00046764 <_API_Mutex_Unlock>: #include void _API_Mutex_Unlock( API_Mutex_Control *the_mutex ) { 46764: 4e56 0000 linkw %fp,#0 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 46768: 2039 0005 ef78 movel 5ef78 <_Thread_Dispatch_disable_level>,%d0 4676e: 5280 addql #1,%d0 46770: 206e 0008 moveal %fp@(8),%a0 46774: 23c0 0005 ef78 movel %d0,5ef78 <_Thread_Dispatch_disable_level> _Thread_Disable_dispatch(); _CORE_mutex_Surrender( 4677a: 42a7 clrl %sp@- 4677c: 2f28 0008 movel %a0@(8),%sp@- 46780: 4868 0010 pea %a0@(16) 46784: 4eb9 0004 6a08 jsr 46a08 <_CORE_mutex_Surrender> &the_mutex->Mutex, the_mutex->Object.id, NULL ); _Thread_Enable_dispatch(); 4678a: 4fef 000c lea %sp@(12),%sp } 4678e: 4e5e unlk %fp _CORE_mutex_Surrender( &the_mutex->Mutex, the_mutex->Object.id, NULL ); _Thread_Enable_dispatch(); 46790: 4ef9 0004 7dbc jmp 47dbc <_Thread_Enable_dispatch> ... 00048bdc <_CORE_RWLock_Obtain_for_writing>: * Otherwise, we have to block. * If locked for reading and no waiters, then OK to read. * If any thread is waiting, then we wait. */ _ISR_Disable( level ); 48bdc: 203c 0000 0700 movel #1792,%d0 Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_RWLock_API_mp_support_callout api_rwlock_mp_support ) { 48be2: 4e56 fff4 linkw %fp,#-12 48be6: 206e 0008 moveal %fp@(8),%a0 48bea: 48d7 001c moveml %d2-%d4,%sp@ 48bee: 282e 000c movel %fp@(12),%d4 48bf2: 242e 0010 movel %fp@(16),%d2 48bf6: 262e 0014 movel %fp@(20),%d3 ISR_Level level; Thread_Control *executing = _Thread_Executing; 48bfa: 2279 0006 1d86 moveal 61d86 <_Thread_Executing>,%a1 * Otherwise, we have to block. * If locked for reading and no waiters, then OK to read. * If any thread is waiting, then we wait. */ _ISR_Disable( level ); 48c00: 40c1 movew %sr,%d1 48c02: 8081 orl %d1,%d0 48c04: 46c0 movew %d0,%sr switch ( the_rwlock->current_state ) { 48c06: 4aa8 0044 tstl %a0@(68) 48c0a: 6614 bnes 48c20 <_CORE_RWLock_Obtain_for_writing+0x44> case CORE_RWLOCK_UNLOCKED: the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_WRITING; 48c0c: 7002 moveq #2,%d0 48c0e: 2140 0044 movel %d0,%a0@(68) _ISR_Enable( level ); 48c12: 46c1 movew %d1,%sr executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 48c14: 42a9 0034 clrl %a1@(52) _CORE_RWLock_Timeout ); /* return to API level so it can dispatch and we block */ } 48c18: 4cd7 001c moveml %sp@,%d2-%d4 48c1c: 4e5e unlk %fp 48c1e: 4e75 rts /* * If the thread is not willing to wait, then return immediately. */ if ( !wait ) { 48c20: 4a02 tstb %d2 48c22: 6610 bnes 48c34 <_CORE_RWLock_Obtain_for_writing+0x58> _ISR_Enable( level ); 48c24: 46c1 movew %d1,%sr executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; 48c26: 7002 moveq #2,%d0 _CORE_RWLock_Timeout ); /* return to API level so it can dispatch and we block */ } 48c28: 4cd7 001c moveml %sp@,%d2-%d4 * If the thread is not willing to wait, then return immediately. */ if ( !wait ) { _ISR_Enable( level ); executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; 48c2c: 2340 0034 movel %d0,%a1@(52) _CORE_RWLock_Timeout ); /* return to API level so it can dispatch and we block */ } 48c30: 4e5e unlk %fp 48c32: 4e75 rts */ _Thread_queue_Enter_critical_section( &the_rwlock->Wait_queue ); executing->Wait.queue = &the_rwlock->Wait_queue; executing->Wait.id = id; executing->Wait.option = CORE_RWLOCK_THREAD_WAITING_FOR_WRITE; 48c34: 7001 moveq #1,%d0 * We need to wait to enter this critical section */ _Thread_queue_Enter_critical_section( &the_rwlock->Wait_queue ); executing->Wait.queue = &the_rwlock->Wait_queue; executing->Wait.id = id; 48c36: 2344 0020 movel %d4,%a1@(32) executing->Wait.option = CORE_RWLOCK_THREAD_WAITING_FOR_WRITE; executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 48c3a: 42a9 0034 clrl %a1@(52) /* * We need to wait to enter this critical section */ _Thread_queue_Enter_critical_section( &the_rwlock->Wait_queue ); executing->Wait.queue = &the_rwlock->Wait_queue; 48c3e: 2348 0044 movel %a0,%a1@(68) executing->Wait.id = id; executing->Wait.option = CORE_RWLOCK_THREAD_WAITING_FOR_WRITE; 48c42: 2340 0030 movel %d0,%a1@(48) 48c46: 2140 0030 movel %d0,%a0@(48) executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; _ISR_Enable( level ); 48c4a: 46c1 movew %d1,%sr _Thread_queue_Enqueue_with_handler( 48c4c: 2d43 000c movel %d3,%fp@(12) 48c50: 203c 0004 8d48 movel #298312,%d0 48c56: 2d48 0008 movel %a0,%fp@(8) 48c5a: 2d40 0010 movel %d0,%fp@(16) _CORE_RWLock_Timeout ); /* return to API level so it can dispatch and we block */ } 48c5e: 4cd7 001c moveml %sp@,%d2-%d4 48c62: 4e5e unlk %fp executing->Wait.id = id; executing->Wait.option = CORE_RWLOCK_THREAD_WAITING_FOR_WRITE; executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; _ISR_Enable( level ); _Thread_queue_Enqueue_with_handler( 48c64: 4ef9 0004 a5c4 jmp 4a5c4 <_Thread_queue_Enqueue_with_handler> ... 0004df24 <_CORE_barrier_Wait>: Thread_Control *executing; ISR_Level level; executing = _Thread_Executing; executing->Wait.return_code = CORE_BARRIER_STATUS_SUCCESSFUL; _ISR_Disable( level ); 4df24: 203c 0000 0700 movel #1792,%d0 Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_barrier_API_mp_support_callout api_barrier_mp_support ) { 4df2a: 4e56 fff4 linkw %fp,#-12 Thread_Control *executing; ISR_Level level; executing = _Thread_Executing; 4df2e: 2279 0005 f032 moveal 5f032 <_Thread_Executing>,%a1 Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_barrier_API_mp_support_callout api_barrier_mp_support ) { 4df34: 48d7 001c moveml %d2-%d4,%sp@ 4df38: 242e 000c movel %fp@(12),%d2 4df3c: 262e 0014 movel %fp@(20),%d3 Thread_Control *executing; ISR_Level level; executing = _Thread_Executing; executing->Wait.return_code = CORE_BARRIER_STATUS_SUCCESSFUL; 4df40: 42a9 0034 clrl %a1@(52) Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_barrier_API_mp_support_callout api_barrier_mp_support ) { 4df44: 206e 0008 moveal %fp@(8),%a0 4df48: 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 ); 4df4c: 40c1 movew %sr,%d1 4df4e: 8081 orl %d1,%d0 4df50: 46c0 movew %d0,%sr the_barrier->number_of_waiting_threads++; 4df52: 2028 0048 movel %a0@(72),%d0 4df56: 5280 addql #1,%d0 4df58: 2140 0048 movel %d0,%a0@(72) if ( _CORE_barrier_Is_automatic( &the_barrier->Attributes ) ) { 4df5c: 4aa8 0040 tstl %a0@(64) 4df60: 6606 bnes 4df68 <_CORE_barrier_Wait+0x44> if ( the_barrier->number_of_waiting_threads == the_barrier->Attributes.maximum_count) { 4df62: b0a8 0044 cmpl %a0@(68),%d0 4df66: 672e beqs 4df96 <_CORE_barrier_Wait+0x72> 4df68: 7001 moveq #1,%d0 } } _Thread_queue_Enter_critical_section( &the_barrier->Wait_queue ); executing->Wait.queue = &the_barrier->Wait_queue; executing->Wait.id = id; 4df6a: 2342 0020 movel %d2,%a1@(32) return; } } _Thread_queue_Enter_critical_section( &the_barrier->Wait_queue ); executing->Wait.queue = &the_barrier->Wait_queue; 4df6e: 2348 0044 movel %a0,%a1@(68) 4df72: 2140 0030 movel %d0,%a0@(48) executing->Wait.id = id; _ISR_Enable( level ); 4df76: 46c1 movew %d1,%sr _Thread_queue_Enqueue( &the_barrier->Wait_queue, timeout ); 4df78: 2d43 000c movel %d3,%fp@(12) 4df7c: 203c 0004 8678 movel #296568,%d0 4df82: 2d48 0008 movel %a0,%fp@(8) 4df86: 2d40 0010 movel %d0,%fp@(16) } 4df8a: 4cd7 001c moveml %sp@,%d2-%d4 4df8e: 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 ); 4df90: 4ef9 0004 8318 jmp 48318 <_Thread_queue_Enqueue_with_handler> _ISR_Disable( level ); the_barrier->number_of_waiting_threads++; if ( _CORE_barrier_Is_automatic( &the_barrier->Attributes ) ) { if ( the_barrier->number_of_waiting_threads == the_barrier->Attributes.maximum_count) { executing->Wait.return_code = CORE_BARRIER_STATUS_AUTOMATICALLY_RELEASED; 4df96: 7001 moveq #1,%d0 4df98: 2340 0034 movel %d0,%a1@(52) _ISR_Enable( level ); 4df9c: 46c1 movew %d1,%sr _CORE_barrier_Release( the_barrier, id, api_barrier_mp_support ); 4df9e: 2d44 0010 movel %d4,%fp@(16) 4dfa2: 2d42 000c movel %d2,%fp@(12) 4dfa6: 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 ); } 4dfaa: 4cd7 001c moveml %sp@,%d2-%d4 4dfae: 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 ); 4dfb0: 4ef9 0004 dee8 jmp 4dee8 <_CORE_barrier_Release> ... 00059f8c <_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 ) { 59f8c: 4e56 ffe0 linkw %fp,#-32 59f90: 48d7 3c3c moveml %d2-%d5/%a2-%a5,%sp@ 59f94: 266e 0008 moveal %fp@(8),%a3 59f98: 282e 000c movel %fp@(12),%d4 59f9c: 242e 0010 movel %fp@(16),%d2 59fa0: 2a2e 001c movel %fp@(28),%d5 Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; if ( size > the_message_queue->maximum_message_size ) { 59fa4: b4ab 004c cmpl %a3@(76),%d2 59fa8: 6262 bhis 5a00c <_CORE_message_queue_Broadcast+0x80> * NOTE: This check is critical because threads can block on * send and receive and this ensures that we are broadcasting * the message to threads waiting to receive -- not to send. */ if ( the_message_queue->number_of_pending_messages != 0 ) { 59faa: 4aab 0048 tstl %a3@(72) 59fae: 664c bnes 59ffc <_CORE_message_queue_Broadcast+0x70> * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { 59fb0: 2f0b movel %a3,%sp@- 59fb2: 49f9 0005 c6ec lea 5c6ec <_Thread_queue_Dequeue>,%a4 59fb8: 4283 clrl %d3 const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 59fba: 4bf9 0006 3654 lea 63654 ,%a5 59fc0: 4e94 jsr %a4@ /* * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = 59fc2: 588f addql #4,%sp _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { 59fc4: 2440 moveal %d0,%a2 /* * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = 59fc6: 4a80 tstl %d0 59fc8: 6722 beqs 59fec <_CORE_message_queue_Broadcast+0x60> 59fca: 2f02 movel %d2,%sp@- _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { waitp = &the_thread->Wait; number_broadcasted += 1; 59fcc: 5283 addql #1,%d3 59fce: 2f04 movel %d4,%sp@- 59fd0: 2f2a 002c movel %a2@(44),%sp@- 59fd4: 4e95 jsr %a5@ buffer, waitp->return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; 59fd6: 206a 0028 moveal %a2@(40),%a0 59fda: 4fef 000c lea %sp@(12),%sp 59fde: 2082 movel %d2,%a0@ * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { 59fe0: 2f0b movel %a3,%sp@- 59fe2: 4e94 jsr %a4@ /* * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = 59fe4: 588f addql #4,%sp _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { 59fe6: 2440 moveal %d0,%a2 /* * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = 59fe8: 4a80 tstl %d0 59fea: 66de bnes 59fca <_CORE_message_queue_Broadcast+0x3e> if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_message_queue_mp_support) ( the_thread, id ); #endif } *count = number_broadcasted; 59fec: 2045 moveal %d5,%a0 59fee: 4280 clrl %d0 59ff0: 2083 movel %d3,%a0@ return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; } 59ff2: 4cee 3c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a5 59ff8: 4e5e unlk %fp 59ffa: 4e75 rts * send and receive and this ensures that we are broadcasting * the message to threads waiting to receive -- not to send. */ if ( the_message_queue->number_of_pending_messages != 0 ) { *count = 0; 59ffc: 2045 moveal %d5,%a0 59ffe: 4280 clrl %d0 #endif } *count = number_broadcasted; return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; } 5a000: 4cee 3c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a5 * send and receive and this ensures that we are broadcasting * the message to threads waiting to receive -- not to send. */ if ( the_message_queue->number_of_pending_messages != 0 ) { *count = 0; 5a006: 4290 clrl %a0@ #endif } *count = number_broadcasted; return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; } 5a008: 4e5e unlk %fp 5a00a: 4e75 rts { Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; if ( size > the_message_queue->maximum_message_size ) { 5a00c: 7001 moveq #1,%d0 <== NOT EXECUTED #endif } *count = number_broadcasted; return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; } 5a00e: 4cee 3c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a5 <== NOT EXECUTED 5a014: 4e5e unlk %fp <== NOT EXECUTED 00053d28 <_CORE_message_queue_Close>: void _CORE_message_queue_Close( CORE_message_queue_Control *the_message_queue, Thread_queue_Flush_callout remote_extract_callout, uint32_t status ) { 53d28: 4e56 0000 linkw %fp,#0 53d2c: 2f0a movel %a2,%sp@- /* * This will flush blocked threads whether they were blocked on * a send or receive. */ _Thread_queue_Flush( 53d2e: 2f2e 0010 movel %fp@(16),%sp@- 53d32: 2f2e 000c movel %fp@(12),%sp@- void _CORE_message_queue_Close( CORE_message_queue_Control *the_message_queue, Thread_queue_Flush_callout remote_extract_callout, uint32_t status ) { 53d36: 246e 0008 moveal %fp@(8),%a2 /* * This will flush blocked threads whether they were blocked on * a send or receive. */ _Thread_queue_Flush( 53d3a: 2f0a movel %a2,%sp@- 53d3c: 4eb9 0004 db4c jsr 4db4c <_Thread_queue_Flush> * This removes all messages from the pending message queue. Since * we just flushed all waiting threads, we don't have to worry about * the flush satisfying any blocked senders as a side-effect. */ if ( the_message_queue->number_of_pending_messages != 0 ) 53d42: 4fef 000c lea %sp@(12),%sp 53d46: 4aaa 0048 tstl %a2@(72) 53d4a: 6612 bnes 53d5e <_CORE_message_queue_Close+0x36> (void) _CORE_message_queue_Flush_support( the_message_queue ); (void) _Workspace_Free( the_message_queue->message_buffers ); 53d4c: 2d6a 005c 0008 movel %a2@(92),%fp@(8) } 53d52: 246e fffc moveal %fp@(-4),%a2 53d56: 4e5e unlk %fp */ if ( the_message_queue->number_of_pending_messages != 0 ) (void) _CORE_message_queue_Flush_support( the_message_queue ); (void) _Workspace_Free( the_message_queue->message_buffers ); 53d58: 4ef9 0004 e87c jmp 4e87c <_Workspace_Free> * we just flushed all waiting threads, we don't have to worry about * the flush satisfying any blocked senders as a side-effect. */ if ( the_message_queue->number_of_pending_messages != 0 ) (void) _CORE_message_queue_Flush_support( the_message_queue ); 53d5e: 2f0a movel %a2,%sp@- 53d60: 4eb9 0005 3d7c jsr 53d7c <_CORE_message_queue_Flush_support> (void) _Workspace_Free( the_message_queue->message_buffers ); 53d66: 2d6a 005c 0008 movel %a2@(92),%fp@(8) * we just flushed all waiting threads, we don't have to worry about * the flush satisfying any blocked senders as a side-effect. */ if ( the_message_queue->number_of_pending_messages != 0 ) (void) _CORE_message_queue_Flush_support( the_message_queue ); 53d6c: 588f addql #4,%sp (void) _Workspace_Free( the_message_queue->message_buffers ); } 53d6e: 246e fffc moveal %fp@(-4),%a2 53d72: 4e5e unlk %fp */ if ( the_message_queue->number_of_pending_messages != 0 ) (void) _CORE_message_queue_Flush_support( the_message_queue ); (void) _Workspace_Free( the_message_queue->message_buffers ); 53d74: 4ef9 0004 e87c jmp 4e87c <_Workspace_Free> ... 0004fde4 <_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)) { 4fde4: 7203 moveq #3,%d1 CORE_message_queue_Control *the_message_queue, CORE_message_queue_Attributes *the_message_queue_attributes, uint32_t maximum_pending_messages, size_t maximum_message_size ) { 4fde6: 4e56 fff4 linkw %fp,#-12 4fdea: 202e 0014 movel %fp@(20),%d0 4fdee: 48d7 040c moveml %d2-%d3/%a2,%sp@ 4fdf2: 246e 0008 moveal %fp@(8),%a2 4fdf6: 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)) { 4fdfa: c280 andl %d0,%d1 ) { size_t message_buffering_required; size_t allocated_message_size; the_message_queue->maximum_pending_messages = maximum_pending_messages; 4fdfc: 2542 0044 movel %d2,%a2@(68) the_message_queue->number_of_pending_messages = 0; 4fe00: 42aa 0048 clrl %a2@(72) the_message_queue->maximum_message_size = maximum_message_size; 4fe04: 2540 004c movel %d0,%a2@(76) CORE_message_queue_Control *the_message_queue, CORE_message_queue_Notify_Handler the_handler, void *the_argument ) { the_message_queue->notify_handler = the_handler; 4fe08: 42aa 0060 clrl %a2@(96) the_message_queue->notify_argument = the_argument; 4fe0c: 42aa 0064 clrl %a2@(100) /* * 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)) { 4fe10: 4a81 tstl %d1 4fe12: 6620 bnes 4fe34 <_CORE_message_queue_Initialize+0x50> 4fe14: 2200 movel %d0,%d1 /* * Calculate how much total memory is required for message buffering and * check for overflow on the multiplication. */ message_buffering_required = (size_t) maximum_pending_messages * (allocated_message_size + sizeof(CORE_message_queue_Buffer_control)); 4fe16: 2601 movel %d1,%d3 4fe18: 0683 0000 0014 addil #20,%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 * 4fe1e: 2003 movel %d3,%d0 4fe20: 4c02 0800 mulsl %d2,%d0 (allocated_message_size + sizeof(CORE_message_queue_Buffer_control)); if (message_buffering_required < allocated_message_size) 4fe24: b280 cmpl %d0,%d1 4fe26: 631c blss 4fe44 <_CORE_message_queue_Initialize+0x60> THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; 4fe28: 4200 clrb %d0 } 4fe2a: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 4fe30: 4e5e unlk %fp 4fe32: 4e75 rts * Round size up to multiple of a pointer for chain init and * check for overflow on adding overhead to each message. */ allocated_message_size = maximum_message_size; if (allocated_message_size & (sizeof(uint32_t) - 1)) { allocated_message_size += sizeof(uint32_t); 4fe34: 2200 movel %d0,%d1 4fe36: 5881 addql #4,%d1 allocated_message_size &= ~(sizeof(uint32_t) - 1); 4fe38: 76fc moveq #-4,%d3 4fe3a: c283 andl %d3,%d1 } if (allocated_message_size < maximum_message_size) 4fe3c: b280 cmpl %d0,%d1 4fe3e: 64d6 bccs 4fe16 <_CORE_message_queue_Initialize+0x32> THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; 4fe40: 4200 clrb %d0 <== NOT EXECUTED 4fe42: 60e6 bras 4fe2a <_CORE_message_queue_Initialize+0x46><== NOT EXECUTED return false; /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) 4fe44: 2f00 movel %d0,%sp@- 4fe46: 4eb9 0005 2c74 jsr 52c74 <_Workspace_Allocate> _Workspace_Allocate( message_buffering_required ); if (the_message_queue->message_buffers == 0) 4fe4c: 588f addql #4,%sp return false; /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) 4fe4e: 2540 005c movel %d0,%a2@(92) _Workspace_Allocate( message_buffering_required ); if (the_message_queue->message_buffers == 0) 4fe52: 67d4 beqs 4fe28 <_CORE_message_queue_Initialize+0x44> /* * Initialize the pool of inactive messages, pending messages, * and set of waiting threads. */ _Chain_Initialize ( 4fe54: 2f03 movel %d3,%sp@- 4fe56: 2f02 movel %d2,%sp@- 4fe58: 2f00 movel %d0,%sp@- 4fe5a: 486a 0068 pea %a2@(104) 4fe5e: 4eb9 0005 51e4 jsr 551e4 <_Chain_Initialize> allocated_message_size + sizeof( CORE_message_queue_Buffer_control ) ); _Chain_Initialize_empty( &the_message_queue->Pending_messages ); _Thread_queue_Initialize( 4fe64: 4878 0006 pea 6 4fe68: 7001 moveq #1,%d0 4fe6a: 206e 000c moveal %fp@(12),%a0 4fe6e: b090 cmpl %a0@,%d0 4fe70: 57c0 seq %d0 4fe72: 4878 0080 pea 80 4fe76: 49c0 extbl %d0 4fe78: 4480 negl %d0 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 4fe7a: 41ea 0054 lea %a2@(84),%a0 4fe7e: 2f00 movel %d0,%sp@- 4fe80: 2548 0050 movel %a0,%a2@(80) the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 4fe84: 41ea 0050 lea %a2@(80),%a0 4fe88: 2548 0058 movel %a0,%a2@(88) 4fe8c: 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; 4fe8e: 42aa 0054 clrl %a2@(84) 4fe92: 4eb9 0005 2014 jsr 52014 <_Thread_queue_Initialize> THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; 4fe98: 4fef 0020 lea %sp@(32),%sp } 4fe9c: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 allocated_message_size + sizeof( CORE_message_queue_Buffer_control ) ); _Chain_Initialize_empty( &the_message_queue->Pending_messages ); _Thread_queue_Initialize( 4fea2: 7001 moveq #1,%d0 STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; } 4fea4: 4e5e unlk %fp <== NOT EXECUTED 0004fea8 <_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 ); 4fea8: 203c 0000 0700 movel #1792,%d0 void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 4feae: 4e56 ffe8 linkw %fp,#-24 ISR_Level level; CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; 4feb2: 2279 0006 97c6 moveal 697c6 <_Thread_Executing>,%a1 void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 4feb8: 48d7 1c1c moveml %d2-%d4/%a2-%a4,%sp@ 4febc: 282e 000c movel %fp@(12),%d4 4fec0: 286e 001c moveal %fp@(28),%a4 4fec4: 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; 4fec8: 42a9 0034 clrl %a1@(52) void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 4fecc: 262e 0010 movel %fp@(16),%d3 4fed0: 206e 0014 moveal %fp@(20),%a0 4fed4: 242e 0018 movel %fp@(24),%d2 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 ); 4fed8: 40c1 movew %sr,%d1 4feda: 8081 orl %d1,%d0 4fedc: 46c0 movew %d0,%sr */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4fede: 200a movel %a2,%d0 4fee0: 0680 0000 0054 addil #84,%d0 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 4fee6: 266a 0050 moveal %a2@(80),%a3 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4feea: b08b cmpl %a3,%d0 4feec: 6700 0088 beqw 4ff76 <_CORE_message_queue_Seize+0xce> { Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; 4fef0: 2253 moveal %a3@,%a1 the_message = _CORE_message_queue_Get_pending_message( the_message_queue ); if ( the_message != NULL ) { the_message_queue->number_of_pending_messages -= 1; 4fef2: 53aa 0048 subql #1,%a2@(72) the_chain->first = new_first; new_first->previous = _Chain_Head(the_chain); 4fef6: 49ea 0050 lea %a2@(80),%a4 Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; the_chain->first = new_first; 4fefa: 2549 0050 movel %a1,%a2@(80) new_first->previous = _Chain_Head(the_chain); 4fefe: 234c 0004 movel %a4,%a1@(4) _ISR_Enable( level ); 4ff02: 46c1 movew %d1,%sr *size_p = the_message->Contents.size; _Thread_Executing->Wait.count = 4ff04: 2279 0006 97c6 moveal 697c6 <_Thread_Executing>,%a1 _CORE_message_queue_Get_message_priority( the_message ); _CORE_message_queue_Copy_buffer( the_message->Contents.buffer, 4ff0a: 240b movel %a3,%d2 4ff0c: 0682 0000 0010 addil #16,%d2 const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 4ff12: 49f9 0005 8948 lea 58948 ,%a4 the_message = _CORE_message_queue_Get_pending_message( the_message_queue ); if ( the_message != NULL ) { the_message_queue->number_of_pending_messages -= 1; _ISR_Enable( level ); *size_p = the_message->Contents.size; 4ff18: 20ab 000c movel %a3@(12),%a0@ _Thread_Executing->Wait.count = 4ff1c: 236b 0008 0024 movel %a3@(8),%a1@(36) 4ff22: 2f10 movel %a0@,%sp@- 4ff24: 2f02 movel %d2,%sp@- 4ff26: 2f03 movel %d3,%sp@- 4ff28: 4e94 jsr %a4@ * is not, then we can go ahead and free the buffer. * * NOTE: If we note that the queue was not full before this receive, * then we can avoid this dequeue. */ the_thread = _Thread_queue_Dequeue( &the_message_queue->Wait_queue ); 4ff2a: 2f0a movel %a2,%sp@- 4ff2c: 4eb9 0005 1c38 jsr 51c38 <_Thread_queue_Dequeue> if ( !the_thread ) { 4ff32: 4fef 0010 lea %sp@(16),%sp * is not, then we can go ahead and free the buffer. * * NOTE: If we note that the queue was not full before this receive, * then we can avoid this dequeue. */ the_thread = _Thread_queue_Dequeue( &the_message_queue->Wait_queue ); 4ff36: 2040 moveal %d0,%a0 if ( !the_thread ) { 4ff38: 4a80 tstl %d0 4ff3a: 6700 0088 beqw 4ffc4 <_CORE_message_queue_Seize+0x11c> */ _CORE_message_queue_Set_message_priority( the_message, the_thread->Wait.count ); the_message->Contents.size = (size_t) the_thread->Wait.option; 4ff3e: 2028 0030 movel %a0@(48),%d0 CORE_message_queue_Buffer_control *the_message, int priority ) { #if defined(RTEMS_SCORE_COREMSG_ENABLE_MESSAGE_PRIORITY) the_message->priority = priority; 4ff42: 2768 0024 0008 movel %a0@(36),%a3@(8) 4ff48: 2740 000c movel %d0,%a3@(12) const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 4ff4c: 2f00 movel %d0,%sp@- 4ff4e: 2f28 002c movel %a0@(44),%sp@- 4ff52: 2f02 movel %d2,%sp@- 4ff54: 4e94 jsr %a4@ the_thread->Wait.return_argument_second.immutable_object, the_message->Contents.buffer, the_message->Contents.size ); _CORE_message_queue_Insert_message( 4ff56: 2d6b 0008 0010 movel %a3@(8),%fp@(16) 4ff5c: 4fef 000c lea %sp@(12),%sp 4ff60: 2d4b 000c movel %a3,%fp@(12) 4ff64: 2d4a 0008 movel %a2,%fp@(8) executing->Wait.return_argument = size_p; /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); } 4ff68: 4cee 1c1c ffe8 moveml %fp@(-24),%d2-%d4/%a2-%a4 4ff6e: 4e5e unlk %fp the_thread->Wait.return_argument_second.immutable_object, the_message->Contents.buffer, the_message->Contents.size ); _CORE_message_queue_Insert_message( 4ff70: 4ef9 0005 522c jmp 5522c <_CORE_message_queue_Insert_message> return; } #endif } if ( !wait ) { 4ff76: 4a02 tstb %d2 4ff78: 6612 bnes 4ff8c <_CORE_message_queue_Seize+0xe4> _ISR_Enable( level ); 4ff7a: 46c1 movew %d1,%sr executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT; 4ff7c: 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 ); } 4ff7e: 4cee 1c1c ffe8 moveml %fp@(-24),%d2-%d4/%a2-%a4 #endif } if ( !wait ) { _ISR_Enable( level ); executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT; 4ff84: 2340 0034 movel %d0,%a1@(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 ); } 4ff88: 4e5e unlk %fp 4ff8a: 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; 4ff8c: 7001 moveq #1,%d0 4ff8e: 2540 0030 movel %d0,%a2@(48) _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue ); executing->Wait.queue = &the_message_queue->Wait_queue; executing->Wait.id = id; executing->Wait.return_argument_second.mutable_object = buffer; executing->Wait.return_argument = size_p; 4ff92: 2348 0028 movel %a0,%a1@(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; 4ff96: 2343 002c movel %d3,%a1@(44) return; } _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue ); executing->Wait.queue = &the_message_queue->Wait_queue; executing->Wait.id = id; 4ff9a: 2344 0020 movel %d4,%a1@(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; 4ff9e: 234a 0044 movel %a2,%a1@(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 ); 4ffa2: 46c1 movew %d1,%sr _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); 4ffa4: 2d4c 000c movel %a4,%fp@(12) 4ffa8: 49f9 0005 20f8 lea 520f8 <_Thread_queue_Timeout>,%a4 4ffae: 2d4a 0008 movel %a2,%fp@(8) 4ffb2: 2d4c 0010 movel %a4,%fp@(16) } 4ffb6: 4cee 1c1c ffe8 moveml %fp@(-24),%d2-%d4/%a2-%a4 4ffbc: 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 ); 4ffbe: 4ef9 0005 1d98 jmp 51d98 <_Thread_queue_Enqueue_with_handler> 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 ); 4ffc4: 45ea 0068 lea %a2@(104),%a2 4ffc8: 2d4b 000c movel %a3,%fp@(12) 4ffcc: 2d4a 0008 movel %a2,%fp@(8) } 4ffd0: 4cee 1c1c ffe8 moveml %fp@(-24),%d2-%d4/%a2-%a4 4ffd6: 4e5e unlk %fp 4ffd8: 4ef9 0004 fd18 jmp 4fd18 <_Chain_Append> ... 0004ffe0 <_CORE_message_queue_Submit>: #endif CORE_message_queue_Submit_types submit_type, bool wait, Watchdog_Interval timeout ) { 4ffe0: 4e56 ffec linkw %fp,#-20 4ffe4: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 4ffe8: 246e 0008 moveal %fp@(8),%a2 4ffec: 242e 0010 movel %fp@(16),%d2 4fff0: 282e 001c movel %fp@(28),%d4 4fff4: 162e 0023 moveb %fp@(35),%d3 CORE_message_queue_Buffer_control *the_message; Thread_Control *the_thread; if ( size > the_message_queue->maximum_message_size ) { 4fff8: b4aa 004c cmpl %a2@(76),%d2 4fffc: 6228 bhis 50026 <_CORE_message_queue_Submit+0x46> } /* * Is there a thread currently waiting on this message queue? */ if ( the_message_queue->number_of_pending_messages == 0 ) { 4fffe: 202a 0048 movel %a2@(72),%d0 50002: 672e beqs 50032 <_CORE_message_queue_Submit+0x52> /* * No one waiting on the message queue at this time, so attempt to * queue the message up for a future receive. */ if ( the_message_queue->number_of_pending_messages < the_message_queue->maximum_pending_messages ) { 50004: b0aa 0044 cmpl %a2@(68),%d0 50008: 6500 00ba bcsw 500c4 <_CORE_message_queue_Submit+0xe4> /* * No message buffers were available so we may need to return an * overflow error or block the sender until the message is placed * on the queue. */ if ( !wait ) { 5000c: 4a03 tstb %d3 5000e: 6700 00f4 beqw 50104 <_CORE_message_queue_Submit+0x124> /* * Do NOT block on a send if the caller is in an ISR. It is * deadly to block in an ISR. */ if ( _ISR_Is_in_progress() ) { 50012: 2039 0006 97a6 movel 697a6 <_ISR_Nest_level>,%d0 50018: 6754 beqs 5006e <_CORE_message_queue_Submit+0x8e> 5001a: 7003 moveq #3,%d0 _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); } return CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_WAIT; #endif } 5001c: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 50022: 4e5e unlk %fp 50024: 4e75 rts ) { CORE_message_queue_Buffer_control *the_message; Thread_Control *the_thread; if ( size > the_message_queue->maximum_message_size ) { 50026: 7001 moveq #1,%d0 _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); } return CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_WAIT; #endif } 50028: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 5002e: 4e5e unlk %fp 50030: 4e75 rts /* * Is there a thread currently waiting on this message queue? */ if ( the_message_queue->number_of_pending_messages == 0 ) { the_thread = _Thread_queue_Dequeue( &the_message_queue->Wait_queue ); 50032: 2f0a movel %a2,%sp@- 50034: 4eb9 0005 1c38 jsr 51c38 <_Thread_queue_Dequeue> if ( the_thread ) { 5003a: 588f addql #4,%sp /* * Is there a thread currently waiting on this message queue? */ if ( the_message_queue->number_of_pending_messages == 0 ) { the_thread = _Thread_queue_Dequeue( &the_message_queue->Wait_queue ); 5003c: 2640 moveal %d0,%a3 if ( the_thread ) { 5003e: 4a80 tstl %d0 50040: 6700 00ce beqw 50110 <_CORE_message_queue_Submit+0x130> const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 50044: 2f02 movel %d2,%sp@- 50046: 2f2e 000c movel %fp@(12),%sp@- 5004a: 2f2b 002c movel %a3@(44),%sp@- 5004e: 4eb9 0005 8948 jsr 58948 _CORE_message_queue_Copy_buffer( buffer, the_thread->Wait.return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; 50054: 206b 0028 moveal %a3@(40),%a0 #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_message_queue_mp_support) ( the_thread, id ); #endif return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; 50058: 4fef 000c lea %sp@(12),%sp buffer, the_thread->Wait.return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; the_thread->Wait.count = (uint32_t) submit_type; 5005c: 4280 clrl %d0 _CORE_message_queue_Copy_buffer( buffer, the_thread->Wait.return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; 5005e: 2082 movel %d2,%a0@ the_thread->Wait.count = (uint32_t) submit_type; 50060: 2744 0024 movel %d4,%a3@(36) _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); } return CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_WAIT; #endif } 50064: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 5006a: 4e5e unlk %fp 5006c: 4e75 rts * Thus the unusual choice to open a new scope and declare * it as a variable. Doing this emphasizes how dangerous it * would be to use this variable prior to here. */ { Thread_Control *executing = _Thread_Executing; 5006e: 2079 0006 97c6 moveal 697c6 <_Thread_Executing>,%a0 ISR_Level level; _ISR_Disable( level ); 50074: 203c 0000 0700 movel #1792,%d0 5007a: 40c1 movew %sr,%d1 5007c: 8081 orl %d1,%d0 5007e: 46c0 movew %d0,%sr 50080: 7001 moveq #1,%d0 _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue ); executing->Wait.queue = &the_message_queue->Wait_queue; executing->Wait.id = id; 50082: 216e 0014 0020 movel %fp@(20),%a0@(32) 50088: 2540 0030 movel %d0,%a2@(48) executing->Wait.return_argument_second.immutable_object = buffer; 5008c: 202e 000c movel %fp@(12),%d0 executing->Wait.option = (uint32_t) size; executing->Wait.count = submit_type; 50090: 2144 0024 movel %d4,%a0@(36) _ISR_Disable( level ); _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.immutable_object = buffer; 50094: 2140 002c movel %d0,%a0@(44) executing->Wait.option = (uint32_t) size; 50098: 2142 0030 movel %d2,%a0@(48) Thread_Control *executing = _Thread_Executing; ISR_Level level; _ISR_Disable( level ); _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue ); executing->Wait.queue = &the_message_queue->Wait_queue; 5009c: 214a 0044 movel %a2,%a0@(68) executing->Wait.id = id; executing->Wait.return_argument_second.immutable_object = buffer; executing->Wait.option = (uint32_t) size; executing->Wait.count = submit_type; _ISR_Enable( level ); 500a0: 46c1 movew %d1,%sr _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); 500a2: 4879 0005 20f8 pea 520f8 <_Thread_queue_Timeout> 500a8: 2f2e 0024 movel %fp@(36),%sp@- 500ac: 2f0a movel %a2,%sp@- 500ae: 4eb9 0005 1d98 jsr 51d98 <_Thread_queue_Enqueue_with_handler> } return CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_WAIT; 500b4: 4fef 000c lea %sp@(12),%sp executing->Wait.return_argument_second.immutable_object = buffer; executing->Wait.option = (uint32_t) size; executing->Wait.count = submit_type; _ISR_Enable( level ); _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); 500b8: 7007 moveq #7,%d0 } return CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_WAIT; #endif } 500ba: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 500c0: 4e5e unlk %fp 500c2: 4e75 rts RTEMS_INLINE_ROUTINE CORE_message_queue_Buffer_control * _CORE_message_queue_Allocate_message_buffer ( CORE_message_queue_Control *the_message_queue ) { return (CORE_message_queue_Buffer_control *) 500c4: 486a 0068 pea %a2@(104) 500c8: 4eb9 0004 fd78 jsr 4fd78 <_Chain_Get> 500ce: 2640 moveal %d0,%a3 const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 500d0: 2f02 movel %d2,%sp@- 500d2: 2f2e 000c movel %fp@(12),%sp@- 500d6: 486b 0010 pea %a3@(16) 500da: 4eb9 0005 8948 jsr 58948 _CORE_message_queue_Copy_buffer( buffer, the_message->Contents.buffer, size ); the_message->Contents.size = size; 500e0: 2742 000c movel %d2,%a3@(12) CORE_message_queue_Buffer_control *the_message, int priority ) { #if defined(RTEMS_SCORE_COREMSG_ENABLE_MESSAGE_PRIORITY) the_message->priority = priority; 500e4: 2744 0008 movel %d4,%a3@(8) _CORE_message_queue_Set_message_priority( the_message, submit_type ); _CORE_message_queue_Insert_message( 500e8: 2f04 movel %d4,%sp@- 500ea: 2f0b movel %a3,%sp@- 500ec: 2f0a movel %a2,%sp@- 500ee: 4eb9 0005 522c jsr 5522c <_CORE_message_queue_Insert_message> the_message_queue, the_message, submit_type ); return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; 500f4: 4fef 001c lea %sp@(28),%sp size ); the_message->Contents.size = size; _CORE_message_queue_Set_message_priority( the_message, submit_type ); _CORE_message_queue_Insert_message( 500f8: 4280 clrl %d0 _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); } return CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_WAIT; #endif } 500fa: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 50100: 4e5e unlk %fp 50102: 4e75 rts /* * No message buffers were available so we may need to return an * overflow error or block the sender until the message is placed * on the queue. */ if ( !wait ) { 50104: 7002 moveq #2,%d0 _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); } return CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_WAIT; #endif } 50106: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 5010c: 4e5e unlk %fp 5010e: 4e75 rts /* * Is there a thread currently waiting on this message queue? */ if ( the_message_queue->number_of_pending_messages == 0 ) { the_thread = _Thread_queue_Dequeue( &the_message_queue->Wait_queue ); if ( the_thread ) { 50110: 202a 0048 movel %a2@(72),%d0 /* * No one waiting on the message queue at this time, so attempt to * queue the message up for a future receive. */ if ( the_message_queue->number_of_pending_messages < the_message_queue->maximum_pending_messages ) { 50114: b0aa 0044 cmpl %a2@(68),%d0 50118: 6400 fef2 bccw 5000c <_CORE_message_queue_Submit+0x2c> 5011c: 60a6 bras 500c4 <_CORE_message_queue_Submit+0xe4> ... 00046b6c <_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 ) { 46b6c: 4e56 0000 linkw %fp,#0 46b70: 2f0a movel %a2,%sp@- 46b72: 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)) ) { 46b76: 2f0a movel %a2,%sp@- 46b78: 4eb9 0004 81b8 jsr 481b8 <_Thread_queue_Dequeue> 46b7e: 588f addql #4,%sp 46b80: 4a80 tstl %d0 46b82: 670a beqs 46b8e <_CORE_semaphore_Surrender+0x22> status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); } return status; } 46b84: 246e fffc moveal %fp@(-4),%a2 ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; if ( (the_thread = _Thread_queue_Dequeue(&the_semaphore->Wait_queue)) ) { 46b88: 4280 clrl %d0 status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); } return status; } 46b8a: 4e5e unlk %fp 46b8c: 4e75 rts if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_semaphore_mp_support) ( the_thread, id ); #endif } else { _ISR_Disable( level ); 46b8e: 203c 0000 0700 movel #1792,%d0 46b94: 40c1 movew %sr,%d1 46b96: 8081 orl %d1,%d0 46b98: 46c0 movew %d0,%sr if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 46b9a: 202a 0048 movel %a2@(72),%d0 46b9e: b0aa 0040 cmpl %a2@(64),%d0 46ba2: 6412 bccs 46bb6 <_CORE_semaphore_Surrender+0x4a> the_semaphore->count += 1; 46ba4: 5280 addql #1,%d0 46ba6: 2540 0048 movel %d0,%a2@(72) 46baa: 4280 clrl %d0 else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); 46bac: 46c1 movew %d1,%sr } return status; } 46bae: 246e fffc moveal %fp@(-4),%a2 46bb2: 4e5e unlk %fp 46bb4: 4e75 rts (*api_semaphore_mp_support) ( the_thread, id ); #endif } else { _ISR_Disable( level ); if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 46bb6: 7004 moveq #4,%d0 <== NOT EXECUTED the_semaphore->count += 1; else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); 46bb8: 46c1 movew %d1,%sr <== NOT EXECUTED 46bba: 60f2 bras 46bae <_CORE_semaphore_Surrender+0x42> <== NOT EXECUTED 0004599c <_Event_Timeout>: void _Event_Timeout( Objects_Id id, void *ignored ) { 4599c: 4e56 fffc linkw %fp,#-4 459a0: 2f03 movel %d3,%sp@- 459a2: 2f02 movel %d2,%sp@- Thread_Control *the_thread; Objects_Locations location; ISR_Level level; the_thread = _Thread_Get( id, &location ); 459a4: 486e fffc pea %fp@(-4) 459a8: 2f2e 0008 movel %fp@(8),%sp@- 459ac: 4eb9 0004 7de4 jsr 47de4 <_Thread_Get> switch ( location ) { 459b2: 508f addql #8,%sp 459b4: 4aae fffc tstl %fp@(-4) 459b8: 6642 bnes 459fc <_Event_Timeout+0x60> * * If it is not satisfied, then it is "nothing happened" and * this is the "timeout" transition. After a request is satisfied, * a timeout is not allowed to occur. */ _ISR_Disable( level ); 459ba: 223c 0000 0700 movel #1792,%d1 459c0: 40c2 movew %sr,%d2 459c2: 8282 orl %d2,%d1 459c4: 46c1 movew %d1,%sr _ISR_Enable( level ); return; } #endif the_thread->Wait.count = 0; 459c6: 2040 moveal %d0,%a0 459c8: 42a8 0024 clrl %a0@(36) if ( _Thread_Is_executing( the_thread ) ) { 459cc: b0b9 0005 f032 cmpl 5f032 <_Thread_Executing>,%d0 459d2: 6734 beqs 45a08 <_Event_Timeout+0x6c> if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) _Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; } the_thread->Wait.return_code = RTEMS_TIMEOUT; 459d4: 7606 moveq #6,%d3 459d6: 2040 moveal %d0,%a0 459d8: 2143 0034 movel %d3,%a0@(52) _ISR_Enable( level ); 459dc: 46c2 movew %d2,%sr 459de: 2f3c 1003 fff8 movel #268697592,%sp@- 459e4: 2f00 movel %d0,%sp@- 459e6: 4eb9 0004 79e8 jsr 479e8 <_Thread_Clear_state> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 459ec: 508f addql #8,%sp 459ee: 2039 0005 ef78 movel 5ef78 <_Thread_Dispatch_disable_level>,%d0 459f4: 5380 subql #1,%d0 459f6: 23c0 0005 ef78 movel %d0,5ef78 <_Thread_Dispatch_disable_level> case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 459fc: 242e fff4 movel %fp@(-12),%d2 45a00: 262e fff8 movel %fp@(-8),%d3 45a04: 4e5e unlk %fp 45a06: 4e75 rts } #endif the_thread->Wait.count = 0; if ( _Thread_Is_executing( the_thread ) ) { if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 45a08: 2239 0005 f7c6 movel 5f7c6 <_Event_Sync_state>,%d1 45a0e: 7601 moveq #1,%d3 45a10: b681 cmpl %d1,%d3 45a12: 66c0 bnes 459d4 <_Event_Timeout+0x38> _Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; } the_thread->Wait.return_code = RTEMS_TIMEOUT; 45a14: 7606 moveq #6,%d3 45a16: 2040 moveal %d0,%a0 #endif the_thread->Wait.count = 0; if ( _Thread_Is_executing( the_thread ) ) { if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) _Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 45a18: 7202 moveq #2,%d1 } the_thread->Wait.return_code = RTEMS_TIMEOUT; 45a1a: 2143 0034 movel %d3,%a0@(52) #endif the_thread->Wait.count = 0; if ( _Thread_Is_executing( the_thread ) ) { if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) _Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 45a1e: 23c1 0005 f7c6 movel %d1,5f7c6 <_Event_Sync_state> } the_thread->Wait.return_code = RTEMS_TIMEOUT; _ISR_Enable( level ); 45a24: 46c2 movew %d2,%sr RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 45a26: 2f3c 1003 fff8 movel #268697592,%sp@- 45a2c: 2f00 movel %d0,%sp@- 45a2e: 4eb9 0004 79e8 jsr 479e8 <_Thread_Clear_state> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 45a34: 508f addql #8,%sp 45a36: 2039 0005 ef78 movel 5ef78 <_Thread_Dispatch_disable_level>,%d0 45a3c: 5380 subql #1,%d0 45a3e: 23c0 0005 ef78 movel %d0,5ef78 <_Thread_Dispatch_disable_level> 45a44: 60b6 bras 459fc <_Event_Timeout+0x60> ... 0004bcc0 <_Heap_Allocate_aligned_with_boundary>: Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 4bcc0: 4e56 ffcc linkw %fp,#-52 4bcc4: 226e 000c moveal %fp@(12),%a1 4bcc8: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 4bccc: 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; 4bcd0: 2c09 movel %a1,%d6 4bcd2: 5886 addql #4,%d6 uintptr_t const page_size = heap->page_size; 4bcd4: 202a 0010 movel %a2@(16),%d0 Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 4bcd8: 222e 0010 movel %fp@(16),%d1 4bcdc: 282e 0014 movel %fp@(20),%d4 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 4bce0: 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; 4bce4: 2d40 fffc movel %d0,%fp@(-4) uintptr_t alloc_begin = 0; uint32_t search_count = 0; if ( block_size_floor < alloc_size ) { 4bce8: bc89 cmpl %a1,%d6 4bcea: 6500 0146 bcsw 4be32 <_Heap_Allocate_aligned_with_boundary+0x172> /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { 4bcee: 4a84 tstl %d4 4bcf0: 6600 013c bnew 4be2e <_Heap_Allocate_aligned_with_boundary+0x16e> if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { 4bcf4: b1ca cmpal %a2,%a0 4bcf6: 6700 0152 beqw 4be4a <_Heap_Allocate_aligned_with_boundary+0x18a> uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; 4bcfa: 242e fffc movel %fp@(-4),%d2 uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; 4bcfe: 7a04 moveq #4,%d5 uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; 4bd00: 5e82 addql #7,%d2 uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; 4bd02: 9a89 subl %a1,%d5 if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { 4bd04: 4283 clrl %d3 uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; 4bd06: 2d42 fff8 movel %d2,%fp@(-8) uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; 4bd0a: 2d45 fff4 movel %d5,%fp@(-12) /* * The HEAP_PREV_BLOCK_USED flag is always set in the block size_and_flag * field. Thus the value is about one unit larger than the real block * size. The greater than operator takes this into account. */ if ( block->size_and_flag > block_size_floor ) { 4bd0e: 2028 0004 movel %a0@(4),%d0 while ( block != free_list_tail ) { _HAssert( _Heap_Is_prev_used( block ) ); /* Statistics */ ++search_count; 4bd12: 5283 addql #1,%d3 /* * The HEAP_PREV_BLOCK_USED flag is always set in the block size_and_flag * field. Thus the value is about one unit larger than the real block * size. The greater than operator takes this into account. */ if ( block->size_and_flag > block_size_floor ) { 4bd14: b086 cmpl %d6,%d0 4bd16: 630e blss 4bd26 <_Heap_Allocate_aligned_with_boundary+0x66> if ( alignment == 0 ) { 4bd18: 4a81 tstl %d1 4bd1a: 6628 bnes 4bd44 <_Heap_Allocate_aligned_with_boundary+0x84> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 4bd1c: 2408 movel %a0,%d2 4bd1e: 5082 addql #8,%d2 boundary ); } } if ( alloc_begin != 0 ) { 4bd20: 4a82 tstl %d2 4bd22: 6600 00ee bnew 4be12 <_Heap_Allocate_aligned_with_boundary+0x152> break; } block = block->next; 4bd26: 2068 0008 moveal %a0@(8),%a0 if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { 4bd2a: b1ca cmpal %a2,%a0 4bd2c: 66e0 bnes 4bd0e <_Heap_Allocate_aligned_with_boundary+0x4e> 4bd2e: 4280 clrl %d0 uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { Heap_Statistics *const stats = &heap->stats; 4bd30: b6aa 0044 cmpl %a2@(68),%d3 4bd34: 6304 blss 4bd3a <_Heap_Allocate_aligned_with_boundary+0x7a> ); } /* Statistics */ if ( stats->max_search < search_count ) { stats->max_search = search_count; 4bd36: 2543 0044 movel %d3,%a2@(68) } return (void *) alloc_begin; } 4bd3a: 4cee 3cfc ffcc moveml %fp@(-52),%d2-%d7/%a2-%a5 4bd40: 4e5e unlk %fp 4bd42: 4e75 rts uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; 4bd44: 7efe moveq #-2,%d7 4bd46: 4be8 0008 lea %a0@(8),%a5 4bd4a: c087 andl %d7,%d0 uintptr_t alignment, uintptr_t boundary ) { uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; 4bd4c: 286a 0014 moveal %a2@(20),%a4 uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; 4bd50: d088 addl %a0,%d0 uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; 4bd52: 2a2e fff8 movel %fp@(-8),%d5 4bd56: 9a8c subl %a4,%d5 uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; 4bd58: 242e fff4 movel %fp@(-12),%d2 4bd5c: d480 addl %d0,%d2 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4bd5e: 2e02 movel %d2,%d7 uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; 4bd60: d085 addl %d5,%d0 4bd62: 4c41 7005 remul %d1,%d5,%d7 4bd66: 9485 subl %d5,%d2 uintptr_t alloc_begin = alloc_end - alloc_size; alloc_begin = _Heap_Align_down( alloc_begin, alignment ); /* Ensure that the we have a valid new block at the end */ if ( alloc_begin > alloc_begin_ceiling ) { 4bd68: b480 cmpl %d0,%d2 4bd6a: 630a blss 4bd76 <_Heap_Allocate_aligned_with_boundary+0xb6> 4bd6c: 2a00 movel %d0,%d5 4bd6e: 4c41 5002 remul %d1,%d2,%d5 4bd72: 9082 subl %d2,%d0 4bd74: 2400 movel %d0,%d2 } alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { 4bd76: 4a84 tstl %d4 4bd78: 676c beqs 4bde6 <_Heap_Allocate_aligned_with_boundary+0x126> /* Ensure that the we have a valid new block at the end */ if ( alloc_begin > alloc_begin_ceiling ) { alloc_begin = _Heap_Align_down( alloc_begin_ceiling, alignment ); } alloc_end = alloc_begin + alloc_size; 4bd7a: 2002 movel %d2,%d0 4bd7c: d089 addl %a1,%d0 4bd7e: 2e00 movel %d0,%d7 4bd80: 4c44 7005 remul %d4,%d5,%d7 4bd84: 2e00 movel %d0,%d7 4bd86: 9e85 subl %d5,%d7 4bd88: 2a07 movel %d7,%d5 /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { 4bd8a: be82 cmpl %d2,%d7 4bd8c: 6358 blss 4bde6 <_Heap_Allocate_aligned_with_boundary+0x126> 4bd8e: be80 cmpl %d0,%d7 4bd90: 6454 bccs 4bde6 <_Heap_Allocate_aligned_with_boundary+0x126> alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; 4bd92: 2e0d movel %a5,%d7 4bd94: de89 addl %a1,%d7 uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { if ( boundary_line < boundary_floor ) { 4bd96: ba87 cmpl %d7,%d5 4bd98: 658c bcss 4bd26 <_Heap_Allocate_aligned_with_boundary+0x66> return 0; } alloc_begin = boundary_line - alloc_size; 4bd9a: 9a89 subl %a1,%d5 4bd9c: 2005 movel %d5,%d0 4bd9e: 2647 moveal %d7,%a3 4bda0: 4c41 0002 remul %d1,%d2,%d0 4bda4: 9a82 subl %d2,%d5 alloc_begin = _Heap_Align_down( alloc_begin, alignment ); alloc_end = alloc_begin + alloc_size; 4bda6: 2005 movel %d5,%d0 4bda8: d089 addl %a1,%d0 4bdaa: 2405 movel %d5,%d2 4bdac: 2e00 movel %d0,%d7 4bdae: 4c44 7005 remul %d4,%d5,%d7 4bdb2: 2e00 movel %d0,%d7 4bdb4: 9e85 subl %d5,%d7 4bdb6: 2a07 movel %d7,%d5 /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { 4bdb8: be82 cmpl %d2,%d7 4bdba: 632a blss 4bde6 <_Heap_Allocate_aligned_with_boundary+0x126> 4bdbc: be80 cmpl %d0,%d7 4bdbe: 6426 bccs 4bde6 <_Heap_Allocate_aligned_with_boundary+0x126> if ( boundary_line < boundary_floor ) { 4bdc0: ba8b cmpl %a3,%d5 4bdc2: 6500 ff62 bcsw 4bd26 <_Heap_Allocate_aligned_with_boundary+0x66> return 0; } alloc_begin = boundary_line - alloc_size; 4bdc6: 9a89 subl %a1,%d5 4bdc8: 2005 movel %d5,%d0 4bdca: 4c41 0002 remul %d1,%d2,%d0 4bdce: 9a82 subl %d2,%d5 alloc_begin = _Heap_Align_down( alloc_begin, alignment ); alloc_end = alloc_begin + alloc_size; 4bdd0: 2005 movel %d5,%d0 4bdd2: d089 addl %a1,%d0 4bdd4: 2405 movel %d5,%d2 4bdd6: 2e00 movel %d0,%d7 4bdd8: 4c44 7005 remul %d4,%d5,%d7 4bddc: 2e00 movel %d0,%d7 4bdde: 9e85 subl %d5,%d7 4bde0: 2a07 movel %d7,%d5 /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { 4bde2: be82 cmpl %d2,%d7 4bde4: 62d6 bhis 4bdbc <_Heap_Allocate_aligned_with_boundary+0xfc> 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 ) { 4bde6: b48d cmpl %a5,%d2 4bde8: 6500 ff3c bcsw 4bd26 <_Heap_Allocate_aligned_with_boundary+0x66> 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; 4bdec: 70f8 moveq #-8,%d0 4bdee: 9088 subl %a0,%d0 4bdf0: 2a40 moveal %d0,%a5 4bdf2: 2e02 movel %d2,%d7 4bdf4: dbc2 addal %d2,%a5 4bdf6: 202e fffc movel %fp@(-4),%d0 4bdfa: 4c40 7005 remul %d0,%d5,%d7 4bdfe: 9bc5 subal %d5,%a5 if ( free_size >= min_block_size || free_size == 0 ) { 4be00: bbcc cmpal %a4,%a5 4be02: 6400 ff1c bccw 4bd20 <_Heap_Allocate_aligned_with_boundary+0x60> 4be06: 4a8d tstl %a5 4be08: 6600 ff1c bnew 4bd26 <_Heap_Allocate_aligned_with_boundary+0x66> boundary ); } } if ( alloc_begin != 0 ) { 4be0c: 4a82 tstl %d2 4be0e: 6700 ff16 beqw 4bd26 <_Heap_Allocate_aligned_with_boundary+0x66> if ( alloc_begin != 0 ) { /* Statistics */ stats->searches += search_count; block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 4be12: 2f09 movel %a1,%sp@- block = block->next; } if ( alloc_begin != 0 ) { /* Statistics */ stats->searches += search_count; 4be14: d7aa 004c addl %d3,%a2@(76) block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 4be18: 2f02 movel %d2,%sp@- 4be1a: 2f08 movel %a0,%sp@- 4be1c: 2f0a movel %a2,%sp@- 4be1e: 4eb9 0004 6e94 jsr 46e94 <_Heap_Block_allocate> 4be24: 4fef 0010 lea %sp@(16),%sp 4be28: 2002 movel %d2,%d0 4be2a: 6000 ff04 braw 4bd30 <_Heap_Allocate_aligned_with_boundary+0x70> /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { if ( boundary < alloc_size ) { 4be2e: b889 cmpl %a1,%d4 4be30: 640c bccs 4be3e <_Heap_Allocate_aligned_with_boundary+0x17e> ); } /* Statistics */ if ( stats->max_search < search_count ) { stats->max_search = search_count; 4be32: 4280 clrl %d0 } return (void *) alloc_begin; } 4be34: 4cee 3cfc ffcc moveml %fp@(-52),%d2-%d7/%a2-%a5 4be3a: 4e5e unlk %fp 4be3c: 4e75 rts if ( boundary != 0 ) { if ( boundary < alloc_size ) { return NULL; } if ( alignment == 0 ) { 4be3e: 4a81 tstl %d1 4be40: 6600 feb2 bnew 4bcf4 <_Heap_Allocate_aligned_with_boundary+0x34> 4be44: 2200 movel %d0,%d1 4be46: 6000 feac braw 4bcf4 <_Heap_Allocate_aligned_with_boundary+0x34> alignment = page_size; } } while ( block != free_list_tail ) { 4be4a: 4283 clrl %d3 4be4c: 4280 clrl %d0 4be4e: 6000 fee0 braw 4bd30 <_Heap_Allocate_aligned_with_boundary+0x70> ... 00046e94 <_Heap_Block_allocate>: Heap_Block *free_list_anchor = NULL; _HAssert( alloc_area_begin <= alloc_begin ); if ( _Heap_Is_free( block ) ) { 46e94: 70fe moveq #-2,%d0 Heap_Control *heap, Heap_Block *block, uintptr_t alloc_begin, uintptr_t alloc_size ) { 46e96: 4e56 ffe0 linkw %fp,#-32 46e9a: 222e 0010 movel %fp@(16),%d1 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 46e9e: 2041 moveal %d1,%a0 46ea0: 5188 subql #8,%a0 46ea2: 48d7 3c3c moveml %d2-%d5/%a2-%a5,%sp@ 46ea6: 246e 000c moveal %fp@(12),%a2 Heap_Block *free_list_anchor = NULL; _HAssert( alloc_area_begin <= alloc_begin ); if ( _Heap_Is_free( block ) ) { 46eaa: 7601 moveq #1,%d3 ) { Heap_Statistics *const stats = &heap->stats; uintptr_t const alloc_area_begin = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_area_offset = alloc_begin - alloc_area_begin; 46eac: 2848 moveal %a0,%a4 46eae: 240a movel %a2,%d2 46eb0: 99ca subal %a2,%a4 Heap_Block *free_list_anchor = NULL; _HAssert( alloc_area_begin <= alloc_begin ); if ( _Heap_Is_free( block ) ) { 46eb2: c0aa 0004 andl %a2@(4),%d0 Heap_Control *heap, Heap_Block *block, uintptr_t alloc_begin, uintptr_t alloc_size ) { 46eb6: 266e 0008 moveal %fp@(8),%a3 Heap_Block *free_list_anchor = NULL; _HAssert( alloc_area_begin <= alloc_begin ); if ( _Heap_Is_free( block ) ) { 46eba: c6b2 0804 andl %a2@(00000004,%d0:l),%d3 Heap_Control *heap, Heap_Block *block, uintptr_t alloc_begin, uintptr_t alloc_size ) { 46ebe: 2a2e 0014 movel %fp@(20),%d5 Heap_Block *free_list_anchor = NULL; _HAssert( alloc_area_begin <= alloc_begin ); if ( _Heap_Is_free( block ) ) { 46ec2: 4a03 tstb %d3 46ec4: 6600 00aa bnew 46f70 <_Heap_Block_allocate+0xdc> free_list_anchor = block->prev; _Heap_Free_list_remove( block ); /* Statistics */ --stats->free_blocks; 46ec8: 53ab 0038 subql #1,%a3@(56) ++stats->used_blocks; stats->free_size -= _Heap_Block_size( block ); 46ecc: 76fe moveq #-2,%d3 _Heap_Free_list_remove( block ); /* Statistics */ --stats->free_blocks; ++stats->used_blocks; 46ece: 52ab 0040 addql #1,%a3@(64) return _Heap_Free_list_tail(heap)->prev; } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; 46ed2: 202a 0008 movel %a2@(8),%d0 Heap_Block *prev = block->prev; prev->next = next; next->prev = prev; 46ed6: 2a40 moveal %d0,%a5 Heap_Block *free_list_anchor = NULL; _HAssert( alloc_area_begin <= alloc_begin ); if ( _Heap_Is_free( block ) ) { free_list_anchor = block->prev; 46ed8: 226a 000c moveal %a2@(12),%a1 _Heap_Free_list_remove( block ); /* Statistics */ --stats->free_blocks; ++stats->used_blocks; stats->free_size -= _Heap_Block_size( block ); 46edc: c6aa 0004 andl %a2@(4),%d3 RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; Heap_Block *prev = block->prev; prev->next = next; 46ee0: 2340 0008 movel %d0,%a1@(8) } else { free_list_anchor = _Heap_Free_list_head( heap ); } if ( alloc_area_offset < heap->page_size ) { 46ee4: 202b 0010 movel %a3@(16),%d0 _Heap_Free_list_remove( block ); /* Statistics */ --stats->free_blocks; ++stats->used_blocks; stats->free_size -= _Heap_Block_size( block ); 46ee8: 97ab 0030 subl %d3,%a3@(48) next->prev = prev; 46eec: 2b49 000c movel %a1,%a5@(12) } else { free_list_anchor = _Heap_Free_list_head( heap ); } if ( alloc_area_offset < heap->page_size ) { 46ef0: b08c cmpl %a4,%d0 46ef2: 6200 0088 bhiw 46f7c <_Heap_Block_allocate+0xe8> - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 46ef6: 262a 0004 movel %a2@(4),%d3 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_of_alloc_area( uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) 46efa: 4c40 1004 remul %d0,%d4,%d1 _HAssert( new_block_size >= heap->min_block_size ); /* Statistics */ stats->free_size += block_size; if ( _Heap_Is_prev_used( block ) ) { 46efe: 7201 moveq #1,%d1 46f00: 91c4 subal %d4,%a0 _Heap_Block_of_alloc_area( alloc_begin, heap->page_size ); uintptr_t const new_block_begin = (uintptr_t) new_block; uintptr_t const new_block_size = block_end - new_block_begin; block_end = new_block_begin; block_size = block_end - block_begin; 46f02: 2008 movel %a0,%d0 46f04: 908a subl %a2,%d0 _HAssert( block_size >= heap->min_block_size ); _HAssert( new_block_size >= heap->min_block_size ); /* Statistics */ stats->free_size += block_size; 46f06: d1ab 0030 addl %d0,%a3@(48) if ( _Heap_Is_prev_used( block ) ) { 46f0a: c2aa 0004 andl %a2@(4),%d1 46f0e: 6700 0082 beqw 46f92 <_Heap_Block_allocate+0xfe> } block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; new_block->prev_size = block_size; new_block->size_and_flag = new_block_size; 46f12: 78fe moveq #-2,%d4 _Heap_Free_list_insert_after( free_list_anchor, block ); free_list_anchor = block; /* Statistics */ ++stats->free_blocks; 46f14: 52ab 0038 addql #1,%a3@(56) 46f18: 220a movel %a2,%d1 RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after( Heap_Block *block_before, Heap_Block *new_block ) { Heap_Block *next = block_before->next; 46f1a: 2869 0008 moveal %a1@(8),%a4 } block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; new_block->prev_size = block_size; new_block->size_and_flag = new_block_size; 46f1e: c684 andl %d4,%d3 block = prev_block; block_begin = (uintptr_t) block; block_size += prev_block_size; } block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; 46f20: 7801 moveq #1,%d4 46f22: 8880 orl %d0,%d4 new_block->next = next; 46f24: 254c 0008 movel %a4,%a2@(8) new_block->prev_size = block_size; new_block->size_and_flag = new_block_size; 46f28: d483 addl %d3,%d2 46f2a: 9488 subl %a0,%d2 new_block->prev = block_before; 46f2c: 2549 000c movel %a1,%a2@(12) block = prev_block; block_begin = (uintptr_t) block; block_size += prev_block_size; } block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; 46f30: 2544 0004 movel %d4,%a2@(4) block_before->next = new_block; 46f34: 234a 0008 movel %a2,%a1@(8) next->prev = new_block; 46f38: 294a 000c movel %a2,%a4@(12) new_block->prev_size = block_size; new_block->size_and_flag = new_block_size; _Heap_Block_split( heap, new_block, free_list_anchor, alloc_size ); 46f3c: 2448 moveal %a0,%a2 block_size += prev_block_size; } block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; new_block->prev_size = block_size; 46f3e: 2080 movel %d0,%a0@ new_block->size_and_flag = new_block_size; 46f40: 2142 0004 movel %d2,%a0@(4) _Heap_Block_split( heap, new_block, free_list_anchor, alloc_size ); 46f44: 2f05 movel %d5,%sp@- 46f46: 2f01 movel %d1,%sp@- 46f48: 2f08 movel %a0,%sp@- 46f4a: 2f0b movel %a3,%sp@- 46f4c: 4eb9 0004 6da0 jsr 46da0 <_Heap_Block_split> 46f52: 4fef 0010 lea %sp@(16),%sp alloc_size ); } /* Statistics */ if ( stats->min_free_size > stats->free_size ) { 46f56: 202b 0030 movel %a3@(48),%d0 Heap_Block *block, uintptr_t alloc_begin, uintptr_t alloc_size ) { Heap_Statistics *const stats = &heap->stats; 46f5a: b0ab 0034 cmpl %a3@(52),%d0 46f5e: 6404 bccs 46f64 <_Heap_Block_allocate+0xd0> ); } /* Statistics */ if ( stats->min_free_size > stats->free_size ) { stats->min_free_size = stats->free_size; 46f60: 2740 0034 movel %d0,%a3@(52) } return block; } 46f64: 200a movel %a2,%d0 46f66: 4cee 3c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a5 46f6c: 4e5e unlk %fp 46f6e: 4e75 rts stats->free_size -= _Heap_Block_size( block ); } else { free_list_anchor = _Heap_Free_list_head( heap ); } if ( alloc_area_offset < heap->page_size ) { 46f70: 202b 0010 movel %a3@(16),%d0 /* Statistics */ --stats->free_blocks; ++stats->used_blocks; stats->free_size -= _Heap_Block_size( block ); } else { free_list_anchor = _Heap_Free_list_head( heap ); 46f74: 224b moveal %a3,%a1 } if ( alloc_area_offset < heap->page_size ) { 46f76: b08c cmpl %a4,%d0 46f78: 6300 ff7c blsw 46ef6 <_Heap_Block_allocate+0x62> Heap_Block *block, Heap_Block *free_list_anchor, uintptr_t alloc_size ) { _Heap_Block_split( heap, block, free_list_anchor, alloc_size ); 46f7c: 4874 5800 pea %a4@(00000000,%d5:l) 46f80: 2f09 movel %a1,%sp@- 46f82: 2f0a movel %a2,%sp@- 46f84: 2f0b movel %a3,%sp@- 46f86: 4eb9 0004 6da0 jsr 46da0 <_Heap_Block_split> 46f8c: 4fef 0010 lea %sp@(16),%sp 46f90: 60c4 bras 46f56 <_Heap_Block_allocate+0xc2> RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Prev_block( const Heap_Block *block ) { return (Heap_Block *) ((uintptr_t) block - block->prev_size); 46f92: 95d2 subal %a2@,%a2 Heap_Block *const prev_block = _Heap_Prev_block( block ); uintptr_t const prev_block_size = _Heap_Block_size( prev_block ); block = prev_block; block_begin = (uintptr_t) block; block_size += prev_block_size; 46f94: 78fe moveq #-2,%d4 46f96: 2209 movel %a1,%d1 46f98: c8aa 0004 andl %a2@(4),%d4 46f9c: d084 addl %d4,%d0 } block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; new_block->prev_size = block_size; new_block->size_and_flag = new_block_size; 46f9e: 78fe moveq #-2,%d4 46fa0: c684 andl %d4,%d3 block = prev_block; block_begin = (uintptr_t) block; block_size += prev_block_size; } block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; 46fa2: 7801 moveq #1,%d4 46fa4: 8880 orl %d0,%d4 new_block->prev_size = block_size; new_block->size_and_flag = new_block_size; 46fa6: d483 addl %d3,%d2 46fa8: 9488 subl %a0,%d2 block = prev_block; block_begin = (uintptr_t) block; block_size += prev_block_size; } block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; 46faa: 2544 0004 movel %d4,%a2@(4) new_block->prev_size = block_size; new_block->size_and_flag = new_block_size; _Heap_Block_split( heap, new_block, free_list_anchor, alloc_size ); 46fae: 2448 moveal %a0,%a2 block_size += prev_block_size; } block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; new_block->prev_size = block_size; 46fb0: 2080 movel %d0,%a0@ new_block->size_and_flag = new_block_size; 46fb2: 2142 0004 movel %d2,%a0@(4) _Heap_Block_split( heap, new_block, free_list_anchor, alloc_size ); 46fb6: 2f05 movel %d5,%sp@- 46fb8: 2f01 movel %d1,%sp@- 46fba: 2f08 movel %a0,%sp@- 46fbc: 2f0b movel %a3,%sp@- 46fbe: 4eb9 0004 6da0 jsr 46da0 <_Heap_Block_split> 46fc4: 4fef 0010 lea %sp@(16),%sp 46fc8: 608c bras 46f56 <_Heap_Block_allocate+0xc2> ... 00050dc4 <_Heap_Extend>: Heap_Control *heap, void *area_begin_ptr, uintptr_t area_size, uintptr_t *amount_extended ) { 50dc4: 4e56 fff4 linkw %fp,#-12 50dc8: 206e 0008 moveal %fp@(8),%a0 50dcc: 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; 50dd0: 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; 50dd4: 2268 0024 moveal %a0@(36),%a1 Heap_Control *heap, void *area_begin_ptr, uintptr_t area_size, uintptr_t *amount_extended ) { 50dd8: 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; 50ddc: b0a8 0018 cmpl %a0@(24),%d0 50de0: 6410 bccs 50df2 <_Heap_Extend+0x2e> * As noted, this code only supports (4). */ if ( area_begin >= heap_area_begin && area_begin < heap_area_end ) { return HEAP_EXTEND_ERROR; /* case 3 */ } else if ( area_begin != heap_area_end ) { 50de2: b280 cmpl %d0,%d1 50de4: 671c beqs 50e02 <_Heap_Extend+0x3e> 50de6: 7002 moveq #2,%d0 _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( last_block )); } return HEAP_EXTEND_SUCCESSFUL; } 50de8: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 50dee: 4e5e unlk %fp 50df0: 4e75 rts * 5. non-contiguous higher address (NOT SUPPORTED) * * As noted, this code only supports (4). */ if ( area_begin >= heap_area_begin && area_begin < heap_area_end ) { 50df2: b280 cmpl %d0,%d1 50df4: 63ec blss 50de2 <_Heap_Extend+0x1e> 50df6: 7001 moveq #1,%d0 _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( last_block )); } return HEAP_EXTEND_SUCCESSFUL; } 50df8: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 50dfe: 4e5e unlk %fp 50e00: 4e75 rts { Heap_Statistics *const stats = &heap->stats; uintptr_t const area_begin = (uintptr_t) area_begin_ptr; uintptr_t const heap_area_begin = heap->area_begin; uintptr_t const heap_area_end = heap->area_end; uintptr_t const new_heap_area_end = heap_area_end + area_size; 50e02: 2200 movel %d0,%d1 50e04: d2ae 0010 addl %fp@(16),%d1 * block and free it. */ heap->area_end = new_heap_area_end; extend_size = new_heap_area_end 50e08: 70f8 moveq #-8,%d0 50e0a: 9089 subl %a1,%d0 50e0c: d081 addl %d1,%d0 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 50e0e: 2600 movel %d0,%d3 50e10: 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; 50e16: 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; 50e1a: 246e 0014 moveal %fp@(20),%a2 50e1e: 9082 subl %d2,%d0 50e20: 2480 movel %d0,%a2@ if( extend_size >= heap->min_block_size ) { 50e22: b0a8 0014 cmpl %a0@(20),%d0 50e26: 640c bccs 50e34 <_Heap_Extend+0x70> /* 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 )); 50e28: 4280 clrl %d0 <== NOT EXECUTED } return HEAP_EXTEND_SUCCESSFUL; } 50e2a: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 50e30: 4e5e unlk %fp 50e32: 4e75 rts uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; block->size_and_flag = size | flag; 50e34: 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); 50e36: 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; 50e3a: c4a9 0004 andl %a1@(4),%d2 if( extend_size >= heap->min_block_size ) { Heap_Block *const new_last_block = _Heap_Block_at( last_block, extend_size ); _Heap_Block_set_size( last_block, extend_size ); new_last_block->size_and_flag = 50e3e: 2228 0020 movel %a0@(32),%d1 50e42: 928a subl %a2,%d1 50e44: 8480 orl %d0,%d2 ((uintptr_t) heap->first_block - (uintptr_t) new_last_block) | HEAP_PREV_BLOCK_USED; heap->last_block = new_last_block; 50e46: 214a 0024 movel %a2,%a0@(36) 50e4a: 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 = 50e4e: 7401 moveq #1,%d2 50e50: 8481 orl %d1,%d2 50e52: 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 )); 50e56: 4869 0008 pea %a1@(8) | HEAP_PREV_BLOCK_USED; heap->last_block = new_last_block; /* Statistics */ stats->size += extend_size; 50e5a: d1a8 002c addl %d0,%a0@(44) ++stats->used_blocks; 50e5e: 52a8 0040 addql #1,%a0@(64) --stats->frees; /* Do not count subsequent call as actual free() */ 50e62: 53a8 0050 subql #1,%a0@(80) _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( last_block )); 50e66: 2f08 movel %a0,%sp@- 50e68: 4eb9 0004 b5e8 jsr 4b5e8 <_Heap_Free> 50e6e: 508f addql #8,%sp 50e70: 4280 clrl %d0 50e72: 60b6 bras 50e2a <_Heap_Extend+0x66> 0004be54 <_Heap_Free>: #include #include #include bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { 4be54: 4e56 ffe4 linkw %fp,#-28 4be58: 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 ) 4be5c: 2040 moveal %d0,%a0 4be5e: 5188 subql #8,%a0 4be60: 226e 0008 moveal %fp@(8),%a1 4be64: 4c69 0001 0010 remul %a1@(16),%d1,%d0 4be6a: 48d7 0c7c moveml %d2-%d6/%a2-%a3,%sp@ const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 4be6e: 2029 0020 movel %a1@(32),%d0 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_of_alloc_area( uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) 4be72: 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 4be74: b088 cmpl %a0,%d0 4be76: 6200 00a0 bhiw 4bf18 <_Heap_Free+0xc4> && (uintptr_t) block <= (uintptr_t) heap->last_block; 4be7a: 2229 0024 movel %a1@(36),%d1 RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap( const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block 4be7e: b288 cmpl %a0,%d1 4be80: 6500 0096 bcsw 4bf18 <_Heap_Free+0xc4> - 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; 4be84: 2628 0004 movel %a0@(4),%d3 4be88: 74fe moveq #-2,%d2 4be8a: c483 andl %d3,%d2 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4be8c: 45f0 2800 lea %a0@(00000000,%d2:l),%a2 RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap( const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block 4be90: b5c0 cmpal %d0,%a2 4be92: 6500 0084 bcsw 4bf18 <_Heap_Free+0xc4> 4be96: b5c1 cmpal %d1,%a2 4be98: 627e bhis 4bf18 <_Heap_Free+0xc4> 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; 4be9a: 282a 0004 movel %a2@(4),%d4 if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { _HAssert( false ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 4be9e: 7a01 moveq #1,%d5 4bea0: ca84 andl %d4,%d5 4bea2: 4a05 tstb %d5 4bea4: 6772 beqs 4bf18 <_Heap_Free+0xc4> - 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; 4bea6: 7afe moveq #-2,%d5 4bea8: c885 andl %d5,%d4 _HAssert( false ); return false; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block 4beaa: b5c1 cmpal %d1,%a2 4beac: 6700 00fa beqw 4bfa8 <_Heap_Free+0x154> #include #include #include bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) 4beb0: 7a01 moveq #1,%d5 4beb2: 7c01 moveq #1,%d6 4beb4: cab2 4804 andl %a2@(00000004,%d4:l),%d5 4beb8: bd85 eorl %d6,%d5 next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); if ( !_Heap_Is_prev_used( block ) ) { 4beba: 7c01 moveq #1,%d6 4bebc: c686 andl %d6,%d3 4bebe: 4a03 tstb %d3 4bec0: 6660 bnes 4bf22 <_Heap_Free+0xce> uintptr_t const prev_size = block->prev_size; 4bec2: 2610 movel %a0@,%d3 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4bec4: 91c3 subal %d3,%a0 RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap( const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block 4bec6: b1c0 cmpal %d0,%a0 4bec8: 654e bcss 4bf18 <_Heap_Free+0xc4> 4beca: b1c1 cmpal %d1,%a0 4becc: 624a bhis 4bf18 <_Heap_Free+0xc4> return( false ); } /* As we always coalesce free blocks, the block that preceedes prev_block must have been used. */ if ( !_Heap_Is_prev_used ( prev_block) ) { 4bece: 7001 moveq #1,%d0 4bed0: c0a8 0004 andl %a0@(4),%d0 4bed4: 4a00 tstb %d0 4bed6: 6740 beqs 4bf18 <_Heap_Free+0xc4> _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ 4bed8: 4a05 tstb %d5 4beda: 6700 00d2 beqw 4bfae <_Heap_Free+0x15a> } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; Heap_Block *prev = block->prev; 4bede: 266a 000c moveal %a2@(12),%a3 uintptr_t const size = block_size + prev_size + next_block_size; _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 4bee2: 53a9 0038 subql #1,%a1@(56) _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ uintptr_t const size = block_size + prev_size + next_block_size; 4bee6: d882 addl %d2,%d4 4bee8: d684 addl %d4,%d3 _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4beea: 7001 moveq #1,%d0 return _Heap_Free_list_tail(heap)->prev; } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; 4beec: 246a 0008 moveal %a2@(8),%a2 4bef0: 8083 orl %d3,%d0 next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; 4bef2: 2183 3800 movel %d3,%a0@(00000000,%d3:l) if ( next_is_free ) { /* coalesce both */ uintptr_t const size = block_size + prev_size + next_block_size; _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4bef6: 2140 0004 movel %d0,%a0@(4) Heap_Block *prev = block->prev; prev->next = next; next->prev = prev; 4befa: 254b 000c movel %a3,%a2@(12) RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; Heap_Block *prev = block->prev; prev->next = next; 4befe: 274a 0008 movel %a2,%a3@(8) } /* Statistics */ --stats->used_blocks; ++stats->frees; stats->free_size += block_size; 4bf02: d5a9 0030 addl %d2,%a1@(48) stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 4bf06: 53a9 0040 subql #1,%a1@(64) ++stats->frees; 4bf0a: 52a9 0050 addql #1,%a1@(80) stats->free_size += block_size; 4bf0e: 7001 moveq #1,%d0 return( true ); } 4bf10: 4cd7 0c7c moveml %sp@,%d2-%d6/%a2-%a3 4bf14: 4e5e unlk %fp 4bf16: 4e75 rts 4bf18: 4cd7 0c7c moveml %sp@,%d2-%d6/%a2-%a3 /* Statistics */ --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); 4bf1c: 4200 clrb %d0 } 4bf1e: 4e5e unlk %fp 4bf20: 4e75 rts uintptr_t const size = block_size + prev_size; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ 4bf22: 4a05 tstb %d5 4bf24: 6736 beqs 4bf5c <_Heap_Free+0x108> Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; Heap_Block *prev = old_block->prev; 4bf26: 266a 000c moveal %a2@(12),%a3 uintptr_t const size = block_size + next_block_size; 4bf2a: d882 addl %d2,%d4 _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4bf2c: 7001 moveq #1,%d0 RTEMS_INLINE_ROUTINE void _Heap_Free_list_replace( Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; 4bf2e: 246a 0008 moveal %a2@(8),%a2 4bf32: 8084 orl %d4,%d0 next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; 4bf34: 2184 4800 movel %d4,%a0@(00000000,%d4:l) Heap_Block *prev = old_block->prev; new_block->next = next; new_block->prev = prev; 4bf38: 214b 000c movel %a3,%a0@(12) ) { Heap_Block *next = old_block->next; Heap_Block *prev = old_block->prev; new_block->next = next; 4bf3c: 214a 0008 movel %a2,%a0@(8) next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ uintptr_t const size = block_size + next_block_size; _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4bf40: 2140 0004 movel %d0,%a0@(4) } /* Statistics */ --stats->used_blocks; ++stats->frees; stats->free_size += block_size; 4bf44: d5a9 0030 addl %d2,%a1@(48) stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 4bf48: 53a9 0040 subql #1,%a1@(64) ++stats->frees; 4bf4c: 52a9 0050 addql #1,%a1@(80) stats->free_size += block_size; 4bf50: 7001 moveq #1,%d0 new_block->prev = prev; next->prev = new_block; 4bf52: 2548 000c movel %a0,%a2@(12) prev->next = new_block; 4bf56: 2748 0008 movel %a0,%a3@(8) 4bf5a: 60b4 bras 4bf10 <_Heap_Free+0xbc> next_block->prev_size = size; } else { /* no coalesce */ /* Add 'block' to the head of the free blocks list as it tends to produce less fragmentation than adding to the tail. */ _Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block ); block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; 4bf5c: 7a01 moveq #1,%d5 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4bf5e: 7cfe moveq #-2,%d6 next_block->prev_size = size; } else { /* no coalesce */ /* Add 'block' to the head of the free blocks list as it tends to produce less fragmentation than adding to the tail. */ _Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block ); block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; 4bf60: 8a82 orl %d2,%d5 RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after( Heap_Block *block_before, Heap_Block *new_block ) { Heap_Block *next = block_before->next; 4bf62: 2669 0008 moveal %a1@(8),%a3 4bf66: 2145 0004 movel %d5,%a0@(4) next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4bf6a: cdaa 0004 andl %d6,%a2@(4) next_block->prev_size = block_size; 4bf6e: 2482 movel %d2,%a2@ /* Statistics */ ++stats->free_blocks; 4bf70: 2029 0038 movel %a1@(56),%d0 4bf74: 5280 addql #1,%d0 new_block->next = next; 4bf76: 214b 0008 movel %a3,%a0@(8) new_block->prev = block_before; 4bf7a: 2149 000c movel %a1,%a0@(12) block_before->next = new_block; 4bf7e: 2348 0008 movel %a0,%a1@(8) next->prev = new_block; 4bf82: 2748 000c movel %a0,%a3@(12) 4bf86: 2340 0038 movel %d0,%a1@(56) #include #include bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { Heap_Statistics *const stats = &heap->stats; 4bf8a: b0a9 003c cmpl %a1@(60),%d0 4bf8e: 6300 ff72 blsw 4bf02 <_Heap_Free+0xae> } /* Statistics */ --stats->used_blocks; ++stats->frees; stats->free_size += block_size; 4bf92: d5a9 0030 addl %d2,%a1@(48) stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 4bf96: 53a9 0040 subql #1,%a1@(64) ++stats->frees; 4bf9a: 52a9 0050 addql #1,%a1@(80) next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; if ( stats->max_free_blocks < stats->free_blocks ) { stats->max_free_blocks = stats->free_blocks; 4bf9e: 2340 003c movel %d0,%a1@(60) } /* Statistics */ --stats->used_blocks; ++stats->frees; stats->free_size += block_size; 4bfa2: 7001 moveq #1,%d0 4bfa4: 6000 ff6a braw 4bf10 <_Heap_Free+0xbc> _HAssert( false ); return false; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block 4bfa8: 4205 clrb %d5 4bfaa: 6000 ff0e braw 4beba <_Heap_Free+0x66> prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; } else { /* coalesce prev */ uintptr_t const size = block_size + prev_size; 4bfae: d682 addl %d2,%d3 prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4bfb0: 7a01 moveq #1,%d5 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4bfb2: 7cfe moveq #-2,%d6 next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; } else { /* coalesce prev */ uintptr_t const size = block_size + prev_size; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4bfb4: 8a83 orl %d3,%d5 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = size; 4bfb6: 2483 movel %d3,%a2@ } /* Statistics */ --stats->used_blocks; ++stats->frees; stats->free_size += block_size; 4bfb8: 7001 moveq #1,%d0 next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; } else { /* coalesce prev */ uintptr_t const size = block_size + prev_size; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4bfba: 2145 0004 movel %d5,%a0@(4) next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4bfbe: cdaa 0004 andl %d6,%a2@(4) } /* Statistics */ --stats->used_blocks; ++stats->frees; stats->free_size += block_size; 4bfc2: d5a9 0030 addl %d2,%a1@(48) stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 4bfc6: 53a9 0040 subql #1,%a1@(64) ++stats->frees; 4bfca: 52a9 0050 addql #1,%a1@(80) 4bfce: 6000 ff40 braw 4bf10 <_Heap_Free+0xbc> ... 0007bf88 <_Heap_Get_information>: void _Heap_Get_information( Heap_Control *the_heap, Heap_Information_block *the_info ) { 7bf88: 4e56 fff4 linkw %fp,#-12 7bf8c: 206e 0008 moveal %fp@(8),%a0 7bf90: 48d7 040c moveml %d2-%d3/%a2,%sp@ 7bf94: 246e 000c moveal %fp@(12),%a2 Heap_Block *the_block = the_heap->first_block; Heap_Block *const end = the_heap->last_block; 7bf98: 2428 0024 movel %a0@(36),%d2 void _Heap_Get_information( Heap_Control *the_heap, Heap_Information_block *the_info ) { Heap_Block *the_block = the_heap->first_block; 7bf9c: 2268 0020 moveal %a0@(32),%a1 Heap_Block *const end = the_heap->last_block; _HAssert(the_block->prev_size == the_heap->page_size); _HAssert(_Heap_Is_prev_used(the_block)); the_info->Free.number = 0; 7bfa0: 4292 clrl %a2@ the_info->Free.total = 0; 7bfa2: 42aa 0008 clrl %a2@(8) the_info->Free.largest = 0; 7bfa6: 42aa 0004 clrl %a2@(4) the_info->Used.number = 0; 7bfaa: 42aa 000c clrl %a2@(12) the_info->Used.total = 0; 7bfae: 42aa 0014 clrl %a2@(20) the_info->Used.largest = 0; 7bfb2: 42aa 0010 clrl %a2@(16) while ( the_block != end ) { 7bfb6: b489 cmpl %a1,%d2 7bfb8: 6746 beqs 7c000 <_Heap_Get_information+0x78> uintptr_t const the_size = _Heap_Block_size(the_block); Heap_Block *const next_block = _Heap_Block_at(the_block, the_size); Heap_Information *info; if ( _Heap_Is_prev_used(next_block) ) info = &the_info->Used; 7bfba: 260a movel %a2,%d3 7bfbc: 0683 0000 000c addil #12,%d3 the_info->Free.largest = 0; the_info->Used.number = 0; the_info->Used.total = 0; the_info->Used.largest = 0; while ( the_block != end ) { 7bfc2: 2229 0004 movel %a1@(4),%d1 - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 7bfc6: 70fe moveq #-2,%d0 uintptr_t const the_size = _Heap_Block_size(the_block); Heap_Block *const next_block = _Heap_Block_at(the_block, the_size); Heap_Information *info; if ( _Heap_Is_prev_used(next_block) ) 7bfc8: 204a moveal %a2,%a0 7bfca: 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); 7bfcc: d3c0 addal %d0,%a1 block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 7bfce: 2229 0004 movel %a1@(4),%d1 7bfd2: 0801 0000 btst #0,%d1 7bfd6: 6702 beqs 7bfda <_Heap_Get_information+0x52> 7bfd8: 2043 moveal %d3,%a0 info = &the_info->Used; else info = &the_info->Free; info->number++; 7bfda: 5290 addql #1,%a0@ info->total += the_size; 7bfdc: d1a8 0008 addl %d0,%a0@(8) if ( info->largest < the_size ) 7bfe0: b0a8 0004 cmpl %a0@(4),%d0 7bfe4: 6304 blss 7bfea <_Heap_Get_information+0x62> info->largest = the_size; 7bfe6: 2140 0004 movel %d0,%a0@(4) the_info->Free.largest = 0; the_info->Used.number = 0; the_info->Used.total = 0; the_info->Used.largest = 0; while ( the_block != end ) { 7bfea: b3c2 cmpal %d2,%a1 7bfec: 66d8 bnes 7bfc6 <_Heap_Get_information+0x3e> 7bfee: 202a 0014 movel %a2@(20),%d0 7bff2: 5080 addql #8,%d0 /* * Handle the last dummy block. Don't consider this block to be * "used" as client never allocated it. Make 'Used.total' contain this * blocks' overhead though. */ the_info->Used.total += HEAP_BLOCK_HEADER_SIZE; 7bff4: 2540 0014 movel %d0,%a2@(20) } 7bff8: 4cd7 040c moveml %sp@,%d2-%d3/%a2 7bffc: 4e5e unlk %fp 7bffe: 4e75 rts the_info->Free.largest = 0; the_info->Used.number = 0; the_info->Used.total = 0; the_info->Used.largest = 0; while ( the_block != end ) { 7c000: 7008 moveq #8,%d0 <== NOT EXECUTED /* * Handle the last dummy block. Don't consider this block to be * "used" as client never allocated it. Make 'Used.total' contain this * blocks' overhead though. */ the_info->Used.total += HEAP_BLOCK_HEADER_SIZE; 7c002: 2540 0014 movel %d0,%a2@(20) <== NOT EXECUTED } 7c006: 4cd7 040c moveml %sp@,%d2-%d3/%a2 <== NOT EXECUTED 7c00a: 4e5e unlk %fp <== NOT EXECUTED ... 000464a6 <_IO_Manager_initialization>: * workspace. * */ void _IO_Manager_initialization(void) { 464a6: 4e56 fff0 linkw %fp,#-16 464aa: 48d7 003c moveml %d2-%d5,%sp@ uint32_t index; rtems_driver_address_table *driver_table; uint32_t drivers_in_table; uint32_t number_of_drivers; driver_table = Configuration.Device_driver_table; 464ae: 2639 0005 d7f6 movel 5d7f6 ,%d3 drivers_in_table = Configuration.number_of_device_drivers; 464b4: 2439 0005 d7f2 movel 5d7f2 ,%d2 number_of_drivers = Configuration.maximum_drivers; 464ba: 2839 0005 d7ee movel 5d7ee ,%d4 /* * If the user claims there are less drivers than are actually in * the table, then let's just go with the table's count. */ if ( number_of_drivers <= drivers_in_table ) 464c0: b882 cmpl %d2,%d4 464c2: 6216 bhis 464da <_IO_Manager_initialization+0x34> * If the maximum number of driver is the same as the number in the * table, then we do not have to copy the driver table. They can't * register any dynamically. */ if ( number_of_drivers == drivers_in_table ) { _IO_Driver_address_table = driver_table; 464c4: 23c3 0005 f808 movel %d3,5f808 <_IO_Driver_address_table> _IO_Number_of_drivers = number_of_drivers; 464ca: 23c2 0005 f804 movel %d2,5f804 <_IO_Number_of_drivers> ); for ( index = 0 ; index < drivers_in_table ; index++ ) _IO_Driver_address_table[index] = driver_table[index]; number_of_drivers = drivers_in_table; } 464d0: 4cee 003c fff0 moveml %fp@(-16),%d2-%d5 464d6: 4e5e unlk %fp 464d8: 4e75 rts /* * The application requested extra slots in the driver table, so we * have to allocate a new driver table and copy theirs to it. */ _IO_Driver_address_table = (rtems_driver_address_table *) 464da: 2004 movel %d4,%d0 464dc: 2a04 movel %d4,%d5 464de: e788 lsll #3,%d0 464e0: eb8d lsll #5,%d5 464e2: 9a80 subl %d0,%d5 464e4: 2f05 movel %d5,%sp@- 464e6: 4eb9 0004 91c0 jsr 491c0 <_Workspace_Allocate_or_fatal_error> _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; memset( 464ec: 2f05 movel %d5,%sp@- 464ee: 42a7 clrl %sp@- _IO_Driver_address_table = (rtems_driver_address_table *) _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; 464f0: 23c4 0005 f804 movel %d4,5f804 <_IO_Number_of_drivers> memset( 464f6: 2f00 movel %d0,%sp@- /* * The application requested extra slots in the driver table, so we * have to allocate a new driver table and copy theirs to it. */ _IO_Driver_address_table = (rtems_driver_address_table *) 464f8: 23c0 0005 f808 movel %d0,5f808 <_IO_Driver_address_table> _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; memset( 464fe: 4eb9 0004 f484 jsr 4f484 _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 46504: 4fef 0010 lea %sp@(16),%sp 46508: 4a82 tstl %d2 4650a: 67c4 beqs 464d0 <_IO_Manager_initialization+0x2a> 4650c: 2839 0005 f808 movel 5f808 <_IO_Driver_address_table>,%d4 46512: 4280 clrl %d0 46514: 4281 clrl %d1 _IO_Driver_address_table[index] = driver_table[index]; 46516: 2243 moveal %d3,%a1 46518: 2044 moveal %d4,%a0 4651a: d3c0 addal %d0,%a1 4651c: d1c0 addal %d0,%a0 memset( _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 4651e: 5281 addql #1,%d1 46520: 0680 0000 0018 addil #24,%d0 _IO_Driver_address_table[index] = driver_table[index]; 46526: 20d9 movel %a1@+,%a0@+ 46528: 20d9 movel %a1@+,%a0@+ 4652a: 20d9 movel %a1@+,%a0@+ 4652c: 20d9 movel %a1@+,%a0@+ 4652e: 20d9 movel %a1@+,%a0@+ 46530: 2091 movel %a1@,%a0@ memset( _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 46532: b282 cmpl %d2,%d1 46534: 649a bccs 464d0 <_IO_Manager_initialization+0x2a> _IO_Driver_address_table[index] = driver_table[index]; 46536: 2243 moveal %d3,%a1 46538: 2044 moveal %d4,%a0 4653a: d3c0 addal %d0,%a1 4653c: d1c0 addal %d0,%a0 memset( _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 4653e: 5281 addql #1,%d1 46540: 0680 0000 0018 addil #24,%d0 _IO_Driver_address_table[index] = driver_table[index]; 46546: 20d9 movel %a1@+,%a0@+ 46548: 20d9 movel %a1@+,%a0@+ 4654a: 20d9 movel %a1@+,%a0@+ 4654c: 20d9 movel %a1@+,%a0@+ 4654e: 20d9 movel %a1@+,%a0@+ 46550: 2091 movel %a1@,%a0@ memset( _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 46552: b282 cmpl %d2,%d1 46554: 65c0 bcss 46516 <_IO_Manager_initialization+0x70> 46556: 6000 ff78 braw 464d0 <_IO_Manager_initialization+0x2a> ... 00046fcc <_Internal_error_Occurred>: _Internal_errors_What_happened.the_source = the_source; _Internal_errors_What_happened.is_internal = is_internal; _Internal_errors_What_happened.the_error = the_error; _User_extensions_Fatal( the_source, is_internal, the_error ); 46fcc: 4280 clrl %d0 void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 46fce: 4e56 0000 linkw %fp,#0 46fd2: 222e 000c movel %fp@(12),%d1 _Internal_errors_What_happened.the_source = the_source; _Internal_errors_What_happened.is_internal = is_internal; _Internal_errors_What_happened.the_error = the_error; _User_extensions_Fatal( the_source, is_internal, the_error ); 46fd6: 1001 moveb %d1,%d0 46fd8: 2040 moveal %d0,%a0 void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 46fda: 2f03 movel %d3,%sp@- 46fdc: 202e 0008 movel %fp@(8),%d0 46fe0: 2f02 movel %d2,%sp@- 46fe2: 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 ); 46fe6: 2f02 movel %d2,%sp@- Internal_errors_t the_error ) { _Internal_errors_What_happened.the_source = the_source; _Internal_errors_What_happened.is_internal = is_internal; 46fe8: 13c1 0005 f022 moveb %d1,5f022 <_Internal_errors_What_happened+0x4> _Internal_errors_What_happened.the_error = the_error; _User_extensions_Fatal( the_source, is_internal, the_error ); 46fee: 2f08 movel %a0,%sp@- bool is_internal, Internal_errors_t the_error ) { _Internal_errors_What_happened.the_source = the_source; 46ff0: 23c0 0005 f01e movel %d0,5f01e <_Internal_errors_What_happened> _Internal_errors_What_happened.is_internal = is_internal; _Internal_errors_What_happened.the_error = the_error; _User_extensions_Fatal( the_source, is_internal, the_error ); 46ff6: 2f00 movel %d0,%sp@- ) { _Internal_errors_What_happened.the_source = the_source; _Internal_errors_What_happened.is_internal = is_internal; _Internal_errors_What_happened.the_error = the_error; 46ff8: 23c2 0005 f024 movel %d2,5f024 <_Internal_errors_What_happened+0x6> _User_extensions_Fatal( the_source, is_internal, the_error ); 46ffe: 4eb9 0004 8df2 jsr 48df2 <_User_extensions_Fatal> _System_state_Set( SYSTEM_STATE_FAILED ); _CPU_Fatal_halt( the_error ); 47004: 307c 0700 moveaw #1792,%a0 47008: 2608 movel %a0,%d3 4700a: 40c0 movew %sr,%d0 4700c: 8083 orl %d3,%d0 4700e: 46c0 movew %d0,%sr 47010: 2002 movel %d2,%d0 <== NOT EXECUTED 47012: 223c dead beef movel #-559038737,%d1 <== NOT EXECUTED 47018: 4ac8 halt <== NOT EXECUTED RTEMS_INLINE_ROUTINE void _System_state_Set ( System_state_Codes state ) { _System_state_Current = state; 4701a: 7005 moveq #5,%d0 4701c: 4fef 000c lea %sp@(12),%sp 47020: 23c0 0005 f100 movel %d0,5f100 <_System_state_Current> 47026: 60fe bras 47026 <_Internal_error_Occurred+0x5a> 00047090 <_Objects_Allocate>: */ Objects_Control *_Objects_Allocate( Objects_Information *information ) { 47090: 4e56 fff0 linkw %fp,#-16 47094: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ 47098: 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 ) 4709c: 4aaa 0014 tstl %a2@(20) 470a0: 660c bnes 470ae <_Objects_Allocate+0x1e> 470a2: 4280 clrl %d0 <== NOT EXECUTED information->inactive--; } } return the_object; } 470a4: 4cee 0c0c fff0 moveml %fp@(-16),%d2-%d3/%a2-%a3 470aa: 4e5e unlk %fp 470ac: 4e75 rts /* * OK. The manager should be initialized and configured to have objects. * With any luck, it is safe to attempt to allocate an object. */ the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 470ae: 240a movel %a2,%d2 470b0: 0682 0000 001c addil #28,%d2 470b6: 47f9 0004 b9c0 lea 4b9c0 <_Chain_Get>,%a3 470bc: 2f02 movel %d2,%sp@- 470be: 4e93 jsr %a3@ if ( information->auto_extend ) { 470c0: 588f addql #4,%sp 470c2: 4a2a 0010 tstb %a2@(16) 470c6: 67dc beqs 470a4 <_Objects_Allocate+0x14> /* * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { 470c8: 4a80 tstl %d0 470ca: 6738 beqs 47104 <_Objects_Allocate+0x74> } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 470cc: 2040 moveal %d0,%a0 470ce: 4281 clrl %d1 470d0: 4283 clrl %d3 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 470d2: 4282 clrl %d2 } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 470d4: 362a 0008 movew %a2@(8),%d3 470d8: 3228 000a movew %a0@(10),%d1 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; information->inactive--; 470dc: 306a 0028 moveaw %a2@(40),%a0 block = (uint32_t) _Objects_Get_index( the_object->id ) - _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 470e0: 342a 0012 movew %a2@(18),%d2 } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 470e4: 9283 subl %d3,%d1 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; information->inactive--; 470e6: 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 ]--; 470e8: 4c42 1001 remul %d2,%d1,%d1 information->inactive--; 470ec: 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 ]--; 470f0: 206a 002a moveal %a2@(42),%a0 470f4: e589 lsll #2,%d1 information->inactive--; } } return the_object; } 470f6: 4cee 0c0c fff0 moveml %fp@(-16),%d2-%d3/%a2-%a3 470fc: 4e5e unlk %fp block = (uint32_t) _Objects_Get_index( the_object->id ) - _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 470fe: d1c1 addal %d1,%a0 47100: 5390 subql #1,%a0@ information->inactive--; } } return the_object; } 47102: 4e75 rts * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { _Objects_Extend_information( information ); 47104: 2f0a movel %a2,%sp@- 47106: 4eb9 0004 714c jsr 4714c <_Objects_Extend_information> the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 4710c: 2f02 movel %d2,%sp@- 4710e: 4e93 jsr %a3@ } if ( the_object ) { 47110: 508f addql #8,%sp 47112: 4a80 tstl %d0 47114: 66b6 bnes 470cc <_Objects_Allocate+0x3c> information->inactive--; } } return the_object; } 47116: 4cee 0c0c fff0 moveml %fp@(-16),%d2-%d3/%a2-%a3 4711c: 4e5e unlk %fp <== NOT EXECUTED 00047120 <_Objects_Close>: #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 47120: 4280 clrl %d0 void _Objects_Close( Objects_Information *information, Objects_Control *the_object ) { 47122: 4e56 0000 linkw %fp,#0 47126: 226e 000c moveal %fp@(12),%a1 4712a: 206e 0008 moveal %fp@(8),%a0 4712e: 2f0a movel %a2,%sp@- 47130: 2468 0018 moveal %a0@(24),%a2 47134: 3029 000a movew %a1@(10),%d0 47138: 42b2 0c00 clrl %a2@(00000000,%d0:l:4) _Objects_Invalidate_Id( information, the_object ); _Objects_Namespace_remove( information, the_object ); 4713c: 2d49 000c movel %a1,%fp@(12) } 47140: 245f moveal %sp@+,%a2 47142: 4e5e unlk %fp Objects_Control *the_object ) { _Objects_Invalidate_Id( information, the_object ); _Objects_Namespace_remove( information, the_object ); 47144: 4ef9 0004 76a8 jmp 476a8 <_Objects_Namespace_remove> ... 0004714c <_Objects_Extend_information>: */ void _Objects_Extend_information( Objects_Information *information ) { 4714c: 4e56 ffcc linkw %fp,#-52 47150: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 47154: 246e 0008 moveal %fp@(8),%a2 /* * Search for a free block of indexes. The block variable ends up set * to block_count + 1 if the table needs to be extended. */ minimum_index = _Objects_Get_index( information->minimum_id ); 47158: 4285 clrl %d5 index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 4715a: 206a 002e moveal %a2@(46),%a0 /* * Search for a free block of indexes. The block variable ends up set * to block_count + 1 if the table needs to be extended. */ minimum_index = _Objects_Get_index( information->minimum_id ); 4715e: 3a2a 0008 movew %a2@(8),%d5 index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 47162: 4a88 tstl %a0 47164: 6700 022c beqw 47392 <_Objects_Extend_information+0x246> block_count = 0; else { block_count = information->maximum / information->allocation_size; 47168: 322a 000e movew %a2@(14),%d1 4716c: 302a 0012 movew %a2@(18),%d0 47170: 3801 movew %d1,%d4 47172: 0284 0000 ffff andil #65535,%d4 47178: 88c0 divuw %d0,%d4 4717a: 0284 0000 ffff andil #65535,%d4 for ( ; block < block_count; block++ ) { 47180: 6700 0224 beqw 473a6 <_Objects_Extend_information+0x25a> if ( information->object_blocks[ block ] == NULL ) 47184: 4a90 tstl %a0@ 47186: 6700 021e beqw 473a6 <_Objects_Extend_information+0x25a> 4718a: 5888 addql #4,%a0 4718c: 2605 movel %d5,%d3 4718e: 4282 clrl %d2 47190: 0280 0000 ffff andil #65535,%d0 break; else index_base += information->allocation_size; 47196: d680 addl %d0,%d3 if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { 47198: 5282 addql #1,%d2 4719a: b484 cmpl %d4,%d2 4719c: 6404 bccs 471a2 <_Objects_Extend_information+0x56> if ( information->object_blocks[ block ] == NULL ) 4719e: 4a98 tstl %a0@+ 471a0: 66f4 bnes 47196 <_Objects_Extend_information+0x4a> else index_base += information->allocation_size; } } maximum = (uint32_t) information->maximum + information->allocation_size; 471a2: 0281 0000 ffff andil #65535,%d1 471a8: 2641 moveal %d1,%a3 471aa: d7c0 addal %d0,%a3 /* * We need to limit the number of objects to the maximum number * representable in the index portion of the object Id. In the * case of 16-bit Ids, this is only 256 object instances. */ if ( maximum > OBJECTS_ID_FINAL_INDEX ) { 471ac: b7fc 0000 ffff cmpal #65535,%a3 471b2: 6200 0186 bhiw 4733a <_Objects_Extend_information+0x1ee> /* * Allocate the name table, and the objects and if it fails either return or * generate a fatal error depending on auto-extending being active. */ block_size = information->allocation_size * information->size; 471b6: 41ea 0014 lea %a2@(20),%a0 471ba: 4c10 0800 mulsl %a0@,%d0 if ( information->auto_extend ) { 471be: 4a2a 0010 tstb %a2@(16) 471c2: 6700 0180 beqw 47344 <_Objects_Extend_information+0x1f8> new_object_block = _Workspace_Allocate( block_size ); 471c6: 2f00 movel %d0,%sp@- 471c8: 4eb9 0004 91f4 jsr 491f4 <_Workspace_Allocate> if ( !new_object_block ) 471ce: 588f addql #4,%sp * Allocate the name table, and the objects and if it fails either return or * generate a fatal error depending on auto-extending being active. */ block_size = information->allocation_size * information->size; if ( information->auto_extend ) { new_object_block = _Workspace_Allocate( block_size ); 471d0: 2c00 movel %d0,%d6 if ( !new_object_block ) 471d2: 6700 0166 beqw 4733a <_Objects_Extend_information+0x1ee> } /* * If the index_base is the maximum we need to grow the tables. */ if (index_base >= information->maximum ) { 471d6: 4280 clrl %d0 471d8: 302a 000e movew %a2@(14),%d0 471dc: b083 cmpl %d3,%d0 471de: 6200 00c4 bhiw 472a4 <_Objects_Extend_information+0x158> */ /* * Up the block count and maximum */ block_count++; 471e2: 2a44 moveal %d4,%a5 471e4: 528d addql #1,%a5 * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); object_blocks = (void**) _Workspace_Allocate( block_size ); 471e6: 200b movel %a3,%d0 471e8: 41f5 da00 lea %a5@(00000000,%a5:l:2),%a0 471ec: d088 addl %a0,%d0 471ee: d085 addl %d5,%d0 471f0: e588 lsll #2,%d0 471f2: 2f00 movel %d0,%sp@- 471f4: 4eb9 0004 91f4 jsr 491f4 <_Workspace_Allocate> if ( !object_blocks ) { 471fa: 588f addql #4,%sp * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); object_blocks = (void**) _Workspace_Allocate( block_size ); 471fc: 2840 moveal %d0,%a4 if ( !object_blocks ) { 471fe: 4a80 tstl %d0 47200: 6700 01b2 beqw 473b4 <_Objects_Extend_information+0x268> } /* * Break the block into the various sections. */ inactive_per_block = (uint32_t *) _Addresses_Add_offset( 47204: 2e0d movel %a5,%d7 * Take the block count down. Saves all the (block_count - 1) * in the copies. */ block_count--; if ( information->maximum > minimum_index ) { 47206: 4280 clrl %d0 } /* * Break the block into the various sections. */ inactive_per_block = (uint32_t *) _Addresses_Add_offset( 47208: e58f lsll #2,%d7 * Take the block count down. Saves all the (block_count - 1) * in the copies. */ block_count--; if ( information->maximum > minimum_index ) { 4720a: 302a 000e movew %a2@(14),%d0 RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset ( const void *base, uintptr_t offset ) { return (void *)((uintptr_t)base + offset); 4720e: 4bf4 7800 lea %a4@(00000000,%d7:l),%a5 47212: de8d addl %a5,%d7 47214: b085 cmpl %d5,%d0 47216: 6200 013c bhiw 47354 <_Objects_Extend_information+0x208> } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 4721a: 4a85 tstl %d5 4721c: 670c beqs 4722a <_Objects_Extend_information+0xde> information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, 4721e: 2047 moveal %d7,%a0 47220: 4280 clrl %d0 /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { local_table[ index ] = NULL; 47222: 4298 clrl %a0@+ } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 47224: 5280 addql #1,%d0 47226: b085 cmpl %d5,%d0 47228: 65f8 bcss 47222 <_Objects_Extend_information+0xd6> 4722a: e58c lsll #2,%d4 */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); 4722c: 4281 clrl %d1 4722e: 322a 0012 movew %a2@(18),%d1 /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; 47232: 42b5 4800 clrl %a5@(00000000,%d4:l) for ( index=index_base ; index < ( information->allocation_size + index_base ); 47236: d283 addl %d3,%d1 } /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; 47238: 42b4 4800 clrl %a4@(00000000,%d4:l) inactive_per_block[block_count] = 0; for ( index=index_base ; 4723c: b283 cmpl %d3,%d1 4723e: 6310 blss 47250 <_Objects_Extend_information+0x104> 47240: 2247 moveal %d7,%a1 47242: 2003 movel %d3,%d0 47244: 41f1 3c00 lea %a1@(00000000,%d3:l:4),%a0 index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; 47248: 4298 clrl %a0@+ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); index++ ) { 4724a: 5280 addql #1,%d0 * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; 4724c: b280 cmpl %d0,%d1 4724e: 62f8 bhis 47248 <_Objects_Extend_information+0xfc> index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; } _ISR_Disable( level ); 47250: 203c 0000 0700 movel #1792,%d0 47256: 40c4 movew %sr,%d4 47258: 8084 orl %d4,%d0 4725a: 46c0 movew %d0,%sr information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; information->local_table = local_table; information->maximum = (Objects_Maximum) maximum; information->maximum_id = _Objects_Build_id( 4725c: 2012 movel %a2@,%d0 4725e: 7218 moveq #24,%d1 47260: 4285 clrl %d5 47262: e3a8 lsll %d1,%d0 47264: 3a0b movew %a3,%d5 47266: 4281 clrl %d1 47268: 2245 moveal %d5,%a1 4726a: 7a1b moveq #27,%d5 4726c: 322a 0004 movew %a2@(4),%d1 47270: 08c0 0010 bset #16,%d0 local_table[ index ] = NULL; } _ISR_Disable( level ); old_tables = information->object_blocks; 47274: 206a 002e moveal %a2@(46),%a0 information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; information->local_table = local_table; information->maximum = (Objects_Maximum) maximum; information->maximum_id = _Objects_Build_id( 47278: eba9 lsll %d5,%d1 old_tables = information->object_blocks; information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; information->local_table = local_table; information->maximum = (Objects_Maximum) maximum; 4727a: 354b 000e movew %a3,%a2@(14) _ISR_Disable( level ); old_tables = information->object_blocks; information->object_blocks = object_blocks; 4727e: 254c 002e movel %a4,%a2@(46) information->inactive_per_block = inactive_per_block; information->local_table = local_table; information->maximum = (Objects_Maximum) maximum; information->maximum_id = _Objects_Build_id( 47282: 8081 orl %d1,%d0 47284: 2209 movel %a1,%d1 47286: 8280 orl %d0,%d1 _ISR_Disable( level ); old_tables = information->object_blocks; information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; 47288: 254d 002a movel %a5,%a2@(42) information->local_table = local_table; information->maximum = (Objects_Maximum) maximum; information->maximum_id = _Objects_Build_id( 4728c: 2541 000a movel %d1,%a2@(10) old_tables = information->object_blocks; information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; information->local_table = local_table; 47290: 2547 0018 movel %d7,%a2@(24) information->the_class, _Objects_Local_node, information->maximum ); _ISR_Enable( level ); 47294: 46c4 movew %d4,%sr if ( old_tables ) 47296: 4a88 tstl %a0 47298: 670a beqs 472a4 <_Objects_Extend_information+0x158> _Workspace_Free( old_tables ); 4729a: 2f08 movel %a0,%sp@- 4729c: 4eb9 0004 9210 jsr 49210 <_Workspace_Free> 472a2: 588f addql #4,%sp } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 472a4: 206a 002e moveal %a2@(46),%a0 /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 472a8: 4280 clrl %d0 472aa: 280e movel %fp,%d4 472ac: 0684 ffff fff4 addil #-12,%d4 472b2: 47f9 0004 b9c0 lea 4b9c0 <_Chain_Get>,%a3 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 472b8: 2a0a movel %a2,%d5 472ba: 0685 0000 001c addil #28,%d5 472c0: 49f9 0004 6798 lea 46798 <_Chain_Append>,%a4 } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 472c6: e58a lsll #2,%d2 /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 472c8: 302a 0012 movew %a2@(18),%d0 } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 472cc: 2186 2800 movel %d6,%a0@(00000000,%d2:l) /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 472d0: 2f2a 0014 movel %a2@(20),%sp@- 472d4: 2f00 movel %d0,%sp@- 472d6: 2f06 movel %d6,%sp@- 472d8: 2f04 movel %d4,%sp@- 472da: 4eb9 0004 b9fc jsr 4b9fc <_Chain_Initialize> /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { 472e0: 4fef 0010 lea %sp@(16),%sp 472e4: 2f04 movel %d4,%sp@- 472e6: 4e93 jsr %a3@ 472e8: 588f addql #4,%sp 472ea: 4a80 tstl %d0 472ec: 6732 beqs 47320 <_Objects_Extend_information+0x1d4> the_object->id = _Objects_Build_id( 472ee: 2212 movel %a2@,%d1 472f0: 7c18 moveq #24,%d6 472f2: 7e1b moveq #27,%d7 472f4: 2040 moveal %d0,%a0 472f6: eda9 lsll %d6,%d1 472f8: 4286 clrl %d6 472fa: 3c2a 0004 movew %a2@(4),%d6 472fe: 08c1 0010 bset #16,%d1 47302: efae lsll %d7,%d6 47304: 8286 orl %d6,%d1 47306: 8283 orl %d3,%d1 index ); _Chain_Append( &information->Inactive, &the_object->Node ); index++; 47308: 5283 addql #1,%d3 */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { the_object->id = _Objects_Build_id( 4730a: 2141 0008 movel %d1,%a0@(8) information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 4730e: 2f00 movel %d0,%sp@- 47310: 2f05 movel %d5,%sp@- 47312: 4e94 jsr %a4@ index++; 47314: 508f addql #8,%sp /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { 47316: 2f04 movel %d4,%sp@- 47318: 4e93 jsr %a3@ 4731a: 588f addql #4,%sp 4731c: 4a80 tstl %d0 4731e: 66ce bnes 472ee <_Objects_Extend_information+0x1a2> _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 47320: 4280 clrl %d0 information->inactive = 47322: 322a 0028 movew %a2@(40),%d1 47326: 326a 0012 moveaw %a2@(18),%a1 _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 4732a: 206a 002a moveal %a2@(42),%a0 information->inactive = 4732e: d289 addl %a1,%d1 _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 47330: 3009 movew %a1,%d0 information->inactive = 47332: 3541 0028 movew %d1,%a2@(40) _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 47336: 2180 2800 movel %d0,%a0@(00000000,%d2:l) information->inactive = (Objects_Maximum)(information->inactive + information->allocation_size); } 4733a: 4cee 3cfc ffcc moveml %fp@(-52),%d2-%d7/%a2-%a5 47340: 4e5e unlk %fp 47342: 4e75 rts if ( information->auto_extend ) { new_object_block = _Workspace_Allocate( block_size ); if ( !new_object_block ) return; } else { new_object_block = _Workspace_Allocate_or_fatal_error( block_size ); 47344: 2f00 movel %d0,%sp@- 47346: 4eb9 0004 91c0 jsr 491c0 <_Workspace_Allocate_or_fatal_error> 4734c: 588f addql #4,%sp 4734e: 2c00 movel %d0,%d6 47350: 6000 fe84 braw 471d6 <_Objects_Extend_information+0x8a> /* * Copy each section of the table over. This has to be performed as * separate parts as size of each block has changed. */ memcpy( object_blocks, 47354: e58c lsll #2,%d4 47356: 2f04 movel %d4,%sp@- 47358: 2f2a 002e movel %a2@(46),%sp@- 4735c: 2f0c movel %a4,%sp@- 4735e: 4eb9 0004 f414 jsr 4f414 information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, 47364: 2f04 movel %d4,%sp@- 47366: 2f2a 002a movel %a2@(42),%sp@- 4736a: 2f0d movel %a5,%sp@- 4736c: 4eb9 0004 f414 jsr 4f414 information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, 47372: 4280 clrl %d0 47374: 302a 000e movew %a2@(14),%d0 47378: da80 addl %d0,%d5 4737a: e58d lsll #2,%d5 4737c: 2f05 movel %d5,%sp@- 4737e: 2f2a 0018 movel %a2@(24),%sp@- 47382: 2f07 movel %d7,%sp@- 47384: 4eb9 0004 f414 jsr 4f414 4738a: 4fef 0024 lea %sp@(36),%sp 4738e: 6000 fe9c braw 4722c <_Objects_Extend_information+0xe0> minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 47392: 4280 clrl %d0 47394: 2605 movel %d5,%d3 47396: 4282 clrl %d2 47398: 4284 clrl %d4 4739a: 322a 000e movew %a2@(14),%d1 4739e: 302a 0012 movew %a2@(18),%d0 473a2: 6000 fdfe braw 471a2 <_Objects_Extend_information+0x56> block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { if ( information->object_blocks[ block ] == NULL ) 473a6: 2605 movel %d5,%d3 <== NOT EXECUTED 473a8: 4282 clrl %d2 <== NOT EXECUTED 473aa: 0280 0000 ffff andil #65535,%d0 <== NOT EXECUTED 473b0: 6000 fdf0 braw 471a2 <_Objects_Extend_information+0x56><== NOT EXECUTED (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); object_blocks = (void**) _Workspace_Allocate( block_size ); if ( !object_blocks ) { _Workspace_Free( new_object_block ); 473b4: 2f06 movel %d6,%sp@- 473b6: 4eb9 0004 9210 jsr 49210 <_Workspace_Free> return; 473bc: 588f addql #4,%sp } information->inactive_per_block[ block ] = information->allocation_size; information->inactive = (Objects_Maximum)(information->inactive + information->allocation_size); } 473be: 4cee 3cfc ffcc moveml %fp@(-52),%d2-%d7/%a2-%a5 473c4: 4e5e unlk %fp <== NOT EXECUTED 00047ad8 <_Objects_Set_name>: { size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 47ad8: 4280 clrl %d0 bool _Objects_Set_name( Objects_Information *information, Objects_Control *the_object, const char *name ) { 47ada: 4e56 fff0 linkw %fp,#-16 47ade: 48d7 3c00 moveml %a2-%a5,%sp@ 47ae2: 286e 0008 moveal %fp@(8),%a4 47ae6: 246e 0010 moveal %fp@(16),%a2 size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 47aea: 302c 0034 movew %a4@(52),%d0 47aee: 2f00 movel %d0,%sp@- bool _Objects_Set_name( Objects_Information *information, Objects_Control *the_object, const char *name ) { 47af0: 2a6e 000c moveal %fp@(12),%a5 size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 47af4: 2f0a movel %a2,%sp@- 47af6: 4eb9 0005 08a0 jsr 508a0 #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) { 47afc: 508f addql #8,%sp { size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 47afe: 2640 moveal %d0,%a3 #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) { 47b00: 4a2c 0032 tstb %a4@(50) 47b04: 6662 bnes 47b68 <_Objects_Set_name+0x90> d[length] = '\0'; the_object->name.name_p = d; } else #endif { the_object->name.name_u32 = _Objects_Build_name( 47b06: 7018 moveq #24,%d0 47b08: 1212 moveb %a2@,%d1 47b0a: 49c1 extbl %d1 47b0c: e1a9 lsll %d0,%d1 47b0e: 103c 0001 moveb #1,%d0 47b12: b08b cmpl %a3,%d0 47b14: 643c bccs 47b52 <_Objects_Set_name+0x7a> 47b16: 102a 0001 moveb %a2@(1),%d0 47b1a: 49c0 extbl %d0 47b1c: 4840 swap %d0 47b1e: 4240 clrw %d0 47b20: 8081 orl %d1,%d0 47b22: 7202 moveq #2,%d1 47b24: b28b cmpl %a3,%d1 47b26: 6730 beqs 47b58 <_Objects_Set_name+0x80> 47b28: 122a 0002 moveb %a2@(2),%d1 47b2c: 49c1 extbl %d1 47b2e: e189 lsll #8,%d1 47b30: 8081 orl %d1,%d0 47b32: 7203 moveq #3,%d1 47b34: b28b cmpl %a3,%d1 47b36: 6700 0088 beqw 47bc0 <_Objects_Set_name+0xe8> 47b3a: 122a 0003 moveb %a2@(3),%d1 47b3e: 49c1 extbl %d1 47b40: 8081 orl %d1,%d0 47b42: 2b40 000c movel %d0,%a5@(12) 47b46: 7001 moveq #1,%d0 ); } return true; } 47b48: 4cee 3c00 fff0 moveml %fp@(-16),%a2-%a5 47b4e: 4e5e unlk %fp 47b50: 4e75 rts d[length] = '\0'; the_object->name.name_p = d; } else #endif { the_object->name.name_u32 = _Objects_Build_name( 47b52: 2001 movel %d1,%d0 47b54: 08c0 0015 bset #21,%d0 47b58: 7220 moveq #32,%d1 47b5a: 08c0 000d bset #13,%d0 47b5e: 8081 orl %d1,%d0 47b60: 2b40 000c movel %d0,%a5@(12) 47b64: 7001 moveq #1,%d0 47b66: 60e0 bras 47b48 <_Objects_Set_name+0x70> #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) { char *d; d = _Workspace_Allocate( length + 1 ); 47b68: 486b 0001 pea %a3@(1) 47b6c: 4eb9 0004 966c jsr 4966c <_Workspace_Allocate> if ( !d ) 47b72: 588f addql #4,%sp #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) { char *d; d = _Workspace_Allocate( length + 1 ); 47b74: 2840 moveal %d0,%a4 if ( !d ) 47b76: 4a80 tstl %d0 47b78: 673a beqs 47bb4 <_Objects_Set_name+0xdc> return false; if ( the_object->name.name_p ) { 47b7a: 202d 000c movel %a5@(12),%d0 47b7e: 670e beqs 47b8e <_Objects_Set_name+0xb6> _Workspace_Free( (void *)the_object->name.name_p ); 47b80: 2f00 movel %d0,%sp@- 47b82: 4eb9 0004 9688 jsr 49688 <_Workspace_Free> the_object->name.name_p = NULL; 47b88: 588f addql #4,%sp 47b8a: 42ad 000c clrl %a5@(12) } strncpy( d, name, length ); 47b8e: 2f0b movel %a3,%sp@- 47b90: 2f0a movel %a2,%sp@- 47b92: 2f0c movel %a4,%sp@- 47b94: 4eb9 0005 0818 jsr 50818 d[length] = '\0'; the_object->name.name_p = d; 47b9a: 4fef 000c lea %sp@(12),%sp _Workspace_Free( (void *)the_object->name.name_p ); the_object->name.name_p = NULL; } strncpy( d, name, length ); d[length] = '\0'; 47b9e: 4200 clrb %d0 47ba0: 1980 b800 moveb %d0,%a4@(00000000,%a3:l) the_object->name.name_p = d; 47ba4: 7001 moveq #1,%d0 47ba6: 2b4c 000c movel %a4,%a5@(12) ); } return true; } 47baa: 4cee 3c00 fff0 moveml %fp@(-16),%a2-%a5 47bb0: 4e5e unlk %fp 47bb2: 4e75 rts 47bb4: 4cee 3c00 fff0 moveml %fp@(-16),%a2-%a5 <== NOT EXECUTED #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) { char *d; d = _Workspace_Allocate( length + 1 ); if ( !d ) 47bba: 4200 clrb %d0 <== NOT EXECUTED ); } return true; } 47bbc: 4e5e unlk %fp <== NOT EXECUTED 47bbe: 4e75 rts <== NOT EXECUTED d[length] = '\0'; the_object->name.name_p = d; } else #endif { the_object->name.name_u32 = _Objects_Build_name( 47bc0: 123c 0020 moveb #32,%d1 47bc4: 8081 orl %d1,%d0 47bc6: 2b40 000c movel %d0,%a5@(12) 47bca: 7001 moveq #1,%d0 47bcc: 6000 ff7a braw 47b48 <_Objects_Set_name+0x70> 00047758 <_Objects_Shrink_information>: /* * Search the list to find block or chunk with all objects inactive. */ index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / 47758: 4281 clrl %d1 */ void _Objects_Shrink_information( Objects_Information *information ) { 4775a: 4e56 ffec linkw %fp,#-20 4775e: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 47762: 246e 0008 moveal %fp@(8),%a2 /* * Search the list to find block or chunk with all objects inactive. */ index_base = _Objects_Get_index( information->minimum_id ); 47766: 4283 clrl %d3 block_count = (information->maximum - index_base) / 47768: 4284 clrl %d4 /* * Search the list to find block or chunk with all objects inactive. */ index_base = _Objects_Get_index( information->minimum_id ); 4776a: 362a 0008 movew %a2@(8),%d3 block_count = (information->maximum - index_base) / 4776e: 382a 000e movew %a2@(14),%d4 47772: 322a 0012 movew %a2@(18),%d1 47776: 9883 subl %d3,%d4 47778: 4c41 4004 remul %d1,%d4,%d4 information->allocation_size; for ( block = 0; block < block_count; block++ ) { 4777c: 672c beqs 477aa <_Objects_Shrink_information+0x52> if ( information->inactive_per_block[ block ] == 4777e: 226a 002a moveal %a2@(42),%a1 47782: b291 cmpl %a1@,%d1 47784: 672e beqs 477b4 <_Objects_Shrink_information+0x5c> information->object_blocks[ block ] = NULL; information->inactive_per_block[ block ] = 0; information->inactive -= information->allocation_size; return; 47786: 7404 moveq #4,%d2 47788: 4280 clrl %d0 } index_base += information->allocation_size; 4778a: 2042 moveal %d2,%a0 4778c: d681 addl %d1,%d3 4778e: 5888 addql #4,%a0 index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / information->allocation_size; for ( block = 0; block < block_count; block++ ) { 47790: 5280 addql #1,%d0 47792: b084 cmpl %d4,%d0 47794: 6414 bccs 477aa <_Objects_Shrink_information+0x52> if ( information->inactive_per_block[ block ] == 47796: b2b1 2800 cmpl %a1@(00000000,%d2:l),%d1 4779a: 671a beqs 477b6 <_Objects_Shrink_information+0x5e> 4779c: 2408 movel %a0,%d2 information->inactive -= information->allocation_size; return; } index_base += information->allocation_size; 4779e: 2042 moveal %d2,%a0 477a0: d681 addl %d1,%d3 477a2: 5888 addql #4,%a0 index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / information->allocation_size; for ( block = 0; block < block_count; block++ ) { 477a4: 5280 addql #1,%d0 477a6: b084 cmpl %d4,%d0 477a8: 65ec bcss 47796 <_Objects_Shrink_information+0x3e> return; } index_base += information->allocation_size; } } 477aa: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 477b0: 4e5e unlk %fp 477b2: 4e75 rts index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / information->allocation_size; for ( block = 0; block < block_count; block++ ) { if ( information->inactive_per_block[ block ] == 477b4: 4282 clrl %d2 <== NOT EXECUTED information->allocation_size ) { /* * Assume the Inactive chain is never empty at this point */ the_object = (Objects_Control *) information->Inactive.first; 477b6: 206a 001c moveal %a2@(28),%a0 */ extract_me = the_object; the_object = (Objects_Control *) the_object->Node.next; if ((index >= index_base) && (index < (index_base + information->allocation_size))) { _Chain_Extract( &extract_me->Node ); 477ba: 47f9 0004 b998 lea 4b998 <_Chain_Extract>,%a3 * Assume the Inactive chain is never empty at this point */ the_object = (Objects_Control *) information->Inactive.first; do { index = _Objects_Get_index( the_object->id ); 477c0: 4280 clrl %d0 477c2: 3028 000a movew %a0@(10),%d0 /* * Get the next node before the node is extracted */ extract_me = the_object; the_object = (Objects_Control *) the_object->Node.next; 477c6: 2810 movel %a0@,%d4 if ((index >= index_base) && 477c8: b680 cmpl %d0,%d3 477ca: 620c bhis 477d8 <_Objects_Shrink_information+0x80> (index < (index_base + information->allocation_size))) { 477cc: 4281 clrl %d1 477ce: 322a 0012 movew %a2@(18),%d1 477d2: d283 addl %d3,%d1 477d4: b280 cmpl %d0,%d1 477d6: 623e bhis 47816 <_Objects_Shrink_information+0xbe> _Chain_Extract( &extract_me->Node ); } } while ( the_object ); 477d8: 2044 moveal %d4,%a0 477da: 4a84 tstl %d4 477dc: 66e2 bnes 477c0 <_Objects_Shrink_information+0x68> /* * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); 477de: 206a 002e moveal %a2@(46),%a0 477e2: 2f30 2800 movel %a0@(00000000,%d2:l),%sp@- 477e6: 4eb9 0004 9210 jsr 49210 <_Workspace_Free> information->object_blocks[ block ] = NULL; 477ec: 206a 002e moveal %a2@(46),%a0 information->inactive_per_block[ block ] = 0; information->inactive -= information->allocation_size; return; 477f0: 588f addql #4,%sp _Workspace_Free( information->object_blocks[ block ] ); information->object_blocks[ block ] = NULL; information->inactive_per_block[ block ] = 0; information->inactive -= information->allocation_size; 477f2: 302a 0028 movew %a2@(40),%d0 477f6: 322a 0012 movew %a2@(18),%d1 * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); information->object_blocks[ block ] = NULL; information->inactive_per_block[ block ] = 0; 477fa: 226a 002a moveal %a2@(42),%a1 information->inactive -= information->allocation_size; 477fe: 9081 subl %d1,%d0 * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); information->object_blocks[ block ] = NULL; information->inactive_per_block[ block ] = 0; 47800: 42b1 2800 clrl %a1@(00000000,%d2:l) /* * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); information->object_blocks[ block ] = NULL; 47804: 42b0 2800 clrl %a0@(00000000,%d2:l) information->inactive_per_block[ block ] = 0; information->inactive -= information->allocation_size; 47808: 3540 0028 movew %d0,%a2@(40) return; } index_base += information->allocation_size; } } 4780c: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 47812: 4e5e unlk %fp 47814: 4e75 rts */ extract_me = the_object; the_object = (Objects_Control *) the_object->Node.next; if ((index >= index_base) && (index < (index_base + information->allocation_size))) { _Chain_Extract( &extract_me->Node ); 47816: 2f08 movel %a0,%sp@- 47818: 4e93 jsr %a3@ 4781a: 588f addql #4,%sp } } while ( the_object ); 4781c: 2044 moveal %d4,%a0 4781e: 4a84 tstl %d4 47820: 669e bnes 477c0 <_Objects_Shrink_information+0x68> 47822: 60ba bras 477de <_Objects_Shrink_information+0x86> 00046bc8 <_POSIX_Condition_variables_Wait_support>: pthread_cond_t *cond, pthread_mutex_t *mutex, Watchdog_Interval timeout, bool already_timedout ) { 46bc8: 4e56 ffe8 linkw %fp,#-24 46bcc: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@ register POSIX_Condition_variables_Control *the_cond; Objects_Locations location; int status; int mutex_status; if ( !_POSIX_Mutex_Get( mutex, &location ) ) { 46bd0: 240e movel %fp,%d2 46bd2: 5982 subql #4,%d2 46bd4: 2f02 movel %d2,%sp@- pthread_cond_t *cond, pthread_mutex_t *mutex, Watchdog_Interval timeout, bool already_timedout ) { 46bd6: 246e 000c moveal %fp@(12),%a2 register POSIX_Condition_variables_Control *the_cond; Objects_Locations location; int status; int mutex_status; if ( !_POSIX_Mutex_Get( mutex, &location ) ) { 46bda: 2f0a movel %a2,%sp@- pthread_cond_t *cond, pthread_mutex_t *mutex, Watchdog_Interval timeout, bool already_timedout ) { 46bdc: 266e 0008 moveal %fp@(8),%a3 46be0: 162e 0017 moveb %fp@(23),%d3 register POSIX_Condition_variables_Control *the_cond; Objects_Locations location; int status; int mutex_status; if ( !_POSIX_Mutex_Get( mutex, &location ) ) { 46be4: 4eb9 0004 6dbe jsr 46dbe <_POSIX_Mutex_Get> 46bea: 508f addql #8,%sp 46bec: 4a80 tstl %d0 46bee: 6764 beqs 46c54 <_POSIX_Condition_variables_Wait_support+0x8c> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 46bf0: 2039 0006 19d8 movel 619d8 <_Thread_Dispatch_disable_level>,%d0 46bf6: 5380 subql #1,%d0 return EINVAL; } _Thread_Unnest_dispatch(); the_cond = _POSIX_Condition_variables_Get( cond, &location ); 46bf8: 2f02 movel %d2,%sp@- 46bfa: 23c0 0006 19d8 movel %d0,619d8 <_Thread_Dispatch_disable_level> 46c00: 2f0b movel %a3,%sp@- 46c02: 4eb9 0004 69b4 jsr 469b4 <_POSIX_Condition_variables_Get> switch ( location ) { 46c08: 508f addql #8,%sp return EINVAL; } _Thread_Unnest_dispatch(); the_cond = _POSIX_Condition_variables_Get( cond, &location ); 46c0a: 2840 moveal %d0,%a4 switch ( location ) { 46c0c: 4aae fffc tstl %fp@(-4) 46c10: 6642 bnes 46c54 <_POSIX_Condition_variables_Wait_support+0x8c> case OBJECTS_LOCAL: if ( the_cond->Mutex && ( the_cond->Mutex != *mutex ) ) { 46c12: 202c 0014 movel %a4@(20),%d0 46c16: 6718 beqs 46c30 <_POSIX_Condition_variables_Wait_support+0x68> 46c18: b092 cmpl %a2@,%d0 46c1a: 6714 beqs 46c30 <_POSIX_Condition_variables_Wait_support+0x68> _Thread_Enable_dispatch(); 46c1c: 4eb9 0004 a008 jsr 4a008 <_Thread_Enable_dispatch> 46c22: 7416 moveq #22,%d2 case OBJECTS_ERROR: break; } return EINVAL; } 46c24: 2002 movel %d2,%d0 46c26: 4cee 1c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a4 46c2c: 4e5e unlk %fp 46c2e: 4e75 rts if ( the_cond->Mutex && ( the_cond->Mutex != *mutex ) ) { _Thread_Enable_dispatch(); return EINVAL; } (void) pthread_mutex_unlock( mutex ); 46c30: 2f0a movel %a2,%sp@- 46c32: 4eb9 0004 700c jsr 4700c _Thread_Enable_dispatch(); return EINVAL; } */ if ( !already_timedout ) { 46c38: 588f addql #4,%sp 46c3a: 4a03 tstb %d3 46c3c: 6724 beqs 46c62 <_POSIX_Condition_variables_Wait_support+0x9a> status = _Thread_Executing->Wait.return_code; if ( status && status != ETIMEDOUT ) return status; } else { _Thread_Enable_dispatch(); 46c3e: 4eb9 0004 a008 jsr 4a008 <_Thread_Enable_dispatch> 46c44: 7474 moveq #116,%d2 /* * When we get here the dispatch disable level is 0. */ mutex_status = pthread_mutex_lock( mutex ); 46c46: 2f0a movel %a2,%sp@- 46c48: 4eb9 0004 6f70 jsr 46f70 if ( mutex_status ) 46c4e: 588f addql #4,%sp 46c50: 4a80 tstl %d0 46c52: 67d0 beqs 46c24 <_POSIX_Condition_variables_Wait_support+0x5c> 46c54: 7416 moveq #22,%d2 case OBJECTS_ERROR: break; } return EINVAL; } 46c56: 2002 movel %d2,%d0 46c58: 4cee 1c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a4 46c5e: 4e5e unlk %fp 46c60: 4e75 rts return EINVAL; } */ if ( !already_timedout ) { the_cond->Mutex = *mutex; 46c62: 2952 0014 movel %a2@,%a4@(20) _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); _Thread_Executing->Wait.return_code = 0; _Thread_Executing->Wait.queue = &the_cond->Wait_queue; 46c66: 200c movel %a4,%d0 46c68: 0680 0000 0018 addil #24,%d0 RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section ( Thread_queue_Control *the_thread_queue ) { the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 46c6e: 7201 moveq #1,%d1 if ( !already_timedout ) { the_cond->Mutex = *mutex; _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); _Thread_Executing->Wait.return_code = 0; 46c70: 2079 0006 1a92 moveal 61a92 <_Thread_Executing>,%a0 46c76: 42a8 0034 clrl %a0@(52) _Thread_Executing->Wait.queue = &the_cond->Wait_queue; _Thread_Executing->Wait.id = *cond; 46c7a: 2153 0020 movel %a3@,%a0@(32) if ( !already_timedout ) { the_cond->Mutex = *mutex; _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); _Thread_Executing->Wait.return_code = 0; _Thread_Executing->Wait.queue = &the_cond->Wait_queue; 46c7e: 2140 0044 movel %d0,%a0@(68) 46c82: 2941 0048 movel %d1,%a4@(72) _Thread_Executing->Wait.id = *cond; _Thread_queue_Enqueue( &the_cond->Wait_queue, timeout ); 46c86: 4879 0004 a920 pea 4a920 <_Thread_queue_Timeout> 46c8c: 2f2e 0010 movel %fp@(16),%sp@- 46c90: 2f00 movel %d0,%sp@- 46c92: 4eb9 0004 a564 jsr 4a564 <_Thread_queue_Enqueue_with_handler> _Thread_Enable_dispatch(); 46c98: 4eb9 0004 a008 jsr 4a008 <_Thread_Enable_dispatch> /* * Switch ourself out because we blocked as a result of the * _Thread_queue_Enqueue. */ status = _Thread_Executing->Wait.return_code; 46c9e: 2079 0006 1a92 moveal 61a92 <_Thread_Executing>,%a0 if ( status && status != ETIMEDOUT ) 46ca4: 4fef 000c lea %sp@(12),%sp /* * Switch ourself out because we blocked as a result of the * _Thread_queue_Enqueue. */ status = _Thread_Executing->Wait.return_code; 46ca8: 2428 0034 movel %a0@(52),%d2 if ( status && status != ETIMEDOUT ) 46cac: 6798 beqs 46c46 <_POSIX_Condition_variables_Wait_support+0x7e> 46cae: 7074 moveq #116,%d0 46cb0: b082 cmpl %d2,%d0 46cb2: 6792 beqs 46c46 <_POSIX_Condition_variables_Wait_support+0x7e> case OBJECTS_ERROR: break; } return EINVAL; } 46cb4: 2002 movel %d2,%d0 <== NOT EXECUTED 46cb6: 4cee 1c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a4 <== NOT EXECUTED 46cbc: 4e5e unlk %fp <== NOT EXECUTED 0004bac4 <_POSIX_Message_queue_Receive_support>: size_t msg_len, unsigned int *msg_prio, bool wait, Watchdog_Interval timeout ) { 4bac4: 4e56 ffe8 linkw %fp,#-24 4bac8: 48d7 041c moveml %d2-%d4/%a2,%sp@ RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control_fd *_POSIX_Message_queue_Get_fd ( mqd_t id, Objects_Locations *location ) { return (POSIX_Message_queue_Control_fd *) _Objects_Get( 4bacc: 486e fffc pea %fp@(-4) 4bad0: 242e 0008 movel %fp@(8),%d2 4bad4: 2f02 movel %d2,%sp@- 4bad6: 4879 0006 8f90 pea 68f90 <_POSIX_Message_queue_Information_fds> 4badc: 246e 0014 moveal %fp@(20),%a2 4bae0: 262e 0018 movel %fp@(24),%d3 4bae4: 4eb9 0004 eed8 jsr 4eed8 <_Objects_Get> Objects_Locations location; size_t length_out; bool do_wait; the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); switch ( location ) { 4baea: 4fef 000c lea %sp@(12),%sp 4baee: 2040 moveal %d0,%a0 4baf0: 4aae fffc tstl %fp@(-4) 4baf4: 671a beqs 4bb10 <_POSIX_Message_queue_Receive_support+0x4c> #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); 4baf6: 4eb9 0005 66ec jsr 566ec <__errno> 4bafc: 72ff moveq #-1,%d1 4bafe: 2040 moveal %d0,%a0 4bb00: 7009 moveq #9,%d0 } 4bb02: 4cee 041c ffe8 moveml %fp@(-24),%d2-%d4/%a2 #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); 4bb08: 2080 movel %d0,%a0@ } 4bb0a: 2001 movel %d1,%d0 4bb0c: 4e5e unlk %fp 4bb0e: 4e75 rts the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); switch ( location ) { case OBJECTS_LOCAL: if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) { 4bb10: 2028 0014 movel %a0@(20),%d0 4bb14: 7203 moveq #3,%d1 4bb16: 7801 moveq #1,%d4 4bb18: c280 andl %d0,%d1 4bb1a: b881 cmpl %d1,%d4 4bb1c: 6700 00f2 beqw 4bc10 <_POSIX_Message_queue_Receive_support+0x14c> _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EBADF ); } the_mq = the_mq_fd->Queue; 4bb20: 2068 0010 moveal %a0@(16),%a0 if ( msg_len < the_mq->Message_queue.maximum_message_size ) { 4bb24: 222e 0010 movel %fp@(16),%d1 4bb28: b2a8 0066 cmpl %a0@(102),%d1 4bb2c: 6500 0098 bcsw 4bbc6 <_POSIX_Message_queue_Receive_support+0x102> length_out = -1; /* * A timed receive with a bad time will do a poll regardless. */ if ( wait ) 4bb30: 4a03 tstb %d3 4bb32: 6756 beqs 4bb8a <_POSIX_Message_queue_Receive_support+0xc6> 4bb34: 720e moveq #14,%d1 4bb36: e2a8 lsrl %d1,%d0 4bb38: 7801 moveq #1,%d4 4bb3a: b980 eorl %d4,%d0 do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 4bb3c: 2f2e 001c movel %fp@(28),%sp@- length_out = -1; /* * A timed receive with a bad time will do a poll regardless. */ if ( wait ) 4bb40: c084 andl %d4,%d0 do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 4bb42: 2f00 movel %d0,%sp@- 4bb44: 486e fff8 pea %fp@(-8) /* * Now if something goes wrong, we return a "length" of -1 * to indicate an error. */ length_out = -1; 4bb48: 70ff moveq #-1,%d0 do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 4bb4a: 2f2e 000c movel %fp@(12),%sp@- 4bb4e: 2f02 movel %d2,%sp@- 4bb50: 4868 001a pea %a0@(26) /* * Now if something goes wrong, we return a "length" of -1 * to indicate an error. */ length_out = -1; 4bb54: 2d40 fff8 movel %d0,%fp@(-8) do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 4bb58: 4eb9 0004 de40 jsr 4de40 <_CORE_message_queue_Seize> &length_out, do_wait, timeout ); _Thread_Enable_dispatch(); 4bb5e: 4eb9 0004 f7b8 jsr 4f7b8 <_Thread_Enable_dispatch> *msg_prio = _POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count); 4bb64: 2079 0006 8c0e moveal 68c0e <_Thread_Executing>,%a0 do_wait, timeout ); _Thread_Enable_dispatch(); *msg_prio = 4bb6a: 24a8 0024 movel %a0@(36),%a2@ 4bb6e: 6d4e blts 4bbbe <_POSIX_Message_queue_Receive_support+0xfa> _POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count); if ( !_Thread_Executing->Wait.return_code ) 4bb70: 4fef 0018 lea %sp@(24),%sp 4bb74: 4aa8 0034 tstl %a0@(52) 4bb78: 666c bnes 4bbe6 <_POSIX_Message_queue_Receive_support+0x122> return length_out; 4bb7a: 222e fff8 movel %fp@(-8),%d1 case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); } 4bb7e: 2001 movel %d1,%d0 4bb80: 4cee 041c ffe8 moveml %fp@(-24),%d2-%d4/%a2 4bb86: 4e5e unlk %fp 4bb88: 4e75 rts do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 4bb8a: 2f2e 001c movel %fp@(28),%sp@- <== NOT EXECUTED length_out = -1; /* * A timed receive with a bad time will do a poll regardless. */ if ( wait ) 4bb8e: 4280 clrl %d0 <== NOT EXECUTED do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 4bb90: 2f00 movel %d0,%sp@- <== NOT EXECUTED 4bb92: 486e fff8 pea %fp@(-8) <== NOT EXECUTED /* * Now if something goes wrong, we return a "length" of -1 * to indicate an error. */ length_out = -1; 4bb96: 70ff moveq #-1,%d0 <== NOT EXECUTED do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 4bb98: 2f2e 000c movel %fp@(12),%sp@- <== NOT EXECUTED 4bb9c: 2f02 movel %d2,%sp@- <== NOT EXECUTED 4bb9e: 4868 001a pea %a0@(26) <== NOT EXECUTED /* * Now if something goes wrong, we return a "length" of -1 * to indicate an error. */ length_out = -1; 4bba2: 2d40 fff8 movel %d0,%fp@(-8) <== NOT EXECUTED do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 4bba6: 4eb9 0004 de40 jsr 4de40 <_CORE_message_queue_Seize> <== NOT EXECUTED &length_out, do_wait, timeout ); _Thread_Enable_dispatch(); 4bbac: 4eb9 0004 f7b8 jsr 4f7b8 <_Thread_Enable_dispatch> <== NOT EXECUTED *msg_prio = _POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count); 4bbb2: 2079 0006 8c0e moveal 68c0e <_Thread_Executing>,%a0 <== NOT EXECUTED do_wait, timeout ); _Thread_Enable_dispatch(); *msg_prio = 4bbb8: 24a8 0024 movel %a0@(36),%a2@ <== NOT EXECUTED 4bbbc: 6cb2 bges 4bb70 <_POSIX_Message_queue_Receive_support+0xac><== NOT EXECUTED 4bbbe: 2212 movel %a2@,%d1 4bbc0: 4481 negl %d1 4bbc2: 2481 movel %d1,%a2@ 4bbc4: 60aa bras 4bb70 <_POSIX_Message_queue_Receive_support+0xac> } the_mq = the_mq_fd->Queue; if ( msg_len < the_mq->Message_queue.maximum_message_size ) { _Thread_Enable_dispatch(); 4bbc6: 4eb9 0004 f7b8 jsr 4f7b8 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EMSGSIZE ); 4bbcc: 747a moveq #122,%d2 4bbce: 4eb9 0005 66ec jsr 566ec <__errno> 4bbd4: 72ff moveq #-1,%d1 4bbd6: 2040 moveal %d0,%a0 case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); } 4bbd8: 2001 movel %d1,%d0 the_mq = the_mq_fd->Queue; if ( msg_len < the_mq->Message_queue.maximum_message_size ) { _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EMSGSIZE ); 4bbda: 2082 movel %d2,%a0@ case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); } 4bbdc: 4cee 041c ffe8 moveml %fp@(-24),%d2-%d4/%a2 4bbe2: 4e5e unlk %fp 4bbe4: 4e75 rts _POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count); if ( !_Thread_Executing->Wait.return_code ) return length_out; rtems_set_errno_and_return_minus_one( 4bbe6: 4eb9 0005 66ec jsr 566ec <__errno> 4bbec: 2079 0006 8c0e moveal 68c0e <_Thread_Executing>,%a0 4bbf2: 2440 moveal %d0,%a2 4bbf4: 2f28 0034 movel %a0@(52),%sp@- 4bbf8: 4eb9 0004 bec4 jsr 4bec4 <_POSIX_Message_queue_Translate_core_message_queue_return_code> 4bbfe: 588f addql #4,%sp 4bc00: 72ff moveq #-1,%d1 4bc02: 2480 movel %d0,%a2@ case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); } 4bc04: 2001 movel %d1,%d0 4bc06: 4cee 041c ffe8 moveml %fp@(-24),%d2-%d4/%a2 4bc0c: 4e5e unlk %fp 4bc0e: 4e75 rts the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); switch ( location ) { case OBJECTS_LOCAL: if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) { _Thread_Enable_dispatch(); 4bc10: 4eb9 0004 f7b8 jsr 4f7b8 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EBADF ); 4bc16: 7609 moveq #9,%d3 4bc18: 4eb9 0005 66ec jsr 566ec <__errno> 4bc1e: 72ff moveq #-1,%d1 4bc20: 2040 moveal %d0,%a0 case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); } 4bc22: 2001 movel %d1,%d0 switch ( location ) { case OBJECTS_LOCAL: if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) { _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EBADF ); 4bc24: 2083 movel %d3,%a0@ case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); } 4bc26: 4cee 041c ffe8 moveml %fp@(-24),%d2-%d4/%a2 4bc2c: 4e5e unlk %fp <== NOT EXECUTED 0004b388 <_POSIX_Threads_Sporadic_budget_callout>: RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( int priority ) { return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1); 4b388: 4280 clrl %d0 /* * This will prevent the thread from consuming its entire "budget" * while at low priority. */ the_thread->cpu_time_budget = 0xFFFFFFFF; /* XXX should be based on MAX_U32 */ 4b38a: 72ff moveq #-1,%d1 * _POSIX_Threads_Sporadic_budget_callout */ void _POSIX_Threads_Sporadic_budget_callout( Thread_Control *the_thread ) { 4b38c: 4e56 0000 linkw %fp,#0 4b390: 206e 0008 moveal %fp@(8),%a0 4b394: 1039 0005 d7c2 moveb 5d7c2 ,%d0 POSIX_API_Control *api; uint32_t new_priority; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4b39a: 2268 010e moveal %a0@(270),%a1 4b39e: 90a9 0088 subl %a1@(136),%d0 /* * This will prevent the thread from consuming its entire "budget" * while at low priority. */ the_thread->cpu_time_budget = 0xFFFFFFFF; /* XXX should be based on MAX_U32 */ 4b3a2: 2141 0076 movel %d1,%a0@(118) new_priority = _POSIX_Priority_To_core(api->schedparam.sched_ss_low_priority); the_thread->real_priority = new_priority; 4b3a6: 2140 0018 movel %d0,%a0@(24) */ #if 0 printk( "callout %d %d %d\n", the_thread->resource_count, the_thread->current_priority, new_priority ); #endif if ( the_thread->resource_count == 0 ) { 4b3aa: 4aa8 001c tstl %a0@(28) 4b3ae: 6606 bnes 4b3b6 <_POSIX_Threads_Sporadic_budget_callout+0x2e> /* * Make sure we are actually lowering it. If they have lowered it * to logically lower than sched_ss_low_priority, then we do not want to * change it. */ if ( the_thread->current_priority < new_priority ) { 4b3b0: b0a8 0014 cmpl %a0@(20),%d0 4b3b4: 6204 bhis 4b3ba <_POSIX_Threads_Sporadic_budget_callout+0x32> #if 0 printk( "lower priority\n" ); #endif } } } 4b3b6: 4e5e unlk %fp <== NOT EXECUTED 4b3b8: 4e75 rts <== NOT EXECUTED * Make sure we are actually lowering it. If they have lowered it * to logically lower than sched_ss_low_priority, then we do not want to * change it. */ if ( the_thread->current_priority < new_priority ) { _Thread_Change_priority( the_thread, new_priority, true ); 4b3ba: 4878 0001 pea 1 4b3be: 2f00 movel %d0,%sp@- 4b3c0: 2f08 movel %a0,%sp@- 4b3c2: 4eb9 0004 789c jsr 4789c <_Thread_Change_priority> 4b3c8: 4fef 000c lea %sp@(12),%sp #if 0 printk( "lower priority\n" ); #endif } } } 4b3cc: 4e5e unlk %fp <== NOT EXECUTED 00045cc0 <_POSIX_Timer_TSR>: * This is the operation that is run when a timer expires */ void _POSIX_Timer_TSR( Objects_Id timer __attribute__((unused)), void *data) { 45cc0: 4e56 0000 linkw %fp,#0 45cc4: 2f0a movel %a2,%sp@- 45cc6: 246e 000c moveal %fp@(12),%a2 bool activated; ptimer = (POSIX_Timer_Control *)data; /* Increment the number of expirations. */ ptimer->overrun = ptimer->overrun + 1; 45cca: 52aa 0066 addql #1,%a2@(102) /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || 45cce: 4aaa 0052 tstl %a2@(82) 45cd2: 6606 bnes 45cda <_POSIX_Timer_TSR+0x1a> ( ptimer->timer_data.it_interval.tv_nsec != 0 ) ) { 45cd4: 4aaa 0056 tstl %a2@(86) 45cd8: 672a beqs 45d04 <_POSIX_Timer_TSR+0x44> activated = _POSIX_Timer_Insert_helper( 45cda: 2f0a movel %a2,%sp@- 45cdc: 4879 0004 5cc0 pea 45cc0 <_POSIX_Timer_TSR> 45ce2: 2f2a 0008 movel %a2@(8),%sp@- 45ce6: 2f2a 0062 movel %a2@(98),%sp@- 45cea: 486a 0010 pea %a2@(16) 45cee: 4eb9 0004 bf48 jsr 4bf48 <_POSIX_Timer_Insert_helper> ptimer->ticks, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) 45cf4: 4fef 0014 lea %sp@(20),%sp 45cf8: 4a00 tstb %d0 45cfa: 662a bnes 45d26 <_POSIX_Timer_TSR+0x66> /* After the signal handler returns, the count of expirations of the * timer must be set to 0. */ ptimer->overrun = 0; } 45cfc: 246e fffc moveal %fp@(-4),%a2 <== NOT EXECUTED 45d00: 4e5e unlk %fp <== NOT EXECUTED 45d02: 4e75 rts <== NOT EXECUTED /* The state really did not change but just to be safe */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; } else { /* Indicates that the timer is stopped */ ptimer->state = POSIX_TIMER_STATE_CREATE_STOP; 45d04: 7004 moveq #4,%d0 <== NOT EXECUTED 45d06: 1540 003c moveb %d0,%a2@(60) <== NOT EXECUTED /* * The sending of the signal to the process running the handling function * specified for that signal is simulated */ if ( pthread_kill ( ptimer->thread_id, ptimer->inf.sigev_signo ) ) { 45d0a: 2f2a 0042 movel %a2@(66),%sp@- <== NOT EXECUTED 45d0e: 2f2a 0038 movel %a2@(56),%sp@- <== NOT EXECUTED 45d12: 4eb9 0004 ba5c jsr 4ba5c <== NOT EXECUTED } /* After the signal handler returns, the count of expirations of the * timer must be set to 0. */ ptimer->overrun = 0; 45d18: 508f addql #8,%sp <== NOT EXECUTED 45d1a: 42aa 0066 clrl %a2@(102) <== NOT EXECUTED } 45d1e: 246e fffc moveal %fp@(-4),%a2 45d22: 4e5e unlk %fp 45d24: 4e75 rts ); if ( !activated ) return; /* Store the time when the timer was started again */ _TOD_Get( &ptimer->time ); 45d26: 486a 006a pea %a2@(106) 45d2a: 4eb9 0004 7470 jsr 47470 <_TOD_Get> /* Increment the number of expirations. */ ptimer->overrun = ptimer->overrun + 1; /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || 45d30: 588f addql #4,%sp /* Store the time when the timer was started again */ _TOD_Get( &ptimer->time ); /* The state really did not change but just to be safe */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; 45d32: 7003 moveq #3,%d0 45d34: 1540 003c moveb %d0,%a2@(60) /* * The sending of the signal to the process running the handling function * specified for that signal is simulated */ if ( pthread_kill ( ptimer->thread_id, ptimer->inf.sigev_signo ) ) { 45d38: 2f2a 0042 movel %a2@(66),%sp@- 45d3c: 2f2a 0038 movel %a2@(56),%sp@- 45d40: 4eb9 0004 ba5c jsr 4ba5c } /* After the signal handler returns, the count of expirations of the * timer must be set to 0. */ ptimer->overrun = 0; 45d46: 508f addql #8,%sp 45d48: 42aa 0066 clrl %a2@(102) 45d4c: 60d0 bras 45d1e <_POSIX_Timer_TSR+0x5e> ... 0004e8dc <_POSIX_signals_Clear_process_signals>: clear_signal = true; mask = signo_to_mask( signo ); ISR_Level level; _ISR_Disable( level ); 4e8dc: 203c 0000 0700 movel #1792,%d0 */ void _POSIX_signals_Clear_process_signals( int signo ) { 4e8e2: 4e56 0000 linkw %fp,#0 4e8e6: 222e 0008 movel %fp@(8),%d1 4e8ea: 2f03 movel %d3,%sp@- 4e8ec: 2f02 movel %d2,%sp@- clear_signal = true; mask = signo_to_mask( signo ); ISR_Level level; _ISR_Disable( level ); 4e8ee: 40c2 movew %sr,%d2 4e8f0: 8082 orl %d2,%d0 4e8f2: 46c0 movew %d0,%sr if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { 4e8f4: 2601 movel %d1,%d3 4e8f6: 2001 movel %d1,%d0 4e8f8: 41f9 0005 f426 lea 5f426 <_POSIX_signals_Vectors>,%a0 4e8fe: e58b lsll #2,%d3 4e900: e988 lsll #4,%d0 4e902: 9083 subl %d3,%d0 4e904: 7602 moveq #2,%d3 4e906: b6b0 0800 cmpl %a0@(00000000,%d0:l),%d3 4e90a: 6726 beqs 4e932 <_POSIX_signals_Clear_process_signals+0x56> if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) clear_signal = false; } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; 4e90c: 5381 subql #1,%d1 4e90e: 7001 moveq #1,%d0 4e910: e3a8 lsll %d1,%d0 4e912: 4680 notl %d0 4e914: c0b9 0005 f61a andl 5f61a <_POSIX_signals_Pending>,%d0 4e91a: 23c0 0005 f61a movel %d0,5f61a <_POSIX_signals_Pending> if ( !_POSIX_signals_Pending ) 4e920: 6606 bnes 4e928 <_POSIX_signals_Clear_process_signals+0x4c> _Thread_Do_post_task_switch_extension--; 4e922: 53b9 0005 f01a subql #1,5f01a <_Thread_Do_post_task_switch_extension> } _ISR_Enable( level ); 4e928: 46c2 movew %d2,%sr } 4e92a: 241f movel %sp@+,%d2 4e92c: 261f movel %sp@+,%d3 4e92e: 4e5e unlk %fp 4e930: 4e75 rts ISR_Level level; _ISR_Disable( level ); if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) 4e932: 0680 0005 f61e addil #390686,%d0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4e938: 2040 moveal %d0,%a0 4e93a: 5888 addql #4,%a0 4e93c: 2240 moveal %d0,%a1 4e93e: b1d1 cmpal %a1@,%a0 4e940: 67ca beqs 4e90c <_POSIX_signals_Clear_process_signals+0x30> if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; if ( !_POSIX_signals_Pending ) _Thread_Do_post_task_switch_extension--; } _ISR_Enable( level ); 4e942: 46c2 movew %d2,%sr <== NOT EXECUTED } 4e944: 241f movel %sp@+,%d2 <== NOT EXECUTED 4e946: 261f movel %sp@+,%d3 <== NOT EXECUTED 4e948: 4e5e unlk %fp <== NOT EXECUTED 0004d770 <_POSIX_signals_Clear_signals>: static inline sigset_t signo_to_mask( uint32_t sig ) { return 1u << (sig - 1); 4d770: 7001 moveq #1,%d0 int signo, siginfo_t *info, bool is_global, bool check_blocked ) { 4d772: 4e56 ffe8 linkw %fp,#-24 4d776: 206e 0008 moveal %fp@(8),%a0 4d77a: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@ 4d77e: 242e 000c movel %fp@(12),%d2 4d782: 2202 movel %d2,%d1 4d784: 5381 subql #1,%d1 4d786: 1a2e 0017 moveb %fp@(23),%d5 4d78a: e3a8 lsll %d1,%d0 /* set blocked signals based on if checking for them, SIGNAL_ALL_MASK * insures that no signals are blocked and all are checked. */ if ( check_blocked ) 4d78c: 4a2e 001b tstb %fp@(27) 4d790: 664e bnes 4d7e0 <_POSIX_signals_Clear_signals+0x70> 4d792: 78ff moveq #-1,%d4 signals_blocked = SIGNAL_ALL_MASK; /* XXX is this right for siginfo type signals? */ /* XXX are we sure they can be cleared the same way? */ _ISR_Disable( level ); 4d794: 223c 0000 0700 movel #1792,%d1 4d79a: 40c3 movew %sr,%d3 4d79c: 8283 orl %d3,%d1 4d79e: 46c1 movew %d1,%sr if ( is_global ) { 4d7a0: 4a05 tstb %d5 4d7a2: 6752 beqs 4d7f6 <_POSIX_signals_Clear_signals+0x86> if ( mask & (_POSIX_signals_Pending & signals_blocked) ) { 4d7a4: c0b9 0005 f61a andl 5f61a <_POSIX_signals_Pending>,%d0 4d7aa: c084 andl %d4,%d0 4d7ac: 676a beqs 4d818 <_POSIX_signals_Clear_signals+0xa8> if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { 4d7ae: 2202 movel %d2,%d1 4d7b0: 2002 movel %d2,%d0 4d7b2: 47f9 0004 e8dc lea 4e8dc <_POSIX_signals_Clear_process_signals>,%a3 4d7b8: 41f9 0005 f426 lea 5f426 <_POSIX_signals_Vectors>,%a0 4d7be: e589 lsll #2,%d1 4d7c0: e988 lsll #4,%d0 4d7c2: 9081 subl %d1,%d0 4d7c4: 7202 moveq #2,%d1 4d7c6: b2b0 0800 cmpl %a0@(00000000,%d0:l),%d1 4d7ca: 675a beqs 4d826 <_POSIX_signals_Clear_signals+0xb6> &psiginfo->Node ); } else do_callout = false; } _POSIX_signals_Clear_process_signals( signo ); 4d7cc: 2f02 movel %d2,%sp@- 4d7ce: 4e93 jsr %a3@ 4d7d0: 588f addql #4,%sp 4d7d2: 7001 moveq #1,%d0 if ( mask & (api->signals_pending & signals_blocked) ) { api->signals_pending &= ~mask; do_callout = true; } } _ISR_Enable( level ); 4d7d4: 46c3 movew %d3,%sr return do_callout; } 4d7d6: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 4d7dc: 4e5e unlk %fp 4d7de: 4e75 rts /* set blocked signals based on if checking for them, SIGNAL_ALL_MASK * insures that no signals are blocked and all are checked. */ if ( check_blocked ) signals_blocked = ~api->signals_blocked; 4d7e0: 2828 00cc movel %a0@(204),%d4 signals_blocked = SIGNAL_ALL_MASK; /* XXX is this right for siginfo type signals? */ /* XXX are we sure they can be cleared the same way? */ _ISR_Disable( level ); 4d7e4: 223c 0000 0700 movel #1792,%d1 /* set blocked signals based on if checking for them, SIGNAL_ALL_MASK * insures that no signals are blocked and all are checked. */ if ( check_blocked ) signals_blocked = ~api->signals_blocked; 4d7ea: 4684 notl %d4 signals_blocked = SIGNAL_ALL_MASK; /* XXX is this right for siginfo type signals? */ /* XXX are we sure they can be cleared the same way? */ _ISR_Disable( level ); 4d7ec: 40c3 movew %sr,%d3 4d7ee: 8283 orl %d3,%d1 4d7f0: 46c1 movew %d1,%sr if ( is_global ) { 4d7f2: 4a05 tstb %d5 4d7f4: 66ae bnes 4d7a4 <_POSIX_signals_Clear_signals+0x34> } _POSIX_signals_Clear_process_signals( signo ); do_callout = true; } } else { if ( mask & (api->signals_pending & signals_blocked) ) { 4d7f6: 2428 00d0 movel %a0@(208),%d2 4d7fa: 2200 movel %d0,%d1 4d7fc: c282 andl %d2,%d1 4d7fe: c284 andl %d4,%d1 4d800: 6716 beqs 4d818 <_POSIX_signals_Clear_signals+0xa8> api->signals_pending &= ~mask; 4d802: 4680 notl %d0 4d804: c082 andl %d2,%d0 4d806: 2140 00d0 movel %d0,%a0@(208) 4d80a: 7001 moveq #1,%d0 do_callout = true; } } _ISR_Enable( level ); 4d80c: 46c3 movew %d3,%sr return do_callout; } 4d80e: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 4d814: 4e5e unlk %fp 4d816: 4e75 rts _POSIX_signals_Clear_process_signals( signo ); do_callout = true; } } else { if ( mask & (api->signals_pending & signals_blocked) ) { api->signals_pending &= ~mask; 4d818: 4200 clrb %d0 do_callout = true; } } _ISR_Enable( level ); 4d81a: 46c3 movew %d3,%sr return do_callout; } 4d81c: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 4d822: 4e5e unlk %fp 4d824: 4e75 rts _ISR_Disable( level ); if ( is_global ) { if ( mask & (_POSIX_signals_Pending & signals_blocked) ) { if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { psiginfo = (POSIX_signals_Siginfo_node *) 4d826: 0680 0005 f61e addil #390686,%d0 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 4d82c: 2040 moveal %d0,%a0 4d82e: 2458 moveal %a0@+,%a2 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4d830: b1ca cmpal %a2,%a0 4d832: 6744 beqs 4d878 <_POSIX_signals_Clear_signals+0x108> { Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; 4d834: 2052 moveal %a2@,%a0 the_chain->first = new_first; 4d836: 2240 moveal %d0,%a1 4d838: 2288 movel %a0,%a1@ new_first->previous = _Chain_Head(the_chain); 4d83a: 2140 0004 movel %d0,%a0@(4) _Chain_Get_unprotected( &_POSIX_signals_Siginfo[ signo ] ); _POSIX_signals_Clear_process_signals( signo ); 4d83e: 2f02 movel %d2,%sp@- 4d840: 4e93 jsr %a3@ * It may be impossible to get here with an empty chain * BUT until that is proven we need to be defensive and * protect against it. */ if ( psiginfo ) { *info = psiginfo->Info; 4d842: 206e 0010 moveal %fp@(16),%a0 the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; the_chain->last = the_node; old_last_node->next = the_node; the_node->previous = old_last_node; 4d846: 588f addql #4,%sp 4d848: 20ea 0008 movel %a2@(8),%a0@+ 4d84c: 20ea 000c movel %a2@(12),%a0@+ 4d850: 20aa 0010 movel %a2@(16),%a0@ Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 4d854: 24bc 0005 f5aa movel #390570,%a2@ old_last_node = the_chain->last; 4d85a: 2279 0005 f5ae moveal 5f5ae <_POSIX_signals_Inactive_siginfo+0x8>,%a1 the_chain->last = the_node; 4d860: 23ca 0005 f5ae movel %a2,5f5ae <_POSIX_signals_Inactive_siginfo+0x8> old_last_node->next = the_node; the_node->previous = old_last_node; 4d866: 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; 4d86a: 228a movel %a2,%a1@ &psiginfo->Node ); } else do_callout = false; } _POSIX_signals_Clear_process_signals( signo ); 4d86c: 2f02 movel %d2,%sp@- 4d86e: 4e93 jsr %a3@ 4d870: 588f addql #4,%sp 4d872: 7001 moveq #1,%d0 4d874: 6000 ff5e braw 4d7d4 <_POSIX_signals_Clear_signals+0x64> if ( is_global ) { if ( mask & (_POSIX_signals_Pending & signals_blocked) ) { if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { psiginfo = (POSIX_signals_Siginfo_node *) _Chain_Get_unprotected( &_POSIX_signals_Siginfo[ signo ] ); _POSIX_signals_Clear_process_signals( signo ); 4d878: 2f02 movel %d2,%sp@- 4d87a: 4e93 jsr %a3@ 4d87c: 588f addql #4,%sp &psiginfo->Node ); } else do_callout = false; } _POSIX_signals_Clear_process_signals( signo ); 4d87e: 2f02 movel %d2,%sp@- 4d880: 4e93 jsr %a3@ 4d882: 588f addql #4,%sp 4d884: 7001 moveq #1,%d0 4d886: 6000 ff4c braw 4d7d4 <_POSIX_signals_Clear_signals+0x64> ... 00045b88 <_POSIX_signals_Ualarm_TSR>: void _POSIX_signals_Ualarm_TSR( Objects_Id id __attribute__((unused)), void *argument __attribute__((unused)) ) { 45b88: 4e56 0000 linkw %fp,#0 /* * Send a SIGALRM but if there is a problem, ignore it. * It's OK, there isn't a way this should fail. */ (void) kill( getpid(), SIGALRM ); 45b8c: 4eb9 0004 2a2c jsr 42a2c 45b92: 4878 000e pea e 45b96: 2f00 movel %d0,%sp@- 45b98: 4eb9 0004 5884 jsr 45884 RTEMS_INLINE_ROUTINE void _Watchdog_Reset( Watchdog_Control *the_watchdog ) { (void) _Watchdog_Remove( the_watchdog ); 45b9e: 4879 0006 114e pea 6114e <_POSIX_signals_Ualarm_timer> 45ba4: 4eb9 0004 96fc jsr 496fc <_Watchdog_Remove> _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 45baa: 4fef 000c lea %sp@(12),%sp 45bae: 203c 0006 114e movel #397646,%d0 45bb4: 2d40 000c movel %d0,%fp@(12) 45bb8: 203c 0006 0a00 movel #395776,%d0 45bbe: 2d40 0008 movel %d0,%fp@(8) /* * If the reset interval is non-zero, reschedule ourselves. */ _Watchdog_Reset( &_POSIX_signals_Ualarm_timer ); } 45bc2: 4e5e unlk %fp 45bc4: 4ef9 0004 95b4 jmp 495b4 <_Watchdog_Insert> ... 0004e97c <_POSIX_signals_Unblock_thread>: 4e97c: 7001 moveq #1,%d0 bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, siginfo_t *info ) { 4e97e: 4e56 fff4 linkw %fp,#-12 4e982: 222e 000c movel %fp@(12),%d1 4e986: 48d7 040c moveml %d2-%d3/%a2,%sp@ 4e98a: 246e 0008 moveal %fp@(8),%a2 4e98e: 2601 movel %d1,%d3 4e990: 5383 subql #1,%d3 /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 4e992: 242a 0010 movel %a2@(16),%d2 4e996: 0282 1000 8000 andil #268468224,%d2 bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, siginfo_t *info ) { 4e99c: 226e 0010 moveal %fp@(16),%a1 POSIX_API_Control *api; sigset_t mask; siginfo_t *the_info = NULL; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4e9a0: 206a 010e moveal %a2@(270),%a0 4e9a4: e7a8 lsll %d3,%d0 /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 4e9a6: 0c82 1000 8000 cmpil #268468224,%d2 4e9ac: 6772 beqs 4ea20 <_POSIX_signals_Unblock_thread+0xa4> } /* * Thread is not waiting due to a sigwait. */ if ( ~api->signals_blocked & mask ) { 4e9ae: 2228 00cc movel %a0@(204),%d1 4e9b2: 4681 notl %d1 4e9b4: c081 andl %d1,%d0 4e9b6: 675c beqs 4ea14 <_POSIX_signals_Unblock_thread+0x98> * + Any other combination, do nothing. */ the_thread->do_post_task_switch_extension = true; if ( the_thread->current_state & STATES_INTERRUPTIBLE_BY_SIGNAL ) { 4e9b8: 202a 0010 movel %a2@(16),%d0 * it is not blocked, THEN * we need to dispatch at the end of this ISR. * + Any other combination, do nothing. */ the_thread->do_post_task_switch_extension = true; 4e9bc: 7201 moveq #1,%d1 4e9be: 1541 0074 moveb %d1,%a2@(116) if ( the_thread->current_state & STATES_INTERRUPTIBLE_BY_SIGNAL ) { 4e9c2: 0800 001c btst #28,%d0 4e9c6: 6736 beqs 4e9fe <_POSIX_signals_Unblock_thread+0x82> the_thread->Wait.return_code = EINTR; 4e9c8: 7004 moveq #4,%d0 4e9ca: 2540 0034 movel %d0,%a2@(52) #if 0 if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) ) _Thread_queue_Extract_with_proxy( the_thread ); else #endif if ( _States_Is_delaying(the_thread->current_state) ){ 4e9ce: 103c 0008 moveb #8,%d0 4e9d2: c0aa 0010 andl %a2@(16),%d0 4e9d6: 673c beqs 4ea14 <_POSIX_signals_Unblock_thread+0x98> if ( _Watchdog_Is_active( &the_thread->Timer ) ) 4e9d8: 7202 moveq #2,%d1 4e9da: b2aa 0050 cmpl %a2@(80),%d1 4e9de: 6700 00a4 beqw 4ea84 <_POSIX_signals_Unblock_thread+0x108> RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 4e9e2: 2f3c 1003 fff8 movel #268697592,%sp@- <== NOT EXECUTED 4e9e8: 2f0a movel %a2,%sp@- <== NOT EXECUTED 4e9ea: 4eb9 0004 79e8 jsr 479e8 <_Thread_Clear_state> <== NOT EXECUTED 4e9f0: 508f addql #8,%sp <== NOT EXECUTED 4e9f2: 4200 clrb %d0 <== NOT EXECUTED if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _ISR_Signals_to_thread_executing = true; } } return false; } 4e9f4: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 4e9fa: 4e5e unlk %fp 4e9fc: 4e75 rts if ( _States_Is_delaying(the_thread->current_state) ){ if ( _Watchdog_Is_active( &the_thread->Timer ) ) (void) _Watchdog_Remove( &the_thread->Timer ); _Thread_Unblock( the_thread ); } } else if ( the_thread->current_state == STATES_READY ) { 4e9fe: 4a80 tstl %d0 4ea00: 6612 bnes 4ea14 <_POSIX_signals_Unblock_thread+0x98> if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 4ea02: 2039 0005 f012 movel 5f012 <_ISR_Nest_level>,%d0 4ea08: 670a beqs 4ea14 <_POSIX_signals_Unblock_thread+0x98> 4ea0a: b5f9 0005 f032 cmpal 5f032 <_Thread_Executing>,%a2 4ea10: 6700 0094 beqw 4eaa6 <_POSIX_signals_Unblock_thread+0x12a> _ISR_Signals_to_thread_executing = true; } } return false; } 4ea14: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 (void) _Watchdog_Remove( &the_thread->Timer ); _Thread_Unblock( the_thread ); } } else if ( the_thread->current_state == STATES_READY ) { if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _ISR_Signals_to_thread_executing = true; 4ea1a: 4200 clrb %d0 } } return false; } 4ea1c: 4e5e unlk %fp 4ea1e: 4e75 rts * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { 4ea20: 2400 movel %d0,%d2 4ea22: c4aa 0030 andl %a2@(48),%d2 4ea26: 672a beqs 4ea52 <_POSIX_signals_Unblock_thread+0xd6> the_thread->Wait.return_code = EINTR; 4ea28: 7004 moveq #4,%d0 the_info = (siginfo_t *) the_thread->Wait.return_argument; 4ea2a: 206a 0028 moveal %a2@(40),%a0 */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { the_thread->Wait.return_code = EINTR; 4ea2e: 2540 0034 movel %d0,%a2@(52) the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { 4ea32: 4a89 tstl %a1 4ea34: 6734 beqs 4ea6a <_POSIX_signals_Unblock_thread+0xee> the_info->si_signo = signo; the_info->si_code = SI_USER; the_info->si_value.sival_int = 0; } else { *the_info = *info; 4ea36: 20d9 movel %a1@+,%a0@+ 4ea38: 20d9 movel %a1@+,%a0@+ 4ea3a: 2091 movel %a1@,%a0@ } _Thread_queue_Extract_with_proxy( the_thread ); 4ea3c: 2f0a movel %a2,%sp@- 4ea3e: 4eb9 0004 852c jsr 4852c <_Thread_queue_Extract_with_proxy> return true; 4ea44: 588f addql #4,%sp the_info->si_value.sival_int = 0; } else { *the_info = *info; } _Thread_queue_Extract_with_proxy( the_thread ); 4ea46: 7001 moveq #1,%d0 if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _ISR_Signals_to_thread_executing = true; } } return false; } 4ea48: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 4ea4e: 4e5e unlk %fp 4ea50: 4e75 rts * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { 4ea52: 2428 00cc movel %a0@(204),%d2 4ea56: 4682 notl %d2 4ea58: c082 andl %d2,%d0 4ea5a: 67b8 beqs 4ea14 <_POSIX_signals_Unblock_thread+0x98> the_thread->Wait.return_code = EINTR; 4ea5c: 7004 moveq #4,%d0 the_info = (siginfo_t *) the_thread->Wait.return_argument; 4ea5e: 206a 0028 moveal %a2@(40),%a0 */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { the_thread->Wait.return_code = EINTR; 4ea62: 2540 0034 movel %d0,%a2@(52) the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { 4ea66: 4a89 tstl %a1 4ea68: 66cc bnes 4ea36 <_POSIX_signals_Unblock_thread+0xba> the_info->si_signo = signo; 4ea6a: 2081 movel %d1,%a0@ the_info->si_code = SI_USER; 4ea6c: 7201 moveq #1,%d1 the_info->si_value.sival_int = 0; 4ea6e: 42a8 0008 clrl %a0@(8) the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { the_info->si_signo = signo; the_info->si_code = SI_USER; 4ea72: 2141 0004 movel %d1,%a0@(4) the_info->si_value.sival_int = 0; } else { *the_info = *info; } _Thread_queue_Extract_with_proxy( the_thread ); 4ea76: 2f0a movel %a2,%sp@- 4ea78: 4eb9 0004 852c jsr 4852c <_Thread_queue_Extract_with_proxy> return true; 4ea7e: 588f addql #4,%sp the_info->si_value.sival_int = 0; } else { *the_info = *info; } _Thread_queue_Extract_with_proxy( the_thread ); 4ea80: 7001 moveq #1,%d0 4ea82: 60c4 bras 4ea48 <_POSIX_signals_Unblock_thread+0xcc> _Thread_queue_Extract_with_proxy( the_thread ); else #endif if ( _States_Is_delaying(the_thread->current_state) ){ if ( _Watchdog_Is_active( &the_thread->Timer ) ) (void) _Watchdog_Remove( &the_thread->Timer ); 4ea84: 486a 0048 pea %a2@(72) 4ea88: 4eb9 0004 90a4 jsr 490a4 <_Watchdog_Remove> 4ea8e: 588f addql #4,%sp 4ea90: 2f3c 1003 fff8 movel #268697592,%sp@- 4ea96: 2f0a movel %a2,%sp@- 4ea98: 4eb9 0004 79e8 jsr 479e8 <_Thread_Clear_state> 4ea9e: 508f addql #8,%sp 4eaa0: 4200 clrb %d0 4eaa2: 6000 ff50 braw 4e9f4 <_POSIX_signals_Unblock_thread+0x78> _Thread_Unblock( the_thread ); } } else if ( the_thread->current_state == STATES_READY ) { if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _ISR_Signals_to_thread_executing = true; 4eaa6: 7001 moveq #1,%d0 } } return false; } 4eaa8: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 4eaae: 4e5e unlk %fp (void) _Watchdog_Remove( &the_thread->Timer ); _Thread_Unblock( the_thread ); } } else if ( the_thread->current_state == STATES_READY ) { if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _ISR_Signals_to_thread_executing = true; 4eab0: 13c0 0005 f0c0 moveb %d0,5f0c0 <_ISR_Signals_to_thread_executing> 4eab6: 4200 clrb %d0 } } return false; } ... 00046150 <_RTEMS_tasks_Initialize_user_tasks_body>: * * Output parameters: NONE */ void _RTEMS_tasks_Initialize_user_tasks_body( void ) { 46150: 4e56 ffe4 linkw %fp,#-28 46154: 48d7 1c1c moveml %d2-%d4/%a2-%a4,%sp@ rtems_initialization_tasks_table *user_tasks; /* * Move information into local variables */ user_tasks = Configuration_RTEMS_API.User_initialization_tasks_table; 46158: 2479 0005 d7ba moveal 5d7ba ,%a2 maximum = Configuration_RTEMS_API.number_of_initialization_tasks; 4615e: 2639 0005 d7b6 movel 5d7b6 ,%d3 /* * Verify that we have a set of user tasks to iterate */ if ( !user_tasks ) 46164: 4a8a tstl %a2 46166: 6754 beqs 461bc <_RTEMS_tasks_Initialize_user_tasks_body+0x6c> return; /* * Now iterate over the initialization tasks and create/start them. */ for ( index=0 ; index < maximum ; index++ ) { 46168: 4a83 tstl %d3 4616a: 6750 beqs 461bc <_RTEMS_tasks_Initialize_user_tasks_body+0x6c> 4616c: 280e movel %fp,%d4 4616e: 4282 clrl %d2 46170: 5984 subql #4,%d4 46172: 47f9 0004 5f24 lea 45f24 ,%a3 &id ); if ( !rtems_is_status_successful( return_value ) ) _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); return_value = rtems_task_start( 46178: 49f9 0004 61d8 lea 461d8 ,%a4 /* * Now iterate over the initialization tasks and create/start them. */ for ( index=0 ; index < maximum ; index++ ) { return_value = rtems_task_create( 4617e: 2f04 movel %d4,%sp@- 46180: 2f2a 000c movel %a2@(12),%sp@- 46184: 2f2a 0014 movel %a2@(20),%sp@- 46188: 2f2a 0004 movel %a2@(4),%sp@- 4618c: 2f2a 0008 movel %a2@(8),%sp@- 46190: 2f12 movel %a2@,%sp@- 46192: 4e93 jsr %a3@ user_tasks[ index ].stack_size, user_tasks[ index ].mode_set, user_tasks[ index ].attribute_set, &id ); if ( !rtems_is_status_successful( return_value ) ) 46194: 4fef 0018 lea %sp@(24),%sp 46198: 4a80 tstl %d0 4619a: 662a bnes 461c6 <_RTEMS_tasks_Initialize_user_tasks_body+0x76> _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); return_value = rtems_task_start( 4619c: 2f2a 0018 movel %a2@(24),%sp@- 461a0: 2f2a 0010 movel %a2@(16),%sp@- 461a4: 2f2e fffc movel %fp@(-4),%sp@- 461a8: 4e94 jsr %a4@ id, user_tasks[ index ].entry_point, user_tasks[ index ].argument ); if ( !rtems_is_status_successful( return_value ) ) 461aa: 4fef 000c lea %sp@(12),%sp 461ae: 4a80 tstl %d0 461b0: 6614 bnes 461c6 <_RTEMS_tasks_Initialize_user_tasks_body+0x76> return; /* * Now iterate over the initialization tasks and create/start them. */ for ( index=0 ; index < maximum ; index++ ) { 461b2: 5282 addql #1,%d2 461b4: 45ea 001c lea %a2@(28),%a2 461b8: b483 cmpl %d3,%d2 461ba: 65c2 bcss 4617e <_RTEMS_tasks_Initialize_user_tasks_body+0x2e> user_tasks[ index ].argument ); if ( !rtems_is_status_successful( return_value ) ) _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); } } 461bc: 4cee 1c1c ffe4 moveml %fp@(-28),%d2-%d4/%a2-%a4 461c2: 4e5e unlk %fp 461c4: 4e75 rts id, user_tasks[ index ].entry_point, user_tasks[ index ].argument ); if ( !rtems_is_status_successful( return_value ) ) _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); 461c6: 2f00 movel %d0,%sp@- 461c8: 4878 0001 pea 1 461cc: 4878 0001 pea 1 461d0: 4eb9 0004 6fcc jsr 46fcc <_Internal_error_Occurred> ... 000485c8 <_TOD_Set>: */ void _TOD_Set( const struct timespec *time ) { 485c8: 4e56 0000 linkw %fp,#0 485cc: 2039 0006 9598 movel 69598 <_Thread_Dispatch_disable_level>,%d0 485d2: 5280 addql #1,%d0 485d4: 2f0a movel %a2,%sp@- 485d6: 246e 0008 moveal %fp@(8),%a2 485da: 23c0 0006 9598 movel %d0,69598 <_Thread_Dispatch_disable_level> long seconds; _Thread_Disable_dispatch(); _TOD_Deactivate(); seconds = _TOD_Seconds_since_epoch(); 485e0: 2039 0006 962a movel 6962a <_TOD_Now>,%d0 if ( time->tv_sec < seconds ) 485e6: 2212 movel %a2@,%d1 485e8: b280 cmpl %d0,%d1 485ea: 6d38 blts 48624 <_TOD_Set+0x5c> Watchdog_Adjust_directions direction, Watchdog_Interval units ) { _Watchdog_Adjust( &_Watchdog_Seconds_chain, direction, units ); 485ec: 9280 subl %d0,%d1 485ee: 2f01 movel %d1,%sp@- 485f0: 42a7 clrl %sp@- 485f2: 4879 0006 9664 pea 69664 <_Watchdog_Seconds_chain> 485f8: 4eb9 0004 acbc jsr 4acbc <_Watchdog_Adjust> _Watchdog_Adjust_seconds( WATCHDOG_BACKWARD, seconds - time->tv_sec ); else _Watchdog_Adjust_seconds( WATCHDOG_FORWARD, time->tv_sec - seconds ); /* POSIX format TOD (timespec) */ _Timestamp_Set( &_TOD_Now, time->tv_sec, time->tv_nsec ); 485fe: 23d2 0006 962a movel %a2@,6962a <_TOD_Now> 48604: 588a addql #4,%a2 48606: 4fef 000c lea %sp@(12),%sp 4860a: 23d2 0006 962e movel %a2@,6962e <_TOD_Now+0x4> _TOD_Is_set = true; _TOD_Activate(); _Thread_Enable_dispatch(); } 48610: 246e fffc moveal %fp@(-4),%a2 48614: 4e5e unlk %fp else _Watchdog_Adjust_seconds( WATCHDOG_FORWARD, time->tv_sec - seconds ); /* POSIX format TOD (timespec) */ _Timestamp_Set( &_TOD_Now, time->tv_sec, time->tv_nsec ); _TOD_Is_set = true; 48616: 7001 moveq #1,%d0 48618: 13c0 0006 95ac moveb %d0,695ac <_TOD_Is_set> _TOD_Activate(); _Thread_Enable_dispatch(); 4861e: 4ef9 0004 9910 jmp 49910 <_Thread_Enable_dispatch> 48624: 9081 subl %d1,%d0 48626: 2f00 movel %d0,%sp@- 48628: 4878 0001 pea 1 4862c: 4879 0006 9664 pea 69664 <_Watchdog_Seconds_chain> 48632: 4eb9 0004 acbc jsr 4acbc <_Watchdog_Adjust> _Watchdog_Adjust_seconds( WATCHDOG_BACKWARD, seconds - time->tv_sec ); else _Watchdog_Adjust_seconds( WATCHDOG_FORWARD, time->tv_sec - seconds ); /* POSIX format TOD (timespec) */ _Timestamp_Set( &_TOD_Now, time->tv_sec, time->tv_nsec ); 48638: 23d2 0006 962a movel %a2@,6962a <_TOD_Now> 4863e: 588a addql #4,%a2 48640: 4fef 000c lea %sp@(12),%sp 48644: 23d2 0006 962e movel %a2@,6962e <_TOD_Now+0x4> _TOD_Is_set = true; _TOD_Activate(); _Thread_Enable_dispatch(); } 4864a: 246e fffc moveal %fp@(-4),%a2 4864e: 4e5e unlk %fp else _Watchdog_Adjust_seconds( WATCHDOG_FORWARD, time->tv_sec - seconds ); /* POSIX format TOD (timespec) */ _Timestamp_Set( &_TOD_Now, time->tv_sec, time->tv_nsec ); _TOD_Is_set = true; 48650: 7001 moveq #1,%d0 48652: 13c0 0006 95ac moveb %d0,695ac <_TOD_Is_set> _TOD_Activate(); _Thread_Enable_dispatch(); 48658: 4ef9 0004 9910 jmp 49910 <_Thread_Enable_dispatch> ... 000479e8 <_Thread_Clear_state>: ) { ISR_Level level; States_Control current_state; _ISR_Disable( level ); 479e8: 327c 0700 moveaw #1792,%a1 479ec: 2009 movel %a1,%d0 void _Thread_Clear_state( Thread_Control *the_thread, States_Control state ) { 479ee: 4e56 ffec linkw %fp,#-20 479f2: 206e 0008 moveal %fp@(8),%a0 479f6: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@ 479fa: 242e 000c movel %fp@(12),%d2 ISR_Level level; States_Control current_state; _ISR_Disable( level ); 479fe: 40c3 movew %sr,%d3 47a00: 8083 orl %d3,%d0 47a02: 46c0 movew %d0,%sr current_state = the_thread->current_state; 47a04: 2228 0010 movel %a0@(16),%d1 if ( current_state & state ) { 47a08: 2002 movel %d2,%d0 47a0a: c081 andl %d1,%d0 47a0c: 6776 beqs 47a84 <_Thread_Clear_state+0x9c> RTEMS_INLINE_ROUTINE States_Control _States_Clear ( States_Control states_to_clear, States_Control current_state ) { return (current_state & ~states_to_clear); 47a0e: 2002 movel %d2,%d0 47a10: 4680 notl %d0 47a12: c081 andl %d1,%d0 current_state = 47a14: 2140 0010 movel %d0,%a0@(16) the_thread->current_state = _States_Clear( state, current_state ); if ( _States_Is_ready( current_state ) ) { 47a18: 666a bnes 47a84 <_Thread_Clear_state+0x9c> RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 47a1a: 2868 008e moveal %a0@(142),%a4 47a1e: 3028 0094 movew %a0@(148),%d0 47a22: 3214 movew %a4@,%d1 _Priority_Add_to_bit_map( &the_thread->Priority_map ); _Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node); 47a24: 2468 008a moveal %a0@(138),%a2 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 47a28: 240a movel %a2,%d2 47a2a: 5882 addql #4,%d2 47a2c: 8081 orl %d1,%d0 47a2e: 2082 movel %d2,%a0@ old_last_node = the_chain->last; 47a30: 266a 0008 moveal %a2@(8),%a3 47a34: 3880 movew %d0,%a4@ the_chain->last = the_node; 47a36: 2548 0008 movel %a0,%a2@(8) _Priority_Major_bit_map |= the_priority_map->ready_major; 47a3a: 3239 0005 f028 movew 5f028 <_Priority_Major_bit_map>,%d1 47a40: 3028 0092 movew %a0@(146),%d0 old_last_node->next = the_node; the_node->previous = old_last_node; 47a44: 214b 0004 movel %a3,%a0@(4) 47a48: 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; 47a4a: 2688 movel %a0,%a3@ 47a4c: 33c0 0005 f028 movew %d0,5f028 <_Priority_Major_bit_map> _ISR_Flash( level ); 47a52: 2009 movel %a1,%d0 47a54: 46c3 movew %d3,%sr 47a56: 8083 orl %d3,%d0 47a58: 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 ) { 47a5a: 2028 0014 movel %a0@(20),%d0 47a5e: 2279 0005 f006 moveal 5f006 <_Thread_Heir>,%a1 47a64: b0a9 0014 cmpl %a1@(20),%d0 47a68: 641a bccs 47a84 <_Thread_Clear_state+0x9c> _Thread_Heir = the_thread; 47a6a: 23c8 0005 f006 movel %a0,5f006 <_Thread_Heir> if ( _Thread_Executing->is_preemptible || 47a70: 2079 0005 f032 moveal 5f032 <_Thread_Executing>,%a0 47a76: 4a28 0075 tstb %a0@(117) 47a7a: 6712 beqs 47a8e <_Thread_Clear_state+0xa6> the_thread->current_priority == 0 ) _Context_Switch_necessary = true; 47a7c: 7001 moveq #1,%d0 47a7e: 13c0 0005 f042 moveb %d0,5f042 <_Context_Switch_necessary> } } } _ISR_Enable( level ); 47a84: 46c3 movew %d3,%sr } 47a86: 4cd7 1c0c moveml %sp@,%d2-%d3/%a2-%a4 47a8a: 4e5e unlk %fp 47a8c: 4e75 rts * Even if the thread isn't preemptible, if the new heir is * a pseudo-ISR system task, we need to do a context switch. */ if ( the_thread->current_priority < _Thread_Heir->current_priority ) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 47a8e: 4a80 tstl %d0 47a90: 66f2 bnes 47a84 <_Thread_Clear_state+0x9c> the_thread->current_priority == 0 ) _Context_Switch_necessary = true; 47a92: 7001 moveq #1,%d0 <== NOT EXECUTED 47a94: 13c0 0005 f042 moveb %d0,5f042 <_Context_Switch_necessary> <== NOT EXECUTED 47a9a: 60e8 bras 47a84 <_Thread_Clear_state+0x9c> <== NOT EXECUTED 00047a9c <_Thread_Close>: 47a9c: 4280 clrl %d0 void _Thread_Close( Objects_Information *information, Thread_Control *the_thread ) { 47a9e: 4e56 0000 linkw %fp,#0 47aa2: 2f0b movel %a3,%sp@- 47aa4: 266e 0008 moveal %fp@(8),%a3 47aa8: 2f0a movel %a2,%sp@- 47aaa: 246e 000c moveal %fp@(12),%a2 47aae: 206b 0018 moveal %a3@(24),%a0 47ab2: 302a 000a movew %a2@(10),%d0 47ab6: 42b0 0c00 clrl %a0@(00000000,%d0:l:4) */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 47aba: 2039 0005 ef78 movel 5ef78 <_Thread_Dispatch_disable_level>,%d0 47ac0: 5380 subql #1,%d0 * disappear and set a transient state on it. So we temporarily * unnest dispatching. */ _Thread_Unnest_dispatch(); _User_extensions_Thread_delete( the_thread ); 47ac2: 2f0a movel %a2,%sp@- 47ac4: 23c0 0005 ef78 movel %d0,5ef78 <_Thread_Dispatch_disable_level> 47aca: 4eb9 0004 8e90 jsr 48e90 <_User_extensions_Thread_delete> rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 47ad0: 2039 0005 ef78 movel 5ef78 <_Thread_Dispatch_disable_level>,%d0 47ad6: 5280 addql #1,%d0 47ad8: 23c0 0005 ef78 movel %d0,5ef78 <_Thread_Dispatch_disable_level> /* * Now we are in a dispatching critical section again and we * can take the thread OUT of the published set. It is invalid * to use this thread's Id OR name after this call. */ _Objects_Close( information, &the_thread->Object ); 47ade: 2f0a movel %a2,%sp@- 47ae0: 2f0b movel %a3,%sp@- 47ae2: 4eb9 0004 7120 jsr 47120 <_Objects_Close> /* * By setting the dormant state, the thread will not be considered * for scheduling when we remove any blocking states. */ _Thread_Set_state( the_thread, STATES_DORMANT ); 47ae8: 4878 0001 pea 1 47aec: 2f0a movel %a2,%sp@- 47aee: 4eb9 0004 8720 jsr 48720 <_Thread_Set_state> if ( !_Thread_queue_Extract_with_proxy( the_thread ) ) { 47af4: 2f0a movel %a2,%sp@- 47af6: 4eb9 0004 852c jsr 4852c <_Thread_queue_Extract_with_proxy> 47afc: 4fef 0018 lea %sp@(24),%sp 47b00: 4a00 tstb %d0 47b02: 6608 bnes 47b0c <_Thread_Close+0x70> if ( _Watchdog_Is_active( &the_thread->Timer ) ) 47b04: 7002 moveq #2,%d0 47b06: b0aa 0050 cmpl %a2@(80),%d0 47b0a: 6756 beqs 47b62 <_Thread_Close+0xc6> /* * The thread might have been FP. So deal with that. */ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( _Thread_Is_allocated_fp( the_thread ) ) 47b0c: b5f9 0005 effe cmpal 5effe <_Thread_Allocated_fp>,%a2 47b12: 6746 beqs 47b5a <_Thread_Close+0xbe> _Thread_Deallocate_fp(); #endif the_thread->fp_context = NULL; if ( the_thread->Start.fp_context ) 47b14: 202a 00c6 movel %a2@(198),%d0 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( _Thread_Is_allocated_fp( the_thread ) ) _Thread_Deallocate_fp(); #endif the_thread->fp_context = NULL; 47b18: 42aa 0102 clrl %a2@(258) if ( the_thread->Start.fp_context ) 47b1c: 4a80 tstl %d0 47b1e: 670a beqs 47b2a <_Thread_Close+0x8e> (void) _Workspace_Free( the_thread->Start.fp_context ); 47b20: 2f00 movel %d0,%sp@- 47b22: 4eb9 0004 9210 jsr 49210 <_Workspace_Free> 47b28: 588f addql #4,%sp /* * Free the rest of the memory associated with this task * and set the associated pointers to NULL for safety. */ _Thread_Stack_Free( the_thread ); 47b2a: 2f0a movel %a2,%sp@- 47b2c: 4eb9 0004 891c jsr 4891c <_Thread_Stack_Free> the_thread->Start.stack = NULL; if ( the_thread->extensions ) 47b32: 202a 0116 movel %a2@(278),%d0 47b36: 588f addql #4,%sp /* * Free the rest of the memory associated with this task * and set the associated pointers to NULL for safety. */ _Thread_Stack_Free( the_thread ); the_thread->Start.stack = NULL; 47b38: 42aa 00ca clrl %a2@(202) if ( the_thread->extensions ) 47b3c: 4a80 tstl %d0 47b3e: 670a beqs 47b4a <_Thread_Close+0xae> (void) _Workspace_Free( the_thread->extensions ); 47b40: 2f00 movel %d0,%sp@- 47b42: 4eb9 0004 9210 jsr 49210 <_Workspace_Free> 47b48: 588f addql #4,%sp the_thread->extensions = NULL; 47b4a: 42aa 0116 clrl %a2@(278) } 47b4e: 246e fff8 moveal %fp@(-8),%a2 47b52: 266e fffc moveal %fp@(-4),%a3 47b56: 4e5e unlk %fp 47b58: 4e75 rts */ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) RTEMS_INLINE_ROUTINE void _Thread_Deallocate_fp( void ) { _Thread_Allocated_fp = NULL; 47b5a: 42b9 0005 effe clrl 5effe <_Thread_Allocated_fp> 47b60: 60b2 bras 47b14 <_Thread_Close+0x78> */ _Thread_Set_state( the_thread, STATES_DORMANT ); if ( !_Thread_queue_Extract_with_proxy( the_thread ) ) { if ( _Watchdog_Is_active( &the_thread->Timer ) ) (void) _Watchdog_Remove( &the_thread->Timer ); 47b62: 486a 0048 pea %a2@(72) 47b66: 4eb9 0004 90a4 jsr 490a4 <_Watchdog_Remove> 47b6c: 588f addql #4,%sp /* * The thread might have been FP. So deal with that. */ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( _Thread_Is_allocated_fp( the_thread ) ) 47b6e: b5f9 0005 effe cmpal 5effe <_Thread_Allocated_fp>,%a2 47b74: 669e bnes 47b14 <_Thread_Close+0x78> 47b76: 60e2 bras 47b5a <_Thread_Close+0xbe> <== NOT EXECUTED 00047dbc <_Thread_Enable_dispatch>: #if ( (defined(CPU_INLINE_ENABLE_DISPATCH) && \ (CPU_INLINE_ENABLE_DISPATCH == FALSE)) || \ (__RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH__ == 1) ) void _Thread_Enable_dispatch( void ) { 47dbc: 4e56 0000 linkw %fp,#0 if ( --_Thread_Dispatch_disable_level ) 47dc0: 2039 0005 ef78 movel 5ef78 <_Thread_Dispatch_disable_level>,%d0 47dc6: 5380 subql #1,%d0 47dc8: 23c0 0005 ef78 movel %d0,5ef78 <_Thread_Dispatch_disable_level> 47dce: 2039 0005 ef78 movel 5ef78 <_Thread_Dispatch_disable_level>,%d0 47dd4: 6704 beqs 47dda <_Thread_Enable_dispatch+0x1e> return; _Thread_Dispatch(); } 47dd6: 4e5e unlk %fp 47dd8: 4e75 rts 47dda: 4e5e unlk %fp (__RTEMS_DO_NOT_INLINE_THREAD_ENABLE_DISPATCH__ == 1) ) void _Thread_Enable_dispatch( void ) { if ( --_Thread_Dispatch_disable_level ) return; _Thread_Dispatch(); 47ddc: 4ef9 0004 7c64 jmp 47c64 <_Thread_Dispatch> ... 0004e000 <_Thread_Handler>: * * Output parameters: NONE */ void _Thread_Handler( void ) { 4e000: 4e56 0000 linkw %fp,#0 4e004: 2f0a movel %a2,%sp@- #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static char doneConstructors; char doneCons; #endif executing = _Thread_Executing; 4e006: 2479 0005 f032 moveal 5f032 <_Thread_Executing>,%a2 * * Output parameters: NONE */ void _Thread_Handler( void ) { 4e00c: 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; 4e00e: 222a 00b4 movel %a2@(180),%d1 _ISR_Set_level(level); 4e012: 40c0 movew %sr,%d0 4e014: e189 lsll #8,%d1 4e016: 0280 0000 f8ff andil #63743,%d0 4e01c: 8081 orl %d1,%d0 4e01e: 46c0 movew %d0,%sr #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) doneCons = doneConstructors; doneConstructors = 1; 4e020: 7001 moveq #1,%d0 level = executing->Start.isr_level; _ISR_Set_level(level); #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) doneCons = doneConstructors; 4e022: 1439 0005 e728 moveb 5e728 ,%d2 doneConstructors = 1; 4e028: 13c0 0005 e728 moveb %d0,5e728 #endif #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && 4e02e: 4aaa 0102 tstl %a2@(258) 4e032: 6720 beqs 4e054 <_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 ); 4e034: 2079 0005 effe moveal 5effe <_Thread_Allocated_fp>,%a0 4e03a: b1ca cmpal %a2,%a0 4e03c: 6716 beqs 4e054 <_Thread_Handler+0x54> !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) 4e03e: 4a88 tstl %a0 4e040: 670c beqs 4e04e <_Thread_Handler+0x4e> _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 4e042: 4868 0102 pea %a0@(258) 4e046: 4eb9 0004 93c6 jsr 493c6 <_CPU_Context_save_fp> 4e04c: 588f addql #4,%sp _Thread_Allocated_fp = executing; 4e04e: 23ca 0005 effe movel %a2,5effe <_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 ); 4e054: 2f0a movel %a2,%sp@- 4e056: 4eb9 0004 8d74 jsr 48d74 <_User_extensions_Thread_begin> /* * At this point, the dispatch disable level BETTER be 1. */ _Thread_Enable_dispatch(); 4e05c: 4eb9 0004 7dbc jsr 47dbc <_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) */ { 4e062: 588f addql #4,%sp 4e064: 4a02 tstb %d2 4e066: 6724 beqs 4e08c <_Thread_Handler+0x8c> INIT_NAME (); } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 4e068: 202a 009e movel %a2@(158),%d0 4e06c: 672a beqs 4e098 <_Thread_Handler+0x98> (*(Thread_Entry_numeric) executing->Start.entry_point)( executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { 4e06e: 7201 moveq #1,%d1 4e070: b280 cmpl %d0,%d1 4e072: 674c beqs 4e0c0 <_Thread_Handler+0xc0> * 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 ); 4e074: 2f0a movel %a2,%sp@- <== NOT EXECUTED 4e076: 4eb9 0004 8db2 jsr 48db2 <_User_extensions_Thread_exitted> <== NOT EXECUTED _Internal_error_Occurred( 4e07c: 4878 0006 pea 6 <== NOT EXECUTED 4e080: 4878 0001 pea 1 <== NOT EXECUTED 4e084: 42a7 clrl %sp@- <== NOT EXECUTED 4e086: 4eb9 0004 6fcc jsr 46fcc <_Internal_error_Occurred> <== NOT EXECUTED * _init could be a weak symbol and we SHOULD test it but it isn't * in any configuration I know of and it generates a warning on every * RTEMS target configuration. --joel (12 May 2007) */ if (!doneCons) /* && (volatile void *)_init) */ { INIT_NAME (); 4e08c: 4eb9 0005 bc38 jsr 5bc38 <_init> } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 4e092: 202a 009e movel %a2@(158),%d0 4e096: 66d6 bnes 4e06e <_Thread_Handler+0x6e> executing->Wait.return_argument = (*(Thread_Entry_numeric) executing->Start.entry_point)( 4e098: 2f2a 00a6 movel %a2@(166),%sp@- 4e09c: 206a 009a moveal %a2@(154),%a0 4e0a0: 4e90 jsr %a0@ INIT_NAME (); } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { executing->Wait.return_argument = 4e0a2: 588f addql #4,%sp 4e0a4: 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 ); 4e0a8: 2f0a movel %a2,%sp@- 4e0aa: 4eb9 0004 8db2 jsr 48db2 <_User_extensions_Thread_exitted> _Internal_error_Occurred( 4e0b0: 4878 0006 pea 6 4e0b4: 4878 0001 pea 1 4e0b8: 42a7 clrl %sp@- 4e0ba: 4eb9 0004 6fcc jsr 46fcc <_Internal_error_Occurred> ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { executing->Wait.return_argument = (*(Thread_Entry_pointer) executing->Start.entry_point)( 4e0c0: 2f2a 00a2 movel %a2@(162),%sp@- 4e0c4: 206a 009a moveal %a2@(154),%a0 4e0c8: 4e90 jsr %a0@ executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { executing->Wait.return_argument = 4e0ca: 588f addql #4,%sp 4e0cc: 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 ); 4e0d0: 2f0a movel %a2,%sp@- 4e0d2: 4eb9 0004 8db2 jsr 48db2 <_User_extensions_Thread_exitted> _Internal_error_Occurred( 4e0d8: 4878 0006 pea 6 <== NOT EXECUTED 4e0dc: 4878 0001 pea 1 <== NOT EXECUTED 4e0e0: 42a7 clrl %sp@- <== NOT EXECUTED 4e0e2: 4eb9 0004 6fcc jsr 46fcc <_Internal_error_Occurred> <== NOT EXECUTED 000480d8 <_Thread_Handler_initialization>: * * Output parameters: NONE */ void _Thread_Handler_initialization(void) { 480d8: 4e56 0000 linkw %fp,#0 #endif /* * BOTH stacks hooks must be set or both must be NULL. * Do not allow mixture. */ if ( !( (!Configuration.stack_allocate_hook) 480dc: 4ab9 0005 d7e8 tstl 5d7e8 480e2: 57c0 seq %d0 480e4: 4ab9 0005 d7e4 tstl 5d7e4 480ea: 57c1 seq %d1 480ec: 4480 negl %d0 480ee: 4481 negl %d1 480f0: b380 eorl %d1,%d0 uint32_t maximum_extensions; #if defined(RTEMS_MULTIPROCESSING) uint32_t maximum_proxies; #endif ticks_per_timeslice = Configuration.ticks_per_timeslice; 480f2: 2239 0005 d7d4 movel 5d7d4 ,%d1 maximum_extensions = Configuration.maximum_extensions; 480f8: 2079 0005 d7cc moveal 5d7cc ,%a0 * * Output parameters: NONE */ void _Thread_Handler_initialization(void) { 480fe: 2f02 movel %d2,%sp@- #endif /* * BOTH stacks hooks must be set or both must be NULL. * Do not allow mixture. */ if ( !( (!Configuration.stack_allocate_hook) 48100: 4a00 tstb %d0 48102: 6600 00a2 bnew 481a6 <_Thread_Handler_initialization+0xce> _Thread_Maximum_extensions = maximum_extensions; _Thread_Ticks_per_timeslice = ticks_per_timeslice; _Thread_Ready_chain = (Chain_Control *) _Workspace_Allocate_or_fatal_error( 48106: 4280 clrl %d0 48108: 1039 0005 d7c2 moveb 5d7c2 ,%d0 (PRIORITY_MAXIMUM + 1) * sizeof(Chain_Control) ); for ( index=0; index <= PRIORITY_MAXIMUM ; index++ ) 4810e: 4282 clrl %d2 _Thread_Maximum_extensions = maximum_extensions; _Thread_Ticks_per_timeslice = ticks_per_timeslice; _Thread_Ready_chain = (Chain_Control *) _Workspace_Allocate_or_fatal_error( 48110: 5280 addql #1,%d0 _Thread_Do_post_task_switch_extension = 0; _Thread_Maximum_extensions = maximum_extensions; _Thread_Ticks_per_timeslice = ticks_per_timeslice; 48112: 23c1 0005 ef28 movel %d1,5ef28 <_Thread_Ticks_per_timeslice> _Thread_Ready_chain = (Chain_Control *) _Workspace_Allocate_or_fatal_error( 48118: 2200 movel %d0,%d1 4811a: e588 lsll #2,%d0 4811c: e989 lsll #4,%d1 _Thread_Allocated_fp = NULL; #endif _Thread_Do_post_task_switch_extension = 0; _Thread_Maximum_extensions = maximum_extensions; 4811e: 23c8 0005 f016 movel %a0,5f016 <_Thread_Maximum_extensions> _Thread_Ticks_per_timeslice = ticks_per_timeslice; _Thread_Ready_chain = (Chain_Control *) _Workspace_Allocate_or_fatal_error( 48124: 9280 subl %d0,%d1 INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_BAD_STACK_HOOK ); _Context_Switch_necessary = false; 48126: 4200 clrb %d0 _Thread_Maximum_extensions = maximum_extensions; _Thread_Ticks_per_timeslice = ticks_per_timeslice; _Thread_Ready_chain = (Chain_Control *) _Workspace_Allocate_or_fatal_error( 48128: 2f01 movel %d1,%sp@- INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_BAD_STACK_HOOK ); _Context_Switch_necessary = false; 4812a: 13c0 0005 f042 moveb %d0,5f042 <_Context_Switch_necessary> _Thread_Executing = NULL; 48130: 42b9 0005 f032 clrl 5f032 <_Thread_Executing> _Thread_Heir = NULL; 48136: 42b9 0005 f006 clrl 5f006 <_Thread_Heir> #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Thread_Allocated_fp = NULL; 4813c: 42b9 0005 effe clrl 5effe <_Thread_Allocated_fp> #endif _Thread_Do_post_task_switch_extension = 0; 48142: 42b9 0005 f01a clrl 5f01a <_Thread_Do_post_task_switch_extension> _Thread_Maximum_extensions = maximum_extensions; _Thread_Ticks_per_timeslice = ticks_per_timeslice; _Thread_Ready_chain = (Chain_Control *) _Workspace_Allocate_or_fatal_error( 48148: 4eb9 0004 91c0 jsr 491c0 <_Workspace_Allocate_or_fatal_error> (PRIORITY_MAXIMUM + 1) * sizeof(Chain_Control) ); for ( index=0; index <= PRIORITY_MAXIMUM ; index++ ) 4814e: 588f addql #4,%sp 48150: 1439 0005 d7c2 moveb 5d7c2 ,%d2 48156: 2040 moveal %d0,%a0 48158: 4281 clrl %d1 _Thread_Maximum_extensions = maximum_extensions; _Thread_Ticks_per_timeslice = ticks_per_timeslice; _Thread_Ready_chain = (Chain_Control *) _Workspace_Allocate_or_fatal_error( 4815a: 23c0 0005 ef24 movel %d0,5ef24 <_Thread_Ready_chain> */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 48160: 2008 movel %a0,%d0 48162: 5880 addql #4,%d0 (PRIORITY_MAXIMUM + 1) * sizeof(Chain_Control) ); for ( index=0; index <= PRIORITY_MAXIMUM ; index++ ) 48164: 5281 addql #1,%d1 48166: 2080 movel %d0,%a0@ the_chain->permanent_null = NULL; 48168: 42a8 0004 clrl %a0@(4) the_chain->last = _Chain_Head(the_chain); 4816c: 2148 0008 movel %a0,%a0@(8) 48170: 41e8 000c lea %a0@(12),%a0 48174: b481 cmpl %d1,%d2 48176: 64e8 bccs 48160 <_Thread_Handler_initialization+0x88> /* * Initialize this class of objects. */ _Objects_Initialize_information( 48178: 4878 0008 pea 8 4817c: 42a7 clrl %sp@- 4817e: 4878 011e pea 11e 48182: 4878 0001 pea 1 48186: 4878 0001 pea 1 4818a: 4878 0001 pea 1 4818e: 4879 0005 f0c6 pea 5f0c6 <_Thread_Internal_information> 48194: 4eb9 0004 7598 jsr 47598 <_Objects_Initialize_information> false, /* true if this is a global object class */ NULL /* Proxy extraction support callout */ #endif ); } 4819a: 242e fffc movel %fp@(-4),%d2 /* * Initialize this class of objects. */ _Objects_Initialize_information( 4819e: 4fef 001c lea %sp@(28),%sp false, /* true if this is a global object class */ NULL /* Proxy extraction support callout */ #endif ); } 481a2: 4e5e unlk %fp 481a4: 4e75 rts * BOTH stacks hooks must be set or both must be NULL. * Do not allow mixture. */ if ( !( (!Configuration.stack_allocate_hook) == (!Configuration.stack_free_hook) ) ) _Internal_error_Occurred( 481a6: 4878 000f pea f 481aa: 4878 0001 pea 1 481ae: 42a7 clrl %sp@- 481b0: 4eb9 0004 6fcc jsr 46fcc <_Internal_error_Occurred> ... 00047e80 <_Thread_Initialize>: Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 47e80: 4e56 ffe8 linkw %fp,#-24 47e84: 202e 0010 movel %fp@(16),%d0 47e88: 48d7 047c moveml %d2-%d6/%a2,%sp@ 47e8c: 246e 000c moveal %fp@(12),%a2 47e90: 282e 0014 movel %fp@(20),%d4 47e94: 242e 001c movel %fp@(28),%d2 47e98: 262e 0024 movel %fp@(36),%d3 /* * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; 47e9c: 42aa 010a clrl %a2@(266) Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 47ea0: 1a2e 001b moveb %fp@(27),%d5 /* * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; 47ea4: 42aa 010e clrl %a2@(270) Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 47ea8: 1c2e 0023 moveb %fp@(35),%d6 /* * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; 47eac: 42aa 0112 clrl %a2@(274) extensions_area = NULL; the_thread->libc_reent = NULL; 47eb0: 42aa 0106 clrl %a2@(262) if ( !actual_stack_size || actual_stack_size < stack_size ) return false; /* stack allocation failed */ stack = the_thread->Start.stack; #else if ( !stack_area ) { 47eb4: 4a80 tstl %d0 47eb6: 6700 01f0 beqw 480a8 <_Thread_Initialize+0x228> stack = the_thread->Start.stack; the_thread->Start.core_allocated_stack = true; } else { stack = stack_area; actual_stack_size = stack_size; the_thread->Start.core_allocated_stack = false; 47eba: 2204 movel %d4,%d1 47ebc: 4204 clrb %d4 47ebe: 1544 00bc moveb %d4,%a2@(188) Stack_Control *the_stack, void *starting_address, size_t size ) { the_stack->area = starting_address; 47ec2: 2540 00c2 movel %d0,%a2@(194) the_stack->size = size; 47ec6: 2541 00be movel %d1,%a2@(190) /* * Allocate the floating point area for this thread */ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( is_fp ) { 47eca: 4a05 tstb %d5 47ecc: 6600 017e bnew 4804c <_Thread_Initialize+0x1cc> 47ed0: 4280 clrl %d0 47ed2: 4285 clrl %d5 #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { 47ed4: 2239 0005 f016 movel 5f016 <_Thread_Maximum_extensions>,%d1 if ( !fp_area ) goto failed; fp_area = _Context_Fp_start( fp_area, 0 ); } the_thread->fp_context = fp_area; the_thread->Start.fp_context = fp_area; 47eda: 2540 00c6 movel %d0,%a2@(198) 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; 47ede: 2540 0102 movel %d0,%a2@(258) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 47ee2: 42aa 0050 clrl %a2@(80) the_watchdog->routine = routine; 47ee6: 42aa 0064 clrl %a2@(100) the_watchdog->id = id; 47eea: 42aa 0068 clrl %a2@(104) the_watchdog->user_data = user_data; 47eee: 42aa 006c clrl %a2@(108) #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { 47ef2: 4a81 tstl %d1 47ef4: 6600 0178 bnew 4806e <_Thread_Initialize+0x1ee> (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) goto failed; } the_thread->extensions = (void **) extensions_area; 47ef8: 42aa 0116 clrl %a2@(278) 47efc: 4284 clrl %d4 /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; 47efe: 2543 00ac movel %d3,%a2@(172) the_thread->Start.budget_callout = budget_callout; switch ( budget_algorithm ) { 47f02: 7002 moveq #2,%d0 * General initialization */ the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; the_thread->Start.budget_callout = budget_callout; 47f04: 256e 0028 00b0 movel %fp@(40),%a2@(176) /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; 47f0a: 1546 00aa moveb %d6,%a2@(170) the_thread->Start.budget_algorithm = budget_algorithm; the_thread->Start.budget_callout = budget_callout; switch ( budget_algorithm ) { 47f0e: b083 cmpl %d3,%d0 47f10: 6700 00d6 beqw 47fe8 <_Thread_Initialize+0x168> #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 ); 47f14: 2f02 movel %d2,%sp@- case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; 47f16: 256e 002c 00b4 movel %fp@(44),%a2@(180) the_thread->current_state = STATES_DORMANT; 47f1c: 7001 moveq #1,%d0 #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 ); 47f1e: 2f0a movel %a2,%sp@- #endif } the_thread->Start.isr_level = isr_level; the_thread->current_state = STATES_DORMANT; 47f20: 2540 0010 movel %d0,%a2@(16) the_thread->Wait.queue = NULL; 47f24: 42aa 0044 clrl %a2@(68) the_thread->resource_count = 0; 47f28: 42aa 001c clrl %a2@(28) #if defined(RTEMS_ITRON_API) the_thread->suspend_count = 0; #endif the_thread->real_priority = priority; 47f2c: 2542 0018 movel %d2,%a2@(24) the_thread->Start.initial_priority = priority; 47f30: 2542 00b8 movel %d2,%a2@(184) _Thread_Set_priority( the_thread, priority ); 47f34: 4eb9 0004 86b0 jsr 486b0 <_Thread_Set_priority> #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 47f3a: 206e 0008 moveal %fp@(8),%a0 47f3e: 4280 clrl %d0 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 47f40: 256e 0030 000c movel %fp@(48),%a2@(12) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 47f46: 2068 0018 moveal %a0@(24),%a0 47f4a: 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 ); 47f4e: 42aa 0082 clrl %a2@(130) 47f52: 218a 0c00 movel %a2,%a0@(00000000,%d0:l:4) 47f56: 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 ); 47f5a: 2f0a movel %a2,%sp@- 47f5c: 4eb9 0004 8e44 jsr 48e44 <_User_extensions_Thread_create> if ( extension_status ) 47f62: 4fef 000c lea %sp@(12),%sp 47f66: 4a00 tstb %d0 47f68: 6672 bnes 47fdc <_Thread_Initialize+0x15c> return true; failed: if ( the_thread->libc_reent ) 47f6a: 202a 0106 movel %a2@(262),%d0 47f6e: 670a beqs 47f7a <_Thread_Initialize+0xfa> _Workspace_Free( the_thread->libc_reent ); 47f70: 2f00 movel %d0,%sp@- 47f72: 4eb9 0004 9210 jsr 49210 <_Workspace_Free> 47f78: 588f addql #4,%sp for ( i=0 ; i <= THREAD_API_LAST ; i++ ) if ( the_thread->API_Extensions[i] ) 47f7a: 202a 010a movel %a2@(266),%d0 47f7e: 670a beqs 47f8a <_Thread_Initialize+0x10a> _Workspace_Free( the_thread->API_Extensions[i] ); 47f80: 2f00 movel %d0,%sp@- 47f82: 4eb9 0004 9210 jsr 49210 <_Workspace_Free> 47f88: 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] ) 47f8a: 202a 010e movel %a2@(270),%d0 47f8e: 670a beqs 47f9a <_Thread_Initialize+0x11a> _Workspace_Free( the_thread->API_Extensions[i] ); 47f90: 2f00 movel %d0,%sp@- 47f92: 4eb9 0004 9210 jsr 49210 <_Workspace_Free> 47f98: 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] ) 47f9a: 202a 0112 movel %a2@(274),%d0 47f9e: 670a beqs 47faa <_Thread_Initialize+0x12a> _Workspace_Free( the_thread->API_Extensions[i] ); 47fa0: 2f00 movel %d0,%sp@- <== NOT EXECUTED 47fa2: 4eb9 0004 9210 jsr 49210 <_Workspace_Free> <== NOT EXECUTED 47fa8: 588f addql #4,%sp <== NOT EXECUTED if ( extensions_area ) 47faa: 4a84 tstl %d4 47fac: 670a beqs 47fb8 <_Thread_Initialize+0x138> (void) _Workspace_Free( extensions_area ); 47fae: 2f04 movel %d4,%sp@- 47fb0: 4eb9 0004 9210 jsr 49210 <_Workspace_Free> 47fb6: 588f addql #4,%sp #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( fp_area ) 47fb8: 4a85 tstl %d5 47fba: 670a beqs 47fc6 <_Thread_Initialize+0x146> (void) _Workspace_Free( fp_area ); 47fbc: 2f05 movel %d5,%sp@- 47fbe: 4eb9 0004 9210 jsr 49210 <_Workspace_Free> 47fc4: 588f addql #4,%sp #endif _Thread_Stack_Free( the_thread ); 47fc6: 2f0a movel %a2,%sp@- 47fc8: 4eb9 0004 891c jsr 4891c <_Thread_Stack_Free> return false; 47fce: 588f addql #4,%sp } 47fd0: 4cee 047c ffe8 moveml %fp@(-24),%d2-%d6/%a2 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( fp_area ) (void) _Workspace_Free( fp_area ); #endif _Thread_Stack_Free( the_thread ); 47fd6: 4200 clrb %d0 return false; } 47fd8: 4e5e unlk %fp 47fda: 4e75 rts 47fdc: 4cee 047c ffe8 moveml %fp@(-24),%d2-%d6/%a2 * user extensions with dispatching enabled. The Allocator * Mutex provides sufficient protection to let the user extensions * run safely. */ extension_status = _User_extensions_Thread_create( the_thread ); if ( extension_status ) 47fe2: 7001 moveq #1,%d0 _Thread_Stack_Free( the_thread ); return false; } 47fe4: 4e5e unlk %fp 47fe6: 4e75 rts case THREAD_CPU_BUDGET_ALGORITHM_NONE: case THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE: break; #if defined(RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE) case THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; 47fe8: 41f9 0005 ef28 lea 5ef28 <_Thread_Ticks_per_timeslice>,%a0 #endif } the_thread->Start.isr_level = isr_level; the_thread->current_state = STATES_DORMANT; 47fee: 7001 moveq #1,%d0 case THREAD_CPU_BUDGET_ALGORITHM_NONE: case THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE: break; #if defined(RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE) case THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; 47ff0: 2550 0076 movel %a0@,%a2@(118) #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 ); 47ff4: 2f02 movel %d2,%sp@- case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; 47ff6: 256e 002c 00b4 movel %fp@(44),%a2@(180) #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 ); 47ffc: 2f0a movel %a2,%sp@- #endif } the_thread->Start.isr_level = isr_level; the_thread->current_state = STATES_DORMANT; 47ffe: 2540 0010 movel %d0,%a2@(16) the_thread->Wait.queue = NULL; 48002: 42aa 0044 clrl %a2@(68) the_thread->resource_count = 0; 48006: 42aa 001c clrl %a2@(28) #if defined(RTEMS_ITRON_API) the_thread->suspend_count = 0; #endif the_thread->real_priority = priority; 4800a: 2542 0018 movel %d2,%a2@(24) the_thread->Start.initial_priority = priority; 4800e: 2542 00b8 movel %d2,%a2@(184) _Thread_Set_priority( the_thread, priority ); 48012: 4eb9 0004 86b0 jsr 486b0 <_Thread_Set_priority> 48018: 206e 0008 moveal %fp@(8),%a0 4801c: 4280 clrl %d0 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 4801e: 256e 0030 000c movel %fp@(48),%a2@(12) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 48024: 2068 0018 moveal %a0@(24),%a0 48028: 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 ); 4802c: 42aa 0082 clrl %a2@(130) 48030: 218a 0c00 movel %a2,%a0@(00000000,%d0:l:4) 48034: 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 ); 48038: 2f0a movel %a2,%sp@- 4803a: 4eb9 0004 8e44 jsr 48e44 <_User_extensions_Thread_create> if ( extension_status ) 48040: 4fef 000c lea %sp@(12),%sp 48044: 4a00 tstb %d0 48046: 6700 ff22 beqw 47f6a <_Thread_Initialize+0xea> 4804a: 6090 bras 47fdc <_Thread_Initialize+0x15c> /* * 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 ); 4804c: 4878 001c pea 1c 48050: 4eb9 0004 91f4 jsr 491f4 <_Workspace_Allocate> if ( !fp_area ) 48056: 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 ); 48058: 2a00 movel %d0,%d5 if ( !fp_area ) 4805a: 6600 fe78 bnew 47ed4 <_Thread_Initialize+0x54> extension_status = _User_extensions_Thread_create( the_thread ); if ( extension_status ) return true; failed: if ( the_thread->libc_reent ) 4805e: 202a 0106 movel %a2@(262),%d0 * Allocate the floating point area for this thread */ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( is_fp ) { fp_area = _Workspace_Allocate( CONTEXT_FP_SIZE ); if ( !fp_area ) 48062: 4284 clrl %d4 extension_status = _User_extensions_Thread_create( the_thread ); if ( extension_status ) return true; failed: if ( the_thread->libc_reent ) 48064: 4a80 tstl %d0 48066: 6600 ff08 bnew 47f70 <_Thread_Initialize+0xf0> 4806a: 6000 ff0e braw 47f7a <_Thread_Initialize+0xfa> /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { extensions_area = _Workspace_Allocate( 4806e: e589 lsll #2,%d1 48070: 2041 moveal %d1,%a0 48072: 4868 0004 pea %a0@(4) 48076: 4eb9 0004 91f4 jsr 491f4 <_Workspace_Allocate> (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) 4807c: 588f addql #4,%sp /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { extensions_area = _Workspace_Allocate( 4807e: 2800 movel %d0,%d4 (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) 48080: 6700 fee8 beqw 47f6a <_Thread_Initialize+0xea> goto failed; } the_thread->extensions = (void **) extensions_area; 48084: 2040 moveal %d0,%a0 * create the extension long after tasks have been created * so they cannot rely on the thread create user extension * call. */ if ( the_thread->extensions ) { for ( i = 0; i <= _Thread_Maximum_extensions ; i++ ) 48086: 4281 clrl %d1 48088: 4280 clrl %d0 4808a: 2279 0005 f016 moveal 5f016 <_Thread_Maximum_extensions>,%a1 (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) goto failed; } the_thread->extensions = (void **) extensions_area; 48090: 2544 0116 movel %d4,%a2@(278) * so they cannot rely on the thread create user extension * call. */ if ( the_thread->extensions ) { for ( i = 0; i <= _Thread_Maximum_extensions ; i++ ) the_thread->extensions[i] = NULL; 48094: 42b0 1c00 clrl %a0@(00000000,%d1:l:4) * create the extension long after tasks have been created * so they cannot rely on the thread create user extension * call. */ if ( the_thread->extensions ) { for ( i = 0; i <= _Thread_Maximum_extensions ; i++ ) 48098: 5280 addql #1,%d0 4809a: 2200 movel %d0,%d1 4809c: b089 cmpl %a1,%d0 4809e: 6200 fe5e bhiw 47efe <_Thread_Initialize+0x7e> 480a2: 206a 0116 moveal %a2@(278),%a0 480a6: 60ec bras 48094 <_Thread_Initialize+0x214> return false; /* stack allocation failed */ stack = the_thread->Start.stack; #else if ( !stack_area ) { actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); 480a8: 2f04 movel %d4,%sp@- 480aa: 2f0a movel %a2,%sp@- 480ac: 4eb9 0004 88b8 jsr 488b8 <_Thread_Stack_Allocate> if ( !actual_stack_size || actual_stack_size < stack_size ) 480b2: 508f addql #8,%sp return false; /* stack allocation failed */ stack = the_thread->Start.stack; #else if ( !stack_area ) { actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); 480b4: 2200 movel %d0,%d1 if ( !actual_stack_size || actual_stack_size < stack_size ) 480b6: 6712 beqs 480ca <_Thread_Initialize+0x24a> 480b8: b084 cmpl %d4,%d0 480ba: 650e bcss 480ca <_Thread_Initialize+0x24a> return false; /* stack allocation failed */ stack = the_thread->Start.stack; 480bc: 202a 00ca movel %a2@(202),%d0 the_thread->Start.core_allocated_stack = true; 480c0: 7801 moveq #1,%d4 480c2: 1544 00bc moveb %d4,%a2@(188) 480c6: 6000 fdfa braw 47ec2 <_Thread_Initialize+0x42> _Thread_Stack_Free( the_thread ); return false; } 480ca: 4cee 047c ffe8 moveml %fp@(-24),%d2-%d6/%a2 if ( fp_area ) (void) _Workspace_Free( fp_area ); #endif _Thread_Stack_Free( the_thread ); return false; 480d0: 4200 clrb %d0 } 480d2: 4e5e unlk %fp ... 0004d100 <_Thread_Reset>: void _Thread_Reset( Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { 4d100: 4e56 0000 linkw %fp,#0 4d104: 2f0a movel %a2,%sp@- 4d106: 246e 0008 moveal %fp@(8),%a2 the_thread->is_preemptible = the_thread->Start.is_preemptible; the_thread->budget_algorithm = the_thread->Start.budget_algorithm; the_thread->budget_callout = the_thread->Start.budget_callout; the_thread->Start.pointer_argument = pointer_argument; the_thread->Start.numeric_argument = numeric_argument; 4d10a: 256e 0010 00a6 movel %fp@(16),%a2@(166) the_thread->resource_count = 0; #if defined(RTEMS_ITRON_API) the_thread->suspend_count = 0; #endif the_thread->is_preemptible = the_thread->Start.is_preemptible; the_thread->budget_algorithm = the_thread->Start.budget_algorithm; 4d110: 256a 00ac 007a movel %a2@(172),%a2@(122) the_thread->budget_callout = the_thread->Start.budget_callout; 4d116: 256a 00b0 007e movel %a2@(176),%a2@(126) the_thread->Start.pointer_argument = pointer_argument; 4d11c: 256e 000c 00a2 movel %fp@(12),%a2@(162) { the_thread->resource_count = 0; #if defined(RTEMS_ITRON_API) the_thread->suspend_count = 0; #endif the_thread->is_preemptible = the_thread->Start.is_preemptible; 4d122: 156a 00aa 0075 moveb %a2@(170),%a2@(117) Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { the_thread->resource_count = 0; 4d128: 42aa 001c clrl %a2@(28) the_thread->budget_callout = the_thread->Start.budget_callout; the_thread->Start.pointer_argument = pointer_argument; the_thread->Start.numeric_argument = numeric_argument; if ( !_Thread_queue_Extract_with_proxy( the_thread ) ) { 4d12c: 2f0a movel %a2,%sp@- 4d12e: 4eb9 0004 9140 jsr 49140 <_Thread_queue_Extract_with_proxy> 4d134: 588f addql #4,%sp 4d136: 4a00 tstb %d0 4d138: 6608 bnes 4d142 <_Thread_Reset+0x42> if ( _Watchdog_Is_active( &the_thread->Timer ) ) 4d13a: 7002 moveq #2,%d0 4d13c: b0aa 0050 cmpl %a2@(80),%d0 4d140: 672a beqs 4d16c <_Thread_Reset+0x6c> (void) _Watchdog_Remove( &the_thread->Timer ); } if ( the_thread->current_priority != the_thread->Start.initial_priority ) { 4d142: 202a 00b8 movel %a2@(184),%d0 4d146: b0aa 0014 cmpl %a2@(20),%d0 4d14a: 6718 beqs 4d164 <_Thread_Reset+0x64> the_thread->real_priority = the_thread->Start.initial_priority; _Thread_Set_priority( the_thread, the_thread->Start.initial_priority ); 4d14c: 2d4a 0008 movel %a2,%fp@(8) 4d150: 2d40 000c movel %d0,%fp@(12) if ( _Watchdog_Is_active( &the_thread->Timer ) ) (void) _Watchdog_Remove( &the_thread->Timer ); } if ( the_thread->current_priority != the_thread->Start.initial_priority ) { the_thread->real_priority = the_thread->Start.initial_priority; 4d154: 2540 0018 movel %d0,%a2@(24) _Thread_Set_priority( the_thread, the_thread->Start.initial_priority ); } } 4d158: 246e fffc moveal %fp@(-4),%a2 4d15c: 4e5e unlk %fp (void) _Watchdog_Remove( &the_thread->Timer ); } if ( the_thread->current_priority != the_thread->Start.initial_priority ) { the_thread->real_priority = the_thread->Start.initial_priority; _Thread_Set_priority( the_thread, the_thread->Start.initial_priority ); 4d15e: 4ef9 0004 9350 jmp 49350 <_Thread_Set_priority> } } 4d164: 246e fffc moveal %fp@(-4),%a2 4d168: 4e5e unlk %fp 4d16a: 4e75 rts the_thread->Start.numeric_argument = numeric_argument; if ( !_Thread_queue_Extract_with_proxy( the_thread ) ) { if ( _Watchdog_Is_active( &the_thread->Timer ) ) (void) _Watchdog_Remove( &the_thread->Timer ); 4d16c: 486a 0048 pea %a2@(72) 4d170: 4eb9 0004 9d88 jsr 49d88 <_Watchdog_Remove> 4d176: 588f addql #4,%sp 4d178: 60c8 bras 4d142 <_Thread_Reset+0x42> ... 000492c4 <_Thread_Restart>: Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { if ( !_States_Is_dormant( the_thread->current_state ) ) { 492c4: 7001 moveq #1,%d0 bool _Thread_Restart( Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { 492c6: 4e56 0000 linkw %fp,#0 492ca: 2f0a movel %a2,%sp@- 492cc: 246e 0008 moveal %fp@(8),%a2 if ( !_States_Is_dormant( the_thread->current_state ) ) { 492d0: c0aa 0010 andl %a2@(16),%d0 492d4: 4a00 tstb %d0 492d6: 670a beqs 492e2 <_Thread_Restart+0x1e> return true; } return false; } 492d8: 246e fffc moveal %fp@(-4),%a2 492dc: 4e5e unlk %fp Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { if ( !_States_Is_dormant( the_thread->current_state ) ) { 492de: 4200 clrb %d0 return true; } return false; } 492e0: 4e75 rts Thread_Entry_numeric_type numeric_argument ) { if ( !_States_Is_dormant( the_thread->current_state ) ) { _Thread_Set_transient( the_thread ); 492e2: 2f0a movel %a2,%sp@- 492e4: 4eb9 0004 94d4 jsr 494d4 <_Thread_Set_transient> _Thread_Reset( the_thread, pointer_argument, numeric_argument ); 492ea: 2f2e 0010 movel %fp@(16),%sp@- 492ee: 2f2e 000c movel %fp@(12),%sp@- 492f2: 2f0a movel %a2,%sp@- 492f4: 4eb9 0004 d100 jsr 4d100 <_Thread_Reset> _Thread_Load_environment( the_thread ); 492fa: 2f0a movel %a2,%sp@- 492fc: 4eb9 0004 cd54 jsr 4cd54 <_Thread_Load_environment> _Thread_Ready( the_thread ); 49302: 2f0a movel %a2,%sp@- 49304: 4eb9 0004 d040 jsr 4d040 <_Thread_Ready> _User_extensions_Thread_restart( the_thread ); 4930a: 2f0a movel %a2,%sp@- 4930c: 4eb9 0004 9b78 jsr 49b78 <_User_extensions_Thread_restart> if ( _Thread_Is_executing ( the_thread ) ) 49312: 4fef 001c lea %sp@(28),%sp 49316: b5f9 0005 ffca cmpal 5ffca <_Thread_Executing>,%a2 4931c: 670a beqs 49328 <_Thread_Restart+0x64> #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( _Thread_Executing->fp_context != NULL ) _Context_Restore_fp( &_Thread_Executing->fp_context ); #endif _CPU_Context_Restart_self( &_Thread_Executing->Registers ); 4931e: 7001 moveq #1,%d0 return true; } return false; } 49320: 246e fffc moveal %fp@(-4),%a2 49324: 4e5e unlk %fp 49326: 4e75 rts */ RTEMS_INLINE_ROUTINE void _Thread_Restart_self( void ) { #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( _Thread_Executing->fp_context != NULL ) 49328: 4aaa 0102 tstl %a2@(258) 4932c: 6712 beqs 49340 <_Thread_Restart+0x7c> _Context_Restore_fp( &_Thread_Executing->fp_context ); 4932e: 486a 0102 pea %a2@(258) 49332: 4eb9 0004 a0e2 jsr 4a0e2 <_CPU_Context_restore_fp> 49338: 2479 0005 ffca moveal 5ffca <_Thread_Executing>,%a2 4933e: 588f addql #4,%sp #endif _CPU_Context_Restart_self( &_Thread_Executing->Registers ); 49340: 486a 00ce pea %a2@(206) 49344: 4eb9 0004 9f8a jsr 49f8a <_CPU_Context_Restart_self> 4934a: 588f addql #4,%sp <== NOT EXECUTED 4934c: 7001 moveq #1,%d0 <== NOT EXECUTED 4934e: 60d0 bras 49320 <_Thread_Restart+0x5c> <== NOT EXECUTED 0004c774 <_Thread_Resume>: { ISR_Level level; States_Control current_state; _ISR_Disable( level ); 4c774: 327c 0700 moveaw #1792,%a1 4c778: 2009 movel %a1,%d0 void _Thread_Resume( Thread_Control *the_thread, bool force ) { 4c77a: 4e56 ffec linkw %fp,#-20 4c77e: 206e 0008 moveal %fp@(8),%a0 4c782: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@ ISR_Level level; States_Control current_state; _ISR_Disable( level ); 4c786: 40c1 movew %sr,%d1 4c788: 8081 orl %d1,%d0 4c78a: 46c0 movew %d0,%sr _ISR_Enable( level ); return; } #endif current_state = the_thread->current_state; 4c78c: 2028 0010 movel %a0@(16),%d0 if ( current_state & STATES_SUSPENDED ) { 4c790: 0800 0001 btst #1,%d0 4c794: 6774 beqs 4c80a <_Thread_Resume+0x96> 4c796: 74fd moveq #-3,%d2 4c798: c082 andl %d2,%d0 current_state = 4c79a: 2140 0010 movel %d0,%a0@(16) the_thread->current_state = _States_Clear(STATES_SUSPENDED, current_state); if ( _States_Is_ready( current_state ) ) { 4c79e: 666a bnes 4c80a <_Thread_Resume+0x96> RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 4c7a0: 2868 008e moveal %a0@(142),%a4 4c7a4: 3028 0094 movew %a0@(148),%d0 4c7a8: 3414 movew %a4@,%d2 _Priority_Add_to_bit_map( &the_thread->Priority_map ); _Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node); 4c7aa: 2468 008a moveal %a0@(138),%a2 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 4c7ae: 260a movel %a2,%d3 4c7b0: 5883 addql #4,%d3 4c7b2: 8082 orl %d2,%d0 4c7b4: 2083 movel %d3,%a0@ old_last_node = the_chain->last; 4c7b6: 266a 0008 moveal %a2@(8),%a3 4c7ba: 3880 movew %d0,%a4@ the_chain->last = the_node; 4c7bc: 2548 0008 movel %a0,%a2@(8) _Priority_Major_bit_map |= the_priority_map->ready_major; 4c7c0: 3439 0006 4c30 movew 64c30 <_Priority_Major_bit_map>,%d2 4c7c6: 3028 0092 movew %a0@(146),%d0 old_last_node->next = the_node; the_node->previous = old_last_node; 4c7ca: 214b 0004 movel %a3,%a0@(4) 4c7ce: 8082 orl %d2,%d0 Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; the_chain->last = the_node; old_last_node->next = the_node; 4c7d0: 2688 movel %a0,%a3@ 4c7d2: 33c0 0006 4c30 movew %d0,64c30 <_Priority_Major_bit_map> _ISR_Flash( level ); 4c7d8: 2009 movel %a1,%d0 4c7da: 46c1 movew %d1,%sr 4c7dc: 8081 orl %d1,%d0 4c7de: 46c0 movew %d0,%sr if ( the_thread->current_priority < _Thread_Heir->current_priority ) { 4c7e0: 2028 0014 movel %a0@(20),%d0 4c7e4: 2279 0006 4c0e moveal 64c0e <_Thread_Heir>,%a1 4c7ea: b0a9 0014 cmpl %a1@(20),%d0 4c7ee: 641a bccs 4c80a <_Thread_Resume+0x96> _Thread_Heir = the_thread; 4c7f0: 23c8 0006 4c0e movel %a0,64c0e <_Thread_Heir> if ( _Thread_Executing->is_preemptible || 4c7f6: 2079 0006 4c3a moveal 64c3a <_Thread_Executing>,%a0 4c7fc: 4a28 0075 tstb %a0@(117) 4c800: 6712 beqs 4c814 <_Thread_Resume+0xa0> the_thread->current_priority == 0 ) _Context_Switch_necessary = true; 4c802: 7001 moveq #1,%d0 4c804: 13c0 0006 4c4a moveb %d0,64c4a <_Context_Switch_necessary> } } } _ISR_Enable( level ); 4c80a: 46c1 movew %d1,%sr } 4c80c: 4cd7 1c0c moveml %sp@,%d2-%d3/%a2-%a4 4c810: 4e5e unlk %fp 4c812: 4e75 rts _ISR_Flash( level ); if ( the_thread->current_priority < _Thread_Heir->current_priority ) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 4c814: 4a80 tstl %d0 4c816: 66f2 bnes 4c80a <_Thread_Resume+0x96> the_thread->current_priority == 0 ) _Context_Switch_necessary = true; 4c818: 7001 moveq #1,%d0 <== NOT EXECUTED 4c81a: 13c0 0006 4c4a moveb %d0,64c4a <_Context_Switch_necessary> <== NOT EXECUTED 4c820: 60e8 bras 4c80a <_Thread_Resume+0x96> <== NOT EXECUTED ... 00048b88 <_Thread_Yield_processor>: * ready chain * select heir */ void _Thread_Yield_processor( void ) { 48b88: 4e56 fff4 linkw %fp,#-12 ISR_Level level; Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; 48b8c: 2079 0005 f032 moveal 5f032 <_Thread_Executing>,%a0 * ready chain * select heir */ void _Thread_Yield_processor( void ) { 48b92: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; ready = executing->ready; _ISR_Disable( level ); 48b96: 243c 0000 0700 movel #1792,%d2 48b9c: 2002 movel %d2,%d0 ISR_Level level; Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; ready = executing->ready; 48b9e: 2268 008a moveal %a0@(138),%a1 _ISR_Disable( level ); 48ba2: 40c1 movew %sr,%d1 48ba4: 8081 orl %d1,%d0 48ba6: 46c0 movew %d0,%sr if ( !_Chain_Has_only_one_node( ready ) ) { 48ba8: 2029 0008 movel %a1@(8),%d0 48bac: b091 cmpl %a1@,%d0 48bae: 6750 beqs 48c00 <_Thread_Yield_processor+0x78> ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 48bb0: 2450 moveal %a0@,%a2 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 48bb2: 2009 movel %a1,%d0 48bb4: 5880 addql #4,%d0 { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 48bb6: 2668 0004 moveal %a0@(4),%a3 next->previous = previous; previous->next = next; 48bba: 268a movel %a2,%a3@ Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 48bbc: 254b 0004 movel %a3,%a2@(4) Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 48bc0: 2080 movel %d0,%a0@ old_last_node = the_chain->last; 48bc2: 2469 0008 moveal %a1@(8),%a2 the_chain->last = the_node; 48bc6: 2348 0008 movel %a0,%a1@(8) old_last_node->next = the_node; the_node->previous = old_last_node; 48bca: 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; 48bce: 2488 movel %a0,%a2@ _Chain_Extract_unprotected( &executing->Object.Node ); _Chain_Append_unprotected( ready, &executing->Object.Node ); _ISR_Flash( level ); 48bd0: 46c1 movew %d1,%sr 48bd2: 8481 orl %d1,%d2 48bd4: 46c2 movew %d2,%sr if ( _Thread_Is_heir( executing ) ) 48bd6: b1f9 0005 f006 cmpal 5f006 <_Thread_Heir>,%a0 48bdc: 6712 beqs 48bf0 <_Thread_Yield_processor+0x68> _Thread_Heir = (Thread_Control *) ready->first; _Context_Switch_necessary = true; } else if ( !_Thread_Is_heir( executing ) ) _Context_Switch_necessary = true; 48bde: 7001 moveq #1,%d0 <== NOT EXECUTED 48be0: 13c0 0005 f042 moveb %d0,5f042 <_Context_Switch_necessary> <== NOT EXECUTED _ISR_Enable( level ); 48be6: 46c1 movew %d1,%sr } 48be8: 4cd7 0c04 moveml %sp@,%d2/%a2-%a3 48bec: 4e5e unlk %fp 48bee: 4e75 rts _Chain_Append_unprotected( ready, &executing->Object.Node ); _ISR_Flash( level ); if ( _Thread_Is_heir( executing ) ) _Thread_Heir = (Thread_Control *) ready->first; 48bf0: 23d1 0005 f006 movel %a1@,5f006 <_Thread_Heir> _Context_Switch_necessary = true; } else if ( !_Thread_Is_heir( executing ) ) _Context_Switch_necessary = true; 48bf6: 7001 moveq #1,%d0 48bf8: 13c0 0005 f042 moveb %d0,5f042 <_Context_Switch_necessary> 48bfe: 60e6 bras 48be6 <_Thread_Yield_processor+0x5e> if ( _Thread_Is_heir( executing ) ) _Thread_Heir = (Thread_Control *) ready->first; _Context_Switch_necessary = true; } else if ( !_Thread_Is_heir( executing ) ) 48c00: b1f9 0005 f006 cmpal 5f006 <_Thread_Heir>,%a0 48c06: 67de beqs 48be6 <_Thread_Yield_processor+0x5e> _Context_Switch_necessary = true; 48c08: 7001 moveq #1,%d0 <== NOT EXECUTED 48c0a: 13c0 0005 f042 moveb %d0,5f042 <_Context_Switch_necessary> <== NOT EXECUTED 48c10: 60d4 bras 48be6 <_Thread_Yield_processor+0x5e> <== NOT EXECUTED ... 00047834 <_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 ) ) { 47834: 7202 moveq #2,%d1 Thread_blocking_operation_States sync_state __attribute__((unused)), #endif Thread_Control *the_thread, ISR_Level level ) { 47836: 4e56 0000 linkw %fp,#0 4783a: 202e 0010 movel %fp@(16),%d0 4783e: 2f0a movel %a2,%sp@- 47840: 246e 000c moveal %fp@(12),%a2 #endif /* * The thread is not waiting on anything after this completes. */ the_thread->Wait.queue = NULL; 47844: 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 ) ) { 47848: b2aa 0050 cmpl %a2@(80),%d1 4784c: 671c beqs 4786a <_Thread_blocking_operation_Cancel+0x36> _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); (void) _Watchdog_Remove( &the_thread->Timer ); } else _ISR_Enable( level ); 4784e: 46c0 movew %d0,%sr RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 47850: 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 } 47854: 246e fffc moveal %fp@(-4),%a2 47858: 203c 1003 fff8 movel #268697592,%d0 4785e: 2d40 000c movel %d0,%fp@(12) 47862: 4e5e unlk %fp 47864: 4ef9 0004 79e8 jmp 479e8 <_Thread_Clear_state> RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 4786a: 123c 0003 moveb #3,%d1 4786e: 2541 0050 movel %d1,%a2@(80) * If the sync state is timed out, this is very likely not needed. * But better safe than sorry when it comes to critical sections. */ if ( _Watchdog_Is_active( &the_thread->Timer ) ) { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 47872: 46c0 movew %d0,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 47874: 486a 0048 pea %a2@(72) 47878: 4eb9 0004 90a4 jsr 490a4 <_Watchdog_Remove> 4787e: 588f addql #4,%sp 47880: 203c 1003 fff8 movel #268697592,%d0 47886: 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 } 4788a: 246e fffc moveal %fp@(-4),%a2 4788e: 2d40 000c movel %d0,%fp@(12) 47892: 4e5e unlk %fp 47894: 4ef9 0004 79e8 jmp 479e8 <_Thread_Clear_state> ... 000483b4 <_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 ) { 483b4: 4e56 ffe4 linkw %fp,#-28 483b8: 48d7 1c3c moveml %d2-%d5/%a2-%a4,%sp@ 483bc: 266e 000c moveal %fp@(12),%a3 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 483c0: 41eb 003c lea %a3@(60),%a0 return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); 483c4: 263c 0000 0700 movel #1792,%d3 Priority_Control priority; States_Control block_state; _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; 483ca: 222b 0014 movel %a3@(20),%d1 header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; 483ce: 2401 movel %d1,%d2 483d0: ec8a lsrl #6,%d2 483d2: 2002 movel %d2,%d0 483d4: e58a lsll #2,%d2 483d6: e988 lsll #4,%d0 Thread_blocking_operation_States _Thread_queue_Enqueue_priority ( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, ISR_Level *level_p ) { 483d8: 286e 0008 moveal %fp@(8),%a4 _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; 483dc: 9082 subl %d2,%d0 483de: 45f4 0800 lea %a4@(00000000,%d0:l),%a2 483e2: 2748 0038 movel %a0,%a3@(56) the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 483e6: 41eb 0038 lea %a3@(56),%a0 block_state = the_thread_queue->state; 483ea: 242c 0038 movel %a4@(56),%d2 483ee: 2748 0040 movel %a0,%a3@(64) RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 483f2: 42ab 003c clrl %a3@(60) if ( _Thread_queue_Is_reverse_search( priority ) ) 483f6: 0801 0005 btst #5,%d1 483fa: 6656 bnes 48452 <_Thread_queue_Enqueue_priority+0x9e> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 483fc: 2a0a movel %a2,%d5 goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); 483fe: 2803 movel %d3,%d4 48400: 5885 addql #4,%d5 48402: 2004 movel %d4,%d0 48404: 40c3 movew %sr,%d3 48406: 8083 orl %d3,%d0 48408: 46c0 movew %d0,%sr search_thread = (Thread_Control *) header->first; 4840a: 2052 moveal %a2@,%a0 while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 4840c: ba88 cmpl %a0,%d5 4840e: 6700 010a beqw 4851a <_Thread_queue_Enqueue_priority+0x166> search_priority = search_thread->current_priority; 48412: 2268 0014 moveal %a0@(20),%a1 if ( priority <= search_priority ) 48416: b3c1 cmpal %d1,%a1 48418: 6418 bccs 48432 <_Thread_queue_Enqueue_priority+0x7e> break; search_priority = search_thread->current_priority; if ( priority <= search_priority ) break; #endif _ISR_Flash( level ); 4841a: 2004 movel %d4,%d0 4841c: 46c3 movew %d3,%sr 4841e: 8083 orl %d3,%d0 48420: 46c0 movew %d0,%sr if ( !_States_Are_set( search_thread->current_state, block_state) ) { 48422: 2002 movel %d2,%d0 48424: c0a8 0010 andl %a0@(16),%d0 48428: 6700 0092 beqw 484bc <_Thread_queue_Enqueue_priority+0x108> _ISR_Enable( level ); goto restart_forward_search; } search_thread = (Thread_Control *)search_thread->Object.Node.next; 4842c: 2050 moveal %a0@,%a0 restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); search_thread = (Thread_Control *) header->first; while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 4842e: ba88 cmpl %a0,%d5 48430: 66e0 bnes 48412 <_Thread_queue_Enqueue_priority+0x5e> 48432: 2403 movel %d3,%d2 } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 48434: 7001 moveq #1,%d0 48436: b0ac 0030 cmpl %a4@(48),%d0 4843a: 6700 0094 beqw 484d0 <_Thread_queue_Enqueue_priority+0x11c> * 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; 4843e: 206e 0010 moveal %fp@(16),%a0 return the_thread_queue->sync_state; 48442: 202c 0030 movel %a4@(48),%d0 * For example, the blocking thread could have been given * the mutex by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ *level_p = level; 48446: 2082 movel %d2,%a0@ return the_thread_queue->sync_state; } 48448: 4cd7 1c3c moveml %sp@,%d2-%d5/%a2-%a4 4844c: 4e5e unlk %fp 4844e: 4e75 rts if ( priority >= search_priority ) break; #endif _ISR_Flash( level ); if ( !_States_Are_set( search_thread->current_state, block_state) ) { _ISR_Enable( level ); 48450: 46c4 movew %d4,%sr the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 48452: 4284 clrl %d4 48454: 1839 0005 d7c2 moveb 5d7c2 ,%d4 _ISR_Disable( level ); 4845a: 2003 movel %d3,%d0 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 4845c: 2244 moveal %d4,%a1 4845e: 5289 addql #1,%a1 _ISR_Disable( level ); 48460: 40c4 movew %sr,%d4 48462: 8084 orl %d4,%d0 48464: 46c0 movew %d0,%sr search_thread = (Thread_Control *) header->last; 48466: 206a 0008 moveal %a2@(8),%a0 while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 4846a: b5c8 cmpal %a0,%a2 4846c: 6720 beqs 4848e <_Thread_queue_Enqueue_priority+0xda> search_priority = search_thread->current_priority; 4846e: 2268 0014 moveal %a0@(20),%a1 if ( priority >= search_priority ) 48472: b3c1 cmpal %d1,%a1 48474: 6318 blss 4848e <_Thread_queue_Enqueue_priority+0xda> break; search_priority = search_thread->current_priority; if ( priority >= search_priority ) break; #endif _ISR_Flash( level ); 48476: 2003 movel %d3,%d0 48478: 46c4 movew %d4,%sr 4847a: 8084 orl %d4,%d0 4847c: 46c0 movew %d0,%sr if ( !_States_Are_set( search_thread->current_state, block_state) ) { 4847e: 2002 movel %d2,%d0 48480: c0a8 0010 andl %a0@(16),%d0 48484: 67ca beqs 48450 <_Thread_queue_Enqueue_priority+0x9c> _ISR_Enable( level ); goto restart_reverse_search; } search_thread = (Thread_Control *) 48486: 2068 0004 moveal %a0@(4),%a0 restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); search_thread = (Thread_Control *) header->last; while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 4848a: b5c8 cmpal %a0,%a2 4848c: 66e0 bnes 4846e <_Thread_queue_Enqueue_priority+0xba> 4848e: 2404 movel %d4,%d2 } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 48490: 7001 moveq #1,%d0 48492: b0ac 0030 cmpl %a4@(48),%d0 48496: 66a6 bnes 4843e <_Thread_queue_Enqueue_priority+0x8a> THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 48498: 42ac 0030 clrl %a4@(48) if ( priority == search_priority ) 4849c: b3c1 cmpal %d1,%a1 4849e: 6756 beqs 484f6 <_Thread_queue_Enqueue_priority+0x142> goto equal_priority; search_node = (Chain_Node *) search_thread; next_node = search_node->next; 484a0: 2250 moveal %a0@,%a1 the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; 484a2: 2748 0004 movel %a0,%a3@(4) search_node = (Chain_Node *) search_thread; next_node = search_node->next; the_node = (Chain_Node *) the_thread; the_node->next = next_node; 484a6: 2689 movel %a1,%a3@ the_node->previous = search_node; search_node->next = the_node; next_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 484a8: 274c 0044 movel %a4,%a3@(68) next_node = search_node->next; the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; search_node->next = the_node; 484ac: 208b movel %a3,%a0@ next_node->previous = the_node; 484ae: 234b 0004 movel %a3,%a1@(4) the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 484b2: 46c4 movew %d4,%sr * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; } 484b4: 4cd7 1c3c moveml %sp@,%d2-%d5/%a2-%a4 484b8: 4e5e unlk %fp 484ba: 4e75 rts if ( priority <= search_priority ) break; #endif _ISR_Flash( level ); if ( !_States_Are_set( search_thread->current_state, block_state) ) { _ISR_Enable( level ); 484bc: 46c3 movew %d3,%sr <== NOT EXECUTED if ( _Thread_queue_Is_reverse_search( priority ) ) goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); 484be: 2004 movel %d4,%d0 <== NOT EXECUTED 484c0: 40c3 movew %sr,%d3 <== NOT EXECUTED 484c2: 8083 orl %d3,%d0 <== NOT EXECUTED 484c4: 46c0 movew %d0,%sr <== NOT EXECUTED search_thread = (Thread_Control *) header->first; 484c6: 2052 moveal %a2@,%a0 <== NOT EXECUTED while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 484c8: ba88 cmpl %a0,%d5 <== NOT EXECUTED 484ca: 6600 ff46 bnew 48412 <_Thread_queue_Enqueue_priority+0x5e><== NOT EXECUTED 484ce: 604a bras 4851a <_Thread_queue_Enqueue_priority+0x166><== NOT EXECUTED if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 484d0: 42ac 0030 clrl %a4@(48) if ( priority == search_priority ) 484d4: b3c1 cmpal %d1,%a1 484d6: 671e beqs 484f6 <_Thread_queue_Enqueue_priority+0x142> goto equal_priority; search_node = (Chain_Node *) search_thread; previous_node = search_node->previous; 484d8: 2268 0004 moveal %a0@(4),%a1 the_node = (Chain_Node *) the_thread; the_node->next = search_node; 484dc: 2688 movel %a0,%a3@ the_node->previous = previous_node; 484de: 2749 0004 movel %a1,%a3@(4) previous_node->next = the_node; search_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 484e2: 274c 0044 movel %a4,%a3@(68) previous_node = search_node->previous; the_node = (Chain_Node *) the_thread; the_node->next = search_node; the_node->previous = previous_node; previous_node->next = the_node; 484e6: 228b movel %a3,%a1@ search_node->previous = the_node; 484e8: 214b 0004 movel %a3,%a0@(4) the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 484ec: 46c3 movew %d3,%sr * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; } 484ee: 4cd7 1c3c moveml %sp@,%d2-%d5/%a2-%a4 484f2: 4e5e unlk %fp 484f4: 4e75 rts 484f6: 41e8 003c lea %a0@(60),%a0 _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; equal_priority: /* add at end of priority group */ search_node = _Chain_Tail( &search_thread->Wait.Block2n ); previous_node = search_node->previous; 484fa: 2268 0004 moveal %a0@(4),%a1 the_node = (Chain_Node *) the_thread; the_node->next = search_node; 484fe: 2688 movel %a0,%a3@ the_node->previous = previous_node; 48500: 2749 0004 movel %a1,%a3@(4) previous_node->next = the_node; search_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 48504: 274c 0044 movel %a4,%a3@(68) previous_node = search_node->previous; the_node = (Chain_Node *) the_thread; the_node->next = search_node; the_node->previous = previous_node; previous_node->next = the_node; 48508: 228b movel %a3,%a1@ search_node->previous = the_node; 4850a: 214b 0004 movel %a3,%a0@(4) the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 4850e: 46c2 movew %d2,%sr 48510: 7001 moveq #1,%d0 * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; } 48512: 4cd7 1c3c moveml %sp@,%d2-%d5/%a2-%a4 48516: 4e5e unlk %fp 48518: 4e75 rts restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); search_thread = (Thread_Control *) header->first; while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 4851a: 2403 movel %d3,%d2 4851c: 327c ffff moveaw #-1,%a1 } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 48520: 7001 moveq #1,%d0 48522: b0ac 0030 cmpl %a4@(48),%d0 48526: 6600 ff16 bnew 4843e <_Thread_queue_Enqueue_priority+0x8a> 4852a: 60a4 bras 484d0 <_Thread_queue_Enqueue_priority+0x11c> 00048318 <_Thread_queue_Enqueue_with_handler>: void _Thread_queue_Enqueue_with_handler( Thread_queue_Control *the_thread_queue, Watchdog_Interval timeout, Thread_queue_Timeout_callout handler ) { 48318: 4e56 fff0 linkw %fp,#-16 4831c: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 48320: 266e 0008 moveal %fp@(8),%a3 else #endif /* * Set the blocking state for this thread queue in the thread. */ _Thread_Set_state( the_thread, the_thread_queue->state ); 48324: 2f2b 0038 movel %a3@(56),%sp@- Thread_queue_Control *, Thread_Control *, ISR_Level * ); the_thread = _Thread_Executing; 48328: 2479 0005 f032 moveal 5f032 <_Thread_Executing>,%a2 void _Thread_queue_Enqueue_with_handler( Thread_queue_Control *the_thread_queue, Watchdog_Interval timeout, Thread_queue_Timeout_callout handler ) { 4832e: 242e 000c movel %fp@(12),%d2 else #endif /* * Set the blocking state for this thread queue in the thread. */ _Thread_Set_state( the_thread, the_thread_queue->state ); 48332: 2f0a movel %a2,%sp@- 48334: 4eb9 0004 8720 jsr 48720 <_Thread_Set_state> /* * If the thread wants to timeout, then schedule its timer. */ if ( timeout ) { 4833a: 508f addql #8,%sp 4833c: 4a82 tstl %d2 4833e: 6644 bnes 48384 <_Thread_queue_Enqueue_with_handler+0x6c> } /* * Now enqueue the thread per the discipline for this thread queue. */ if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) 48340: 41f9 0004 83b4 lea 483b4 <_Thread_queue_Enqueue_priority>,%a0 48346: 7001 moveq #1,%d0 48348: b0ab 0034 cmpl %a3@(52),%d0 4834c: 6706 beqs 48354 <_Thread_queue_Enqueue_with_handler+0x3c> 4834e: 41f9 0004 c190 lea 4c190 <_Thread_queue_Enqueue_fifo>,%a0 enqueue_p = _Thread_queue_Enqueue_priority; else /* must be THREAD_QUEUE_DISCIPLINE_FIFO */ enqueue_p = _Thread_queue_Enqueue_fifo; sync_state = (*enqueue_p)( the_thread_queue, the_thread, &level ); 48354: 486e fffc pea %fp@(-4) 48358: 2f0a movel %a2,%sp@- 4835a: 2f0b movel %a3,%sp@- 4835c: 4e90 jsr %a0@ if ( sync_state != THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 4835e: 4fef 000c lea %sp@(12),%sp 48362: 7201 moveq #1,%d1 48364: b280 cmpl %d0,%d1 48366: 6712 beqs 4837a <_Thread_queue_Enqueue_with_handler+0x62> _Thread_blocking_operation_Cancel( sync_state, the_thread, level ); 48368: 2f2e fffc movel %fp@(-4),%sp@- 4836c: 2f0a movel %a2,%sp@- 4836e: 2f00 movel %d0,%sp@- 48370: 4eb9 0004 7834 jsr 47834 <_Thread_blocking_operation_Cancel> 48376: 4fef 000c lea %sp@(12),%sp } 4837a: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3 48380: 4e5e unlk %fp 48382: 4e75 rts /* * If the thread wants to timeout, then schedule its timer. */ if ( timeout ) { _Watchdog_Initialize( 48384: 202a 0008 movel %a2@(8),%d0 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 48388: 256e 0010 0064 movel %fp@(16),%a2@(100) the_watchdog->id = id; 4838e: 2540 0068 movel %d0,%a2@(104) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 48392: 2542 0054 movel %d2,%a2@(84) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 48396: 42aa 0050 clrl %a2@(80) the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 4839a: 42aa 006c clrl %a2@(108) ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 4839e: 486a 0048 pea %a2@(72) 483a2: 4879 0005 f050 pea 5f050 <_Watchdog_Ticks_chain> 483a8: 4eb9 0004 8f5c jsr 48f5c <_Watchdog_Insert> 483ae: 508f addql #8,%sp 483b0: 608e bras 48340 <_Thread_queue_Enqueue_with_handler+0x28> ... 0004e0e8 <_Thread_queue_Extract_fifo>: Thread_Control *the_thread ) { ISR_Level level; _ISR_Disable( level ); 4e0e8: 203c 0000 0700 movel #1792,%d0 void _Thread_queue_Extract_fifo( Thread_queue_Control *the_thread_queue __attribute__((unused)), Thread_Control *the_thread ) { 4e0ee: 4e56 0000 linkw %fp,#0 4e0f2: 2f0a movel %a2,%sp@- 4e0f4: 246e 000c moveal %fp@(12),%a2 ISR_Level level; _ISR_Disable( level ); 4e0f8: 40c1 movew %sr,%d1 4e0fa: 8081 orl %d1,%d0 4e0fc: 46c0 movew %d0,%sr if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 4e0fe: 202a 0010 movel %a2@(16),%d0 4e102: 0280 0003 bee0 andil #245472,%d0 4e108: 6734 beqs 4e13e <_Thread_queue_Extract_fifo+0x56> ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 4e10a: 2052 moveal %a2@,%a0 _Chain_Extract_unprotected( &the_thread->Object.Node ); the_thread->Wait.queue = NULL; if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 4e10c: 7002 moveq #2,%d0 previous = the_node->previous; 4e10e: 226a 0004 moveal %a2@(4),%a1 return; } _Chain_Extract_unprotected( &the_thread->Object.Node ); the_thread->Wait.queue = NULL; 4e112: 42aa 0044 clrl %a2@(68) next->previous = previous; previous->next = next; 4e116: 2288 movel %a0,%a1@ Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 4e118: 2149 0004 movel %a1,%a0@(4) if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 4e11c: b0aa 0050 cmpl %a2@(80),%d0 4e120: 6726 beqs 4e148 <_Thread_queue_Extract_fifo+0x60> _ISR_Enable( level ); 4e122: 46c1 movew %d1,%sr RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 4e124: 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 } 4e128: 246e fffc moveal %fp@(-4),%a2 4e12c: 203c 1003 fff8 movel #268697592,%d0 4e132: 2d40 000c movel %d0,%fp@(12) 4e136: 4e5e unlk %fp 4e138: 4ef9 0004 79e8 jmp 479e8 <_Thread_Clear_state> ISR_Level level; _ISR_Disable( level ); if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { _ISR_Enable( level ); 4e13e: 46c1 movew %d1,%sr #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); #endif } 4e140: 246e fffc moveal %fp@(-4),%a2 4e144: 4e5e unlk %fp 4e146: 4e75 rts 4e148: 7003 moveq #3,%d0 4e14a: 2540 0050 movel %d0,%a2@(80) if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { _ISR_Enable( level ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 4e14e: 46c1 movew %d1,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 4e150: 486a 0048 pea %a2@(72) 4e154: 4eb9 0004 90a4 jsr 490a4 <_Watchdog_Remove> 4e15a: 588f addql #4,%sp 4e15c: 203c 1003 fff8 movel #268697592,%d0 4e162: 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 } 4e166: 246e fffc moveal %fp@(-4),%a2 4e16a: 2d40 000c movel %d0,%fp@(12) 4e16e: 4e5e unlk %fp 4e170: 4ef9 0004 79e8 jmp 479e8 <_Thread_Clear_state> ... 0004c224 <_Thread_queue_Extract_priority_helper>: Chain_Node *new_first_node; Chain_Node *new_second_node; Chain_Node *last_node; the_node = (Chain_Node *) the_thread; _ISR_Disable( level ); 4c224: 203c 0000 0700 movel #1792,%d0 void _Thread_queue_Extract_priority_helper( Thread_queue_Control *the_thread_queue __attribute__((unused)), Thread_Control *the_thread, bool requeuing ) { 4c22a: 4e56 ffec linkw %fp,#-20 4c22e: 48d7 3c04 moveml %d2/%a2-%a5,%sp@ 4c232: 246e 000c moveal %fp@(12),%a2 4c236: 142e 0013 moveb %fp@(19),%d2 Chain_Node *new_first_node; Chain_Node *new_second_node; Chain_Node *last_node; the_node = (Chain_Node *) the_thread; _ISR_Disable( level ); 4c23a: 40c1 movew %sr,%d1 4c23c: 8081 orl %d1,%d0 4c23e: 46c0 movew %d0,%sr if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 4c240: 202a 0010 movel %a2@(16),%d0 4c244: 0280 0003 bee0 andil #245472,%d0 4c24a: 677e beqs 4c2ca <_Thread_queue_Extract_priority_helper+0xa6> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4c24c: 200a movel %a2,%d0 4c24e: 0680 0000 003c addil #60,%d0 /* * The thread was actually waiting on a thread queue so let's remove it. */ next_node = the_node->next; 4c254: 2652 moveal %a2@,%a3 previous_node = the_node->previous; 4c256: 226a 0004 moveal %a2@(4),%a1 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 4c25a: 206a 0038 moveal %a2@(56),%a0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4c25e: b088 cmpl %a0,%d0 4c260: 6774 beqs 4c2d6 <_Thread_queue_Extract_priority_helper+0xb2> if ( !_Chain_Is_empty( &the_thread->Wait.Block2n ) ) { new_first_node = the_thread->Wait.Block2n.first; new_first_thread = (Thread_Control *) new_first_node; last_node = the_thread->Wait.Block2n.last; 4c262: 286a 0040 moveal %a2@(64),%a4 new_second_node = new_first_node->next; 4c266: 2a50 moveal %a0@,%a5 previous_node->next = new_first_node; next_node->previous = new_first_node; 4c268: 2748 0004 movel %a0,%a3@(4) new_first_node = the_thread->Wait.Block2n.first; new_first_thread = (Thread_Control *) new_first_node; last_node = the_thread->Wait.Block2n.last; new_second_node = new_first_node->next; previous_node->next = new_first_node; 4c26c: 2288 movel %a0,%a1@ next_node->previous = new_first_node; new_first_node->next = next_node; new_first_node->previous = previous_node; 4c26e: 2149 0004 movel %a1,%a0@(4) last_node = the_thread->Wait.Block2n.last; new_second_node = new_first_node->next; previous_node->next = new_first_node; next_node->previous = new_first_node; new_first_node->next = next_node; 4c272: 208b movel %a3,%a0@ new_first_node->previous = previous_node; if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) { 4c274: 202a 0040 movel %a2@(64),%d0 4c278: b0aa 0038 cmpl %a2@(56),%d0 4c27c: 6716 beqs 4c294 <_Thread_queue_Extract_priority_helper+0x70> /* > two threads on 2-n */ new_second_node->previous = 4c27e: 43e8 0038 lea %a0@(56),%a1 4c282: 2b49 0004 movel %a1,%a5@(4) _Chain_Head( &new_first_thread->Wait.Block2n ); new_first_thread->Wait.Block2n.first = new_second_node; 4c286: 214d 0038 movel %a5,%a0@(56) new_first_thread->Wait.Block2n.last = last_node; 4c28a: 214c 0040 movel %a4,%a0@(64) last_node->next = _Chain_Tail( &new_first_thread->Wait.Block2n ); 4c28e: 41e8 003c lea %a0@(60),%a0 4c292: 2888 movel %a0,%a4@ /* * If we are not supposed to touch timers or the thread's state, return. */ if ( requeuing ) { 4c294: 4a02 tstb %d2 4c296: 6626 bnes 4c2be <_Thread_queue_Extract_priority_helper+0x9a> _ISR_Enable( level ); return; } if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 4c298: 7002 moveq #2,%d0 4c29a: b0aa 0050 cmpl %a2@(80),%d0 4c29e: 6742 beqs 4c2e2 <_Thread_queue_Extract_priority_helper+0xbe> _ISR_Enable( level ); 4c2a0: 46c1 movew %d1,%sr 4c2a2: 2d4a 0008 movel %a2,%fp@(8) 4c2a6: 227c 1003 fff8 moveal #268697592,%a1 #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); #endif } 4c2ac: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 4c2b2: 2d49 000c movel %a1,%fp@(12) 4c2b6: 4e5e unlk %fp 4c2b8: 4ef9 0004 79e8 jmp 479e8 <_Thread_Clear_state> /* * If we are not supposed to touch timers or the thread's state, return. */ if ( requeuing ) { _ISR_Enable( level ); 4c2be: 46c1 movew %d1,%sr #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); #endif } 4c2c0: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 4c2c6: 4e5e unlk %fp 4c2c8: 4e75 rts Chain_Node *last_node; the_node = (Chain_Node *) the_thread; _ISR_Disable( level ); if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { _ISR_Enable( level ); 4c2ca: 46c1 movew %d1,%sr #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); #endif } 4c2cc: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 4c2d2: 4e5e unlk %fp 4c2d4: 4e75 rts new_first_thread->Wait.Block2n.last = last_node; last_node->next = _Chain_Tail( &new_first_thread->Wait.Block2n ); } } else { previous_node->next = next_node; next_node->previous = previous_node; 4c2d6: 2749 0004 movel %a1,%a3@(4) new_first_thread->Wait.Block2n.last = last_node; last_node->next = _Chain_Tail( &new_first_thread->Wait.Block2n ); } } else { previous_node->next = next_node; 4c2da: 228b movel %a3,%a1@ /* * If we are not supposed to touch timers or the thread's state, return. */ if ( requeuing ) { 4c2dc: 4a02 tstb %d2 4c2de: 67b8 beqs 4c298 <_Thread_queue_Extract_priority_helper+0x74> 4c2e0: 60dc bras 4c2be <_Thread_queue_Extract_priority_helper+0x9a> 4c2e2: 7003 moveq #3,%d0 4c2e4: 2540 0050 movel %d0,%a2@(80) if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { _ISR_Enable( level ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 4c2e8: 46c1 movew %d1,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 4c2ea: 486a 0048 pea %a2@(72) 4c2ee: 4eb9 0004 90a4 jsr 490a4 <_Watchdog_Remove> 4c2f4: 588f addql #4,%sp 4c2f6: 227c 1003 fff8 moveal #268697592,%a1 4c2fc: 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 } 4c300: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 4c306: 2d49 000c movel %a1,%fp@(12) 4c30a: 4e5e unlk %fp 4c30c: 4ef9 0004 79e8 jmp 479e8 <_Thread_Clear_state> ... 00048594 <_Thread_queue_Initialize>: the_thread_queue->state = state; the_thread_queue->discipline = the_discipline; the_thread_queue->timeout_status = timeout_status; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( the_discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) { 48594: 7201 moveq #1,%d1 Thread_queue_Control *the_thread_queue, Thread_queue_Disciplines the_discipline, States_Control state, uint32_t timeout_status ) { 48596: 4e56 0000 linkw %fp,#0 4859a: 206e 0008 moveal %fp@(8),%a0 the_thread_queue->state = state; 4859e: 216e 0010 0038 movel %fp@(16),%a0@(56) Thread_queue_Control *the_thread_queue, Thread_queue_Disciplines the_discipline, States_Control state, uint32_t timeout_status ) { 485a4: 202e 000c movel %fp@(12),%d0 the_thread_queue->state = state; the_thread_queue->discipline = the_discipline; the_thread_queue->timeout_status = timeout_status; 485a8: 216e 0014 003c movel %fp@(20),%a0@(60) States_Control state, uint32_t timeout_status ) { the_thread_queue->state = state; the_thread_queue->discipline = the_discipline; 485ae: 2140 0034 movel %d0,%a0@(52) the_thread_queue->timeout_status = timeout_status; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 485b2: 42a8 0030 clrl %a0@(48) if ( the_discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) { 485b6: b280 cmpl %d0,%d1 485b8: 6712 beqs 485cc <_Thread_queue_Initialize+0x38> */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 485ba: 2008 movel %a0,%d0 485bc: 5880 addql #4,%d0 the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 485be: 2148 0008 movel %a0,%a0@(8) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 485c2: 2080 movel %d0,%a0@ the_chain->permanent_null = NULL; 485c4: 42a8 0004 clrl %a0@(4) _Chain_Initialize_empty( &the_thread_queue->Queues.Priority[index] ); } else { /* must be THREAD_QUEUE_DISCIPLINE_FIFO */ _Chain_Initialize_empty( &the_thread_queue->Queues.Fifo ); } } 485c8: 4e5e unlk %fp 485ca: 4e75 rts * timeout_status - return on a timeout * * Output parameters: NONE */ void _Thread_queue_Initialize( 485cc: 2008 movel %a0,%d0 485ce: 0680 0000 0030 addil #48,%d0 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 485d4: 2208 movel %a0,%d1 485d6: 5881 addql #4,%d1 the_chain->permanent_null = NULL; 485d8: 42a8 0004 clrl %a0@(4) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 485dc: 2081 movel %d1,%a0@ the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 485de: 2148 0008 movel %a0,%a0@(8) 485e2: 41e8 000c lea %a0@(12),%a0 the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( the_discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) { uint32_t index; for( index=0 ; 485e6: b088 cmpl %a0,%d0 485e8: 67de beqs 485c8 <_Thread_queue_Initialize+0x34> */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 485ea: 2208 movel %a0,%d1 485ec: 5881 addql #4,%d1 the_chain->permanent_null = NULL; 485ee: 42a8 0004 clrl %a0@(4) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 485f2: 2081 movel %d1,%a0@ the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 485f4: 2148 0008 movel %a0,%a0@(8) 485f8: 41e8 000c lea %a0@(12),%a0 485fc: b088 cmpl %a0,%d0 485fe: 66d4 bnes 485d4 <_Thread_queue_Initialize+0x40> 48600: 60c6 bras 485c8 <_Thread_queue_Initialize+0x34> ... 00048604 <_Thread_queue_Requeue>: void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { 48604: 4e56 fff0 linkw %fp,#-16 48608: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 4860c: 246e 0008 moveal %fp@(8),%a2 48610: 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 ) 48614: 4a8a tstl %a2 48616: 6708 beqs 48620 <_Thread_queue_Requeue+0x1c> /* * 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 ) { 48618: 7001 moveq #1,%d0 4861a: b0aa 0034 cmpl %a2@(52),%d0 4861e: 670a beqs 4862a <_Thread_queue_Requeue+0x26> _Thread_queue_Extract_priority_helper( tq, the_thread, true ); (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); } _ISR_Enable( level ); } } 48620: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3 <== NOT EXECUTED 48626: 4e5e unlk %fp <== NOT EXECUTED 48628: 4e75 rts <== NOT EXECUTED if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) { Thread_queue_Control *tq = the_thread_queue; ISR_Level level; ISR_Level level_ignored; _ISR_Disable( level ); 4862a: 303c 0700 movew #1792,%d0 4862e: 40c2 movew %sr,%d2 48630: 8082 orl %d2,%d0 48632: 46c0 movew %d0,%sr if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 48634: 202b 0010 movel %a3@(16),%d0 48638: 0280 0003 bee0 andil #245472,%d0 4863e: 660c bnes 4864c <_Thread_queue_Requeue+0x48> _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); } _ISR_Enable( level ); 48640: 46c2 movew %d2,%sr <== NOT EXECUTED } } 48642: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3 48648: 4e5e unlk %fp 4864a: 4e75 rts ISR_Level level_ignored; _ISR_Disable( level ); if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); 4864c: 4878 0001 pea 1 48650: 7001 moveq #1,%d0 48652: 2f0b movel %a3,%sp@- 48654: 2540 0030 movel %d0,%a2@(48) 48658: 2f0a movel %a2,%sp@- 4865a: 4eb9 0004 c224 jsr 4c224 <_Thread_queue_Extract_priority_helper> (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); 48660: 486e fffc pea %fp@(-4) 48664: 2f0b movel %a3,%sp@- 48666: 2f0a movel %a2,%sp@- 48668: 4eb9 0004 83b4 jsr 483b4 <_Thread_queue_Enqueue_priority> 4866e: 4fef 0018 lea %sp@(24),%sp } _ISR_Enable( level ); 48672: 46c2 movew %d2,%sr 48674: 60cc bras 48642 <_Thread_queue_Requeue+0x3e> ... 0005944c <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 5944c: 4e56 ffb0 linkw %fp,#-80 59450: 41ee ffec lea %fp@(-20),%a0 59454: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 59458: 246e 0008 moveal %fp@(8),%a2 5945c: 2c0e movel %fp,%d6 5945e: 260e movel %fp,%d3 59460: 5186 subql #8,%d6 59462: 0683 ffff ffe8 addil #-24,%d3 */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 59468: 240a movel %a2,%d2 /* * This path is for normal forward movement and cases where the * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 5946a: 2a0a movel %a2,%d5 5946c: 4bf9 0005 d70c lea 5d70c <_Watchdog_Adjust_to_chain>,%a5 */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 59472: 0682 0000 0030 addil #48,%d2 /* * This path is for normal forward movement and cases where the * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 59478: 0685 0000 0068 addil #104,%d5 5947e: 47f9 0005 9f08 lea 59f08 <_Chain_Get>,%a3 59484: 49f9 0005 d79c lea 5d79c <_Watchdog_Insert>,%a4 * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); 5948a: 283c 0000 0700 movel #1792,%d4 59490: 2d48 ffd8 movel %a0,%fp@(-40) static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 59494: 41ea 0008 lea %a2@(8),%a0 59498: 2d48 ffe0 movel %a0,%fp@(-32) static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 5949c: 41ea 0040 lea %a2@(64),%a0 594a0: 2d48 ffe4 movel %a0,%fp@(-28) Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 594a4: 41ee fff4 lea %fp@(-12),%a0 594a8: 2d48 fffc movel %a0,%fp@(-4) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 594ac: 41ee ffec lea %fp@(-20),%a0 594b0: 2d46 fff4 movel %d6,%fp@(-12) the_chain->permanent_null = NULL; 594b4: 42ae fff8 clrl %fp@(-8) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 594b8: 2d48 ffe8 movel %a0,%fp@(-24) the_chain->permanent_null = NULL; 594bc: 42ae ffec clrl %fp@(-20) the_chain->last = _Chain_Head(the_chain); 594c0: 2d43 fff0 movel %d3,%fp@(-16) { /* * Afterwards all timer inserts are directed to this chain and the interval * and TOD chains will be no more modified by other parties. */ ts->insert_chain = insert_chain; 594c4: 41ee fff4 lea %fp@(-12),%a0 594c8: 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; 594cc: 2039 0007 e910 movel 7e910 <_Watchdog_Ticks_since_boot>,%d0 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 594d2: 222a 003c movel %a2@(60),%d1 watchdogs->last_snapshot = snapshot; 594d6: 2540 003c movel %d0,%a2@(60) _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 594da: 9081 subl %d1,%d0 594dc: 2f03 movel %d3,%sp@- 594de: 2f00 movel %d0,%sp@- 594e0: 2f02 movel %d2,%sp@- 594e2: 4e95 jsr %a5@ static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 594e4: 2039 0007 e85e movel 7e85e <_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 ) { 594ea: 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; 594ee: 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 ) { 594f2: b280 cmpl %d0,%d1 594f4: 6500 0086 bcsw 5957c <_Timer_server_Body+0x130> * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); } else if ( snapshot < last_snapshot ) { 594f8: b280 cmpl %d0,%d1 594fa: 6200 00a4 bhiw 595a0 <_Timer_server_Body+0x154> */ delta = last_snapshot - snapshot; _Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta ); } watchdogs->last_snapshot = snapshot; 594fe: 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 ); 59502: 202a 0078 movel %a2@(120),%d0 59506: 2f00 movel %d0,%sp@- 59508: 4e93 jsr %a3@ if ( timer == NULL ) { 5950a: 588f addql #4,%sp 5950c: 4a80 tstl %d0 5950e: 672e beqs 5953e <_Timer_server_Body+0xf2> static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 59510: 2040 moveal %d0,%a0 59512: 7e01 moveq #1,%d7 59514: 2228 0038 movel %a0@(56),%d1 59518: be81 cmpl %d1,%d7 5951a: 6700 00a8 beqw 595c4 <_Timer_server_Body+0x178> _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 5951e: 7e03 moveq #3,%d7 59520: be81 cmpl %d1,%d7 59522: 66de bnes 59502 <_Timer_server_Body+0xb6> _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 59524: 2040 moveal %d0,%a0 59526: 4868 0010 pea %a0@(16) 5952a: 2f05 movel %d5,%sp@- 5952c: 4e94 jsr %a4@ } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 5952e: 202a 0078 movel %a2@(120),%d0 ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 59532: 508f addql #8,%sp } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 59534: 2f00 movel %d0,%sp@- 59536: 4e93 jsr %a3@ if ( timer == NULL ) { 59538: 588f addql #4,%sp 5953a: 4a80 tstl %d0 5953c: 66d2 bnes 59510 <_Timer_server_Body+0xc4> * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); 5953e: 2004 movel %d4,%d0 59540: 40c1 movew %sr,%d1 59542: 8081 orl %d1,%d0 59544: 46c0 movew %d0,%sr if ( _Chain_Is_empty( insert_chain ) ) { 59546: bcae fff4 cmpl %fp@(-12),%d6 5954a: 6700 0086 beqw 595d2 <_Timer_server_Body+0x186> ts->insert_chain = NULL; _ISR_Enable( level ); break; } else { _ISR_Enable( level ); 5954e: 46c1 movew %d1,%sr <== NOT EXECUTED static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 59550: 2039 0007 e910 movel 7e910 <_Watchdog_Ticks_since_boot>,%d0<== NOT EXECUTED /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 59556: 222a 003c movel %a2@(60),%d1 <== NOT EXECUTED watchdogs->last_snapshot = snapshot; 5955a: 2540 003c movel %d0,%a2@(60) <== NOT EXECUTED _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 5955e: 9081 subl %d1,%d0 <== NOT EXECUTED 59560: 2f03 movel %d3,%sp@- <== NOT EXECUTED 59562: 2f00 movel %d0,%sp@- <== NOT EXECUTED 59564: 2f02 movel %d2,%sp@- <== NOT EXECUTED 59566: 4e95 jsr %a5@ <== NOT EXECUTED static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 59568: 2039 0007 e85e movel 7e85e <_TOD_Now>,%d0 <== NOT EXECUTED /* * Process the seconds chain. Start by checking that the Time * of Day (TOD) has not been set backwards. If it has then * we want to adjust the watchdogs->Chain to indicate this. */ if ( snapshot > last_snapshot ) { 5956e: 4fef 000c lea %sp@(12),%sp <== NOT EXECUTED Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); Watchdog_Interval last_snapshot = watchdogs->last_snapshot; 59572: 222a 0074 movel %a2@(116),%d1 <== NOT EXECUTED /* * Process the seconds chain. Start by checking that the Time * of Day (TOD) has not been set backwards. If it has then * we want to adjust the watchdogs->Chain to indicate this. */ if ( snapshot > last_snapshot ) { 59576: b280 cmpl %d0,%d1 <== NOT EXECUTED 59578: 6400 ff7e bccw 594f8 <_Timer_server_Body+0xac> <== NOT EXECUTED /* * This path is for normal forward movement and cases where the * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 5957c: 2f03 movel %d3,%sp@- 5957e: 2e00 movel %d0,%d7 59580: 9e81 subl %d1,%d7 59582: 2f07 movel %d7,%sp@- 59584: 2d40 ffdc movel %d0,%fp@(-36) 59588: 2f05 movel %d5,%sp@- 5958a: 4eb9 0005 d70c jsr 5d70c <_Watchdog_Adjust_to_chain> 59590: 202e ffdc movel %fp@(-36),%d0 59594: 4fef 000c lea %sp@(12),%sp */ delta = last_snapshot - snapshot; _Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta ); } watchdogs->last_snapshot = snapshot; 59598: 2540 0074 movel %d0,%a2@(116) 5959c: 6000 ff64 braw 59502 <_Timer_server_Body+0xb6> /* * 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 ); 595a0: 9280 subl %d0,%d1 595a2: 2f01 movel %d1,%sp@- 595a4: 4878 0001 pea 1 595a8: 2d40 ffdc movel %d0,%fp@(-36) 595ac: 2f05 movel %d5,%sp@- 595ae: 4eb9 0005 d678 jsr 5d678 <_Watchdog_Adjust> 595b4: 202e ffdc movel %fp@(-36),%d0 595b8: 4fef 000c lea %sp@(12),%sp } watchdogs->last_snapshot = snapshot; 595bc: 2540 0074 movel %d0,%a2@(116) 595c0: 6000 ff40 braw 59502 <_Timer_server_Body+0xb6> Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 595c4: 4868 0010 pea %a0@(16) 595c8: 2f02 movel %d2,%sp@- 595ca: 4e94 jsr %a4@ 595cc: 508f addql #8,%sp 595ce: 6000 ff32 braw 59502 <_Timer_server_Body+0xb6> */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); if ( _Chain_Is_empty( insert_chain ) ) { ts->insert_chain = NULL; 595d2: 42aa 0078 clrl %a2@(120) _ISR_Enable( level ); 595d6: 46c1 movew %d1,%sr _Chain_Initialize_empty( &fire_chain ); while ( true ) { _Timer_server_Get_watchdogs_that_fire_now( ts, &insert_chain, &fire_chain ); if ( !_Chain_Is_empty( &fire_chain ) ) { 595d8: 202e ffd8 movel %fp@(-40),%d0 595dc: b0ae ffe8 cmpl %fp@(-24),%d0 595e0: 6752 beqs 59634 <_Timer_server_Body+0x1e8> /* * It is essential that interrupts are disable here since an interrupt * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); 595e2: 2204 movel %d4,%d1 595e4: 40c0 movew %sr,%d0 595e6: 8280 orl %d0,%d1 595e8: 46c1 movew %d1,%sr */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 595ea: 206e ffe8 moveal %fp@(-24),%a0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 595ee: b1ee ffd8 cmpal %fp@(-40),%a0 595f2: 6732 beqs 59626 <_Timer_server_Body+0x1da> { Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; 595f4: 2250 moveal %a0@,%a1 the_chain->first = new_first; 595f6: 2d49 ffe8 movel %a1,%fp@(-24) watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; 595fa: 42a8 0008 clrl %a0@(8) new_first->previous = _Chain_Head(the_chain); 595fe: 2343 0004 movel %d3,%a1@(4) _ISR_Enable( level ); 59602: 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 ); 59604: 2f28 0024 movel %a0@(36),%sp@- 59608: 2f28 0020 movel %a0@(32),%sp@- 5960c: 2068 001c moveal %a0@(28),%a0 59610: 4e90 jsr %a0@ } 59612: 508f addql #8,%sp /* * It is essential that interrupts are disable here since an interrupt * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); 59614: 2204 movel %d4,%d1 59616: 40c0 movew %sr,%d0 59618: 8280 orl %d0,%d1 5961a: 46c1 movew %d1,%sr */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 5961c: 206e ffe8 moveal %fp@(-24),%a0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 59620: b1ee ffd8 cmpal %fp@(-40),%a0 59624: 66ce bnes 595f4 <_Timer_server_Body+0x1a8> watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; _ISR_Enable( level ); } else { _ISR_Enable( level ); 59626: 46c0 movew %d0,%sr { /* * Afterwards all timer inserts are directed to this chain and the interval * and TOD chains will be no more modified by other parties. */ ts->insert_chain = insert_chain; 59628: 41ee fff4 lea %fp@(-12),%a0 5962c: 2548 0078 movel %a0,%a2@(120) 59630: 6000 fe9a braw 594cc <_Timer_server_Body+0x80> * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); } } else { ts->active = false; 59634: 4207 clrb %d7 59636: 1547 007c moveb %d7,%a2@(124) 5963a: 2039 0007 e7cc movel 7e7cc <_Thread_Dispatch_disable_level>,%d0 59640: 5280 addql #1,%d0 59642: 23c0 0007 e7cc movel %d0,7e7cc <_Thread_Dispatch_disable_level> /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); 59648: 4878 0008 pea 8 5964c: 2f12 movel %a2@,%sp@- 5964e: 4eb9 0005 cd90 jsr 5cd90 <_Thread_Set_state> _Timer_server_Reset_interval_system_watchdog( ts ); 59654: 2f0a movel %a2,%sp@- 59656: 4eba fd1c jsr %pc@(59374 <_Timer_server_Reset_interval_system_watchdog>) _Timer_server_Reset_tod_system_watchdog( ts ); 5965a: 2f0a movel %a2,%sp@- 5965c: 4eba fd80 jsr %pc@(593de <_Timer_server_Reset_tod_system_watchdog>) _Thread_Enable_dispatch(); 59660: 4eb9 0005 c2c0 jsr 5c2c0 <_Thread_Enable_dispatch> ts->active = true; 59666: 7001 moveq #1,%d0 59668: 1540 007c moveb %d0,%a2@(124) static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 5966c: 2f2e ffe0 movel %fp@(-32),%sp@- 59670: 4eb9 0005 d8e4 jsr 5d8e4 <_Watchdog_Remove> static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 59676: 2f2e ffe4 movel %fp@(-28),%sp@- 5967a: 4eb9 0005 d8e4 jsr 5d8e4 <_Watchdog_Remove> 59680: 4fef 0018 lea %sp@(24),%sp 59684: 6000 fe3e braw 594c4 <_Timer_server_Body+0x78> 00059688 <_Timer_server_Schedule_operation_method>: static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 59688: 4e56 fff0 linkw %fp,#-16 5968c: 206e 000c moveal %fp@(12),%a0 59690: 48d7 041c moveml %d2-%d4/%a2,%sp@ 59694: 246e 0008 moveal %fp@(8),%a2 if ( ts->insert_chain == NULL ) { 59698: 202a 0078 movel %a2@(120),%d0 5969c: 671a beqs 596b8 <_Timer_server_Schedule_operation_method+0x30> * server is not preemptible, so we must be in interrupt context here. No * thread dispatch will happen until the timer server finishes its * critical section. We have to use the protected chain methods because * we may be interrupted by a higher priority interrupt. */ _Chain_Append( ts->insert_chain, &timer->Object.Node ); 5969e: 202a 0078 movel %a2@(120),%d0 596a2: 2d48 000c movel %a0,%fp@(12) } } 596a6: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 * server is not preemptible, so we must be in interrupt context here. No * thread dispatch will happen until the timer server finishes its * critical section. We have to use the protected chain methods because * we may be interrupted by a higher priority interrupt. */ _Chain_Append( ts->insert_chain, &timer->Object.Node ); 596ac: 2d40 0008 movel %d0,%fp@(8) } } 596b0: 4e5e unlk %fp * server is not preemptible, so we must be in interrupt context here. No * thread dispatch will happen until the timer server finishes its * critical section. We have to use the protected chain methods because * we may be interrupted by a higher priority interrupt. */ _Chain_Append( ts->insert_chain, &timer->Object.Node ); 596b2: 4ef9 0005 9ed0 jmp 59ed0 <_Chain_Append> 596b8: 2039 0007 e7cc movel 7e7cc <_Thread_Dispatch_disable_level>,%d0 596be: 5280 addql #1,%d0 596c0: 23c0 0007 e7cc movel %d0,7e7cc <_Thread_Dispatch_disable_level> * being inserted. This could result in an integer overflow. */ _Thread_Disable_dispatch(); if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 596c6: 2028 0038 movel %a0@(56),%d0 596ca: 7201 moveq #1,%d1 596cc: b280 cmpl %d0,%d1 596ce: 6700 0088 beqw 59758 <_Timer_server_Schedule_operation_method+0xd0> _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); if ( !ts->active ) { _Timer_server_Reset_interval_system_watchdog( ts ); } } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 596d2: 7203 moveq #3,%d1 596d4: b280 cmpl %d0,%d1 596d6: 670e beqs 596e6 <_Timer_server_Schedule_operation_method+0x5e> * critical section. We have to use the protected chain methods because * we may be interrupted by a higher priority interrupt. */ _Chain_Append( ts->insert_chain, &timer->Object.Node ); } } 596d8: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 596de: 4e5e unlk %fp if ( !ts->active ) { _Timer_server_Reset_tod_system_watchdog( ts ); } } _Thread_Enable_dispatch(); 596e0: 4ef9 0005 c2c0 jmp 5c2c0 <_Thread_Enable_dispatch> } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { /* * We have to advance the last known seconds value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 596e6: 203c 0000 0700 movel #1792,%d0 596ec: 40c2 movew %sr,%d2 596ee: 8082 orl %d2,%d0 596f0: 46c0 movew %d0,%sr */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 596f2: 260a movel %a2,%d3 596f4: 0683 0000 006c addil #108,%d3 snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 596fa: 2039 0007 e85e movel 7e85e <_TOD_Now>,%d0 last_snapshot = ts->TOD_watchdogs.last_snapshot; 59700: 222a 0074 movel %a2@(116),%d1 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 59704: 226a 0068 moveal %a2@(104),%a1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 59708: b689 cmpl %a1,%d3 5970a: 671a beqs 59726 <_Timer_server_Schedule_operation_method+0x9e> if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; 5970c: 2629 0010 movel %a1@(16),%d3 if ( snapshot > last_snapshot ) { 59710: b280 cmpl %d0,%d1 59712: 6400 00b8 bccw 597cc <_Timer_server_Schedule_operation_method+0x144> /* * We advanced in time. */ delta = snapshot - last_snapshot; 59716: 2800 movel %d0,%d4 59718: 9881 subl %d1,%d4 if (delta_interval > delta) { 5971a: b883 cmpl %d3,%d4 5971c: 6500 00ba bcsw 597d8 <_Timer_server_Schedule_operation_method+0x150> 59720: 4281 clrl %d1 <== NOT EXECUTED * Someone put us in the past. */ delta = last_snapshot - snapshot; delta_interval += delta; } first_watchdog->delta_interval = delta_interval; 59722: 2341 0010 movel %d1,%a1@(16) <== NOT EXECUTED } ts->TOD_watchdogs.last_snapshot = snapshot; 59726: 2540 0074 movel %d0,%a2@(116) _ISR_Enable( level ); 5972a: 46c2 movew %d2,%sr _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 5972c: 4868 0010 pea %a0@(16) 59730: 486a 0068 pea %a2@(104) 59734: 4eb9 0005 d79c jsr 5d79c <_Watchdog_Insert> if ( !ts->active ) { 5973a: 508f addql #8,%sp 5973c: 102a 007c moveb %a2@(124),%d0 59740: 6696 bnes 596d8 <_Timer_server_Schedule_operation_method+0x50> _Timer_server_Reset_tod_system_watchdog( ts ); 59742: 2f0a movel %a2,%sp@- 59744: 4eba fc98 jsr %pc@(593de <_Timer_server_Reset_tod_system_watchdog>) 59748: 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 ); } } 5974a: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 59750: 4e5e unlk %fp if ( !ts->active ) { _Timer_server_Reset_tod_system_watchdog( ts ); } } _Thread_Enable_dispatch(); 59752: 4ef9 0005 c2c0 jmp 5c2c0 <_Thread_Enable_dispatch> if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { /* * We have to advance the last known ticks value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 59758: 203c 0000 0700 movel #1792,%d0 5975e: 40c3 movew %sr,%d3 59760: 8083 orl %d3,%d0 59762: 46c0 movew %d0,%sr snapshot = _Watchdog_Ticks_since_boot; 59764: 2039 0007 e910 movel 7e910 <_Watchdog_Ticks_since_boot>,%d0 5976a: 240a movel %a2,%d2 5976c: 0682 0000 0034 addil #52,%d2 last_snapshot = ts->Interval_watchdogs.last_snapshot; 59772: 222a 003c movel %a2@(60),%d1 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 59776: 226a 0030 moveal %a2@(48),%a1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 5977a: b489 cmpl %a1,%d2 5977c: 6712 beqs 59790 <_Timer_server_Schedule_operation_method+0x108> first_watchdog = _Watchdog_First( &ts->Interval_watchdogs.Chain ); /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; 5977e: 2800 movel %d0,%d4 59780: 9881 subl %d1,%d4 delta_interval = first_watchdog->delta_interval; 59782: 2429 0010 movel %a1@(16),%d2 if (delta_interval > delta) { 59786: b484 cmpl %d4,%d2 59788: 623a bhis 597c4 <_Timer_server_Schedule_operation_method+0x13c> 5978a: 4282 clrl %d2 delta_interval -= delta; } else { delta_interval = 0; } first_watchdog->delta_interval = delta_interval; 5978c: 2342 0010 movel %d2,%a1@(16) } ts->Interval_watchdogs.last_snapshot = snapshot; 59790: 2540 003c movel %d0,%a2@(60) _ISR_Enable( level ); 59794: 46c3 movew %d3,%sr _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 59796: 4868 0010 pea %a0@(16) 5979a: 486a 0030 pea %a2@(48) 5979e: 4eb9 0005 d79c jsr 5d79c <_Watchdog_Insert> if ( !ts->active ) { 597a4: 508f addql #8,%sp 597a6: 102a 007c moveb %a2@(124),%d0 597aa: 6600 ff2c bnew 596d8 <_Timer_server_Schedule_operation_method+0x50> _Timer_server_Reset_interval_system_watchdog( ts ); 597ae: 2f0a movel %a2,%sp@- 597b0: 4eba fbc2 jsr %pc@(59374 <_Timer_server_Reset_interval_system_watchdog>) 597b4: 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 ); } } 597b6: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 597bc: 4e5e unlk %fp if ( !ts->active ) { _Timer_server_Reset_tod_system_watchdog( ts ); } } _Thread_Enable_dispatch(); 597be: 4ef9 0005 c2c0 jmp 5c2c0 <_Thread_Enable_dispatch> */ delta = snapshot - last_snapshot; delta_interval = first_watchdog->delta_interval; if (delta_interval > delta) { delta_interval -= delta; 597c4: 9484 subl %d4,%d2 } else { delta_interval = 0; } first_watchdog->delta_interval = delta_interval; 597c6: 2342 0010 movel %d2,%a1@(16) 597ca: 60c4 bras 59790 <_Timer_server_Schedule_operation_method+0x108> } } else { /* * Someone put us in the past. */ delta = last_snapshot - snapshot; 597cc: d283 addl %d3,%d1 delta_interval += delta; 597ce: 9280 subl %d0,%d1 } first_watchdog->delta_interval = delta_interval; 597d0: 2341 0010 movel %d1,%a1@(16) 597d4: 6000 ff50 braw 59726 <_Timer_server_Schedule_operation_method+0x9e> /* * We advanced in time. */ delta = snapshot - last_snapshot; if (delta_interval > delta) { delta_interval -= delta; 597d8: 9684 subl %d4,%d3 597da: 2203 movel %d3,%d1 * Someone put us in the past. */ delta = last_snapshot - snapshot; delta_interval += delta; } first_watchdog->delta_interval = delta_interval; 597dc: 2341 0010 movel %d1,%a1@(16) 597e0: 6000 ff44 braw 59726 <_Timer_server_Schedule_operation_method+0x9e> 0005d70c <_Watchdog_Adjust_to_chain>: Chain_Control *header, Watchdog_Interval units_arg, Chain_Control *to_fire ) { 5d70c: 4e56 ffe4 linkw %fp,#-28 5d710: 48d7 3c1c moveml %d2-%d4/%a2-%a5,%sp@ 5d714: 2a6e 0008 moveal %fp@(8),%a5 5d718: 282e 000c movel %fp@(12),%d4 5d71c: 266e 0010 moveal %fp@(16),%a3 Watchdog_Interval units = units_arg; ISR_Level level; Watchdog_Control *first; if ( units <= 0 ) { 5d720: 675e beqs 5d780 <_Watchdog_Adjust_to_chain+0x74> return; } _ISR_Disable( level ); 5d722: 263c 0000 0700 movel #1792,%d3 5d728: 2003 movel %d3,%d0 5d72a: 40c1 movew %sr,%d1 5d72c: 8081 orl %d1,%d0 5d72e: 46c0 movew %d0,%sr 5d730: 284d moveal %a5,%a4 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 5d732: 240b movel %a3,%d2 5d734: 5882 addql #4,%d2 5d736: 205c moveal %a4@+,%a0 while ( 1 ) { if ( units <= 0 ) { break; } if ( _Chain_Is_empty( header ) ) { 5d738: b1cc cmpal %a4,%a0 5d73a: 6742 beqs 5d77e <_Watchdog_Adjust_to_chain+0x72> /* * If it is longer than "units" until the first element on the chain * fires, then bump it and quit. */ if ( units < first->delta_interval ) { 5d73c: 2028 0010 movel %a0@(16),%d0 5d740: b880 cmpl %d0,%d4 5d742: 654c bcss 5d790 <_Watchdog_Adjust_to_chain+0x84> /* * The first set happens in less than units, so take all of them * off the chain and adjust units to reflect this. */ units -= first->delta_interval; 5d744: 9880 subl %d0,%d4 first->delta_interval = 0; 5d746: 42a8 0010 clrl %a0@(16) ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 5d74a: 2250 moveal %a0@,%a1 previous = the_node->previous; 5d74c: 2468 0004 moveal %a0@(4),%a2 next->previous = previous; previous->next = next; 5d750: 2489 movel %a1,%a2@ Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 5d752: 234a 0004 movel %a2,%a1@(4) Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 5d756: 2082 movel %d2,%a0@ old_last_node = the_chain->last; 5d758: 226b 0008 moveal %a3@(8),%a1 the_chain->last = the_node; 5d75c: 2748 0008 movel %a0,%a3@(8) old_last_node->next = the_node; the_node->previous = old_last_node; 5d760: 2149 0004 movel %a1,%a0@(4) Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; the_chain->last = the_node; old_last_node->next = the_node; 5d764: 2288 movel %a0,%a1@ while ( 1 ) { _Chain_Extract_unprotected( &first->Node ); _Chain_Append_unprotected( to_fire, &first->Node ); _ISR_Flash( level ); 5d766: 2003 movel %d3,%d0 5d768: 46c1 movew %d1,%sr 5d76a: 8081 orl %d1,%d0 5d76c: 46c0 movew %d0,%sr */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 5d76e: 2055 moveal %a5@,%a0 if ( _Chain_Is_empty( header ) ) 5d770: b1cc cmpal %a4,%a0 5d772: 6714 beqs 5d788 <_Watchdog_Adjust_to_chain+0x7c> break; first = _Watchdog_First( header ); if ( first->delta_interval != 0 ) 5d774: 4aa8 0010 tstl %a0@(16) 5d778: 67d0 beqs 5d74a <_Watchdog_Adjust_to_chain+0x3e> } _ISR_Disable( level ); while ( 1 ) { if ( units <= 0 ) { 5d77a: 4a84 tstl %d4 5d77c: 66ba bnes 5d738 <_Watchdog_Adjust_to_chain+0x2c> if ( first->delta_interval != 0 ) break; } } _ISR_Enable( level ); 5d77e: 46c1 movew %d1,%sr } 5d780: 4cd7 3c1c moveml %sp@,%d2-%d4/%a2-%a5 5d784: 4e5e unlk %fp 5d786: 4e75 rts */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 5d788: 204c moveal %a4,%a0 } _ISR_Disable( level ); while ( 1 ) { if ( units <= 0 ) { 5d78a: 4a84 tstl %d4 5d78c: 66aa bnes 5d738 <_Watchdog_Adjust_to_chain+0x2c> 5d78e: 60ee bras 5d77e <_Watchdog_Adjust_to_chain+0x72> /* * If it is longer than "units" until the first element on the chain * fires, then bump it and quit. */ if ( units < first->delta_interval ) { first->delta_interval -= units; 5d790: 9084 subl %d4,%d0 <== NOT EXECUTED 5d792: 2140 0010 movel %d0,%a0@(16) <== NOT EXECUTED if ( first->delta_interval != 0 ) break; } } _ISR_Enable( level ); 5d796: 46c1 movew %d1,%sr <== NOT EXECUTED 5d798: 60e6 bras 5d780 <_Watchdog_Adjust_to_chain+0x74> <== NOT EXECUTED ... 00049228 <_Workspace_Handler_initialization>: /* * _Workspace_Handler_initialization */ void _Workspace_Handler_initialization(void) { 49228: 4e56 0000 linkw %fp,#0 4922c: 2f03 movel %d3,%sp@- uintptr_t memory_available = 0; void *starting_address = Configuration.work_space_start; uintptr_t size = Configuration.work_space_size; 4922e: 2639 0005 d7c8 movel 5d7c8 ,%d3 /* * _Workspace_Handler_initialization */ void _Workspace_Handler_initialization(void) { 49234: 2f02 movel %d2,%sp@- uintptr_t memory_available = 0; void *starting_address = Configuration.work_space_start; 49236: 2439 0005 d7c4 movel 5d7c4 ,%d2 uintptr_t size = Configuration.work_space_size; if ( Configuration.do_zero_of_workspace ) 4923c: 4a39 0005 d7ec tstb 5d7ec 49242: 6628 bnes 4926c <_Workspace_Handler_initialization+0x44> memset( starting_address, 0, size ); memory_available = _Heap_Initialize( 49244: 4878 0004 pea 4 49248: 2f03 movel %d3,%sp@- 4924a: 2f02 movel %d2,%sp@- 4924c: 4879 0005 ef9a pea 5ef9a <_Workspace_Area> 49252: 4eb9 0004 6c60 jsr 46c60 <_Heap_Initialize> starting_address, size, CPU_HEAP_ALIGNMENT ); if ( memory_available == 0 ) 49258: 4fef 0010 lea %sp@(16),%sp 4925c: 4a80 tstl %d0 4925e: 671e beqs 4927e <_Workspace_Handler_initialization+0x56> _Internal_error_Occurred( INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_TOO_LITTLE_WORKSPACE ); } 49260: 242e fff8 movel %fp@(-8),%d2 49264: 262e fffc movel %fp@(-4),%d3 49268: 4e5e unlk %fp 4926a: 4e75 rts uintptr_t memory_available = 0; void *starting_address = Configuration.work_space_start; uintptr_t size = Configuration.work_space_size; if ( Configuration.do_zero_of_workspace ) memset( starting_address, 0, size ); 4926c: 2f03 movel %d3,%sp@- 4926e: 42a7 clrl %sp@- 49270: 2f02 movel %d2,%sp@- 49272: 4eb9 0004 f484 jsr 4f484 49278: 4fef 000c lea %sp@(12),%sp 4927c: 60c6 bras 49244 <_Workspace_Handler_initialization+0x1c> size, CPU_HEAP_ALIGNMENT ); if ( memory_available == 0 ) _Internal_error_Occurred( 4927e: 4878 0003 pea 3 49282: 4878 0001 pea 1 49286: 42a7 clrl %sp@- 49288: 4eb9 0004 6fcc jsr 46fcc <_Internal_error_Occurred> ... 0004e644 : int killinfo( pid_t pid, int sig, const union sigval *value ) { 4e644: 4e56 ffd0 linkw %fp,#-48 4e648: 48d7 1cfc moveml %d2-%d7/%a2-%a4,%sp@ 4e64c: 262e 000c movel %fp@(12),%d3 4e650: 246e 0010 moveal %fp@(16),%a2 POSIX_signals_Siginfo_node *psiginfo; /* * Only supported for the "calling process" (i.e. this node). */ if ( pid != getpid() ) 4e654: 4eb9 0004 d5a4 jsr 4d5a4 4e65a: b0ae 0008 cmpl %fp@(8),%d0 4e65e: 6600 022c bnew 4e88c rtems_set_errno_and_return_minus_one( ESRCH ); /* * Validate the signal passed. */ if ( !sig ) 4e662: 4a83 tstl %d3 4e664: 6700 023e beqw 4e8a4 static inline bool is_valid_signo( int signo ) { return ((signo) >= 1 && (signo) <= 32 ); 4e668: 2003 movel %d3,%d0 4e66a: 5380 subql #1,%d0 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 4e66c: 721f moveq #31,%d1 4e66e: b280 cmpl %d0,%d1 4e670: 6500 0232 bcsw 4e8a4 rtems_set_errno_and_return_minus_one( EINVAL ); /* * If the signal is being ignored, then we are out of here. */ if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) 4e674: 2203 movel %d3,%d1 4e676: 2803 movel %d3,%d4 4e678: 7e01 moveq #1,%d7 4e67a: e589 lsll #2,%d1 4e67c: e98c lsll #4,%d4 4e67e: 9881 subl %d1,%d4 4e680: 2044 moveal %d4,%a0 4e682: d1fc 0005 f42e addal #390190,%a0 4e688: be90 cmpl %a0@,%d7 4e68a: 6700 00d4 beqw 4e760 /* * P1003.1c/Draft 10, p. 33 says that certain signals should always * be directed to the executing thread such as those caused by hardware * faults. */ if ( (sig == SIGFPE) || (sig == SIGILL) || (sig == SIGSEGV ) ) 4e68e: 7208 moveq #8,%d1 4e690: b283 cmpl %d3,%d1 4e692: 6700 00d8 beqw 4e76c 4e696: 7e04 moveq #4,%d7 4e698: be83 cmpl %d3,%d7 4e69a: 6700 00d0 beqw 4e76c 4e69e: 123c 000b moveb #11,%d1 4e6a2: b283 cmpl %d3,%d1 4e6a4: 6700 00c6 beqw 4e76c static inline sigset_t signo_to_mask( uint32_t sig ) { return 1u << (sig - 1); 4e6a8: 7401 moveq #1,%d2 /* * Build up a siginfo structure */ siginfo = &siginfo_struct; siginfo->si_signo = sig; siginfo->si_code = SI_USER; 4e6aa: 7e01 moveq #1,%d7 4e6ac: e1aa lsll %d0,%d2 /* * Build up a siginfo structure */ siginfo = &siginfo_struct; siginfo->si_signo = sig; 4e6ae: 2d43 fff4 movel %d3,%fp@(-12) siginfo->si_code = SI_USER; 4e6b2: 2d47 fff8 movel %d7,%fp@(-8) if ( !value ) { 4e6b6: 4a8a tstl %a2 4e6b8: 6700 01ca beqw 4e884 siginfo->si_value.sival_int = 0; } else { siginfo->si_value = *value; 4e6bc: 2d52 fffc movel %a2@,%fp@(-4) 4e6c0: 2039 0005 ef78 movel 5ef78 <_Thread_Dispatch_disable_level>,%d0 4e6c6: 5280 addql #1,%d0 4e6c8: 23c0 0005 ef78 movel %d0,5ef78 <_Thread_Dispatch_disable_level> /* * Is the currently executing thread interested? If so then it will * get it an execute it as soon as the dispatcher executes. */ the_thread = _Thread_Executing; 4e6ce: 2479 0005 f032 moveal 5f032 <_Thread_Executing>,%a2 api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4e6d4: 206a 010e moveal %a2@(270),%a0 4e6d8: 2028 00cc movel %a0@(204),%d0 4e6dc: 4680 notl %d0 4e6de: c082 andl %d2,%d0 4e6e0: 6642 bnes 4e724 /* XXX violation of visibility -- need to define thread queue support */ the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = the_chain->first ; 4e6e2: 2079 0005 f5b2 moveal 5f5b2 <_POSIX_signals_Wait_queue>,%a0 4e6e8: b1fc 0005 f5b6 cmpal #390582,%a0 4e6ee: 6700 00ec beqw 4e7dc #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 4e6f2: 2002 movel %d2,%d0 for ( the_node = the_chain->first ; !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { the_thread = (Thread_Control *)the_node; 4e6f4: 2448 moveal %a0,%a2 #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 4e6f6: c0a8 0030 andl %a0@(48),%d0 for ( the_node = the_chain->first ; !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { the_thread = (Thread_Control *)the_node; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4e6fa: 2268 010e moveal %a0@(270),%a1 #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 4e6fe: 6624 bnes 4e724 /* * Is this thread is blocked waiting for another signal but has * not blocked this one? */ if (~api->signals_blocked & mask) 4e700: 2029 00cc movel %a1@(204),%d0 4e704: 4680 notl %d0 4e706: c082 andl %d2,%d0 4e708: 661a bnes 4e724 the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = the_chain->first ; !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { 4e70a: 2050 moveal %a0@,%a0 the_thread = (Thread_Control *)the_node; 4e70c: 2448 moveal %a0,%a2 /* XXX violation of visibility -- need to define thread queue support */ the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = the_chain->first ; 4e70e: b1fc 0005 f5b6 cmpal #390582,%a0 4e714: 6700 00c6 beqw 4e7dc #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 4e718: 2002 movel %d2,%d0 <== NOT EXECUTED 4e71a: c0a8 0030 andl %a0@(48),%d0 <== NOT EXECUTED for ( the_node = the_chain->first ; !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { the_thread = (Thread_Control *)the_node; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4e71e: 2268 010e moveal %a0@(270),%a1 <== NOT EXECUTED #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 4e722: 67dc beqs 4e700 <== NOT EXECUTED * thread needs to do the post context switch extension so it can * evaluate the signals pending. */ process_it: the_thread->do_post_task_switch_extension = true; 4e724: 7001 moveq #1,%d0 4e726: 1540 0074 moveb %d0,%a2@(116) /* * Returns true if the signal was synchronously given to a thread * blocked waiting for the signal. */ if ( _POSIX_signals_Unblock_thread( the_thread, sig, siginfo ) ) { 4e72a: 486e fff4 pea %fp@(-12) 4e72e: 2f03 movel %d3,%sp@- 4e730: 2f0a movel %a2,%sp@- 4e732: 4eb9 0004 e97c jsr 4e97c <_POSIX_signals_Unblock_thread> 4e738: 4fef 000c lea %sp@(12),%sp 4e73c: 4a00 tstb %d0 4e73e: 6600 008a bnew 4e7ca /* * We may have woken up a thread but we definitely need to post the * signal to the process wide information set. */ _POSIX_signals_Set_process_signals( mask ); 4e742: 2f02 movel %d2,%sp@- 4e744: 4eb9 0004 e94c jsr 4e94c <_POSIX_signals_Set_process_signals> if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { 4e74a: 588f addql #4,%sp 4e74c: 41f9 0005 f426 lea 5f426 <_POSIX_signals_Vectors>,%a0 4e752: 7202 moveq #2,%d1 4e754: b2b0 4800 cmpl %a0@(00000000,%d4:l),%d1 4e758: 672e beqs 4e788 _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); 4e75a: 4eb9 0004 7dbc jsr 47dbc <_Thread_Enable_dispatch> 4e760: 4280 clrl %d0 return 0; } 4e762: 4cee 1cfc ffd0 moveml %fp@(-48),%d2-%d7/%a2-%a4 4e768: 4e5e unlk %fp 4e76a: 4e75 rts * P1003.1c/Draft 10, p. 33 says that certain signals should always * be directed to the executing thread such as those caused by hardware * faults. */ if ( (sig == SIGFPE) || (sig == SIGILL) || (sig == SIGSEGV ) ) return pthread_kill( pthread_self(), sig ); 4e76c: 4eb9 0004 eb98 jsr 4eb98 4e772: 2f03 movel %d3,%sp@- 4e774: 2f00 movel %d0,%sp@- 4e776: 4eb9 0004 eabc jsr 4eabc 4e77c: 508f addql #8,%sp } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); return 0; } 4e77e: 4cee 1cfc ffd0 moveml %fp@(-48),%d2-%d7/%a2-%a4 4e784: 4e5e unlk %fp 4e786: 4e75 rts */ _POSIX_signals_Set_process_signals( mask ); if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { psiginfo = (POSIX_signals_Siginfo_node *) 4e788: 4879 0005 f5a6 pea 5f5a6 <_POSIX_signals_Inactive_siginfo> 4e78e: 4eb9 0004 b9c0 jsr 4b9c0 <_Chain_Get> _Chain_Get( &_POSIX_signals_Inactive_siginfo ); if ( !psiginfo ) { 4e794: 588f addql #4,%sp */ _POSIX_signals_Set_process_signals( mask ); if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { psiginfo = (POSIX_signals_Siginfo_node *) 4e796: 2040 moveal %d0,%a0 _Chain_Get( &_POSIX_signals_Inactive_siginfo ); if ( !psiginfo ) { 4e798: 4a80 tstl %d0 4e79a: 6700 0120 beqw 4e8bc _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EAGAIN ); } psiginfo->Info = *siginfo; 4e79e: 216e fff4 0008 movel %fp@(-12),%a0@(8) _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 4e7a4: 0684 0005 f61e addil #390686,%d4 if ( !psiginfo ) { _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EAGAIN ); } psiginfo->Info = *siginfo; 4e7aa: 216e fff8 000c movel %fp@(-8),%a0@(12) 4e7b0: 216e fffc 0010 movel %fp@(-4),%a0@(16) _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 4e7b6: 2f00 movel %d0,%sp@- 4e7b8: 2f04 movel %d4,%sp@- 4e7ba: 4eb9 0004 6798 jsr 46798 <_Chain_Append> 4e7c0: 508f addql #8,%sp } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); 4e7c2: 4eb9 0004 7dbc jsr 47dbc <_Thread_Enable_dispatch> 4e7c8: 6096 bras 4e760 /* * Returns true if the signal was synchronously given to a thread * blocked waiting for the signal. */ if ( _POSIX_signals_Unblock_thread( the_thread, sig, siginfo ) ) { _Thread_Enable_dispatch(); 4e7ca: 4eb9 0004 7dbc jsr 47dbc <_Thread_Enable_dispatch> 4e7d0: 4280 clrl %d0 } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); return 0; } 4e7d2: 4cee 1cfc ffd0 moveml %fp@(-48),%d2-%d7/%a2-%a4 4e7d8: 4e5e unlk %fp 4e7da: 4e75 rts * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 4e7dc: 4285 clrl %d5 4e7de: 1a39 0005 d7c2 moveb 5d7c2 ,%d5 4e7e4: 49f9 0005 ef38 lea 5ef38 <_Objects_Information_table+0x8>,%a4 */ #define _POSIX_signals_Is_interested( _api, _mask ) \ ( ~(_api)->signals_blocked & (_mask) ) int killinfo( 4e7ea: 95ca subal %a2,%a2 * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 4e7ec: 5285 addql #1,%d5 for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) { /* * This can occur when no one is interested and ITRON is not configured. */ if ( !_Objects_Information_table[ the_api ] ) 4e7ee: 2054 moveal %a4@,%a0 4e7f0: 4a88 tstl %a0 4e7f2: 675e beqs 4e852 continue; the_info = _Objects_Information_table[ the_api ][ 1 ]; 4e7f4: 2068 0004 moveal %a0@(4),%a0 */ if ( !the_info ) continue; #endif maximum = the_info->maximum; 4e7f8: 4286 clrl %d6 4e7fa: 3c28 000e movew %a0@(14),%d6 object_table = the_info->local_table; 4e7fe: 2268 0018 moveal %a0@(24),%a1 for ( index = 1 ; index <= maximum ; index++ ) { 4e802: 4a86 tstl %d6 4e804: 674c beqs 4e852 4e806: 5889 addql #4,%a1 4e808: 7001 moveq #1,%d0 the_thread = (Thread_Control *) object_table[ index ]; 4e80a: 2051 moveal %a1@,%a0 #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 4e80c: 5280 addql #1,%d0 4e80e: 5889 addql #4,%a1 the_thread = (Thread_Control *) object_table[ index ]; if ( !the_thread ) 4e810: 4a88 tstl %a0 4e812: 673a beqs 4e84e /* * If this thread is of lower priority than the interested thread, * go on to the next thread. */ if ( the_thread->current_priority > interested_priority ) 4e814: 2228 0014 movel %a0@(20),%d1 4e818: ba81 cmpl %d1,%d5 4e81a: 6532 bcss 4e84e DEBUG_STEP("2"); /* * If this thread is not interested, then go on to the next thread. */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4e81c: 2668 010e moveal %a0@(270),%a3 4e820: 2e2b 00cc movel %a3@(204),%d7 4e824: 4687 notl %d7 4e826: ce82 andl %d2,%d7 4e828: 6724 beqs 4e84e * * NOTE: We initialized interested_priority to PRIORITY_MAXIMUM + 1 * so we never have to worry about deferencing a NULL * interested thread. */ if ( the_thread->current_priority < interested_priority ) { 4e82a: ba81 cmpl %d1,%d5 4e82c: 621c bhis 4e84a * and blocking interruptibutable by signal. * * If the interested thread is ready, don't think about changing. */ if ( !_States_Is_ready( interested->current_state ) ) { 4e82e: 2e2a 0010 movel %a2@(16),%d7 4e832: 671a beqs 4e84e /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 4e834: 2668 0010 moveal %a0@(16),%a3 4e838: 4a8b tstl %a3 4e83a: 670e beqs 4e84a continue; } DEBUG_STEP("6"); /* prefer blocked/interruptible over blocked/not interruptible */ if ( !_States_Is_interruptible_by_signal(interested->current_state) ) { 4e83c: 0807 001c btst #28,%d7 4e840: 660c bnes 4e84e DEBUG_STEP("7"); if ( _States_Is_interruptible_by_signal(the_thread->current_state) ) { 4e842: 2e0b movel %a3,%d7 4e844: 0807 001c btst #28,%d7 4e848: 6704 beqs 4e84e 4e84a: 2a01 movel %d1,%d5 4e84c: 2448 moveal %a0,%a2 #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 4e84e: b086 cmpl %d6,%d0 4e850: 63b8 blss 4e80a 4e852: 588c addql #4,%a4 * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) { 4e854: b9fc 0005 ef44 cmpal #388932,%a4 4e85a: 6692 bnes 4e7ee } } } } if ( interested ) { 4e85c: 4a8a tstl %a2 4e85e: 6700 fee2 beqw 4e742 * thread needs to do the post context switch extension so it can * evaluate the signals pending. */ process_it: the_thread->do_post_task_switch_extension = true; 4e862: 7001 moveq #1,%d0 4e864: 1540 0074 moveb %d0,%a2@(116) /* * Returns true if the signal was synchronously given to a thread * blocked waiting for the signal. */ if ( _POSIX_signals_Unblock_thread( the_thread, sig, siginfo ) ) { 4e868: 486e fff4 pea %fp@(-12) 4e86c: 2f03 movel %d3,%sp@- 4e86e: 2f0a movel %a2,%sp@- 4e870: 4eb9 0004 e97c jsr 4e97c <_POSIX_signals_Unblock_thread> 4e876: 4fef 000c lea %sp@(12),%sp 4e87a: 4a00 tstb %d0 4e87c: 6700 fec4 beqw 4e742 4e880: 6000 ff48 braw 4e7ca <== NOT EXECUTED */ siginfo = &siginfo_struct; siginfo->si_signo = sig; siginfo->si_code = SI_USER; if ( !value ) { siginfo->si_value.sival_int = 0; 4e884: 42ae fffc clrl %fp@(-4) 4e888: 6000 fe36 braw 4e6c0 /* * Only supported for the "calling process" (i.e. this node). */ if ( pid != getpid() ) rtems_set_errno_and_return_minus_one( ESRCH ); 4e88c: 4eb9 0004 ebf4 jsr 4ebf4 <__errno> 4e892: 7603 moveq #3,%d3 4e894: 2040 moveal %d0,%a0 4e896: 70ff moveq #-1,%d0 4e898: 2083 movel %d3,%a0@ } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); return 0; } 4e89a: 4cee 1cfc ffd0 moveml %fp@(-48),%d2-%d7/%a2-%a4 4e8a0: 4e5e unlk %fp 4e8a2: 4e75 rts */ if ( !sig ) rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) rtems_set_errno_and_return_minus_one( EINVAL ); 4e8a4: 4eb9 0004 ebf4 jsr 4ebf4 <__errno> 4e8aa: 7416 moveq #22,%d2 4e8ac: 2040 moveal %d0,%a0 4e8ae: 70ff moveq #-1,%d0 4e8b0: 2082 movel %d2,%a0@ } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); return 0; } 4e8b2: 4cee 1cfc ffd0 moveml %fp@(-48),%d2-%d7/%a2-%a4 4e8b8: 4e5e unlk %fp 4e8ba: 4e75 rts if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { psiginfo = (POSIX_signals_Siginfo_node *) _Chain_Get( &_POSIX_signals_Inactive_siginfo ); if ( !psiginfo ) { _Thread_Enable_dispatch(); 4e8bc: 4eb9 0004 7dbc jsr 47dbc <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EAGAIN ); 4e8c2: 4eb9 0004 ebf4 jsr 4ebf4 <__errno> 4e8c8: 720b moveq #11,%d1 4e8ca: 2040 moveal %d0,%a0 4e8cc: 70ff moveq #-1,%d0 } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); return 0; } 4e8ce: 4cee 1cfc ffd0 moveml %fp@(-48),%d2-%d7/%a2-%a4 psiginfo = (POSIX_signals_Siginfo_node *) _Chain_Get( &_POSIX_signals_Inactive_siginfo ); if ( !psiginfo ) { _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EAGAIN ); 4e8d4: 2081 movel %d1,%a0@ } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); return 0; } 4e8d6: 4e5e unlk %fp ... 000460fc : int pthread_barrier_init( pthread_barrier_t *barrier, const pthread_barrierattr_t *attr, unsigned int count ) { 460fc: 4e56 ffe0 linkw %fp,#-32 46100: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ 46104: 246e 0008 moveal %fp@(8),%a2 46108: 262e 000c movel %fp@(12),%d3 4610c: 242e 0010 movel %fp@(16),%d2 const pthread_barrierattr_t *the_attr; /* * Error check parameters */ if ( !barrier ) 46110: 4a8a tstl %a2 46112: 677a beqs 4618e return EINVAL; if ( count == 0 ) 46114: 4a82 tstl %d2 46116: 6776 beqs 4618e return EINVAL; /* * If the user passed in NULL, use the default attributes */ if ( attr ) { 46118: 4a83 tstl %d3 4611a: 6700 0090 beqw 461ac 4611e: 2043 moveal %d3,%a0 } /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) 46120: 4a90 tstl %a0@ 46122: 676a beqs 4618e return EINVAL; switch ( the_attr->process_shared ) { 46124: 4aa8 0004 tstl %a0@(4) 46128: 6664 bnes 4618e rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 4612a: 2039 0006 06fc movel 606fc <_Thread_Dispatch_disable_level>,%d0 46130: 5280 addql #1,%d0 /* * Convert from POSIX attributes to Core Barrier attributes */ the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE; the_attributes.maximum_count = count; 46132: 2d42 fffc movel %d2,%fp@(-4) 46136: 23c0 0006 06fc movel %d0,606fc <_Thread_Dispatch_disable_level> } /* * Convert from POSIX attributes to Core Barrier attributes */ the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE; 4613c: 42ae fff8 clrl %fp@(-8) * This function allocates a barrier control block from * the inactive chain of free barrier control blocks. */ RTEMS_INLINE_ROUTINE POSIX_Barrier_Control *_POSIX_Barrier_Allocate( void ) { return (POSIX_Barrier_Control *) 46140: 4879 0006 0a3e pea 60a3e <_POSIX_Barrier_Information> 46146: 4eb9 0004 83e0 jsr 483e0 <_Objects_Allocate> */ _Thread_Disable_dispatch(); /* prevents deletion */ the_barrier = _POSIX_Barrier_Allocate(); if ( !the_barrier ) { 4614c: 588f addql #4,%sp 4614e: 2640 moveal %d0,%a3 46150: 4a80 tstl %d0 46152: 6746 beqs 4619a _Thread_Enable_dispatch(); return EAGAIN; } _CORE_barrier_Initialize( &the_barrier->Barrier, &the_attributes ); 46154: 486e fff8 pea %fp@(-8) 46158: 486b 0010 pea %a3@(16) 4615c: 4eb9 0004 7a50 jsr 47a50 <_CORE_barrier_Initialize> #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 46162: 202b 0008 movel %a3@(8),%d0 46166: 4281 clrl %d1 46168: 2079 0006 0a56 moveal 60a56 <_POSIX_Barrier_Information+0x18>,%a0 4616e: 3200 movew %d0,%d1 46170: 218b 1c00 movel %a3,%a0@(00000000,%d1:l:4) _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 46174: 42ab 000c clrl %a3@(12) ); /* * Exit the critical section and return the user an operational barrier */ *barrier = the_barrier->Object.id; 46178: 2480 movel %d0,%a2@ _Thread_Enable_dispatch(); 4617a: 4eb9 0004 908c jsr 4908c <_Thread_Enable_dispatch> return 0; 46180: 508f addql #8,%sp /* * Exit the critical section and return the user an operational barrier */ *barrier = the_barrier->Object.id; _Thread_Enable_dispatch(); 46182: 4280 clrl %d0 return 0; } 46184: 4cee 0c0c ffe0 moveml %fp@(-32),%d2-%d3/%a2-%a3 4618a: 4e5e unlk %fp 4618c: 4e75 rts /* * Exit the critical section and return the user an operational barrier */ *barrier = the_barrier->Object.id; _Thread_Enable_dispatch(); return 0; 4618e: 7016 moveq #22,%d0 } 46190: 4cee 0c0c ffe0 moveml %fp@(-32),%d2-%d3/%a2-%a3 46196: 4e5e unlk %fp 46198: 4e75 rts _Thread_Disable_dispatch(); /* prevents deletion */ the_barrier = _POSIX_Barrier_Allocate(); if ( !the_barrier ) { _Thread_Enable_dispatch(); 4619a: 4eb9 0004 908c jsr 4908c <_Thread_Enable_dispatch> 461a0: 700b moveq #11,%d0 * Exit the critical section and return the user an operational barrier */ *barrier = the_barrier->Object.id; _Thread_Enable_dispatch(); return 0; } 461a2: 4cee 0c0c ffe0 moveml %fp@(-32),%d2-%d3/%a2-%a3 461a8: 4e5e unlk %fp 461aa: 4e75 rts * If the user passed in NULL, use the default attributes */ if ( attr ) { the_attr = attr; } else { (void) pthread_barrierattr_init( &my_attr ); 461ac: 260e movel %fp,%d3 461ae: 0683 ffff fff0 addil #-16,%d3 461b4: 2f03 movel %d3,%sp@- 461b6: 4eb9 0004 6038 jsr 46038 461bc: 588f addql #4,%sp 461be: 2043 moveal %d3,%a0 } /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) 461c0: 4a90 tstl %a0@ 461c2: 6600 ff60 bnew 46124 461c6: 60c6 bras 4618e <== NOT EXECUTED 0004d8fc : } void pthread_exit( void *value_ptr ) { 4d8fc: 4e56 0000 linkw %fp,#0 _POSIX_Thread_Exit( _Thread_Executing, value_ptr ); 4d900: 2f2e 0008 movel %fp@(8),%sp@- 4d904: 2f39 0005 f032 movel 5f032 <_Thread_Executing>,%sp@- 4d90a: 4eb9 0004 d88c jsr 4d88c <_POSIX_Thread_Exit> 4d910: 508f addql #8,%sp <== NOT EXECUTED } 4d912: 4e5e unlk %fp <== NOT EXECUTED ... 00046768 : int pthread_once( pthread_once_t *once_control, void (*init_routine)(void) ) { 46768: 4e56 ffec linkw %fp,#-20 4676c: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ 46770: 246e 0008 moveal %fp@(8),%a2 46774: 266e 000c moveal %fp@(12),%a3 if ( !once_control || !init_routine ) 46778: 4a8a tstl %a2 4677a: 6766 beqs 467e2 4677c: 4a8b tstl %a3 4677e: 6762 beqs 467e2 return EINVAL; if ( !once_control->init_executed ) { 46780: 4aaa 0004 tstl %a2@(4) 46784: 670c beqs 46792 if ( !once_control->init_executed ) { once_control->is_initialized = true; once_control->init_executed = true; (*init_routine)(); } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); 46786: 4280 clrl %d0 } return 0; } 46788: 4cee 1c04 ffec moveml %fp@(-20),%d2/%a2-%a4 4678e: 4e5e unlk %fp 46790: 4e75 rts if ( !once_control || !init_routine ) return EINVAL; if ( !once_control->init_executed ) { rtems_mode saveMode; rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode); 46792: 240e movel %fp,%d2 46794: 5982 subql #4,%d2 46796: 49f9 0004 7428 lea 47428 ,%a4 4679c: 2f02 movel %d2,%sp@- 4679e: 4878 0100 pea 100 467a2: 4878 0100 pea 100 467a6: 4e94 jsr %a4@ if ( !once_control->init_executed ) { 467a8: 4fef 000c lea %sp@(12),%sp 467ac: 4aaa 0004 tstl %a2@(4) 467b0: 6714 beqs 467c6 once_control->is_initialized = true; once_control->init_executed = true; (*init_routine)(); } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); 467b2: 2f02 movel %d2,%sp@- <== NOT EXECUTED 467b4: 4878 0100 pea 100 <== NOT EXECUTED 467b8: 2f2e fffc movel %fp@(-4),%sp@- <== NOT EXECUTED 467bc: 4e94 jsr %a4@ <== NOT EXECUTED 467be: 4fef 000c lea %sp@(12),%sp <== NOT EXECUTED 467c2: 4280 clrl %d0 467c4: 60c2 bras 46788 if ( !once_control->init_executed ) { rtems_mode saveMode; rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode); if ( !once_control->init_executed ) { once_control->is_initialized = true; once_control->init_executed = true; 467c6: 7001 moveq #1,%d0 467c8: 2540 0004 movel %d0,%a2@(4) if ( !once_control->init_executed ) { rtems_mode saveMode; rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode); if ( !once_control->init_executed ) { once_control->is_initialized = true; 467cc: 2480 movel %d0,%a2@ once_control->init_executed = true; (*init_routine)(); 467ce: 4e93 jsr %a3@ } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); 467d0: 2f02 movel %d2,%sp@- 467d2: 4878 0100 pea 100 467d6: 2f2e fffc movel %fp@(-4),%sp@- 467da: 4e94 jsr %a4@ 467dc: 4fef 000c lea %sp@(12),%sp 467e0: 60e0 bras 467c2 467e2: 7016 moveq #22,%d0 } return 0; } 467e4: 4cee 1c04 ffec moveml %fp@(-20),%d2/%a2-%a4 467ea: 4e5e unlk %fp ... 0004897c : int pthread_setschedparam( pthread_t thread, int policy, struct sched_param *param ) { 4897c: 4e56 ffe0 linkw %fp,#-32 48980: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 48984: 282e 000c movel %fp@(12),%d4 48988: 242e 0010 movel %fp@(16),%d2 int rc; /* * Check all the parameters */ if ( !param ) 4898c: 6700 00c4 beqw 48a52 return EINVAL; rc = _POSIX_Thread_Translate_sched_param( 48990: 486e fff8 pea %fp@(-8) 48994: 486e fffc pea %fp@(-4) 48998: 2f02 movel %d2,%sp@- 4899a: 2f04 movel %d4,%sp@- 4899c: 4eb9 0004 e804 jsr 4e804 <_POSIX_Thread_Translate_sched_param> policy, param, &budget_algorithm, &budget_callout ); if ( rc ) 489a2: 4fef 0010 lea %sp@(16),%sp * Check all the parameters */ if ( !param ) return EINVAL; rc = _POSIX_Thread_Translate_sched_param( 489a6: 2600 movel %d0,%d3 policy, param, &budget_algorithm, &budget_callout ); if ( rc ) 489a8: 670c beqs 489b6 case OBJECTS_ERROR: break; } return ESRCH; } 489aa: 2003 movel %d3,%d0 489ac: 4cee 0c1c ffe0 moveml %fp@(-32),%d2-%d4/%a2-%a3 489b2: 4e5e unlk %fp 489b4: 4e75 rts 489b6: 486e fff4 pea %fp@(-12) 489ba: 2f2e 0008 movel %fp@(8),%sp@- 489be: 4879 0006 442e pea 6442e <_POSIX_Threads_Information> 489c4: 4eb9 0004 aab8 jsr 4aab8 <_Objects_Get> /* * Actually change the scheduling policy and parameters */ the_thread = _POSIX_Threads_Get( thread, &location ); switch ( location ) { 489ca: 4fef 000c lea %sp@(12),%sp 489ce: 2440 moveal %d0,%a2 489d0: 4aae fff4 tstl %fp@(-12) 489d4: 6600 008a bnew 48a60 case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 489d8: 266a 010e moveal %a2@(270),%a3 if ( api->schedpolicy == SCHED_SPORADIC ) 489dc: 7004 moveq #4,%d0 489de: b0ab 0080 cmpl %a3@(128),%d0 489e2: 6700 00ba beqw 48a9e (void) _Watchdog_Remove( &api->Sporadic_timer ); api->schedpolicy = policy; api->schedparam = *param; 489e6: 2242 moveal %d2,%a1 489e8: 41eb 0084 lea %a3@(132),%a0 api = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( api->schedpolicy == SCHED_SPORADIC ) (void) _Watchdog_Remove( &api->Sporadic_timer ); api->schedpolicy = policy; 489ec: 2744 0080 movel %d4,%a3@(128) api->schedparam = *param; 489f0: 20d9 movel %a1@+,%a0@+ 489f2: 20d9 movel %a1@+,%a0@+ 489f4: 20d9 movel %a1@+,%a0@+ 489f6: 20d9 movel %a1@+,%a0@+ 489f8: 20d9 movel %a1@+,%a0@+ 489fa: 20d9 movel %a1@+,%a0@+ the_thread->budget_algorithm = budget_algorithm; 489fc: 256e fffc 007a movel %fp@(-4),%a2@(122) if ( api->schedpolicy == SCHED_SPORADIC ) (void) _Watchdog_Remove( &api->Sporadic_timer ); api->schedpolicy = policy; api->schedparam = *param; 48a02: 2091 movel %a1@,%a0@ the_thread->budget_algorithm = budget_algorithm; the_thread->budget_callout = budget_callout; 48a04: 256e fff8 007e movel %fp@(-8),%a2@(126) switch ( api->schedpolicy ) { 48a0a: 4a84 tstl %d4 48a0c: 6d32 blts 48a40 48a0e: 7002 moveq #2,%d0 48a10: b084 cmpl %d4,%d0 48a12: 6d5c blts 48a70 48a14: 4280 clrl %d0 48a16: 1039 0006 2a56 moveb 62a56 ,%d0 case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; 48a1c: 41f9 0006 41f8 lea 641f8 <_Thread_Ticks_per_timeslice>,%a0 48a22: 90ab 0084 subl %a3@(132),%d0 48a26: 2550 0076 movel %a0@,%a2@(118) the_thread->real_priority = 48a2a: 2540 0018 movel %d0,%a2@(24) _POSIX_Priority_To_core( api->schedparam.sched_priority ); _Thread_Change_priority( 48a2e: 4878 0001 pea 1 48a32: 2f00 movel %d0,%sp@- 48a34: 2f0a movel %a2,%sp@- 48a36: 4eb9 0004 ada8 jsr 4ada8 <_Thread_Change_priority> the_thread, the_thread->real_priority, true ); break; 48a3c: 4fef 000c lea %sp@(12),%sp _Watchdog_Remove( &api->Sporadic_timer ); _POSIX_Threads_Sporadic_budget_TSR( 0, the_thread ); break; } _Thread_Enable_dispatch(); 48a40: 4eb9 0004 b2c8 jsr 4b2c8 <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return ESRCH; } 48a46: 2003 movel %d3,%d0 48a48: 4cee 0c1c ffe0 moveml %fp@(-32),%d2-%d4/%a2-%a3 48a4e: 4e5e unlk %fp 48a50: 4e75 rts int rc; /* * Check all the parameters */ if ( !param ) 48a52: 7616 moveq #22,%d3 case OBJECTS_ERROR: break; } return ESRCH; } 48a54: 2003 movel %d3,%d0 48a56: 4cee 0c1c ffe0 moveml %fp@(-32),%d2-%d4/%a2-%a3 48a5c: 4e5e unlk %fp 48a5e: 4e75 rts /* * Actually change the scheduling policy and parameters */ the_thread = _POSIX_Threads_Get( thread, &location ); switch ( location ) { 48a60: 163c 0003 moveb #3,%d3 case OBJECTS_ERROR: break; } return ESRCH; } 48a64: 2003 movel %d3,%d0 48a66: 4cee 0c1c ffe0 moveml %fp@(-32),%d2-%d4/%a2-%a3 48a6c: 4e5e unlk %fp 48a6e: 4e75 rts api->schedpolicy = policy; api->schedparam = *param; the_thread->budget_algorithm = budget_algorithm; the_thread->budget_callout = budget_callout; switch ( api->schedpolicy ) { 48a70: 103c 0004 moveb #4,%d0 48a74: b084 cmpl %d4,%d0 48a76: 66c8 bnes 48a40 true ); break; case SCHED_SPORADIC: api->ss_high_priority = api->schedparam.sched_priority; 48a78: 276b 0084 00a0 movel %a3@(132),%a3@(160) _Watchdog_Remove( &api->Sporadic_timer ); 48a7e: 486b 00a4 pea %a3@(164) 48a82: 4eb9 0004 c748 jsr 4c748 <_Watchdog_Remove> _POSIX_Threads_Sporadic_budget_TSR( 0, the_thread ); 48a88: 2f0a movel %a2,%sp@- 48a8a: 42a7 clrl %sp@- 48a8c: 4eb9 0004 88c0 jsr 488c0 <_POSIX_Threads_Sporadic_budget_TSR> 48a92: 4fef 000c lea %sp@(12),%sp break; } _Thread_Enable_dispatch(); 48a96: 4eb9 0004 b2c8 jsr 4b2c8 <_Thread_Enable_dispatch> 48a9c: 60a8 bras 48a46 case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( api->schedpolicy == SCHED_SPORADIC ) (void) _Watchdog_Remove( &api->Sporadic_timer ); 48a9e: 486b 00a4 pea %a3@(164) 48aa2: 4eb9 0004 c748 jsr 4c748 <_Watchdog_Remove> api->schedpolicy = policy; api->schedparam = *param; the_thread->budget_algorithm = budget_algorithm; 48aa8: 256e fffc 007a movel %fp@(-4),%a2@(122) if ( api->schedpolicy == SCHED_SPORADIC ) (void) _Watchdog_Remove( &api->Sporadic_timer ); api->schedpolicy = policy; api->schedparam = *param; 48aae: 2242 moveal %d2,%a1 48ab0: 41eb 0084 lea %a3@(132),%a0 case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( api->schedpolicy == SCHED_SPORADIC ) (void) _Watchdog_Remove( &api->Sporadic_timer ); 48ab4: 588f addql #4,%sp api->schedpolicy = policy; 48ab6: 2744 0080 movel %d4,%a3@(128) api->schedparam = *param; 48aba: 20d9 movel %a1@+,%a0@+ 48abc: 20d9 movel %a1@+,%a0@+ 48abe: 20d9 movel %a1@+,%a0@+ 48ac0: 20d9 movel %a1@+,%a0@+ 48ac2: 20d9 movel %a1@+,%a0@+ 48ac4: 20d9 movel %a1@+,%a0@+ the_thread->budget_algorithm = budget_algorithm; the_thread->budget_callout = budget_callout; 48ac6: 256e fff8 007e movel %fp@(-8),%a2@(126) if ( api->schedpolicy == SCHED_SPORADIC ) (void) _Watchdog_Remove( &api->Sporadic_timer ); api->schedpolicy = policy; api->schedparam = *param; 48acc: 2091 movel %a1@,%a0@ the_thread->budget_algorithm = budget_algorithm; the_thread->budget_callout = budget_callout; switch ( api->schedpolicy ) { 48ace: 4a84 tstl %d4 48ad0: 6c00 ff3c bgew 48a0e 48ad4: 6000 ff6a braw 48a40 <== NOT EXECUTED 00046454 : * * 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183 */ void pthread_testcancel( void ) { 46454: 4e56 0000 linkw %fp,#0 * Don't even think about deleting a resource from an ISR. * Besides this request is supposed to be for _Thread_Executing * and the ISR context is not a thread. */ if ( _ISR_Is_in_progress() ) 46458: 2039 0006 022e movel 6022e <_ISR_Nest_level>,%d0 4645e: 663c bnes 4649c return; thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 46460: 2079 0006 024e moveal 6024e <_Thread_Executing>,%a0 46466: 2039 0006 0194 movel 60194 <_Thread_Dispatch_disable_level>,%d0 4646c: 5280 addql #1,%d0 4646e: 2068 010e moveal %a0@(270),%a0 46472: 23c0 0006 0194 movel %d0,60194 <_Thread_Dispatch_disable_level> _Thread_Disable_dispatch(); if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 46478: 4aa8 00d4 tstl %a0@(212) 4647c: 6622 bnes 464a0 thread_support->cancelation_requested ) 4647e: 4aa8 00dc tstl %a0@(220) 46482: 671c beqs 464a0 cancel = true; _Thread_Enable_dispatch(); 46484: 4eb9 0004 8b28 jsr 48b28 <_Thread_Enable_dispatch> if ( cancel ) _POSIX_Thread_Exit( _Thread_Executing, PTHREAD_CANCELED ); 4648a: 4878 ffff pea ffffffff 4648e: 2f39 0006 024e movel 6024e <_Thread_Executing>,%sp@- 46494: 4eb9 0004 c1ec jsr 4c1ec <_POSIX_Thread_Exit> 4649a: 508f addql #8,%sp <== NOT EXECUTED } 4649c: 4e5e unlk %fp <== NOT EXECUTED 4649e: 4e75 rts <== NOT EXECUTED 464a0: 4e5e unlk %fp _Thread_Disable_dispatch(); if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && thread_support->cancelation_requested ) cancel = true; _Thread_Enable_dispatch(); 464a2: 4ef9 0004 8b28 jmp 48b28 <_Thread_Enable_dispatch> 0004634e : #endif Objects_Information *_Internal_Objects[ OBJECTS_INTERNAL_CLASSES_LAST + 1 ]; void rtems_initialize_data_structures(void) { 4634e: 4e56 0000 linkw %fp,#0 46352: 42b9 0005 f100 clrl 5f100 <_System_state_Current> #endif /* * Initialize any target architecture specific support as early as possible */ _CPU_Initialize(); 46358: 4eb9 0004 9354 jsr 49354 <_CPU_Initialize> /* * Do this as early as possible to ensure no debugging output * is even attempted to be printed. */ _Debug_Manager_initialization(); 4635e: 4eb9 0004 b8f0 jsr 4b8f0 <_Debug_Manager_initialization> _API_extensions_Initialization(); 46364: 4eb9 0004 6604 jsr 46604 <_API_extensions_Initialization> * This routine initializes the thread dispatching subsystem. */ RTEMS_INLINE_ROUTINE void _Thread_Dispatch_initialization( void ) { _Thread_Dispatch_disable_level = 1; 4636a: 7001 moveq #1,%d0 4636c: 23c0 0005 ef78 movel %d0,5ef78 <_Thread_Dispatch_disable_level> /* * Before this is called, we are not allowed to allocate memory * from the Workspace because it is not initialized. */ _Workspace_Handler_initialization(); 46372: 4eb9 0004 9228 jsr 49228 <_Workspace_Handler_initialization> _User_extensions_Handler_initialization(); 46378: 4eb9 0004 8cb0 jsr 48cb0 <_User_extensions_Handler_initialization> _ISR_Handler_initialization(); 4637e: 4eb9 0004 7028 jsr 47028 <_ISR_Handler_initialization> /* * Initialize the internal support API and allocator Mutex */ _Objects_Information_table[OBJECTS_INTERNAL_API] = _Internal_Objects; _API_Mutex_Initialization( 1 ); 46384: 4878 0001 pea 1 _ISR_Handler_initialization(); /* * Initialize the internal support API and allocator Mutex */ _Objects_Information_table[OBJECTS_INTERNAL_API] = _Internal_Objects; 46388: 203c 0005 ef8e movel #389006,%d0 4638e: 23c0 0005 ef34 movel %d0,5ef34 <_Objects_Information_table+0x4> _API_Mutex_Initialization( 1 ); 46394: 4eb9 0004 6738 jsr 46738 <_API_Mutex_Initialization> _API_Mutex_Allocate( &_RTEMS_Allocator_Mutex ); 4639a: 4879 0005 f02a pea 5f02a <_RTEMS_Allocator_Mutex> 463a0: 4eb9 0004 66a0 jsr 466a0 <_API_Mutex_Allocate> #include #endif Objects_Information *_Internal_Objects[ OBJECTS_INTERNAL_CLASSES_LAST + 1 ]; void rtems_initialize_data_structures(void) 463a6: 508f addql #8,%sp RTEMS_INLINE_ROUTINE void _Priority_Handler_initialization( void ) { int index; _Priority_Major_bit_map = 0; 463a8: 41f9 0005 f098 lea 5f098 <_Priority_Bit_map>,%a0 463ae: 4240 clrw %d0 463b0: 33c0 0005 f028 movew %d0,5f028 <_Priority_Major_bit_map> for ( index=0 ; index <16 ; index++ ) _Priority_Bit_map[ index ] = 0; 463b6: 4258 clrw %a0@+ RTEMS_INLINE_ROUTINE void _Priority_Handler_initialization( void ) { int index; _Priority_Major_bit_map = 0; for ( index=0 ; index <16 ; index++ ) 463b8: b1fc 0005 f0b8 cmpal #389304,%a0 463be: 66f6 bnes 463b6 _API_Mutex_Initialization( 1 ); _API_Mutex_Allocate( &_RTEMS_Allocator_Mutex ); _Priority_Handler_initialization(); _Watchdog_Handler_initialization(); 463c0: 4eb9 0004 9058 jsr 49058 <_Watchdog_Handler_initialization> _TOD_Handler_initialization(); 463c6: 4eb9 0004 6bbc jsr 46bbc <_TOD_Handler_initialization> _Thread_Handler_initialization(); 463cc: 4eb9 0004 80d8 jsr 480d8 <_Thread_Handler_initialization> _MPCI_Handler_initialization( RTEMS_TIMEOUT ); #endif /* MANAGERS */ _RTEMS_API_Initialize(); 463d2: 4eb9 0004 65b0 jsr 465b0 <_RTEMS_API_Initialize> _Extension_Manager_initialization(); 463d8: 4eb9 0004 6428 jsr 46428 <_Extension_Manager_initialization> _IO_Manager_initialization(); 463de: 4eb9 0004 64a6 jsr 464a6 <_IO_Manager_initialization> #ifdef RTEMS_POSIX_API _POSIX_API_Initialize(); 463e4: 4eb9 0004 655c jsr 4655c <_POSIX_API_Initialize> _Thread_Create_idle(); /* * Scheduling can properly occur now as long as we avoid dispatching. */ } 463ea: 4e5e unlk %fp 463ec: 7001 moveq #1,%d0 463ee: 23c0 0005 f100 movel %d0,5f100 <_System_state_Current> * _Thread_Executing and _Thread_Heir are not set. * * At this point all API extensions are in place. After the call to * _Thread_Create_idle() _Thread_Executing and _Thread_Heir will be set. */ _Thread_Create_idle(); 463f4: 4ef9 0004 7b78 jmp 47b78 <_Thread_Create_idle> ... 000482e8 : 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 ) { 482e8: 4e56 fff4 linkw %fp,#-12 482ec: 226e 000c moveal %fp@(12),%a1 482f0: 48d7 040c moveml %d2-%d3/%a2,%sp@ 482f4: 242e 0008 movel %fp@(8),%d2 482f8: 246e 0010 moveal %fp@(16),%a2 rtems_device_major_number major_limit = _IO_Number_of_drivers; 482fc: 2039 0006 590a movel 6590a <_IO_Number_of_drivers>,%d0 if ( rtems_interrupt_is_in_progress() ) 48302: 2239 0006 50ea movel 650ea <_ISR_Nest_level>,%d1 48308: 6600 009c bnew 483a6 return RTEMS_CALLED_FROM_ISR; if ( registered_major == NULL ) 4830c: 4a8a tstl %a2 4830e: 6700 00ea beqw 483fa return RTEMS_INVALID_ADDRESS; /* Set it to an invalid value */ *registered_major = major_limit; 48312: 2480 movel %d0,%a2@ if ( driver_table == NULL ) 48314: 4a89 tstl %a1 48316: 6700 00e2 beqw 483fa static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 4831a: 4a91 tstl %a1@ 4831c: 6700 00d4 beqw 483f2 return RTEMS_INVALID_ADDRESS; if ( rtems_io_is_empty_table( driver_table ) ) return RTEMS_INVALID_ADDRESS; if ( major >= major_limit ) 48320: b480 cmpl %d0,%d2 48322: 6476 bccs 4839a rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 48324: 2039 0006 5050 movel 65050 <_Thread_Dispatch_disable_level>,%d0 4832a: 5280 addql #1,%d0 4832c: 23c0 0006 5050 movel %d0,65050 <_Thread_Dispatch_disable_level> return RTEMS_INVALID_NUMBER; _Thread_Disable_dispatch(); if ( major == 0 ) { 48332: 4a82 tstl %d2 48334: 667c bnes 483b2 static rtems_status_code rtems_io_obtain_major_number( rtems_device_major_number *major ) { rtems_device_major_number n = _IO_Number_of_drivers; 48336: 2039 0006 590a movel 6590a <_IO_Number_of_drivers>,%d0 rtems_device_major_number m = 0; /* major is error checked by caller */ for ( m = 0; m < n; ++m ) { 4833c: 6700 00fc beqw 4843a 48340: 2239 0006 590e movel 6590e <_IO_Driver_address_table>,%d1 48346: 2041 moveal %d1,%a0 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 48348: 4a90 tstl %a0@ 4834a: 6700 008e beqw 483da 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 ) { 4834e: 5282 addql #1,%d2 48350: 41e8 0018 lea %a0@(24),%a0 48354: b480 cmpl %d0,%d2 48356: 65f0 bcss 48348 if ( rtems_io_is_empty_table( table ) ) break; } /* Assigns invalid value in case of failure */ *major = m; 48358: 2482 movel %d2,%a2@ if ( m != n ) 4835a: b480 cmpl %d0,%d2 4835c: 6700 00de beqw 4843c 48360: 2602 movel %d2,%d3 48362: 2002 movel %d2,%d0 48364: 2041 moveal %d1,%a0 48366: e78b lsll #3,%d3 48368: eb88 lsll #5,%d0 4836a: 9083 subl %d3,%d0 4836c: d1c0 addal %d0,%a0 } *registered_major = major; } _IO_Driver_address_table [major] = *driver_table; 4836e: 20d9 movel %a1@+,%a0@+ 48370: 20d9 movel %a1@+,%a0@+ 48372: 20d9 movel %a1@+,%a0@+ 48374: 20d9 movel %a1@+,%a0@+ 48376: 20d9 movel %a1@+,%a0@+ 48378: 2091 movel %a1@,%a0@ _Thread_Enable_dispatch(); 4837a: 4eb9 0004 9e8c jsr 49e8c <_Thread_Enable_dispatch> return rtems_io_initialize( major, 0, NULL ); 48380: 2d42 0008 movel %d2,%fp@(8) } 48384: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 4838a: 42ae 0010 clrl %fp@(16) 4838e: 42ae 000c clrl %fp@(12) } 48392: 4e5e unlk %fp _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 48394: 4ef9 0005 1290 jmp 51290 return RTEMS_INVALID_ADDRESS; if ( rtems_io_is_empty_table( driver_table ) ) return RTEMS_INVALID_ADDRESS; if ( major >= major_limit ) 4839a: 700a moveq #10,%d0 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); } 4839c: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 483a2: 4e5e unlk %fp 483a4: 4e75 rts rtems_device_major_number *registered_major ) { rtems_device_major_number major_limit = _IO_Number_of_drivers; if ( rtems_interrupt_is_in_progress() ) 483a6: 7012 moveq #18,%d0 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); } 483a8: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 483ae: 4e5e unlk %fp 483b0: 4e75 rts _Thread_Enable_dispatch(); return sc; } major = *registered_major; } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major; 483b2: 2202 movel %d2,%d1 483b4: 2002 movel %d2,%d0 483b6: e789 lsll #3,%d1 483b8: eb88 lsll #5,%d0 483ba: 2079 0006 590e moveal 6590e <_IO_Driver_address_table>,%a0 483c0: 9081 subl %d1,%d0 483c2: d1c0 addal %d0,%a0 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 483c4: 4a90 tstl %a0@ 483c6: 673e beqs 48406 major = *registered_major; } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major; if ( !rtems_io_is_empty_table( table ) ) { _Thread_Enable_dispatch(); 483c8: 4eb9 0004 9e8c jsr 49e8c <_Thread_Enable_dispatch> 483ce: 700c moveq #12,%d0 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); } 483d0: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 483d6: 4e5e unlk %fp 483d8: 4e75 rts static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 483da: 4aa8 0004 tstl %a0@(4) 483de: 6700 ff78 beqw 48358 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 ) { 483e2: 5282 addql #1,%d2 483e4: 41e8 0018 lea %a0@(24),%a0 483e8: b480 cmpl %d0,%d2 483ea: 6500 ff5c bcsw 48348 483ee: 6000 ff68 braw 48358 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 483f2: 4aa9 0004 tstl %a1@(4) 483f6: 6600 ff28 bnew 48320 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 483fa: 7009 moveq #9,%d0 } 483fc: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 48402: 4e5e unlk %fp 48404: 4e75 rts static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 48406: 4aa8 0004 tstl %a0@(4) 4840a: 66bc bnes 483c8 } *registered_major = major; } _IO_Driver_address_table [major] = *driver_table; 4840c: 20d9 movel %a1@+,%a0@+ 4840e: 20d9 movel %a1@+,%a0@+ 48410: 20d9 movel %a1@+,%a0@+ 48412: 20d9 movel %a1@+,%a0@+ 48414: 20d9 movel %a1@+,%a0@+ 48416: 2091 movel %a1@,%a0@ if ( !rtems_io_is_empty_table( table ) ) { _Thread_Enable_dispatch(); return RTEMS_RESOURCE_IN_USE; } *registered_major = major; 48418: 2482 movel %d2,%a2@ } _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); 4841a: 4eb9 0004 9e8c jsr 49e8c <_Thread_Enable_dispatch> return rtems_io_initialize( major, 0, NULL ); 48420: 2d42 0008 movel %d2,%fp@(8) } 48424: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 4842a: 42ae 0010 clrl %fp@(16) 4842e: 42ae 000c clrl %fp@(12) } 48432: 4e5e unlk %fp _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 48434: 4ef9 0005 1290 jmp 51290 if ( rtems_io_is_empty_table( table ) ) break; } /* Assigns invalid value in case of failure */ *major = m; 4843a: 4292 clrl %a2@ <== NOT EXECUTED if ( major == 0 ) { rtems_status_code sc = rtems_io_obtain_major_number( registered_major ); if ( sc != RTEMS_SUCCESSFUL ) { _Thread_Enable_dispatch(); 4843c: 4eb9 0004 9e8c jsr 49e8c <_Thread_Enable_dispatch> 48442: 7005 moveq #5,%d0 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); } 48444: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 4844a: 4e5e unlk %fp ... 00047770 : rtems_status_code rtems_object_get_class_information( int the_api, int the_class, rtems_object_api_class_information *info ) { 47770: 4e56 0000 linkw %fp,#0 47774: 2f0a movel %a2,%sp@- 47776: 246e 0010 moveal %fp@(16),%a2 4777a: 2f02 movel %d2,%sp@- int i; /* * Validate parameters and look up information structure. */ if ( !info ) 4777c: 4a8a tstl %a2 4777e: 6766 beqs 477e6 return RTEMS_INVALID_ADDRESS; obj_info = _Objects_Get_information( the_api, the_class ); 47780: 2f2e 000c movel %fp@(12),%sp@- 47784: 2f2e 0008 movel %fp@(8),%sp@- 47788: 4eb9 0004 937c jsr 4937c <_Objects_Get_information> if ( !obj_info ) 4778e: 508f addql #8,%sp * Validate parameters and look up information structure. */ if ( !info ) return RTEMS_INVALID_ADDRESS; obj_info = _Objects_Get_information( the_api, the_class ); 47790: 2040 moveal %d0,%a0 if ( !obj_info ) 47792: 4a80 tstl %d0 47794: 675e beqs 477f4 return RTEMS_INVALID_NUMBER; /* * Return information about this object class to the user. */ info->minimum_id = obj_info->minimum_id; 47796: 24a8 0006 movel %a0@(6),%a2@ info->maximum_id = obj_info->maximum_id; info->auto_extend = obj_info->auto_extend; info->maximum = obj_info->maximum; 4779a: 4282 clrl %d2 /* * Return information about this object class to the user. */ info->minimum_id = obj_info->minimum_id; info->maximum_id = obj_info->maximum_id; 4779c: 2568 000a 0004 movel %a0@(10),%a2@(4) info->auto_extend = obj_info->auto_extend; info->maximum = obj_info->maximum; 477a2: 3428 000e movew %a0@(14),%d2 /* * Return information about this object class to the user. */ info->minimum_id = obj_info->minimum_id; info->maximum_id = obj_info->maximum_id; info->auto_extend = obj_info->auto_extend; 477a6: 1568 0010 000c moveb %a0@(16),%a2@(12) info->maximum = obj_info->maximum; 477ac: 2542 0008 movel %d2,%a2@(8) for ( unallocated=0, i=1 ; i <= info->maximum ; i++ ) 477b0: 6750 beqs 47802 477b2: 2068 0018 moveal %a0@(24),%a0 477b6: 7201 moveq #1,%d1 477b8: 7001 moveq #1,%d0 477ba: 93c9 subal %a1,%a1 477bc: 5280 addql #1,%d0 if ( !obj_info->local_table[i] ) 477be: 4ab0 1c00 tstl %a0@(00000000,%d1:l:4) 477c2: 6718 beqs 477dc info->minimum_id = obj_info->minimum_id; info->maximum_id = obj_info->maximum_id; info->auto_extend = obj_info->auto_extend; info->maximum = obj_info->maximum; for ( unallocated=0, i=1 ; i <= info->maximum ; i++ ) 477c4: 2200 movel %d0,%d1 477c6: b082 cmpl %d2,%d0 477c8: 63f2 blss 477bc if ( !obj_info->local_table[i] ) unallocated++; info->unallocated = unallocated; 477ca: 2549 000e movel %a1,%a2@(14) 477ce: 4280 clrl %d0 return RTEMS_SUCCESSFUL; } 477d0: 242e fff8 movel %fp@(-8),%d2 477d4: 246e fffc moveal %fp@(-4),%a2 477d8: 4e5e unlk %fp 477da: 4e75 rts info->auto_extend = obj_info->auto_extend; info->maximum = obj_info->maximum; for ( unallocated=0, i=1 ; i <= info->maximum ; i++ ) if ( !obj_info->local_table[i] ) unallocated++; 477dc: 5289 addql #1,%a1 info->minimum_id = obj_info->minimum_id; info->maximum_id = obj_info->maximum_id; info->auto_extend = obj_info->auto_extend; info->maximum = obj_info->maximum; for ( unallocated=0, i=1 ; i <= info->maximum ; i++ ) 477de: 2200 movel %d0,%d1 477e0: b082 cmpl %d2,%d0 477e2: 63d8 blss 477bc 477e4: 60e4 bras 477ca unallocated++; info->unallocated = unallocated; return RTEMS_SUCCESSFUL; } 477e6: 242e fff8 movel %fp@(-8),%d2 int i; /* * Validate parameters and look up information structure. */ if ( !info ) 477ea: 7009 moveq #9,%d0 unallocated++; info->unallocated = unallocated; return RTEMS_SUCCESSFUL; } 477ec: 246e fffc moveal %fp@(-4),%a2 477f0: 4e5e unlk %fp 477f2: 4e75 rts 477f4: 242e fff8 movel %fp@(-8),%d2 */ if ( !info ) return RTEMS_INVALID_ADDRESS; obj_info = _Objects_Get_information( the_api, the_class ); if ( !obj_info ) 477f8: 700a moveq #10,%d0 unallocated++; info->unallocated = unallocated; return RTEMS_SUCCESSFUL; } 477fa: 246e fffc moveal %fp@(-4),%a2 477fe: 4e5e unlk %fp 47800: 4e75 rts info->minimum_id = obj_info->minimum_id; info->maximum_id = obj_info->maximum_id; info->auto_extend = obj_info->auto_extend; info->maximum = obj_info->maximum; for ( unallocated=0, i=1 ; i <= info->maximum ; i++ ) 47802: 93c9 subal %a1,%a1 <== NOT EXECUTED if ( !obj_info->local_table[i] ) unallocated++; info->unallocated = unallocated; 47804: 4280 clrl %d0 <== NOT EXECUTED 47806: 2549 000e movel %a1,%a2@(14) <== NOT EXECUTED 4780a: 60c4 bras 477d0 <== NOT EXECUTED 0007b7b0 : rtems_status_code rtems_rate_monotonic_period( rtems_id id, rtems_interval length ) { 7b7b0: 4e56 ffec linkw %fp,#-20 7b7b4: 48d7 040c moveml %d2-%d3/%a2,%sp@ 7b7b8: 486e fffc pea %fp@(-4) 7b7bc: 242e 0008 movel %fp@(8),%d2 7b7c0: 2f02 movel %d2,%sp@- 7b7c2: 4879 000a 7530 pea a7530 <_Rate_monotonic_Information> 7b7c8: 4eb9 0004 c5f8 jsr 4c5f8 <_Objects_Get> rtems_rate_monotonic_period_states local_state; ISR_Level level; the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 7b7ce: 4fef 000c lea %sp@(12),%sp 7b7d2: 2440 moveal %d0,%a2 7b7d4: 4aae fffc tstl %fp@(-4) 7b7d8: 661e bnes 7b7f8 case OBJECTS_LOCAL: if ( !_Thread_Is_executing( the_period->owner ) ) { 7b7da: 2039 000a 6b46 movel a6b46 <_Thread_Executing>,%d0 7b7e0: b0aa 0040 cmpl %a2@(64),%d0 7b7e4: 671e beqs 7b804 _Thread_Enable_dispatch(); 7b7e6: 4eb9 0004 cf38 jsr 4cf38 <_Thread_Enable_dispatch> 7b7ec: 7017 moveq #23,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 7b7ee: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 7b7f4: 4e5e unlk %fp 7b7f6: 4e75 rts the_period->state = RATE_MONOTONIC_ACTIVE; the_period->next_length = length; _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); return RTEMS_TIMEOUT; 7b7f8: 7004 moveq #4,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 7b7fa: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 7b800: 4e5e unlk %fp 7b802: 4e75 rts if ( !_Thread_Is_executing( the_period->owner ) ) { _Thread_Enable_dispatch(); return RTEMS_NOT_OWNER_OF_RESOURCE; } if ( length == RTEMS_PERIOD_STATUS ) { 7b804: 4aae 000c tstl %fp@(12) 7b808: 6700 00ce beqw 7b8d8 } _Thread_Enable_dispatch(); return( return_value ); } _ISR_Disable( level ); 7b80c: 203c 0000 0700 movel #1792,%d0 7b812: 40c3 movew %sr,%d3 7b814: 8083 orl %d3,%d0 7b816: 46c0 movew %d0,%sr switch ( the_period->state ) { 7b818: 202a 0038 movel %a2@(56),%d0 7b81c: 7202 moveq #2,%d1 7b81e: b280 cmpl %d0,%d1 7b820: 6700 00dc beqw 7b8fe 7b824: 123c 0004 moveb #4,%d1 7b828: b280 cmpl %d0,%d1 7b82a: 6762 beqs 7b88e 7b82c: 4a80 tstl %d0 7b82e: 66c8 bnes 7b7f8 case RATE_MONOTONIC_INACTIVE: { _ISR_Enable( level ); 7b830: 46c3 movew %d3,%sr /* * Baseline statistics information for the beginning of a period. */ _Rate_monotonic_Initiate_statistics( the_period ); 7b832: 2f0a movel %a2,%sp@- 7b834: 2d40 fff8 movel %d0,%fp@(-8) 7b838: 4eb9 0007 b568 jsr 7b568 <_Rate_monotonic_Initiate_statistics> Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 7b83e: 223c 0007 b99c movel #506268,%d1 the_watchdog->id = id; 7b844: 2542 0030 movel %d2,%a2@(48) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 7b848: 242e 000c movel %fp@(12),%d2 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 7b84c: 2541 002c movel %d1,%a2@(44) the_period->state = RATE_MONOTONIC_ACTIVE; 7b850: 7202 moveq #2,%d1 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 7b852: 2542 001c movel %d2,%a2@(28) 7b856: 2541 0038 movel %d1,%a2@(56) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 7b85a: 42aa 0018 clrl %a2@(24) the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 7b85e: 42aa 0034 clrl %a2@(52) _Rate_monotonic_Timeout, id, NULL ); the_period->next_length = length; 7b862: 2542 003c movel %d2,%a2@(60) ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 7b866: 486a 0010 pea %a2@(16) 7b86a: 4879 000a 6b64 pea a6b64 <_Watchdog_Ticks_chain> 7b870: 4eb9 0004 e0d8 jsr 4e0d8 <_Watchdog_Insert> _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 7b876: 4eb9 0004 cf38 jsr 4cf38 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 7b87c: 202e fff8 movel %fp@(-8),%d0 7b880: 4fef 000c lea %sp@(12),%sp case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 7b884: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 7b88a: 4e5e unlk %fp 7b88c: 4e75 rts case RATE_MONOTONIC_EXPIRED: /* * Update statistics from the concluding period */ _Rate_monotonic_Update_statistics( the_period ); 7b88e: 2f0a movel %a2,%sp@- 7b890: 4eb9 0007 b696 jsr 7b696 <_Rate_monotonic_Update_statistics> _ISR_Enable( level ); 7b896: 46c3 movew %d3,%sr the_period->state = RATE_MONOTONIC_ACTIVE; 7b898: 7202 moveq #2,%d1 the_period->next_length = length; _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 7b89a: 7006 moveq #6,%d0 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 7b89c: 242e 000c movel %fp@(12),%d2 */ _Rate_monotonic_Update_statistics( the_period ); _ISR_Enable( level ); the_period->state = RATE_MONOTONIC_ACTIVE; 7b8a0: 2541 0038 movel %d1,%a2@(56) 7b8a4: 2542 001c movel %d2,%a2@(28) the_period->next_length = length; 7b8a8: 2542 003c movel %d2,%a2@(60) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 7b8ac: 486a 0010 pea %a2@(16) 7b8b0: 4879 000a 6b64 pea a6b64 <_Watchdog_Ticks_chain> 7b8b6: 2d40 fff8 movel %d0,%fp@(-8) 7b8ba: 4eb9 0004 e0d8 jsr 4e0d8 <_Watchdog_Insert> _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 7b8c0: 4eb9 0004 cf38 jsr 4cf38 <_Thread_Enable_dispatch> return RTEMS_TIMEOUT; 7b8c6: 202e fff8 movel %fp@(-8),%d0 7b8ca: 4fef 000c lea %sp@(12),%sp case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 7b8ce: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 7b8d4: 4e5e unlk %fp 7b8d6: 4e75 rts _Thread_Enable_dispatch(); return RTEMS_NOT_OWNER_OF_RESOURCE; } if ( length == RTEMS_PERIOD_STATUS ) { switch ( the_period->state ) { 7b8d8: 202a 0038 movel %a2@(56),%d0 7b8dc: 7204 moveq #4,%d1 7b8de: b280 cmpl %d0,%d1 7b8e0: 6400 009c bccw 7b97e 7b8e4: 4280 clrl %d0 <== NOT EXECUTED case RATE_MONOTONIC_ACTIVE: default: /* unreached -- only to remove warnings */ return_value = RTEMS_SUCCESSFUL; break; } _Thread_Enable_dispatch(); 7b8e6: 2d40 fff8 movel %d0,%fp@(-8) <== NOT EXECUTED 7b8ea: 4eb9 0004 cf38 jsr 4cf38 <_Thread_Enable_dispatch> <== NOT EXECUTED return( return_value ); 7b8f0: 202e fff8 movel %fp@(-8),%d0 <== NOT EXECUTED case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 7b8f4: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 7b8fa: 4e5e unlk %fp 7b8fc: 4e75 rts case RATE_MONOTONIC_ACTIVE: /* * Update statistics from the concluding period. */ _Rate_monotonic_Update_statistics( the_period ); 7b8fe: 2f0a movel %a2,%sp@- 7b900: 4eb9 0007 b696 jsr 7b696 <_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; 7b906: 242e 000c movel %fp@(12),%d2 /* * This tells the _Rate_monotonic_Timeout that this task is * in the process of blocking on the period and that we * may be changing the length of the next period. */ the_period->state = RATE_MONOTONIC_OWNER_IS_BLOCKING; 7b90a: 7001 moveq #1,%d0 the_period->next_length = length; 7b90c: 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; 7b910: 2540 0038 movel %d0,%a2@(56) the_period->next_length = length; _ISR_Enable( level ); 7b914: 46c3 movew %d3,%sr _Thread_Executing->Wait.id = the_period->Object.id; 7b916: 2079 000a 6b46 moveal a6b46 <_Thread_Executing>,%a0 7b91c: 216a 0008 0020 movel %a2@(8),%a0@(32) _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 7b922: 4878 4000 pea 4000 7b926: 2f08 movel %a0,%sp@- 7b928: 4eb9 0004 d89c jsr 4d89c <_Thread_Set_state> /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); 7b92e: 203c 0000 0700 movel #1792,%d0 7b934: 40c1 movew %sr,%d1 7b936: 8081 orl %d1,%d0 7b938: 46c0 movew %d0,%sr local_state = the_period->state; the_period->state = RATE_MONOTONIC_ACTIVE; 7b93a: 7402 moveq #2,%d2 /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); local_state = the_period->state; 7b93c: 202a 0038 movel %a2@(56),%d0 the_period->state = RATE_MONOTONIC_ACTIVE; 7b940: 2542 0038 movel %d2,%a2@(56) _ISR_Enable( level ); 7b944: 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 ) 7b946: 7203 moveq #3,%d1 7b948: 4fef 000c lea %sp@(12),%sp 7b94c: b280 cmpl %d0,%d1 7b94e: 6712 beqs 7b962 _Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); _Thread_Enable_dispatch(); 7b950: 4eb9 0004 cf38 jsr 4cf38 <_Thread_Enable_dispatch> 7b956: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 7b958: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 7b95e: 4e5e unlk %fp 7b960: 4e75 rts /* * If it did, then we want to unblock ourself and continue as * if nothing happen. The period was reset in the timeout routine. */ if ( local_state == RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING ) _Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 7b962: 4878 4000 pea 4000 7b966: 2f39 000a 6b46 movel a6b46 <_Thread_Executing>,%sp@- 7b96c: 4eb9 0004 cb64 jsr 4cb64 <_Thread_Clear_state> 7b972: 508f addql #8,%sp _Thread_Enable_dispatch(); 7b974: 4eb9 0004 cf38 jsr 4cf38 <_Thread_Enable_dispatch> 7b97a: 4280 clrl %d0 7b97c: 60da bras 7b958 _Thread_Enable_dispatch(); return RTEMS_NOT_OWNER_OF_RESOURCE; } if ( length == RTEMS_PERIOD_STATUS ) { switch ( the_period->state ) { 7b97e: 41f9 000a 0ac0 lea a0ac0 ,%a0 7b984: 2030 0c00 movel %a0@(00000000,%d0:l:4),%d0 case RATE_MONOTONIC_ACTIVE: default: /* unreached -- only to remove warnings */ return_value = RTEMS_SUCCESSFUL; break; } _Thread_Enable_dispatch(); 7b988: 2d40 fff8 movel %d0,%fp@(-8) 7b98c: 4eb9 0004 cf38 jsr 4cf38 <_Thread_Enable_dispatch> return( return_value ); 7b992: 202e fff8 movel %fp@(-8),%d0 7b996: 6000 ff5c braw 7b8f4 ... 00069e48 : */ void rtems_rate_monotonic_report_statistics_with_plugin( void *context, rtems_printk_plugin_t print ) { 69e48: 4e56 ff78 linkw %fp,#-136 69e4c: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 69e50: 262e 0008 movel %fp@(8),%d3 69e54: 246e 000c moveal %fp@(12),%a2 rtems_id id; rtems_rate_monotonic_period_statistics the_stats; rtems_rate_monotonic_period_status the_status; char name[5]; if ( !print ) 69e58: 4a8a tstl %a2 69e5a: 6700 0082 beqw 69ede return; (*print)( context, "Period information by period\n" ); 69e5e: 4879 0009 d696 pea 9d696 <_TOD_Days_per_month+0x68> 69e64: 2f03 movel %d3,%sp@- 69e66: 4e92 jsr %a2@ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ (*print)( context, "--- CPU times are in seconds ---\n" ); 69e68: 4879 0009 d6b4 pea 9d6b4 <_TOD_Days_per_month+0x86> 69e6e: 2f03 movel %d3,%sp@- 69e70: 4e92 jsr %a2@ (*print)( context, "--- Wall times are in seconds ---\n" ); 69e72: 4879 0009 d6d6 pea 9d6d6 <_TOD_Days_per_month+0xa8> 69e78: 2f03 movel %d3,%sp@- 69e7a: 4e92 jsr %a2@ Be sure to test the various cases. (*print)( context,"\ 1234567890123456789012345678901234567890123456789012345678901234567890123456789\ \n"); */ (*print)( context, " ID OWNER COUNT MISSED " 69e7c: 4879 0009 d6f9 pea 9d6f9 <_TOD_Days_per_month+0xcb> 69e82: 2f03 movel %d3,%sp@- 69e84: 4e92 jsr %a2@ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ " " #endif " WALL TIME\n" ); (*print)( context, " " 69e86: 4fef 001c lea %sp@(28),%sp 69e8a: 2ebc 0009 d744 movel #644932,%sp@ 69e90: 2f03 movel %d3,%sp@- 69e92: 4e92 jsr %a2@ /* * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 69e94: 2439 000a 7536 movel a7536 <_Rate_monotonic_Information+0x6>,%d2 69e9a: 508f addql #8,%sp 69e9c: b4b9 000a 753a cmpl a753a <_Rate_monotonic_Information+0xa>,%d2 69ea2: 623a bhis 69ede 69ea4: 280e movel %fp,%d4 #if defined(RTEMS_DEBUG) if ( status != RTEMS_SUCCESSFUL ) continue; #endif rtems_object_get_name( the_status.owner, sizeof(name), name ); 69ea6: 2a0e movel %fp,%d5 69ea8: 0684 ffff ffa2 addil #-94,%d4 69eae: 47f9 0007 b3e0 lea 7b3e0 ,%a3 status = rtems_rate_monotonic_get_statistics( id, &the_stats ); if ( status != RTEMS_SUCCESSFUL ) continue; /* If the above passed, so should this but check it anyway */ status = rtems_rate_monotonic_get_status( id, &the_status ); 69eb4: 4bf9 0007 b4a0 lea 7b4a0 ,%a5 #if defined(RTEMS_DEBUG) if ( status != RTEMS_SUCCESSFUL ) continue; #endif rtems_object_get_name( the_status.owner, sizeof(name), name ); 69eba: 5b85 subql #5,%d5 69ebc: 49f9 0004 a93c lea 4a93c ,%a4 struct timespec cpu_average; struct timespec *min_cpu = &the_stats.min_cpu_time; struct timespec *max_cpu = &the_stats.max_cpu_time; struct timespec *total_cpu = &the_stats.total_cpu_time; _Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average ); 69ec2: 2e3c 0006 b69c movel #439964,%d7 * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; id <= _Rate_monotonic_Information.maximum_id ; id++ ) { status = rtems_rate_monotonic_get_statistics( id, &the_stats ); 69ec8: 2f04 movel %d4,%sp@- 69eca: 2f02 movel %d2,%sp@- 69ecc: 4e93 jsr %a3@ if ( status != RTEMS_SUCCESSFUL ) 69ece: 508f addql #8,%sp 69ed0: 4a80 tstl %d0 69ed2: 6714 beqs 69ee8 * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; id <= _Rate_monotonic_Information.maximum_id ; id++ ) { 69ed4: 5282 addql #1,%d2 /* * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 69ed6: b4b9 000a 753a cmpl a753a <_Rate_monotonic_Information+0xa>,%d2 69edc: 63ea blss 69ec8 the_stats.min_wall_time, the_stats.max_wall_time, ival_wall, fval_wall ); #endif } } } 69ede: 4cee 3cfc ff78 moveml %fp@(-136),%d2-%d7/%a2-%a5 69ee4: 4e5e unlk %fp 69ee6: 4e75 rts status = rtems_rate_monotonic_get_statistics( id, &the_stats ); if ( status != RTEMS_SUCCESSFUL ) continue; /* If the above passed, so should this but check it anyway */ status = rtems_rate_monotonic_get_status( id, &the_status ); 69ee8: 486e ffda pea %fp@(-38) 69eec: 2f02 movel %d2,%sp@- 69eee: 4e95 jsr %a5@ #if defined(RTEMS_DEBUG) if ( status != RTEMS_SUCCESSFUL ) continue; #endif rtems_object_get_name( the_status.owner, sizeof(name), name ); 69ef0: 2f05 movel %d5,%sp@- 69ef2: 4878 0005 pea 5 69ef6: 2f2e ffda movel %fp@(-38),%sp@- 69efa: 4e94 jsr %a4@ /* * Print part of report line that is not dependent on granularity */ (*print)( context, 69efc: 2f2e ffa6 movel %fp@(-90),%sp@- 69f00: 2f2e ffa2 movel %fp@(-94),%sp@- 69f04: 2f05 movel %d5,%sp@- 69f06: 2f02 movel %d2,%sp@- 69f08: 4879 0009 d790 pea 9d790 <_TOD_Days_per_month+0x162> 69f0e: 2f03 movel %d3,%sp@- 69f10: 4e92 jsr %a2@ ); /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { 69f12: 202e ffa2 movel %fp@(-94),%d0 69f16: 4fef 002c lea %sp@(44),%sp 69f1a: 6618 bnes 69f34 (*print)( context, "\n" ); 69f1c: 4879 0009 ef87 pea 9ef87 <__FUNCTION__.5975+0x5d> * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; id <= _Rate_monotonic_Information.maximum_id ; id++ ) { 69f22: 5282 addql #1,%d2 /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { (*print)( context, "\n" ); 69f24: 2f03 movel %d3,%sp@- 69f26: 4e92 jsr %a2@ continue; 69f28: 508f addql #8,%sp /* * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 69f2a: b4b9 000a 753a cmpl a753a <_Rate_monotonic_Information+0xa>,%d2 69f30: 6396 blss 69ec8 69f32: 60aa bras 69ede <== NOT EXECUTED struct timespec cpu_average; struct timespec *min_cpu = &the_stats.min_cpu_time; struct timespec *max_cpu = &the_stats.max_cpu_time; struct timespec *total_cpu = &the_stats.total_cpu_time; _Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average ); 69f34: 486e fff2 pea %fp@(-14) 69f38: 2047 moveal %d7,%a0 * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; id <= _Rate_monotonic_Information.maximum_id ; id++ ) { 69f3a: 5282 addql #1,%d2 struct timespec cpu_average; struct timespec *min_cpu = &the_stats.min_cpu_time; struct timespec *max_cpu = &the_stats.max_cpu_time; struct timespec *total_cpu = &the_stats.total_cpu_time; _Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average ); 69f3c: 2f00 movel %d0,%sp@- 69f3e: 486e ffba pea %fp@(-70) 69f42: 4e90 jsr %a0@ (*print)( context, 69f44: 202e fff6 movel %fp@(-10),%d0 69f48: 223c 0000 03e8 movel #1000,%d1 69f4e: 4c41 0800 remsl %d1,%d0,%d0 69f52: 2c2e ffb6 movel %fp@(-74),%d6 69f56: 2f00 movel %d0,%sp@- 69f58: 2001 movel %d1,%d0 69f5a: 2f2e fff2 movel %fp@(-14),%sp@- 69f5e: 4c40 6806 remsl %d0,%d6,%d6 69f62: 202e ffae movel %fp@(-82),%d0 69f66: 2246 moveal %d6,%a1 69f68: 223c 0000 03e8 movel #1000,%d1 69f6e: 2f09 movel %a1,%sp@- 69f70: 2f2e ffb2 movel %fp@(-78),%sp@- 69f74: 4c41 0800 remsl %d1,%d0,%d0 struct timespec *min_wall = &the_stats.min_wall_time; struct timespec *max_wall = &the_stats.max_wall_time; struct timespec *total_wall = &the_stats.total_wall_time; _Timespec_Divide_by_integer(total_wall, the_stats.count, &wall_average); (*print)( context, 69f78: 2c3c 0000 03e8 movel #1000,%d6 struct timespec *min_cpu = &the_stats.min_cpu_time; struct timespec *max_cpu = &the_stats.max_cpu_time; struct timespec *total_cpu = &the_stats.total_cpu_time; _Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average ); (*print)( context, 69f7e: 2f00 movel %d0,%sp@- 69f80: 2f2e ffaa movel %fp@(-86),%sp@- 69f84: 4879 0009 d7a7 pea 9d7a7 <_TOD_Days_per_month+0x179> 69f8a: 2f03 movel %d3,%sp@- 69f8c: 4e92 jsr %a2@ struct timespec wall_average; struct timespec *min_wall = &the_stats.min_wall_time; struct timespec *max_wall = &the_stats.max_wall_time; struct timespec *total_wall = &the_stats.total_wall_time; _Timespec_Divide_by_integer(total_wall, the_stats.count, &wall_average); 69f8e: 4fef 002c lea %sp@(44),%sp 69f92: 2047 moveal %d7,%a0 69f94: 486e fff2 pea %fp@(-14) 69f98: 2f2e ffa2 movel %fp@(-94),%sp@- 69f9c: 486e ffd2 pea %fp@(-46) 69fa0: 4e90 jsr %a0@ (*print)( context, 69fa2: 202e fff6 movel %fp@(-10),%d0 69fa6: 4c46 0800 remsl %d6,%d0,%d0 69faa: 222e ffce movel %fp@(-50),%d1 69fae: 2f00 movel %d0,%sp@- 69fb0: 2f2e fff2 movel %fp@(-14),%sp@- 69fb4: 4c46 1801 remsl %d6,%d1,%d1 69fb8: 202e ffc6 movel %fp@(-58),%d0 69fbc: 2241 moveal %d1,%a1 69fbe: 2f09 movel %a1,%sp@- 69fc0: 2f2e ffca movel %fp@(-54),%sp@- 69fc4: 4c46 0800 remsl %d6,%d0,%d0 69fc8: 2f00 movel %d0,%sp@- 69fca: 2f2e ffc2 movel %fp@(-62),%sp@- 69fce: 4879 0009 d7c6 pea 9d7c6 <_TOD_Days_per_month+0x198> 69fd4: 2f03 movel %d3,%sp@- 69fd6: 4e92 jsr %a2@ 69fd8: 4fef 002c lea %sp@(44),%sp /* * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 69fdc: b4b9 000a 753a cmpl a753a <_Rate_monotonic_Information+0xa>,%d2 69fe2: 6300 fee4 blsw 69ec8 69fe6: 6000 fef6 braw 69ede <== NOT EXECUTED 0006a004 : /* * rtems_rate_monotonic_reset_all_statistics */ void rtems_rate_monotonic_reset_all_statistics( void ) { 6a004: 4e56 0000 linkw %fp,#0 6a008: 2039 000a 6a8c movel a6a8c <_Thread_Dispatch_disable_level>,%d0 6a00e: 5280 addql #1,%d0 6a010: 2f0a movel %a2,%sp@- 6a012: 23c0 000a 6a8c movel %d0,a6a8c <_Thread_Dispatch_disable_level> 6a018: 2f02 movel %d2,%sp@- /* * Cycle through all possible ids and try to reset each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 6a01a: 2439 000a 7536 movel a7536 <_Rate_monotonic_Information+0x6>,%d2 6a020: b4b9 000a 753a cmpl a753a <_Rate_monotonic_Information+0xa>,%d2 6a026: 6216 bhis 6a03e 6a028: 45f9 0006 a050 lea 6a050 ,%a2 id <= _Rate_monotonic_Information.maximum_id ; id++ ) { status = rtems_rate_monotonic_reset_statistics( id ); 6a02e: 2f02 movel %d2,%sp@- * Cycle through all possible ids and try to reset each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; id <= _Rate_monotonic_Information.maximum_id ; id++ ) { 6a030: 5282 addql #1,%d2 status = rtems_rate_monotonic_reset_statistics( id ); 6a032: 4e92 jsr %a2@ /* * Cycle through all possible ids and try to reset each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 6a034: 588f addql #4,%sp 6a036: b4b9 000a 753a cmpl a753a <_Rate_monotonic_Information+0xa>,%d2 6a03c: 63f0 blss 6a02e /* * Done so exit thread dispatching disabled critical section. */ _Thread_Enable_dispatch(); } 6a03e: 242e fff8 movel %fp@(-8),%d2 6a042: 246e fffc moveal %fp@(-4),%a2 6a046: 4e5e unlk %fp } /* * Done so exit thread dispatching disabled critical section. */ _Thread_Enable_dispatch(); 6a048: 4ef9 0004 cf38 jmp 4cf38 <_Thread_Enable_dispatch> ... 00057468 : uintptr_t length, uintptr_t page_size, rtems_attribute attribute_set, rtems_id *id ) { 57468: 4e56 ffec linkw %fp,#-20 5746c: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ 57470: 262e 0008 movel %fp@(8),%d3 57474: 242e 000c movel %fp@(12),%d2 57478: 246e 001c moveal %fp@(28),%a2 rtems_status_code return_status; Region_Control *the_region; if ( !rtems_is_name_valid( name ) ) 5747c: 4a83 tstl %d3 5747e: 6700 0096 beqw 57516 return RTEMS_INVALID_NAME; if ( !starting_address ) 57482: 4a82 tstl %d2 57484: 670a beqs 57490 return RTEMS_INVALID_ADDRESS; if ( !id ) 57486: 4a8a tstl %a2 57488: 6706 beqs 57490 return RTEMS_INVALID_ADDRESS; if ( !_Addresses_Is_aligned( starting_address ) ) 5748a: 7003 moveq #3,%d0 5748c: c082 andl %d2,%d0 5748e: 670c beqs 5749c return_status = RTEMS_SUCCESSFUL; } } _RTEMS_Unlock_allocator(); return return_status; 57490: 7009 moveq #9,%d0 } 57492: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3 57498: 4e5e unlk %fp 5749a: 4e75 rts return RTEMS_INVALID_ADDRESS; if ( !_Addresses_Is_aligned( starting_address ) ) return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); /* to prevent deletion */ 5749c: 2f39 0007 e87e movel 7e87e <_RTEMS_Allocator_Mutex>,%sp@- 574a2: 4eb9 0005 9e3c jsr 59e3c <_API_Mutex_Lock> * This function allocates a region control block from * the inactive chain of free region control blocks. */ RTEMS_INLINE_ROUTINE Region_Control *_Region_Allocate( void ) { return (Region_Control *) _Objects_Allocate( &_Region_Information ); 574a8: 4879 0007 e6ca pea 7e6ca <_Region_Information> 574ae: 4eb9 0005 b4cc jsr 5b4cc <_Objects_Allocate> the_region = _Region_Allocate(); if ( !the_region ) 574b4: 508f addql #8,%sp 574b6: 2640 moveal %d0,%a3 574b8: 4a80 tstl %d0 574ba: 6766 beqs 57522 return_status = RTEMS_TOO_MANY; else { the_region->maximum_segment_size = _Heap_Initialize( 574bc: 2f2e 0014 movel %fp@(20),%sp@- 574c0: 2f2e 0010 movel %fp@(16),%sp@- 574c4: 2f02 movel %d2,%sp@- 574c6: 486b 0068 pea %a3@(104) 574ca: 4eb9 0005 af50 jsr 5af50 <_Heap_Initialize> &the_region->Memory, starting_address, length, page_size ); if ( !the_region->maximum_segment_size ) { 574d0: 4fef 0010 lea %sp@(16),%sp if ( !the_region ) return_status = RTEMS_TOO_MANY; else { the_region->maximum_segment_size = _Heap_Initialize( 574d4: 2740 005c movel %d0,%a3@(92) &the_region->Memory, starting_address, length, page_size ); if ( !the_region->maximum_segment_size ) { 574d8: 6662 bnes 5753c */ RTEMS_INLINE_ROUTINE void _Region_Free ( Region_Control *the_region ) { _Objects_Free( &_Region_Information, &the_region->Object ); 574da: 2f0b movel %a3,%sp@- 574dc: 4879 0007 e6ca pea 7e6ca <_Region_Information> 574e2: 103c 0008 moveb #8,%d0 574e6: 2d40 fffc movel %d0,%fp@(-4) 574ea: 4eb9 0005 b804 jsr 5b804 <_Objects_Free> 574f0: 202e fffc movel %fp@(-4),%d0 574f4: 508f addql #8,%sp *id = the_region->Object.id; return_status = RTEMS_SUCCESSFUL; } } _RTEMS_Unlock_allocator(); 574f6: 2f39 0007 e87e movel 7e87e <_RTEMS_Allocator_Mutex>,%sp@- 574fc: 2d40 fffc movel %d0,%fp@(-4) 57500: 4eb9 0005 9e9c jsr 59e9c <_API_Mutex_Unlock> return return_status; 57506: 202e fffc movel %fp@(-4),%d0 5750a: 588f addql #4,%sp } 5750c: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3 57512: 4e5e unlk %fp 57514: 4e75 rts ) { rtems_status_code return_status; Region_Control *the_region; if ( !rtems_is_name_valid( name ) ) 57516: 7003 moveq #3,%d0 } } _RTEMS_Unlock_allocator(); return return_status; } 57518: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3 5751e: 4e5e unlk %fp 57520: 4e75 rts *id = the_region->Object.id; return_status = RTEMS_SUCCESSFUL; } } _RTEMS_Unlock_allocator(); 57522: 2f39 0007 e87e movel 7e87e <_RTEMS_Allocator_Mutex>,%sp@- _RTEMS_Lock_allocator(); /* to prevent deletion */ the_region = _Region_Allocate(); if ( !the_region ) 57528: 7005 moveq #5,%d0 *id = the_region->Object.id; return_status = RTEMS_SUCCESSFUL; } } _RTEMS_Unlock_allocator(); 5752a: 2d40 fffc movel %d0,%fp@(-4) 5752e: 4eb9 0005 9e9c jsr 59e9c <_API_Mutex_Unlock> return return_status; 57534: 202e fffc movel %fp@(-4),%d0 57538: 588f addql #4,%sp 5753a: 60d0 bras 5750c return_status = RTEMS_INVALID_SIZE; } else { the_region->starting_address = starting_address; 5753c: 2742 0050 movel %d2,%a3@(80) the_region->length = length; the_region->page_size = page_size; the_region->attribute_set = attribute_set; the_region->number_of_used_blocks = 0; _Thread_queue_Initialize( 57540: 222e 0018 movel %fp@(24),%d1 } else { the_region->starting_address = starting_address; the_region->length = length; 57544: 202e 0010 movel %fp@(16),%d0 the_region->page_size = page_size; the_region->attribute_set = attribute_set; the_region->number_of_used_blocks = 0; _Thread_queue_Initialize( 57548: e489 lsrl #2,%d1 else { the_region->starting_address = starting_address; the_region->length = length; the_region->page_size = page_size; 5754a: 242e 0014 movel %fp@(20),%d2 the_region->attribute_set = attribute_set; 5754e: 206e 0018 moveal %fp@(24),%a0 } else { the_region->starting_address = starting_address; the_region->length = length; 57552: 2740 0054 movel %d0,%a3@(84) &_Region_Information, &the_region->Object, (Objects_Name) name ); *id = the_region->Object.id; 57556: 4280 clrl %d0 else { the_region->starting_address = starting_address; the_region->length = length; the_region->page_size = page_size; 57558: 2742 0058 movel %d2,%a3@(88) the_region->attribute_set = attribute_set; the_region->number_of_used_blocks = 0; _Thread_queue_Initialize( 5755c: 7401 moveq #1,%d2 else { the_region->starting_address = starting_address; the_region->length = length; the_region->page_size = page_size; the_region->attribute_set = attribute_set; 5755e: 2748 0060 movel %a0,%a3@(96) the_region->number_of_used_blocks = 0; _Thread_queue_Initialize( 57562: c481 andl %d1,%d2 the_region->starting_address = starting_address; the_region->length = length; the_region->page_size = page_size; the_region->attribute_set = attribute_set; the_region->number_of_used_blocks = 0; 57564: 42ab 0064 clrl %a3@(100) _Thread_queue_Initialize( 57568: 4878 0006 pea 6 5756c: 4878 0040 pea 40 57570: 2f02 movel %d2,%sp@- 57572: 486b 0010 pea %a3@(16) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 57576: 4282 clrl %d2 57578: 2d40 fffc movel %d0,%fp@(-4) 5757c: 4eb9 0005 cac8 jsr 5cac8 <_Thread_queue_Initialize> 57582: 222b 0008 movel %a3@(8),%d1 &_Region_Information, &the_region->Object, (Objects_Name) name ); *id = the_region->Object.id; 57586: 4fef 0010 lea %sp@(16),%sp 5758a: 2079 0007 e6e2 moveal 7e6e2 <_Region_Information+0x18>,%a0 57590: 3401 movew %d1,%d2 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 57592: 2743 000c movel %d3,%a3@(12) 57596: 202e fffc movel %fp@(-4),%d0 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 5759a: 218b 2c00 movel %a3,%a0@(00000000,%d2:l:4) 5759e: 2481 movel %d1,%a2@ return_status = RTEMS_SUCCESSFUL; } } _RTEMS_Unlock_allocator(); 575a0: 2f39 0007 e87e movel 7e87e <_RTEMS_Allocator_Mutex>,%sp@- 575a6: 2d40 fffc movel %d0,%fp@(-4) 575aa: 4eb9 0005 9e9c jsr 59e9c <_API_Mutex_Unlock> return return_status; 575b0: 202e fffc movel %fp@(-4),%d0 575b4: 588f addql #4,%sp 575b6: 6000 ff54 braw 5750c ... 0005766c : rtems_status_code rtems_region_extend( rtems_id id, void *starting_address, uintptr_t length ) { 5766c: 4e56 fff8 linkw %fp,#-8 57670: 2f0a movel %a2,%sp@- 57672: 2f02 movel %d2,%sp@- 57674: 242e 000c movel %fp@(12),%d2 Heap_Extend_status heap_status; Objects_Locations location; rtems_status_code return_status; Region_Control *the_region; if ( !starting_address ) 57678: 677e beqs 576f8 return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); /* to prevent deletion */ 5767a: 2f39 0007 e87e movel 7e87e <_RTEMS_Allocator_Mutex>,%sp@- 57680: 4eb9 0005 9e3c jsr 59e3c <_API_Mutex_Lock> RTEMS_INLINE_ROUTINE Region_Control *_Region_Get ( Objects_Id id, Objects_Locations *location ) { return (Region_Control *) 57686: 486e fff8 pea %fp@(-8) 5768a: 2f2e 0008 movel %fp@(8),%sp@- 5768e: 4879 0007 e6ca pea 7e6ca <_Region_Information> 57694: 4eb9 0005 b968 jsr 5b968 <_Objects_Get_no_protection> the_region = _Region_Get( id, &location ); switch ( location ) { 5769a: 4fef 0010 lea %sp@(16),%sp 5769e: 2440 moveal %d0,%a2 576a0: 4aae fff8 tstl %fp@(-8) 576a4: 6640 bnes 576e6 case OBJECTS_LOCAL: heap_status = _Heap_Extend( 576a6: 486e fffc pea %fp@(-4) 576aa: 2f2e 0010 movel %fp@(16),%sp@- 576ae: 2f02 movel %d2,%sp@- 576b0: 486a 0068 pea %a2@(104) 576b4: 4eb9 0005 ac40 jsr 5ac40 <_Heap_Extend> starting_address, length, &amount_extended ); if ( heap_status == HEAP_EXTEND_SUCCESSFUL ) { 576ba: 4fef 0010 lea %sp@(16),%sp 576be: 4a80 tstl %d0 576c0: 6748 beqs 5770a the_region->length += amount_extended; the_region->maximum_segment_size += amount_extended; return_status = RTEMS_SUCCESSFUL; } else if ( heap_status == HEAP_EXTEND_ERROR ) { 576c2: 7201 moveq #1,%d1 576c4: b280 cmpl %d0,%d1 576c6: 6760 beqs 57728 default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 576c8: 2f39 0007 e87e movel 7e87e <_RTEMS_Allocator_Mutex>,%sp@- if ( heap_status == HEAP_EXTEND_SUCCESSFUL ) { the_region->length += amount_extended; the_region->maximum_segment_size += amount_extended; return_status = RTEMS_SUCCESSFUL; } else if ( heap_status == HEAP_EXTEND_ERROR ) { 576ce: 7418 moveq #24,%d2 default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 576d0: 4eb9 0005 9e9c jsr 59e9c <_API_Mutex_Unlock> return return_status; 576d6: 588f addql #4,%sp } 576d8: 2002 movel %d2,%d0 576da: 242e fff0 movel %fp@(-16),%d2 576de: 246e fff4 moveal %fp@(-12),%a2 576e2: 4e5e unlk %fp 576e4: 4e75 rts default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 576e6: 2f39 0007 e87e movel 7e87e <_RTEMS_Allocator_Mutex>,%sp@- return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); /* to prevent deletion */ the_region = _Region_Get( id, &location ); switch ( location ) { 576ec: 7404 moveq #4,%d2 default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 576ee: 4eb9 0005 9e9c jsr 59e9c <_API_Mutex_Unlock> return return_status; 576f4: 588f addql #4,%sp 576f6: 60e0 bras 576d8 Heap_Extend_status heap_status; Objects_Locations location; rtems_status_code return_status; Region_Control *the_region; if ( !starting_address ) 576f8: 143c 0009 moveb #9,%d2 break; } _RTEMS_Unlock_allocator(); return return_status; } 576fc: 2002 movel %d2,%d0 576fe: 242e fff0 movel %fp@(-16),%d2 57702: 246e fff4 moveal %fp@(-12),%a2 57706: 4e5e unlk %fp 57708: 4e75 rts length, &amount_extended ); if ( heap_status == HEAP_EXTEND_SUCCESSFUL ) { the_region->length += amount_extended; 5770a: 202e fffc movel %fp@(-4),%d0 the_region->maximum_segment_size += amount_extended; 5770e: d1aa 005c addl %d0,%a2@(92) 57712: 4282 clrl %d2 length, &amount_extended ); if ( heap_status == HEAP_EXTEND_SUCCESSFUL ) { the_region->length += amount_extended; 57714: d1aa 0054 addl %d0,%a2@(84) default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 57718: 2f39 0007 e87e movel 7e87e <_RTEMS_Allocator_Mutex>,%sp@- 5771e: 4eb9 0005 9e9c jsr 59e9c <_API_Mutex_Unlock> return return_status; 57724: 588f addql #4,%sp 57726: 60b0 bras 576d8 default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 57728: 2f39 0007 e87e movel 7e87e <_RTEMS_Allocator_Mutex>,%sp@- if ( heap_status == HEAP_EXTEND_SUCCESSFUL ) { the_region->length += amount_extended; the_region->maximum_segment_size += amount_extended; return_status = RTEMS_SUCCESSFUL; } else if ( heap_status == HEAP_EXTEND_ERROR ) { 5772e: 7409 moveq #9,%d2 default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 57730: 4eb9 0005 9e9c jsr 59e9c <_API_Mutex_Unlock> return return_status; 57736: 588f addql #4,%sp 57738: 609e bras 576d8 ... 000579c0 : rtems_status_code rtems_region_get_segment_size( rtems_id id, void *segment, uintptr_t *size ) { 579c0: 4e56 fffc linkw %fp,#-4 579c4: 2f03 movel %d3,%sp@- 579c6: 262e 0010 movel %fp@(16),%d3 579ca: 2f02 movel %d2,%sp@- 579cc: 242e 000c movel %fp@(12),%d2 Objects_Locations location; rtems_status_code return_status = RTEMS_SUCCESSFUL; register Region_Control *the_region; if ( !segment ) 579d0: 6700 0092 beqw 57a64 return RTEMS_INVALID_ADDRESS; if ( !size ) 579d4: 4a83 tstl %d3 579d6: 6700 008c beqw 57a64 return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); 579da: 2f39 0007 e87e movel 7e87e <_RTEMS_Allocator_Mutex>,%sp@- 579e0: 4eb9 0005 9e3c jsr 59e3c <_API_Mutex_Lock> 579e6: 486e fffc pea %fp@(-4) 579ea: 2f2e 0008 movel %fp@(8),%sp@- 579ee: 4879 0007 e6ca pea 7e6ca <_Region_Information> 579f4: 4eb9 0005 b968 jsr 5b968 <_Objects_Get_no_protection> the_region = _Region_Get( id, &location ); switch ( location ) { 579fa: 222e fffc movel %fp@(-4),%d1 579fe: 4fef 0010 lea %sp@(16),%sp 57a02: 6636 bnes 57a3a case OBJECTS_LOCAL: if ( !_Heap_Size_of_alloc_area( &the_region->Memory, segment, size ) ) 57a04: 2f03 movel %d3,%sp@- 57a06: 2040 moveal %d0,%a0 57a08: 2f02 movel %d2,%sp@- 57a0a: 4868 0068 pea %a0@(104) 57a0e: 4eb9 0005 b3a4 jsr 5b3a4 <_Heap_Size_of_alloc_area> 57a14: 4fef 000c lea %sp@(12),%sp 57a18: 4a00 tstb %d0 57a1a: 6624 bnes 57a40 case OBJECTS_ERROR: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 57a1c: 2f39 0007 e87e movel 7e87e <_RTEMS_Allocator_Mutex>,%sp@- <== NOT EXECUTED the_region = _Region_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: if ( !_Heap_Size_of_alloc_area( &the_region->Memory, segment, size ) ) 57a22: 7409 moveq #9,%d2 <== NOT EXECUTED case OBJECTS_ERROR: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 57a24: 4eb9 0005 9e9c jsr 59e9c <_API_Mutex_Unlock> <== NOT EXECUTED return return_status; 57a2a: 588f addql #4,%sp <== NOT EXECUTED } 57a2c: 2002 movel %d2,%d0 57a2e: 242e fff4 movel %fp@(-12),%d2 57a32: 262e fff8 movel %fp@(-8),%d3 57a36: 4e5e unlk %fp 57a38: 4e75 rts return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); the_region = _Region_Get( id, &location ); switch ( location ) { 57a3a: 7001 moveq #1,%d0 57a3c: b081 cmpl %d1,%d0 57a3e: 6712 beqs 57a52 case OBJECTS_ERROR: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 57a40: 2f39 0007 e87e movel 7e87e <_RTEMS_Allocator_Mutex>,%sp@- the_region = _Region_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: if ( !_Heap_Size_of_alloc_area( &the_region->Memory, segment, size ) ) 57a46: 4282 clrl %d2 case OBJECTS_ERROR: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 57a48: 4eb9 0005 9e9c jsr 59e9c <_API_Mutex_Unlock> return return_status; 57a4e: 588f addql #4,%sp 57a50: 60da bras 57a2c case OBJECTS_ERROR: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 57a52: 2f39 0007 e87e movel 7e87e <_RTEMS_Allocator_Mutex>,%sp@- return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); the_region = _Region_Get( id, &location ); switch ( location ) { 57a58: 7404 moveq #4,%d2 case OBJECTS_ERROR: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 57a5a: 4eb9 0005 9e9c jsr 59e9c <_API_Mutex_Unlock> return return_status; 57a60: 588f addql #4,%sp 57a62: 60c8 bras 57a2c 57a64: 7409 moveq #9,%d2 } 57a66: 2002 movel %d2,%d0 57a68: 242e fff4 movel %fp@(-12),%d2 57a6c: 262e fff8 movel %fp@(-8),%d3 57a70: 4e5e unlk %fp <== NOT EXECUTED 00045a8c : uint32_t count, rtems_attribute attribute_set, rtems_task_priority priority_ceiling, rtems_id *id ) { 45a8c: 4e56 ffd4 linkw %fp,#-44 45a90: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 45a94: 262e 0008 movel %fp@(8),%d3 45a98: 242e 0010 movel %fp@(16),%d2 45a9c: 246e 0018 moveal %fp@(24),%a2 register Semaphore_Control *the_semaphore; CORE_mutex_Attributes the_mutex_attr; CORE_semaphore_Attributes the_semaphore_attr; CORE_mutex_Status mutex_status; if ( !rtems_is_name_valid( name ) ) 45aa0: 4a83 tstl %d3 45aa2: 6748 beqs 45aec return RTEMS_INVALID_NAME; if ( !id ) 45aa4: 4a8a tstl %a2 45aa6: 6700 00ea beqw 45b92 * id - semaphore id * RTEMS_SUCCESSFUL - if successful * error code - if unsuccessful */ rtems_status_code rtems_semaphore_create( 45aaa: 2002 movel %d2,%d0 45aac: 0280 0000 00c0 andil #192,%d0 return RTEMS_NOT_DEFINED; } else #endif if ( _Attributes_Is_inherit_priority( attribute_set ) || 45ab2: 6744 beqs 45af8 _Attributes_Is_priority_ceiling( attribute_set ) ) { if ( ! (_Attributes_Is_binary_semaphore( attribute_set ) && 45ab4: 7230 moveq #48,%d1 45ab6: 7810 moveq #16,%d4 45ab8: c282 andl %d2,%d1 45aba: b881 cmpl %d1,%d4 45abc: 670c beqs 45aca name, 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; 45abe: 700b moveq #11,%d0 } 45ac0: 4cee 0c1c ffd4 moveml %fp@(-44),%d2-%d4/%a2-%a3 45ac6: 4e5e unlk %fp 45ac8: 4e75 rts #endif if ( _Attributes_Is_inherit_priority( attribute_set ) || _Attributes_Is_priority_ceiling( attribute_set ) ) { if ( ! (_Attributes_Is_binary_semaphore( attribute_set ) && 45aca: 44c2 movew %d2,%ccr 45acc: 66f0 bnes 45abe _Attributes_Is_priority( attribute_set ) ) ) return RTEMS_NOT_DEFINED; } if ( _Attributes_Is_inherit_priority( attribute_set ) && 45ace: 0c80 0000 00c0 cmpil #192,%d0 45ad4: 67e8 beqs 45abe _Attributes_Is_priority_ceiling( attribute_set ) ) return RTEMS_NOT_DEFINED; if ( !_Attributes_Is_counting_semaphore( attribute_set ) && ( count > 1 ) ) 45ad6: 7001 moveq #1,%d0 45ad8: b0ae 000c cmpl %fp@(12),%d0 45adc: 6420 bccs 45afe 45ade: 103c 000a moveb #10,%d0 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 45ae2: 4cee 0c1c ffd4 moveml %fp@(-44),%d2-%d4/%a2-%a3 45ae8: 4e5e unlk %fp 45aea: 4e75 rts register Semaphore_Control *the_semaphore; CORE_mutex_Attributes the_mutex_attr; CORE_semaphore_Attributes the_semaphore_attr; CORE_mutex_Status mutex_status; if ( !rtems_is_name_valid( name ) ) 45aec: 7003 moveq #3,%d0 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 45aee: 4cee 0c1c ffd4 moveml %fp@(-44),%d2-%d4/%a2-%a3 45af4: 4e5e unlk %fp 45af6: 4e75 rts */ RTEMS_INLINE_ROUTINE bool _Attributes_Is_counting_semaphore( rtems_attribute attribute_set ) { return ((attribute_set & RTEMS_SEMAPHORE_CLASS) == RTEMS_COUNTING_SEMAPHORE); 45af8: 7830 moveq #48,%d4 45afa: c882 andl %d2,%d4 if ( _Attributes_Is_inherit_priority( attribute_set ) && _Attributes_Is_priority_ceiling( attribute_set ) ) return RTEMS_NOT_DEFINED; if ( !_Attributes_Is_counting_semaphore( attribute_set ) && ( count > 1 ) ) 45afc: 66d8 bnes 45ad6 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 45afe: 2039 0005 ef78 movel 5ef78 <_Thread_Dispatch_disable_level>,%d0 45b04: 5280 addql #1,%d0 45b06: 23c0 0005 ef78 movel %d0,5ef78 <_Thread_Dispatch_disable_level> * This function allocates a semaphore control block from * the inactive chain of free semaphore control blocks. */ RTEMS_INLINE_ROUTINE Semaphore_Control *_Semaphore_Allocate( void ) { return (Semaphore_Control *) _Objects_Allocate( &_Semaphore_Information ); 45b0c: 4879 0005 eeb0 pea 5eeb0 <_Semaphore_Information> 45b12: 4eb9 0004 7090 jsr 47090 <_Objects_Allocate> _Thread_Disable_dispatch(); /* prevents deletion */ the_semaphore = _Semaphore_Allocate(); if ( !the_semaphore ) { 45b18: 588f addql #4,%sp 45b1a: 2640 moveal %d0,%a3 45b1c: 4a80 tstl %d0 45b1e: 6700 00d8 beqw 45bf8 _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; } #endif the_semaphore->attribute_set = attribute_set; 45b22: 2742 0010 movel %d2,%a3@(16) /* * Initialize it as a counting semaphore. */ if ( _Attributes_Is_counting_semaphore( attribute_set ) ) { 45b26: 4a84 tstl %d4 45b28: 6774 beqs 45b9e /* * It is either simple binary semaphore or a more powerful mutex * style binary semaphore. This is the mutex style. */ if ( _Attributes_Is_priority( attribute_set ) ) the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY; 45b2a: 44c2 movew %d2,%ccr 45b2c: 56c0 sne %d0 45b2e: 49c0 extbl %d0 45b30: 5280 addql #1,%d0 45b32: 2d40 fff0 movel %d0,%fp@(-16) else the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_FIFO; if ( _Attributes_Is_binary_semaphore( attribute_set ) ) { 45b36: 7010 moveq #16,%d0 45b38: b084 cmpl %d4,%d0 45b3a: 6700 00ce beqw 45c0a the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING; the_mutex_attr.only_owner_release = true; } } } else /* must be simple binary semaphore */ { the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_BLOCKS; 45b3e: 7202 moveq #2,%d1 the_mutex_attr.only_owner_release = false; 45b40: 4204 clrb %d4 the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING; the_mutex_attr.only_owner_release = true; } } } else /* must be simple binary semaphore */ { the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_BLOCKS; 45b42: 2d41 ffea movel %d1,%fp@(-22) the_mutex_attr.only_owner_release = false; 45b46: 1d44 ffee moveb %d4,%fp@(-18) } mutex_status = _CORE_mutex_Initialize( 45b4a: 7001 moveq #1,%d0 45b4c: b0ae 000c cmpl %fp@(12),%d0 45b50: 57c0 seq %d0 45b52: 49c0 extbl %d0 45b54: 4480 negl %d0 45b56: 2f00 movel %d0,%sp@- 45b58: 486e ffea pea %fp@(-22) 45b5c: 486b 0014 pea %a3@(20) 45b60: 4eb9 0004 67dc jsr 467dc <_CORE_mutex_Initialize> &the_semaphore->Core_control.mutex, &the_mutex_attr, (count == 1) ? CORE_MUTEX_UNLOCKED : CORE_MUTEX_LOCKED ); if ( mutex_status == CORE_MUTEX_STATUS_CEILING_VIOLATED ) { 45b66: 4fef 000c lea %sp@(12),%sp 45b6a: 7206 moveq #6,%d1 45b6c: b280 cmpl %d0,%d1 45b6e: 665e bnes 45bce */ RTEMS_INLINE_ROUTINE void _Semaphore_Free ( Semaphore_Control *the_semaphore ) { _Objects_Free( &_Semaphore_Information, &the_semaphore->Object ); 45b70: 2f0b movel %a3,%sp@- 45b72: 4879 0005 eeb0 pea 5eeb0 <_Semaphore_Information> 45b78: 4eb9 0004 73c8 jsr 473c8 <_Objects_Free> _Semaphore_Free( the_semaphore ); _Thread_Enable_dispatch(); 45b7e: 4eb9 0004 7dbc jsr 47dbc <_Thread_Enable_dispatch> return RTEMS_INVALID_PRIORITY; 45b84: 508f addql #8,%sp (count == 1) ? CORE_MUTEX_UNLOCKED : CORE_MUTEX_LOCKED ); if ( mutex_status == CORE_MUTEX_STATUS_CEILING_VIOLATED ) { _Semaphore_Free( the_semaphore ); _Thread_Enable_dispatch(); 45b86: 7013 moveq #19,%d0 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 45b88: 4cee 0c1c ffd4 moveml %fp@(-44),%d2-%d4/%a2-%a3 45b8e: 4e5e unlk %fp 45b90: 4e75 rts CORE_mutex_Status mutex_status; if ( !rtems_is_name_valid( name ) ) return RTEMS_INVALID_NAME; if ( !id ) 45b92: 7009 moveq #9,%d0 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 45b94: 4cee 0c1c ffd4 moveml %fp@(-44),%d2-%d4/%a2-%a3 45b9a: 4e5e unlk %fp 45b9c: 4e75 rts * The following are just to make Purify happy. */ the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES; the_mutex_attr.priority_ceiling = PRIORITY_MINIMUM; _CORE_semaphore_Initialize( 45b9e: 2f2e 000c movel %fp@(12),%sp@- */ if ( _Attributes_Is_counting_semaphore( attribute_set ) ) { /* * This effectively disables limit checking. */ the_semaphore_attr.maximum_count = 0xFFFFFFFF; 45ba2: 72ff moveq #-1,%d1 * The following are just to make Purify happy. */ the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES; the_mutex_attr.priority_ceiling = PRIORITY_MINIMUM; _CORE_semaphore_Initialize( 45ba4: 486e fff8 pea %fp@(-8) 45ba8: 486b 0014 pea %a3@(20) * This effectively disables limit checking. */ the_semaphore_attr.maximum_count = 0xFFFFFFFF; if ( _Attributes_Is_priority( attribute_set ) ) the_semaphore_attr.discipline = CORE_SEMAPHORE_DISCIPLINES_PRIORITY; 45bac: 44c2 movew %d2,%ccr 45bae: 56c0 sne %d0 */ if ( _Attributes_Is_counting_semaphore( attribute_set ) ) { /* * This effectively disables limit checking. */ the_semaphore_attr.maximum_count = 0xFFFFFFFF; 45bb0: 2d41 fff8 movel %d1,%fp@(-8) if ( _Attributes_Is_priority( attribute_set ) ) the_semaphore_attr.discipline = CORE_SEMAPHORE_DISCIPLINES_PRIORITY; 45bb4: 49c0 extbl %d0 45bb6: 5280 addql #1,%d0 the_semaphore_attr.discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO; /* * The following are just to make Purify happy. */ the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES; 45bb8: 42ae ffea clrl %fp@(-22) * This effectively disables limit checking. */ the_semaphore_attr.maximum_count = 0xFFFFFFFF; if ( _Attributes_Is_priority( attribute_set ) ) the_semaphore_attr.discipline = CORE_SEMAPHORE_DISCIPLINES_PRIORITY; 45bbc: 2d40 fffc movel %d0,%fp@(-4) /* * The following are just to make Purify happy. */ the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES; the_mutex_attr.priority_ceiling = PRIORITY_MINIMUM; 45bc0: 42ae fff4 clrl %fp@(-12) _CORE_semaphore_Initialize( 45bc4: 4eb9 0004 6b24 jsr 46b24 <_CORE_semaphore_Initialize> 45bca: 4fef 000c lea %sp@(12),%sp #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 45bce: 202b 0008 movel %a3@(8),%d0 45bd2: 4281 clrl %d1 45bd4: 2079 0005 eec8 moveal 5eec8 <_Semaphore_Information+0x18>,%a0 45bda: 3200 movew %d0,%d1 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 45bdc: 2743 000c movel %d3,%a3@(12) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 45be0: 218b 1c00 movel %a3,%a0@(00000000,%d1:l:4) &_Semaphore_Information, &the_semaphore->Object, (Objects_Name) name ); *id = the_semaphore->Object.id; 45be4: 2480 movel %d0,%a2@ the_semaphore->Object.id, name, 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); 45be6: 4eb9 0004 7dbc jsr 47dbc <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; } 45bec: 4cee 0c1c ffd4 moveml %fp@(-44),%d2-%d4/%a2-%a3 the_semaphore->Object.id, name, 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); 45bf2: 4280 clrl %d0 return RTEMS_SUCCESSFUL; } 45bf4: 4e5e unlk %fp 45bf6: 4e75 rts _Thread_Disable_dispatch(); /* prevents deletion */ the_semaphore = _Semaphore_Allocate(); if ( !the_semaphore ) { _Thread_Enable_dispatch(); 45bf8: 4eb9 0004 7dbc jsr 47dbc <_Thread_Enable_dispatch> 45bfe: 7005 moveq #5,%d0 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 45c00: 4cee 0c1c ffd4 moveml %fp@(-44),%d2-%d4/%a2-%a3 45c06: 4e5e unlk %fp 45c08: 4e75 rts else the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_FIFO; if ( _Attributes_Is_binary_semaphore( attribute_set ) ) { the_mutex_attr.priority_ceiling = priority_ceiling; the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES; 45c0a: 42ae ffea clrl %fp@(-22) the_mutex_attr.only_owner_release = false; if ( the_mutex_attr.discipline == CORE_MUTEX_DISCIPLINES_PRIORITY ) { 45c0e: 7801 moveq #1,%d4 the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_FIFO; if ( _Attributes_Is_binary_semaphore( attribute_set ) ) { the_mutex_attr.priority_ceiling = priority_ceiling; the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES; the_mutex_attr.only_owner_release = false; 45c10: 4201 clrb %d1 the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY; else the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_FIFO; if ( _Attributes_Is_binary_semaphore( attribute_set ) ) { the_mutex_attr.priority_ceiling = priority_ceiling; 45c12: 2d6e 0014 fff4 movel %fp@(20),%fp@(-12) the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES; the_mutex_attr.only_owner_release = false; 45c18: 1d41 ffee moveb %d1,%fp@(-18) if ( the_mutex_attr.discipline == CORE_MUTEX_DISCIPLINES_PRIORITY ) { 45c1c: b8ae fff0 cmpl %fp@(-16),%d4 45c20: 6600 ff28 bnew 45b4a if ( _Attributes_Is_inherit_priority( attribute_set ) ) { 45c24: 0802 0006 btst #6,%d2 45c28: 6712 beqs 45c3c the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT; 45c2a: 103c 0002 moveb #2,%d0 the_mutex_attr.only_owner_release = true; 45c2e: 7201 moveq #1,%d1 the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES; the_mutex_attr.only_owner_release = false; if ( the_mutex_attr.discipline == CORE_MUTEX_DISCIPLINES_PRIORITY ) { if ( _Attributes_Is_inherit_priority( attribute_set ) ) { the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT; 45c30: 2d40 fff0 movel %d0,%fp@(-16) the_mutex_attr.only_owner_release = true; 45c34: 1d41 ffee moveb %d1,%fp@(-18) 45c38: 6000 ff10 braw 45b4a } else if ( _Attributes_Is_priority_ceiling( attribute_set ) ) { 45c3c: 4a02 tstb %d2 45c3e: 6c00 ff0a bgew 45b4a the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING; 45c42: 7803 moveq #3,%d4 the_mutex_attr.only_owner_release = true; 45c44: 7001 moveq #1,%d0 if ( the_mutex_attr.discipline == CORE_MUTEX_DISCIPLINES_PRIORITY ) { if ( _Attributes_Is_inherit_priority( attribute_set ) ) { the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT; the_mutex_attr.only_owner_release = true; } else if ( _Attributes_Is_priority_ceiling( attribute_set ) ) { the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING; 45c46: 2d44 fff0 movel %d4,%fp@(-16) the_mutex_attr.only_owner_release = true; 45c4a: 1d40 ffee moveb %d0,%fp@(-18) 45c4e: 6000 fefa braw 45b4a ... 00045c54 : #endif rtems_status_code rtems_semaphore_delete( rtems_id id ) { 45c54: 4e56 fffc linkw %fp,#-4 45c58: 2f0a movel %a2,%sp@- RTEMS_INLINE_ROUTINE Semaphore_Control *_Semaphore_Get ( Objects_Id id, Objects_Locations *location ) { return (Semaphore_Control *) 45c5a: 486e fffc pea %fp@(-4) 45c5e: 2f2e 0008 movel %fp@(8),%sp@- 45c62: 4879 0005 eeb0 pea 5eeb0 <_Semaphore_Information> 45c68: 4eb9 0004 752c jsr 4752c <_Objects_Get> register Semaphore_Control *the_semaphore; Objects_Locations location; the_semaphore = _Semaphore_Get( id, &location ); switch ( location ) { 45c6e: 4fef 000c lea %sp@(12),%sp 45c72: 2440 moveal %d0,%a2 45c74: 4aae fffc tstl %fp@(-4) 45c78: 670a beqs 45c84 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 45c7a: 246e fff8 moveal %fp@(-8),%a2 { register Semaphore_Control *the_semaphore; Objects_Locations location; the_semaphore = _Semaphore_Get( id, &location ); switch ( location ) { 45c7e: 7004 moveq #4,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 45c80: 4e5e unlk %fp 45c82: 4e75 rts 45c84: 7030 moveq #48,%d0 45c86: c0aa 0010 andl %a2@(16),%d0 the_semaphore = _Semaphore_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: if ( !_Attributes_Is_counting_semaphore(the_semaphore->attribute_set) ) { 45c8a: 6760 beqs 45cec if ( _CORE_mutex_Is_locked( &the_semaphore->Core_control.mutex ) && 45c8c: 4aaa 0062 tstl %a2@(98) 45c90: 6616 bnes 45ca8 45c92: 7220 moveq #32,%d1 45c94: b280 cmpl %d0,%d1 45c96: 6710 beqs 45ca8 !_Attributes_Is_simple_binary_semaphore( the_semaphore->attribute_set ) ) { _Thread_Enable_dispatch(); 45c98: 4eb9 0004 7dbc jsr 47dbc <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 45c9e: 246e fff8 moveal %fp@(-8),%a2 case OBJECTS_LOCAL: if ( !_Attributes_Is_counting_semaphore(the_semaphore->attribute_set) ) { if ( _CORE_mutex_Is_locked( &the_semaphore->Core_control.mutex ) && !_Attributes_Is_simple_binary_semaphore( the_semaphore->attribute_set ) ) { _Thread_Enable_dispatch(); 45ca2: 700c moveq #12,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 45ca4: 4e5e unlk %fp 45ca6: 4e75 rts !_Attributes_Is_simple_binary_semaphore( the_semaphore->attribute_set ) ) { _Thread_Enable_dispatch(); return RTEMS_RESOURCE_IN_USE; } _CORE_mutex_Flush( 45ca8: 4878 0004 pea 4 45cac: 42a7 clrl %sp@- 45cae: 486a 0014 pea %a2@(20) 45cb2: 4eb9 0004 67d0 jsr 467d0 <_CORE_mutex_Flush> 45cb8: 4fef 000c lea %sp@(12),%sp SEMAPHORE_MP_OBJECT_WAS_DELETED, CORE_SEMAPHORE_WAS_DELETED ); } _Objects_Close( &_Semaphore_Information, &the_semaphore->Object ); 45cbc: 2f0a movel %a2,%sp@- 45cbe: 4879 0005 eeb0 pea 5eeb0 <_Semaphore_Information> 45cc4: 4eb9 0004 7120 jsr 47120 <_Objects_Close> */ RTEMS_INLINE_ROUTINE void _Semaphore_Free ( Semaphore_Control *the_semaphore ) { _Objects_Free( &_Semaphore_Information, &the_semaphore->Object ); 45cca: 2f0a movel %a2,%sp@- 45ccc: 4879 0005 eeb0 pea 5eeb0 <_Semaphore_Information> 45cd2: 4eb9 0004 73c8 jsr 473c8 <_Objects_Free> 0, /* Not used */ 0 /* Not used */ ); } #endif _Thread_Enable_dispatch(); 45cd8: 4eb9 0004 7dbc jsr 47dbc <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 45cde: 4fef 0010 lea %sp@(16),%sp 0, /* Not used */ 0 /* Not used */ ); } #endif _Thread_Enable_dispatch(); 45ce2: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 45ce4: 246e fff8 moveal %fp@(-8),%a2 45ce8: 4e5e unlk %fp 45cea: 4e75 rts &the_semaphore->Core_control.mutex, SEMAPHORE_MP_OBJECT_WAS_DELETED, CORE_MUTEX_WAS_DELETED ); } else { _CORE_semaphore_Flush( 45cec: 4878 0002 pea 2 45cf0: 42a7 clrl %sp@- 45cf2: 486a 0014 pea %a2@(20) 45cf6: 4eb9 0004 6b18 jsr 46b18 <_CORE_semaphore_Flush> 45cfc: 4fef 000c lea %sp@(12),%sp SEMAPHORE_MP_OBJECT_WAS_DELETED, CORE_SEMAPHORE_WAS_DELETED ); } _Objects_Close( &_Semaphore_Information, &the_semaphore->Object ); 45d00: 2f0a movel %a2,%sp@- 45d02: 4879 0005 eeb0 pea 5eeb0 <_Semaphore_Information> 45d08: 4eb9 0004 7120 jsr 47120 <_Objects_Close> 45d0e: 2f0a movel %a2,%sp@- 45d10: 4879 0005 eeb0 pea 5eeb0 <_Semaphore_Information> 45d16: 4eb9 0004 73c8 jsr 473c8 <_Objects_Free> 0, /* Not used */ 0 /* Not used */ ); } #endif _Thread_Enable_dispatch(); 45d1c: 4eb9 0004 7dbc jsr 47dbc <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 45d22: 4fef 0010 lea %sp@(16),%sp 0, /* Not used */ 0 /* Not used */ ); } #endif _Thread_Enable_dispatch(); 45d26: 4280 clrl %d0 45d28: 60ba bras 45ce4 ... 00050dc4 : #endif rtems_status_code rtems_semaphore_flush( rtems_id id ) { 50dc4: 4e56 fffc linkw %fp,#-4 50dc8: 486e fffc pea %fp@(-4) 50dcc: 2f2e 0008 movel %fp@(8),%sp@- 50dd0: 4879 0006 4f88 pea 64f88 <_Semaphore_Information> 50dd6: 4eb9 0004 957c jsr 4957c <_Objects_Get> register Semaphore_Control *the_semaphore; Objects_Locations location; the_semaphore = _Semaphore_Get( id, &location ); switch ( location ) { 50ddc: 4fef 000c lea %sp@(12),%sp 50de0: 4aae fffc tstl %fp@(-4) 50de4: 6706 beqs 50dec 50de6: 7004 moveq #4,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 50de8: 4e5e unlk %fp 50dea: 4e75 rts the_semaphore = _Semaphore_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: if ( !_Attributes_Is_counting_semaphore(the_semaphore->attribute_set) ) { 50dec: 7230 moveq #48,%d1 50dee: 2040 moveal %d0,%a0 50df0: c2a8 0010 andl %a0@(16),%d1 50df4: 6720 beqs 50e16 _CORE_mutex_Flush( 50df6: 4878 0001 pea 1 50dfa: 42a7 clrl %sp@- 50dfc: 4868 0014 pea %a0@(20) 50e00: 4eb9 0004 8784 jsr 48784 <_CORE_mutex_Flush> 50e06: 4fef 000c lea %sp@(12),%sp &the_semaphore->Core_control.semaphore, SEND_OBJECT_WAS_DELETED, CORE_SEMAPHORE_STATUS_UNSATISFIED_NOWAIT ); } _Thread_Enable_dispatch(); 50e0a: 4eb9 0004 9e8c jsr 49e8c <_Thread_Enable_dispatch> 50e10: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 50e12: 4e5e unlk %fp 50e14: 4e75 rts &the_semaphore->Core_control.mutex, SEND_OBJECT_WAS_DELETED, CORE_MUTEX_STATUS_UNSATISFIED_NOWAIT ); } else { _CORE_semaphore_Flush( 50e16: 4878 0001 pea 1 50e1a: 2040 moveal %d0,%a0 50e1c: 42a7 clrl %sp@- 50e1e: 4868 0014 pea %a0@(20) 50e22: 4eb9 0004 8acc jsr 48acc <_CORE_semaphore_Flush> 50e28: 4fef 000c lea %sp@(12),%sp &the_semaphore->Core_control.semaphore, SEND_OBJECT_WAS_DELETED, CORE_SEMAPHORE_STATUS_UNSATISFIED_NOWAIT ); } _Thread_Enable_dispatch(); 50e2c: 4eb9 0004 9e8c jsr 49e8c <_Thread_Enable_dispatch> 50e32: 4280 clrl %d0 50e34: 60dc bras 50e12 ... 00058f30 : */ rtems_status_code rtems_timer_reset( rtems_id id ) { 58f30: 4e56 fff0 linkw %fp,#-16 58f34: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 58f38: 486e fffc pea %fp@(-4) 58f3c: 2f2e 0008 movel %fp@(8),%sp@- 58f40: 4879 0007 f060 pea 7f060 <_Timer_Information> 58f46: 4eb9 0005 b9a4 jsr 5b9a4 <_Objects_Get> Timer_Control *the_timer; Objects_Locations location; rtems_status_code status = RTEMS_SUCCESSFUL; the_timer = _Timer_Get( id, &location ); switch ( location ) { 58f4c: 4fef 000c lea %sp@(12),%sp 58f50: 2440 moveal %d0,%a2 58f52: 4aae fffc tstl %fp@(-4) 58f56: 670e beqs 58f66 58f58: 7404 moveq #4,%d2 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 58f5a: 2002 movel %d2,%d0 58f5c: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3 58f62: 4e5e unlk %fp 58f64: 4e75 rts the_timer = _Timer_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: if ( the_timer->the_class == TIMER_INTERVAL ) { 58f66: 202a 0038 movel %a2@(56),%d0 58f6a: 671a beqs 58f86 _Watchdog_Remove( &the_timer->Ticker ); _Watchdog_Insert( &_Watchdog_Ticks_chain, &the_timer->Ticker ); } else if ( the_timer->the_class == TIMER_INTERVAL_ON_TASK ) { 58f6c: 7201 moveq #1,%d1 58f6e: b280 cmpl %d0,%d1 58f70: 673c beqs 58fae 58f72: 740b moveq #11,%d2 * TIMER_TIME_OF_DAY, or TIMER_TIME_OF_DAY_ON_TASK). We * can only reset active interval timers. */ status = RTEMS_NOT_DEFINED; } _Thread_Enable_dispatch(); 58f74: 4eb9 0005 c2c0 jsr 5c2c0 <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 58f7a: 2002 movel %d2,%d0 58f7c: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3 58f82: 4e5e unlk %fp 58f84: 4e75 rts the_timer = _Timer_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: if ( the_timer->the_class == TIMER_INTERVAL ) { _Watchdog_Remove( &the_timer->Ticker ); 58f86: 45ea 0010 lea %a2@(16),%a2 _Watchdog_Insert( &_Watchdog_Ticks_chain, &the_timer->Ticker ); 58f8a: 4282 clrl %d2 the_timer = _Timer_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: if ( the_timer->the_class == TIMER_INTERVAL ) { _Watchdog_Remove( &the_timer->Ticker ); 58f8c: 2f0a movel %a2,%sp@- 58f8e: 4eb9 0005 d8e4 jsr 5d8e4 <_Watchdog_Remove> _Watchdog_Insert( &_Watchdog_Ticks_chain, &the_timer->Ticker ); 58f94: 2f0a movel %a2,%sp@- 58f96: 4879 0007 e8a4 pea 7e8a4 <_Watchdog_Ticks_chain> 58f9c: 4eb9 0005 d79c jsr 5d79c <_Watchdog_Insert> 58fa2: 4fef 000c lea %sp@(12),%sp * TIMER_TIME_OF_DAY, or TIMER_TIME_OF_DAY_ON_TASK). We * can only reset active interval timers. */ status = RTEMS_NOT_DEFINED; } _Thread_Enable_dispatch(); 58fa6: 4eb9 0005 c2c0 jsr 5c2c0 <_Thread_Enable_dispatch> 58fac: 60cc bras 58f7a if ( !timer_server ) { _Thread_Enable_dispatch(); return RTEMS_INCORRECT_STATE; } #endif _Watchdog_Remove( &the_timer->Ticker ); 58fae: 486a 0010 pea %a2@(16) (*timer_server->schedule_operation)( timer_server, the_timer ); 58fb2: 4282 clrl %d2 case OBJECTS_LOCAL: if ( the_timer->the_class == TIMER_INTERVAL ) { _Watchdog_Remove( &the_timer->Ticker ); _Watchdog_Insert( &_Watchdog_Ticks_chain, &the_timer->Ticker ); } else if ( the_timer->the_class == TIMER_INTERVAL_ON_TASK ) { Timer_server_Control *timer_server = _Timer_server; 58fb4: 2679 0007 f09a moveal 7f09a <_Timer_server>,%a3 if ( !timer_server ) { _Thread_Enable_dispatch(); return RTEMS_INCORRECT_STATE; } #endif _Watchdog_Remove( &the_timer->Ticker ); 58fba: 4eb9 0005 d8e4 jsr 5d8e4 <_Watchdog_Remove> (*timer_server->schedule_operation)( timer_server, the_timer ); 58fc0: 2f0a movel %a2,%sp@- 58fc2: 2f0b movel %a3,%sp@- 58fc4: 206b 0004 moveal %a3@(4),%a0 58fc8: 4e90 jsr %a0@ 58fca: 4fef 000c lea %sp@(12),%sp * TIMER_TIME_OF_DAY, or TIMER_TIME_OF_DAY_ON_TASK). We * can only reset active interval timers. */ status = RTEMS_NOT_DEFINED; } _Thread_Enable_dispatch(); 58fce: 4eb9 0005 c2c0 jsr 5c2c0 <_Thread_Enable_dispatch> 58fd4: 60a4 bras 58f7a ... 000590c0 : rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ) { 590c0: 4e56 ffec linkw %fp,#-20 590c4: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ 590c8: 242e 000c movel %fp@(12),%d2 590cc: 262e 0010 movel %fp@(16),%d3 Timer_Control *the_timer; Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; 590d0: 2479 0007 f09a moveal 7f09a <_Timer_server>,%a2 if ( !timer_server ) 590d6: 4a8a tstl %a2 590d8: 6700 00c8 beqw 591a2 return RTEMS_INCORRECT_STATE; if ( !_TOD_Is_set ) 590dc: 4a39 0007 e7e0 tstb 7e7e0 <_TOD_Is_set> 590e2: 6700 00a6 beqw 5918a return RTEMS_NOT_DEFINED; if ( !routine ) 590e6: 4a83 tstl %d3 590e8: 6700 00ac beqw 59196 return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) 590ec: 2f02 movel %d2,%sp@- 590ee: 4eb9 0005 5d94 jsr 55d94 <_TOD_Validate> 590f4: 588f addql #4,%sp 590f6: 4a00 tstb %d0 590f8: 660c bnes 59106 the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); (*timer_server->schedule_operation)( timer_server, the_timer ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; 590fa: 7014 moveq #20,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 590fc: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3 59102: 4e5e unlk %fp 59104: 4e75 rts return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 59106: 2f02 movel %d2,%sp@- 59108: 4eb9 0005 5c84 jsr 55c84 <_TOD_To_seconds> if ( seconds <= _TOD_Seconds_since_epoch() ) 5910e: 588f addql #4,%sp return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 59110: 2400 movel %d0,%d2 if ( seconds <= _TOD_Seconds_since_epoch() ) 59112: b0b9 0007 e85e cmpl 7e85e <_TOD_Now>,%d0 59118: 63e0 blss 590fa 5911a: 486e fffc pea %fp@(-4) 5911e: 2f2e 0008 movel %fp@(8),%sp@- 59122: 4879 0007 f060 pea 7f060 <_Timer_Information> 59128: 4eb9 0005 b9a4 jsr 5b9a4 <_Objects_Get> return RTEMS_INVALID_CLOCK; the_timer = _Timer_Get( id, &location ); switch ( location ) { 5912e: 4fef 000c lea %sp@(12),%sp 59132: 2640 moveal %d0,%a3 59134: 4aae fffc tstl %fp@(-4) 59138: 6674 bnes 591ae case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); 5913a: 486b 0010 pea %a3@(16) 5913e: 4eb9 0005 d8e4 jsr 5d8e4 <_Watchdog_Remove> the_watchdog->routine = routine; the_watchdog->id = id; 59144: 202e 0008 movel %fp@(8),%d0 59148: 2740 0030 movel %d0,%a3@(48) the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK; _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); 5914c: 94b9 0007 e85e subl 7e85e <_TOD_Now>,%d2 the_timer = _Timer_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK; 59152: 7003 moveq #3,%d0 the_watchdog->user_data = user_data; 59154: 276e 0014 0034 movel %fp@(20),%a3@(52) 5915a: 2740 0038 movel %d0,%a3@(56) _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); 5915e: 2742 001c movel %d2,%a3@(28) Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 59162: 2743 002c movel %d3,%a3@(44) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 59166: 42ab 0018 clrl %a3@(24) (*timer_server->schedule_operation)( timer_server, the_timer ); 5916a: 2f0b movel %a3,%sp@- 5916c: 2f0a movel %a2,%sp@- 5916e: 206a 0004 moveal %a2@(4),%a0 59172: 4e90 jsr %a0@ _Thread_Enable_dispatch(); 59174: 4eb9 0005 c2c0 jsr 5c2c0 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 5917a: 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(); 5917e: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 59180: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3 59186: 4e5e unlk %fp 59188: 4e75 rts Timer_server_Control *timer_server = _Timer_server; if ( !timer_server ) return RTEMS_INCORRECT_STATE; if ( !_TOD_Is_set ) 5918a: 700b moveq #11,%d0 <== NOT EXECUTED case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 5918c: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3 <== NOT EXECUTED 59192: 4e5e unlk %fp <== NOT EXECUTED 59194: 4e75 rts <== NOT EXECUTED return RTEMS_INCORRECT_STATE; if ( !_TOD_Is_set ) return RTEMS_NOT_DEFINED; if ( !routine ) 59196: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 59198: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3 5919e: 4e5e unlk %fp 591a0: 4e75 rts Timer_Control *the_timer; Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; if ( !timer_server ) 591a2: 700e moveq #14,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 591a4: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3 591aa: 4e5e unlk %fp 591ac: 4e75 rts seconds = _TOD_To_seconds( wall_time ); if ( seconds <= _TOD_Seconds_since_epoch() ) return RTEMS_INVALID_CLOCK; the_timer = _Timer_Get( id, &location ); switch ( location ) { 591ae: 7004 moveq #4,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 591b0: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3 591b6: 4e5e unlk %fp ... 00048b84 : int sem_timedwait( sem_t *sem, const struct timespec *abstime ) { 48b84: 4e56 fffc linkw %fp,#-4 48b88: 2f02 movel %d2,%sp@- * * If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID, * POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW, * then we should not wait. */ status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks ); 48b8a: 486e fffc pea %fp@(-4) 48b8e: 2f2e 000c movel %fp@(12),%sp@- int sem_timedwait( sem_t *sem, const struct timespec *abstime ) { 48b92: 242e 0008 movel %fp@(8),%d2 * * If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID, * POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW, * then we should not wait. */ status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks ); 48b96: 4eb9 0004 e560 jsr 4e560 <_POSIX_Absolute_timeout_to_ticks> if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) 48b9c: 508f addql #8,%sp 48b9e: 7203 moveq #3,%d1 48ba0: b280 cmpl %d0,%d1 48ba2: 671a beqs 48bbe do_wait = false; lock_status = _POSIX_Semaphore_Wait_support( sem, do_wait, ticks ); 48ba4: 2f2e fffc movel %fp@(-4),%sp@- <== NOT EXECUTED 48ba8: 42a7 clrl %sp@- <== NOT EXECUTED 48baa: 2f02 movel %d2,%sp@- <== NOT EXECUTED 48bac: 4eb9 0004 f1c4 jsr 4f1c4 <_POSIX_Semaphore_Wait_support> <== NOT EXECUTED break; } } return lock_status; } 48bb2: 242e fff8 movel %fp@(-8),%d2 <== NOT EXECUTED */ status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks ); if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; lock_status = _POSIX_Semaphore_Wait_support( sem, do_wait, ticks ); 48bb6: 4fef 000c lea %sp@(12),%sp <== NOT EXECUTED break; } } return lock_status; } 48bba: 4e5e unlk %fp <== NOT EXECUTED 48bbc: 4e75 rts <== NOT EXECUTED */ status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks ); if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; lock_status = _POSIX_Semaphore_Wait_support( sem, do_wait, ticks ); 48bbe: 2f2e fffc movel %fp@(-4),%sp@- 48bc2: 4878 0001 pea 1 48bc6: 2f02 movel %d2,%sp@- 48bc8: 4eb9 0004 f1c4 jsr 4f1c4 <_POSIX_Semaphore_Wait_support> break; } } return lock_status; } 48bce: 242e fff8 movel %fp@(-8),%d2 */ status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks ); if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; lock_status = _POSIX_Semaphore_Wait_support( sem, do_wait, ticks ); 48bd2: 4fef 000c lea %sp@(12),%sp break; } } return lock_status; } 48bd6: 4e5e unlk %fp ... 00048b74 : #include int sigsuspend( const sigset_t *sigmask ) { 48b74: 4e56 ffec linkw %fp,#-20 48b78: 48d7 040c moveml %d2-%d3/%a2,%sp@ int status; POSIX_API_Control *api; api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; status = sigprocmask( SIG_BLOCK, sigmask, &saved_signals_blocked ); 48b7c: 240e movel %fp,%d2 48b7e: 5982 subql #4,%d2 48b80: 45f9 0004 8b4c lea 48b4c ,%a2 (void) sigfillset( &all_signals ); 48b86: 260e movel %fp,%d3 48b88: 5183 subql #8,%d3 int status; POSIX_API_Control *api; api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; status = sigprocmask( SIG_BLOCK, sigmask, &saved_signals_blocked ); 48b8a: 2f02 movel %d2,%sp@- 48b8c: 2f2e 0008 movel %fp@(8),%sp@- 48b90: 4878 0001 pea 1 48b94: 4e92 jsr %a2@ (void) sigfillset( &all_signals ); 48b96: 2f03 movel %d3,%sp@- 48b98: 4eb9 0004 8aa8 jsr 48aa8 status = sigtimedwait( &all_signals, NULL, NULL ); 48b9e: 42a7 clrl %sp@- 48ba0: 42a7 clrl %sp@- 48ba2: 2f03 movel %d3,%sp@- 48ba4: 4eb9 0004 8c30 jsr 48c30 48baa: 2600 movel %d0,%d3 (void) sigprocmask( SIG_SETMASK, &saved_signals_blocked, NULL ); 48bac: 42a7 clrl %sp@- 48bae: 2f02 movel %d2,%sp@- 48bb0: 42a7 clrl %sp@- 48bb2: 4e92 jsr %a2@ /* * sigtimedwait() returns the signal number while sigsuspend() * is supposed to return -1 and EINTR when a signal is caught. */ if ( status != -1 ) 48bb4: 4fef 0028 lea %sp@(40),%sp 48bb8: 70ff moveq #-1,%d0 48bba: b083 cmpl %d3,%d0 48bbc: 660c bnes 48bca rtems_set_errno_and_return_minus_one( EINTR ); return status; } 48bbe: 70ff moveq #-1,%d0 <== NOT EXECUTED 48bc0: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 <== NOT EXECUTED 48bc6: 4e5e unlk %fp <== NOT EXECUTED 48bc8: 4e75 rts <== NOT EXECUTED /* * sigtimedwait() returns the signal number while sigsuspend() * is supposed to return -1 and EINTR when a signal is caught. */ if ( status != -1 ) rtems_set_errno_and_return_minus_one( EINTR ); 48bca: 4eb9 0005 1eec jsr 51eec <__errno> 48bd0: 2040 moveal %d0,%a0 48bd2: 7004 moveq #4,%d0 return status; } 48bd4: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 /* * sigtimedwait() returns the signal number while sigsuspend() * is supposed to return -1 and EINTR when a signal is caught. */ if ( status != -1 ) rtems_set_errno_and_return_minus_one( EINTR ); 48bda: 2080 movel %d0,%a0@ return status; } 48bdc: 70ff moveq #-1,%d0 48bde: 4e5e unlk %fp ... 000459f4 : timer_t timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue ) { 459f4: 4e56 ffc8 linkw %fp,#-56 459f8: 202e 000c movel %fp@(12),%d0 459fc: 48d7 3c1c moveml %d2-%d4/%a2-%a5,%sp@ 45a00: 266e 0010 moveal %fp@(16),%a3 45a04: 282e 0014 movel %fp@(20),%d4 Objects_Locations location; bool activated; uint32_t initial_period; struct itimerspec normalize; if ( !value ) 45a08: 4a8b tstl %a3 45a0a: 6700 0194 beqw 45ba0 rtems_set_errno_and_return_minus_one( EINVAL ); /* First, it verifies if the structure "value" is correct */ if ( ( value->it_value.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) || 45a0e: 223c 3b9a c9ff movel #999999999,%d1 45a14: b2ab 000c cmpl %a3@(12),%d1 45a18: 6500 0186 bcsw 45ba0 ( value->it_value.tv_nsec < 0 ) || ( value->it_interval.tv_nsec >= TOD_NANOSECONDS_PER_SECOND) || 45a1c: b2ab 0004 cmpl %a3@(4),%d1 45a20: 6500 017e bcsw 45ba0 ( value->it_interval.tv_nsec < 0 )) { /* The number of nanoseconds is not correct */ rtems_set_errno_and_return_minus_one( EINVAL ); } if ( flags != TIMER_ABSTIME && flags != POSIX_TIMER_RELATIVE ) { 45a24: 7204 moveq #4,%d1 45a26: b280 cmpl %d0,%d1 45a28: 6700 00fa beqw 45b24 45a2c: 4a80 tstl %d0 45a2e: 6600 0170 bnew 45ba0 rtems_set_errno_and_return_minus_one( EINVAL ); } normalize = *value; 45a32: 260e movel %fp,%d3 45a34: 0683 ffff ffe4 addil #-28,%d3 45a3a: 204b moveal %a3,%a0 45a3c: 2243 moveal %d3,%a1 45a3e: 240e movel %fp,%d2 45a40: 0682 ffff ffe8 addil #-24,%d2 45a46: 49ee ffec lea %fp@(-20),%a4 45a4a: 4bee fff0 lea %fp@(-16),%a5 45a4e: 2298 movel %a0@+,%a1@ 45a50: 2242 moveal %d2,%a1 45a52: 2298 movel %a0@+,%a1@ 45a54: 2898 movel %a0@+,%a4@ 45a56: 2a90 movel %a0@,%a5@ RTEMS_INLINE_ROUTINE POSIX_Timer_Control *_POSIX_Timer_Get ( timer_t id, Objects_Locations *location ) { return (POSIX_Timer_Control *) 45a58: 486e fffc pea %fp@(-4) 45a5c: 2f2e 0008 movel %fp@(8),%sp@- 45a60: 4879 0005 ff4c pea 5ff4c <_POSIX_Timer_Information> 45a66: 4eb9 0004 7e7c jsr 47e7c <_Objects_Get> * something with the structure of times of the timer: to stop, start * or start it again */ ptimer = _POSIX_Timer_Get( timerid, &location ); switch ( location ) { 45a6c: 4fef 000c lea %sp@(12),%sp 45a70: 2440 moveal %d0,%a2 45a72: 4aae fffc tstl %fp@(-4) 45a76: 6600 0128 bnew 45ba0 case OBJECTS_LOCAL: /* First, it verifies if the timer must be stopped */ if ( normalize.it_value.tv_sec == 0 && normalize.it_value.tv_nsec == 0 ) { 45a7a: 4aae ffec tstl %fp@(-20) 45a7e: 6608 bnes 45a88 45a80: 4aae fff0 tstl %fp@(-16) 45a84: 6700 0132 beqw 45bb8 _Thread_Enable_dispatch(); return 0; } /* Convert from seconds and nanoseconds to ticks */ ptimer->ticks = _Timespec_To_ticks( &value->it_interval ); 45a88: 2f0b movel %a3,%sp@- 45a8a: 47f9 0004 95b4 lea 495b4 <_Timespec_To_ticks>,%a3 45a90: 4e93 jsr %a3@ 45a92: 2540 0062 movel %d0,%a2@(98) initial_period = _Timespec_To_ticks( &normalize.it_value ); 45a96: 2f0c movel %a4,%sp@- 45a98: 4e93 jsr %a3@ activated = _POSIX_Timer_Insert_helper( 45a9a: 2f0a movel %a2,%sp@- 45a9c: 4879 0004 5cc0 pea 45cc0 <_POSIX_Timer_TSR> 45aa2: 2f2a 0008 movel %a2@(8),%sp@- 45aa6: 2f00 movel %d0,%sp@- 45aa8: 486a 0010 pea %a2@(16) 45aac: 4eb9 0004 bf48 jsr 4bf48 <_POSIX_Timer_Insert_helper> initial_period, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) { 45ab2: 4fef 001c lea %sp@(28),%sp 45ab6: 4a00 tstb %d0 45ab8: 6700 0166 beqw 45c20 /* * The timer has been started and is running. So we return the * old ones in "ovalue" */ if ( ovalue ) 45abc: 4a84 tstl %d4 45abe: 6700 0172 beqw 45c32 *ovalue = ptimer->timer_data; 45ac2: 220a movel %a2,%d1 45ac4: 0681 0000 0052 addil #82,%d1 45aca: 2044 moveal %d4,%a0 45acc: 2241 moveal %d1,%a1 45ace: 200a movel %a2,%d0 45ad0: 0680 0000 0056 addil #86,%d0 45ad6: 47ea 005a lea %a2@(90),%a3 45ada: 280a movel %a2,%d4 45adc: 0684 0000 005e addil #94,%d4 45ae2: 20d1 movel %a1@,%a0@+ 45ae4: 2240 moveal %d0,%a1 45ae6: 20d1 movel %a1@,%a0@+ 45ae8: 2244 moveal %d4,%a1 45aea: 20d3 movel %a3@,%a0@+ 45aec: 2091 movel %a1@,%a0@ ptimer->timer_data = normalize; 45aee: 2041 moveal %d1,%a0 45af0: 2243 moveal %d3,%a1 45af2: 2091 movel %a1@,%a0@ 45af4: 2040 moveal %d0,%a0 45af6: 2242 moveal %d2,%a1 45af8: 2091 movel %a1@,%a0@ 45afa: 2044 moveal %d4,%a0 45afc: 2694 movel %a4@,%a3@ 45afe: 2095 movel %a5@,%a0@ /* Indicate that the time is running */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; 45b00: 7003 moveq #3,%d0 45b02: 1540 003c moveb %d0,%a2@(60) _TOD_Get( &ptimer->time ); 45b06: 486a 006a pea %a2@(106) 45b0a: 4eb9 0004 7470 jsr 47470 <_TOD_Get> _Thread_Enable_dispatch(); 45b10: 4eb9 0004 868c jsr 4868c <_Thread_Enable_dispatch> return 0; 45b16: 588f addql #4,%sp ptimer->timer_data = normalize; /* Indicate that the time is running */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; _TOD_Get( &ptimer->time ); _Thread_Enable_dispatch(); 45b18: 4280 clrl %d0 case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EINVAL ); } 45b1a: 4cee 3c1c ffc8 moveml %fp@(-56),%d2-%d4/%a2-%a5 45b20: 4e5e unlk %fp 45b22: 4e75 rts if ( flags != TIMER_ABSTIME && flags != POSIX_TIMER_RELATIVE ) { rtems_set_errno_and_return_minus_one( EINVAL ); } normalize = *value; 45b24: 260e movel %fp,%d3 45b26: 0683 ffff ffe4 addil #-28,%d3 45b2c: 204b moveal %a3,%a0 45b2e: 2243 moveal %d3,%a1 45b30: 240e movel %fp,%d2 45b32: 0682 ffff ffe8 addil #-24,%d2 45b38: 200e movel %fp,%d0 45b3a: 0680 ffff ffec addil #-20,%d0 /* Convert absolute to relative time */ if (flags == TIMER_ABSTIME) { struct timespec now; _TOD_Get( &now ); /* Check for seconds in the past */ if ( _Timespec_Greater_than( &now, &normalize.it_value ) ) 45b40: 2840 moveal %d0,%a4 if ( flags != TIMER_ABSTIME && flags != POSIX_TIMER_RELATIVE ) { rtems_set_errno_and_return_minus_one( EINVAL ); } normalize = *value; 45b42: 4bee fff0 lea %fp@(-16),%a5 /* Convert absolute to relative time */ if (flags == TIMER_ABSTIME) { struct timespec now; _TOD_Get( &now ); 45b46: 45ee fff4 lea %fp@(-12),%a2 if ( flags != TIMER_ABSTIME && flags != POSIX_TIMER_RELATIVE ) { rtems_set_errno_and_return_minus_one( EINVAL ); } normalize = *value; 45b4a: 2298 movel %a0@+,%a1@ 45b4c: 2242 moveal %d2,%a1 45b4e: 2298 movel %a0@+,%a1@ 45b50: 2898 movel %a0@+,%a4@ 45b52: 2a90 movel %a0@,%a5@ /* Convert absolute to relative time */ if (flags == TIMER_ABSTIME) { struct timespec now; _TOD_Get( &now ); 45b54: 2f0a movel %a2,%sp@- 45b56: 4eb9 0004 7470 jsr 47470 <_TOD_Get> /* Check for seconds in the past */ if ( _Timespec_Greater_than( &now, &normalize.it_value ) ) 45b5c: 2f0c movel %a4,%sp@- 45b5e: 2f0a movel %a2,%sp@- 45b60: 4eb9 0004 952c jsr 4952c <_Timespec_Greater_than> 45b66: 4fef 000c lea %sp@(12),%sp 45b6a: 4a00 tstb %d0 45b6c: 6632 bnes 45ba0 rtems_set_errno_and_return_minus_one( EINVAL ); _Timespec_Subtract( &now, &normalize.it_value, &normalize.it_value ); 45b6e: 2f0c movel %a4,%sp@- 45b70: 2f0c movel %a4,%sp@- 45b72: 2f0a movel %a2,%sp@- 45b74: 4eb9 0004 9560 jsr 49560 <_Timespec_Subtract> 45b7a: 4fef 000c lea %sp@(12),%sp 45b7e: 486e fffc pea %fp@(-4) 45b82: 2f2e 0008 movel %fp@(8),%sp@- 45b86: 4879 0005 ff4c pea 5ff4c <_POSIX_Timer_Information> 45b8c: 4eb9 0004 7e7c jsr 47e7c <_Objects_Get> * something with the structure of times of the timer: to stop, start * or start it again */ ptimer = _POSIX_Timer_Get( timerid, &location ); switch ( location ) { 45b92: 4fef 000c lea %sp@(12),%sp 45b96: 2440 moveal %d0,%a2 45b98: 4aae fffc tstl %fp@(-4) 45b9c: 6700 fedc beqw 45a7a #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EINVAL ); 45ba0: 4eb9 0004 f4d0 jsr 4f4d0 <__errno> 45ba6: 7216 moveq #22,%d1 45ba8: 2040 moveal %d0,%a0 45baa: 70ff moveq #-1,%d0 } 45bac: 4cee 3c1c ffc8 moveml %fp@(-56),%d2-%d4/%a2-%a5 #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EINVAL ); 45bb2: 2081 movel %d1,%a0@ } 45bb4: 4e5e unlk %fp 45bb6: 4e75 rts case OBJECTS_LOCAL: /* First, it verifies if the timer must be stopped */ if ( normalize.it_value.tv_sec == 0 && normalize.it_value.tv_nsec == 0 ) { /* Stop the timer */ (void) _Watchdog_Remove( &ptimer->Timer ); 45bb8: 486a 0010 pea %a2@(16) 45bbc: 4eb9 0004 9a08 jsr 49a08 <_Watchdog_Remove> /* The old data of the timer are returned */ if ( ovalue ) 45bc2: 588f addql #4,%sp 45bc4: 4a84 tstl %d4 45bc6: 6700 00b6 beqw 45c7e *ovalue = ptimer->timer_data; 45bca: 220a movel %a2,%d1 45bcc: 0681 0000 0052 addil #82,%d1 45bd2: 2244 moveal %d4,%a1 45bd4: 2041 moveal %d1,%a0 45bd6: 200a movel %a2,%d0 45bd8: 0680 0000 0056 addil #86,%d0 45bde: 47ea 005a lea %a2@(90),%a3 45be2: 280a movel %a2,%d4 45be4: 0684 0000 005e addil #94,%d4 45bea: 22d0 movel %a0@,%a1@+ 45bec: 2040 moveal %d0,%a0 45bee: 22d0 movel %a0@,%a1@+ 45bf0: 2044 moveal %d4,%a0 45bf2: 22d3 movel %a3@,%a1@+ 45bf4: 2290 movel %a0@,%a1@ /* The new data are set */ ptimer->timer_data = normalize; 45bf6: 2241 moveal %d1,%a1 45bf8: 2043 moveal %d3,%a0 45bfa: 2290 movel %a0@,%a1@ 45bfc: 2240 moveal %d0,%a1 45bfe: 2042 moveal %d2,%a0 45c00: 2290 movel %a0@,%a1@ 45c02: 2244 moveal %d4,%a1 45c04: 2694 movel %a4@,%a3@ 45c06: 2295 movel %a5@,%a1@ /* Indicates that the timer is created and stopped */ ptimer->state = POSIX_TIMER_STATE_CREATE_STOP; 45c08: 7004 moveq #4,%d0 45c0a: 1540 003c moveb %d0,%a2@(60) /* Returns with success */ _Thread_Enable_dispatch(); 45c0e: 4eb9 0004 868c jsr 4868c <_Thread_Enable_dispatch> 45c14: 4280 clrl %d0 case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EINVAL ); } 45c16: 4cee 3c1c ffc8 moveml %fp@(-56),%d2-%d4/%a2-%a5 45c1c: 4e5e unlk %fp 45c1e: 4e75 rts ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) { _Thread_Enable_dispatch(); 45c20: 4eb9 0004 868c jsr 4868c <_Thread_Enable_dispatch> 45c26: 4280 clrl %d0 case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EINVAL ); } 45c28: 4cee 3c1c ffc8 moveml %fp@(-56),%d2-%d4/%a2-%a5 45c2e: 4e5e unlk %fp 45c30: 4e75 rts 45c32: 220a movel %a2,%d1 45c34: 0681 0000 0052 addil #82,%d1 * The timer has been started and is running. So we return the * old ones in "ovalue" */ if ( ovalue ) *ovalue = ptimer->timer_data; ptimer->timer_data = normalize; 45c3a: 2041 moveal %d1,%a0 45c3c: 2243 moveal %d3,%a1 45c3e: 200a movel %a2,%d0 45c40: 0680 0000 0056 addil #86,%d0 45c46: 47ea 005a lea %a2@(90),%a3 45c4a: 280a movel %a2,%d4 45c4c: 0684 0000 005e addil #94,%d4 45c52: 2091 movel %a1@,%a0@ 45c54: 2040 moveal %d0,%a0 45c56: 2242 moveal %d2,%a1 45c58: 2091 movel %a1@,%a0@ 45c5a: 2044 moveal %d4,%a0 45c5c: 2694 movel %a4@,%a3@ 45c5e: 2095 movel %a5@,%a0@ /* Indicate that the time is running */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; 45c60: 7003 moveq #3,%d0 45c62: 1540 003c moveb %d0,%a2@(60) _TOD_Get( &ptimer->time ); 45c66: 486a 006a pea %a2@(106) 45c6a: 4eb9 0004 7470 jsr 47470 <_TOD_Get> _Thread_Enable_dispatch(); 45c70: 4eb9 0004 868c jsr 4868c <_Thread_Enable_dispatch> return 0; 45c76: 588f addql #4,%sp ptimer->timer_data = normalize; /* Indicate that the time is running */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; _TOD_Get( &ptimer->time ); _Thread_Enable_dispatch(); 45c78: 4280 clrl %d0 45c7a: 6000 fe9e braw 45b1a 45c7e: 220a movel %a2,%d1 45c80: 0681 0000 0052 addil #82,%d1 (void) _Watchdog_Remove( &ptimer->Timer ); /* The old data of the timer are returned */ if ( ovalue ) *ovalue = ptimer->timer_data; /* The new data are set */ ptimer->timer_data = normalize; 45c86: 2241 moveal %d1,%a1 45c88: 2043 moveal %d3,%a0 45c8a: 200a movel %a2,%d0 45c8c: 0680 0000 0056 addil #86,%d0 45c92: 47ea 005a lea %a2@(90),%a3 45c96: 280a movel %a2,%d4 45c98: 0684 0000 005e addil #94,%d4 45c9e: 2290 movel %a0@,%a1@ 45ca0: 2240 moveal %d0,%a1 45ca2: 2042 moveal %d2,%a0 45ca4: 2290 movel %a0@,%a1@ 45ca6: 2244 moveal %d4,%a1 45ca8: 2694 movel %a4@,%a3@ 45caa: 2295 movel %a5@,%a1@ /* Indicates that the timer is created and stopped */ ptimer->state = POSIX_TIMER_STATE_CREATE_STOP; 45cac: 7004 moveq #4,%d0 45cae: 1540 003c moveb %d0,%a2@(60) /* Returns with success */ _Thread_Enable_dispatch(); 45cb2: 4eb9 0004 868c jsr 4868c <_Thread_Enable_dispatch> 45cb8: 4280 clrl %d0 45cba: 6000 ff5a braw 45c16 ... 00045a7c : useconds_t ualarm( useconds_t useconds, useconds_t interval ) { 45a7c: 4e56 ffe8 linkw %fp,#-24 45a80: 48d7 041c moveml %d2-%d4/%a2,%sp@ 45a84: 242e 0008 movel %fp@(8),%d2 /* * Initialize the timer used to implement alarm(). */ if ( !the_timer->routine ) { 45a88: 4ab9 0006 116a tstl 6116a <_POSIX_signals_Ualarm_timer+0x1c> 45a8e: 6700 0086 beqw 45b16 _Watchdog_Initialize( the_timer, _POSIX_signals_Ualarm_TSR, 0, NULL ); } else { Watchdog_States state; state = _Watchdog_Remove( the_timer ); 45a92: 4879 0006 114e pea 6114e <_POSIX_signals_Ualarm_timer> 45a98: 4eb9 0004 96fc jsr 496fc <_Watchdog_Remove> if ( (state == WATCHDOG_ACTIVE) || (state == WATCHDOG_REMOVE_IT) ) { 45a9e: 588f addql #4,%sp 45aa0: 7201 moveq #1,%d1 45aa2: 5580 subql #2,%d0 45aa4: b280 cmpl %d0,%d1 45aa6: 6400 0098 bccw 45b40 45aaa: 4283 clrl %d3 <== NOT EXECUTED /* * If useconds is non-zero, then the caller wants to schedule * the alarm repeatedly at that interval. If the interval is * less than a single clock tick, then fudge it to a clock tick. */ if ( useconds ) { 45aac: 4a82 tstl %d2 <== NOT EXECUTED 45aae: 660c bnes 45abc <== NOT EXECUTED _Watchdog_Insert_ticks( the_timer, _Timespec_To_ticks( &tp ) ); } return remaining; } 45ab0: 2003 movel %d3,%d0 45ab2: 4cee 041c ffe8 moveml %fp@(-24),%d2-%d4/%a2 45ab8: 4e5e unlk %fp 45aba: 4e75 rts if ( useconds ) { Watchdog_Interval ticks; tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND; tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; ticks = _Timespec_To_ticks( &tp ); 45abc: 280e movel %fp,%d4 * less than a single clock tick, then fudge it to a clock tick. */ if ( useconds ) { Watchdog_Interval ticks; tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND; 45abe: 223c 000f 4240 movel #1000000,%d1 tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; ticks = _Timespec_To_ticks( &tp ); 45ac4: 5184 subql #8,%d4 45ac6: 45f9 0004 9214 lea 49214 <_Timespec_To_ticks>,%a2 * less than a single clock tick, then fudge it to a clock tick. */ if ( useconds ) { Watchdog_Interval ticks; tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND; 45acc: 4c41 2000 remul %d1,%d0,%d2 45ad0: 4c41 2002 remul %d1,%d2,%d2 tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; 45ad4: 223c 0000 03e8 movel #1000,%d1 * less than a single clock tick, then fudge it to a clock tick. */ if ( useconds ) { Watchdog_Interval ticks; tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND; 45ada: 2d42 fff8 movel %d2,%fp@(-8) tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; 45ade: 4c00 1800 mulsl %d0,%d1 ticks = _Timespec_To_ticks( &tp ); 45ae2: 2f04 movel %d4,%sp@- */ if ( useconds ) { Watchdog_Interval ticks; tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND; tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; 45ae4: 2d41 fffc movel %d1,%fp@(-4) ticks = _Timespec_To_ticks( &tp ); 45ae8: 4e92 jsr %a2@ if ( ticks == 0 ) ticks = 1; _Watchdog_Insert_ticks( the_timer, _Timespec_To_ticks( &tp ) ); 45aea: 2f04 movel %d4,%sp@- 45aec: 4e92 jsr %a2@ ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 45aee: 4879 0006 114e pea 6114e <_POSIX_signals_Ualarm_timer> 45af4: 4879 0006 0a00 pea 60a00 <_Watchdog_Ticks_chain> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 45afa: 23c0 0006 115a movel %d0,6115a <_POSIX_signals_Ualarm_timer+0xc> _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 45b00: 4eb9 0004 95b4 jsr 495b4 <_Watchdog_Insert> 45b06: 4fef 0010 lea %sp@(16),%sp } return remaining; } 45b0a: 2003 movel %d3,%d0 45b0c: 4cee 041c ffe8 moveml %fp@(-24),%d2-%d4/%a2 45b12: 4e5e unlk %fp 45b14: 4e75 rts Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 45b16: 42b9 0006 1156 clrl 61156 <_POSIX_signals_Ualarm_timer+0x8> the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 45b1c: 4283 clrl %d3 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 45b1e: 203c 0004 5b88 movel #285576,%d0 the_watchdog->id = id; 45b24: 42b9 0006 116e clrl 6116e <_POSIX_signals_Ualarm_timer+0x20> Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 45b2a: 23c0 0006 116a movel %d0,6116a <_POSIX_signals_Ualarm_timer+0x1c> the_watchdog->id = id; the_watchdog->user_data = user_data; 45b30: 42b9 0006 1172 clrl 61172 <_POSIX_signals_Ualarm_timer+0x24> /* * If useconds is non-zero, then the caller wants to schedule * the alarm repeatedly at that interval. If the interval is * less than a single clock tick, then fudge it to a clock tick. */ if ( useconds ) { 45b36: 4a82 tstl %d2 45b38: 6700 ff76 beqw 45ab0 45b3c: 6000 ff7e braw 45abc * boot. Since alarm() is dealing in seconds, we must account for * this. */ ticks = the_timer->initial; ticks -= (the_timer->stop_time - the_timer->start_time); 45b40: 2039 0006 1162 movel 61162 <_POSIX_signals_Ualarm_timer+0x14>,%d0 45b46: d0b9 0006 115a addl 6115a <_POSIX_signals_Ualarm_timer+0xc>,%d0 /* remaining is now in ticks */ _Timespec_From_ticks( ticks, &tp ); 45b4c: 486e fff8 pea %fp@(-8) 45b50: 90b9 0006 1166 subl 61166 <_POSIX_signals_Ualarm_timer+0x18>,%d0 remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND; 45b56: 283c 000f 4240 movel #1000000,%d4 ticks = the_timer->initial; ticks -= (the_timer->stop_time - the_timer->start_time); /* remaining is now in ticks */ _Timespec_From_ticks( ticks, &tp ); 45b5c: 2f00 movel %d0,%sp@- 45b5e: 4eb9 0004 9184 jsr 49184 <_Timespec_From_ticks> remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND; 45b64: 202e fff8 movel %fp@(-8),%d0 45b68: 4c04 0800 mulsl %d4,%d0 remaining += tp.tv_nsec / 1000; 45b6c: 283c 0000 03e8 movel #1000,%d4 45b72: 508f addql #8,%sp 45b74: 262e fffc movel %fp@(-4),%d3 45b78: 4c44 3803 remsl %d4,%d3,%d3 45b7c: d680 addl %d0,%d3 /* * If useconds is non-zero, then the caller wants to schedule * the alarm repeatedly at that interval. If the interval is * less than a single clock tick, then fudge it to a clock tick. */ if ( useconds ) { 45b7e: 4a82 tstl %d2 45b80: 6700 ff2e beqw 45ab0 45b84: 6000 ff36 braw 45abc <== NOT EXECUTED