00045840 <_API_Mutex_Unlock>: #include void _API_Mutex_Unlock( API_Mutex_Control *the_mutex ) { 45840: 4e56 0000 linkw %fp,#0 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 45844: 2039 0005 ba78 movel 5ba78 <_Thread_Dispatch_disable_level>,%d0 4584a: 5280 addql #1,%d0 4584c: 206e 0008 moveal %fp@(8),%a0 45850: 23c0 0005 ba78 movel %d0,5ba78 <_Thread_Dispatch_disable_level> _Thread_Disable_dispatch(); _CORE_mutex_Surrender( 45856: 42a7 clrl %sp@- 45858: 2f28 0008 movel %a0@(8),%sp@- 4585c: 4868 0010 pea %a0@(16) 45860: 4eb9 0004 5a6c jsr 45a6c <_CORE_mutex_Surrender> &the_mutex->Mutex, the_mutex->Object.id, NULL ); _Thread_Enable_dispatch(); 45866: 4fef 000c lea %sp@(12),%sp } 4586a: 4e5e unlk %fp _CORE_mutex_Surrender( &the_mutex->Mutex, the_mutex->Object.id, NULL ); _Thread_Enable_dispatch(); 4586c: 4ef9 0004 6c62 jmp 46c62 <_Thread_Enable_dispatch> ... 0004b428 <_CORE_barrier_Wait>: Thread_Control *executing; ISR_Level level; executing = _Thread_Executing; executing->Wait.return_code = CORE_BARRIER_STATUS_SUCCESSFUL; _ISR_Disable( level ); 4b428: 203c 0000 0700 movel #1792,%d0 Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_barrier_API_mp_support_callout api_barrier_mp_support ) { 4b42e: 4e56 fff4 linkw %fp,#-12 Thread_Control *executing; ISR_Level level; executing = _Thread_Executing; 4b432: 2279 0005 bb32 moveal 5bb32 <_Thread_Executing>,%a1 Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_barrier_API_mp_support_callout api_barrier_mp_support ) { 4b438: 48d7 001c moveml %d2-%d4,%sp@ 4b43c: 242e 000c movel %fp@(12),%d2 4b440: 262e 0014 movel %fp@(20),%d3 Thread_Control *executing; ISR_Level level; executing = _Thread_Executing; executing->Wait.return_code = CORE_BARRIER_STATUS_SUCCESSFUL; 4b444: 42a9 0034 clrl %a1@(52) Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_barrier_API_mp_support_callout api_barrier_mp_support ) { 4b448: 206e 0008 moveal %fp@(8),%a0 4b44c: 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 ); 4b450: 40c1 movew %sr,%d1 4b452: 8081 orl %d1,%d0 4b454: 46c0 movew %d0,%sr the_barrier->number_of_waiting_threads++; 4b456: 2028 0048 movel %a0@(72),%d0 4b45a: 5280 addql #1,%d0 4b45c: 2140 0048 movel %d0,%a0@(72) if ( _CORE_barrier_Is_automatic( &the_barrier->Attributes ) ) { 4b460: 4aa8 0040 tstl %a0@(64) 4b464: 6626 bnes 4b48c <_CORE_barrier_Wait+0x64> if ( the_barrier->number_of_waiting_threads == the_barrier->Attributes.maximum_count) { 4b466: b0a8 0044 cmpl %a0@(68),%d0 4b46a: 6620 bnes 4b48c <_CORE_barrier_Wait+0x64> executing->Wait.return_code = CORE_BARRIER_STATUS_AUTOMATICALLY_RELEASED; 4b46c: 7001 moveq #1,%d0 4b46e: 2340 0034 movel %d0,%a1@(52) _ISR_Enable( level ); 4b472: 46c1 movew %d1,%sr _CORE_barrier_Release( the_barrier, id, api_barrier_mp_support ); 4b474: 2d44 0010 movel %d4,%fp@(16) 4b478: 2d42 000c movel %d2,%fp@(12) 4b47c: 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 ); } 4b480: 4cd7 001c moveml %sp@,%d2-%d4 4b484: 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 ); 4b486: 4ef9 0004 b3f4 jmp 4b3f4 <_CORE_barrier_Release> 4b48c: 7001 moveq #1,%d0 } } _Thread_queue_Enter_critical_section( &the_barrier->Wait_queue ); executing->Wait.queue = &the_barrier->Wait_queue; executing->Wait.id = id; 4b48e: 2342 0020 movel %d2,%a1@(32) return; } } _Thread_queue_Enter_critical_section( &the_barrier->Wait_queue ); executing->Wait.queue = &the_barrier->Wait_queue; 4b492: 2348 0044 movel %a0,%a1@(68) 4b496: 2140 0030 movel %d0,%a0@(48) executing->Wait.id = id; _ISR_Enable( level ); 4b49a: 46c1 movew %d1,%sr _Thread_queue_Enqueue( &the_barrier->Wait_queue, timeout ); 4b49c: 2d43 000c movel %d3,%fp@(12) 4b4a0: 203c 0004 73c0 movel #291776,%d0 4b4a6: 2d48 0008 movel %a0,%fp@(8) 4b4aa: 2d40 0010 movel %d0,%fp@(16) } 4b4ae: 4cd7 001c moveml %sp@,%d2-%d4 4b4b2: 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 ); 4b4b4: 4ef9 0004 70d4 jmp 470d4 <_Thread_queue_Enqueue_with_handler> ... 0005202c <_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 ) { 5202c: 4e56 ffe0 linkw %fp,#-32 52030: 48d7 3c3c moveml %d2-%d5/%a2-%a5,%sp@ 52034: 246e 0008 moveal %fp@(8),%a2 52038: 2a2e 000c movel %fp@(12),%d5 5203c: 262e 0010 movel %fp@(16),%d3 52040: 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 ) { 52044: b6aa 004c cmpl %a2@(76),%d3 52048: 6304 blss 5204e <_CORE_message_queue_Broadcast+0x22><== ALWAYS TAKEN 5204a: 7001 moveq #1,%d0 <== NOT EXECUTED 5204c: 6042 bras 52090 <_CORE_message_queue_Broadcast+0x64><== NOT EXECUTED * NOTE: This check is critical because threads can block on * send and receive and this ensures that we are broadcasting * the message to threads waiting to receive -- not to send. */ if ( the_message_queue->number_of_pending_messages != 0 ) { 5204e: 4aaa 0048 tstl %a2@(72) 52052: 6610 bnes 52064 <_CORE_message_queue_Broadcast+0x38> * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { 52054: 4282 clrl %d2 52056: 283c 0005 4228 movel #344616,%d4 const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 5205c: 4bf9 0005 9240 lea 59240 ,%a5 52062: 601a bras 5207e <_CORE_message_queue_Broadcast+0x52> * 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; 52064: 4294 clrl %a4@ 52066: 6026 bras 5208e <_CORE_message_queue_Broadcast+0x62> 52068: 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; 5206a: 5282 addql #1,%d2 5206c: 2f05 movel %d5,%sp@- 5206e: 2f2b 002c movel %a3@(44),%sp@- 52072: 4e95 jsr %a5@ buffer, waitp->return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; 52074: 206b 0028 moveal %a3@(40),%a0 52078: 4fef 000c lea %sp@(12),%sp 5207c: 2083 movel %d3,%a0@ * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { 5207e: 2f0a movel %a2,%sp@- 52080: 2044 moveal %d4,%a0 52082: 4e90 jsr %a0@ /* * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = 52084: 588f addql #4,%sp _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { 52086: 2640 moveal %d0,%a3 /* * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = 52088: 4a80 tstl %d0 5208a: 66dc bnes 52068 <_CORE_message_queue_Broadcast+0x3c> if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_message_queue_mp_support) ( the_thread, id ); #endif } *count = number_broadcasted; 5208c: 2882 movel %d2,%a4@ 5208e: 4280 clrl %d0 return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; } 52090: 4cee 3c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a5 52096: 4e5e unlk %fp ... 0004dc94 <_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)) { 4dc94: 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 ) { 4dc96: 4e56 fff4 linkw %fp,#-12 4dc9a: 222e 0014 movel %fp@(20),%d1 4dc9e: 48d7 040c moveml %d2-%d3/%a2,%sp@ 4dca2: 246e 0008 moveal %fp@(8),%a2 4dca6: 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)) { 4dcaa: c081 andl %d1,%d0 ) { size_t message_buffering_required; size_t allocated_message_size; the_message_queue->maximum_pending_messages = maximum_pending_messages; 4dcac: 2542 0044 movel %d2,%a2@(68) the_message_queue->number_of_pending_messages = 0; 4dcb0: 42aa 0048 clrl %a2@(72) the_message_queue->maximum_message_size = maximum_message_size; 4dcb4: 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)) { 4dcb8: 4a80 tstl %d0 4dcba: 6604 bnes 4dcc0 <_CORE_message_queue_Initialize+0x2c> 4dcbc: 2001 movel %d1,%d0 4dcbe: 600c bras 4dccc <_CORE_message_queue_Initialize+0x38> allocated_message_size += sizeof(uint32_t); 4dcc0: 2001 movel %d1,%d0 4dcc2: 5880 addql #4,%d0 allocated_message_size &= ~(sizeof(uint32_t) - 1); 4dcc4: 76fc moveq #-4,%d3 4dcc6: c083 andl %d3,%d0 } if (allocated_message_size < maximum_message_size) 4dcc8: b280 cmpl %d0,%d1 4dcca: 626e bhis 4dd3a <_CORE_message_queue_Initialize+0xa6><== NEVER TAKEN /* * Calculate how much total memory is required for message buffering and * check for overflow on the multiplication. */ message_buffering_required = (size_t) maximum_pending_messages * (allocated_message_size + sizeof(CORE_message_queue_Buffer_control)); 4dccc: 2600 movel %d0,%d3 4dcce: 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 * 4dcd4: 2203 movel %d3,%d1 4dcd6: 4c02 1800 mulsl %d2,%d1 (allocated_message_size + sizeof(CORE_message_queue_Buffer_control)); if (message_buffering_required < allocated_message_size) 4dcda: b081 cmpl %d1,%d0 4dcdc: 625c bhis 4dd3a <_CORE_message_queue_Initialize+0xa6><== NEVER TAKEN return false; /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) 4dcde: 2f01 movel %d1,%sp@- 4dce0: 4eb9 0005 0510 jsr 50510 <_Workspace_Allocate> _Workspace_Allocate( message_buffering_required ); if (the_message_queue->message_buffers == 0) 4dce6: 588f addql #4,%sp return false; /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) 4dce8: 2540 005c movel %d0,%a2@(92) _Workspace_Allocate( message_buffering_required ); if (the_message_queue->message_buffers == 0) 4dcec: 674c beqs 4dd3a <_CORE_message_queue_Initialize+0xa6> /* * Initialize the pool of inactive messages, pending messages, * and set of waiting threads. */ _Chain_Initialize ( 4dcee: 2f03 movel %d3,%sp@- 4dcf0: 2f02 movel %d2,%sp@- 4dcf2: 2f00 movel %d0,%sp@- 4dcf4: 486a 0060 pea %a2@(96) 4dcf8: 4eb9 0005 1dfc jsr 51dfc <_Chain_Initialize> allocated_message_size + sizeof( CORE_message_queue_Buffer_control ) ); _Chain_Initialize_empty( &the_message_queue->Pending_messages ); _Thread_queue_Initialize( 4dcfe: 4878 0006 pea 6 4dd02: 7001 moveq #1,%d0 4dd04: 206e 000c moveal %fp@(12),%a0 4dd08: b090 cmpl %a0@,%d0 4dd0a: 57c0 seq %d0 4dd0c: 4878 0080 pea 80 4dd10: 49c0 extbl %d0 4dd12: 4480 negl %d0 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 4dd14: 41ea 0054 lea %a2@(84),%a0 4dd18: 2f00 movel %d0,%sp@- 4dd1a: 2548 0050 movel %a0,%a2@(80) the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 4dd1e: 41ea 0050 lea %a2@(80),%a0 4dd22: 2548 0058 movel %a0,%a2@(88) 4dd26: 2f0a movel %a2,%sp@- RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 4dd28: 42aa 0054 clrl %a2@(84) 4dd2c: 4eb9 0004 fa58 jsr 4fa58 <_Thread_queue_Initialize> THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; 4dd32: 4fef 0020 lea %sp@(32),%sp allocated_message_size + sizeof( CORE_message_queue_Buffer_control ) ); _Chain_Initialize_empty( &the_message_queue->Pending_messages ); _Thread_queue_Initialize( 4dd36: 7001 moveq #1,%d0 THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; 4dd38: 6002 bras 4dd3c <_CORE_message_queue_Initialize+0xa8> 4dd3a: 4200 clrb %d0 } 4dd3c: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 4dd42: 4e5e unlk %fp ... 0004dd48 <_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 ); 4dd48: 223c 0000 0700 movel #1792,%d1 void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 4dd4e: 4e56 ffe0 linkw %fp,#-32 ISR_Level level; CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; 4dd52: 2079 0006 5076 moveal 65076 <_Thread_Executing>,%a0 void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 4dd58: 48d7 3c3c moveml %d2-%d5/%a2-%a5,%sp@ 4dd5c: 282e 000c movel %fp@(12),%d4 4dd60: 262e 001c movel %fp@(28),%d3 4dd64: 246e 0008 moveal %fp@(8),%a2 ISR_Level level; CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; 4dd68: 42a8 0034 clrl %a0@(52) void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 4dd6c: 242e 0010 movel %fp@(16),%d2 4dd70: 226e 0014 moveal %fp@(20),%a1 4dd74: 1a2e 001b moveb %fp@(27),%d5 CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; _ISR_Disable( level ); 4dd78: 40c0 movew %sr,%d0 4dd7a: 8280 orl %d0,%d1 4dd7c: 46c1 movew %d1,%sr */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4dd7e: 220a movel %a2,%d1 4dd80: 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)); 4dd86: 266a 0050 moveal %a2@(80),%a3 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4dd8a: b28b cmpl %a3,%d1 4dd8c: 6752 beqs 4dde0 <_CORE_message_queue_Seize+0x98> { Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; 4dd8e: 2853 moveal %a3@,%a4 the_chain->first = new_first; new_first->previous = _Chain_Head(the_chain); 4dd90: 4bea 0050 lea %a2@(80),%a5 Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; the_chain->first = new_first; 4dd94: 254c 0050 movel %a4,%a2@(80) new_first->previous = _Chain_Head(the_chain); 4dd98: 294d 0004 movel %a5,%a4@(4) the_message = _CORE_message_queue_Get_pending_message( the_message_queue ); if ( the_message != NULL ) { 4dd9c: 4a8b tstl %a3 4dd9e: 6740 beqs 4dde0 <_CORE_message_queue_Seize+0x98> <== NEVER TAKEN the_message_queue->number_of_pending_messages -= 1; 4dda0: 53aa 0048 subql #1,%a2@(72) _ISR_Enable( level ); 4dda4: 46c0 movew %d0,%sr *size_p = the_message->Contents.size; 4dda6: 22ab 0008 movel %a3@(8),%a1@ _Thread_Executing->Wait.count = 4ddaa: 2079 0006 5076 moveal 65076 <_Thread_Executing>,%a0 4ddb0: 42a8 0024 clrl %a0@(36) const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 4ddb4: 2f11 movel %a1@,%sp@- 4ddb6: 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 ); 4ddba: 45ea 0060 lea %a2@(96),%a2 const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 4ddbe: 2f02 movel %d2,%sp@- 4ddc0: 4eb9 0005 44c8 jsr 544c8 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 ); 4ddc6: 4fef 000c lea %sp@(12),%sp 4ddca: 2d4a 0008 movel %a2,%fp@(8) 4ddce: 2d4b 000c movel %a3,%fp@(12) executing->Wait.return_argument = size_p; /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); } 4ddd2: 4cee 3c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a5 4ddd8: 4e5e unlk %fp 4ddda: 4ef9 0004 dbd0 jmp 4dbd0 <_Chain_Append> return; } #endif } if ( !wait ) { 4dde0: 4a05 tstb %d5 4dde2: 6612 bnes 4ddf6 <_CORE_message_queue_Seize+0xae> _ISR_Enable( level ); 4dde4: 46c0 movew %d0,%sr executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT; 4dde6: 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 ); } 4dde8: 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; 4ddee: 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 ); } 4ddf2: 4e5e unlk %fp 4ddf4: 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; 4ddf6: 7201 moveq #1,%d1 4ddf8: 2541 0030 movel %d1,%a2@(48) _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue ); executing->Wait.queue = &the_message_queue->Wait_queue; executing->Wait.id = id; executing->Wait.return_argument_second.mutable_object = buffer; executing->Wait.return_argument = size_p; 4ddfc: 2149 0028 movel %a1,%a0@(40) } _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue ); executing->Wait.queue = &the_message_queue->Wait_queue; executing->Wait.id = id; executing->Wait.return_argument_second.mutable_object = buffer; 4de00: 2142 002c movel %d2,%a0@(44) return; } _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue ); executing->Wait.queue = &the_message_queue->Wait_queue; executing->Wait.id = id; 4de04: 2144 0020 movel %d4,%a0@(32) executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT; return; } _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue ); executing->Wait.queue = &the_message_queue->Wait_queue; 4de08: 214a 0044 movel %a2,%a0@(68) executing->Wait.id = id; executing->Wait.return_argument_second.mutable_object = buffer; executing->Wait.return_argument = size_p; /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); 4de0c: 46c0 movew %d0,%sr _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); 4de0e: 4bf9 0004 fb14 lea 4fb14 <_Thread_queue_Timeout>,%a5 4de14: 2d43 000c movel %d3,%fp@(12) 4de18: 2d4d 0010 movel %a5,%fp@(16) 4de1c: 2d4a 0008 movel %a2,%fp@(8) } 4de20: 4cee 3c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a5 4de26: 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 ); 4de28: 4ef9 0004 f828 jmp 4f828 <_Thread_queue_Enqueue_with_handler> ... 000459c4 <_CORE_mutex_Seize>: Objects_Id _id, bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { 459c4: 4e56 0000 linkw %fp,#0 459c8: 202e 0010 movel %fp@(16),%d0 459cc: 2f0a movel %a2,%sp@- 459ce: 246e 0008 moveal %fp@(8),%a2 459d2: 2f02 movel %d2,%sp@- _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); 459d4: 2239 0005 ba78 movel 5ba78 <_Thread_Dispatch_disable_level>,%d1 Objects_Id _id, bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { 459da: 1400 moveb %d0,%d2 _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); 459dc: 4a81 tstl %d1 459de: 671c beqs 459fc <_CORE_mutex_Seize+0x38> 459e0: 4a00 tstb %d0 459e2: 6718 beqs 459fc <_CORE_mutex_Seize+0x38> <== NEVER TAKEN 459e4: 7001 moveq #1,%d0 459e6: b0b9 0005 bbfa cmpl 5bbfa <_System_state_Current>,%d0 459ec: 640e bccs 459fc <_CORE_mutex_Seize+0x38> 459ee: 4878 0013 pea 13 459f2: 42a7 clrl %sp@- 459f4: 42a7 clrl %sp@- 459f6: 4eb9 0004 5f7c jsr 45f7c <_Internal_error_Occurred> 459fc: 486e 0018 pea %fp@(24) 45a00: 2f0a movel %a2,%sp@- 45a02: 4eb9 0004 9948 jsr 49948 <_CORE_mutex_Seize_interrupt_trylock> 45a08: 508f addql #8,%sp 45a0a: 4a80 tstl %d0 45a0c: 6750 beqs 45a5e <_CORE_mutex_Seize+0x9a> 45a0e: 4a02 tstb %d2 45a10: 6614 bnes 45a26 <_CORE_mutex_Seize+0x62> 45a12: 202e 0018 movel %fp@(24),%d0 45a16: 46c0 movew %d0,%sr 45a18: 2079 0005 bb32 moveal 5bb32 <_Thread_Executing>,%a0 45a1e: 7001 moveq #1,%d0 45a20: 2140 0034 movel %d0,%a0@(52) 45a24: 6038 bras 45a5e <_CORE_mutex_Seize+0x9a> 45a26: 2039 0005 ba78 movel 5ba78 <_Thread_Dispatch_disable_level>,%d0 45a2c: 5280 addql #1,%d0 45a2e: 2079 0005 bb32 moveal 5bb32 <_Thread_Executing>,%a0 45a34: 216e 000c 0020 movel %fp@(12),%a0@(32) 45a3a: 23c0 0005 ba78 movel %d0,5ba78 <_Thread_Dispatch_disable_level> RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section ( Thread_queue_Control *the_thread_queue ) { the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 45a40: 7001 moveq #1,%d0 45a42: 214a 0044 movel %a2,%a0@(68) 45a46: 2540 0030 movel %d0,%a2@(48) 45a4a: 202e 0018 movel %fp@(24),%d0 45a4e: 46c0 movew %d0,%sr 45a50: 2f2e 0014 movel %fp@(20),%sp@- 45a54: 2f0a movel %a2,%sp@- 45a56: 4eb9 0004 5960 jsr 45960 <_CORE_mutex_Seize_interrupt_blocking> 45a5c: 508f addql #8,%sp } 45a5e: 242e fff8 movel %fp@(-8),%d2 45a62: 246e fffc moveal %fp@(-4),%a2 45a66: 4e5e unlk %fp ... 00049948 <_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 ) { 49948: 4e56 0000 linkw %fp,#0 { Thread_Control *executing; /* disabled when you get here */ executing = _Thread_Executing; 4994c: 2279 0005 bb32 moveal 5bb32 <_Thread_Executing>,%a1 49952: 2f0b movel %a3,%sp@- 49954: 206e 0008 moveal %fp@(8),%a0 49958: 2f0a movel %a2,%sp@- 4995a: 246e 000c moveal %fp@(12),%a2 executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; 4995e: 42a9 0034 clrl %a1@(52) if ( !_CORE_mutex_Is_locked( the_mutex ) ) { 49962: 4aa8 004e tstl %a0@(78) 49966: 6700 0098 beqw 49a00 <_CORE_mutex_Seize_interrupt_trylock+0xb8> the_mutex->lock = CORE_MUTEX_LOCKED; 4996a: 42a8 004e clrl %a0@(78) the_mutex->holder = executing; the_mutex->holder_id = executing->Object.id; the_mutex->nest_count = 1; 4996e: 7201 moveq #1,%d1 executing = _Thread_Executing; executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; if ( !_CORE_mutex_Is_locked( the_mutex ) ) { the_mutex->lock = CORE_MUTEX_LOCKED; the_mutex->holder = executing; the_mutex->holder_id = executing->Object.id; 49970: 2169 0008 005e movel %a1@(8),%a0@(94) */ RTEMS_INLINE_ROUTINE bool _CORE_mutex_Is_inherit_priority( CORE_mutex_Attributes *the_attribute ) { return the_attribute->discipline == CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT; 49976: 2028 0046 movel %a0@(70),%d0 executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; if ( !_CORE_mutex_Is_locked( the_mutex ) ) { the_mutex->lock = CORE_MUTEX_LOCKED; the_mutex->holder = executing; the_mutex->holder_id = executing->Object.id; the_mutex->nest_count = 1; 4997a: 2141 0052 movel %d1,%a0@(82) if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || 4997e: 123c 0002 moveb #2,%d1 executing = _Thread_Executing; executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; if ( !_CORE_mutex_Is_locked( the_mutex ) ) { the_mutex->lock = CORE_MUTEX_LOCKED; the_mutex->holder = executing; 49982: 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 ) || 49986: b280 cmpl %d0,%d1 49988: 6708 beqs 49992 <_CORE_mutex_Seize_interrupt_trylock+0x4a> 4998a: 123c 0003 moveb #3,%d1 4998e: b280 cmpl %d0,%d1 49990: 660a bnes 4999c <_CORE_mutex_Seize_interrupt_trylock+0x54> _Chain_Prepend_unprotected( &executing->lock_mutex, &the_mutex->queue.lock_queue ); the_mutex->queue.priority_before = executing->current_priority; #endif executing->resource_count++; 49992: 52a9 001c addql #1,%a1@(28) } if ( !_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) { 49996: 7203 moveq #3,%d1 49998: b280 cmpl %d0,%d1 4999a: 6706 beqs 499a2 <_CORE_mutex_Seize_interrupt_trylock+0x5a> _ISR_Enable( *level_p ); 4999c: 2012 movel %a2@,%d0 4999e: 46c0 movew %d0,%sr 499a0: 607c bras 49a1e <_CORE_mutex_Seize_interrupt_trylock+0xd6> */ { Priority_Control ceiling; Priority_Control current; ceiling = the_mutex->Attributes.priority_ceiling; 499a2: 2028 004a movel %a0@(74),%d0 current = executing->current_priority; 499a6: 2229 0014 movel %a1@(20),%d1 if ( current == ceiling ) { 499aa: b081 cmpl %d1,%d0 499ac: 6606 bnes 499b4 <_CORE_mutex_Seize_interrupt_trylock+0x6c> _ISR_Enable( *level_p ); 499ae: 2012 movel %a2@,%d0 499b0: 46c0 movew %d0,%sr 499b2: 606a bras 49a1e <_CORE_mutex_Seize_interrupt_trylock+0xd6> return 0; } if ( current > ceiling ) { 499b4: b081 cmpl %d1,%d0 499b6: 642e bccs 499e6 <_CORE_mutex_Seize_interrupt_trylock+0x9e> rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 499b8: 2039 0005 ba78 movel 5ba78 <_Thread_Dispatch_disable_level>,%d0 499be: 5280 addql #1,%d0 499c0: 23c0 0005 ba78 movel %d0,5ba78 <_Thread_Dispatch_disable_level> _Thread_Disable_dispatch(); _ISR_Enable( *level_p ); 499c6: 2012 movel %a2@,%d0 499c8: 46c0 movew %d0,%sr _Thread_Change_priority( 499ca: 42a7 clrl %sp@- 499cc: 2f28 004a movel %a0@(74),%sp@- 499d0: 2f28 005a movel %a0@(90),%sp@- 499d4: 4eb9 0004 6768 jsr 46768 <_Thread_Change_priority> the_mutex->holder, the_mutex->Attributes.priority_ceiling, false ); _Thread_Enable_dispatch(); 499da: 4eb9 0004 6c62 jsr 46c62 <_Thread_Enable_dispatch> 499e0: 4fef 000c lea %sp@(12),%sp 499e4: 6038 bras 49a1e <_CORE_mutex_Seize_interrupt_trylock+0xd6> return 0; } /* if ( current < ceiling ) */ { executing->Wait.return_code = CORE_MUTEX_STATUS_CEILING_VIOLATED; 499e6: 7006 moveq #6,%d0 the_mutex->lock = CORE_MUTEX_UNLOCKED; 499e8: 7201 moveq #1,%d1 ); _Thread_Enable_dispatch(); return 0; } /* if ( current < ceiling ) */ { executing->Wait.return_code = CORE_MUTEX_STATUS_CEILING_VIOLATED; 499ea: 2340 0034 movel %d0,%a1@(52) the_mutex->lock = CORE_MUTEX_UNLOCKED; the_mutex->nest_count = 0; /* undo locking above */ 499ee: 42a8 0052 clrl %a0@(82) _Thread_Enable_dispatch(); return 0; } /* if ( current < ceiling ) */ { executing->Wait.return_code = CORE_MUTEX_STATUS_CEILING_VIOLATED; the_mutex->lock = CORE_MUTEX_UNLOCKED; 499f2: 2141 004e movel %d1,%a0@(78) the_mutex->nest_count = 0; /* undo locking above */ executing->resource_count--; /* undo locking above */ 499f6: 53a9 001c subql #1,%a1@(28) _ISR_Enable( *level_p ); 499fa: 2012 movel %a2@,%d0 499fc: 46c0 movew %d0,%sr 499fe: 601e bras 49a1e <_CORE_mutex_Seize_interrupt_trylock+0xd6> /* * 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 ) ) { 49a00: 2668 005a moveal %a0@(90),%a3 49a04: b3cb cmpal %a3,%a1 49a06: 6626 bnes 49a2e <_CORE_mutex_Seize_interrupt_trylock+0xe6> switch ( the_mutex->Attributes.lock_nesting_behavior ) { 49a08: 2028 0040 movel %a0@(64),%d0 49a0c: 6708 beqs 49a16 <_CORE_mutex_Seize_interrupt_trylock+0xce> 49a0e: 7201 moveq #1,%d1 49a10: b280 cmpl %d0,%d1 49a12: 661a bnes 49a2e <_CORE_mutex_Seize_interrupt_trylock+0xe6><== ALWAYS TAKEN 49a14: 600c bras 49a22 <_CORE_mutex_Seize_interrupt_trylock+0xda><== NOT EXECUTED case CORE_MUTEX_NESTING_ACQUIRES: the_mutex->nest_count++; 49a16: 52a8 0052 addql #1,%a0@(82) _ISR_Enable( *level_p ); 49a1a: 2012 movel %a2@,%d0 49a1c: 46c0 movew %d0,%sr 49a1e: 4280 clrl %d0 49a20: 600e bras 49a30 <_CORE_mutex_Seize_interrupt_trylock+0xe8> return 0; case CORE_MUTEX_NESTING_IS_ERROR: executing->Wait.return_code = CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED; 49a22: 7002 moveq #2,%d0 <== NOT EXECUTED 49a24: 2740 0034 movel %d0,%a3@(52) <== NOT EXECUTED _ISR_Enable( *level_p ); 49a28: 2012 movel %a2@,%d0 <== NOT EXECUTED 49a2a: 46c0 movew %d0,%sr <== NOT EXECUTED 49a2c: 60f0 bras 49a1e <_CORE_mutex_Seize_interrupt_trylock+0xd6><== NOT EXECUTED 49a2e: 7001 moveq #1,%d0 return _CORE_mutex_Seize_interrupt_trylock_body( the_mutex, level_p ); } 49a30: 246e fff8 moveal %fp@(-8),%a2 49a34: 266e fffc moveal %fp@(-4),%a3 49a38: 4e5e unlk %fp <== NOT EXECUTED 00045bb8 <_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 ) { 45bb8: 4e56 0000 linkw %fp,#0 45bbc: 2f0a movel %a2,%sp@- 45bbe: 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)) ) { 45bc2: 2f0a movel %a2,%sp@- 45bc4: 4eb9 0004 6f94 jsr 46f94 <_Thread_queue_Dequeue> 45bca: 588f addql #4,%sp 45bcc: 4a80 tstl %d0 45bce: 6704 beqs 45bd4 <_CORE_semaphore_Surrender+0x1c> 45bd0: 4280 clrl %d0 45bd2: 6024 bras 45bf8 <_CORE_semaphore_Surrender+0x40> if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_semaphore_mp_support) ( the_thread, id ); #endif } else { _ISR_Disable( level ); 45bd4: 203c 0000 0700 movel #1792,%d0 45bda: 40c1 movew %sr,%d1 45bdc: 8081 orl %d1,%d0 45bde: 46c0 movew %d0,%sr if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 45be0: 202a 0048 movel %a2@(72),%d0 45be4: b0aa 0040 cmpl %a2@(64),%d0 45be8: 6504 bcss 45bee <_CORE_semaphore_Surrender+0x36> <== ALWAYS TAKEN 45bea: 7004 moveq #4,%d0 <== NOT EXECUTED 45bec: 6008 bras 45bf6 <_CORE_semaphore_Surrender+0x3e> <== NOT EXECUTED the_semaphore->count += 1; 45bee: 5280 addql #1,%d0 45bf0: 2540 0048 movel %d0,%a2@(72) 45bf4: 4280 clrl %d0 else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); 45bf6: 46c1 movew %d1,%sr } return status; } 45bf8: 246e fffc moveal %fp@(-4),%a2 45bfc: 4e5e unlk %fp <== NOT EXECUTED 000449d8 <_Event_Seize>: executing = _Thread_Executing; executing->Wait.return_code = RTEMS_SUCCESSFUL; api = executing->API_Extensions[ THREAD_API_RTEMS ]; _ISR_Disable( level ); 449d8: 203c 0000 0700 movel #1792,%d0 rtems_event_set event_in, rtems_option option_set, rtems_interval ticks, rtems_event_set *event_out ) { 449de: 4e56 ffec linkw %fp,#-20 449e2: 226e 0010 moveal %fp@(16),%a1 449e6: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ rtems_event_set pending_events; ISR_Level level; RTEMS_API_Control *api; Thread_blocking_operation_States sync_state; executing = _Thread_Executing; 449ea: 2479 0005 bb32 moveal 5bb32 <_Thread_Executing>,%a2 rtems_event_set event_in, rtems_option option_set, rtems_interval ticks, rtems_event_set *event_out ) { 449f0: 242e 0008 movel %fp@(8),%d2 449f4: 262e 000c movel %fp@(12),%d3 ISR_Level level; RTEMS_API_Control *api; Thread_blocking_operation_States sync_state; executing = _Thread_Executing; executing->Wait.return_code = RTEMS_SUCCESSFUL; 449f8: 42aa 0034 clrl %a2@(52) rtems_event_set event_in, rtems_option option_set, rtems_interval ticks, rtems_event_set *event_out ) { 449fc: 206e 0014 moveal %fp@(20),%a0 Thread_blocking_operation_States sync_state; executing = _Thread_Executing; executing->Wait.return_code = RTEMS_SUCCESSFUL; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 44a00: 266a 0108 moveal %a2@(264),%a3 _ISR_Disable( level ); 44a04: 40c1 movew %sr,%d1 44a06: 8081 orl %d1,%d0 44a08: 46c0 movew %d0,%sr pending_events = api->pending_events; 44a0a: 2813 movel %a3@,%d4 RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Get( rtems_event_set the_event_set, rtems_event_set the_event_condition ) { return ( the_event_set & the_event_condition ); 44a0c: 2002 movel %d2,%d0 44a0e: c084 andl %d4,%d0 seized_events = _Event_sets_Get( pending_events, event_in ); if ( !_Event_sets_Is_empty( seized_events ) && 44a10: 6716 beqs 44a28 <_Event_Seize+0x50> 44a12: b480 cmpl %d0,%d2 44a14: 6706 beqs 44a1c <_Event_Seize+0x44> 44a16: 0803 0001 btst #1,%d3 44a1a: 670c beqs 44a28 <_Event_Seize+0x50> <== NEVER TAKEN (seized_events == event_in || _Options_Is_any( option_set )) ) { api->pending_events = 44a1c: 2400 movel %d0,%d2 44a1e: 4682 notl %d2 44a20: c484 andl %d4,%d2 44a22: 2682 movel %d2,%a3@ _Event_sets_Clear( pending_events, seized_events ); _ISR_Enable( level ); 44a24: 46c1 movew %d1,%sr 44a26: 600e bras 44a36 <_Event_Seize+0x5e> *event_out = seized_events; return; } if ( _Options_Is_no_wait( option_set ) ) { 44a28: 0803 0000 btst #0,%d3 44a2c: 670e beqs 44a3c <_Event_Seize+0x64> _ISR_Enable( level ); 44a2e: 46c1 movew %d1,%sr executing->Wait.return_code = RTEMS_UNSATISFIED; 44a30: 720d moveq #13,%d1 44a32: 2541 0034 movel %d1,%a2@(52) *event_out = seized_events; 44a36: 2080 movel %d0,%a0@ return; 44a38: 6000 0096 braw 44ad0 <_Event_Seize+0xf8> * * NOTE: Since interrupts are disabled, this isn't that much of an * issue but better safe than sorry. */ executing->Wait.option = (uint32_t) option_set; executing->Wait.count = (uint32_t) event_in; 44a3c: 2542 0024 movel %d2,%a2@(36) executing->Wait.return_argument = event_out; _Event_Sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 44a40: 7401 moveq #1,%d2 * set properly when we are marked as in the event critical section. * * NOTE: Since interrupts are disabled, this isn't that much of an * issue but better safe than sorry. */ executing->Wait.option = (uint32_t) option_set; 44a42: 2543 0030 movel %d3,%a2@(48) executing->Wait.count = (uint32_t) event_in; executing->Wait.return_argument = event_out; 44a46: 2548 0028 movel %a0,%a2@(40) _Event_Sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 44a4a: 23c2 0005 bc56 movel %d2,5bc56 <_Event_Sync_state> _ISR_Enable( level ); 44a50: 46c1 movew %d1,%sr if ( ticks ) { 44a52: 4a89 tstl %a1 44a54: 6730 beqs 44a86 <_Event_Seize+0xae> _Watchdog_Initialize( 44a56: 202a 0008 movel %a2@(8),%d0 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 44a5a: 223c 0004 4c38 movel #281656,%d1 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 44a60: 2549 0054 movel %a1,%a2@(84) Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 44a64: 2541 0064 movel %d1,%a2@(100) the_watchdog->id = id; 44a68: 2540 0068 movel %d0,%a2@(104) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 44a6c: 42aa 0050 clrl %a2@(80) the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 44a70: 42aa 006c clrl %a2@(108) ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 44a74: 486a 0048 pea %a2@(72) 44a78: 4879 0005 bb50 pea 5bb50 <_Watchdog_Ticks_chain> 44a7e: 4eb9 0004 7b74 jsr 47b74 <_Watchdog_Insert> 44a84: 508f addql #8,%sp NULL ); _Watchdog_Insert_ticks( &executing->Timer, ticks ); } _Thread_Set_state( executing, STATES_WAITING_FOR_EVENT ); 44a86: 4878 0100 pea 100 44a8a: 2f0a movel %a2,%sp@- 44a8c: 4eb9 0004 7468 jsr 47468 <_Thread_Set_state> _ISR_Disable( level ); 44a92: 203c 0000 0700 movel #1792,%d0 44a98: 40c1 movew %sr,%d1 44a9a: 8081 orl %d1,%d0 44a9c: 46c0 movew %d0,%sr sync_state = _Event_Sync_state; _Event_Sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) { 44a9e: 7401 moveq #1,%d2 44aa0: 508f addql #8,%sp _Thread_Set_state( executing, STATES_WAITING_FOR_EVENT ); _ISR_Disable( level ); sync_state = _Event_Sync_state; 44aa2: 2039 0005 bc56 movel 5bc56 <_Event_Sync_state>,%d0 _Event_Sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 44aa8: 42b9 0005 bc56 clrl 5bc56 <_Event_Sync_state> if ( sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) { 44aae: b480 cmpl %d0,%d2 44ab0: 6604 bnes 44ab6 <_Event_Seize+0xde> _ISR_Enable( level ); 44ab2: 46c1 movew %d1,%sr 44ab4: 601a bras 44ad0 <_Event_Seize+0xf8> * An interrupt completed the thread's blocking request. * The blocking thread was satisfied by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ _Thread_blocking_operation_Cancel( sync_state, executing, level ); 44ab6: 2d4a 000c movel %a2,%fp@(12) 44aba: 2d41 0010 movel %d1,%fp@(16) } 44abe: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 * An interrupt completed the thread's blocking request. * The blocking thread was satisfied by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ _Thread_blocking_operation_Cancel( sync_state, executing, level ); 44ac4: 2d40 0008 movel %d0,%fp@(8) } 44ac8: 4e5e unlk %fp * An interrupt completed the thread's blocking request. * The blocking thread was satisfied by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ _Thread_blocking_operation_Cancel( sync_state, executing, level ); 44aca: 4ef9 0004 6718 jmp 46718 <_Thread_blocking_operation_Cancel> } 44ad0: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 44ad6: 4e5e unlk %fp ... 00044b30 <_Event_Surrender>: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; option_set = (rtems_option) the_thread->Wait.option; _ISR_Disable( level ); 44b30: 203c 0000 0700 movel #1792,%d0 */ void _Event_Surrender( Thread_Control *the_thread ) { 44b36: 4e56 ffe8 linkw %fp,#-24 44b3a: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@ 44b3e: 246e 0008 moveal %fp@(8),%a2 rtems_event_set event_condition; rtems_event_set seized_events; rtems_option option_set; RTEMS_API_Control *api; api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; 44b42: 206a 0108 moveal %a2@(264),%a0 option_set = (rtems_option) the_thread->Wait.option; 44b46: 282a 0030 movel %a2@(48),%d4 _ISR_Disable( level ); 44b4a: 40c1 movew %sr,%d1 44b4c: 8081 orl %d1,%d0 44b4e: 46c0 movew %d0,%sr pending_events = api->pending_events; event_condition = (rtems_event_set) the_thread->Wait.count; 44b50: 262a 0024 movel %a2@(36),%d3 RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Get( rtems_event_set the_event_set, rtems_event_set the_event_condition ) { return ( the_event_set & the_event_condition ); 44b54: 2003 movel %d3,%d0 api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; option_set = (rtems_option) the_thread->Wait.option; _ISR_Disable( level ); pending_events = api->pending_events; 44b56: 2410 movel %a0@,%d2 44b58: c082 andl %d2,%d0 seized_events = _Event_sets_Get( pending_events, event_condition ); /* * No events were seized in this operation */ if ( _Event_sets_Is_empty( seized_events ) ) { 44b5a: 6606 bnes 44b62 <_Event_Surrender+0x32> _ISR_Enable( level ); 44b5c: 46c1 movew %d1,%sr return; 44b5e: 6000 00cc braw 44c2c <_Event_Surrender+0xfc> /* * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && 44b62: 2279 0005 bb12 moveal 5bb12 <_ISR_Nest_level>,%a1 44b68: 4a89 tstl %a1 44b6a: 674a beqs 44bb6 <_Event_Surrender+0x86> 44b6c: b5f9 0005 bb32 cmpal 5bb32 <_Thread_Executing>,%a2 44b72: 6642 bnes 44bb6 <_Event_Surrender+0x86> _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 44b74: 2279 0005 bc56 moveal 5bc56 <_Event_Sync_state>,%a1 /* * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && 44b7a: 7a02 moveq #2,%d5 44b7c: ba89 cmpl %a1,%d5 44b7e: 670e beqs 44b8e <_Event_Surrender+0x5e> <== NEVER TAKEN _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { 44b80: 2279 0005 bc56 moveal 5bc56 <_Event_Sync_state>,%a1 /* * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && 44b86: 1a3c 0001 moveb #1,%d5 44b8a: ba89 cmpl %a1,%d5 44b8c: 6628 bnes 44bb6 <_Event_Surrender+0x86> _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { 44b8e: b680 cmpl %d0,%d3 44b90: 6706 beqs 44b98 <_Event_Surrender+0x68> 44b92: 0804 0001 btst #1,%d4 44b96: 671a beqs 44bb2 <_Event_Surrender+0x82> <== NEVER TAKEN api->pending_events = _Event_sets_Clear( pending_events,seized_events ); 44b98: 2600 movel %d0,%d3 44b9a: 4683 notl %d3 44b9c: c682 andl %d2,%d3 44b9e: 2083 movel %d3,%a0@ the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 44ba0: 206a 0028 moveal %a2@(40),%a0 _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { api->pending_events = _Event_sets_Clear( pending_events,seized_events ); the_thread->Wait.count = 0; 44ba4: 42aa 0024 clrl %a2@(36) *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 44ba8: 2080 movel %d0,%a0@ _Event_Sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 44baa: 7003 moveq #3,%d0 44bac: 23c0 0005 bc56 movel %d0,5bc56 <_Event_Sync_state> } _ISR_Enable( level ); 44bb2: 46c1 movew %d1,%sr return; 44bb4: 6076 bras 44c2c <_Event_Surrender+0xfc> } /* * Otherwise, this is a normal send to another thread */ if ( _States_Is_waiting_for_event( the_thread->current_state ) ) { 44bb6: 2a2a 0010 movel %a2@(16),%d5 44bba: 0285 0000 0100 andil #256,%d5 44bc0: 6768 beqs 44c2a <_Event_Surrender+0xfa> if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { 44bc2: b680 cmpl %d0,%d3 44bc4: 6706 beqs 44bcc <_Event_Surrender+0x9c> 44bc6: 0804 0001 btst #1,%d4 44bca: 675e beqs 44c2a <_Event_Surrender+0xfa> <== NEVER TAKEN api->pending_events = _Event_sets_Clear( pending_events, seized_events ); 44bcc: 2600 movel %d0,%d3 44bce: 4683 notl %d3 44bd0: c682 andl %d2,%d3 44bd2: 2083 movel %d3,%a0@ the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 44bd4: 206a 0028 moveal %a2@(40),%a0 * Otherwise, this is a normal send to another thread */ if ( _States_Is_waiting_for_event( the_thread->current_state ) ) { if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { api->pending_events = _Event_sets_Clear( pending_events, seized_events ); the_thread->Wait.count = 0; 44bd8: 42aa 0024 clrl %a2@(36) *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 44bdc: 2080 movel %d0,%a0@ _ISR_Flash( level ); 44bde: 203c 0000 0700 movel #1792,%d0 44be4: 46c1 movew %d1,%sr 44be6: 8081 orl %d1,%d0 44be8: 46c0 movew %d0,%sr 44bea: 47f9 0004 68a8 lea 468a8 <_Thread_Clear_state>,%a3 if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 44bf0: 7a02 moveq #2,%d5 44bf2: baaa 0050 cmpl %a2@(80),%d5 44bf6: 6710 beqs 44c08 <_Event_Surrender+0xd8> _ISR_Enable( level ); 44bf8: 46c1 movew %d1,%sr RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 44bfa: 2f3c 1003 fff8 movel #268697592,%sp@- 44c00: 2f0a movel %a2,%sp@- 44c02: 4e93 jsr %a3@ 44c04: 508f addql #8,%sp 44c06: 6024 bras 44c2c <_Event_Surrender+0xfc> RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 44c08: 7003 moveq #3,%d0 44c0a: 2540 0050 movel %d0,%a2@(80) _Thread_Unblock( the_thread ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 44c0e: 46c1 movew %d1,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 44c10: 486a 0048 pea %a2@(72) 44c14: 4eb9 0004 7c90 jsr 47c90 <_Watchdog_Remove> 44c1a: 2f3c 1003 fff8 movel #268697592,%sp@- 44c20: 2f0a movel %a2,%sp@- 44c22: 4e93 jsr %a3@ 44c24: 4fef 000c lea %sp@(12),%sp 44c28: 6002 bras 44c2c <_Event_Surrender+0xfc> _Thread_Unblock( the_thread ); } return; } } _ISR_Enable( level ); 44c2a: 46c1 movew %d1,%sr } 44c2c: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 44c32: 4e5e unlk %fp ... 00044c38 <_Event_Timeout>: void _Event_Timeout( Objects_Id id, void *ignored ) { 44c38: 4e56 fffc linkw %fp,#-4 44c3c: 2f03 movel %d3,%sp@- 44c3e: 2f02 movel %d2,%sp@- Thread_Control *the_thread; Objects_Locations location; ISR_Level level; the_thread = _Thread_Get( id, &location ); 44c40: 486e fffc pea %fp@(-4) 44c44: 2f2e 0008 movel %fp@(8),%sp@- 44c48: 4eb9 0004 6c88 jsr 46c88 <_Thread_Get> switch ( location ) { 44c4e: 508f addql #8,%sp 44c50: 4aae fffc tstl %fp@(-4) 44c54: 6656 bnes 44cac <_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 ); 44c56: 223c 0000 0700 movel #1792,%d1 44c5c: 40c2 movew %sr,%d2 44c5e: 8282 orl %d2,%d1 44c60: 46c1 movew %d1,%sr _ISR_Enable( level ); return; } #endif the_thread->Wait.count = 0; 44c62: 2040 moveal %d0,%a0 44c64: 42a8 0024 clrl %a0@(36) if ( _Thread_Is_executing( the_thread ) ) { 44c68: b0b9 0005 bb32 cmpl 5bb32 <_Thread_Executing>,%d0 44c6e: 6614 bnes 44c84 <_Event_Timeout+0x4c> if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 44c70: 2239 0005 bc56 movel 5bc56 <_Event_Sync_state>,%d1 44c76: 7601 moveq #1,%d3 44c78: b681 cmpl %d1,%d3 44c7a: 6608 bnes 44c84 <_Event_Timeout+0x4c> _Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 44c7c: 7202 moveq #2,%d1 44c7e: 23c1 0005 bc56 movel %d1,5bc56 <_Event_Sync_state> } the_thread->Wait.return_code = RTEMS_TIMEOUT; 44c84: 7606 moveq #6,%d3 44c86: 2040 moveal %d0,%a0 44c88: 2143 0034 movel %d3,%a0@(52) _ISR_Enable( level ); 44c8c: 46c2 movew %d2,%sr 44c8e: 2f3c 1003 fff8 movel #268697592,%sp@- 44c94: 2f00 movel %d0,%sp@- 44c96: 4eb9 0004 68a8 jsr 468a8 <_Thread_Clear_state> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 44c9c: 508f addql #8,%sp 44c9e: 2039 0005 ba78 movel 5ba78 <_Thread_Dispatch_disable_level>,%d0 44ca4: 5380 subql #1,%d0 44ca6: 23c0 0005 ba78 movel %d0,5ba78 <_Thread_Dispatch_disable_level> case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 44cac: 242e fff4 movel %fp@(-12),%d2 44cb0: 262e fff8 movel %fp@(-8),%d3 44cb4: 4e5e unlk %fp <== NOT EXECUTED 00049b14 <_Heap_Allocate_aligned_with_boundary>: Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 49b14: 4e56 ffc8 linkw %fp,#-56 49b18: 202e 000c movel %fp@(12),%d0 49b1c: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 49b20: 246e 0008 moveal %fp@(8),%a2 Heap_Statistics *const stats = &heap->stats; Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); Heap_Block *block = _Heap_Free_list_first( heap ); uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE - HEAP_BLOCK_SIZE_OFFSET; 49b24: 2840 moveal %d0,%a4 49b26: 588c addql #4,%a4 Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 49b28: 222e 0010 movel %fp@(16),%d1 49b2c: 2a2e 0014 movel %fp@(20),%d5 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 49b30: 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; 49b34: 2e2a 0010 movel %a2@(16),%d7 uintptr_t alloc_begin = 0; uint32_t search_count = 0; if ( block_size_floor < alloc_size ) { 49b38: b08c cmpl %a4,%d0 49b3a: 6200 0120 bhiw 49c5c <_Heap_Allocate_aligned_with_boundary+0x148> /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { 49b3e: 4a85 tstl %d5 49b40: 670c beqs 49b4e <_Heap_Allocate_aligned_with_boundary+0x3a> if ( boundary < alloc_size ) { 49b42: b085 cmpl %d5,%d0 49b44: 6200 0116 bhiw 49c5c <_Heap_Allocate_aligned_with_boundary+0x148> return NULL; } if ( alignment == 0 ) { 49b48: 4a81 tstl %d1 49b4a: 6602 bnes 49b4e <_Heap_Allocate_aligned_with_boundary+0x3a> 49b4c: 2207 movel %d7,%d1 uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; 49b4e: 2407 movel %d7,%d2 49b50: 5e82 addql #7,%d2 if ( boundary != 0 ) { if ( boundary < alloc_size ) { return NULL; } if ( alignment == 0 ) { 49b52: 4283 clrl %d3 49b54: 2a43 moveal %d3,%a5 uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; 49b56: 2d42 fff8 movel %d2,%fp@(-8) uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; 49b5a: 7404 moveq #4,%d2 49b5c: 9480 subl %d0,%d2 49b5e: 2d42 fff4 movel %d2,%fp@(-12) 49b62: 6000 00c6 braw 49c2a <_Heap_Allocate_aligned_with_boundary+0x116> /* * 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 ) { 49b66: 2628 0004 movel %a0@(4),%d3 while ( block != free_list_tail ) { _HAssert( _Heap_Is_prev_used( block ) ); /* Statistics */ ++search_count; 49b6a: 528d addql #1,%a5 /* * The HEAP_PREV_BLOCK_USED flag is always set in the block size_and_flag * field. Thus the value is about one unit larger than the real block * size. The greater than operator takes this into account. */ if ( block->size_and_flag > block_size_floor ) { 49b6c: b9c3 cmpal %d3,%a4 49b6e: 6400 00b6 bccw 49c26 <_Heap_Allocate_aligned_with_boundary+0x112> 49b72: 43e8 0008 lea %a0@(8),%a1 if ( alignment == 0 ) { 49b76: 4a81 tstl %d1 49b78: 6606 bnes 49b80 <_Heap_Allocate_aligned_with_boundary+0x6c> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 49b7a: 2409 movel %a1,%d2 49b7c: 6000 00a4 braw 49c22 <_Heap_Allocate_aligned_with_boundary+0x10e> 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; 49b80: 74fe moveq #-2,%d2 49b82: c682 andl %d2,%d3 uintptr_t alignment, uintptr_t boundary ) { uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; 49b84: 266a 0014 moveal %a2@(20),%a3 uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; 49b88: d688 addl %a0,%d3 uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; 49b8a: 282e fff8 movel %fp@(-8),%d4 49b8e: 988b subl %a3,%d4 uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; 49b90: 242e fff4 movel %fp@(-12),%d2 49b94: d483 addl %d3,%d2 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 49b96: 2c02 movel %d2,%d6 uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; 49b98: d684 addl %d4,%d3 49b9a: 4c41 6004 remul %d1,%d4,%d6 uintptr_t alignment, uintptr_t boundary ) { uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; 49b9e: 2d4b fff0 movel %a3,%fp@(-16) 49ba2: 9484 subl %d4,%d2 uintptr_t alloc_begin = alloc_end - alloc_size; alloc_begin = _Heap_Align_down( alloc_begin, alignment ); /* Ensure that the we have a valid new block at the end */ if ( alloc_begin > alloc_begin_ceiling ) { 49ba4: b682 cmpl %d2,%d3 49ba6: 640a bccs 49bb2 <_Heap_Allocate_aligned_with_boundary+0x9e> 49ba8: 2803 movel %d3,%d4 49baa: 4c41 4002 remul %d1,%d2,%d4 49bae: 9682 subl %d2,%d3 49bb0: 2403 movel %d3,%d2 } alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { 49bb2: 4a85 tstl %d5 49bb4: 674e beqs 49c04 <_Heap_Allocate_aligned_with_boundary+0xf0> /* Ensure that the we have a valid new block at the end */ if ( alloc_begin > alloc_begin_ceiling ) { alloc_begin = _Heap_Align_down( alloc_begin_ceiling, alignment ); } alloc_end = alloc_begin + alloc_size; 49bb6: 2802 movel %d2,%d4 49bb8: d880 addl %d0,%d4 49bba: 2604 movel %d4,%d3 /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; 49bbc: 47f1 0800 lea %a1@(00000000,%d0:l),%a3 49bc0: 4c45 3006 remul %d5,%d6,%d3 49bc4: 2d4b fffc movel %a3,%fp@(-4) 49bc8: 2604 movel %d4,%d3 49bca: 9686 subl %d6,%d3 49bcc: 2c03 movel %d3,%d6 49bce: 266e fff0 moveal %fp@(-16),%a3 49bd2: 6020 bras 49bf4 <_Heap_Allocate_aligned_with_boundary+0xe0> uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { if ( boundary_line < boundary_floor ) { 49bd4: bcae fffc cmpl %fp@(-4),%d6 49bd8: 654c bcss 49c26 <_Heap_Allocate_aligned_with_boundary+0x112> 49bda: 2803 movel %d3,%d4 49bdc: 4c41 4002 remul %d1,%d2,%d4 49be0: 9682 subl %d2,%d3 return 0; } alloc_begin = boundary_line - alloc_size; alloc_begin = _Heap_Align_down( alloc_begin, alignment ); alloc_end = alloc_begin + alloc_size; 49be2: 2803 movel %d3,%d4 49be4: d880 addl %d0,%d4 49be6: 2403 movel %d3,%d2 49be8: 2604 movel %d4,%d3 49bea: 4c45 3006 remul %d5,%d6,%d3 49bee: 2604 movel %d4,%d3 49bf0: 9686 subl %d6,%d3 49bf2: 2c03 movel %d3,%d6 while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { if ( boundary_line < boundary_floor ) { return 0; } alloc_begin = boundary_line - alloc_size; 49bf4: 2606 movel %d6,%d3 49bf6: 9680 subl %d0,%d3 /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { 49bf8: bc82 cmpl %d2,%d6 49bfa: 6304 blss 49c00 <_Heap_Allocate_aligned_with_boundary+0xec> 49bfc: b886 cmpl %d6,%d4 49bfe: 62d4 bhis 49bd4 <_Heap_Allocate_aligned_with_boundary+0xc0> 49c00: 2d4b fff0 movel %a3,%fp@(-16) boundary_line = _Heap_Align_down( alloc_end, boundary ); } } /* Ensure that the we have a valid new block at the beginning */ if ( alloc_begin >= alloc_begin_floor ) { 49c04: b3c2 cmpal %d2,%a1 49c06: 621e bhis 49c26 <_Heap_Allocate_aligned_with_boundary+0x112> uintptr_t const alloc_block_begin = (uintptr_t) _Heap_Block_of_alloc_area( alloc_begin, page_size ); uintptr_t const free_size = alloc_block_begin - block_begin; 49c08: 2802 movel %d2,%d4 49c0a: 327c fff8 moveaw #-8,%a1 49c0e: 93c8 subal %a0,%a1 49c10: d3c2 addal %d2,%a1 49c12: 4c47 4003 remul %d7,%d3,%d4 49c16: 93c3 subal %d3,%a1 if ( free_size >= min_block_size || free_size == 0 ) { 49c18: b3ee fff0 cmpal %fp@(-16),%a1 49c1c: 6404 bccs 49c22 <_Heap_Allocate_aligned_with_boundary+0x10e> 49c1e: 4a89 tstl %a1 49c20: 6604 bnes 49c26 <_Heap_Allocate_aligned_with_boundary+0x112> boundary ); } } if ( alloc_begin != 0 ) { 49c22: 4a82 tstl %d2 49c24: 6610 bnes 49c36 <_Heap_Allocate_aligned_with_boundary+0x122><== ALWAYS TAKEN break; } block = block->next; 49c26: 2068 0008 moveal %a0@(8),%a0 if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { 49c2a: b5c8 cmpal %a0,%a2 49c2c: 6600 ff38 bnew 49b66 <_Heap_Allocate_aligned_with_boundary+0x52> 49c30: 260d movel %a5,%d3 49c32: 4282 clrl %d2 49c34: 6018 bras 49c4e <_Heap_Allocate_aligned_with_boundary+0x13a> if ( alloc_begin != 0 ) { /* Statistics */ stats->searches += search_count; block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 49c36: 2f00 movel %d0,%sp@- 49c38: 260d movel %a5,%d3 block = block->next; } if ( alloc_begin != 0 ) { /* Statistics */ stats->searches += search_count; 49c3a: d7aa 004c addl %d3,%a2@(76) block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 49c3e: 2f02 movel %d2,%sp@- 49c40: 2f08 movel %a0,%sp@- 49c42: 2f0a movel %a2,%sp@- 49c44: 4eb9 0004 5e86 jsr 45e86 <_Heap_Block_allocate> 49c4a: 4fef 0010 lea %sp@(16),%sp uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { Heap_Statistics *const stats = &heap->stats; 49c4e: b6aa 0044 cmpl %a2@(68),%d3 49c52: 6304 blss 49c58 <_Heap_Allocate_aligned_with_boundary+0x144> ); } /* Statistics */ if ( stats->max_search < search_count ) { stats->max_search = search_count; 49c54: 2543 0044 movel %d3,%a2@(68) } return (void *) alloc_begin; 49c58: 2002 movel %d2,%d0 49c5a: 6002 bras 49c5e <_Heap_Allocate_aligned_with_boundary+0x14a> 49c5c: 4280 clrl %d0 } 49c5e: 4cee 3cfc ffc8 moveml %fp@(-56),%d2-%d7/%a2-%a5 49c64: 4e5e unlk %fp <== NOT EXECUTED 0004dd94 <_Heap_Extend>: Heap_Control *heap, void *area_begin_ptr, uintptr_t area_size, uintptr_t *amount_extended ) { 4dd94: 4e56 fff4 linkw %fp,#-12 4dd98: 206e 0008 moveal %fp@(8),%a0 4dd9c: 202e 000c movel %fp@(12),%d0 Heap_Statistics *const stats = &heap->stats; uintptr_t const area_begin = (uintptr_t) area_begin_ptr; uintptr_t const heap_area_begin = heap->area_begin; uintptr_t const heap_area_end = heap->area_end; 4dda0: 2228 001c movel %a0@(28),%d1 uintptr_t const new_heap_area_end = heap_area_end + area_size; uintptr_t extend_size = 0; Heap_Block *const last_block = heap->last_block; 4dda4: 2268 0024 moveal %a0@(36),%a1 Heap_Control *heap, void *area_begin_ptr, uintptr_t area_size, uintptr_t *amount_extended ) { 4dda8: 48d7 040c moveml %d2-%d3/%a2,%sp@ Heap_Statistics *const stats = &heap->stats; uintptr_t const area_begin = (uintptr_t) area_begin_ptr; uintptr_t const heap_area_begin = heap->area_begin; 4ddac: b0a8 0018 cmpl %a0@(24),%d0 4ddb0: 6508 bcss 4ddba <_Heap_Extend+0x26> * 5. non-contiguous higher address (NOT SUPPORTED) * * As noted, this code only supports (4). */ if ( area_begin >= heap_area_begin && area_begin < heap_area_end ) { 4ddb2: b280 cmpl %d0,%d1 4ddb4: 6304 blss 4ddba <_Heap_Extend+0x26> 4ddb6: 7001 moveq #1,%d0 4ddb8: 606c bras 4de26 <_Heap_Extend+0x92> return HEAP_EXTEND_ERROR; /* case 3 */ } else if ( area_begin != heap_area_end ) { 4ddba: b280 cmpl %d0,%d1 4ddbc: 6704 beqs 4ddc2 <_Heap_Extend+0x2e> 4ddbe: 7002 moveq #2,%d0 4ddc0: 6064 bras 4de26 <_Heap_Extend+0x92> { Heap_Statistics *const stats = &heap->stats; uintptr_t const area_begin = (uintptr_t) area_begin_ptr; uintptr_t const heap_area_begin = heap->area_begin; uintptr_t const heap_area_end = heap->area_end; uintptr_t const new_heap_area_end = heap_area_end + area_size; 4ddc2: 2200 movel %d0,%d1 4ddc4: d2ae 0010 addl %fp@(16),%d1 * block and free it. */ heap->area_end = new_heap_area_end; extend_size = new_heap_area_end 4ddc8: 70f8 moveq #-8,%d0 4ddca: 9089 subl %a1,%d0 4ddcc: d081 addl %d1,%d0 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4ddce: 2600 movel %d0,%d3 4ddd0: 4c68 3002 0010 remul %a0@(16),%d2,%d3 * Currently only case 4 should make it to this point. * The basic trick is to make the extend area look like a used * block and free it. */ heap->area_end = new_heap_area_end; 4ddd6: 2141 001c movel %d1,%a0@(28) extend_size = new_heap_area_end - (uintptr_t) last_block - HEAP_BLOCK_HEADER_SIZE; extend_size = _Heap_Align_down( extend_size, heap->page_size ); *amount_extended = extend_size; 4ddda: 246e 0014 moveal %fp@(20),%a2 4ddde: 9082 subl %d2,%d0 4dde0: 2480 movel %d0,%a2@ if( extend_size >= heap->min_block_size ) { 4dde2: b0a8 0014 cmpl %a0@(20),%d0 4dde6: 653c bcss 4de24 <_Heap_Extend+0x90> <== NEVER TAKEN uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; block->size_and_flag = size | flag; 4dde8: 7401 moveq #1,%d2 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4ddea: 45f1 0800 lea %a1@(00000000,%d0:l),%a2 uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; block->size_and_flag = size | flag; 4ddee: c4a9 0004 andl %a1@(4),%d2 Heap_Block *const new_last_block = _Heap_Block_at( last_block, extend_size ); _Heap_Block_set_size( last_block, extend_size ); new_last_block->size_and_flag = 4ddf2: 2228 0020 movel %a0@(32),%d1 4ddf6: 928a subl %a2,%d1 4ddf8: 8480 orl %d0,%d2 ((uintptr_t) heap->first_block - (uintptr_t) new_last_block) | HEAP_PREV_BLOCK_USED; heap->last_block = new_last_block; 4ddfa: 214a 0024 movel %a2,%a0@(36) 4ddfe: 2342 0004 movel %d2,%a1@(4) if( extend_size >= heap->min_block_size ) { Heap_Block *const new_last_block = _Heap_Block_at( last_block, extend_size ); _Heap_Block_set_size( last_block, extend_size ); new_last_block->size_and_flag = 4de02: 7401 moveq #1,%d2 4de04: 8481 orl %d1,%d2 4de06: 2542 0004 movel %d2,%a2@(4) /* Statistics */ stats->size += extend_size; ++stats->used_blocks; --stats->frees; /* Do not count subsequent call as actual free() */ _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( last_block )); 4de0a: 4869 0008 pea %a1@(8) | HEAP_PREV_BLOCK_USED; heap->last_block = new_last_block; /* Statistics */ stats->size += extend_size; 4de0e: d1a8 002c addl %d0,%a0@(44) ++stats->used_blocks; 4de12: 52a8 0040 addql #1,%a0@(64) --stats->frees; /* Do not count subsequent call as actual free() */ 4de16: 53a8 0050 subql #1,%a0@(80) _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( last_block )); 4de1a: 2f08 movel %a0,%sp@- 4de1c: 4eb9 0004 991c jsr 4991c <_Heap_Free> 4de22: 508f addql #8,%sp 4de24: 4280 clrl %d0 } return HEAP_EXTEND_SUCCESSFUL; } 4de26: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 4de2c: 4e5e unlk %fp <== NOT EXECUTED 0005884c <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { 5884c: 4e56 0000 linkw %fp,#0 58850: 202e 000c movel %fp@(12),%d0 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_of_alloc_area( uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) 58854: 2040 moveal %d0,%a0 58856: 5188 subql #8,%a0 58858: 226e 0008 moveal %fp@(8),%a1 5885c: 2f02 movel %d2,%sp@- 5885e: 2400 movel %d0,%d2 58860: 4c69 2001 0010 remul %a1@(16),%d1,%d2 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 58866: 2429 0020 movel %a1@(32),%d2 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_of_alloc_area( uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) 5886a: 91c1 subal %d1,%a0 RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap( const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block 5886c: b488 cmpl %a0,%d2 5886e: 6244 bhis 588b4 <_Heap_Size_of_alloc_area+0x68> 58870: b1e9 0024 cmpal %a1@(36),%a0 58874: 53c1 sls %d1 58876: 49c1 extbl %d1 58878: 4481 negl %d1 uintptr_t const alloc_begin = (uintptr_t) alloc_begin_ptr; Heap_Block *block = _Heap_Block_of_alloc_area( alloc_begin, page_size ); Heap_Block *next_block = NULL; uintptr_t block_size = 0; if ( !_Heap_Is_block_in_heap( heap, block ) ) { 5887a: 4a01 tstb %d1 5887c: 6736 beqs 588b4 <_Heap_Size_of_alloc_area+0x68> <== NEVER TAKEN RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 5887e: 72fe moveq #-2,%d1 58880: c2a8 0004 andl %a0@(4),%d1 58884: d1c1 addal %d1,%a0 RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap( const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block 58886: b488 cmpl %a0,%d2 58888: 622a bhis 588b4 <_Heap_Size_of_alloc_area+0x68> <== NEVER TAKEN 5888a: b1e9 0024 cmpal %a1@(36),%a0 5888e: 53c1 sls %d1 58890: 49c1 extbl %d1 58892: 4481 negl %d1 } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( 58894: 4a01 tstb %d1 58896: 671c beqs 588b4 <_Heap_Size_of_alloc_area+0x68> <== NEVER TAKEN 58898: 7201 moveq #1,%d1 5889a: c2a8 0004 andl %a0@(4),%d1 5889e: 4a01 tstb %d1 588a0: 6712 beqs 588b4 <_Heap_Size_of_alloc_area+0x68> <== NEVER TAKEN || !_Heap_Is_prev_used( next_block ) ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_BLOCK_SIZE_OFFSET - alloc_begin; 588a2: 7204 moveq #4,%d1 588a4: 9280 subl %d0,%d1 588a6: 2001 movel %d1,%d0 588a8: d088 addl %a0,%d0 588aa: 226e 0010 moveal %fp@(16),%a1 588ae: 2280 movel %d0,%a1@ 588b0: 7001 moveq #1,%d0 return true; 588b2: 6002 bras 588b6 <_Heap_Size_of_alloc_area+0x6a> 588b4: 4200 clrb %d0 } 588b6: 241f movel %sp@+,%d2 588b8: 4e5e unlk %fp <== NOT EXECUTED 00046940 <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 46940: 4e56 ffd0 linkw %fp,#-48 46944: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 46948: 286e 0008 moveal %fp@(8),%a4 uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; Heap_Block *const last_block = heap->last_block; Heap_Block *block = heap->first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 4694c: 47fa 031a lea %pc@(46c68 <_Heap_Walk_print>),%a3 bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 46950: 242e 000c movel %fp@(12),%d2 uintptr_t const page_size = heap->page_size; 46954: 2c2c 0010 movel %a4@(16),%d6 uintptr_t const min_block_size = heap->min_block_size; 46958: 262c 0014 movel %a4@(20),%d3 Heap_Block *const last_block = heap->last_block; 4695c: 2a2c 0024 movel %a4@(36),%d5 Heap_Block *block = heap->first_block; 46960: 246c 0020 moveal %a4@(32),%a2 Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 46964: 4a2e 0013 tstb %fp@(19) 46968: 6604 bnes 4696e <_Heap_Walk+0x2e> 4696a: 47fa ffcc lea %pc@(46938 <_Heap_Walk_print_nothing>),%a3 if ( !_System_state_Is_up( _System_state_Get() ) ) { 4696e: 7003 moveq #3,%d0 46970: b0b9 0005 df82 cmpl 5df82 <_System_state_Current>,%d0 46976: 6600 02da bnew 46c52 <_Heap_Walk+0x312> 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)( 4697a: 2f2c 000c movel %a4@(12),%sp@- 4697e: 2f2c 0008 movel %a4@(8),%sp@- 46982: 2f05 movel %d5,%sp@- 46984: 2f0a movel %a2,%sp@- 46986: 2f2c 001c movel %a4@(28),%sp@- 4698a: 2f2c 0018 movel %a4@(24),%sp@- 4698e: 2f03 movel %d3,%sp@- 46990: 2f06 movel %d6,%sp@- 46992: 4879 0005 a342 pea 5a342 46998: 42a7 clrl %sp@- 4699a: 2f02 movel %d2,%sp@- 4699c: 4e93 jsr %a3@ heap->area_begin, heap->area_end, first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { 4699e: 4fef 002c lea %sp@(44),%sp 469a2: 4a86 tstl %d6 469a4: 6608 bnes 469ae <_Heap_Walk+0x6e> (*printer)( source, true, "page size is zero\n" ); 469a6: 4879 0005 a3d3 pea 5a3d3 469ac: 607e bras 46a2c <_Heap_Walk+0xec> return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 469ae: 7003 moveq #3,%d0 469b0: c086 andl %d6,%d0 469b2: 670c beqs 469c0 <_Heap_Walk+0x80> (*printer)( 469b4: 2f06 movel %d6,%sp@- 469b6: 4879 0005 a3e6 pea 5a3e6 469bc: 6000 0268 braw 46c26 <_Heap_Walk+0x2e6> ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 469c0: 2203 movel %d3,%d1 469c2: 4c46 1000 remul %d6,%d0,%d1 469c6: 4a80 tstl %d0 469c8: 670c beqs 469d6 <_Heap_Walk+0x96> (*printer)( 469ca: 2f03 movel %d3,%sp@- 469cc: 4879 0005 a404 pea 5a404 469d2: 6000 0252 braw 46c26 <_Heap_Walk+0x2e6> ); return false; } if ( 469d6: 200a movel %a2,%d0 469d8: 5080 addql #8,%d0 469da: 4c46 0001 remul %d6,%d1,%d0 469de: 4a81 tstl %d1 469e0: 670c beqs 469ee <_Heap_Walk+0xae> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 469e2: 2f0a movel %a2,%sp@- 469e4: 4879 0005 a428 pea 5a428 469ea: 6000 023a braw 46c26 <_Heap_Walk+0x2e6> ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 469ee: 7001 moveq #1,%d0 469f0: c0aa 0004 andl %a2@(4),%d0 469f4: 4a00 tstb %d0 469f6: 6608 bnes 46a00 <_Heap_Walk+0xc0> (*printer)( 469f8: 4879 0005 a459 pea 5a459 469fe: 602c bras 46a2c <_Heap_Walk+0xec> ); return false; } if ( first_block->prev_size != page_size ) { 46a00: 2812 movel %a2@,%d4 46a02: bc84 cmpl %d4,%d6 46a04: 670e beqs 46a14 <_Heap_Walk+0xd4> (*printer)( 46a06: 2f06 movel %d6,%sp@- 46a08: 2f04 movel %d4,%sp@- 46a0a: 4879 0005 a487 pea 5a487 46a10: 6000 0150 braw 46b62 <_Heap_Walk+0x222> ); return false; } if ( _Heap_Is_free( last_block ) ) { 46a14: 2045 moveal %d5,%a0 46a16: 70fe moveq #-2,%d0 46a18: 7201 moveq #1,%d1 46a1a: c0a8 0004 andl %a0@(4),%d0 46a1e: c2b0 0804 andl %a0@(00000004,%d0:l),%d1 46a22: 4a01 tstb %d1 46a24: 6616 bnes 46a3c <_Heap_Walk+0xfc> (*printer)( 46a26: 4879 0005 a4b2 pea 5a4b2 46a2c: 4878 0001 pea 1 46a30: 2f02 movel %d2,%sp@- 46a32: 4e93 jsr %a3@ 46a34: 4fef 000c lea %sp@(12),%sp 46a38: 6000 01f8 braw 46c32 <_Heap_Walk+0x2f2> int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 46a3c: 2c2c 0010 movel %a4@(16),%d6 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 46a40: 220c movel %a4,%d1 46a42: 206c 0008 moveal %a4@(8),%a0 46a46: 606a bras 46ab2 <_Heap_Walk+0x172> 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 46a48: b1ec 0020 cmpal %a4@(32),%a0 46a4c: 650e bcss 46a5c <_Heap_Walk+0x11c> 46a4e: b1ec 0024 cmpal %a4@(36),%a0 46a52: 53c0 sls %d0 46a54: 49c0 extbl %d0 46a56: 4480 negl %d0 const Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); const Heap_Block *prev_block = free_list_tail; const Heap_Block *free_block = first_free_block; while ( free_block != free_list_tail ) { if ( !_Heap_Is_block_in_heap( heap, free_block ) ) { 46a58: 4a00 tstb %d0 46a5a: 660c bnes 46a68 <_Heap_Walk+0x128> <== ALWAYS TAKEN (*printer)( 46a5c: 2f08 movel %a0,%sp@- 46a5e: 4879 0005 a4c7 pea 5a4c7 46a64: 6000 01c0 braw 46c26 <_Heap_Walk+0x2e6> ); return false; } if ( 46a68: 4c46 7000 remul %d6,%d0,%d7 46a6c: 4a80 tstl %d0 46a6e: 670c beqs 46a7c <_Heap_Walk+0x13c> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 46a70: 2f08 movel %a0,%sp@- 46a72: 4879 0005 a4e7 pea 5a4e7 46a78: 6000 01ac braw 46c26 <_Heap_Walk+0x2e6> ); return false; } if ( _Heap_Is_used( free_block ) ) { 46a7c: 70fe moveq #-2,%d0 46a7e: 7e01 moveq #1,%d7 46a80: c0a8 0004 andl %a0@(4),%d0 46a84: ceb0 0804 andl %a0@(00000004,%d0:l),%d7 46a88: 670c beqs 46a96 <_Heap_Walk+0x156> (*printer)( 46a8a: 2f08 movel %a0,%sp@- 46a8c: 4879 0005 a517 pea 5a517 46a92: 6000 0192 braw 46c26 <_Heap_Walk+0x2e6> ); return false; } if ( free_block->prev != prev_block ) { 46a96: 2028 000c movel %a0@(12),%d0 46a9a: b280 cmpl %d0,%d1 46a9c: 670e beqs 46aac <_Heap_Walk+0x16c> (*printer)( 46a9e: 2f00 movel %d0,%sp@- 46aa0: 2f08 movel %a0,%sp@- 46aa2: 4879 0005 a533 pea 5a533 46aa8: 6000 00b8 braw 46b62 <_Heap_Walk+0x222> return false; } prev_block = free_block; free_block = free_block->next; 46aac: 2208 movel %a0,%d1 46aae: 2068 0008 moveal %a0@(8),%a0 ); return false; } if ( 46ab2: 2e08 movel %a0,%d7 46ab4: 5087 addql #8,%d7 const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); const Heap_Block *prev_block = free_list_tail; const Heap_Block *free_block = first_free_block; while ( free_block != free_list_tail ) { 46ab6: b9c8 cmpal %a0,%a4 46ab8: 668e bnes 46a48 <_Heap_Walk+0x108> 46aba: 6000 0190 braw 46c4c <_Heap_Walk+0x30c> - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 46abe: 202a 0004 movel %a2@(4),%d0 46ac2: 7cfe moveq #-2,%d6 uintptr_t const block_size = _Heap_Block_size( block ); bool const prev_used = _Heap_Is_prev_used( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); uintptr_t const next_block_begin = (uintptr_t) next_block; if ( prev_used ) { 46ac4: 7201 moveq #1,%d1 46ac6: cc80 andl %d0,%d6 46ac8: c081 andl %d1,%d0 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 46aca: 4bf2 6800 lea %a2@(00000000,%d6:l),%a5 46ace: 4a00 tstb %d0 46ad0: 6716 beqs 46ae8 <_Heap_Walk+0x1a8> (*printer)( 46ad2: 2f06 movel %d6,%sp@- 46ad4: 2f0a movel %a2,%sp@- 46ad6: 4879 0005 a565 pea 5a565 46adc: 42a7 clrl %sp@- 46ade: 2f02 movel %d2,%sp@- 46ae0: 4e93 jsr %a3@ 46ae2: 4fef 0014 lea %sp@(20),%sp 46ae6: 6016 bras 46afe <_Heap_Walk+0x1be> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 46ae8: 2f12 movel %a2@,%sp@- 46aea: 2f06 movel %d6,%sp@- 46aec: 2f0a movel %a2,%sp@- 46aee: 4879 0005 a57c pea 5a57c 46af4: 42a7 clrl %sp@- 46af6: 2f02 movel %d2,%sp@- 46af8: 4e93 jsr %a3@ 46afa: 4fef 0018 lea %sp@(24),%sp RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap( const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block 46afe: bbec 0020 cmpal %a4@(32),%a5 46b02: 650e bcss 46b12 <_Heap_Walk+0x1d2> <== NEVER TAKEN 46b04: bbec 0024 cmpal %a4@(36),%a5 46b08: 53c0 sls %d0 46b0a: 49c0 extbl %d0 46b0c: 4480 negl %d0 block_size, block->prev_size ); } if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 46b0e: 4a00 tstb %d0 46b10: 660c bnes 46b1e <_Heap_Walk+0x1de> (*printer)( 46b12: 2f0d movel %a5,%sp@- 46b14: 2f0a movel %a2,%sp@- 46b16: 4879 0005 a5a1 pea 5a5a1 46b1c: 6044 bras 46b62 <_Heap_Walk+0x222> ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) ) { 46b1e: 2206 movel %d6,%d1 46b20: 4c44 1000 remul %d4,%d0,%d1 46b24: 4a80 tstl %d0 46b26: 670c beqs 46b34 <_Heap_Walk+0x1f4> (*printer)( 46b28: 2f06 movel %d6,%sp@- 46b2a: 2f0a movel %a2,%sp@- 46b2c: 4879 0005 a5ce pea 5a5ce 46b32: 602e bras 46b62 <_Heap_Walk+0x222> ); return false; } if ( block_size < min_block_size ) { 46b34: b686 cmpl %d6,%d3 46b36: 631c blss 46b54 <_Heap_Walk+0x214> (*printer)( 46b38: 2f03 movel %d3,%sp@- 46b3a: 2f06 movel %d6,%sp@- 46b3c: 2f0a movel %a2,%sp@- 46b3e: 4879 0005 a5fc pea 5a5fc 46b44: 4878 0001 pea 1 46b48: 2f02 movel %d2,%sp@- 46b4a: 4e93 jsr %a3@ block, block_size, min_block_size ); return false; 46b4c: 4fef 0018 lea %sp@(24),%sp 46b50: 6000 00e0 braw 46c32 <_Heap_Walk+0x2f2> } if ( next_block_begin <= block_begin ) { 46b54: b5cd cmpal %a5,%a2 46b56: 651a bcss 46b72 <_Heap_Walk+0x232> (*printer)( 46b58: 2f0d movel %a5,%sp@- 46b5a: 2f0a movel %a2,%sp@- 46b5c: 4879 0005 a627 pea 5a627 46b62: 4878 0001 pea 1 46b66: 2f02 movel %d2,%sp@- 46b68: 4e93 jsr %a3@ "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 46b6a: 4fef 0014 lea %sp@(20),%sp 46b6e: 6000 00c2 braw 46c32 <_Heap_Walk+0x2f2> } if ( !_Heap_Is_prev_used( next_block ) ) { 46b72: 7001 moveq #1,%d0 46b74: c0ad 0004 andl %a5@(4),%d0 46b78: 4a00 tstb %d0 46b7a: 6600 00ce bnew 46c4a <_Heap_Walk+0x30a> 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; 46b7e: 2e2a 0004 movel %a2@(4),%d7 - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 46b82: 7cfe moveq #-2,%d6 return _Heap_Free_list_head(heap)->next; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_last( Heap_Control *heap ) { return _Heap_Free_list_tail(heap)->prev; 46b84: 43f9 0005 a65b lea 5a65b ,%a1 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 46b8a: 206c 0008 moveal %a4@(8),%a0 - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 46b8e: cc87 andl %d7,%d6 block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 46b90: 2d47 fffc movel %d7,%fp@(-4) RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 46b94: 2e0a movel %a2,%d7 46b96: de86 addl %d6,%d7 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 46b98: 2d48 fff8 movel %a0,%fp@(-8) Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 46b9c: 206a 0008 moveal %a2@(8),%a0 } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_last( Heap_Control *heap ) { return _Heap_Free_list_tail(heap)->prev; 46ba0: b1ec 000c cmpal %a4@(12),%a0 46ba4: 6710 beqs 46bb6 <_Heap_Walk+0x276> " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") 46ba6: 43f9 0005 a665 lea 5a665 ,%a1 46bac: b9c8 cmpal %a0,%a4 46bae: 6706 beqs 46bb6 <_Heap_Walk+0x276> 46bb0: 43f9 0005 a292 lea 5a292 ,%a1 Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 46bb6: 202a 000c movel %a2@(12),%d0 46bba: 223c 0005 a66f movel #370287,%d1 46bc0: b0ae fff8 cmpl %fp@(-8),%d0 46bc4: 6710 beqs 46bd6 <_Heap_Walk+0x296> "block 0x%08x: prev 0x%08x%s, next 0x%08x%s\n", block, block->prev, block->prev == first_free_block ? " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), 46bc6: 223c 0005 a67a movel #370298,%d1 46bcc: b9c0 cmpal %d0,%a4 46bce: 6706 beqs 46bd6 <_Heap_Walk+0x296> 46bd0: 223c 0005 a292 movel #369298,%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)( 46bd6: 2f09 movel %a1,%sp@- 46bd8: 2f08 movel %a0,%sp@- 46bda: 2f01 movel %d1,%sp@- 46bdc: 2f00 movel %d0,%sp@- 46bde: 2f0a movel %a2,%sp@- 46be0: 4879 0005 a684 pea 5a684 46be6: 42a7 clrl %sp@- 46be8: 2f02 movel %d2,%sp@- 46bea: 4e93 jsr %a3@ block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { 46bec: 4fef 0020 lea %sp@(32),%sp 46bf0: 2047 moveal %d7,%a0 46bf2: 2010 movel %a0@,%d0 46bf4: b086 cmpl %d6,%d0 46bf6: 671c beqs 46c14 <_Heap_Walk+0x2d4> (*printer)( 46bf8: 2f07 movel %d7,%sp@- 46bfa: 2f00 movel %d0,%sp@- 46bfc: 2f06 movel %d6,%sp@- 46bfe: 2f0a movel %a2,%sp@- 46c00: 4879 0005 a6b0 pea 5a6b0 46c06: 4878 0001 pea 1 46c0a: 2f02 movel %d2,%sp@- 46c0c: 4e93 jsr %a3@ 46c0e: 4fef 001c lea %sp@(28),%sp 46c12: 601e bras 46c32 <_Heap_Walk+0x2f2> ); return false; } if ( !prev_used ) { 46c14: 7001 moveq #1,%d0 46c16: c0ae fffc andl %fp@(-4),%d0 46c1a: 4a00 tstb %d0 46c1c: 6618 bnes 46c36 <_Heap_Walk+0x2f6> (*printer)( 46c1e: 2f0a movel %a2,%sp@- 46c20: 4879 0005 a6e9 pea 5a6e9 46c26: 4878 0001 pea 1 46c2a: 2f02 movel %d2,%sp@- 46c2c: 4e93 jsr %a3@ 46c2e: 4fef 0010 lea %sp@(16),%sp 46c32: 4200 clrb %d0 46c34: 601e bras 46c54 <_Heap_Walk+0x314> return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 46c36: 206c 0008 moveal %a4@(8),%a0 46c3a: 6008 bras 46c44 <_Heap_Walk+0x304> { 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 ) { 46c3c: b5c8 cmpal %a0,%a2 46c3e: 670a beqs 46c4a <_Heap_Walk+0x30a> return true; } free_block = free_block->next; 46c40: 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 ) { 46c44: b9c8 cmpal %a0,%a4 46c46: 66f4 bnes 46c3c <_Heap_Walk+0x2fc> 46c48: 6014 bras 46c5e <_Heap_Walk+0x31e> 46c4a: 244d moveal %a5,%a2 if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; } while ( block != last_block ) { 46c4c: ba8a cmpl %a2,%d5 46c4e: 6600 fe6e bnew 46abe <_Heap_Walk+0x17e> 46c52: 7001 moveq #1,%d0 block = next_block; } return true; } 46c54: 4cee 3cfc ffd0 moveml %fp@(-48),%d2-%d7/%a2-%a5 46c5a: 4e5e unlk %fp 46c5c: 4e75 rts return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 46c5e: 2f0a movel %a2,%sp@- 46c60: 4879 0005 a718 pea 5a718 46c66: 60be bras 46c26 <_Heap_Walk+0x2e6> 00045f7c <_Internal_error_Occurred>: void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 45f7c: 4e56 0000 linkw %fp,#0 45f80: 222e 000c movel %fp@(12),%d1 45f84: 2f03 movel %d3,%sp@- _Internal_errors_What_happened.the_source = the_source; _Internal_errors_What_happened.is_internal = is_internal; _Internal_errors_What_happened.the_error = the_error; _User_extensions_Fatal( the_source, is_internal, the_error ); 45f86: 4283 clrl %d3 45f88: 1601 moveb %d1,%d3 void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 45f8a: 2f02 movel %d2,%sp@- 45f8c: 242e 0010 movel %fp@(16),%d2 _Internal_errors_What_happened.the_source = the_source; _Internal_errors_What_happened.is_internal = is_internal; _Internal_errors_What_happened.the_error = the_error; _User_extensions_Fatal( the_source, is_internal, the_error ); 45f90: 2f02 movel %d2,%sp@- void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 45f92: 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 ); 45f96: 2f03 movel %d3,%sp@- _System_state_Set( SYSTEM_STATE_FAILED ); _CPU_Fatal_halt( the_error ); 45f98: 263c 0000 0700 movel #1792,%d3 _Internal_errors_What_happened.the_source = the_source; _Internal_errors_What_happened.is_internal = is_internal; _Internal_errors_What_happened.the_error = the_error; _User_extensions_Fatal( the_source, is_internal, the_error ); 45f9e: 2f00 movel %d0,%sp@- Internal_errors_t the_error ) { _Internal_errors_What_happened.the_source = the_source; _Internal_errors_What_happened.is_internal = is_internal; 45fa0: 13c1 0005 bb22 moveb %d1,5bb22 <_Internal_errors_What_happened+0x4> bool is_internal, Internal_errors_t the_error ) { _Internal_errors_What_happened.the_source = the_source; 45fa6: 23c0 0005 bb1e movel %d0,5bb1e <_Internal_errors_What_happened> _Internal_errors_What_happened.is_internal = is_internal; _Internal_errors_What_happened.the_error = the_error; 45fac: 23c2 0005 bb24 movel %d2,5bb24 <_Internal_errors_What_happened+0x6> _User_extensions_Fatal( the_source, is_internal, the_error ); 45fb2: 4eb9 0004 7a2e jsr 47a2e <_User_extensions_Fatal> _System_state_Set( SYSTEM_STATE_FAILED ); _CPU_Fatal_halt( the_error ); 45fb8: 40c0 movew %sr,%d0 45fba: 8083 orl %d3,%d0 45fbc: 46c0 movew %d0,%sr 45fbe: 2002 movel %d2,%d0 <== NOT EXECUTED 45fc0: 223c dead beef movel #-559038737,%d1 <== NOT EXECUTED 45fc6: 4ac8 halt <== NOT EXECUTED RTEMS_INLINE_ROUTINE void _System_state_Set ( System_state_Codes state ) { _System_state_Current = state; 45fc8: 7005 moveq #5,%d0 45fca: 4fef 000c lea %sp@(12),%sp 45fce: 23c0 0005 bbfa movel %d0,5bbfa <_System_state_Current> 45fd4: 60fe bras 45fd4 <_Internal_error_Occurred+0x58> ... 00046040 <_Objects_Allocate>: */ Objects_Control *_Objects_Allocate( Objects_Information *information ) { 46040: 4e56 fff0 linkw %fp,#-16 46044: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ 46048: 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 ) 4604c: 4aaa 0014 tstl %a2@(20) 46050: 6604 bnes 46056 <_Objects_Allocate+0x16> <== ALWAYS TAKEN 46052: 4280 clrl %d0 <== NOT EXECUTED 46054: 605e bras 460b4 <_Objects_Allocate+0x74> <== NOT EXECUTED /* * OK. The manager should be initialized and configured to have objects. * With any luck, it is safe to attempt to allocate an object. */ the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 46056: 240a movel %a2,%d2 46058: 0682 0000 001c addil #28,%d2 4605e: 47f9 0004 98d4 lea 498d4 <_Chain_Get>,%a3 46064: 2f02 movel %d2,%sp@- 46066: 4e93 jsr %a3@ if ( information->auto_extend ) { 46068: 588f addql #4,%sp 4606a: 4a2a 0010 tstb %a2@(16) 4606e: 6744 beqs 460b4 <_Objects_Allocate+0x74> /* * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { 46070: 4a80 tstl %d0 46072: 6612 bnes 46086 <_Objects_Allocate+0x46> _Objects_Extend_information( information ); 46074: 2f0a movel %a2,%sp@- 46076: 4eb9 0004 60ec jsr 460ec <_Objects_Extend_information> the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 4607c: 2f02 movel %d2,%sp@- 4607e: 4e93 jsr %a3@ } if ( the_object ) { 46080: 508f addql #8,%sp 46082: 4a80 tstl %d0 46084: 672e beqs 460b4 <_Objects_Allocate+0x74> uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 46086: 2040 moveal %d0,%a0 46088: 4281 clrl %d1 4608a: 4283 clrl %d3 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 4608c: 4282 clrl %d2 } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 4608e: 362a 0008 movew %a2@(8),%d3 46092: 3228 000a movew %a0@(10),%d1 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 46096: 342a 0012 movew %a2@(18),%d2 information->inactive--; 4609a: 306a 0028 moveaw %a2@(40),%a0 } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 4609e: 9283 subl %d3,%d1 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 460a0: 4c42 1001 remul %d2,%d1,%d1 information->inactive--; 460a4: 5388 subql #1,%a0 block = (uint32_t) _Objects_Get_index( the_object->id ) - _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 460a6: e589 lsll #2,%d1 information->inactive--; 460a8: 3548 0028 movew %a0,%a2@(40) block = (uint32_t) _Objects_Get_index( the_object->id ) - _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 460ac: 206a 002a moveal %a2@(42),%a0 460b0: d1c1 addal %d1,%a0 460b2: 5390 subql #1,%a0@ information->inactive--; } } return the_object; } 460b4: 4cee 0c0c fff0 moveml %fp@(-16),%d2-%d3/%a2-%a3 460ba: 4e5e unlk %fp ... 000460c0 <_Objects_Close>: #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 460c0: 4280 clrl %d0 void _Objects_Close( Objects_Information *information, Objects_Control *the_object ) { 460c2: 4e56 0000 linkw %fp,#0 460c6: 226e 000c moveal %fp@(12),%a1 460ca: 206e 0008 moveal %fp@(8),%a0 460ce: 2f0a movel %a2,%sp@- 460d0: 2468 0018 moveal %a0@(24),%a2 460d4: 3029 000a movew %a1@(10),%d0 460d8: 42b2 0c00 clrl %a2@(00000000,%d0:l:4) _Objects_Invalidate_Id( information, the_object ); _Objects_Namespace_remove( information, the_object ); 460dc: 2d49 000c movel %a1,%fp@(12) } 460e0: 245f moveal %sp@+,%a2 460e2: 4e5e unlk %fp Objects_Control *the_object ) { _Objects_Invalidate_Id( information, the_object ); _Objects_Namespace_remove( information, the_object ); 460e4: 4ef9 0004 65e0 jmp 465e0 <_Objects_Namespace_remove> ... 000463e4 <_Objects_Get_information>: Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint32_t the_class ) { 463e4: 4e56 0000 linkw %fp,#0 463e8: 2f03 movel %d3,%sp@- 463ea: 262e 0008 movel %fp@(8),%d3 463ee: 2f02 movel %d2,%sp@- 463f0: 242e 000c movel %fp@(12),%d2 Objects_Information *info; int the_class_api_maximum; if ( !the_class ) 463f4: 672e beqs 46424 <_Objects_Get_information+0x40> /* * This call implicitly validates the_api so we do not call * _Objects_Is_api_valid above here. */ the_class_api_maximum = _Objects_API_maximum_class( the_api ); 463f6: 2f03 movel %d3,%sp@- 463f8: 4eb9 0004 9dd8 jsr 49dd8 <_Objects_API_maximum_class> if ( the_class_api_maximum == 0 ) 463fe: 588f addql #4,%sp 46400: 4a80 tstl %d0 46402: 6720 beqs 46424 <_Objects_Get_information+0x40> return NULL; if ( the_class > (uint32_t) the_class_api_maximum ) 46404: b082 cmpl %d2,%d0 46406: 651c bcss 46424 <_Objects_Get_information+0x40> return NULL; if ( !_Objects_Information_table[ the_api ] ) 46408: 41f9 0005 ba30 lea 5ba30 <_Objects_Information_table>,%a0 4640e: 2070 3c00 moveal %a0@(00000000,%d3:l:4),%a0 46412: 4a88 tstl %a0 46414: 670e beqs 46424 <_Objects_Get_information+0x40> <== NEVER TAKEN return NULL; info = _Objects_Information_table[ the_api ][ the_class ]; 46416: 2030 2c00 movel %a0@(00000000,%d2:l:4),%d0 if ( !info ) 4641a: 670a beqs 46426 <_Objects_Get_information+0x42> <== NEVER TAKEN * In a multprocessing configuration, we may access remote objects. * Thus we may have 0 local instances and still have a valid object * pointer. */ #if !defined(RTEMS_MULTIPROCESSING) if ( info->maximum == 0 ) 4641c: 2040 moveal %d0,%a0 4641e: 4a68 000e tstw %a0@(14) 46422: 6602 bnes 46426 <_Objects_Get_information+0x42> 46424: 4280 clrl %d0 return NULL; #endif return info; } 46426: 242e fff8 movel %fp@(-8),%d2 4642a: 262e fffc movel %fp@(-4),%d3 4642e: 4e5e unlk %fp ... 00053634 <_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; 53634: 7001 moveq #1,%d0 if ( information->maximum >= index ) { 53636: 4281 clrl %d1 Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 53638: 4e56 0000 linkw %fp,#0 5363c: 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; 53640: 90a8 0006 subl %a0@(6),%d0 53644: d0ae 000c addl %fp@(12),%d0 if ( information->maximum >= index ) { 53648: 3228 000e movew %a0@(14),%d1 Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 5364c: 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 ) { 53650: b081 cmpl %d1,%d0 53652: 620e bhis 53662 <_Objects_Get_no_protection+0x2e> if ( (the_object = information->local_table[ index ]) != NULL ) { 53654: 2068 0018 moveal %a0@(24),%a0 53658: 2030 0c00 movel %a0@(00000000,%d0:l:4),%d0 5365c: 6704 beqs 53662 <_Objects_Get_no_protection+0x2e><== NEVER TAKEN *location = OBJECTS_LOCAL; 5365e: 4291 clrl %a1@ return the_object; 53660: 6006 bras 53668 <_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; 53662: 7001 moveq #1,%d0 53664: 2280 movel %d0,%a1@ 53666: 4280 clrl %d0 return NULL; } 53668: 4e5e unlk %fp <== NOT EXECUTED 00047314 <_Objects_Id_to_name>: */ Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { 47314: 4e56 fffc linkw %fp,#-4 47318: 222e 0008 movel %fp@(8),%d1 4731c: 2f02 movel %d2,%sp@- /* * Caller is trusted for name != NULL. */ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 4731e: 4a81 tstl %d1 47320: 660a bnes 4732c <_Objects_Id_to_name+0x18> 47322: 2079 0005 cf4a moveal 5cf4a <_Thread_Executing>,%a0 47328: 2228 0008 movel %a0@(8),%d1 */ RTEMS_INLINE_ROUTINE Objects_APIs _Objects_Get_API( Objects_Id id ) { return (Objects_APIs) ((id >> OBJECTS_API_START_BIT) & OBJECTS_API_VALID_BITS); 4732c: 7418 moveq #24,%d2 4732e: 2001 movel %d1,%d0 47330: e4a8 lsrl %d2,%d0 47332: 143c 0007 moveb #7,%d2 47336: c082 andl %d2,%d0 */ RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid( uint32_t the_api ) { if ( !the_api || the_api > OBJECTS_APIS_LAST ) 47338: 143c 0003 moveb #3,%d2 4733c: 2040 moveal %d0,%a0 4733e: 5388 subql #1,%a0 47340: b488 cmpl %a0,%d2 47342: 6538 bcss 4737c <_Objects_Id_to_name+0x68> 47344: 6040 bras 47386 <_Objects_Id_to_name+0x72> if ( !_Objects_Information_table[ the_api ] ) return OBJECTS_INVALID_ID; the_class = _Objects_Get_class( tmpId ); information = _Objects_Information_table[ the_api ][ the_class ]; 47346: 2001 movel %d1,%d0 47348: 741b moveq #27,%d2 4734a: e4a8 lsrl %d2,%d0 4734c: 2030 0c00 movel %a0@(00000000,%d0:l:4),%d0 if ( !information ) 47350: 672a beqs 4737c <_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 ); 47352: 486e fffc pea %fp@(-4) 47356: 2f01 movel %d1,%sp@- 47358: 2f00 movel %d0,%sp@- 4735a: 4eb9 0004 72b4 jsr 472b4 <_Objects_Get> if ( !the_object ) 47360: 4fef 000c lea %sp@(12),%sp 47364: 4a80 tstl %d0 47366: 6714 beqs 4737c <_Objects_Id_to_name+0x68> return OBJECTS_INVALID_ID; *name = the_object->name; 47368: 206e 000c moveal %fp@(12),%a0 4736c: 2240 moveal %d0,%a1 4736e: 20a9 000c movel %a1@(12),%a0@ _Thread_Enable_dispatch(); 47372: 4eb9 0004 7b0e jsr 47b0e <_Thread_Enable_dispatch> 47378: 4280 clrl %d0 return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; 4737a: 6002 bras 4737e <_Objects_Id_to_name+0x6a> 4737c: 7003 moveq #3,%d0 } 4737e: 242e fff8 movel %fp@(-8),%d2 47382: 4e5e unlk %fp 47384: 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 ] ) 47386: 41f9 0005 ce48 lea 5ce48 <_Objects_Information_table>,%a0 4738c: 2070 0c00 moveal %a0@(00000000,%d0:l:4),%a0 47390: 4a88 tstl %a0 47392: 66b2 bnes 47346 <_Objects_Id_to_name+0x32> 47394: 60e6 bras 4737c <_Objects_Id_to_name+0x68> ... 000464ec <_Objects_Initialize_information>: information->maximum = 0; /* * Register this Object Class in the Object Information Table. */ _Objects_Information_table[ the_api ][ the_class ] = information; 464ec: 41f9 0005 ba30 lea 5ba30 <_Objects_Information_table>,%a0 , bool supports_global, Objects_Thread_queue_Extract_callout extract #endif ) { 464f2: 4e56 fff0 linkw %fp,#-16 464f6: 202e 000c movel %fp@(12),%d0 information->maximum = 0; /* * Register this Object Class in the Object Information Table. */ _Objects_Information_table[ the_api ][ the_class ] = information; 464fa: 2270 0c00 moveal %a0@(00000000,%d0:l:4),%a1 , bool supports_global, Objects_Thread_queue_Extract_callout extract #endif ) { 464fe: 48d7 003c moveml %d2-%d5,%sp@ 46502: 222e 0014 movel %fp@(20),%d1 46506: 4285 clrl %d5 /* * Are we operating in limited or unlimited (e.g. auto-extend) mode. */ information->auto_extend = (maximum & OBJECTS_UNLIMITED_OBJECTS) ? true : false; 46508: 2601 movel %d1,%d3 , bool supports_global, Objects_Thread_queue_Extract_callout extract #endif ) { 4650a: 206e 0008 moveal %fp@(8),%a0 information->the_class = the_class; information->size = size; information->local_table = 0; information->inactive_per_block = 0; information->object_blocks = 0; information->inactive = 0; 4650e: 4242 clrw %d2 , bool supports_global, Objects_Thread_queue_Extract_callout extract #endif ) { 46510: 3a2e 001a movew %fp@(26),%d5 46514: 282e 0010 movel %fp@(16),%d4 /* * Are we operating in limited or unlimited (e.g. auto-extend) mode. */ information->auto_extend = (maximum & OBJECTS_UNLIMITED_OBJECTS) ? true : false; 46518: d683 addl %d3,%d3 4651a: 9783 subxl %d3,%d3 4651c: 4483 negl %d3 information->the_class = the_class; information->size = size; information->local_table = 0; information->inactive_per_block = 0; information->object_blocks = 0; information->inactive = 0; 4651e: 3142 0028 movew %d2,%a0@(40) /* * Set the maximum value to 0. It will be updated when objects are * added to the inactive set from _Objects_Extend_information() */ information->maximum = 0; 46522: 3142 000e movew %d2,%a0@(14) , bool supports_global, Objects_Thread_queue_Extract_callout extract #endif ) { 46526: 242e 0020 movel %fp@(32),%d2 #if defined(RTEMS_MULTIPROCESSING) uint32_t index; #endif information->the_api = the_api; information->the_class = the_class; 4652a: 3144 0004 movew %d4,%a0@(4) _Objects_Information_table[ the_api ][ the_class ] = information; /* * Are we operating in limited or unlimited (e.g. auto-extend) mode. */ information->auto_extend = 4652e: 1143 0010 moveb %d3,%a0@(16) uint32_t index; #endif information->the_api = the_api; information->the_class = the_class; information->size = size; 46532: 2145 0014 movel %d5,%a0@(20) information->maximum = 0; /* * Register this Object Class in the Object Information Table. */ _Objects_Information_table[ the_api ][ the_class ] = information; 46536: 2388 4c00 movel %a0,%a1@(00000000,%d4:l:4) /* * Are we operating in limited or unlimited (e.g. auto-extend) mode. */ information->auto_extend = (maximum & OBJECTS_UNLIMITED_OBJECTS) ? true : false; maximum_per_allocation = maximum & ~OBJECTS_UNLIMITED_OBJECTS; 4653a: 0881 001f bclr #31,%d1 uint32_t maximum_per_allocation; #if defined(RTEMS_MULTIPROCESSING) uint32_t index; #endif information->the_api = the_api; 4653e: 2080 movel %d0,%a0@ information->the_class = the_class; information->size = size; information->local_table = 0; 46540: 42a8 0018 clrl %a0@(24) information->inactive_per_block = 0; 46544: 42a8 002a clrl %a0@(42) information->object_blocks = 0; 46548: 42a8 002e clrl %a0@(46) maximum_per_allocation = maximum & ~OBJECTS_UNLIMITED_OBJECTS; /* * Unlimited and maximum of zero is illogical. */ if ( information->auto_extend && maximum_per_allocation == 0) { 4654c: 4a03 tstb %d3 4654e: 6714 beqs 46564 <_Objects_Initialize_information+0x78> 46550: 4a81 tstl %d1 46552: 6610 bnes 46564 <_Objects_Initialize_information+0x78> _Internal_error_Occurred( 46554: 4878 0014 pea 14 46558: 4878 0001 pea 1 4655c: 42a7 clrl %sp@- 4655e: 4eb9 0004 5f7c jsr 45f7c <_Internal_error_Occurred> /* * Calculate minimum and maximum Id's */ minimum_index = (maximum_per_allocation == 0) ? 0 : 1; information->minimum_id = 46564: 7a18 moveq #24,%d5 46566: 4a81 tstl %d1 46568: 56c3 sne %d3 4656a: eba8 lsll %d5,%d0 4656c: 1a3c 001b moveb #27,%d5 46570: 49c3 extbl %d3 46572: 4483 negl %d3 information->allocation_size = maximum_per_allocation; /* * Provide a null local table entry for the case of any empty table. */ information->local_table = &null_local_table; 46574: 43f9 0005 b21c lea 5b21c ,%a1 /* * Calculate minimum and maximum Id's */ minimum_index = (maximum_per_allocation == 0) ? 0 : 1; information->minimum_id = 4657a: ebac lsll %d5,%d4 4657c: 08c0 0010 bset #16,%d0 /* * Calculate the maximum name length */ name_length = maximum_name_length; if ( name_length & (OBJECTS_NAME_ALIGNMENT-1) ) 46580: 1a3c 0003 moveb #3,%d5 /* * Calculate minimum and maximum Id's */ minimum_index = (maximum_per_allocation == 0) ? 0 : 1; information->minimum_id = 46584: 8084 orl %d4,%d0 /* * Calculate the maximum name length */ name_length = maximum_name_length; if ( name_length & (OBJECTS_NAME_ALIGNMENT-1) ) 46586: ca82 andl %d2,%d5 } /* * The allocation unit is the maximum value */ information->allocation_size = maximum_per_allocation; 46588: 3141 0012 movew %d1,%a0@(18) /* * Calculate minimum and maximum Id's */ minimum_index = (maximum_per_allocation == 0) ? 0 : 1; information->minimum_id = 4658c: 8083 orl %d3,%d0 information->allocation_size = maximum_per_allocation; /* * Provide a null local table entry for the case of any empty table. */ information->local_table = &null_local_table; 4658e: 2149 0018 movel %a1,%a0@(24) /* * Calculate minimum and maximum Id's */ minimum_index = (maximum_per_allocation == 0) ? 0 : 1; information->minimum_id = 46592: 2140 0006 movel %d0,%a0@(6) /* * Calculate the maximum name length */ name_length = maximum_name_length; if ( name_length & (OBJECTS_NAME_ALIGNMENT-1) ) 46596: 4a85 tstl %d5 46598: 6604 bnes 4659e <_Objects_Initialize_information+0xb2><== NEVER TAKEN 4659a: 2002 movel %d2,%d0 4659c: 6008 bras 465a6 <_Objects_Initialize_information+0xba> name_length = (name_length + OBJECTS_NAME_ALIGNMENT) & 4659e: 2002 movel %d2,%d0 <== NOT EXECUTED 465a0: 5880 addql #4,%d0 <== NOT EXECUTED 465a2: 74fc moveq #-4,%d2 <== NOT EXECUTED 465a4: c082 andl %d2,%d0 <== NOT EXECUTED */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 465a6: 43e8 0020 lea %a0@(32),%a1 465aa: 2149 001c movel %a1,%a0@(28) the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 465ae: 43e8 001c lea %a0@(28),%a1 ~(OBJECTS_NAME_ALIGNMENT-1); information->name_length = name_length; 465b2: 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; 465b6: 42a8 0020 clrl %a0@(32) the_chain->last = _Chain_Head(the_chain); 465ba: 2149 0024 movel %a1,%a0@(36) _Chain_Initialize_empty( &information->Inactive ); /* * Initialize objects .. if there are any */ if ( maximum_per_allocation ) { 465be: 4a81 tstl %d1 465c0: 6712 beqs 465d4 <_Objects_Initialize_information+0xe8> /* * Always have the maximum size available so the current performance * figures are create are met. If the user moves past the maximum * number then a performance hit is taken. */ _Objects_Extend_information( information ); 465c2: 2d48 0008 movel %a0,%fp@(8) _Chain_Initialize_empty( &information->global_table[ index ] ); } else information->global_table = NULL; #endif } 465c6: 4cee 003c fff0 moveml %fp@(-16),%d2-%d5 465cc: 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 ); 465ce: 4ef9 0004 60ec jmp 460ec <_Objects_Extend_information> _Chain_Initialize_empty( &information->global_table[ index ] ); } else information->global_table = NULL; #endif } 465d4: 4cee 003c fff0 moveml %fp@(-16),%d2-%d5 465da: 4e5e unlk %fp ... 00048190 <_Objects_Set_name>: { size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 48190: 4280 clrl %d0 bool _Objects_Set_name( Objects_Information *information, Objects_Control *the_object, const char *name ) { 48192: 4e56 fff0 linkw %fp,#-16 48196: 206e 0008 moveal %fp@(8),%a0 size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 4819a: 3028 0032 movew %a0@(50),%d0 bool _Objects_Set_name( Objects_Information *information, Objects_Control *the_object, const char *name ) { 4819e: 48d7 041c moveml %d2-%d4/%a2,%sp@ 481a2: 246e 0010 moveal %fp@(16),%a2 size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 481a6: 2f00 movel %d0,%sp@- 481a8: 2f0a movel %a2,%sp@- 481aa: 4eb9 0004 e964 jsr 4e964 d[length] = '\0'; the_object->name.name_p = d; } else #endif { the_object->name.name_u32 = _Objects_Build_name( 481b0: 508f addql #8,%sp 481b2: 7201 moveq #1,%d1 481b4: 1812 moveb %a2@,%d4 481b6: b280 cmpl %d0,%d1 481b8: 644a bccs 48204 <_Objects_Set_name+0x74> 481ba: 7602 moveq #2,%d3 481bc: 142a 0001 moveb %a2@(1),%d2 481c0: 49c2 extbl %d2 481c2: 4842 swap %d2 481c4: 4242 clrw %d2 481c6: b680 cmpl %d0,%d3 481c8: 643e bccs 48208 <_Objects_Set_name+0x78> 481ca: 163c 0003 moveb #3,%d3 481ce: 122a 0002 moveb %a2@(2),%d1 481d2: 49c1 extbl %d1 481d4: e189 lsll #8,%d1 481d6: b680 cmpl %d0,%d3 481d8: 6506 bcss 481e0 <_Objects_Set_name+0x50> 481da: 163c 0020 moveb #32,%d3 481de: 6006 bras 481e6 <_Objects_Set_name+0x56> 481e0: 162a 0003 moveb %a2@(3),%d3 481e4: 49c3 extbl %d3 481e6: 7018 moveq #24,%d0 481e8: e1ac lsll %d0,%d4 481ea: 206e 000c moveal %fp@(12),%a0 481ee: 8484 orl %d4,%d2 ); } return true; } 481f0: 7001 moveq #1,%d0 d[length] = '\0'; the_object->name.name_p = d; } else #endif { the_object->name.name_u32 = _Objects_Build_name( 481f2: 8481 orl %d1,%d2 481f4: 8483 orl %d3,%d2 481f6: 2142 000c movel %d2,%a0@(12) ); } return true; } 481fa: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 48200: 4e5e unlk %fp 48202: 4e75 rts d[length] = '\0'; the_object->name.name_p = d; } else #endif { the_object->name.name_u32 = _Objects_Build_name( 48204: 7420 moveq #32,%d2 48206: 4842 swap %d2 48208: 223c 0000 2000 movel #8192,%d1 4820e: 7620 moveq #32,%d3 48210: 60d4 bras 481e6 <_Objects_Set_name+0x56> ... 00049696 <_RTEMS_tasks_Post_switch_extension>: */ void _RTEMS_tasks_Post_switch_extension( Thread_Control *executing ) { 49696: 4e56 ffec linkw %fp,#-20 4969a: 206e 0008 moveal %fp@(8),%a0 4969e: 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 ]; 496a2: 2468 0108 moveal %a0@(264),%a2 if ( !api ) 496a6: 4a8a tstl %a2 496a8: 6754 beqs 496fe <_RTEMS_tasks_Post_switch_extension+0x68><== NEVER TAKEN * Signal Processing */ asr = &api->Signal; _ISR_Disable( level ); 496aa: 203c 0000 0700 movel #1792,%d0 496b0: 40c1 movew %sr,%d1 496b2: 8081 orl %d1,%d0 496b4: 46c0 movew %d0,%sr signal_set = asr->signals_posted; 496b6: 262a 0012 movel %a2@(18),%d3 asr->signals_posted = 0; 496ba: 42aa 0012 clrl %a2@(18) _ISR_Enable( level ); 496be: 46c1 movew %d1,%sr if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ 496c0: 4a83 tstl %d3 496c2: 673a beqs 496fe <_RTEMS_tasks_Post_switch_extension+0x68><== NEVER TAKEN return; asr->nest_level += 1; 496c4: 52aa 001a addql #1,%a2@(26) rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 496c8: 240e movel %fp,%d2 496ca: 5982 subql #4,%d2 496cc: 47f9 0004 b0dc lea 4b0dc ,%a3 496d2: 2f02 movel %d2,%sp@- 496d4: 2f3c 0000 ffff movel #65535,%sp@- 496da: 2f2a 000e movel %a2@(14),%sp@- 496de: 4e93 jsr %a3@ (*asr->handler)( signal_set ); 496e0: 2f03 movel %d3,%sp@- 496e2: 206a 000a moveal %a2@(10),%a0 496e6: 4e90 jsr %a0@ asr->nest_level -= 1; 496e8: 53aa 001a subql #1,%a2@(26) rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 496ec: 2f02 movel %d2,%sp@- 496ee: 2f3c 0000 ffff movel #65535,%sp@- 496f4: 2f2e fffc movel %fp@(-4),%sp@- 496f8: 4e93 jsr %a3@ 496fa: 4fef 001c lea %sp@(28),%sp } 496fe: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3 49704: 4e5e unlk %fp <== NOT EXECUTED 00056af8 <_Region_Process_queue>: */ void _Region_Process_queue( Region_Control *the_region ) { 56af8: 4e56 ffe4 linkw %fp,#-28 56afc: 2039 0007 4084 movel 74084 <_Thread_Dispatch_disable_level>,%d0 56b02: 5280 addql #1,%d0 56b04: 48d7 3c1c moveml %d2-%d4/%a2-%a5,%sp@ 56b08: 266e 0008 moveal %fp@(8),%a3 56b0c: 23c0 0007 4084 movel %d0,74084 <_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(); 56b12: 2f39 0007 4136 movel 74136 <_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 ); 56b18: 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 ); 56b1a: 280b movel %a3,%d4 56b1c: 0682 0000 0010 addil #16,%d2 56b22: 0684 0000 0068 addil #104,%d4 56b28: 4bf9 0005 28f4 lea 528f4 <_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 ); 56b2e: 49f9 0005 718c lea 5718c <_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(); 56b34: 4eb9 0005 1f4c jsr 51f4c <_API_Mutex_Unlock> 56b3a: 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 ); 56b3c: 263c 0005 7290 movel #357008,%d3 56b42: 2f02 movel %d2,%sp@- 56b44: 2043 moveal %d3,%a0 56b46: 4e90 jsr %a0@ if ( the_thread == NULL ) 56b48: 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 ); 56b4a: 2440 moveal %d0,%a2 if ( the_thread == NULL ) 56b4c: 4a80 tstl %d0 56b4e: 672c beqs 56b7c <_Region_Process_queue+0x84> 56b50: 42a7 clrl %sp@- 56b52: 42a7 clrl %sp@- 56b54: 2f2a 0024 movel %a2@(36),%sp@- 56b58: 2f04 movel %d4,%sp@- 56b5a: 4e95 jsr %a5@ the_segment = (void **) _Region_Allocate_segment( the_region, the_thread->Wait.count ); if ( the_segment == NULL ) 56b5c: 4fef 0010 lea %sp@(16),%sp 56b60: 4a80 tstl %d0 56b62: 6718 beqs 56b7c <_Region_Process_queue+0x84> break; *(void **)the_thread->Wait.return_argument = the_segment; 56b64: 206a 0028 moveal %a2@(40),%a0 the_region->number_of_used_blocks += 1; 56b68: 52ab 0064 addql #1,%a3@(100) ); if ( the_segment == NULL ) break; *(void **)the_thread->Wait.return_argument = the_segment; 56b6c: 2080 movel %d0,%a0@ the_region->number_of_used_blocks += 1; _Thread_queue_Extract( &the_region->Wait_queue, the_thread ); 56b6e: 2f0a movel %a2,%sp@- 56b70: 2f02 movel %d2,%sp@- 56b72: 4e94 jsr %a4@ the_thread->Wait.return_code = RTEMS_SUCCESSFUL; } 56b74: 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; 56b76: 42aa 0034 clrl %a2@(52) } 56b7a: 60c6 bras 56b42 <_Region_Process_queue+0x4a> _Thread_Enable_dispatch(); } 56b7c: 4cee 3c1c ffe4 moveml %fp@(-28),%d2-%d4/%a2-%a5 56b82: 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(); 56b84: 4ef9 0005 3ec6 jmp 53ec6 <_Thread_Enable_dispatch> ... 000458e4 <_TOD_Validate>: */ bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 458e4: 4e56 0000 linkw %fp,#0 458e8: 206e 0008 moveal %fp@(8),%a0 458ec: 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(); 458ee: 2039 0005 c480 movel 5c480 ,%d0 */ bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 458f4: 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) || 458f6: 4a88 tstl %a0 458f8: 6762 beqs 4595c <_TOD_Validate+0x78> <== NEVER TAKEN (the_tod->ticks >= ticks_per_second) || 458fa: 243c 000f 4240 movel #1000000,%d2 45900: 4c40 2002 remul %d0,%d2,%d2 45904: b4a8 0018 cmpl %a0@(24),%d2 45908: 6352 blss 4595c <_TOD_Validate+0x78> <== NEVER TAKEN (the_tod->second >= TOD_SECONDS_PER_MINUTE) || 4590a: 763b moveq #59,%d3 4590c: b6a8 0014 cmpl %a0@(20),%d3 45910: 654a bcss 4595c <_TOD_Validate+0x78> <== NEVER TAKEN (the_tod->minute >= TOD_MINUTES_PER_HOUR) || 45912: b6a8 0010 cmpl %a0@(16),%d3 45916: 6544 bcss 4595c <_TOD_Validate+0x78> <== NEVER TAKEN (the_tod->hour >= TOD_HOURS_PER_DAY) || 45918: 7017 moveq #23,%d0 4591a: b0a8 000c cmpl %a0@(12),%d0 4591e: 653c bcss 4595c <_TOD_Validate+0x78> <== NEVER TAKEN (the_tod->month == 0) || 45920: 2028 0004 movel %a0@(4),%d0 uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 45924: 6736 beqs 4595c <_TOD_Validate+0x78> <== NEVER TAKEN 45926: 720c moveq #12,%d1 45928: b280 cmpl %d0,%d1 4592a: 6530 bcss 4595c <_TOD_Validate+0x78> <== NEVER TAKEN (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) || 4592c: 2410 movel %a0@,%d2 uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 4592e: 0c82 0000 07c3 cmpil #1987,%d2 45934: 6326 blss 4595c <_TOD_Validate+0x78> <== NEVER TAKEN (the_tod->minute >= TOD_MINUTES_PER_HOUR) || (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) 45936: 2228 0008 movel %a0@(8),%d1 uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 4593a: 6720 beqs 4595c <_TOD_Validate+0x78> <== NEVER TAKEN (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) return false; if ( (the_tod->year % 4) == 0 ) 4593c: 163c 0003 moveb #3,%d3 45940: 41f9 0005 b40e lea 5b40e <_TOD_Days_per_month>,%a0 45946: c483 andl %d3,%d2 45948: 6606 bnes 45950 <_TOD_Validate+0x6c> days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; 4594a: 2030 0c34 movel %a0@(00000034,%d0:l:4),%d0 4594e: 6004 bras 45954 <_TOD_Validate+0x70> else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; 45950: 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( 45954: b081 cmpl %d1,%d0 45956: 54c0 scc %d0 45958: 4480 negl %d0 4595a: 6002 bras 4595e <_TOD_Validate+0x7a> 4595c: 4200 clrb %d0 if ( the_tod->day > days_in_month ) return false; return true; } 4595e: 241f movel %sp@+,%d2 45960: 261f movel %sp@+,%d3 45962: 4e5e unlk %fp ... 00046768 <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 46768: 4e56 fff0 linkw %fp,#-16 4676c: 48d7 041c moveml %d2-%d4/%a2,%sp@ 46770: 246e 0008 moveal %fp@(8),%a2 /* * Set a transient state for the thread so it is pulled off the Ready chains. * This will prevent it from being scheduled no matter what happens in an * ISR. */ _Thread_Set_transient( the_thread ); 46774: 2f0a movel %a2,%sp@- void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 46776: 262e 000c movel %fp@(12),%d3 */ /* * Save original state */ original_state = the_thread->current_state; 4677a: 242a 0010 movel %a2@(16),%d2 void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 4677e: 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 ); 46782: 4eb9 0004 7550 jsr 47550 <_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 ) 46788: 588f addql #4,%sp 4678a: b6aa 0014 cmpl %a2@(20),%d3 4678e: 670c beqs 4679c <_Thread_Change_priority+0x34> _Thread_Set_priority( the_thread, new_priority ); 46790: 2f03 movel %d3,%sp@- 46792: 2f0a movel %a2,%sp@- 46794: 4eb9 0004 73f8 jsr 473f8 <_Thread_Set_priority> 4679a: 508f addql #8,%sp _ISR_Disable( level ); 4679c: 223c 0000 0700 movel #1792,%d1 467a2: 40c0 movew %sr,%d0 467a4: 8280 orl %d0,%d1 467a6: 46c1 movew %d1,%sr 467a8: 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; 467aa: 222a 0010 movel %a2@(16),%d1 467ae: c483 andl %d3,%d2 if ( state != STATES_TRANSIENT ) { 467b0: b681 cmpl %d1,%d3 467b2: 6730 beqs 467e4 <_Thread_Change_priority+0x7c> /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) 467b4: 4a82 tstl %d2 467b6: 6608 bnes 467c0 <_Thread_Change_priority+0x58> <== NEVER TAKEN the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); 467b8: 74fb moveq #-5,%d2 467ba: c481 andl %d1,%d2 467bc: 2542 0010 movel %d2,%a2@(16) _ISR_Enable( level ); 467c0: 46c0 movew %d0,%sr if ( _States_Is_waiting_on_thread_queue( state ) ) { 467c2: 0281 0003 bee0 andil #245472,%d1 467c8: 6700 00d2 beqw 4689c <_Thread_Change_priority+0x134> _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); 467cc: 2d4a 000c movel %a2,%fp@(12) 467d0: 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 ); } 467d6: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 467dc: 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 ); 467de: 4ef9 0004 735c jmp 4735c <_Thread_queue_Requeue> } return; } /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) { 467e4: 4a82 tstl %d2 467e6: 6650 bnes 46838 <_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; 467e8: 226a 008e moveal %a2@(142),%a1 467ec: 322a 0094 movew %a2@(148),%d1 467f0: 3411 movew %a1@,%d2 467f2: 206a 008a moveal %a2@(138),%a0 467f6: 8282 orl %d2,%d1 * Interrupts are STILL disabled. * We now know the thread will be in the READY state when we remove * the TRANSIENT state. So we have to place it on the appropriate * Ready Queue with interrupts off. */ the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); 467f8: 42aa 0010 clrl %a2@(16) 467fc: 3281 movew %d1,%a1@ _Priority_Major_bit_map |= the_priority_map->ready_major; 467fe: 3239 0005 bb28 movew 5bb28 <_Priority_Major_bit_map>,%d1 46804: 342a 0092 movew %a2@(146),%d2 46808: 8282 orl %d2,%d1 4680a: 33c1 0005 bb28 movew %d1,5bb28 <_Priority_Major_bit_map> _Priority_Add_to_bit_map( &the_thread->Priority_map ); if ( prepend_it ) 46810: 4a04 tstb %d4 46812: 6710 beqs 46824 <_Thread_Change_priority+0xbc> ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 46814: 2250 moveal %a0@,%a1 Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 46816: 2548 0004 movel %a0,%a2@(4) before_node = after_node->next; after_node->next = the_node; 4681a: 208a movel %a2,%a0@ the_node->next = before_node; before_node->previous = the_node; 4681c: 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; 46820: 2489 movel %a1,%a2@ 46822: 6014 bras 46838 <_Thread_Change_priority+0xd0> Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 46824: 2608 movel %a0,%d3 46826: 5883 addql #4,%d3 46828: 2483 movel %d3,%a2@ old_last_node = the_chain->last; 4682a: 2268 0008 moveal %a0@(8),%a1 the_chain->last = the_node; 4682e: 214a 0008 movel %a2,%a0@(8) old_last_node->next = the_node; the_node->previous = old_last_node; 46832: 2549 0004 movel %a1,%a2@(4) Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; the_chain->last = the_node; old_last_node->next = the_node; 46836: 228a movel %a2,%a1@ _Chain_Prepend_unprotected( the_thread->ready, &the_thread->Object.Node ); else _Chain_Append_unprotected( the_thread->ready, &the_thread->Object.Node ); } _ISR_Flash( level ); 46838: 223c 0000 0700 movel #1792,%d1 4683e: 46c0 movew %d0,%sr 46840: 8280 orl %d0,%d1 46842: 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 ); 46844: 3239 0005 bb28 movew 5bb28 <_Priority_Major_bit_map>,%d1 4684a: 4841 swap %d1 4684c: 04c1 ff1 %d1 _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 4684e: 4282 clrl %d2 46850: 41f9 0005 bb94 lea 5bb94 <_Priority_Bit_map>,%a0 46856: 3401 movew %d1,%d2 46858: 3230 2a00 movew %a0@(00000000,%d2:l:2),%d1 4685c: 4841 swap %d1 4685e: 04c1 ff1 %d1 * ready thread. */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) 46860: 4283 clrl %d3 46862: e98a lsll #4,%d2 46864: 3601 movew %d1,%d3 46866: 2279 0005 ba24 moveal 5ba24 <_Thread_Ready_chain>,%a1 4686c: 2202 movel %d2,%d1 4686e: d283 addl %d3,%d1 46870: 2401 movel %d1,%d2 46872: e58a lsll #2,%d2 46874: e989 lsll #4,%d1 * is also the heir thread, and false otherwise. */ RTEMS_INLINE_ROUTINE bool _Thread_Is_executing_also_the_heir( void ) { return ( _Thread_Executing == _Thread_Heir ); 46876: 2079 0005 bb32 moveal 5bb32 <_Thread_Executing>,%a0 * ready thread. */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) 4687c: 93c2 subal %d2,%a1 4687e: 2231 1800 movel %a1@(00000000,%d1:l),%d1 46882: 23c1 0005 bb06 movel %d1,5bb06 <_Thread_Heir> * We altered the set of thread priorities. So let's figure out * who is the heir and if we need to switch to them. */ _Thread_Calculate_heir(); if ( !_Thread_Is_executing_also_the_heir() && 46888: b288 cmpl %a0,%d1 4688a: 670e beqs 4689a <_Thread_Change_priority+0x132> _Thread_Executing->is_preemptible ) 4688c: 4a28 0075 tstb %a0@(117) 46890: 6708 beqs 4689a <_Thread_Change_priority+0x132> _Context_Switch_necessary = true; 46892: 7201 moveq #1,%d1 46894: 13c1 0005 bb42 moveb %d1,5bb42 <_Context_Switch_necessary> _ISR_Enable( level ); 4689a: 46c0 movew %d0,%sr } 4689c: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 468a2: 4e5e unlk %fp ... 000468a8 <_Thread_Clear_state>: void _Thread_Clear_state( Thread_Control *the_thread, States_Control state ) { 468a8: 4e56 ffec linkw %fp,#-20 468ac: 206e 0008 moveal %fp@(8),%a0 468b0: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ ISR_Level level; States_Control current_state; _ISR_Disable( level ); 468b4: 263c 0000 0700 movel #1792,%d3 468ba: 2203 movel %d3,%d1 void _Thread_Clear_state( Thread_Control *the_thread, States_Control state ) { 468bc: 202e 000c movel %fp@(12),%d0 ISR_Level level; States_Control current_state; _ISR_Disable( level ); 468c0: 40c2 movew %sr,%d2 468c2: 8282 orl %d2,%d1 468c4: 46c1 movew %d1,%sr current_state = the_thread->current_state; 468c6: 2228 0010 movel %a0@(16),%d1 if ( current_state & state ) { 468ca: 2800 movel %d0,%d4 468cc: c881 andl %d1,%d4 468ce: 6778 beqs 46948 <_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); 468d0: 4680 notl %d0 468d2: c081 andl %d1,%d0 current_state = 468d4: 2140 0010 movel %d0,%a0@(16) the_thread->current_state = _States_Clear( state, current_state ); if ( _States_Is_ready( current_state ) ) { 468d8: 666e bnes 46948 <_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; 468da: 2668 008e moveal %a0@(142),%a3 468de: 3028 0094 movew %a0@(148),%d0 468e2: 3213 movew %a3@,%d1 _Priority_Add_to_bit_map( &the_thread->Priority_map ); _Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node); 468e4: 2268 008a moveal %a0@(138),%a1 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 468e8: 2809 movel %a1,%d4 468ea: 5884 addql #4,%d4 468ec: 8081 orl %d1,%d0 468ee: 2084 movel %d4,%a0@ old_last_node = the_chain->last; 468f0: 2469 0008 moveal %a1@(8),%a2 468f4: 3680 movew %d0,%a3@ the_chain->last = the_node; 468f6: 2348 0008 movel %a0,%a1@(8) _Priority_Major_bit_map |= the_priority_map->ready_major; 468fa: 3039 0005 bb28 movew 5bb28 <_Priority_Major_bit_map>,%d0 46900: 3228 0092 movew %a0@(146),%d1 old_last_node->next = the_node; the_node->previous = old_last_node; 46904: 214a 0004 movel %a2,%a0@(4) 46908: 8081 orl %d1,%d0 Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; the_chain->last = the_node; old_last_node->next = the_node; 4690a: 2488 movel %a0,%a2@ 4690c: 33c0 0005 bb28 movew %d0,5bb28 <_Priority_Major_bit_map> _ISR_Flash( level ); 46912: 2003 movel %d3,%d0 46914: 46c2 movew %d2,%sr 46916: 8082 orl %d2,%d0 46918: 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 ) { 4691a: 2028 0014 movel %a0@(20),%d0 4691e: 2279 0005 bb06 moveal 5bb06 <_Thread_Heir>,%a1 46924: b0a9 0014 cmpl %a1@(20),%d0 46928: 641e bccs 46948 <_Thread_Clear_state+0xa0> _Thread_Heir = the_thread; 4692a: 23c8 0005 bb06 movel %a0,5bb06 <_Thread_Heir> if ( _Thread_Executing->is_preemptible || 46930: 2079 0005 bb32 moveal 5bb32 <_Thread_Executing>,%a0 46936: 4a28 0075 tstb %a0@(117) 4693a: 6604 bnes 46940 <_Thread_Clear_state+0x98> 4693c: 4a80 tstl %d0 4693e: 6608 bnes 46948 <_Thread_Clear_state+0xa0> <== ALWAYS TAKEN the_thread->current_priority == 0 ) _Context_Switch_necessary = true; 46940: 7001 moveq #1,%d0 46942: 13c0 0005 bb42 moveb %d0,5bb42 <_Context_Switch_necessary> } } } _ISR_Enable( level ); 46948: 46c2 movew %d2,%sr } 4694a: 4cd7 0c1c moveml %sp@,%d2-%d4/%a2-%a3 4694e: 4e5e unlk %fp ... 00046ad4 <_Thread_Delay_ended>: void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { 46ad4: 4e56 fffc linkw %fp,#-4 Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 46ad8: 486e fffc pea %fp@(-4) 46adc: 2f2e 0008 movel %fp@(8),%sp@- 46ae0: 4eb9 0004 6c88 jsr 46c88 <_Thread_Get> switch ( location ) { 46ae6: 508f addql #8,%sp 46ae8: 4aae fffc tstl %fp@(-4) 46aec: 661e bnes 46b0c <_Thread_Delay_ended+0x38> <== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_Clear_state( 46aee: 2f3c 1000 0018 movel #268435480,%sp@- 46af4: 2f00 movel %d0,%sp@- 46af6: 4eb9 0004 68a8 jsr 468a8 <_Thread_Clear_state> 46afc: 508f addql #8,%sp 46afe: 2039 0005 ba78 movel 5ba78 <_Thread_Dispatch_disable_level>,%d0 46b04: 5380 subql #1,%d0 46b06: 23c0 0005 ba78 movel %d0,5ba78 <_Thread_Dispatch_disable_level> | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Thread_Unnest_dispatch(); break; } } 46b0c: 4e5e unlk %fp <== NOT EXECUTED 00046b10 <_Thread_Dispatch>: Thread_Control *executing; Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); 46b10: 307c 0700 moveaw #1792,%a0 46b14: 2208 movel %a0,%d1 * dispatch thread * no dispatch thread */ void _Thread_Dispatch( void ) { 46b16: 4e56 ffc8 linkw %fp,#-56 46b1a: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ Thread_Control *executing; Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; 46b1e: 2479 0005 bb32 moveal 5bb32 <_Thread_Executing>,%a2 _ISR_Disable( level ); 46b24: 40c0 movew %sr,%d0 46b26: 8280 orl %d0,%d1 46b28: 46c1 movew %d1,%sr _ISR_Enable( level ); #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 46b2a: 260e movel %fp,%d3 _Timestamp_Subtract( 46b2c: 240e movel %fp,%d2 _ISR_Enable( level ); #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 46b2e: 5183 subql #8,%d3 _Timestamp_Subtract( 46b30: 0682 ffff fff0 addil #-16,%d2 46b36: 2e3c 0004 78c4 movel #293060,%d7 &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); 46b3c: 2c3c 0004 788c movel #293004,%d6 if ( _Thread_libc_reent ) { executing->libc_reent = *_Thread_libc_reent; *_Thread_libc_reent = heir->libc_reent; } _User_extensions_Thread_switch( executing, heir ); 46b42: 2a3c 0004 7b3c movel #293692,%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 ); 46b48: 4bf9 0004 7fac lea 47fac <_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 ); 46b4e: 49f9 0004 7f8a lea 47f8a <_CPU_Context_save_fp>,%a4 if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 46b54: 283c 0004 7e54 movel #294484,%d4 Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { 46b5a: 6000 00d0 braw 46c2c <_Thread_Dispatch+0x11c> heir = _Thread_Heir; _Thread_Dispatch_disable_level = 1; 46b5e: 7201 moveq #1,%d1 46b60: 23c1 0005 ba78 movel %d1,5ba78 <_Thread_Dispatch_disable_level> ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { heir = _Thread_Heir; 46b66: 2679 0005 bb06 moveal 5bb06 <_Thread_Heir>,%a3 _Thread_Dispatch_disable_level = 1; _Context_Switch_necessary = false; 46b6c: 4201 clrb %d1 _Thread_Executing = heir; 46b6e: 23cb 0005 bb32 movel %a3,5bb32 <_Thread_Executing> executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { heir = _Thread_Heir; _Thread_Dispatch_disable_level = 1; _Context_Switch_necessary = false; 46b74: 13c1 0005 bb42 moveb %d1,5bb42 <_Context_Switch_necessary> _Thread_Executing = heir; #if __RTEMS_ADA__ executing->rtems_ada_self = rtems_ada_self; rtems_ada_self = heir->rtems_ada_self; #endif if ( heir->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE ) 46b7a: 7201 moveq #1,%d1 46b7c: b2ab 007a cmpl %a3@(122),%d1 46b80: 660a bnes 46b8c <_Thread_Dispatch+0x7c> heir->cpu_time_budget = _Thread_Ticks_per_timeslice; 46b82: 41f9 0005 ba28 lea 5ba28 <_Thread_Ticks_per_timeslice>,%a0 46b88: 2750 0076 movel %a0@,%a3@(118) _ISR_Enable( level ); 46b8c: 46c0 movew %d0,%sr #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 46b8e: 2f03 movel %d3,%sp@- 46b90: 4eb9 0004 9aa8 jsr 49aa8 <_TOD_Get_uptime> _Timestamp_Subtract( 46b96: 2047 moveal %d7,%a0 46b98: 2f02 movel %d2,%sp@- 46b9a: 2f03 movel %d3,%sp@- 46b9c: 4879 0005 bb3a pea 5bb3a <_Thread_Time_of_last_context_switch> 46ba2: 4e90 jsr %a0@ &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); 46ba4: 2046 moveal %d6,%a0 46ba6: 2f02 movel %d2,%sp@- 46ba8: 486a 0082 pea %a2@(130) 46bac: 4e90 jsr %a0@ #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 46bae: 2079 0005 bb02 moveal 5bb02 <_Thread_libc_reent>,%a0 46bb4: 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; 46bb8: 202e fff8 movel %fp@(-8),%d0 46bbc: 222e fffc movel %fp@(-4),%d1 46bc0: 23c0 0005 bb3a movel %d0,5bb3a <_Thread_Time_of_last_context_switch> 46bc6: 23c1 0005 bb3e movel %d1,5bb3e <_Thread_Time_of_last_context_switch+0x4> #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 46bcc: 4a88 tstl %a0 46bce: 6708 beqs 46bd8 <_Thread_Dispatch+0xc8> <== NEVER TAKEN executing->libc_reent = *_Thread_libc_reent; 46bd0: 2550 0104 movel %a0@,%a2@(260) *_Thread_libc_reent = heir->libc_reent; 46bd4: 20ab 0104 movel %a3@(260),%a0@ } _User_extensions_Thread_switch( executing, heir ); 46bd8: 2f0b movel %a3,%sp@- 46bda: 2045 moveal %d5,%a0 46bdc: 2f0a movel %a2,%sp@- 46bde: 4e90 jsr %a0@ if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 46be0: 486b 00cc pea %a3@(204) 46be4: 2044 moveal %d4,%a0 46be6: 486a 00cc pea %a2@(204) 46bea: 4e90 jsr %a0@ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && 46bec: 4fef 0010 lea %sp@(16),%sp 46bf0: 4aaa 0100 tstl %a2@(256) 46bf4: 6724 beqs 46c1a <_Thread_Dispatch+0x10a> #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) RTEMS_INLINE_ROUTINE bool _Thread_Is_allocated_fp ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Allocated_fp ); 46bf6: 2079 0005 bafe moveal 5bafe <_Thread_Allocated_fp>,%a0 46bfc: b1ca cmpal %a2,%a0 46bfe: 671a beqs 46c1a <_Thread_Dispatch+0x10a> !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) 46c00: 4a88 tstl %a0 46c02: 6708 beqs 46c0c <_Thread_Dispatch+0xfc> _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 46c04: 4868 0100 pea %a0@(256) 46c08: 4e94 jsr %a4@ 46c0a: 588f addql #4,%sp _Context_Restore_fp( &executing->fp_context ); 46c0c: 486a 0100 pea %a2@(256) 46c10: 4e95 jsr %a5@ _Thread_Allocated_fp = executing; 46c12: 588f addql #4,%sp 46c14: 23ca 0005 bafe movel %a2,5bafe <_Thread_Allocated_fp> if ( executing->fp_context != NULL ) _Context_Restore_fp( &executing->fp_context ); #endif #endif executing = _Thread_Executing; 46c1a: 2479 0005 bb32 moveal 5bb32 <_Thread_Executing>,%a2 _ISR_Disable( level ); 46c20: 223c 0000 0700 movel #1792,%d1 46c26: 40c0 movew %sr,%d0 46c28: 8280 orl %d0,%d1 46c2a: 46c1 movew %d1,%sr Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { 46c2c: 1239 0005 bb42 moveb 5bb42 <_Context_Switch_necessary>,%d1 46c32: 6600 ff2a bnew 46b5e <_Thread_Dispatch+0x4e> executing = _Thread_Executing; _ISR_Disable( level ); } _Thread_Dispatch_disable_level = 0; 46c36: 42b9 0005 ba78 clrl 5ba78 <_Thread_Dispatch_disable_level> _ISR_Enable( level ); 46c3c: 46c0 movew %d0,%sr if ( _Thread_Do_post_task_switch_extension || 46c3e: 4ab9 0005 bb1a tstl 5bb1a <_Thread_Do_post_task_switch_extension> 46c44: 6606 bnes 46c4c <_Thread_Dispatch+0x13c> <== NEVER TAKEN executing->do_post_task_switch_extension ) { 46c46: 4a2a 0074 tstb %a2@(116) 46c4a: 670c beqs 46c58 <_Thread_Dispatch+0x148> executing->do_post_task_switch_extension = false; 46c4c: 4200 clrb %d0 46c4e: 1540 0074 moveb %d0,%a2@(116) _API_extensions_Run_postswitch(); 46c52: 4eb9 0004 572a jsr 4572a <_API_extensions_Run_postswitch> } } 46c58: 4cee 3cfc ffc8 moveml %fp@(-56),%d2-%d7/%a2-%a5 46c5e: 4e5e unlk %fp <== NOT EXECUTED 0004b4bc <_Thread_Evaluate_mode>: * * XXX */ bool _Thread_Evaluate_mode( void ) { 4b4bc: 4e56 0000 linkw %fp,#0 Thread_Control *executing; executing = _Thread_Executing; 4b4c0: 2079 0005 bb32 moveal 5bb32 <_Thread_Executing>,%a0 if ( !_States_Is_ready( executing->current_state ) || 4b4c6: 4aa8 0010 tstl %a0@(16) 4b4ca: 660e bnes 4b4da <_Thread_Evaluate_mode+0x1e> <== NEVER TAKEN 4b4cc: b1f9 0005 bb06 cmpal 5bb06 <_Thread_Heir>,%a0 4b4d2: 6710 beqs 4b4e4 <_Thread_Evaluate_mode+0x28> ( !_Thread_Is_heir( executing ) && executing->is_preemptible ) ) { 4b4d4: 4a28 0075 tstb %a0@(117) 4b4d8: 670a beqs 4b4e4 <_Thread_Evaluate_mode+0x28> <== NEVER TAKEN _Context_Switch_necessary = true; 4b4da: 7001 moveq #1,%d0 4b4dc: 13c0 0005 bb42 moveb %d0,5bb42 <_Context_Switch_necessary> return true; 4b4e2: 6002 bras 4b4e6 <_Thread_Evaluate_mode+0x2a> 4b4e4: 4200 clrb %d0 } return false; } 4b4e6: 4e5e unlk %fp ... 0004b4ec <_Thread_Handler>: * * Output parameters: NONE */ void _Thread_Handler( void ) { 4b4ec: 4e56 0000 linkw %fp,#0 4b4f0: 2f0a movel %a2,%sp@- #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static char doneConstructors; char doneCons; #endif executing = _Thread_Executing; 4b4f2: 2479 0005 bb32 moveal 5bb32 <_Thread_Executing>,%a2 * * Output parameters: NONE */ void _Thread_Handler( void ) { 4b4f8: 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; 4b4fa: 222a 00b4 movel %a2@(180),%d1 _ISR_Set_level(level); 4b4fe: 40c0 movew %sr,%d0 4b500: e189 lsll #8,%d1 4b502: 0280 0000 f8ff andil #63743,%d0 4b508: 8081 orl %d1,%d0 4b50a: 46c0 movew %d0,%sr #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) doneCons = doneConstructors; doneConstructors = 1; 4b50c: 7001 moveq #1,%d0 level = executing->Start.isr_level; _ISR_Set_level(level); #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) doneCons = doneConstructors; 4b50e: 1439 0005 b22c moveb 5b22c ,%d2 doneConstructors = 1; 4b514: 13c0 0005 b22c moveb %d0,5b22c #endif #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && 4b51a: 4aaa 0100 tstl %a2@(256) 4b51e: 6720 beqs 4b540 <_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 ); 4b520: 2079 0005 bafe moveal 5bafe <_Thread_Allocated_fp>,%a0 4b526: b1ca cmpal %a2,%a0 4b528: 6716 beqs 4b540 <_Thread_Handler+0x54> !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) 4b52a: 4a88 tstl %a0 4b52c: 670c beqs 4b53a <_Thread_Handler+0x4e> _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 4b52e: 4868 0100 pea %a0@(256) 4b532: 4eb9 0004 7f8a jsr 47f8a <_CPU_Context_save_fp> 4b538: 588f addql #4,%sp _Thread_Allocated_fp = executing; 4b53a: 23ca 0005 bafe movel %a2,5bafe <_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 ); 4b540: 2f0a movel %a2,%sp@- 4b542: 4eb9 0004 79bc jsr 479bc <_User_extensions_Thread_begin> /* * At this point, the dispatch disable level BETTER be 1. */ _Thread_Enable_dispatch(); 4b548: 4eb9 0004 6c62 jsr 46c62 <_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) */ { 4b54e: 588f addql #4,%sp 4b550: 4a02 tstb %d2 4b552: 6606 bnes 4b55a <_Thread_Handler+0x6e> INIT_NAME (); 4b554: 4eb9 0005 8954 jsr 58954 <_init> } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 4b55a: 4aaa 009e tstl %a2@(158) 4b55e: 6610 bnes 4b570 <_Thread_Handler+0x84> <== NEVER TAKEN executing->Wait.return_argument = (*(Thread_Entry_numeric) executing->Start.entry_point)( 4b560: 2f2a 00a6 movel %a2@(166),%sp@- 4b564: 206a 009a moveal %a2@(154),%a0 4b568: 4e90 jsr %a0@ INIT_NAME (); } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { executing->Wait.return_argument = 4b56a: 588f addql #4,%sp 4b56c: 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 ); 4b570: 2f0a movel %a2,%sp@- 4b572: 4eb9 0004 79f4 jsr 479f4 <_User_extensions_Thread_exitted> _Internal_error_Occurred( 4b578: 4878 0006 pea 6 4b57c: 4878 0001 pea 1 4b580: 42a7 clrl %sp@- 4b582: 4eb9 0004 5f7c jsr 45f7c <_Internal_error_Occurred> 00046d14 <_Thread_Initialize>: Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 46d14: 4e56 ffec linkw %fp,#-20 46d18: 48d7 043c moveml %d2-%d5/%a2,%sp@ 46d1c: 242e 0014 movel %fp@(20),%d2 46d20: 246e 000c moveal %fp@(12),%a2 /* * Allocate and Initialize the stack for this thread. */ #if !defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API) actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); 46d24: 2f02 movel %d2,%sp@- Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 46d26: 262e 0018 movel %fp@(24),%d3 /* * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; 46d2a: 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 ) { 46d2e: 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; 46d32: 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 ) { 46d36: 1a2e 0023 moveb %fp@(35),%d5 /* * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; 46d3a: 42aa 0110 clrl %a2@(272) extensions_area = NULL; the_thread->libc_reent = NULL; 46d3e: 42aa 0104 clrl %a2@(260) /* * Allocate and Initialize the stack for this thread. */ #if !defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API) actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); 46d42: 2f0a movel %a2,%sp@- 46d44: 4eb9 0004 75cc jsr 475cc <_Thread_Stack_Allocate> if ( !actual_stack_size || actual_stack_size < stack_size ) 46d4a: 508f addql #8,%sp 46d4c: 4a80 tstl %d0 46d4e: 6700 015a beqw 46eaa <_Thread_Initialize+0x196> 46d52: b480 cmpl %d0,%d2 46d54: 6200 0154 bhiw 46eaa <_Thread_Initialize+0x196> void *starting_address, size_t size ) { the_stack->area = starting_address; the_stack->size = size; 46d58: 2540 00bc movel %d0,%a2@(188) Stack_Control *the_stack, void *starting_address, size_t size ) { the_stack->area = starting_address; 46d5c: 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 ) { 46d62: 4a03 tstb %d3 46d64: 6604 bnes 46d6a <_Thread_Initialize+0x56> 46d66: 4283 clrl %d3 46d68: 6016 bras 46d80 <_Thread_Initialize+0x6c> fp_area = _Workspace_Allocate( CONTEXT_FP_SIZE ); 46d6a: 4878 001c pea 1c 46d6e: 4eb9 0004 7dbc jsr 47dbc <_Workspace_Allocate> if ( !fp_area ) 46d74: 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 ); 46d76: 2600 movel %d0,%d3 if ( !fp_area ) 46d78: 6606 bnes 46d80 <_Thread_Initialize+0x6c> 46d7a: 4282 clrl %d2 46d7c: 6000 00c6 braw 46e44 <_Thread_Initialize+0x130> #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { 46d80: 2039 0005 bb16 movel 5bb16 <_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; 46d86: 2543 0100 movel %d3,%a2@(256) the_thread->Start.fp_context = fp_area; 46d8a: 2543 00c4 movel %d3,%a2@(196) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 46d8e: 42aa 0050 clrl %a2@(80) the_watchdog->routine = routine; 46d92: 42aa 0064 clrl %a2@(100) the_watchdog->id = id; 46d96: 42aa 0068 clrl %a2@(104) the_watchdog->user_data = user_data; 46d9a: 42aa 006c clrl %a2@(108) #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { 46d9e: 4a80 tstl %d0 46da0: 6604 bnes 46da6 <_Thread_Initialize+0x92> 46da2: 4282 clrl %d2 46da4: 6016 bras 46dbc <_Thread_Initialize+0xa8> extensions_area = _Workspace_Allocate( 46da6: e588 lsll #2,%d0 46da8: 2040 moveal %d0,%a0 46daa: 4868 0004 pea %a0@(4) 46dae: 4eb9 0004 7dbc jsr 47dbc <_Workspace_Allocate> (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) 46db4: 588f addql #4,%sp /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { extensions_area = _Workspace_Allocate( 46db6: 2400 movel %d0,%d2 (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) 46db8: 6700 008a beqw 46e44 <_Thread_Initialize+0x130> goto failed; } the_thread->extensions = (void **) extensions_area; 46dbc: 2542 0114 movel %d2,%a2@(276) * if they are linked to the thread. An extension user may * create the extension long after tasks have been created * so they cannot rely on the thread create user extension * call. */ if ( the_thread->extensions ) { 46dc0: 6718 beqs 46dda <_Thread_Initialize+0xc6> for ( i = 0; i <= _Thread_Maximum_extensions ; i++ ) 46dc2: 2239 0005 bb16 movel 5bb16 <_Thread_Maximum_extensions>,%d1 46dc8: 4280 clrl %d0 46dca: 600a bras 46dd6 <_Thread_Initialize+0xc2> the_thread->extensions[i] = NULL; 46dcc: 206a 0114 moveal %a2@(276),%a0 46dd0: 42b0 0c00 clrl %a0@(00000000,%d0:l:4) * create the extension long after tasks have been created * so they cannot rely on the thread create user extension * call. */ if ( the_thread->extensions ) { for ( i = 0; i <= _Thread_Maximum_extensions ; i++ ) 46dd4: 5280 addql #1,%d0 46dd6: b280 cmpl %d0,%d1 46dd8: 64f2 bccs 46dcc <_Thread_Initialize+0xb8> #if defined(RTEMS_ITRON_API) the_thread->suspend_count = 0; #endif the_thread->real_priority = priority; the_thread->Start.initial_priority = priority; _Thread_Set_priority( the_thread, priority ); 46dda: 2f04 movel %d4,%sp@- case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; 46ddc: 256e 002c 00b4 movel %fp@(44),%a2@(180) the_thread->current_state = STATES_DORMANT; 46de2: 7001 moveq #1,%d0 /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; 46de4: 256e 0024 00ac movel %fp@(36),%a2@(172) the_thread->Start.budget_callout = budget_callout; 46dea: 256e 0028 00b0 movel %fp@(40),%a2@(176) /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; 46df0: 1545 00aa moveb %d5,%a2@(170) #if defined(RTEMS_ITRON_API) the_thread->suspend_count = 0; #endif the_thread->real_priority = priority; the_thread->Start.initial_priority = priority; _Thread_Set_priority( the_thread, priority ); 46df4: 2f0a movel %a2,%sp@- #endif } the_thread->Start.isr_level = isr_level; the_thread->current_state = STATES_DORMANT; 46df6: 2540 0010 movel %d0,%a2@(16) the_thread->Wait.queue = NULL; 46dfa: 42aa 0044 clrl %a2@(68) the_thread->resource_count = 0; 46dfe: 42aa 001c clrl %a2@(28) #if defined(RTEMS_ITRON_API) the_thread->suspend_count = 0; #endif the_thread->real_priority = priority; 46e02: 2544 0018 movel %d4,%a2@(24) the_thread->Start.initial_priority = priority; 46e06: 2544 00b8 movel %d4,%a2@(184) _Thread_Set_priority( the_thread, priority ); 46e0a: 4eb9 0004 73f8 jsr 473f8 <_Thread_Set_priority> #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 46e10: 206e 0008 moveal %fp@(8),%a0 46e14: 4280 clrl %d0 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 46e16: 256e 0030 000c movel %fp@(48),%a2@(12) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 46e1c: 2068 0018 moveal %a0@(24),%a0 46e20: 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 ); 46e24: 42aa 0082 clrl %a2@(130) 46e28: 218a 0c00 movel %a2,%a0@(00000000,%d0:l:4) 46e2c: 42aa 0086 clrl %a2@(134) * enabled when we get here. We want to be able to run the * user extensions with dispatching enabled. The Allocator * Mutex provides sufficient protection to let the user extensions * run safely. */ extension_status = _User_extensions_Thread_create( the_thread ); 46e30: 2f0a movel %a2,%sp@- 46e32: 4eb9 0004 7a78 jsr 47a78 <_User_extensions_Thread_create> if ( extension_status ) 46e38: 4fef 000c lea %sp@(12),%sp 46e3c: 4a00 tstb %d0 46e3e: 6704 beqs 46e44 <_Thread_Initialize+0x130> 46e40: 7001 moveq #1,%d0 46e42: 6068 bras 46eac <_Thread_Initialize+0x198> return true; failed: if ( the_thread->libc_reent ) 46e44: 202a 0104 movel %a2@(260),%d0 46e48: 670a beqs 46e54 <_Thread_Initialize+0x140> _Workspace_Free( the_thread->libc_reent ); 46e4a: 2f00 movel %d0,%sp@- 46e4c: 4eb9 0004 7dd8 jsr 47dd8 <_Workspace_Free> 46e52: 588f addql #4,%sp for ( i=0 ; i <= THREAD_API_LAST ; i++ ) if ( the_thread->API_Extensions[i] ) 46e54: 202a 0108 movel %a2@(264),%d0 46e58: 670a beqs 46e64 <_Thread_Initialize+0x150> _Workspace_Free( the_thread->API_Extensions[i] ); 46e5a: 2f00 movel %d0,%sp@- 46e5c: 4eb9 0004 7dd8 jsr 47dd8 <_Workspace_Free> 46e62: 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] ) 46e64: 202a 010c movel %a2@(268),%d0 46e68: 670a beqs 46e74 <_Thread_Initialize+0x160> <== ALWAYS TAKEN _Workspace_Free( the_thread->API_Extensions[i] ); 46e6a: 2f00 movel %d0,%sp@- <== NOT EXECUTED 46e6c: 4eb9 0004 7dd8 jsr 47dd8 <_Workspace_Free> <== NOT EXECUTED 46e72: 588f addql #4,%sp <== NOT EXECUTED 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] ) 46e74: 202a 0110 movel %a2@(272),%d0 46e78: 670a beqs 46e84 <_Thread_Initialize+0x170> <== ALWAYS TAKEN _Workspace_Free( the_thread->API_Extensions[i] ); 46e7a: 2f00 movel %d0,%sp@- <== NOT EXECUTED 46e7c: 4eb9 0004 7dd8 jsr 47dd8 <_Workspace_Free> <== NOT EXECUTED 46e82: 588f addql #4,%sp <== NOT EXECUTED if ( extensions_area ) 46e84: 4a82 tstl %d2 46e86: 670a beqs 46e92 <_Thread_Initialize+0x17e> (void) _Workspace_Free( extensions_area ); 46e88: 2f02 movel %d2,%sp@- 46e8a: 4eb9 0004 7dd8 jsr 47dd8 <_Workspace_Free> 46e90: 588f addql #4,%sp #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( fp_area ) 46e92: 4a83 tstl %d3 46e94: 670a beqs 46ea0 <_Thread_Initialize+0x18c> (void) _Workspace_Free( fp_area ); 46e96: 2f03 movel %d3,%sp@- 46e98: 4eb9 0004 7dd8 jsr 47dd8 <_Workspace_Free> 46e9e: 588f addql #4,%sp #endif _Thread_Stack_Free( the_thread ); 46ea0: 2f0a movel %a2,%sp@- 46ea2: 4eb9 0004 7618 jsr 47618 <_Thread_Stack_Free> return false; 46ea8: 588f addql #4,%sp 46eaa: 4200 clrb %d0 } 46eac: 4cee 043c ffec moveml %fp@(-20),%d2-%d5/%a2 46eb2: 4e5e unlk %fp ... 0004a1d8 <_Thread_Reset_timeslice>: * ready chain * select heir */ void _Thread_Reset_timeslice( void ) { 4a1d8: 4e56 fff4 linkw %fp,#-12 ISR_Level level; Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; 4a1dc: 2079 0005 bb32 moveal 5bb32 <_Thread_Executing>,%a0 * ready chain * select heir */ void _Thread_Reset_timeslice( void ) { 4a1e2: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; ready = executing->ready; _ISR_Disable( level ); 4a1e6: 243c 0000 0700 movel #1792,%d2 4a1ec: 2202 movel %d2,%d1 ISR_Level level; Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; ready = executing->ready; 4a1ee: 2268 008a moveal %a0@(138),%a1 _ISR_Disable( level ); 4a1f2: 40c0 movew %sr,%d0 4a1f4: 8280 orl %d0,%d1 4a1f6: 46c1 movew %d1,%sr if ( _Chain_Has_only_one_node( ready ) ) { 4a1f8: 2229 0008 movel %a1@(8),%d1 4a1fc: b291 cmpl %a1@,%d1 4a1fe: 6604 bnes 4a204 <_Thread_Reset_timeslice+0x2c> _ISR_Enable( level ); 4a200: 46c0 movew %d0,%sr return; 4a202: 6040 bras 4a244 <_Thread_Reset_timeslice+0x6c> ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 4a204: 2450 moveal %a0@,%a2 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 4a206: 2209 movel %a1,%d1 4a208: 5881 addql #4,%d1 { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 4a20a: 2668 0004 moveal %a0@(4),%a3 next->previous = previous; previous->next = next; 4a20e: 268a movel %a2,%a3@ Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 4a210: 254b 0004 movel %a3,%a2@(4) Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 4a214: 2081 movel %d1,%a0@ old_last_node = the_chain->last; 4a216: 2469 0008 moveal %a1@(8),%a2 the_chain->last = the_node; 4a21a: 2348 0008 movel %a0,%a1@(8) old_last_node->next = the_node; the_node->previous = old_last_node; 4a21e: 214a 0004 movel %a2,%a0@(4) Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; the_chain->last = the_node; old_last_node->next = the_node; 4a222: 2488 movel %a0,%a2@ } _Chain_Extract_unprotected( &executing->Object.Node ); _Chain_Append_unprotected( ready, &executing->Object.Node ); _ISR_Flash( level ); 4a224: 2202 movel %d2,%d1 4a226: 46c0 movew %d0,%sr 4a228: 8280 orl %d0,%d1 4a22a: 46c1 movew %d1,%sr if ( _Thread_Is_heir( executing ) ) 4a22c: b1f9 0005 bb06 cmpal 5bb06 <_Thread_Heir>,%a0 4a232: 6606 bnes 4a23a <_Thread_Reset_timeslice+0x62> <== NEVER TAKEN _Thread_Heir = (Thread_Control *) ready->first; 4a234: 23d1 0005 bb06 movel %a1@,5bb06 <_Thread_Heir> _Context_Switch_necessary = true; 4a23a: 7201 moveq #1,%d1 4a23c: 13c1 0005 bb42 moveb %d1,5bb42 <_Context_Switch_necessary> _ISR_Enable( level ); 4a242: 46c0 movew %d0,%sr } 4a244: 4cd7 0c04 moveml %sp@,%d2/%a2-%a3 4a248: 4e5e unlk %fp <== NOT EXECUTED 00047b6c <_Thread_Restart>: Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { if ( !_States_Is_dormant( the_thread->current_state ) ) { 47b6c: 7001 moveq #1,%d0 bool _Thread_Restart( Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { 47b6e: 4e56 0000 linkw %fp,#0 47b72: 2f0a movel %a2,%sp@- 47b74: 246e 0008 moveal %fp@(8),%a2 if ( !_States_Is_dormant( the_thread->current_state ) ) { 47b78: c0aa 0010 andl %a2@(16),%d0 47b7c: 4a00 tstb %d0 47b7e: 6704 beqs 47b84 <_Thread_Restart+0x18> 47b80: 4200 clrb %d0 47b82: 6064 bras 47be8 <_Thread_Restart+0x7c> _Thread_Set_transient( the_thread ); 47b84: 2f0a movel %a2,%sp@- 47b86: 4eb9 0004 7d48 jsr 47d48 <_Thread_Set_transient> _Thread_Reset( the_thread, pointer_argument, numeric_argument ); 47b8c: 2f2e 0010 movel %fp@(16),%sp@- 47b90: 2f2e 000c movel %fp@(12),%sp@- 47b94: 2f0a movel %a2,%sp@- 47b96: 4eb9 0004 aa10 jsr 4aa10 <_Thread_Reset> _Thread_Load_environment( the_thread ); 47b9c: 2f0a movel %a2,%sp@- 47b9e: 4eb9 0004 a6ac jsr 4a6ac <_Thread_Load_environment> _Thread_Ready( the_thread ); 47ba4: 2f0a movel %a2,%sp@- 47ba6: 4eb9 0004 a950 jsr 4a950 <_Thread_Ready> _User_extensions_Thread_restart( the_thread ); 47bac: 2f0a movel %a2,%sp@- 47bae: 4eb9 0004 82f4 jsr 482f4 <_User_extensions_Thread_restart> if ( _Thread_Is_executing ( the_thread ) ) 47bb4: 4fef 001c lea %sp@(28),%sp 47bb8: b5f9 0005 c61a cmpal 5c61a <_Thread_Executing>,%a2 47bbe: 6626 bnes 47be6 <_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 ) 47bc0: 4aaa 0100 tstl %a2@(256) 47bc4: 670c beqs 47bd2 <_Thread_Restart+0x66> _Context_Restore_fp( &_Thread_Executing->fp_context ); 47bc6: 486a 0100 pea %a2@(256) 47bca: 4eb9 0004 87e4 jsr 487e4 <_CPU_Context_restore_fp> 47bd0: 588f addql #4,%sp #endif _CPU_Context_Restart_self( &_Thread_Executing->Registers ); 47bd2: 2079 0005 c61a moveal 5c61a <_Thread_Executing>,%a0 47bd8: 41e8 00cc lea %a0@(204),%a0 47bdc: 2f08 movel %a0,%sp@- 47bde: 4eb9 0004 86a2 jsr 486a2 <_CPU_Context_Restart_self> 47be4: 588f addql #4,%sp <== NOT EXECUTED 47be6: 7001 moveq #1,%d0 return true; } return false; } 47be8: 246e fffc moveal %fp@(-4),%a2 47bec: 4e5e unlk %fp <== NOT EXECUTED 0004ac20 <_Thread_Resume>: void _Thread_Resume( Thread_Control *the_thread, bool force ) { 4ac20: 4e56 ffec linkw %fp,#-20 4ac24: 206e 0008 moveal %fp@(8),%a0 4ac28: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ ISR_Level level; States_Control current_state; _ISR_Disable( level ); 4ac2c: 243c 0000 0700 movel #1792,%d2 4ac32: 2002 movel %d2,%d0 4ac34: 40c1 movew %sr,%d1 4ac36: 8081 orl %d1,%d0 4ac38: 46c0 movew %d0,%sr _ISR_Enable( level ); return; } #endif current_state = the_thread->current_state; 4ac3a: 2028 0010 movel %a0@(16),%d0 if ( current_state & STATES_SUSPENDED ) { 4ac3e: 0800 0001 btst #1,%d0 4ac42: 6778 beqs 4acbc <_Thread_Resume+0x9c> <== NEVER TAKEN 4ac44: 76fd moveq #-3,%d3 4ac46: c083 andl %d3,%d0 current_state = 4ac48: 2140 0010 movel %d0,%a0@(16) the_thread->current_state = _States_Clear(STATES_SUSPENDED, current_state); if ( _States_Is_ready( current_state ) ) { 4ac4c: 666e bnes 4acbc <_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; 4ac4e: 2668 008e moveal %a0@(142),%a3 4ac52: 3028 0094 movew %a0@(148),%d0 4ac56: 3613 movew %a3@,%d3 _Priority_Add_to_bit_map( &the_thread->Priority_map ); _Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node); 4ac58: 2268 008a moveal %a0@(138),%a1 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 4ac5c: 2809 movel %a1,%d4 4ac5e: 5884 addql #4,%d4 4ac60: 8083 orl %d3,%d0 4ac62: 2084 movel %d4,%a0@ old_last_node = the_chain->last; 4ac64: 2469 0008 moveal %a1@(8),%a2 4ac68: 3680 movew %d0,%a3@ the_chain->last = the_node; 4ac6a: 2348 0008 movel %a0,%a1@(8) _Priority_Major_bit_map |= the_priority_map->ready_major; 4ac6e: 3039 0006 0cd0 movew 60cd0 <_Priority_Major_bit_map>,%d0 4ac74: 3628 0092 movew %a0@(146),%d3 old_last_node->next = the_node; the_node->previous = old_last_node; 4ac78: 214a 0004 movel %a2,%a0@(4) 4ac7c: 8083 orl %d3,%d0 Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; the_chain->last = the_node; old_last_node->next = the_node; 4ac7e: 2488 movel %a0,%a2@ 4ac80: 33c0 0006 0cd0 movew %d0,60cd0 <_Priority_Major_bit_map> _ISR_Flash( level ); 4ac86: 2002 movel %d2,%d0 4ac88: 46c1 movew %d1,%sr 4ac8a: 8081 orl %d1,%d0 4ac8c: 46c0 movew %d0,%sr if ( the_thread->current_priority < _Thread_Heir->current_priority ) { 4ac8e: 2028 0014 movel %a0@(20),%d0 4ac92: 2279 0006 0cae moveal 60cae <_Thread_Heir>,%a1 4ac98: b0a9 0014 cmpl %a1@(20),%d0 4ac9c: 641e bccs 4acbc <_Thread_Resume+0x9c> _Thread_Heir = the_thread; 4ac9e: 23c8 0006 0cae movel %a0,60cae <_Thread_Heir> if ( _Thread_Executing->is_preemptible || 4aca4: 2079 0006 0cda moveal 60cda <_Thread_Executing>,%a0 4acaa: 4a28 0075 tstb %a0@(117) 4acae: 6604 bnes 4acb4 <_Thread_Resume+0x94> 4acb0: 4a80 tstl %d0 4acb2: 6608 bnes 4acbc <_Thread_Resume+0x9c> <== ALWAYS TAKEN the_thread->current_priority == 0 ) _Context_Switch_necessary = true; 4acb4: 7001 moveq #1,%d0 4acb6: 13c0 0006 0cea moveb %d0,60cea <_Context_Switch_necessary> } } } _ISR_Enable( level ); 4acbc: 46c1 movew %d1,%sr } 4acbe: 4cd7 0c1c moveml %sp@,%d2-%d4/%a2-%a3 4acc2: 4e5e unlk %fp ... 00047618 <_Thread_Stack_Free>: */ void _Thread_Stack_Free( Thread_Control *the_thread ) { 47618: 4e56 0000 linkw %fp,#0 4761c: 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 ) 47620: 2279 0005 a368 moveal 5a368 ,%a1 47626: 4a89 tstl %a1 47628: 670a beqs 47634 <_Thread_Stack_Free+0x1c> (*Configuration.stack_free_hook)( the_thread->Start.Initial_stack.area ); 4762a: 2d68 00c0 0008 movel %a0@(192),%fp@(8) else _Workspace_Free( the_thread->Start.Initial_stack.area ); } 47630: 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 ); 47632: 4ed1 jmp %a1@ else _Workspace_Free( the_thread->Start.Initial_stack.area ); 47634: 2d68 00c0 0008 movel %a0@(192),%fp@(8) } 4763a: 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 ); 4763c: 4ef9 0004 7dd8 jmp 47dd8 <_Workspace_Free> ... 00047810 <_Thread_Yield_processor>: * ready chain * select heir */ void _Thread_Yield_processor( void ) { 47810: 4e56 fff4 linkw %fp,#-12 ISR_Level level; Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; 47814: 2079 0005 bb32 moveal 5bb32 <_Thread_Executing>,%a0 * ready chain * select heir */ void _Thread_Yield_processor( void ) { 4781a: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; ready = executing->ready; _ISR_Disable( level ); 4781e: 243c 0000 0700 movel #1792,%d2 47824: 2002 movel %d2,%d0 ISR_Level level; Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; ready = executing->ready; 47826: 2268 008a moveal %a0@(138),%a1 _ISR_Disable( level ); 4782a: 40c1 movew %sr,%d1 4782c: 8081 orl %d1,%d0 4782e: 46c0 movew %d0,%sr if ( !_Chain_Has_only_one_node( ready ) ) { 47830: 2029 0008 movel %a1@(8),%d0 47834: b091 cmpl %a1@,%d0 47836: 6738 beqs 47870 <_Thread_Yield_processor+0x60> ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 47838: 2450 moveal %a0@,%a2 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 4783a: 2009 movel %a1,%d0 4783c: 5880 addql #4,%d0 { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 4783e: 2668 0004 moveal %a0@(4),%a3 next->previous = previous; previous->next = next; 47842: 268a movel %a2,%a3@ Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 47844: 254b 0004 movel %a3,%a2@(4) Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 47848: 2080 movel %d0,%a0@ old_last_node = the_chain->last; 4784a: 2469 0008 moveal %a1@(8),%a2 the_chain->last = the_node; 4784e: 2348 0008 movel %a0,%a1@(8) old_last_node->next = the_node; the_node->previous = old_last_node; 47852: 214a 0004 movel %a2,%a0@(4) Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; the_chain->last = the_node; old_last_node->next = the_node; 47856: 2488 movel %a0,%a2@ _Chain_Extract_unprotected( &executing->Object.Node ); _Chain_Append_unprotected( ready, &executing->Object.Node ); _ISR_Flash( level ); 47858: 2002 movel %d2,%d0 4785a: 46c1 movew %d1,%sr 4785c: 8081 orl %d1,%d0 4785e: 46c0 movew %d0,%sr if ( _Thread_Is_heir( executing ) ) 47860: b1f9 0005 bb06 cmpal 5bb06 <_Thread_Heir>,%a0 47866: 6610 bnes 47878 <_Thread_Yield_processor+0x68> <== NEVER TAKEN _Thread_Heir = (Thread_Control *) ready->first; 47868: 23d1 0005 bb06 movel %a1@,5bb06 <_Thread_Heir> 4786e: 6008 bras 47878 <_Thread_Yield_processor+0x68> _Context_Switch_necessary = true; } else if ( !_Thread_Is_heir( executing ) ) 47870: b1f9 0005 bb06 cmpal 5bb06 <_Thread_Heir>,%a0 47876: 6708 beqs 47880 <_Thread_Yield_processor+0x70> <== ALWAYS TAKEN _Context_Switch_necessary = true; 47878: 7001 moveq #1,%d0 4787a: 13c0 0005 bb42 moveb %d0,5bb42 <_Context_Switch_necessary> _ISR_Enable( level ); 47880: 46c1 movew %d1,%sr } 47882: 4cd7 0c04 moveml %sp@,%d2/%a2-%a3 47886: 4e5e unlk %fp ... 00046718 <_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 ) ) { 46718: 7202 moveq #2,%d1 Thread_blocking_operation_States sync_state __attribute__((unused)), #endif Thread_Control *the_thread, ISR_Level level ) { 4671a: 4e56 0000 linkw %fp,#0 4671e: 202e 0010 movel %fp@(16),%d0 46722: 2f0a movel %a2,%sp@- 46724: 246e 000c moveal %fp@(12),%a2 #endif /* * The thread is not waiting on anything after this completes. */ the_thread->Wait.queue = NULL; 46728: 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 ) ) { 4672c: b2aa 0050 cmpl %a2@(80),%d1 46730: 6618 bnes 4674a <_Thread_blocking_operation_Cancel+0x32> RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 46732: 123c 0003 moveb #3,%d1 46736: 2541 0050 movel %d1,%a2@(80) _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 4673a: 46c0 movew %d0,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 4673c: 486a 0048 pea %a2@(72) 46740: 4eb9 0004 7c90 jsr 47c90 <_Watchdog_Remove> 46746: 588f addql #4,%sp 46748: 6002 bras 4674c <_Thread_blocking_operation_Cancel+0x34> } else _ISR_Enable( level ); 4674a: 46c0 movew %d0,%sr RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 4674c: 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 } 46750: 246e fffc moveal %fp@(-4),%a2 46754: 203c 1003 fff8 movel #268697592,%d0 4675a: 2d40 000c movel %d0,%fp@(12) 4675e: 4e5e unlk %fp 46760: 4ef9 0004 68a8 jmp 468a8 <_Thread_Clear_state> ... 0004716c <_Thread_queue_Enqueue_priority>: Thread_blocking_operation_States _Thread_queue_Enqueue_priority ( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, ISR_Level *level_p ) { 4716c: 4e56 ffe4 linkw %fp,#-28 47170: 206e 000c moveal %fp@(12),%a0 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 47174: 43e8 003c lea %a0@(60),%a1 Priority_Control priority; States_Control block_state; _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; 47178: 2028 0014 movel %a0@(20),%d0 Thread_blocking_operation_States _Thread_queue_Enqueue_priority ( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, ISR_Level *level_p ) { 4717c: 48d7 0c7c moveml %d2-%d6/%a2-%a3,%sp@ _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; 47180: 2400 movel %d0,%d2 47182: ec8a lsrl #6,%d2 47184: 2202 movel %d2,%d1 return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); 47186: 283c 0000 0700 movel #1792,%d4 _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; 4718c: e989 lsll #4,%d1 4718e: e58a lsll #2,%d2 Thread_blocking_operation_States _Thread_queue_Enqueue_priority ( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, ISR_Level *level_p ) { 47190: 246e 0008 moveal %fp@(8),%a2 _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; 47194: 9282 subl %d2,%d1 47196: 47f2 1800 lea %a2@(00000000,%d1:l),%a3 4719a: 2149 0038 movel %a1,%a0@(56) the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 4719e: 43e8 0038 lea %a0@(56),%a1 block_state = the_thread_queue->state; 471a2: 2a2a 0038 movel %a2@(56),%d5 471a6: 2149 0040 movel %a1,%a0@(64) RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 471aa: 42a8 003c clrl %a0@(60) if ( _Thread_queue_Is_reverse_search( priority ) ) 471ae: 0800 0005 btst #5,%d0 471b2: 6660 bnes 47214 <_Thread_queue_Enqueue_priority+0xa8> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 471b4: 2c0b movel %a3,%d6 471b6: 5886 addql #4,%d6 goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); 471b8: 2404 movel %d4,%d2 471ba: 40c1 movew %sr,%d1 471bc: 8481 orl %d1,%d2 471be: 46c2 movew %d2,%sr search_thread = (Thread_Control *) header->first; 471c0: 2253 moveal %a3@,%a1 471c2: 76ff moveq #-1,%d3 while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 471c4: 601e bras 471e4 <_Thread_queue_Enqueue_priority+0x78> search_priority = search_thread->current_priority; 471c6: 2629 0014 movel %a1@(20),%d3 if ( priority <= search_priority ) 471ca: b680 cmpl %d0,%d3 471cc: 641a bccs 471e8 <_Thread_queue_Enqueue_priority+0x7c> break; search_priority = search_thread->current_priority; if ( priority <= search_priority ) break; #endif _ISR_Flash( level ); 471ce: 2404 movel %d4,%d2 471d0: 46c1 movew %d1,%sr 471d2: 8481 orl %d1,%d2 471d4: 46c2 movew %d2,%sr if ( !_States_Are_set( search_thread->current_state, block_state) ) { 471d6: 2405 movel %d5,%d2 471d8: c4a9 0010 andl %a1@(16),%d2 471dc: 6604 bnes 471e2 <_Thread_queue_Enqueue_priority+0x76><== ALWAYS TAKEN _ISR_Enable( level ); 471de: 46c1 movew %d1,%sr <== NOT EXECUTED goto restart_forward_search; 471e0: 60d6 bras 471b8 <_Thread_queue_Enqueue_priority+0x4c><== NOT EXECUTED } search_thread = (Thread_Control *)search_thread->Object.Node.next; 471e2: 2251 moveal %a1@,%a1 restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); search_thread = (Thread_Control *) header->first; while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 471e4: bc89 cmpl %a1,%d6 471e6: 66de bnes 471c6 <_Thread_queue_Enqueue_priority+0x5a> 471e8: 2401 movel %d1,%d2 } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 471ea: 7801 moveq #1,%d4 471ec: b8aa 0030 cmpl %a2@(48),%d4 471f0: 6600 00a4 bnew 47296 <_Thread_queue_Enqueue_priority+0x12a> THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 471f4: 42aa 0030 clrl %a2@(48) if ( priority == search_priority ) 471f8: b680 cmpl %d0,%d3 471fa: 677e beqs 4727a <_Thread_queue_Enqueue_priority+0x10e> goto equal_priority; search_node = (Chain_Node *) search_thread; previous_node = search_node->previous; 471fc: 2669 0004 moveal %a1@(4),%a3 the_node = (Chain_Node *) the_thread; the_node->next = search_node; 47200: 2089 movel %a1,%a0@ the_node->previous = previous_node; 47202: 214b 0004 movel %a3,%a0@(4) previous_node->next = the_node; search_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 47206: 214a 0044 movel %a2,%a0@(68) previous_node = search_node->previous; the_node = (Chain_Node *) the_thread; the_node->next = search_node; the_node->previous = previous_node; previous_node->next = the_node; 4720a: 2688 movel %a0,%a3@ search_node->previous = the_node; 4720c: 2348 0004 movel %a0,%a1@(4) the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 47210: 46c1 movew %d1,%sr 47212: 6062 bras 47276 <_Thread_queue_Enqueue_priority+0x10a> return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 47214: 4283 clrl %d3 47216: 1639 0005 a342 moveb 5a342 ,%d3 _ISR_Disable( level ); 4721c: 2404 movel %d4,%d2 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 4721e: 5283 addql #1,%d3 _ISR_Disable( level ); 47220: 40c1 movew %sr,%d1 47222: 8481 orl %d1,%d2 47224: 46c2 movew %d2,%sr search_thread = (Thread_Control *) header->last; 47226: 226b 0008 moveal %a3@(8),%a1 while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 4722a: 6020 bras 4724c <_Thread_queue_Enqueue_priority+0xe0> search_priority = search_thread->current_priority; 4722c: 2629 0014 movel %a1@(20),%d3 if ( priority >= search_priority ) 47230: b680 cmpl %d0,%d3 47232: 631c blss 47250 <_Thread_queue_Enqueue_priority+0xe4> break; search_priority = search_thread->current_priority; if ( priority >= search_priority ) break; #endif _ISR_Flash( level ); 47234: 2404 movel %d4,%d2 47236: 46c1 movew %d1,%sr 47238: 8481 orl %d1,%d2 4723a: 46c2 movew %d2,%sr if ( !_States_Are_set( search_thread->current_state, block_state) ) { 4723c: 2405 movel %d5,%d2 4723e: c4a9 0010 andl %a1@(16),%d2 47242: 6604 bnes 47248 <_Thread_queue_Enqueue_priority+0xdc> _ISR_Enable( level ); 47244: 46c1 movew %d1,%sr goto restart_reverse_search; 47246: 60cc bras 47214 <_Thread_queue_Enqueue_priority+0xa8> } search_thread = (Thread_Control *) 47248: 2269 0004 moveal %a1@(4),%a1 restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); search_thread = (Thread_Control *) header->last; while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 4724c: b7c9 cmpal %a1,%a3 4724e: 66dc bnes 4722c <_Thread_queue_Enqueue_priority+0xc0> 47250: 2401 movel %d1,%d2 } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 47252: 7801 moveq #1,%d4 47254: b8aa 0030 cmpl %a2@(48),%d4 47258: 663c bnes 47296 <_Thread_queue_Enqueue_priority+0x12a> THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 4725a: 42aa 0030 clrl %a2@(48) if ( priority == search_priority ) 4725e: b680 cmpl %d0,%d3 47260: 6718 beqs 4727a <_Thread_queue_Enqueue_priority+0x10e> goto equal_priority; search_node = (Chain_Node *) search_thread; next_node = search_node->next; 47262: 2651 moveal %a1@,%a3 the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; 47264: 2149 0004 movel %a1,%a0@(4) search_node = (Chain_Node *) search_thread; next_node = search_node->next; the_node = (Chain_Node *) the_thread; the_node->next = next_node; 47268: 208b movel %a3,%a0@ the_node->previous = search_node; search_node->next = the_node; next_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 4726a: 214a 0044 movel %a2,%a0@(68) next_node = search_node->next; the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; search_node->next = the_node; 4726e: 2288 movel %a0,%a1@ next_node->previous = the_node; 47270: 2748 0004 movel %a0,%a3@(4) the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 47274: 46c1 movew %d1,%sr 47276: 7001 moveq #1,%d0 return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 47278: 6026 bras 472a0 <_Thread_queue_Enqueue_priority+0x134> 4727a: 43e9 003c lea %a1@(60),%a1 equal_priority: /* add at end of priority group */ search_node = _Chain_Tail( &search_thread->Wait.Block2n ); previous_node = search_node->previous; 4727e: 2669 0004 moveal %a1@(4),%a3 the_node = (Chain_Node *) the_thread; the_node->next = search_node; 47282: 2089 movel %a1,%a0@ the_node->previous = previous_node; 47284: 214b 0004 movel %a3,%a0@(4) previous_node->next = the_node; search_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 47288: 214a 0044 movel %a2,%a0@(68) previous_node = search_node->previous; the_node = (Chain_Node *) the_thread; the_node->next = search_node; the_node->previous = previous_node; previous_node->next = the_node; 4728c: 2688 movel %a0,%a3@ search_node->previous = the_node; 4728e: 2348 0004 movel %a0,%a1@(4) the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 47292: 46c2 movew %d2,%sr 47294: 60e0 bras 47276 <_Thread_queue_Enqueue_priority+0x10a> * For example, the blocking thread could have been given * the mutex by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ *level_p = level; 47296: 206e 0010 moveal %fp@(16),%a0 return the_thread_queue->sync_state; 4729a: 202a 0030 movel %a2@(48),%d0 * For example, the blocking thread could have been given * the mutex by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ *level_p = level; 4729e: 2082 movel %d2,%a0@ return the_thread_queue->sync_state; } 472a0: 4cd7 0c7c moveml %sp@,%d2-%d6/%a2-%a3 472a4: 4e5e unlk %fp <== NOT EXECUTED 0004b588 <_Thread_queue_Extract_fifo>: Thread_Control *the_thread ) { ISR_Level level; _ISR_Disable( level ); 4b588: 223c 0000 0700 movel #1792,%d1 void _Thread_queue_Extract_fifo( Thread_queue_Control *the_thread_queue __attribute__((unused)), Thread_Control *the_thread ) { 4b58e: 4e56 0000 linkw %fp,#0 4b592: 2f0a movel %a2,%sp@- 4b594: 246e 000c moveal %fp@(12),%a2 ISR_Level level; _ISR_Disable( level ); 4b598: 40c0 movew %sr,%d0 4b59a: 8280 orl %d0,%d1 4b59c: 46c1 movew %d1,%sr if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 4b59e: 222a 0010 movel %a2@(16),%d1 4b5a2: 0281 0003 bee0 andil #245472,%d1 4b5a8: 660a bnes 4b5b4 <_Thread_queue_Extract_fifo+0x2c> _ISR_Enable( level ); 4b5aa: 46c0 movew %d0,%sr #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); #endif } 4b5ac: 246e fffc moveal %fp@(-4),%a2 4b5b0: 4e5e unlk %fp 4b5b2: 4e75 rts ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 4b5b4: 2052 moveal %a2@,%a0 _Chain_Extract_unprotected( &the_thread->Object.Node ); the_thread->Wait.queue = NULL; if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 4b5b6: 7202 moveq #2,%d1 previous = the_node->previous; 4b5b8: 226a 0004 moveal %a2@(4),%a1 return; } _Chain_Extract_unprotected( &the_thread->Object.Node ); the_thread->Wait.queue = NULL; 4b5bc: 42aa 0044 clrl %a2@(68) next->previous = previous; previous->next = next; 4b5c0: 2288 movel %a0,%a1@ Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 4b5c2: 2149 0004 movel %a1,%a0@(4) if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 4b5c6: b2aa 0050 cmpl %a2@(80),%d1 4b5ca: 6704 beqs 4b5d0 <_Thread_queue_Extract_fifo+0x48> _ISR_Enable( level ); 4b5cc: 46c0 movew %d0,%sr 4b5ce: 6014 bras 4b5e4 <_Thread_queue_Extract_fifo+0x5c> 4b5d0: 7203 moveq #3,%d1 4b5d2: 2541 0050 movel %d1,%a2@(80) } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 4b5d6: 46c0 movew %d0,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 4b5d8: 486a 0048 pea %a2@(72) 4b5dc: 4eb9 0004 7c90 jsr 47c90 <_Watchdog_Remove> 4b5e2: 588f addql #4,%sp RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 4b5e4: 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 } 4b5e8: 246e fffc moveal %fp@(-4),%a2 4b5ec: 203c 1003 fff8 movel #268697592,%d0 4b5f2: 2d40 000c movel %d0,%fp@(12) 4b5f6: 4e5e unlk %fp 4b5f8: 4ef9 0004 68a8 jmp 468a8 <_Thread_Clear_state> ... 0004a0d0 <_Thread_queue_Process_timeout>: #include void _Thread_queue_Process_timeout( Thread_Control *the_thread ) { 4a0d0: 4e56 0000 linkw %fp,#0 4a0d4: 206e 0008 moveal %fp@(8),%a0 Thread_queue_Control *the_thread_queue = the_thread->Wait.queue; 4a0d8: 2268 0044 moveal %a0@(68),%a1 * If it is not satisfied, then it is "nothing happened" and * this is the "timeout" transition. After a request is satisfied, * a timeout is not allowed to occur. */ if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SYNCHRONIZED && 4a0dc: 2029 0030 movel %a1@(48),%d0 4a0e0: 671c beqs 4a0fe <_Thread_queue_Process_timeout+0x2e> 4a0e2: b1f9 0005 bb32 cmpal 5bb32 <_Thread_Executing>,%a0 4a0e8: 6614 bnes 4a0fe <_Thread_queue_Process_timeout+0x2e><== NEVER TAKEN _Thread_Is_executing( the_thread ) ) { if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) { 4a0ea: 7203 moveq #3,%d1 4a0ec: b280 cmpl %d0,%d1 4a0ee: 6722 beqs 4a112 <_Thread_queue_Process_timeout+0x42> the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 4a0f0: 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; 4a0f2: 2169 003c 0034 movel %a1@(60),%a0@(52) the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 4a0f8: 2340 0030 movel %d0,%a1@(48) 4a0fc: 6014 bras 4a112 <_Thread_queue_Process_timeout+0x42> } } else { the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; 4a0fe: 2169 003c 0034 movel %a1@(60),%a0@(52) _Thread_queue_Extract( the_thread->Wait.queue, the_thread ); 4a104: 2f08 movel %a0,%sp@- 4a106: 2f28 0044 movel %a0@(68),%sp@- 4a10a: 4eb9 0004 9fcc jsr 49fcc <_Thread_queue_Extract> 4a110: 508f addql #8,%sp } } 4a112: 4e5e unlk %fp ... 0004735c <_Thread_queue_Requeue>: void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { 4735c: 4e56 fff0 linkw %fp,#-16 47360: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 47364: 246e 0008 moveal %fp@(8),%a2 47368: 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 ) 4736c: 4a8a tstl %a2 4736e: 6746 beqs 473b6 <_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 ) { 47370: 7001 moveq #1,%d0 47372: b0aa 0034 cmpl %a2@(52),%d0 47376: 663e bnes 473b6 <_Thread_queue_Requeue+0x5a> <== NEVER TAKEN Thread_queue_Control *tq = the_thread_queue; ISR_Level level; ISR_Level level_ignored; _ISR_Disable( level ); 47378: 303c 0700 movew #1792,%d0 4737c: 40c2 movew %sr,%d2 4737e: 8082 orl %d2,%d0 47380: 46c0 movew %d0,%sr if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 47382: 202b 0010 movel %a3@(16),%d0 47386: 0280 0003 bee0 andil #245472,%d0 4738c: 6726 beqs 473b4 <_Thread_queue_Requeue+0x58> <== NEVER TAKEN _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); 4738e: 4878 0001 pea 1 47392: 7001 moveq #1,%d0 47394: 2f0b movel %a3,%sp@- 47396: 2540 0030 movel %d0,%a2@(48) 4739a: 2f0a movel %a2,%sp@- 4739c: 4eb9 0004 a004 jsr 4a004 <_Thread_queue_Extract_priority_helper> (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); 473a2: 486e fffc pea %fp@(-4) 473a6: 2f0b movel %a3,%sp@- 473a8: 2f0a movel %a2,%sp@- 473aa: 4eb9 0004 716c jsr 4716c <_Thread_queue_Enqueue_priority> 473b0: 4fef 0018 lea %sp@(24),%sp } _ISR_Enable( level ); 473b4: 46c2 movew %d2,%sr } } 473b6: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3 473bc: 4e5e unlk %fp <== NOT EXECUTED 000473c0 <_Thread_queue_Timeout>: void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { 473c0: 4e56 fffc linkw %fp,#-4 Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 473c4: 486e fffc pea %fp@(-4) 473c8: 2f2e 0008 movel %fp@(8),%sp@- 473cc: 4eb9 0004 6c88 jsr 46c88 <_Thread_Get> switch ( location ) { 473d2: 508f addql #8,%sp 473d4: 4aae fffc tstl %fp@(-4) 473d8: 6618 bnes 473f2 <_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 ); 473da: 2f00 movel %d0,%sp@- 473dc: 4eb9 0004 a0d0 jsr 4a0d0 <_Thread_queue_Process_timeout> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 473e2: 588f addql #4,%sp 473e4: 2039 0005 ba78 movel 5ba78 <_Thread_Dispatch_disable_level>,%d0 473ea: 5380 subql #1,%d0 473ec: 23c0 0005 ba78 movel %d0,5ba78 <_Thread_Dispatch_disable_level> _Thread_Unnest_dispatch(); break; } } 473f2: 4e5e unlk %fp ... 00051644 <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 51644: 4e56 ffb4 linkw %fp,#-76 51648: 200e movel %fp,%d0 5164a: 0680 ffff fff4 addil #-12,%d0 51650: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 51654: 246e 0008 moveal %fp@(8),%a2 51658: 240e movel %fp,%d2 5165a: 2a0e movel %fp,%d5 5165c: 260e movel %fp,%d3 5165e: 0682 ffff ffe8 addil #-24,%d2 51664: 5185 subql #8,%d5 51666: 0683 ffff ffec addil #-20,%d3 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 5166c: 41ea 0008 lea %a2@(8),%a0 static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 51670: 4bea 0040 lea %a2@(64),%a5 */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 51674: 2e0a movel %a2,%d7 /* * This path is for normal forward movement and cases where the * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 51676: 280a movel %a2,%d4 */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 51678: 0687 0000 0030 addil #48,%d7 /* * This path is for normal forward movement and cases where the * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 5167e: 0684 0000 0068 addil #104,%d4 */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 51684: 49f9 0005 5054 lea 55054 <_Watchdog_Adjust_to_chain>,%a4 ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 5168a: 47f9 0005 50e4 lea 550e4 <_Watchdog_Insert>,%a3 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 51690: 2d48 ffe4 movel %a0,%fp@(-28) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 51694: 2d45 fff4 movel %d5,%fp@(-12) the_chain->permanent_null = NULL; 51698: 42ae fff8 clrl %fp@(-8) the_chain->last = _Chain_Head(the_chain); 5169c: 2d40 fffc movel %d0,%fp@(-4) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 516a0: 2d43 ffe8 movel %d3,%fp@(-24) the_chain->permanent_null = NULL; 516a4: 42ae ffec clrl %fp@(-20) the_chain->last = _Chain_Head(the_chain); 516a8: 2d42 fff0 movel %d2,%fp@(-16) 516ac: 2d4d ffe0 movel %a5,%fp@(-32) { /* * Afterwards all timer inserts are directed to this chain and the interval * and TOD chains will be no more modified by other parties. */ ts->insert_chain = insert_chain; 516b0: 41ee fff4 lea %fp@(-12),%a0 * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); 516b4: 3a7c 0700 moveaw #1792,%a5 { /* * Afterwards all timer inserts are directed to this chain and the interval * and TOD chains will be no more modified by other parties. */ ts->insert_chain = insert_chain; 516b8: 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; 516bc: 2039 0007 41c4 movel 741c4 <_Watchdog_Ticks_since_boot>,%d0 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 516c2: 222a 003c movel %a2@(60),%d1 watchdogs->last_snapshot = snapshot; 516c6: 2540 003c movel %d0,%a2@(60) _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 516ca: 486e ffe8 pea %fp@(-24) 516ce: 9081 subl %d1,%d0 516d0: 2f00 movel %d0,%sp@- 516d2: 2f07 movel %d7,%sp@- 516d4: 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(); 516d6: 2039 0007 4116 movel 74116 <_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 ) { 516dc: 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; 516e0: 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 ) { 516e4: b280 cmpl %d0,%d1 516e6: 6414 bccs 516fc <_Timer_server_Body+0xb8> /* * This path is for normal forward movement and cases where the * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 516e8: 486e ffe8 pea %fp@(-24) 516ec: 2c00 movel %d0,%d6 516ee: 9c81 subl %d1,%d6 516f0: 2f06 movel %d6,%sp@- 516f2: 2d40 ffdc movel %d0,%fp@(-36) 516f6: 2f04 movel %d4,%sp@- 516f8: 4e94 jsr %a4@ 516fa: 6018 bras 51714 <_Timer_server_Body+0xd0> } else if ( snapshot < last_snapshot ) { 516fc: b280 cmpl %d0,%d1 516fe: 631c blss 5171c <_Timer_server_Body+0xd8> /* * The current TOD is before the last TOD which indicates that * TOD has been set backwards. */ delta = last_snapshot - snapshot; _Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta ); 51700: 9280 subl %d0,%d1 51702: 2f01 movel %d1,%sp@- 51704: 4878 0001 pea 1 51708: 2d40 ffdc movel %d0,%fp@(-36) 5170c: 2f04 movel %d4,%sp@- 5170e: 4eb9 0005 4fd4 jsr 54fd4 <_Watchdog_Adjust> 51714: 202e ffdc movel %fp@(-36),%d0 51718: 4fef 000c lea %sp@(12),%sp } watchdogs->last_snapshot = snapshot; 5171c: 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 ); 51720: 202a 0078 movel %a2@(120),%d0 51724: 2f00 movel %d0,%sp@- 51726: 4eb9 0005 1fb8 jsr 51fb8 <_Chain_Get> if ( timer == NULL ) { 5172c: 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 ); 5172e: 2040 moveal %d0,%a0 if ( timer == NULL ) { 51730: 4a80 tstl %d0 51732: 6724 beqs 51758 <_Timer_server_Body+0x114> <== ALWAYS TAKEN static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 51734: 2028 0038 movel %a0@(56),%d0 <== NOT EXECUTED 51738: 7201 moveq #1,%d1 <== NOT EXECUTED 5173a: b280 cmpl %d0,%d1 <== NOT EXECUTED 5173c: 6608 bnes 51746 <_Timer_server_Body+0x102> <== NOT EXECUTED _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 5173e: 4868 0010 pea %a0@(16) <== NOT EXECUTED 51742: 2f07 movel %d7,%sp@- <== NOT EXECUTED 51744: 600c bras 51752 <_Timer_server_Body+0x10e> <== NOT EXECUTED } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 51746: 7c03 moveq #3,%d6 <== NOT EXECUTED 51748: bc80 cmpl %d0,%d6 <== NOT EXECUTED 5174a: 66d4 bnes 51720 <_Timer_server_Body+0xdc> <== NOT EXECUTED _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 5174c: 4868 0010 pea %a0@(16) <== NOT EXECUTED 51750: 2f04 movel %d4,%sp@- <== NOT EXECUTED 51752: 4e93 jsr %a3@ <== NOT EXECUTED 51754: 508f addql #8,%sp <== NOT EXECUTED 51756: 60c8 bras 51720 <_Timer_server_Body+0xdc> <== NOT EXECUTED * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); 51758: 200d movel %a5,%d0 5175a: 40c1 movew %sr,%d1 5175c: 8081 orl %d1,%d0 5175e: 46c0 movew %d0,%sr if ( _Chain_Is_empty( insert_chain ) ) { 51760: baae fff4 cmpl %fp@(-12),%d5 51764: 6612 bnes 51778 <_Timer_server_Body+0x134> <== NEVER TAKEN ts->insert_chain = NULL; 51766: 42aa 0078 clrl %a2@(120) _ISR_Enable( level ); 5176a: 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 ); 5176c: 3a7c 0700 moveaw #1792,%a5 _Chain_Initialize_empty( &fire_chain ); while ( true ) { _Timer_server_Get_watchdogs_that_fire_now( ts, &insert_chain, &fire_chain ); if ( !_Chain_Is_empty( &fire_chain ) ) { 51770: b6ae ffe8 cmpl %fp@(-24),%d3 51774: 6608 bnes 5177e <_Timer_server_Body+0x13a> 51776: 6042 bras 517ba <_Timer_server_Body+0x176> ts->insert_chain = NULL; _ISR_Enable( level ); break; } else { _ISR_Enable( level ); 51778: 46c1 movew %d1,%sr <== NOT EXECUTED 5177a: 6000 ff40 braw 516bc <_Timer_server_Body+0x78> <== NOT EXECUTED /* * It is essential that interrupts are disable here since an interrupt * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); 5177e: 220d movel %a5,%d1 51780: 40c0 movew %sr,%d0 51782: 8280 orl %d0,%d1 51784: 46c1 movew %d1,%sr */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 51786: 206e ffe8 moveal %fp@(-24),%a0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 5178a: b688 cmpl %a0,%d3 5178c: 6726 beqs 517b4 <_Timer_server_Body+0x170> { Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; 5178e: 2250 moveal %a0@,%a1 the_chain->first = new_first; 51790: 2d49 ffe8 movel %a1,%fp@(-24) new_first->previous = _Chain_Head(the_chain); 51794: 2342 0004 movel %d2,%a1@(4) watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { 51798: 4a88 tstl %a0 5179a: 6718 beqs 517b4 <_Timer_server_Body+0x170> <== NEVER TAKEN watchdog->state = WATCHDOG_INACTIVE; 5179c: 42a8 0008 clrl %a0@(8) _ISR_Enable( level ); 517a0: 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 ); 517a2: 2f28 0024 movel %a0@(36),%sp@- 517a6: 2f28 0020 movel %a0@(32),%sp@- 517aa: 2068 001c moveal %a0@(28),%a0 517ae: 4e90 jsr %a0@ } 517b0: 508f addql #8,%sp 517b2: 60ca bras 5177e <_Timer_server_Body+0x13a> watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; _ISR_Enable( level ); } else { _ISR_Enable( level ); 517b4: 46c0 movew %d0,%sr 517b6: 6000 fef8 braw 516b0 <_Timer_server_Body+0x6c> * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); } } else { ts->active = false; 517ba: 4200 clrb %d0 517bc: 1540 007c moveb %d0,%a2@(124) 517c0: 2039 0007 4084 movel 74084 <_Thread_Dispatch_disable_level>,%d0 517c6: 5280 addql #1,%d0 517c8: 23c0 0007 4084 movel %d0,74084 <_Thread_Dispatch_disable_level> /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); 517ce: 4878 0008 pea 8 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 517d2: 4bf9 0005 5200 lea 55200 <_Watchdog_Remove>,%a5 /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); 517d8: 2f12 movel %a2@,%sp@- 517da: 4eb9 0005 4828 jsr 54828 <_Thread_Set_state> _Timer_server_Reset_interval_system_watchdog( ts ); 517e0: 2f0a movel %a2,%sp@- 517e2: 4eba fd9c jsr %pc@(51580 <_Timer_server_Reset_interval_system_watchdog>) _Timer_server_Reset_tod_system_watchdog( ts ); 517e6: 2f0a movel %a2,%sp@- 517e8: 4eba fdf6 jsr %pc@(515e0 <_Timer_server_Reset_tod_system_watchdog>) _Thread_Enable_dispatch(); 517ec: 4eb9 0005 3ec6 jsr 53ec6 <_Thread_Enable_dispatch> ts->active = true; 517f2: 7201 moveq #1,%d1 517f4: 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 ); 517f8: 2f2e ffe4 movel %fp@(-28),%sp@- 517fc: 4e95 jsr %a5@ static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 517fe: 2f2e ffe0 movel %fp@(-32),%sp@- 51802: 4e95 jsr %a5@ 51804: 4fef 0018 lea %sp@(24),%sp 51808: 6000 fea6 braw 516b0 <_Timer_server_Body+0x6c> 0005180c <_Timer_server_Schedule_operation_method>: static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 5180c: 4e56 fff0 linkw %fp,#-16 51810: 206e 000c moveal %fp@(12),%a0 51814: 48d7 041c moveml %d2-%d4/%a2,%sp@ 51818: 246e 0008 moveal %fp@(8),%a2 if ( ts->insert_chain == NULL ) { 5181c: 202a 0078 movel %a2@(120),%d0 51820: 6600 00f8 bnew 5191a <_Timer_server_Schedule_operation_method+0x10e> 51824: 2039 0007 4084 movel 74084 <_Thread_Dispatch_disable_level>,%d0 5182a: 5280 addql #1,%d0 5182c: 23c0 0007 4084 movel %d0,74084 <_Thread_Dispatch_disable_level> * being inserted. This could result in an integer overflow. */ _Thread_Disable_dispatch(); if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 51832: 2028 0038 movel %a0@(56),%d0 51836: 7201 moveq #1,%d1 51838: b280 cmpl %d0,%d1 5183a: 6660 bnes 5189c <_Timer_server_Schedule_operation_method+0x90> /* * We have to advance the last known ticks value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 5183c: 203c 0000 0700 movel #1792,%d0 51842: 40c3 movew %sr,%d3 51844: 8083 orl %d3,%d0 51846: 46c0 movew %d0,%sr snapshot = _Watchdog_Ticks_since_boot; 51848: 2039 0007 41c4 movel 741c4 <_Watchdog_Ticks_since_boot>,%d0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 5184e: 220a movel %a2,%d1 51850: 0681 0000 0034 addil #52,%d1 last_snapshot = ts->Interval_watchdogs.last_snapshot; 51856: 242a 003c movel %a2@(60),%d2 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 5185a: 226a 0030 moveal %a2@(48),%a1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 5185e: b289 cmpl %a1,%d1 51860: 6716 beqs 51878 <_Timer_server_Schedule_operation_method+0x6c> first_watchdog = _Watchdog_First( &ts->Interval_watchdogs.Chain ); /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; 51862: 2800 movel %d0,%d4 51864: 9882 subl %d2,%d4 delta_interval = first_watchdog->delta_interval; 51866: 2229 0010 movel %a1@(16),%d1 if (delta_interval > delta) { 5186a: b881 cmpl %d1,%d4 5186c: 6504 bcss 51872 <_Timer_server_Schedule_operation_method+0x66> 5186e: 4281 clrl %d1 51870: 6002 bras 51874 <_Timer_server_Schedule_operation_method+0x68> delta_interval -= delta; 51872: 9284 subl %d4,%d1 } else { delta_interval = 0; } first_watchdog->delta_interval = delta_interval; 51874: 2341 0010 movel %d1,%a1@(16) } ts->Interval_watchdogs.last_snapshot = snapshot; 51878: 2540 003c movel %d0,%a2@(60) _ISR_Enable( level ); 5187c: 46c3 movew %d3,%sr _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 5187e: 4868 0010 pea %a0@(16) 51882: 486a 0030 pea %a2@(48) 51886: 4eb9 0005 50e4 jsr 550e4 <_Watchdog_Insert> if ( !ts->active ) { 5188c: 508f addql #8,%sp 5188e: 102a 007c moveb %a2@(124),%d0 51892: 6678 bnes 5190c <_Timer_server_Schedule_operation_method+0x100> _Timer_server_Reset_interval_system_watchdog( ts ); 51894: 2f0a movel %a2,%sp@- 51896: 4eba fce8 jsr %pc@(51580 <_Timer_server_Reset_interval_system_watchdog>) 5189a: 606e bras 5190a <_Timer_server_Schedule_operation_method+0xfe> } } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 5189c: 7203 moveq #3,%d1 5189e: b280 cmpl %d0,%d1 518a0: 666a bnes 5190c <_Timer_server_Schedule_operation_method+0x100> /* * We have to advance the last known seconds value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 518a2: 203c 0000 0700 movel #1792,%d0 518a8: 40c3 movew %sr,%d3 518aa: 8083 orl %d3,%d0 518ac: 46c0 movew %d0,%sr 518ae: 200a movel %a2,%d0 518b0: 0680 0000 006c addil #108,%d0 snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 518b6: 2239 0007 4116 movel 74116 <_TOD_Now>,%d1 last_snapshot = ts->TOD_watchdogs.last_snapshot; 518bc: 242a 0074 movel %a2@(116),%d2 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 518c0: 226a 0068 moveal %a2@(104),%a1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 518c4: b089 cmpl %a1,%d0 518c6: 6720 beqs 518e8 <_Timer_server_Schedule_operation_method+0xdc> if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; 518c8: 2029 0010 movel %a1@(16),%d0 if ( snapshot > last_snapshot ) { 518cc: b481 cmpl %d1,%d2 518ce: 6410 bccs 518e0 <_Timer_server_Schedule_operation_method+0xd4> /* * We advanced in time. */ delta = snapshot - last_snapshot; 518d0: 2801 movel %d1,%d4 518d2: 9882 subl %d2,%d4 if (delta_interval > delta) { 518d4: b880 cmpl %d0,%d4 518d6: 6504 bcss 518dc <_Timer_server_Schedule_operation_method+0xd0><== ALWAYS TAKEN 518d8: 4280 clrl %d0 <== NOT EXECUTED 518da: 6008 bras 518e4 <_Timer_server_Schedule_operation_method+0xd8><== NOT EXECUTED delta_interval -= delta; 518dc: 9084 subl %d4,%d0 518de: 6004 bras 518e4 <_Timer_server_Schedule_operation_method+0xd8> } } else { /* * Someone put us in the past. */ delta = last_snapshot - snapshot; 518e0: d082 addl %d2,%d0 delta_interval += delta; 518e2: 9081 subl %d1,%d0 } first_watchdog->delta_interval = delta_interval; 518e4: 2340 0010 movel %d0,%a1@(16) } ts->TOD_watchdogs.last_snapshot = snapshot; 518e8: 2541 0074 movel %d1,%a2@(116) _ISR_Enable( level ); 518ec: 46c3 movew %d3,%sr _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 518ee: 4868 0010 pea %a0@(16) 518f2: 486a 0068 pea %a2@(104) 518f6: 4eb9 0005 50e4 jsr 550e4 <_Watchdog_Insert> if ( !ts->active ) { 518fc: 508f addql #8,%sp 518fe: 102a 007c moveb %a2@(124),%d0 51902: 6608 bnes 5190c <_Timer_server_Schedule_operation_method+0x100> _Timer_server_Reset_tod_system_watchdog( ts ); 51904: 2f0a movel %a2,%sp@- 51906: 4eba fcd8 jsr %pc@(515e0 <_Timer_server_Reset_tod_system_watchdog>) 5190a: 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 ); } } 5190c: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 51912: 4e5e unlk %fp if ( !ts->active ) { _Timer_server_Reset_tod_system_watchdog( ts ); } } _Thread_Enable_dispatch(); 51914: 4ef9 0005 3ec6 jmp 53ec6 <_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 ); 5191a: 202a 0078 movel %a2@(120),%d0 <== NOT EXECUTED 5191e: 2d48 000c movel %a0,%fp@(12) <== NOT EXECUTED } } 51922: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 <== NOT EXECUTED * server is not preemptible, so we must be in interrupt context here. No * thread dispatch will happen until the timer server finishes its * critical section. We have to use the protected chain methods because * we may be interrupted by a higher priority interrupt. */ _Chain_Append( ts->insert_chain, &timer->Object.Node ); 51928: 2d40 0008 movel %d0,%fp@(8) <== NOT EXECUTED } } 5192c: 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 ); 5192e: 4ef9 0005 1f80 jmp 51f80 <_Chain_Append> <== NOT EXECUTED 00048f4c <_Timespec_Greater_than>: bool _Timespec_Greater_than( const struct timespec *lhs, const struct timespec *rhs ) { 48f4c: 4e56 0000 linkw %fp,#0 48f50: 226e 0008 moveal %fp@(8),%a1 48f54: 206e 000c moveal %fp@(12),%a0 if ( lhs->tv_sec > rhs->tv_sec ) 48f58: 2211 movel %a1@,%d1 48f5a: 2010 movel %a0@,%d0 48f5c: b081 cmpl %d1,%d0 48f5e: 6c04 bges 48f64 <_Timespec_Greater_than+0x18> 48f60: 7001 moveq #1,%d0 48f62: 6014 bras 48f78 <_Timespec_Greater_than+0x2c> return true; if ( lhs->tv_sec < rhs->tv_sec ) 48f64: b081 cmpl %d1,%d0 48f66: 6f04 bles 48f6c <_Timespec_Greater_than+0x20> <== ALWAYS TAKEN 48f68: 4200 clrb %d0 <== NOT EXECUTED 48f6a: 600c bras 48f78 <_Timespec_Greater_than+0x2c> <== NOT EXECUTED #include #include #include bool _Timespec_Greater_than( 48f6c: 2068 0004 moveal %a0@(4),%a0 48f70: b1e9 0004 cmpal %a1@(4),%a0 48f74: 5dc0 slt %d0 48f76: 4480 negl %d0 /* ASSERT: lhs->tv_sec == rhs->tv_sec */ if ( lhs->tv_nsec > rhs->tv_nsec ) return true; return false; } 48f78: 4e5e unlk %fp <== NOT EXECUTED 000479f4 <_User_extensions_Thread_exitted>: void _User_extensions_Thread_exitted ( Thread_Control *executing ) { 479f4: 4e56 0000 linkw %fp,#0 479f8: 2f0a movel %a2,%sp@- Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 479fa: 2479 0005 bc0e moveal 5bc0e <_User_extensions_List+0x8>,%a2 } void _User_extensions_Thread_exitted ( Thread_Control *executing ) { 47a00: 2f02 movel %d2,%sp@- 47a02: 242e 0008 movel %fp@(8),%d2 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 47a06: 6012 bras 47a1a <_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 ) 47a08: 206a 002c moveal %a2@(44),%a0 47a0c: 4a88 tstl %a0 47a0e: 6706 beqs 47a16 <_User_extensions_Thread_exitted+0x22> (*the_extension->Callouts.thread_exitted)( executing ); 47a10: 2f02 movel %d2,%sp@- 47a12: 4e90 jsr %a0@ 47a14: 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 ) { 47a16: 246a 0004 moveal %a2@(4),%a2 { Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; !_Chain_Is_head( &_User_extensions_List, the_node ) ; 47a1a: b5fc 0005 bc06 cmpal #375814,%a2 47a20: 66e6 bnes 47a08 <_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 ); } } 47a22: 242e fff8 movel %fp@(-8),%d2 47a26: 246e fffc moveal %fp@(-4),%a2 47a2a: 4e5e unlk %fp <== NOT EXECUTED 0004911c <_Watchdog_Adjust>: Watchdog_Interval units ) { ISR_Level level; _ISR_Disable( level ); 4911c: 327c 0700 moveaw #1792,%a1 49120: 2209 movel %a1,%d1 void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 49122: 4e56 ffe8 linkw %fp,#-24 49126: 48d7 1c1c moveml %d2-%d4/%a2-%a4,%sp@ 4912a: 266e 0008 moveal %fp@(8),%a3 4912e: 262e 000c movel %fp@(12),%d3 49132: 242e 0010 movel %fp@(16),%d2 ISR_Level level; _ISR_Disable( level ); 49136: 40c0 movew %sr,%d0 49138: 8280 orl %d0,%d1 4913a: 46c1 movew %d1,%sr */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 4913c: 244b moveal %a3,%a2 4913e: 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 ) ) { 49140: b5c8 cmpal %a0,%a2 49142: 674c beqs 49190 <_Watchdog_Adjust+0x74> switch ( direction ) { 49144: 4a83 tstl %d3 49146: 673c beqs 49184 <_Watchdog_Adjust+0x68> 49148: 7201 moveq #1,%d1 4914a: b283 cmpl %d3,%d1 4914c: 6642 bnes 49190 <_Watchdog_Adjust+0x74> <== NEVER TAKEN case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; 4914e: d5a8 0010 addl %d2,%a0@(16) break; 49152: 603c bras 49190 <_Watchdog_Adjust+0x74> RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First( Chain_Control *header ) { return ( (Watchdog_Control *) header->first ); 49154: 2053 moveal %a3@,%a0 case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { 49156: 2628 0010 movel %a0@(16),%d3 4915a: b682 cmpl %d2,%d3 4915c: 6308 blss 49166 <_Watchdog_Adjust+0x4a> _Watchdog_First( header )->delta_interval -= units; 4915e: 9682 subl %d2,%d3 49160: 2143 0010 movel %d3,%a0@(16) break; 49164: 602a bras 49190 <_Watchdog_Adjust+0x74> } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; 49166: 7201 moveq #1,%d1 49168: 2141 0010 movel %d1,%a0@(16) _ISR_Enable( level ); 4916c: 46c0 movew %d0,%sr _Watchdog_Tickle( header ); 4916e: 2f0b movel %a3,%sp@- 49170: 4e94 jsr %a4@ _ISR_Disable( level ); 49172: 2204 movel %d4,%d1 49174: 40c0 movew %sr,%d0 49176: 8280 orl %d0,%d1 49178: 46c1 movew %d1,%sr while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; 4917a: 9483 subl %d3,%d2 _Watchdog_Tickle( header ); _ISR_Disable( level ); if ( _Chain_Is_empty( header ) ) 4917c: 588f addql #4,%sp 4917e: b5d3 cmpal %a3@,%a2 49180: 660a bnes 4918c <_Watchdog_Adjust+0x70> 49182: 600c bras 49190 <_Watchdog_Adjust+0x74> _ISR_Enable( level ); _Watchdog_Tickle( header ); _ISR_Disable( level ); 49184: 2809 movel %a1,%d4 units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; _ISR_Enable( level ); _Watchdog_Tickle( header ); 49186: 49f9 0004 9334 lea 49334 <_Watchdog_Tickle>,%a4 switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 4918c: 4a82 tstl %d2 4918e: 66c4 bnes 49154 <_Watchdog_Adjust+0x38> <== ALWAYS TAKEN } break; } } _ISR_Enable( level ); 49190: 46c0 movew %d0,%sr } 49192: 4cee 1c1c ffe8 moveml %fp@(-24),%d2-%d4/%a2-%a4 49198: 4e5e unlk %fp <== NOT EXECUTED 00047c90 <_Watchdog_Remove>: { ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 47c90: 203c 0000 0700 movel #1792,%d0 */ Watchdog_States _Watchdog_Remove( Watchdog_Control *the_watchdog ) { 47c96: 4e56 0000 linkw %fp,#0 47c9a: 206e 0008 moveal %fp@(8),%a0 47c9e: 2f0a movel %a2,%sp@- 47ca0: 2f02 movel %d2,%sp@- ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 47ca2: 40c1 movew %sr,%d1 47ca4: 8081 orl %d1,%d0 47ca6: 46c0 movew %d0,%sr previous_state = the_watchdog->state; 47ca8: 2028 0008 movel %a0@(8),%d0 switch ( previous_state ) { 47cac: 7401 moveq #1,%d2 47cae: b480 cmpl %d0,%d2 47cb0: 670c beqs 47cbe <_Watchdog_Remove+0x2e> 47cb2: 6244 bhis 47cf8 <_Watchdog_Remove+0x68> 47cb4: 143c 0003 moveb #3,%d2 47cb8: b480 cmpl %d0,%d2 47cba: 653c bcss 47cf8 <_Watchdog_Remove+0x68> <== NEVER TAKEN 47cbc: 6006 bras 47cc4 <_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; 47cbe: 42a8 0008 clrl %a0@(8) break; 47cc2: 6034 bras 47cf8 <_Watchdog_Remove+0x68> RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_Next( Watchdog_Control *the_watchdog ) { return ( (Watchdog_Control *) the_watchdog->Node.next ); 47cc4: 2250 moveal %a0@,%a1 case WATCHDOG_ACTIVE: case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; 47cc6: 42a8 0008 clrl %a0@(8) next_watchdog = _Watchdog_Next( the_watchdog ); if ( _Watchdog_Next(next_watchdog) ) 47cca: 4a91 tstl %a1@ 47ccc: 6708 beqs 47cd6 <_Watchdog_Remove+0x46> next_watchdog->delta_interval += the_watchdog->delta_interval; 47cce: 2428 0010 movel %a0@(16),%d2 47cd2: d5a9 0010 addl %d2,%a1@(16) if ( _Watchdog_Sync_count ) 47cd6: 2279 0005 bbb4 moveal 5bbb4 <_Watchdog_Sync_count>,%a1 47cdc: 4a89 tstl %a1 47cde: 670c beqs 47cec <_Watchdog_Remove+0x5c> _Watchdog_Sync_level = _ISR_Nest_level; 47ce0: 2279 0005 bb12 moveal 5bb12 <_ISR_Nest_level>,%a1 47ce6: 23c9 0005 bb2e movel %a1,5bb2e <_Watchdog_Sync_level> ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 47cec: 2250 moveal %a0@,%a1 previous = the_node->previous; 47cee: 2468 0004 moveal %a0@(4),%a2 next->previous = previous; previous->next = next; 47cf2: 2489 movel %a1,%a2@ Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 47cf4: 234a 0004 movel %a2,%a1@(4) _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 47cf8: 2279 0005 bbb8 moveal 5bbb8 <_Watchdog_Ticks_since_boot>,%a1 47cfe: 2149 0018 movel %a1,%a0@(24) _ISR_Enable( level ); 47d02: 46c1 movew %d1,%sr return( previous_state ); } 47d04: 241f movel %sp@+,%d2 47d06: 245f moveal %sp@+,%a2 47d08: 4e5e unlk %fp <== NOT EXECUTED 00048d20 <_Watchdog_Report_chain>: ) { ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 48d20: 203c 0000 0700 movel #1792,%d0 void _Watchdog_Report_chain( const char *name, Chain_Control *header ) { 48d26: 4e56 ffec linkw %fp,#-20 48d2a: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@ 48d2e: 242e 0008 movel %fp@(8),%d2 48d32: 266e 000c moveal %fp@(12),%a3 ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 48d36: 40c3 movew %sr,%d3 48d38: 8083 orl %d3,%d0 48d3a: 46c0 movew %d0,%sr printk( "Watchdog Chain: %s %p\n", name, header ); 48d3c: 2f0b movel %a3,%sp@- 48d3e: 49f9 0004 3698 lea 43698 ,%a4 48d44: 2f02 movel %d2,%sp@- 48d46: 4879 0005 afe0 pea 5afe0 48d4c: 4e94 jsr %a4@ */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 48d4e: 245b moveal %a3@+,%a2 if ( !_Chain_Is_empty( header ) ) { 48d50: 4fef 000c lea %sp@(12),%sp 48d54: b7ca cmpal %a2,%a3 48d56: 6726 beqs 48d7e <_Watchdog_Report_chain+0x5e> node != _Chain_Tail(header) ; node = node->next ) { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); 48d58: 49f9 0004 8d94 lea 48d94 <_Watchdog_Report>,%a4 48d5e: 2f0a movel %a2,%sp@- 48d60: 42a7 clrl %sp@- 48d62: 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 ) 48d64: 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 ; 48d66: 508f addql #8,%sp 48d68: b7ca cmpal %a2,%a3 48d6a: 66f2 bnes 48d5e <_Watchdog_Report_chain+0x3e> <== NEVER TAKEN { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); 48d6c: 2f02 movel %d2,%sp@- 48d6e: 4879 0005 aff7 pea 5aff7 48d74: 4eb9 0004 3698 jsr 43698 48d7a: 508f addql #8,%sp 48d7c: 600a bras 48d88 <_Watchdog_Report_chain+0x68> } else { printk( "Chain is empty\n" ); 48d7e: 4879 0005 b006 pea 5b006 48d84: 4e94 jsr %a4@ 48d86: 588f addql #4,%sp } _ISR_Enable( level ); 48d88: 46c3 movew %d3,%sr } 48d8a: 4cee 1c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a4 48d90: 4e5e unlk %fp <== NOT EXECUTED 00047d0c <_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 ); 47d0c: 203c 0000 0700 movel #1792,%d0 */ void _Watchdog_Tickle( Chain_Control *header ) { 47d12: 4e56 ffe8 linkw %fp,#-24 47d16: 48d7 3c0c moveml %d2-%d3/%a2-%a5,%sp@ 47d1a: 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 ); 47d1e: 40c2 movew %sr,%d2 47d20: 8082 orl %d2,%d0 47d22: 46c0 movew %d0,%sr */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 47d24: 264c moveal %a4,%a3 47d26: 245b moveal %a3@+,%a2 if ( _Chain_Is_empty( header ) ) 47d28: b7ca cmpal %a2,%a3 47d2a: 674e beqs 47d7a <_Watchdog_Tickle+0x6e> * 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) { 47d2c: 202a 0010 movel %a2@(16),%d0 47d30: 6708 beqs 47d3a <_Watchdog_Tickle+0x2e> the_watchdog->delta_interval--; 47d32: 5380 subql #1,%d0 47d34: 2540 0010 movel %d0,%a2@(16) if ( the_watchdog->delta_interval != 0 ) 47d38: 6640 bnes 47d7a <_Watchdog_Tickle+0x6e> goto leave; } do { watchdog_state = _Watchdog_Remove( the_watchdog ); 47d3a: 4bf9 0004 7c90 lea 47c90 <_Watchdog_Remove>,%a5 case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 47d40: 263c 0000 0700 movel #1792,%d3 if ( the_watchdog->delta_interval != 0 ) goto leave; } do { watchdog_state = _Watchdog_Remove( the_watchdog ); 47d46: 2f0a movel %a2,%sp@- 47d48: 4e95 jsr %a5@ _ISR_Enable( level ); 47d4a: 46c2 movew %d2,%sr switch( watchdog_state ) { 47d4c: 7202 moveq #2,%d1 47d4e: 588f addql #4,%sp 47d50: b280 cmpl %d0,%d1 47d52: 6610 bnes 47d64 <_Watchdog_Tickle+0x58> <== NEVER TAKEN case WATCHDOG_ACTIVE: (*the_watchdog->routine)( 47d54: 2f2a 0024 movel %a2@(36),%sp@- 47d58: 2f2a 0020 movel %a2@(32),%sp@- 47d5c: 206a 001c moveal %a2@(28),%a0 47d60: 4e90 jsr %a0@ 47d62: 508f addql #8,%sp case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 47d64: 2003 movel %d3,%d0 47d66: 40c2 movew %sr,%d2 47d68: 8082 orl %d2,%d0 47d6a: 46c0 movew %d0,%sr RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First( Chain_Control *header ) { return ( (Watchdog_Control *) header->first ); 47d6c: 2014 movel %a4@,%d0 47d6e: 2440 moveal %d0,%a2 the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); 47d70: b7c0 cmpal %d0,%a3 47d72: 6706 beqs 47d7a <_Watchdog_Tickle+0x6e> 47d74: 4aaa 0010 tstl %a2@(16) 47d78: 67cc beqs 47d46 <_Watchdog_Tickle+0x3a> leave: _ISR_Enable(level); 47d7a: 46c2 movew %d2,%sr } 47d7c: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 47d82: 4e5e unlk %fp ... 00046d9c : rtems_status_code rtems_io_register_driver( rtems_device_major_number major, const rtems_driver_address_table *driver_table, rtems_device_major_number *registered_major ) { 46d9c: 4e56 0000 linkw %fp,#0 46da0: 206e 000c moveal %fp@(12),%a0 46da4: 2f0a movel %a2,%sp@- 46da6: 226e 0010 moveal %fp@(16),%a1 46daa: 2f02 movel %d2,%sp@- 46dac: 242e 0008 movel %fp@(8),%d2 rtems_device_major_number major_limit = _IO_Number_of_drivers; 46db0: 2039 0006 10c6 movel 610c6 <_IO_Number_of_drivers>,%d0 if ( rtems_interrupt_is_in_progress() ) 46db6: 2239 0006 0f1a movel 60f1a <_ISR_Nest_level>,%d1 46dbc: 6706 beqs 46dc4 46dbe: 7012 moveq #18,%d0 46dc0: 6000 00d6 braw 46e98 return RTEMS_CALLED_FROM_ISR; if ( registered_major == NULL ) 46dc4: 4a89 tstl %a1 46dc6: 6700 00ce beqw 46e96 return RTEMS_INVALID_ADDRESS; /* Set it to an invalid value */ *registered_major = major_limit; 46dca: 2280 movel %d0,%a1@ if ( driver_table == NULL ) 46dcc: 4a88 tstl %a0 46dce: 6700 00c6 beqw 46e96 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 46dd2: 4a90 tstl %a0@ 46dd4: 6600 00ce bnew 46ea4 46dd8: 4aa8 0004 tstl %a0@(4) 46ddc: 6600 00c6 bnew 46ea4 46de0: 6000 00b4 braw 46e96 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 46de4: 2039 0006 0e80 movel 60e80 <_Thread_Dispatch_disable_level>,%d0 46dea: 5280 addql #1,%d0 46dec: 23c0 0006 0e80 movel %d0,60e80 <_Thread_Dispatch_disable_level> if ( major >= major_limit ) return RTEMS_INVALID_NUMBER; _Thread_Disable_dispatch(); if ( major == 0 ) { 46df2: 4a82 tstl %d2 46df4: 662c bnes 46e22 static rtems_status_code rtems_io_obtain_major_number( rtems_device_major_number *major ) { rtems_device_major_number n = _IO_Number_of_drivers; 46df6: 2039 0006 10c6 movel 610c6 <_IO_Number_of_drivers>,%d0 46dfc: 2479 0006 10ca moveal 610ca <_IO_Driver_address_table>,%a2 46e02: 6010 bras 46e14 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 46e04: 4a92 tstl %a2@ 46e06: 6600 00a6 bnew 46eae 46e0a: 4aaa 0004 tstl %a2@(4) 46e0e: 6600 009e bnew 46eae 46e12: 6004 bras 46e18 rtems_device_major_number n = _IO_Number_of_drivers; rtems_device_major_number m = 0; /* major is error checked by caller */ for ( m = 0; m < n; ++m ) { 46e14: b082 cmpl %d2,%d0 46e16: 62ec bhis 46e04 if ( rtems_io_is_empty_table( table ) ) break; } /* Assigns invalid value in case of failure */ *major = m; 46e18: 2282 movel %d2,%a1@ if ( m != n ) 46e1a: b082 cmpl %d2,%d0 46e1c: 6634 bnes 46e52 46e1e: 6000 0098 braw 46eb8 _Thread_Enable_dispatch(); return sc; } major = *registered_major; } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major; 46e22: 2202 movel %d2,%d1 46e24: 2002 movel %d2,%d0 46e26: e789 lsll #3,%d1 46e28: eb88 lsll #5,%d0 46e2a: 2479 0006 10ca moveal 610ca <_IO_Driver_address_table>,%a2 46e30: 9081 subl %d1,%d0 46e32: d5c0 addal %d0,%a2 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 46e34: 4a92 tstl %a2@ 46e36: 660e bnes 46e46 46e38: 4aaa 0004 tstl %a2@(4) 46e3c: 57c0 seq %d0 46e3e: 49c0 extbl %d0 46e40: 4480 negl %d0 } major = *registered_major; } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major; if ( !rtems_io_is_empty_table( table ) ) { 46e42: 4a00 tstb %d0 46e44: 660a bnes 46e50 _Thread_Enable_dispatch(); 46e46: 4eb9 0004 864a jsr 4864a <_Thread_Enable_dispatch> 46e4c: 700c moveq #12,%d0 return RTEMS_RESOURCE_IN_USE; 46e4e: 6048 bras 46e98 } *registered_major = major; 46e50: 2282 movel %d2,%a1@ } _IO_Driver_address_table [major] = *driver_table; 46e52: 4878 0018 pea 18 46e56: 2202 movel %d2,%d1 46e58: 2002 movel %d2,%d0 46e5a: e789 lsll #3,%d1 46e5c: eb88 lsll #5,%d0 46e5e: 2f08 movel %a0,%sp@- 46e60: 9081 subl %d1,%d0 46e62: d0b9 0006 10ca addl 610ca <_IO_Driver_address_table>,%d0 46e68: 2f00 movel %d0,%sp@- 46e6a: 4eb9 0005 0ccc jsr 50ccc _Thread_Enable_dispatch(); 46e70: 4eb9 0004 864a jsr 4864a <_Thread_Enable_dispatch> return rtems_io_initialize( major, 0, NULL ); } 46e76: 246e fffc moveal %fp@(-4),%a2 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 46e7a: 4fef 000c lea %sp@(12),%sp 46e7e: 2d42 0008 movel %d2,%fp@(8) } 46e82: 242e fff8 movel %fp@(-8),%d2 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 46e86: 42ae 0010 clrl %fp@(16) 46e8a: 42ae 000c clrl %fp@(12) } 46e8e: 4e5e unlk %fp _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 46e90: 4ef9 0004 e1c0 jmp 4e1c0 46e96: 7009 moveq #9,%d0 } 46e98: 242e fff8 movel %fp@(-8),%d2 46e9c: 246e fffc moveal %fp@(-4),%a2 46ea0: 4e5e unlk %fp 46ea2: 4e75 rts return RTEMS_INVALID_ADDRESS; if ( rtems_io_is_empty_table( driver_table ) ) return RTEMS_INVALID_ADDRESS; if ( major >= major_limit ) 46ea4: b082 cmpl %d2,%d0 46ea6: 6200 ff3c bhiw 46de4 46eaa: 700a moveq #10,%d0 46eac: 60ea bras 46e98 rtems_device_major_number n = _IO_Number_of_drivers; rtems_device_major_number m = 0; /* major is error checked by caller */ for ( m = 0; m < n; ++m ) { 46eae: 5282 addql #1,%d2 46eb0: 45ea 0018 lea %a2@(24),%a2 46eb4: 6000 ff5e braw 46e14 if ( major == 0 ) { rtems_status_code sc = rtems_io_obtain_major_number( registered_major ); if ( sc != RTEMS_SUCCESSFUL ) { _Thread_Enable_dispatch(); 46eb8: 4eb9 0004 864a jsr 4864a <_Thread_Enable_dispatch> 46ebe: 7005 moveq #5,%d0 return sc; 46ec0: 60d6 bras 46e98 ... 00047338 : #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) { 47338: 4e56 fff0 linkw %fp,#-16 4733c: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ 47340: 286e 0008 moveal %fp@(8),%a4 uint32_t i; uint32_t api_index; Thread_Control *the_thread; Objects_Information *information; if ( !routine ) 47344: 4a8c tstl %a4 47346: 6740 beqs 47388 <== NEVER TAKEN 47348: 45f9 0006 5924 lea 65924 <_Objects_Information_table+0x4>,%a2 return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { if ( !_Objects_Information_table[ api_index ] ) 4734e: 2052 moveal %a2@,%a0 47350: 4a88 tstl %a0 47352: 672a beqs 4737e continue; information = _Objects_Information_table[ api_index ][ 1 ]; 47354: 2668 0004 moveal %a0@(4),%a3 if ( !information ) 47358: 4a8b tstl %a3 4735a: 6722 beqs 4737e 4735c: 7401 moveq #1,%d2 4735e: 6014 bras 47374 continue; for ( i=1 ; i <= information->maximum ; i++ ) { the_thread = (Thread_Control *)information->local_table[ i ]; 47360: 206b 0018 moveal %a3@(24),%a0 47364: 2030 2c00 movel %a0@(00000000,%d2:l:4),%d0 information = _Objects_Information_table[ api_index ][ 1 ]; if ( !information ) continue; for ( i=1 ; i <= information->maximum ; i++ ) { 47368: 5282 addql #1,%d2 the_thread = (Thread_Control *)information->local_table[ i ]; if ( !the_thread ) 4736a: 4a80 tstl %d0 4736c: 6706 beqs 47374 <== NEVER TAKEN continue; (*routine)(the_thread); 4736e: 2f00 movel %d0,%sp@- 47370: 4e94 jsr %a4@ 47372: 588f addql #4,%sp information = _Objects_Information_table[ api_index ][ 1 ]; if ( !information ) continue; for ( i=1 ; i <= information->maximum ; i++ ) { 47374: 4280 clrl %d0 47376: 302b 000e movew %a3@(14),%d0 4737a: b082 cmpl %d2,%d0 4737c: 64e2 bccs 47360 4737e: 588a addql #4,%a2 Objects_Information *information; if ( !routine ) return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { 47380: b5fc 0006 5934 cmpal #416052,%a2 47386: 66c6 bnes 4734e (*routine)(the_thread); } } } 47388: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 4738e: 4e5e unlk %fp ... 0004f390 : rtems_status_code rtems_partition_return_buffer( rtems_id id, void *buffer ) { 4f390: 4e56 fffc linkw %fp,#-4 4f394: 2f0a movel %a2,%sp@- 4f396: 2f02 movel %d2,%sp@- RTEMS_INLINE_ROUTINE Partition_Control *_Partition_Get ( Objects_Id id, Objects_Locations *location ) { return (Partition_Control *) 4f398: 486e fffc pea %fp@(-4) 4f39c: 2f2e 0008 movel %fp@(8),%sp@- 4f3a0: 4879 0007 3f18 pea 73f18 <_Partition_Information> 4f3a6: 242e 000c movel %fp@(12),%d2 4f3aa: 4eb9 0005 366c jsr 5366c <_Objects_Get> register Partition_Control *the_partition; Objects_Locations location; the_partition = _Partition_Get( id, &location ); switch ( location ) { 4f3b0: 4fef 000c lea %sp@(12),%sp 4f3b4: 2440 moveal %d0,%a2 4f3b6: 4aae fffc tstl %fp@(-4) 4f3ba: 6704 beqs 4f3c0 4f3bc: 7004 moveq #4,%d0 4f3be: 603c bras 4f3fc ) { void *starting; void *ending; starting = the_partition->starting_address; 4f3c0: 202a 0010 movel %a2@(16),%d0 ending = _Addresses_Add_offset( starting, the_partition->length ); 4f3c4: 222a 0014 movel %a2@(20),%d1 const void *address, const void *base, const void *limit ) { return (address >= base && address <= limit); 4f3c8: b082 cmpl %d2,%d0 4f3ca: 623c bhis 4f408 <== NEVER TAKEN 4f3cc: d280 addl %d0,%d1 4f3ce: b282 cmpl %d2,%d1 4f3d0: 6536 bcss 4f408 <== NEVER TAKEN return ( 4f3d2: 2202 movel %d2,%d1 4f3d4: 9280 subl %d0,%d1 4f3d6: 2001 movel %d1,%d0 4f3d8: 4c6a 0001 0018 remul %a2@(24),%d1,%d0 4f3de: 4a81 tstl %d1 4f3e0: 6626 bnes 4f408 <== NEVER TAKEN RTEMS_INLINE_ROUTINE void _Partition_Free_buffer ( Partition_Control *the_partition, Chain_Node *the_buffer ) { _Chain_Append( &the_partition->Memory, the_buffer ); 4f3e2: 2f02 movel %d2,%sp@- 4f3e4: 486a 0024 pea %a2@(36) 4f3e8: 4eb9 0005 1f80 jsr 51f80 <_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; 4f3ee: 53aa 0020 subql #1,%a2@(32) _Thread_Enable_dispatch(); 4f3f2: 4eb9 0005 3ec6 jsr 53ec6 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 4f3f8: 508f addql #8,%sp case OBJECTS_LOCAL: if ( _Partition_Is_buffer_valid( buffer, the_partition ) ) { _Partition_Free_buffer( the_partition, buffer ); the_partition->number_of_used_blocks -= 1; _Thread_Enable_dispatch(); 4f3fa: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4f3fc: 242e fff4 movel %fp@(-12),%d2 4f400: 246e fff8 moveal %fp@(-8),%a2 4f404: 4e5e unlk %fp 4f406: 4e75 rts _Partition_Free_buffer( the_partition, buffer ); the_partition->number_of_used_blocks -= 1; _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } _Thread_Enable_dispatch(); 4f408: 4eb9 0005 3ec6 jsr 53ec6 <_Thread_Enable_dispatch> 4f40e: 7009 moveq #9,%d0 return RTEMS_INVALID_ADDRESS; 4f410: 60ea bras 4f3fc ... 00045c30 : rtems_status_code rtems_rate_monotonic_period( rtems_id id, rtems_interval length ) { 45c30: 4e56 ffec linkw %fp,#-20 45c34: 48d7 041c moveml %d2-%d4/%a2,%sp@ RTEMS_INLINE_ROUTINE Rate_monotonic_Control *_Rate_monotonic_Get ( Objects_Id id, Objects_Locations *location ) { return (Rate_monotonic_Control *) 45c38: 486e fffc pea %fp@(-4) 45c3c: 262e 0008 movel %fp@(8),%d3 45c40: 2f03 movel %d3,%sp@- 45c42: 4879 0005 d5a4 pea 5d5a4 <_Rate_monotonic_Information> 45c48: 242e 000c movel %fp@(12),%d2 45c4c: 4eb9 0004 7a54 jsr 47a54 <_Objects_Get> rtems_rate_monotonic_period_states local_state; ISR_Level level; the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 45c52: 4fef 000c lea %sp@(12),%sp 45c56: 2440 moveal %d0,%a2 45c58: 4aae fffc tstl %fp@(-4) 45c5c: 6600 0138 bnew 45d96 case OBJECTS_LOCAL: if ( !_Thread_Is_executing( the_period->owner ) ) { 45c60: 2039 0005 d75a movel 5d75a <_Thread_Executing>,%d0 45c66: b0aa 0040 cmpl %a2@(64),%d0 45c6a: 670c beqs 45c78 _Thread_Enable_dispatch(); 45c6c: 4eb9 0004 822a jsr 4822a <_Thread_Enable_dispatch> 45c72: 7817 moveq #23,%d4 return RTEMS_NOT_OWNER_OF_RESOURCE; 45c74: 6000 0122 braw 45d98 } if ( length == RTEMS_PERIOD_STATUS ) { 45c78: 4a82 tstl %d2 45c7a: 6622 bnes 45c9e switch ( the_period->state ) { 45c7c: 202a 0038 movel %a2@(56),%d0 45c80: 7204 moveq #4,%d1 45c82: b280 cmpl %d0,%d1 45c84: 6404 bccs 45c8a <== ALWAYS TAKEN 45c86: 4284 clrl %d4 <== NOT EXECUTED 45c88: 600a bras 45c94 <== NOT EXECUTED 45c8a: 41f9 0005 ad92 lea 5ad92 ,%a0 45c90: 2830 0c00 movel %a0@(00000000,%d0:l:4),%d4 case RATE_MONOTONIC_ACTIVE: default: /* unreached -- only to remove warnings */ return_value = RTEMS_SUCCESSFUL; break; } _Thread_Enable_dispatch(); 45c94: 4eb9 0004 822a jsr 4822a <_Thread_Enable_dispatch> return( return_value ); 45c9a: 6000 00fc braw 45d98 } _ISR_Disable( level ); 45c9e: 203c 0000 0700 movel #1792,%d0 45ca4: 40c4 movew %sr,%d4 45ca6: 8084 orl %d4,%d0 45ca8: 46c0 movew %d0,%sr switch ( the_period->state ) { 45caa: 202a 0038 movel %a2@(56),%d0 45cae: 7202 moveq #2,%d1 45cb0: b280 cmpl %d0,%d1 45cb2: 6740 beqs 45cf4 45cb4: 123c 0004 moveb #4,%d1 45cb8: b280 cmpl %d0,%d1 45cba: 6700 00a4 beqw 45d60 45cbe: 4a80 tstl %d0 45cc0: 6600 00d4 bnew 45d96 case RATE_MONOTONIC_INACTIVE: { _ISR_Enable( level ); 45cc4: 46c4 movew %d4,%sr /* * Baseline statistics information for the beginning of a period. */ _Rate_monotonic_Initiate_statistics( the_period ); 45cc6: 2f0a movel %a2,%sp@- ); the_period->next_length = length; _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 45cc8: 4284 clrl %d4 _ISR_Enable( level ); /* * Baseline statistics information for the beginning of a period. */ _Rate_monotonic_Initiate_statistics( the_period ); 45cca: 4eb9 0004 5a1c jsr 45a1c <_Rate_monotonic_Initiate_statistics> Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 45cd0: 203c 0004 5fdc movel #286684,%d0 the_period->state = RATE_MONOTONIC_ACTIVE; 45cd6: 7202 moveq #2,%d1 45cd8: 2540 002c movel %d0,%a2@(44) the_watchdog->id = id; 45cdc: 2543 0030 movel %d3,%a2@(48) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 45ce0: 2542 001c movel %d2,%a2@(28) 45ce4: 2541 0038 movel %d1,%a2@(56) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 45ce8: 42aa 0018 clrl %a2@(24) the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 45cec: 42aa 0034 clrl %a2@(52) 45cf0: 6000 0084 braw 45d76 case RATE_MONOTONIC_ACTIVE: /* * Update statistics from the concluding period. */ _Rate_monotonic_Update_statistics( the_period ); 45cf4: 2f0a movel %a2,%sp@- 45cf6: 4eb9 0004 5b3c jsr 45b3c <_Rate_monotonic_Update_statistics> * This tells the _Rate_monotonic_Timeout that this task is * in the process of blocking on the period and that we * may be changing the length of the next period. */ the_period->state = RATE_MONOTONIC_OWNER_IS_BLOCKING; the_period->next_length = length; 45cfc: 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; 45d00: 7401 moveq #1,%d2 45d02: 2542 0038 movel %d2,%a2@(56) the_period->next_length = length; _ISR_Enable( level ); 45d06: 46c4 movew %d4,%sr _Thread_Executing->Wait.id = the_period->Object.id; 45d08: 2079 0005 d75a moveal 5d75a <_Thread_Executing>,%a0 45d0e: 216a 0008 0020 movel %a2@(8),%a0@(32) _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 45d14: 4878 4000 pea 4000 45d18: 2f08 movel %a0,%sp@- 45d1a: 4eb9 0004 8a60 jsr 48a60 <_Thread_Set_state> /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); 45d20: 203c 0000 0700 movel #1792,%d0 45d26: 40c1 movew %sr,%d1 45d28: 8081 orl %d1,%d0 45d2a: 46c0 movew %d0,%sr local_state = the_period->state; the_period->state = RATE_MONOTONIC_ACTIVE; 45d2c: 143c 0002 moveb #2,%d2 /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); local_state = the_period->state; 45d30: 202a 0038 movel %a2@(56),%d0 the_period->state = RATE_MONOTONIC_ACTIVE; 45d34: 2542 0038 movel %d2,%a2@(56) _ISR_Enable( level ); 45d38: 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 ) 45d3a: 7203 moveq #3,%d1 45d3c: 4fef 000c lea %sp@(12),%sp 45d40: b280 cmpl %d0,%d1 45d42: 6612 bnes 45d56 _Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 45d44: 4878 4000 pea 4000 45d48: 2f39 0005 d75a movel 5d75a <_Thread_Executing>,%sp@- 45d4e: 4eb9 0004 7e70 jsr 47e70 <_Thread_Clear_state> 45d54: 508f addql #8,%sp _Thread_Enable_dispatch(); 45d56: 4eb9 0004 822a jsr 4822a <_Thread_Enable_dispatch> 45d5c: 4284 clrl %d4 return RTEMS_SUCCESSFUL; 45d5e: 6038 bras 45d98 case RATE_MONOTONIC_EXPIRED: /* * Update statistics from the concluding period */ _Rate_monotonic_Update_statistics( the_period ); 45d60: 2f0a movel %a2,%sp@- 45d62: 4eb9 0004 5b3c jsr 45b3c <_Rate_monotonic_Update_statistics> _ISR_Enable( level ); 45d68: 46c4 movew %d4,%sr the_period->state = RATE_MONOTONIC_ACTIVE; 45d6a: 7002 moveq #2,%d0 the_period->next_length = length; _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 45d6c: 7806 moveq #6,%d4 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 45d6e: 2542 001c movel %d2,%a2@(28) */ _Rate_monotonic_Update_statistics( the_period ); _ISR_Enable( level ); the_period->state = RATE_MONOTONIC_ACTIVE; 45d72: 2540 0038 movel %d0,%a2@(56) the_period->next_length = length; 45d76: 2542 003c movel %d2,%a2@(60) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 45d7a: 486a 0010 pea %a2@(16) 45d7e: 4879 0005 d778 pea 5d778 <_Watchdog_Ticks_chain> 45d84: 4eb9 0004 925c jsr 4925c <_Watchdog_Insert> _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 45d8a: 4eb9 0004 822a jsr 4822a <_Thread_Enable_dispatch> return RTEMS_TIMEOUT; 45d90: 4fef 000c lea %sp@(12),%sp 45d94: 6002 bras 45d98 45d96: 7804 moveq #4,%d4 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 45d98: 2004 movel %d4,%d0 45d9a: 4cee 041c ffec moveml %fp@(-20),%d2-%d4/%a2 45da0: 4e5e unlk %fp <== NOT EXECUTED 0004ff88 : rtems_status_code rtems_region_get_segment_size( rtems_id id, void *segment, uintptr_t *size ) { 4ff88: 4e56 fffc linkw %fp,#-4 4ff8c: 2f03 movel %d3,%sp@- 4ff8e: 262e 0010 movel %fp@(16),%d3 4ff92: 2f02 movel %d2,%sp@- 4ff94: 242e 000c movel %fp@(12),%d2 Objects_Locations location; rtems_status_code return_status = RTEMS_SUCCESSFUL; register Region_Control *the_region; if ( !segment ) 4ff98: 6766 beqs 50000 <== NEVER TAKEN return RTEMS_INVALID_ADDRESS; if ( !size ) 4ff9a: 4a83 tstl %d3 4ff9c: 6762 beqs 50000 <== NEVER TAKEN return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); 4ff9e: 2f39 0007 4136 movel 74136 <_RTEMS_Allocator_Mutex>,%sp@- 4ffa4: 4eb9 0005 1eec jsr 51eec <_API_Mutex_Lock> 4ffaa: 486e fffc pea %fp@(-4) 4ffae: 2f2e 0008 movel %fp@(8),%sp@- 4ffb2: 4879 0007 3f88 pea 73f88 <_Region_Information> 4ffb8: 4eb9 0005 3634 jsr 53634 <_Objects_Get_no_protection> the_region = _Region_Get( id, &location ); switch ( location ) { 4ffbe: 222e fffc movel %fp@(-4),%d1 4ffc2: 4fef 0010 lea %sp@(16),%sp 4ffc6: 670a beqs 4ffd2 4ffc8: 7001 moveq #1,%d0 4ffca: b081 cmpl %d1,%d0 4ffcc: 6620 bnes 4ffee <== NEVER TAKEN 4ffce: 7404 moveq #4,%d2 4ffd0: 601e bras 4fff0 case OBJECTS_LOCAL: if ( !_Heap_Size_of_alloc_area( &the_region->Memory, segment, size ) ) 4ffd2: 2f03 movel %d3,%sp@- 4ffd4: 2040 moveal %d0,%a0 4ffd6: 2f02 movel %d2,%sp@- 4ffd8: 4868 0068 pea %a0@(104) 4ffdc: 4eb9 0005 30b4 jsr 530b4 <_Heap_Size_of_alloc_area> 4ffe2: 4fef 000c lea %sp@(12),%sp 4ffe6: 4a00 tstb %d0 4ffe8: 6604 bnes 4ffee <== ALWAYS TAKEN 4ffea: 7409 moveq #9,%d2 <== NOT EXECUTED 4ffec: 6002 bras 4fff0 <== NOT EXECUTED 4ffee: 4282 clrl %d2 case OBJECTS_ERROR: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 4fff0: 2f39 0007 4136 movel 74136 <_RTEMS_Allocator_Mutex>,%sp@- 4fff6: 4eb9 0005 1f4c jsr 51f4c <_API_Mutex_Unlock> return return_status; 4fffc: 588f addql #4,%sp 4fffe: 6002 bras 50002 50000: 7409 moveq #9,%d2 } 50002: 2002 movel %d2,%d0 50004: 242e fff4 movel %fp@(-12),%d2 50008: 262e fff8 movel %fp@(-8),%d3 5000c: 4e5e unlk %fp <== NOT EXECUTED 00050620 : rtems_status_code rtems_signal_send( rtems_id id, rtems_signal_set signal_set ) { 50620: 4e56 fffc linkw %fp,#-4 50624: 2f03 movel %d3,%sp@- 50626: 2f02 movel %d2,%sp@- 50628: 242e 000c movel %fp@(12),%d2 register Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; ASR_Information *asr; if ( !signal_set ) 5062c: 6606 bnes 50634 5062e: 700a moveq #10,%d0 50630: 6000 0084 braw 506b6 return RTEMS_INVALID_NUMBER; the_thread = _Thread_Get( id, &location ); 50634: 486e fffc pea %fp@(-4) 50638: 2f2e 0008 movel %fp@(8),%sp@- 5063c: 4eb9 0005 3f1c jsr 53f1c <_Thread_Get> switch ( location ) { 50642: 508f addql #8,%sp 50644: 4aae fffc tstl %fp@(-4) 50648: 6704 beqs 5064e 5064a: 7004 moveq #4,%d0 5064c: 6068 bras 506b6 case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; 5064e: 2240 moveal %d0,%a1 50650: 2069 0108 moveal %a1@(264),%a0 asr = &api->Signal; 50654: 4aa8 000a tstl %a0@(10) 50658: 6754 beqs 506ae if ( ! _ASR_Is_null_handler( asr->handler ) ) { if ( asr->is_enabled ) { 5065a: 4a28 0008 tstb %a0@(8) 5065e: 6732 beqs 50692 rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 50660: 223c 0000 0700 movel #1792,%d1 50666: 40c3 movew %sr,%d3 50668: 8283 orl %d3,%d1 5066a: 46c1 movew %d1,%sr *signal_set |= signals; 5066c: 85a8 0012 orl %d2,%a0@(18) _ISR_Enable( _level ); 50670: 46c3 movew %d3,%sr _ASR_Post_signals( signal_set, &asr->signals_posted ); the_thread->do_post_task_switch_extension = true; if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 50672: 2239 0007 411e movel 7411e <_ISR_Nest_level>,%d1 if ( ! _ASR_Is_null_handler( asr->handler ) ) { if ( asr->is_enabled ) { _ASR_Post_signals( signal_set, &asr->signals_posted ); the_thread->do_post_task_switch_extension = true; 50678: 7401 moveq #1,%d2 5067a: 1342 0074 moveb %d2,%a1@(116) if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 5067e: 4a81 tstl %d1 50680: 6722 beqs 506a4 50682: b0b9 0007 413e cmpl 7413e <_Thread_Executing>,%d0 50688: 661a bnes 506a4 <== NEVER TAKEN _ISR_Signals_to_thread_executing = true; 5068a: 13c2 0007 41c8 moveb %d2,741c8 <_ISR_Signals_to_thread_executing> 50690: 6012 bras 506a4 rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 50692: 203c 0000 0700 movel #1792,%d0 50698: 40c1 movew %sr,%d1 5069a: 8081 orl %d1,%d0 5069c: 46c0 movew %d0,%sr *signal_set |= signals; 5069e: 85a8 0016 orl %d2,%a0@(22) _ISR_Enable( _level ); 506a2: 46c1 movew %d1,%sr } else { _ASR_Post_signals( signal_set, &asr->signals_pending ); } _Thread_Enable_dispatch(); 506a4: 4eb9 0005 3ec6 jsr 53ec6 <_Thread_Enable_dispatch> 506aa: 4280 clrl %d0 return RTEMS_SUCCESSFUL; 506ac: 6008 bras 506b6 } _Thread_Enable_dispatch(); 506ae: 4eb9 0005 3ec6 jsr 53ec6 <_Thread_Enable_dispatch> 506b4: 700b moveq #11,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 506b6: 242e fff4 movel %fp@(-12),%d2 506ba: 262e fff8 movel %fp@(-8),%d3 506be: 4e5e unlk %fp ... 0004b0dc : rtems_status_code rtems_task_mode( rtems_mode mode_set, rtems_mode mask, rtems_mode *previous_mode_set ) { 4b0dc: 4e56 ffe4 linkw %fp,#-28 4b0e0: 48d7 1c3c moveml %d2-%d5/%a2-%a4,%sp@ 4b0e4: 262e 0008 movel %fp@(8),%d3 4b0e8: 282e 000c movel %fp@(12),%d4 4b0ec: 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 ) 4b0f0: 4a8c tstl %a4 4b0f2: 6606 bnes 4b0fa 4b0f4: 7009 moveq #9,%d0 4b0f6: 6000 00fc braw 4b1f4 return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; 4b0fa: 2479 0005 bb32 moveal 5bb32 <_Thread_Executing>,%a2 api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 4b100: 4a2a 0075 tstb %a2@(117) 4b104: 57c0 seq %d0 4b106: 243c 0000 0100 movel #256,%d2 4b10c: 49c0 extbl %d0 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 4b10e: 266a 0108 moveal %a2@(264),%a3 asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 4b112: c480 andl %d0,%d2 if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) 4b114: 4aaa 007a tstl %a2@(122) 4b118: 6704 beqs 4b11e old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; 4b11a: 08c2 0009 bset #9,%d2 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; 4b11e: 4a2b 0008 tstb %a3@(8) 4b122: 57c0 seq %d0 4b124: 2a3c 0000 0400 movel #1024,%d5 4b12a: 49c0 extbl %d0 4b12c: ca80 andl %d0,%d5 old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; old_mode |= _ISR_Get_level(); 4b12e: 4eb9 0004 7f20 jsr 47f20 <_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; 4b134: 8085 orl %d5,%d0 old_mode |= _ISR_Get_level(); *previous_mode_set = old_mode; 4b136: 8082 orl %d2,%d0 4b138: 2880 movel %d0,%a4@ /* * These are generic thread scheduling characteristics. */ if ( mask & RTEMS_PREEMPT_MASK ) 4b13a: 0804 0008 btst #8,%d4 4b13e: 670e beqs 4b14e executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; 4b140: 2003 movel %d3,%d0 4b142: 7201 moveq #1,%d1 4b144: e088 lsrl #8,%d0 4b146: b380 eorl %d1,%d0 4b148: c081 andl %d1,%d0 4b14a: 1540 0075 moveb %d0,%a2@(117) if ( mask & RTEMS_TIMESLICE_MASK ) { 4b14e: 0804 0009 btst #9,%d4 4b152: 671c beqs 4b170 if ( _Modes_Is_timeslice(mode_set) ) { 4b154: 0803 0009 btst #9,%d3 4b158: 6712 beqs 4b16c executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 4b15a: 41f9 0005 ba28 lea 5ba28 <_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; 4b160: 7001 moveq #1,%d0 executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 4b162: 2550 0076 movel %a0@,%a2@(118) if ( mask & RTEMS_PREEMPT_MASK ) executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; if ( mask & RTEMS_TIMESLICE_MASK ) { if ( _Modes_Is_timeslice(mode_set) ) { executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 4b166: 2540 007a movel %d0,%a2@(122) 4b16a: 6004 bras 4b170 executing->cpu_time_budget = _Thread_Ticks_per_timeslice; } else executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 4b16c: 42aa 007a clrl %a2@(122) /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) 4b170: 7007 moveq #7,%d0 4b172: c084 andl %d4,%d0 4b174: 6712 beqs 4b188 */ RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level ( Modes_Control mode_set ) { _ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) ); 4b176: 40c0 movew %sr,%d0 4b178: 7207 moveq #7,%d1 4b17a: c283 andl %d3,%d1 4b17c: 0280 0000 f8ff andil #63743,%d0 4b182: e189 lsll #8,%d1 4b184: 8081 orl %d1,%d0 4b186: 46c0 movew %d0,%sr */ is_asr_enabled = false; needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { 4b188: 0804 000a btst #10,%d4 4b18c: 6744 beqs 4b1d2 * Output: * *previous_mode_set - previous mode set * always return RTEMS_SUCCESSFUL; */ rtems_status_code rtems_task_mode( 4b18e: 700a moveq #10,%d0 4b190: e0ab lsrl %d0,%d3 4b192: 7201 moveq #1,%d1 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; 4b194: 4280 clrl %d0 4b196: 102b 0008 moveb %a3@(8),%d0 * Output: * *previous_mode_set - previous mode set * always return RTEMS_SUCCESSFUL; */ rtems_status_code rtems_task_mode( 4b19a: b383 eorl %d1,%d3 4b19c: c681 andl %d1,%d3 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; 4b19e: b083 cmpl %d3,%d0 4b1a0: 6730 beqs 4b1d2 ) { rtems_signal_set _signals; ISR_Level _level; _ISR_Disable( _level ); 4b1a2: 203c 0000 0700 movel #1792,%d0 needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true; if ( is_asr_enabled != asr->is_enabled ) { asr->is_enabled = is_asr_enabled; 4b1a8: 1743 0008 moveb %d3,%a3@(8) 4b1ac: 40c1 movew %sr,%d1 4b1ae: 8081 orl %d1,%d0 4b1b0: 46c0 movew %d0,%sr _signals = information->signals_pending; 4b1b2: 202b 0016 movel %a3@(22),%d0 information->signals_pending = information->signals_posted; 4b1b6: 276b 0012 0016 movel %a3@(18),%a3@(22) information->signals_posted = _signals; 4b1bc: 2740 0012 movel %d0,%a3@(18) _ISR_Enable( _level ); 4b1c0: 46c1 movew %d1,%sr if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; 4b1c2: 4aab 0012 tstl %a3@(18) 4b1c6: 670a beqs 4b1d2 if ( is_asr_enabled != asr->is_enabled ) { asr->is_enabled = is_asr_enabled; _ASR_Swap_signals( asr ); if ( _ASR_Are_signals_pending( asr ) ) { needs_asr_dispatching = true; executing->do_post_task_switch_extension = true; 4b1c8: 7001 moveq #1,%d0 4b1ca: 7401 moveq #1,%d2 4b1cc: 1540 0074 moveb %d0,%a2@(116) 4b1d0: 6002 bras 4b1d4 4b1d2: 4202 clrb %d2 } } } if ( _System_state_Is_up( _System_state_Get() ) ) 4b1d4: 7203 moveq #3,%d1 4b1d6: b2b9 0005 bbfa cmpl 5bbfa <_System_state_Current>,%d1 4b1dc: 6614 bnes 4b1f2 <== NEVER TAKEN if ( _Thread_Evaluate_mode() || needs_asr_dispatching ) 4b1de: 4eb9 0004 b4bc jsr 4b4bc <_Thread_Evaluate_mode> 4b1e4: 4a00 tstb %d0 4b1e6: 6604 bnes 4b1ec 4b1e8: 4a02 tstb %d2 4b1ea: 6706 beqs 4b1f2 _Thread_Dispatch(); 4b1ec: 4eb9 0004 6b10 jsr 46b10 <_Thread_Dispatch> 4b1f2: 4280 clrl %d0 return RTEMS_SUCCESSFUL; } 4b1f4: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4 4b1fa: 4e5e unlk %fp ... 000494cc : rtems_status_code rtems_task_set_priority( rtems_id id, rtems_task_priority new_priority, rtems_task_priority *old_priority ) { 494cc: 4e56 fffc linkw %fp,#-4 494d0: 2f0a movel %a2,%sp@- 494d2: 246e 0010 moveal %fp@(16),%a2 494d6: 2f02 movel %d2,%sp@- 494d8: 242e 000c movel %fp@(12),%d2 register Thread_Control *the_thread; Objects_Locations location; if ( new_priority != RTEMS_CURRENT_PRIORITY && 494dc: 6710 beqs 494ee 494de: 4280 clrl %d0 494e0: 1039 0005 fa32 moveb 5fa32 ,%d0 494e6: b082 cmpl %d2,%d0 494e8: 6404 bccs 494ee 494ea: 7013 moveq #19,%d0 494ec: 6054 bras 49542 !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; if ( !old_priority ) 494ee: 4a8a tstl %a2 494f0: 6604 bnes 494f6 494f2: 7009 moveq #9,%d0 494f4: 604c bras 49542 return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); 494f6: 486e fffc pea %fp@(-4) 494fa: 2f2e 0008 movel %fp@(8),%sp@- 494fe: 4eb9 0004 b158 jsr 4b158 <_Thread_Get> switch ( location ) { 49504: 508f addql #8,%sp return RTEMS_INVALID_PRIORITY; if ( !old_priority ) return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); 49506: 2040 moveal %d0,%a0 switch ( location ) { 49508: 4aae fffc tstl %fp@(-4) 4950c: 6704 beqs 49512 4950e: 7004 moveq #4,%d0 49510: 6030 bras 49542 case OBJECTS_LOCAL: /* XXX need helper to "convert" from core priority */ *old_priority = the_thread->current_priority; 49512: 24a8 0014 movel %a0@(20),%a2@ if ( new_priority != RTEMS_CURRENT_PRIORITY ) { 49516: 4a82 tstl %d2 49518: 6720 beqs 4953a the_thread->real_priority = new_priority; 4951a: 2142 0018 movel %d2,%a0@(24) if ( the_thread->resource_count == 0 || 4951e: 4aa8 001c tstl %a0@(28) 49522: 6706 beqs 4952a the_thread->current_priority > new_priority ) 49524: b4a8 0014 cmpl %a0@(20),%d2 49528: 6410 bccs 4953a <== ALWAYS TAKEN _Thread_Change_priority( the_thread, new_priority, false ); 4952a: 42a7 clrl %sp@- 4952c: 2f02 movel %d2,%sp@- 4952e: 2f08 movel %a0,%sp@- 49530: 4eb9 0004 ac08 jsr 4ac08 <_Thread_Change_priority> 49536: 4fef 000c lea %sp@(12),%sp } _Thread_Enable_dispatch(); 4953a: 4eb9 0004 b102 jsr 4b102 <_Thread_Enable_dispatch> 49540: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 49542: 242e fff4 movel %fp@(-12),%d2 49546: 246e fff8 moveal %fp@(-8),%a2 4954a: 4e5e unlk %fp ... 00050ea8 : */ rtems_status_code rtems_timer_cancel( rtems_id id ) { 50ea8: 4e56 fffc linkw %fp,#-4 RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Get ( Objects_Id id, Objects_Locations *location ) { return (Timer_Control *) 50eac: 486e fffc pea %fp@(-4) 50eb0: 2f2e 0008 movel %fp@(8),%sp@- 50eb4: 4879 0007 42a6 pea 742a6 <_Timer_Information> 50eba: 4eb9 0005 366c jsr 5366c <_Objects_Get> Timer_Control *the_timer; Objects_Locations location; the_timer = _Timer_Get( id, &location ); switch ( location ) { 50ec0: 4fef 000c lea %sp@(12),%sp 50ec4: 4aae fffc tstl %fp@(-4) 50ec8: 6704 beqs 50ece 50eca: 7004 moveq #4,%d0 50ecc: 601e bras 50eec case OBJECTS_LOCAL: if ( !_Timer_Is_dormant_class( the_timer->the_class ) ) 50ece: 7204 moveq #4,%d1 50ed0: 2040 moveal %d0,%a0 50ed2: b2a8 0038 cmpl %a0@(56),%d1 50ed6: 670c beqs 50ee4 <== NEVER TAKEN (void) _Watchdog_Remove( &the_timer->Ticker ); 50ed8: 4868 0010 pea %a0@(16) 50edc: 4eb9 0005 5200 jsr 55200 <_Watchdog_Remove> 50ee2: 588f addql #4,%sp _Thread_Enable_dispatch(); 50ee4: 4eb9 0005 3ec6 jsr 53ec6 <_Thread_Enable_dispatch> 50eea: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 50eec: 4e5e unlk %fp <== NOT EXECUTED 0005132c : rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ) { 5132c: 4e56 ffe8 linkw %fp,#-24 51330: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 51334: 282e 0008 movel %fp@(8),%d4 51338: 262e 000c movel %fp@(12),%d3 5133c: 242e 0010 movel %fp@(16),%d2 Timer_Control *the_timer; Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; 51340: 2679 0007 42de moveal 742de <_Timer_server>,%a3 if ( !timer_server ) 51346: 4a8b tstl %a3 51348: 6606 bnes 51350 5134a: 700e moveq #14,%d0 5134c: 6000 00a4 braw 513f2 return RTEMS_INCORRECT_STATE; if ( !_TOD_Is_set ) 51350: 4a39 0007 4098 tstb 74098 <_TOD_Is_set> 51356: 6606 bnes 5135e <== ALWAYS TAKEN 51358: 700b moveq #11,%d0 <== NOT EXECUTED 5135a: 6000 0096 braw 513f2 <== NOT EXECUTED return RTEMS_NOT_DEFINED; if ( !routine ) 5135e: 4a82 tstl %d2 51360: 6606 bnes 51368 51362: 7009 moveq #9,%d0 51364: 6000 008c braw 513f2 return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) 51368: 2f03 movel %d3,%sp@- 5136a: 4eb9 0004 e7a8 jsr 4e7a8 <_TOD_Validate> 51370: 588f addql #4,%sp 51372: 4a00 tstb %d0 51374: 677a beqs 513f0 return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 51376: 2f03 movel %d3,%sp@- 51378: 4eb9 0004 e708 jsr 4e708 <_TOD_To_seconds> if ( seconds <= _TOD_Seconds_since_epoch() ) 5137e: 588f addql #4,%sp return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 51380: 2600 movel %d0,%d3 if ( seconds <= _TOD_Seconds_since_epoch() ) 51382: b0b9 0007 4116 cmpl 74116 <_TOD_Now>,%d0 51388: 6366 blss 513f0 5138a: 486e fffc pea %fp@(-4) 5138e: 2f04 movel %d4,%sp@- 51390: 4879 0007 42a6 pea 742a6 <_Timer_Information> 51396: 4eb9 0005 366c jsr 5366c <_Objects_Get> return RTEMS_INVALID_CLOCK; the_timer = _Timer_Get( id, &location ); switch ( location ) { 5139c: 4fef 000c lea %sp@(12),%sp 513a0: 2440 moveal %d0,%a2 513a2: 4aae fffc tstl %fp@(-4) 513a6: 6704 beqs 513ac 513a8: 7004 moveq #4,%d0 513aa: 6046 bras 513f2 case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); 513ac: 486a 0010 pea %a2@(16) 513b0: 4eb9 0005 5200 jsr 55200 <_Watchdog_Remove> the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 513b6: 256e 0014 0034 movel %fp@(20),%a2@(52) the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK; 513bc: 7003 moveq #3,%d0 void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; 513be: 2544 0030 movel %d4,%a2@(48) _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); 513c2: 96b9 0007 4116 subl 74116 <_TOD_Now>,%d3 the_timer = _Timer_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK; 513c8: 2540 0038 movel %d0,%a2@(56) _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); 513cc: 2543 001c movel %d3,%a2@(28) Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 513d0: 2542 002c movel %d2,%a2@(44) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 513d4: 42aa 0018 clrl %a2@(24) (*timer_server->schedule_operation)( timer_server, the_timer ); 513d8: 2f0a movel %a2,%sp@- 513da: 2f0b movel %a3,%sp@- 513dc: 206b 0004 moveal %a3@(4),%a0 513e0: 4e90 jsr %a0@ _Thread_Enable_dispatch(); 513e2: 4eb9 0005 3ec6 jsr 53ec6 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 513e8: 4fef 000c lea %sp@(12),%sp _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); (*timer_server->schedule_operation)( timer_server, the_timer ); _Thread_Enable_dispatch(); 513ec: 4280 clrl %d0 return RTEMS_SUCCESSFUL; 513ee: 6002 bras 513f2 513f0: 7014 moveq #20,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 513f2: 4cee 0c1c ffe8 moveml %fp@(-24),%d2-%d4/%a2-%a3 513f8: 4e5e unlk %fp <== NOT EXECUTED