=============================================================================== 00046084 <_API_Mutex_Unlock>: #include void _API_Mutex_Unlock( API_Mutex_Control *the_mutex ) { 46084: 4e56 0000 linkw %fp,#0 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 46088: 2039 0005 c5bc movel 5c5bc <_Thread_Dispatch_disable_level>,%d0 4608e: 5280 addql #1,%d0 46090: 206e 0008 moveal %fp@(8),%a0 46094: 23c0 0005 c5bc movel %d0,5c5bc <_Thread_Dispatch_disable_level> _Thread_Disable_dispatch(); _CORE_mutex_Surrender( 4609a: 42a7 clrl %sp@- 4609c: 2f28 0008 movel %a0@(8),%sp@- 460a0: 4868 0010 pea %a0@(16) 460a4: 4eb9 0004 6308 jsr 46308 <_CORE_mutex_Surrender> &the_mutex->Mutex, the_mutex->Object.id, NULL ); _Thread_Enable_dispatch(); 460aa: 4fef 000c lea %sp@(12),%sp } 460ae: 4e5e unlk %fp _CORE_mutex_Surrender( &the_mutex->Mutex, the_mutex->Object.id, NULL ); _Thread_Enable_dispatch(); 460b0: 4ef9 0004 7612 jmp 47612 <_Thread_Enable_dispatch> ... =============================================================================== 0004c594 <_CORE_barrier_Wait>: Thread_Control *executing; ISR_Level level; executing = _Thread_Executing; executing->Wait.return_code = CORE_BARRIER_STATUS_SUCCESSFUL; _ISR_Disable( level ); 4c594: 203c 0000 0700 movel #1792,%d0 Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_barrier_API_mp_support_callout api_barrier_mp_support ) { 4c59a: 4e56 fff4 linkw %fp,#-12 Thread_Control *executing; ISR_Level level; executing = _Thread_Executing; 4c59e: 2279 0005 dcf8 moveal 5dcf8 <_Per_CPU_Information+0xc>,%a1 Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_barrier_API_mp_support_callout api_barrier_mp_support ) { 4c5a4: 48d7 001c moveml %d2-%d4,%sp@ 4c5a8: 206e 0008 moveal %fp@(8),%a0 Thread_Control *executing; ISR_Level level; executing = _Thread_Executing; executing->Wait.return_code = CORE_BARRIER_STATUS_SUCCESSFUL; 4c5ac: 42a9 0034 clrl %a1@(52) Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_barrier_API_mp_support_callout api_barrier_mp_support ) { 4c5b0: 242e 000c movel %fp@(12),%d2 4c5b4: 262e 0014 movel %fp@(20),%d3 4c5b8: 282e 0018 movel %fp@(24),%d4 Thread_Control *executing; ISR_Level level; executing = _Thread_Executing; executing->Wait.return_code = CORE_BARRIER_STATUS_SUCCESSFUL; _ISR_Disable( level ); 4c5bc: 40c1 movew %sr,%d1 4c5be: 8081 orl %d1,%d0 4c5c0: 46c0 movew %d0,%sr the_barrier->number_of_waiting_threads++; 4c5c2: 2028 0048 movel %a0@(72),%d0 4c5c6: 5280 addql #1,%d0 4c5c8: 2140 0048 movel %d0,%a0@(72) if ( _CORE_barrier_Is_automatic( &the_barrier->Attributes ) ) { 4c5cc: 4aa8 0040 tstl %a0@(64) 4c5d0: 6626 bnes 4c5f8 <_CORE_barrier_Wait+0x64> if ( the_barrier->number_of_waiting_threads == 4c5d2: b0a8 0044 cmpl %a0@(68),%d0 4c5d6: 6620 bnes 4c5f8 <_CORE_barrier_Wait+0x64> the_barrier->Attributes.maximum_count) { executing->Wait.return_code = CORE_BARRIER_STATUS_AUTOMATICALLY_RELEASED; 4c5d8: 7001 moveq #1,%d0 4c5da: 2340 0034 movel %d0,%a1@(52) _ISR_Enable( level ); 4c5de: 46c1 movew %d1,%sr _CORE_barrier_Release( the_barrier, id, api_barrier_mp_support ); 4c5e0: 2d44 0010 movel %d4,%fp@(16) 4c5e4: 2d42 000c movel %d2,%fp@(12) executing->Wait.queue = &the_barrier->Wait_queue; executing->Wait.id = id; _ISR_Enable( level ); _Thread_queue_Enqueue( &the_barrier->Wait_queue, timeout ); } 4c5e8: 4cd7 001c moveml %sp@,%d2-%d4 if ( _CORE_barrier_Is_automatic( &the_barrier->Attributes ) ) { if ( the_barrier->number_of_waiting_threads == the_barrier->Attributes.maximum_count) { executing->Wait.return_code = CORE_BARRIER_STATUS_AUTOMATICALLY_RELEASED; _ISR_Enable( level ); _CORE_barrier_Release( the_barrier, id, api_barrier_mp_support ); 4c5ec: 2d48 0008 movel %a0,%fp@(8) executing->Wait.queue = &the_barrier->Wait_queue; executing->Wait.id = id; _ISR_Enable( level ); _Thread_queue_Enqueue( &the_barrier->Wait_queue, timeout ); } 4c5f0: 4e5e unlk %fp if ( _CORE_barrier_Is_automatic( &the_barrier->Attributes ) ) { if ( the_barrier->number_of_waiting_threads == the_barrier->Attributes.maximum_count) { executing->Wait.return_code = CORE_BARRIER_STATUS_AUTOMATICALLY_RELEASED; _ISR_Enable( level ); _CORE_barrier_Release( the_barrier, id, api_barrier_mp_support ); 4c5f2: 4ef9 0004 c560 jmp 4c560 <_CORE_barrier_Release> 4c5f8: 7001 moveq #1,%d0 4c5fa: 2140 0030 movel %d0,%a0@(48) return; } } _Thread_queue_Enter_critical_section( &the_barrier->Wait_queue ); executing->Wait.queue = &the_barrier->Wait_queue; 4c5fe: 2348 0044 movel %a0,%a1@(68) executing->Wait.id = id; 4c602: 2342 0020 movel %d2,%a1@(32) _ISR_Enable( level ); 4c606: 46c1 movew %d1,%sr _Thread_queue_Enqueue( &the_barrier->Wait_queue, timeout ); 4c608: 2d43 000c movel %d3,%fp@(12) 4c60c: 203c 0004 90a0 movel #299168,%d0 4c612: 2d48 0008 movel %a0,%fp@(8) } 4c616: 4cd7 001c moveml %sp@,%d2-%d4 _Thread_queue_Enter_critical_section( &the_barrier->Wait_queue ); executing->Wait.queue = &the_barrier->Wait_queue; executing->Wait.id = id; _ISR_Enable( level ); _Thread_queue_Enqueue( &the_barrier->Wait_queue, timeout ); 4c61a: 2d40 0010 movel %d0,%fp@(16) } 4c61e: 4e5e unlk %fp _Thread_queue_Enter_critical_section( &the_barrier->Wait_queue ); executing->Wait.queue = &the_barrier->Wait_queue; executing->Wait.id = id; _ISR_Enable( level ); _Thread_queue_Enqueue( &the_barrier->Wait_queue, timeout ); 4c620: 4ef9 0004 8d90 jmp 48d90 <_Thread_queue_Enqueue_with_handler> ... =============================================================================== 00052cdc <_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 ) { 52cdc: 4e56 ffe0 linkw %fp,#-32 52ce0: 48d7 3c3c moveml %d2-%d5/%a2-%a5,%sp@ 52ce4: 246e 0008 moveal %fp@(8),%a2 52ce8: 2a2e 000c movel %fp@(12),%d5 52cec: 262e 0010 movel %fp@(16),%d3 52cf0: 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 ) { 52cf4: b6aa 004c cmpl %a2@(76),%d3 52cf8: 6244 bhis 52d3e <_CORE_message_queue_Broadcast+0x62><== NEVER TAKEN * NOTE: This check is critical because threads can block on * send and receive and this ensures that we are broadcasting * the message to threads waiting to receive -- not to send. */ if ( the_message_queue->number_of_pending_messages != 0 ) { 52cfa: 4aaa 0048 tstl %a2@(72) 52cfe: 6610 bnes 52d10 <_CORE_message_queue_Broadcast+0x34> 52d00: 4282 clrl %d2 /* * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = 52d02: 283c 0005 5044 movel #348228,%d4 const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 52d08: 4bf9 0005 9b4c lea 59b4c ,%a5 52d0e: 601a bras 52d2a <_CORE_message_queue_Broadcast+0x4e> * 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; 52d10: 4294 clrl %a4@ 52d12: 6026 bras 52d3a <_CORE_message_queue_Broadcast+0x5e> 52d14: 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; 52d16: 5282 addql #1,%d2 52d18: 2f05 movel %d5,%sp@- 52d1a: 2f2b 002c movel %a3@(44),%sp@- 52d1e: 4e95 jsr %a5@ buffer, waitp->return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; 52d20: 206b 0028 moveal %a3@(40),%a0 52d24: 4fef 000c lea %sp@(12),%sp 52d28: 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 = 52d2a: 2f0a movel %a2,%sp@- 52d2c: 2044 moveal %d4,%a0 52d2e: 4e90 jsr %a0@ 52d30: 588f addql #4,%sp 52d32: 2640 moveal %d0,%a3 52d34: 4a80 tstl %d0 52d36: 66dc bnes 52d14 <_CORE_message_queue_Broadcast+0x38> if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_message_queue_mp_support) ( the_thread, id ); #endif } *count = number_broadcasted; 52d38: 2882 movel %d2,%a4@ return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; 52d3a: 4280 clrl %d0 52d3c: 6002 bras 52d40 <_CORE_message_queue_Broadcast+0x64> Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; if ( size > the_message_queue->maximum_message_size ) { return CORE_MESSAGE_QUEUE_STATUS_INVALID_SIZE; 52d3e: 7001 moveq #1,%d0 <== NOT EXECUTED #endif } *count = number_broadcasted; return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; } 52d40: 4cee 3c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a5 52d46: 4e5e unlk %fp ... =============================================================================== 0004df50 <_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)) { 4df50: 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 ) { 4df52: 4e56 fff4 linkw %fp,#-12 4df56: 222e 0014 movel %fp@(20),%d1 4df5a: 48d7 040c moveml %d2-%d3/%a2,%sp@ 4df5e: 246e 0008 moveal %fp@(8),%a2 4df62: 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)) { 4df66: c081 andl %d1,%d0 ) { size_t message_buffering_required; size_t allocated_message_size; the_message_queue->maximum_pending_messages = maximum_pending_messages; 4df68: 2542 0044 movel %d2,%a2@(68) the_message_queue->number_of_pending_messages = 0; 4df6c: 42aa 0048 clrl %a2@(72) the_message_queue->maximum_message_size = maximum_message_size; 4df70: 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)) { 4df74: 4a80 tstl %d0 4df76: 670e beqs 4df86 <_CORE_message_queue_Initialize+0x36> allocated_message_size += sizeof(uint32_t); 4df78: 2001 movel %d1,%d0 4df7a: 5880 addql #4,%d0 allocated_message_size &= ~(sizeof(uint32_t) - 1); 4df7c: 76fc moveq #-4,%d3 4df7e: c083 andl %d3,%d0 } if (allocated_message_size < maximum_message_size) 4df80: b280 cmpl %d0,%d1 4df82: 6272 bhis 4dff6 <_CORE_message_queue_Initialize+0xa6><== NEVER TAKEN 4df84: 6002 bras 4df88 <_CORE_message_queue_Initialize+0x38> /* * 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)) { 4df86: 2001 movel %d1,%d0 /* * 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)); 4df88: 2600 movel %d0,%d3 4df8a: 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 * 4df90: 2203 movel %d3,%d1 4df92: 4c02 1800 mulsl %d2,%d1 (allocated_message_size + sizeof(CORE_message_queue_Buffer_control)); if (message_buffering_required < allocated_message_size) 4df96: b081 cmpl %d1,%d0 4df98: 625c bhis 4dff6 <_CORE_message_queue_Initialize+0xa6><== NEVER TAKEN /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) _Workspace_Allocate( message_buffering_required ); 4df9a: 2f01 movel %d1,%sp@- 4df9c: 4eb9 0005 086c jsr 5086c <_Workspace_Allocate> if (the_message_queue->message_buffers == 0) 4dfa2: 588f addql #4,%sp return false; /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) 4dfa4: 2540 005c movel %d0,%a2@(92) _Workspace_Allocate( message_buffering_required ); if (the_message_queue->message_buffers == 0) 4dfa8: 674c beqs 4dff6 <_CORE_message_queue_Initialize+0xa6> /* * Initialize the pool of inactive messages, pending messages, * and set of waiting threads. */ _Chain_Initialize ( 4dfaa: 2f03 movel %d3,%sp@- 4dfac: 2f02 movel %d2,%sp@- 4dfae: 2f00 movel %d0,%sp@- 4dfb0: 486a 0060 pea %a2@(96) 4dfb4: 4eb9 0005 21cc jsr 521cc <_Chain_Initialize> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4dfba: 41ea 0054 lea %a2@(84),%a0 allocated_message_size + sizeof( CORE_message_queue_Buffer_control ) ); _Chain_Initialize_empty( &the_message_queue->Pending_messages ); _Thread_queue_Initialize( 4dfbe: 7001 moveq #1,%d0 4dfc0: 2548 0050 movel %a0,%a2@(80) the_message_queue->message_buffers, (size_t) maximum_pending_messages, allocated_message_size + sizeof( CORE_message_queue_Buffer_control ) ); _Chain_Initialize_empty( &the_message_queue->Pending_messages ); 4dfc4: 41ea 0050 lea %a2@(80),%a0 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 4dfc8: 42aa 0054 clrl %a2@(84) 4dfcc: 2548 0058 movel %a0,%a2@(88) _Thread_queue_Initialize( 4dfd0: 4878 0006 pea 6 4dfd4: 206e 000c moveal %fp@(12),%a0 4dfd8: 4878 0080 pea 80 4dfdc: b090 cmpl %a0@,%d0 4dfde: 57c0 seq %d0 4dfe0: 49c0 extbl %d0 4dfe2: 4480 negl %d0 4dfe4: 2f00 movel %d0,%sp@- 4dfe6: 2f0a movel %a2,%sp@- 4dfe8: 4eb9 0004 fd74 jsr 4fd74 <_Thread_queue_Initialize> THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; 4dfee: 4fef 0020 lea %sp@(32),%sp 4dff2: 7001 moveq #1,%d0 4dff4: 6002 bras 4dff8 <_CORE_message_queue_Initialize+0xa8> */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) _Workspace_Allocate( message_buffering_required ); if (the_message_queue->message_buffers == 0) return false; 4dff6: 4200 clrb %d0 STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; } 4dff8: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 4dffe: 4e5e unlk %fp ... =============================================================================== 0004e004 <_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 ); 4e004: 223c 0000 0700 movel #1792,%d1 void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 4e00a: 4e56 ffe0 linkw %fp,#-32 ISR_Level level; CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; 4e00e: 2079 0006 52a8 moveal 652a8 <_Per_CPU_Information+0xc>,%a0 void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 4e014: 48d7 3c3c moveml %d2-%d5/%a2-%a5,%sp@ 4e018: 246e 0008 moveal %fp@(8),%a2 4e01c: 282e 000c movel %fp@(12),%d4 4e020: 242e 0010 movel %fp@(16),%d2 4e024: 226e 0014 moveal %fp@(20),%a1 4e028: 262e 001c movel %fp@(28),%d3 4e02c: 1a2e 001b moveb %fp@(27),%d5 ISR_Level level; CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; 4e030: 42a8 0034 clrl %a0@(52) _ISR_Disable( level ); 4e034: 40c0 movew %sr,%d0 4e036: 8280 orl %d0,%d1 4e038: 46c1 movew %d1,%sr */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4e03a: 220a movel %a2,%d1 4e03c: 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)); 4e042: 266a 0050 moveal %a2@(80),%a3 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 4e046: b28b cmpl %a3,%d1 4e048: 6752 beqs 4e09c <_CORE_message_queue_Seize+0x98> { Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; 4e04a: 2853 moveal %a3@,%a4 CORE_message_queue_Buffer_control *_CORE_message_queue_Get_pending_message ( CORE_message_queue_Control *the_message_queue ) { return (CORE_message_queue_Buffer_control *) _Chain_Get_unprotected( &the_message_queue->Pending_messages ); 4e04c: 4bea 0050 lea %a2@(80),%a5 the_chain->first = new_first; 4e050: 254c 0050 movel %a4,%a2@(80) 4e054: 294d 0004 movel %a5,%a4@(4) the_message = _CORE_message_queue_Get_pending_message( the_message_queue ); if ( the_message != NULL ) { 4e058: 4a8b tstl %a3 4e05a: 6740 beqs 4e09c <_CORE_message_queue_Seize+0x98> <== NEVER TAKEN the_message_queue->number_of_pending_messages -= 1; 4e05c: 53aa 0048 subql #1,%a2@(72) _ISR_Enable( level ); 4e060: 46c0 movew %d0,%sr *size_p = the_message->Contents.size; 4e062: 22ab 0008 movel %a3@(8),%a1@ _Thread_Executing->Wait.count = 4e066: 2079 0006 52a8 moveal 652a8 <_Per_CPU_Information+0xc>,%a0 4e06c: 42a8 0024 clrl %a0@(36) const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 4e070: 2f11 movel %a1@,%sp@- 4e072: 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 ); 4e076: 45ea 0060 lea %a2@(96),%a2 const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 4e07a: 2f02 movel %d2,%sp@- 4e07c: 4eb9 0005 46b8 jsr 546b8 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 ); 4e082: 4fef 000c lea %sp@(12),%sp 4e086: 2d4b 000c movel %a3,%fp@(12) 4e08a: 2d4a 0008 movel %a2,%fp@(8) executing->Wait.return_argument = size_p; /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); } 4e08e: 4cee 3c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a5 4e094: 4e5e unlk %fp 4e096: 4ef9 0004 de8c jmp 4de8c <_Chain_Append> return; } #endif } if ( !wait ) { 4e09c: 4a05 tstb %d5 4e09e: 6612 bnes 4e0b2 <_CORE_message_queue_Seize+0xae> _ISR_Enable( level ); 4e0a0: 46c0 movew %d0,%sr executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT; 4e0a2: 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 ); } 4e0a4: 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; 4e0aa: 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 ); } 4e0ae: 4e5e unlk %fp 4e0b0: 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; 4e0b2: 7201 moveq #1,%d1 4e0b4: 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; 4e0b8: 2142 002c movel %d2,%a0@(44) executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT; return; } _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue ); executing->Wait.queue = &the_message_queue->Wait_queue; 4e0bc: 214a 0044 movel %a2,%a0@(68) executing->Wait.id = id; 4e0c0: 2144 0020 movel %d4,%a0@(32) executing->Wait.return_argument_second.mutable_object = buffer; executing->Wait.return_argument = size_p; 4e0c4: 2149 0028 movel %a1,%a0@(40) /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); 4e0c8: 46c0 movew %d0,%sr _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); 4e0ca: 4bf9 0004 fe44 lea 4fe44 <_Thread_queue_Timeout>,%a5 4e0d0: 2d43 000c movel %d3,%fp@(12) 4e0d4: 2d4d 0010 movel %a5,%fp@(16) 4e0d8: 2d4a 0008 movel %a2,%fp@(8) } 4e0dc: 4cee 3c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a5 4e0e2: 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 ); 4e0e4: 4ef9 0004 fb34 jmp 4fb34 <_Thread_queue_Enqueue_with_handler> ... =============================================================================== 00046264 <_CORE_mutex_Seize>: Objects_Id _id, bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { 46264: 4e56 0000 linkw %fp,#0 _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); 46268: 2039 0005 c5bc movel 5c5bc <_Thread_Dispatch_disable_level>,%d0 Objects_Id _id, bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { 4626e: 2f0a movel %a2,%sp@- 46270: 246e 0008 moveal %fp@(8),%a2 46274: 2f02 movel %d2,%sp@- 46276: 142e 0013 moveb %fp@(19),%d2 _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); 4627a: 4a80 tstl %d0 4627c: 671c beqs 4629a <_CORE_mutex_Seize+0x36> 4627e: 4a02 tstb %d2 46280: 6718 beqs 4629a <_CORE_mutex_Seize+0x36> <== NEVER TAKEN 46282: 7001 moveq #1,%d0 46284: b0b9 0005 c728 cmpl 5c728 <_System_state_Current>,%d0 4628a: 640e bccs 4629a <_CORE_mutex_Seize+0x36> 4628c: 4878 0012 pea 12 46290: 42a7 clrl %sp@- 46292: 42a7 clrl %sp@- 46294: 4eb9 0004 68cc jsr 468cc <_Internal_error_Occurred> 4629a: 486e 0018 pea %fp@(24) 4629e: 2f0a movel %a2,%sp@- 462a0: 4eb9 0004 a130 jsr 4a130 <_CORE_mutex_Seize_interrupt_trylock> 462a6: 508f addql #8,%sp 462a8: 4a80 tstl %d0 462aa: 6750 beqs 462fc <_CORE_mutex_Seize+0x98> 462ac: 4a02 tstb %d2 462ae: 6614 bnes 462c4 <_CORE_mutex_Seize+0x60> 462b0: 202e 0018 movel %fp@(24),%d0 462b4: 46c0 movew %d0,%sr 462b6: 2079 0005 c780 moveal 5c780 <_Per_CPU_Information+0xc>,%a0 462bc: 7001 moveq #1,%d0 462be: 2140 0034 movel %d0,%a0@(52) 462c2: 6038 bras 462fc <_CORE_mutex_Seize+0x98> 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; 462c4: 7001 moveq #1,%d0 462c6: 2079 0005 c780 moveal 5c780 <_Per_CPU_Information+0xc>,%a0 462cc: 2540 0030 movel %d0,%a2@(48) 462d0: 2039 0005 c5bc movel 5c5bc <_Thread_Dispatch_disable_level>,%d0 462d6: 5280 addql #1,%d0 462d8: 216e 000c 0020 movel %fp@(12),%a0@(32) 462de: 214a 0044 movel %a2,%a0@(68) 462e2: 23c0 0005 c5bc movel %d0,5c5bc <_Thread_Dispatch_disable_level> 462e8: 202e 0018 movel %fp@(24),%d0 462ec: 46c0 movew %d0,%sr 462ee: 2f2e 0014 movel %fp@(20),%sp@- 462f2: 2f0a movel %a2,%sp@- 462f4: 4eb9 0004 6200 jsr 46200 <_CORE_mutex_Seize_interrupt_blocking> 462fa: 508f addql #8,%sp } 462fc: 242e fff8 movel %fp@(-8),%d2 46300: 246e fffc moveal %fp@(-4),%a2 46304: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004a130 <_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 ) { 4a130: 4e56 fff4 linkw %fp,#-12 { Thread_Control *executing; /* disabled when you get here */ executing = _Thread_Executing; 4a134: 2279 0005 c780 moveal 5c780 <_Per_CPU_Information+0xc>,%a1 4a13a: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 4a13e: 206e 0008 moveal %fp@(8),%a0 4a142: 246e 000c moveal %fp@(12),%a2 executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; 4a146: 42a9 0034 clrl %a1@(52) if ( !_CORE_mutex_Is_locked( the_mutex ) ) { 4a14a: 4aa8 004e tstl %a0@(78) 4a14e: 6700 009e beqw 4a1ee <_CORE_mutex_Seize_interrupt_trylock+0xbe> the_mutex->lock = CORE_MUTEX_LOCKED; the_mutex->holder = executing; the_mutex->holder_id = executing->Object.id; the_mutex->nest_count = 1; 4a152: 7001 moveq #1,%d0 if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || 4a154: 7202 moveq #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; the_mutex->holder_id = executing->Object.id; 4a156: 2169 0008 005e movel %a1@(8),%a0@(94) the_mutex->nest_count = 1; 4a15c: 2140 0052 movel %d0,%a0@(82) return _CORE_mutex_Seize_interrupt_trylock_body( the_mutex, level_p ); } 4a160: 2028 0046 movel %a0@(70),%d0 /* disabled when you get here */ executing = _Thread_Executing; executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; if ( !_CORE_mutex_Is_locked( the_mutex ) ) { the_mutex->lock = CORE_MUTEX_LOCKED; 4a164: 42a8 004e clrl %a0@(78) the_mutex->holder = executing; 4a168: 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 ) || 4a16c: b280 cmpl %d0,%d1 4a16e: 6706 beqs 4a176 <_CORE_mutex_Seize_interrupt_trylock+0x46> 4a170: 7403 moveq #3,%d2 4a172: b480 cmpl %d0,%d2 4a174: 6612 bnes 4a188 <_CORE_mutex_Seize_interrupt_trylock+0x58> _Chain_Prepend_unprotected( &executing->lock_mutex, &the_mutex->queue.lock_queue ); the_mutex->queue.priority_before = executing->current_priority; #endif executing->resource_count++; 4a176: 2229 001c movel %a1@(28),%d1 4a17a: 2401 movel %d1,%d2 4a17c: 5282 addql #1,%d2 4a17e: 2342 001c movel %d2,%a1@(28) } if ( !_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) { 4a182: 7403 moveq #3,%d2 4a184: b480 cmpl %d0,%d2 4a186: 6708 beqs 4a190 <_CORE_mutex_Seize_interrupt_trylock+0x60> _ISR_Enable( *level_p ); 4a188: 2012 movel %a2@,%d0 4a18a: 46c0 movew %d0,%sr 4a18c: 6000 008a braw 4a218 <_CORE_mutex_Seize_interrupt_trylock+0xe8> */ { Priority_Control ceiling; Priority_Control current; ceiling = the_mutex->Attributes.priority_ceiling; 4a190: 2028 004a movel %a0@(74),%d0 current = executing->current_priority; 4a194: 2669 0014 moveal %a1@(20),%a3 if ( current == ceiling ) { 4a198: b08b cmpl %a3,%d0 4a19a: 6606 bnes 4a1a2 <_CORE_mutex_Seize_interrupt_trylock+0x72> _ISR_Enable( *level_p ); 4a19c: 2012 movel %a2@,%d0 4a19e: 46c0 movew %d0,%sr 4a1a0: 6076 bras 4a218 <_CORE_mutex_Seize_interrupt_trylock+0xe8> return 0; } if ( current > ceiling ) { 4a1a2: b08b cmpl %a3,%d0 4a1a4: 642e bccs 4a1d4 <_CORE_mutex_Seize_interrupt_trylock+0xa4> rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 4a1a6: 2039 0005 c5bc movel 5c5bc <_Thread_Dispatch_disable_level>,%d0 4a1ac: 5280 addql #1,%d0 4a1ae: 23c0 0005 c5bc movel %d0,5c5bc <_Thread_Dispatch_disable_level> _Thread_Disable_dispatch(); _ISR_Enable( *level_p ); 4a1b4: 2012 movel %a2@,%d0 4a1b6: 46c0 movew %d0,%sr _Thread_Change_priority( 4a1b8: 42a7 clrl %sp@- 4a1ba: 2f28 004a movel %a0@(74),%sp@- 4a1be: 2f28 005a movel %a0@(90),%sp@- 4a1c2: 4eb9 0004 712c jsr 4712c <_Thread_Change_priority> the_mutex->holder, the_mutex->Attributes.priority_ceiling, false ); _Thread_Enable_dispatch(); 4a1c8: 4eb9 0004 7612 jsr 47612 <_Thread_Enable_dispatch> 4a1ce: 4fef 000c lea %sp@(12),%sp 4a1d2: 6044 bras 4a218 <_CORE_mutex_Seize_interrupt_trylock+0xe8> return 0; } /* if ( current < ceiling ) */ { executing->Wait.return_code = CORE_MUTEX_STATUS_CEILING_VIOLATED; 4a1d4: 7006 moveq #6,%d0 the_mutex->lock = CORE_MUTEX_UNLOCKED; 4a1d6: 7401 moveq #1,%d2 ); _Thread_Enable_dispatch(); return 0; } /* if ( current < ceiling ) */ { executing->Wait.return_code = CORE_MUTEX_STATUS_CEILING_VIOLATED; 4a1d8: 2340 0034 movel %d0,%a1@(52) the_mutex->lock = CORE_MUTEX_UNLOCKED; 4a1dc: 2142 004e movel %d2,%a0@(78) the_mutex->nest_count = 0; /* undo locking above */ 4a1e0: 42a8 0052 clrl %a0@(82) executing->resource_count--; /* undo locking above */ 4a1e4: 2341 001c movel %d1,%a1@(28) _ISR_Enable( *level_p ); 4a1e8: 2012 movel %a2@,%d0 4a1ea: 46c0 movew %d0,%sr 4a1ec: 602a bras 4a218 <_CORE_mutex_Seize_interrupt_trylock+0xe8> /* * 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 ) ) { 4a1ee: 2668 005a moveal %a0@(90),%a3 4a1f2: b3cb cmpal %a3,%a1 4a1f4: 6626 bnes 4a21c <_CORE_mutex_Seize_interrupt_trylock+0xec> switch ( the_mutex->Attributes.lock_nesting_behavior ) { 4a1f6: 2028 0040 movel %a0@(64),%d0 4a1fa: 6708 beqs 4a204 <_CORE_mutex_Seize_interrupt_trylock+0xd4> 4a1fc: 7201 moveq #1,%d1 4a1fe: b280 cmpl %d0,%d1 4a200: 661a bnes 4a21c <_CORE_mutex_Seize_interrupt_trylock+0xec><== ALWAYS TAKEN 4a202: 600a bras 4a20e <_CORE_mutex_Seize_interrupt_trylock+0xde><== NOT EXECUTED case CORE_MUTEX_NESTING_ACQUIRES: the_mutex->nest_count++; 4a204: 52a8 0052 addql #1,%a0@(82) _ISR_Enable( *level_p ); 4a208: 2012 movel %a2@,%d0 4a20a: 46c0 movew %d0,%sr 4a20c: 600a bras 4a218 <_CORE_mutex_Seize_interrupt_trylock+0xe8> return 0; case CORE_MUTEX_NESTING_IS_ERROR: executing->Wait.return_code = CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED; 4a20e: 7402 moveq #2,%d2 <== NOT EXECUTED 4a210: 2742 0034 movel %d2,%a3@(52) <== NOT EXECUTED _ISR_Enable( *level_p ); 4a214: 2012 movel %a2@,%d0 <== NOT EXECUTED 4a216: 46c0 movew %d0,%sr <== NOT EXECUTED return 0; 4a218: 4280 clrl %d0 4a21a: 6002 bras 4a21e <_CORE_mutex_Seize_interrupt_trylock+0xee> /* * The mutex is not available and the caller must deal with the possibility * of blocking. */ return 1; 4a21c: 7001 moveq #1,%d0 4a21e: 4cee 0c04 fff4 moveml %fp@(-12),%d2/%a2-%a3 4a224: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00046440 <_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 ) { 46440: 4e56 0000 linkw %fp,#0 46444: 2f0a movel %a2,%sp@- 46446: 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)) ) { 4644a: 2f0a movel %a2,%sp@- 4644c: 4eb9 0004 7930 jsr 47930 <_Thread_queue_Dequeue> 46452: 588f addql #4,%sp 46454: 4a80 tstl %d0 46456: 6624 bnes 4647c <_CORE_semaphore_Surrender+0x3c> if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_semaphore_mp_support) ( the_thread, id ); #endif } else { _ISR_Disable( level ); 46458: 303c 0700 movew #1792,%d0 4645c: 40c1 movew %sr,%d1 4645e: 8081 orl %d1,%d0 46460: 46c0 movew %d0,%sr if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 46462: 202a 0048 movel %a2@(72),%d0 46466: b0aa 0040 cmpl %a2@(64),%d0 4646a: 640a bccs 46476 <_CORE_semaphore_Surrender+0x36> <== NEVER TAKEN the_semaphore->count += 1; 4646c: 5280 addql #1,%d0 4646e: 2540 0048 movel %d0,%a2@(72) { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 46472: 4280 clrl %d0 46474: 6002 bras 46478 <_CORE_semaphore_Surrender+0x38> } else { _ISR_Disable( level ); if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) the_semaphore->count += 1; else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; 46476: 7004 moveq #4,%d0 <== NOT EXECUTED _ISR_Enable( level ); 46478: 46c1 movew %d1,%sr 4647a: 6002 bras 4647e <_CORE_semaphore_Surrender+0x3e> { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 4647c: 4280 clrl %d0 status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); } return status; } 4647e: 246e fffc moveal %fp@(-4),%a2 46482: 4e5e unlk %fp ... =============================================================================== 0004521c <_Event_Seize>: executing = _Thread_Executing; executing->Wait.return_code = RTEMS_SUCCESSFUL; api = executing->API_Extensions[ THREAD_API_RTEMS ]; _ISR_Disable( level ); 4521c: 203c 0000 0700 movel #1792,%d0 rtems_event_set event_in, rtems_option option_set, rtems_interval ticks, rtems_event_set *event_out ) { 45222: 4e56 ffec linkw %fp,#-20 45226: 226e 0010 moveal %fp@(16),%a1 4522a: 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; 4522e: 2479 0005 c780 moveal 5c780 <_Per_CPU_Information+0xc>,%a2 rtems_event_set event_in, rtems_option option_set, rtems_interval ticks, rtems_event_set *event_out ) { 45234: 242e 0008 movel %fp@(8),%d2 45238: 262e 000c movel %fp@(12),%d3 4523c: 206e 0014 moveal %fp@(20),%a0 ISR_Level level; RTEMS_API_Control *api; Thread_blocking_operation_States sync_state; executing = _Thread_Executing; executing->Wait.return_code = RTEMS_SUCCESSFUL; 45240: 42aa 0034 clrl %a2@(52) api = executing->API_Extensions[ THREAD_API_RTEMS ]; 45244: 266a 0108 moveal %a2@(264),%a3 _ISR_Disable( level ); 45248: 40c1 movew %sr,%d1 4524a: 8081 orl %d1,%d0 4524c: 46c0 movew %d0,%sr pending_events = api->pending_events; 4524e: 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 ); 45250: 2002 movel %d2,%d0 45252: c084 andl %d4,%d0 seized_events = _Event_sets_Get( pending_events, event_in ); if ( !_Event_sets_Is_empty( seized_events ) && 45254: 6716 beqs 4526c <_Event_Seize+0x50> 45256: b480 cmpl %d0,%d2 45258: 6706 beqs 45260 <_Event_Seize+0x44> (seized_events == event_in || _Options_Is_any( option_set )) ) { 4525a: 0803 0001 btst #1,%d3 4525e: 670c beqs 4526c <_Event_Seize+0x50> <== NEVER TAKEN RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Clear( rtems_event_set the_event_set, rtems_event_set the_mask ) { return ( the_event_set & ~(the_mask) ); 45260: 2400 movel %d0,%d2 45262: 4682 notl %d2 45264: c484 andl %d4,%d2 45266: 2682 movel %d2,%a3@ api->pending_events = _Event_sets_Clear( pending_events, seized_events ); _ISR_Enable( level ); 45268: 46c1 movew %d1,%sr 4526a: 600e bras 4527a <_Event_Seize+0x5e> *event_out = seized_events; return; } if ( _Options_Is_no_wait( option_set ) ) { 4526c: 0803 0000 btst #0,%d3 45270: 670e beqs 45280 <_Event_Seize+0x64> _ISR_Enable( level ); 45272: 46c1 movew %d1,%sr executing->Wait.return_code = RTEMS_UNSATISFIED; 45274: 720d moveq #13,%d1 45276: 2541 0034 movel %d1,%a2@(52) *event_out = seized_events; 4527a: 2080 movel %d0,%a0@ return; 4527c: 6000 0096 braw 45314 <_Event_Seize+0xf8> * * 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; 45280: 2542 0024 movel %d2,%a2@(36) executing->Wait.return_argument = event_out; _Event_Sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 45284: 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; 45286: 2543 0030 movel %d3,%a2@(48) executing->Wait.count = (uint32_t) event_in; executing->Wait.return_argument = event_out; 4528a: 2548 0028 movel %a0,%a2@(40) _Event_Sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 4528e: 23c2 0005 c78e movel %d2,5c78e <_Event_Sync_state> _ISR_Enable( level ); 45294: 46c1 movew %d1,%sr if ( ticks ) { 45296: 4a89 tstl %a1 45298: 6730 beqs 452ca <_Event_Seize+0xae> _Watchdog_Initialize( 4529a: 202a 0008 movel %a2@(8),%d0 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 4529e: 223c 0004 5478 movel #283768,%d1 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 452a4: 42aa 0050 clrl %a2@(80) the_watchdog->routine = routine; 452a8: 2541 0064 movel %d1,%a2@(100) the_watchdog->id = id; 452ac: 2540 0068 movel %d0,%a2@(104) the_watchdog->user_data = user_data; 452b0: 42aa 006c clrl %a2@(108) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 452b4: 2549 0054 movel %a1,%a2@(84) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 452b8: 486a 0048 pea %a2@(72) 452bc: 4879 0005 c67e pea 5c67e <_Watchdog_Ticks_chain> 452c2: 4eb9 0004 8530 jsr 48530 <_Watchdog_Insert> 452c8: 508f addql #8,%sp NULL ); _Watchdog_Insert_ticks( &executing->Timer, ticks ); } _Thread_Set_state( executing, STATES_WAITING_FOR_EVENT ); 452ca: 4878 0100 pea 100 452ce: 2f0a movel %a2,%sp@- 452d0: 4eb9 0004 7e24 jsr 47e24 <_Thread_Set_state> _ISR_Disable( level ); 452d6: 203c 0000 0700 movel #1792,%d0 452dc: 40c1 movew %sr,%d1 452de: 8081 orl %d1,%d0 452e0: 46c0 movew %d0,%sr sync_state = _Event_Sync_state; _Event_Sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) { 452e2: 7401 moveq #1,%d2 452e4: 508f addql #8,%sp _Thread_Set_state( executing, STATES_WAITING_FOR_EVENT ); _ISR_Disable( level ); sync_state = _Event_Sync_state; 452e6: 2039 0005 c78e movel 5c78e <_Event_Sync_state>,%d0 _Event_Sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 452ec: 42b9 0005 c78e clrl 5c78e <_Event_Sync_state> if ( sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) { 452f2: b480 cmpl %d0,%d2 452f4: 6604 bnes 452fa <_Event_Seize+0xde> _ISR_Enable( level ); 452f6: 46c1 movew %d1,%sr 452f8: 601a bras 45314 <_Event_Seize+0xf8> * 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 ); 452fa: 2d4a 000c movel %a2,%fp@(12) 452fe: 2d41 0010 movel %d1,%fp@(16) } 45302: 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 ); 45308: 2d40 0008 movel %d0,%fp@(8) } 4530c: 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 ); 4530e: 4ef9 0004 70dc jmp 470dc <_Thread_blocking_operation_Cancel> } 45314: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 4531a: 4e5e unlk %fp ... =============================================================================== 00045374 <_Event_Surrender>: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; option_set = (rtems_option) the_thread->Wait.option; _ISR_Disable( level ); 45374: 203c 0000 0700 movel #1792,%d0 */ void _Event_Surrender( Thread_Control *the_thread ) { 4537a: 4e56 ffe8 linkw %fp,#-24 4537e: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@ 45382: 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 ]; 45386: 206a 0108 moveal %a2@(264),%a0 option_set = (rtems_option) the_thread->Wait.option; 4538a: 282a 0030 movel %a2@(48),%d4 _ISR_Disable( level ); 4538e: 40c1 movew %sr,%d1 45390: 8081 orl %d1,%d0 45392: 46c0 movew %d0,%sr pending_events = api->pending_events; event_condition = (rtems_event_set) the_thread->Wait.count; 45394: 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 ); 45398: 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; 4539a: 2410 movel %a0@,%d2 4539c: 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 ) ) { 4539e: 6606 bnes 453a6 <_Event_Surrender+0x32> _ISR_Enable( level ); 453a0: 46c1 movew %d1,%sr return; 453a2: 6000 00ca braw 4546e <_Event_Surrender+0xfa> /* * 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() && 453a6: 4ab9 0005 c77c tstl 5c77c <_Per_CPU_Information+0x8> 453ac: 674a beqs 453f8 <_Event_Surrender+0x84> 453ae: b5f9 0005 c780 cmpal 5c780 <_Per_CPU_Information+0xc>,%a2 453b4: 6642 bnes 453f8 <_Event_Surrender+0x84> _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 453b6: 2279 0005 c78e moveal 5c78e <_Event_Sync_state>,%a1 /* * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) && 453bc: 7a02 moveq #2,%d5 453be: ba89 cmpl %a1,%d5 453c0: 670e beqs 453d0 <_Event_Surrender+0x5c> <== NEVER TAKEN ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { 453c2: 2279 0005 c78e moveal 5c78e <_Event_Sync_state>,%a1 * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 453c8: 1a3c 0001 moveb #1,%d5 453cc: ba89 cmpl %a1,%d5 453ce: 6628 bnes 453f8 <_Event_Surrender+0x84> (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { 453d0: b680 cmpl %d0,%d3 453d2: 6706 beqs 453da <_Event_Surrender+0x66> 453d4: 0804 0001 btst #1,%d4 453d8: 671a beqs 453f4 <_Event_Surrender+0x80> <== NEVER TAKEN RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Clear( rtems_event_set the_event_set, rtems_event_set the_mask ) { return ( the_event_set & ~(the_mask) ); 453da: 2600 movel %d0,%d3 453dc: 4683 notl %d3 453de: c682 andl %d2,%d3 453e0: 2083 movel %d3,%a0@ api->pending_events = _Event_sets_Clear( pending_events,seized_events ); the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 453e2: 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; 453e6: 42aa 0024 clrl %a2@(36) *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 453ea: 2080 movel %d0,%a0@ _Event_Sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 453ec: 7003 moveq #3,%d0 453ee: 23c0 0005 c78e movel %d0,5c78e <_Event_Sync_state> } _ISR_Enable( level ); 453f4: 46c1 movew %d1,%sr return; 453f6: 6076 bras 4546e <_Event_Surrender+0xfa> */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_for_event ( States_Control the_states ) { return (the_states & STATES_WAITING_FOR_EVENT); 453f8: 2a2a 0010 movel %a2@(16),%d5 453fc: 0285 0000 0100 andil #256,%d5 } /* * Otherwise, this is a normal send to another thread */ if ( _States_Is_waiting_for_event( the_thread->current_state ) ) { 45402: 6768 beqs 4546c <_Event_Surrender+0xf8> if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { 45404: b680 cmpl %d0,%d3 45406: 6706 beqs 4540e <_Event_Surrender+0x9a> 45408: 0804 0001 btst #1,%d4 4540c: 675e beqs 4546c <_Event_Surrender+0xf8> <== NEVER TAKEN 4540e: 2600 movel %d0,%d3 45410: 4683 notl %d3 45412: c682 andl %d2,%d3 45414: 2083 movel %d3,%a0@ api->pending_events = _Event_sets_Clear( pending_events, seized_events ); the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 45416: 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; 4541a: 42aa 0024 clrl %a2@(36) *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 4541e: 2080 movel %d0,%a0@ _ISR_Flash( level ); 45420: 203c 0000 0700 movel #1792,%d0 45426: 46c1 movew %d1,%sr 45428: 8081 orl %d1,%d0 4542a: 46c0 movew %d0,%sr 4542c: 47f9 0004 726c lea 4726c <_Thread_Clear_state>,%a3 if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 45432: 7a02 moveq #2,%d5 45434: baaa 0050 cmpl %a2@(80),%d5 45438: 6710 beqs 4544a <_Event_Surrender+0xd6> _ISR_Enable( level ); 4543a: 46c1 movew %d1,%sr RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 4543c: 2f3c 1003 fff8 movel #268697592,%sp@- 45442: 2f0a movel %a2,%sp@- 45444: 4e93 jsr %a3@ 45446: 508f addql #8,%sp 45448: 6024 bras 4546e <_Event_Surrender+0xfa> RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 4544a: 7003 moveq #3,%d0 4544c: 2540 0050 movel %d0,%a2@(80) _Thread_Unblock( the_thread ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 45450: 46c1 movew %d1,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 45452: 486a 0048 pea %a2@(72) 45456: 4eb9 0004 864c jsr 4864c <_Watchdog_Remove> 4545c: 2f3c 1003 fff8 movel #268697592,%sp@- 45462: 2f0a movel %a2,%sp@- 45464: 4e93 jsr %a3@ 45466: 4fef 000c lea %sp@(12),%sp 4546a: 6002 bras 4546e <_Event_Surrender+0xfa> _Thread_Unblock( the_thread ); } return; } } _ISR_Enable( level ); 4546c: 46c1 movew %d1,%sr } 4546e: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 45474: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00045478 <_Event_Timeout>: void _Event_Timeout( Objects_Id id, void *ignored ) { 45478: 4e56 fffc linkw %fp,#-4 4547c: 2f03 movel %d3,%sp@- 4547e: 2f02 movel %d2,%sp@- Thread_Control *the_thread; Objects_Locations location; ISR_Level level; the_thread = _Thread_Get( id, &location ); 45480: 486e fffc pea %fp@(-4) 45484: 2f2e 0008 movel %fp@(8),%sp@- 45488: 4eb9 0004 7638 jsr 47638 <_Thread_Get> switch ( location ) { 4548e: 508f addql #8,%sp 45490: 4aae fffc tstl %fp@(-4) 45494: 6656 bnes 454ec <_Event_Timeout+0x74> <== NEVER TAKEN * * If it is not satisfied, then it is "nothing happened" and * this is the "timeout" transition. After a request is satisfied, * a timeout is not allowed to occur. */ _ISR_Disable( level ); 45496: 223c 0000 0700 movel #1792,%d1 4549c: 40c2 movew %sr,%d2 4549e: 8282 orl %d2,%d1 454a0: 46c1 movew %d1,%sr _ISR_Enable( level ); return; } #endif the_thread->Wait.count = 0; 454a2: 2040 moveal %d0,%a0 454a4: 42a8 0024 clrl %a0@(36) if ( _Thread_Is_executing( the_thread ) ) { 454a8: b0b9 0005 c780 cmpl 5c780 <_Per_CPU_Information+0xc>,%d0 454ae: 6614 bnes 454c4 <_Event_Timeout+0x4c> if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 454b0: 2239 0005 c78e movel 5c78e <_Event_Sync_state>,%d1 454b6: 7601 moveq #1,%d3 454b8: b681 cmpl %d1,%d3 454ba: 6608 bnes 454c4 <_Event_Timeout+0x4c> _Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 454bc: 7202 moveq #2,%d1 454be: 23c1 0005 c78e movel %d1,5c78e <_Event_Sync_state> } the_thread->Wait.return_code = RTEMS_TIMEOUT; 454c4: 7606 moveq #6,%d3 454c6: 2040 moveal %d0,%a0 454c8: 2143 0034 movel %d3,%a0@(52) _ISR_Enable( level ); 454cc: 46c2 movew %d2,%sr 454ce: 2f3c 1003 fff8 movel #268697592,%sp@- 454d4: 2f00 movel %d0,%sp@- 454d6: 4eb9 0004 726c jsr 4726c <_Thread_Clear_state> _Thread_Unblock( the_thread ); _Thread_Unnest_dispatch(); break; 454dc: 508f addql #8,%sp */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 454de: 2039 0005 c5bc movel 5c5bc <_Thread_Dispatch_disable_level>,%d0 454e4: 5380 subql #1,%d0 454e6: 23c0 0005 c5bc movel %d0,5c5bc <_Thread_Dispatch_disable_level> case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 454ec: 242e fff4 movel %fp@(-12),%d2 454f0: 262e fff8 movel %fp@(-8),%d3 454f4: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004a294 <_Heap_Allocate_aligned_with_boundary>: Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 4a294: 4e56 ffbc linkw %fp,#-68 4a298: 202e 000c movel %fp@(12),%d0 4a29c: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 4a2a0: 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 4a2a4: 2e00 movel %d0,%d7 4a2a6: 5887 addql #4,%d7 Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 4a2a8: 222e 0010 movel %fp@(16),%d1 4a2ac: 2a2e 0014 movel %fp@(20),%d5 if ( stats->max_search < search_count ) { stats->max_search = search_count; } return (void *) alloc_begin; } 4a2b0: 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; 4a2b4: 2c2a 0010 movel %a2@(16),%d6 uintptr_t alloc_begin = 0; uint32_t search_count = 0; if ( block_size_floor < alloc_size ) { 4a2b8: b087 cmpl %d7,%d0 4a2ba: 6200 013e bhiw 4a3fa <_Heap_Allocate_aligned_with_boundary+0x166> /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { 4a2be: 4a85 tstl %d5 4a2c0: 670c beqs 4a2ce <_Heap_Allocate_aligned_with_boundary+0x3a> if ( boundary < alloc_size ) { 4a2c2: b085 cmpl %d5,%d0 4a2c4: 6200 0134 bhiw 4a3fa <_Heap_Allocate_aligned_with_boundary+0x166> return NULL; } if ( alignment == 0 ) { 4a2c8: 4a81 tstl %d1 4a2ca: 6602 bnes 4a2ce <_Heap_Allocate_aligned_with_boundary+0x3a> alignment = page_size; 4a2cc: 2206 movel %d6,%d1 uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size 4a2ce: 2406 movel %d6,%d2 + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; 4a2d0: 7804 moveq #4,%d4 uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size 4a2d2: 5e82 addql #7,%d2 + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; 4a2d4: 9880 subl %d0,%d4 if ( boundary < alloc_size ) { return NULL; } if ( alignment == 0 ) { alignment = page_size; 4a2d6: 4283 clrl %d3 uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size 4a2d8: 2d42 fff8 movel %d2,%fp@(-8) + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; 4a2dc: 2d44 fff4 movel %d4,%fp@(-12) 4a2e0: 2d47 ffe4 movel %d7,%fp@(-28) 4a2e4: 2d46 ffec movel %d6,%fp@(-20) 4a2e8: 6000 00fa braw 4a3e4 <_Heap_Allocate_aligned_with_boundary+0x150> /* * 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 ) { 4a2ec: 2428 0004 movel %a0@(4),%d2 while ( block != free_list_tail ) { _HAssert( _Heap_Is_prev_used( block ) ); /* Statistics */ ++search_count; 4a2f0: 5283 addql #1,%d3 /* * The HEAP_PREV_BLOCK_USED flag is always set in the block size_and_flag * field. Thus the value is about one unit larger than the real block * size. The greater than operator takes this into account. */ if ( block->size_and_flag > block_size_floor ) { 4a2f2: b4ae ffe4 cmpl %fp@(-28),%d2 4a2f6: 6300 00e8 blsw 4a3e0 <_Heap_Allocate_aligned_with_boundary+0x14c> 4a2fa: 43e8 0008 lea %a0@(8),%a1 if ( alignment == 0 ) { 4a2fe: 4a81 tstl %d1 4a300: 6606 bnes 4a308 <_Heap_Allocate_aligned_with_boundary+0x74> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 4a302: 2409 movel %a1,%d2 4a304: 6000 00b6 braw 4a3bc <_Heap_Allocate_aligned_with_boundary+0x128> - 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; 4a308: 7cfe moveq #-2,%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; 4a30a: 266a 0014 moveal %a2@(20),%a3 4a30e: c486 andl %d6,%d2 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; 4a310: 282e fff8 movel %fp@(-8),%d4 4a314: 988b subl %a3,%d4 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; 4a316: d488 addl %a0,%d2 uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size 4a318: 2c04 movel %d4,%d6 4a31a: dc82 addl %d2,%d6 + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; 4a31c: d4ae fff4 addl %fp@(-12),%d2 4a320: 2d42 fffc movel %d2,%fp@(-4) RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4a324: 4c41 2007 remul %d1,%d7,%d2 4a328: 242e fffc movel %fp@(-4),%d2 4a32c: 9487 subl %d7,%d2 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 ) { 4a32e: bc82 cmpl %d2,%d6 4a330: 640a bccs 4a33c <_Heap_Allocate_aligned_with_boundary+0xa8> 4a332: 2806 movel %d6,%d4 4a334: 4c41 4002 remul %d1,%d2,%d4 4a338: 9c82 subl %d2,%d6 4a33a: 2406 movel %d6,%d2 } alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { 4a33c: 4a85 tstl %d5 4a33e: 675c beqs 4a39c <_Heap_Allocate_aligned_with_boundary+0x108> /* 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; 4a340: 2c02 movel %d2,%d6 4a342: dc80 addl %d0,%d6 /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; 4a344: 49f1 0800 lea %a1@(00000000,%d0:l),%a4 /* 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; 4a348: 2d46 fff0 movel %d6,%fp@(-16) 4a34c: 2a6e fff0 moveal %fp@(-16),%a5 4a350: 4c45 6004 remul %d5,%d4,%d6 /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; 4a354: 2d4c fffc movel %a4,%fp@(-4) 4a358: 2e2e ffe4 movel %fp@(-28),%d7 4a35c: 9bc4 subal %d4,%a5 4a35e: 284d moveal %a5,%a4 4a360: 2d43 ffe8 movel %d3,%fp@(-24) 4a364: 282e fff0 movel %fp@(-16),%d4 4a368: 6022 bras 4a38c <_Heap_Allocate_aligned_with_boundary+0xf8> uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { if ( boundary_line < boundary_floor ) { 4a36a: b9ee fffc cmpal %fp@(-4),%a4 4a36e: 6568 bcss 4a3d8 <_Heap_Allocate_aligned_with_boundary+0x144> return 0; } alloc_begin = boundary_line - alloc_size; 4a370: 240c movel %a4,%d2 4a372: 9480 subl %d0,%d2 4a374: 2802 movel %d2,%d4 4a376: 4c41 4003 remul %d1,%d3,%d4 4a37a: 9483 subl %d3,%d2 alloc_begin = _Heap_Align_down( alloc_begin, alignment ); alloc_end = alloc_begin + alloc_size; 4a37c: 2802 movel %d2,%d4 4a37e: d880 addl %d0,%d4 4a380: 2c04 movel %d4,%d6 4a382: 2a44 moveal %d4,%a5 4a384: 4c45 6003 remul %d5,%d3,%d6 4a388: 9bc3 subal %d3,%a5 4a38a: 284d moveal %a5,%a4 /* 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 ) { 4a38c: b9c2 cmpal %d2,%a4 4a38e: 6304 blss 4a394 <_Heap_Allocate_aligned_with_boundary+0x100> 4a390: b88c cmpl %a4,%d4 4a392: 62d6 bhis 4a36a <_Heap_Allocate_aligned_with_boundary+0xd6> 4a394: 262e ffe8 movel %fp@(-24),%d3 4a398: 2d47 ffe4 movel %d7,%fp@(-28) 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 ) { 4a39c: b3c2 cmpal %d2,%a1 4a39e: 6240 bhis 4a3e0 <_Heap_Allocate_aligned_with_boundary+0x14c> 4a3a0: 2c2e ffec movel %fp@(-20),%d6 4a3a4: 2802 movel %d2,%d4 4a3a6: 327c fff8 moveaw #-8,%a1 4a3aa: 93c8 subal %a0,%a1 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 4a3ac: d3c2 addal %d2,%a1 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4a3ae: 4c46 4007 remul %d6,%d7,%d4 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; 4a3b2: 93c7 subal %d7,%a1 if ( free_size >= min_block_size || free_size == 0 ) { 4a3b4: b7c9 cmpal %a1,%a3 4a3b6: 6304 blss 4a3bc <_Heap_Allocate_aligned_with_boundary+0x128> 4a3b8: 4a89 tstl %a1 4a3ba: 6624 bnes 4a3e0 <_Heap_Allocate_aligned_with_boundary+0x14c> boundary ); } } if ( alloc_begin != 0 ) { 4a3bc: 4a82 tstl %d2 4a3be: 6720 beqs 4a3e0 <_Heap_Allocate_aligned_with_boundary+0x14c><== NEVER TAKEN block = block->next; } if ( alloc_begin != 0 ) { /* Statistics */ stats->searches += search_count; 4a3c0: d7aa 004c addl %d3,%a2@(76) block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 4a3c4: 2f00 movel %d0,%sp@- 4a3c6: 2f02 movel %d2,%sp@- 4a3c8: 2f08 movel %a0,%sp@- 4a3ca: 2f0a movel %a2,%sp@- 4a3cc: 4eb9 0004 67d8 jsr 467d8 <_Heap_Block_allocate> 4a3d2: 4fef 0010 lea %sp@(16),%sp 4a3d6: 6014 bras 4a3ec <_Heap_Allocate_aligned_with_boundary+0x158> 4a3d8: 262e ffe8 movel %fp@(-24),%d3 4a3dc: 2d47 ffe4 movel %d7,%fp@(-28) if ( alloc_begin != 0 ) { break; } block = block->next; 4a3e0: 2068 0008 moveal %a0@(8),%a0 if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { 4a3e4: b5c8 cmpal %a0,%a2 4a3e6: 6600 ff04 bnew 4a2ec <_Heap_Allocate_aligned_with_boundary+0x58> 4a3ea: 4282 clrl %d2 boundary ); } /* Statistics */ if ( stats->max_search < search_count ) { 4a3ec: b6aa 0044 cmpl %a2@(68),%d3 4a3f0: 6304 blss 4a3f6 <_Heap_Allocate_aligned_with_boundary+0x162> stats->max_search = search_count; 4a3f2: 2543 0044 movel %d3,%a2@(68) } return (void *) alloc_begin; 4a3f6: 2002 movel %d2,%d0 4a3f8: 6002 bras 4a3fc <_Heap_Allocate_aligned_with_boundary+0x168> return NULL; } if ( boundary != 0 ) { if ( boundary < alloc_size ) { return NULL; 4a3fa: 4280 clrl %d0 if ( stats->max_search < search_count ) { stats->max_search = search_count; } return (void *) alloc_begin; } 4a3fc: 4cee 3cfc ffbc moveml %fp@(-68),%d2-%d7/%a2-%a5 4a402: 4e5e unlk %fp ... =============================================================================== 0004a6ec <_Heap_Extend>: Heap_Control *heap, void *extend_area_begin_ptr, uintptr_t extend_area_size, uintptr_t *extended_size_ptr ) { 4a6ec: 4e56 ffcc linkw %fp,#-52 4a6f0: 202e 0010 movel %fp@(16),%d0 4a6f4: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 4a6f8: 246e 0008 moveal %fp@(8),%a2 4a6fc: 262e 000c movel %fp@(12),%d3 Heap_Block *extend_first_block = NULL; Heap_Block *extend_last_block = NULL; uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; uintptr_t const extend_area_begin = (uintptr_t) extend_area_begin_ptr; uintptr_t const extend_area_end = extend_area_begin + extend_area_size; 4a700: 2403 movel %d3,%d2 4a702: d480 addl %d0,%d2 uintptr_t const free_size = stats->free_size; 4a704: 206a 0030 moveal %a2@(48),%a0 uintptr_t extend_area_size, uintptr_t *extended_size_ptr ) { Heap_Statistics *const stats = &heap->stats; Heap_Block *const first_block = heap->first_block; 4a708: 282a 0020 movel %a2@(32),%d4 Heap_Block *merge_above_block = NULL; Heap_Block *link_below_block = NULL; Heap_Block *link_above_block = NULL; Heap_Block *extend_first_block = NULL; Heap_Block *extend_last_block = NULL; uintptr_t const page_size = heap->page_size; 4a70c: 2a2a 0010 movel %a2@(16),%d5 uintptr_t const min_block_size = heap->min_block_size; 4a710: 222a 0014 movel %a2@(20),%d1 Heap_Block *start_block = first_block; Heap_Block *merge_below_block = NULL; Heap_Block *merge_above_block = NULL; Heap_Block *link_below_block = NULL; Heap_Block *link_above_block = NULL; Heap_Block *extend_first_block = NULL; 4a714: 42ae fffc clrl %fp@(-4) Heap_Block *extend_last_block = NULL; 4a718: 42ae fff8 clrl %fp@(-8) uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; uintptr_t const extend_area_begin = (uintptr_t) extend_area_begin_ptr; uintptr_t const extend_area_end = extend_area_begin + extend_area_size; uintptr_t const free_size = stats->free_size; 4a71c: 2d48 fff4 movel %a0,%fp@(-12) uintptr_t extend_first_block_size = 0; uintptr_t extended_size = 0; bool extend_area_ok = false; if ( extend_area_end < extend_area_begin ) { 4a720: b682 cmpl %d2,%d3 4a722: 6200 01aa bhiw 4a8ce <_Heap_Extend+0x1e2> return false; } extend_area_ok = _Heap_Get_first_and_last_block( 4a726: 486e fff8 pea %fp@(-8) 4a72a: 486e fffc pea %fp@(-4) 4a72e: 2f01 movel %d1,%sp@- 4a730: 2f05 movel %d5,%sp@- 4a732: 2f00 movel %d0,%sp@- 4a734: 2f03 movel %d3,%sp@- 4a736: 4eb9 0004 6898 jsr 46898 <_Heap_Get_first_and_last_block> page_size, min_block_size, &extend_first_block, &extend_last_block ); if (!extend_area_ok ) { 4a73c: 4fef 0018 lea %sp@(24),%sp 4a740: 4a00 tstb %d0 4a742: 6700 018a beqw 4a8ce <_Heap_Extend+0x1e2> 4a746: 2044 moveal %d4,%a0 4a748: 9bcd subal %a5,%a5 4a74a: 4281 clrl %d1 4a74c: 97cb subal %a3,%a3 4a74e: 99cc subal %a4,%a4 return false; } do { uintptr_t const sub_area_begin = (start_block != first_block) ? (uintptr_t) start_block : heap->area_begin; 4a750: b888 cmpl %a0,%d4 4a752: 6704 beqs 4a758 <_Heap_Extend+0x6c> 4a754: 2248 moveal %a0,%a1 4a756: 6004 bras 4a75c <_Heap_Extend+0x70> 4a758: 226a 0018 moveal %a2@(24),%a1 uintptr_t const sub_area_end = start_block->prev_size; 4a75c: 2010 movel %a0@,%d0 Heap_Block *const end_block = _Heap_Block_of_alloc_area( sub_area_end, page_size ); if ( 4a75e: b680 cmpl %d0,%d3 4a760: 6406 bccs 4a768 <_Heap_Extend+0x7c> sub_area_end > extend_area_begin && extend_area_end > sub_area_begin 4a762: b3c2 cmpal %d2,%a1 4a764: 6500 0168 bcsw 4a8ce <_Heap_Extend+0x1e2> ) { return false; } if ( extend_area_end == sub_area_begin ) { 4a768: b3c2 cmpal %d2,%a1 4a76a: 6706 beqs 4a772 <_Heap_Extend+0x86> merge_below_block = start_block; } else if ( extend_area_end < sub_area_end ) { 4a76c: b082 cmpl %d2,%d0 4a76e: 6206 bhis 4a776 <_Heap_Extend+0x8a> 4a770: 6006 bras 4a778 <_Heap_Extend+0x8c> sub_area_end > extend_area_begin && extend_area_end > sub_area_begin ) { return false; } if ( extend_area_end == sub_area_begin ) { 4a772: 2848 moveal %a0,%a4 4a774: 6002 bras 4a778 <_Heap_Extend+0x8c> merge_below_block = start_block; } else if ( extend_area_end < sub_area_end ) { 4a776: 2208 movel %a0,%d1 4a778: 2e00 movel %d0,%d7 4a77a: 2240 moveal %d0,%a1 4a77c: 5189 subql #8,%a1 4a77e: 4c45 7006 remul %d5,%d6,%d7 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 4a782: 93c6 subal %d6,%a1 link_below_block = start_block; } if ( sub_area_end == extend_area_begin ) { 4a784: b680 cmpl %d0,%d3 4a786: 6606 bnes 4a78e <_Heap_Extend+0xa2> start_block->prev_size = extend_area_end; 4a788: 2082 movel %d2,%a0@ RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_of_alloc_area( uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) 4a78a: 2649 moveal %a1,%a3 4a78c: 6006 bras 4a794 <_Heap_Extend+0xa8> merge_above_block = end_block; } else if ( sub_area_end < extend_area_begin ) { 4a78e: b680 cmpl %d0,%d3 4a790: 6302 blss 4a794 <_Heap_Extend+0xa8> 4a792: 2a49 moveal %a1,%a5 - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 4a794: 70fe moveq #-2,%d0 4a796: c0a9 0004 andl %a1@(4),%d0 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4a79a: 41f1 0800 lea %a1@(00000000,%d0:l),%a0 link_above_block = end_block; } start_block = _Heap_Block_at( end_block, _Heap_Block_size( end_block ) ); } while ( start_block != first_block ); 4a79e: b888 cmpl %a0,%d4 4a7a0: 66ae bnes 4a750 <_Heap_Extend+0x64> <== NEVER TAKEN if ( extend_area_begin < heap->area_begin ) { 4a7a2: b6aa 0018 cmpl %a2@(24),%d3 4a7a6: 6406 bccs 4a7ae <_Heap_Extend+0xc2> heap->area_begin = extend_area_begin; 4a7a8: 2543 0018 movel %d3,%a2@(24) 4a7ac: 600a bras 4a7b8 <_Heap_Extend+0xcc> } else if ( heap->area_end < extend_area_end ) { 4a7ae: b4aa 001c cmpl %a2@(28),%d2 4a7b2: 6304 blss 4a7b8 <_Heap_Extend+0xcc> heap->area_end = extend_area_end; 4a7b4: 2542 001c movel %d2,%a2@(28) } extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; 4a7b8: 206e fff8 moveal %fp@(-8),%a0 heap->area_begin = extend_area_begin; } else if ( heap->area_end < extend_area_end ) { heap->area_end = extend_area_end; } extend_first_block_size = 4a7bc: 2008 movel %a0,%d0 (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; extend_first_block->prev_size = extend_area_end; extend_first_block->size_and_flag = extend_first_block_size | HEAP_PREV_BLOCK_USED; 4a7be: 7801 moveq #1,%d4 } else if ( heap->area_end < extend_area_end ) { heap->area_end = extend_area_end; } extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; 4a7c0: 226e fffc moveal %fp@(-4),%a1 heap->area_begin = extend_area_begin; } else if ( heap->area_end < extend_area_end ) { heap->area_end = extend_area_end; } extend_first_block_size = 4a7c4: 9089 subl %a1,%d0 (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; extend_first_block->prev_size = extend_area_end; extend_first_block->size_and_flag = extend_first_block_size | HEAP_PREV_BLOCK_USED; 4a7c6: 8880 orl %d0,%d4 } extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; extend_first_block->prev_size = extend_area_end; 4a7c8: 2282 movel %d2,%a1@ extend_first_block->size_and_flag = extend_first_block_size | HEAP_PREV_BLOCK_USED; 4a7ca: 2344 0004 movel %d4,%a1@(4) extend_last_block->prev_size = extend_first_block_size; 4a7ce: 2080 movel %d0,%a0@ extend_last_block->size_and_flag = 0; 4a7d0: 42a8 0004 clrl %a0@(4) if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) { 4a7d4: b3ea 0020 cmpal %a2@(32),%a1 4a7d8: 6406 bccs 4a7e0 <_Heap_Extend+0xf4> heap->first_block = extend_first_block; 4a7da: 2549 0020 movel %a1,%a2@(32) 4a7de: 600a bras 4a7ea <_Heap_Extend+0xfe> } else if ( (uintptr_t) extend_last_block > (uintptr_t) heap->last_block ) { 4a7e0: b1ea 0024 cmpal %a2@(36),%a0 4a7e4: 6304 blss 4a7ea <_Heap_Extend+0xfe> heap->last_block = extend_last_block; 4a7e6: 2548 0024 movel %a0,%a2@(36) } if ( merge_below_block != NULL ) { 4a7ea: 4a8c tstl %a4 4a7ec: 6732 beqs 4a820 <_Heap_Extend+0x134> Heap_Control *heap, uintptr_t extend_area_begin, Heap_Block *first_block ) { uintptr_t const page_size = heap->page_size; 4a7ee: 202a 0010 movel %a2@(16),%d0 uintptr_t const new_first_block_alloc_begin = _Heap_Align_up( extend_area_begin + HEAP_BLOCK_HEADER_SIZE, page_size ); 4a7f2: 5083 addql #8,%d3 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up( uintptr_t value, uintptr_t alignment ) { uintptr_t remainder = value % alignment; 4a7f4: 2803 movel %d3,%d4 4a7f6: 4c40 4001 remul %d0,%d1,%d4 if ( remainder != 0 ) { 4a7fa: 4a81 tstl %d1 4a7fc: 6704 beqs 4a802 <_Heap_Extend+0x116> <== ALWAYS TAKEN return value - remainder + alignment; 4a7fe: d680 addl %d0,%d3 <== NOT EXECUTED 4a800: 9681 subl %d1,%d3 <== NOT EXECUTED uintptr_t const new_first_block_begin = 4a802: 2043 moveal %d3,%a0 4a804: 5188 subql #8,%a0 new_first_block_alloc_begin - HEAP_BLOCK_HEADER_SIZE; uintptr_t const first_block_begin = (uintptr_t) first_block; uintptr_t const new_first_block_size = 4a806: 200c movel %a4,%d0 4a808: 9088 subl %a0,%d0 first_block_begin - new_first_block_begin; Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin; new_first_block->prev_size = first_block->prev_size; new_first_block->size_and_flag = new_first_block_size | HEAP_PREV_BLOCK_USED; 4a80a: 7201 moveq #1,%d1 4a80c: 8280 orl %d0,%d1 uintptr_t const first_block_begin = (uintptr_t) first_block; uintptr_t const new_first_block_size = first_block_begin - new_first_block_begin; Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin; new_first_block->prev_size = first_block->prev_size; 4a80e: 2094 movel %a4@,%a0@ new_first_block->size_and_flag = new_first_block_size | HEAP_PREV_BLOCK_USED; 4a810: 2141 0004 movel %d1,%a0@(4) _Heap_Free_block( heap, new_first_block ); 4a814: 2f08 movel %a0,%sp@- 4a816: 2f0a movel %a2,%sp@- 4a818: 4eba feb6 jsr %pc@(4a6d0 <_Heap_Free_block>) 4a81c: 508f addql #8,%sp 4a81e: 6012 bras 4a832 <_Heap_Extend+0x146> heap->last_block = extend_last_block; } if ( merge_below_block != NULL ) { _Heap_Merge_below( heap, extend_area_begin, merge_below_block ); } else if ( link_below_block != NULL ) { 4a820: 4a81 tstl %d1 4a822: 670e beqs 4a832 <_Heap_Extend+0x146> _Heap_Link_below( 4a824: 206e fff8 moveal %fp@(-8),%a0 { uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const link_begin = (uintptr_t) link; last_block->size_and_flag = (link_begin - last_block_begin) | HEAP_PREV_BLOCK_USED; 4a828: 7801 moveq #1,%d4 4a82a: 9288 subl %a0,%d1 4a82c: 8881 orl %d1,%d4 4a82e: 2144 0004 movel %d4,%a0@(4) link_below_block, extend_last_block ); } if ( merge_above_block != NULL ) { 4a832: 4a8b tstl %a3 4a834: 6734 beqs 4a86a <_Heap_Extend+0x17e> ) { uintptr_t const page_size = heap->page_size; uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const last_block_new_size = _Heap_Align_down( extend_area_end - last_block_begin - HEAP_BLOCK_HEADER_SIZE, 4a836: 5182 subql #8,%d2 uintptr_t extend_area_end ) { uintptr_t const page_size = heap->page_size; uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const last_block_new_size = _Heap_Align_down( 4a838: 948b subl %a3,%d2 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4a83a: 2202 movel %d2,%d1 4a83c: 4c6a 1000 0010 remul %a2@(16),%d0,%d1 Heap_Block *const new_last_block = _Heap_Block_at( last_block, last_block_new_size ); new_last_block->size_and_flag = (last_block->size_and_flag - last_block_new_size) | HEAP_PREV_BLOCK_USED; 4a842: 7201 moveq #1,%d1 4a844: 9480 subl %d0,%d2 ); Heap_Block *const new_last_block = _Heap_Block_at( last_block, last_block_new_size ); new_last_block->size_and_flag = (last_block->size_and_flag - last_block_new_size) 4a846: 202b 0004 movel %a3@(4),%d0 4a84a: 9082 subl %d2,%d0 | HEAP_PREV_BLOCK_USED; 4a84c: 8280 orl %d0,%d1 RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 4a84e: 7001 moveq #1,%d0 4a850: 2781 2804 movel %d1,%a3@(00000004,%d2:l) 4a854: c0ab 0004 andl %a3@(4),%d0 block->size_and_flag = size | flag; 4a858: 8480 orl %d0,%d2 4a85a: 2742 0004 movel %d2,%a3@(4) _Heap_Block_set_size( last_block, last_block_new_size ); _Heap_Free_block( heap, last_block ); 4a85e: 2f0b movel %a3,%sp@- 4a860: 2f0a movel %a2,%sp@- 4a862: 4eba fe6c jsr %pc@(4a6d0 <_Heap_Free_block>) 4a866: 508f addql #8,%sp 4a868: 6020 bras 4a88a <_Heap_Extend+0x19e> ); } if ( merge_above_block != NULL ) { _Heap_Merge_above( heap, merge_above_block, extend_area_end ); } else if ( link_above_block != NULL ) { 4a86a: 4a8d tstl %a5 4a86c: 671c beqs 4a88a <_Heap_Extend+0x19e> RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 4a86e: 7001 moveq #1,%d0 uintptr_t const link_begin = (uintptr_t) link; uintptr_t const first_block_begin = (uintptr_t) first_block; _Heap_Block_set_size( link, first_block_begin - link_begin ); last_block->size_and_flag |= HEAP_PREV_BLOCK_USED; 4a870: 7801 moveq #1,%d4 ) { uintptr_t const link_begin = (uintptr_t) link; uintptr_t const first_block_begin = (uintptr_t) first_block; _Heap_Block_set_size( link, first_block_begin - link_begin ); 4a872: 222e fffc movel %fp@(-4),%d1 4a876: 928d subl %a5,%d1 4a878: c0ad 0004 andl %a5@(4),%d0 } if ( merge_above_block != NULL ) { _Heap_Merge_above( heap, merge_above_block, extend_area_end ); } else if ( link_above_block != NULL ) { _Heap_Link_above( 4a87c: 206e fff8 moveal %fp@(-8),%a0 block->size_and_flag = size | flag; 4a880: 8280 orl %d0,%d1 4a882: 2b41 0004 movel %d1,%a5@(4) uintptr_t const link_begin = (uintptr_t) link; uintptr_t const first_block_begin = (uintptr_t) first_block; _Heap_Block_set_size( link, first_block_begin - link_begin ); last_block->size_and_flag |= HEAP_PREV_BLOCK_USED; 4a886: 89a8 0004 orl %d4,%a0@(4) extend_first_block, extend_last_block ); } if ( merge_below_block == NULL && merge_above_block == NULL ) { 4a88a: 4a8c tstl %a4 4a88c: 6610 bnes 4a89e <_Heap_Extend+0x1b2> 4a88e: 4a8b tstl %a3 4a890: 660c bnes 4a89e <_Heap_Extend+0x1b2> _Heap_Free_block( heap, extend_first_block ); 4a892: 2f2e fffc movel %fp@(-4),%sp@- 4a896: 2f0a movel %a2,%sp@- 4a898: 4eba fe36 jsr %pc@(4a6d0 <_Heap_Free_block>) 4a89c: 508f addql #8,%sp */ RTEMS_INLINE_ROUTINE void _Heap_Set_last_block_size( Heap_Control *heap ) { _Heap_Block_set_size( heap->last_block, (uintptr_t) heap->first_block - (uintptr_t) heap->last_block 4a89e: 206a 0024 moveal %a2@(36),%a0 RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 4a8a2: 7001 moveq #1,%d0 * This feature will be used to terminate the scattered heap area list. See * also _Heap_Extend(). */ RTEMS_INLINE_ROUTINE void _Heap_Set_last_block_size( Heap_Control *heap ) { _Heap_Block_set_size( 4a8a4: 222a 0020 movel %a2@(32),%d1 4a8a8: 9288 subl %a0,%d1 RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 4a8aa: c0a8 0004 andl %a0@(4),%d0 block->size_and_flag = size | flag; 4a8ae: 8280 orl %d0,%d1 } _Heap_Set_last_block_size( heap ); extended_size = stats->free_size - free_size; 4a8b0: 202a 0030 movel %a2@(48),%d0 4a8b4: 90ae fff4 subl %fp@(-12),%d0 4a8b8: 2141 0004 movel %d1,%a0@(4) /* Statistics */ stats->size += extended_size; 4a8bc: d1aa 002c addl %d0,%a2@(44) if ( extended_size_ptr != NULL ) 4a8c0: 4aae 0014 tstl %fp@(20) 4a8c4: 670c beqs 4a8d2 <_Heap_Extend+0x1e6> <== NEVER TAKEN *extended_size_ptr = extended_size; 4a8c6: 206e 0014 moveal %fp@(20),%a0 4a8ca: 2080 movel %d0,%a0@ 4a8cc: 6004 bras 4a8d2 <_Heap_Extend+0x1e6> _Heap_Block_of_alloc_area( sub_area_end, page_size ); if ( sub_area_end > extend_area_begin && extend_area_end > sub_area_begin ) { return false; 4a8ce: 4200 clrb %d0 4a8d0: 6002 bras 4a8d4 <_Heap_Extend+0x1e8> stats->size += extended_size; if ( extended_size_ptr != NULL ) *extended_size_ptr = extended_size; return true; 4a8d2: 7001 moveq #1,%d0 } 4a8d4: 4cee 3cfc ffcc moveml %fp@(-52),%d2-%d7/%a2-%a5 4a8da: 4e5e unlk %fp ... =============================================================================== 0004a408 <_Heap_Free>: #include #include #include bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { 4a408: 4e56 ffe8 linkw %fp,#-24 4a40c: 202e 000c movel %fp@(12),%d0 4a410: 2240 moveal %d0,%a1 4a412: 5189 subql #8,%a1 4a414: 206e 0008 moveal %fp@(8),%a0 4a418: 4c68 0001 0010 remul %a0@(16),%d1,%d0 4a41e: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%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 4a422: 2828 0020 movel %a0@(32),%d4 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 4a426: 93c1 subal %d1,%a1 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 4a428: b889 cmpl %a1,%d4 4a42a: 620c bhis 4a438 <_Heap_Free+0x30> 4a42c: b3e8 0024 cmpal %a0@(36),%a1 4a430: 53c0 sls %d0 4a432: 49c0 extbl %d0 4a434: 4480 negl %d0 4a436: 6002 bras 4a43a <_Heap_Free+0x32> 4a438: 4280 clrl %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 ) ) { 4a43a: 4a00 tstb %d0 4a43c: 6700 012c beqw 4a56a <_Heap_Free+0x162> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 4a440: 2629 0004 movel %a1@(4),%d3 - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 4a444: 70fe moveq #-2,%d0 4a446: 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); 4a448: 45f1 0800 lea %a1@(00000000,%d0:l),%a2 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 4a44c: b88a cmpl %a2,%d4 4a44e: 620c bhis 4a45c <_Heap_Free+0x54> <== NEVER TAKEN 4a450: b5e8 0024 cmpal %a0@(36),%a2 4a454: 53c1 sls %d1 4a456: 49c1 extbl %d1 4a458: 4481 negl %d1 4a45a: 6002 bras 4a45e <_Heap_Free+0x56> 4a45c: 4281 clrl %d1 <== NOT EXECUTED } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 4a45e: 4a01 tstb %d1 4a460: 6700 0108 beqw 4a56a <_Heap_Free+0x162> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 4a464: 242a 0004 movel %a2@(4),%d2 if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { _HAssert( false ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 4a468: 0802 0000 btst #0,%d2 4a46c: 6700 00fc beqw 4a56a <_Heap_Free+0x162> - 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; 4a470: 72fe moveq #-2,%d1 _HAssert( false ); return false; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block 4a472: 2668 0024 moveal %a0@(36),%a3 4a476: c481 andl %d1,%d2 && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); 4a478: b7ca cmpal %a2,%a3 4a47a: 670c beqs 4a488 <_Heap_Free+0x80> 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; 4a47c: 7201 moveq #1,%d1 4a47e: c2b2 2804 andl %a2@(00000004,%d2:l),%d1 #include #include #include bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) 4a482: 5381 subql #1,%d1 4a484: 4481 negl %d1 4a486: 6002 bras 4a48a <_Heap_Free+0x82> 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 )); 4a488: 4281 clrl %d1 _HAssert( false ); return false; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block 4a48a: 1a01 moveb %d1,%d5 && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); if ( !_Heap_Is_prev_used( block ) ) { 4a48c: 0803 0000 btst #0,%d3 4a490: 6662 bnes 4a4f4 <_Heap_Free+0xec> uintptr_t const prev_size = block->prev_size; 4a492: 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); 4a494: 93c3 subal %d3,%a1 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 4a496: b889 cmpl %a1,%d4 4a498: 620a bhis 4a4a4 <_Heap_Free+0x9c> <== NEVER TAKEN 4a49a: b3cb cmpal %a3,%a1 4a49c: 53c1 sls %d1 4a49e: 49c1 extbl %d1 4a4a0: 4481 negl %d1 4a4a2: 6002 bras 4a4a6 <_Heap_Free+0x9e> 4a4a4: 4281 clrl %d1 <== NOT EXECUTED Heap_Block * const prev_block = _Heap_Block_at( block, -prev_size ); if ( !_Heap_Is_block_in_heap( heap, prev_block ) ) { 4a4a6: 4a01 tstb %d1 4a4a8: 6700 00c0 beqw 4a56a <_Heap_Free+0x162> 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; 4a4ac: 7201 moveq #1,%d1 4a4ae: c2a9 0004 andl %a1@(4),%d1 return( false ); } /* As we always coalesce free blocks, the block that preceedes prev_block must have been used. */ if ( !_Heap_Is_prev_used ( prev_block) ) { 4a4b2: 6700 00b6 beqw 4a56a <_Heap_Free+0x162> _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ 4a4b6: 4a05 tstb %d5 4a4b8: 6726 beqs 4a4e0 <_Heap_Free+0xd8> return _Heap_Free_list_tail(heap)->prev; } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; 4a4ba: 266a 0008 moveal %a2@(8),%a3 uintptr_t const size = block_size + prev_size + next_block_size; 4a4be: d480 addl %d0,%d2 4a4c0: d682 addl %d2,%d3 _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4a4c2: 7401 moveq #1,%d2 Heap_Block *prev = block->prev; 4a4c4: 246a 000c moveal %a2@(12),%a2 prev->next = next; 4a4c8: 254b 0008 movel %a3,%a2@(8) 4a4cc: 8483 orl %d3,%d2 next->prev = prev; 4a4ce: 274a 000c movel %a2,%a3@(12) } if ( next_is_free ) { /* coalesce both */ uintptr_t const size = block_size + prev_size + next_block_size; _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 4a4d2: 53a8 0038 subql #1,%a0@(56) prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; 4a4d6: 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; 4a4da: 2342 0004 movel %d2,%a1@(4) 4a4de: 607a bras 4a55a <_Heap_Free+0x152> 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; 4a4e0: d680 addl %d0,%d3 prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4a4e2: 7201 moveq #1,%d1 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4a4e4: 74fe moveq #-2,%d2 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; 4a4e6: 8283 orl %d3,%d1 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = size; 4a4e8: 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; 4a4ea: 2341 0004 movel %d1,%a1@(4) next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4a4ee: c5aa 0004 andl %d2,%a2@(4) 4a4f2: 6066 bras 4a55a <_Heap_Free+0x152> next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ 4a4f4: 4a01 tstb %d1 4a4f6: 672a beqs 4a522 <_Heap_Free+0x11a> RTEMS_INLINE_ROUTINE void _Heap_Free_list_replace( Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; 4a4f8: 266a 0008 moveal %a2@(8),%a3 uintptr_t const size = block_size + next_block_size; 4a4fc: 2202 movel %d2,%d1 4a4fe: d280 addl %d0,%d1 _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4a500: 7401 moveq #1,%d2 Heap_Block *prev = old_block->prev; 4a502: 246a 000c moveal %a2@(12),%a2 new_block->next = next; 4a506: 234b 0008 movel %a3,%a1@(8) 4a50a: 8481 orl %d1,%d2 new_block->prev = prev; 4a50c: 234a 000c movel %a2,%a1@(12) next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; 4a510: 2381 1800 movel %d1,%a1@(00000000,%d1:l) next->prev = new_block; 4a514: 2749 000c movel %a1,%a3@(12) prev->next = new_block; 4a518: 2549 0008 movel %a1,%a2@(8) next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ uintptr_t const size = block_size + next_block_size; _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4a51c: 2342 0004 movel %d2,%a1@(4) 4a520: 6038 bras 4a55a <_Heap_Free+0x152> 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; 4a522: 7201 moveq #1,%d1 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4a524: 74fe moveq #-2,%d2 next_block->prev_size = size; } else { /* no coalesce */ /* Add 'block' to the head of the free blocks list as it tends to produce less fragmentation than adding to the tail. */ _Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block ); block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; 4a526: 8280 orl %d0,%d1 RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after( Heap_Block *block_before, Heap_Block *new_block ) { Heap_Block *next = block_before->next; 4a528: 2668 0008 moveal %a0@(8),%a3 new_block->next = next; new_block->prev = block_before; 4a52c: 2348 000c movel %a0,%a1@(12) 4a530: 2341 0004 movel %d1,%a1@(4) next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; 4a534: 2228 0038 movel %a0@(56),%d1 4a538: 5281 addql #1,%d1 Heap_Block *new_block ) { Heap_Block *next = block_before->next; new_block->next = next; 4a53a: 234b 0008 movel %a3,%a1@(8) } else { /* no coalesce */ /* Add 'block' to the head of the free blocks list as it tends to produce less fragmentation than adding to the tail. */ _Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block ); block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4a53e: c5aa 0004 andl %d2,%a2@(4) new_block->prev = block_before; block_before->next = new_block; next->prev = new_block; 4a542: 2749 000c movel %a1,%a3@(12) next_block->prev_size = block_size; 4a546: 2480 movel %d0,%a2@ { Heap_Block *next = block_before->next; new_block->next = next; new_block->prev = block_before; block_before->next = new_block; 4a548: 2149 0008 movel %a1,%a0@(8) /* Statistics */ ++stats->free_blocks; 4a54c: 2141 0038 movel %d1,%a0@(56) if ( stats->max_free_blocks < stats->free_blocks ) { 4a550: b2a8 003c cmpl %a0@(60),%d1 4a554: 6304 blss 4a55a <_Heap_Free+0x152> stats->max_free_blocks = stats->free_blocks; 4a556: 2141 003c movel %d1,%a0@(60) } /* Statistics */ --stats->used_blocks; ++stats->frees; stats->free_size += block_size; 4a55a: d1a8 0030 addl %d0,%a0@(48) stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 4a55e: 53a8 0040 subql #1,%a0@(64) ++stats->frees; 4a562: 52a8 0050 addql #1,%a0@(80) stats->free_size += block_size; return( true ); 4a566: 7001 moveq #1,%d0 4a568: 6002 bras 4a56c <_Heap_Free+0x164> /* As we always coalesce free blocks, the block that preceedes prev_block must have been used. */ if ( !_Heap_Is_prev_used ( prev_block) ) { _HAssert( false ); return( false ); 4a56a: 4200 clrb %d0 --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 4a56c: 4cd7 0c3c moveml %sp@,%d2-%d5/%a2-%a3 4a570: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0005945c <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { 5945c: 4e56 0000 linkw %fp,#0 59460: 202e 000c movel %fp@(12),%d0 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 59464: 2040 moveal %d0,%a0 59466: 5188 subql #8,%a0 59468: 226e 0008 moveal %fp@(8),%a1 5946c: 2f02 movel %d2,%sp@- 5946e: 2400 movel %d0,%d2 59470: 4c69 2001 0010 remul %a1@(16),%d1,%d2 RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap( const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block 59476: 2429 0020 movel %a1@(32),%d2 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 5947a: 91c1 subal %d1,%a0 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 5947c: b488 cmpl %a0,%d2 5947e: 620c bhis 5948c <_Heap_Size_of_alloc_area+0x30> 59480: b1e9 0024 cmpal %a1@(36),%a0 59484: 53c1 sls %d1 59486: 49c1 extbl %d1 59488: 4481 negl %d1 5948a: 6002 bras 5948e <_Heap_Size_of_alloc_area+0x32> 5948c: 4281 clrl %d1 uintptr_t const alloc_begin = (uintptr_t) alloc_begin_ptr; Heap_Block *block = _Heap_Block_of_alloc_area( alloc_begin, page_size ); Heap_Block *next_block = NULL; uintptr_t block_size = 0; if ( !_Heap_Is_block_in_heap( heap, block ) ) { 5948e: 4a01 tstb %d1 59490: 6738 beqs 594ca <_Heap_Size_of_alloc_area+0x6e> - 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; 59492: 72fe moveq #-2,%d1 59494: c2a8 0004 andl %a0@(4),%d1 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 59498: d1c1 addal %d1,%a0 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 5949a: b488 cmpl %a0,%d2 5949c: 620c bhis 594aa <_Heap_Size_of_alloc_area+0x4e> <== NEVER TAKEN 5949e: b1e9 0024 cmpal %a1@(36),%a0 594a2: 53c1 sls %d1 594a4: 49c1 extbl %d1 594a6: 4481 negl %d1 594a8: 6002 bras 594ac <_Heap_Size_of_alloc_area+0x50> 594aa: 4281 clrl %d1 <== NOT EXECUTED } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( 594ac: 4a01 tstb %d1 594ae: 671a beqs 594ca <_Heap_Size_of_alloc_area+0x6e> <== NEVER TAKEN block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 594b0: 7201 moveq #1,%d1 594b2: c2a8 0004 andl %a0@(4),%d1 !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) 594b6: 6712 beqs 594ca <_Heap_Size_of_alloc_area+0x6e> <== NEVER TAKEN ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_BLOCK_SIZE_OFFSET - alloc_begin; 594b8: 7204 moveq #4,%d1 594ba: 9280 subl %d0,%d1 594bc: 2001 movel %d1,%d0 594be: d088 addl %a0,%d0 594c0: 226e 0010 moveal %fp@(16),%a1 594c4: 2280 movel %d0,%a1@ return true; 594c6: 7001 moveq #1,%d0 594c8: 6002 bras 594cc <_Heap_Size_of_alloc_area+0x70> if ( !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) ) { return false; 594ca: 4200 clrb %d0 } *alloc_size = (uintptr_t) next_block + HEAP_BLOCK_SIZE_OFFSET - alloc_begin; return true; } 594cc: 241f movel %sp@+,%d2 594ce: 4e5e unlk %fp ... =============================================================================== 000472ae <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 472ae: 4e56 ffd0 linkw %fp,#-48 472b2: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 472b6: 266e 0008 moveal %fp@(8),%a3 uintptr_t const min_block_size = heap->min_block_size; Heap_Block *const first_block = heap->first_block; Heap_Block *const last_block = heap->last_block; Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 472ba: 45fa ffac lea %pc@(47268 <_Heap_Walk_print_nothing>),%a2 bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 472be: 242e 000c movel %fp@(12),%d2 uintptr_t const page_size = heap->page_size; 472c2: 282b 0010 movel %a3@(16),%d4 uintptr_t const min_block_size = heap->min_block_size; 472c6: 2a2b 0014 movel %a3@(20),%d5 Heap_Block *const first_block = heap->first_block; 472ca: 2c2b 0020 movel %a3@(32),%d6 Heap_Block *const last_block = heap->last_block; 472ce: 2e2b 0024 movel %a3@(36),%d7 Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 472d2: 4a2e 0013 tstb %fp@(19) 472d6: 6704 beqs 472dc <_Heap_Walk+0x2e> 472d8: 45fa ff96 lea %pc@(47270 <_Heap_Walk_print>),%a2 if ( !_System_state_Is_up( _System_state_Get() ) ) { 472dc: 7003 moveq #3,%d0 472de: b0b9 0005 ea70 cmpl 5ea70 <_System_state_Current>,%d0 472e4: 6600 02fc bnew 475e2 <_Heap_Walk+0x334> Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); Heap_Block *const first_block = heap->first_block; Heap_Block *const last_block = heap->last_block; (*printer)( 472e8: 2f2b 000c movel %a3@(12),%sp@- 472ec: 2f2b 0008 movel %a3@(8),%sp@- 472f0: 2f07 movel %d7,%sp@- 472f2: 2f06 movel %d6,%sp@- 472f4: 2f2b 001c movel %a3@(28),%sp@- 472f8: 2f2b 0018 movel %a3@(24),%sp@- 472fc: 2f05 movel %d5,%sp@- 472fe: 2f04 movel %d4,%sp@- 47300: 4879 0005 b05d pea 5b05d 47306: 42a7 clrl %sp@- 47308: 2f02 movel %d2,%sp@- 4730a: 4e92 jsr %a2@ heap->area_begin, heap->area_end, first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { 4730c: 4fef 002c lea %sp@(44),%sp 47310: 4a84 tstl %d4 47312: 6608 bnes 4731c <_Heap_Walk+0x6e> (*printer)( source, true, "page size is zero\n" ); 47314: 4879 0005 b0ee pea 5b0ee 4731a: 6050 bras 4736c <_Heap_Walk+0xbe> ) { #if (CPU_ALIGNMENT == 0) return true; #else return (((uintptr_t)address % CPU_ALIGNMENT) == 0); 4731c: 7003 moveq #3,%d0 4731e: c084 andl %d4,%d0 return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 47320: 670c beqs 4732e <_Heap_Walk+0x80> (*printer)( 47322: 2f04 movel %d4,%sp@- 47324: 4879 0005 b101 pea 5b101 4732a: 6000 02ca braw 475f6 <_Heap_Walk+0x348> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 4732e: 2205 movel %d5,%d1 47330: 4c44 1000 remul %d4,%d0,%d1 ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 47334: 4a80 tstl %d0 47336: 670c beqs 47344 <_Heap_Walk+0x96> (*printer)( 47338: 2f05 movel %d5,%sp@- 4733a: 4879 0005 b11f pea 5b11f 47340: 6000 02b4 braw 475f6 <_Heap_Walk+0x348> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 47344: 2006 movel %d6,%d0 47346: 5080 addql #8,%d0 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 47348: 4c44 0001 remul %d4,%d1,%d0 ); return false; } if ( 4734c: 4a81 tstl %d1 4734e: 670c beqs 4735c <_Heap_Walk+0xae> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 47350: 2f06 movel %d6,%sp@- 47352: 4879 0005 b143 pea 5b143 47358: 6000 029c braw 475f6 <_Heap_Walk+0x348> block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 4735c: 7001 moveq #1,%d0 4735e: 2046 moveal %d6,%a0 47360: c0a8 0004 andl %a0@(4),%d0 ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 47364: 6616 bnes 4737c <_Heap_Walk+0xce> (*printer)( 47366: 4879 0005 b174 pea 5b174 4736c: 4878 0001 pea 1 47370: 2f02 movel %d2,%sp@- 47372: 4e92 jsr %a2@ 47374: 4fef 000c lea %sp@(12),%sp 47378: 6000 00ba braw 47434 <_Heap_Walk+0x186> - 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; 4737c: 70fe moveq #-2,%d0 4737e: 2047 moveal %d7,%a0 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 47380: 2847 moveal %d7,%a4 - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 47382: c0a8 0004 andl %a0@(4),%d0 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 47386: d9c0 addal %d0,%a4 block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 47388: 7001 moveq #1,%d0 4738a: c0ac 0004 andl %a4@(4),%d0 ); return false; } if ( _Heap_Is_free( last_block ) ) { 4738e: 6608 bnes 47398 <_Heap_Walk+0xea> (*printer)( 47390: 4879 0005 b1a2 pea 5b1a2 47396: 60d4 bras 4736c <_Heap_Walk+0xbe> ); return false; } if ( 47398: bc8c cmpl %a4,%d6 4739a: 6708 beqs 473a4 <_Heap_Walk+0xf6> <== ALWAYS TAKEN _Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block ) { (*printer)( 4739c: 4879 0005 b1b7 pea 5b1b7 <== NOT EXECUTED 473a2: 60c8 bras 4736c <_Heap_Walk+0xbe> <== NOT EXECUTED int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 473a4: 262b 0010 movel %a3@(16),%d3 const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); 473a8: 220b movel %a3,%d1 block = next_block; } while ( block != first_block ); return true; } 473aa: 206b 0008 moveal %a3@(8),%a0 473ae: 2d44 fff8 movel %d4,%fp@(-8) 473b2: 2d43 fffc movel %d3,%fp@(-4) 473b6: 6000 0088 braw 47440 <_Heap_Walk+0x192> const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 473ba: b1eb 0020 cmpal %a3@(32),%a0 473be: 650c bcss 473cc <_Heap_Walk+0x11e> 473c0: b1eb 0024 cmpal %a3@(36),%a0 473c4: 53c0 sls %d0 473c6: 49c0 extbl %d0 473c8: 4480 negl %d0 473ca: 6002 bras 473ce <_Heap_Walk+0x120> 473cc: 4280 clrl %d0 const Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); const Heap_Block *prev_block = free_list_tail; const Heap_Block *free_block = first_free_block; while ( free_block != free_list_tail ) { if ( !_Heap_Is_block_in_heap( heap, free_block ) ) { 473ce: 4a00 tstb %d0 473d0: 660c bnes 473de <_Heap_Walk+0x130> (*printer)( 473d2: 2f08 movel %a0,%sp@- 473d4: 4879 0005 b1e6 pea 5b1e6 473da: 6000 021a braw 475f6 <_Heap_Walk+0x348> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 473de: 4be8 0008 lea %a0@(8),%a5 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 473e2: 200d movel %a5,%d0 473e4: 262e fffc movel %fp@(-4),%d3 473e8: 4c43 0004 remul %d3,%d4,%d0 ); return false; } if ( 473ec: 4a84 tstl %d4 473ee: 670c beqs 473fc <_Heap_Walk+0x14e> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 473f0: 2f08 movel %a0,%sp@- 473f2: 4879 0005 b206 pea 5b206 473f8: 6000 01fc braw 475f6 <_Heap_Walk+0x348> - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 473fc: 70fe moveq #-2,%d0 block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 473fe: 7601 moveq #1,%d3 - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 47400: c0a8 0004 andl %a0@(4),%d0 block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 47404: c6b0 0804 andl %a0@(00000004,%d0:l),%d3 ); return false; } if ( _Heap_Is_used( free_block ) ) { 47408: 670c beqs 47416 <_Heap_Walk+0x168> (*printer)( 4740a: 2f08 movel %a0,%sp@- 4740c: 4879 0005 b236 pea 5b236 47412: 6000 01e2 braw 475f6 <_Heap_Walk+0x348> ); return false; } if ( free_block->prev != prev_block ) { 47416: 2028 000c movel %a0@(12),%d0 4741a: b280 cmpl %d0,%d1 4741c: 671c beqs 4743a <_Heap_Walk+0x18c> (*printer)( 4741e: 2f00 movel %d0,%sp@- 47420: 2f08 movel %a0,%sp@- 47422: 4879 0005 b252 pea 5b252 47428: 4878 0001 pea 1 4742c: 2f02 movel %d2,%sp@- 4742e: 4e92 jsr %a2@ 47430: 4fef 0014 lea %sp@(20),%sp if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 47434: 4200 clrb %d0 47436: 6000 01ac braw 475e4 <_Heap_Walk+0x336> return false; } prev_block = free_block; free_block = free_block->next; 4743a: 2208 movel %a0,%d1 4743c: 2068 0008 moveal %a0@(8),%a0 const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); const Heap_Block *prev_block = free_list_tail; const Heap_Block *free_block = first_free_block; while ( free_block != free_list_tail ) { 47440: b7c8 cmpal %a0,%a3 47442: 6600 ff76 bnew 473ba <_Heap_Walk+0x10c> 47446: 282e fff8 movel %fp@(-8),%d4 4744a: 6002 bras 4744e <_Heap_Walk+0x1a0> block->prev_size ); } block = next_block; } while ( block != first_block ); 4744c: 284d moveal %a5,%a4 return true; } 4744e: 202c 0004 movel %a4@(4),%d0 - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 47452: 76fe moveq #-2,%d3 47454: c680 andl %d0,%d3 47456: 2d40 fffc movel %d0,%fp@(-4) RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4745a: 4bf4 3800 lea %a4@(00000000,%d3:l),%a5 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 4745e: bbeb 0020 cmpal %a3@(32),%a5 47462: 650c bcss 47470 <_Heap_Walk+0x1c2> <== NEVER TAKEN 47464: bbeb 0024 cmpal %a3@(36),%a5 47468: 53c0 sls %d0 4746a: 49c0 extbl %d0 4746c: 4480 negl %d0 4746e: 6002 bras 47472 <_Heap_Walk+0x1c4> 47470: 4280 clrl %d0 <== NOT EXECUTED bool const prev_used = _Heap_Is_prev_used( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); uintptr_t const next_block_begin = (uintptr_t) next_block; bool const is_not_last_block = block != last_block; if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 47472: 4a00 tstb %d0 47474: 660c bnes 47482 <_Heap_Walk+0x1d4> (*printer)( 47476: 2f0d movel %a5,%sp@- 47478: 2f0c movel %a4,%sp@- 4747a: 4879 0005 b284 pea 5b284 47480: 60a6 bras 47428 <_Heap_Walk+0x17a> uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); bool const prev_used = _Heap_Is_prev_used( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); uintptr_t const next_block_begin = (uintptr_t) next_block; bool const is_not_last_block = block != last_block; 47482: be8c cmpl %a4,%d7 47484: 56c0 sne %d0 47486: 2200 movel %d0,%d1 47488: 4481 negl %d1 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 4748a: 2003 movel %d3,%d0 4748c: 1d41 fffb moveb %d1,%fp@(-5) 47490: 4c44 0001 remul %d4,%d1,%d0 ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { 47494: 4a81 tstl %d1 47496: 6714 beqs 474ac <_Heap_Walk+0x1fe> 47498: 4a2e fffb tstb %fp@(-5) 4749c: 670e beqs 474ac <_Heap_Walk+0x1fe> (*printer)( 4749e: 2f03 movel %d3,%sp@- 474a0: 2f0c movel %a4,%sp@- 474a2: 4879 0005 b2b1 pea 5b2b1 474a8: 6000 ff7e braw 47428 <_Heap_Walk+0x17a> ); return false; } if ( block_size < min_block_size && is_not_last_block ) { 474ac: ba83 cmpl %d3,%d5 474ae: 6322 blss 474d2 <_Heap_Walk+0x224> 474b0: 4a2e fffb tstb %fp@(-5) 474b4: 671c beqs 474d2 <_Heap_Walk+0x224> <== NEVER TAKEN (*printer)( 474b6: 2f05 movel %d5,%sp@- 474b8: 2f03 movel %d3,%sp@- 474ba: 2f0c movel %a4,%sp@- 474bc: 4879 0005 b2df pea 5b2df 474c2: 4878 0001 pea 1 474c6: 2f02 movel %d2,%sp@- 474c8: 4e92 jsr %a2@ block, block_size, min_block_size ); return false; 474ca: 4fef 0018 lea %sp@(24),%sp 474ce: 6000 ff64 braw 47434 <_Heap_Walk+0x186> } if ( next_block_begin <= block_begin && is_not_last_block ) { 474d2: b9cd cmpal %a5,%a4 474d4: 6514 bcss 474ea <_Heap_Walk+0x23c> 474d6: 4a2e fffb tstb %fp@(-5) 474da: 670e beqs 474ea <_Heap_Walk+0x23c> (*printer)( 474dc: 2f0d movel %a5,%sp@- 474de: 2f0c movel %a4,%sp@- 474e0: 4879 0005 b30a pea 5b30a 474e6: 6000 ff40 braw 47428 <_Heap_Walk+0x17a> block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 474ea: 7001 moveq #1,%d0 474ec: c0ae fffc andl %fp@(-4),%d0 474f0: 2d40 fffc movel %d0,%fp@(-4) 474f4: 7001 moveq #1,%d0 474f6: c0ad 0004 andl %a5@(4),%d0 ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 474fa: 6600 00ae bnew 475aa <_Heap_Walk+0x2fc> block = next_block; } while ( block != first_block ); return true; } 474fe: 222b 0008 movel %a3@(8),%d1 Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 47502: 43f9 0005 b02a lea 5b02a ,%a1 block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? 47508: 206c 0008 moveal %a4@(8),%a0 block = next_block; } while ( block != first_block ); return true; } 4750c: 2d41 fff8 movel %d1,%fp@(-8) Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 47510: b1eb 000c cmpal %a3@(12),%a0 47514: 6710 beqs 47526 <_Heap_Walk+0x278> " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 47516: 43f9 0005 af64 lea 5af64 ,%a1 4751c: b7c8 cmpal %a0,%a3 4751e: 6606 bnes 47526 <_Heap_Walk+0x278> 47520: 43f9 0005 b039 lea 5b039 ,%a1 false, "block 0x%08x: size %u, prev 0x%08x%s, next 0x%08x%s\n", block, block_size, block->prev, block->prev == first_free_block ? 47526: 202c 000c movel %a4@(12),%d0 Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 4752a: 223c 0005 b043 movel #372803,%d1 47530: b0ae fff8 cmpl %fp@(-8),%d0 47534: 6710 beqs 47546 <_Heap_Walk+0x298> block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 47536: 223c 0005 af64 movel #372580,%d1 4753c: b7c0 cmpal %d0,%a3 4753e: 6606 bnes 47546 <_Heap_Walk+0x298> 47540: 223c 0005 b053 movel #372819,%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)( 47546: 2f09 movel %a1,%sp@- 47548: 2f08 movel %a0,%sp@- 4754a: 2f01 movel %d1,%sp@- 4754c: 2f00 movel %d0,%sp@- 4754e: 2f03 movel %d3,%sp@- 47550: 2f0c movel %a4,%sp@- 47552: 4879 0005 b33e pea 5b33e 47558: 42a7 clrl %sp@- 4755a: 2f02 movel %d2,%sp@- 4755c: 4e92 jsr %a2@ block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { 4755e: 2015 movel %a5@,%d0 47560: 4fef 0024 lea %sp@(36),%sp 47564: b083 cmpl %d3,%d0 47566: 671e beqs 47586 <_Heap_Walk+0x2d8> (*printer)( 47568: 2f0d movel %a5,%sp@- 4756a: 2f00 movel %d0,%sp@- 4756c: 2f03 movel %d3,%sp@- 4756e: 2f0c movel %a4,%sp@- 47570: 4879 0005 b373 pea 5b373 47576: 4878 0001 pea 1 4757a: 2f02 movel %d2,%sp@- 4757c: 4e92 jsr %a2@ 4757e: 4fef 001c lea %sp@(28),%sp 47582: 6000 feb0 braw 47434 <_Heap_Walk+0x186> ); return false; } if ( !prev_used ) { 47586: 4aae fffc tstl %fp@(-4) 4758a: 660a bnes 47596 <_Heap_Walk+0x2e8> (*printer)( 4758c: 2f0c movel %a4,%sp@- 4758e: 4879 0005 b3ac pea 5b3ac 47594: 6060 bras 475f6 <_Heap_Walk+0x348> block = next_block; } while ( block != first_block ); return true; } 47596: 206b 0008 moveal %a3@(8),%a0 4759a: 6008 bras 475a4 <_Heap_Walk+0x2f6> { const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *free_block = _Heap_Free_list_first( heap ); while ( free_block != free_list_tail ) { if ( free_block == block ) { 4759c: b9c8 cmpal %a0,%a4 4759e: 673c beqs 475dc <_Heap_Walk+0x32e> return true; } free_block = free_block->next; 475a0: 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 ) { 475a4: b7c8 cmpal %a0,%a3 475a6: 66f4 bnes 4759c <_Heap_Walk+0x2ee> 475a8: 6044 bras 475ee <_Heap_Walk+0x340> if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { 475aa: 4aae fffc tstl %fp@(-4) 475ae: 6716 beqs 475c6 <_Heap_Walk+0x318> (*printer)( 475b0: 2f03 movel %d3,%sp@- 475b2: 2f0c movel %a4,%sp@- 475b4: 4879 0005 b3db pea 5b3db 475ba: 42a7 clrl %sp@- 475bc: 2f02 movel %d2,%sp@- 475be: 4e92 jsr %a2@ 475c0: 4fef 0014 lea %sp@(20),%sp 475c4: 6016 bras 475dc <_Heap_Walk+0x32e> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 475c6: 2f14 movel %a4@,%sp@- 475c8: 2f03 movel %d3,%sp@- 475ca: 2f0c movel %a4,%sp@- 475cc: 4879 0005 b3f2 pea 5b3f2 475d2: 42a7 clrl %sp@- 475d4: 2f02 movel %d2,%sp@- 475d6: 4e92 jsr %a2@ 475d8: 4fef 0018 lea %sp@(24),%sp block->prev_size ); } block = next_block; } while ( block != first_block ); 475dc: bc8d cmpl %a5,%d6 475de: 6600 fe6c bnew 4744c <_Heap_Walk+0x19e> Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; 475e2: 7001 moveq #1,%d0 block = next_block; } while ( block != first_block ); return true; } 475e4: 4cee 3cfc ffd0 moveml %fp@(-48),%d2-%d7/%a2-%a5 475ea: 4e5e unlk %fp 475ec: 4e75 rts return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 475ee: 2f0c movel %a4,%sp@- 475f0: 4879 0005 b417 pea 5b417 475f6: 4878 0001 pea 1 475fa: 2f02 movel %d2,%sp@- 475fc: 4e92 jsr %a2@ 475fe: 4fef 0010 lea %sp@(16),%sp 47602: 6000 fe30 braw 47434 <_Heap_Walk+0x186> ... =============================================================================== 000468cc <_Internal_error_Occurred>: void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 468cc: 4e56 0000 linkw %fp,#0 468d0: 222e 000c movel %fp@(12),%d1 468d4: 2f02 movel %d2,%sp@- 468d6: 242e 0010 movel %fp@(16),%d2 _Internal_errors_What_happened.the_source = the_source; _Internal_errors_What_happened.is_internal = is_internal; 468da: 13c1 0005 c656 moveb %d1,5c656 <_Internal_errors_What_happened+0x4> _Internal_errors_What_happened.the_error = the_error; _User_extensions_Fatal( the_source, is_internal, the_error ); 468e0: 2f02 movel %d2,%sp@- void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 468e2: 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 ); 468e6: 0281 0000 00ff andil #255,%d1 bool is_internal, Internal_errors_t the_error ) { _Internal_errors_What_happened.the_source = the_source; 468ec: 23c0 0005 c652 movel %d0,5c652 <_Internal_errors_What_happened> _Internal_errors_What_happened.is_internal = is_internal; _Internal_errors_What_happened.the_error = the_error; _User_extensions_Fatal( the_source, is_internal, the_error ); 468f2: 2f01 movel %d1,%sp@- ) { _Internal_errors_What_happened.the_source = the_source; _Internal_errors_What_happened.is_internal = is_internal; _Internal_errors_What_happened.the_error = the_error; 468f4: 23c2 0005 c658 movel %d2,5c658 <_Internal_errors_What_happened+0x6> _User_extensions_Fatal( the_source, is_internal, the_error ); 468fa: 2f00 movel %d0,%sp@- 468fc: 4eb9 0004 83e6 jsr 483e6 <_User_extensions_Fatal> RTEMS_INLINE_ROUTINE void _System_state_Set ( System_state_Codes state ) { _System_state_Current = state; 46902: 7005 moveq #5,%d0 <== NOT EXECUTED _System_state_Set( SYSTEM_STATE_FAILED ); _CPU_Fatal_halt( the_error ); 46904: 2042 moveal %d2,%a0 <== NOT EXECUTED 46906: 243c 0000 0700 movel #1792,%d2 <== NOT EXECUTED 4690c: 23c0 0005 c728 movel %d0,5c728 <_System_state_Current> <== NOT EXECUTED 46912: 40c0 movew %sr,%d0 <== NOT EXECUTED 46914: 8082 orl %d2,%d0 <== NOT EXECUTED 46916: 46c0 movew %d0,%sr <== NOT EXECUTED 46918: 2008 movel %a0,%d0 <== NOT EXECUTED 4691a: 223c dead beef movel #-559038737,%d1 <== NOT EXECUTED 46920: 4ac8 halt <== NOT EXECUTED 46922: 4fef 000c lea %sp@(12),%sp <== NOT EXECUTED 46926: 60fe bras 46926 <_Internal_error_Occurred+0x5a> <== NOT EXECUTED =============================================================================== 00046988 <_Objects_Allocate>: */ Objects_Control *_Objects_Allocate( Objects_Information *information ) { 46988: 4e56 fff0 linkw %fp,#-16 4698c: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ 46990: 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 ) 46994: 4aaa 0014 tstl %a2@(20) 46998: 675e beqs 469f8 <_Objects_Allocate+0x70> <== NEVER TAKEN /* * OK. The manager should be initialized and configured to have objects. * With any luck, it is safe to attempt to allocate an object. */ the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 4699a: 240a movel %a2,%d2 4699c: 0682 0000 001c addil #28,%d2 469a2: 47f9 0004 6118 lea 46118 <_Chain_Get>,%a3 469a8: 2f02 movel %d2,%sp@- 469aa: 4e93 jsr %a3@ if ( information->auto_extend ) { 469ac: 588f addql #4,%sp 469ae: 4a2a 0010 tstb %a2@(16) 469b2: 6746 beqs 469fa <_Objects_Allocate+0x72> /* * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { 469b4: 4a80 tstl %d0 469b6: 6612 bnes 469ca <_Objects_Allocate+0x42> _Objects_Extend_information( information ); 469b8: 2f0a movel %a2,%sp@- 469ba: 4eb9 0004 6a30 jsr 46a30 <_Objects_Extend_information> the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 469c0: 2f02 movel %d2,%sp@- 469c2: 4e93 jsr %a3@ } if ( the_object ) { 469c4: 508f addql #8,%sp 469c6: 4a80 tstl %d0 469c8: 6730 beqs 469fa <_Objects_Allocate+0x72> uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 469ca: 2040 moveal %d0,%a0 469cc: 4281 clrl %d1 469ce: 4282 clrl %d2 469d0: 3228 000a movew %a0@(10),%d1 469d4: 342a 0008 movew %a2@(8),%d2 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 469d8: 206a 002a moveal %a2@(42),%a0 } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 469dc: 9282 subl %d2,%d1 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; 469de: 342a 0012 movew %a2@(18),%d2 469e2: 4c42 1001 remul %d2,%d1,%d1 information->inactive_per_block[ block ]--; 469e6: e589 lsll #2,%d1 469e8: d1c1 addal %d1,%a0 469ea: 5390 subql #1,%a0@ information->inactive--; 469ec: 322a 0028 movew %a2@(40),%d1 469f0: 5381 subql #1,%d1 469f2: 3541 0028 movew %d1,%a2@(40) 469f6: 6002 bras 469fa <_Objects_Allocate+0x72> * still attempts to create the object, the information block * should be all zeroed out because it is in the BSS. So let's * check that code for this manager is even present. */ if ( information->size == 0 ) return NULL; 469f8: 4280 clrl %d0 <== NOT EXECUTED ); } #endif return the_object; } 469fa: 4cee 0c0c fff0 moveml %fp@(-16),%d2-%d3/%a2-%a3 46a00: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00046a04 <_Objects_Close>: RTEMS_INLINE_ROUTINE void _Objects_Invalidate_Id( Objects_Information *information, Objects_Control *the_object ) { _Objects_Set_local_object( 46a04: 4280 clrl %d0 void _Objects_Close( Objects_Information *information, Objects_Control *the_object ) { 46a06: 4e56 0000 linkw %fp,#0 46a0a: 226e 000c moveal %fp@(12),%a1 46a0e: 206e 0008 moveal %fp@(8),%a0 46a12: 2f0a movel %a2,%sp@- #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 46a14: 2468 0018 moveal %a0@(24),%a2 RTEMS_INLINE_ROUTINE void _Objects_Invalidate_Id( Objects_Information *information, Objects_Control *the_object ) { _Objects_Set_local_object( 46a18: 3029 000a movew %a1@(10),%d0 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 46a1c: 42b2 0c00 clrl %a2@(00000000,%d0:l:4) _Objects_Invalidate_Id( information, the_object ); _Objects_Namespace_remove( information, the_object ); } 46a20: 245f moveal %sp@+,%a2 Objects_Control *the_object ) { _Objects_Invalidate_Id( information, the_object ); _Objects_Namespace_remove( information, the_object ); 46a22: 2d49 000c movel %a1,%fp@(12) } 46a26: 4e5e unlk %fp Objects_Control *the_object ) { _Objects_Invalidate_Id( information, the_object ); _Objects_Namespace_remove( information, the_object ); 46a28: 4ef9 0004 6f28 jmp 46f28 <_Objects_Namespace_remove> ... =============================================================================== 00046d2c <_Objects_Get_information>: Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint32_t the_class ) { 46d2c: 4e56 0000 linkw %fp,#0 46d30: 2f03 movel %d3,%sp@- 46d32: 262e 0008 movel %fp@(8),%d3 46d36: 2f02 movel %d2,%sp@- 46d38: 242e 000c movel %fp@(12),%d2 Objects_Information *info; int the_class_api_maximum; if ( !the_class ) 46d3c: 6734 beqs 46d72 <_Objects_Get_information+0x46> /* * 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 ); 46d3e: 2f03 movel %d3,%sp@- 46d40: 4eb9 0004 a574 jsr 4a574 <_Objects_API_maximum_class> if ( the_class_api_maximum == 0 ) 46d46: 588f addql #4,%sp 46d48: 4a80 tstl %d0 46d4a: 6726 beqs 46d72 <_Objects_Get_information+0x46> return NULL; if ( the_class > (uint32_t) the_class_api_maximum ) 46d4c: b082 cmpl %d2,%d0 46d4e: 6522 bcss 46d72 <_Objects_Get_information+0x46> return NULL; if ( !_Objects_Information_table[ the_api ] ) 46d50: 41f9 0005 c578 lea 5c578 <_Objects_Information_table>,%a0 46d56: 2070 3c00 moveal %a0@(00000000,%d3:l:4),%a0 46d5a: 4a88 tstl %a0 46d5c: 6714 beqs 46d72 <_Objects_Get_information+0x46> <== NEVER TAKEN return NULL; info = _Objects_Information_table[ the_api ][ the_class ]; 46d5e: 2030 2c00 movel %a0@(00000000,%d2:l:4),%d0 if ( !info ) 46d62: 6710 beqs 46d74 <_Objects_Get_information+0x48> <== NEVER TAKEN * Thus we may have 0 local instances and still have a valid object * pointer. */ #if !defined(RTEMS_MULTIPROCESSING) if ( info->maximum == 0 ) return NULL; 46d64: 2040 moveal %d0,%a0 46d66: 4a68 000e tstw %a0@(14) 46d6a: 56c1 sne %d1 46d6c: 49c1 extbl %d1 46d6e: c081 andl %d1,%d0 46d70: 6002 bras 46d74 <_Objects_Get_information+0x48> if ( the_class > (uint32_t) the_class_api_maximum ) return NULL; if ( !_Objects_Information_table[ the_api ] ) return NULL; 46d72: 4280 clrl %d0 if ( info->maximum == 0 ) return NULL; #endif return info; } 46d74: 242e fff8 movel %fp@(-8),%d2 46d78: 262e fffc movel %fp@(-4),%d3 46d7c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000544b4 <_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; 544b4: 7001 moveq #1,%d0 if ( information->maximum >= index ) { 544b6: 4281 clrl %d1 Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 544b8: 4e56 0000 linkw %fp,#0 544bc: 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; 544c0: 90a8 0006 subl %a0@(6),%d0 544c4: d0ae 000c addl %fp@(12),%d0 if ( information->maximum >= index ) { 544c8: 3228 000e movew %a0@(14),%d1 Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 544cc: 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 ) { 544d0: b081 cmpl %d1,%d0 544d2: 620e bhis 544e2 <_Objects_Get_no_protection+0x2e> if ( (the_object = information->local_table[ index ]) != NULL ) { 544d4: 2068 0018 moveal %a0@(24),%a0 544d8: 2030 0c00 movel %a0@(00000000,%d0:l:4),%d0 544dc: 6704 beqs 544e2 <_Objects_Get_no_protection+0x2e><== NEVER TAKEN *location = OBJECTS_LOCAL; 544de: 4291 clrl %a1@ return the_object; 544e0: 6006 bras 544e8 <_Objects_Get_no_protection+0x34> /* * This isn't supported or required yet for Global objects so * if it isn't local, we don't find it. */ *location = OBJECTS_ERROR; 544e2: 7001 moveq #1,%d0 544e4: 2280 movel %d0,%a1@ return NULL; 544e6: 4280 clrl %d0 } 544e8: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00047d04 <_Objects_Id_to_name>: */ Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { 47d04: 4e56 fffc linkw %fp,#-4 47d08: 222e 0008 movel %fp@(8),%d1 47d0c: 2f02 movel %d2,%sp@- /* * Caller is trusted for name != NULL. */ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 47d0e: 4a81 tstl %d1 47d10: 660a bnes 47d1c <_Objects_Id_to_name+0x18> 47d12: 2079 0005 dc38 moveal 5dc38 <_Per_CPU_Information+0xc>,%a0 47d18: 2228 0008 movel %a0@(8),%d1 47d1c: 7418 moveq #24,%d2 47d1e: 2001 movel %d1,%d0 47d20: e4a8 lsrl %d2,%d0 47d22: 143c 0007 moveb #7,%d2 47d26: c082 andl %d2,%d0 */ RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid( uint32_t the_api ) { if ( !the_api || the_api > OBJECTS_APIS_LAST ) 47d28: 143c 0002 moveb #2,%d2 47d2c: 2040 moveal %d0,%a0 47d2e: 5388 subql #1,%a0 47d30: b488 cmpl %a0,%d2 47d32: 6538 bcss 47d6c <_Objects_Id_to_name+0x68> 47d34: 6040 bras 47d76 <_Objects_Id_to_name+0x72> */ RTEMS_INLINE_ROUTINE uint32_t _Objects_Get_class( Objects_Id id ) { return (uint32_t) 47d36: 2001 movel %d1,%d0 47d38: 741b moveq #27,%d2 47d3a: e4a8 lsrl %d2,%d0 if ( !_Objects_Information_table[ the_api ] ) return OBJECTS_INVALID_ID; the_class = _Objects_Get_class( tmpId ); information = _Objects_Information_table[ the_api ][ the_class ]; 47d3c: 2030 0c00 movel %a0@(00000000,%d0:l:4),%d0 if ( !information ) 47d40: 672a beqs 47d6c <_Objects_Id_to_name+0x68> <== NEVER TAKEN #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) return OBJECTS_INVALID_ID; #endif the_object = _Objects_Get( information, tmpId, &ignored_location ); 47d42: 486e fffc pea %fp@(-4) 47d46: 2f01 movel %d1,%sp@- 47d48: 2f00 movel %d0,%sp@- 47d4a: 4eb9 0004 7ca4 jsr 47ca4 <_Objects_Get> if ( !the_object ) 47d50: 4fef 000c lea %sp@(12),%sp 47d54: 4a80 tstl %d0 47d56: 6714 beqs 47d6c <_Objects_Id_to_name+0x68> return OBJECTS_INVALID_ID; *name = the_object->name; 47d58: 206e 000c moveal %fp@(12),%a0 47d5c: 2240 moveal %d0,%a1 47d5e: 20a9 000c movel %a1@(12),%a0@ _Thread_Enable_dispatch(); 47d62: 4eb9 0004 8562 jsr 48562 <_Thread_Enable_dispatch> return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; 47d68: 4280 clrl %d0 47d6a: 6002 bras 47d6e <_Objects_Id_to_name+0x6a> the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; if ( !_Objects_Information_table[ the_api ] ) return OBJECTS_INVALID_ID; 47d6c: 7003 moveq #3,%d0 return OBJECTS_INVALID_ID; *name = the_object->name; _Thread_Enable_dispatch(); return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; } 47d6e: 242e fff8 movel %fp@(-8),%d2 47d72: 4e5e unlk %fp 47d74: 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 ] ) 47d76: 41f9 0005 da30 lea 5da30 <_Objects_Information_table>,%a0 47d7c: 2070 0c00 moveal %a0@(00000000,%d0:l:4),%a0 47d80: 4a88 tstl %a0 47d82: 66b2 bnes 47d36 <_Objects_Id_to_name+0x32> <== ALWAYS TAKEN 47d84: 60e6 bras 47d6c <_Objects_Id_to_name+0x68> <== NOT EXECUTED ... =============================================================================== 00046e38 <_Objects_Initialize_information>: , bool supports_global, Objects_Thread_queue_Extract_callout extract #endif ) { 46e38: 4e56 fff4 linkw %fp,#-12 46e3c: 206e 0008 moveal %fp@(8),%a0 46e40: 48d7 001c moveml %d2-%d4,%sp@ 46e44: 4284 clrl %d4 46e46: 382e 001a movew %fp@(26),%d4 46e4a: 202e 000c movel %fp@(12),%d0 46e4e: 2244 moveal %d4,%a1 information->the_class = the_class; information->size = size; information->local_table = 0; information->inactive_per_block = 0; information->object_blocks = 0; information->inactive = 0; 46e50: 4244 clrw %d4 uint32_t index; #endif information->the_api = the_api; information->the_class = the_class; information->size = size; 46e52: 2149 0014 movel %a1,%a0@(20) information->maximum = 0; /* * Register this Object Class in the Object Information Table. */ _Objects_Information_table[ the_api ][ the_class ] = information; 46e56: 43f9 0005 c578 lea 5c578 <_Objects_Information_table>,%a1 , bool supports_global, Objects_Thread_queue_Extract_callout extract #endif ) { 46e5c: 222e 0014 movel %fp@(20),%d1 46e60: 262e 0010 movel %fp@(16),%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; 46e64: 3144 0028 movew %d4,%a0@(40) /* * Set the maximum value to 0. It will be updated when objects are * added to the inactive set from _Objects_Extend_information() */ information->maximum = 0; 46e68: 3144 000e movew %d4,%a0@(14) /* * Register this Object Class in the Object Information Table. */ _Objects_Information_table[ the_api ][ the_class ] = information; 46e6c: 2271 0c00 moveal %a1@(00000000,%d0:l:4),%a1 /* * Are we operating in limited or unlimited (e.g. auto-extend) mode. */ information->auto_extend = (maximum & OBJECTS_UNLIMITED_OBJECTS) ? true : false; 46e70: 2801 movel %d1,%d4 , bool supports_global, Objects_Thread_queue_Extract_callout extract #endif ) { 46e72: 242e 0020 movel %fp@(32),%d2 uint32_t maximum_per_allocation; #if defined(RTEMS_MULTIPROCESSING) uint32_t index; #endif information->the_api = the_api; 46e76: 2080 movel %d0,%a0@ information->the_class = the_class; 46e78: 3143 0004 movew %d3,%a0@(4) information->size = size; information->local_table = 0; 46e7c: 42a8 0018 clrl %a0@(24) /* * Are we operating in limited or unlimited (e.g. auto-extend) mode. */ information->auto_extend = (maximum & OBJECTS_UNLIMITED_OBJECTS) ? true : false; 46e80: d884 addl %d4,%d4 46e82: 9984 subxl %d4,%d4 46e84: 4484 negl %d4 information->the_api = the_api; information->the_class = the_class; information->size = size; information->local_table = 0; information->inactive_per_block = 0; 46e86: 42a8 002a clrl %a0@(42) /* * 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; 46e8a: 0881 001f bclr #31,%d1 information->the_api = the_api; information->the_class = the_class; information->size = size; information->local_table = 0; information->inactive_per_block = 0; information->object_blocks = 0; 46e8e: 42a8 002e clrl %a0@(46) information->maximum = 0; /* * Register this Object Class in the Object Information Table. */ _Objects_Information_table[ the_api ][ the_class ] = information; 46e92: 2388 3c00 movel %a0,%a1@(00000000,%d3:l:4) /* * Are we operating in limited or unlimited (e.g. auto-extend) mode. */ information->auto_extend = 46e96: 1144 0010 moveb %d4,%a0@(16) maximum_per_allocation = maximum & ~OBJECTS_UNLIMITED_OBJECTS; /* * Unlimited and maximum of zero is illogical. */ if ( information->auto_extend && maximum_per_allocation == 0) { 46e9a: 4a84 tstl %d4 46e9c: 6714 beqs 46eb2 <_Objects_Initialize_information+0x7a> 46e9e: 4a81 tstl %d1 46ea0: 6610 bnes 46eb2 <_Objects_Initialize_information+0x7a> _Internal_error_Occurred( 46ea2: 4878 0013 pea 13 46ea6: 4878 0001 pea 1 46eaa: 42a7 clrl %sp@- 46eac: 4eb9 0004 68cc jsr 468cc <_Internal_error_Occurred> uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 46eb2: 7818 moveq #24,%d4 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; 46eb4: 43f9 0005 bd74 lea 5bd74 ,%a1 46eba: e9a8 lsll %d4,%d0 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 46ebc: 183c 001b moveb #27,%d4 uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 46ec0: 08c0 0010 bset #16,%d0 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 46ec4: e9ab lsll %d4,%d3 } /* * The allocation unit is the maximum value */ information->allocation_size = maximum_per_allocation; 46ec6: 3141 0012 movew %d1,%a0@(18) /* * Provide a null local table entry for the case of any empty table. */ information->local_table = &null_local_table; 46eca: 2149 0018 movel %a1,%a0@(24) 46ece: 8083 orl %d3,%d0 /* * Calculate minimum and maximum Id's */ minimum_index = (maximum_per_allocation == 0) ? 0 : 1; 46ed0: 4a81 tstl %d1 46ed2: 56c3 sne %d3 46ed4: 49c3 extbl %d3 46ed6: 4483 negl %d3 uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 46ed8: 8083 orl %d3,%d0 46eda: 2140 0006 movel %d0,%a0@(6) /* * Calculate the maximum name length */ name_length = maximum_name_length; if ( name_length & (OBJECTS_NAME_ALIGNMENT-1) ) 46ede: 7003 moveq #3,%d0 46ee0: c082 andl %d2,%d0 46ee2: 670a beqs 46eee <_Objects_Initialize_information+0xb6><== ALWAYS TAKEN name_length = (name_length + OBJECTS_NAME_ALIGNMENT) & 46ee4: 2002 movel %d2,%d0 <== NOT EXECUTED 46ee6: 5880 addql #4,%d0 <== NOT EXECUTED 46ee8: 74fc moveq #-4,%d2 <== NOT EXECUTED 46eea: c082 andl %d2,%d0 <== NOT EXECUTED 46eec: 6002 bras 46ef0 <_Objects_Initialize_information+0xb8><== NOT EXECUTED /* * Calculate the maximum name length */ name_length = maximum_name_length; if ( name_length & (OBJECTS_NAME_ALIGNMENT-1) ) 46eee: 2002 movel %d2,%d0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 46ef0: 43e8 0020 lea %a0@(32),%a1 46ef4: 2149 001c movel %a1,%a0@(28) name_length = (name_length + OBJECTS_NAME_ALIGNMENT) & ~(OBJECTS_NAME_ALIGNMENT-1); information->name_length = name_length; _Chain_Initialize_empty( &information->Inactive ); 46ef8: 43e8 001c lea %a0@(28),%a1 if ( name_length & (OBJECTS_NAME_ALIGNMENT-1) ) name_length = (name_length + OBJECTS_NAME_ALIGNMENT) & ~(OBJECTS_NAME_ALIGNMENT-1); information->name_length = name_length; 46efc: 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; 46f00: 42a8 0020 clrl %a0@(32) _Chain_Initialize_empty( &information->Inactive ); 46f04: 2149 0024 movel %a1,%a0@(36) /* * Initialize objects .. if there are any */ if ( maximum_per_allocation ) { 46f08: 4a81 tstl %d1 46f0a: 6712 beqs 46f1e <_Objects_Initialize_information+0xe6> /* * 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 ); 46f0c: 2d48 0008 movel %a0,%fp@(8) _Chain_Initialize_empty( &information->global_table[ index ] ); } else information->global_table = NULL; #endif } 46f10: 4cee 001c fff4 moveml %fp@(-12),%d2-%d4 46f16: 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 ); 46f18: 4ef9 0004 6a30 jmp 46a30 <_Objects_Extend_information> _Chain_Initialize_empty( &information->global_table[ index ] ); } else information->global_table = NULL; #endif } 46f1e: 4cee 001c fff4 moveml %fp@(-12),%d2-%d4 46f24: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004b3e8 <_Protected_heap_Get_information>: bool _Protected_heap_Get_information( Heap_Control *the_heap, Heap_Information_block *the_info ) { 4b3e8: 4e56 0000 linkw %fp,#0 4b3ec: 2f03 movel %d3,%sp@- 4b3ee: 262e 000c movel %fp@(12),%d3 4b3f2: 2f02 movel %d2,%sp@- 4b3f4: 242e 0008 movel %fp@(8),%d2 if ( !the_heap ) 4b3f8: 672e beqs 4b428 <_Protected_heap_Get_information+0x40><== NEVER TAKEN return false; if ( !the_info ) 4b3fa: 4a83 tstl %d3 4b3fc: 672a beqs 4b428 <_Protected_heap_Get_information+0x40><== NEVER TAKEN return false; _RTEMS_Lock_allocator(); 4b3fe: 2f39 0006 1f1a movel 61f1a <_RTEMS_Allocator_Mutex>,%sp@- 4b404: 4eb9 0004 9ad4 jsr 49ad4 <_API_Mutex_Lock> _Heap_Get_information( the_heap, the_info ); 4b40a: 2f03 movel %d3,%sp@- 4b40c: 2f02 movel %d2,%sp@- 4b40e: 4eb9 0004 e994 jsr 4e994 <_Heap_Get_information> _RTEMS_Unlock_allocator(); 4b414: 2f39 0006 1f1a movel 61f1a <_RTEMS_Allocator_Mutex>,%sp@- 4b41a: 4eb9 0004 9b34 jsr 49b34 <_API_Mutex_Unlock> return true; 4b420: 4fef 0010 lea %sp@(16),%sp 4b424: 7001 moveq #1,%d0 4b426: 6002 bras 4b42a <_Protected_heap_Get_information+0x42> { if ( !the_heap ) return false; if ( !the_info ) return false; 4b428: 4200 clrb %d0 _RTEMS_Lock_allocator(); _Heap_Get_information( the_heap, the_info ); _RTEMS_Unlock_allocator(); return true; } 4b42a: 242e fff8 movel %fp@(-8),%d2 4b42e: 262e fffc movel %fp@(-4),%d3 4b432: 4e5e unlk %fp ... =============================================================================== 00049ea0 <_RTEMS_tasks_Post_switch_extension>: */ void _RTEMS_tasks_Post_switch_extension( Thread_Control *executing ) { 49ea0: 4e56 ffec linkw %fp,#-20 RTEMS_API_Control *api; ASR_Information *asr; rtems_signal_set signal_set; Modes_Control prev_mode; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 49ea4: 206e 0008 moveal %fp@(8),%a0 */ void _RTEMS_tasks_Post_switch_extension( Thread_Control *executing ) { 49ea8: 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 ]; 49eac: 2468 0108 moveal %a0@(264),%a2 if ( !api ) 49eb0: 4a8a tstl %a2 49eb2: 6754 beqs 49f08 <_RTEMS_tasks_Post_switch_extension+0x68><== NEVER TAKEN * Signal Processing */ asr = &api->Signal; _ISR_Disable( level ); 49eb4: 203c 0000 0700 movel #1792,%d0 49eba: 40c1 movew %sr,%d1 49ebc: 8081 orl %d1,%d0 49ebe: 46c0 movew %d0,%sr signal_set = asr->signals_posted; 49ec0: 262a 0012 movel %a2@(18),%d3 asr->signals_posted = 0; 49ec4: 42aa 0012 clrl %a2@(18) _ISR_Enable( level ); 49ec8: 46c1 movew %d1,%sr if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ 49eca: 4a83 tstl %d3 49ecc: 673a beqs 49f08 <_RTEMS_tasks_Post_switch_extension+0x68> return; asr->nest_level += 1; 49ece: 52aa 001a addql #1,%a2@(26) rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 49ed2: 240e movel %fp,%d2 49ed4: 5982 subql #4,%d2 49ed6: 47f9 0004 b8f0 lea 4b8f0 ,%a3 49edc: 2f02 movel %d2,%sp@- 49ede: 2f3c 0000 ffff movel #65535,%sp@- 49ee4: 2f2a 000e movel %a2@(14),%sp@- 49ee8: 4e93 jsr %a3@ (*asr->handler)( signal_set ); 49eea: 2f03 movel %d3,%sp@- 49eec: 206a 000a moveal %a2@(10),%a0 49ef0: 4e90 jsr %a0@ asr->nest_level -= 1; 49ef2: 53aa 001a subql #1,%a2@(26) rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 49ef6: 2f02 movel %d2,%sp@- 49ef8: 2f3c 0000 ffff movel #65535,%sp@- 49efe: 2f2e fffc movel %fp@(-4),%sp@- 49f02: 4e93 jsr %a3@ 49f04: 4fef 001c lea %sp@(28),%sp } 49f08: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3 49f0e: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000577cc <_Region_Process_queue>: */ void _Region_Process_queue( Region_Control *the_region ) { 577cc: 4e56 ffe4 linkw %fp,#-28 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 577d0: 2039 0007 5048 movel 75048 <_Thread_Dispatch_disable_level>,%d0 577d6: 5280 addql #1,%d0 577d8: 48d7 3c1c moveml %d2-%d4/%a2-%a5,%sp@ 577dc: 266e 0008 moveal %fp@(8),%a3 577e0: 23c0 0007 5048 movel %d0,75048 <_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(); 577e6: 2f39 0007 50ea movel 750ea <_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 ); 577ec: 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 ); 577ee: 260b movel %a3,%d3 577f0: 0682 0000 0010 addil #16,%d2 577f6: 0683 0000 0068 addil #104,%d3 577fc: 4bf9 0005 358c lea 5358c <_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 ); 57802: 49f9 0005 7dbc lea 57dbc <_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(); 57808: 4eb9 0005 2bd4 jsr 52bd4 <_API_Mutex_Unlock> 5780e: 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 ); 57810: 283c 0005 7ebc movel #360124,%d4 57816: 2f02 movel %d2,%sp@- 57818: 2044 moveal %d4,%a0 5781a: 4e90 jsr %a0@ if ( the_thread == NULL ) 5781c: 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 ); 5781e: 2440 moveal %d0,%a2 if ( the_thread == NULL ) 57820: 4a80 tstl %d0 57822: 672c beqs 57850 <_Region_Process_queue+0x84> 57824: 42a7 clrl %sp@- 57826: 42a7 clrl %sp@- 57828: 2f2a 0024 movel %a2@(36),%sp@- 5782c: 2f03 movel %d3,%sp@- 5782e: 4e95 jsr %a5@ the_segment = (void **) _Region_Allocate_segment( the_region, the_thread->Wait.count ); if ( the_segment == NULL ) 57830: 4fef 0010 lea %sp@(16),%sp 57834: 4a80 tstl %d0 57836: 6718 beqs 57850 <_Region_Process_queue+0x84> break; *(void **)the_thread->Wait.return_argument = the_segment; 57838: 206a 0028 moveal %a2@(40),%a0 5783c: 2080 movel %d0,%a0@ the_region->number_of_used_blocks += 1; 5783e: 52ab 0064 addql #1,%a3@(100) _Thread_queue_Extract( &the_region->Wait_queue, the_thread ); 57842: 2f0a movel %a2,%sp@- 57844: 2f02 movel %d2,%sp@- 57846: 4e94 jsr %a4@ the_thread->Wait.return_code = RTEMS_SUCCESSFUL; } 57848: 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; 5784a: 42aa 0034 clrl %a2@(52) } 5784e: 60c6 bras 57816 <_Region_Process_queue+0x4a> _Thread_Enable_dispatch(); } 57850: 4cee 3c1c ffe4 moveml %fp@(-28),%d2-%d4/%a2-%a5 57856: 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(); 57858: 4ef9 0005 4d26 jmp 54d26 <_Thread_Enable_dispatch> ... =============================================================================== 00046178 <_TOD_Validate>: */ bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 46178: 4e56 0000 linkw %fp,#0 4617c: 206e 0008 moveal %fp@(8),%a0 46180: 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(); 46182: 2039 0005 d030 movel 5d030 ,%d0 */ bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 46188: 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) || 4618a: 4a88 tstl %a0 4618c: 6762 beqs 461f0 <_TOD_Validate+0x78> <== NEVER TAKEN ) { uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / 4618e: 243c 000f 4240 movel #1000000,%d2 46194: 4c40 2002 remul %d0,%d2,%d2 rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 46198: b4a8 0018 cmpl %a0@(24),%d2 4619c: 6352 blss 461f0 <_TOD_Validate+0x78> (the_tod->ticks >= ticks_per_second) || 4619e: 763b moveq #59,%d3 461a0: b6a8 0014 cmpl %a0@(20),%d3 461a4: 654a bcss 461f0 <_TOD_Validate+0x78> (the_tod->second >= TOD_SECONDS_PER_MINUTE) || 461a6: b6a8 0010 cmpl %a0@(16),%d3 461aa: 6544 bcss 461f0 <_TOD_Validate+0x78> (the_tod->minute >= TOD_MINUTES_PER_HOUR) || 461ac: 7017 moveq #23,%d0 461ae: b0a8 000c cmpl %a0@(12),%d0 461b2: 653c bcss 461f0 <_TOD_Validate+0x78> (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || 461b4: 2028 0004 movel %a0@(4),%d0 rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || (the_tod->ticks >= ticks_per_second) || (the_tod->second >= TOD_SECONDS_PER_MINUTE) || (the_tod->minute >= TOD_MINUTES_PER_HOUR) || (the_tod->hour >= TOD_HOURS_PER_DAY) || 461b8: 6736 beqs 461f0 <_TOD_Validate+0x78> <== NEVER TAKEN (the_tod->month == 0) || 461ba: 720c moveq #12,%d1 461bc: b280 cmpl %d0,%d1 461be: 6530 bcss 461f0 <_TOD_Validate+0x78> (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || 461c0: 2410 movel %a0@,%d2 (the_tod->ticks >= ticks_per_second) || (the_tod->second >= TOD_SECONDS_PER_MINUTE) || (the_tod->minute >= TOD_MINUTES_PER_HOUR) || (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || 461c2: 0c82 0000 07c3 cmpil #1987,%d2 461c8: 6326 blss 461f0 <_TOD_Validate+0x78> (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) 461ca: 2228 0008 movel %a0@(8),%d1 (the_tod->second >= TOD_SECONDS_PER_MINUTE) || (the_tod->minute >= TOD_MINUTES_PER_HOUR) || (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || 461ce: 6720 beqs 461f0 <_TOD_Validate+0x78> <== NEVER TAKEN (the_tod->day == 0) ) return false; if ( (the_tod->year % 4) == 0 ) 461d0: 163c 0003 moveb #3,%d3 461d4: 41f9 0005 c19a lea 5c19a <_TOD_Days_per_month>,%a0 461da: c483 andl %d3,%d2 461dc: 6606 bnes 461e4 <_TOD_Validate+0x6c> days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; 461de: 2030 0c34 movel %a0@(00000034,%d0:l:4),%d0 461e2: 6004 bras 461e8 <_TOD_Validate+0x70> else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; 461e4: 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( 461e8: b081 cmpl %d1,%d0 461ea: 54c0 scc %d0 461ec: 4480 negl %d0 461ee: 6002 bras 461f2 <_TOD_Validate+0x7a> (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) return false; 461f0: 4200 clrb %d0 if ( the_tod->day > days_in_month ) return false; return true; } 461f2: 241f movel %sp@+,%d2 461f4: 261f movel %sp@+,%d3 461f6: 4e5e unlk %fp ... =============================================================================== 0004712c <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 4712c: 4e56 fff0 linkw %fp,#-16 47130: 48d7 041c moveml %d2-%d4/%a2,%sp@ 47134: 246e 0008 moveal %fp@(8),%a2 */ /* * Save original state */ original_state = the_thread->current_state; 47138: 242a 0010 movel %a2@(16),%d2 void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 4713c: 262e 000c movel %fp@(12),%d3 /* * Set a transient state for the thread so it is pulled off the Ready chains. * This will prevent it from being scheduled no matter what happens in an * ISR. */ _Thread_Set_transient( the_thread ); 47140: 2f0a movel %a2,%sp@- void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 47142: 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 ); 47146: 4eb9 0004 7f0c jsr 47f0c <_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 ) 4714c: 588f addql #4,%sp 4714e: b6aa 0014 cmpl %a2@(20),%d3 47152: 670c beqs 47160 <_Thread_Change_priority+0x34> _Thread_Set_priority( the_thread, new_priority ); 47154: 2f03 movel %d3,%sp@- 47156: 2f0a movel %a2,%sp@- 47158: 4eb9 0004 7db4 jsr 47db4 <_Thread_Set_priority> 4715e: 508f addql #8,%sp _ISR_Disable( level ); 47160: 223c 0000 0700 movel #1792,%d1 47166: 40c0 movew %sr,%d0 47168: 8280 orl %d0,%d1 4716a: 46c1 movew %d1,%sr 4716c: 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; 4716e: 222a 0010 movel %a2@(16),%d1 47172: c483 andl %d3,%d2 if ( state != STATES_TRANSIENT ) { 47174: b681 cmpl %d1,%d3 47176: 6730 beqs 471a8 <_Thread_Change_priority+0x7c> /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) 47178: 4a82 tstl %d2 4717a: 6608 bnes 47184 <_Thread_Change_priority+0x58> <== NEVER TAKEN RTEMS_INLINE_ROUTINE States_Control _States_Clear ( States_Control states_to_clear, States_Control current_state ) { return (current_state & ~states_to_clear); 4717c: 74fb moveq #-5,%d2 4717e: c481 andl %d1,%d2 47180: 2542 0010 movel %d2,%a2@(16) the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); _ISR_Enable( level ); 47184: 46c0 movew %d0,%sr */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue ( States_Control the_states ) { return (the_states & STATES_WAITING_ON_THREAD_QUEUE); 47186: 0281 0003 bee0 andil #245472,%d1 if ( _States_Is_waiting_on_thread_queue( state ) ) { 4718c: 6700 00d2 beqw 47260 <_Thread_Change_priority+0x134> _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); 47190: 2d4a 000c movel %a2,%fp@(12) 47194: 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 ); } 4719a: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 471a0: 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 ); 471a2: 4ef9 0004 7d18 jmp 47d18 <_Thread_queue_Requeue> } return; } /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) { 471a8: 4a82 tstl %d2 471aa: 6650 bnes 471fc <_Thread_Change_priority+0xd0> <== NEVER TAKEN RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 471ac: 206a 008e moveal %a2@(142),%a0 471b0: 322a 0094 movew %a2@(148),%d1 471b4: 3410 movew %a0@,%d2 * Interrupts are STILL disabled. * We now know the thread will be in the READY state when we remove * the TRANSIENT state. So we have to place it on the appropriate * Ready Queue with interrupts off. */ the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); 471b6: 42aa 0010 clrl %a2@(16) 471ba: 8282 orl %d2,%d1 471bc: 3081 movew %d1,%a0@ 471be: 206a 008a moveal %a2@(138),%a0 _Priority_Major_bit_map |= the_priority_map->ready_major; 471c2: 3239 0005 c65c movew 5c65c <_Priority_Major_bit_map>,%d1 471c8: 342a 0092 movew %a2@(146),%d2 471cc: 8282 orl %d2,%d1 471ce: 33c1 0005 c65c movew %d1,5c65c <_Priority_Major_bit_map> _Priority_Add_to_bit_map( &the_thread->Priority_map ); if ( prepend_it ) 471d4: 4a04 tstb %d4 471d6: 6710 beqs 471e8 <_Thread_Change_priority+0xbc> ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 471d8: 2250 moveal %a0@,%a1 Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 471da: 2548 0004 movel %a0,%a2@(4) before_node = after_node->next; after_node->next = the_node; 471de: 208a movel %a2,%a0@ the_node->next = before_node; before_node->previous = the_node; 471e0: 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; 471e4: 2489 movel %a1,%a2@ 471e6: 6014 bras 471fc <_Thread_Change_priority+0xd0> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 471e8: 2608 movel %a0,%d3 471ea: 5883 addql #4,%d3 ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; 471ec: 2268 0008 moveal %a0@(8),%a1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 471f0: 2483 movel %d3,%a2@ { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; the_chain->last = the_node; 471f2: 214a 0008 movel %a2,%a0@(8) old_last_node->next = the_node; 471f6: 228a movel %a2,%a1@ the_node->previous = old_last_node; 471f8: 2549 0004 movel %a1,%a2@(4) _Chain_Prepend_unprotected( the_thread->ready, &the_thread->Object.Node ); else _Chain_Append_unprotected( the_thread->ready, &the_thread->Object.Node ); } _ISR_Flash( level ); 471fc: 223c 0000 0700 movel #1792,%d1 47202: 46c0 movew %d0,%sr 47204: 8280 orl %d0,%d1 47206: 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 ); 47208: 3239 0005 c65c movew 5c65c <_Priority_Major_bit_map>,%d1 4720e: 4841 swap %d1 47210: 04c1 ff1 %d1 _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 47212: 4282 clrl %d2 47214: 41f9 0005 c6c4 lea 5c6c4 <_Priority_Bit_map>,%a0 4721a: 3401 movew %d1,%d2 4721c: 3230 2a00 movew %a0@(00000000,%d2:l:2),%d1 47220: 4841 swap %d1 47222: 04c1 ff1 %d1 return (_Priority_Bits_index( major ) << 4) + 47224: 4283 clrl %d3 47226: e98a lsll #4,%d2 47228: 3601 movew %d1,%d3 */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) _Thread_Ready_chain[ _Priority_Get_highest() ].first; 4722a: 2079 0005 c570 moveal 5c570 <_Thread_Ready_chain>,%a0 47230: 2202 movel %d2,%d1 47232: d283 addl %d3,%d1 47234: 2401 movel %d1,%d2 47236: e58a lsll #2,%d2 47238: e989 lsll #4,%d1 4723a: 91c2 subal %d2,%a0 * ready thread. */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) 4723c: 2230 1800 movel %a0@(00000000,%d1:l),%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 ); 47240: 2079 0005 c780 moveal 5c780 <_Per_CPU_Information+0xc>,%a0 * ready thread. */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) 47246: 23c1 0005 c784 movel %d1,5c784 <_Per_CPU_Information+0x10> * 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() && 4724c: b288 cmpl %a0,%d1 4724e: 670e beqs 4725e <_Thread_Change_priority+0x132> 47250: 4a28 0074 tstb %a0@(116) 47254: 6708 beqs 4725e <_Thread_Change_priority+0x132> _Thread_Executing->is_preemptible ) _Context_Switch_necessary = true; 47256: 7201 moveq #1,%d1 47258: 13c1 0005 c78c moveb %d1,5c78c <_Per_CPU_Information+0x18> _ISR_Enable( level ); 4725e: 46c0 movew %d0,%sr } 47260: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 47266: 4e5e unlk %fp ... =============================================================================== 0004726c <_Thread_Clear_state>: void _Thread_Clear_state( Thread_Control *the_thread, States_Control state ) { 4726c: 4e56 fff0 linkw %fp,#-16 47270: 206e 0008 moveal %fp@(8),%a0 47274: 48d7 041c moveml %d2-%d4/%a2,%sp@ ISR_Level level; States_Control current_state; _ISR_Disable( level ); 47278: 263c 0000 0700 movel #1792,%d3 4727e: 2203 movel %d3,%d1 void _Thread_Clear_state( Thread_Control *the_thread, States_Control state ) { 47280: 202e 000c movel %fp@(12),%d0 ISR_Level level; States_Control current_state; _ISR_Disable( level ); 47284: 40c2 movew %sr,%d2 47286: 8282 orl %d2,%d1 47288: 46c1 movew %d1,%sr current_state = the_thread->current_state; 4728a: 2228 0010 movel %a0@(16),%d1 if ( current_state & state ) { 4728e: 2800 movel %d0,%d4 47290: c881 andl %d1,%d4 47292: 6778 beqs 4730c <_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); 47294: 4680 notl %d0 47296: c081 andl %d1,%d0 current_state = the_thread->current_state = _States_Clear( state, current_state ); 47298: 2140 0010 movel %d0,%a0@(16) if ( _States_Is_ready( current_state ) ) { 4729c: 666e bnes 4730c <_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; 4729e: 2268 008e moveal %a0@(142),%a1 472a2: 3028 0094 movew %a0@(148),%d0 472a6: 3211 movew %a1@,%d1 472a8: 8081 orl %d1,%d0 472aa: 3280 movew %d0,%a1@ _Priority_Add_to_bit_map( &the_thread->Priority_map ); _Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node); 472ac: 2268 008a moveal %a0@(138),%a1 _Priority_Major_bit_map |= the_priority_map->ready_major; 472b0: 3039 0005 c65c movew 5c65c <_Priority_Major_bit_map>,%d0 472b6: 3228 0092 movew %a0@(146),%d1 ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; 472ba: 2469 0008 moveal %a1@(8),%a2 472be: 8081 orl %d1,%d0 472c0: 33c0 0005 c65c movew %d0,5c65c <_Priority_Major_bit_map> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 472c6: 2009 movel %a1,%d0 472c8: 5880 addql #4,%d0 472ca: 2080 movel %d0,%a0@ { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; the_chain->last = the_node; 472cc: 2348 0008 movel %a0,%a1@(8) old_last_node->next = the_node; 472d0: 2488 movel %a0,%a2@ the_node->previous = old_last_node; 472d2: 214a 0004 movel %a2,%a0@(4) _ISR_Flash( level ); 472d6: 2003 movel %d3,%d0 472d8: 46c2 movew %d2,%sr 472da: 8082 orl %d2,%d0 472dc: 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 ) { 472de: 2028 0014 movel %a0@(20),%d0 472e2: 2279 0005 c784 moveal 5c784 <_Per_CPU_Information+0x10>,%a1 472e8: b0a9 0014 cmpl %a1@(20),%d0 472ec: 641e bccs 4730c <_Thread_Clear_state+0xa0> _Thread_Heir = the_thread; 472ee: 23c8 0005 c784 movel %a0,5c784 <_Per_CPU_Information+0x10> if ( _Thread_Executing->is_preemptible || 472f4: 2079 0005 c780 moveal 5c780 <_Per_CPU_Information+0xc>,%a0 472fa: 4a28 0074 tstb %a0@(116) 472fe: 6604 bnes 47304 <_Thread_Clear_state+0x98> 47300: 4a80 tstl %d0 47302: 6608 bnes 4730c <_Thread_Clear_state+0xa0> <== ALWAYS TAKEN the_thread->current_priority == 0 ) _Context_Switch_necessary = true; 47304: 7001 moveq #1,%d0 47306: 13c0 0005 c78c moveb %d0,5c78c <_Per_CPU_Information+0x18> } } } _ISR_Enable( level ); 4730c: 46c2 movew %d2,%sr } 4730e: 4cd7 041c moveml %sp@,%d2-%d4/%a2 47312: 4e5e unlk %fp ... =============================================================================== 00047498 <_Thread_Delay_ended>: void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { 47498: 4e56 fffc linkw %fp,#-4 Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 4749c: 486e fffc pea %fp@(-4) 474a0: 2f2e 0008 movel %fp@(8),%sp@- 474a4: 4eb9 0004 7638 jsr 47638 <_Thread_Get> switch ( location ) { 474aa: 508f addql #8,%sp 474ac: 4aae fffc tstl %fp@(-4) 474b0: 661e bnes 474d0 <_Thread_Delay_ended+0x38> <== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_Clear_state( 474b2: 2f3c 1000 0018 movel #268435480,%sp@- 474b8: 2f00 movel %d0,%sp@- 474ba: 4eb9 0004 726c jsr 4726c <_Thread_Clear_state> 474c0: 508f addql #8,%sp 474c2: 2039 0005 c5bc movel 5c5bc <_Thread_Dispatch_disable_level>,%d0 474c8: 5380 subql #1,%d0 474ca: 23c0 0005 c5bc movel %d0,5c5bc <_Thread_Dispatch_disable_level> | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Thread_Unnest_dispatch(); break; } } 474d0: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000474d4 <_Thread_Dispatch>: * dispatch thread * no dispatch thread */ void _Thread_Dispatch( void ) { 474d4: 4e56 ffc8 linkw %fp,#-56 474d8: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ Thread_Control *executing; Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); 474dc: 283c 0000 0700 movel #1792,%d4 474e2: 2204 movel %d4,%d1 { Thread_Control *executing; Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; 474e4: 2479 0005 c780 moveal 5c780 <_Per_CPU_Information+0xc>,%a2 _ISR_Disable( level ); 474ea: 40c0 movew %sr,%d0 474ec: 8280 orl %d0,%d1 474ee: 46c1 movew %d1,%sr _ISR_Enable( level ); #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 474f0: 260e movel %fp,%d3 _Timestamp_Subtract( 474f2: 240e movel %fp,%d2 _ISR_Enable( level ); #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 474f4: 5183 subql #8,%d3 _Timestamp_Subtract( 474f6: 0682 ffff fff0 addil #-16,%d2 &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); 474fc: 2e3c 0004 8244 movel #295492,%d7 if ( _Thread_libc_reent ) { executing->libc_reent = *_Thread_libc_reent; *_Thread_libc_reent = heir->libc_reent; } _User_extensions_Thread_switch( executing, heir ); 47502: 2c3c 0004 84f8 movel #296184,%d6 if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 47508: 2a3c 0004 880c movel #296972,%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 ); 4750e: 4bf9 0004 8974 lea 48974 <_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 ); 47514: 49f9 0004 8952 lea 48952 <_CPU_Context_save_fp>,%a4 Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { 4751a: 6000 00d4 braw 475f0 <_Thread_Dispatch+0x11c> heir = _Thread_Heir; _Thread_Dispatch_disable_level = 1; 4751e: 7201 moveq #1,%d1 47520: 23c1 0005 c5bc movel %d1,5c5bc <_Thread_Dispatch_disable_level> ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { heir = _Thread_Heir; 47526: 2679 0005 c784 moveal 5c784 <_Per_CPU_Information+0x10>,%a3 _Thread_Dispatch_disable_level = 1; _Context_Switch_necessary = false; 4752c: 4201 clrb %d1 _Thread_Executing = heir; 4752e: 23cb 0005 c780 movel %a3,5c780 <_Per_CPU_Information+0xc> executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { heir = _Thread_Heir; _Thread_Dispatch_disable_level = 1; _Context_Switch_necessary = false; 47534: 13c1 0005 c78c moveb %d1,5c78c <_Per_CPU_Information+0x18> /* * When the heir and executing are the same, then we are being * requested to do the post switch dispatching. This is normally * done to dispatch signals. */ if ( heir == executing ) 4753a: b5cb cmpal %a3,%a2 4753c: 6700 00bc beqw 475fa <_Thread_Dispatch+0x126> */ #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 ) 47540: 7201 moveq #1,%d1 47542: b2ab 007a cmpl %a3@(122),%d1 47546: 660a bnes 47552 <_Thread_Dispatch+0x7e> heir->cpu_time_budget = _Thread_Ticks_per_timeslice; 47548: 41f9 0005 c574 lea 5c574 <_Thread_Ticks_per_timeslice>,%a0 4754e: 2750 0076 movel %a0@,%a3@(118) _ISR_Enable( level ); 47552: 46c0 movew %d0,%sr #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 47554: 2f03 movel %d3,%sp@- 47556: 4eb9 0004 a228 jsr 4a228 <_TOD_Get_uptime> _Timestamp_Subtract( 4755c: 2f02 movel %d2,%sp@- 4755e: 2f03 movel %d3,%sp@- 47560: 4879 0005 c66a pea 5c66a <_Thread_Time_of_last_context_switch> 47566: 4eb9 0004 827c jsr 4827c <_Timespec_Subtract> &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); 4756c: 2047 moveal %d7,%a0 4756e: 2f02 movel %d2,%sp@- 47570: 486a 0082 pea %a2@(130) 47574: 4e90 jsr %a0@ #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 47576: 2079 0005 c642 moveal 5c642 <_Thread_libc_reent>,%a0 4757c: 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; 47580: 202e fff8 movel %fp@(-8),%d0 47584: 222e fffc movel %fp@(-4),%d1 47588: 23c0 0005 c66a movel %d0,5c66a <_Thread_Time_of_last_context_switch> 4758e: 23c1 0005 c66e movel %d1,5c66e <_Thread_Time_of_last_context_switch+0x4> #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 47594: 4a88 tstl %a0 47596: 6708 beqs 475a0 <_Thread_Dispatch+0xcc> <== NEVER TAKEN executing->libc_reent = *_Thread_libc_reent; 47598: 2550 0104 movel %a0@,%a2@(260) *_Thread_libc_reent = heir->libc_reent; 4759c: 20ab 0104 movel %a3@(260),%a0@ } _User_extensions_Thread_switch( executing, heir ); 475a0: 2f0b movel %a3,%sp@- 475a2: 2046 moveal %d6,%a0 475a4: 2f0a movel %a2,%sp@- 475a6: 4e90 jsr %a0@ if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 475a8: 486b 00cc pea %a3@(204) 475ac: 2045 moveal %d5,%a0 475ae: 486a 00cc pea %a2@(204) 475b2: 4e90 jsr %a0@ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && 475b4: 4fef 0010 lea %sp@(16),%sp 475b8: 4aaa 0100 tstl %a2@(256) 475bc: 6724 beqs 475e2 <_Thread_Dispatch+0x10e> #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 ); 475be: 2079 0005 c63e moveal 5c63e <_Thread_Allocated_fp>,%a0 475c4: b1ca cmpal %a2,%a0 475c6: 671a beqs 475e2 <_Thread_Dispatch+0x10e> !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) 475c8: 4a88 tstl %a0 475ca: 6708 beqs 475d4 <_Thread_Dispatch+0x100> _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 475cc: 4868 0100 pea %a0@(256) 475d0: 4e94 jsr %a4@ 475d2: 588f addql #4,%sp _Context_Restore_fp( &executing->fp_context ); 475d4: 486a 0100 pea %a2@(256) 475d8: 4e95 jsr %a5@ _Thread_Allocated_fp = executing; 475da: 588f addql #4,%sp 475dc: 23ca 0005 c63e movel %a2,5c63e <_Thread_Allocated_fp> if ( executing->fp_context != NULL ) _Context_Restore_fp( &executing->fp_context ); #endif #endif executing = _Thread_Executing; 475e2: 2479 0005 c780 moveal 5c780 <_Per_CPU_Information+0xc>,%a2 _ISR_Disable( level ); 475e8: 2204 movel %d4,%d1 475ea: 40c0 movew %sr,%d0 475ec: 8280 orl %d0,%d1 475ee: 46c1 movew %d1,%sr Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { 475f0: 1239 0005 c78c moveb 5c78c <_Per_CPU_Information+0x18>,%d1 475f6: 6600 ff26 bnew 4751e <_Thread_Dispatch+0x4a> _ISR_Disable( level ); } post_switch: _Thread_Dispatch_disable_level = 0; 475fa: 42b9 0005 c5bc clrl 5c5bc <_Thread_Dispatch_disable_level> _ISR_Enable( level ); 47600: 46c0 movew %d0,%sr _API_extensions_Run_postswitch(); 47602: 4eb9 0004 5f88 jsr 45f88 <_API_extensions_Run_postswitch> } 47608: 4cee 3cfc ffc8 moveml %fp@(-56),%d2-%d7/%a2-%a5 4760e: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00047638 <_Thread_Get>: Thread_Control *_Thread_Get ( Objects_Id id, Objects_Locations *location ) { 47638: 4e56 0000 linkw %fp,#0 4763c: 202e 0008 movel %fp@(8),%d0 47640: 2f03 movel %d3,%sp@- 47642: 206e 000c moveal %fp@(12),%a0 47646: 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 ) ) { 47648: 4a80 tstl %d0 4764a: 6618 bnes 47664 <_Thread_Get+0x2c> rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 4764c: 2039 0005 c5bc movel 5c5bc <_Thread_Dispatch_disable_level>,%d0 47652: 5280 addql #1,%d0 47654: 23c0 0005 c5bc movel %d0,5c5bc <_Thread_Dispatch_disable_level> _Thread_Disable_dispatch(); *location = OBJECTS_LOCAL; 4765a: 4290 clrl %a0@ tp = _Thread_Executing; 4765c: 2039 0005 c780 movel 5c780 <_Per_CPU_Information+0xc>,%d0 goto done; 47662: 6044 bras 476a8 <_Thread_Get+0x70> */ RTEMS_INLINE_ROUTINE Objects_APIs _Objects_Get_API( Objects_Id id ) { return (Objects_APIs) ((id >> OBJECTS_API_START_BIT) & OBJECTS_API_VALID_BITS); 47664: 7418 moveq #24,%d2 47666: 2200 movel %d0,%d1 47668: e4a9 lsrl %d2,%d1 4766a: 7607 moveq #7,%d3 */ RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid( uint32_t the_api ) { if ( !the_api || the_api > OBJECTS_APIS_LAST ) 4766c: 143c 0002 moveb #2,%d2 */ RTEMS_INLINE_ROUTINE Objects_APIs _Objects_Get_API( Objects_Id id ) { return (Objects_APIs) ((id >> OBJECTS_API_START_BIT) & OBJECTS_API_VALID_BITS); 47670: c283 andl %d3,%d1 */ RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid( uint32_t the_api ) { if ( !the_api || the_api > OBJECTS_APIS_LAST ) 47672: 2241 moveal %d1,%a1 47674: 5389 subql #1,%a1 47676: b489 cmpl %a1,%d2 47678: 643a bccs 476b4 <_Thread_Get+0x7c> 4767a: 6014 bras 47690 <_Thread_Get+0x58> if ( the_class != 1 ) { /* threads are always first class :) */ *location = OBJECTS_ERROR; goto done; } api_information = _Objects_Information_table[ the_api ]; 4767c: 43f9 0005 c578 lea 5c578 <_Objects_Information_table>,%a1 47682: 2271 1c00 moveal %a1@(00000000,%d1:l:4),%a1 if ( !api_information ) { 47686: 4a89 tstl %a1 47688: 6706 beqs 47690 <_Thread_Get+0x58> <== NEVER TAKEN *location = OBJECTS_ERROR; goto done; } information = api_information[ the_class ]; 4768a: 2229 0004 movel %a1@(4),%d1 if ( !information ) { 4768e: 6608 bnes 47698 <_Thread_Get+0x60> *location = OBJECTS_ERROR; 47690: 7001 moveq #1,%d0 47692: 2080 movel %d0,%a0@ { uint32_t the_api; uint32_t the_class; Objects_Information **api_information; Objects_Information *information; Thread_Control *tp = (Thread_Control *) 0; 47694: 4280 clrl %d0 } information = api_information[ the_class ]; if ( !information ) { *location = OBJECTS_ERROR; goto done; 47696: 6010 bras 476a8 <_Thread_Get+0x70> } tp = (Thread_Control *) _Objects_Get( information, id, location ); 47698: 2f08 movel %a0,%sp@- 4769a: 2f00 movel %d0,%sp@- 4769c: 2f01 movel %d1,%sp@- 4769e: 4eb9 0004 6dd8 jsr 46dd8 <_Objects_Get> 476a4: 4fef 000c lea %sp@(12),%sp done: return tp; } 476a8: 242e fff8 movel %fp@(-8),%d2 476ac: 262e fffc movel %fp@(-4),%d3 476b0: 4e5e unlk %fp 476b2: 4e75 rts */ RTEMS_INLINE_ROUTINE uint32_t _Objects_Get_class( Objects_Id id ) { return (uint32_t) 476b4: 761b moveq #27,%d3 476b6: 2400 movel %d0,%d2 476b8: e6aa lsrl %d3,%d2 *location = OBJECTS_ERROR; goto done; } the_class = _Objects_Get_class( id ); if ( the_class != 1 ) { /* threads are always first class :) */ 476ba: 163c 0001 moveb #1,%d3 476be: b682 cmpl %d2,%d3 476c0: 67ba beqs 4767c <_Thread_Get+0x44> 476c2: 60cc bras 47690 <_Thread_Get+0x58> =============================================================================== 0004bb78 <_Thread_Handler>: * * Output parameters: NONE */ void _Thread_Handler( void ) { 4bb78: 4e56 0000 linkw %fp,#0 4bb7c: 2f0a movel %a2,%sp@- #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static char doneConstructors; char doneCons; #endif executing = _Thread_Executing; 4bb7e: 2479 0005 c780 moveal 5c780 <_Per_CPU_Information+0xc>,%a2 * * Output parameters: NONE */ void _Thread_Handler( void ) { 4bb84: 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; 4bb86: 222a 00b4 movel %a2@(180),%d1 _ISR_Set_level(level); 4bb8a: 40c0 movew %sr,%d0 4bb8c: e189 lsll #8,%d1 4bb8e: 0280 0000 f8ff andil #63743,%d0 4bb94: 8081 orl %d1,%d0 4bb96: 46c0 movew %d0,%sr #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) doneCons = doneConstructors; doneConstructors = 1; 4bb98: 7001 moveq #1,%d0 level = executing->Start.isr_level; _ISR_Set_level(level); #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) doneCons = doneConstructors; 4bb9a: 1439 0005 bd7c moveb 5bd7c ,%d2 doneConstructors = 1; 4bba0: 13c0 0005 bd7c moveb %d0,5bd7c #endif #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && 4bba6: 4aaa 0100 tstl %a2@(256) 4bbaa: 6720 beqs 4bbcc <_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 ); 4bbac: 2079 0005 c63e moveal 5c63e <_Thread_Allocated_fp>,%a0 4bbb2: b1ca cmpal %a2,%a0 4bbb4: 6716 beqs 4bbcc <_Thread_Handler+0x54> !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) 4bbb6: 4a88 tstl %a0 4bbb8: 670c beqs 4bbc6 <_Thread_Handler+0x4e> _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 4bbba: 4868 0100 pea %a0@(256) 4bbbe: 4eb9 0004 8952 jsr 48952 <_CPU_Context_save_fp> 4bbc4: 588f addql #4,%sp _Thread_Allocated_fp = executing; 4bbc6: 23ca 0005 c63e movel %a2,5c63e <_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 ); 4bbcc: 2f0a movel %a2,%sp@- 4bbce: 4eb9 0004 8374 jsr 48374 <_User_extensions_Thread_begin> /* * At this point, the dispatch disable level BETTER be 1. */ _Thread_Enable_dispatch(); 4bbd4: 4eb9 0004 7612 jsr 47612 <_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) */ { 4bbda: 588f addql #4,%sp 4bbdc: 4a02 tstb %d2 4bbde: 6606 bnes 4bbe6 <_Thread_Handler+0x6e> INIT_NAME (); 4bbe0: 4eb9 0005 9568 jsr 59568 <_init> } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 4bbe6: 4aaa 009e tstl %a2@(158) 4bbea: 6610 bnes 4bbfc <_Thread_Handler+0x84> <== NEVER TAKEN executing->Wait.return_argument = (*(Thread_Entry_numeric) executing->Start.entry_point)( 4bbec: 2f2a 00a6 movel %a2@(166),%sp@- 4bbf0: 206a 009a moveal %a2@(154),%a0 4bbf4: 4e90 jsr %a0@ INIT_NAME (); } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { executing->Wait.return_argument = 4bbf6: 588f addql #4,%sp 4bbf8: 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 ); 4bbfc: 2f0a movel %a2,%sp@- 4bbfe: 4eb9 0004 83ac jsr 483ac <_User_extensions_Thread_exitted> _Internal_error_Occurred( 4bc04: 4878 0005 pea 5 4bc08: 4878 0001 pea 1 4bc0c: 42a7 clrl %sp@- 4bc0e: 4eb9 0004 68cc jsr 468cc <_Internal_error_Occurred> =============================================================================== 000476c4 <_Thread_Initialize>: Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 476c4: 4e56 ffec linkw %fp,#-20 476c8: 48d7 043c moveml %d2-%d5/%a2,%sp@ 476cc: 246e 000c moveal %fp@(12),%a2 476d0: 242e 0014 movel %fp@(20),%d2 /* * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; 476d4: 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 ) { 476d8: 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; 476dc: 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 ) { 476e0: 162e 001b moveb %fp@(27),%d3 */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; extensions_area = NULL; the_thread->libc_reent = NULL; 476e4: 42aa 0104 clrl %a2@(260) Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 476e8: 1a2e 0023 moveb %fp@(35),%d5 /* * 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 ); 476ec: 2f02 movel %d2,%sp@- 476ee: 2f0a movel %a2,%sp@- 476f0: 4eb9 0004 7f84 jsr 47f84 <_Thread_Stack_Allocate> if ( !actual_stack_size || actual_stack_size < stack_size ) 476f6: 508f addql #8,%sp 476f8: 4a80 tstl %d0 476fa: 6700 0142 beqw 4783e <_Thread_Initialize+0x17a> 476fe: b480 cmpl %d0,%d2 47700: 6200 013c bhiw 4783e <_Thread_Initialize+0x17a> void *starting_address, size_t size ) { the_stack->area = starting_address; the_stack->size = size; 47704: 2540 00bc movel %d0,%a2@(188) Stack_Control *the_stack, void *starting_address, size_t size ) { the_stack->area = starting_address; 47708: 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 ) { 4770e: 4a03 tstb %d3 47710: 6714 beqs 47726 <_Thread_Initialize+0x62> fp_area = _Workspace_Allocate( CONTEXT_FP_SIZE ); 47712: 4878 001c pea 1c 47716: 4eb9 0004 87a4 jsr 487a4 <_Workspace_Allocate> if ( !fp_area ) 4771c: 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 ); 4771e: 2600 movel %d0,%d3 if ( !fp_area ) 47720: 6606 bnes 47728 <_Thread_Initialize+0x64> 47722: 6000 00c2 braw 477e6 <_Thread_Initialize+0x122> extensions_area = NULL; the_thread->libc_reent = NULL; #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) fp_area = NULL; 47726: 4283 clrl %d3 #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { 47728: 2039 0005 c64e movel 5c64e <_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; 4772e: 2543 0100 movel %d3,%a2@(256) the_thread->Start.fp_context = fp_area; 47732: 2543 00c4 movel %d3,%a2@(196) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 47736: 42aa 0050 clrl %a2@(80) the_watchdog->routine = routine; 4773a: 42aa 0064 clrl %a2@(100) the_watchdog->id = id; 4773e: 42aa 0068 clrl %a2@(104) the_watchdog->user_data = user_data; 47742: 42aa 006c clrl %a2@(108) #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { 47746: 4a80 tstl %d0 47748: 6718 beqs 47762 <_Thread_Initialize+0x9e> extensions_area = _Workspace_Allocate( 4774a: e588 lsll #2,%d0 4774c: 2040 moveal %d0,%a0 4774e: 4868 0004 pea %a0@(4) 47752: 4eb9 0004 87a4 jsr 487a4 <_Workspace_Allocate> (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) 47758: 588f addql #4,%sp /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { extensions_area = _Workspace_Allocate( 4775a: 2400 movel %d0,%d2 (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) 4775c: 6606 bnes 47764 <_Thread_Initialize+0xa0> 4775e: 6000 0088 braw 477e8 <_Thread_Initialize+0x124> * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; extensions_area = NULL; 47762: 4282 clrl %d2 (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) goto failed; } the_thread->extensions = (void **) extensions_area; 47764: 2542 0110 movel %d2,%a2@(272) * 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 ) { 47768: 6714 beqs 4777e <_Thread_Initialize+0xba> for ( i = 0; i <= _Thread_Maximum_extensions ; i++ ) 4776a: 2239 0005 c64e movel 5c64e <_Thread_Maximum_extensions>,%d1 47770: 2042 moveal %d2,%a0 47772: 4280 clrl %d0 47774: 6004 bras 4777a <_Thread_Initialize+0xb6> the_thread->extensions[i] = NULL; 47776: 4298 clrl %a0@+ * create the extension long after tasks have been created * so they cannot rely on the thread create user extension * call. */ if ( the_thread->extensions ) { for ( i = 0; i <= _Thread_Maximum_extensions ; i++ ) 47778: 5280 addql #1,%d0 4777a: b280 cmpl %d0,%d1 4777c: 64f8 bccs 47776 <_Thread_Initialize+0xb2> #endif } the_thread->Start.isr_level = isr_level; the_thread->current_state = STATES_DORMANT; 4777e: 7001 moveq #1,%d0 /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; 47780: 256e 0024 00ac movel %fp@(36),%a2@(172) the_thread->Start.budget_callout = budget_callout; 47786: 256e 0028 00b0 movel %fp@(40),%a2@(176) case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; 4778c: 256e 002c 00b4 movel %fp@(44),%a2@(180) /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; 47792: 1545 00aa moveb %d5,%a2@(170) #endif } the_thread->Start.isr_level = isr_level; the_thread->current_state = STATES_DORMANT; 47796: 2540 0010 movel %d0,%a2@(16) the_thread->Wait.queue = NULL; 4779a: 42aa 0044 clrl %a2@(68) the_thread->resource_count = 0; 4779e: 42aa 001c clrl %a2@(28) the_thread->real_priority = priority; 477a2: 2544 0018 movel %d4,%a2@(24) the_thread->Start.initial_priority = priority; 477a6: 2544 00b8 movel %d4,%a2@(184) _Thread_Set_priority( the_thread, priority ); 477aa: 2f04 movel %d4,%sp@- 477ac: 2f0a movel %a2,%sp@- 477ae: 4eb9 0004 7db4 jsr 47db4 <_Thread_Set_priority> _Thread_Stack_Free( the_thread ); return false; } 477b4: 206e 0008 moveal %fp@(8),%a0 Objects_Information *information, Objects_Control *the_object, Objects_Name name ) { _Objects_Set_local_object( 477b8: 4280 clrl %d0 477ba: 2068 0018 moveal %a0@(24),%a0 477be: 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 ); 477c2: 42aa 0082 clrl %a2@(130) 477c6: 42aa 0086 clrl %a2@(134) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 477ca: 218a 0c00 movel %a2,%a0@(00000000,%d0:l:4) information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 477ce: 256e 0030 000c movel %fp@(48),%a2@(12) * 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 ); 477d4: 2f0a movel %a2,%sp@- 477d6: 4eb9 0004 8430 jsr 48430 <_User_extensions_Thread_create> if ( extension_status ) 477dc: 4fef 000c lea %sp@(12),%sp 477e0: 4a00 tstb %d0 477e2: 6704 beqs 477e8 <_Thread_Initialize+0x124> 477e4: 605c bras 47842 <_Thread_Initialize+0x17e> * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; extensions_area = NULL; 477e6: 4282 clrl %d2 extension_status = _User_extensions_Thread_create( the_thread ); if ( extension_status ) return true; failed: if ( the_thread->libc_reent ) 477e8: 202a 0104 movel %a2@(260),%d0 477ec: 670a beqs 477f8 <_Thread_Initialize+0x134> _Workspace_Free( the_thread->libc_reent ); 477ee: 2f00 movel %d0,%sp@- 477f0: 4eb9 0004 87c0 jsr 487c0 <_Workspace_Free> 477f6: 588f addql #4,%sp for ( i=0 ; i <= THREAD_API_LAST ; i++ ) if ( the_thread->API_Extensions[i] ) 477f8: 202a 0108 movel %a2@(264),%d0 477fc: 670a beqs 47808 <_Thread_Initialize+0x144> _Workspace_Free( the_thread->API_Extensions[i] ); 477fe: 2f00 movel %d0,%sp@- 47800: 4eb9 0004 87c0 jsr 487c0 <_Workspace_Free> 47806: 588f addql #4,%sp 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] ) 47808: 202a 010c movel %a2@(268),%d0 4780c: 670a beqs 47818 <_Thread_Initialize+0x154> <== ALWAYS TAKEN _Workspace_Free( the_thread->API_Extensions[i] ); 4780e: 2f00 movel %d0,%sp@- <== NOT EXECUTED 47810: 4eb9 0004 87c0 jsr 487c0 <_Workspace_Free> <== NOT EXECUTED 47816: 588f addql #4,%sp <== NOT EXECUTED if ( extensions_area ) 47818: 4a82 tstl %d2 4781a: 670a beqs 47826 <_Thread_Initialize+0x162> (void) _Workspace_Free( extensions_area ); 4781c: 2f02 movel %d2,%sp@- 4781e: 4eb9 0004 87c0 jsr 487c0 <_Workspace_Free> 47824: 588f addql #4,%sp #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( fp_area ) 47826: 4a83 tstl %d3 47828: 670a beqs 47834 <_Thread_Initialize+0x170> (void) _Workspace_Free( fp_area ); 4782a: 2f03 movel %d3,%sp@- 4782c: 4eb9 0004 87c0 jsr 487c0 <_Workspace_Free> 47832: 588f addql #4,%sp #endif _Thread_Stack_Free( the_thread ); 47834: 2f0a movel %a2,%sp@- 47836: 4eb9 0004 7fd0 jsr 47fd0 <_Thread_Stack_Free> return false; 4783c: 588f addql #4,%sp * 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 ); if ( !actual_stack_size || actual_stack_size < stack_size ) return false; /* stack allocation failed */ 4783e: 4200 clrb %d0 47840: 6002 bras 47844 <_Thread_Initialize+0x180> * Mutex provides sufficient protection to let the user extensions * run safely. */ extension_status = _User_extensions_Thread_create( the_thread ); if ( extension_status ) return true; 47842: 7001 moveq #1,%d0 _Thread_Stack_Free( the_thread ); return false; } 47844: 4cee 043c ffec moveml %fp@(-20),%d2-%d5/%a2 4784a: 4e5e unlk %fp ... =============================================================================== 0004856c <_Thread_Restart>: */ RTEMS_INLINE_ROUTINE bool _States_Is_dormant ( States_Control the_states ) { return (the_states & STATES_DORMANT); 4856c: 7001 moveq #1,%d0 bool _Thread_Restart( Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { 4856e: 4e56 0000 linkw %fp,#0 48572: 2f0a movel %a2,%sp@- 48574: 246e 0008 moveal %fp@(8),%a2 48578: c0aa 0010 andl %a2@(16),%d0 if ( !_States_Is_dormant( the_thread->current_state ) ) { 4857c: 6664 bnes 485e2 <_Thread_Restart+0x76> _Thread_Set_transient( the_thread ); 4857e: 2f0a movel %a2,%sp@- 48580: 4eb9 0004 8748 jsr 48748 <_Thread_Set_transient> _Thread_Reset( the_thread, pointer_argument, numeric_argument ); 48586: 2f2e 0010 movel %fp@(16),%sp@- 4858a: 2f2e 000c movel %fp@(12),%sp@- 4858e: 2f0a movel %a2,%sp@- 48590: 4eb9 0004 b168 jsr 4b168 <_Thread_Reset> _Thread_Load_environment( the_thread ); 48596: 2f0a movel %a2,%sp@- 48598: 4eb9 0004 ae14 jsr 4ae14 <_Thread_Load_environment> _Thread_Ready( the_thread ); 4859e: 2f0a movel %a2,%sp@- 485a0: 4eb9 0004 b0a8 jsr 4b0a8 <_Thread_Ready> _User_extensions_Thread_restart( the_thread ); 485a6: 2f0a movel %a2,%sp@- 485a8: 4eb9 0004 8cf4 jsr 48cf4 <_User_extensions_Thread_restart> if ( _Thread_Is_executing ( the_thread ) ) 485ae: 4fef 001c lea %sp@(28),%sp 485b2: b5f9 0005 d2a8 cmpal 5d2a8 <_Per_CPU_Information+0xc>,%a2 485b8: 662c bnes 485e6 <_Thread_Restart+0x7a> */ RTEMS_INLINE_ROUTINE void _Thread_Restart_self( void ) { #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( _Thread_Executing->fp_context != NULL ) 485ba: 4aaa 0100 tstl %a2@(256) 485be: 670c beqs 485cc <_Thread_Restart+0x60> _Context_Restore_fp( &_Thread_Executing->fp_context ); 485c0: 486a 0100 pea %a2@(256) 485c4: 4eb9 0004 91f0 jsr 491f0 <_CPU_Context_restore_fp> 485ca: 588f addql #4,%sp #endif _CPU_Context_Restart_self( &_Thread_Executing->Registers ); 485cc: 2079 0005 d2a8 moveal 5d2a8 <_Per_CPU_Information+0xc>,%a0 485d2: 41e8 00cc lea %a0@(204),%a0 485d6: 2f08 movel %a0,%sp@- 485d8: 4eb9 0004 909e jsr 4909e <_CPU_Context_Restart_self> 485de: 588f addql #4,%sp <== NOT EXECUTED 485e0: 6004 bras 485e6 <_Thread_Restart+0x7a> <== NOT EXECUTED _Thread_Restart_self(); return true; } return false; 485e2: 4200 clrb %d0 485e4: 6002 bras 485e8 <_Thread_Restart+0x7c> _User_extensions_Thread_restart( the_thread ); if ( _Thread_Is_executing ( the_thread ) ) _Thread_Restart_self(); return true; 485e6: 7001 moveq #1,%d0 } return false; } 485e8: 246e fffc moveal %fp@(-4),%a2 485ec: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004abe4 <_Thread_Resume>: void _Thread_Resume( Thread_Control *the_thread, bool force ) { 4abe4: 4e56 fff4 linkw %fp,#-12 4abe8: 206e 0008 moveal %fp@(8),%a0 4abec: 48d7 040c moveml %d2-%d3/%a2,%sp@ ISR_Level level; States_Control current_state; _ISR_Disable( level ); 4abf0: 243c 0000 0700 movel #1792,%d2 4abf6: 2002 movel %d2,%d0 4abf8: 40c1 movew %sr,%d1 4abfa: 8081 orl %d1,%d0 4abfc: 46c0 movew %d0,%sr current_state = the_thread->current_state; 4abfe: 2028 0010 movel %a0@(16),%d0 if ( current_state & STATES_SUSPENDED ) { 4ac02: 0800 0001 btst #1,%d0 4ac06: 6778 beqs 4ac80 <_Thread_Resume+0x9c> <== NEVER TAKEN RTEMS_INLINE_ROUTINE States_Control _States_Clear ( States_Control states_to_clear, States_Control current_state ) { return (current_state & ~states_to_clear); 4ac08: 76fd moveq #-3,%d3 4ac0a: c083 andl %d3,%d0 current_state = the_thread->current_state = _States_Clear(STATES_SUSPENDED, current_state); 4ac0c: 2140 0010 movel %d0,%a0@(16) if ( _States_Is_ready( current_state ) ) { 4ac10: 666e bnes 4ac80 <_Thread_Resume+0x9c> RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 4ac12: 2268 008e moveal %a0@(142),%a1 4ac16: 3028 0094 movew %a0@(148),%d0 4ac1a: 3611 movew %a1@,%d3 4ac1c: 8083 orl %d3,%d0 4ac1e: 3280 movew %d0,%a1@ _Priority_Add_to_bit_map( &the_thread->Priority_map ); _Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node); 4ac20: 2268 008a moveal %a0@(138),%a1 _Priority_Major_bit_map |= the_priority_map->ready_major; 4ac24: 3039 0005 faa4 movew 5faa4 <_Priority_Major_bit_map>,%d0 4ac2a: 3628 0092 movew %a0@(146),%d3 ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; 4ac2e: 2469 0008 moveal %a1@(8),%a2 4ac32: 8083 orl %d3,%d0 4ac34: 33c0 0005 faa4 movew %d0,5faa4 <_Priority_Major_bit_map> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4ac3a: 2009 movel %a1,%d0 4ac3c: 5880 addql #4,%d0 4ac3e: 2080 movel %d0,%a0@ { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; the_chain->last = the_node; 4ac40: 2348 0008 movel %a0,%a1@(8) old_last_node->next = the_node; 4ac44: 2488 movel %a0,%a2@ the_node->previous = old_last_node; 4ac46: 214a 0004 movel %a2,%a0@(4) _ISR_Flash( level ); 4ac4a: 2002 movel %d2,%d0 4ac4c: 46c1 movew %d1,%sr 4ac4e: 8081 orl %d1,%d0 4ac50: 46c0 movew %d0,%sr if ( the_thread->current_priority < _Thread_Heir->current_priority ) { 4ac52: 2028 0014 movel %a0@(20),%d0 4ac56: 2279 0005 fbcc moveal 5fbcc <_Per_CPU_Information+0x10>,%a1 4ac5c: b0a9 0014 cmpl %a1@(20),%d0 4ac60: 641e bccs 4ac80 <_Thread_Resume+0x9c> _Thread_Heir = the_thread; 4ac62: 23c8 0005 fbcc movel %a0,5fbcc <_Per_CPU_Information+0x10> if ( _Thread_Executing->is_preemptible || 4ac68: 2079 0005 fbc8 moveal 5fbc8 <_Per_CPU_Information+0xc>,%a0 4ac6e: 4a28 0074 tstb %a0@(116) 4ac72: 6604 bnes 4ac78 <_Thread_Resume+0x94> 4ac74: 4a80 tstl %d0 4ac76: 6608 bnes 4ac80 <_Thread_Resume+0x9c> <== ALWAYS TAKEN the_thread->current_priority == 0 ) _Context_Switch_necessary = true; 4ac78: 7601 moveq #1,%d3 4ac7a: 13c3 0005 fbd4 moveb %d3,5fbd4 <_Per_CPU_Information+0x18> } } } _ISR_Enable( level ); 4ac80: 46c1 movew %d1,%sr } 4ac82: 4cd7 040c moveml %sp@,%d2-%d3/%a2 4ac86: 4e5e unlk %fp ... =============================================================================== 00047fd0 <_Thread_Stack_Free>: */ void _Thread_Stack_Free( Thread_Control *the_thread ) { 47fd0: 4e56 0000 linkw %fp,#0 47fd4: 206e 0008 moveal %fp@(8),%a0 * Call ONLY the CPU table stack free hook, or the * the RTEMS workspace free. This is so the free * routine properly matches the allocation of the stack. */ if ( Configuration.stack_free_hook ) 47fd8: 2279 0005 aeb8 moveal 5aeb8 ,%a1 47fde: 4a89 tstl %a1 47fe0: 670a beqs 47fec <_Thread_Stack_Free+0x1c> (*Configuration.stack_free_hook)( the_thread->Start.Initial_stack.area ); 47fe2: 2d68 00c0 0008 movel %a0@(192),%fp@(8) else _Workspace_Free( the_thread->Start.Initial_stack.area ); } 47fe8: 4e5e unlk %fp * the RTEMS workspace free. This is so the free * routine properly matches the allocation of the stack. */ if ( Configuration.stack_free_hook ) (*Configuration.stack_free_hook)( the_thread->Start.Initial_stack.area ); 47fea: 4ed1 jmp %a1@ else _Workspace_Free( the_thread->Start.Initial_stack.area ); 47fec: 2d68 00c0 0008 movel %a0@(192),%fp@(8) } 47ff2: 4e5e unlk %fp */ if ( Configuration.stack_free_hook ) (*Configuration.stack_free_hook)( the_thread->Start.Initial_stack.area ); else _Workspace_Free( the_thread->Start.Initial_stack.area ); 47ff4: 4ef9 0004 87c0 jmp 487c0 <_Workspace_Free> ... =============================================================================== 000481cc <_Thread_Yield_processor>: * ready chain * select heir */ void _Thread_Yield_processor( void ) { 481cc: 4e56 fff0 linkw %fp,#-16 ISR_Level level; Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; 481d0: 2079 0005 c780 moveal 5c780 <_Per_CPU_Information+0xc>,%a0 * ready chain * select heir */ void _Thread_Yield_processor( void ) { 481d6: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; ready = executing->ready; _ISR_Disable( level ); 481da: 243c 0000 0700 movel #1792,%d2 481e0: 2002 movel %d2,%d0 ISR_Level level; Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; ready = executing->ready; 481e2: 2268 008a moveal %a0@(138),%a1 _ISR_Disable( level ); 481e6: 40c1 movew %sr,%d1 481e8: 8081 orl %d1,%d0 481ea: 46c0 movew %d0,%sr */ RTEMS_INLINE_ROUTINE bool _Chain_Has_only_one_node( const Chain_Control *the_chain ) { return (the_chain->first == the_chain->last); 481ec: 2469 0008 moveal %a1@(8),%a2 if ( !_Chain_Has_only_one_node( ready ) ) { 481f0: b5d1 cmpal %a1@,%a2 481f2: 6734 beqs 48228 <_Thread_Yield_processor+0x5c> ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 481f4: 2850 moveal %a0@,%a4 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 481f6: 2009 movel %a1,%d0 481f8: 5880 addql #4,%d0 { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 481fa: 2668 0004 moveal %a0@(4),%a3 next->previous = previous; previous->next = next; 481fe: 268c movel %a4,%a3@ Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 48200: 294b 0004 movel %a3,%a4@(4) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 48204: 2080 movel %d0,%a0@ { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; the_chain->last = the_node; 48206: 2348 0008 movel %a0,%a1@(8) old_last_node->next = the_node; 4820a: 2488 movel %a0,%a2@ the_node->previous = old_last_node; 4820c: 214a 0004 movel %a2,%a0@(4) _Chain_Extract_unprotected( &executing->Object.Node ); _Chain_Append_unprotected( ready, &executing->Object.Node ); _ISR_Flash( level ); 48210: 2002 movel %d2,%d0 48212: 46c1 movew %d1,%sr 48214: 8081 orl %d1,%d0 48216: 46c0 movew %d0,%sr if ( _Thread_Is_heir( executing ) ) 48218: b1f9 0005 c784 cmpal 5c784 <_Per_CPU_Information+0x10>,%a0 4821e: 6610 bnes 48230 <_Thread_Yield_processor+0x64> <== NEVER TAKEN _Thread_Heir = (Thread_Control *) ready->first; 48220: 23d1 0005 c784 movel %a1@,5c784 <_Per_CPU_Information+0x10> 48226: 6008 bras 48230 <_Thread_Yield_processor+0x64> _Context_Switch_necessary = true; } else if ( !_Thread_Is_heir( executing ) ) 48228: b1f9 0005 c784 cmpal 5c784 <_Per_CPU_Information+0x10>,%a0 4822e: 6708 beqs 48238 <_Thread_Yield_processor+0x6c> <== ALWAYS TAKEN _Context_Switch_necessary = true; 48230: 7001 moveq #1,%d0 48232: 13c0 0005 c78c moveb %d0,5c78c <_Per_CPU_Information+0x18> _ISR_Enable( level ); 48238: 46c1 movew %d1,%sr } 4823a: 4cd7 1c04 moveml %sp@,%d2/%a2-%a4 4823e: 4e5e unlk %fp ... =============================================================================== 000470dc <_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 ) ) { 470dc: 7202 moveq #2,%d1 Thread_blocking_operation_States sync_state __attribute__((unused)), #endif Thread_Control *the_thread, ISR_Level level ) { 470de: 4e56 0000 linkw %fp,#0 470e2: 202e 0010 movel %fp@(16),%d0 470e6: 2f0a movel %a2,%sp@- 470e8: 246e 000c moveal %fp@(12),%a2 #endif /* * The thread is not waiting on anything after this completes. */ the_thread->Wait.queue = NULL; 470ec: 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 ) ) { 470f0: b2aa 0050 cmpl %a2@(80),%d1 470f4: 6618 bnes 4710e <_Thread_blocking_operation_Cancel+0x32> RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 470f6: 123c 0003 moveb #3,%d1 470fa: 2541 0050 movel %d1,%a2@(80) _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 470fe: 46c0 movew %d0,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 47100: 486a 0048 pea %a2@(72) 47104: 4eb9 0004 864c jsr 4864c <_Watchdog_Remove> 4710a: 588f addql #4,%sp 4710c: 6002 bras 47110 <_Thread_blocking_operation_Cancel+0x34> } else _ISR_Enable( level ); 4710e: 46c0 movew %d0,%sr RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 47110: 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 } 47114: 246e fffc moveal %fp@(-4),%a2 47118: 203c 1003 fff8 movel #268697592,%d0 4711e: 2d40 000c movel %d0,%fp@(12) 47122: 4e5e unlk %fp 47124: 4ef9 0004 726c jmp 4726c <_Thread_Clear_state> ... =============================================================================== 0004bc14 <_Thread_queue_Extract_fifo>: Thread_Control *the_thread ) { ISR_Level level; _ISR_Disable( level ); 4bc14: 223c 0000 0700 movel #1792,%d1 void _Thread_queue_Extract_fifo( Thread_queue_Control *the_thread_queue __attribute__((unused)), Thread_Control *the_thread ) { 4bc1a: 4e56 0000 linkw %fp,#0 4bc1e: 2f0a movel %a2,%sp@- 4bc20: 246e 000c moveal %fp@(12),%a2 ISR_Level level; _ISR_Disable( level ); 4bc24: 40c0 movew %sr,%d0 4bc26: 8280 orl %d0,%d1 4bc28: 46c1 movew %d1,%sr 4bc2a: 222a 0010 movel %a2@(16),%d1 4bc2e: 0281 0003 bee0 andil #245472,%d1 if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 4bc34: 660a bnes 4bc40 <_Thread_queue_Extract_fifo+0x2c> _ISR_Enable( level ); 4bc36: 46c0 movew %d0,%sr #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); #endif } 4bc38: 246e fffc moveal %fp@(-4),%a2 4bc3c: 4e5e unlk %fp 4bc3e: 4e75 rts ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 4bc40: 2252 moveal %a2@,%a1 _Chain_Extract_unprotected( &the_thread->Object.Node ); the_thread->Wait.queue = NULL; if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 4bc42: 7202 moveq #2,%d1 previous = the_node->previous; 4bc44: 206a 0004 moveal %a2@(4),%a0 next->previous = previous; 4bc48: 2348 0004 movel %a0,%a1@(4) previous->next = next; 4bc4c: 2089 movel %a1,%a0@ return; } _Chain_Extract_unprotected( &the_thread->Object.Node ); the_thread->Wait.queue = NULL; 4bc4e: 42aa 0044 clrl %a2@(68) if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 4bc52: b2aa 0050 cmpl %a2@(80),%d1 4bc56: 6704 beqs 4bc5c <_Thread_queue_Extract_fifo+0x48> _ISR_Enable( level ); 4bc58: 46c0 movew %d0,%sr 4bc5a: 6014 bras 4bc70 <_Thread_queue_Extract_fifo+0x5c> 4bc5c: 7203 moveq #3,%d1 4bc5e: 2541 0050 movel %d1,%a2@(80) } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 4bc62: 46c0 movew %d0,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 4bc64: 486a 0048 pea %a2@(72) 4bc68: 4eb9 0004 864c jsr 4864c <_Watchdog_Remove> 4bc6e: 588f addql #4,%sp RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 4bc70: 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 } 4bc74: 246e fffc moveal %fp@(-4),%a2 4bc78: 203c 1003 fff8 movel #268697592,%d0 4bc7e: 2d40 000c movel %d0,%fp@(12) 4bc82: 4e5e unlk %fp 4bc84: 4ef9 0004 726c jmp 4726c <_Thread_Clear_state> ... =============================================================================== 0004a720 <_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 ); 4a720: 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 ) { 4a726: 4e56 ffec linkw %fp,#-20 4a72a: 48d7 3c04 moveml %d2/%a2-%a5,%sp@ 4a72e: 246e 000c moveal %fp@(12),%a2 4a732: 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 ); 4a736: 40c0 movew %sr,%d0 4a738: 8280 orl %d0,%d1 4a73a: 46c1 movew %d1,%sr */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue ( States_Control the_states ) { return (the_states & STATES_WAITING_ON_THREAD_QUEUE); 4a73c: 222a 0010 movel %a2@(16),%d1 4a740: 0281 0003 bee0 andil #245472,%d1 if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 4a746: 6606 bnes 4a74e <_Thread_queue_Extract_priority_helper+0x2e> _ISR_Enable( level ); 4a748: 46c0 movew %d0,%sr return; 4a74a: 6000 0090 braw 4a7dc <_Thread_queue_Extract_priority_helper+0xbc> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4a74e: 220a movel %a2,%d1 4a750: 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; 4a756: 2252 moveal %a2@,%a1 previous_node = the_node->previous; 4a758: 266a 0004 moveal %a2@(4),%a3 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 4a75c: 206a 0038 moveal %a2@(56),%a0 if ( !_Chain_Is_empty( &the_thread->Wait.Block2n ) ) { 4a760: b288 cmpl %a0,%d1 4a762: 672e beqs 4a792 <_Thread_queue_Extract_priority_helper+0x72> new_first_node = the_thread->Wait.Block2n.first; new_first_thread = (Thread_Control *) new_first_node; last_node = the_thread->Wait.Block2n.last; 4a764: 286a 0040 moveal %a2@(64),%a4 new_second_node = new_first_node->next; 4a768: 2a50 moveal %a0@,%a5 previous_node->next = new_first_node; next_node->previous = new_first_node; 4a76a: 2348 0004 movel %a0,%a1@(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; 4a76e: 2688 movel %a0,%a3@ next_node->previous = new_first_node; new_first_node->next = next_node; new_first_node->previous = previous_node; 4a770: 214b 0004 movel %a3,%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; 4a774: 2089 movel %a1,%a0@ new_first_node->previous = previous_node; if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) { 4a776: b9c8 cmpal %a0,%a4 4a778: 671e beqs 4a798 <_Thread_queue_Extract_priority_helper+0x78> /* > two threads on 2-n */ new_second_node->previous = _Chain_Head( &new_first_thread->Wait.Block2n ); 4a77a: 43e8 0038 lea %a0@(56),%a1 4a77e: 2b49 0004 movel %a1,%a5@(4) new_first_thread->Wait.Block2n.first = new_second_node; 4a782: 214d 0038 movel %a5,%a0@(56) new_first_thread->Wait.Block2n.last = last_node; 4a786: 214c 0040 movel %a4,%a0@(64) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4a78a: 41e8 003c lea %a0@(60),%a0 4a78e: 2888 movel %a0,%a4@ 4a790: 6006 bras 4a798 <_Thread_queue_Extract_priority_helper+0x78> last_node->next = _Chain_Tail( &new_first_thread->Wait.Block2n ); } } else { previous_node->next = next_node; 4a792: 2689 movel %a1,%a3@ next_node->previous = previous_node; 4a794: 234b 0004 movel %a3,%a1@(4) /* * If we are not supposed to touch timers or the thread's state, return. */ if ( requeuing ) { 4a798: 4a02 tstb %d2 4a79a: 6704 beqs 4a7a0 <_Thread_queue_Extract_priority_helper+0x80> _ISR_Enable( level ); 4a79c: 46c0 movew %d0,%sr 4a79e: 603c bras 4a7dc <_Thread_queue_Extract_priority_helper+0xbc> return; } if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 4a7a0: 7202 moveq #2,%d1 4a7a2: b2aa 0050 cmpl %a2@(80),%d1 4a7a6: 6704 beqs 4a7ac <_Thread_queue_Extract_priority_helper+0x8c><== NEVER TAKEN _ISR_Enable( level ); 4a7a8: 46c0 movew %d0,%sr 4a7aa: 6014 bras 4a7c0 <_Thread_queue_Extract_priority_helper+0xa0> 4a7ac: 7203 moveq #3,%d1 <== NOT EXECUTED 4a7ae: 2541 0050 movel %d1,%a2@(80) <== NOT EXECUTED } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 4a7b2: 46c0 movew %d0,%sr <== NOT EXECUTED (void) _Watchdog_Remove( &the_thread->Timer ); 4a7b4: 486a 0048 pea %a2@(72) <== NOT EXECUTED 4a7b8: 4eb9 0004 864c jsr 4864c <_Watchdog_Remove> <== NOT EXECUTED 4a7be: 588f addql #4,%sp <== NOT EXECUTED 4a7c0: 2d4a 0008 movel %a2,%fp@(8) 4a7c4: 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 } 4a7ca: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 4a7d0: 2d49 000c movel %a1,%fp@(12) 4a7d4: 4e5e unlk %fp 4a7d6: 4ef9 0004 726c jmp 4726c <_Thread_Clear_state> 4a7dc: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 4a7e2: 4e5e unlk %fp ... =============================================================================== 0004a7e8 <_Thread_queue_Process_timeout>: #include void _Thread_queue_Process_timeout( Thread_Control *the_thread ) { 4a7e8: 4e56 0000 linkw %fp,#0 4a7ec: 226e 0008 moveal %fp@(8),%a1 Thread_queue_Control *the_thread_queue = the_thread->Wait.queue; 4a7f0: 2069 0044 moveal %a1@(68),%a0 * If it is not satisfied, then it is "nothing happened" and * this is the "timeout" transition. After a request is satisfied, * a timeout is not allowed to occur. */ if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SYNCHRONIZED && 4a7f4: 2028 0030 movel %a0@(48),%d0 4a7f8: 671c beqs 4a816 <_Thread_queue_Process_timeout+0x2e> 4a7fa: b3f9 0005 c780 cmpal 5c780 <_Per_CPU_Information+0xc>,%a1 4a800: 6614 bnes 4a816 <_Thread_queue_Process_timeout+0x2e><== NEVER TAKEN _Thread_Is_executing( the_thread ) ) { if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) { 4a802: 7203 moveq #3,%d1 4a804: b280 cmpl %d0,%d1 4a806: 6720 beqs 4a828 <_Thread_queue_Process_timeout+0x40> the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 4a808: 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; 4a80a: 2368 003c 0034 movel %a0@(60),%a1@(52) the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 4a810: 2140 0030 movel %d0,%a0@(48) 4a814: 6012 bras 4a828 <_Thread_queue_Process_timeout+0x40> } } else { the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; 4a816: 2368 003c 0034 movel %a0@(60),%a1@(52) _Thread_queue_Extract( the_thread->Wait.queue, the_thread ); 4a81c: 2f09 movel %a1,%sp@- 4a81e: 2f08 movel %a0,%sp@- 4a820: 4eb9 0004 a6e8 jsr 4a6e8 <_Thread_queue_Extract> 4a826: 508f addql #8,%sp } } 4a828: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00047d18 <_Thread_queue_Requeue>: void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { 47d18: 4e56 fff0 linkw %fp,#-16 47d1c: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 47d20: 246e 0008 moveal %fp@(8),%a2 47d24: 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 ) 47d28: 4a8a tstl %a2 47d2a: 6746 beqs 47d72 <_Thread_queue_Requeue+0x5a> <== NEVER TAKEN /* * If queueing by FIFO, there is nothing to do. This only applies to * priority blocking discipline. */ if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) { 47d2c: 7001 moveq #1,%d0 47d2e: b0aa 0034 cmpl %a2@(52),%d0 47d32: 663e bnes 47d72 <_Thread_queue_Requeue+0x5a> <== NEVER TAKEN Thread_queue_Control *tq = the_thread_queue; ISR_Level level; ISR_Level level_ignored; _ISR_Disable( level ); 47d34: 303c 0700 movew #1792,%d0 47d38: 40c2 movew %sr,%d2 47d3a: 8082 orl %d2,%d0 47d3c: 46c0 movew %d0,%sr 47d3e: 202b 0010 movel %a3@(16),%d0 47d42: 0280 0003 bee0 andil #245472,%d0 if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 47d48: 6726 beqs 47d70 <_Thread_queue_Requeue+0x58> <== NEVER TAKEN RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section ( Thread_queue_Control *the_thread_queue ) { the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 47d4a: 7001 moveq #1,%d0 47d4c: 2540 0030 movel %d0,%a2@(48) _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); 47d50: 4878 0001 pea 1 47d54: 2f0b movel %a3,%sp@- 47d56: 2f0a movel %a2,%sp@- 47d58: 4eb9 0004 a720 jsr 4a720 <_Thread_queue_Extract_priority_helper> (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); 47d5e: 486e fffc pea %fp@(-4) 47d62: 2f0b movel %a3,%sp@- 47d64: 2f0a movel %a2,%sp@- 47d66: 4eb9 0004 7b04 jsr 47b04 <_Thread_queue_Enqueue_priority> 47d6c: 4fef 0018 lea %sp@(24),%sp } _ISR_Enable( level ); 47d70: 46c2 movew %d2,%sr } } 47d72: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3 47d78: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00047d7c <_Thread_queue_Timeout>: void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { 47d7c: 4e56 fffc linkw %fp,#-4 Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 47d80: 486e fffc pea %fp@(-4) 47d84: 2f2e 0008 movel %fp@(8),%sp@- 47d88: 4eb9 0004 7638 jsr 47638 <_Thread_Get> switch ( location ) { 47d8e: 508f addql #8,%sp 47d90: 4aae fffc tstl %fp@(-4) 47d94: 6618 bnes 47dae <_Thread_queue_Timeout+0x32> <== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 47d96: 2f00 movel %d0,%sp@- 47d98: 4eb9 0004 a7e8 jsr 4a7e8 <_Thread_queue_Process_timeout> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 47d9e: 588f addql #4,%sp 47da0: 2039 0005 c5bc movel 5c5bc <_Thread_Dispatch_disable_level>,%d0 47da6: 5380 subql #1,%d0 47da8: 23c0 0005 c5bc movel %d0,5c5bc <_Thread_Dispatch_disable_level> _Thread_Unnest_dispatch(); break; } } 47dae: 4e5e unlk %fp ... =============================================================================== 000521d2 <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 521d2: 4e56 ffb4 linkw %fp,#-76 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 521d6: 200e movel %fp,%d0 521d8: 0680 ffff fff4 addil #-12,%d0 521de: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 521e2: 246e 0008 moveal %fp@(8),%a2 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 521e6: 41ea 0008 lea %a2@(8),%a0 521ea: 2e0e movel %fp,%d7 521ec: 260e movel %fp,%d3 521ee: 280e movel %fp,%d4 521f0: 5187 subql #8,%d7 521f2: 0683 ffff ffe8 addil #-24,%d3 521f8: 0684 ffff ffec addil #-20,%d4 */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 521fe: 2c0a movel %a2,%d6 /* * 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 ); 52200: 240a movel %a2,%d2 */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 52202: 0686 0000 0030 addil #48,%d6 52208: 49f9 0005 5e90 lea 55e90 <_Watchdog_Adjust_to_chain>,%a4 /* * 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 ); 5220e: 0682 0000 0068 addil #104,%d2 } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 52214: 4bf9 0005 2c68 lea 52c68 <_Chain_Get>,%a5 ) { 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 ); 5221a: 47f9 0005 5f20 lea 55f20 <_Watchdog_Insert>,%a3 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 52220: 2d48 ffe4 movel %a0,%fp@(-28) static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 52224: 41ea 0040 lea %a2@(64),%a0 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 52228: 2d47 fff4 movel %d7,%fp@(-12) the_chain->permanent_null = NULL; 5222c: 42ae fff8 clrl %fp@(-8) { Timer_server_Control *ts = (Timer_server_Control *) arg; Chain_Control insert_chain; Chain_Control fire_chain; _Chain_Initialize_empty( &insert_chain ); 52230: 2d40 fffc movel %d0,%fp@(-4) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 52234: 2d44 ffe8 movel %d4,%fp@(-24) the_chain->permanent_null = NULL; 52238: 42ae ffec clrl %fp@(-20) the_chain->last = _Chain_Head(the_chain); 5223c: 2d43 fff0 movel %d3,%fp@(-16) static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 52240: 2d48 ffe0 movel %a0,%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; 52244: 41ee fff4 lea %fp@(-12),%a0 52248: 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; 5224c: 2039 0007 5174 movel 75174 <_Watchdog_Ticks_since_boot>,%d0 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 52252: 222a 003c movel %a2@(60),%d1 watchdogs->last_snapshot = snapshot; 52256: 2540 003c movel %d0,%a2@(60) _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 5225a: 486e ffe8 pea %fp@(-24) 5225e: 9081 subl %d1,%d0 52260: 2f00 movel %d0,%sp@- 52262: 2f06 movel %d6,%sp@- 52264: 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(); 52266: 2039 0007 50d2 movel 750d2 <_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 ) { 5226c: 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; 52270: 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 ) { 52274: b280 cmpl %d0,%d1 52276: 6414 bccs 5228c <_Timer_server_Body+0xba> /* * 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 ); 52278: 486e ffe8 pea %fp@(-24) 5227c: 2a00 movel %d0,%d5 5227e: 9a81 subl %d1,%d5 52280: 2f05 movel %d5,%sp@- 52282: 2d40 ffdc movel %d0,%fp@(-36) 52286: 2f02 movel %d2,%sp@- 52288: 4e94 jsr %a4@ 5228a: 6018 bras 522a4 <_Timer_server_Body+0xd2> } else if ( snapshot < last_snapshot ) { 5228c: b280 cmpl %d0,%d1 5228e: 631c blss 522ac <_Timer_server_Body+0xda> /* * 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 ); 52290: 9280 subl %d0,%d1 52292: 2f01 movel %d1,%sp@- 52294: 4878 0001 pea 1 52298: 2d40 ffdc movel %d0,%fp@(-36) 5229c: 2f02 movel %d2,%sp@- 5229e: 4eb9 0005 5e10 jsr 55e10 <_Watchdog_Adjust> 522a4: 202e ffdc movel %fp@(-36),%d0 522a8: 4fef 000c lea %sp@(12),%sp } watchdogs->last_snapshot = snapshot; 522ac: 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 ); 522b0: 202a 0078 movel %a2@(120),%d0 522b4: 2f00 movel %d0,%sp@- 522b6: 4e95 jsr %a5@ if ( timer == NULL ) { 522b8: 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 ); 522ba: 2040 moveal %d0,%a0 if ( timer == NULL ) { 522bc: 4a80 tstl %d0 522be: 6724 beqs 522e4 <_Timer_server_Body+0x112> <== ALWAYS TAKEN static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 522c0: 2028 0038 movel %a0@(56),%d0 <== NOT EXECUTED 522c4: 7201 moveq #1,%d1 <== NOT EXECUTED 522c6: b280 cmpl %d0,%d1 <== NOT EXECUTED 522c8: 6608 bnes 522d2 <_Timer_server_Body+0x100> <== NOT EXECUTED _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 522ca: 4868 0010 pea %a0@(16) <== NOT EXECUTED 522ce: 2f06 movel %d6,%sp@- <== NOT EXECUTED 522d0: 600c bras 522de <_Timer_server_Body+0x10c> <== NOT EXECUTED } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 522d2: 7a03 moveq #3,%d5 <== NOT EXECUTED 522d4: ba80 cmpl %d0,%d5 <== NOT EXECUTED 522d6: 66d8 bnes 522b0 <_Timer_server_Body+0xde> <== NOT EXECUTED _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 522d8: 4868 0010 pea %a0@(16) <== NOT EXECUTED 522dc: 2f02 movel %d2,%sp@- <== NOT EXECUTED 522de: 4e93 jsr %a3@ <== NOT EXECUTED 522e0: 508f addql #8,%sp <== NOT EXECUTED 522e2: 60cc bras 522b0 <_Timer_server_Body+0xde> <== 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 ); 522e4: 203c 0000 0700 movel #1792,%d0 522ea: 40c1 movew %sr,%d1 522ec: 8081 orl %d1,%d0 522ee: 46c0 movew %d0,%sr if ( _Chain_Is_empty( insert_chain ) ) { 522f0: beae fff4 cmpl %fp@(-12),%d7 522f4: 6614 bnes 5230a <_Timer_server_Body+0x138> <== NEVER TAKEN ts->insert_chain = NULL; 522f6: 42aa 0078 clrl %a2@(120) _ISR_Enable( level ); 522fa: 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 ); 522fc: 2a3c 0000 0700 movel #1792,%d5 _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 ) ) { 52302: b8ae ffe8 cmpl %fp@(-24),%d4 52306: 6608 bnes 52310 <_Timer_server_Body+0x13e> 52308: 6042 bras 5234c <_Timer_server_Body+0x17a> ts->insert_chain = NULL; _ISR_Enable( level ); break; } else { _ISR_Enable( level ); 5230a: 46c1 movew %d1,%sr <== NOT EXECUTED 5230c: 6000 ff3e braw 5224c <_Timer_server_Body+0x7a> <== 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 ); 52310: 2205 movel %d5,%d1 52312: 40c0 movew %sr,%d0 52314: 8280 orl %d0,%d1 52316: 46c1 movew %d1,%sr */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 52318: 206e ffe8 moveal %fp@(-24),%a0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 5231c: b888 cmpl %a0,%d4 5231e: 6726 beqs 52346 <_Timer_server_Body+0x174> { Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; 52320: 2250 moveal %a0@,%a1 the_chain->first = new_first; 52322: 2d49 ffe8 movel %a1,%fp@(-24) new_first->previous = _Chain_Head(the_chain); 52326: 2343 0004 movel %d3,%a1@(4) watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { 5232a: 4a88 tstl %a0 5232c: 6718 beqs 52346 <_Timer_server_Body+0x174> <== NEVER TAKEN watchdog->state = WATCHDOG_INACTIVE; 5232e: 42a8 0008 clrl %a0@(8) _ISR_Enable( level ); 52332: 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 ); 52334: 2f28 0024 movel %a0@(36),%sp@- 52338: 2f28 0020 movel %a0@(32),%sp@- 5233c: 2068 001c moveal %a0@(28),%a0 52340: 4e90 jsr %a0@ } 52342: 508f addql #8,%sp 52344: 60ca bras 52310 <_Timer_server_Body+0x13e> watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; _ISR_Enable( level ); } else { _ISR_Enable( level ); 52346: 46c0 movew %d0,%sr 52348: 6000 fefa braw 52244 <_Timer_server_Body+0x72> * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); } } else { ts->active = false; 5234c: 4200 clrb %d0 5234e: 1540 007c moveb %d0,%a2@(124) /* * Block until there is something to do. */ _Thread_Disable_dispatch(); 52352: 4eba fda4 jsr %pc@(520f8 <_Thread_Disable_dispatch>) _Thread_Set_state( ts->thread, STATES_DELAYING ); 52356: 4878 0008 pea 8 5235a: 2f12 movel %a2@,%sp@- 5235c: 4eb9 0005 5664 jsr 55664 <_Thread_Set_state> _Timer_server_Reset_interval_system_watchdog( ts ); 52362: 2f0a movel %a2,%sp@- 52364: 4eba fda8 jsr %pc@(5210e <_Timer_server_Reset_interval_system_watchdog>) _Timer_server_Reset_tod_system_watchdog( ts ); 52368: 2f0a movel %a2,%sp@- 5236a: 4eba fe02 jsr %pc@(5216e <_Timer_server_Reset_tod_system_watchdog>) _Thread_Enable_dispatch(); 5236e: 4eb9 0005 4d26 jsr 54d26 <_Thread_Enable_dispatch> ts->active = true; 52374: 7201 moveq #1,%d1 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 52376: 41f9 0005 603c lea 5603c <_Watchdog_Remove>,%a0 _Thread_Set_state( ts->thread, STATES_DELAYING ); _Timer_server_Reset_interval_system_watchdog( ts ); _Timer_server_Reset_tod_system_watchdog( ts ); _Thread_Enable_dispatch(); ts->active = true; 5237c: 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 ); 52380: 2f2e ffe4 movel %fp@(-28),%sp@- 52384: 2d48 ffdc movel %a0,%fp@(-36) 52388: 4e90 jsr %a0@ static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 5238a: 2f2e ffe0 movel %fp@(-32),%sp@- 5238e: 206e ffdc moveal %fp@(-36),%a0 52392: 4e90 jsr %a0@ 52394: 4fef 0018 lea %sp@(24),%sp 52398: 6000 feaa braw 52244 <_Timer_server_Body+0x72> =============================================================================== 0005239c <_Timer_server_Schedule_operation_method>: static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 5239c: 4e56 fff0 linkw %fp,#-16 523a0: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ 523a4: 246e 0008 moveal %fp@(8),%a2 523a8: 266e 000c moveal %fp@(12),%a3 if ( ts->insert_chain == NULL ) { 523ac: 202a 0078 movel %a2@(120),%d0 523b0: 6600 00ea bnew 5249c <_Timer_server_Schedule_operation_method+0x100> * is the reference point for the delta chain. Thus if we do not update the * reference point we have to add DT to the initial delta of the watchdog * being inserted. This could result in an integer overflow. */ _Thread_Disable_dispatch(); 523b4: 4eba fd42 jsr %pc@(520f8 <_Thread_Disable_dispatch>) if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 523b8: 202b 0038 movel %a3@(56),%d0 523bc: 7201 moveq #1,%d1 523be: b280 cmpl %d0,%d1 523c0: 665c bnes 5241e <_Timer_server_Schedule_operation_method+0x82> /* * We have to advance the last known ticks value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 523c2: 203c 0000 0700 movel #1792,%d0 523c8: 40c2 movew %sr,%d2 523ca: 8082 orl %d2,%d0 523cc: 46c0 movew %d0,%sr snapshot = _Watchdog_Ticks_since_boot; 523ce: 2039 0007 5174 movel 75174 <_Watchdog_Ticks_since_boot>,%d0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 523d4: 43ea 0034 lea %a2@(52),%a1 last_snapshot = ts->Interval_watchdogs.last_snapshot; 523d8: 222a 003c movel %a2@(60),%d1 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 523dc: 206a 0030 moveal %a2@(48),%a0 if ( !_Chain_Is_empty( &ts->Interval_watchdogs.Chain ) ) { 523e0: b3c8 cmpal %a0,%a1 523e2: 6716 beqs 523fa <_Timer_server_Schedule_operation_method+0x5e> first_watchdog = _Watchdog_First( &ts->Interval_watchdogs.Chain ); /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; 523e4: 2240 moveal %d0,%a1 523e6: 93c1 subal %d1,%a1 delta_interval = first_watchdog->delta_interval; 523e8: 2228 0010 movel %a0@(16),%d1 if (delta_interval > delta) { 523ec: b3c1 cmpal %d1,%a1 523ee: 6404 bccs 523f4 <_Timer_server_Schedule_operation_method+0x58> delta_interval -= delta; 523f0: 9289 subl %a1,%d1 523f2: 6002 bras 523f6 <_Timer_server_Schedule_operation_method+0x5a> } else { delta_interval = 0; 523f4: 4281 clrl %d1 } first_watchdog->delta_interval = delta_interval; 523f6: 2141 0010 movel %d1,%a0@(16) } ts->Interval_watchdogs.last_snapshot = snapshot; 523fa: 2540 003c movel %d0,%a2@(60) _ISR_Enable( level ); 523fe: 46c2 movew %d2,%sr _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 52400: 486b 0010 pea %a3@(16) 52404: 486a 0030 pea %a2@(48) 52408: 4eb9 0005 5f20 jsr 55f20 <_Watchdog_Insert> if ( !ts->active ) { 5240e: 508f addql #8,%sp 52410: 102a 007c moveb %a2@(124),%d0 52414: 6678 bnes 5248e <_Timer_server_Schedule_operation_method+0xf2> _Timer_server_Reset_interval_system_watchdog( ts ); 52416: 2f0a movel %a2,%sp@- 52418: 4eba fcf4 jsr %pc@(5210e <_Timer_server_Reset_interval_system_watchdog>) 5241c: 606e bras 5248c <_Timer_server_Schedule_operation_method+0xf0> } } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 5241e: 7203 moveq #3,%d1 52420: b280 cmpl %d0,%d1 52422: 666a bnes 5248e <_Timer_server_Schedule_operation_method+0xf2> /* * We have to advance the last known seconds value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 52424: 203c 0000 0700 movel #1792,%d0 5242a: 40c2 movew %sr,%d2 5242c: 8082 orl %d2,%d0 5242e: 46c0 movew %d0,%sr */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 52430: 200a movel %a2,%d0 52432: 0680 0000 006c addil #108,%d0 snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 52438: 2239 0007 50d2 movel 750d2 <_TOD_Now>,%d1 last_snapshot = ts->TOD_watchdogs.last_snapshot; 5243e: 226a 0074 moveal %a2@(116),%a1 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 52442: 206a 0068 moveal %a2@(104),%a0 if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { 52446: b088 cmpl %a0,%d0 52448: 6720 beqs 5246a <_Timer_server_Schedule_operation_method+0xce> first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; 5244a: 2028 0010 movel %a0@(16),%d0 if ( snapshot > last_snapshot ) { 5244e: b3c1 cmpal %d1,%a1 52450: 640c bccs 5245e <_Timer_server_Schedule_operation_method+0xc2> /* * We advanced in time. */ delta = snapshot - last_snapshot; 52452: 2841 moveal %d1,%a4 52454: 99c9 subal %a1,%a4 if (delta_interval > delta) { 52456: b9c0 cmpal %d0,%a4 52458: 640a bccs 52464 <_Timer_server_Schedule_operation_method+0xc8><== NEVER TAKEN delta_interval -= delta; 5245a: 908c subl %a4,%d0 5245c: 6008 bras 52466 <_Timer_server_Schedule_operation_method+0xca> } } else { /* * Someone put us in the past. */ delta = last_snapshot - snapshot; 5245e: d089 addl %a1,%d0 delta_interval += delta; 52460: 9081 subl %d1,%d0 52462: 6002 bras 52466 <_Timer_server_Schedule_operation_method+0xca> */ delta = snapshot - last_snapshot; if (delta_interval > delta) { delta_interval -= delta; } else { delta_interval = 0; 52464: 4280 clrl %d0 <== NOT EXECUTED * Someone put us in the past. */ delta = last_snapshot - snapshot; delta_interval += delta; } first_watchdog->delta_interval = delta_interval; 52466: 2140 0010 movel %d0,%a0@(16) } ts->TOD_watchdogs.last_snapshot = snapshot; 5246a: 2541 0074 movel %d1,%a2@(116) _ISR_Enable( level ); 5246e: 46c2 movew %d2,%sr _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 52470: 486b 0010 pea %a3@(16) 52474: 486a 0068 pea %a2@(104) 52478: 4eb9 0005 5f20 jsr 55f20 <_Watchdog_Insert> if ( !ts->active ) { 5247e: 508f addql #8,%sp 52480: 102a 007c moveb %a2@(124),%d0 52484: 6608 bnes 5248e <_Timer_server_Schedule_operation_method+0xf2> _Timer_server_Reset_tod_system_watchdog( ts ); 52486: 2f0a movel %a2,%sp@- 52488: 4eba fce4 jsr %pc@(5216e <_Timer_server_Reset_tod_system_watchdog>) 5248c: 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 ); } } 5248e: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 52494: 4e5e unlk %fp if ( !ts->active ) { _Timer_server_Reset_tod_system_watchdog( ts ); } } _Thread_Enable_dispatch(); 52496: 4ef9 0005 4d26 jmp 54d26 <_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 ); 5249c: 202a 0078 movel %a2@(120),%d0 <== NOT EXECUTED 524a0: 2d4b 000c movel %a3,%fp@(12) <== NOT EXECUTED } } 524a4: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 <== 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 ); 524aa: 2d40 0008 movel %d0,%fp@(8) <== NOT EXECUTED } } 524ae: 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 ); 524b0: 4ef9 0005 2c08 jmp 52c08 <_Chain_Append> <== NOT EXECUTED =============================================================================== 00049934 <_Timespec_Greater_than>: bool _Timespec_Greater_than( const struct timespec *lhs, const struct timespec *rhs ) { 49934: 4e56 0000 linkw %fp,#0 49938: 226e 0008 moveal %fp@(8),%a1 4993c: 206e 000c moveal %fp@(12),%a0 if ( lhs->tv_sec > rhs->tv_sec ) 49940: 2211 movel %a1@,%d1 49942: 2010 movel %a0@,%d0 49944: b081 cmpl %d1,%d0 49946: 6d10 blts 49958 <_Timespec_Greater_than+0x24> return true; if ( lhs->tv_sec < rhs->tv_sec ) 49948: 6e12 bgts 4995c <_Timespec_Greater_than+0x28> <== NEVER TAKEN #include #include #include bool _Timespec_Greater_than( 4994a: 2068 0004 moveal %a0@(4),%a0 4994e: b1e9 0004 cmpal %a1@(4),%a0 49952: 5dc0 slt %d0 49954: 4480 negl %d0 49956: 6006 bras 4995e <_Timespec_Greater_than+0x2a> const struct timespec *lhs, const struct timespec *rhs ) { if ( lhs->tv_sec > rhs->tv_sec ) return true; 49958: 7001 moveq #1,%d0 4995a: 6002 bras 4995e <_Timespec_Greater_than+0x2a> if ( lhs->tv_sec < rhs->tv_sec ) return false; 4995c: 4200 clrb %d0 <== NOT EXECUTED /* ASSERT: lhs->tv_sec == rhs->tv_sec */ if ( lhs->tv_nsec > rhs->tv_nsec ) return true; return false; } 4995e: 4e5e unlk %fp ... =============================================================================== 000483e6 <_User_extensions_Fatal>: void _User_extensions_Fatal ( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 483e6: 4e56 fff0 linkw %fp,#-16 483ea: 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 ); 483ee: 4282 clrl %d2 483f0: 142e 000f moveb %fp@(15),%d2 void _User_extensions_Fatal ( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 483f4: 282e 0008 movel %fp@(8),%d4 483f8: 262e 0010 movel %fp@(16),%d3 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 483fc: 2479 0005 c738 moveal 5c738 <_User_extensions_List+0x8>,%a2 48402: 6018 bras 4841c <_User_extensions_Fatal+0x36> !_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 ) 48404: 206a 0030 moveal %a2@(48),%a0 48408: 4a88 tstl %a0 4840a: 670c beqs 48418 <_User_extensions_Fatal+0x32> (*the_extension->Callouts.fatal)( the_source, is_internal, the_error ); 4840c: 2f03 movel %d3,%sp@- 4840e: 2f02 movel %d2,%sp@- 48410: 2f04 movel %d4,%sp@- 48412: 4e90 jsr %a0@ 48414: 4fef 000c lea %sp@(12),%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 ) { 48418: 246a 0004 moveal %a2@(4),%a2 ) { Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 4841c: b5fc 0005 c730 cmpal #378672,%a2 48422: 66e0 bnes 48404 <_User_extensions_Fatal+0x1e> <== ALWAYS TAKEN the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.fatal != NULL ) (*the_extension->Callouts.fatal)( the_source, is_internal, the_error ); } } 48424: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 <== NOT EXECUTED 4842a: 4e5e unlk %fp <== NOT EXECUTED ... =============================================================================== 000482c0 <_User_extensions_Handler_initialization>: #include #include #include void _User_extensions_Handler_initialization(void) { 482c0: 4e56 ffe8 linkw %fp,#-24 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 482c4: 203c 0005 c734 movel #378676,%d0 482ca: 23c0 0005 c730 movel %d0,5c730 <_User_extensions_List> the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 482d0: 203c 0005 c730 movel #378672,%d0 482d6: 23c0 0005 c738 movel %d0,5c738 <_User_extensions_List+0x8> */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 482dc: 203c 0005 c5c4 movel #378308,%d0 482e2: 23c0 0005 c5c0 movel %d0,5c5c0 <_User_extensions_Switches_list> the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 482e8: 203c 0005 c5c0 movel #378304,%d0 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 482ee: 42b9 0005 c734 clrl 5c734 <_User_extensions_List+0x4> 482f4: 48d7 1c1c moveml %d2-%d4/%a2-%a4,%sp@ User_extensions_Control *extension; uint32_t i; uint32_t number_of_extensions; User_extensions_Table *initial_extensions; number_of_extensions = Configuration.number_of_initial_extensions; 482f8: 2839 0005 aeca movel 5aeca ,%d4 initial_extensions = Configuration.User_extension_table; 482fe: 2639 0005 aece movel 5aece ,%d3 48304: 42b9 0005 c5c4 clrl 5c5c4 <_User_extensions_Switches_list+0x4> the_chain->last = _Chain_Head(the_chain); 4830a: 23c0 0005 c5c8 movel %d0,5c5c8 <_User_extensions_Switches_list+0x8> _Chain_Initialize_empty( &_User_extensions_List ); _Chain_Initialize_empty( &_User_extensions_Switches_list ); if ( initial_extensions ) { 48310: 4a83 tstl %d3 48312: 6754 beqs 48368 <_User_extensions_Handler_initialization+0xa8><== NEVER TAKEN extension = (User_extensions_Control *) _Workspace_Allocate_or_fatal_error( 48314: 7434 moveq #52,%d2 48316: 4c04 2800 mulsl %d4,%d2 RTEMS_INLINE_ROUTINE void _User_extensions_Add_set_with_table( User_extensions_Control *extension, const User_extensions_Table *extension_table ) { extension->Callouts = *extension_table; 4831a: 49f9 0004 c5a4 lea 4c5a4 ,%a4 _User_extensions_Add_set( extension ); 48320: 47f9 0004 a8ec lea 4a8ec <_User_extensions_Add_set>,%a3 48326: 2f02 movel %d2,%sp@- 48328: 4eb9 0004 87d8 jsr 487d8 <_Workspace_Allocate_or_fatal_error> 4832e: 2440 moveal %d0,%a2 number_of_extensions * sizeof( User_extensions_Control ) ); memset ( 48330: 2f02 movel %d2,%sp@- extension, 0, number_of_extensions * sizeof( User_extensions_Control ) ); for ( i = 0 ; i < number_of_extensions ; i++ ) { 48332: 4282 clrl %d2 extension = (User_extensions_Control *) _Workspace_Allocate_or_fatal_error( number_of_extensions * sizeof( User_extensions_Control ) ); memset ( 48334: 42a7 clrl %sp@- 48336: 2f00 movel %d0,%sp@- 48338: 4eb9 0004 c614 jsr 4c614 extension, 0, number_of_extensions * sizeof( User_extensions_Control ) ); for ( i = 0 ; i < number_of_extensions ; i++ ) { 4833e: 4fef 0010 lea %sp@(16),%sp 48342: 6020 bras 48364 <_User_extensions_Handler_initialization+0xa4> RTEMS_INLINE_ROUTINE void _User_extensions_Add_set_with_table( User_extensions_Control *extension, const User_extensions_Table *extension_table ) { extension->Callouts = *extension_table; 48344: 4878 0020 pea 20 48348: 5282 addql #1,%d2 4834a: 2f03 movel %d3,%sp@- 4834c: 486a 0014 pea %a2@(20) 48350: 0683 0000 0020 addil #32,%d3 48356: 4e94 jsr %a4@ _User_extensions_Add_set( extension ); 48358: 2f0a movel %a2,%sp@- _User_extensions_Add_set_with_table (extension, &initial_extensions[i]); extension++; 4835a: 45ea 0034 lea %a2@(52),%a2 4835e: 4e93 jsr %a3@ extension, 0, number_of_extensions * sizeof( User_extensions_Control ) ); for ( i = 0 ; i < number_of_extensions ; i++ ) { 48360: 4fef 0010 lea %sp@(16),%sp 48364: b882 cmpl %d2,%d4 48366: 62dc bhis 48344 <_User_extensions_Handler_initialization+0x84> _User_extensions_Add_set_with_table (extension, &initial_extensions[i]); extension++; } } } 48368: 4cee 1c1c ffe8 moveml %fp@(-24),%d2-%d4/%a2-%a4 4836e: 4e5e unlk %fp ... =============================================================================== 000483ac <_User_extensions_Thread_exitted>: void _User_extensions_Thread_exitted ( Thread_Control *executing ) { 483ac: 4e56 0000 linkw %fp,#0 483b0: 2f0a movel %a2,%sp@- Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 483b2: 2479 0005 c738 moveal 5c738 <_User_extensions_List+0x8>,%a2 } void _User_extensions_Thread_exitted ( Thread_Control *executing ) { 483b8: 2f02 movel %d2,%sp@- 483ba: 242e 0008 movel %fp@(8),%d2 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 483be: 6012 bras 483d2 <_User_extensions_Thread_exitted+0x26> !_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 ) 483c0: 206a 002c moveal %a2@(44),%a0 483c4: 4a88 tstl %a0 483c6: 6706 beqs 483ce <_User_extensions_Thread_exitted+0x22> (*the_extension->Callouts.thread_exitted)( executing ); 483c8: 2f02 movel %d2,%sp@- 483ca: 4e90 jsr %a0@ 483cc: 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 ) { 483ce: 246a 0004 moveal %a2@(4),%a2 ) { Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 483d2: b5fc 0005 c730 cmpal #378672,%a2 483d8: 66e6 bnes 483c0 <_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 ); } } 483da: 242e fff8 movel %fp@(-8),%d2 483de: 246e fffc moveal %fp@(-4),%a2 483e2: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00049a94 <_Watchdog_Adjust>: Watchdog_Interval units ) { ISR_Level level; _ISR_Disable( level ); 49a94: 327c 0700 moveaw #1792,%a1 49a98: 2209 movel %a1,%d1 void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 49a9a: 4e56 ffe8 linkw %fp,#-24 49a9e: 48d7 1c1c moveml %d2-%d4/%a2-%a4,%sp@ 49aa2: 266e 0008 moveal %fp@(8),%a3 49aa6: 262e 000c movel %fp@(12),%d3 49aaa: 242e 0010 movel %fp@(16),%d2 ISR_Level level; _ISR_Disable( level ); 49aae: 40c0 movew %sr,%d0 49ab0: 8280 orl %d0,%d1 49ab2: 46c1 movew %d1,%sr */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 49ab4: 244b moveal %a3,%a2 49ab6: 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 ) ) { 49ab8: b5c8 cmpal %a0,%a2 49aba: 674c beqs 49b08 <_Watchdog_Adjust+0x74> switch ( direction ) { 49abc: 4a83 tstl %d3 49abe: 673c beqs 49afc <_Watchdog_Adjust+0x68> 49ac0: 7201 moveq #1,%d1 49ac2: b283 cmpl %d3,%d1 49ac4: 6642 bnes 49b08 <_Watchdog_Adjust+0x74> <== NEVER TAKEN case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; 49ac6: d5a8 0010 addl %d2,%a0@(16) break; 49aca: 603c bras 49b08 <_Watchdog_Adjust+0x74> RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First( Chain_Control *header ) { return ( (Watchdog_Control *) header->first ); 49acc: 2053 moveal %a3@,%a0 case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { 49ace: 2628 0010 movel %a0@(16),%d3 49ad2: b682 cmpl %d2,%d3 49ad4: 6308 blss 49ade <_Watchdog_Adjust+0x4a> _Watchdog_First( header )->delta_interval -= units; 49ad6: 9682 subl %d2,%d3 49ad8: 2143 0010 movel %d3,%a0@(16) break; 49adc: 602a bras 49b08 <_Watchdog_Adjust+0x74> } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; 49ade: 7201 moveq #1,%d1 49ae0: 2141 0010 movel %d1,%a0@(16) _ISR_Enable( level ); 49ae4: 46c0 movew %d0,%sr _Watchdog_Tickle( header ); 49ae6: 2f0b movel %a3,%sp@- 49ae8: 4e94 jsr %a4@ _ISR_Disable( level ); 49aea: 2204 movel %d4,%d1 49aec: 40c0 movew %sr,%d0 49aee: 8280 orl %d0,%d1 49af0: 46c1 movew %d1,%sr if ( _Chain_Is_empty( header ) ) 49af2: 588f addql #4,%sp 49af4: b5d3 cmpal %a3@,%a2 49af6: 6710 beqs 49b08 <_Watchdog_Adjust+0x74> while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; 49af8: 9483 subl %d3,%d2 49afa: 6008 bras 49b04 <_Watchdog_Adjust+0x70> _Watchdog_First( header )->delta_interval = 1; _ISR_Enable( level ); _Watchdog_Tickle( header ); 49afc: 49f9 0004 9cac lea 49cac <_Watchdog_Tickle>,%a4 _ISR_Disable( level ); 49b02: 2809 movel %a1,%d4 switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 49b04: 4a82 tstl %d2 49b06: 66c4 bnes 49acc <_Watchdog_Adjust+0x38> <== ALWAYS TAKEN } break; } } _ISR_Enable( level ); 49b08: 46c0 movew %d0,%sr } 49b0a: 4cee 1c1c ffe8 moveml %fp@(-24),%d2-%d4/%a2-%a4 49b10: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004864c <_Watchdog_Remove>: { ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 4864c: 203c 0000 0700 movel #1792,%d0 */ Watchdog_States _Watchdog_Remove( Watchdog_Control *the_watchdog ) { 48652: 4e56 0000 linkw %fp,#0 48656: 206e 0008 moveal %fp@(8),%a0 4865a: 2f0a movel %a2,%sp@- 4865c: 2f02 movel %d2,%sp@- ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 4865e: 40c1 movew %sr,%d1 48660: 8081 orl %d1,%d0 48662: 46c0 movew %d0,%sr previous_state = the_watchdog->state; 48664: 2028 0008 movel %a0@(8),%d0 switch ( previous_state ) { 48668: 7401 moveq #1,%d2 4866a: b480 cmpl %d0,%d2 4866c: 670c beqs 4867a <_Watchdog_Remove+0x2e> 4866e: 6242 bhis 486b2 <_Watchdog_Remove+0x66> 48670: 143c 0003 moveb #3,%d2 48674: b480 cmpl %d0,%d2 48676: 653a bcss 486b2 <_Watchdog_Remove+0x66> <== NEVER TAKEN 48678: 6006 bras 48680 <_Watchdog_Remove+0x34> /* * It is not actually on the chain so just change the state and * the Insert operation we interrupted will be aborted. */ the_watchdog->state = WATCHDOG_INACTIVE; 4867a: 42a8 0008 clrl %a0@(8) break; 4867e: 6032 bras 486b2 <_Watchdog_Remove+0x66> } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; _ISR_Enable( level ); return( previous_state ); } 48680: 2250 moveal %a0@,%a1 break; case WATCHDOG_ACTIVE: case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; 48682: 42a8 0008 clrl %a0@(8) next_watchdog = _Watchdog_Next( the_watchdog ); if ( _Watchdog_Next(next_watchdog) ) 48686: 4a91 tstl %a1@ 48688: 6708 beqs 48692 <_Watchdog_Remove+0x46> next_watchdog->delta_interval += the_watchdog->delta_interval; 4868a: 2428 0010 movel %a0@(16),%d2 4868e: d5a9 0010 addl %d2,%a1@(16) if ( _Watchdog_Sync_count ) 48692: 2479 0005 c6e4 moveal 5c6e4 <_Watchdog_Sync_count>,%a2 48698: 4a8a tstl %a2 4869a: 670c beqs 486a8 <_Watchdog_Remove+0x5c> _Watchdog_Sync_level = _ISR_Nest_level; 4869c: 45f9 0005 c77c lea 5c77c <_Per_CPU_Information+0x8>,%a2 486a2: 23d2 0005 c662 movel %a2@,5c662 <_Watchdog_Sync_level> { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 486a8: 2468 0004 moveal %a0@(4),%a2 next->previous = previous; 486ac: 234a 0004 movel %a2,%a1@(4) previous->next = next; 486b0: 2489 movel %a1,%a2@ _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 486b2: 2279 0005 c6e8 moveal 5c6e8 <_Watchdog_Ticks_since_boot>,%a1 486b8: 2149 0018 movel %a1,%a0@(24) _ISR_Enable( level ); 486bc: 46c1 movew %d1,%sr return( previous_state ); } 486be: 241f movel %sp@+,%d2 486c0: 245f moveal %sp@+,%a2 486c2: 4e5e unlk %fp ... =============================================================================== 000496a4 <_Watchdog_Report_chain>: ) { ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 496a4: 203c 0000 0700 movel #1792,%d0 void _Watchdog_Report_chain( const char *name, Chain_Control *header ) { 496aa: 4e56 ffec linkw %fp,#-20 496ae: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@ 496b2: 242e 0008 movel %fp@(8),%d2 496b6: 266e 000c moveal %fp@(12),%a3 ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 496ba: 40c3 movew %sr,%d3 496bc: 8083 orl %d3,%d0 496be: 46c0 movew %d0,%sr printk( "Watchdog Chain: %s %p\n", name, header ); 496c0: 2f0b movel %a3,%sp@- 496c2: 49f9 0004 3e7c lea 43e7c ,%a4 496c8: 2f02 movel %d2,%sp@- 496ca: 4879 0005 bd4a pea 5bd4a 496d0: 4e94 jsr %a4@ */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 496d2: 245b moveal %a3@+,%a2 if ( !_Chain_Is_empty( header ) ) { 496d4: 4fef 000c lea %sp@(12),%sp 496d8: b7ca cmpal %a2,%a3 496da: 6726 beqs 49702 <_Watchdog_Report_chain+0x5e> node != _Chain_Tail(header) ; node = node->next ) { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); 496dc: 49f9 0004 9718 lea 49718 <_Watchdog_Report>,%a4 496e2: 2f0a movel %a2,%sp@- 496e4: 42a7 clrl %sp@- 496e6: 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 ) 496e8: 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 ; 496ea: 508f addql #8,%sp 496ec: b7ca cmpal %a2,%a3 496ee: 66f2 bnes 496e2 <_Watchdog_Report_chain+0x3e> <== NEVER TAKEN { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); 496f0: 2f02 movel %d2,%sp@- 496f2: 4879 0005 bd61 pea 5bd61 496f8: 4eb9 0004 3e7c jsr 43e7c 496fe: 508f addql #8,%sp 49700: 600a bras 4970c <_Watchdog_Report_chain+0x68> } else { printk( "Chain is empty\n" ); 49702: 4879 0005 bd70 pea 5bd70 49708: 4e94 jsr %a4@ 4970a: 588f addql #4,%sp } _ISR_Enable( level ); 4970c: 46c3 movew %d3,%sr } 4970e: 4cee 1c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a4 49714: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000486c8 <_Watchdog_Tickle>: * See the comment in watchdoginsert.c and watchdogadjust.c * about why it's safe not to declare header a pointer to * volatile data - till, 2003/7 */ _ISR_Disable( level ); 486c8: 203c 0000 0700 movel #1792,%d0 */ void _Watchdog_Tickle( Chain_Control *header ) { 486ce: 4e56 ffe8 linkw %fp,#-24 486d2: 48d7 3c0c moveml %d2-%d3/%a2-%a5,%sp@ 486d6: 286e 0008 moveal %fp@(8),%a4 * See the comment in watchdoginsert.c and watchdogadjust.c * about why it's safe not to declare header a pointer to * volatile data - till, 2003/7 */ _ISR_Disable( level ); 486da: 40c2 movew %sr,%d2 486dc: 8082 orl %d2,%d0 486de: 46c0 movew %d0,%sr */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 486e0: 264c moveal %a4,%a3 486e2: 245b moveal %a3@+,%a2 if ( _Chain_Is_empty( header ) ) 486e4: b7ca cmpal %a2,%a3 486e6: 674c beqs 48734 <_Watchdog_Tickle+0x6c> * to be inserted has already had its delta_interval adjusted to 0, and * so is added to the head of the chain with a delta_interval of 0. * * Steven Johnson - 12/2005 (gcc-3.2.3 -O3 on powerpc) */ if (the_watchdog->delta_interval != 0) { 486e8: 202a 0010 movel %a2@(16),%d0 486ec: 6708 beqs 486f6 <_Watchdog_Tickle+0x2e> the_watchdog->delta_interval--; 486ee: 5380 subql #1,%d0 486f0: 2540 0010 movel %d0,%a2@(16) if ( the_watchdog->delta_interval != 0 ) 486f4: 663e bnes 48734 <_Watchdog_Tickle+0x6c> goto leave; } do { watchdog_state = _Watchdog_Remove( the_watchdog ); 486f6: 4bf9 0004 864c lea 4864c <_Watchdog_Remove>,%a5 case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 486fc: 263c 0000 0700 movel #1792,%d3 if ( the_watchdog->delta_interval != 0 ) goto leave; } do { watchdog_state = _Watchdog_Remove( the_watchdog ); 48702: 2f0a movel %a2,%sp@- 48704: 4e95 jsr %a5@ _ISR_Enable( level ); 48706: 46c2 movew %d2,%sr switch( watchdog_state ) { 48708: 7202 moveq #2,%d1 4870a: 588f addql #4,%sp 4870c: b280 cmpl %d0,%d1 4870e: 6610 bnes 48720 <_Watchdog_Tickle+0x58> <== NEVER TAKEN case WATCHDOG_ACTIVE: (*the_watchdog->routine)( 48710: 2f2a 0024 movel %a2@(36),%sp@- 48714: 2f2a 0020 movel %a2@(32),%sp@- 48718: 206a 001c moveal %a2@(28),%a0 4871c: 4e90 jsr %a0@ the_watchdog->id, the_watchdog->user_data ); break; 4871e: 508f addql #8,%sp case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 48720: 2003 movel %d3,%d0 48722: 40c2 movew %sr,%d2 48724: 8082 orl %d2,%d0 48726: 46c0 movew %d0,%sr } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); } 48728: 2454 moveal %a4@,%a2 _ISR_Disable( level ); the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); 4872a: b7ca cmpal %a2,%a3 4872c: 6706 beqs 48734 <_Watchdog_Tickle+0x6c> } _ISR_Disable( level ); the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && 4872e: 4aaa 0010 tstl %a2@(16) 48732: 67ce beqs 48702 <_Watchdog_Tickle+0x3a> (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); 48734: 46c2 movew %d2,%sr } 48736: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 4873c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004bf04 : rtems_status_code rtems_barrier_wait( rtems_id id, rtems_interval timeout ) { 4bf04: 4e56 fffc linkw %fp,#-4 4bf08: 2f02 movel %d2,%sp@- 4bf0a: 486e fffc pea %fp@(-4) 4bf0e: 242e 0008 movel %fp@(8),%d2 4bf12: 2f02 movel %d2,%sp@- 4bf14: 4879 0005 dd06 pea 5dd06 <_Barrier_Information> 4bf1a: 4eb9 0004 8170 jsr 48170 <_Objects_Get> Barrier_Control *the_barrier; Objects_Locations location; the_barrier = _Barrier_Get( id, &location ); switch ( location ) { 4bf20: 4fef 000c lea %sp@(12),%sp 4bf24: 4aae fffc tstl %fp@(-4) 4bf28: 6634 bnes 4bf5e <== NEVER TAKEN case OBJECTS_LOCAL: _CORE_barrier_Wait( 4bf2a: 42a7 clrl %sp@- 4bf2c: 2f2e 000c movel %fp@(12),%sp@- 4bf30: 2040 moveal %d0,%a0 4bf32: 4878 0001 pea 1 4bf36: 2f02 movel %d2,%sp@- 4bf38: 4868 0014 pea %a0@(20) 4bf3c: 4eb9 0004 c594 jsr 4c594 <_CORE_barrier_Wait> id, true, timeout, NULL ); _Thread_Enable_dispatch(); 4bf42: 4eb9 0004 8936 jsr 48936 <_Thread_Enable_dispatch> return _Barrier_Translate_core_barrier_return_code( _Thread_Executing->Wait.return_code ); 4bf48: 2079 0005 dcf8 moveal 5dcf8 <_Per_CPU_Information+0xc>,%a0 true, timeout, NULL ); _Thread_Enable_dispatch(); return _Barrier_Translate_core_barrier_return_code( 4bf4e: 2f28 0034 movel %a0@(52),%sp@- 4bf52: 4eb9 0004 ce8c jsr 4ce8c <_Barrier_Translate_core_barrier_return_code> 4bf58: 4fef 0018 lea %sp@(24),%sp 4bf5c: 6002 bras 4bf60 #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 4bf5e: 7004 moveq #4,%d0 } 4bf60: 242e fff8 movel %fp@(-8),%d2 4bf64: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00047c74 : #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) { 47c74: 4e56 fff0 linkw %fp,#-16 47c78: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ 47c7c: 286e 0008 moveal %fp@(8),%a4 uint32_t i; uint32_t api_index; Thread_Control *the_thread; Objects_Information *information; if ( !routine ) 47c80: 4a8c tstl %a4 47c82: 673c beqs 47cc0 <== NEVER TAKEN 47c84: 45f9 0006 64dc lea 664dc <_Objects_Information_table+0x4>,%a2 return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { if ( !_Objects_Information_table[ api_index ] ) 47c8a: 205a moveal %a2@+,%a0 47c8c: 4a88 tstl %a0 47c8e: 6728 beqs 47cb8 continue; information = _Objects_Information_table[ api_index ][ 1 ]; 47c90: 2668 0004 moveal %a0@(4),%a3 if ( !information ) 47c94: 4a8b tstl %a3 47c96: 6720 beqs 47cb8 47c98: 7401 moveq #1,%d2 47c9a: 6012 bras 47cae continue; for ( i=1 ; i <= information->maximum ; i++ ) { the_thread = (Thread_Control *)information->local_table[ i ]; 47c9c: 206b 0018 moveal %a3@(24),%a0 47ca0: 2030 2c00 movel %a0@(00000000,%d2:l:4),%d0 if ( !the_thread ) 47ca4: 6706 beqs 47cac <== NEVER TAKEN continue; (*routine)(the_thread); 47ca6: 2f00 movel %d0,%sp@- 47ca8: 4e94 jsr %a4@ 47caa: 588f addql #4,%sp information = _Objects_Information_table[ api_index ][ 1 ]; if ( !information ) continue; for ( i=1 ; i <= information->maximum ; i++ ) { 47cac: 5282 addql #1,%d2 47cae: 4280 clrl %d0 47cb0: 302b 000e movew %a3@(14),%d0 47cb4: b082 cmpl %d2,%d0 47cb6: 64e4 bccs 47c9c Objects_Information *information; if ( !routine ) return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { 47cb8: b5fc 0006 64e8 cmpal #419048,%a2 47cbe: 66ca bnes 47c8a (*routine)(the_thread); } } } 47cc0: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 47cc6: 4e5e unlk %fp ... =============================================================================== 0004ffb4 : */ rtems_status_code rtems_partition_delete( rtems_id id ) { 4ffb4: 4e56 fffc linkw %fp,#-4 4ffb8: 2f0b movel %a3,%sp@- 4ffba: 2f0a movel %a2,%sp@- Objects_Id id, Objects_Locations *location ) { return (Partition_Control *) _Objects_Get( &_Partition_Information, id, location ); 4ffbc: 486e fffc pea %fp@(-4) 4ffc0: 2f2e 0008 movel %fp@(8),%sp@- 4ffc4: 4879 0007 4ee4 pea 74ee4 <_Partition_Information> 4ffca: 4eb9 0005 44ec jsr 544ec <_Objects_Get> register Partition_Control *the_partition; Objects_Locations location; the_partition = _Partition_Get( id, &location ); switch ( location ) { 4ffd0: 4fef 000c lea %sp@(12),%sp 4ffd4: 2440 moveal %d0,%a2 4ffd6: 4aae fffc tstl %fp@(-4) 4ffda: 6638 bnes 50014 <== NEVER TAKEN 4ffdc: 47f9 0005 4d26 lea 54d26 <_Thread_Enable_dispatch>,%a3 case OBJECTS_LOCAL: if ( the_partition->number_of_used_blocks == 0 ) { 4ffe2: 4aaa 0020 tstl %a2@(32) 4ffe6: 6626 bnes 5000e <== NEVER TAKEN _Objects_Close( &_Partition_Information, &the_partition->Object ); 4ffe8: 2f00 movel %d0,%sp@- 4ffea: 4879 0007 4ee4 pea 74ee4 <_Partition_Information> 4fff0: 4eb9 0005 40e0 jsr 540e0 <_Objects_Close> */ RTEMS_INLINE_ROUTINE void _Partition_Free ( Partition_Control *the_partition ) { _Objects_Free( &_Partition_Information, &the_partition->Object ); 4fff6: 2f0a movel %a2,%sp@- 4fff8: 4879 0007 4ee4 pea 74ee4 <_Partition_Information> 4fffe: 4eb9 0005 4358 jsr 54358 <_Objects_Free> 0 /* Not used */ ); } #endif _Thread_Enable_dispatch(); 50004: 4e93 jsr %a3@ return RTEMS_SUCCESSFUL; 50006: 4fef 0010 lea %sp@(16),%sp 5000a: 4280 clrl %d0 5000c: 6008 bras 50016 } _Thread_Enable_dispatch(); 5000e: 4e93 jsr %a3@ return RTEMS_RESOURCE_IN_USE; 50010: 700c moveq #12,%d0 50012: 6002 bras 50016 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 50014: 7004 moveq #4,%d0 } 50016: 246e fff4 moveal %fp@(-12),%a2 5001a: 266e fff8 moveal %fp@(-8),%a3 5001e: 4e5e unlk %fp ... =============================================================================== 000500b8 : rtems_status_code rtems_partition_return_buffer( rtems_id id, void *buffer ) { 500b8: 4e56 fffc linkw %fp,#-4 500bc: 2f0a movel %a2,%sp@- 500be: 2f02 movel %d2,%sp@- Objects_Id id, Objects_Locations *location ) { return (Partition_Control *) _Objects_Get( &_Partition_Information, id, location ); 500c0: 486e fffc pea %fp@(-4) 500c4: 2f2e 0008 movel %fp@(8),%sp@- 500c8: 4879 0007 4ee4 pea 74ee4 <_Partition_Information> 500ce: 242e 000c movel %fp@(12),%d2 500d2: 4eb9 0005 44ec jsr 544ec <_Objects_Get> register Partition_Control *the_partition; Objects_Locations location; the_partition = _Partition_Get( id, &location ); switch ( location ) { 500d8: 4fef 000c lea %sp@(12),%sp 500dc: 2440 moveal %d0,%a2 500de: 4aae fffc tstl %fp@(-4) 500e2: 663e bnes 50122 ) { void *starting; void *ending; starting = the_partition->starting_address; 500e4: 202a 0010 movel %a2@(16),%d0 ending = _Addresses_Add_offset( starting, the_partition->length ); 500e8: 222a 0014 movel %a2@(20),%d1 const void *address, const void *base, const void *limit ) { return (address >= base && address <= limit); 500ec: b082 cmpl %d2,%d0 500ee: 6240 bhis 50130 RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset ( const void *base, uintptr_t offset ) { return (void *)((uintptr_t)base + offset); 500f0: d280 addl %d0,%d1 const void *address, const void *base, const void *limit ) { return (address >= base && address <= limit); 500f2: b282 cmpl %d2,%d1 500f4: 653a bcss 50130 <== NEVER TAKEN RTEMS_INLINE_ROUTINE int32_t _Addresses_Subtract ( const void *left, const void *right ) { return (int32_t) ((const char *) left - (const char *) right); 500f6: 2202 movel %d2,%d1 500f8: 9280 subl %d0,%d1 500fa: 2001 movel %d1,%d0 offset = (uint32_t) _Addresses_Subtract( the_buffer, the_partition->starting_address ); return ((offset % the_partition->buffer_size) == 0); 500fc: 4c6a 0001 0018 remul %a2@(24),%d1,%d0 starting = the_partition->starting_address; ending = _Addresses_Add_offset( starting, the_partition->length ); return ( _Addresses_Is_in_range( the_buffer, starting, ending ) && 50102: 4a81 tstl %d1 50104: 662a bnes 50130 RTEMS_INLINE_ROUTINE void _Partition_Free_buffer ( Partition_Control *the_partition, Chain_Node *the_buffer ) { _Chain_Append( &the_partition->Memory, the_buffer ); 50106: 2f02 movel %d2,%sp@- 50108: 486a 0024 pea %a2@(36) 5010c: 4eb9 0005 2c08 jsr 52c08 <_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; 50112: 53aa 0020 subql #1,%a2@(32) _Thread_Enable_dispatch(); 50116: 4eb9 0005 4d26 jsr 54d26 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 5011c: 508f addql #8,%sp 5011e: 4280 clrl %d0 50120: 6002 bras 50124 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 50122: 7004 moveq #4,%d0 } 50124: 242e fff4 movel %fp@(-12),%d2 50128: 246e fff8 moveal %fp@(-8),%a2 5012c: 4e5e unlk %fp 5012e: 4e75 rts _Partition_Free_buffer( the_partition, buffer ); the_partition->number_of_used_blocks -= 1; _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } _Thread_Enable_dispatch(); 50130: 4eb9 0005 4d26 jsr 54d26 <_Thread_Enable_dispatch> return RTEMS_INVALID_ADDRESS; 50136: 7009 moveq #9,%d0 50138: 60ea bras 50124 ... =============================================================================== 0004b54c : rtems_status_code rtems_rate_monotonic_get_status( rtems_id id, rtems_rate_monotonic_period_status *status ) { 4b54c: 4e56 ffec linkw %fp,#-20 4b550: 2f0a movel %a2,%sp@- 4b552: 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 ) 4b556: 4a8a tstl %a2 4b558: 6700 0092 beqw 4b5ec 4b55c: 486e fffc pea %fp@(-4) 4b560: 2f2e 0008 movel %fp@(8),%sp@- 4b564: 4879 0005 e140 pea 5e140 <_Rate_monotonic_Information> 4b56a: 4eb9 0004 8400 jsr 48400 <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 4b570: 4fef 000c lea %sp@(12),%sp 4b574: 2040 moveal %d0,%a0 4b576: 4aae fffc tstl %fp@(-4) 4b57a: 6674 bnes 4b5f0 <== NEVER TAKEN case OBJECTS_LOCAL: status->owner = the_period->owner->Object.id; 4b57c: 2268 0040 moveal %a0@(64),%a1 4b580: 24a9 0008 movel %a1@(8),%a2@ status->state = the_period->state; 4b584: 2028 0038 movel %a0@(56),%d0 4b588: 2540 0004 movel %d0,%a2@(4) /* * If the period is inactive, there is no information. */ if ( status->state == RATE_MONOTONIC_INACTIVE ) { 4b58c: 6612 bnes 4b5a0 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timespec_Set_to_zero( &status->since_last_period ); 4b58e: 42aa 0008 clrl %a2@(8) 4b592: 42aa 000c clrl %a2@(12) _Timespec_Set_to_zero( &status->executed_since_last_period ); 4b596: 42aa 0010 clrl %a2@(16) 4b59a: 42aa 0014 clrl %a2@(20) 4b59e: 6042 bras 4b5e2 } else { /* * Grab the current status. */ valid_status = 4b5a0: 486e fff4 pea %fp@(-12) 4b5a4: 486e ffec pea %fp@(-20) 4b5a8: 2f08 movel %a0,%sp@- 4b5aa: 4eb9 0004 6298 jsr 46298 <_Rate_monotonic_Get_status> _Rate_monotonic_Get_status( the_period, &since_last_period, &executed ); if (!valid_status) { 4b5b0: 4fef 000c lea %sp@(12),%sp 4b5b4: 4a00 tstb %d0 4b5b6: 660a bnes 4b5c2 _Thread_Enable_dispatch(); 4b5b8: 4eb9 0004 8c3a jsr 48c3a <_Thread_Enable_dispatch> return RTEMS_NOT_DEFINED; 4b5be: 700b moveq #11,%d0 4b5c0: 6030 bras 4b5f2 } #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_To_timespec( 4b5c2: 202e ffec movel %fp@(-20),%d0 4b5c6: 222e fff0 movel %fp@(-16),%d1 4b5ca: 2540 0008 movel %d0,%a2@(8) 4b5ce: 2541 000c movel %d1,%a2@(12) &since_last_period, &status->since_last_period ); _Timestamp_To_timespec( 4b5d2: 202e fff4 movel %fp@(-12),%d0 4b5d6: 222e fff8 movel %fp@(-8),%d1 4b5da: 2540 0010 movel %d0,%a2@(16) 4b5de: 2541 0014 movel %d1,%a2@(20) status->since_last_period = since_last_period; status->executed_since_last_period = executed; #endif } _Thread_Enable_dispatch(); 4b5e2: 4eb9 0004 8c3a jsr 48c3a <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 4b5e8: 4280 clrl %d0 4b5ea: 6006 bras 4b5f2 Rate_monotonic_Period_time_t since_last_period; Rate_monotonic_Control *the_period; bool valid_status; if ( !status ) return RTEMS_INVALID_ADDRESS; 4b5ec: 7009 moveq #9,%d0 4b5ee: 6002 bras 4b5f2 #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 4b5f0: 7004 moveq #4,%d0 } 4b5f2: 246e ffe8 moveal %fp@(-24),%a2 4b5f6: 4e5e unlk %fp ... =============================================================================== 000464a2 : rtems_status_code rtems_rate_monotonic_period( rtems_id id, rtems_interval length ) { 464a2: 4e56 ffec linkw %fp,#-20 464a6: 48d7 041c moveml %d2-%d4/%a2,%sp@ Objects_Id id, Objects_Locations *location ) { return (Rate_monotonic_Control *) _Objects_Get( &_Rate_monotonic_Information, id, location ); 464aa: 486e fffc pea %fp@(-4) 464ae: 262e 0008 movel %fp@(8),%d3 464b2: 2f03 movel %d3,%sp@- 464b4: 4879 0005 e140 pea 5e140 <_Rate_monotonic_Information> 464ba: 242e 000c movel %fp@(12),%d2 464be: 4eb9 0004 8400 jsr 48400 <_Objects_Get> rtems_rate_monotonic_period_states local_state; ISR_Level level; the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 464c4: 4fef 000c lea %sp@(12),%sp 464c8: 2440 moveal %d0,%a2 464ca: 4aae fffc tstl %fp@(-4) 464ce: 6600 0150 bnew 46620 case OBJECTS_LOCAL: if ( !_Thread_Is_executing( the_period->owner ) ) { 464d2: 2039 0005 e3f8 movel 5e3f8 <_Per_CPU_Information+0xc>,%d0 464d8: b0aa 0040 cmpl %a2@(64),%d0 464dc: 670c beqs 464ea _Thread_Enable_dispatch(); 464de: 4eb9 0004 8c3a jsr 48c3a <_Thread_Enable_dispatch> return RTEMS_NOT_OWNER_OF_RESOURCE; 464e4: 7417 moveq #23,%d2 464e6: 6000 013a braw 46622 } if ( length == RTEMS_PERIOD_STATUS ) { 464ea: 4a82 tstl %d2 464ec: 6622 bnes 46510 switch ( the_period->state ) { 464ee: 202a 0038 movel %a2@(56),%d0 464f2: 7204 moveq #4,%d1 464f4: b280 cmpl %d0,%d1 464f6: 650c bcss 46504 <== NEVER TAKEN 464f8: 41f9 0005 bb0a lea 5bb0a ,%a0 464fe: 2430 0c00 movel %a0@(00000000,%d0:l:4),%d2 46502: 6002 bras 46506 46504: 4282 clrl %d2 <== NOT EXECUTED case RATE_MONOTONIC_ACTIVE: default: /* unreached -- only to remove warnings */ return_value = RTEMS_SUCCESSFUL; break; } _Thread_Enable_dispatch(); 46506: 4eb9 0004 8c3a jsr 48c3a <_Thread_Enable_dispatch> return( return_value ); 4650c: 6000 0114 braw 46622 } _ISR_Disable( level ); 46510: 203c 0000 0700 movel #1792,%d0 46516: 40c4 movew %sr,%d4 46518: 8084 orl %d4,%d0 4651a: 46c0 movew %d0,%sr switch ( the_period->state ) { 4651c: 202a 0038 movel %a2@(56),%d0 46520: 7202 moveq #2,%d1 46522: b280 cmpl %d0,%d1 46524: 675a beqs 46580 46526: 123c 0004 moveb #4,%d1 4652a: b280 cmpl %d0,%d1 4652c: 6700 00bc beqw 465ea 46530: 4a80 tstl %d0 46532: 6600 00ec bnew 46620 case RATE_MONOTONIC_INACTIVE: { _ISR_Enable( level ); 46536: 46c4 movew %d4,%sr /* * Baseline statistics information for the beginning of a period. */ _Rate_monotonic_Initiate_statistics( the_period ); 46538: 2f0a movel %a2,%sp@- 4653a: 4eb9 0004 6336 jsr 46336 <_Rate_monotonic_Initiate_statistics> the_period->state = RATE_MONOTONIC_ACTIVE; 46540: 7002 moveq #2,%d0 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 46542: 223c 0004 686c movel #288876,%d1 46548: 2540 0038 movel %d0,%a2@(56) 4654c: 2541 002c movel %d1,%a2@(44) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 46550: 42aa 0018 clrl %a2@(24) the_watchdog->routine = routine; the_watchdog->id = id; 46554: 2543 0030 movel %d3,%a2@(48) the_watchdog->user_data = user_data; 46558: 42aa 0034 clrl %a2@(52) _Rate_monotonic_Timeout, id, NULL ); the_period->next_length = length; 4655c: 2542 003c movel %d2,%a2@(60) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 46560: 2542 001c movel %d2,%a2@(28) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 46564: 486a 0010 pea %a2@(16) 46568: 4879 0005 e2f6 pea 5e2f6 <_Watchdog_Ticks_chain> 4656e: 4eb9 0004 9c48 jsr 49c48 <_Watchdog_Insert> _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 46574: 4eb9 0004 8c3a jsr 48c3a <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 4657a: 4fef 000c lea %sp@(12),%sp 4657e: 6066 bras 465e6 case RATE_MONOTONIC_ACTIVE: /* * Update statistics from the concluding period. */ _Rate_monotonic_Update_statistics( the_period ); 46580: 2f0a movel %a2,%sp@- 46582: 4eb9 0004 63ae jsr 463ae <_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; 46588: 7001 moveq #1,%d0 the_period->next_length = length; 4658a: 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; 4658e: 2540 0038 movel %d0,%a2@(56) the_period->next_length = length; _ISR_Enable( level ); 46592: 46c4 movew %d4,%sr _Thread_Executing->Wait.id = the_period->Object.id; 46594: 2079 0005 e3f8 moveal 5e3f8 <_Per_CPU_Information+0xc>,%a0 4659a: 216a 0008 0020 movel %a2@(8),%a0@(32) _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 465a0: 4878 4000 pea 4000 465a4: 2f08 movel %a0,%sp@- 465a6: 4eb9 0004 944c jsr 4944c <_Thread_Set_state> /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); 465ac: 203c 0000 0700 movel #1792,%d0 465b2: 40c1 movew %sr,%d1 465b4: 8081 orl %d1,%d0 465b6: 46c0 movew %d0,%sr local_state = the_period->state; the_period->state = RATE_MONOTONIC_ACTIVE; 465b8: 7402 moveq #2,%d2 /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); local_state = the_period->state; 465ba: 202a 0038 movel %a2@(56),%d0 the_period->state = RATE_MONOTONIC_ACTIVE; 465be: 2542 0038 movel %d2,%a2@(56) _ISR_Enable( level ); 465c2: 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 ) 465c4: 7203 moveq #3,%d1 465c6: 4fef 000c lea %sp@(12),%sp 465ca: b280 cmpl %d0,%d1 465cc: 6612 bnes 465e0 _Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 465ce: 4878 4000 pea 4000 465d2: 2f39 0005 e3f8 movel 5e3f8 <_Per_CPU_Information+0xc>,%sp@- 465d8: 4eb9 0004 8894 jsr 48894 <_Thread_Clear_state> 465de: 508f addql #8,%sp _Thread_Enable_dispatch(); 465e0: 4eb9 0004 8c3a jsr 48c3a <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 465e6: 4282 clrl %d2 465e8: 6038 bras 46622 case RATE_MONOTONIC_EXPIRED: /* * Update statistics from the concluding period */ _Rate_monotonic_Update_statistics( the_period ); 465ea: 2f0a movel %a2,%sp@- 465ec: 4eb9 0004 63ae jsr 463ae <_Rate_monotonic_Update_statistics> _ISR_Enable( level ); 465f2: 46c4 movew %d4,%sr the_period->state = RATE_MONOTONIC_ACTIVE; 465f4: 7002 moveq #2,%d0 the_period->next_length = length; 465f6: 2542 003c movel %d2,%a2@(60) */ _Rate_monotonic_Update_statistics( the_period ); _ISR_Enable( level ); the_period->state = RATE_MONOTONIC_ACTIVE; 465fa: 2540 0038 movel %d0,%a2@(56) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 465fe: 2542 001c movel %d2,%a2@(28) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 46602: 486a 0010 pea %a2@(16) the_period->next_length = length; _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); return RTEMS_TIMEOUT; 46606: 7406 moveq #6,%d2 46608: 4879 0005 e2f6 pea 5e2f6 <_Watchdog_Ticks_chain> 4660e: 4eb9 0004 9c48 jsr 49c48 <_Watchdog_Insert> the_period->state = RATE_MONOTONIC_ACTIVE; the_period->next_length = length; _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 46614: 4eb9 0004 8c3a jsr 48c3a <_Thread_Enable_dispatch> return RTEMS_TIMEOUT; 4661a: 4fef 000c lea %sp@(12),%sp 4661e: 6002 bras 46622 #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 46620: 7404 moveq #4,%d2 } 46622: 2002 movel %d2,%d0 46624: 4cee 041c ffec moveml %fp@(-20),%d2-%d4/%a2 4662a: 4e5e unlk %fp ... =============================================================================== 00050cb0 : rtems_status_code rtems_region_get_segment_size( rtems_id id, void *segment, uintptr_t *size ) { 50cb0: 4e56 fffc linkw %fp,#-4 50cb4: 2f03 movel %d3,%sp@- 50cb6: 262e 0010 movel %fp@(16),%d3 50cba: 2f02 movel %d2,%sp@- 50cbc: 242e 000c movel %fp@(12),%d2 Objects_Locations location; rtems_status_code return_status = RTEMS_SUCCESSFUL; register Region_Control *the_region; if ( !segment ) 50cc0: 6768 beqs 50d2a return RTEMS_INVALID_ADDRESS; if ( !size ) 50cc2: 4a83 tstl %d3 50cc4: 6764 beqs 50d2a return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); 50cc6: 2f39 0007 50ea movel 750ea <_RTEMS_Allocator_Mutex>,%sp@- 50ccc: 4eb9 0005 2b74 jsr 52b74 <_API_Mutex_Lock> 50cd2: 486e fffc pea %fp@(-4) 50cd6: 2f2e 0008 movel %fp@(8),%sp@- 50cda: 4879 0007 4f54 pea 74f54 <_Region_Information> 50ce0: 4eb9 0005 44b4 jsr 544b4 <_Objects_Get_no_protection> the_region = _Region_Get( id, &location ); switch ( location ) { 50ce6: 222e fffc movel %fp@(-4),%d1 50cea: 4fef 0010 lea %sp@(16),%sp 50cee: 6708 beqs 50cf8 <== NEVER TAKEN 50cf0: 7001 moveq #1,%d0 50cf2: b081 cmpl %d1,%d0 50cf4: 661a bnes 50d10 <== NEVER TAKEN 50cf6: 601c bras 50d14 case OBJECTS_LOCAL: if ( !_Heap_Size_of_alloc_area( &the_region->Memory, segment, size ) ) 50cf8: 2f03 movel %d3,%sp@- 50cfa: 2040 moveal %d0,%a0 50cfc: 2f02 movel %d2,%sp@- 50cfe: 4868 0068 pea %a0@(104) 50d02: 4eb9 0005 3f30 jsr 53f30 <_Heap_Size_of_alloc_area> 50d08: 4fef 000c lea %sp@(12),%sp 50d0c: 4a00 tstb %d0 50d0e: 6708 beqs 50d18 <== NEVER TAKEN void *segment, uintptr_t *size ) { Objects_Locations location; rtems_status_code return_status = RTEMS_SUCCESSFUL; 50d10: 4282 clrl %d2 50d12: 6006 bras 50d1a case OBJECTS_REMOTE: /* this error cannot be returned */ break; #endif case OBJECTS_ERROR: return_status = RTEMS_INVALID_ID; 50d14: 7404 moveq #4,%d2 50d16: 6002 bras 50d1a the_region = _Region_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: if ( !_Heap_Size_of_alloc_area( &the_region->Memory, segment, size ) ) return_status = RTEMS_INVALID_ADDRESS; 50d18: 7409 moveq #9,%d2 <== NOT EXECUTED case OBJECTS_ERROR: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 50d1a: 2f39 0007 50ea movel 750ea <_RTEMS_Allocator_Mutex>,%sp@- 50d20: 4eb9 0005 2bd4 jsr 52bd4 <_API_Mutex_Unlock> return return_status; 50d26: 588f addql #4,%sp 50d28: 6002 bras 50d2c if ( !segment ) return RTEMS_INVALID_ADDRESS; if ( !size ) return RTEMS_INVALID_ADDRESS; 50d2a: 7409 moveq #9,%d2 break; } _RTEMS_Unlock_allocator(); return return_status; } 50d2c: 2002 movel %d2,%d0 50d2e: 242e fff4 movel %fp@(-12),%d2 50d32: 262e fff8 movel %fp@(-8),%d3 50d36: 4e5e unlk %fp ... =============================================================================== 00051310 : rtems_status_code rtems_signal_send( rtems_id id, rtems_signal_set signal_set ) { 51310: 4e56 fffc linkw %fp,#-4 51314: 2f03 movel %d3,%sp@- 51316: 2f02 movel %d2,%sp@- 51318: 242e 000c movel %fp@(12),%d2 register Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; ASR_Information *asr; if ( !signal_set ) 5131c: 677a beqs 51398 return RTEMS_INVALID_NUMBER; the_thread = _Thread_Get( id, &location ); 5131e: 486e fffc pea %fp@(-4) 51322: 2f2e 0008 movel %fp@(8),%sp@- 51326: 4eb9 0005 4d4c jsr 54d4c <_Thread_Get> switch ( location ) { 5132c: 508f addql #8,%sp 5132e: 4aae fffc tstl %fp@(-4) 51332: 6668 bnes 5139c case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; 51334: 2240 moveal %d0,%a1 51336: 2069 0108 moveal %a1@(264),%a0 asr = &api->Signal; if ( ! _ASR_Is_null_handler( asr->handler ) ) { 5133a: 4aa8 000a tstl %a0@(10) 5133e: 674e beqs 5138e if ( asr->is_enabled ) { 51340: 4a28 0008 tstb %a0@(8) 51344: 672c beqs 51372 rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 51346: 223c 0000 0700 movel #1792,%d1 5134c: 40c3 movew %sr,%d3 5134e: 8283 orl %d3,%d1 51350: 46c1 movew %d1,%sr *signal_set |= signals; 51352: 85a8 0012 orl %d2,%a0@(18) _ISR_Enable( _level ); 51356: 46c3 movew %d3,%sr _ASR_Post_signals( signal_set, &asr->signals_posted ); if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 51358: 4ab9 0007 5210 tstl 75210 <_Per_CPU_Information+0x8> 5135e: 6724 beqs 51384 51360: b0b9 0007 5214 cmpl 75214 <_Per_CPU_Information+0xc>,%d0 51366: 661c bnes 51384 <== NEVER TAKEN _Context_Switch_necessary = true; 51368: 7001 moveq #1,%d0 5136a: 13c0 0007 5220 moveb %d0,75220 <_Per_CPU_Information+0x18> 51370: 6012 bras 51384 rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 51372: 203c 0000 0700 movel #1792,%d0 51378: 40c1 movew %sr,%d1 5137a: 8081 orl %d1,%d0 5137c: 46c0 movew %d0,%sr *signal_set |= signals; 5137e: 85a8 0016 orl %d2,%a0@(22) _ISR_Enable( _level ); 51382: 46c1 movew %d1,%sr } else { _ASR_Post_signals( signal_set, &asr->signals_pending ); } _Thread_Enable_dispatch(); 51384: 4eb9 0005 4d26 jsr 54d26 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 5138a: 4280 clrl %d0 5138c: 6010 bras 5139e } _Thread_Enable_dispatch(); 5138e: 4eb9 0005 4d26 jsr 54d26 <_Thread_Enable_dispatch> return RTEMS_NOT_DEFINED; 51394: 700b moveq #11,%d0 51396: 6006 bras 5139e Objects_Locations location; RTEMS_API_Control *api; ASR_Information *asr; if ( !signal_set ) return RTEMS_INVALID_NUMBER; 51398: 700a moveq #10,%d0 5139a: 6002 bras 5139e case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 5139c: 7004 moveq #4,%d0 } 5139e: 242e fff4 movel %fp@(-12),%d2 513a2: 262e fff8 movel %fp@(-8),%d3 513a6: 4e5e unlk %fp ... =============================================================================== 00047244 : rtems_status_code rtems_task_get_note( rtems_id id, uint32_t notepad, uint32_t *note ) { 47244: 4e56 fffc linkw %fp,#-4 47248: 202e 0008 movel %fp@(8),%d0 4724c: 2f0a movel %a2,%sp@- 4724e: 246e 0010 moveal %fp@(16),%a2 47252: 2f02 movel %d2,%sp@- 47254: 242e 000c movel %fp@(12),%d2 register Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; if ( !rtems_configuration_get_notepads_enabled() ) 47258: 4a39 0005 d604 tstb 5d604 4725e: 6752 beqs 472b2 <== NEVER TAKEN return RTEMS_NOT_CONFIGURED; if ( !note ) 47260: 4a8a tstl %a2 47262: 6752 beqs 472b6 /* * 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 ) 47264: 720f moveq #15,%d1 47266: b282 cmpl %d2,%d1 47268: 6550 bcss 472ba /* * Optimize the most likely case to avoid the Thread_Dispatch. */ if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) || 4726a: 4a80 tstl %d0 4726c: 670c beqs 4727a _Objects_Are_ids_equal( id, _Thread_Executing->Object.id ) ) { 4726e: 2079 0005 f1c8 moveal 5f1c8 <_Per_CPU_Information+0xc>,%a0 /* * Optimize the most likely case to avoid the Thread_Dispatch. */ if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) || 47274: b0a8 0008 cmpl %a0@(8),%d0 47278: 6610 bnes 4728a _Objects_Are_ids_equal( id, _Thread_Executing->Object.id ) ) { api = _Thread_Executing->API_Extensions[ THREAD_API_RTEMS ]; 4727a: 2079 0005 f1c8 moveal 5f1c8 <_Per_CPU_Information+0xc>,%a0 *note = api->Notepads[ notepad ]; 47280: 2068 0108 moveal %a0@(264),%a0 47284: 24b0 2c1e movel %a0@(0000001e,%d2:l:4),%a2@ 47288: 6024 bras 472ae return RTEMS_SUCCESSFUL; } the_thread = _Thread_Get( id, &location ); 4728a: 486e fffc pea %fp@(-4) 4728e: 2f00 movel %d0,%sp@- 47290: 4eb9 0004 9068 jsr 49068 <_Thread_Get> switch ( location ) { 47296: 508f addql #8,%sp 47298: 4aae fffc tstl %fp@(-4) 4729c: 6620 bnes 472be case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; *note = api->Notepads[ notepad ]; 4729e: 2240 moveal %d0,%a1 472a0: 2069 0108 moveal %a1@(264),%a0 472a4: 24b0 2c1e movel %a0@(0000001e,%d2:l:4),%a2@ _Thread_Enable_dispatch(); 472a8: 4eb9 0004 9042 jsr 49042 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 472ae: 4280 clrl %d0 472b0: 600e bras 472c0 register Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; if ( !rtems_configuration_get_notepads_enabled() ) return RTEMS_NOT_CONFIGURED; 472b2: 7016 moveq #22,%d0 472b4: 600a bras 472c0 if ( !note ) return RTEMS_INVALID_ADDRESS; 472b6: 7009 moveq #9,%d0 472b8: 6006 bras 472c0 * 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 ) return RTEMS_INVALID_NUMBER; 472ba: 700a moveq #10,%d0 472bc: 6002 bras 472c0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 472be: 7004 moveq #4,%d0 } 472c0: 242e fff4 movel %fp@(-12),%d2 472c4: 246e fff8 moveal %fp@(-8),%a2 472c8: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004b8f0 : rtems_status_code rtems_task_mode( rtems_mode mode_set, rtems_mode mask, rtems_mode *previous_mode_set ) { 4b8f0: 4e56 ffe4 linkw %fp,#-28 4b8f4: 48d7 1c3c moveml %d2-%d5/%a2-%a4,%sp@ 4b8f8: 262e 0008 movel %fp@(8),%d3 4b8fc: 282e 000c movel %fp@(12),%d4 4b900: 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 ) 4b904: 4a8c tstl %a4 4b906: 6700 010c beqw 4ba14 return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; 4b90a: 2679 0005 c780 moveal 5c780 <_Per_CPU_Information+0xc>,%a3 api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 4b910: 4a2b 0074 tstb %a3@(116) 4b914: 57c2 seq %d2 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 4b916: 246b 0108 moveal %a3@(264),%a2 asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 4b91a: 49c2 extbl %d2 4b91c: 0282 0000 0100 andil #256,%d2 if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) 4b922: 4aab 007a tstl %a3@(122) 4b926: 6704 beqs 4b92c old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; 4b928: 08c2 0009 bset #9,%d2 old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; 4b92c: 4a2a 0008 tstb %a2@(8) 4b930: 57c5 seq %d5 old_mode |= _ISR_Get_level(); 4b932: 4eb9 0004 88c8 jsr 488c8 <_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; 4b938: 49c5 extbl %d5 4b93a: 0285 0000 0400 andil #1024,%d5 4b940: 8085 orl %d5,%d0 old_mode |= _ISR_Get_level(); 4b942: 8082 orl %d2,%d0 4b944: 2880 movel %d0,%a4@ /* * These are generic thread scheduling characteristics. */ if ( mask & RTEMS_PREEMPT_MASK ) 4b946: 0804 0008 btst #8,%d4 4b94a: 670c beqs 4b958 executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; 4b94c: 0803 0008 btst #8,%d3 4b950: 57c0 seq %d0 4b952: 4480 negl %d0 4b954: 1740 0074 moveb %d0,%a3@(116) if ( mask & RTEMS_TIMESLICE_MASK ) { 4b958: 0804 0009 btst #9,%d4 4b95c: 671c beqs 4b97a if ( _Modes_Is_timeslice(mode_set) ) { 4b95e: 0803 0009 btst #9,%d3 4b962: 6712 beqs 4b976 executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 4b964: 41f9 0005 c574 lea 5c574 <_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; 4b96a: 7001 moveq #1,%d0 executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 4b96c: 2750 0076 movel %a0@,%a3@(118) if ( mask & RTEMS_PREEMPT_MASK ) executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; if ( mask & RTEMS_TIMESLICE_MASK ) { if ( _Modes_Is_timeslice(mode_set) ) { executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 4b970: 2740 007a movel %d0,%a3@(122) 4b974: 6004 bras 4b97a executing->cpu_time_budget = _Thread_Ticks_per_timeslice; } else executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 4b976: 42ab 007a clrl %a3@(122) /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) 4b97a: 7007 moveq #7,%d0 4b97c: c084 andl %d4,%d0 4b97e: 6712 beqs 4b992 */ RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level ( Modes_Control mode_set ) { _ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) ); 4b980: 40c0 movew %sr,%d0 */ RTEMS_INLINE_ROUTINE ISR_Level _Modes_Get_interrupt_level ( Modes_Control mode_set ) { return ( mode_set & RTEMS_INTERRUPT_MASK ); 4b982: 7207 moveq #7,%d1 4b984: c283 andl %d3,%d1 */ RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level ( Modes_Control mode_set ) { _ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) ); 4b986: 0280 0000 f8ff andil #63743,%d0 4b98c: e189 lsll #8,%d1 4b98e: 8081 orl %d1,%d0 4b990: 46c0 movew %d0,%sr */ is_asr_enabled = false; needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { 4b992: 0804 000a btst #10,%d4 4b996: 6740 beqs 4b9d8 is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true; if ( is_asr_enabled != asr->is_enabled ) { 4b998: 4281 clrl %d1 4b99a: 122a 0008 moveb %a2@(8),%d1 4b99e: 4282 clrl %d2 * Output: * *previous_mode_set - previous mode set * always return RTEMS_SUCCESSFUL; */ rtems_status_code rtems_task_mode( 4b9a0: 0803 000a btst #10,%d3 4b9a4: 57c0 seq %d0 4b9a6: 4480 negl %d0 is_asr_enabled = false; needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true; if ( is_asr_enabled != asr->is_enabled ) { 4b9a8: 1400 moveb %d0,%d2 4b9aa: b282 cmpl %d2,%d1 4b9ac: 672a beqs 4b9d8 asr->is_enabled = is_asr_enabled; 4b9ae: 1540 0008 moveb %d0,%a2@(8) ) { rtems_signal_set _signals; ISR_Level _level; _ISR_Disable( _level ); 4b9b2: 203c 0000 0700 movel #1792,%d0 4b9b8: 40c1 movew %sr,%d1 4b9ba: 8081 orl %d1,%d0 4b9bc: 46c0 movew %d0,%sr _signals = information->signals_pending; 4b9be: 202a 0016 movel %a2@(22),%d0 information->signals_pending = information->signals_posted; 4b9c2: 256a 0012 0016 movel %a2@(18),%a2@(22) information->signals_posted = _signals; 4b9c8: 2540 0012 movel %d0,%a2@(18) _ISR_Enable( _level ); 4b9cc: 46c1 movew %d1,%sr /* * This is specific to the RTEMS API */ is_asr_enabled = false; needs_asr_dispatching = false; 4b9ce: 4aaa 0012 tstl %a2@(18) 4b9d2: 56c0 sne %d0 4b9d4: 4480 negl %d0 4b9d6: 6002 bras 4b9da 4b9d8: 4200 clrb %d0 needs_asr_dispatching = true; } } } if ( _System_state_Is_up( _System_state_Get() ) ) 4b9da: 7203 moveq #3,%d1 4b9dc: b2b9 0005 c728 cmpl 5c728 <_System_state_Current>,%d1 4b9e2: 6634 bnes 4ba18 <== NEVER TAKEN */ RTEMS_INLINE_ROUTINE bool _Thread_Evaluate_mode( void ) { Thread_Control *executing; executing = _Thread_Executing; 4b9e4: 2079 0005 c780 moveal 5c780 <_Per_CPU_Information+0xc>,%a0 if ( !_States_Is_ready( executing->current_state ) || 4b9ea: 4aa8 0010 tstl %a0@(16) 4b9ee: 660e bnes 4b9fe <== NEVER TAKEN 4b9f0: b1f9 0005 c784 cmpal 5c784 <_Per_CPU_Information+0x10>,%a0 4b9f6: 6710 beqs 4ba08 ( !_Thread_Is_heir( executing ) && executing->is_preemptible ) ) { 4b9f8: 4a28 0074 tstb %a0@(116) 4b9fc: 670a beqs 4ba08 <== NEVER TAKEN _Context_Switch_necessary = true; 4b9fe: 7001 moveq #1,%d0 4ba00: 13c0 0005 c78c moveb %d0,5c78c <_Per_CPU_Information+0x18> 4ba06: 6004 bras 4ba0c if ( _Thread_Evaluate_mode() || needs_asr_dispatching ) 4ba08: 4a00 tstb %d0 4ba0a: 670c beqs 4ba18 _Thread_Dispatch(); 4ba0c: 4eb9 0004 74d4 jsr 474d4 <_Thread_Dispatch> 4ba12: 6004 bras 4ba18 bool is_asr_enabled = false; bool needs_asr_dispatching = false; rtems_mode old_mode; if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; 4ba14: 7009 moveq #9,%d0 4ba16: 6002 bras 4ba1a if ( _System_state_Is_up( _System_state_Get() ) ) if ( _Thread_Evaluate_mode() || needs_asr_dispatching ) _Thread_Dispatch(); return RTEMS_SUCCESSFUL; 4ba18: 4280 clrl %d0 } 4ba1a: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4 4ba20: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00049468 : rtems_status_code rtems_task_set_priority( rtems_id id, rtems_task_priority new_priority, rtems_task_priority *old_priority ) { 49468: 4e56 fffc linkw %fp,#-4 4946c: 2f0a movel %a2,%sp@- 4946e: 246e 0010 moveal %fp@(16),%a2 49472: 2f02 movel %d2,%sp@- 49474: 242e 000c movel %fp@(12),%d2 register Thread_Control *the_thread; Objects_Locations location; if ( new_priority != RTEMS_CURRENT_PRIORITY && 49478: 670c beqs 49486 RTEMS_INLINE_ROUTINE bool _RTEMS_tasks_Priority_is_valid ( rtems_task_priority the_priority ) { return ( ( the_priority >= RTEMS_MINIMUM_PRIORITY ) && ( the_priority <= RTEMS_MAXIMUM_PRIORITY ) ); 4947a: 4280 clrl %d0 4947c: 1039 0005 e832 moveb 5e832 ,%d0 49482: b082 cmpl %d2,%d0 49484: 654e bcss 494d4 !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; if ( !old_priority ) 49486: 4a8a tstl %a2 49488: 674e beqs 494d8 return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); 4948a: 486e fffc pea %fp@(-4) 4948e: 2f2e 0008 movel %fp@(8),%sp@- 49492: 4eb9 0004 b0f0 jsr 4b0f0 <_Thread_Get> switch ( location ) { 49498: 508f addql #8,%sp return RTEMS_INVALID_PRIORITY; if ( !old_priority ) return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); 4949a: 2040 moveal %d0,%a0 switch ( location ) { 4949c: 4aae fffc tstl %fp@(-4) 494a0: 663a bnes 494dc case OBJECTS_LOCAL: /* XXX need helper to "convert" from core priority */ *old_priority = the_thread->current_priority; 494a2: 24a8 0014 movel %a0@(20),%a2@ if ( new_priority != RTEMS_CURRENT_PRIORITY ) { 494a6: 4a82 tstl %d2 494a8: 6720 beqs 494ca the_thread->real_priority = new_priority; 494aa: 2142 0018 movel %d2,%a0@(24) if ( the_thread->resource_count == 0 || 494ae: 4aa8 001c tstl %a0@(28) 494b2: 6706 beqs 494ba 494b4: b4a8 0014 cmpl %a0@(20),%d2 494b8: 6410 bccs 494ca <== ALWAYS TAKEN the_thread->current_priority > new_priority ) _Thread_Change_priority( the_thread, new_priority, false ); 494ba: 42a7 clrl %sp@- 494bc: 2f02 movel %d2,%sp@- 494be: 2f08 movel %a0,%sp@- 494c0: 4eb9 0004 abe4 jsr 4abe4 <_Thread_Change_priority> 494c6: 4fef 000c lea %sp@(12),%sp } _Thread_Enable_dispatch(); 494ca: 4eb9 0004 b0ca jsr 4b0ca <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 494d0: 4280 clrl %d0 494d2: 600a bras 494de register Thread_Control *the_thread; Objects_Locations location; if ( new_priority != RTEMS_CURRENT_PRIORITY && !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; 494d4: 7013 moveq #19,%d0 494d6: 6006 bras 494de if ( !old_priority ) return RTEMS_INVALID_ADDRESS; 494d8: 7009 moveq #9,%d0 494da: 6002 bras 494de case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 494dc: 7004 moveq #4,%d0 } 494de: 242e fff4 movel %fp@(-12),%d2 494e2: 246e fff8 moveal %fp@(-8),%a2 494e6: 4e5e unlk %fp ... =============================================================================== 00051b9c : */ rtems_status_code rtems_timer_cancel( rtems_id id ) { 51b9c: 4e56 fffc linkw %fp,#-4 Objects_Id id, Objects_Locations *location ) { return (Timer_Control *) _Objects_Get( &_Timer_Information, id, location ); 51ba0: 486e fffc pea %fp@(-4) 51ba4: 2f2e 0008 movel %fp@(8),%sp@- 51ba8: 4879 0007 525e pea 7525e <_Timer_Information> 51bae: 4eb9 0005 44ec jsr 544ec <_Objects_Get> Timer_Control *the_timer; Objects_Locations location; the_timer = _Timer_Get( id, &location ); switch ( location ) { 51bb4: 4fef 000c lea %sp@(12),%sp 51bb8: 4aae fffc tstl %fp@(-4) 51bbc: 6620 bnes 51bde case OBJECTS_LOCAL: if ( !_Timer_Is_dormant_class( the_timer->the_class ) ) 51bbe: 7204 moveq #4,%d1 51bc0: 2040 moveal %d0,%a0 51bc2: b2a8 0038 cmpl %a0@(56),%d1 51bc6: 670c beqs 51bd4 <== NEVER TAKEN (void) _Watchdog_Remove( &the_timer->Ticker ); 51bc8: 4868 0010 pea %a0@(16) 51bcc: 4eb9 0005 603c jsr 5603c <_Watchdog_Remove> 51bd2: 588f addql #4,%sp _Thread_Enable_dispatch(); 51bd4: 4eb9 0005 4d26 jsr 54d26 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 51bda: 4280 clrl %d0 51bdc: 6002 bras 51be0 #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 51bde: 7004 moveq #4,%d0 } 51be0: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00045e1c : rtems_status_code rtems_timer_create( rtems_name name, rtems_id *id ) { 45e1c: 4e56 fff4 linkw %fp,#-12 45e20: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 45e24: 242e 0008 movel %fp@(8),%d2 45e28: 246e 000c moveal %fp@(12),%a2 Timer_Control *the_timer; if ( !rtems_is_name_valid( name ) ) 45e2c: 6766 beqs 45e94 <== NEVER TAKEN return RTEMS_INVALID_NAME; if ( !id ) 45e2e: 4a8a tstl %a2 45e30: 6766 beqs 45e98 <== NEVER TAKEN 45e32: 2039 0005 c830 movel 5c830 <_Thread_Dispatch_disable_level>,%d0 45e38: 5280 addql #1,%d0 45e3a: 23c0 0005 c830 movel %d0,5c830 <_Thread_Dispatch_disable_level> * This function allocates a timer control block from * the inactive chain of free timer control blocks. */ RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Allocate( void ) { return (Timer_Control *) _Objects_Allocate( &_Timer_Information ); 45e40: 4879 0005 ca06 pea 5ca06 <_Timer_Information> 45e46: 4eb9 0004 6c18 jsr 46c18 <_Objects_Allocate> _Thread_Disable_dispatch(); /* to prevent deletion */ the_timer = _Timer_Allocate(); if ( !the_timer ) { 45e4c: 588f addql #4,%sp 45e4e: 43f9 0004 782e lea 4782e <_Thread_Enable_dispatch>,%a1 45e54: 2040 moveal %d0,%a0 45e56: 4a80 tstl %d0 45e58: 6606 bnes 45e60 _Thread_Enable_dispatch(); 45e5a: 4e91 jsr %a1@ return RTEMS_TOO_MANY; 45e5c: 7005 moveq #5,%d0 45e5e: 603a bras 45e9a } the_timer->the_class = TIMER_DORMANT; 45e60: 7004 moveq #4,%d0 Objects_Information *information, Objects_Control *the_object, Objects_Name name ) { _Objects_Set_local_object( 45e62: 4281 clrl %d1 45e64: 2140 0038 movel %d0,%a0@(56) information, _Objects_Get_index( the_object->id ), 45e68: 2028 0008 movel %a0@(8),%d0 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 45e6c: 2679 0005 ca1e moveal 5ca1e <_Timer_Information+0x18>,%a3 Objects_Information *information, Objects_Control *the_object, Objects_Name name ) { _Objects_Set_local_object( 45e72: 3200 movew %d0,%d1 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 45e74: 42a8 0018 clrl %a0@(24) the_watchdog->routine = routine; 45e78: 42a8 002c clrl %a0@(44) the_watchdog->id = id; 45e7c: 42a8 0030 clrl %a0@(48) the_watchdog->user_data = user_data; 45e80: 42a8 0034 clrl %a0@(52) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 45e84: 2788 1c00 movel %a0,%a3@(00000000,%d1:l:4) information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 45e88: 2142 000c movel %d2,%a0@(12) &_Timer_Information, &the_timer->Object, (Objects_Name) name ); *id = the_timer->Object.id; 45e8c: 2480 movel %d0,%a2@ _Thread_Enable_dispatch(); 45e8e: 4e91 jsr %a1@ return RTEMS_SUCCESSFUL; 45e90: 4280 clrl %d0 45e92: 6006 bras 45e9a ) { Timer_Control *the_timer; if ( !rtems_is_name_valid( name ) ) return RTEMS_INVALID_NAME; 45e94: 7003 moveq #3,%d0 45e96: 6002 bras 45e9a if ( !id ) return RTEMS_INVALID_ADDRESS; 45e98: 7009 moveq #9,%d0 ); *id = the_timer->Object.id; _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 45e9a: 4cee 0c04 fff4 moveml %fp@(-12),%d2/%a2-%a3 45ea0: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00051f68 : rtems_id id, rtems_interval ticks, rtems_timer_service_routine_entry routine, void *user_data ) { 51f68: 4e56 ffe4 linkw %fp,#-28 51f6c: 48d7 1c1c moveml %d2-%d4/%a2-%a4,%sp@ 51f70: 262e 0008 movel %fp@(8),%d3 51f74: 242e 000c movel %fp@(12),%d2 51f78: 282e 0010 movel %fp@(16),%d4 Timer_Control *the_timer; Objects_Locations location; ISR_Level level; Timer_server_Control *timer_server = _Timer_server; 51f7c: 2679 0007 5296 moveal 75296 <_Timer_server>,%a3 if ( !timer_server ) 51f82: 4a8b tstl %a3 51f84: 6700 0086 beqw 5200c return RTEMS_INCORRECT_STATE; if ( !routine ) 51f88: 4a84 tstl %d4 51f8a: 6700 0084 beqw 52010 return RTEMS_INVALID_ADDRESS; if ( ticks == 0 ) 51f8e: 4a82 tstl %d2 51f90: 6700 0082 beqw 52014 51f94: 486e fffc pea %fp@(-4) 51f98: 2f03 movel %d3,%sp@- 51f9a: 4879 0007 525e pea 7525e <_Timer_Information> 51fa0: 4eb9 0005 44ec jsr 544ec <_Objects_Get> return RTEMS_INVALID_NUMBER; the_timer = _Timer_Get( id, &location ); switch ( location ) { 51fa6: 4fef 000c lea %sp@(12),%sp 51faa: 2440 moveal %d0,%a2 51fac: 4aae fffc tstl %fp@(-4) 51fb0: 6666 bnes 52018 <== NEVER TAKEN case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); 51fb2: 486a 0010 pea %a2@(16) 51fb6: 4eb9 0005 603c jsr 5603c <_Watchdog_Remove> _ISR_Disable( level ); 51fbc: 203c 0000 0700 movel #1792,%d0 51fc2: 40c1 movew %sr,%d1 51fc4: 8081 orl %d1,%d0 51fc6: 46c0 movew %d0,%sr 51fc8: 49f9 0005 4d26 lea 54d26 <_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 ) { 51fce: 588f addql #4,%sp 51fd0: 4aaa 0018 tstl %a2@(24) 51fd4: 6706 beqs 51fdc _ISR_Enable( level ); 51fd6: 46c1 movew %d1,%sr _Thread_Enable_dispatch(); 51fd8: 4e94 jsr %a4@ 51fda: 602c bras 52008 /* * 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; 51fdc: 7001 moveq #1,%d0 ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 51fde: 256e 0014 0034 movel %fp@(20),%a2@(52) 51fe4: 2540 0038 movel %d0,%a2@(56) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 51fe8: 42aa 0018 clrl %a2@(24) the_watchdog->routine = routine; 51fec: 2544 002c movel %d4,%a2@(44) the_watchdog->id = id; 51ff0: 2543 0030 movel %d3,%a2@(48) _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = ticks; 51ff4: 2542 001c movel %d2,%a2@(28) _ISR_Enable( level ); 51ff8: 46c1 movew %d1,%sr (*timer_server->schedule_operation)( timer_server, the_timer ); 51ffa: 2f0a movel %a2,%sp@- 51ffc: 2f0b movel %a3,%sp@- 51ffe: 206b 0004 moveal %a3@(4),%a0 52002: 4e90 jsr %a0@ _Thread_Enable_dispatch(); 52004: 4e94 jsr %a4@ return RTEMS_SUCCESSFUL; 52006: 508f addql #8,%sp 52008: 4280 clrl %d0 5200a: 600e bras 5201a Objects_Locations location; ISR_Level level; Timer_server_Control *timer_server = _Timer_server; if ( !timer_server ) return RTEMS_INCORRECT_STATE; 5200c: 700e moveq #14,%d0 5200e: 600a bras 5201a if ( !routine ) return RTEMS_INVALID_ADDRESS; 52010: 7009 moveq #9,%d0 52012: 6006 bras 5201a if ( ticks == 0 ) return RTEMS_INVALID_NUMBER; 52014: 700a moveq #10,%d0 52016: 6002 bras 5201a #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 52018: 7004 moveq #4,%d0 } 5201a: 4cee 1c1c ffe4 moveml %fp@(-28),%d2-%d4/%a2-%a4 52020: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00052024 : rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ) { 52024: 4e56 ffe8 linkw %fp,#-24 52028: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 5202c: 262e 0008 movel %fp@(8),%d3 52030: 242e 000c movel %fp@(12),%d2 52034: 282e 0010 movel %fp@(16),%d4 Timer_Control *the_timer; Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; 52038: 2679 0007 5296 moveal 75296 <_Timer_server>,%a3 if ( !timer_server ) 5203e: 4a8b tstl %a3 52040: 6700 0098 beqw 520da return RTEMS_INCORRECT_STATE; if ( !_TOD_Is_set ) 52044: 4a39 0007 5058 tstb 75058 <_TOD_Is_set> 5204a: 6700 0092 beqw 520de return RTEMS_NOT_DEFINED; if ( !routine ) 5204e: 4a84 tstl %d4 52050: 6700 0090 beqw 520e2 return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) 52054: 2f02 movel %d2,%sp@- 52056: 4eb9 0004 f4d4 jsr 4f4d4 <_TOD_Validate> 5205c: 588f addql #4,%sp 5205e: 4a00 tstb %d0 52060: 6700 0084 beqw 520e6 return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 52064: 2f02 movel %d2,%sp@- 52066: 4eb9 0004 f438 jsr 4f438 <_TOD_To_seconds> if ( seconds <= _TOD_Seconds_since_epoch() ) 5206c: 588f addql #4,%sp return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 5206e: 2400 movel %d0,%d2 if ( seconds <= _TOD_Seconds_since_epoch() ) 52070: b0b9 0007 50d2 cmpl 750d2 <_TOD_Now>,%d0 52076: 636e blss 520e6 52078: 486e fffc pea %fp@(-4) 5207c: 2f03 movel %d3,%sp@- 5207e: 4879 0007 525e pea 7525e <_Timer_Information> 52084: 4eb9 0005 44ec jsr 544ec <_Objects_Get> return RTEMS_INVALID_CLOCK; the_timer = _Timer_Get( id, &location ); switch ( location ) { 5208a: 4fef 000c lea %sp@(12),%sp 5208e: 2440 moveal %d0,%a2 52090: 4aae fffc tstl %fp@(-4) 52094: 6654 bnes 520ea case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); 52096: 486a 0010 pea %a2@(16) 5209a: 4eb9 0005 603c jsr 5603c <_Watchdog_Remove> the_watchdog->user_data = user_data; 520a0: 256e 0014 0034 movel %fp@(20),%a2@(52) the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK; _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); 520a6: 94b9 0007 50d2 subl 750d2 <_TOD_Now>,%d2 the_timer = _Timer_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK; 520ac: 7003 moveq #3,%d0 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 520ae: 42aa 0018 clrl %a2@(24) 520b2: 2540 0038 movel %d0,%a2@(56) the_watchdog->routine = routine; 520b6: 2544 002c movel %d4,%a2@(44) the_watchdog->id = id; 520ba: 2543 0030 movel %d3,%a2@(48) _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); 520be: 2542 001c movel %d2,%a2@(28) (*timer_server->schedule_operation)( timer_server, the_timer ); 520c2: 2f0a movel %a2,%sp@- 520c4: 2f0b movel %a3,%sp@- 520c6: 206b 0004 moveal %a3@(4),%a0 520ca: 4e90 jsr %a0@ _Thread_Enable_dispatch(); 520cc: 4eb9 0005 4d26 jsr 54d26 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 520d2: 4fef 000c lea %sp@(12),%sp 520d6: 4280 clrl %d0 520d8: 6012 bras 520ec Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; if ( !timer_server ) return RTEMS_INCORRECT_STATE; 520da: 700e moveq #14,%d0 520dc: 600e bras 520ec if ( !_TOD_Is_set ) return RTEMS_NOT_DEFINED; 520de: 700b moveq #11,%d0 <== NOT EXECUTED 520e0: 600a bras 520ec <== NOT EXECUTED if ( !routine ) return RTEMS_INVALID_ADDRESS; 520e2: 7009 moveq #9,%d0 520e4: 6006 bras 520ec if ( !_TOD_Validate( wall_time ) ) return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); if ( seconds <= _TOD_Seconds_since_epoch() ) return RTEMS_INVALID_CLOCK; 520e6: 7014 moveq #20,%d0 520e8: 6002 bras 520ec #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 520ea: 7004 moveq #4,%d0 } 520ec: 4cee 0c1c ffe8 moveml %fp@(-24),%d2-%d4/%a2-%a3 520f2: 4e5e unlk %fp ...