=============================================================================== 0004612c <_API_Mutex_Unlock>: #include void _API_Mutex_Unlock( API_Mutex_Control *the_mutex ) { 4612c: 4e56 0000 linkw %fp,#0 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 46130: 2039 0005 ef3c movel 5ef3c <_Thread_Dispatch_disable_level>,%d0 46136: 5280 addql #1,%d0 46138: 206e 0008 moveal %fp@(8),%a0 4613c: 23c0 0005 ef3c movel %d0,5ef3c <_Thread_Dispatch_disable_level> _Thread_Disable_dispatch(); _CORE_mutex_Surrender( 46142: 42a7 clrl %sp@- 46144: 2f28 0008 movel %a0@(8),%sp@- 46148: 4868 0010 pea %a0@(16) 4614c: 4eb9 0004 63b4 jsr 463b4 <_CORE_mutex_Surrender> &the_mutex->Mutex, the_mutex->Object.id, NULL ); _Thread_Enable_dispatch(); 46152: 4fef 000c lea %sp@(12),%sp } 46156: 4e5e unlk %fp _CORE_mutex_Surrender( &the_mutex->Mutex, the_mutex->Object.id, NULL ); _Thread_Enable_dispatch(); 46158: 4ef9 0004 76b2 jmp 476b2 <_Thread_Enable_dispatch> ... =============================================================================== 000480e4 <_CORE_RWLock_Obtain_for_reading>: * If unlocked, then OK to read. * If locked for reading and no waiters, then OK to read. * If any thread is waiting, then we wait. */ _ISR_Disable( level ); 480e4: 203c 0000 0700 movel #1792,%d0 Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_RWLock_API_mp_support_callout api_rwlock_mp_support ) { 480ea: 4e56 ffe8 linkw %fp,#-24 480ee: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@ 480f2: 246e 0008 moveal %fp@(8),%a2 480f6: 282e 000c movel %fp@(12),%d4 480fa: 262e 0014 movel %fp@(20),%d3 480fe: 1a2e 0013 moveb %fp@(19),%d5 ISR_Level level; Thread_Control *executing = _Thread_Executing; 48102: 2679 0006 197a moveal 6197a <_Thread_Executing>,%a3 * If unlocked, then OK to read. * If locked for reading and no waiters, then OK to read. * If any thread is waiting, then we wait. */ _ISR_Disable( level ); 48108: 40c2 movew %sr,%d2 4810a: 8082 orl %d2,%d0 4810c: 46c0 movew %d0,%sr switch ( the_rwlock->current_state ) { 4810e: 202a 0044 movel %a2@(68),%d0 48112: 6708 beqs 4811c <_CORE_RWLock_Obtain_for_reading+0x38> 48114: 7201 moveq #1,%d1 48116: b280 cmpl %d0,%d1 48118: 662a bnes 48144 <_CORE_RWLock_Obtain_for_reading+0x60> 4811a: 600e bras 4812a <_CORE_RWLock_Obtain_for_reading+0x46> case CORE_RWLOCK_UNLOCKED: the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING; 4811c: 7001 moveq #1,%d0 the_rwlock->number_of_readers += 1; 4811e: 52aa 0048 addql #1,%a2@(72) */ _ISR_Disable( level ); switch ( the_rwlock->current_state ) { case CORE_RWLOCK_UNLOCKED: the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING; 48122: 2540 0044 movel %d0,%a2@(68) the_rwlock->number_of_readers += 1; _ISR_Enable( level ); 48126: 46c2 movew %d2,%sr 48128: 6014 bras 4813e <_CORE_RWLock_Obtain_for_reading+0x5a> executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; return; case CORE_RWLOCK_LOCKED_FOR_READING: { Thread_Control *waiter; waiter = _Thread_queue_First( &the_rwlock->Wait_queue ); 4812a: 2f0a movel %a2,%sp@- 4812c: 4eb9 0004 9c64 jsr 49c64 <_Thread_queue_First> if ( !waiter ) { 48132: 588f addql #4,%sp 48134: 4a80 tstl %d0 48136: 660c bnes 48144 <_CORE_RWLock_Obtain_for_reading+0x60><== NEVER TAKEN the_rwlock->number_of_readers += 1; 48138: 52aa 0048 addql #1,%a2@(72) _ISR_Enable( level ); 4813c: 46c2 movew %d2,%sr executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 4813e: 42ab 0034 clrl %a3@(52) return; 48142: 6046 bras 4818a <_CORE_RWLock_Obtain_for_reading+0xa6> /* * If the thread is not willing to wait, then return immediately. */ if ( !wait ) { 48144: 4a05 tstb %d5 48146: 660a bnes 48152 <_CORE_RWLock_Obtain_for_reading+0x6e> _ISR_Enable( level ); 48148: 46c2 movew %d2,%sr executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; 4814a: 7202 moveq #2,%d1 4814c: 2741 0034 movel %d1,%a3@(52) 48150: 6038 bras 4818a <_CORE_RWLock_Obtain_for_reading+0xa6> 48152: 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; 48154: 2744 0020 movel %d4,%a3@(32) executing->Wait.option = CORE_RWLOCK_THREAD_WAITING_FOR_READ; executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 48158: 42ab 0034 clrl %a3@(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; 4815c: 274a 0044 movel %a2,%a3@(68) executing->Wait.id = id; executing->Wait.option = CORE_RWLOCK_THREAD_WAITING_FOR_READ; 48160: 42ab 0030 clrl %a3@(48) 48164: 2540 0030 movel %d0,%a2@(48) executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; _ISR_Enable( level ); 48168: 46c2 movew %d2,%sr _Thread_queue_Enqueue_with_handler( 4816a: 2d43 000c movel %d3,%fp@(12) 4816e: 223c 0004 82d4 movel #295636,%d1 48174: 2d4a 0008 movel %a2,%fp@(8) timeout, _CORE_RWLock_Timeout ); /* return to API level so it can dispatch and we block */ } 48178: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 executing->Wait.id = id; executing->Wait.option = CORE_RWLOCK_THREAD_WAITING_FOR_READ; executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; _ISR_Enable( level ); _Thread_queue_Enqueue_with_handler( 4817e: 2d41 0010 movel %d1,%fp@(16) timeout, _CORE_RWLock_Timeout ); /* return to API level so it can dispatch and we block */ } 48182: 4e5e unlk %fp executing->Wait.id = id; executing->Wait.option = CORE_RWLOCK_THREAD_WAITING_FOR_READ; executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; _ISR_Enable( level ); _Thread_queue_Enqueue_with_handler( 48184: 4ef9 0004 9964 jmp 49964 <_Thread_queue_Enqueue_with_handler> timeout, _CORE_RWLock_Timeout ); /* return to API level so it can dispatch and we block */ } 4818a: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 48190: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00048220 <_CORE_RWLock_Release>: * 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 ); 48220: 223c 0000 0700 movel #1792,%d1 */ CORE_RWLock_Status _CORE_RWLock_Release( CORE_RWLock_Control *the_rwlock ) { 48226: 4e56 fff0 linkw %fp,#-16 ISR_Level level; Thread_Control *executing = _Thread_Executing; 4822a: 2079 0006 197a moveal 6197a <_Thread_Executing>,%a0 */ CORE_RWLock_Status _CORE_RWLock_Release( CORE_RWLock_Control *the_rwlock ) { 48230: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ 48234: 246e 0008 moveal %fp@(8),%a2 * 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 ); 48238: 40c0 movew %sr,%d0 4823a: 8280 orl %d0,%d1 4823c: 46c1 movew %d1,%sr if ( the_rwlock->current_state == CORE_RWLOCK_UNLOCKED){ 4823e: 222a 0044 movel %a2@(68),%d1 48242: 660a bnes 4824e <_CORE_RWLock_Release+0x2e> _ISR_Enable( level ); 48244: 46c0 movew %d0,%sr executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; 48246: 7002 moveq #2,%d0 48248: 2140 0034 movel %d0,%a0@(52) return CORE_RWLOCK_SUCCESSFUL; 4824c: 6078 bras 482c6 <_CORE_RWLock_Release+0xa6> } if ( the_rwlock->current_state == CORE_RWLOCK_LOCKED_FOR_READING ) { 4824e: 7401 moveq #1,%d2 48250: b481 cmpl %d1,%d2 48252: 6610 bnes 48264 <_CORE_RWLock_Release+0x44> the_rwlock->number_of_readers -= 1; 48254: 222a 0048 movel %a2@(72),%d1 48258: 5381 subql #1,%d1 4825a: 2541 0048 movel %d1,%a2@(72) if ( the_rwlock->number_of_readers != 0 ) { 4825e: 6704 beqs 48264 <_CORE_RWLock_Release+0x44> /* must be unlocked again */ _ISR_Enable( level ); 48260: 46c0 movew %d0,%sr return CORE_RWLOCK_SUCCESSFUL; 48262: 6062 bras 482c6 <_CORE_RWLock_Release+0xa6> } } /* CORE_RWLOCK_LOCKED_FOR_WRITING or READING with readers */ executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 48264: 42a8 0034 clrl %a0@(52) /* * Implicitly transition to "unlocked" and find another thread interested * in obtaining this rwlock. */ the_rwlock->current_state = CORE_RWLOCK_UNLOCKED; 48268: 42aa 0044 clrl %a2@(68) _ISR_Enable( level ); 4826c: 46c0 movew %d0,%sr next = _Thread_queue_Dequeue( &the_rwlock->Wait_queue ); 4826e: 2f0a movel %a2,%sp@- 48270: 4eb9 0004 9824 jsr 49824 <_Thread_queue_Dequeue> if ( next ) { 48276: 588f addql #4,%sp 48278: 4a80 tstl %d0 4827a: 674a beqs 482c6 <_CORE_RWLock_Release+0xa6> if ( next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) { 4827c: 7201 moveq #1,%d1 4827e: 2040 moveal %d0,%a0 48280: b2a8 0030 cmpl %a0@(48),%d1 48284: 6608 bnes 4828e <_CORE_RWLock_Release+0x6e> the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_WRITING; 48286: 7002 moveq #2,%d0 48288: 2540 0044 movel %d0,%a2@(68) return CORE_RWLOCK_SUCCESSFUL; 4828c: 6038 bras 482c6 <_CORE_RWLock_Release+0xa6> /* * Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING */ the_rwlock->number_of_readers += 1; the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING; 4828e: 7201 moveq #1,%d1 } /* * Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING */ the_rwlock->number_of_readers += 1; 48290: 52aa 0048 addql #1,%a2@(72) /* * Now see if more readers can be let go. */ while ( 1 ) { next = _Thread_queue_First( &the_rwlock->Wait_queue ); 48294: 49f9 0004 9c64 lea 49c64 <_Thread_queue_First>,%a4 if ( !next || next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) return CORE_RWLOCK_SUCCESSFUL; the_rwlock->number_of_readers += 1; _Thread_queue_Extract( &the_rwlock->Wait_queue, next ); 4829a: 47f9 0004 9b38 lea 49b38 <_Thread_queue_Extract>,%a3 /* * Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING */ the_rwlock->number_of_readers += 1; the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING; 482a0: 2541 0044 movel %d1,%a2@(68) /* * Now see if more readers can be let go. */ while ( 1 ) { next = _Thread_queue_First( &the_rwlock->Wait_queue ); 482a4: 2f0a movel %a2,%sp@- 482a6: 4e94 jsr %a4@ if ( !next || 482a8: 588f addql #4,%sp 482aa: 4a80 tstl %d0 482ac: 6718 beqs 482c6 <_CORE_RWLock_Release+0xa6> next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) 482ae: 7401 moveq #1,%d2 482b0: 2040 moveal %d0,%a0 482b2: b4a8 0030 cmpl %a0@(48),%d2 482b6: 670e beqs 482c6 <_CORE_RWLock_Release+0xa6> <== NEVER TAKEN return CORE_RWLOCK_SUCCESSFUL; the_rwlock->number_of_readers += 1; 482b8: 52aa 0048 addql #1,%a2@(72) _Thread_queue_Extract( &the_rwlock->Wait_queue, next ); 482bc: 2f00 movel %d0,%sp@- 482be: 2f0a movel %a2,%sp@- 482c0: 4e93 jsr %a3@ } 482c2: 508f addql #8,%sp 482c4: 60de bras 482a4 <_CORE_RWLock_Release+0x84> } /* indentation is to match _ISR_Disable at top */ return CORE_RWLOCK_SUCCESSFUL; } 482c6: 4280 clrl %d0 482c8: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 482ce: 4e5e unlk %fp ... =============================================================================== 000482d4 <_CORE_RWLock_Timeout>: void _CORE_RWLock_Timeout( Objects_Id id, void *ignored ) { 482d4: 4e56 fffc linkw %fp,#-4 Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 482d8: 486e fffc pea %fp@(-4) 482dc: 2f2e 0008 movel %fp@(8),%sp@- 482e0: 4eb9 0004 94f0 jsr 494f0 <_Thread_Get> switch ( location ) { 482e6: 508f addql #8,%sp 482e8: 4aae fffc tstl %fp@(-4) 482ec: 6618 bnes 48306 <_CORE_RWLock_Timeout+0x32> <== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 482ee: 2f00 movel %d0,%sp@- 482f0: 4eb9 0004 9d48 jsr 49d48 <_Thread_queue_Process_timeout> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 482f6: 588f addql #4,%sp 482f8: 2039 0006 18c0 movel 618c0 <_Thread_Dispatch_disable_level>,%d0 482fe: 5380 subql #1,%d0 48300: 23c0 0006 18c0 movel %d0,618c0 <_Thread_Dispatch_disable_level> _Thread_Unnest_dispatch(); break; } } 48306: 4e5e unlk %fp ... =============================================================================== 0004b640 <_CORE_barrier_Wait>: Thread_Control *executing; ISR_Level level; executing = _Thread_Executing; executing->Wait.return_code = CORE_BARRIER_STATUS_SUCCESSFUL; _ISR_Disable( level ); 4b640: 203c 0000 0700 movel #1792,%d0 Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_barrier_API_mp_support_callout api_barrier_mp_support ) { 4b646: 4e56 fff4 linkw %fp,#-12 Thread_Control *executing; ISR_Level level; executing = _Thread_Executing; 4b64a: 2279 0005 eff6 moveal 5eff6 <_Thread_Executing>,%a1 Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_barrier_API_mp_support_callout api_barrier_mp_support ) { 4b650: 48d7 001c moveml %d2-%d4,%sp@ 4b654: 242e 000c movel %fp@(12),%d2 4b658: 262e 0014 movel %fp@(20),%d3 Thread_Control *executing; ISR_Level level; executing = _Thread_Executing; executing->Wait.return_code = CORE_BARRIER_STATUS_SUCCESSFUL; 4b65c: 42a9 0034 clrl %a1@(52) Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_barrier_API_mp_support_callout api_barrier_mp_support ) { 4b660: 206e 0008 moveal %fp@(8),%a0 4b664: 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 ); 4b668: 40c1 movew %sr,%d1 4b66a: 8081 orl %d1,%d0 4b66c: 46c0 movew %d0,%sr the_barrier->number_of_waiting_threads++; 4b66e: 2028 0048 movel %a0@(72),%d0 4b672: 5280 addql #1,%d0 4b674: 2140 0048 movel %d0,%a0@(72) if ( _CORE_barrier_Is_automatic( &the_barrier->Attributes ) ) { 4b678: 4aa8 0040 tstl %a0@(64) 4b67c: 6626 bnes 4b6a4 <_CORE_barrier_Wait+0x64> if ( the_barrier->number_of_waiting_threads == the_barrier->Attributes.maximum_count) { 4b67e: b0a8 0044 cmpl %a0@(68),%d0 4b682: 6620 bnes 4b6a4 <_CORE_barrier_Wait+0x64> executing->Wait.return_code = CORE_BARRIER_STATUS_AUTOMATICALLY_RELEASED; 4b684: 7001 moveq #1,%d0 4b686: 2340 0034 movel %d0,%a1@(52) _ISR_Enable( level ); 4b68a: 46c1 movew %d1,%sr _CORE_barrier_Release( the_barrier, id, api_barrier_mp_support ); 4b68c: 2d44 0010 movel %d4,%fp@(16) 4b690: 2d42 000c movel %d2,%fp@(12) 4b694: 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 ); } 4b698: 4cd7 001c moveml %sp@,%d2-%d4 4b69c: 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 ); 4b69e: 4ef9 0004 b60c jmp 4b60c <_CORE_barrier_Release> 4b6a4: 7001 moveq #1,%d0 } } _Thread_queue_Enter_critical_section( &the_barrier->Wait_queue ); executing->Wait.queue = &the_barrier->Wait_queue; executing->Wait.id = id; 4b6a6: 2342 0020 movel %d2,%a1@(32) return; } } _Thread_queue_Enter_critical_section( &the_barrier->Wait_queue ); executing->Wait.queue = &the_barrier->Wait_queue; 4b6aa: 2348 0044 movel %a0,%a1@(68) 4b6ae: 2140 0030 movel %d0,%a0@(48) executing->Wait.id = id; _ISR_Enable( level ); 4b6b2: 46c1 movew %d1,%sr _Thread_queue_Enqueue( &the_barrier->Wait_queue, timeout ); 4b6b4: 2d43 000c movel %d3,%fp@(12) 4b6b8: 203c 0004 7e38 movel #294456,%d0 4b6be: 2d48 0008 movel %a0,%fp@(8) 4b6c2: 2d40 0010 movel %d0,%fp@(16) } 4b6c6: 4cd7 001c moveml %sp@,%d2-%d4 4b6ca: 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 ); 4b6cc: 4ef9 0004 7b4c jmp 47b4c <_Thread_queue_Enqueue_with_handler> ... =============================================================================== 00052940 <_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 ) { 52940: 4e56 ffe0 linkw %fp,#-32 52944: 48d7 3c3c moveml %d2-%d5/%a2-%a5,%sp@ 52948: 246e 0008 moveal %fp@(8),%a2 5294c: 2a2e 000c movel %fp@(12),%d5 52950: 262e 0010 movel %fp@(16),%d3 52954: 286e 001c moveal %fp@(28),%a4 Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; if ( size > the_message_queue->maximum_message_size ) { 52958: b6aa 004c cmpl %a2@(76),%d3 5295c: 6304 blss 52962 <_CORE_message_queue_Broadcast+0x22><== ALWAYS TAKEN 5295e: 7001 moveq #1,%d0 <== NOT EXECUTED 52960: 6042 bras 529a4 <_CORE_message_queue_Broadcast+0x64><== NOT EXECUTED * NOTE: This check is critical because threads can block on * send and receive and this ensures that we are broadcasting * the message to threads waiting to receive -- not to send. */ if ( the_message_queue->number_of_pending_messages != 0 ) { 52962: 4aaa 0048 tstl %a2@(72) 52966: 6610 bnes 52978 <_CORE_message_queue_Broadcast+0x38> * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { 52968: 4282 clrl %d2 5296a: 283c 0005 4ccc movel #347340,%d4 const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 52970: 4bf9 0005 bb10 lea 5bb10 ,%a5 52976: 601a bras 52992 <_CORE_message_queue_Broadcast+0x52> * send and receive and this ensures that we are broadcasting * the message to threads waiting to receive -- not to send. */ if ( the_message_queue->number_of_pending_messages != 0 ) { *count = 0; 52978: 4294 clrl %a4@ 5297a: 6026 bras 529a2 <_CORE_message_queue_Broadcast+0x62> 5297c: 2f03 movel %d3,%sp@- */ number_broadcasted = 0; while ((the_thread = _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { waitp = &the_thread->Wait; number_broadcasted += 1; 5297e: 5282 addql #1,%d2 52980: 2f05 movel %d5,%sp@- 52982: 2f2b 002c movel %a3@(44),%sp@- 52986: 4e95 jsr %a5@ buffer, waitp->return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; 52988: 206b 0028 moveal %a3@(40),%a0 5298c: 4fef 000c lea %sp@(12),%sp 52990: 2083 movel %d3,%a0@ * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { 52992: 2f0a movel %a2,%sp@- 52994: 2044 moveal %d4,%a0 52996: 4e90 jsr %a0@ /* * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = 52998: 588f addql #4,%sp _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { 5299a: 2640 moveal %d0,%a3 /* * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = 5299c: 4a80 tstl %d0 5299e: 66dc bnes 5297c <_CORE_message_queue_Broadcast+0x3c> if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_message_queue_mp_support) ( the_thread, id ); #endif } *count = number_broadcasted; 529a0: 2882 movel %d2,%a4@ 529a2: 4280 clrl %d0 return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; } 529a4: 4cee 3c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a5 529aa: 4e5e unlk %fp ... =============================================================================== 0004e33c <_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)) { 4e33c: 7003 moveq #3,%d0 CORE_message_queue_Control *the_message_queue, CORE_message_queue_Attributes *the_message_queue_attributes, uint32_t maximum_pending_messages, size_t maximum_message_size ) { 4e33e: 4e56 fff4 linkw %fp,#-12 4e342: 222e 0014 movel %fp@(20),%d1 4e346: 48d7 040c moveml %d2-%d3/%a2,%sp@ 4e34a: 246e 0008 moveal %fp@(8),%a2 4e34e: 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)) { 4e352: c081 andl %d1,%d0 ) { size_t message_buffering_required; size_t allocated_message_size; the_message_queue->maximum_pending_messages = maximum_pending_messages; 4e354: 2542 0044 movel %d2,%a2@(68) the_message_queue->number_of_pending_messages = 0; 4e358: 42aa 0048 clrl %a2@(72) the_message_queue->maximum_message_size = maximum_message_size; 4e35c: 2541 004c movel %d1,%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; 4e360: 42aa 0060 clrl %a2@(96) the_message_queue->notify_argument = the_argument; 4e364: 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)) { 4e368: 4a80 tstl %d0 4e36a: 6604 bnes 4e370 <_CORE_message_queue_Initialize+0x34> 4e36c: 2001 movel %d1,%d0 4e36e: 600c bras 4e37c <_CORE_message_queue_Initialize+0x40> allocated_message_size += sizeof(uint32_t); 4e370: 2001 movel %d1,%d0 4e372: 5880 addql #4,%d0 allocated_message_size &= ~(sizeof(uint32_t) - 1); 4e374: 76fc moveq #-4,%d3 4e376: c083 andl %d3,%d0 } if (allocated_message_size < maximum_message_size) 4e378: b280 cmpl %d0,%d1 4e37a: 626e bhis 4e3ea <_CORE_message_queue_Initialize+0xae><== NEVER TAKEN /* * Calculate how much total memory is required for message buffering and * check for overflow on the multiplication. */ message_buffering_required = (size_t) maximum_pending_messages * (allocated_message_size + sizeof(CORE_message_queue_Buffer_control)); 4e37c: 2600 movel %d0,%d3 4e37e: 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 * 4e384: 2203 movel %d3,%d1 4e386: 4c02 1800 mulsl %d2,%d1 (allocated_message_size + sizeof(CORE_message_queue_Buffer_control)); if (message_buffering_required < allocated_message_size) 4e38a: b081 cmpl %d1,%d0 4e38c: 625c bhis 4e3ea <_CORE_message_queue_Initialize+0xae><== NEVER TAKEN return false; /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) 4e38e: 2f01 movel %d1,%sp@- 4e390: 4eb9 0005 0d68 jsr 50d68 <_Workspace_Allocate> _Workspace_Allocate( message_buffering_required ); if (the_message_queue->message_buffers == 0) 4e396: 588f addql #4,%sp return false; /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) 4e398: 2540 005c movel %d0,%a2@(92) _Workspace_Allocate( message_buffering_required ); if (the_message_queue->message_buffers == 0) 4e39c: 674c beqs 4e3ea <_CORE_message_queue_Initialize+0xae> /* * Initialize the pool of inactive messages, pending messages, * and set of waiting threads. */ _Chain_Initialize ( 4e39e: 2f03 movel %d3,%sp@- 4e3a0: 2f02 movel %d2,%sp@- 4e3a2: 2f00 movel %d0,%sp@- 4e3a4: 486a 0068 pea %a2@(104) 4e3a8: 4eb9 0005 3aa4 jsr 53aa4 <_Chain_Initialize> allocated_message_size + sizeof( CORE_message_queue_Buffer_control ) ); _Chain_Initialize_empty( &the_message_queue->Pending_messages ); _Thread_queue_Initialize( 4e3ae: 4878 0006 pea 6 4e3b2: 7001 moveq #1,%d0 4e3b4: 206e 000c moveal %fp@(12),%a0 4e3b8: b090 cmpl %a0@,%d0 4e3ba: 57c0 seq %d0 4e3bc: 4878 0080 pea 80 4e3c0: 49c0 extbl %d0 4e3c2: 4480 negl %d0 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 4e3c4: 41ea 0054 lea %a2@(84),%a0 4e3c8: 2f00 movel %d0,%sp@- 4e3ca: 2548 0050 movel %a0,%a2@(80) the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 4e3ce: 41ea 0050 lea %a2@(80),%a0 4e3d2: 2548 0058 movel %a0,%a2@(88) 4e3d6: 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; 4e3d8: 42aa 0054 clrl %a2@(84) 4e3dc: 4eb9 0005 027c jsr 5027c <_Thread_queue_Initialize> THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; 4e3e2: 4fef 0020 lea %sp@(32),%sp allocated_message_size + sizeof( CORE_message_queue_Buffer_control ) ); _Chain_Initialize_empty( &the_message_queue->Pending_messages ); _Thread_queue_Initialize( 4e3e6: 7001 moveq #1,%d0 THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; 4e3e8: 6002 bras 4e3ec <_CORE_message_queue_Initialize+0xb0> 4e3ea: 4200 clrb %d0 } 4e3ec: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 4e3f2: 4e5e unlk %fp ... =============================================================================== 0004e3f8 <_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 ); 4e3f8: 223c 0000 0700 movel #1792,%d1 void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 4e3fe: 4e56 ffe0 linkw %fp,#-32 ISR_Level level; CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; 4e402: 2079 0006 7dfe moveal 67dfe <_Thread_Executing>,%a0 void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 4e408: 48d7 3c3c moveml %d2-%d5/%a2-%a5,%sp@ 4e40c: 282e 000c movel %fp@(12),%d4 4e410: 242e 001c movel %fp@(28),%d2 4e414: 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; 4e418: 42a8 0034 clrl %a0@(52) void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 4e41c: 262e 0010 movel %fp@(16),%d3 4e420: 226e 0014 moveal %fp@(20),%a1 4e424: 1a2e 001b moveb %fp@(27),%d5 CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; _ISR_Disable( level ); 4e428: 40c0 movew %sr,%d0 4e42a: 8280 orl %d0,%d1 4e42c: 46c1 movew %d1,%sr */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4e42e: 220a movel %a2,%d1 4e430: 0681 0000 0054 addil #84,%d1 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 4e436: 266a 0050 moveal %a2@(80),%a3 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4e43a: b28b cmpl %a3,%d1 4e43c: 6700 00a6 beqw 4e4e4 <_CORE_message_queue_Seize+0xec> { Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; 4e440: 2853 moveal %a3@,%a4 the_chain->first = new_first; new_first->previous = _Chain_Head(the_chain); 4e442: 4bea 0050 lea %a2@(80),%a5 Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; the_chain->first = new_first; 4e446: 254c 0050 movel %a4,%a2@(80) new_first->previous = _Chain_Head(the_chain); 4e44a: 294d 0004 movel %a5,%a4@(4) the_message = _CORE_message_queue_Get_pending_message( the_message_queue ); if ( the_message != NULL ) { 4e44e: 4a8b tstl %a3 4e450: 6700 0092 beqw 4e4e4 <_CORE_message_queue_Seize+0xec> the_message_queue->number_of_pending_messages -= 1; 4e454: 53aa 0048 subql #1,%a2@(72) _ISR_Enable( level ); 4e458: 46c0 movew %d0,%sr *size_p = the_message->Contents.size; _Thread_Executing->Wait.count = 4e45a: 2079 0006 7dfe moveal 67dfe <_Thread_Executing>,%a0 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; 4e460: 22ab 000c movel %a3@(12),%a1@ _Thread_Executing->Wait.count = _CORE_message_queue_Get_message_priority( the_message ); _CORE_message_queue_Copy_buffer( the_message->Contents.buffer, 4e464: 240b movel %a3,%d2 4e466: 0682 0000 0010 addil #16,%d2 if ( the_message != NULL ) { the_message_queue->number_of_pending_messages -= 1; _ISR_Enable( level ); *size_p = the_message->Contents.size; _Thread_Executing->Wait.count = 4e46c: 216b 0008 0024 movel %a3@(8),%a0@(36) const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 4e472: 49f9 0005 6d90 lea 56d90 ,%a4 4e478: 2f11 movel %a1@,%sp@- 4e47a: 2f02 movel %d2,%sp@- 4e47c: 2f03 movel %d3,%sp@- 4e47e: 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 ); 4e480: 2f0a movel %a2,%sp@- 4e482: 4eb9 0004 ff0c jsr 4ff0c <_Thread_queue_Dequeue> if ( !the_thread ) { 4e488: 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 ); 4e48c: 2040 moveal %d0,%a0 if ( !the_thread ) { 4e48e: 4a80 tstl %d0 4e490: 661a bnes 4e4ac <_CORE_message_queue_Seize+0xb4> 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 ); 4e492: 45ea 0068 lea %a2@(104),%a2 4e496: 2d4b 000c movel %a3,%fp@(12) 4e49a: 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 ); } 4e49e: 4cee 3c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a5 4e4a4: 4e5e unlk %fp 4e4a6: 4ef9 0004 e278 jmp 4e278 <_Chain_Append> */ _CORE_message_queue_Set_message_priority( the_message, the_thread->Wait.count ); the_message->Contents.size = (size_t) the_thread->Wait.option; 4e4ac: 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; 4e4b0: 2768 0024 0008 movel %a0@(36),%a3@(8) 4e4b6: 2740 000c movel %d0,%a3@(12) const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 4e4ba: 2f00 movel %d0,%sp@- 4e4bc: 2f28 002c movel %a0@(44),%sp@- 4e4c0: 2f02 movel %d2,%sp@- 4e4c2: 4e94 jsr %a4@ the_thread->Wait.return_argument_second.immutable_object, the_message->Contents.buffer, the_message->Contents.size ); _CORE_message_queue_Insert_message( 4e4c4: 2d6b 0008 0010 movel %a3@(8),%fp@(16) 4e4ca: 4fef 000c lea %sp@(12),%sp 4e4ce: 2d4b 000c movel %a3,%fp@(12) 4e4d2: 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 ); } 4e4d6: 4cee 3c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a5 4e4dc: 4e5e unlk %fp the_thread->Wait.return_argument_second.immutable_object, the_message->Contents.buffer, the_message->Contents.size ); _CORE_message_queue_Insert_message( 4e4de: 4ef9 0005 3be8 jmp 53be8 <_CORE_message_queue_Insert_message> return; } #endif } if ( !wait ) { 4e4e4: 4a05 tstb %d5 4e4e6: 6612 bnes 4e4fa <_CORE_message_queue_Seize+0x102> _ISR_Enable( level ); 4e4e8: 46c0 movew %d0,%sr executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT; 4e4ea: 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 ); } 4e4ec: 4cee 3c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a5 #endif } if ( !wait ) { _ISR_Enable( level ); executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT; 4e4f2: 2140 0034 movel %d0,%a0@(52) executing->Wait.return_argument = size_p; /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); } 4e4f6: 4e5e unlk %fp 4e4f8: 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; 4e4fa: 7201 moveq #1,%d1 4e4fc: 2541 0030 movel %d1,%a2@(48) _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue ); executing->Wait.queue = &the_message_queue->Wait_queue; executing->Wait.id = id; executing->Wait.return_argument_second.mutable_object = buffer; executing->Wait.return_argument = size_p; 4e500: 2149 0028 movel %a1,%a0@(40) } _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue ); executing->Wait.queue = &the_message_queue->Wait_queue; executing->Wait.id = id; executing->Wait.return_argument_second.mutable_object = buffer; 4e504: 2143 002c movel %d3,%a0@(44) return; } _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue ); executing->Wait.queue = &the_message_queue->Wait_queue; executing->Wait.id = id; 4e508: 2144 0020 movel %d4,%a0@(32) executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT; return; } _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue ); executing->Wait.queue = &the_message_queue->Wait_queue; 4e50c: 214a 0044 movel %a2,%a0@(68) executing->Wait.id = id; executing->Wait.return_argument_second.mutable_object = buffer; executing->Wait.return_argument = size_p; /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); 4e510: 46c0 movew %d0,%sr _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); 4e512: 4bf9 0005 0338 lea 50338 <_Thread_queue_Timeout>,%a5 4e518: 2d42 000c movel %d2,%fp@(12) 4e51c: 2d4d 0010 movel %a5,%fp@(16) 4e520: 2d4a 0008 movel %a2,%fp@(8) } 4e524: 4cee 3c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a5 4e52a: 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 ); 4e52c: 4ef9 0005 004c jmp 5004c <_Thread_queue_Enqueue_with_handler> ... =============================================================================== 0004630c <_CORE_mutex_Seize>: Objects_Id _id, bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { 4630c: 4e56 0000 linkw %fp,#0 46310: 202e 0010 movel %fp@(16),%d0 46314: 2f0a movel %a2,%sp@- 46316: 246e 0008 moveal %fp@(8),%a2 4631a: 2f02 movel %d2,%sp@- _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); 4631c: 2239 0005 ef3c movel 5ef3c <_Thread_Dispatch_disable_level>,%d1 Objects_Id _id, bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { 46322: 1400 moveb %d0,%d2 _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); 46324: 4a81 tstl %d1 46326: 671c beqs 46344 <_CORE_mutex_Seize+0x38> 46328: 4a00 tstb %d0 4632a: 6718 beqs 46344 <_CORE_mutex_Seize+0x38> <== NEVER TAKEN 4632c: 7001 moveq #1,%d0 4632e: b0b9 0005 f0c4 cmpl 5f0c4 <_System_state_Current>,%d0 46334: 640e bccs 46344 <_CORE_mutex_Seize+0x38> 46336: 4878 0013 pea 13 4633a: 42a7 clrl %sp@- 4633c: 42a7 clrl %sp@- 4633e: 4eb9 0004 6930 jsr 46930 <_Internal_error_Occurred> 46344: 486e 0018 pea %fp@(24) 46348: 2f0a movel %a2,%sp@- 4634a: 4eb9 0004 b6d4 jsr 4b6d4 <_CORE_mutex_Seize_interrupt_trylock> 46350: 508f addql #8,%sp 46352: 4a80 tstl %d0 46354: 6750 beqs 463a6 <_CORE_mutex_Seize+0x9a> 46356: 4a02 tstb %d2 46358: 6614 bnes 4636e <_CORE_mutex_Seize+0x62> 4635a: 202e 0018 movel %fp@(24),%d0 4635e: 46c0 movew %d0,%sr 46360: 2079 0005 eff6 moveal 5eff6 <_Thread_Executing>,%a0 46366: 7001 moveq #1,%d0 46368: 2140 0034 movel %d0,%a0@(52) 4636c: 6038 bras 463a6 <_CORE_mutex_Seize+0x9a> 4636e: 2039 0005 ef3c movel 5ef3c <_Thread_Dispatch_disable_level>,%d0 46374: 5280 addql #1,%d0 46376: 2079 0005 eff6 moveal 5eff6 <_Thread_Executing>,%a0 4637c: 216e 000c 0020 movel %fp@(12),%a0@(32) 46382: 23c0 0005 ef3c movel %d0,5ef3c <_Thread_Dispatch_disable_level> RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section ( Thread_queue_Control *the_thread_queue ) { the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 46388: 7001 moveq #1,%d0 4638a: 214a 0044 movel %a2,%a0@(68) 4638e: 2540 0030 movel %d0,%a2@(48) 46392: 202e 0018 movel %fp@(24),%d0 46396: 46c0 movew %d0,%sr 46398: 2f2e 0014 movel %fp@(20),%sp@- 4639c: 2f0a movel %a2,%sp@- 4639e: 4eb9 0004 62a8 jsr 462a8 <_CORE_mutex_Seize_interrupt_blocking> 463a4: 508f addql #8,%sp } 463a6: 242e fff8 movel %fp@(-8),%d2 463aa: 246e fffc moveal %fp@(-4),%a2 463ae: 4e5e unlk %fp ... =============================================================================== 00046500 <_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 ) { 46500: 4e56 0000 linkw %fp,#0 46504: 2f0a movel %a2,%sp@- 46506: 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)) ) { 4650a: 2f0a movel %a2,%sp@- 4650c: 4eb9 0004 7a0c jsr 47a0c <_Thread_queue_Dequeue> 46512: 588f addql #4,%sp 46514: 4a80 tstl %d0 46516: 6704 beqs 4651c <_CORE_semaphore_Surrender+0x1c> 46518: 4280 clrl %d0 4651a: 6024 bras 46540 <_CORE_semaphore_Surrender+0x40> if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_semaphore_mp_support) ( the_thread, id ); #endif } else { _ISR_Disable( level ); 4651c: 203c 0000 0700 movel #1792,%d0 46522: 40c1 movew %sr,%d1 46524: 8081 orl %d1,%d0 46526: 46c0 movew %d0,%sr if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 46528: 202a 0048 movel %a2@(72),%d0 4652c: b0aa 0040 cmpl %a2@(64),%d0 46530: 6504 bcss 46536 <_CORE_semaphore_Surrender+0x36> <== ALWAYS TAKEN 46532: 7004 moveq #4,%d0 <== NOT EXECUTED 46534: 6008 bras 4653e <_CORE_semaphore_Surrender+0x3e> <== NOT EXECUTED the_semaphore->count += 1; 46536: 5280 addql #1,%d0 46538: 2540 0048 movel %d0,%a2@(72) 4653c: 4280 clrl %d0 else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); 4653e: 46c1 movew %d1,%sr } return status; } 46540: 246e fffc moveal %fp@(-4),%a2 46544: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00045268 <_Event_Seize>: executing = _Thread_Executing; executing->Wait.return_code = RTEMS_SUCCESSFUL; api = executing->API_Extensions[ THREAD_API_RTEMS ]; _ISR_Disable( level ); 45268: 203c 0000 0700 movel #1792,%d0 rtems_event_set event_in, rtems_option option_set, rtems_interval ticks, rtems_event_set *event_out ) { 4526e: 4e56 ffec linkw %fp,#-20 45272: 226e 0010 moveal %fp@(16),%a1 45276: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ rtems_event_set pending_events; ISR_Level level; RTEMS_API_Control *api; Thread_blocking_operation_States sync_state; executing = _Thread_Executing; 4527a: 2479 0005 eff6 moveal 5eff6 <_Thread_Executing>,%a2 rtems_event_set event_in, rtems_option option_set, rtems_interval ticks, rtems_event_set *event_out ) { 45280: 242e 0008 movel %fp@(8),%d2 45284: 262e 000c movel %fp@(12),%d3 ISR_Level level; RTEMS_API_Control *api; Thread_blocking_operation_States sync_state; executing = _Thread_Executing; executing->Wait.return_code = RTEMS_SUCCESSFUL; 45288: 42aa 0034 clrl %a2@(52) rtems_event_set event_in, rtems_option option_set, rtems_interval ticks, rtems_event_set *event_out ) { 4528c: 206e 0014 moveal %fp@(20),%a0 Thread_blocking_operation_States sync_state; executing = _Thread_Executing; executing->Wait.return_code = RTEMS_SUCCESSFUL; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 45290: 266a 010a moveal %a2@(266),%a3 _ISR_Disable( level ); 45294: 40c1 movew %sr,%d1 45296: 8081 orl %d1,%d0 45298: 46c0 movew %d0,%sr pending_events = api->pending_events; 4529a: 2813 movel %a3@,%d4 RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Get( rtems_event_set the_event_set, rtems_event_set the_event_condition ) { return ( the_event_set & the_event_condition ); 4529c: 2002 movel %d2,%d0 4529e: c084 andl %d4,%d0 seized_events = _Event_sets_Get( pending_events, event_in ); if ( !_Event_sets_Is_empty( seized_events ) && 452a0: 6716 beqs 452b8 <_Event_Seize+0x50> 452a2: b480 cmpl %d0,%d2 452a4: 6706 beqs 452ac <_Event_Seize+0x44> 452a6: 0803 0001 btst #1,%d3 452aa: 670c beqs 452b8 <_Event_Seize+0x50> <== NEVER TAKEN (seized_events == event_in || _Options_Is_any( option_set )) ) { api->pending_events = 452ac: 2400 movel %d0,%d2 452ae: 4682 notl %d2 452b0: c484 andl %d4,%d2 452b2: 2682 movel %d2,%a3@ _Event_sets_Clear( pending_events, seized_events ); _ISR_Enable( level ); 452b4: 46c1 movew %d1,%sr 452b6: 600e bras 452c6 <_Event_Seize+0x5e> *event_out = seized_events; return; } if ( _Options_Is_no_wait( option_set ) ) { 452b8: 0803 0000 btst #0,%d3 452bc: 670e beqs 452cc <_Event_Seize+0x64> _ISR_Enable( level ); 452be: 46c1 movew %d1,%sr executing->Wait.return_code = RTEMS_UNSATISFIED; 452c0: 720d moveq #13,%d1 452c2: 2541 0034 movel %d1,%a2@(52) *event_out = seized_events; 452c6: 2080 movel %d0,%a0@ return; 452c8: 6000 0096 braw 45360 <_Event_Seize+0xf8> * * NOTE: Since interrupts are disabled, this isn't that much of an * issue but better safe than sorry. */ executing->Wait.option = (uint32_t) option_set; executing->Wait.count = (uint32_t) event_in; 452cc: 2542 0024 movel %d2,%a2@(36) executing->Wait.return_argument = event_out; _Event_Sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 452d0: 7401 moveq #1,%d2 * set properly when we are marked as in the event critical section. * * NOTE: Since interrupts are disabled, this isn't that much of an * issue but better safe than sorry. */ executing->Wait.option = (uint32_t) option_set; 452d2: 2543 0030 movel %d3,%a2@(48) executing->Wait.count = (uint32_t) event_in; executing->Wait.return_argument = event_out; 452d6: 2548 0028 movel %a0,%a2@(40) _Event_Sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 452da: 23c2 0005 f7b8 movel %d2,5f7b8 <_Event_Sync_state> _ISR_Enable( level ); 452e0: 46c1 movew %d1,%sr if ( ticks ) { 452e2: 4a89 tstl %a1 452e4: 6730 beqs 45316 <_Event_Seize+0xae> _Watchdog_Initialize( 452e6: 202a 0008 movel %a2@(8),%d0 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 452ea: 223c 0004 54c8 movel #283848,%d1 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 452f0: 2549 0054 movel %a1,%a2@(84) Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 452f4: 2541 0064 movel %d1,%a2@(100) the_watchdog->id = id; 452f8: 2540 0068 movel %d0,%a2@(104) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 452fc: 42aa 0050 clrl %a2@(80) the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 45300: 42aa 006c clrl %a2@(108) ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 45304: 486a 0048 pea %a2@(72) 45308: 4879 0005 f014 pea 5f014 <_Watchdog_Ticks_chain> 4530e: 4eb9 0004 8620 jsr 48620 <_Watchdog_Insert> 45314: 508f addql #8,%sp NULL ); _Watchdog_Insert_ticks( &executing->Timer, ticks ); } _Thread_Set_state( executing, STATES_WAITING_FOR_EVENT ); 45316: 4878 0100 pea 100 4531a: 2f0a movel %a2,%sp@- 4531c: 4eb9 0004 7ee0 jsr 47ee0 <_Thread_Set_state> _ISR_Disable( level ); 45322: 203c 0000 0700 movel #1792,%d0 45328: 40c1 movew %sr,%d1 4532a: 8081 orl %d1,%d0 4532c: 46c0 movew %d0,%sr sync_state = _Event_Sync_state; _Event_Sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) { 4532e: 7401 moveq #1,%d2 45330: 508f addql #8,%sp _Thread_Set_state( executing, STATES_WAITING_FOR_EVENT ); _ISR_Disable( level ); sync_state = _Event_Sync_state; 45332: 2039 0005 f7b8 movel 5f7b8 <_Event_Sync_state>,%d0 _Event_Sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 45338: 42b9 0005 f7b8 clrl 5f7b8 <_Event_Sync_state> if ( sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) { 4533e: b480 cmpl %d0,%d2 45340: 6604 bnes 45346 <_Event_Seize+0xde> _ISR_Enable( level ); 45342: 46c1 movew %d1,%sr 45344: 601a bras 45360 <_Event_Seize+0xf8> * An interrupt completed the thread's blocking request. * The blocking thread was satisfied by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ _Thread_blocking_operation_Cancel( sync_state, executing, level ); 45346: 2d4a 000c movel %a2,%fp@(12) 4534a: 2d41 0010 movel %d1,%fp@(16) } 4534e: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 * An interrupt completed the thread's blocking request. * The blocking thread was satisfied by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ _Thread_blocking_operation_Cancel( sync_state, executing, level ); 45354: 2d40 0008 movel %d0,%fp@(8) } 45358: 4e5e unlk %fp * An interrupt completed the thread's blocking request. * The blocking thread was satisfied by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ _Thread_blocking_operation_Cancel( sync_state, executing, level ); 4535a: 4ef9 0004 7168 jmp 47168 <_Thread_blocking_operation_Cancel> } 45360: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 45366: 4e5e unlk %fp ... =============================================================================== 000453c0 <_Event_Surrender>: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; option_set = (rtems_option) the_thread->Wait.option; _ISR_Disable( level ); 453c0: 203c 0000 0700 movel #1792,%d0 */ void _Event_Surrender( Thread_Control *the_thread ) { 453c6: 4e56 ffe8 linkw %fp,#-24 453ca: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@ 453ce: 246e 0008 moveal %fp@(8),%a2 rtems_event_set event_condition; rtems_event_set seized_events; rtems_option option_set; RTEMS_API_Control *api; api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; 453d2: 206a 010a moveal %a2@(266),%a0 option_set = (rtems_option) the_thread->Wait.option; 453d6: 282a 0030 movel %a2@(48),%d4 _ISR_Disable( level ); 453da: 40c1 movew %sr,%d1 453dc: 8081 orl %d1,%d0 453de: 46c0 movew %d0,%sr pending_events = api->pending_events; event_condition = (rtems_event_set) the_thread->Wait.count; 453e0: 262a 0024 movel %a2@(36),%d3 RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Get( rtems_event_set the_event_set, rtems_event_set the_event_condition ) { return ( the_event_set & the_event_condition ); 453e4: 2003 movel %d3,%d0 api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; option_set = (rtems_option) the_thread->Wait.option; _ISR_Disable( level ); pending_events = api->pending_events; 453e6: 2410 movel %a0@,%d2 453e8: c082 andl %d2,%d0 seized_events = _Event_sets_Get( pending_events, event_condition ); /* * No events were seized in this operation */ if ( _Event_sets_Is_empty( seized_events ) ) { 453ea: 6606 bnes 453f2 <_Event_Surrender+0x32> _ISR_Enable( level ); 453ec: 46c1 movew %d1,%sr return; 453ee: 6000 00cc braw 454bc <_Event_Surrender+0xfc> /* * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && 453f2: 2279 0005 efd6 moveal 5efd6 <_ISR_Nest_level>,%a1 453f8: 4a89 tstl %a1 453fa: 674a beqs 45446 <_Event_Surrender+0x86> 453fc: b5f9 0005 eff6 cmpal 5eff6 <_Thread_Executing>,%a2 45402: 6642 bnes 45446 <_Event_Surrender+0x86> _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 45404: 2279 0005 f7b8 moveal 5f7b8 <_Event_Sync_state>,%a1 /* * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && 4540a: 7a02 moveq #2,%d5 4540c: ba89 cmpl %a1,%d5 4540e: 670e beqs 4541e <_Event_Surrender+0x5e> <== NEVER TAKEN _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { 45410: 2279 0005 f7b8 moveal 5f7b8 <_Event_Sync_state>,%a1 /* * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && 45416: 1a3c 0001 moveb #1,%d5 4541a: ba89 cmpl %a1,%d5 4541c: 6628 bnes 45446 <_Event_Surrender+0x86> _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { 4541e: b680 cmpl %d0,%d3 45420: 6706 beqs 45428 <_Event_Surrender+0x68> 45422: 0804 0001 btst #1,%d4 45426: 671a beqs 45442 <_Event_Surrender+0x82> <== NEVER TAKEN api->pending_events = _Event_sets_Clear( pending_events,seized_events ); 45428: 2600 movel %d0,%d3 4542a: 4683 notl %d3 4542c: c682 andl %d2,%d3 4542e: 2083 movel %d3,%a0@ the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 45430: 206a 0028 moveal %a2@(40),%a0 _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { api->pending_events = _Event_sets_Clear( pending_events,seized_events ); the_thread->Wait.count = 0; 45434: 42aa 0024 clrl %a2@(36) *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 45438: 2080 movel %d0,%a0@ _Event_Sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 4543a: 7003 moveq #3,%d0 4543c: 23c0 0005 f7b8 movel %d0,5f7b8 <_Event_Sync_state> } _ISR_Enable( level ); 45442: 46c1 movew %d1,%sr return; 45444: 6076 bras 454bc <_Event_Surrender+0xfc> } /* * Otherwise, this is a normal send to another thread */ if ( _States_Is_waiting_for_event( the_thread->current_state ) ) { 45446: 2a2a 0010 movel %a2@(16),%d5 4544a: 0285 0000 0100 andil #256,%d5 45450: 6768 beqs 454ba <_Event_Surrender+0xfa> if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { 45452: b680 cmpl %d0,%d3 45454: 6706 beqs 4545c <_Event_Surrender+0x9c> 45456: 0804 0001 btst #1,%d4 4545a: 675e beqs 454ba <_Event_Surrender+0xfa> <== NEVER TAKEN api->pending_events = _Event_sets_Clear( pending_events, seized_events ); 4545c: 2600 movel %d0,%d3 4545e: 4683 notl %d3 45460: c682 andl %d2,%d3 45462: 2083 movel %d3,%a0@ the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 45464: 206a 0028 moveal %a2@(40),%a0 * Otherwise, this is a normal send to another thread */ if ( _States_Is_waiting_for_event( the_thread->current_state ) ) { if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { api->pending_events = _Event_sets_Clear( pending_events, seized_events ); the_thread->Wait.count = 0; 45468: 42aa 0024 clrl %a2@(36) *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 4546c: 2080 movel %d0,%a0@ _ISR_Flash( level ); 4546e: 203c 0000 0700 movel #1792,%d0 45474: 46c1 movew %d1,%sr 45476: 8081 orl %d1,%d0 45478: 46c0 movew %d0,%sr 4547a: 47f9 0004 72f8 lea 472f8 <_Thread_Clear_state>,%a3 if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 45480: 7a02 moveq #2,%d5 45482: baaa 0050 cmpl %a2@(80),%d5 45486: 6710 beqs 45498 <_Event_Surrender+0xd8> _ISR_Enable( level ); 45488: 46c1 movew %d1,%sr RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 4548a: 2f3c 1003 fff8 movel #268697592,%sp@- 45490: 2f0a movel %a2,%sp@- 45492: 4e93 jsr %a3@ 45494: 508f addql #8,%sp 45496: 6024 bras 454bc <_Event_Surrender+0xfc> RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 45498: 7003 moveq #3,%d0 4549a: 2540 0050 movel %d0,%a2@(80) _Thread_Unblock( the_thread ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 4549e: 46c1 movew %d1,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 454a0: 486a 0048 pea %a2@(72) 454a4: 4eb9 0004 873c jsr 4873c <_Watchdog_Remove> 454aa: 2f3c 1003 fff8 movel #268697592,%sp@- 454b0: 2f0a movel %a2,%sp@- 454b2: 4e93 jsr %a3@ 454b4: 4fef 000c lea %sp@(12),%sp 454b8: 6002 bras 454bc <_Event_Surrender+0xfc> _Thread_Unblock( the_thread ); } return; } } _ISR_Enable( level ); 454ba: 46c1 movew %d1,%sr } 454bc: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 454c2: 4e5e unlk %fp ... =============================================================================== 000454c8 <_Event_Timeout>: void _Event_Timeout( Objects_Id id, void *ignored ) { 454c8: 4e56 fffc linkw %fp,#-4 454cc: 2f03 movel %d3,%sp@- 454ce: 2f02 movel %d2,%sp@- Thread_Control *the_thread; Objects_Locations location; ISR_Level level; the_thread = _Thread_Get( id, &location ); 454d0: 486e fffc pea %fp@(-4) 454d4: 2f2e 0008 movel %fp@(8),%sp@- 454d8: 4eb9 0004 76d8 jsr 476d8 <_Thread_Get> switch ( location ) { 454de: 508f addql #8,%sp 454e0: 4aae fffc tstl %fp@(-4) 454e4: 6656 bnes 4553c <_Event_Timeout+0x74> <== NEVER TAKEN * * If it is not satisfied, then it is "nothing happened" and * this is the "timeout" transition. After a request is satisfied, * a timeout is not allowed to occur. */ _ISR_Disable( level ); 454e6: 223c 0000 0700 movel #1792,%d1 454ec: 40c2 movew %sr,%d2 454ee: 8282 orl %d2,%d1 454f0: 46c1 movew %d1,%sr _ISR_Enable( level ); return; } #endif the_thread->Wait.count = 0; 454f2: 2040 moveal %d0,%a0 454f4: 42a8 0024 clrl %a0@(36) if ( _Thread_Is_executing( the_thread ) ) { 454f8: b0b9 0005 eff6 cmpl 5eff6 <_Thread_Executing>,%d0 454fe: 6614 bnes 45514 <_Event_Timeout+0x4c> if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 45500: 2239 0005 f7b8 movel 5f7b8 <_Event_Sync_state>,%d1 45506: 7601 moveq #1,%d3 45508: b681 cmpl %d1,%d3 4550a: 6608 bnes 45514 <_Event_Timeout+0x4c> _Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 4550c: 7202 moveq #2,%d1 4550e: 23c1 0005 f7b8 movel %d1,5f7b8 <_Event_Sync_state> } the_thread->Wait.return_code = RTEMS_TIMEOUT; 45514: 7606 moveq #6,%d3 45516: 2040 moveal %d0,%a0 45518: 2143 0034 movel %d3,%a0@(52) _ISR_Enable( level ); 4551c: 46c2 movew %d2,%sr 4551e: 2f3c 1003 fff8 movel #268697592,%sp@- 45524: 2f00 movel %d0,%sp@- 45526: 4eb9 0004 72f8 jsr 472f8 <_Thread_Clear_state> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 4552c: 508f addql #8,%sp 4552e: 2039 0005 ef3c movel 5ef3c <_Thread_Dispatch_disable_level>,%d0 45534: 5380 subql #1,%d0 45536: 23c0 0005 ef3c movel %d0,5ef3c <_Thread_Dispatch_disable_level> case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 4553c: 242e fff4 movel %fp@(-12),%d2 45540: 262e fff8 movel %fp@(-8),%d3 45544: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004b834 <_Heap_Allocate_aligned_with_boundary>: Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 4b834: 4e56 ffc8 linkw %fp,#-56 4b838: 202e 000c movel %fp@(12),%d0 4b83c: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 4b840: 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; 4b844: 2840 moveal %d0,%a4 4b846: 588c addql #4,%a4 Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 4b848: 222e 0010 movel %fp@(16),%d1 4b84c: 2a2e 0014 movel %fp@(20),%d5 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 4b850: 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; 4b854: 2e2a 0010 movel %a2@(16),%d7 uintptr_t alloc_begin = 0; uint32_t search_count = 0; if ( block_size_floor < alloc_size ) { 4b858: b08c cmpl %a4,%d0 4b85a: 6200 0120 bhiw 4b97c <_Heap_Allocate_aligned_with_boundary+0x148> /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { 4b85e: 4a85 tstl %d5 4b860: 670c beqs 4b86e <_Heap_Allocate_aligned_with_boundary+0x3a> if ( boundary < alloc_size ) { 4b862: b085 cmpl %d5,%d0 4b864: 6200 0116 bhiw 4b97c <_Heap_Allocate_aligned_with_boundary+0x148> return NULL; } if ( alignment == 0 ) { 4b868: 4a81 tstl %d1 4b86a: 6602 bnes 4b86e <_Heap_Allocate_aligned_with_boundary+0x3a> 4b86c: 2207 movel %d7,%d1 uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; 4b86e: 2407 movel %d7,%d2 4b870: 5e82 addql #7,%d2 if ( boundary != 0 ) { if ( boundary < alloc_size ) { return NULL; } if ( alignment == 0 ) { 4b872: 4283 clrl %d3 4b874: 2a43 moveal %d3,%a5 uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; 4b876: 2d42 fff8 movel %d2,%fp@(-8) uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; 4b87a: 7404 moveq #4,%d2 4b87c: 9480 subl %d0,%d2 4b87e: 2d42 fff4 movel %d2,%fp@(-12) 4b882: 6000 00c6 braw 4b94a <_Heap_Allocate_aligned_with_boundary+0x116> /* * The HEAP_PREV_BLOCK_USED flag is always set in the block size_and_flag * field. Thus the value is about one unit larger than the real block * size. The greater than operator takes this into account. */ if ( block->size_and_flag > block_size_floor ) { 4b886: 2628 0004 movel %a0@(4),%d3 while ( block != free_list_tail ) { _HAssert( _Heap_Is_prev_used( block ) ); /* Statistics */ ++search_count; 4b88a: 528d addql #1,%a5 /* * The HEAP_PREV_BLOCK_USED flag is always set in the block size_and_flag * field. Thus the value is about one unit larger than the real block * size. The greater than operator takes this into account. */ if ( block->size_and_flag > block_size_floor ) { 4b88c: b9c3 cmpal %d3,%a4 4b88e: 6400 00b6 bccw 4b946 <_Heap_Allocate_aligned_with_boundary+0x112> 4b892: 43e8 0008 lea %a0@(8),%a1 if ( alignment == 0 ) { 4b896: 4a81 tstl %d1 4b898: 6606 bnes 4b8a0 <_Heap_Allocate_aligned_with_boundary+0x6c> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 4b89a: 2409 movel %a1,%d2 4b89c: 6000 00a4 braw 4b942 <_Heap_Allocate_aligned_with_boundary+0x10e> uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; 4b8a0: 74fe moveq #-2,%d2 4b8a2: c682 andl %d2,%d3 uintptr_t alignment, uintptr_t boundary ) { uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; 4b8a4: 266a 0014 moveal %a2@(20),%a3 uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; 4b8a8: d688 addl %a0,%d3 uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; 4b8aa: 282e fff8 movel %fp@(-8),%d4 4b8ae: 988b subl %a3,%d4 uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; 4b8b0: 242e fff4 movel %fp@(-12),%d2 4b8b4: d483 addl %d3,%d2 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4b8b6: 2c02 movel %d2,%d6 uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; 4b8b8: d684 addl %d4,%d3 4b8ba: 4c41 6004 remul %d1,%d4,%d6 uintptr_t alignment, uintptr_t boundary ) { uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; 4b8be: 2d4b fff0 movel %a3,%fp@(-16) 4b8c2: 9484 subl %d4,%d2 uintptr_t alloc_begin = alloc_end - alloc_size; alloc_begin = _Heap_Align_down( alloc_begin, alignment ); /* Ensure that the we have a valid new block at the end */ if ( alloc_begin > alloc_begin_ceiling ) { 4b8c4: b682 cmpl %d2,%d3 4b8c6: 640a bccs 4b8d2 <_Heap_Allocate_aligned_with_boundary+0x9e> 4b8c8: 2803 movel %d3,%d4 4b8ca: 4c41 4002 remul %d1,%d2,%d4 4b8ce: 9682 subl %d2,%d3 4b8d0: 2403 movel %d3,%d2 } alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { 4b8d2: 4a85 tstl %d5 4b8d4: 674e beqs 4b924 <_Heap_Allocate_aligned_with_boundary+0xf0> /* Ensure that the we have a valid new block at the end */ if ( alloc_begin > alloc_begin_ceiling ) { alloc_begin = _Heap_Align_down( alloc_begin_ceiling, alignment ); } alloc_end = alloc_begin + alloc_size; 4b8d6: 2802 movel %d2,%d4 4b8d8: d880 addl %d0,%d4 4b8da: 2604 movel %d4,%d3 /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; 4b8dc: 47f1 0800 lea %a1@(00000000,%d0:l),%a3 4b8e0: 4c45 3006 remul %d5,%d6,%d3 4b8e4: 2d4b fffc movel %a3,%fp@(-4) 4b8e8: 2604 movel %d4,%d3 4b8ea: 9686 subl %d6,%d3 4b8ec: 2c03 movel %d3,%d6 4b8ee: 266e fff0 moveal %fp@(-16),%a3 4b8f2: 6020 bras 4b914 <_Heap_Allocate_aligned_with_boundary+0xe0> uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { if ( boundary_line < boundary_floor ) { 4b8f4: bcae fffc cmpl %fp@(-4),%d6 4b8f8: 654c bcss 4b946 <_Heap_Allocate_aligned_with_boundary+0x112><== NEVER TAKEN 4b8fa: 2803 movel %d3,%d4 4b8fc: 4c41 4002 remul %d1,%d2,%d4 4b900: 9682 subl %d2,%d3 return 0; } alloc_begin = boundary_line - alloc_size; alloc_begin = _Heap_Align_down( alloc_begin, alignment ); alloc_end = alloc_begin + alloc_size; 4b902: 2803 movel %d3,%d4 4b904: d880 addl %d0,%d4 4b906: 2403 movel %d3,%d2 4b908: 2604 movel %d4,%d3 4b90a: 4c45 3006 remul %d5,%d6,%d3 4b90e: 2604 movel %d4,%d3 4b910: 9686 subl %d6,%d3 4b912: 2c03 movel %d3,%d6 while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { if ( boundary_line < boundary_floor ) { return 0; } alloc_begin = boundary_line - alloc_size; 4b914: 2606 movel %d6,%d3 4b916: 9680 subl %d0,%d3 /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { 4b918: bc82 cmpl %d2,%d6 4b91a: 6304 blss 4b920 <_Heap_Allocate_aligned_with_boundary+0xec> 4b91c: b886 cmpl %d6,%d4 4b91e: 62d4 bhis 4b8f4 <_Heap_Allocate_aligned_with_boundary+0xc0> 4b920: 2d4b fff0 movel %a3,%fp@(-16) boundary_line = _Heap_Align_down( alloc_end, boundary ); } } /* Ensure that the we have a valid new block at the beginning */ if ( alloc_begin >= alloc_begin_floor ) { 4b924: b3c2 cmpal %d2,%a1 4b926: 621e bhis 4b946 <_Heap_Allocate_aligned_with_boundary+0x112> uintptr_t const alloc_block_begin = (uintptr_t) _Heap_Block_of_alloc_area( alloc_begin, page_size ); uintptr_t const free_size = alloc_block_begin - block_begin; 4b928: 2802 movel %d2,%d4 4b92a: 327c fff8 moveaw #-8,%a1 4b92e: 93c8 subal %a0,%a1 4b930: d3c2 addal %d2,%a1 4b932: 4c47 4003 remul %d7,%d3,%d4 4b936: 93c3 subal %d3,%a1 if ( free_size >= min_block_size || free_size == 0 ) { 4b938: b3ee fff0 cmpal %fp@(-16),%a1 4b93c: 6404 bccs 4b942 <_Heap_Allocate_aligned_with_boundary+0x10e> 4b93e: 4a89 tstl %a1 4b940: 6604 bnes 4b946 <_Heap_Allocate_aligned_with_boundary+0x112> boundary ); } } if ( alloc_begin != 0 ) { 4b942: 4a82 tstl %d2 4b944: 6610 bnes 4b956 <_Heap_Allocate_aligned_with_boundary+0x122><== ALWAYS TAKEN break; } block = block->next; 4b946: 2068 0008 moveal %a0@(8),%a0 if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { 4b94a: b5c8 cmpal %a0,%a2 4b94c: 6600 ff38 bnew 4b886 <_Heap_Allocate_aligned_with_boundary+0x52> 4b950: 260d movel %a5,%d3 4b952: 4282 clrl %d2 4b954: 6018 bras 4b96e <_Heap_Allocate_aligned_with_boundary+0x13a> if ( alloc_begin != 0 ) { /* Statistics */ stats->searches += search_count; block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 4b956: 2f00 movel %d0,%sp@- 4b958: 260d movel %a5,%d3 block = block->next; } if ( alloc_begin != 0 ) { /* Statistics */ stats->searches += search_count; 4b95a: d7aa 004c addl %d3,%a2@(76) block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 4b95e: 2f02 movel %d2,%sp@- 4b960: 2f08 movel %a0,%sp@- 4b962: 2f0a movel %a2,%sp@- 4b964: 4eb9 0004 683a jsr 4683a <_Heap_Block_allocate> 4b96a: 4fef 0010 lea %sp@(16),%sp uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { Heap_Statistics *const stats = &heap->stats; 4b96e: b6aa 0044 cmpl %a2@(68),%d3 4b972: 6304 blss 4b978 <_Heap_Allocate_aligned_with_boundary+0x144> ); } /* Statistics */ if ( stats->max_search < search_count ) { stats->max_search = search_count; 4b974: 2543 0044 movel %d3,%a2@(68) } return (void *) alloc_begin; 4b978: 2002 movel %d2,%d0 4b97a: 6002 bras 4b97e <_Heap_Allocate_aligned_with_boundary+0x14a> 4b97c: 4280 clrl %d0 } 4b97e: 4cee 3cfc ffc8 moveml %fp@(-56),%d2-%d7/%a2-%a5 4b984: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004fa38 <_Heap_Extend>: Heap_Control *heap, void *area_begin_ptr, uintptr_t area_size, uintptr_t *amount_extended ) { 4fa38: 4e56 fff4 linkw %fp,#-12 4fa3c: 206e 0008 moveal %fp@(8),%a0 4fa40: 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; 4fa44: 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; 4fa48: 2268 0024 moveal %a0@(36),%a1 Heap_Control *heap, void *area_begin_ptr, uintptr_t area_size, uintptr_t *amount_extended ) { 4fa4c: 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; 4fa50: b0a8 0018 cmpl %a0@(24),%d0 4fa54: 6508 bcss 4fa5e <_Heap_Extend+0x26> * 5. non-contiguous higher address (NOT SUPPORTED) * * As noted, this code only supports (4). */ if ( area_begin >= heap_area_begin && area_begin < heap_area_end ) { 4fa56: b280 cmpl %d0,%d1 4fa58: 6304 blss 4fa5e <_Heap_Extend+0x26> 4fa5a: 7001 moveq #1,%d0 4fa5c: 606c bras 4faca <_Heap_Extend+0x92> return HEAP_EXTEND_ERROR; /* case 3 */ } else if ( area_begin != heap_area_end ) { 4fa5e: b280 cmpl %d0,%d1 4fa60: 6704 beqs 4fa66 <_Heap_Extend+0x2e> 4fa62: 7002 moveq #2,%d0 4fa64: 6064 bras 4faca <_Heap_Extend+0x92> { Heap_Statistics *const stats = &heap->stats; uintptr_t const area_begin = (uintptr_t) area_begin_ptr; uintptr_t const heap_area_begin = heap->area_begin; uintptr_t const heap_area_end = heap->area_end; uintptr_t const new_heap_area_end = heap_area_end + area_size; 4fa66: 2200 movel %d0,%d1 4fa68: d2ae 0010 addl %fp@(16),%d1 * block and free it. */ heap->area_end = new_heap_area_end; extend_size = new_heap_area_end 4fa6c: 70f8 moveq #-8,%d0 4fa6e: 9089 subl %a1,%d0 4fa70: d081 addl %d1,%d0 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4fa72: 2600 movel %d0,%d3 4fa74: 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; 4fa7a: 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; 4fa7e: 246e 0014 moveal %fp@(20),%a2 4fa82: 9082 subl %d2,%d0 4fa84: 2480 movel %d0,%a2@ if( extend_size >= heap->min_block_size ) { 4fa86: b0a8 0014 cmpl %a0@(20),%d0 4fa8a: 653c bcss 4fac8 <_Heap_Extend+0x90> <== NEVER TAKEN uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; block->size_and_flag = size | flag; 4fa8c: 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); 4fa8e: 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; 4fa92: c4a9 0004 andl %a1@(4),%d2 Heap_Block *const new_last_block = _Heap_Block_at( last_block, extend_size ); _Heap_Block_set_size( last_block, extend_size ); new_last_block->size_and_flag = 4fa96: 2228 0020 movel %a0@(32),%d1 4fa9a: 928a subl %a2,%d1 4fa9c: 8480 orl %d0,%d2 ((uintptr_t) heap->first_block - (uintptr_t) new_last_block) | HEAP_PREV_BLOCK_USED; heap->last_block = new_last_block; 4fa9e: 214a 0024 movel %a2,%a0@(36) 4faa2: 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 = 4faa6: 7401 moveq #1,%d2 4faa8: 8481 orl %d1,%d2 4faaa: 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 )); 4faae: 4869 0008 pea %a1@(8) | HEAP_PREV_BLOCK_USED; heap->last_block = new_last_block; /* Statistics */ stats->size += extend_size; 4fab2: d1a8 002c addl %d0,%a0@(44) ++stats->used_blocks; 4fab6: 52a8 0040 addql #1,%a0@(64) --stats->frees; /* Do not count subsequent call as actual free() */ 4faba: 53a8 0050 subql #1,%a0@(80) _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( last_block )); 4fabe: 2f08 movel %a0,%sp@- 4fac0: 4eb9 0004 a060 jsr 4a060 <_Heap_Free> 4fac6: 508f addql #8,%sp 4fac8: 4280 clrl %d0 } return HEAP_EXTEND_SUCCESSFUL; } 4faca: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 4fad0: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0005b7b8 <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { 5b7b8: 4e56 0000 linkw %fp,#0 5b7bc: 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 ) 5b7c0: 2040 moveal %d0,%a0 5b7c2: 5188 subql #8,%a0 5b7c4: 226e 0008 moveal %fp@(8),%a1 5b7c8: 2f02 movel %d2,%sp@- 5b7ca: 2400 movel %d0,%d2 5b7cc: 4c69 2001 0010 remul %a1@(16),%d1,%d2 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 5b7d2: 2429 0020 movel %a1@(32),%d2 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_of_alloc_area( uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) 5b7d6: 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 5b7d8: b488 cmpl %a0,%d2 5b7da: 6244 bhis 5b820 <_Heap_Size_of_alloc_area+0x68> 5b7dc: b1e9 0024 cmpal %a1@(36),%a0 5b7e0: 53c1 sls %d1 5b7e2: 49c1 extbl %d1 5b7e4: 4481 negl %d1 uintptr_t const alloc_begin = (uintptr_t) alloc_begin_ptr; Heap_Block *block = _Heap_Block_of_alloc_area( alloc_begin, page_size ); Heap_Block *next_block = NULL; uintptr_t block_size = 0; if ( !_Heap_Is_block_in_heap( heap, block ) ) { 5b7e6: 4a01 tstb %d1 5b7e8: 6736 beqs 5b820 <_Heap_Size_of_alloc_area+0x68> <== NEVER TAKEN RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 5b7ea: 72fe moveq #-2,%d1 5b7ec: c2a8 0004 andl %a0@(4),%d1 5b7f0: d1c1 addal %d1,%a0 RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap( const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block 5b7f2: b488 cmpl %a0,%d2 5b7f4: 622a bhis 5b820 <_Heap_Size_of_alloc_area+0x68> <== NEVER TAKEN 5b7f6: b1e9 0024 cmpal %a1@(36),%a0 5b7fa: 53c1 sls %d1 5b7fc: 49c1 extbl %d1 5b7fe: 4481 negl %d1 } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( 5b800: 4a01 tstb %d1 5b802: 671c beqs 5b820 <_Heap_Size_of_alloc_area+0x68> <== NEVER TAKEN 5b804: 7201 moveq #1,%d1 5b806: c2a8 0004 andl %a0@(4),%d1 5b80a: 4a01 tstb %d1 5b80c: 6712 beqs 5b820 <_Heap_Size_of_alloc_area+0x68> <== NEVER TAKEN || !_Heap_Is_prev_used( next_block ) ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_BLOCK_SIZE_OFFSET - alloc_begin; 5b80e: 7204 moveq #4,%d1 5b810: 9280 subl %d0,%d1 5b812: 2001 movel %d1,%d0 5b814: d088 addl %a0,%d0 5b816: 226e 0010 moveal %fp@(16),%a1 5b81a: 2280 movel %d0,%a1@ 5b81c: 7001 moveq #1,%d0 return true; 5b81e: 6002 bras 5b822 <_Heap_Size_of_alloc_area+0x6a> 5b820: 4200 clrb %d0 } 5b822: 241f movel %sp@+,%d2 5b824: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000472f4 <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 472f4: 4e56 ffd0 linkw %fp,#-48 472f8: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 472fc: 286e 0008 moveal %fp@(8),%a4 uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; Heap_Block *const last_block = heap->last_block; Heap_Block *block = heap->first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 47300: 47fa 031a lea %pc@(4761c <_Heap_Walk_print>),%a3 bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 47304: 242e 000c movel %fp@(12),%d2 uintptr_t const page_size = heap->page_size; 47308: 2c2c 0010 movel %a4@(16),%d6 uintptr_t const min_block_size = heap->min_block_size; 4730c: 262c 0014 movel %a4@(20),%d3 Heap_Block *const last_block = heap->last_block; 47310: 2a2c 0024 movel %a4@(36),%d5 Heap_Block *block = heap->first_block; 47314: 246c 0020 moveal %a4@(32),%a2 Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 47318: 4a2e 0013 tstb %fp@(19) 4731c: 6604 bnes 47322 <_Heap_Walk+0x2e> 4731e: 47fa ffcc lea %pc@(472ec <_Heap_Walk_print_nothing>),%a3 if ( !_System_state_Is_up( _System_state_Get() ) ) { 47322: 7003 moveq #3,%d0 47324: b0b9 0006 145c cmpl 6145c <_System_state_Current>,%d0 4732a: 6600 02da bnew 47606 <_Heap_Walk+0x312> Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); Heap_Block *const first_block = heap->first_block; Heap_Block *const last_block = heap->last_block; (*printer)( 4732e: 2f2c 000c movel %a4@(12),%sp@- 47332: 2f2c 0008 movel %a4@(8),%sp@- 47336: 2f05 movel %d5,%sp@- 47338: 2f0a movel %a2,%sp@- 4733a: 2f2c 001c movel %a4@(28),%sp@- 4733e: 2f2c 0018 movel %a4@(24),%sp@- 47342: 2f03 movel %d3,%sp@- 47344: 2f06 movel %d6,%sp@- 47346: 4879 0005 d3cc pea 5d3cc 4734c: 42a7 clrl %sp@- 4734e: 2f02 movel %d2,%sp@- 47350: 4e93 jsr %a3@ heap->area_begin, heap->area_end, first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { 47352: 4fef 002c lea %sp@(44),%sp 47356: 4a86 tstl %d6 47358: 6608 bnes 47362 <_Heap_Walk+0x6e> (*printer)( source, true, "page size is zero\n" ); 4735a: 4879 0005 d45d pea 5d45d 47360: 607e bras 473e0 <_Heap_Walk+0xec> return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 47362: 7003 moveq #3,%d0 47364: c086 andl %d6,%d0 47366: 670c beqs 47374 <_Heap_Walk+0x80> (*printer)( 47368: 2f06 movel %d6,%sp@- 4736a: 4879 0005 d470 pea 5d470 47370: 6000 0268 braw 475da <_Heap_Walk+0x2e6> ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 47374: 2203 movel %d3,%d1 47376: 4c46 1000 remul %d6,%d0,%d1 4737a: 4a80 tstl %d0 4737c: 670c beqs 4738a <_Heap_Walk+0x96> (*printer)( 4737e: 2f03 movel %d3,%sp@- 47380: 4879 0005 d48e pea 5d48e 47386: 6000 0252 braw 475da <_Heap_Walk+0x2e6> ); return false; } if ( 4738a: 200a movel %a2,%d0 4738c: 5080 addql #8,%d0 4738e: 4c46 0001 remul %d6,%d1,%d0 47392: 4a81 tstl %d1 47394: 670c beqs 473a2 <_Heap_Walk+0xae> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 47396: 2f0a movel %a2,%sp@- 47398: 4879 0005 d4b2 pea 5d4b2 4739e: 6000 023a braw 475da <_Heap_Walk+0x2e6> ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 473a2: 7001 moveq #1,%d0 473a4: c0aa 0004 andl %a2@(4),%d0 473a8: 4a00 tstb %d0 473aa: 6608 bnes 473b4 <_Heap_Walk+0xc0> (*printer)( 473ac: 4879 0005 d4e3 pea 5d4e3 473b2: 602c bras 473e0 <_Heap_Walk+0xec> ); return false; } if ( first_block->prev_size != page_size ) { 473b4: 2812 movel %a2@,%d4 473b6: bc84 cmpl %d4,%d6 473b8: 670e beqs 473c8 <_Heap_Walk+0xd4> (*printer)( 473ba: 2f06 movel %d6,%sp@- 473bc: 2f04 movel %d4,%sp@- 473be: 4879 0005 d511 pea 5d511 473c4: 6000 0150 braw 47516 <_Heap_Walk+0x222> ); return false; } if ( _Heap_Is_free( last_block ) ) { 473c8: 2045 moveal %d5,%a0 473ca: 70fe moveq #-2,%d0 473cc: 7201 moveq #1,%d1 473ce: c0a8 0004 andl %a0@(4),%d0 473d2: c2b0 0804 andl %a0@(00000004,%d0:l),%d1 473d6: 4a01 tstb %d1 473d8: 6616 bnes 473f0 <_Heap_Walk+0xfc> (*printer)( 473da: 4879 0005 d53c pea 5d53c 473e0: 4878 0001 pea 1 473e4: 2f02 movel %d2,%sp@- 473e6: 4e93 jsr %a3@ 473e8: 4fef 000c lea %sp@(12),%sp 473ec: 6000 01f8 braw 475e6 <_Heap_Walk+0x2f2> int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 473f0: 2c2c 0010 movel %a4@(16),%d6 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 473f4: 220c movel %a4,%d1 473f6: 206c 0008 moveal %a4@(8),%a0 473fa: 606a bras 47466 <_Heap_Walk+0x172> RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap( const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block 473fc: b1ec 0020 cmpal %a4@(32),%a0 47400: 650e bcss 47410 <_Heap_Walk+0x11c> 47402: b1ec 0024 cmpal %a4@(36),%a0 47406: 53c0 sls %d0 47408: 49c0 extbl %d0 4740a: 4480 negl %d0 const Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); const Heap_Block *prev_block = free_list_tail; const Heap_Block *free_block = first_free_block; while ( free_block != free_list_tail ) { if ( !_Heap_Is_block_in_heap( heap, free_block ) ) { 4740c: 4a00 tstb %d0 4740e: 660c bnes 4741c <_Heap_Walk+0x128> <== ALWAYS TAKEN (*printer)( 47410: 2f08 movel %a0,%sp@- 47412: 4879 0005 d551 pea 5d551 47418: 6000 01c0 braw 475da <_Heap_Walk+0x2e6> ); return false; } if ( 4741c: 4c46 7000 remul %d6,%d0,%d7 47420: 4a80 tstl %d0 47422: 670c beqs 47430 <_Heap_Walk+0x13c> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 47424: 2f08 movel %a0,%sp@- 47426: 4879 0005 d571 pea 5d571 4742c: 6000 01ac braw 475da <_Heap_Walk+0x2e6> ); return false; } if ( _Heap_Is_used( free_block ) ) { 47430: 70fe moveq #-2,%d0 47432: 7e01 moveq #1,%d7 47434: c0a8 0004 andl %a0@(4),%d0 47438: ceb0 0804 andl %a0@(00000004,%d0:l),%d7 4743c: 670c beqs 4744a <_Heap_Walk+0x156> (*printer)( 4743e: 2f08 movel %a0,%sp@- 47440: 4879 0005 d5a1 pea 5d5a1 47446: 6000 0192 braw 475da <_Heap_Walk+0x2e6> ); return false; } if ( free_block->prev != prev_block ) { 4744a: 2028 000c movel %a0@(12),%d0 4744e: b280 cmpl %d0,%d1 47450: 670e beqs 47460 <_Heap_Walk+0x16c> (*printer)( 47452: 2f00 movel %d0,%sp@- 47454: 2f08 movel %a0,%sp@- 47456: 4879 0005 d5bd pea 5d5bd 4745c: 6000 00b8 braw 47516 <_Heap_Walk+0x222> return false; } prev_block = free_block; free_block = free_block->next; 47460: 2208 movel %a0,%d1 47462: 2068 0008 moveal %a0@(8),%a0 ); return false; } if ( 47466: 2e08 movel %a0,%d7 47468: 5087 addql #8,%d7 const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); const Heap_Block *prev_block = free_list_tail; const Heap_Block *free_block = first_free_block; while ( free_block != free_list_tail ) { 4746a: b9c8 cmpal %a0,%a4 4746c: 668e bnes 473fc <_Heap_Walk+0x108> 4746e: 6000 0190 braw 47600 <_Heap_Walk+0x30c> - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 47472: 202a 0004 movel %a2@(4),%d0 47476: 7cfe moveq #-2,%d6 uintptr_t const block_size = _Heap_Block_size( block ); bool const prev_used = _Heap_Is_prev_used( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); uintptr_t const next_block_begin = (uintptr_t) next_block; if ( prev_used ) { 47478: 7201 moveq #1,%d1 4747a: cc80 andl %d0,%d6 4747c: 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); 4747e: 4bf2 6800 lea %a2@(00000000,%d6:l),%a5 47482: 4a00 tstb %d0 47484: 6716 beqs 4749c <_Heap_Walk+0x1a8> (*printer)( 47486: 2f06 movel %d6,%sp@- 47488: 2f0a movel %a2,%sp@- 4748a: 4879 0005 d5ef pea 5d5ef 47490: 42a7 clrl %sp@- 47492: 2f02 movel %d2,%sp@- 47494: 4e93 jsr %a3@ 47496: 4fef 0014 lea %sp@(20),%sp 4749a: 6016 bras 474b2 <_Heap_Walk+0x1be> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 4749c: 2f12 movel %a2@,%sp@- 4749e: 2f06 movel %d6,%sp@- 474a0: 2f0a movel %a2,%sp@- 474a2: 4879 0005 d606 pea 5d606 474a8: 42a7 clrl %sp@- 474aa: 2f02 movel %d2,%sp@- 474ac: 4e93 jsr %a3@ 474ae: 4fef 0018 lea %sp@(24),%sp RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap( const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block 474b2: bbec 0020 cmpal %a4@(32),%a5 474b6: 650e bcss 474c6 <_Heap_Walk+0x1d2> <== NEVER TAKEN 474b8: bbec 0024 cmpal %a4@(36),%a5 474bc: 53c0 sls %d0 474be: 49c0 extbl %d0 474c0: 4480 negl %d0 block_size, block->prev_size ); } if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 474c2: 4a00 tstb %d0 474c4: 660c bnes 474d2 <_Heap_Walk+0x1de> (*printer)( 474c6: 2f0d movel %a5,%sp@- 474c8: 2f0a movel %a2,%sp@- 474ca: 4879 0005 d62b pea 5d62b 474d0: 6044 bras 47516 <_Heap_Walk+0x222> ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) ) { 474d2: 2206 movel %d6,%d1 474d4: 4c44 1000 remul %d4,%d0,%d1 474d8: 4a80 tstl %d0 474da: 670c beqs 474e8 <_Heap_Walk+0x1f4> (*printer)( 474dc: 2f06 movel %d6,%sp@- 474de: 2f0a movel %a2,%sp@- 474e0: 4879 0005 d658 pea 5d658 474e6: 602e bras 47516 <_Heap_Walk+0x222> ); return false; } if ( block_size < min_block_size ) { 474e8: b686 cmpl %d6,%d3 474ea: 631c blss 47508 <_Heap_Walk+0x214> (*printer)( 474ec: 2f03 movel %d3,%sp@- 474ee: 2f06 movel %d6,%sp@- 474f0: 2f0a movel %a2,%sp@- 474f2: 4879 0005 d686 pea 5d686 474f8: 4878 0001 pea 1 474fc: 2f02 movel %d2,%sp@- 474fe: 4e93 jsr %a3@ block, block_size, min_block_size ); return false; 47500: 4fef 0018 lea %sp@(24),%sp 47504: 6000 00e0 braw 475e6 <_Heap_Walk+0x2f2> } if ( next_block_begin <= block_begin ) { 47508: b5cd cmpal %a5,%a2 4750a: 651a bcss 47526 <_Heap_Walk+0x232> (*printer)( 4750c: 2f0d movel %a5,%sp@- 4750e: 2f0a movel %a2,%sp@- 47510: 4879 0005 d6b1 pea 5d6b1 47516: 4878 0001 pea 1 4751a: 2f02 movel %d2,%sp@- 4751c: 4e93 jsr %a3@ "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 4751e: 4fef 0014 lea %sp@(20),%sp 47522: 6000 00c2 braw 475e6 <_Heap_Walk+0x2f2> } if ( !_Heap_Is_prev_used( next_block ) ) { 47526: 7001 moveq #1,%d0 47528: c0ad 0004 andl %a5@(4),%d0 4752c: 4a00 tstb %d0 4752e: 6600 00ce bnew 475fe <_Heap_Walk+0x30a> block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 47532: 2e2a 0004 movel %a2@(4),%d7 - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 47536: 7cfe moveq #-2,%d6 return _Heap_Free_list_head(heap)->next; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_last( Heap_Control *heap ) { return _Heap_Free_list_tail(heap)->prev; 47538: 43f9 0005 d6e5 lea 5d6e5 ,%a1 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 4753e: 206c 0008 moveal %a4@(8),%a0 - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 47542: cc87 andl %d7,%d6 block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 47544: 2d47 fffc movel %d7,%fp@(-4) RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 47548: 2e0a movel %a2,%d7 4754a: de86 addl %d6,%d7 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 4754c: 2d48 fff8 movel %a0,%fp@(-8) Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 47550: 206a 0008 moveal %a2@(8),%a0 } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_last( Heap_Control *heap ) { return _Heap_Free_list_tail(heap)->prev; 47554: b1ec 000c cmpal %a4@(12),%a0 47558: 6710 beqs 4756a <_Heap_Walk+0x276> " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") 4755a: 43f9 0005 d6ef lea 5d6ef ,%a1 47560: b9c8 cmpal %a0,%a4 47562: 6706 beqs 4756a <_Heap_Walk+0x276> 47564: 43f9 0005 d31c lea 5d31c ,%a1 Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 4756a: 202a 000c movel %a2@(12),%d0 4756e: 223c 0005 d6f9 movel #382713,%d1 47574: b0ae fff8 cmpl %fp@(-8),%d0 47578: 6710 beqs 4758a <_Heap_Walk+0x296> "block 0x%08x: prev 0x%08x%s, next 0x%08x%s\n", block, block->prev, block->prev == first_free_block ? " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), 4757a: 223c 0005 d704 movel #382724,%d1 47580: b9c0 cmpal %d0,%a4 47582: 6706 beqs 4758a <_Heap_Walk+0x296> 47584: 223c 0005 d31c movel #381724,%d1 Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 4758a: 2f09 movel %a1,%sp@- 4758c: 2f08 movel %a0,%sp@- 4758e: 2f01 movel %d1,%sp@- 47590: 2f00 movel %d0,%sp@- 47592: 2f0a movel %a2,%sp@- 47594: 4879 0005 d70e pea 5d70e 4759a: 42a7 clrl %sp@- 4759c: 2f02 movel %d2,%sp@- 4759e: 4e93 jsr %a3@ block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { 475a0: 4fef 0020 lea %sp@(32),%sp 475a4: 2047 moveal %d7,%a0 475a6: 2010 movel %a0@,%d0 475a8: b086 cmpl %d6,%d0 475aa: 671c beqs 475c8 <_Heap_Walk+0x2d4> (*printer)( 475ac: 2f07 movel %d7,%sp@- 475ae: 2f00 movel %d0,%sp@- 475b0: 2f06 movel %d6,%sp@- 475b2: 2f0a movel %a2,%sp@- 475b4: 4879 0005 d73a pea 5d73a 475ba: 4878 0001 pea 1 475be: 2f02 movel %d2,%sp@- 475c0: 4e93 jsr %a3@ 475c2: 4fef 001c lea %sp@(28),%sp 475c6: 601e bras 475e6 <_Heap_Walk+0x2f2> ); return false; } if ( !prev_used ) { 475c8: 7001 moveq #1,%d0 475ca: c0ae fffc andl %fp@(-4),%d0 475ce: 4a00 tstb %d0 475d0: 6618 bnes 475ea <_Heap_Walk+0x2f6> (*printer)( 475d2: 2f0a movel %a2,%sp@- 475d4: 4879 0005 d773 pea 5d773 475da: 4878 0001 pea 1 475de: 2f02 movel %d2,%sp@- 475e0: 4e93 jsr %a3@ 475e2: 4fef 0010 lea %sp@(16),%sp 475e6: 4200 clrb %d0 475e8: 601e bras 47608 <_Heap_Walk+0x314> return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 475ea: 206c 0008 moveal %a4@(8),%a0 475ee: 6008 bras 475f8 <_Heap_Walk+0x304> { const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *free_block = _Heap_Free_list_first( heap ); while ( free_block != free_list_tail ) { if ( free_block == block ) { 475f0: b5c8 cmpal %a0,%a2 475f2: 670a beqs 475fe <_Heap_Walk+0x30a> return true; } free_block = free_block->next; 475f4: 2068 0008 moveal %a0@(8),%a0 ) { const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *free_block = _Heap_Free_list_first( heap ); while ( free_block != free_list_tail ) { 475f8: b9c8 cmpal %a0,%a4 475fa: 66f4 bnes 475f0 <_Heap_Walk+0x2fc> 475fc: 6014 bras 47612 <_Heap_Walk+0x31e> 475fe: 244d moveal %a5,%a2 if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; } while ( block != last_block ) { 47600: ba8a cmpl %a2,%d5 47602: 6600 fe6e bnew 47472 <_Heap_Walk+0x17e> 47606: 7001 moveq #1,%d0 block = next_block; } return true; } 47608: 4cee 3cfc ffd0 moveml %fp@(-48),%d2-%d7/%a2-%a5 4760e: 4e5e unlk %fp 47610: 4e75 rts return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 47612: 2f0a movel %a2,%sp@- 47614: 4879 0005 d7a2 pea 5d7a2 4761a: 60be bras 475da <_Heap_Walk+0x2e6> =============================================================================== 00046930 <_Internal_error_Occurred>: void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 46930: 4e56 0000 linkw %fp,#0 46934: 222e 000c movel %fp@(12),%d1 46938: 2f03 movel %d3,%sp@- _Internal_errors_What_happened.the_source = the_source; _Internal_errors_What_happened.is_internal = is_internal; _Internal_errors_What_happened.the_error = the_error; _User_extensions_Fatal( the_source, is_internal, the_error ); 4693a: 4283 clrl %d3 4693c: 1601 moveb %d1,%d3 void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 4693e: 2f02 movel %d2,%sp@- 46940: 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 ); 46944: 2f02 movel %d2,%sp@- void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 46946: 202e 0008 movel %fp@(8),%d0 _Internal_errors_What_happened.the_source = the_source; _Internal_errors_What_happened.is_internal = is_internal; _Internal_errors_What_happened.the_error = the_error; _User_extensions_Fatal( the_source, is_internal, the_error ); 4694a: 2f03 movel %d3,%sp@- _System_state_Set( SYSTEM_STATE_FAILED ); _CPU_Fatal_halt( the_error ); 4694c: 263c 0000 0700 movel #1792,%d3 _Internal_errors_What_happened.the_source = the_source; _Internal_errors_What_happened.is_internal = is_internal; _Internal_errors_What_happened.the_error = the_error; _User_extensions_Fatal( the_source, is_internal, the_error ); 46952: 2f00 movel %d0,%sp@- Internal_errors_t the_error ) { _Internal_errors_What_happened.the_source = the_source; _Internal_errors_What_happened.is_internal = is_internal; 46954: 13c1 0005 efe6 moveb %d1,5efe6 <_Internal_errors_What_happened+0x4> bool is_internal, Internal_errors_t the_error ) { _Internal_errors_What_happened.the_source = the_source; 4695a: 23c0 0005 efe2 movel %d0,5efe2 <_Internal_errors_What_happened> _Internal_errors_What_happened.is_internal = is_internal; _Internal_errors_What_happened.the_error = the_error; 46960: 23c2 0005 efe8 movel %d2,5efe8 <_Internal_errors_What_happened+0x6> _User_extensions_Fatal( the_source, is_internal, the_error ); 46966: 4eb9 0004 84da jsr 484da <_User_extensions_Fatal> _System_state_Set( SYSTEM_STATE_FAILED ); _CPU_Fatal_halt( the_error ); 4696c: 40c0 movew %sr,%d0 4696e: 8083 orl %d3,%d0 46970: 46c0 movew %d0,%sr 46972: 2002 movel %d2,%d0 <== NOT EXECUTED 46974: 223c dead beef movel #-559038737,%d1 <== NOT EXECUTED 4697a: 4ac8 halt <== NOT EXECUTED RTEMS_INLINE_ROUTINE void _System_state_Set ( System_state_Codes state ) { _System_state_Current = state; 4697c: 7005 moveq #5,%d0 4697e: 4fef 000c lea %sp@(12),%sp 46982: 23c0 0005 f0c4 movel %d0,5f0c4 <_System_state_Current> 46988: 60fe bras 46988 <_Internal_error_Occurred+0x58> ... =============================================================================== 000469f4 <_Objects_Allocate>: */ Objects_Control *_Objects_Allocate( Objects_Information *information ) { 469f4: 4e56 fff0 linkw %fp,#-16 469f8: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ 469fc: 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 ) 46a00: 4aaa 0014 tstl %a2@(20) 46a04: 6604 bnes 46a0a <_Objects_Allocate+0x16> <== ALWAYS TAKEN 46a06: 4280 clrl %d0 <== NOT EXECUTED 46a08: 605e bras 46a68 <_Objects_Allocate+0x74> <== NOT EXECUTED /* * OK. The manager should be initialized and configured to have objects. * With any luck, it is safe to attempt to allocate an object. */ the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 46a0a: 240a movel %a2,%d2 46a0c: 0682 0000 001c addil #28,%d2 46a12: 47f9 0004 61c0 lea 461c0 <_Chain_Get>,%a3 46a18: 2f02 movel %d2,%sp@- 46a1a: 4e93 jsr %a3@ if ( information->auto_extend ) { 46a1c: 588f addql #4,%sp 46a1e: 4a2a 0010 tstb %a2@(16) 46a22: 6744 beqs 46a68 <_Objects_Allocate+0x74> /* * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { 46a24: 4a80 tstl %d0 46a26: 6612 bnes 46a3a <_Objects_Allocate+0x46> _Objects_Extend_information( information ); 46a28: 2f0a movel %a2,%sp@- 46a2a: 4eb9 0004 6aa0 jsr 46aa0 <_Objects_Extend_information> the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 46a30: 2f02 movel %d2,%sp@- 46a32: 4e93 jsr %a3@ } if ( the_object ) { 46a34: 508f addql #8,%sp 46a36: 4a80 tstl %d0 46a38: 672e beqs 46a68 <_Objects_Allocate+0x74> uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 46a3a: 2040 moveal %d0,%a0 46a3c: 4281 clrl %d1 46a3e: 4283 clrl %d3 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 46a40: 4282 clrl %d2 } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 46a42: 362a 0008 movew %a2@(8),%d3 46a46: 3228 000a movew %a0@(10),%d1 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 46a4a: 342a 0012 movew %a2@(18),%d2 information->inactive--; 46a4e: 306a 0028 moveaw %a2@(40),%a0 } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 46a52: 9283 subl %d3,%d1 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 46a54: 4c42 1001 remul %d2,%d1,%d1 information->inactive--; 46a58: 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 ]--; 46a5a: e589 lsll #2,%d1 information->inactive--; 46a5c: 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 ]--; 46a60: 206a 002a moveal %a2@(42),%a0 46a64: d1c1 addal %d1,%a0 46a66: 5390 subql #1,%a0@ information->inactive--; } } return the_object; } 46a68: 4cee 0c0c fff0 moveml %fp@(-16),%d2-%d3/%a2-%a3 46a6e: 4e5e unlk %fp ... =============================================================================== 00046a74 <_Objects_Close>: #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 46a74: 4280 clrl %d0 void _Objects_Close( Objects_Information *information, Objects_Control *the_object ) { 46a76: 4e56 0000 linkw %fp,#0 46a7a: 226e 000c moveal %fp@(12),%a1 46a7e: 206e 0008 moveal %fp@(8),%a0 46a82: 2f0a movel %a2,%sp@- 46a84: 2468 0018 moveal %a0@(24),%a2 46a88: 3029 000a movew %a1@(10),%d0 46a8c: 42b2 0c00 clrl %a2@(00000000,%d0:l:4) _Objects_Invalidate_Id( information, the_object ); _Objects_Namespace_remove( information, the_object ); 46a90: 2d49 000c movel %a1,%fp@(12) } 46a94: 245f moveal %sp@+,%a2 46a96: 4e5e unlk %fp Objects_Control *the_object ) { _Objects_Invalidate_Id( information, the_object ); _Objects_Namespace_remove( information, the_object ); 46a98: 4ef9 0004 6f98 jmp 46f98 <_Objects_Namespace_remove> ... =============================================================================== 00046d98 <_Objects_Get_information>: Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint32_t the_class ) { 46d98: 4e56 0000 linkw %fp,#0 46d9c: 2f03 movel %d3,%sp@- 46d9e: 262e 0008 movel %fp@(8),%d3 46da2: 2f02 movel %d2,%sp@- 46da4: 242e 000c movel %fp@(12),%d2 Objects_Information *info; int the_class_api_maximum; if ( !the_class ) 46da8: 672e beqs 46dd8 <_Objects_Get_information+0x40> /* * This call implicitly validates the_api so we do not call * _Objects_Is_api_valid above here. */ the_class_api_maximum = _Objects_API_maximum_class( the_api ); 46daa: 2f03 movel %d3,%sp@- 46dac: 4eb9 0004 baf8 jsr 4baf8 <_Objects_API_maximum_class> if ( the_class_api_maximum == 0 ) 46db2: 588f addql #4,%sp 46db4: 4a80 tstl %d0 46db6: 6720 beqs 46dd8 <_Objects_Get_information+0x40> return NULL; if ( the_class > (uint32_t) the_class_api_maximum ) 46db8: b082 cmpl %d2,%d0 46dba: 651c bcss 46dd8 <_Objects_Get_information+0x40> return NULL; if ( !_Objects_Information_table[ the_api ] ) 46dbc: 41f9 0005 eef4 lea 5eef4 <_Objects_Information_table>,%a0 46dc2: 2070 3c00 moveal %a0@(00000000,%d3:l:4),%a0 46dc6: 4a88 tstl %a0 46dc8: 670e beqs 46dd8 <_Objects_Get_information+0x40> <== NEVER TAKEN return NULL; info = _Objects_Information_table[ the_api ][ the_class ]; 46dca: 2030 2c00 movel %a0@(00000000,%d2:l:4),%d0 if ( !info ) 46dce: 670a beqs 46dda <_Objects_Get_information+0x42> <== NEVER TAKEN * In a multprocessing configuration, we may access remote objects. * Thus we may have 0 local instances and still have a valid object * pointer. */ #if !defined(RTEMS_MULTIPROCESSING) if ( info->maximum == 0 ) 46dd0: 2040 moveal %d0,%a0 46dd2: 4a68 000e tstw %a0@(14) 46dd6: 6602 bnes 46dda <_Objects_Get_information+0x42> 46dd8: 4280 clrl %d0 return NULL; #endif return info; } 46dda: 242e fff8 movel %fp@(-8),%d2 46dde: 262e fffc movel %fp@(-4),%d3 46de2: 4e5e unlk %fp ... =============================================================================== 00046fd4 <_Objects_Get_next>: Objects_Information *information, Objects_Id id, Objects_Locations *location_p, Objects_Id *next_id_p ) { 46fd4: 4e56 ffec linkw %fp,#-20 46fd8: 48d7 3c04 moveml %d2/%a2-%a5,%sp@ 46fdc: 266e 0008 moveal %fp@(8),%a3 46fe0: 242e 000c movel %fp@(12),%d2 46fe4: 246e 0010 moveal %fp@(16),%a2 46fe8: 286e 0014 moveal %fp@(20),%a4 Objects_Control *object; Objects_Id next_id; if ( !information ) 46fec: 4a8b tstl %a3 46fee: 6746 beqs 47036 <_Objects_Get_next+0x62> <== NEVER TAKEN return NULL; if ( !location_p ) 46ff0: 4a8a tstl %a2 46ff2: 6742 beqs 47036 <_Objects_Get_next+0x62> <== NEVER TAKEN return NULL; if ( !next_id_p ) 46ff4: 4a8c tstl %a4 46ff6: 673e beqs 47036 <_Objects_Get_next+0x62> <== NEVER TAKEN return NULL; if (_Objects_Get_index(id) == OBJECTS_ID_INITIAL_INDEX) 46ff8: 4a42 tstw %d2 46ffa: 6604 bnes 47000 <_Objects_Get_next+0x2c> <== NEVER TAKEN next_id = information->minimum_id; 46ffc: 242b 0006 movel %a3@(6),%d2 *location_p = OBJECTS_ERROR; goto final; } /* try to grab one */ object = _Objects_Get(information, next_id, location_p); 47000: 4bf9 0004 7044 lea 47044 <_Objects_Get>,%a5 else next_id = id; do { /* walked off end of list? */ if (_Objects_Get_index(next_id) > information->maximum) 47006: 4281 clrl %d1 47008: 4280 clrl %d0 4700a: 322b 000e movew %a3@(14),%d1 4700e: 3002 movew %d2,%d0 47010: b081 cmpl %d1,%d0 47012: 630c blss 47020 <_Objects_Get_next+0x4c> { *location_p = OBJECTS_ERROR; 47014: 7401 moveq #1,%d2 *next_id_p = next_id; return object; final: *next_id_p = OBJECTS_ID_FINAL; 47016: 72ff moveq #-1,%d1 47018: 4280 clrl %d0 do { /* walked off end of list? */ if (_Objects_Get_index(next_id) > information->maximum) { *location_p = OBJECTS_ERROR; 4701a: 2482 movel %d2,%a2@ *next_id_p = next_id; return object; final: *next_id_p = OBJECTS_ID_FINAL; 4701c: 2881 movel %d1,%a4@ return 0; 4701e: 6018 bras 47038 <_Objects_Get_next+0x64> *location_p = OBJECTS_ERROR; goto final; } /* try to grab one */ object = _Objects_Get(information, next_id, location_p); 47020: 2f0a movel %a2,%sp@- 47022: 2f02 movel %d2,%sp@- next_id++; 47024: 5282 addql #1,%d2 *location_p = OBJECTS_ERROR; goto final; } /* try to grab one */ object = _Objects_Get(information, next_id, location_p); 47026: 2f0b movel %a3,%sp@- 47028: 4e95 jsr %a5@ next_id++; } while (*location_p != OBJECTS_LOCAL); 4702a: 4fef 000c lea %sp@(12),%sp 4702e: 4a92 tstl %a2@ 47030: 66d4 bnes 47006 <_Objects_Get_next+0x32> *next_id_p = next_id; 47032: 2882 movel %d2,%a4@ return object; 47034: 6002 bras 47038 <_Objects_Get_next+0x64> final: *next_id_p = OBJECTS_ID_FINAL; return 0; 47036: 4280 clrl %d0 } 47038: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 4703e: 4e5e unlk %fp ... =============================================================================== 0005400c <_Objects_Get_no_protection>: /* * You can't just extract the index portion or you can get tricked * by a value between 1 and maximum. */ index = id - information->minimum_id + 1; 5400c: 7001 moveq #1,%d0 if ( information->maximum >= index ) { 5400e: 4281 clrl %d1 Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 54010: 4e56 0000 linkw %fp,#0 54014: 206e 0008 moveal %fp@(8),%a0 /* * You can't just extract the index portion or you can get tricked * by a value between 1 and maximum. */ index = id - information->minimum_id + 1; 54018: 90a8 0006 subl %a0@(6),%d0 5401c: d0ae 000c addl %fp@(12),%d0 if ( information->maximum >= index ) { 54020: 3228 000e movew %a0@(14),%d1 Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 54024: 226e 0010 moveal %fp@(16),%a1 * You can't just extract the index portion or you can get tricked * by a value between 1 and maximum. */ index = id - information->minimum_id + 1; if ( information->maximum >= index ) { 54028: b081 cmpl %d1,%d0 5402a: 620e bhis 5403a <_Objects_Get_no_protection+0x2e> if ( (the_object = information->local_table[ index ]) != NULL ) { 5402c: 2068 0018 moveal %a0@(24),%a0 54030: 2030 0c00 movel %a0@(00000000,%d0:l:4),%d0 54034: 6704 beqs 5403a <_Objects_Get_no_protection+0x2e><== NEVER TAKEN *location = OBJECTS_LOCAL; 54036: 4291 clrl %a1@ return the_object; 54038: 6006 bras 54040 <_Objects_Get_no_protection+0x34> /* * This isn't supported or required yet for Global objects so * if it isn't local, we don't find it. */ *location = OBJECTS_ERROR; 5403a: 7001 moveq #1,%d0 5403c: 2280 movel %d0,%a1@ 5403e: 4280 clrl %d0 return NULL; } 54040: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00047cc8 <_Objects_Id_to_name>: */ Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { 47cc8: 4e56 fffc linkw %fp,#-4 47ccc: 222e 0008 movel %fp@(8),%d1 47cd0: 2f02 movel %d2,%sp@- /* * Caller is trusted for name != NULL. */ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 47cd2: 4a81 tstl %d1 47cd4: 660a bnes 47ce0 <_Objects_Id_to_name+0x18> 47cd6: 2079 0006 041e moveal 6041e <_Thread_Executing>,%a0 47cdc: 2228 0008 movel %a0@(8),%d1 */ RTEMS_INLINE_ROUTINE Objects_APIs _Objects_Get_API( Objects_Id id ) { return (Objects_APIs) ((id >> OBJECTS_API_START_BIT) & OBJECTS_API_VALID_BITS); 47ce0: 7418 moveq #24,%d2 47ce2: 2001 movel %d1,%d0 47ce4: e4a8 lsrl %d2,%d0 47ce6: 143c 0007 moveb #7,%d2 47cea: c082 andl %d2,%d0 */ RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid( uint32_t the_api ) { if ( !the_api || the_api > OBJECTS_APIS_LAST ) 47cec: 143c 0003 moveb #3,%d2 47cf0: 2040 moveal %d0,%a0 47cf2: 5388 subql #1,%a0 47cf4: b488 cmpl %a0,%d2 47cf6: 6540 bcss 47d38 <_Objects_Id_to_name+0x70> 47cf8: 6048 bras 47d42 <_Objects_Id_to_name+0x7a> if ( !_Objects_Information_table[ the_api ] ) return OBJECTS_INVALID_ID; the_class = _Objects_Get_class( tmpId ); information = _Objects_Information_table[ the_api ][ the_class ]; 47cfa: 2001 movel %d1,%d0 47cfc: 741b moveq #27,%d2 47cfe: e4a8 lsrl %d2,%d0 47d00: 2070 0c00 moveal %a0@(00000000,%d0:l:4),%a0 if ( !information ) 47d04: 4a88 tstl %a0 47d06: 6730 beqs 47d38 <_Objects_Id_to_name+0x70> <== NEVER TAKEN return OBJECTS_INVALID_ID; #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) 47d08: 4a28 0032 tstb %a0@(50) 47d0c: 662a bnes 47d38 <_Objects_Id_to_name+0x70> <== NEVER TAKEN return OBJECTS_INVALID_ID; #endif the_object = _Objects_Get( information, tmpId, &ignored_location ); 47d0e: 486e fffc pea %fp@(-4) 47d12: 2f01 movel %d1,%sp@- 47d14: 2f08 movel %a0,%sp@- 47d16: 4eb9 0004 7c68 jsr 47c68 <_Objects_Get> if ( !the_object ) 47d1c: 4fef 000c lea %sp@(12),%sp 47d20: 4a80 tstl %d0 47d22: 6714 beqs 47d38 <_Objects_Id_to_name+0x70> return OBJECTS_INVALID_ID; *name = the_object->name; 47d24: 206e 000c moveal %fp@(12),%a0 47d28: 2240 moveal %d0,%a1 47d2a: 20a9 000c movel %a1@(12),%a0@ _Thread_Enable_dispatch(); 47d2e: 4eb9 0004 8566 jsr 48566 <_Thread_Enable_dispatch> 47d34: 4280 clrl %d0 return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; 47d36: 6002 bras 47d3a <_Objects_Id_to_name+0x72> 47d38: 7003 moveq #3,%d0 } 47d3a: 242e fff8 movel %fp@(-8),%d2 47d3e: 4e5e unlk %fp 47d40: 4e75 rts the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; if ( !_Objects_Information_table[ the_api ] ) 47d42: 41f9 0006 031c lea 6031c <_Objects_Information_table>,%a0 47d48: 2070 0c00 moveal %a0@(00000000,%d0:l:4),%a0 47d4c: 4a88 tstl %a0 47d4e: 66aa bnes 47cfa <_Objects_Id_to_name+0x32> 47d50: 60e6 bras 47d38 <_Objects_Id_to_name+0x70> ... =============================================================================== 000473a8 <_Objects_Set_name>: { size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 473a8: 4280 clrl %d0 bool _Objects_Set_name( Objects_Information *information, Objects_Control *the_object, const char *name ) { 473aa: 4e56 ffe0 linkw %fp,#-32 473ae: 48d7 3c3c moveml %d2-%d5/%a2-%a5,%sp@ 473b2: 2a6e 0008 moveal %fp@(8),%a5 size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 473b6: 302d 0034 movew %a5@(52),%d0 bool _Objects_Set_name( Objects_Information *information, Objects_Control *the_object, const char *name ) { 473ba: 246e 0010 moveal %fp@(16),%a2 size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 473be: 2f00 movel %d0,%sp@- bool _Objects_Set_name( Objects_Information *information, Objects_Control *the_object, const char *name ) { 473c0: 286e 000c moveal %fp@(12),%a4 size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 473c4: 2f0a movel %a2,%sp@- 473c6: 4eb9 0004 fd3c jsr 4fd3c #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) { 473cc: 508f addql #8,%sp { size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 473ce: 2640 moveal %d0,%a3 #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) { 473d0: 4a2d 0032 tstb %a5@(50) 473d4: 6748 beqs 4741e <_Objects_Set_name+0x76> <== NEVER TAKEN char *d; d = _Workspace_Allocate( length + 1 ); 473d6: 486b 0001 pea %a3@(1) 473da: 4eb9 0004 8cac jsr 48cac <_Workspace_Allocate> if ( !d ) 473e0: 588f addql #4,%sp #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) { char *d; d = _Workspace_Allocate( length + 1 ); 473e2: 2a40 moveal %d0,%a5 if ( !d ) 473e4: 4a80 tstl %d0 473e6: 6604 bnes 473ec <_Objects_Set_name+0x44> <== ALWAYS TAKEN 473e8: 4200 clrb %d0 <== NOT EXECUTED 473ea: 6076 bras 47462 <_Objects_Set_name+0xba> <== NOT EXECUTED return false; if ( the_object->name.name_p ) { 473ec: 202c 000c movel %a4@(12),%d0 473f0: 670e beqs 47400 <_Objects_Set_name+0x58> <== NEVER TAKEN _Workspace_Free( (void *)the_object->name.name_p ); 473f2: 2f00 movel %d0,%sp@- 473f4: 4eb9 0004 8cc8 jsr 48cc8 <_Workspace_Free> the_object->name.name_p = NULL; 473fa: 588f addql #4,%sp 473fc: 42ac 000c clrl %a4@(12) } strncpy( d, name, length ); 47400: 2f0b movel %a3,%sp@- 47402: 2f0a movel %a2,%sp@- 47404: 2f0d movel %a5,%sp@- 47406: 4eb9 0004 fcb4 jsr 4fcb4 d[length] = '\0'; the_object->name.name_p = d; 4740c: 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'; 47410: 4200 clrb %d0 47412: 1b80 b800 moveb %d0,%a5@(00000000,%a3:l) the_object->name.name_p = d; 47416: 7001 moveq #1,%d0 47418: 294d 000c movel %a5,%a4@(12) 4741c: 6044 bras 47462 <_Objects_Set_name+0xba> } else #endif { the_object->name.name_u32 = _Objects_Build_name( 4741e: 7201 moveq #1,%d1 47420: 1012 moveb %a2@,%d0 47422: b28b cmpl %a3,%d1 47424: 6446 bccs 4746c <_Objects_Set_name+0xc4> 47426: 7602 moveq #2,%d3 47428: 142a 0001 moveb %a2@(1),%d2 4742c: 49c2 extbl %d2 4742e: 4842 swap %d2 47430: 4242 clrw %d2 47432: b68b cmpl %a3,%d3 47434: 643a bccs 47470 <_Objects_Set_name+0xc8> 47436: 7a03 moveq #3,%d5 47438: 122a 0002 moveb %a2@(2),%d1 4743c: 49c1 extbl %d1 4743e: e189 lsll #8,%d1 47440: ba8b cmpl %a3,%d5 47442: 6506 bcss 4744a <_Objects_Set_name+0xa2> 47444: 163c 0020 moveb #32,%d3 47448: 6006 bras 47450 <_Objects_Set_name+0xa8> 4744a: 162a 0003 moveb %a2@(3),%d3 4744e: 49c3 extbl %d3 47450: 2800 movel %d0,%d4 47452: 7a18 moveq #24,%d5 47454: ebac lsll %d5,%d4 47456: 7001 moveq #1,%d0 47458: 8484 orl %d4,%d2 4745a: 8481 orl %d1,%d2 4745c: 8483 orl %d3,%d2 4745e: 2942 000c movel %d2,%a4@(12) ); } return true; } 47462: 4cee 3c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a5 47468: 4e5e unlk %fp 4746a: 4e75 rts d[length] = '\0'; the_object->name.name_p = d; } else #endif { the_object->name.name_u32 = _Objects_Build_name( 4746c: 7420 moveq #32,%d2 4746e: 4842 swap %d2 47470: 223c 0000 2000 movel #8192,%d1 47476: 7620 moveq #32,%d3 47478: 60d6 bras 47450 <_Objects_Set_name+0xa8> ... =============================================================================== 0004644c <_POSIX_Condition_variables_Wait_support>: pthread_cond_t *cond, pthread_mutex_t *mutex, Watchdog_Interval timeout, bool already_timedout ) { 4644c: 4e56 ffe4 linkw %fp,#-28 46450: 48d7 3c0c moveml %d2-%d3/%a2-%a5,%sp@ register POSIX_Condition_variables_Control *the_cond; Objects_Locations location; int status; int mutex_status; if ( !_POSIX_Mutex_Get( mutex, &location ) ) { 46454: 240e movel %fp,%d2 46456: 5982 subql #4,%d2 pthread_cond_t *cond, pthread_mutex_t *mutex, Watchdog_Interval timeout, bool already_timedout ) { 46458: 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 ) ) { 4645c: 2f02 movel %d2,%sp@- pthread_cond_t *cond, pthread_mutex_t *mutex, Watchdog_Interval timeout, bool already_timedout ) { 4645e: 2a6e 0008 moveal %fp@(8),%a5 register POSIX_Condition_variables_Control *the_cond; Objects_Locations location; int status; int mutex_status; if ( !_POSIX_Mutex_Get( mutex, &location ) ) { 46462: 2f0a movel %a2,%sp@- pthread_cond_t *cond, pthread_mutex_t *mutex, Watchdog_Interval timeout, bool already_timedout ) { 46464: 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 ) ) { 46468: 4eb9 0004 65fe jsr 465fe <_POSIX_Mutex_Get> 4646e: 508f addql #8,%sp 46470: 4a80 tstl %d0 46472: 6700 00ae beqw 46522 <_POSIX_Condition_variables_Wait_support+0xd6> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 46476: 2039 0006 146c movel 6146c <_Thread_Dispatch_disable_level>,%d0 4647c: 5380 subql #1,%d0 return EINVAL; } _Thread_Unnest_dispatch(); the_cond = _POSIX_Condition_variables_Get( cond, &location ); 4647e: 2f02 movel %d2,%sp@- 46480: 23c0 0006 146c movel %d0,6146c <_Thread_Dispatch_disable_level> 46486: 2f0d movel %a5,%sp@- 46488: 4eb9 0004 627c jsr 4627c <_POSIX_Condition_variables_Get> switch ( location ) { 4648e: 508f addql #8,%sp return EINVAL; } _Thread_Unnest_dispatch(); the_cond = _POSIX_Condition_variables_Get( cond, &location ); 46490: 2640 moveal %d0,%a3 switch ( location ) { 46492: 4aae fffc tstl %fp@(-4) 46496: 6600 008a bnew 46522 <_POSIX_Condition_variables_Wait_support+0xd6> case OBJECTS_LOCAL: if ( the_cond->Mutex && ( the_cond->Mutex != *mutex ) ) { 4649a: 202b 0014 movel %a3@(20),%d0 4649e: 670c beqs 464ac <_POSIX_Condition_variables_Wait_support+0x60> 464a0: b092 cmpl %a2@,%d0 464a2: 6708 beqs 464ac <_POSIX_Condition_variables_Wait_support+0x60> _Thread_Enable_dispatch(); 464a4: 4eb9 0004 930a jsr 4930a <_Thread_Enable_dispatch> 464aa: 6076 bras 46522 <_POSIX_Condition_variables_Wait_support+0xd6> return EINVAL; } (void) pthread_mutex_unlock( mutex ); 464ac: 2f0a movel %a2,%sp@- 464ae: 49f9 0004 930a lea 4930a <_Thread_Enable_dispatch>,%a4 464b4: 4eb9 0004 6804 jsr 46804 _Thread_Enable_dispatch(); return EINVAL; } */ if ( !already_timedout ) { 464ba: 588f addql #4,%sp 464bc: 4a03 tstb %d3 464be: 6650 bnes 46510 <_POSIX_Condition_variables_Wait_support+0xc4> the_cond->Mutex = *mutex; 464c0: 2752 0014 movel %a2@,%a3@(20) _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); _Thread_Executing->Wait.return_code = 0; _Thread_Executing->Wait.queue = &the_cond->Wait_queue; 464c4: 200b movel %a3,%d0 464c6: 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; 464cc: 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; 464ce: 2079 0006 1526 moveal 61526 <_Thread_Executing>,%a0 464d4: 42a8 0034 clrl %a0@(52) _Thread_Executing->Wait.queue = &the_cond->Wait_queue; _Thread_Executing->Wait.id = *cond; 464d8: 2155 0020 movel %a5@,%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; 464dc: 2140 0044 movel %d0,%a0@(68) 464e0: 2741 0048 movel %d1,%a3@(72) _Thread_Executing->Wait.id = *cond; _Thread_queue_Enqueue( &the_cond->Wait_queue, timeout ); 464e4: 4879 0004 9ae8 pea 49ae8 <_Thread_queue_Timeout> 464ea: 2f2e 0010 movel %fp@(16),%sp@- 464ee: 2f00 movel %d0,%sp@- 464f0: 4eb9 0004 97a4 jsr 497a4 <_Thread_queue_Enqueue_with_handler> _Thread_Enable_dispatch(); 464f6: 4e94 jsr %a4@ /* * Switch ourself out because we blocked as a result of the * _Thread_queue_Enqueue. */ status = _Thread_Executing->Wait.return_code; 464f8: 2079 0006 1526 moveal 61526 <_Thread_Executing>,%a0 if ( status && status != ETIMEDOUT ) 464fe: 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; 46502: 2428 0034 movel %a0@(52),%d2 if ( status && status != ETIMEDOUT ) 46506: 670c beqs 46514 <_POSIX_Condition_variables_Wait_support+0xc8> 46508: 7074 moveq #116,%d0 4650a: b082 cmpl %d2,%d0 4650c: 6616 bnes 46524 <_POSIX_Condition_variables_Wait_support+0xd8><== NEVER TAKEN 4650e: 6004 bras 46514 <_POSIX_Condition_variables_Wait_support+0xc8> return status; } else { _Thread_Enable_dispatch(); 46510: 4e94 jsr %a4@ 46512: 7474 moveq #116,%d2 /* * When we get here the dispatch disable level is 0. */ mutex_status = pthread_mutex_lock( mutex ); 46514: 2f0a movel %a2,%sp@- 46516: 4eb9 0004 676c jsr 4676c if ( mutex_status ) 4651c: 588f addql #4,%sp 4651e: 4a80 tstl %d0 46520: 6702 beqs 46524 <_POSIX_Condition_variables_Wait_support+0xd8> 46522: 7416 moveq #22,%d2 case OBJECTS_ERROR: break; } return EINVAL; } 46524: 2002 movel %d2,%d0 46526: 4cee 3c0c ffe4 moveml %fp@(-28),%d2-%d3/%a2-%a5 4652c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004d5a8 <_POSIX_Keys_Run_destructors>: */ RTEMS_INLINE_ROUTINE Objects_APIs _Objects_Get_API( Objects_Id id ) { return (Objects_APIs) ((id >> OBJECTS_API_START_BIT) & OBJECTS_API_VALID_BITS); 4d5a8: 7218 moveq #24,%d1 */ void _POSIX_Keys_Run_destructors( Thread_Control *thread ) { 4d5aa: 4e56 ffe8 linkw %fp,#-24 4d5ae: 206e 0008 moveal %fp@(8),%a0 4d5b2: 48d7 047c moveml %d2-%d6/%a2,%sp@ Objects_Maximum thread_index = _Objects_Get_index( thread->Object.id ); 4d5b6: 2428 0008 movel %a0@(8),%d2 4d5ba: 2002 movel %d2,%d0 4d5bc: e2a8 lsrl %d1,%d0 4d5be: 123c 0007 moveb #7,%d1 for ( index = 1 ; index <= max ; ++index ) { POSIX_Keys_Control *key = (POSIX_Keys_Control *) _POSIX_Keys_Information.local_table [ index ]; if ( key != NULL && key->destructor != NULL ) { void *value = key->Values [ thread_api ][ thread_index ]; 4d5c2: 0282 0000 ffff andil #65535,%d2 4d5c8: c081 andl %d1,%d0 4d5ca: e58a lsll #2,%d2 4d5cc: 2a00 movel %d0,%d5 4d5ce: 5a85 addql #5,%d5 Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; done = true; for ( index = 1 ; index <= max ; ++index ) { 4d5d0: 4286 clrl %d6 * * Reference: 17.1.1.2 P1003.1c/Draft 10, p. 163, line 99. */ while ( !done ) { Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; 4d5d2: 7601 moveq #1,%d3 4d5d4: 7201 moveq #1,%d1 done = true; for ( index = 1 ; index <= max ; ++index ) { 4d5d6: 3c39 0005 f2de movew 5f2de <_POSIX_Keys_Information+0xe>,%d6 4d5dc: 6030 bras 4d60e <_POSIX_Keys_Run_destructors+0x66> POSIX_Keys_Control *key = (POSIX_Keys_Control *) _POSIX_Keys_Information.local_table [ index ]; 4d5de: 2079 0005 f2e8 moveal 5f2e8 <_POSIX_Keys_Information+0x18>,%a0 Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; done = true; for ( index = 1 ; index <= max ; ++index ) { 4d5e4: 5283 addql #1,%d3 POSIX_Keys_Control *key = (POSIX_Keys_Control *) _POSIX_Keys_Information.local_table [ index ]; 4d5e6: 2070 4c00 moveal %a0@(00000000,%d4:l:4),%a0 if ( key != NULL && key->destructor != NULL ) { 4d5ea: 4a88 tstl %a0 4d5ec: 6720 beqs 4d60e <_POSIX_Keys_Run_destructors+0x66> 4d5ee: 4aa8 0010 tstl %a0@(16) 4d5f2: 671a beqs 4d60e <_POSIX_Keys_Run_destructors+0x66> void *value = key->Values [ thread_api ][ thread_index ]; 4d5f4: 2470 5c00 moveal %a0@(00000000,%d5:l:4),%a2 4d5f8: d5c2 addal %d2,%a2 4d5fa: 2252 moveal %a2@,%a1 if ( value != NULL ) { 4d5fc: 4a89 tstl %a1 4d5fe: 670e beqs 4d60e <_POSIX_Keys_Run_destructors+0x66> key->Values [ thread_api ][ thread_index ] = NULL; 4d600: 4292 clrl %a2@ (*key->destructor)( value ); 4d602: 2f09 movel %a1,%sp@- 4d604: 2068 0010 moveal %a0@(16),%a0 4d608: 4e90 jsr %a0@ 4d60a: 588f addql #4,%sp 4d60c: 4201 clrb %d1 Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; done = true; for ( index = 1 ; index <= max ; ++index ) { 4d60e: 4284 clrl %d4 4d610: 3803 movew %d3,%d4 4d612: bc84 cmpl %d4,%d6 4d614: 64c8 bccs 4d5de <_POSIX_Keys_Run_destructors+0x36> * number of iterations. An infinite loop may happen if destructors set * thread specific data. This can be considered dubious. * * Reference: 17.1.1.2 P1003.1c/Draft 10, p. 163, line 99. */ while ( !done ) { 4d616: 4a01 tstb %d1 4d618: 67b6 beqs 4d5d0 <_POSIX_Keys_Run_destructors+0x28><== NEVER TAKEN done = false; } } } } } 4d61a: 4cee 047c ffe8 moveml %fp@(-24),%d2-%d6/%a2 4d620: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000507c8 <_POSIX_Message_queue_Name_to_id>: */ int _POSIX_Message_queue_Name_to_id( const char *name, Objects_Id *id ) { 507c8: 4e56 fffc linkw %fp,#-4 507cc: 2f0a movel %a2,%sp@- 507ce: 246e 0008 moveal %fp@(8),%a2 Objects_Name_or_id_lookup_errors status; Objects_Id the_id; if ( !name ) 507d2: 4a8a tstl %a2 507d4: 6748 beqs 5081e <_POSIX_Message_queue_Name_to_id+0x56><== NEVER TAKEN return EINVAL; if ( !name[0] ) 507d6: 4a12 tstb %a2@ 507d8: 6744 beqs 5081e <_POSIX_Message_queue_Name_to_id+0x56><== NEVER TAKEN return EINVAL; if ( strnlen( name, NAME_MAX ) >= NAME_MAX ) 507da: 4878 00ff pea ff 507de: 2f0a movel %a2,%sp@- 507e0: 4eb9 0005 5bac jsr 55bac 507e6: 508f addql #8,%sp 507e8: 0c80 0000 00fe cmpil #254,%d0 507ee: 6304 blss 507f4 <_POSIX_Message_queue_Name_to_id+0x2c> 507f0: 705b moveq #91,%d0 507f2: 602c bras 50820 <_POSIX_Message_queue_Name_to_id+0x58> return ENAMETOOLONG; status = _Objects_Name_to_id_string( 507f4: 486e fffc pea %fp@(-4) 507f8: 2f0a movel %a2,%sp@- 507fa: 4879 0006 7126 pea 67126 <_POSIX_Message_queue_Information> 50800: 4eb9 0005 1bc0 jsr 51bc0 <_Objects_Name_to_id_string> &_POSIX_Message_queue_Information, name, &the_id ); *id = the_id; 50806: 206e 000c moveal %fp@(12),%a0 if ( status == OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL ) 5080a: 4fef 000c lea %sp@(12),%sp status = _Objects_Name_to_id_string( &_POSIX_Message_queue_Information, name, &the_id ); *id = the_id; 5080e: 20ae fffc movel %fp@(-4),%a0@ if ( status == OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL ) 50812: 4a80 tstl %d0 50814: 6704 beqs 5081a <_POSIX_Message_queue_Name_to_id+0x52> 50816: 7002 moveq #2,%d0 50818: 6006 bras 50820 <_POSIX_Message_queue_Name_to_id+0x58> 5081a: 4280 clrl %d0 5081c: 6002 bras 50820 <_POSIX_Message_queue_Name_to_id+0x58> 5081e: 7016 moveq #22,%d0 return 0; return ENOENT; } 50820: 246e fff8 moveal %fp@(-8),%a2 50824: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00049c98 <_POSIX_Message_queue_Receive_support>: size_t msg_len, unsigned int *msg_prio, bool wait, Watchdog_Interval timeout ) { 49c98: 4e56 ffe4 linkw %fp,#-28 49c9c: 48d7 043c moveml %d2-%d5/%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( 49ca0: 486e fffc pea %fp@(-4) 49ca4: 242e 0008 movel %fp@(8),%d2 49ca8: 2f02 movel %d2,%sp@- 49caa: 4879 0006 7294 pea 67294 <_POSIX_Message_queue_Information_fds> 49cb0: 246e 0014 moveal %fp@(20),%a2 49cb4: 262e 0018 movel %fp@(24),%d3 49cb8: 4eb9 0004 c9f0 jsr 4c9f0 <_Objects_Get> Objects_Locations location; size_t length_out; bool do_wait; the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); switch ( location ) { 49cbe: 4fef 000c lea %sp@(12),%sp 49cc2: 4aae fffc tstl %fp@(-4) 49cc6: 6600 00c4 bnew 49d8c <_POSIX_Message_queue_Receive_support+0xf4> case OBJECTS_LOCAL: if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) { 49cca: 2040 moveal %d0,%a0 49ccc: 7803 moveq #3,%d4 49cce: 7a01 moveq #1,%d5 49cd0: 2228 0014 movel %a0@(20),%d1 49cd4: c881 andl %d1,%d4 49cd6: ba84 cmpl %d4,%d5 49cd8: 660a bnes 49ce4 <_POSIX_Message_queue_Receive_support+0x4c> _Thread_Enable_dispatch(); 49cda: 4eb9 0004 d242 jsr 4d242 <_Thread_Enable_dispatch> 49ce0: 6000 00aa braw 49d8c <_POSIX_Message_queue_Receive_support+0xf4> rtems_set_errno_and_return_minus_one( EBADF ); } the_mq = the_mq_fd->Queue; 49ce4: 2240 moveal %d0,%a1 49ce6: 2069 0010 moveal %a1@(16),%a0 if ( msg_len < the_mq->Message_queue.maximum_message_size ) { 49cea: 2028 0066 movel %a0@(102),%d0 49cee: b0ae 0010 cmpl %fp@(16),%d0 49cf2: 6318 blss 49d0c <_POSIX_Message_queue_Receive_support+0x74> _Thread_Enable_dispatch(); 49cf4: 4eb9 0004 d242 jsr 4d242 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EMSGSIZE ); 49cfa: 747a moveq #122,%d2 49cfc: 4eb9 0005 3fe0 jsr 53fe0 <__errno> 49d02: 72ff moveq #-1,%d1 49d04: 2040 moveal %d0,%a0 49d06: 2082 movel %d2,%a0@ 49d08: 6000 0090 braw 49d9a <_POSIX_Message_queue_Receive_support+0x102> length_out = -1; /* * A timed receive with a bad time will do a poll regardless. */ if ( wait ) 49d0c: 4a03 tstb %d3 49d0e: 6604 bnes 49d14 <_POSIX_Message_queue_Receive_support+0x7c><== ALWAYS TAKEN 49d10: 4200 clrb %d0 <== NOT EXECUTED 49d12: 600c bras 49d20 <_POSIX_Message_queue_Receive_support+0x88><== NOT EXECUTED do_wait = (the_mq_fd->oflag & O_NONBLOCK) ? false : true; 49d14: 2001 movel %d1,%d0 49d16: 760e moveq #14,%d3 49d18: 7a01 moveq #1,%d5 49d1a: e6a8 lsrl %d3,%d0 49d1c: bb80 eorl %d5,%d0 49d1e: c085 andl %d5,%d0 do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 49d20: 2f2e 001c movel %fp@(28),%sp@- 49d24: 7201 moveq #1,%d1 /* * Now if something goes wrong, we return a "length" of -1 * to indicate an error. */ length_out = -1; 49d26: 76ff moveq #-1,%d3 do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 49d28: c280 andl %d0,%d1 /* * Now if something goes wrong, we return a "length" of -1 * to indicate an error. */ length_out = -1; 49d2a: 2d43 fff8 movel %d3,%fp@(-8) do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 49d2e: 2f01 movel %d1,%sp@- 49d30: 486e fff8 pea %fp@(-8) 49d34: 2f2e 000c movel %fp@(12),%sp@- 49d38: 2f02 movel %d2,%sp@- 49d3a: 4868 001a pea %a0@(26) 49d3e: 4eb9 0004 bb38 jsr 4bb38 <_CORE_message_queue_Seize> &length_out, do_wait, timeout ); _Thread_Enable_dispatch(); 49d44: 4eb9 0004 d242 jsr 4d242 <_Thread_Enable_dispatch> *msg_prio = _POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count); 49d4a: 2079 0006 6f12 moveal 66f12 <_Thread_Executing>,%a0 do_wait, timeout ); _Thread_Enable_dispatch(); *msg_prio = 49d50: 24a8 0024 movel %a0@(36),%a2@ 49d54: 6c06 bges 49d5c <_POSIX_Message_queue_Receive_support+0xc4> 49d56: 2a12 movel %a2@,%d5 49d58: 4485 negl %d5 49d5a: 2485 movel %d5,%a2@ _POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count); if ( !_Thread_Executing->Wait.return_code ) 49d5c: 4fef 0018 lea %sp@(24),%sp 49d60: 4aa8 0034 tstl %a0@(52) 49d64: 6606 bnes 49d6c <_POSIX_Message_queue_Receive_support+0xd4> return length_out; 49d66: 222e fff8 movel %fp@(-8),%d1 49d6a: 602e bras 49d9a <_POSIX_Message_queue_Receive_support+0x102> rtems_set_errno_and_return_minus_one( 49d6c: 4eb9 0005 3fe0 jsr 53fe0 <__errno> 49d72: 2079 0006 6f12 moveal 66f12 <_Thread_Executing>,%a0 49d78: 2440 moveal %d0,%a2 49d7a: 2f28 0034 movel %a0@(52),%sp@- 49d7e: 4eb9 0004 9fc4 jsr 49fc4 <_POSIX_Message_queue_Translate_core_message_queue_return_code> 49d84: 588f addql #4,%sp 49d86: 72ff moveq #-1,%d1 49d88: 2480 movel %d0,%a2@ 49d8a: 600e bras 49d9a <_POSIX_Message_queue_Receive_support+0x102> #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); 49d8c: 4eb9 0005 3fe0 jsr 53fe0 <__errno> 49d92: 72ff moveq #-1,%d1 49d94: 2040 moveal %d0,%a0 49d96: 7009 moveq #9,%d0 49d98: 2080 movel %d0,%a0@ } 49d9a: 2001 movel %d1,%d0 49d9c: 4cee 043c ffe4 moveml %fp@(-28),%d2-%d5/%a2 49da2: 4e5e unlk %fp ... =============================================================================== 0004aba4 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch>: #include void _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch( Thread_Control *the_thread ) { 4aba4: 4e56 0000 linkw %fp,#0 4aba8: 226e 0008 moveal %fp@(8),%a1 POSIX_API_Control *thread_support; thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4abac: 2069 010e moveal %a1@(270),%a0 if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 4abb0: 4aa8 00d4 tstl %a0@(212) 4abb4: 662e bnes 4abe4 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x40><== NEVER TAKEN thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS && 4abb6: 7001 moveq #1,%d0 4abb8: b0a8 00d8 cmpl %a0@(216),%d0 4abbc: 6626 bnes 4abe4 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x40> thread_support->cancelation_requested ) { 4abbe: 4aa8 00dc tstl %a0@(220) 4abc2: 6720 beqs 4abe4 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x40> _Thread_Unnest_dispatch(); _POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED ); 4abc4: 4878 ffff pea ffffffff */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 4abc8: 2039 0005 f5c0 movel 5f5c0 <_Thread_Dispatch_disable_level>,%d0 4abce: 5380 subql #1,%d0 4abd0: 2f09 movel %a1,%sp@- 4abd2: 23c0 0005 f5c0 movel %d0,5f5c0 <_Thread_Dispatch_disable_level> 4abd8: 4eb9 0004 b1f0 jsr 4b1f0 <_POSIX_Thread_Exit> { POSIX_API_Control *thread_support; thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 4abde: 508f addql #8,%sp _Thread_Unnest_dispatch(); _POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED ); } else _Thread_Enable_dispatch(); } 4abe0: 4e5e unlk %fp 4abe2: 4e75 rts 4abe4: 4e5e unlk %fp thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS && thread_support->cancelation_requested ) { _Thread_Unnest_dispatch(); _POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED ); } else _Thread_Enable_dispatch(); 4abe6: 4ef9 0004 79de jmp 479de <_Thread_Enable_dispatch> =============================================================================== 0004bc58 <_POSIX_Thread_Translate_sched_param>: int policy, struct sched_param *param, Thread_CPU_budget_algorithms *budget_algorithm, Thread_CPU_budget_algorithm_callout *budget_callout ) { 4bc58: 4e56 ffec linkw %fp,#-20 4bc5c: 48d7 3c04 moveml %d2/%a2-%a5,%sp@ 4bc60: 246e 000c moveal %fp@(12),%a2 if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) 4bc64: 2f12 movel %a2@,%sp@- int policy, struct sched_param *param, Thread_CPU_budget_algorithms *budget_algorithm, Thread_CPU_budget_algorithm_callout *budget_callout ) { 4bc66: 242e 0008 movel %fp@(8),%d2 4bc6a: 266e 0010 moveal %fp@(16),%a3 4bc6e: 286e 0014 moveal %fp@(20),%a4 if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) 4bc72: 4eb9 0004 bc34 jsr 4bc34 <_POSIX_Priority_Is_valid> 4bc78: 588f addql #4,%sp 4bc7a: 4a00 tstb %d0 4bc7c: 677c beqs 4bcfa <_POSIX_Thread_Translate_sched_param+0xa2><== NEVER TAKEN return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 4bc7e: 4293 clrl %a3@ *budget_callout = NULL; 4bc80: 4294 clrl %a4@ if ( policy == SCHED_OTHER ) { 4bc82: 4a82 tstl %d2 4bc84: 6608 bnes 4bc8e <_POSIX_Thread_Translate_sched_param+0x36> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 4bc86: 7201 moveq #1,%d1 4bc88: 4280 clrl %d0 4bc8a: 2681 movel %d1,%a3@ return 0; 4bc8c: 606e bras 4bcfc <_POSIX_Thread_Translate_sched_param+0xa4> } if ( policy == SCHED_FIFO ) { 4bc8e: 7001 moveq #1,%d0 4bc90: b082 cmpl %d2,%d0 4bc92: 6604 bnes 4bc98 <_POSIX_Thread_Translate_sched_param+0x40> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 4bc94: 4293 clrl %a3@ 4bc96: 6008 bras 4bca0 <_POSIX_Thread_Translate_sched_param+0x48> return 0; } if ( policy == SCHED_RR ) { 4bc98: 7002 moveq #2,%d0 4bc9a: b082 cmpl %d2,%d0 4bc9c: 6606 bnes 4bca4 <_POSIX_Thread_Translate_sched_param+0x4c> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; 4bc9e: 2680 movel %d0,%a3@ 4bca0: 4200 clrb %d0 return 0; 4bca2: 6058 bras 4bcfc <_POSIX_Thread_Translate_sched_param+0xa4> } if ( policy == SCHED_SPORADIC ) { 4bca4: 7004 moveq #4,%d0 4bca6: b082 cmpl %d2,%d0 4bca8: 6650 bnes 4bcfa <_POSIX_Thread_Translate_sched_param+0xa2> if ( (param->sched_ss_repl_period.tv_sec == 0) && 4bcaa: 4aaa 0008 tstl %a2@(8) 4bcae: 6606 bnes 4bcb6 <_POSIX_Thread_Translate_sched_param+0x5e> (param->sched_ss_repl_period.tv_nsec == 0) ) 4bcb0: 4aaa 000c tstl %a2@(12) 4bcb4: 6744 beqs 4bcfa <_POSIX_Thread_Translate_sched_param+0xa2> return EINVAL; if ( (param->sched_ss_init_budget.tv_sec == 0) && 4bcb6: 4aaa 0010 tstl %a2@(16) 4bcba: 6606 bnes 4bcc2 <_POSIX_Thread_Translate_sched_param+0x6a> (param->sched_ss_init_budget.tv_nsec == 0) ) 4bcbc: 4aaa 0014 tstl %a2@(20) 4bcc0: 6738 beqs 4bcfa <_POSIX_Thread_Translate_sched_param+0xa2> return EINVAL; if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) < 4bcc2: 486a 0008 pea %a2@(8) 4bcc6: 4bf9 0004 92ac lea 492ac <_Timespec_To_ticks>,%a5 4bccc: 4e95 jsr %a5@ 4bcce: 486a 0010 pea %a2@(16) 4bcd2: 2400 movel %d0,%d2 4bcd4: 4e95 jsr %a5@ 4bcd6: 508f addql #8,%sp 4bcd8: b082 cmpl %d2,%d0 4bcda: 621e bhis 4bcfa <_POSIX_Thread_Translate_sched_param+0xa2> _Timespec_To_ticks( ¶m->sched_ss_init_budget ) ) return EINVAL; if ( !_POSIX_Priority_Is_valid( param->sched_ss_low_priority ) ) 4bcdc: 2f2a 0004 movel %a2@(4),%sp@- 4bce0: 4eb9 0004 bc34 jsr 4bc34 <_POSIX_Priority_Is_valid> 4bce6: 588f addql #4,%sp 4bce8: 4a00 tstb %d0 4bcea: 670e beqs 4bcfa <_POSIX_Thread_Translate_sched_param+0xa2> return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; 4bcec: 7003 moveq #3,%d0 *budget_callout = _POSIX_Threads_Sporadic_budget_callout; 4bcee: 28bc 0004 5df8 movel #286200,%a4@ return EINVAL; if ( !_POSIX_Priority_Is_valid( param->sched_ss_low_priority ) ) return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; 4bcf4: 2680 movel %d0,%a3@ *budget_callout = _POSIX_Threads_Sporadic_budget_callout; 4bcf6: 4280 clrl %d0 return 0; 4bcf8: 6002 bras 4bcfc <_POSIX_Thread_Translate_sched_param+0xa4> 4bcfa: 7016 moveq #22,%d0 } return EINVAL; } 4bcfc: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 4bd02: 4e5e unlk %fp ... =============================================================================== 00045b5c <_POSIX_Threads_Initialize_user_threads_body>: * * Output parameters: NONE */ void _POSIX_Threads_Initialize_user_threads_body(void) { 45b5c: 4e56 ff9c linkw %fp,#-100 45b60: 48d7 3c7c moveml %d2-%d6/%a2-%a5,%sp@ uint32_t maximum; posix_initialization_threads_table *user_threads; pthread_t thread_id; pthread_attr_t attr; user_threads = Configuration_POSIX_API.User_initialization_threads_table; 45b64: 2479 0005 e79e moveal 5e79e ,%a2 maximum = Configuration_POSIX_API.number_of_initialization_threads; 45b6a: 2839 0005 e79a movel 5e79a ,%d4 if ( !user_threads || maximum == 0 ) 45b70: 4a8a tstl %a2 45b72: 676a beqs 45bde <_POSIX_Threads_Initialize_user_threads_body+0x82><== NEVER TAKEN 45b74: 4a84 tstl %d4 45b76: 6766 beqs 45bde <_POSIX_Threads_Initialize_user_threads_body+0x82><== NEVER TAKEN for ( index=0 ; index < maximum ; index++ ) { /* * There is no way for these calls to fail in this situation. */ (void) pthread_attr_init( &attr ); 45b78: 240e movel %fp,%d2 (void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); (void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size); status = pthread_create( 45b7a: 2a0e movel %fp,%d5 pthread_attr_t attr; user_threads = Configuration_POSIX_API.User_initialization_threads_table; maximum = Configuration_POSIX_API.number_of_initialization_threads; if ( !user_threads || maximum == 0 ) 45b7c: 4283 clrl %d3 for ( index=0 ; index < maximum ; index++ ) { /* * There is no way for these calls to fail in this situation. */ (void) pthread_attr_init( &attr ); 45b7e: 0682 ffff ffc0 addil #-64,%d2 45b84: 2c3c 0004 bd08 movel #310536,%d6 (void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); 45b8a: 4bf9 0004 bd34 lea 4bd34 ,%a5 (void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size); 45b90: 49f9 0004 bd6c lea 4bd6c ,%a4 status = pthread_create( 45b96: 5985 subql #4,%d5 45b98: 47f9 0004 58b4 lea 458b4 ,%a3 for ( index=0 ; index < maximum ; index++ ) { /* * There is no way for these calls to fail in this situation. */ (void) pthread_attr_init( &attr ); 45b9e: 2f02 movel %d2,%sp@- 45ba0: 2046 moveal %d6,%a0 45ba2: 4e90 jsr %a0@ (void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); 45ba4: 4878 0002 pea 2 45ba8: 2f02 movel %d2,%sp@- 45baa: 4e95 jsr %a5@ (void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size); 45bac: 2f2a 0004 movel %a2@(4),%sp@- 45bb0: 2f02 movel %d2,%sp@- 45bb2: 4e94 jsr %a4@ status = pthread_create( 45bb4: 42a7 clrl %sp@- 45bb6: 2f12 movel %a2@,%sp@- 45bb8: 2f02 movel %d2,%sp@- 45bba: 2f05 movel %d5,%sp@- 45bbc: 4e93 jsr %a3@ &thread_id, &attr, user_threads[ index ].thread_entry, NULL ); if ( status ) 45bbe: 4fef 0024 lea %sp@(36),%sp 45bc2: 4a80 tstl %d0 45bc4: 6710 beqs 45bd6 <_POSIX_Threads_Initialize_user_threads_body+0x7a> _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status ); 45bc6: 2f00 movel %d0,%sp@- 45bc8: 4878 0001 pea 1 45bcc: 4878 0002 pea 2 45bd0: 4eb9 0004 7828 jsr 47828 <_Internal_error_Occurred> * * Setting the attributes explicitly is critical, since we don't want * to inherit the idle tasks attributes. */ for ( index=0 ; index < maximum ; index++ ) { 45bd6: 5283 addql #1,%d3 45bd8: 508a addql #8,%a2 45bda: b883 cmpl %d3,%d4 45bdc: 62c0 bhis 45b9e <_POSIX_Threads_Initialize_user_threads_body+0x42><== NEVER TAKEN NULL ); if ( status ) _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status ); } } 45bde: 4cee 3c7c ff9c moveml %fp@(-100),%d2-%d6/%a2-%a5 45be4: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004ae34 <_POSIX_Threads_Sporadic_budget_TSR>: */ void _POSIX_Threads_Sporadic_budget_TSR( Objects_Id id __attribute__((unused)), void *argument ) { 4ae34: 4e56 0000 linkw %fp,#0 4ae38: 2f0b movel %a3,%sp@- 4ae3a: 2f0a movel %a2,%sp@- 4ae3c: 246e 000c moveal %fp@(12),%a2 Thread_Control *the_thread; POSIX_API_Control *api; the_thread = argument; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4ae40: 266a 010e moveal %a2@(270),%a3 /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_init_budget ); 4ae44: 486b 0094 pea %a3@(148) 4ae48: 4eb9 0004 bef4 jsr 4bef4 <_Timespec_To_ticks> */ #if 0 printk( "TSR %d %d %d\n", the_thread->resource_count, the_thread->current_priority, new_priority ); #endif if ( the_thread->resource_count == 0 ) { 4ae4e: 588f addql #4,%sp 4ae50: 4281 clrl %d1 4ae52: 1239 0005 d762 moveb 5d762 ,%d1 4ae58: 92ab 0084 subl %a3@(132),%d1 api = the_thread->API_Extensions[ THREAD_API_POSIX ]; /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_init_budget ); the_thread->cpu_time_budget = ticks; 4ae5c: 2540 0076 movel %d0,%a2@(118) new_priority = _POSIX_Priority_To_core( api->schedparam.sched_priority ); the_thread->real_priority = new_priority; 4ae60: 2541 0018 movel %d1,%a2@(24) */ #if 0 printk( "TSR %d %d %d\n", the_thread->resource_count, the_thread->current_priority, new_priority ); #endif if ( the_thread->resource_count == 0 ) { 4ae64: 4aaa 001c tstl %a2@(28) 4ae68: 6618 bnes 4ae82 <_POSIX_Threads_Sporadic_budget_TSR+0x4e><== NEVER TAKEN /* * If this would make them less important, then do not change it. */ if ( the_thread->current_priority > new_priority ) { 4ae6a: b2aa 0014 cmpl %a2@(20),%d1 4ae6e: 6412 bccs 4ae82 <_POSIX_Threads_Sporadic_budget_TSR+0x4e> _Thread_Change_priority( the_thread, new_priority, true ); 4ae70: 4878 0001 pea 1 4ae74: 2f01 movel %d1,%sp@- 4ae76: 2f0a movel %a2,%sp@- 4ae78: 4eb9 0004 71b8 jsr 471b8 <_Thread_Change_priority> 4ae7e: 4fef 000c lea %sp@(12),%sp #endif } } /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_repl_period ); 4ae82: 486b 008c pea %a3@(140) 4ae86: 4eb9 0004 bef4 jsr 4bef4 <_Timespec_To_ticks> _Watchdog_Insert_ticks( &api->Sporadic_timer, ticks ); } 4ae8c: 246e fff8 moveal %fp@(-8),%a2 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 4ae90: 588f addql #4,%sp Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 4ae92: 2740 00b0 movel %d0,%a3@(176) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 4ae96: 47eb 00a4 lea %a3@(164),%a3 4ae9a: 203c 0005 f014 movel #389140,%d0 4aea0: 2d4b 000c movel %a3,%fp@(12) 4aea4: 266e fffc moveal %fp@(-4),%a3 4aea8: 2d40 0008 movel %d0,%fp@(8) 4aeac: 4e5e unlk %fp 4aeae: 4ef9 0004 8620 jmp 48620 <_Watchdog_Insert> =============================================================================== 0004adf0 <_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); 4adf0: 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 */ 4adf2: 72ff moveq #-1,%d1 * _POSIX_Threads_Sporadic_budget_callout */ void _POSIX_Threads_Sporadic_budget_callout( Thread_Control *the_thread ) { 4adf4: 4e56 0000 linkw %fp,#0 4adf8: 206e 0008 moveal %fp@(8),%a0 4adfc: 1039 0005 d762 moveb 5d762 ,%d0 POSIX_API_Control *api; uint32_t new_priority; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4ae02: 2268 010e moveal %a0@(270),%a1 4ae06: 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 */ 4ae0a: 2141 0076 movel %d1,%a0@(118) new_priority = _POSIX_Priority_To_core(api->schedparam.sched_ss_low_priority); the_thread->real_priority = new_priority; 4ae0e: 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 ) { 4ae12: 4aa8 001c tstl %a0@(28) 4ae16: 6618 bnes 4ae30 <_POSIX_Threads_Sporadic_budget_callout+0x40><== NEVER TAKEN /* * 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 ) { 4ae18: b0a8 0014 cmpl %a0@(20),%d0 4ae1c: 6312 blss 4ae30 <_POSIX_Threads_Sporadic_budget_callout+0x40><== NEVER TAKEN _Thread_Change_priority( the_thread, new_priority, true ); 4ae1e: 4878 0001 pea 1 4ae22: 2f00 movel %d0,%sp@- 4ae24: 2f08 movel %a0,%sp@- 4ae26: 4eb9 0004 71b8 jsr 471b8 <_Thread_Change_priority> 4ae2c: 4fef 000c lea %sp@(12),%sp #if 0 printk( "lower priority\n" ); #endif } } } 4ae30: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00045700 <_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) { 45700: 4e56 0000 linkw %fp,#0 45704: 2f0a movel %a2,%sp@- 45706: 246e 000c moveal %fp@(12),%a2 bool activated; ptimer = (POSIX_Timer_Control *)data; /* Increment the number of expirations. */ ptimer->overrun = ptimer->overrun + 1; 4570a: 52aa 0066 addql #1,%a2@(102) /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || 4570e: 4aaa 0052 tstl %a2@(82) 45712: 6606 bnes 4571a <_POSIX_Timer_TSR+0x1a> ( ptimer->timer_data.it_interval.tv_nsec != 0 ) ) { 45714: 4aaa 0056 tstl %a2@(86) 45718: 6732 beqs 4574c <_POSIX_Timer_TSR+0x4c> <== NEVER TAKEN activated = _POSIX_Timer_Insert_helper( 4571a: 2f0a movel %a2,%sp@- 4571c: 4879 0004 5700 pea 45700 <_POSIX_Timer_TSR> 45722: 2f2a 0008 movel %a2@(8),%sp@- 45726: 2f2a 0062 movel %a2@(98),%sp@- 4572a: 486a 0010 pea %a2@(16) 4572e: 4eb9 0004 b6fc jsr 4b6fc <_POSIX_Timer_Insert_helper> ptimer->ticks, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) 45734: 4fef 0014 lea %sp@(20),%sp 45738: 4a00 tstb %d0 4573a: 672a beqs 45766 <_POSIX_Timer_TSR+0x66> <== NEVER TAKEN return; /* Store the time when the timer was started again */ _TOD_Get( &ptimer->time ); 4573c: 486a 006a pea %a2@(106) 45740: 4eb9 0004 6c34 jsr 46c34 <_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 ) || 45746: 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; 45748: 7003 moveq #3,%d0 4574a: 6002 bras 4574e <_POSIX_Timer_TSR+0x4e> } else { /* Indicates that the timer is stopped */ ptimer->state = POSIX_TIMER_STATE_CREATE_STOP; 4574c: 7004 moveq #4,%d0 <== NOT EXECUTED 4574e: 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 ) ) { 45752: 2f2a 0042 movel %a2@(66),%sp@- 45756: 2f2a 0038 movel %a2@(56),%sp@- 4575a: 4eb9 0004 b2dc jsr 4b2dc } /* After the signal handler returns, the count of expirations of the * timer must be set to 0. */ ptimer->overrun = 0; 45760: 508f addql #8,%sp 45762: 42aa 0066 clrl %a2@(102) } 45766: 246e fffc moveal %fp@(-4),%a2 4576a: 4e5e unlk %fp ... =============================================================================== 0004ab9c <_POSIX_signals_Abnormal_termination_handler>: sigset_t _POSIX_signals_Pending; void _POSIX_signals_Abnormal_termination_handler( int signo __attribute__((unused)) ) { 4ab9c: 4e56 0000 linkw %fp,#0 exit( 1 ); 4aba0: 4878 0001 pea 1 4aba4: 4eb9 0004 e1b4 jsr 4e1b4 ... =============================================================================== 0004d848 <_POSIX_signals_Check_signal>: ) { siginfo_t siginfo_struct; sigset_t saved_signals_blocked; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 4d848: 4280 clrl %d0 bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 4d84a: 4e56 ffdc linkw %fp,#-36 siginfo_t siginfo_struct; sigset_t saved_signals_blocked; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 4d84e: 102e 0013 moveb %fp@(19),%d0 bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 4d852: 48d7 1c1c moveml %d2-%d4/%a2-%a4,%sp@ siginfo_t siginfo_struct; sigset_t saved_signals_blocked; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 4d856: 4878 0001 pea 1 4d85a: 260e movel %fp,%d3 4d85c: 0683 ffff fff4 addil #-12,%d3 4d862: 2f00 movel %d0,%sp@- bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 4d864: 242e 000c movel %fp@(12),%d2 siginfo_t siginfo_struct; sigset_t saved_signals_blocked; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 4d868: 2f03 movel %d3,%sp@- bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 4d86a: 246e 0008 moveal %fp@(8),%a2 siginfo_t siginfo_struct; sigset_t saved_signals_blocked; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 4d86e: 2f02 movel %d2,%sp@- 4d870: 2f0a movel %a2,%sp@- 4d872: 4eb9 0004 d8e4 jsr 4d8e4 <_POSIX_signals_Clear_signals> 4d878: 4fef 0014 lea %sp@(20),%sp 4d87c: 4a00 tstb %d0 4d87e: 6758 beqs 4d8d8 <_POSIX_signals_Check_signal+0x90> #endif /* * Just to prevent sending a signal which is currently being ignored. */ if ( _POSIX_signals_Vectors[ signo ].sa_handler == SIG_IGN ) 4d880: 2202 movel %d2,%d1 4d882: 2002 movel %d2,%d0 4d884: 43f9 0005 f3de lea 5f3de <_POSIX_signals_Vectors>,%a1 4d88a: e589 lsll #2,%d1 4d88c: e988 lsll #4,%d0 4d88e: 9081 subl %d1,%d0 4d890: 2040 moveal %d0,%a0 4d892: d1fc 0005 f3e6 addal #390118,%a0 4d898: 7201 moveq #1,%d1 4d89a: 2050 moveal %a0@,%a0 4d89c: b288 cmpl %a0,%d1 4d89e: 6738 beqs 4d8d8 <_POSIX_signals_Check_signal+0x90><== NEVER TAKEN /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; 4d8a0: 2842 moveal %d2,%a4 4d8a2: 47f4 2a01 lea %a4@(00000001,%d2:l:2),%a3 return false; /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; 4d8a6: 282a 00cc movel %a2@(204),%d4 api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; 4d8aa: 2231 bc00 movel %a1@(00000000,%a3:l:4),%d1 4d8ae: 8284 orl %d4,%d1 4d8b0: 2541 00cc movel %d1,%a2@(204) /* * Here, the signal handler function executes */ switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) { 4d8b4: 7202 moveq #2,%d1 4d8b6: b2b1 0800 cmpl %a1@(00000000,%d0:l),%d1 4d8ba: 660e bnes 4d8ca <_POSIX_signals_Check_signal+0x82> case SA_SIGINFO: (*_POSIX_signals_Vectors[ signo ].sa_sigaction)( 4d8bc: 42a7 clrl %sp@- 4d8be: 2f03 movel %d3,%sp@- 4d8c0: 2f02 movel %d2,%sp@- 4d8c2: 4e90 jsr %a0@ signo, &siginfo_struct, NULL /* context is undefined per 1003.1b-1993, p. 66 */ ); break; 4d8c4: 4fef 000c lea %sp@(12),%sp 4d8c8: 6006 bras 4d8d0 <_POSIX_signals_Check_signal+0x88> default: (*_POSIX_signals_Vectors[ signo ].sa_handler)( signo ); 4d8ca: 2f02 movel %d2,%sp@- 4d8cc: 4e90 jsr %a0@ 4d8ce: 588f addql #4,%sp } /* * Restore the previous set of blocked signals */ api->signals_blocked = saved_signals_blocked; 4d8d0: 2544 00cc movel %d4,%a2@(204) 4d8d4: 7001 moveq #1,%d0 return true; 4d8d6: 6002 bras 4d8da <_POSIX_signals_Check_signal+0x92> 4d8d8: 4200 clrb %d0 } 4d8da: 4cee 1c1c ffdc moveml %fp@(-36),%d2-%d4/%a2-%a4 4d8e0: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004e10c <_POSIX_signals_Clear_process_signals>: clear_signal = true; mask = signo_to_mask( signo ); ISR_Level level; _ISR_Disable( level ); 4e10c: 203c 0000 0700 movel #1792,%d0 */ void _POSIX_signals_Clear_process_signals( int signo ) { 4e112: 4e56 0000 linkw %fp,#0 4e116: 222e 0008 movel %fp@(8),%d1 4e11a: 2f03 movel %d3,%sp@- 4e11c: 2f02 movel %d2,%sp@- clear_signal = true; mask = signo_to_mask( signo ); ISR_Level level; _ISR_Disable( level ); 4e11e: 40c2 movew %sr,%d2 4e120: 8082 orl %d2,%d0 4e122: 46c0 movew %d0,%sr if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { 4e124: 2601 movel %d1,%d3 4e126: 2001 movel %d1,%d0 4e128: 41f9 0005 f3de lea 5f3de <_POSIX_signals_Vectors>,%a0 4e12e: e58b lsll #2,%d3 4e130: e988 lsll #4,%d0 4e132: 9083 subl %d3,%d0 4e134: 7602 moveq #2,%d3 4e136: b6b0 0800 cmpl %a0@(00000000,%d0:l),%d3 4e13a: 6610 bnes 4e14c <_POSIX_signals_Clear_process_signals+0x40> if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) 4e13c: 2040 moveal %d0,%a0 4e13e: d1fc 0005 f5d6 addal #390614,%a0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4e144: 2008 movel %a0,%d0 4e146: 5880 addql #4,%d0 4e148: b090 cmpl %a0@,%d0 4e14a: 661c bnes 4e168 <_POSIX_signals_Clear_process_signals+0x5c><== NEVER TAKEN clear_signal = false; } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; 4e14c: 5381 subql #1,%d1 4e14e: 7001 moveq #1,%d0 4e150: e3a8 lsll %d1,%d0 4e152: 4680 notl %d0 4e154: c0b9 0005 f5d2 andl 5f5d2 <_POSIX_signals_Pending>,%d0 4e15a: 23c0 0005 f5d2 movel %d0,5f5d2 <_POSIX_signals_Pending> if ( !_POSIX_signals_Pending ) 4e160: 6606 bnes 4e168 <_POSIX_signals_Clear_process_signals+0x5c><== NEVER TAKEN _Thread_Do_post_task_switch_extension--; 4e162: 53b9 0005 efde subql #1,5efde <_Thread_Do_post_task_switch_extension> } _ISR_Enable( level ); 4e168: 46c2 movew %d2,%sr } 4e16a: 241f movel %sp@+,%d2 4e16c: 261f movel %sp@+,%d3 4e16e: 4e5e unlk %fp ... =============================================================================== 00046210 <_POSIX_signals_Get_highest>: #include int _POSIX_signals_Get_highest( sigset_t set ) { 46210: 701b moveq #27,%d0 46212: 4e56 fff4 linkw %fp,#-12 46216: 48d7 001c moveml %d2-%d4,%sp@ 4621a: 242e 0008 movel %fp@(8),%d2 int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { if ( set & signo_to_mask( signo ) ) { 4621e: 7601 moveq #1,%d3 46220: 2200 movel %d0,%d1 46222: 5381 subql #1,%d1 46224: 2803 movel %d3,%d4 46226: e3ac lsll %d1,%d4 46228: 2204 movel %d4,%d1 4622a: c282 andl %d2,%d1 4622c: 6626 bnes 46254 <_POSIX_signals_Get_highest+0x44><== NEVER TAKEN sigset_t set ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 4622e: 5280 addql #1,%d0 46230: 123c 0020 moveb #32,%d1 46234: b280 cmpl %d0,%d1 46236: 66e8 bnes 46220 <_POSIX_signals_Get_highest+0x10> 46238: 7001 moveq #1,%d0 #if (SIGHUP != 1) #error "Assumption that SIGHUP==1 violated!!" #endif for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { if ( set & signo_to_mask( signo ) ) { 4623a: 7601 moveq #1,%d3 4623c: 2200 movel %d0,%d1 4623e: 5381 subql #1,%d1 46240: 2803 movel %d3,%d4 46242: e3ac lsll %d1,%d4 46244: 2204 movel %d4,%d1 46246: c282 andl %d2,%d1 46248: 660a bnes 46254 <_POSIX_signals_Get_highest+0x44> */ #if (SIGHUP != 1) #error "Assumption that SIGHUP==1 violated!!" #endif for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { 4624a: 5280 addql #1,%d0 4624c: 123c 001b moveb #27,%d1 46250: b280 cmpl %d0,%d1 46252: 66e8 bnes 4623c <_POSIX_signals_Get_highest+0x2c><== ALWAYS TAKEN * a return 0. This routine will NOT be called unless a signal * is pending in the set passed in. */ found_it: return signo; } 46254: 4cd7 001c moveml %sp@,%d2-%d4 46258: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004ab0e <_POSIX_signals_Post_switch_extension>: */ void _POSIX_signals_Post_switch_extension( Thread_Control *the_thread ) { 4ab0e: 4e56 fff0 linkw %fp,#-16 4ab12: 206e 0008 moveal %fp@(8),%a0 4ab16: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ POSIX_API_Control *api; int signo; ISR_Level level; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4ab1a: 2468 010e moveal %a0@(270),%a2 /* * api may be NULL in case of a thread close in progress */ if ( !api ) 4ab1e: 4a8a tstl %a2 4ab20: 6770 beqs 4ab92 <_POSIX_signals_Post_switch_extension+0x84><== NEVER TAKEN * * The first thing done is to check there are any signals to be * processed at all. No point in doing this loop otherwise. */ while (1) { _ISR_Disable( level ); 4ab22: 263c 0000 0700 movel #1792,%d3 break; } _ISR_Enable( level ); for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { _POSIX_signals_Check_signal( api, signo, false ); 4ab28: 47f9 0004 d848 lea 4d848 <_POSIX_signals_Check_signal>,%a3 * * The first thing done is to check there are any signals to be * processed at all. No point in doing this loop otherwise. */ while (1) { _ISR_Disable( level ); 4ab2e: 2003 movel %d3,%d0 4ab30: 40c1 movew %sr,%d1 4ab32: 8081 orl %d1,%d0 4ab34: 46c0 movew %d0,%sr if ( !(~api->signals_blocked & (api->signals_pending | _POSIX_signals_Pending)) ) { 4ab36: 2039 0005 f5d2 movel 5f5d2 <_POSIX_signals_Pending>,%d0 * The first thing done is to check there are any signals to be * processed at all. No point in doing this loop otherwise. */ while (1) { _ISR_Disable( level ); if ( !(~api->signals_blocked & 4ab3c: 242a 00cc movel %a2@(204),%d2 4ab40: 4682 notl %d2 (api->signals_pending | _POSIX_signals_Pending)) ) { 4ab42: 80aa 00d0 orl %a2@(208),%d0 * The first thing done is to check there are any signals to be * processed at all. No point in doing this loop otherwise. */ while (1) { _ISR_Disable( level ); if ( !(~api->signals_blocked & 4ab46: c082 andl %d2,%d0 4ab48: 6604 bnes 4ab4e <_POSIX_signals_Post_switch_extension+0x40> (api->signals_pending | _POSIX_signals_Pending)) ) { _ISR_Enable( level ); 4ab4a: 46c1 movew %d1,%sr 4ab4c: 6044 bras 4ab92 <_POSIX_signals_Post_switch_extension+0x84> break; } _ISR_Enable( level ); 4ab4e: 46c1 movew %d1,%sr 4ab50: 741b moveq #27,%d2 for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { _POSIX_signals_Check_signal( api, signo, false ); 4ab52: 42a7 clrl %sp@- 4ab54: 2f02 movel %d2,%sp@- 4ab56: 2f0a movel %a2,%sp@- 4ab58: 4e93 jsr %a3@ _POSIX_signals_Check_signal( api, signo, true ); 4ab5a: 4878 0001 pea 1 4ab5e: 2f02 movel %d2,%sp@- _ISR_Enable( level ); break; } _ISR_Enable( level ); for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 4ab60: 5282 addql #1,%d2 _POSIX_signals_Check_signal( api, signo, false ); _POSIX_signals_Check_signal( api, signo, true ); 4ab62: 2f0a movel %a2,%sp@- 4ab64: 4e93 jsr %a3@ _ISR_Enable( level ); break; } _ISR_Enable( level ); for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 4ab66: 4fef 0018 lea %sp@(24),%sp 4ab6a: 7020 moveq #32,%d0 4ab6c: b082 cmpl %d2,%d0 4ab6e: 66e2 bnes 4ab52 <_POSIX_signals_Post_switch_extension+0x44> 4ab70: 7401 moveq #1,%d2 _POSIX_signals_Check_signal( api, signo, true ); } /* Unfortunately - nothing like __SIGFIRSTNOTRT in newlib signal .h */ for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { _POSIX_signals_Check_signal( api, signo, false ); 4ab72: 42a7 clrl %sp@- 4ab74: 2f02 movel %d2,%sp@- 4ab76: 2f0a movel %a2,%sp@- 4ab78: 4e93 jsr %a3@ _POSIX_signals_Check_signal( api, signo, true ); 4ab7a: 4878 0001 pea 1 4ab7e: 2f02 movel %d2,%sp@- _POSIX_signals_Check_signal( api, signo, false ); _POSIX_signals_Check_signal( api, signo, true ); } /* Unfortunately - nothing like __SIGFIRSTNOTRT in newlib signal .h */ for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { 4ab80: 5282 addql #1,%d2 _POSIX_signals_Check_signal( api, signo, false ); _POSIX_signals_Check_signal( api, signo, true ); 4ab82: 2f0a movel %a2,%sp@- 4ab84: 4e93 jsr %a3@ _POSIX_signals_Check_signal( api, signo, false ); _POSIX_signals_Check_signal( api, signo, true ); } /* Unfortunately - nothing like __SIGFIRSTNOTRT in newlib signal .h */ for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { 4ab86: 4fef 0018 lea %sp@(24),%sp 4ab8a: 701b moveq #27,%d0 4ab8c: b082 cmpl %d2,%d0 4ab8e: 66e2 bnes 4ab72 <_POSIX_signals_Post_switch_extension+0x64> 4ab90: 609c bras 4ab2e <_POSIX_signals_Post_switch_extension+0x20> _POSIX_signals_Check_signal( api, signo, false ); _POSIX_signals_Check_signal( api, signo, true ); } } } 4ab92: 4cee 0c0c fff0 moveml %fp@(-16),%d2-%d3/%a2-%a3 4ab98: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000456dc <_POSIX_signals_Ualarm_TSR>: void _POSIX_signals_Ualarm_TSR( Objects_Id id __attribute__((unused)), void *argument __attribute__((unused)) ) { 456dc: 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 ); 456e0: 4eb9 0004 2a90 jsr 42a90 456e6: 4878 000e pea e 456ea: 2f00 movel %d0,%sp@- 456ec: 4eb9 0004 53fc jsr 453fc RTEMS_INLINE_ROUTINE void _Watchdog_Reset( Watchdog_Control *the_watchdog ) { (void) _Watchdog_Remove( the_watchdog ); 456f2: 4879 0006 0ee6 pea 60ee6 <_POSIX_signals_Ualarm_timer> 456f8: 4eb9 0004 8d08 jsr 48d08 <_Watchdog_Remove> _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 456fe: 4fef 000c lea %sp@(12),%sp 45702: 203c 0006 0ee6 movel #397030,%d0 45708: 2d40 000c movel %d0,%fp@(12) 4570c: 203c 0006 07a4 movel #395172,%d0 45712: 2d40 0008 movel %d0,%fp@(8) /* * If the reset interval is non-zero, reschedule ourselves. */ _Watchdog_Reset( &_POSIX_signals_Ualarm_timer ); } 45716: 4e5e unlk %fp 45718: 4ef9 0004 8bec jmp 48bec <_Watchdog_Insert> ... =============================================================================== 0004da00 <_POSIX_signals_Unblock_thread>: 4da00: 7001 moveq #1,%d0 bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, siginfo_t *info ) { 4da02: 4e56 fff4 linkw %fp,#-12 4da06: 226e 000c moveal %fp@(12),%a1 4da0a: 48d7 040c moveml %d2-%d3/%a2,%sp@ 4da0e: 246e 0008 moveal %fp@(8),%a2 4da12: 2609 movel %a1,%d3 4da14: 5383 subql #1,%d3 /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 4da16: 242a 0010 movel %a2@(16),%d2 4da1a: 0282 1000 8000 andil #268468224,%d2 bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, siginfo_t *info ) { 4da20: 222e 0010 movel %fp@(16),%d1 POSIX_API_Control *api; sigset_t mask; siginfo_t *the_info = NULL; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4da24: 206a 010e moveal %a2@(270),%a0 4da28: e7a8 lsll %d3,%d0 /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 4da2a: 0c82 1000 8000 cmpil #268468224,%d2 4da30: 6652 bnes 4da84 <_POSIX_signals_Unblock_thread+0x84> if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { 4da32: 2400 movel %d0,%d2 4da34: c4aa 0030 andl %a2@(48),%d2 4da38: 660c bnes 4da46 <_POSIX_signals_Unblock_thread+0x46> 4da3a: 2428 00cc movel %a0@(204),%d2 4da3e: 4682 notl %d2 4da40: c082 andl %d2,%d0 4da42: 6700 00ac beqw 4daf0 <_POSIX_signals_Unblock_thread+0xf0> the_thread->Wait.return_code = EINTR; 4da46: 7004 moveq #4,%d0 the_info = (siginfo_t *) the_thread->Wait.return_argument; 4da48: 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; 4da4c: 2540 0034 movel %d0,%a2@(52) the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { 4da50: 4a81 tstl %d1 4da52: 6610 bnes 4da64 <_POSIX_signals_Unblock_thread+0x64> the_info->si_signo = signo; the_info->si_code = SI_USER; 4da54: 123c 0001 moveb #1,%d1 the_thread->Wait.return_code = EINTR; the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { the_info->si_signo = signo; 4da58: 2089 movel %a1,%a0@ the_info->si_code = SI_USER; the_info->si_value.sival_int = 0; 4da5a: 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; 4da5e: 2141 0004 movel %d1,%a0@(4) 4da62: 6012 bras 4da76 <_POSIX_signals_Unblock_thread+0x76> the_info->si_value.sival_int = 0; } else { *the_info = *info; 4da64: 4878 000c pea c 4da68: 2f01 movel %d1,%sp@- 4da6a: 2f08 movel %a0,%sp@- 4da6c: 4eb9 0004 e9c4 jsr 4e9c4 4da72: 4fef 000c lea %sp@(12),%sp } _Thread_queue_Extract_with_proxy( the_thread ); 4da76: 2f0a movel %a2,%sp@- 4da78: 4eb9 0004 7d20 jsr 47d20 <_Thread_queue_Extract_with_proxy> return true; 4da7e: 588f addql #4,%sp the_info->si_value.sival_int = 0; } else { *the_info = *info; } _Thread_queue_Extract_with_proxy( the_thread ); 4da80: 7001 moveq #1,%d0 return true; 4da82: 606e bras 4daf2 <_POSIX_signals_Unblock_thread+0xf2> } /* * Thread is not waiting due to a sigwait. */ if ( ~api->signals_blocked & mask ) { 4da84: 2228 00cc movel %a0@(204),%d1 4da88: 4681 notl %d1 4da8a: c081 andl %d1,%d0 4da8c: 6762 beqs 4daf0 <_POSIX_signals_Unblock_thread+0xf0> * + Any other combination, do nothing. */ the_thread->do_post_task_switch_extension = true; if ( the_thread->current_state & STATES_INTERRUPTIBLE_BY_SIGNAL ) { 4da8e: 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; 4da92: 7201 moveq #1,%d1 4da94: 1541 0074 moveb %d1,%a2@(116) if ( the_thread->current_state & STATES_INTERRUPTIBLE_BY_SIGNAL ) { 4da98: 0800 001c btst #28,%d0 4da9c: 6736 beqs 4dad4 <_POSIX_signals_Unblock_thread+0xd4> the_thread->Wait.return_code = EINTR; 4da9e: 7004 moveq #4,%d0 4daa0: 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) ){ 4daa4: 103c 0008 moveb #8,%d0 4daa8: c0aa 0010 andl %a2@(16),%d0 4daac: 6742 beqs 4daf0 <_POSIX_signals_Unblock_thread+0xf0><== NEVER TAKEN if ( _Watchdog_Is_active( &the_thread->Timer ) ) 4daae: 7202 moveq #2,%d1 4dab0: b2aa 0050 cmpl %a2@(80),%d1 4dab4: 660c bnes 4dac2 <_POSIX_signals_Unblock_thread+0xc2><== NEVER TAKEN (void) _Watchdog_Remove( &the_thread->Timer ); 4dab6: 486a 0048 pea %a2@(72) 4daba: 4eb9 0004 873c jsr 4873c <_Watchdog_Remove> 4dac0: 588f addql #4,%sp RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 4dac2: 2f3c 1003 fff8 movel #268697592,%sp@- 4dac8: 2f0a movel %a2,%sp@- 4daca: 4eb9 0004 72f8 jsr 472f8 <_Thread_Clear_state> 4dad0: 508f addql #8,%sp 4dad2: 601c bras 4daf0 <_POSIX_signals_Unblock_thread+0xf0> _Thread_Unblock( the_thread ); } } else if ( the_thread->current_state == STATES_READY ) { 4dad4: 4a80 tstl %d0 4dad6: 6618 bnes 4daf0 <_POSIX_signals_Unblock_thread+0xf0><== NEVER TAKEN if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 4dad8: 2039 0005 efd6 movel 5efd6 <_ISR_Nest_level>,%d0 4dade: 6710 beqs 4daf0 <_POSIX_signals_Unblock_thread+0xf0> 4dae0: b5f9 0005 eff6 cmpal 5eff6 <_Thread_Executing>,%a2 4dae6: 6608 bnes 4daf0 <_POSIX_signals_Unblock_thread+0xf0><== NEVER TAKEN _ISR_Signals_to_thread_executing = true; 4dae8: 7001 moveq #1,%d0 4daea: 13c0 0005 f084 moveb %d0,5f084 <_ISR_Signals_to_thread_executing> 4daf0: 4200 clrb %d0 } } return false; } 4daf2: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 4daf8: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004b37a <_RTEMS_tasks_Post_switch_extension>: */ void _RTEMS_tasks_Post_switch_extension( Thread_Control *executing ) { 4b37a: 4e56 ffec linkw %fp,#-20 4b37e: 206e 0008 moveal %fp@(8),%a0 4b382: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ RTEMS_API_Control *api; ASR_Information *asr; rtems_signal_set signal_set; Modes_Control prev_mode; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 4b386: 2468 010a moveal %a0@(266),%a2 if ( !api ) 4b38a: 4a8a tstl %a2 4b38c: 6754 beqs 4b3e2 <_RTEMS_tasks_Post_switch_extension+0x68><== NEVER TAKEN * Signal Processing */ asr = &api->Signal; _ISR_Disable( level ); 4b38e: 203c 0000 0700 movel #1792,%d0 4b394: 40c1 movew %sr,%d1 4b396: 8081 orl %d1,%d0 4b398: 46c0 movew %d0,%sr signal_set = asr->signals_posted; 4b39a: 262a 0012 movel %a2@(18),%d3 asr->signals_posted = 0; 4b39e: 42aa 0012 clrl %a2@(18) _ISR_Enable( level ); 4b3a2: 46c1 movew %d1,%sr if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ 4b3a4: 4a83 tstl %d3 4b3a6: 673a beqs 4b3e2 <_RTEMS_tasks_Post_switch_extension+0x68> return; asr->nest_level += 1; 4b3a8: 52aa 001a addql #1,%a2@(26) rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 4b3ac: 240e movel %fp,%d2 4b3ae: 5982 subql #4,%d2 4b3b0: 47f9 0004 dc74 lea 4dc74 ,%a3 4b3b6: 2f02 movel %d2,%sp@- 4b3b8: 2f3c 0000 ffff movel #65535,%sp@- 4b3be: 2f2a 000e movel %a2@(14),%sp@- 4b3c2: 4e93 jsr %a3@ (*asr->handler)( signal_set ); 4b3c4: 2f03 movel %d3,%sp@- 4b3c6: 206a 000a moveal %a2@(10),%a0 4b3ca: 4e90 jsr %a0@ asr->nest_level -= 1; 4b3cc: 53aa 001a subql #1,%a2@(26) rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 4b3d0: 2f02 movel %d2,%sp@- 4b3d2: 2f3c 0000 ffff movel #65535,%sp@- 4b3d8: 2f2e fffc movel %fp@(-4),%sp@- 4b3dc: 4e93 jsr %a3@ 4b3de: 4fef 001c lea %sp@(28),%sp } 4b3e2: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3 4b3e8: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00058808 <_Region_Process_queue>: */ void _Region_Process_queue( Region_Control *the_region ) { 58808: 4e56 ffe4 linkw %fp,#-28 5880c: 2039 0007 76e0 movel 776e0 <_Thread_Dispatch_disable_level>,%d0 58812: 5280 addql #1,%d0 58814: 48d7 3c1c moveml %d2-%d4/%a2-%a5,%sp@ 58818: 266e 0008 moveal %fp@(8),%a3 5881c: 23c0 0007 76e0 movel %d0,776e0 <_Thread_Dispatch_disable_level> * NOTE: Be sure to disable dispatching before unlocking the mutex * since we do not want to open a window where a context * switch could occur. */ _Thread_Disable_dispatch(); _RTEMS_Unlock_allocator(); 58822: 2f39 0007 7792 movel 77792 <_RTEMS_Allocator_Mutex>,%sp@- /* * NOTE: The following loop is O(n) where n is the number of * threads whose memory request is satisfied. */ for ( ; ; ) { the_thread = _Thread_queue_First( &the_region->Wait_queue ); 58828: 240b movel %a3,%d2 RTEMS_INLINE_ROUTINE void *_Region_Allocate_segment ( Region_Control *the_region, uintptr_t size ) { return _Heap_Allocate( &the_region->Memory, size ); 5882a: 280b movel %a3,%d4 5882c: 0682 0000 0010 addil #16,%d2 58832: 0684 0000 0068 addil #104,%d4 58838: 4bf9 0005 32cc lea 532cc <_Heap_Allocate_aligned_with_boundary>,%a5 if ( the_segment == NULL ) break; *(void **)the_thread->Wait.return_argument = the_segment; the_region->number_of_used_blocks += 1; _Thread_queue_Extract( &the_region->Wait_queue, the_thread ); 5883e: 49f9 0005 8f78 lea 58f78 <_Thread_queue_Extract>,%a4 * NOTE: Be sure to disable dispatching before unlocking the mutex * since we do not want to open a window where a context * switch could occur. */ _Thread_Disable_dispatch(); _RTEMS_Unlock_allocator(); 58844: 4eb9 0005 2838 jsr 52838 <_API_Mutex_Unlock> 5884a: 588f addql #4,%sp /* * NOTE: The following loop is O(n) where n is the number of * threads whose memory request is satisfied. */ for ( ; ; ) { the_thread = _Thread_queue_First( &the_region->Wait_queue ); 5884c: 263c 0005 907c movel #364668,%d3 58852: 2f02 movel %d2,%sp@- 58854: 2043 moveal %d3,%a0 58856: 4e90 jsr %a0@ if ( the_thread == NULL ) 58858: 588f addql #4,%sp /* * NOTE: The following loop is O(n) where n is the number of * threads whose memory request is satisfied. */ for ( ; ; ) { the_thread = _Thread_queue_First( &the_region->Wait_queue ); 5885a: 2440 moveal %d0,%a2 if ( the_thread == NULL ) 5885c: 4a80 tstl %d0 5885e: 672c beqs 5888c <_Region_Process_queue+0x84> 58860: 42a7 clrl %sp@- 58862: 42a7 clrl %sp@- 58864: 2f2a 0024 movel %a2@(36),%sp@- 58868: 2f04 movel %d4,%sp@- 5886a: 4e95 jsr %a5@ the_segment = (void **) _Region_Allocate_segment( the_region, the_thread->Wait.count ); if ( the_segment == NULL ) 5886c: 4fef 0010 lea %sp@(16),%sp 58870: 4a80 tstl %d0 58872: 6718 beqs 5888c <_Region_Process_queue+0x84> break; *(void **)the_thread->Wait.return_argument = the_segment; 58874: 206a 0028 moveal %a2@(40),%a0 the_region->number_of_used_blocks += 1; 58878: 52ab 0064 addql #1,%a3@(100) ); if ( the_segment == NULL ) break; *(void **)the_thread->Wait.return_argument = the_segment; 5887c: 2080 movel %d0,%a0@ the_region->number_of_used_blocks += 1; _Thread_queue_Extract( &the_region->Wait_queue, the_thread ); 5887e: 2f0a movel %a2,%sp@- 58880: 2f02 movel %d2,%sp@- 58882: 4e94 jsr %a4@ the_thread->Wait.return_code = RTEMS_SUCCESSFUL; } 58884: 508f addql #8,%sp break; *(void **)the_thread->Wait.return_argument = the_segment; the_region->number_of_used_blocks += 1; _Thread_queue_Extract( &the_region->Wait_queue, the_thread ); the_thread->Wait.return_code = RTEMS_SUCCESSFUL; 58886: 42aa 0034 clrl %a2@(52) } 5888a: 60c6 bras 58852 <_Region_Process_queue+0x4a> _Thread_Enable_dispatch(); } 5888c: 4cee 3c1c ffe4 moveml %fp@(-28),%d2-%d4/%a2-%a5 58892: 4e5e unlk %fp *(void **)the_thread->Wait.return_argument = the_segment; the_region->number_of_used_blocks += 1; _Thread_queue_Extract( &the_region->Wait_queue, the_thread ); the_thread->Wait.return_code = RTEMS_SUCCESSFUL; } _Thread_Enable_dispatch(); 58894: 4ef9 0005 4942 jmp 54942 <_Thread_Enable_dispatch> ... =============================================================================== 00046170 <_TOD_Validate>: */ bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 46170: 4e56 0000 linkw %fp,#0 46174: 206e 0008 moveal %fp@(8),%a0 46178: 2f03 movel %d3,%sp@- uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); 4617a: 2039 0005 f8c0 movel 5f8c0 ,%d0 */ bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 46180: 2f02 movel %d2,%sp@- uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 46182: 4a88 tstl %a0 46184: 6762 beqs 461e8 <_TOD_Validate+0x78> <== NEVER TAKEN (the_tod->ticks >= ticks_per_second) || 46186: 243c 000f 4240 movel #1000000,%d2 4618c: 4c40 2002 remul %d0,%d2,%d2 46190: b4a8 0018 cmpl %a0@(24),%d2 46194: 6352 blss 461e8 <_TOD_Validate+0x78> (the_tod->second >= TOD_SECONDS_PER_MINUTE) || 46196: 763b moveq #59,%d3 46198: b6a8 0014 cmpl %a0@(20),%d3 4619c: 654a bcss 461e8 <_TOD_Validate+0x78> (the_tod->minute >= TOD_MINUTES_PER_HOUR) || 4619e: b6a8 0010 cmpl %a0@(16),%d3 461a2: 6544 bcss 461e8 <_TOD_Validate+0x78> (the_tod->hour >= TOD_HOURS_PER_DAY) || 461a4: 7017 moveq #23,%d0 461a6: b0a8 000c cmpl %a0@(12),%d0 461aa: 653c bcss 461e8 <_TOD_Validate+0x78> (the_tod->month == 0) || 461ac: 2028 0004 movel %a0@(4),%d0 uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 461b0: 6736 beqs 461e8 <_TOD_Validate+0x78> <== NEVER TAKEN 461b2: 720c moveq #12,%d1 461b4: b280 cmpl %d0,%d1 461b6: 6530 bcss 461e8 <_TOD_Validate+0x78> (the_tod->second >= TOD_SECONDS_PER_MINUTE) || (the_tod->minute >= TOD_MINUTES_PER_HOUR) || (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || 461b8: 2410 movel %a0@,%d2 uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 461ba: 0c82 0000 07c3 cmpil #1987,%d2 461c0: 6326 blss 461e8 <_TOD_Validate+0x78> (the_tod->minute >= TOD_MINUTES_PER_HOUR) || (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) 461c2: 2228 0008 movel %a0@(8),%d1 uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 461c6: 6720 beqs 461e8 <_TOD_Validate+0x78> <== NEVER TAKEN (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) return false; if ( (the_tod->year % 4) == 0 ) 461c8: 163c 0003 moveb #3,%d3 461cc: 41f9 0005 e4b2 lea 5e4b2 <_TOD_Days_per_month>,%a0 461d2: c483 andl %d3,%d2 461d4: 6606 bnes 461dc <_TOD_Validate+0x6c> days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; 461d6: 2030 0c34 movel %a0@(00000034,%d0:l:4),%d0 461da: 6004 bras 461e0 <_TOD_Validate+0x70> else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; 461dc: 2030 0c00 movel %a0@(00000000,%d0:l:4),%d0 * false - if the the_tod is invalid * * NOTE: This routine only works for leap-years through 2099. */ bool _TOD_Validate( 461e0: b081 cmpl %d1,%d0 461e2: 54c0 scc %d0 461e4: 4480 negl %d0 461e6: 6002 bras 461ea <_TOD_Validate+0x7a> 461e8: 4200 clrb %d0 if ( the_tod->day > days_in_month ) return false; return true; } 461ea: 241f movel %sp@+,%d2 461ec: 261f movel %sp@+,%d3 461ee: 4e5e unlk %fp ... =============================================================================== 000471b8 <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 471b8: 4e56 fff0 linkw %fp,#-16 471bc: 48d7 041c moveml %d2-%d4/%a2,%sp@ 471c0: 246e 0008 moveal %fp@(8),%a2 /* * Set a transient state for the thread so it is pulled off the Ready chains. * This will prevent it from being scheduled no matter what happens in an * ISR. */ _Thread_Set_transient( the_thread ); 471c4: 2f0a movel %a2,%sp@- void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 471c6: 262e 000c movel %fp@(12),%d3 */ /* * Save original state */ original_state = the_thread->current_state; 471ca: 242a 0010 movel %a2@(16),%d2 void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 471ce: 182e 0013 moveb %fp@(19),%d4 /* * Set a transient state for the thread so it is pulled off the Ready chains. * This will prevent it from being scheduled no matter what happens in an * ISR. */ _Thread_Set_transient( the_thread ); 471d2: 4eb9 0004 7fc8 jsr 47fc8 <_Thread_Set_transient> /* * Do not bother recomputing all the priority related information if * we are not REALLY changing priority. */ if ( the_thread->current_priority != new_priority ) 471d8: 588f addql #4,%sp 471da: b6aa 0014 cmpl %a2@(20),%d3 471de: 670c beqs 471ec <_Thread_Change_priority+0x34> _Thread_Set_priority( the_thread, new_priority ); 471e0: 2f03 movel %d3,%sp@- 471e2: 2f0a movel %a2,%sp@- 471e4: 4eb9 0004 7e70 jsr 47e70 <_Thread_Set_priority> 471ea: 508f addql #8,%sp _ISR_Disable( level ); 471ec: 223c 0000 0700 movel #1792,%d1 471f2: 40c0 movew %sr,%d0 471f4: 8280 orl %d0,%d1 471f6: 46c1 movew %d1,%sr 471f8: 7604 moveq #4,%d3 /* * If the thread has more than STATES_TRANSIENT set, then it is blocked, * If it is blocked on a thread queue, then we need to requeue it. */ state = the_thread->current_state; 471fa: 222a 0010 movel %a2@(16),%d1 471fe: c483 andl %d3,%d2 if ( state != STATES_TRANSIENT ) { 47200: b681 cmpl %d1,%d3 47202: 6730 beqs 47234 <_Thread_Change_priority+0x7c> /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) 47204: 4a82 tstl %d2 47206: 6608 bnes 47210 <_Thread_Change_priority+0x58> <== NEVER TAKEN the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); 47208: 74fb moveq #-5,%d2 4720a: c481 andl %d1,%d2 4720c: 2542 0010 movel %d2,%a2@(16) _ISR_Enable( level ); 47210: 46c0 movew %d0,%sr if ( _States_Is_waiting_on_thread_queue( state ) ) { 47212: 0281 0003 bee0 andil #245472,%d1 47218: 6700 00d2 beqw 472ec <_Thread_Change_priority+0x134> _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); 4721c: 2d4a 000c movel %a2,%fp@(12) 47220: 2d6a 0044 0008 movel %a2@(68),%fp@(8) if ( !_Thread_Is_executing_also_the_heir() && _Thread_Executing->is_preemptible ) _Context_Switch_necessary = true; _ISR_Enable( level ); } 47226: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 4722c: 4e5e unlk %fp /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); _ISR_Enable( level ); if ( _States_Is_waiting_on_thread_queue( state ) ) { _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); 4722e: 4ef9 0004 7dd4 jmp 47dd4 <_Thread_queue_Requeue> } return; } /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) { 47234: 4a82 tstl %d2 47236: 6650 bnes 47288 <_Thread_Change_priority+0xd0> <== NEVER TAKEN RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 47238: 226a 008e moveal %a2@(142),%a1 4723c: 322a 0094 movew %a2@(148),%d1 47240: 3411 movew %a1@,%d2 47242: 206a 008a moveal %a2@(138),%a0 47246: 8282 orl %d2,%d1 * Interrupts are STILL disabled. * We now know the thread will be in the READY state when we remove * the TRANSIENT state. So we have to place it on the appropriate * Ready Queue with interrupts off. */ the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); 47248: 42aa 0010 clrl %a2@(16) 4724c: 3281 movew %d1,%a1@ _Priority_Major_bit_map |= the_priority_map->ready_major; 4724e: 3239 0005 efec movew 5efec <_Priority_Major_bit_map>,%d1 47254: 342a 0092 movew %a2@(146),%d2 47258: 8282 orl %d2,%d1 4725a: 33c1 0005 efec movew %d1,5efec <_Priority_Major_bit_map> _Priority_Add_to_bit_map( &the_thread->Priority_map ); if ( prepend_it ) 47260: 4a04 tstb %d4 47262: 6710 beqs 47274 <_Thread_Change_priority+0xbc> ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 47264: 2250 moveal %a0@,%a1 Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 47266: 2548 0004 movel %a0,%a2@(4) before_node = after_node->next; after_node->next = the_node; 4726a: 208a movel %a2,%a0@ the_node->next = before_node; before_node->previous = the_node; 4726c: 234a 0004 movel %a2,%a1@(4) Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; after_node->next = the_node; the_node->next = before_node; 47270: 2489 movel %a1,%a2@ 47272: 6014 bras 47288 <_Thread_Change_priority+0xd0> Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 47274: 2608 movel %a0,%d3 47276: 5883 addql #4,%d3 47278: 2483 movel %d3,%a2@ old_last_node = the_chain->last; 4727a: 2268 0008 moveal %a0@(8),%a1 the_chain->last = the_node; 4727e: 214a 0008 movel %a2,%a0@(8) old_last_node->next = the_node; the_node->previous = old_last_node; 47282: 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; 47286: 228a movel %a2,%a1@ _Chain_Prepend_unprotected( the_thread->ready, &the_thread->Object.Node ); else _Chain_Append_unprotected( the_thread->ready, &the_thread->Object.Node ); } _ISR_Flash( level ); 47288: 223c 0000 0700 movel #1792,%d1 4728e: 46c0 movew %d0,%sr 47290: 8280 orl %d0,%d1 47292: 46c1 movew %d1,%sr RTEMS_INLINE_ROUTINE Priority_Control _Priority_Get_highest( void ) { Priority_Bit_map_control minor; Priority_Bit_map_control major; _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); 47294: 3239 0005 efec movew 5efec <_Priority_Major_bit_map>,%d1 4729a: 4841 swap %d1 4729c: 04c1 ff1 %d1 _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 4729e: 4282 clrl %d2 472a0: 41f9 0005 f05c lea 5f05c <_Priority_Bit_map>,%a0 472a6: 3401 movew %d1,%d2 472a8: 3230 2a00 movew %a0@(00000000,%d2:l:2),%d1 472ac: 4841 swap %d1 472ae: 04c1 ff1 %d1 * ready thread. */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) 472b0: 4283 clrl %d3 472b2: e98a lsll #4,%d2 472b4: 3601 movew %d1,%d3 472b6: 2279 0005 eee8 moveal 5eee8 <_Thread_Ready_chain>,%a1 472bc: 2202 movel %d2,%d1 472be: d283 addl %d3,%d1 472c0: 2401 movel %d1,%d2 472c2: e58a lsll #2,%d2 472c4: e989 lsll #4,%d1 * is also the heir thread, and false otherwise. */ RTEMS_INLINE_ROUTINE bool _Thread_Is_executing_also_the_heir( void ) { return ( _Thread_Executing == _Thread_Heir ); 472c6: 2079 0005 eff6 moveal 5eff6 <_Thread_Executing>,%a0 * ready thread. */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) 472cc: 93c2 subal %d2,%a1 472ce: 2231 1800 movel %a1@(00000000,%d1:l),%d1 472d2: 23c1 0005 efca movel %d1,5efca <_Thread_Heir> * We altered the set of thread priorities. So let's figure out * who is the heir and if we need to switch to them. */ _Thread_Calculate_heir(); if ( !_Thread_Is_executing_also_the_heir() && 472d8: b288 cmpl %a0,%d1 472da: 670e beqs 472ea <_Thread_Change_priority+0x132> _Thread_Executing->is_preemptible ) 472dc: 4a28 0075 tstb %a0@(117) 472e0: 6708 beqs 472ea <_Thread_Change_priority+0x132> _Context_Switch_necessary = true; 472e2: 7201 moveq #1,%d1 472e4: 13c1 0005 f006 moveb %d1,5f006 <_Context_Switch_necessary> _ISR_Enable( level ); 472ea: 46c0 movew %d0,%sr } 472ec: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 472f2: 4e5e unlk %fp ... =============================================================================== 000472f8 <_Thread_Clear_state>: void _Thread_Clear_state( Thread_Control *the_thread, States_Control state ) { 472f8: 4e56 ffec linkw %fp,#-20 472fc: 206e 0008 moveal %fp@(8),%a0 47300: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ ISR_Level level; States_Control current_state; _ISR_Disable( level ); 47304: 263c 0000 0700 movel #1792,%d3 4730a: 2203 movel %d3,%d1 void _Thread_Clear_state( Thread_Control *the_thread, States_Control state ) { 4730c: 202e 000c movel %fp@(12),%d0 ISR_Level level; States_Control current_state; _ISR_Disable( level ); 47310: 40c2 movew %sr,%d2 47312: 8282 orl %d2,%d1 47314: 46c1 movew %d1,%sr current_state = the_thread->current_state; 47316: 2228 0010 movel %a0@(16),%d1 if ( current_state & state ) { 4731a: 2800 movel %d0,%d4 4731c: c881 andl %d1,%d4 4731e: 6778 beqs 47398 <_Thread_Clear_state+0xa0> RTEMS_INLINE_ROUTINE States_Control _States_Clear ( States_Control states_to_clear, States_Control current_state ) { return (current_state & ~states_to_clear); 47320: 4680 notl %d0 47322: c081 andl %d1,%d0 current_state = 47324: 2140 0010 movel %d0,%a0@(16) the_thread->current_state = _States_Clear( state, current_state ); if ( _States_Is_ready( current_state ) ) { 47328: 666e bnes 47398 <_Thread_Clear_state+0xa0> RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 4732a: 2668 008e moveal %a0@(142),%a3 4732e: 3028 0094 movew %a0@(148),%d0 47332: 3213 movew %a3@,%d1 _Priority_Add_to_bit_map( &the_thread->Priority_map ); _Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node); 47334: 2268 008a moveal %a0@(138),%a1 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 47338: 2809 movel %a1,%d4 4733a: 5884 addql #4,%d4 4733c: 8081 orl %d1,%d0 4733e: 2084 movel %d4,%a0@ old_last_node = the_chain->last; 47340: 2469 0008 moveal %a1@(8),%a2 47344: 3680 movew %d0,%a3@ the_chain->last = the_node; 47346: 2348 0008 movel %a0,%a1@(8) _Priority_Major_bit_map |= the_priority_map->ready_major; 4734a: 3039 0005 efec movew 5efec <_Priority_Major_bit_map>,%d0 47350: 3228 0092 movew %a0@(146),%d1 old_last_node->next = the_node; the_node->previous = old_last_node; 47354: 214a 0004 movel %a2,%a0@(4) 47358: 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; 4735a: 2488 movel %a0,%a2@ 4735c: 33c0 0005 efec movew %d0,5efec <_Priority_Major_bit_map> _ISR_Flash( level ); 47362: 2003 movel %d3,%d0 47364: 46c2 movew %d2,%sr 47366: 8082 orl %d2,%d0 47368: 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 ) { 4736a: 2028 0014 movel %a0@(20),%d0 4736e: 2279 0005 efca moveal 5efca <_Thread_Heir>,%a1 47374: b0a9 0014 cmpl %a1@(20),%d0 47378: 641e bccs 47398 <_Thread_Clear_state+0xa0> _Thread_Heir = the_thread; 4737a: 23c8 0005 efca movel %a0,5efca <_Thread_Heir> if ( _Thread_Executing->is_preemptible || 47380: 2079 0005 eff6 moveal 5eff6 <_Thread_Executing>,%a0 47386: 4a28 0075 tstb %a0@(117) 4738a: 6604 bnes 47390 <_Thread_Clear_state+0x98> 4738c: 4a80 tstl %d0 4738e: 6608 bnes 47398 <_Thread_Clear_state+0xa0> <== ALWAYS TAKEN the_thread->current_priority == 0 ) _Context_Switch_necessary = true; 47390: 7001 moveq #1,%d0 47392: 13c0 0005 f006 moveb %d0,5f006 <_Context_Switch_necessary> } } } _ISR_Enable( level ); 47398: 46c2 movew %d2,%sr } 4739a: 4cd7 0c1c moveml %sp@,%d2-%d4/%a2-%a3 4739e: 4e5e unlk %fp ... =============================================================================== 00047524 <_Thread_Delay_ended>: void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { 47524: 4e56 fffc linkw %fp,#-4 Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 47528: 486e fffc pea %fp@(-4) 4752c: 2f2e 0008 movel %fp@(8),%sp@- 47530: 4eb9 0004 76d8 jsr 476d8 <_Thread_Get> switch ( location ) { 47536: 508f addql #8,%sp 47538: 4aae fffc tstl %fp@(-4) 4753c: 661e bnes 4755c <_Thread_Delay_ended+0x38> <== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_Clear_state( 4753e: 2f3c 1000 0018 movel #268435480,%sp@- 47544: 2f00 movel %d0,%sp@- 47546: 4eb9 0004 72f8 jsr 472f8 <_Thread_Clear_state> 4754c: 508f addql #8,%sp 4754e: 2039 0005 ef3c movel 5ef3c <_Thread_Dispatch_disable_level>,%d0 47554: 5380 subql #1,%d0 47556: 23c0 0005 ef3c movel %d0,5ef3c <_Thread_Dispatch_disable_level> | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Thread_Unnest_dispatch(); break; } } 4755c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00047560 <_Thread_Dispatch>: Thread_Control *executing; Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); 47560: 307c 0700 moveaw #1792,%a0 47564: 2208 movel %a0,%d1 * dispatch thread * no dispatch thread */ void _Thread_Dispatch( void ) { 47566: 4e56 ffc8 linkw %fp,#-56 4756a: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ Thread_Control *executing; Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; 4756e: 2479 0005 eff6 moveal 5eff6 <_Thread_Executing>,%a2 _ISR_Disable( level ); 47574: 40c0 movew %sr,%d0 47576: 8280 orl %d0,%d1 47578: 46c1 movew %d1,%sr _ISR_Enable( level ); #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 4757a: 260e movel %fp,%d3 _Timestamp_Subtract( 4757c: 240e movel %fp,%d2 _ISR_Enable( level ); #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 4757e: 5183 subql #8,%d3 _Timestamp_Subtract( 47580: 0682 ffff fff0 addil #-16,%d2 47586: 2e3c 0004 8370 movel #295792,%d7 &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); 4758c: 2c3c 0004 8338 movel #295736,%d6 if ( _Thread_libc_reent ) { executing->libc_reent = *_Thread_libc_reent; *_Thread_libc_reent = heir->libc_reent; } _User_extensions_Thread_switch( executing, heir ); 47592: 2a3c 0004 85e8 movel #296424,%d5 #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); _Context_Restore_fp( &executing->fp_context ); 47598: 4bf9 0004 8a58 lea 48a58 <_CPU_Context_restore_fp>,%a5 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 4759e: 49f9 0004 8a36 lea 48a36 <_CPU_Context_save_fp>,%a4 if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 475a4: 283c 0004 8900 movel #297216,%d4 Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { 475aa: 6000 00d0 braw 4767c <_Thread_Dispatch+0x11c> heir = _Thread_Heir; _Thread_Dispatch_disable_level = 1; 475ae: 7201 moveq #1,%d1 475b0: 23c1 0005 ef3c movel %d1,5ef3c <_Thread_Dispatch_disable_level> ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { heir = _Thread_Heir; 475b6: 2679 0005 efca moveal 5efca <_Thread_Heir>,%a3 _Thread_Dispatch_disable_level = 1; _Context_Switch_necessary = false; 475bc: 4201 clrb %d1 _Thread_Executing = heir; 475be: 23cb 0005 eff6 movel %a3,5eff6 <_Thread_Executing> executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { heir = _Thread_Heir; _Thread_Dispatch_disable_level = 1; _Context_Switch_necessary = false; 475c4: 13c1 0005 f006 moveb %d1,5f006 <_Context_Switch_necessary> _Thread_Executing = heir; #if __RTEMS_ADA__ executing->rtems_ada_self = rtems_ada_self; rtems_ada_self = heir->rtems_ada_self; #endif if ( heir->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE ) 475ca: 7201 moveq #1,%d1 475cc: b2ab 007a cmpl %a3@(122),%d1 475d0: 660a bnes 475dc <_Thread_Dispatch+0x7c> heir->cpu_time_budget = _Thread_Ticks_per_timeslice; 475d2: 41f9 0005 eeec lea 5eeec <_Thread_Ticks_per_timeslice>,%a0 475d8: 2750 0076 movel %a0@,%a3@(118) _ISR_Enable( level ); 475dc: 46c0 movew %d0,%sr #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 475de: 2f03 movel %d3,%sp@- 475e0: 4eb9 0004 b7c8 jsr 4b7c8 <_TOD_Get_uptime> _Timestamp_Subtract( 475e6: 2047 moveal %d7,%a0 475e8: 2f02 movel %d2,%sp@- 475ea: 2f03 movel %d3,%sp@- 475ec: 4879 0005 effe pea 5effe <_Thread_Time_of_last_context_switch> 475f2: 4e90 jsr %a0@ &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); 475f4: 2046 moveal %d6,%a0 475f6: 2f02 movel %d2,%sp@- 475f8: 486a 0082 pea %a2@(130) 475fc: 4e90 jsr %a0@ #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 475fe: 2079 0005 efc6 moveal 5efc6 <_Thread_libc_reent>,%a0 47604: 4fef 0018 lea %sp@(24),%sp &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); _Thread_Time_of_last_context_switch = uptime; 47608: 202e fff8 movel %fp@(-8),%d0 4760c: 222e fffc movel %fp@(-4),%d1 47610: 23c0 0005 effe movel %d0,5effe <_Thread_Time_of_last_context_switch> 47616: 23c1 0005 f002 movel %d1,5f002 <_Thread_Time_of_last_context_switch+0x4> #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 4761c: 4a88 tstl %a0 4761e: 6708 beqs 47628 <_Thread_Dispatch+0xc8> <== NEVER TAKEN executing->libc_reent = *_Thread_libc_reent; 47620: 2550 0106 movel %a0@,%a2@(262) *_Thread_libc_reent = heir->libc_reent; 47624: 20ab 0106 movel %a3@(262),%a0@ } _User_extensions_Thread_switch( executing, heir ); 47628: 2f0b movel %a3,%sp@- 4762a: 2045 moveal %d5,%a0 4762c: 2f0a movel %a2,%sp@- 4762e: 4e90 jsr %a0@ if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 47630: 486b 00ce pea %a3@(206) 47634: 2044 moveal %d4,%a0 47636: 486a 00ce pea %a2@(206) 4763a: 4e90 jsr %a0@ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && 4763c: 4fef 0010 lea %sp@(16),%sp 47640: 4aaa 0102 tstl %a2@(258) 47644: 6724 beqs 4766a <_Thread_Dispatch+0x10a> #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) RTEMS_INLINE_ROUTINE bool _Thread_Is_allocated_fp ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Allocated_fp ); 47646: 2079 0005 efc2 moveal 5efc2 <_Thread_Allocated_fp>,%a0 4764c: b1ca cmpal %a2,%a0 4764e: 671a beqs 4766a <_Thread_Dispatch+0x10a> !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) 47650: 4a88 tstl %a0 47652: 6708 beqs 4765c <_Thread_Dispatch+0xfc> _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 47654: 4868 0102 pea %a0@(258) 47658: 4e94 jsr %a4@ 4765a: 588f addql #4,%sp _Context_Restore_fp( &executing->fp_context ); 4765c: 486a 0102 pea %a2@(258) 47660: 4e95 jsr %a5@ _Thread_Allocated_fp = executing; 47662: 588f addql #4,%sp 47664: 23ca 0005 efc2 movel %a2,5efc2 <_Thread_Allocated_fp> if ( executing->fp_context != NULL ) _Context_Restore_fp( &executing->fp_context ); #endif #endif executing = _Thread_Executing; 4766a: 2479 0005 eff6 moveal 5eff6 <_Thread_Executing>,%a2 _ISR_Disable( level ); 47670: 223c 0000 0700 movel #1792,%d1 47676: 40c0 movew %sr,%d0 47678: 8280 orl %d0,%d1 4767a: 46c1 movew %d1,%sr Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { 4767c: 1239 0005 f006 moveb 5f006 <_Context_Switch_necessary>,%d1 47682: 6600 ff2a bnew 475ae <_Thread_Dispatch+0x4e> executing = _Thread_Executing; _ISR_Disable( level ); } _Thread_Dispatch_disable_level = 0; 47686: 42b9 0005 ef3c clrl 5ef3c <_Thread_Dispatch_disable_level> _ISR_Enable( level ); 4768c: 46c0 movew %d0,%sr if ( _Thread_Do_post_task_switch_extension || 4768e: 4ab9 0005 efde tstl 5efde <_Thread_Do_post_task_switch_extension> 47694: 6606 bnes 4769c <_Thread_Dispatch+0x13c> executing->do_post_task_switch_extension ) { 47696: 4a2a 0074 tstb %a2@(116) 4769a: 670c beqs 476a8 <_Thread_Dispatch+0x148> executing->do_post_task_switch_extension = false; 4769c: 4200 clrb %d0 4769e: 1540 0074 moveb %d0,%a2@(116) _API_extensions_Run_postswitch(); 476a2: 4eb9 0004 6016 jsr 46016 <_API_extensions_Run_postswitch> } } 476a8: 4cee 3cfc ffc8 moveml %fp@(-56),%d2-%d7/%a2-%a5 476ae: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004df68 <_Thread_Evaluate_mode>: * * XXX */ bool _Thread_Evaluate_mode( void ) { 4df68: 4e56 0000 linkw %fp,#0 Thread_Control *executing; executing = _Thread_Executing; 4df6c: 2079 0005 eff6 moveal 5eff6 <_Thread_Executing>,%a0 if ( !_States_Is_ready( executing->current_state ) || 4df72: 4aa8 0010 tstl %a0@(16) 4df76: 660e bnes 4df86 <_Thread_Evaluate_mode+0x1e> <== NEVER TAKEN 4df78: b1f9 0005 efca cmpal 5efca <_Thread_Heir>,%a0 4df7e: 6710 beqs 4df90 <_Thread_Evaluate_mode+0x28> ( !_Thread_Is_heir( executing ) && executing->is_preemptible ) ) { 4df80: 4a28 0075 tstb %a0@(117) 4df84: 670a beqs 4df90 <_Thread_Evaluate_mode+0x28> <== NEVER TAKEN _Context_Switch_necessary = true; 4df86: 7001 moveq #1,%d0 4df88: 13c0 0005 f006 moveb %d0,5f006 <_Context_Switch_necessary> return true; 4df8e: 6002 bras 4df92 <_Thread_Evaluate_mode+0x2a> 4df90: 4200 clrb %d0 } return false; } 4df92: 4e5e unlk %fp ... =============================================================================== 0004df98 <_Thread_Handler>: * * Output parameters: NONE */ void _Thread_Handler( void ) { 4df98: 4e56 0000 linkw %fp,#0 4df9c: 2f0a movel %a2,%sp@- #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static char doneConstructors; char doneCons; #endif executing = _Thread_Executing; 4df9e: 2479 0005 eff6 moveal 5eff6 <_Thread_Executing>,%a2 * * Output parameters: NONE */ void _Thread_Handler( void ) { 4dfa4: 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; 4dfa6: 222a 00b4 movel %a2@(180),%d1 _ISR_Set_level(level); 4dfaa: 40c0 movew %sr,%d0 4dfac: e189 lsll #8,%d1 4dfae: 0280 0000 f8ff andil #63743,%d0 4dfb4: 8081 orl %d1,%d0 4dfb6: 46c0 movew %d0,%sr #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) doneCons = doneConstructors; doneConstructors = 1; 4dfb8: 7001 moveq #1,%d0 level = executing->Start.isr_level; _ISR_Set_level(level); #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) doneCons = doneConstructors; 4dfba: 1439 0005 e6f0 moveb 5e6f0 ,%d2 doneConstructors = 1; 4dfc0: 13c0 0005 e6f0 moveb %d0,5e6f0 #endif #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && 4dfc6: 4aaa 0102 tstl %a2@(258) 4dfca: 6720 beqs 4dfec <_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 ); 4dfcc: 2079 0005 efc2 moveal 5efc2 <_Thread_Allocated_fp>,%a0 4dfd2: b1ca cmpal %a2,%a0 4dfd4: 6716 beqs 4dfec <_Thread_Handler+0x54> !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) 4dfd6: 4a88 tstl %a0 4dfd8: 670c beqs 4dfe6 <_Thread_Handler+0x4e> _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 4dfda: 4868 0102 pea %a0@(258) 4dfde: 4eb9 0004 8a36 jsr 48a36 <_CPU_Context_save_fp> 4dfe4: 588f addql #4,%sp _Thread_Allocated_fp = executing; 4dfe6: 23ca 0005 efc2 movel %a2,5efc2 <_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 ); 4dfec: 2f0a movel %a2,%sp@- 4dfee: 4eb9 0004 8468 jsr 48468 <_User_extensions_Thread_begin> /* * At this point, the dispatch disable level BETTER be 1. */ _Thread_Enable_dispatch(); 4dff4: 4eb9 0004 76b2 jsr 476b2 <_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) */ { 4dffa: 588f addql #4,%sp 4dffc: 4a02 tstb %d2 4dffe: 6606 bnes 4e006 <_Thread_Handler+0x6e> INIT_NAME (); 4e000: 4eb9 0005 b8c0 jsr 5b8c0 <_init> } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 4e006: 202a 009e movel %a2@(158),%d0 4e00a: 6606 bnes 4e012 <_Thread_Handler+0x7a> executing->Wait.return_argument = (*(Thread_Entry_numeric) executing->Start.entry_point)( 4e00c: 2f2a 00a6 movel %a2@(166),%sp@- 4e010: 600a bras 4e01c <_Thread_Handler+0x84> executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { 4e012: 7201 moveq #1,%d1 4e014: b280 cmpl %d0,%d1 4e016: 6610 bnes 4e028 <_Thread_Handler+0x90> <== NEVER TAKEN executing->Wait.return_argument = (*(Thread_Entry_pointer) executing->Start.entry_point)( 4e018: 2f2a 00a2 movel %a2@(162),%sp@- 4e01c: 206a 009a moveal %a2@(154),%a0 4e020: 4e90 jsr %a0@ executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { executing->Wait.return_argument = 4e022: 588f addql #4,%sp 4e024: 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 ); 4e028: 2f0a movel %a2,%sp@- 4e02a: 4eb9 0004 84a0 jsr 484a0 <_User_extensions_Thread_exitted> _Internal_error_Occurred( 4e030: 4878 0006 pea 6 4e034: 4878 0001 pea 1 4e038: 42a7 clrl %sp@- 4e03a: 4eb9 0004 6930 jsr 46930 <_Internal_error_Occurred> =============================================================================== 00047764 <_Thread_Initialize>: Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 47764: 4e56 ffe8 linkw %fp,#-24 47768: 222e 0010 movel %fp@(16),%d1 4776c: 48d7 047c moveml %d2-%d6/%a2,%sp@ 47770: 246e 000c moveal %fp@(12),%a2 47774: 242e 0014 movel %fp@(20),%d2 47778: 282e 001c movel %fp@(28),%d4 4777c: 2a2e 0024 movel %fp@(36),%d5 /* * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; 47780: 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 ) { 47784: 162e 001b moveb %fp@(27),%d3 /* * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; 47788: 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 ) { 4778c: 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; 47790: 42aa 0112 clrl %a2@(274) extensions_area = NULL; the_thread->libc_reent = NULL; 47794: 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 ) { 47798: 4a81 tstl %d1 4779a: 6620 bnes 477bc <_Thread_Initialize+0x58> actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); 4779c: 2f02 movel %d2,%sp@- 4779e: 2f0a movel %a2,%sp@- 477a0: 4eb9 0004 8044 jsr 48044 <_Thread_Stack_Allocate> if ( !actual_stack_size || actual_stack_size < stack_size ) 477a6: 508f addql #8,%sp 477a8: 4a80 tstl %d0 477aa: 6700 0176 beqw 47922 <_Thread_Initialize+0x1be> 477ae: b480 cmpl %d0,%d2 477b0: 6200 0170 bhiw 47922 <_Thread_Initialize+0x1be> return false; /* stack allocation failed */ stack = the_thread->Start.stack; 477b4: 222a 00ca movel %a2@(202),%d1 the_thread->Start.core_allocated_stack = true; 477b8: 7401 moveq #1,%d2 477ba: 6004 bras 477c0 <_Thread_Initialize+0x5c> } else { stack = stack_area; actual_stack_size = stack_size; the_thread->Start.core_allocated_stack = false; 477bc: 2002 movel %d2,%d0 477be: 4202 clrb %d2 Stack_Control *the_stack, void *starting_address, size_t size ) { the_stack->area = starting_address; 477c0: 2541 00c2 movel %d1,%a2@(194) 477c4: 1542 00bc moveb %d2,%a2@(188) the_stack->size = size; 477c8: 2540 00be movel %d0,%a2@(190) /* * Allocate the floating point area for this thread */ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( is_fp ) { 477cc: 4a03 tstb %d3 477ce: 6604 bnes 477d4 <_Thread_Initialize+0x70> 477d0: 4283 clrl %d3 477d2: 6016 bras 477ea <_Thread_Initialize+0x86> fp_area = _Workspace_Allocate( CONTEXT_FP_SIZE ); 477d4: 4878 001c pea 1c 477d8: 4eb9 0004 8868 jsr 48868 <_Workspace_Allocate> if ( !fp_area ) 477de: 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 ); 477e0: 2600 movel %d0,%d3 if ( !fp_area ) 477e2: 6606 bnes 477ea <_Thread_Initialize+0x86> 477e4: 4282 clrl %d2 477e6: 6000 00d4 braw 478bc <_Thread_Initialize+0x158> #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { 477ea: 2039 0005 efda movel 5efda <_Thread_Maximum_extensions>,%d0 fp_area = _Workspace_Allocate( CONTEXT_FP_SIZE ); if ( !fp_area ) goto failed; fp_area = _Context_Fp_start( fp_area, 0 ); } the_thread->fp_context = fp_area; 477f0: 2543 0102 movel %d3,%a2@(258) the_thread->Start.fp_context = fp_area; 477f4: 2543 00c6 movel %d3,%a2@(198) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 477f8: 42aa 0050 clrl %a2@(80) the_watchdog->routine = routine; 477fc: 42aa 0064 clrl %a2@(100) the_watchdog->id = id; 47800: 42aa 0068 clrl %a2@(104) the_watchdog->user_data = user_data; 47804: 42aa 006c clrl %a2@(108) #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { 47808: 4a80 tstl %d0 4780a: 6604 bnes 47810 <_Thread_Initialize+0xac> 4780c: 4282 clrl %d2 4780e: 6016 bras 47826 <_Thread_Initialize+0xc2> extensions_area = _Workspace_Allocate( 47810: e588 lsll #2,%d0 47812: 2040 moveal %d0,%a0 47814: 4868 0004 pea %a0@(4) 47818: 4eb9 0004 8868 jsr 48868 <_Workspace_Allocate> (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) 4781e: 588f addql #4,%sp /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { extensions_area = _Workspace_Allocate( 47820: 2400 movel %d0,%d2 (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) 47822: 6700 0098 beqw 478bc <_Thread_Initialize+0x158> goto failed; } the_thread->extensions = (void **) extensions_area; 47826: 2542 0116 movel %d2,%a2@(278) * if they are linked to the thread. An extension user may * create the extension long after tasks have been created * so they cannot rely on the thread create user extension * call. */ if ( the_thread->extensions ) { 4782a: 6718 beqs 47844 <_Thread_Initialize+0xe0> for ( i = 0; i <= _Thread_Maximum_extensions ; i++ ) 4782c: 2239 0005 efda movel 5efda <_Thread_Maximum_extensions>,%d1 47832: 4280 clrl %d0 47834: 600a bras 47840 <_Thread_Initialize+0xdc> the_thread->extensions[i] = NULL; 47836: 206a 0116 moveal %a2@(278),%a0 4783a: 42b0 0c00 clrl %a0@(00000000,%d0:l:4) * create the extension long after tasks have been created * so they cannot rely on the thread create user extension * call. */ if ( the_thread->extensions ) { for ( i = 0; i <= _Thread_Maximum_extensions ; i++ ) 4783e: 5280 addql #1,%d0 47840: b280 cmpl %d0,%d1 47842: 64f2 bccs 47836 <_Thread_Initialize+0xd2> /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; 47844: 2545 00ac movel %d5,%a2@(172) the_thread->Start.budget_callout = budget_callout; switch ( budget_algorithm ) { 47848: 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; 4784a: 256e 0028 00b0 movel %fp@(40),%a2@(176) /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; 47850: 1546 00aa moveb %d6,%a2@(170) the_thread->Start.budget_algorithm = budget_algorithm; the_thread->Start.budget_callout = budget_callout; switch ( budget_algorithm ) { 47854: b085 cmpl %d5,%d0 47856: 660a bnes 47862 <_Thread_Initialize+0xfe> 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; 47858: 41f9 0005 eeec lea 5eeec <_Thread_Ticks_per_timeslice>,%a0 4785e: 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 ); 47862: 2f04 movel %d4,%sp@- case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; 47864: 256e 002c 00b4 movel %fp@(44),%a2@(180) the_thread->current_state = STATES_DORMANT; 4786a: 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 ); 4786c: 2f0a movel %a2,%sp@- #endif } the_thread->Start.isr_level = isr_level; the_thread->current_state = STATES_DORMANT; 4786e: 2540 0010 movel %d0,%a2@(16) the_thread->Wait.queue = NULL; 47872: 42aa 0044 clrl %a2@(68) the_thread->resource_count = 0; 47876: 42aa 001c clrl %a2@(28) #if defined(RTEMS_ITRON_API) the_thread->suspend_count = 0; #endif the_thread->real_priority = priority; 4787a: 2544 0018 movel %d4,%a2@(24) the_thread->Start.initial_priority = priority; 4787e: 2544 00b8 movel %d4,%a2@(184) _Thread_Set_priority( the_thread, priority ); 47882: 4eb9 0004 7e70 jsr 47e70 <_Thread_Set_priority> #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 47888: 206e 0008 moveal %fp@(8),%a0 4788c: 4280 clrl %d0 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 4788e: 256e 0030 000c movel %fp@(48),%a2@(12) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 47894: 2068 0018 moveal %a0@(24),%a0 47898: 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 ); 4789c: 42aa 0082 clrl %a2@(130) 478a0: 218a 0c00 movel %a2,%a0@(00000000,%d0:l:4) 478a4: 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 ); 478a8: 2f0a movel %a2,%sp@- 478aa: 4eb9 0004 8524 jsr 48524 <_User_extensions_Thread_create> if ( extension_status ) 478b0: 4fef 000c lea %sp@(12),%sp 478b4: 4a00 tstb %d0 478b6: 6704 beqs 478bc <_Thread_Initialize+0x158> 478b8: 7001 moveq #1,%d0 478ba: 6068 bras 47924 <_Thread_Initialize+0x1c0> return true; failed: if ( the_thread->libc_reent ) 478bc: 202a 0106 movel %a2@(262),%d0 478c0: 670a beqs 478cc <_Thread_Initialize+0x168> _Workspace_Free( the_thread->libc_reent ); 478c2: 2f00 movel %d0,%sp@- 478c4: 4eb9 0004 8884 jsr 48884 <_Workspace_Free> 478ca: 588f addql #4,%sp for ( i=0 ; i <= THREAD_API_LAST ; i++ ) if ( the_thread->API_Extensions[i] ) 478cc: 202a 010a movel %a2@(266),%d0 478d0: 670a beqs 478dc <_Thread_Initialize+0x178> _Workspace_Free( the_thread->API_Extensions[i] ); 478d2: 2f00 movel %d0,%sp@- 478d4: 4eb9 0004 8884 jsr 48884 <_Workspace_Free> 478da: 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] ) 478dc: 202a 010e movel %a2@(270),%d0 478e0: 670a beqs 478ec <_Thread_Initialize+0x188> _Workspace_Free( the_thread->API_Extensions[i] ); 478e2: 2f00 movel %d0,%sp@- 478e4: 4eb9 0004 8884 jsr 48884 <_Workspace_Free> 478ea: 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] ) 478ec: 202a 0112 movel %a2@(274),%d0 478f0: 670a beqs 478fc <_Thread_Initialize+0x198> <== ALWAYS TAKEN _Workspace_Free( the_thread->API_Extensions[i] ); 478f2: 2f00 movel %d0,%sp@- <== NOT EXECUTED 478f4: 4eb9 0004 8884 jsr 48884 <_Workspace_Free> <== NOT EXECUTED 478fa: 588f addql #4,%sp <== NOT EXECUTED if ( extensions_area ) 478fc: 4a82 tstl %d2 478fe: 670a beqs 4790a <_Thread_Initialize+0x1a6> (void) _Workspace_Free( extensions_area ); 47900: 2f02 movel %d2,%sp@- 47902: 4eb9 0004 8884 jsr 48884 <_Workspace_Free> 47908: 588f addql #4,%sp #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( fp_area ) 4790a: 4a83 tstl %d3 4790c: 670a beqs 47918 <_Thread_Initialize+0x1b4> (void) _Workspace_Free( fp_area ); 4790e: 2f03 movel %d3,%sp@- 47910: 4eb9 0004 8884 jsr 48884 <_Workspace_Free> 47916: 588f addql #4,%sp #endif _Thread_Stack_Free( the_thread ); 47918: 2f0a movel %a2,%sp@- 4791a: 4eb9 0004 8090 jsr 48090 <_Thread_Stack_Free> return false; 47920: 588f addql #4,%sp 47922: 4200 clrb %d0 } 47924: 4cee 047c ffe8 moveml %fp@(-24),%d2-%d6/%a2 4792a: 4e5e unlk %fp ... =============================================================================== 000485e4 <_Thread_Restart>: Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { if ( !_States_Is_dormant( the_thread->current_state ) ) { 485e4: 7001 moveq #1,%d0 bool _Thread_Restart( Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { 485e6: 4e56 0000 linkw %fp,#0 485ea: 2f0a movel %a2,%sp@- 485ec: 246e 0008 moveal %fp@(8),%a2 if ( !_States_Is_dormant( the_thread->current_state ) ) { 485f0: c0aa 0010 andl %a2@(16),%d0 485f4: 4a00 tstb %d0 485f6: 6704 beqs 485fc <_Thread_Restart+0x18> 485f8: 4200 clrb %d0 485fa: 6064 bras 48660 <_Thread_Restart+0x7c> _Thread_Set_transient( the_thread ); 485fc: 2f0a movel %a2,%sp@- 485fe: 4eb9 0004 87c0 jsr 487c0 <_Thread_Set_transient> _Thread_Reset( the_thread, pointer_argument, numeric_argument ); 48604: 2f2e 0010 movel %fp@(16),%sp@- 48608: 2f2e 000c movel %fp@(12),%sp@- 4860c: 2f0a movel %a2,%sp@- 4860e: 4eb9 0004 c6b8 jsr 4c6b8 <_Thread_Reset> _Thread_Load_environment( the_thread ); 48614: 2f0a movel %a2,%sp@- 48616: 4eb9 0004 c354 jsr 4c354 <_Thread_Load_environment> _Thread_Ready( the_thread ); 4861c: 2f0a movel %a2,%sp@- 4861e: 4eb9 0004 c5f8 jsr 4c5f8 <_Thread_Ready> _User_extensions_Thread_restart( the_thread ); 48624: 2f0a movel %a2,%sp@- 48626: 4eb9 0004 8da0 jsr 48da0 <_User_extensions_Thread_restart> if ( _Thread_Is_executing ( the_thread ) ) 4862c: 4fef 001c lea %sp@(28),%sp 48630: b5f9 0005 faee cmpal 5faee <_Thread_Executing>,%a2 48636: 6626 bnes 4865e <_Thread_Restart+0x7a> */ RTEMS_INLINE_ROUTINE void _Thread_Restart_self( void ) { #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( _Thread_Executing->fp_context != NULL ) 48638: 4aaa 0102 tstl %a2@(258) 4863c: 670c beqs 4864a <_Thread_Restart+0x66> _Context_Restore_fp( &_Thread_Executing->fp_context ); 4863e: 486a 0102 pea %a2@(258) 48642: 4eb9 0004 9290 jsr 49290 <_CPU_Context_restore_fp> 48648: 588f addql #4,%sp #endif _CPU_Context_Restart_self( &_Thread_Executing->Registers ); 4864a: 2079 0005 faee moveal 5faee <_Thread_Executing>,%a0 48650: 41e8 00ce lea %a0@(206),%a0 48654: 2f08 movel %a0,%sp@- 48656: 4eb9 0004 914e jsr 4914e <_CPU_Context_Restart_self> 4865c: 588f addql #4,%sp <== NOT EXECUTED 4865e: 7001 moveq #1,%d0 return true; } return false; } 48660: 246e fffc moveal %fp@(-4),%a2 48664: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004ad58 <_Thread_Resume>: void _Thread_Resume( Thread_Control *the_thread, bool force ) { 4ad58: 4e56 ffec linkw %fp,#-20 4ad5c: 206e 0008 moveal %fp@(8),%a0 4ad60: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ ISR_Level level; States_Control current_state; _ISR_Disable( level ); 4ad64: 243c 0000 0700 movel #1792,%d2 4ad6a: 2002 movel %d2,%d0 4ad6c: 40c1 movew %sr,%d1 4ad6e: 8081 orl %d1,%d0 4ad70: 46c0 movew %d0,%sr _ISR_Enable( level ); return; } #endif current_state = the_thread->current_state; 4ad72: 2028 0010 movel %a0@(16),%d0 if ( current_state & STATES_SUSPENDED ) { 4ad76: 0800 0001 btst #1,%d0 4ad7a: 6778 beqs 4adf4 <_Thread_Resume+0x9c> <== NEVER TAKEN 4ad7c: 76fd moveq #-3,%d3 4ad7e: c083 andl %d3,%d0 current_state = 4ad80: 2140 0010 movel %d0,%a0@(16) the_thread->current_state = _States_Clear(STATES_SUSPENDED, current_state); if ( _States_Is_ready( current_state ) ) { 4ad84: 666e bnes 4adf4 <_Thread_Resume+0x9c> RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 4ad86: 2668 008e moveal %a0@(142),%a3 4ad8a: 3028 0094 movew %a0@(148),%d0 4ad8e: 3613 movew %a3@,%d3 _Priority_Add_to_bit_map( &the_thread->Priority_map ); _Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node); 4ad90: 2268 008a moveal %a0@(138),%a1 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 4ad94: 2809 movel %a1,%d4 4ad96: 5884 addql #4,%d4 4ad98: 8083 orl %d3,%d0 4ad9a: 2084 movel %d4,%a0@ old_last_node = the_chain->last; 4ad9c: 2469 0008 moveal %a1@(8),%a2 4ada0: 3680 movew %d0,%a3@ the_chain->last = the_node; 4ada2: 2348 0008 movel %a0,%a1@(8) _Priority_Major_bit_map |= the_priority_map->ready_major; 4ada6: 3039 0006 2324 movew 62324 <_Priority_Major_bit_map>,%d0 4adac: 3628 0092 movew %a0@(146),%d3 old_last_node->next = the_node; the_node->previous = old_last_node; 4adb0: 214a 0004 movel %a2,%a0@(4) 4adb4: 8083 orl %d3,%d0 Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; the_chain->last = the_node; old_last_node->next = the_node; 4adb6: 2488 movel %a0,%a2@ 4adb8: 33c0 0006 2324 movew %d0,62324 <_Priority_Major_bit_map> _ISR_Flash( level ); 4adbe: 2002 movel %d2,%d0 4adc0: 46c1 movew %d1,%sr 4adc2: 8081 orl %d1,%d0 4adc4: 46c0 movew %d0,%sr if ( the_thread->current_priority < _Thread_Heir->current_priority ) { 4adc6: 2028 0014 movel %a0@(20),%d0 4adca: 2279 0006 2302 moveal 62302 <_Thread_Heir>,%a1 4add0: b0a9 0014 cmpl %a1@(20),%d0 4add4: 641e bccs 4adf4 <_Thread_Resume+0x9c> _Thread_Heir = the_thread; 4add6: 23c8 0006 2302 movel %a0,62302 <_Thread_Heir> if ( _Thread_Executing->is_preemptible || 4addc: 2079 0006 232e moveal 6232e <_Thread_Executing>,%a0 4ade2: 4a28 0075 tstb %a0@(117) 4ade6: 6604 bnes 4adec <_Thread_Resume+0x94> 4ade8: 4a80 tstl %d0 4adea: 6608 bnes 4adf4 <_Thread_Resume+0x9c> <== ALWAYS TAKEN the_thread->current_priority == 0 ) _Context_Switch_necessary = true; 4adec: 7001 moveq #1,%d0 4adee: 13c0 0006 233e moveb %d0,6233e <_Context_Switch_necessary> } } } _ISR_Enable( level ); 4adf4: 46c1 movew %d1,%sr } 4adf6: 4cd7 0c1c moveml %sp@,%d2-%d4/%a2-%a3 4adfa: 4e5e unlk %fp ... =============================================================================== 00048090 <_Thread_Stack_Free>: */ void _Thread_Stack_Free( Thread_Control *the_thread ) { 48090: 4e56 0000 linkw %fp,#0 48094: 206e 0008 moveal %fp@(8),%a0 #if defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API) /* * If the API provided the stack space, then don't free it. */ if ( !the_thread->Start.core_allocated_stack ) 48098: 4a28 00bc tstb %a0@(188) 4809c: 6722 beqs 480c0 <_Thread_Stack_Free+0x30> <== NEVER TAKEN * Call ONLY the CPU table stack free hook, or the * the RTEMS workspace free. This is so the free * routine properly matches the allocation of the stack. */ if ( Configuration.stack_free_hook ) 4809e: 2279 0005 d788 moveal 5d788 ,%a1 480a4: 4a89 tstl %a1 480a6: 670a beqs 480b2 <_Thread_Stack_Free+0x22> (*Configuration.stack_free_hook)( the_thread->Start.Initial_stack.area ); 480a8: 2d68 00c2 0008 movel %a0@(194),%fp@(8) else _Workspace_Free( the_thread->Start.Initial_stack.area ); } 480ae: 4e5e unlk %fp * the RTEMS workspace free. This is so the free * routine properly matches the allocation of the stack. */ if ( Configuration.stack_free_hook ) (*Configuration.stack_free_hook)( the_thread->Start.Initial_stack.area ); 480b0: 4ed1 jmp %a1@ else _Workspace_Free( the_thread->Start.Initial_stack.area ); 480b2: 2d68 00c2 0008 movel %a0@(194),%fp@(8) } 480b8: 4e5e unlk %fp */ if ( Configuration.stack_free_hook ) (*Configuration.stack_free_hook)( the_thread->Start.Initial_stack.area ); else _Workspace_Free( the_thread->Start.Initial_stack.area ); 480ba: 4ef9 0004 8884 jmp 48884 <_Workspace_Free> } 480c0: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004824c <_Thread_Tickle_timeslice>: * * Output parameters: NONE */ void _Thread_Tickle_timeslice( void ) { 4824c: 4e56 0000 linkw %fp,#0 48250: 2f0a movel %a2,%sp@- Thread_Control *executing; executing = _Thread_Executing; 48252: 2479 0005 eff6 moveal 5eff6 <_Thread_Executing>,%a2 /* * If the thread is not preemptible or is not ready, then * just return. */ if ( !executing->is_preemptible ) 48258: 4a2a 0075 tstb %a2@(117) 4825c: 6756 beqs 482b4 <_Thread_Tickle_timeslice+0x68> return; if ( !_States_Is_ready( executing->current_state ) ) 4825e: 4aaa 0010 tstl %a2@(16) 48262: 6650 bnes 482b4 <_Thread_Tickle_timeslice+0x68> /* * The cpu budget algorithm determines what happens next. */ switch ( executing->budget_algorithm ) { 48264: 202a 007a movel %a2@(122),%d0 48268: 7201 moveq #1,%d1 4826a: b280 cmpl %d0,%d1 4826c: 6246 bhis 482b4 <_Thread_Tickle_timeslice+0x68> 4826e: 123c 0002 moveb #2,%d1 48272: b280 cmpl %d0,%d1 48274: 640a bccs 48280 <_Thread_Tickle_timeslice+0x34> 48276: 123c 0003 moveb #3,%d1 4827a: b280 cmpl %d0,%d1 4827c: 6636 bnes 482b4 <_Thread_Tickle_timeslice+0x68> <== NEVER TAKEN 4827e: 601e bras 4829e <_Thread_Tickle_timeslice+0x52> case THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE: #if defined(RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE) case THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE: #endif if ( (int)(--executing->cpu_time_budget) <= 0 ) { 48280: 202a 0076 movel %a2@(118),%d0 48284: 5380 subql #1,%d0 48286: 2540 0076 movel %d0,%a2@(118) 4828a: 6e28 bgts 482b4 <_Thread_Tickle_timeslice+0x68> _Thread_Reset_timeslice(); 4828c: 4eb9 0004 be80 jsr 4be80 <_Thread_Reset_timeslice> executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 48292: 41f9 0005 eeec lea 5eeec <_Thread_Ticks_per_timeslice>,%a0 48298: 2550 0076 movel %a0@,%a2@(118) 4829c: 6016 bras 482b4 <_Thread_Tickle_timeslice+0x68> } break; #if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT) case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: if ( --executing->cpu_time_budget == 0 ) 4829e: 202a 0076 movel %a2@(118),%d0 482a2: 5380 subql #1,%d0 482a4: 2540 0076 movel %d0,%a2@(118) 482a8: 660a bnes 482b4 <_Thread_Tickle_timeslice+0x68> (*executing->budget_callout)( executing ); 482aa: 2f0a movel %a2,%sp@- 482ac: 206a 007e moveal %a2@(126),%a0 482b0: 4e90 jsr %a0@ 482b2: 588f addql #4,%sp break; #endif } } 482b4: 246e fffc moveal %fp@(-4),%a2 482b8: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000482bc <_Thread_Yield_processor>: * ready chain * select heir */ void _Thread_Yield_processor( void ) { 482bc: 4e56 fff4 linkw %fp,#-12 ISR_Level level; Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; 482c0: 2079 0005 eff6 moveal 5eff6 <_Thread_Executing>,%a0 * ready chain * select heir */ void _Thread_Yield_processor( void ) { 482c6: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; ready = executing->ready; _ISR_Disable( level ); 482ca: 243c 0000 0700 movel #1792,%d2 482d0: 2002 movel %d2,%d0 ISR_Level level; Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; ready = executing->ready; 482d2: 2268 008a moveal %a0@(138),%a1 _ISR_Disable( level ); 482d6: 40c1 movew %sr,%d1 482d8: 8081 orl %d1,%d0 482da: 46c0 movew %d0,%sr if ( !_Chain_Has_only_one_node( ready ) ) { 482dc: 2029 0008 movel %a1@(8),%d0 482e0: b091 cmpl %a1@,%d0 482e2: 6738 beqs 4831c <_Thread_Yield_processor+0x60> ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 482e4: 2450 moveal %a0@,%a2 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 482e6: 2009 movel %a1,%d0 482e8: 5880 addql #4,%d0 { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 482ea: 2668 0004 moveal %a0@(4),%a3 next->previous = previous; previous->next = next; 482ee: 268a movel %a2,%a3@ Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 482f0: 254b 0004 movel %a3,%a2@(4) Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 482f4: 2080 movel %d0,%a0@ old_last_node = the_chain->last; 482f6: 2469 0008 moveal %a1@(8),%a2 the_chain->last = the_node; 482fa: 2348 0008 movel %a0,%a1@(8) old_last_node->next = the_node; the_node->previous = old_last_node; 482fe: 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; 48302: 2488 movel %a0,%a2@ _Chain_Extract_unprotected( &executing->Object.Node ); _Chain_Append_unprotected( ready, &executing->Object.Node ); _ISR_Flash( level ); 48304: 2002 movel %d2,%d0 48306: 46c1 movew %d1,%sr 48308: 8081 orl %d1,%d0 4830a: 46c0 movew %d0,%sr if ( _Thread_Is_heir( executing ) ) 4830c: b1f9 0005 efca cmpal 5efca <_Thread_Heir>,%a0 48312: 6610 bnes 48324 <_Thread_Yield_processor+0x68> <== NEVER TAKEN _Thread_Heir = (Thread_Control *) ready->first; 48314: 23d1 0005 efca movel %a1@,5efca <_Thread_Heir> 4831a: 6008 bras 48324 <_Thread_Yield_processor+0x68> _Context_Switch_necessary = true; } else if ( !_Thread_Is_heir( executing ) ) 4831c: b1f9 0005 efca cmpal 5efca <_Thread_Heir>,%a0 48322: 6708 beqs 4832c <_Thread_Yield_processor+0x70> <== ALWAYS TAKEN _Context_Switch_necessary = true; 48324: 7001 moveq #1,%d0 48326: 13c0 0005 f006 moveb %d0,5f006 <_Context_Switch_necessary> _ISR_Enable( level ); 4832c: 46c1 movew %d1,%sr } 4832e: 4cd7 0c04 moveml %sp@,%d2/%a2-%a3 48332: 4e5e unlk %fp ... =============================================================================== 00047168 <_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 ) ) { 47168: 7202 moveq #2,%d1 Thread_blocking_operation_States sync_state __attribute__((unused)), #endif Thread_Control *the_thread, ISR_Level level ) { 4716a: 4e56 0000 linkw %fp,#0 4716e: 202e 0010 movel %fp@(16),%d0 47172: 2f0a movel %a2,%sp@- 47174: 246e 000c moveal %fp@(12),%a2 #endif /* * The thread is not waiting on anything after this completes. */ the_thread->Wait.queue = NULL; 47178: 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 ) ) { 4717c: b2aa 0050 cmpl %a2@(80),%d1 47180: 6618 bnes 4719a <_Thread_blocking_operation_Cancel+0x32> RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 47182: 123c 0003 moveb #3,%d1 47186: 2541 0050 movel %d1,%a2@(80) _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 4718a: 46c0 movew %d0,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 4718c: 486a 0048 pea %a2@(72) 47190: 4eb9 0004 873c jsr 4873c <_Watchdog_Remove> 47196: 588f addql #4,%sp 47198: 6002 bras 4719c <_Thread_blocking_operation_Cancel+0x34> } else _ISR_Enable( level ); 4719a: 46c0 movew %d0,%sr RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 4719c: 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 } 471a0: 246e fffc moveal %fp@(-4),%a2 471a4: 203c 1003 fff8 movel #268697592,%d0 471aa: 2d40 000c movel %d0,%fp@(12) 471ae: 4e5e unlk %fp 471b0: 4ef9 0004 72f8 jmp 472f8 <_Thread_Clear_state> ... =============================================================================== 00047be4 <_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 ) { 47be4: 4e56 ffe4 linkw %fp,#-28 47be8: 206e 000c moveal %fp@(12),%a0 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 47bec: 43e8 003c lea %a0@(60),%a1 Priority_Control priority; States_Control block_state; _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; 47bf0: 2028 0014 movel %a0@(20),%d0 Thread_blocking_operation_States _Thread_queue_Enqueue_priority ( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, ISR_Level *level_p ) { 47bf4: 48d7 0c7c moveml %d2-%d6/%a2-%a3,%sp@ _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; 47bf8: 2400 movel %d0,%d2 47bfa: ec8a lsrl #6,%d2 47bfc: 2202 movel %d2,%d1 return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); 47bfe: 283c 0000 0700 movel #1792,%d4 _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; 47c04: e989 lsll #4,%d1 47c06: e58a lsll #2,%d2 Thread_blocking_operation_States _Thread_queue_Enqueue_priority ( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, ISR_Level *level_p ) { 47c08: 246e 0008 moveal %fp@(8),%a2 _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; 47c0c: 9282 subl %d2,%d1 47c0e: 47f2 1800 lea %a2@(00000000,%d1:l),%a3 47c12: 2149 0038 movel %a1,%a0@(56) the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 47c16: 43e8 0038 lea %a0@(56),%a1 block_state = the_thread_queue->state; 47c1a: 2a2a 0038 movel %a2@(56),%d5 47c1e: 2149 0040 movel %a1,%a0@(64) RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 47c22: 42a8 003c clrl %a0@(60) if ( _Thread_queue_Is_reverse_search( priority ) ) 47c26: 0800 0005 btst #5,%d0 47c2a: 6660 bnes 47c8c <_Thread_queue_Enqueue_priority+0xa8> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 47c2c: 2c0b movel %a3,%d6 47c2e: 5886 addql #4,%d6 goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); 47c30: 2404 movel %d4,%d2 47c32: 40c1 movew %sr,%d1 47c34: 8481 orl %d1,%d2 47c36: 46c2 movew %d2,%sr search_thread = (Thread_Control *) header->first; 47c38: 2253 moveal %a3@,%a1 47c3a: 76ff moveq #-1,%d3 while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 47c3c: 601e bras 47c5c <_Thread_queue_Enqueue_priority+0x78> search_priority = search_thread->current_priority; 47c3e: 2629 0014 movel %a1@(20),%d3 if ( priority <= search_priority ) 47c42: b680 cmpl %d0,%d3 47c44: 641a bccs 47c60 <_Thread_queue_Enqueue_priority+0x7c> break; search_priority = search_thread->current_priority; if ( priority <= search_priority ) break; #endif _ISR_Flash( level ); 47c46: 2404 movel %d4,%d2 47c48: 46c1 movew %d1,%sr 47c4a: 8481 orl %d1,%d2 47c4c: 46c2 movew %d2,%sr if ( !_States_Are_set( search_thread->current_state, block_state) ) { 47c4e: 2405 movel %d5,%d2 47c50: c4a9 0010 andl %a1@(16),%d2 47c54: 6604 bnes 47c5a <_Thread_queue_Enqueue_priority+0x76><== ALWAYS TAKEN _ISR_Enable( level ); 47c56: 46c1 movew %d1,%sr <== NOT EXECUTED goto restart_forward_search; 47c58: 60d6 bras 47c30 <_Thread_queue_Enqueue_priority+0x4c><== NOT EXECUTED } search_thread = (Thread_Control *)search_thread->Object.Node.next; 47c5a: 2251 moveal %a1@,%a1 restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); search_thread = (Thread_Control *) header->first; while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 47c5c: bc89 cmpl %a1,%d6 47c5e: 66de bnes 47c3e <_Thread_queue_Enqueue_priority+0x5a> 47c60: 2401 movel %d1,%d2 } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 47c62: 7801 moveq #1,%d4 47c64: b8aa 0030 cmpl %a2@(48),%d4 47c68: 6600 00a4 bnew 47d0e <_Thread_queue_Enqueue_priority+0x12a> THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 47c6c: 42aa 0030 clrl %a2@(48) if ( priority == search_priority ) 47c70: b680 cmpl %d0,%d3 47c72: 677e beqs 47cf2 <_Thread_queue_Enqueue_priority+0x10e> goto equal_priority; search_node = (Chain_Node *) search_thread; previous_node = search_node->previous; 47c74: 2669 0004 moveal %a1@(4),%a3 the_node = (Chain_Node *) the_thread; the_node->next = search_node; 47c78: 2089 movel %a1,%a0@ the_node->previous = previous_node; 47c7a: 214b 0004 movel %a3,%a0@(4) previous_node->next = the_node; search_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 47c7e: 214a 0044 movel %a2,%a0@(68) previous_node = search_node->previous; the_node = (Chain_Node *) the_thread; the_node->next = search_node; the_node->previous = previous_node; previous_node->next = the_node; 47c82: 2688 movel %a0,%a3@ search_node->previous = the_node; 47c84: 2348 0004 movel %a0,%a1@(4) the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 47c88: 46c1 movew %d1,%sr 47c8a: 6062 bras 47cee <_Thread_queue_Enqueue_priority+0x10a> return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 47c8c: 4283 clrl %d3 47c8e: 1639 0005 d762 moveb 5d762 ,%d3 _ISR_Disable( level ); 47c94: 2404 movel %d4,%d2 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 47c96: 5283 addql #1,%d3 _ISR_Disable( level ); 47c98: 40c1 movew %sr,%d1 47c9a: 8481 orl %d1,%d2 47c9c: 46c2 movew %d2,%sr search_thread = (Thread_Control *) header->last; 47c9e: 226b 0008 moveal %a3@(8),%a1 while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 47ca2: 6020 bras 47cc4 <_Thread_queue_Enqueue_priority+0xe0> search_priority = search_thread->current_priority; 47ca4: 2629 0014 movel %a1@(20),%d3 if ( priority >= search_priority ) 47ca8: b680 cmpl %d0,%d3 47caa: 631c blss 47cc8 <_Thread_queue_Enqueue_priority+0xe4> break; search_priority = search_thread->current_priority; if ( priority >= search_priority ) break; #endif _ISR_Flash( level ); 47cac: 2404 movel %d4,%d2 47cae: 46c1 movew %d1,%sr 47cb0: 8481 orl %d1,%d2 47cb2: 46c2 movew %d2,%sr if ( !_States_Are_set( search_thread->current_state, block_state) ) { 47cb4: 2405 movel %d5,%d2 47cb6: c4a9 0010 andl %a1@(16),%d2 47cba: 6604 bnes 47cc0 <_Thread_queue_Enqueue_priority+0xdc> _ISR_Enable( level ); 47cbc: 46c1 movew %d1,%sr goto restart_reverse_search; 47cbe: 60cc bras 47c8c <_Thread_queue_Enqueue_priority+0xa8> } search_thread = (Thread_Control *) 47cc0: 2269 0004 moveal %a1@(4),%a1 restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); search_thread = (Thread_Control *) header->last; while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 47cc4: b7c9 cmpal %a1,%a3 47cc6: 66dc bnes 47ca4 <_Thread_queue_Enqueue_priority+0xc0> 47cc8: 2401 movel %d1,%d2 } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 47cca: 7801 moveq #1,%d4 47ccc: b8aa 0030 cmpl %a2@(48),%d4 47cd0: 663c bnes 47d0e <_Thread_queue_Enqueue_priority+0x12a> THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 47cd2: 42aa 0030 clrl %a2@(48) if ( priority == search_priority ) 47cd6: b680 cmpl %d0,%d3 47cd8: 6718 beqs 47cf2 <_Thread_queue_Enqueue_priority+0x10e> goto equal_priority; search_node = (Chain_Node *) search_thread; next_node = search_node->next; 47cda: 2651 moveal %a1@,%a3 the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; 47cdc: 2149 0004 movel %a1,%a0@(4) search_node = (Chain_Node *) search_thread; next_node = search_node->next; the_node = (Chain_Node *) the_thread; the_node->next = next_node; 47ce0: 208b movel %a3,%a0@ the_node->previous = search_node; search_node->next = the_node; next_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 47ce2: 214a 0044 movel %a2,%a0@(68) next_node = search_node->next; the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; search_node->next = the_node; 47ce6: 2288 movel %a0,%a1@ next_node->previous = the_node; 47ce8: 2748 0004 movel %a0,%a3@(4) the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 47cec: 46c1 movew %d1,%sr 47cee: 7001 moveq #1,%d0 return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 47cf0: 6026 bras 47d18 <_Thread_queue_Enqueue_priority+0x134> 47cf2: 43e9 003c lea %a1@(60),%a1 equal_priority: /* add at end of priority group */ search_node = _Chain_Tail( &search_thread->Wait.Block2n ); previous_node = search_node->previous; 47cf6: 2669 0004 moveal %a1@(4),%a3 the_node = (Chain_Node *) the_thread; the_node->next = search_node; 47cfa: 2089 movel %a1,%a0@ the_node->previous = previous_node; 47cfc: 214b 0004 movel %a3,%a0@(4) previous_node->next = the_node; search_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 47d00: 214a 0044 movel %a2,%a0@(68) previous_node = search_node->previous; the_node = (Chain_Node *) the_thread; the_node->next = search_node; the_node->previous = previous_node; previous_node->next = the_node; 47d04: 2688 movel %a0,%a3@ search_node->previous = the_node; 47d06: 2348 0004 movel %a0,%a1@(4) the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 47d0a: 46c2 movew %d2,%sr 47d0c: 60e0 bras 47cee <_Thread_queue_Enqueue_priority+0x10a> * For example, the blocking thread could have been given * the mutex by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ *level_p = level; 47d0e: 206e 0010 moveal %fp@(16),%a0 return the_thread_queue->sync_state; 47d12: 202a 0030 movel %a2@(48),%d0 * For example, the blocking thread could have been given * the mutex by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ *level_p = level; 47d16: 2082 movel %d2,%a0@ return the_thread_queue->sync_state; } 47d18: 4cd7 0c7c moveml %sp@,%d2-%d6/%a2-%a3 47d1c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004e040 <_Thread_queue_Extract_fifo>: Thread_Control *the_thread ) { ISR_Level level; _ISR_Disable( level ); 4e040: 223c 0000 0700 movel #1792,%d1 void _Thread_queue_Extract_fifo( Thread_queue_Control *the_thread_queue __attribute__((unused)), Thread_Control *the_thread ) { 4e046: 4e56 0000 linkw %fp,#0 4e04a: 2f0a movel %a2,%sp@- 4e04c: 246e 000c moveal %fp@(12),%a2 ISR_Level level; _ISR_Disable( level ); 4e050: 40c0 movew %sr,%d0 4e052: 8280 orl %d0,%d1 4e054: 46c1 movew %d1,%sr if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 4e056: 222a 0010 movel %a2@(16),%d1 4e05a: 0281 0003 bee0 andil #245472,%d1 4e060: 660a bnes 4e06c <_Thread_queue_Extract_fifo+0x2c> _ISR_Enable( level ); 4e062: 46c0 movew %d0,%sr #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); #endif } 4e064: 246e fffc moveal %fp@(-4),%a2 4e068: 4e5e unlk %fp 4e06a: 4e75 rts ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 4e06c: 2052 moveal %a2@,%a0 _Chain_Extract_unprotected( &the_thread->Object.Node ); the_thread->Wait.queue = NULL; if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 4e06e: 7202 moveq #2,%d1 previous = the_node->previous; 4e070: 226a 0004 moveal %a2@(4),%a1 return; } _Chain_Extract_unprotected( &the_thread->Object.Node ); the_thread->Wait.queue = NULL; 4e074: 42aa 0044 clrl %a2@(68) next->previous = previous; previous->next = next; 4e078: 2288 movel %a0,%a1@ Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 4e07a: 2149 0004 movel %a1,%a0@(4) if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 4e07e: b2aa 0050 cmpl %a2@(80),%d1 4e082: 6704 beqs 4e088 <_Thread_queue_Extract_fifo+0x48> _ISR_Enable( level ); 4e084: 46c0 movew %d0,%sr 4e086: 6014 bras 4e09c <_Thread_queue_Extract_fifo+0x5c> 4e088: 7203 moveq #3,%d1 4e08a: 2541 0050 movel %d1,%a2@(80) } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 4e08e: 46c0 movew %d0,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 4e090: 486a 0048 pea %a2@(72) 4e094: 4eb9 0004 873c jsr 4873c <_Watchdog_Remove> 4e09a: 588f addql #4,%sp RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 4e09c: 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 } 4e0a0: 246e fffc moveal %fp@(-4),%a2 4e0a4: 203c 1003 fff8 movel #268697592,%d0 4e0aa: 2d40 000c movel %d0,%fp@(12) 4e0ae: 4e5e unlk %fp 4e0b0: 4ef9 0004 72f8 jmp 472f8 <_Thread_Clear_state> ... =============================================================================== 0004bd78 <_Thread_queue_Process_timeout>: #include void _Thread_queue_Process_timeout( Thread_Control *the_thread ) { 4bd78: 4e56 0000 linkw %fp,#0 4bd7c: 206e 0008 moveal %fp@(8),%a0 Thread_queue_Control *the_thread_queue = the_thread->Wait.queue; 4bd80: 2268 0044 moveal %a0@(68),%a1 * If it is not satisfied, then it is "nothing happened" and * this is the "timeout" transition. After a request is satisfied, * a timeout is not allowed to occur. */ if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SYNCHRONIZED && 4bd84: 2029 0030 movel %a1@(48),%d0 4bd88: 671c beqs 4bda6 <_Thread_queue_Process_timeout+0x2e> 4bd8a: b1f9 0005 eff6 cmpal 5eff6 <_Thread_Executing>,%a0 4bd90: 6614 bnes 4bda6 <_Thread_queue_Process_timeout+0x2e><== NEVER TAKEN _Thread_Is_executing( the_thread ) ) { if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) { 4bd92: 7203 moveq #3,%d1 4bd94: b280 cmpl %d0,%d1 4bd96: 6722 beqs 4bdba <_Thread_queue_Process_timeout+0x42> the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 4bd98: 7002 moveq #2,%d0 */ if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SYNCHRONIZED && _Thread_Is_executing( the_thread ) ) { if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) { the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; 4bd9a: 2169 003c 0034 movel %a1@(60),%a0@(52) the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 4bda0: 2340 0030 movel %d0,%a1@(48) 4bda4: 6014 bras 4bdba <_Thread_queue_Process_timeout+0x42> } } else { the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; 4bda6: 2169 003c 0034 movel %a1@(60),%a0@(52) _Thread_queue_Extract( the_thread->Wait.queue, the_thread ); 4bdac: 2f08 movel %a0,%sp@- 4bdae: 2f28 0044 movel %a0@(68),%sp@- 4bdb2: 4eb9 0004 bc74 jsr 4bc74 <_Thread_queue_Extract> 4bdb8: 508f addql #8,%sp } } 4bdba: 4e5e unlk %fp ... =============================================================================== 00047dd4 <_Thread_queue_Requeue>: void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { 47dd4: 4e56 fff0 linkw %fp,#-16 47dd8: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 47ddc: 246e 0008 moveal %fp@(8),%a2 47de0: 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 ) 47de4: 4a8a tstl %a2 47de6: 6746 beqs 47e2e <_Thread_queue_Requeue+0x5a> <== NEVER TAKEN /* * If queueing by FIFO, there is nothing to do. This only applies to * priority blocking discipline. */ if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) { 47de8: 7001 moveq #1,%d0 47dea: b0aa 0034 cmpl %a2@(52),%d0 47dee: 663e bnes 47e2e <_Thread_queue_Requeue+0x5a> <== NEVER TAKEN Thread_queue_Control *tq = the_thread_queue; ISR_Level level; ISR_Level level_ignored; _ISR_Disable( level ); 47df0: 303c 0700 movew #1792,%d0 47df4: 40c2 movew %sr,%d2 47df6: 8082 orl %d2,%d0 47df8: 46c0 movew %d0,%sr if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 47dfa: 202b 0010 movel %a3@(16),%d0 47dfe: 0280 0003 bee0 andil #245472,%d0 47e04: 6726 beqs 47e2c <_Thread_queue_Requeue+0x58> <== NEVER TAKEN _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); 47e06: 4878 0001 pea 1 47e0a: 7001 moveq #1,%d0 47e0c: 2f0b movel %a3,%sp@- 47e0e: 2540 0030 movel %d0,%a2@(48) 47e12: 2f0a movel %a2,%sp@- 47e14: 4eb9 0004 bcac jsr 4bcac <_Thread_queue_Extract_priority_helper> (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); 47e1a: 486e fffc pea %fp@(-4) 47e1e: 2f0b movel %a3,%sp@- 47e20: 2f0a movel %a2,%sp@- 47e22: 4eb9 0004 7be4 jsr 47be4 <_Thread_queue_Enqueue_priority> 47e28: 4fef 0018 lea %sp@(24),%sp } _ISR_Enable( level ); 47e2c: 46c2 movew %d2,%sr } } 47e2e: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3 47e34: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00047e38 <_Thread_queue_Timeout>: void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { 47e38: 4e56 fffc linkw %fp,#-4 Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 47e3c: 486e fffc pea %fp@(-4) 47e40: 2f2e 0008 movel %fp@(8),%sp@- 47e44: 4eb9 0004 76d8 jsr 476d8 <_Thread_Get> switch ( location ) { 47e4a: 508f addql #8,%sp 47e4c: 4aae fffc tstl %fp@(-4) 47e50: 6618 bnes 47e6a <_Thread_queue_Timeout+0x32> <== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 47e52: 2f00 movel %d0,%sp@- 47e54: 4eb9 0004 bd78 jsr 4bd78 <_Thread_queue_Process_timeout> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 47e5a: 588f addql #4,%sp 47e5c: 2039 0005 ef3c movel 5ef3c <_Thread_Dispatch_disable_level>,%d0 47e62: 5380 subql #1,%d0 47e64: 23c0 0005 ef3c movel %d0,5ef3c <_Thread_Dispatch_disable_level> _Thread_Unnest_dispatch(); break; } } 47e6a: 4e5e unlk %fp ... =============================================================================== 00051ed4 <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 51ed4: 4e56 ffb4 linkw %fp,#-76 51ed8: 200e movel %fp,%d0 51eda: 0680 ffff fff4 addil #-12,%d0 51ee0: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 51ee4: 246e 0008 moveal %fp@(8),%a2 51ee8: 240e movel %fp,%d2 51eea: 2a0e movel %fp,%d5 51eec: 260e movel %fp,%d3 51eee: 0682 ffff ffe8 addil #-24,%d2 51ef4: 5185 subql #8,%d5 51ef6: 0683 ffff ffec addil #-20,%d3 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 51efc: 41ea 0008 lea %a2@(8),%a0 static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 51f00: 4bea 0040 lea %a2@(64),%a5 */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 51f04: 2e0a movel %a2,%d7 /* * This path is for normal forward movement and cases where the * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 51f06: 280a movel %a2,%d4 */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 51f08: 0687 0000 0030 addil #48,%d7 /* * This path is for normal forward movement and cases where the * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 51f0e: 0684 0000 0068 addil #104,%d4 */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 51f14: 49f9 0005 5b2c lea 55b2c <_Watchdog_Adjust_to_chain>,%a4 ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 51f1a: 47f9 0005 5bbc lea 55bbc <_Watchdog_Insert>,%a3 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 51f20: 2d48 ffe4 movel %a0,%fp@(-28) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 51f24: 2d45 fff4 movel %d5,%fp@(-12) the_chain->permanent_null = NULL; 51f28: 42ae fff8 clrl %fp@(-8) the_chain->last = _Chain_Head(the_chain); 51f2c: 2d40 fffc movel %d0,%fp@(-4) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 51f30: 2d43 ffe8 movel %d3,%fp@(-24) the_chain->permanent_null = NULL; 51f34: 42ae ffec clrl %fp@(-20) the_chain->last = _Chain_Head(the_chain); 51f38: 2d42 fff0 movel %d2,%fp@(-16) 51f3c: 2d4d ffe0 movel %a5,%fp@(-32) { /* * Afterwards all timer inserts are directed to this chain and the interval * and TOD chains will be no more modified by other parties. */ ts->insert_chain = insert_chain; 51f40: 41ee fff4 lea %fp@(-12),%a0 * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); 51f44: 3a7c 0700 moveaw #1792,%a5 { /* * Afterwards all timer inserts are directed to this chain and the interval * and TOD chains will be no more modified by other parties. */ ts->insert_chain = insert_chain; 51f48: 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; 51f4c: 2039 0007 7824 movel 77824 <_Watchdog_Ticks_since_boot>,%d0 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 51f52: 222a 003c movel %a2@(60),%d1 watchdogs->last_snapshot = snapshot; 51f56: 2540 003c movel %d0,%a2@(60) _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 51f5a: 486e ffe8 pea %fp@(-24) 51f5e: 9081 subl %d1,%d0 51f60: 2f00 movel %d0,%sp@- 51f62: 2f07 movel %d7,%sp@- 51f64: 4e94 jsr %a4@ static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 51f66: 2039 0007 7772 movel 77772 <_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 ) { 51f6c: 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; 51f70: 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 ) { 51f74: b280 cmpl %d0,%d1 51f76: 6414 bccs 51f8c <_Timer_server_Body+0xb8> /* * This path is for normal forward movement and cases where the * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 51f78: 486e ffe8 pea %fp@(-24) 51f7c: 2c00 movel %d0,%d6 51f7e: 9c81 subl %d1,%d6 51f80: 2f06 movel %d6,%sp@- 51f82: 2d40 ffdc movel %d0,%fp@(-36) 51f86: 2f04 movel %d4,%sp@- 51f88: 4e94 jsr %a4@ 51f8a: 6018 bras 51fa4 <_Timer_server_Body+0xd0> } else if ( snapshot < last_snapshot ) { 51f8c: b280 cmpl %d0,%d1 51f8e: 631c blss 51fac <_Timer_server_Body+0xd8> /* * The current TOD is before the last TOD which indicates that * TOD has been set backwards. */ delta = last_snapshot - snapshot; _Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta ); 51f90: 9280 subl %d0,%d1 51f92: 2f01 movel %d1,%sp@- 51f94: 4878 0001 pea 1 51f98: 2d40 ffdc movel %d0,%fp@(-36) 51f9c: 2f04 movel %d4,%sp@- 51f9e: 4eb9 0005 5aac jsr 55aac <_Watchdog_Adjust> 51fa4: 202e ffdc movel %fp@(-36),%d0 51fa8: 4fef 000c lea %sp@(12),%sp } watchdogs->last_snapshot = snapshot; 51fac: 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 ); 51fb0: 202a 0078 movel %a2@(120),%d0 51fb4: 2f00 movel %d0,%sp@- 51fb6: 4eb9 0005 28cc jsr 528cc <_Chain_Get> if ( timer == NULL ) { 51fbc: 588f addql #4,%sp } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 51fbe: 2040 moveal %d0,%a0 if ( timer == NULL ) { 51fc0: 4a80 tstl %d0 51fc2: 6724 beqs 51fe8 <_Timer_server_Body+0x114> <== ALWAYS TAKEN static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 51fc4: 2028 0038 movel %a0@(56),%d0 <== NOT EXECUTED 51fc8: 7201 moveq #1,%d1 <== NOT EXECUTED 51fca: b280 cmpl %d0,%d1 <== NOT EXECUTED 51fcc: 6608 bnes 51fd6 <_Timer_server_Body+0x102> <== NOT EXECUTED _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 51fce: 4868 0010 pea %a0@(16) <== NOT EXECUTED 51fd2: 2f07 movel %d7,%sp@- <== NOT EXECUTED 51fd4: 600c bras 51fe2 <_Timer_server_Body+0x10e> <== NOT EXECUTED } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 51fd6: 7c03 moveq #3,%d6 <== NOT EXECUTED 51fd8: bc80 cmpl %d0,%d6 <== NOT EXECUTED 51fda: 66d4 bnes 51fb0 <_Timer_server_Body+0xdc> <== NOT EXECUTED _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 51fdc: 4868 0010 pea %a0@(16) <== NOT EXECUTED 51fe0: 2f04 movel %d4,%sp@- <== NOT EXECUTED 51fe2: 4e93 jsr %a3@ <== NOT EXECUTED 51fe4: 508f addql #8,%sp <== NOT EXECUTED 51fe6: 60c8 bras 51fb0 <_Timer_server_Body+0xdc> <== NOT EXECUTED * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); 51fe8: 200d movel %a5,%d0 51fea: 40c1 movew %sr,%d1 51fec: 8081 orl %d1,%d0 51fee: 46c0 movew %d0,%sr if ( _Chain_Is_empty( insert_chain ) ) { 51ff0: baae fff4 cmpl %fp@(-12),%d5 51ff4: 6612 bnes 52008 <_Timer_server_Body+0x134> <== NEVER TAKEN ts->insert_chain = NULL; 51ff6: 42aa 0078 clrl %a2@(120) _ISR_Enable( level ); 51ffa: 46c1 movew %d1,%sr /* * It is essential that interrupts are disable here since an interrupt * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); 51ffc: 3a7c 0700 moveaw #1792,%a5 _Chain_Initialize_empty( &fire_chain ); while ( true ) { _Timer_server_Get_watchdogs_that_fire_now( ts, &insert_chain, &fire_chain ); if ( !_Chain_Is_empty( &fire_chain ) ) { 52000: b6ae ffe8 cmpl %fp@(-24),%d3 52004: 6608 bnes 5200e <_Timer_server_Body+0x13a> 52006: 6042 bras 5204a <_Timer_server_Body+0x176> ts->insert_chain = NULL; _ISR_Enable( level ); break; } else { _ISR_Enable( level ); 52008: 46c1 movew %d1,%sr <== NOT EXECUTED 5200a: 6000 ff40 braw 51f4c <_Timer_server_Body+0x78> <== NOT EXECUTED /* * It is essential that interrupts are disable here since an interrupt * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); 5200e: 220d movel %a5,%d1 52010: 40c0 movew %sr,%d0 52012: 8280 orl %d0,%d1 52014: 46c1 movew %d1,%sr */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 52016: 206e ffe8 moveal %fp@(-24),%a0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 5201a: b688 cmpl %a0,%d3 5201c: 6726 beqs 52044 <_Timer_server_Body+0x170> { Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; 5201e: 2250 moveal %a0@,%a1 the_chain->first = new_first; 52020: 2d49 ffe8 movel %a1,%fp@(-24) new_first->previous = _Chain_Head(the_chain); 52024: 2342 0004 movel %d2,%a1@(4) watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { 52028: 4a88 tstl %a0 5202a: 6718 beqs 52044 <_Timer_server_Body+0x170> <== NEVER TAKEN watchdog->state = WATCHDOG_INACTIVE; 5202c: 42a8 0008 clrl %a0@(8) _ISR_Enable( level ); 52030: 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 ); 52032: 2f28 0024 movel %a0@(36),%sp@- 52036: 2f28 0020 movel %a0@(32),%sp@- 5203a: 2068 001c moveal %a0@(28),%a0 5203e: 4e90 jsr %a0@ } 52040: 508f addql #8,%sp 52042: 60ca bras 5200e <_Timer_server_Body+0x13a> watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; _ISR_Enable( level ); } else { _ISR_Enable( level ); 52044: 46c0 movew %d0,%sr 52046: 6000 fef8 braw 51f40 <_Timer_server_Body+0x6c> * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); } } else { ts->active = false; 5204a: 4200 clrb %d0 5204c: 1540 007c moveb %d0,%a2@(124) 52050: 2039 0007 76e0 movel 776e0 <_Thread_Dispatch_disable_level>,%d0 52056: 5280 addql #1,%d0 52058: 23c0 0007 76e0 movel %d0,776e0 <_Thread_Dispatch_disable_level> /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); 5205e: 4878 0008 pea 8 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 52062: 4bf9 0005 5cd8 lea 55cd8 <_Watchdog_Remove>,%a5 /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); 52068: 2f12 movel %a2@,%sp@- 5206a: 4eb9 0005 52cc jsr 552cc <_Thread_Set_state> _Timer_server_Reset_interval_system_watchdog( ts ); 52070: 2f0a movel %a2,%sp@- 52072: 4eba fd9c jsr %pc@(51e10 <_Timer_server_Reset_interval_system_watchdog>) _Timer_server_Reset_tod_system_watchdog( ts ); 52076: 2f0a movel %a2,%sp@- 52078: 4eba fdf6 jsr %pc@(51e70 <_Timer_server_Reset_tod_system_watchdog>) _Thread_Enable_dispatch(); 5207c: 4eb9 0005 4942 jsr 54942 <_Thread_Enable_dispatch> ts->active = true; 52082: 7201 moveq #1,%d1 52084: 1541 007c moveb %d1,%a2@(124) static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 52088: 2f2e ffe4 movel %fp@(-28),%sp@- 5208c: 4e95 jsr %a5@ static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 5208e: 2f2e ffe0 movel %fp@(-32),%sp@- 52092: 4e95 jsr %a5@ 52094: 4fef 0018 lea %sp@(24),%sp 52098: 6000 fea6 braw 51f40 <_Timer_server_Body+0x6c> =============================================================================== 0005209c <_Timer_server_Schedule_operation_method>: static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 5209c: 4e56 fff0 linkw %fp,#-16 520a0: 206e 000c moveal %fp@(12),%a0 520a4: 48d7 041c moveml %d2-%d4/%a2,%sp@ 520a8: 246e 0008 moveal %fp@(8),%a2 if ( ts->insert_chain == NULL ) { 520ac: 202a 0078 movel %a2@(120),%d0 520b0: 6600 00f8 bnew 521aa <_Timer_server_Schedule_operation_method+0x10e> 520b4: 2039 0007 76e0 movel 776e0 <_Thread_Dispatch_disable_level>,%d0 520ba: 5280 addql #1,%d0 520bc: 23c0 0007 76e0 movel %d0,776e0 <_Thread_Dispatch_disable_level> * being inserted. This could result in an integer overflow. */ _Thread_Disable_dispatch(); if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 520c2: 2028 0038 movel %a0@(56),%d0 520c6: 7201 moveq #1,%d1 520c8: b280 cmpl %d0,%d1 520ca: 6660 bnes 5212c <_Timer_server_Schedule_operation_method+0x90> /* * We have to advance the last known ticks value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 520cc: 203c 0000 0700 movel #1792,%d0 520d2: 40c3 movew %sr,%d3 520d4: 8083 orl %d3,%d0 520d6: 46c0 movew %d0,%sr snapshot = _Watchdog_Ticks_since_boot; 520d8: 2039 0007 7824 movel 77824 <_Watchdog_Ticks_since_boot>,%d0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 520de: 220a movel %a2,%d1 520e0: 0681 0000 0034 addil #52,%d1 last_snapshot = ts->Interval_watchdogs.last_snapshot; 520e6: 242a 003c movel %a2@(60),%d2 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 520ea: 226a 0030 moveal %a2@(48),%a1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 520ee: b289 cmpl %a1,%d1 520f0: 6716 beqs 52108 <_Timer_server_Schedule_operation_method+0x6c> first_watchdog = _Watchdog_First( &ts->Interval_watchdogs.Chain ); /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; 520f2: 2800 movel %d0,%d4 520f4: 9882 subl %d2,%d4 delta_interval = first_watchdog->delta_interval; 520f6: 2229 0010 movel %a1@(16),%d1 if (delta_interval > delta) { 520fa: b881 cmpl %d1,%d4 520fc: 6504 bcss 52102 <_Timer_server_Schedule_operation_method+0x66> 520fe: 4281 clrl %d1 52100: 6002 bras 52104 <_Timer_server_Schedule_operation_method+0x68> delta_interval -= delta; 52102: 9284 subl %d4,%d1 } else { delta_interval = 0; } first_watchdog->delta_interval = delta_interval; 52104: 2341 0010 movel %d1,%a1@(16) } ts->Interval_watchdogs.last_snapshot = snapshot; 52108: 2540 003c movel %d0,%a2@(60) _ISR_Enable( level ); 5210c: 46c3 movew %d3,%sr _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 5210e: 4868 0010 pea %a0@(16) 52112: 486a 0030 pea %a2@(48) 52116: 4eb9 0005 5bbc jsr 55bbc <_Watchdog_Insert> if ( !ts->active ) { 5211c: 508f addql #8,%sp 5211e: 102a 007c moveb %a2@(124),%d0 52122: 6678 bnes 5219c <_Timer_server_Schedule_operation_method+0x100> _Timer_server_Reset_interval_system_watchdog( ts ); 52124: 2f0a movel %a2,%sp@- 52126: 4eba fce8 jsr %pc@(51e10 <_Timer_server_Reset_interval_system_watchdog>) 5212a: 606e bras 5219a <_Timer_server_Schedule_operation_method+0xfe> } } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 5212c: 7203 moveq #3,%d1 5212e: b280 cmpl %d0,%d1 52130: 666a bnes 5219c <_Timer_server_Schedule_operation_method+0x100> /* * We have to advance the last known seconds value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 52132: 203c 0000 0700 movel #1792,%d0 52138: 40c3 movew %sr,%d3 5213a: 8083 orl %d3,%d0 5213c: 46c0 movew %d0,%sr 5213e: 200a movel %a2,%d0 52140: 0680 0000 006c addil #108,%d0 snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 52146: 2239 0007 7772 movel 77772 <_TOD_Now>,%d1 last_snapshot = ts->TOD_watchdogs.last_snapshot; 5214c: 242a 0074 movel %a2@(116),%d2 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 52150: 226a 0068 moveal %a2@(104),%a1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 52154: b089 cmpl %a1,%d0 52156: 6720 beqs 52178 <_Timer_server_Schedule_operation_method+0xdc> if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; 52158: 2029 0010 movel %a1@(16),%d0 if ( snapshot > last_snapshot ) { 5215c: b481 cmpl %d1,%d2 5215e: 6410 bccs 52170 <_Timer_server_Schedule_operation_method+0xd4> /* * We advanced in time. */ delta = snapshot - last_snapshot; 52160: 2801 movel %d1,%d4 52162: 9882 subl %d2,%d4 if (delta_interval > delta) { 52164: b880 cmpl %d0,%d4 52166: 6504 bcss 5216c <_Timer_server_Schedule_operation_method+0xd0><== ALWAYS TAKEN 52168: 4280 clrl %d0 <== NOT EXECUTED 5216a: 6008 bras 52174 <_Timer_server_Schedule_operation_method+0xd8><== NOT EXECUTED delta_interval -= delta; 5216c: 9084 subl %d4,%d0 5216e: 6004 bras 52174 <_Timer_server_Schedule_operation_method+0xd8> } } else { /* * Someone put us in the past. */ delta = last_snapshot - snapshot; 52170: d082 addl %d2,%d0 delta_interval += delta; 52172: 9081 subl %d1,%d0 } first_watchdog->delta_interval = delta_interval; 52174: 2340 0010 movel %d0,%a1@(16) } ts->TOD_watchdogs.last_snapshot = snapshot; 52178: 2541 0074 movel %d1,%a2@(116) _ISR_Enable( level ); 5217c: 46c3 movew %d3,%sr _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 5217e: 4868 0010 pea %a0@(16) 52182: 486a 0068 pea %a2@(104) 52186: 4eb9 0005 5bbc jsr 55bbc <_Watchdog_Insert> if ( !ts->active ) { 5218c: 508f addql #8,%sp 5218e: 102a 007c moveb %a2@(124),%d0 52192: 6608 bnes 5219c <_Timer_server_Schedule_operation_method+0x100> _Timer_server_Reset_tod_system_watchdog( ts ); 52194: 2f0a movel %a2,%sp@- 52196: 4eba fcd8 jsr %pc@(51e70 <_Timer_server_Reset_tod_system_watchdog>) 5219a: 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 ); } } 5219c: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 521a2: 4e5e unlk %fp if ( !ts->active ) { _Timer_server_Reset_tod_system_watchdog( ts ); } } _Thread_Enable_dispatch(); 521a4: 4ef9 0005 4942 jmp 54942 <_Thread_Enable_dispatch> * server is not preemptible, so we must be in interrupt context here. No * thread dispatch will happen until the timer server finishes its * critical section. We have to use the protected chain methods because * we may be interrupted by a higher priority interrupt. */ _Chain_Append( ts->insert_chain, &timer->Object.Node ); 521aa: 202a 0078 movel %a2@(120),%d0 <== NOT EXECUTED 521ae: 2d48 000c movel %a0,%fp@(12) <== NOT EXECUTED } } 521b2: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 <== NOT EXECUTED * server is not preemptible, so we must be in interrupt context here. No * thread dispatch will happen until the timer server finishes its * critical section. We have to use the protected chain methods because * we may be interrupted by a higher priority interrupt. */ _Chain_Append( ts->insert_chain, &timer->Object.Node ); 521b8: 2d40 0008 movel %d0,%fp@(8) <== NOT EXECUTED } } 521bc: 4e5e unlk %fp <== NOT EXECUTED * server is not preemptible, so we must be in interrupt context here. No * thread dispatch will happen until the timer server finishes its * critical section. We have to use the protected chain methods because * we may be interrupted by a higher priority interrupt. */ _Chain_Append( ts->insert_chain, &timer->Object.Node ); 521be: 4ef9 0005 286c jmp 5286c <_Chain_Append> <== NOT EXECUTED =============================================================================== 00049b6c <_Watchdog_Adjust>: Watchdog_Interval units ) { ISR_Level level; _ISR_Disable( level ); 49b6c: 327c 0700 moveaw #1792,%a1 49b70: 2209 movel %a1,%d1 void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 49b72: 4e56 ffe8 linkw %fp,#-24 49b76: 48d7 1c1c moveml %d2-%d4/%a2-%a4,%sp@ 49b7a: 266e 0008 moveal %fp@(8),%a3 49b7e: 262e 000c movel %fp@(12),%d3 49b82: 242e 0010 movel %fp@(16),%d2 ISR_Level level; _ISR_Disable( level ); 49b86: 40c0 movew %sr,%d0 49b88: 8280 orl %d0,%d1 49b8a: 46c1 movew %d1,%sr */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 49b8c: 244b moveal %a3,%a2 49b8e: 205a moveal %a2@+,%a0 * hence the compiler must not assume *header to remain * unmodified across that call. * * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { 49b90: b5c8 cmpal %a0,%a2 49b92: 674c beqs 49be0 <_Watchdog_Adjust+0x74> switch ( direction ) { 49b94: 4a83 tstl %d3 49b96: 673c beqs 49bd4 <_Watchdog_Adjust+0x68> 49b98: 7201 moveq #1,%d1 49b9a: b283 cmpl %d3,%d1 49b9c: 6642 bnes 49be0 <_Watchdog_Adjust+0x74> <== NEVER TAKEN case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; 49b9e: d5a8 0010 addl %d2,%a0@(16) break; 49ba2: 603c bras 49be0 <_Watchdog_Adjust+0x74> RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First( Chain_Control *header ) { return ( (Watchdog_Control *) header->first ); 49ba4: 2053 moveal %a3@,%a0 case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { 49ba6: 2628 0010 movel %a0@(16),%d3 49baa: b682 cmpl %d2,%d3 49bac: 6308 blss 49bb6 <_Watchdog_Adjust+0x4a> _Watchdog_First( header )->delta_interval -= units; 49bae: 9682 subl %d2,%d3 49bb0: 2143 0010 movel %d3,%a0@(16) break; 49bb4: 602a bras 49be0 <_Watchdog_Adjust+0x74> } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; 49bb6: 7201 moveq #1,%d1 49bb8: 2141 0010 movel %d1,%a0@(16) _ISR_Enable( level ); 49bbc: 46c0 movew %d0,%sr _Watchdog_Tickle( header ); 49bbe: 2f0b movel %a3,%sp@- 49bc0: 4e94 jsr %a4@ _ISR_Disable( level ); 49bc2: 2204 movel %d4,%d1 49bc4: 40c0 movew %sr,%d0 49bc6: 8280 orl %d0,%d1 49bc8: 46c1 movew %d1,%sr while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; 49bca: 9483 subl %d3,%d2 _Watchdog_Tickle( header ); _ISR_Disable( level ); if ( _Chain_Is_empty( header ) ) 49bcc: 588f addql #4,%sp 49bce: b5d3 cmpal %a3@,%a2 49bd0: 660a bnes 49bdc <_Watchdog_Adjust+0x70> 49bd2: 600c bras 49be0 <_Watchdog_Adjust+0x74> _ISR_Enable( level ); _Watchdog_Tickle( header ); _ISR_Disable( level ); 49bd4: 2809 movel %a1,%d4 units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; _ISR_Enable( level ); _Watchdog_Tickle( header ); 49bd6: 49f9 0004 9d84 lea 49d84 <_Watchdog_Tickle>,%a4 switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 49bdc: 4a82 tstl %d2 49bde: 66c4 bnes 49ba4 <_Watchdog_Adjust+0x38> <== ALWAYS TAKEN } break; } } _ISR_Enable( level ); 49be0: 46c0 movew %d0,%sr } 49be2: 4cee 1c1c ffe8 moveml %fp@(-24),%d2-%d4/%a2-%a4 49be8: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004873c <_Watchdog_Remove>: { ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 4873c: 203c 0000 0700 movel #1792,%d0 */ Watchdog_States _Watchdog_Remove( Watchdog_Control *the_watchdog ) { 48742: 4e56 0000 linkw %fp,#0 48746: 206e 0008 moveal %fp@(8),%a0 4874a: 2f0a movel %a2,%sp@- 4874c: 2f02 movel %d2,%sp@- ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 4874e: 40c1 movew %sr,%d1 48750: 8081 orl %d1,%d0 48752: 46c0 movew %d0,%sr previous_state = the_watchdog->state; 48754: 2028 0008 movel %a0@(8),%d0 switch ( previous_state ) { 48758: 7401 moveq #1,%d2 4875a: b480 cmpl %d0,%d2 4875c: 670c beqs 4876a <_Watchdog_Remove+0x2e> 4875e: 6244 bhis 487a4 <_Watchdog_Remove+0x68> 48760: 143c 0003 moveb #3,%d2 48764: b480 cmpl %d0,%d2 48766: 653c bcss 487a4 <_Watchdog_Remove+0x68> <== NEVER TAKEN 48768: 6006 bras 48770 <_Watchdog_Remove+0x34> /* * It is not actually on the chain so just change the state and * the Insert operation we interrupted will be aborted. */ the_watchdog->state = WATCHDOG_INACTIVE; 4876a: 42a8 0008 clrl %a0@(8) break; 4876e: 6034 bras 487a4 <_Watchdog_Remove+0x68> RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_Next( Watchdog_Control *the_watchdog ) { return ( (Watchdog_Control *) the_watchdog->Node.next ); 48770: 2250 moveal %a0@,%a1 case WATCHDOG_ACTIVE: case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; 48772: 42a8 0008 clrl %a0@(8) next_watchdog = _Watchdog_Next( the_watchdog ); if ( _Watchdog_Next(next_watchdog) ) 48776: 4a91 tstl %a1@ 48778: 6708 beqs 48782 <_Watchdog_Remove+0x46> next_watchdog->delta_interval += the_watchdog->delta_interval; 4877a: 2428 0010 movel %a0@(16),%d2 4877e: d5a9 0010 addl %d2,%a1@(16) if ( _Watchdog_Sync_count ) 48782: 2279 0005 f07c moveal 5f07c <_Watchdog_Sync_count>,%a1 48788: 4a89 tstl %a1 4878a: 670c beqs 48798 <_Watchdog_Remove+0x5c> _Watchdog_Sync_level = _ISR_Nest_level; 4878c: 2279 0005 efd6 moveal 5efd6 <_ISR_Nest_level>,%a1 48792: 23c9 0005 eff2 movel %a1,5eff2 <_Watchdog_Sync_level> ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 48798: 2250 moveal %a0@,%a1 previous = the_node->previous; 4879a: 2468 0004 moveal %a0@(4),%a2 next->previous = previous; previous->next = next; 4879e: 2489 movel %a1,%a2@ Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 487a0: 234a 0004 movel %a2,%a1@(4) _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 487a4: 2279 0005 f080 moveal 5f080 <_Watchdog_Ticks_since_boot>,%a1 487aa: 2149 0018 movel %a1,%a0@(24) _ISR_Enable( level ); 487ae: 46c1 movew %d1,%sr return( previous_state ); } 487b0: 241f movel %sp@+,%d2 487b2: 245f moveal %sp@+,%a2 487b4: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00049760 <_Watchdog_Report_chain>: ) { ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 49760: 203c 0000 0700 movel #1792,%d0 void _Watchdog_Report_chain( const char *name, Chain_Control *header ) { 49766: 4e56 ffec linkw %fp,#-20 4976a: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@ 4976e: 242e 0008 movel %fp@(8),%d2 49772: 266e 000c moveal %fp@(12),%a3 ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 49776: 40c3 movew %sr,%d3 49778: 8083 orl %d3,%d0 4977a: 46c0 movew %d0,%sr printk( "Watchdog Chain: %s %p\n", name, header ); 4977c: 2f0b movel %a3,%sp@- 4977e: 49f9 0004 3e90 lea 43e90 ,%a4 49784: 2f02 movel %d2,%sp@- 49786: 4879 0005 e066 pea 5e066 4978c: 4e94 jsr %a4@ */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 4978e: 245b moveal %a3@+,%a2 if ( !_Chain_Is_empty( header ) ) { 49790: 4fef 000c lea %sp@(12),%sp 49794: b7ca cmpal %a2,%a3 49796: 6726 beqs 497be <_Watchdog_Report_chain+0x5e> node != _Chain_Tail(header) ; node = node->next ) { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); 49798: 49f9 0004 97d4 lea 497d4 <_Watchdog_Report>,%a4 4979e: 2f0a movel %a2,%sp@- 497a0: 42a7 clrl %sp@- 497a2: 4e94 jsr %a4@ _ISR_Disable( level ); printk( "Watchdog Chain: %s %p\n", name, header ); if ( !_Chain_Is_empty( header ) ) { for ( node = header->first ; node != _Chain_Tail(header) ; node = node->next ) 497a4: 2452 moveal %a2@,%a2 Chain_Node *node; _ISR_Disable( level ); printk( "Watchdog Chain: %s %p\n", name, header ); if ( !_Chain_Is_empty( header ) ) { for ( node = header->first ; 497a6: 508f addql #8,%sp 497a8: b7ca cmpal %a2,%a3 497aa: 66f2 bnes 4979e <_Watchdog_Report_chain+0x3e> <== NEVER TAKEN { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); 497ac: 2f02 movel %d2,%sp@- 497ae: 4879 0005 e07d pea 5e07d 497b4: 4eb9 0004 3e90 jsr 43e90 497ba: 508f addql #8,%sp 497bc: 600a bras 497c8 <_Watchdog_Report_chain+0x68> } else { printk( "Chain is empty\n" ); 497be: 4879 0005 e08c pea 5e08c 497c4: 4e94 jsr %a4@ 497c6: 588f addql #4,%sp } _ISR_Enable( level ); 497c8: 46c3 movew %d3,%sr } 497ca: 4cee 1c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a4 497d0: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000487b8 <_Watchdog_Tickle>: * See the comment in watchdoginsert.c and watchdogadjust.c * about why it's safe not to declare header a pointer to * volatile data - till, 2003/7 */ _ISR_Disable( level ); 487b8: 203c 0000 0700 movel #1792,%d0 */ void _Watchdog_Tickle( Chain_Control *header ) { 487be: 4e56 ffe8 linkw %fp,#-24 487c2: 48d7 3c0c moveml %d2-%d3/%a2-%a5,%sp@ 487c6: 286e 0008 moveal %fp@(8),%a4 * See the comment in watchdoginsert.c and watchdogadjust.c * about why it's safe not to declare header a pointer to * volatile data - till, 2003/7 */ _ISR_Disable( level ); 487ca: 40c2 movew %sr,%d2 487cc: 8082 orl %d2,%d0 487ce: 46c0 movew %d0,%sr */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 487d0: 264c moveal %a4,%a3 487d2: 245b moveal %a3@+,%a2 if ( _Chain_Is_empty( header ) ) 487d4: b7ca cmpal %a2,%a3 487d6: 674e beqs 48826 <_Watchdog_Tickle+0x6e> * to be inserted has already had its delta_interval adjusted to 0, and * so is added to the head of the chain with a delta_interval of 0. * * Steven Johnson - 12/2005 (gcc-3.2.3 -O3 on powerpc) */ if (the_watchdog->delta_interval != 0) { 487d8: 202a 0010 movel %a2@(16),%d0 487dc: 6708 beqs 487e6 <_Watchdog_Tickle+0x2e> the_watchdog->delta_interval--; 487de: 5380 subql #1,%d0 487e0: 2540 0010 movel %d0,%a2@(16) if ( the_watchdog->delta_interval != 0 ) 487e4: 6640 bnes 48826 <_Watchdog_Tickle+0x6e> goto leave; } do { watchdog_state = _Watchdog_Remove( the_watchdog ); 487e6: 4bf9 0004 873c lea 4873c <_Watchdog_Remove>,%a5 case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 487ec: 263c 0000 0700 movel #1792,%d3 if ( the_watchdog->delta_interval != 0 ) goto leave; } do { watchdog_state = _Watchdog_Remove( the_watchdog ); 487f2: 2f0a movel %a2,%sp@- 487f4: 4e95 jsr %a5@ _ISR_Enable( level ); 487f6: 46c2 movew %d2,%sr switch( watchdog_state ) { 487f8: 7202 moveq #2,%d1 487fa: 588f addql #4,%sp 487fc: b280 cmpl %d0,%d1 487fe: 6610 bnes 48810 <_Watchdog_Tickle+0x58> <== NEVER TAKEN case WATCHDOG_ACTIVE: (*the_watchdog->routine)( 48800: 2f2a 0024 movel %a2@(36),%sp@- 48804: 2f2a 0020 movel %a2@(32),%sp@- 48808: 206a 001c moveal %a2@(28),%a0 4880c: 4e90 jsr %a0@ 4880e: 508f addql #8,%sp case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 48810: 2003 movel %d3,%d0 48812: 40c2 movew %sr,%d2 48814: 8082 orl %d2,%d0 48816: 46c0 movew %d0,%sr RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First( Chain_Control *header ) { return ( (Watchdog_Control *) header->first ); 48818: 2014 movel %a4@,%d0 4881a: 2440 moveal %d0,%a2 the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); 4881c: b7c0 cmpal %d0,%a3 4881e: 6706 beqs 48826 <_Watchdog_Tickle+0x6e> 48820: 4aaa 0010 tstl %a2@(16) 48824: 67cc beqs 487f2 <_Watchdog_Tickle+0x3a> leave: _ISR_Enable(level); 48826: 46c2 movew %d2,%sr } 48828: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 4882e: 4e5e unlk %fp ... =============================================================================== 000456bc : int adjtime( struct timeval *delta, struct timeval *olddelta ) { 456bc: 4e56 fff8 linkw %fp,#-8 456c0: 2f0b movel %a3,%sp@- 456c2: 266e 000c moveal %fp@(12),%a3 456c6: 2f0a movel %a2,%sp@- 456c8: 246e 0008 moveal %fp@(8),%a2 long adjustment; /* * Simple validations */ if ( !delta ) 456cc: 4a8a tstl %a2 456ce: 670c beqs 456dc rtems_set_errno_and_return_minus_one( EINVAL ); if ( delta->tv_usec >= TOD_MICROSECONDS_PER_SECOND ) 456d0: 227c 000f 423f moveal #999999,%a1 456d6: b3ea 0004 cmpal %a2@(4),%a1 456da: 6412 bccs 456ee rtems_set_errno_and_return_minus_one( EINVAL ); 456dc: 4eb9 0004 eaec jsr 4eaec <__errno> 456e2: 72ff moveq #-1,%d1 456e4: 2040 moveal %d0,%a0 456e6: 7016 moveq #22,%d0 456e8: 2080 movel %d0,%a0@ 456ea: 6000 00b2 braw 4579e if ( olddelta ) { 456ee: 4a8b tstl %a3 456f0: 6706 beqs 456f8 olddelta->tv_sec = 0; 456f2: 4293 clrl %a3@ olddelta->tv_usec = 0; 456f4: 42ab 0004 clrl %a3@(4) } /* convert delta to microseconds */ adjustment = (delta->tv_sec * TOD_MICROSECONDS_PER_SECOND); 456f8: 203c 000f 4240 movel #1000000,%d0 456fe: 4c12 0800 mulsl %a2@,%d0 adjustment += delta->tv_usec; 45702: d0aa 0004 addl %a2@(4),%d0 /* too small to account for */ if ( adjustment < rtems_configuration_get_microseconds_per_tick() ) 45706: b0b9 0005 ea60 cmpl 5ea60 ,%d0 4570c: 6500 008e bcsw 4579c rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 45710: 2039 0006 0354 movel 60354 <_Thread_Dispatch_disable_level>,%d0 45716: 5280 addql #1,%d0 45718: 23c0 0006 0354 movel %d0,60354 <_Thread_Dispatch_disable_level> * This prevents context switches while we are adjusting the TOD */ _Thread_Disable_dispatch(); _TOD_Get( &ts ); 4571e: 486e fff8 pea %fp@(-8) 45722: 4eb9 0004 6d74 jsr 46d74 <_TOD_Get> ts.tv_sec += delta->tv_sec; ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; 45728: 202a 0004 movel %a2@(4),%d0 4572c: 223c 0000 03e8 movel #1000,%d1 45732: 4c01 0800 mulsl %d1,%d0 /* if adjustment is too much positive */ while ( ts.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 45736: 588f addql #4,%sp _Thread_Disable_dispatch(); _TOD_Get( &ts ); ts.tv_sec += delta->tv_sec; 45738: 2212 movel %a2@,%d1 4573a: d3ae fff8 addl %d1,%fp@(-8) ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; 4573e: d0ae fffc addl %fp@(-4),%d0 45742: 206e fff8 moveal %fp@(-8),%a0 /* if adjustment is too much positive */ while ( ts.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 45746: 6006 bras 4574e 45748: 0680 c465 3600 addil #-1000000000,%d0 4574e: 2208 movel %a0,%d1 45750: 5288 addql #1,%a0 45752: 0c80 3b9a c9ff cmpil #999999999,%d0 45758: 62ee bhis 45748 4575a: 6006 bras 45762 4575c: 0680 3b9a ca00 addil #1000000000,%d0 45762: 2041 moveal %d1,%a0 45764: 5381 subql #1,%d1 ts.tv_nsec -= TOD_NANOSECONDS_PER_SECOND; ts.tv_sec++; } /* if adjustment is too much negative */ while ( ts.tv_nsec <= (-1 * TOD_NANOSECONDS_PER_SECOND) ) { 45766: 0c80 c465 3600 cmpil #-1000000000,%d0 4576c: 63ee blss 4575c ts.tv_nsec += TOD_NANOSECONDS_PER_SECOND; ts.tv_sec--; } _TOD_Set( &ts ); 4576e: 486e fff8 pea %fp@(-8) ts.tv_nsec -= TOD_NANOSECONDS_PER_SECOND; ts.tv_sec++; } /* if adjustment is too much negative */ while ( ts.tv_nsec <= (-1 * TOD_NANOSECONDS_PER_SECOND) ) { 45772: 2d40 fffc movel %d0,%fp@(-4) 45776: 2d48 fff8 movel %a0,%fp@(-8) ts.tv_nsec += TOD_NANOSECONDS_PER_SECOND; ts.tv_sec--; } _TOD_Set( &ts ); 4577a: 4eb9 0004 6e10 jsr 46e10 <_TOD_Set> _Thread_Enable_dispatch(); 45780: 4eb9 0004 7ed6 jsr 47ed6 <_Thread_Enable_dispatch> /* set the user's output */ if ( olddelta ) 45786: 588f addql #4,%sp 45788: 4a8b tstl %a3 4578a: 6710 beqs 4579c <== NEVER TAKEN *olddelta = *delta; 4578c: 4281 clrl %d1 4578e: 2052 moveal %a2@,%a0 45790: 226a 0004 moveal %a2@(4),%a1 45794: 2688 movel %a0,%a3@ 45796: 2749 0004 movel %a1,%a3@(4) 4579a: 6002 bras 4579e 4579c: 4281 clrl %d1 return 0; } 4579e: 246e fff0 moveal %fp@(-16),%a2 457a2: 2001 movel %d1,%d0 457a4: 266e fff4 moveal %fp@(-12),%a3 457a8: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00045638 : int clock_gettime( clockid_t clock_id, struct timespec *tp ) { 45638: 4e56 0000 linkw %fp,#0 4563c: 222e 0008 movel %fp@(8),%d1 45640: 202e 000c movel %fp@(12),%d0 45644: 2f02 movel %d2,%sp@- if ( !tp ) 45646: 4a80 tstl %d0 45648: 6608 bnes 45652 rtems_set_errno_and_return_minus_one( EINVAL ); 4564a: 4eb9 0004 ee9c jsr 4ee9c <__errno> 45650: 6044 bras 45696 if ( clock_id == CLOCK_REALTIME ) { 45652: 7401 moveq #1,%d2 45654: b481 cmpl %d1,%d2 45656: 660a bnes 45662 _TOD_Get(tp); 45658: 2f00 movel %d0,%sp@- 4565a: 4eb9 0004 72d8 jsr 472d8 <_TOD_Get> 45660: 600e bras 45670 return 0; } #ifdef CLOCK_MONOTONIC if ( clock_id == CLOCK_MONOTONIC ) { 45662: 7404 moveq #4,%d2 45664: b481 cmpl %d1,%d2 45666: 660e bnes 45676 <== ALWAYS TAKEN _TOD_Get_uptime_as_timespec( tp ); 45668: 2f00 movel %d0,%sp@- 4566a: 4eb9 0004 7344 jsr 47344 <_TOD_Get_uptime_as_timespec> return 0; 45670: 588f addql #4,%sp _TOD_Get(tp); return 0; } #ifdef CLOCK_MONOTONIC if ( clock_id == CLOCK_MONOTONIC ) { _TOD_Get_uptime_as_timespec( tp ); 45672: 4281 clrl %d1 return 0; 45674: 6028 bras 4569e } #endif #ifdef _POSIX_CPUTIME if ( clock_id == CLOCK_PROCESS_CPUTIME ) { 45676: 7402 moveq #2,%d2 45678: b481 cmpl %d1,%d2 4567a: 67ec beqs 45668 4567c: 41f9 0004 ee9c lea 4ee9c <__errno>,%a0 return 0; } #endif #ifdef _POSIX_THREAD_CPUTIME if ( clock_id == CLOCK_THREAD_CPUTIME ) 45682: 7003 moveq #3,%d0 45684: b081 cmpl %d1,%d0 45686: 660c bnes 45694 rtems_set_errno_and_return_minus_one( ENOSYS ); 45688: 4e90 jsr %a0@ 4568a: 7458 moveq #88,%d2 4568c: 72ff moveq #-1,%d1 4568e: 2040 moveal %d0,%a0 45690: 2082 movel %d2,%a0@ 45692: 600a bras 4569e #endif rtems_set_errno_and_return_minus_one( EINVAL ); 45694: 4e90 jsr %a0@ 45696: 2040 moveal %d0,%a0 45698: 7016 moveq #22,%d0 4569a: 72ff moveq #-1,%d1 4569c: 2080 movel %d0,%a0@ return 0; } 4569e: 242e fffc movel %fp@(-4),%d2 456a2: 2001 movel %d1,%d0 456a4: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000456a8 : int clock_settime( clockid_t clock_id, const struct timespec *tp ) { 456a8: 4e56 0000 linkw %fp,#0 456ac: 222e 0008 movel %fp@(8),%d1 456b0: 206e 000c moveal %fp@(12),%a0 if ( !tp ) 456b4: 4a88 tstl %a0 456b6: 6710 beqs 456c8 <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { 456b8: 7001 moveq #1,%d0 456ba: b081 cmpl %d1,%d0 456bc: 6634 bnes 456f2 <== NEVER TAKEN if ( tp->tv_sec < TOD_SECONDS_1970_THROUGH_1988 ) 456be: 203c 21da e4ff movel #567993599,%d0 456c4: b090 cmpl %a0@,%d0 456c6: 6508 bcss 456d0 rtems_set_errno_and_return_minus_one( EINVAL ); 456c8: 4eb9 0004 ee9c jsr 4ee9c <__errno> 456ce: 604a bras 4571a rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 456d0: 2039 0006 0b1c movel 60b1c <_Thread_Dispatch_disable_level>,%d0 456d6: 5280 addql #1,%d0 456d8: 23c0 0006 0b1c movel %d0,60b1c <_Thread_Dispatch_disable_level> _Thread_Disable_dispatch(); _TOD_Set( tp ); 456de: 2f08 movel %a0,%sp@- 456e0: 4eb9 0004 739c jsr 4739c <_TOD_Set> _Thread_Enable_dispatch(); 456e6: 4eb9 0004 8462 jsr 48462 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( ENOSYS ); #endif else rtems_set_errno_and_return_minus_one( EINVAL ); return 0; 456ec: 588f addql #4,%sp if ( tp->tv_sec < TOD_SECONDS_1970_THROUGH_1988 ) rtems_set_errno_and_return_minus_one( EINVAL ); _Thread_Disable_dispatch(); _TOD_Set( tp ); _Thread_Enable_dispatch(); 456ee: 4281 clrl %d1 rtems_set_errno_and_return_minus_one( ENOSYS ); #endif else rtems_set_errno_and_return_minus_one( EINVAL ); return 0; 456f0: 6030 bras 45722 _Thread_Disable_dispatch(); _TOD_Set( tp ); _Thread_Enable_dispatch(); } #ifdef _POSIX_CPUTIME else if ( clock_id == CLOCK_PROCESS_CPUTIME ) 456f2: 7002 moveq #2,%d0 456f4: b081 cmpl %d1,%d0 456f6: 6608 bnes 45700 rtems_set_errno_and_return_minus_one( ENOSYS ); 456f8: 4eb9 0004 ee9c jsr 4ee9c <__errno> 456fe: 600e bras 4570e 45700: 41f9 0004 ee9c lea 4ee9c <__errno>,%a0 #endif #ifdef _POSIX_THREAD_CPUTIME else if ( clock_id == CLOCK_THREAD_CPUTIME ) 45706: 7003 moveq #3,%d0 45708: b081 cmpl %d1,%d0 4570a: 660c bnes 45718 rtems_set_errno_and_return_minus_one( ENOSYS ); 4570c: 4e90 jsr %a0@ 4570e: 2040 moveal %d0,%a0 45710: 7058 moveq #88,%d0 45712: 72ff moveq #-1,%d1 45714: 2080 movel %d0,%a0@ 45716: 600a bras 45722 #endif else rtems_set_errno_and_return_minus_one( EINVAL ); 45718: 4e90 jsr %a0@ 4571a: 2040 moveal %d0,%a0 4571c: 7016 moveq #22,%d0 4571e: 72ff moveq #-1,%d1 45720: 2080 movel %d0,%a0@ return 0; } 45722: 2001 movel %d1,%d0 45724: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004d624 : int killinfo( pid_t pid, int sig, const union sigval *value ) { 4d624: 4e56 ffd0 linkw %fp,#-48 4d628: 48d7 1cfc moveml %d2-%d7/%a2-%a4,%sp@ 4d62c: 242e 000c movel %fp@(12),%d2 4d630: 246e 0010 moveal %fp@(16),%a2 POSIX_signals_Siginfo_node *psiginfo; /* * Only supported for the "calling process" (i.e. this node). */ if ( pid != getpid() ) 4d634: 4eb9 0004 a35c jsr 4a35c 4d63a: b0ae 0008 cmpl %fp@(8),%d0 4d63e: 6712 beqs 4d652 rtems_set_errno_and_return_minus_one( ESRCH ); 4d640: 4eb9 0004 e1a4 jsr 4e1a4 <__errno> 4d646: 7603 moveq #3,%d3 4d648: 72ff moveq #-1,%d1 4d64a: 2040 moveal %d0,%a0 4d64c: 2083 movel %d3,%a0@ 4d64e: 6000 01ec braw 4d83c /* * Validate the signal passed. */ if ( !sig ) 4d652: 4a82 tstl %d2 4d654: 670a beqs 4d660 static inline bool is_valid_signo( int signo ) { return ((signo) >= 1 && (signo) <= 32 ); 4d656: 2202 movel %d2,%d1 4d658: 5381 subql #1,%d1 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 4d65a: 701f moveq #31,%d0 4d65c: b081 cmpl %d1,%d0 4d65e: 6412 bccs 4d672 rtems_set_errno_and_return_minus_one( EINVAL ); 4d660: 4eb9 0004 e1a4 jsr 4e1a4 <__errno> 4d666: 7416 moveq #22,%d2 4d668: 72ff moveq #-1,%d1 4d66a: 2040 moveal %d0,%a0 4d66c: 2082 movel %d2,%a0@ 4d66e: 6000 01cc braw 4d83c /* * If the signal is being ignored, then we are out of here. */ if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) 4d672: 2602 movel %d2,%d3 4d674: 2002 movel %d2,%d0 4d676: e58b lsll #2,%d3 4d678: e988 lsll #4,%d0 4d67a: 9083 subl %d3,%d0 4d67c: 0680 0005 f3e6 addil #390118,%d0 4d682: 7601 moveq #1,%d3 4d684: 2040 moveal %d0,%a0 4d686: b690 cmpl %a0@,%d3 4d688: 6700 01b0 beqw 4d83a /* * 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 ) ) 4d68c: 7008 moveq #8,%d0 4d68e: b082 cmpl %d2,%d0 4d690: 670e beqs 4d6a0 4d692: 7604 moveq #4,%d3 4d694: b682 cmpl %d2,%d3 4d696: 6708 beqs 4d6a0 4d698: 103c 000b moveb #11,%d0 4d69c: b082 cmpl %d2,%d0 4d69e: 6618 bnes 4d6b8 return pthread_kill( pthread_self(), sig ); 4d6a0: 4eb9 0004 dc48 jsr 4dc48 4d6a6: 2f02 movel %d2,%sp@- 4d6a8: 2f00 movel %d0,%sp@- 4d6aa: 4eb9 0004 db88 jsr 4db88 4d6b0: 508f addql #8,%sp 4d6b2: 2200 movel %d0,%d1 4d6b4: 6000 0186 braw 4d83c static inline sigset_t signo_to_mask( uint32_t sig ) { return 1u << (sig - 1); 4d6b8: 7601 moveq #1,%d3 /* * Build up a siginfo structure */ siginfo = &siginfo_struct; siginfo->si_signo = sig; siginfo->si_code = SI_USER; 4d6ba: 7001 moveq #1,%d0 4d6bc: e3ab lsll %d1,%d3 /* * Build up a siginfo structure */ siginfo = &siginfo_struct; siginfo->si_signo = sig; 4d6be: 2d42 fff4 movel %d2,%fp@(-12) siginfo->si_code = SI_USER; 4d6c2: 2d40 fff8 movel %d0,%fp@(-8) if ( !value ) { 4d6c6: 4a8a tstl %a2 4d6c8: 6606 bnes 4d6d0 <== NEVER TAKEN siginfo->si_value.sival_int = 0; 4d6ca: 42ae fffc clrl %fp@(-4) 4d6ce: 6004 bras 4d6d4 } else { siginfo->si_value = *value; 4d6d0: 2d52 fffc movel %a2@,%fp@(-4) rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 4d6d4: 2039 0005 ef3c movel 5ef3c <_Thread_Dispatch_disable_level>,%d0 4d6da: 5280 addql #1,%d0 4d6dc: 23c0 0005 ef3c movel %d0,5ef3c <_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; 4d6e2: 2279 0005 eff6 moveal 5eff6 <_Thread_Executing>,%a1 api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4d6e8: 2069 010e moveal %a1@(270),%a0 4d6ec: 2028 00cc movel %a0@(204),%d0 4d6f0: 4680 notl %d0 4d6f2: c083 andl %d3,%d0 4d6f4: 6600 00b2 bnew 4d7a8 /* XXX violation of visibility -- need to define thread queue support */ the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = the_chain->first ; 4d6f8: 2079 0005 f56a moveal 5f56a <_POSIX_signals_Wait_queue>,%a0 4d6fe: 601c bras 4d71c #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 4d700: 2003 movel %d3,%d0 4d702: 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 ]; 4d706: 2468 010e moveal %a0@(270),%a2 #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 4d70a: 6600 009c bnew 4d7a8 /* * Is this thread is blocked waiting for another signal but has * not blocked this one? */ if (~api->signals_blocked & mask) 4d70e: 202a 00cc movel %a2@(204),%d0 4d712: 4680 notl %d0 4d714: c083 andl %d3,%d0 4d716: 6600 0090 bnew 4d7a8 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 ) { 4d71a: 2050 moveal %a0@,%a0 the_thread = (Thread_Control *)the_node; 4d71c: 2248 moveal %a0,%a1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4d71e: b1fc 0005 f56e cmpal #390510,%a0 4d724: 66da bnes 4d700 * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 4d726: 4280 clrl %d0 4d728: 1039 0005 d762 moveb 5d762 ,%d0 4d72e: 45f9 0005 eefc lea 5eefc <_Objects_Information_table+0x8>,%a2 */ #define _POSIX_signals_Is_interested( _api, _mask ) \ ( ~(_api)->signals_blocked & (_mask) ) int killinfo( 4d734: 93c9 subal %a1,%a1 * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 4d736: 5280 addql #1,%d0 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 ] ) 4d738: 2052 moveal %a2@,%a0 4d73a: 4a88 tstl %a0 4d73c: 675c beqs 4d79a continue; the_info = _Objects_Information_table[ the_api ][ 1 ]; 4d73e: 2068 0004 moveal %a0@(4),%a0 */ if ( !the_info ) continue; #endif maximum = the_info->maximum; 4d742: 4287 clrl %d7 4d744: 7801 moveq #1,%d4 4d746: 2668 0018 moveal %a0@(24),%a3 4d74a: 588b addql #4,%a3 4d74c: 3e28 000e movew %a0@(14),%d7 object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 4d750: 6044 bras 4d796 the_thread = (Thread_Control *) object_table[ index ]; 4d752: 2053 moveal %a3@,%a0 if ( !the_thread ) 4d754: 4a88 tstl %a0 4d756: 6732 beqs 4d78a /* * If this thread is of lower priority than the interested thread, * go on to the next thread. */ if ( the_thread->current_priority > interested_priority ) 4d758: 2228 0014 movel %a0@(20),%d1 4d75c: b081 cmpl %d1,%d0 4d75e: 652a bcss 4d78a DEBUG_STEP("2"); /* * If this thread is not interested, then go on to the next thread. */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4d760: 2868 010e moveal %a0@(270),%a4 4d764: 2a2c 00cc movel %a4@(204),%d5 4d768: 4685 notl %d5 4d76a: ca83 andl %d3,%d5 4d76c: 671c beqs 4d78a * * 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 ) { 4d76e: b081 cmpl %d1,%d0 4d770: 621c bhis 4d78e * and blocking interruptibutable by signal. * * If the interested thread is ready, don't think about changing. */ if ( !_States_Is_ready( interested->current_state ) ) { 4d772: 2c29 0010 movel %a1@(16),%d6 4d776: 6712 beqs 4d78a <== NEVER TAKEN /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 4d778: 2a28 0010 movel %a0@(16),%d5 4d77c: 6710 beqs 4d78e continue; } DEBUG_STEP("6"); /* prefer blocked/interruptible over blocked/not interruptible */ if ( !_States_Is_interruptible_by_signal(interested->current_state) ) { 4d77e: 0806 001c btst #28,%d6 4d782: 6606 bnes 4d78a DEBUG_STEP("7"); if ( _States_Is_interruptible_by_signal(the_thread->current_state) ) { 4d784: 0805 001c btst #28,%d5 4d788: 6604 bnes 4d78e 4d78a: 2200 movel %d0,%d1 4d78c: 6002 bras 4d790 4d78e: 2248 moveal %a0,%a1 #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 4d790: 5284 addql #1,%d4 4d792: 588b addql #4,%a3 4d794: 2001 movel %d1,%d0 4d796: be84 cmpl %d4,%d7 4d798: 64b8 bccs 4d752 4d79a: 588a addql #4,%a2 * + 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++) { 4d79c: b5fc 0005 ef08 cmpal #388872,%a2 4d7a2: 6694 bnes 4d738 } } } } if ( interested ) { 4d7a4: 4a89 tstl %a1 4d7a6: 671c beqs 4d7c4 * 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; 4d7a8: 7001 moveq #1,%d0 4d7aa: 1340 0074 moveb %d0,%a1@(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 ) ) { 4d7ae: 486e fff4 pea %fp@(-12) 4d7b2: 2f02 movel %d2,%sp@- 4d7b4: 2f09 movel %a1,%sp@- 4d7b6: 4eb9 0004 da00 jsr 4da00 <_POSIX_signals_Unblock_thread> 4d7bc: 4fef 000c lea %sp@(12),%sp 4d7c0: 4a00 tstb %d0 4d7c2: 6670 bnes 4d834 /* * 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 ); 4d7c4: 2f03 movel %d3,%sp@- if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { 4d7c6: 2602 movel %d2,%d3 4d7c8: e58a lsll #2,%d2 4d7ca: e98b lsll #4,%d3 /* * 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 ); 4d7cc: 4eb9 0004 d9d0 jsr 4d9d0 <_POSIX_signals_Set_process_signals> if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { 4d7d2: 588f addql #4,%sp 4d7d4: 9682 subl %d2,%d3 4d7d6: 41f9 0005 f3de lea 5f3de <_POSIX_signals_Vectors>,%a0 4d7dc: 7002 moveq #2,%d0 4d7de: b0b0 3800 cmpl %a0@(00000000,%d3:l),%d0 4d7e2: 6650 bnes 4d834 psiginfo = (POSIX_signals_Siginfo_node *) 4d7e4: 4879 0005 f55e pea 5f55e <_POSIX_signals_Inactive_siginfo> 4d7ea: 4eb9 0004 61c0 jsr 461c0 <_Chain_Get> _Chain_Get( &_POSIX_signals_Inactive_siginfo ); if ( !psiginfo ) { 4d7f0: 588f addql #4,%sp */ _POSIX_signals_Set_process_signals( mask ); if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { psiginfo = (POSIX_signals_Siginfo_node *) 4d7f2: 2440 moveal %d0,%a2 _Chain_Get( &_POSIX_signals_Inactive_siginfo ); if ( !psiginfo ) { 4d7f4: 4a80 tstl %d0 4d7f6: 6616 bnes 4d80e _Thread_Enable_dispatch(); 4d7f8: 4eb9 0004 76b2 jsr 476b2 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EAGAIN ); 4d7fe: 4eb9 0004 e1a4 jsr 4e1a4 <__errno> 4d804: 72ff moveq #-1,%d1 4d806: 2040 moveal %d0,%a0 4d808: 700b moveq #11,%d0 4d80a: 2080 movel %d0,%a0@ 4d80c: 602e bras 4d83c } psiginfo->Info = *siginfo; 4d80e: 4878 000c pea c _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 4d812: 0683 0005 f5d6 addil #390614,%d3 if ( !psiginfo ) { _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EAGAIN ); } psiginfo->Info = *siginfo; 4d818: 486e fff4 pea %fp@(-12) 4d81c: 486a 0008 pea %a2@(8) 4d820: 4eb9 0004 e9c4 jsr 4e9c4 _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 4d826: 2f0a movel %a2,%sp@- 4d828: 2f03 movel %d3,%sp@- 4d82a: 4eb9 0004 6160 jsr 46160 <_Chain_Append> 4d830: 4fef 0014 lea %sp@(20),%sp } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); 4d834: 4eb9 0004 76b2 jsr 476b2 <_Thread_Enable_dispatch> 4d83a: 4281 clrl %d1 return 0; } 4d83c: 2001 movel %d1,%d0 4d83e: 4cee 1cfc ffd0 moveml %fp@(-48),%d2-%d7/%a2-%a4 4d844: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0005bf84 : int nanosleep( const struct timespec *rqtp, struct timespec *rmtp ) { 5bf84: 4e56 fff4 linkw %fp,#-12 5bf88: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 5bf8c: 266e 0008 moveal %fp@(8),%a3 5bf90: 246e 000c moveal %fp@(12),%a2 Watchdog_Interval ticks; if ( !_Timespec_Is_valid( rqtp ) ) 5bf94: 2f0b movel %a3,%sp@- 5bf96: 4eb9 0005 c0d4 jsr 5c0d4 <_Timespec_Is_valid> 5bf9c: 588f addql #4,%sp 5bf9e: 4a00 tstb %d0 5bfa0: 670a beqs 5bfac * Return EINVAL if the delay interval is negative. * * NOTE: This behavior is beyond the POSIX specification. * FSU and GNU/Linux pthreads shares this behavior. */ if ( rqtp->tv_sec < 0 || rqtp->tv_nsec < 0 ) 5bfa2: 4a93 tstl %a3@ 5bfa4: 6d06 blts 5bfac <== NEVER TAKEN 5bfa6: 4aab 0004 tstl %a3@(4) 5bfaa: 6c12 bges 5bfbe <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); 5bfac: 4eb9 0004 e5e4 jsr 4e5e4 <__errno> 5bfb2: 7416 moveq #22,%d2 5bfb4: 72ff moveq #-1,%d1 5bfb6: 2040 moveal %d0,%a0 5bfb8: 2082 movel %d2,%a0@ 5bfba: 6000 00ce braw 5c08a ticks = _Timespec_To_ticks( rqtp ); 5bfbe: 2f0b movel %a3,%sp@- 5bfc0: 47f9 0004 7a4e lea 47a4e <_Thread_Enable_dispatch>,%a3 5bfc6: 4eb9 0004 c310 jsr 4c310 <_Timespec_To_ticks> * A nanosleep for zero time is implemented as a yield. * This behavior is also beyond the POSIX specification but is * consistent with the RTEMS API and yields desirable behavior. */ if ( !ticks ) { 5bfcc: 588f addql #4,%sp * FSU and GNU/Linux pthreads shares this behavior. */ if ( rqtp->tv_sec < 0 || rqtp->tv_nsec < 0 ) rtems_set_errno_and_return_minus_one( EINVAL ); ticks = _Timespec_To_ticks( rqtp ); 5bfce: 2400 movel %d0,%d2 * A nanosleep for zero time is implemented as a yield. * This behavior is also beyond the POSIX specification but is * consistent with the RTEMS API and yields desirable behavior. */ if ( !ticks ) { 5bfd0: 6628 bnes 5bffa 5bfd2: 2039 0005 fd64 movel 5fd64 <_Thread_Dispatch_disable_level>,%d0 5bfd8: 5280 addql #1,%d0 5bfda: 23c0 0005 fd64 movel %d0,5fd64 <_Thread_Dispatch_disable_level> _Thread_Disable_dispatch(); _Thread_Yield_processor(); 5bfe0: 4eb9 0004 8658 jsr 48658 <_Thread_Yield_processor> _Thread_Enable_dispatch(); 5bfe6: 4e93 jsr %a3@ if ( rmtp ) { 5bfe8: 4a8a tstl %a2 5bfea: 6700 009c beqw 5c088 rmtp->tv_sec = 0; rmtp->tv_nsec = 0; 5bfee: 42aa 0004 clrl %a2@(4) 5bff2: 4281 clrl %d1 if ( !ticks ) { _Thread_Disable_dispatch(); _Thread_Yield_processor(); _Thread_Enable_dispatch(); if ( rmtp ) { rmtp->tv_sec = 0; 5bff4: 4292 clrl %a2@ 5bff6: 6000 0092 braw 5c08a 5bffa: 2039 0005 fd64 movel 5fd64 <_Thread_Dispatch_disable_level>,%d0 5c000: 5280 addql #1,%d0 5c002: 23c0 0005 fd64 movel %d0,5fd64 <_Thread_Dispatch_disable_level> /* * Block for the desired amount of time */ _Thread_Disable_dispatch(); _Thread_Set_state( 5c008: 2f3c 1000 0008 movel #268435464,%sp@- 5c00e: 2f39 0005 fe1e movel 5fe1e <_Thread_Executing>,%sp@- 5c014: 4eb9 0004 827c jsr 4827c <_Thread_Set_state> STATES_DELAYING | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Watchdog_Initialize( &_Thread_Executing->Timer, _Thread_Delay_ended, _Thread_Executing->Object.id, 5c01a: 2079 0005 fe1e moveal 5fe1e <_Thread_Executing>,%a0 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 5c020: 203c 0004 78c0 movel #293056,%d0 5c026: 2140 0064 movel %d0,%a0@(100) _Thread_Disable_dispatch(); _Thread_Set_state( _Thread_Executing, STATES_DELAYING | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Watchdog_Initialize( 5c02a: 2028 0008 movel %a0@(8),%d0 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 5c02e: 42a8 0050 clrl %a0@(80) the_watchdog->routine = routine; the_watchdog->id = id; 5c032: 2140 0068 movel %d0,%a0@(104) the_watchdog->user_data = user_data; 5c036: 42a8 006c clrl %a0@(108) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 5c03a: 2142 0054 movel %d2,%a0@(84) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 5c03e: 4868 0048 pea %a0@(72) 5c042: 4879 0005 fe3c pea 5fe3c <_Watchdog_Ticks_chain> 5c048: 4eb9 0004 8a3c jsr 48a3c <_Watchdog_Insert> _Thread_Delay_ended, _Thread_Executing->Object.id, NULL ); _Watchdog_Insert_ticks( &_Thread_Executing->Timer, ticks ); _Thread_Enable_dispatch(); 5c04e: 4e93 jsr %a3@ /* calculate time remaining */ if ( rmtp ) { 5c050: 4fef 0010 lea %sp@(16),%sp 5c054: 4a8a tstl %a2 5c056: 6730 beqs 5c088 ticks -= _Thread_Executing->Timer.stop_time - _Thread_Executing->Timer.start_time; 5c058: 2079 0005 fe1e moveal 5fe1e <_Thread_Executing>,%a0 _Thread_Enable_dispatch(); /* calculate time remaining */ if ( rmtp ) { ticks -= 5c05e: 2028 005c movel %a0@(92),%d0 5c062: 90a8 0060 subl %a0@(96),%d0 5c066: d480 addl %d0,%d2 _Thread_Executing->Timer.stop_time - _Thread_Executing->Timer.start_time; _Timespec_From_ticks( ticks, rmtp ); 5c068: 2f0a movel %a2,%sp@- 5c06a: 2f02 movel %d2,%sp@- 5c06c: 4eb9 0005 c098 jsr 5c098 <_Timespec_From_ticks> */ #if defined(RTEMS_POSIX_API) /* * If there is time remaining, then we were interrupted by a signal. */ if ( ticks ) 5c072: 508f addql #8,%sp 5c074: 4a82 tstl %d2 5c076: 6710 beqs 5c088 rtems_set_errno_and_return_minus_one( EINTR ); 5c078: 4eb9 0004 e5e4 jsr 4e5e4 <__errno> 5c07e: 72ff moveq #-1,%d1 5c080: 2040 moveal %d0,%a0 5c082: 7004 moveq #4,%d0 5c084: 2080 movel %d0,%a0@ 5c086: 6002 bras 5c08a 5c088: 4281 clrl %d1 #endif } return 0; } 5c08a: 2001 movel %d1,%d0 5c08c: 4cee 0c04 fff4 moveml %fp@(-12),%d2/%a2-%a3 5c092: 4e5e unlk %fp ... =============================================================================== 000499f0 : int pthread_attr_setschedpolicy( pthread_attr_t *attr, int policy ) { 499f0: 4e56 0000 linkw %fp,#0 499f4: 206e 0008 moveal %fp@(8),%a0 499f8: 222e 000c movel %fp@(12),%d1 499fc: 2f02 movel %d2,%sp@- if ( !attr || !attr->is_initialized ) 499fe: 4a88 tstl %a0 49a00: 6726 beqs 49a28 49a02: 4a90 tstl %a0@ 49a04: 6722 beqs 49a28 return EINVAL; switch ( policy ) { 49a06: 7004 moveq #4,%d0 49a08: b081 cmpl %d1,%d0 49a0a: 650c bcss 49a18 49a0c: 103c 0001 moveb #1,%d0 49a10: 7417 moveq #23,%d2 49a12: e3a8 lsll %d1,%d0 49a14: c082 andl %d2,%d0 49a16: 6608 bnes 49a20 <== ALWAYS TAKEN 49a18: 203c 0000 0086 movel #134,%d0 49a1e: 600a bras 49a2a case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: case SCHED_SPORADIC: attr->schedpolicy = policy; 49a20: 2141 0014 movel %d1,%a0@(20) 49a24: 4280 clrl %d0 return 0; 49a26: 6002 bras 49a2a 49a28: 7016 moveq #22,%d0 default: return ENOTSUP; } } 49a2a: 241f movel %sp@+,%d2 49a2c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00045b44 : int pthread_barrier_init( pthread_barrier_t *barrier, const pthread_barrierattr_t *attr, unsigned int count ) { 45b44: 4e56 ffe0 linkw %fp,#-32 45b48: 206e 000c moveal %fp@(12),%a0 45b4c: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ 45b50: 266e 0008 moveal %fp@(8),%a3 45b54: 246e 0010 moveal %fp@(16),%a2 const pthread_barrierattr_t *the_attr; /* * Error check parameters */ if ( !barrier ) 45b58: 4a8b tstl %a3 45b5a: 6700 008e beqw 45bea return EINVAL; if ( count == 0 ) 45b5e: 4a8a tstl %a2 45b60: 6700 0088 beqw 45bea return EINVAL; /* * If the user passed in NULL, use the default attributes */ if ( attr ) { 45b64: 4a88 tstl %a0 45b66: 6614 bnes 45b7c the_attr = attr; } else { (void) pthread_barrierattr_init( &my_attr ); 45b68: 240e movel %fp,%d2 45b6a: 0682 ffff fff0 addil #-16,%d2 45b70: 2f02 movel %d2,%sp@- 45b72: 4eb9 0004 5a88 jsr 45a88 45b78: 588f addql #4,%sp 45b7a: 2042 moveal %d2,%a0 } /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) 45b7c: 4a90 tstl %a0@ 45b7e: 676a beqs 45bea return EINVAL; switch ( the_attr->process_shared ) { 45b80: 4aa8 0004 tstl %a0@(4) 45b84: 6664 bnes 45bea <== NEVER TAKEN rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 45b86: 2039 0006 03f0 movel 603f0 <_Thread_Dispatch_disable_level>,%d0 45b8c: 5280 addql #1,%d0 /* * Convert from POSIX attributes to Core Barrier attributes */ the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE; the_attributes.maximum_count = count; 45b8e: 2d4a fffc movel %a2,%fp@(-4) 45b92: 23c0 0006 03f0 movel %d0,603f0 <_Thread_Dispatch_disable_level> } /* * Convert from POSIX attributes to Core Barrier attributes */ the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE; 45b98: 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 *) 45b9c: 4879 0006 0732 pea 60732 <_POSIX_Barrier_Information> 45ba2: 45f9 0004 8672 lea 48672 <_Thread_Enable_dispatch>,%a2 45ba8: 4eb9 0004 7a24 jsr 47a24 <_Objects_Allocate> */ _Thread_Disable_dispatch(); /* prevents deletion */ the_barrier = _POSIX_Barrier_Allocate(); if ( !the_barrier ) { 45bae: 588f addql #4,%sp 45bb0: 2840 moveal %d0,%a4 45bb2: 4a80 tstl %d0 45bb4: 6606 bnes 45bbc _Thread_Enable_dispatch(); 45bb6: 4e92 jsr %a2@ 45bb8: 700b moveq #11,%d0 return EAGAIN; 45bba: 6030 bras 45bec } _CORE_barrier_Initialize( &the_barrier->Barrier, &the_attributes ); 45bbc: 486e fff8 pea %fp@(-8) 45bc0: 486c 0010 pea %a4@(16) 45bc4: 4eb9 0004 7154 jsr 47154 <_CORE_barrier_Initialize> #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 45bca: 202c 0008 movel %a4@(8),%d0 45bce: 4281 clrl %d1 45bd0: 2079 0006 074a moveal 6074a <_POSIX_Barrier_Information+0x18>,%a0 45bd6: 3200 movew %d0,%d1 45bd8: 218c 1c00 movel %a4,%a0@(00000000,%d1:l:4) _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 45bdc: 42ac 000c clrl %a4@(12) ); /* * Exit the critical section and return the user an operational barrier */ *barrier = the_barrier->Object.id; 45be0: 2680 movel %d0,%a3@ _Thread_Enable_dispatch(); 45be2: 4e92 jsr %a2@ return 0; 45be4: 508f addql #8,%sp /* * Exit the critical section and return the user an operational barrier */ *barrier = the_barrier->Object.id; _Thread_Enable_dispatch(); 45be6: 4280 clrl %d0 return 0; 45be8: 6002 bras 45bec 45bea: 7016 moveq #22,%d0 } 45bec: 4cee 1c04 ffe0 moveml %fp@(-32),%d2/%a2-%a4 45bf2: 4e5e unlk %fp ... =============================================================================== 00045588 : void pthread_cleanup_push( void (*routine)( void * ), void *arg ) { 45588: 4e56 0000 linkw %fp,#0 4558c: 2f03 movel %d3,%sp@- 4558e: 262e 000c movel %fp@(12),%d3 45592: 2f02 movel %d2,%sp@- 45594: 242e 0008 movel %fp@(8),%d2 /* * The POSIX standard does not address what to do when the routine * is NULL. It also does not address what happens when we cannot * allocate memory or anything else bad happens. */ if ( !routine ) 45598: 6754 beqs 455ee <== NEVER TAKEN rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 4559a: 2039 0005 fe68 movel 5fe68 <_Thread_Dispatch_disable_level>,%d0 455a0: 5280 addql #1,%d0 455a2: 23c0 0005 fe68 movel %d0,5fe68 <_Thread_Dispatch_disable_level> return; _Thread_Disable_dispatch(); handler = _Workspace_Allocate( sizeof( POSIX_Cancel_Handler_control ) ); 455a8: 4878 0010 pea 10 455ac: 4eb9 0004 9344 jsr 49344 <_Workspace_Allocate> if ( handler ) { 455b2: 588f addql #4,%sp 455b4: 4a80 tstl %d0 455b6: 6726 beqs 455de <== NEVER TAKEN thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; handler_stack = &thread_support->Cancellation_Handlers; 455b8: 2079 0005 ff22 moveal 5ff22 <_Thread_Executing>,%a0 455be: 2228 010e movel %a0@(270),%d1 handler->routine = routine; 455c2: 2040 moveal %d0,%a0 handler = _Workspace_Allocate( sizeof( POSIX_Cancel_Handler_control ) ); if ( handler ) { thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; handler_stack = &thread_support->Cancellation_Handlers; 455c4: 0681 0000 00e0 addil #224,%d1 handler->routine = routine; 455ca: 2142 0008 movel %d2,%a0@(8) handler->arg = arg; 455ce: 2143 000c movel %d3,%a0@(12) _Chain_Append( handler_stack, &handler->Node ); 455d2: 2f00 movel %d0,%sp@- 455d4: 2f01 movel %d1,%sp@- 455d6: 4eb9 0004 6c18 jsr 46c18 <_Chain_Append> 455dc: 508f addql #8,%sp } _Thread_Enable_dispatch(); } 455de: 242e fff8 movel %fp@(-8),%d2 455e2: 262e fffc movel %fp@(-4),%d3 455e6: 4e5e unlk %fp handler->routine = routine; handler->arg = arg; _Chain_Append( handler_stack, &handler->Node ); } _Thread_Enable_dispatch(); 455e8: 4ef9 0004 80fa jmp 480fa <_Thread_Enable_dispatch> } 455ee: 242e fff8 movel %fp@(-8),%d2 455f2: 262e fffc movel %fp@(-4),%d3 455f6: 4e5e unlk %fp ... =============================================================================== 000462d0 : int pthread_cond_init( pthread_cond_t *cond, const pthread_condattr_t *attr ) { 462d0: 4e56 fff4 linkw %fp,#-12 462d4: 202e 000c movel %fp@(12),%d0 462d8: 48d7 1c00 moveml %a2-%a4,%sp@ POSIX_Condition_variables_Control *the_cond; const pthread_condattr_t *the_attr; if ( attr ) the_attr = attr; 462dc: 45f9 0005 e952 lea 5e952 <_POSIX_Condition_variables_Default_attributes>,%a2 462e2: 4a80 tstl %d0 462e4: 6702 beqs 462e8 462e6: 2440 moveal %d0,%a2 /* * Be careful about attributes when global!!! */ if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) 462e8: 7001 moveq #1,%d0 462ea: b0aa 0004 cmpl %a2@(4),%d0 462ee: 6776 beqs 46366 <== NEVER TAKEN return EINVAL; if ( !the_attr->is_initialized ) 462f0: 4a92 tstl %a2@ 462f2: 6772 beqs 46366 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 462f4: 2039 0006 146c movel 6146c <_Thread_Dispatch_disable_level>,%d0 462fa: 5280 addql #1,%d0 462fc: 23c0 0006 146c movel %d0,6146c <_Thread_Dispatch_disable_level> */ RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *_POSIX_Condition_variables_Allocate( void ) { return (POSIX_Condition_variables_Control *) 46302: 4879 0006 183a pea 6183a <_POSIX_Condition_variables_Information> 46308: 47f9 0004 930a lea 4930a <_Thread_Enable_dispatch>,%a3 4630e: 4eb9 0004 86bc jsr 486bc <_Objects_Allocate> _Thread_Disable_dispatch(); the_cond = _POSIX_Condition_variables_Allocate(); if ( !the_cond ) { 46314: 588f addql #4,%sp 46316: 2840 moveal %d0,%a4 46318: 4a80 tstl %d0 4631a: 6606 bnes 46322 _Thread_Enable_dispatch(); 4631c: 4e93 jsr %a3@ 4631e: 700c moveq #12,%d0 return ENOMEM; 46320: 6046 bras 46368 } the_cond->process_shared = the_attr->process_shared; the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX; 46322: 42ac 0014 clrl %a4@(20) if ( !the_cond ) { _Thread_Enable_dispatch(); return ENOMEM; } the_cond->process_shared = the_attr->process_shared; 46326: 296a 0004 0010 movel %a2@(4),%a4@(16) the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX; /* XXX some more initialization might need to go here */ _Thread_queue_Initialize( 4632c: 4878 0074 pea 74 46330: 4878 0800 pea 800 46334: 42a7 clrl %sp@- 46336: 486c 0018 pea %a4@(24) 4633a: 4eb9 0004 9a2c jsr 49a2c <_Thread_queue_Initialize> #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 46340: 202c 0008 movel %a4@(8),%d0 46344: 4281 clrl %d1 46346: 2079 0006 1852 moveal 61852 <_POSIX_Condition_variables_Information+0x18>,%a0 4634c: 3200 movew %d0,%d1 4634e: 218c 1c00 movel %a4,%a0@(00000000,%d1:l:4) _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 46352: 42ac 000c clrl %a4@(12) &_POSIX_Condition_variables_Information, &the_cond->Object, 0 ); *cond = the_cond->Object.id; 46356: 206e 0008 moveal %fp@(8),%a0 4635a: 2080 movel %d0,%a0@ _Thread_Enable_dispatch(); 4635c: 4e93 jsr %a3@ return 0; 4635e: 4fef 0010 lea %sp@(16),%sp 0 ); *cond = the_cond->Object.id; _Thread_Enable_dispatch(); 46362: 4280 clrl %d0 return 0; 46364: 6002 bras 46368 46366: 7016 moveq #22,%d0 } 46368: 4cee 1c00 fff4 moveml %fp@(-12),%a2-%a4 4636e: 4e5e unlk %fp ... =============================================================================== 00046168 : */ int pthread_condattr_destroy( pthread_condattr_t *attr ) { 46168: 4e56 0000 linkw %fp,#0 4616c: 206e 0008 moveal %fp@(8),%a0 if ( !attr || attr->is_initialized == false ) 46170: 4a88 tstl %a0 46172: 670a beqs 4617e 46174: 4a90 tstl %a0@ 46176: 6706 beqs 4617e <== NEVER TAKEN return EINVAL; attr->is_initialized = false; 46178: 4290 clrl %a0@ 4617a: 4280 clrl %d0 return 0; 4617c: 6002 bras 46180 4617e: 7016 moveq #22,%d0 } 46180: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004db6c : } void pthread_exit( void *value_ptr ) { 4db6c: 4e56 0000 linkw %fp,#0 _POSIX_Thread_Exit( _Thread_Executing, value_ptr ); 4db70: 2f2e 0008 movel %fp@(8),%sp@- 4db74: 2f39 0005 eff6 movel 5eff6 <_Thread_Executing>,%sp@- 4db7a: 4eb9 0004 dafc jsr 4dafc <_POSIX_Thread_Exit> 4db80: 508f addql #8,%sp <== NOT EXECUTED } 4db82: 4e5e unlk %fp <== NOT EXECUTED ... =============================================================================== 000453e8 : #if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES) int pthread_mutexattr_gettype( const pthread_mutexattr_t *attr, int *type ) { 453e8: 4e56 0000 linkw %fp,#0 453ec: 206e 0008 moveal %fp@(8),%a0 453f0: 226e 000c moveal %fp@(12),%a1 if ( !attr ) 453f4: 4a88 tstl %a0 453f6: 6710 beqs 45408 <== NEVER TAKEN return EINVAL; if ( !attr->is_initialized ) 453f8: 4a90 tstl %a0@ 453fa: 670c beqs 45408 <== NEVER TAKEN return EINVAL; if ( !type ) 453fc: 4a89 tstl %a1 453fe: 6708 beqs 45408 <== NEVER TAKEN return EINVAL; *type = attr->type; 45400: 22a8 0010 movel %a0@(16),%a1@ 45404: 4280 clrl %d0 return 0; 45406: 6002 bras 4540a 45408: 7016 moveq #22,%d0 } 4540a: 4e5e unlk %fp ... =============================================================================== 00047184 : int pthread_mutexattr_setpshared( pthread_mutexattr_t *attr, int pshared ) { 47184: 4e56 0000 linkw %fp,#0 47188: 206e 0008 moveal %fp@(8),%a0 4718c: 202e 000c movel %fp@(12),%d0 if ( !attr || !attr->is_initialized ) 47190: 4a88 tstl %a0 47192: 6712 beqs 471a6 47194: 4a90 tstl %a0@ 47196: 670e beqs 471a6 return EINVAL; switch ( pshared ) { 47198: 7201 moveq #1,%d1 4719a: b280 cmpl %d0,%d1 4719c: 6508 bcss 471a6 <== NEVER TAKEN case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; 4719e: 2140 0004 movel %d0,%a0@(4) 471a2: 4280 clrl %d0 return 0; 471a4: 6002 bras 471a8 471a6: 7016 moveq #22,%d0 default: return EINVAL; } } 471a8: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004543c : #if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES) int pthread_mutexattr_settype( pthread_mutexattr_t *attr, int type ) { 4543c: 4e56 0000 linkw %fp,#0 45440: 206e 0008 moveal %fp@(8),%a0 45444: 202e 000c movel %fp@(12),%d0 if ( !attr || !attr->is_initialized ) 45448: 4a88 tstl %a0 4544a: 6712 beqs 4545e 4544c: 4a90 tstl %a0@ 4544e: 670e beqs 4545e <== NEVER TAKEN return EINVAL; switch ( type ) { 45450: 7203 moveq #3,%d1 45452: b280 cmpl %d0,%d1 45454: 6508 bcss 4545e case PTHREAD_MUTEX_NORMAL: case PTHREAD_MUTEX_RECURSIVE: case PTHREAD_MUTEX_ERRORCHECK: case PTHREAD_MUTEX_DEFAULT: attr->type = type; 45456: 2140 0010 movel %d0,%a0@(16) 4545a: 4280 clrl %d0 return 0; 4545c: 6002 bras 45460 4545e: 7016 moveq #22,%d0 default: return EINVAL; } } 45460: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00045ebc : int pthread_once( pthread_once_t *once_control, void (*init_routine)(void) ) { 45ebc: 4e56 fffc linkw %fp,#-4 45ec0: 2f0b movel %a3,%sp@- 45ec2: 266e 000c moveal %fp@(12),%a3 45ec6: 2f0a movel %a2,%sp@- 45ec8: 246e 0008 moveal %fp@(8),%a2 if ( !once_control || !init_routine ) 45ecc: 4a8a tstl %a2 45ece: 674a beqs 45f1a 45ed0: 4a8b tstl %a3 45ed2: 6746 beqs 45f1a return EINVAL; if ( !once_control->init_executed ) { 45ed4: 4aaa 0004 tstl %a2@(4) 45ed8: 663c bnes 45f16 rtems_mode saveMode; rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode); 45eda: 486e fffc pea %fp@(-4) 45ede: 4878 0100 pea 100 45ee2: 4878 0100 pea 100 45ee6: 4eb9 0004 69c4 jsr 469c4 if ( !once_control->init_executed ) { 45eec: 4fef 000c lea %sp@(12),%sp 45ef0: 4aaa 0004 tstl %a2@(4) 45ef4: 660a bnes 45f00 <== NEVER TAKEN once_control->is_initialized = true; once_control->init_executed = true; 45ef6: 7001 moveq #1,%d0 45ef8: 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; 45efc: 2480 movel %d0,%a2@ once_control->init_executed = true; (*init_routine)(); 45efe: 4e93 jsr %a3@ } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); 45f00: 486e fffc pea %fp@(-4) 45f04: 4878 0100 pea 100 45f08: 2f2e fffc movel %fp@(-4),%sp@- 45f0c: 4eb9 0004 69c4 jsr 469c4 45f12: 4fef 000c lea %sp@(12),%sp 45f16: 4280 clrl %d0 45f18: 6002 bras 45f1c 45f1a: 7016 moveq #22,%d0 } return 0; } 45f1c: 246e fff4 moveal %fp@(-12),%a2 45f20: 266e fff8 moveal %fp@(-8),%a3 45f24: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00046484 : int pthread_rwlock_init( pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr ) { 46484: 4e56 ffe8 linkw %fp,#-24 46488: 48d7 1c00 moveml %a2-%a4,%sp@ 4648c: 266e 0008 moveal %fp@(8),%a3 46490: 246e 000c moveal %fp@(12),%a2 const pthread_rwlockattr_t *the_attr; /* * Error check parameters */ if ( !rwlock ) 46494: 4a8b tstl %a3 46496: 6778 beqs 46510 return EINVAL; /* * If the user passed in NULL, use the default attributes */ if ( attr ) { 46498: 4a8a tstl %a2 4649a: 660e bnes 464aa the_attr = attr; } else { (void) pthread_rwlockattr_init( &default_attr ); 4649c: 45ee fff4 lea %fp@(-12),%a2 464a0: 2f0a movel %a2,%sp@- 464a2: 4eb9 0004 6d90 jsr 46d90 464a8: 588f addql #4,%sp } /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) 464aa: 4a92 tstl %a2@ 464ac: 6762 beqs 46510 <== NEVER TAKEN return EINVAL; switch ( the_attr->process_shared ) { 464ae: 4aaa 0004 tstl %a2@(4) 464b2: 665c bnes 46510 <== NEVER TAKEN rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 464b4: 2039 0006 18c0 movel 618c0 <_Thread_Dispatch_disable_level>,%d0 464ba: 5280 addql #1,%d0 464bc: 23c0 0006 18c0 movel %d0,618c0 <_Thread_Dispatch_disable_level> * This function allocates a RWLock control block from * the inactive chain of free RWLock control blocks. */ RTEMS_INLINE_ROUTINE POSIX_RWLock_Control *_POSIX_RWLock_Allocate( void ) { return (POSIX_RWLock_Control *) 464c2: 4879 0006 1a6c pea 61a6c <_POSIX_RWLock_Information> 464c8: 45f9 0004 94ca lea 494ca <_Thread_Enable_dispatch>,%a2 464ce: 4eb9 0004 887c jsr 4887c <_Objects_Allocate> */ _Thread_Disable_dispatch(); /* prevents deletion */ the_rwlock = _POSIX_RWLock_Allocate(); if ( !the_rwlock ) { 464d4: 588f addql #4,%sp 464d6: 2840 moveal %d0,%a4 464d8: 4a80 tstl %d0 464da: 6606 bnes 464e2 _Thread_Enable_dispatch(); 464dc: 4e92 jsr %a2@ 464de: 700b moveq #11,%d0 return EAGAIN; 464e0: 6030 bras 46512 } _CORE_RWLock_Initialize( &the_rwlock->RWLock, &the_attributes ); 464e2: 486e fffc pea %fp@(-4) 464e6: 486c 0010 pea %a4@(16) 464ea: 4eb9 0004 80b0 jsr 480b0 <_CORE_RWLock_Initialize> #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 464f0: 202c 0008 movel %a4@(8),%d0 464f4: 4281 clrl %d1 464f6: 2079 0006 1a84 moveal 61a84 <_POSIX_RWLock_Information+0x18>,%a0 464fc: 3200 movew %d0,%d1 464fe: 218c 1c00 movel %a4,%a0@(00000000,%d1:l:4) _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 46502: 42ac 000c clrl %a4@(12) &_POSIX_RWLock_Information, &the_rwlock->Object, 0 ); *rwlock = the_rwlock->Object.id; 46506: 2680 movel %d0,%a3@ _Thread_Enable_dispatch(); 46508: 4e92 jsr %a2@ return 0; 4650a: 508f addql #8,%sp 0 ); *rwlock = the_rwlock->Object.id; _Thread_Enable_dispatch(); 4650c: 4280 clrl %d0 return 0; 4650e: 6002 bras 46512 46510: 7016 moveq #22,%d0 } 46512: 4cee 1c00 ffe8 moveml %fp@(-24),%a2-%a4 46518: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00046584 : int pthread_rwlock_timedrdlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { 46584: 4e56 ffec linkw %fp,#-20 46588: 48d7 040c moveml %d2-%d3/%a2,%sp@ 4658c: 246e 0008 moveal %fp@(8),%a2 Objects_Locations location; Watchdog_Interval ticks; bool do_wait = true; POSIX_Absolute_timeout_conversion_results_t status; if ( !rwlock ) 46590: 4a8a tstl %a2 46592: 6700 008e beqw 46622 * * 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 ); 46596: 486e fff8 pea %fp@(-8) 4659a: 2f2e 000c movel %fp@(12),%sp@- 4659e: 4eb9 0004 cb1c jsr 4cb1c <_POSIX_Absolute_timeout_to_ticks> 465a4: 486e fffc pea %fp@(-4) 465a8: 2400 movel %d0,%d2 465aa: 2f12 movel %a2@,%sp@- 465ac: 4879 0006 1a6c pea 61a6c <_POSIX_RWLock_Information> 465b2: 4eb9 0004 8cc8 jsr 48cc8 <_Objects_Get> if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { 465b8: 4fef 0014 lea %sp@(20),%sp 465bc: 4aae fffc tstl %fp@(-4) 465c0: 6660 bnes 46622 int _EXFUN(pthread_rwlock_init, (pthread_rwlock_t *__rwlock, _CONST pthread_rwlockattr_t *__attr)); int _EXFUN(pthread_rwlock_destroy, (pthread_rwlock_t *__rwlock)); int _EXFUN(pthread_rwlock_rdlock,(pthread_rwlock_t *__rwlock)); int _EXFUN(pthread_rwlock_tryrdlock,(pthread_rwlock_t *__rwlock)); int _EXFUN(pthread_rwlock_timedrdlock, 465c2: 7203 moveq #3,%d1 465c4: b282 cmpl %d2,%d1 465c6: 57c3 seq %d3 case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_reading( 465c8: 42a7 clrl %sp@- 465ca: 2f2e fff8 movel %fp@(-8),%sp@- 465ce: 4483 negl %d3 465d0: 4281 clrl %d1 465d2: 1203 moveb %d3,%d1 465d4: 2040 moveal %d0,%a0 465d6: 2f01 movel %d1,%sp@- 465d8: 2f12 movel %a2@,%sp@- 465da: 4868 0010 pea %a0@(16) 465de: 4eb9 0004 80e4 jsr 480e4 <_CORE_RWLock_Obtain_for_reading> do_wait, ticks, NULL ); _Thread_Enable_dispatch(); 465e4: 4eb9 0004 94ca jsr 494ca <_Thread_Enable_dispatch> if ( !do_wait ) { 465ea: 4fef 0014 lea %sp@(20),%sp 465ee: 4a03 tstb %d3 465f0: 661c bnes 4660e if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) { 465f2: 2079 0006 197a moveal 6197a <_Thread_Executing>,%a0 465f8: 7002 moveq #2,%d0 465fa: b0a8 0034 cmpl %a0@(52),%d0 465fe: 660e bnes 4660e switch (status) { 46600: 4a82 tstl %d2 46602: 671e beqs 46622 <== NEVER TAKEN 46604: b082 cmpl %d2,%d0 46606: 6506 bcss 4660e <== NEVER TAKEN 46608: 103c 0074 moveb #116,%d0 4660c: 6016 bras 46624 break; } } } return _POSIX_RWLock_Translate_core_RWLock_return_code( 4660e: 2079 0006 197a moveal 6197a <_Thread_Executing>,%a0 46614: 2f28 0034 movel %a0@(52),%sp@- 46618: 4eb9 0004 66dc jsr 466dc <_POSIX_RWLock_Translate_core_RWLock_return_code> 4661e: 588f addql #4,%sp 46620: 6002 bras 46624 46622: 7016 moveq #22,%d0 case OBJECTS_ERROR: break; } return EINVAL; } 46624: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 4662a: 4e5e unlk %fp ... =============================================================================== 00046630 : int pthread_rwlock_timedwrlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { 46630: 4e56 ffec linkw %fp,#-20 46634: 48d7 040c moveml %d2-%d3/%a2,%sp@ 46638: 246e 0008 moveal %fp@(8),%a2 Objects_Locations location; Watchdog_Interval ticks; bool do_wait = true; POSIX_Absolute_timeout_conversion_results_t status; if ( !rwlock ) 4663c: 4a8a tstl %a2 4663e: 6700 008e beqw 466ce * * 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 ); 46642: 486e fff8 pea %fp@(-8) 46646: 2f2e 000c movel %fp@(12),%sp@- 4664a: 4eb9 0004 cb1c jsr 4cb1c <_POSIX_Absolute_timeout_to_ticks> 46650: 486e fffc pea %fp@(-4) 46654: 2400 movel %d0,%d2 46656: 2f12 movel %a2@,%sp@- 46658: 4879 0006 1a6c pea 61a6c <_POSIX_RWLock_Information> 4665e: 4eb9 0004 8cc8 jsr 48cc8 <_Objects_Get> if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { 46664: 4fef 0014 lea %sp@(20),%sp 46668: 4aae fffc tstl %fp@(-4) 4666c: 6660 bnes 466ce (pthread_rwlock_t *__rwlock, _CONST struct timespec *__abstime)); int _EXFUN(pthread_rwlock_unlock,(pthread_rwlock_t *__rwlock)); int _EXFUN(pthread_rwlock_wrlock,(pthread_rwlock_t *__rwlock)); int _EXFUN(pthread_rwlock_trywrlock,(pthread_rwlock_t *__rwlock)); int _EXFUN(pthread_rwlock_timedwrlock, 4666e: 7203 moveq #3,%d1 46670: b282 cmpl %d2,%d1 46672: 57c3 seq %d3 case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_writing( 46674: 42a7 clrl %sp@- 46676: 2f2e fff8 movel %fp@(-8),%sp@- 4667a: 4483 negl %d3 4667c: 4281 clrl %d1 4667e: 1203 moveb %d3,%d1 46680: 2040 moveal %d0,%a0 46682: 2f01 movel %d1,%sp@- 46684: 2f12 movel %a2@,%sp@- 46686: 4868 0010 pea %a0@(16) 4668a: 4eb9 0004 8194 jsr 48194 <_CORE_RWLock_Obtain_for_writing> do_wait, ticks, NULL ); _Thread_Enable_dispatch(); 46690: 4eb9 0004 94ca jsr 494ca <_Thread_Enable_dispatch> if ( !do_wait && 46696: 4fef 0014 lea %sp@(20),%sp 4669a: 4a03 tstb %d3 4669c: 661c bnes 466ba (_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) { 4669e: 2079 0006 197a moveal 6197a <_Thread_Executing>,%a0 466a4: 7002 moveq #2,%d0 466a6: b0a8 0034 cmpl %a0@(52),%d0 466aa: 660e bnes 466ba switch (status) { 466ac: 4a82 tstl %d2 466ae: 671e beqs 466ce <== NEVER TAKEN 466b0: b082 cmpl %d2,%d0 466b2: 6506 bcss 466ba <== NEVER TAKEN 466b4: 103c 0074 moveb #116,%d0 466b8: 6016 bras 466d0 case POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE: break; } } return _POSIX_RWLock_Translate_core_RWLock_return_code( 466ba: 2079 0006 197a moveal 6197a <_Thread_Executing>,%a0 466c0: 2f28 0034 movel %a0@(52),%sp@- 466c4: 4eb9 0004 66dc jsr 466dc <_POSIX_RWLock_Translate_core_RWLock_return_code> 466ca: 588f addql #4,%sp 466cc: 6002 bras 466d0 466ce: 7016 moveq #22,%d0 case OBJECTS_ERROR: break; } return EINVAL; } 466d0: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 466d6: 4e5e unlk %fp ... =============================================================================== 000467bc : */ int pthread_rwlock_unlock( pthread_rwlock_t *rwlock ) { 467bc: 4e56 fffc linkw %fp,#-4 467c0: 206e 0008 moveal %fp@(8),%a0 467c4: 2f02 movel %d2,%sp@- POSIX_RWLock_Control *the_rwlock; Objects_Locations location; CORE_RWLock_Status status; if ( !rwlock ) 467c6: 4a88 tstl %a0 467c8: 673c beqs 46806 <== NEVER TAKEN 467ca: 486e fffc pea %fp@(-4) 467ce: 2f10 movel %a0@,%sp@- 467d0: 4879 0006 1a6c pea 61a6c <_POSIX_RWLock_Information> 467d6: 4eb9 0004 8cc8 jsr 48cc8 <_Objects_Get> return EINVAL; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { 467dc: 4fef 000c lea %sp@(12),%sp 467e0: 4aae fffc tstl %fp@(-4) 467e4: 6620 bnes 46806 <== NEVER TAKEN case OBJECTS_LOCAL: status = _CORE_RWLock_Release( &the_rwlock->RWLock ); 467e6: 2040 moveal %d0,%a0 467e8: 4868 0010 pea %a0@(16) 467ec: 4eb9 0004 8220 jsr 48220 <_CORE_RWLock_Release> 467f2: 2400 movel %d0,%d2 _Thread_Enable_dispatch(); 467f4: 4eb9 0004 94ca jsr 494ca <_Thread_Enable_dispatch> return _POSIX_RWLock_Translate_core_RWLock_return_code( status ); 467fa: 2f02 movel %d2,%sp@- 467fc: 4eb9 0004 66dc jsr 466dc <_POSIX_RWLock_Translate_core_RWLock_return_code> 46802: 508f addql #8,%sp 46804: 6002 bras 46808 46806: 7016 moveq #22,%d0 case OBJECTS_ERROR: break; } return EINVAL; } 46808: 242e fff8 movel %fp@(-8),%d2 4680c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00046db0 : int pthread_rwlockattr_setpshared( pthread_rwlockattr_t *attr, int pshared ) { 46db0: 4e56 0000 linkw %fp,#0 46db4: 206e 0008 moveal %fp@(8),%a0 46db8: 202e 000c movel %fp@(12),%d0 if ( !attr ) 46dbc: 4a88 tstl %a0 46dbe: 6712 beqs 46dd2 return EINVAL; if ( !attr->is_initialized ) 46dc0: 4a90 tstl %a0@ 46dc2: 670e beqs 46dd2 return EINVAL; switch ( pshared ) { 46dc4: 7201 moveq #1,%d1 46dc6: b280 cmpl %d0,%d1 46dc8: 6508 bcss 46dd2 <== NEVER TAKEN case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; 46dca: 2140 0004 movel %d0,%a0@(4) 46dce: 4280 clrl %d0 return 0; 46dd0: 6002 bras 46dd4 46dd2: 7016 moveq #22,%d0 default: return EINVAL; } } 46dd4: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00047d10 : int pthread_setschedparam( pthread_t thread, int policy, struct sched_param *param ) { 47d10: 4e56 ffe0 linkw %fp,#-32 47d14: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 47d18: 282e 000c movel %fp@(12),%d4 47d1c: 262e 0010 movel %fp@(16),%d3 int rc; /* * Check all the parameters */ if ( !param ) 47d20: 6606 bnes 47d28 47d22: 7416 moveq #22,%d2 47d24: 6000 00e6 braw 47e0c return EINVAL; rc = _POSIX_Thread_Translate_sched_param( 47d28: 486e fff8 pea %fp@(-8) 47d2c: 486e fffc pea %fp@(-4) 47d30: 2f03 movel %d3,%sp@- 47d32: 2f04 movel %d4,%sp@- 47d34: 4eb9 0004 da1c jsr 4da1c <_POSIX_Thread_Translate_sched_param> policy, param, &budget_algorithm, &budget_callout ); if ( rc ) 47d3a: 4fef 0010 lea %sp@(16),%sp * Check all the parameters */ if ( !param ) return EINVAL; rc = _POSIX_Thread_Translate_sched_param( 47d3e: 2400 movel %d0,%d2 policy, param, &budget_algorithm, &budget_callout ); if ( rc ) 47d40: 6600 00ca bnew 47e0c 47d44: 486e fff4 pea %fp@(-12) 47d48: 2f2e 0008 movel %fp@(8),%sp@- 47d4c: 4879 0006 3c22 pea 63c22 <_POSIX_Threads_Information> 47d52: 4eb9 0004 9aa0 jsr 49aa0 <_Objects_Get> /* * Actually change the scheduling policy and parameters */ the_thread = _POSIX_Threads_Get( thread, &location ); switch ( location ) { 47d58: 4fef 000c lea %sp@(12),%sp 47d5c: 2640 moveal %d0,%a3 47d5e: 4aae fff4 tstl %fp@(-12) 47d62: 6708 beqs 47d6c 47d64: 143c 0003 moveb #3,%d2 47d68: 6000 00a2 braw 47e0c case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 47d6c: 246b 010e moveal %a3@(270),%a2 if ( api->schedpolicy == SCHED_SPORADIC ) 47d70: 7004 moveq #4,%d0 47d72: b0aa 0080 cmpl %a2@(128),%d0 47d76: 660c bnes 47d84 (void) _Watchdog_Remove( &api->Sporadic_timer ); 47d78: 486a 00a4 pea %a2@(164) 47d7c: 4eb9 0004 b498 jsr 4b498 <_Watchdog_Remove> 47d82: 588f addql #4,%sp api->schedpolicy = policy; 47d84: 2544 0080 movel %d4,%a2@(128) api->schedparam = *param; 47d88: 4878 001c pea 1c 47d8c: 2f03 movel %d3,%sp@- 47d8e: 486a 0084 pea %a2@(132) 47d92: 4eb9 0005 1460 jsr 51460 the_thread->budget_algorithm = budget_algorithm; 47d98: 276e fffc 007a movel %fp@(-4),%a3@(122) the_thread->budget_callout = budget_callout; switch ( api->schedpolicy ) { 47d9e: 4fef 000c lea %sp@(12),%sp (void) _Watchdog_Remove( &api->Sporadic_timer ); api->schedpolicy = policy; api->schedparam = *param; the_thread->budget_algorithm = budget_algorithm; the_thread->budget_callout = budget_callout; 47da2: 276e fff8 007e movel %fp@(-8),%a3@(126) switch ( api->schedpolicy ) { 47da8: 202a 0080 movel %a2@(128),%d0 47dac: 6d58 blts 47e06 <== NEVER TAKEN 47dae: 7202 moveq #2,%d1 47db0: b280 cmpl %d0,%d1 47db2: 6c0a bges 47dbe 47db4: 123c 0004 moveb #4,%d1 47db8: b280 cmpl %d0,%d1 47dba: 664a bnes 47e06 <== NEVER TAKEN 47dbc: 602a bras 47de8 47dbe: 4280 clrl %d0 47dc0: 1039 0006 2236 moveb 62236 ,%d0 case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; 47dc6: 41f9 0006 39ec lea 639ec <_Thread_Ticks_per_timeslice>,%a0 47dcc: 90aa 0084 subl %a2@(132),%d0 47dd0: 2750 0076 movel %a0@,%a3@(118) the_thread->real_priority = 47dd4: 2740 0018 movel %d0,%a3@(24) _POSIX_Priority_To_core( api->schedparam.sched_priority ); _Thread_Change_priority( 47dd8: 4878 0001 pea 1 47ddc: 2f00 movel %d0,%sp@- 47dde: 2f0b movel %a3,%sp@- 47de0: 4eb9 0004 9da8 jsr 49da8 <_Thread_Change_priority> 47de6: 601a bras 47e02 true ); break; case SCHED_SPORADIC: api->ss_high_priority = api->schedparam.sched_priority; 47de8: 256a 0084 00a0 movel %a2@(132),%a2@(160) _Watchdog_Remove( &api->Sporadic_timer ); 47dee: 486a 00a4 pea %a2@(164) 47df2: 4eb9 0004 b498 jsr 4b498 <_Watchdog_Remove> _POSIX_Threads_Sporadic_budget_TSR( 0, the_thread ); 47df8: 2f0b movel %a3,%sp@- 47dfa: 42a7 clrl %sp@- 47dfc: 4eb9 0004 7c7c jsr 47c7c <_POSIX_Threads_Sporadic_budget_TSR> 47e02: 4fef 000c lea %sp@(12),%sp break; } _Thread_Enable_dispatch(); 47e06: 4eb9 0004 a2a2 jsr 4a2a2 <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return ESRCH; } 47e0c: 2002 movel %d2,%d0 47e0e: 4cee 0c1c ffe0 moveml %fp@(-32),%d2-%d4/%a2-%a3 47e14: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00045cb0 : * * 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183 */ void pthread_testcancel( void ) { 45cb0: 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() ) 45cb4: 2039 0005 ff02 movel 5ff02 <_ISR_Nest_level>,%d0 * * 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183 */ void pthread_testcancel( void ) { 45cba: 2f02 movel %d2,%sp@- * 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() ) 45cbc: 4a80 tstl %d0 45cbe: 6646 bnes 45d06 <== NEVER TAKEN return; thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 45cc0: 2079 0005 ff22 moveal 5ff22 <_Thread_Executing>,%a0 45cc6: 2039 0005 fe68 movel 5fe68 <_Thread_Dispatch_disable_level>,%d0 45ccc: 5280 addql #1,%d0 45cce: 2068 010e moveal %a0@(270),%a0 45cd2: 23c0 0005 fe68 movel %d0,5fe68 <_Thread_Dispatch_disable_level> _Thread_Disable_dispatch(); if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 45cd8: 4aa8 00d4 tstl %a0@(212) 45cdc: 6704 beqs 45ce2 <== ALWAYS TAKEN 45cde: 4202 clrb %d2 <== NOT EXECUTED 45ce0: 6008 bras 45cea <== NOT EXECUTED /* Setting Cancelability State, P1003.1c/Draft 10, p. 183 */ int _EXFUN(pthread_setcancelstate, (int __state, int *__oldstate)); int _EXFUN(pthread_setcanceltype, (int __type, int *__oldtype)); void _EXFUN(pthread_testcancel, (void)); 45ce2: 4aa8 00dc tstl %a0@(220) 45ce6: 56c2 sne %d2 45ce8: 4482 negl %d2 thread_support->cancelation_requested ) cancel = true; _Thread_Enable_dispatch(); 45cea: 4eb9 0004 80fa jsr 480fa <_Thread_Enable_dispatch> if ( cancel ) 45cf0: 4a02 tstb %d2 45cf2: 6712 beqs 45d06 _POSIX_Thread_Exit( _Thread_Executing, PTHREAD_CANCELED ); 45cf4: 4878 ffff pea ffffffff 45cf8: 2f39 0005 ff22 movel 5ff22 <_Thread_Executing>,%sp@- 45cfe: 4eb9 0004 b950 jsr 4b950 <_POSIX_Thread_Exit> 45d04: 508f addql #8,%sp } 45d06: 242e fffc movel %fp@(-4),%d2 45d0a: 4e5e unlk %fp ... =============================================================================== 00045d42 : #endif Objects_Information *_Internal_Objects[ OBJECTS_INTERNAL_CLASSES_LAST + 1 ]; void rtems_initialize_data_structures(void) { 45d42: 4e56 0000 linkw %fp,#0 45d46: 42b9 0005 f0c4 clrl 5f0c4 <_System_state_Current> #endif /* * Initialize any target architecture specific support as early as possible */ _CPU_Initialize(); 45d4c: 4eb9 0004 89c4 jsr 489c4 <_CPU_Initialize> /* * Do this as early as possible to ensure no debugging output * is even attempted to be printed. */ _Debug_Manager_initialization(); 45d52: 4eb9 0004 b4ec jsr 4b4ec <_Debug_Manager_initialization> _API_extensions_Initialization(); 45d58: 4eb9 0004 5fd0 jsr 45fd0 <_API_extensions_Initialization> * This routine initializes the thread dispatching subsystem. */ RTEMS_INLINE_ROUTINE void _Thread_Dispatch_initialization( void ) { _Thread_Dispatch_disable_level = 1; 45d5e: 7001 moveq #1,%d0 45d60: 23c0 0005 ef3c movel %d0,5ef3c <_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(); 45d66: 4eb9 0004 889c jsr 4889c <_Workspace_Handler_initialization> _User_extensions_Handler_initialization(); 45d6c: 4eb9 0004 83b8 jsr 483b8 <_User_extensions_Handler_initialization> _ISR_Handler_initialization(); 45d72: 4eb9 0004 698c jsr 4698c <_ISR_Handler_initialization> /* * Initialize the internal support API and allocator Mutex */ _Objects_Information_table[OBJECTS_INTERNAL_API] = _Internal_Objects; _API_Mutex_Initialization( 1 ); 45d78: 4878 0001 pea 1 _ISR_Handler_initialization(); /* * Initialize the internal support API and allocator Mutex */ _Objects_Information_table[OBJECTS_INTERNAL_API] = _Internal_Objects; 45d7c: 203c 0005 ef52 movel #388946,%d0 45d82: 23c0 0005 eef8 movel %d0,5eef8 <_Objects_Information_table+0x4> _API_Mutex_Initialization( 1 ); 45d88: 4eb9 0004 6100 jsr 46100 <_API_Mutex_Initialization> _API_Mutex_Allocate( &_RTEMS_Allocator_Mutex ); 45d8e: 4879 0005 efee pea 5efee <_RTEMS_Allocator_Mutex> 45d94: 4eb9 0004 6060 jsr 46060 <_API_Mutex_Allocate> #include #endif Objects_Information *_Internal_Objects[ OBJECTS_INTERNAL_CLASSES_LAST + 1 ]; void rtems_initialize_data_structures(void) 45d9a: 508f addql #8,%sp RTEMS_INLINE_ROUTINE void _Priority_Handler_initialization( void ) { int index; _Priority_Major_bit_map = 0; 45d9c: 41f9 0005 f05c lea 5f05c <_Priority_Bit_map>,%a0 45da2: 4240 clrw %d0 45da4: 33c0 0005 efec movew %d0,5efec <_Priority_Major_bit_map> for ( index=0 ; index <16 ; index++ ) _Priority_Bit_map[ index ] = 0; 45daa: 4258 clrw %a0@+ RTEMS_INLINE_ROUTINE void _Priority_Handler_initialization( void ) { int index; _Priority_Major_bit_map = 0; for ( index=0 ; index <16 ; index++ ) 45dac: b1fc 0005 f07c cmpal #389244,%a0 45db2: 66f6 bnes 45daa _API_Mutex_Initialization( 1 ); _API_Mutex_Allocate( &_RTEMS_Allocator_Mutex ); _Priority_Handler_initialization(); _Watchdog_Handler_initialization(); 45db4: 4eb9 0004 86f0 jsr 486f0 <_Watchdog_Handler_initialization> _TOD_Handler_initialization(); 45dba: 4eb9 0004 65b4 jsr 465b4 <_TOD_Handler_initialization> _Thread_Handler_initialization(); 45dc0: 4eb9 0004 7930 jsr 47930 <_Thread_Handler_initialization> _MPCI_Handler_initialization( RTEMS_TIMEOUT ); #endif /* MANAGERS */ _RTEMS_API_Initialize(); 45dc6: 4eb9 0004 5f7c jsr 45f7c <_RTEMS_API_Initialize> _Extension_Manager_initialization(); 45dcc: 4eb9 0004 5e1c jsr 45e1c <_Extension_Manager_initialization> _IO_Manager_initialization(); 45dd2: 4eb9 0004 5e94 jsr 45e94 <_IO_Manager_initialization> #ifdef RTEMS_POSIX_API _POSIX_API_Initialize(); 45dd8: 4eb9 0004 5f28 jsr 45f28 <_POSIX_API_Initialize> _Thread_Create_idle(); /* * Scheduling can properly occur now as long as we avoid dispatching. */ } 45dde: 4e5e unlk %fp 45de0: 7001 moveq #1,%d0 45de2: 23c0 0005 f0c4 movel %d0,5f0c4 <_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(); 45de8: 4ef9 0004 7474 jmp 47474 <_Thread_Create_idle> ... =============================================================================== 00046e34 : 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 ) { 46e34: 4e56 0000 linkw %fp,#0 46e38: 206e 000c moveal %fp@(12),%a0 46e3c: 2f0a movel %a2,%sp@- 46e3e: 226e 0010 moveal %fp@(16),%a1 46e42: 2f02 movel %d2,%sp@- 46e44: 242e 0008 movel %fp@(8),%d2 rtems_device_major_number major_limit = _IO_Number_of_drivers; 46e48: 2039 0006 2d8e movel 62d8e <_IO_Number_of_drivers>,%d0 if ( rtems_interrupt_is_in_progress() ) 46e4e: 2239 0006 256e movel 6256e <_ISR_Nest_level>,%d1 46e54: 6706 beqs 46e5c 46e56: 7012 moveq #18,%d0 46e58: 6000 00d6 braw 46f30 return RTEMS_CALLED_FROM_ISR; if ( registered_major == NULL ) 46e5c: 4a89 tstl %a1 46e5e: 6700 00ce beqw 46f2e return RTEMS_INVALID_ADDRESS; /* Set it to an invalid value */ *registered_major = major_limit; 46e62: 2280 movel %d0,%a1@ if ( driver_table == NULL ) 46e64: 4a88 tstl %a0 46e66: 6700 00c6 beqw 46f2e static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 46e6a: 4a90 tstl %a0@ 46e6c: 6600 00ce bnew 46f3c 46e70: 4aa8 0004 tstl %a0@(4) 46e74: 6600 00c6 bnew 46f3c 46e78: 6000 00b4 braw 46f2e rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 46e7c: 2039 0006 24d4 movel 624d4 <_Thread_Dispatch_disable_level>,%d0 46e82: 5280 addql #1,%d0 46e84: 23c0 0006 24d4 movel %d0,624d4 <_Thread_Dispatch_disable_level> if ( major >= major_limit ) return RTEMS_INVALID_NUMBER; _Thread_Disable_dispatch(); if ( major == 0 ) { 46e8a: 4a82 tstl %d2 46e8c: 662c bnes 46eba static rtems_status_code rtems_io_obtain_major_number( rtems_device_major_number *major ) { rtems_device_major_number n = _IO_Number_of_drivers; 46e8e: 2039 0006 2d8e movel 62d8e <_IO_Number_of_drivers>,%d0 46e94: 2479 0006 2d92 moveal 62d92 <_IO_Driver_address_table>,%a2 46e9a: 6010 bras 46eac static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 46e9c: 4a92 tstl %a2@ 46e9e: 6600 00a6 bnew 46f46 46ea2: 4aaa 0004 tstl %a2@(4) 46ea6: 6600 009e bnew 46f46 46eaa: 6004 bras 46eb0 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 ) { 46eac: b082 cmpl %d2,%d0 46eae: 62ec bhis 46e9c if ( rtems_io_is_empty_table( table ) ) break; } /* Assigns invalid value in case of failure */ *major = m; 46eb0: 2282 movel %d2,%a1@ if ( m != n ) 46eb2: b082 cmpl %d2,%d0 46eb4: 6634 bnes 46eea 46eb6: 6000 0098 braw 46f50 _Thread_Enable_dispatch(); return sc; } major = *registered_major; } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major; 46eba: 2202 movel %d2,%d1 46ebc: 2002 movel %d2,%d0 46ebe: e789 lsll #3,%d1 46ec0: eb88 lsll #5,%d0 46ec2: 2479 0006 2d92 moveal 62d92 <_IO_Driver_address_table>,%a2 46ec8: 9081 subl %d1,%d0 46eca: d5c0 addal %d0,%a2 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 46ecc: 4a92 tstl %a2@ 46ece: 660e bnes 46ede 46ed0: 4aaa 0004 tstl %a2@(4) 46ed4: 57c0 seq %d0 46ed6: 49c0 extbl %d0 46ed8: 4480 negl %d0 } major = *registered_major; } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major; if ( !rtems_io_is_empty_table( table ) ) { 46eda: 4a00 tstb %d0 46edc: 660a bnes 46ee8 _Thread_Enable_dispatch(); 46ede: 4eb9 0004 875a jsr 4875a <_Thread_Enable_dispatch> 46ee4: 700c moveq #12,%d0 return RTEMS_RESOURCE_IN_USE; 46ee6: 6048 bras 46f30 } *registered_major = major; 46ee8: 2282 movel %d2,%a1@ } _IO_Driver_address_table [major] = *driver_table; 46eea: 4878 0018 pea 18 46eee: 2202 movel %d2,%d1 46ef0: 2002 movel %d2,%d0 46ef2: e789 lsll #3,%d1 46ef4: eb88 lsll #5,%d0 46ef6: 2f08 movel %a0,%sp@- 46ef8: 9081 subl %d1,%d0 46efa: d0b9 0006 2d92 addl 62d92 <_IO_Driver_address_table>,%d0 46f00: 2f00 movel %d0,%sp@- 46f02: 4eb9 0005 2084 jsr 52084 _Thread_Enable_dispatch(); 46f08: 4eb9 0004 875a jsr 4875a <_Thread_Enable_dispatch> return rtems_io_initialize( major, 0, NULL ); } 46f0e: 246e fffc moveal %fp@(-4),%a2 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 46f12: 4fef 000c lea %sp@(12),%sp 46f16: 2d42 0008 movel %d2,%fp@(8) } 46f1a: 242e fff8 movel %fp@(-8),%d2 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 46f1e: 42ae 0010 clrl %fp@(16) 46f22: 42ae 000c clrl %fp@(12) } 46f26: 4e5e unlk %fp _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 46f28: 4ef9 0004 ed74 jmp 4ed74 46f2e: 7009 moveq #9,%d0 } 46f30: 242e fff8 movel %fp@(-8),%d2 46f34: 246e fffc moveal %fp@(-4),%a2 46f38: 4e5e unlk %fp 46f3a: 4e75 rts return RTEMS_INVALID_ADDRESS; if ( rtems_io_is_empty_table( driver_table ) ) return RTEMS_INVALID_ADDRESS; if ( major >= major_limit ) 46f3c: b082 cmpl %d2,%d0 46f3e: 6200 ff3c bhiw 46e7c 46f42: 700a moveq #10,%d0 46f44: 60ea bras 46f30 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 ) { 46f46: 5282 addql #1,%d2 46f48: 45ea 0018 lea %a2@(24),%a2 46f4c: 6000 ff5e braw 46eac if ( major == 0 ) { rtems_status_code sc = rtems_io_obtain_major_number( registered_major ); if ( sc != RTEMS_SUCCESSFUL ) { _Thread_Enable_dispatch(); 46f50: 4eb9 0004 875a jsr 4875a <_Thread_Enable_dispatch> 46f56: 7005 moveq #5,%d0 return sc; 46f58: 60d6 bras 46f30 ... =============================================================================== 00047c7c : #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) { 47c7c: 4e56 fff0 linkw %fp,#-16 47c80: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ 47c84: 286e 0008 moveal %fp@(8),%a4 uint32_t i; uint32_t api_index; Thread_Control *the_thread; Objects_Information *information; if ( !routine ) 47c88: 4a8c tstl %a4 47c8a: 6740 beqs 47ccc <== NEVER TAKEN 47c8c: 45f9 0006 1428 lea 61428 <_Objects_Information_table+0x4>,%a2 return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { if ( !_Objects_Information_table[ api_index ] ) 47c92: 2052 moveal %a2@,%a0 47c94: 4a88 tstl %a0 47c96: 672a beqs 47cc2 continue; information = _Objects_Information_table[ api_index ][ 1 ]; 47c98: 2668 0004 moveal %a0@(4),%a3 if ( !information ) 47c9c: 4a8b tstl %a3 47c9e: 6722 beqs 47cc2 47ca0: 7401 moveq #1,%d2 47ca2: 6014 bras 47cb8 continue; for ( i=1 ; i <= information->maximum ; i++ ) { the_thread = (Thread_Control *)information->local_table[ i ]; 47ca4: 206b 0018 moveal %a3@(24),%a0 47ca8: 2030 2c00 movel %a0@(00000000,%d2:l:4),%d0 information = _Objects_Information_table[ api_index ][ 1 ]; if ( !information ) continue; for ( i=1 ; i <= information->maximum ; i++ ) { 47cac: 5282 addql #1,%d2 the_thread = (Thread_Control *)information->local_table[ i ]; if ( !the_thread ) 47cae: 4a80 tstl %d0 47cb0: 6706 beqs 47cb8 <== NEVER TAKEN continue; (*routine)(the_thread); 47cb2: 2f00 movel %d0,%sp@- 47cb4: 4e94 jsr %a4@ 47cb6: 588f addql #4,%sp information = _Objects_Information_table[ api_index ][ 1 ]; if ( !information ) continue; for ( i=1 ; i <= information->maximum ; i++ ) { 47cb8: 4280 clrl %d0 47cba: 302b 000e movew %a3@(14),%d0 47cbe: b082 cmpl %d2,%d0 47cc0: 64e2 bccs 47ca4 47cc2: 588a addql #4,%a2 Objects_Information *information; if ( !routine ) return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { 47cc4: b5fc 0006 1438 cmpal #398392,%a2 47cca: 66c6 bnes 47c92 (*routine)(the_thread); } } } 47ccc: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 47cd2: 4e5e unlk %fp ... =============================================================================== 0004fc20 : rtems_status_code rtems_partition_return_buffer( rtems_id id, void *buffer ) { 4fc20: 4e56 fffc linkw %fp,#-4 4fc24: 2f0a movel %a2,%sp@- 4fc26: 2f02 movel %d2,%sp@- RTEMS_INLINE_ROUTINE Partition_Control *_Partition_Get ( Objects_Id id, Objects_Locations *location ) { return (Partition_Control *) 4fc28: 486e fffc pea %fp@(-4) 4fc2c: 2f2e 0008 movel %fp@(8),%sp@- 4fc30: 4879 0007 756a pea 7756a <_Partition_Information> 4fc36: 242e 000c movel %fp@(12),%d2 4fc3a: 4eb9 0005 4044 jsr 54044 <_Objects_Get> register Partition_Control *the_partition; Objects_Locations location; the_partition = _Partition_Get( id, &location ); switch ( location ) { 4fc40: 4fef 000c lea %sp@(12),%sp 4fc44: 2440 moveal %d0,%a2 4fc46: 4aae fffc tstl %fp@(-4) 4fc4a: 6704 beqs 4fc50 4fc4c: 7004 moveq #4,%d0 4fc4e: 603c bras 4fc8c ) { void *starting; void *ending; starting = the_partition->starting_address; 4fc50: 202a 0010 movel %a2@(16),%d0 ending = _Addresses_Add_offset( starting, the_partition->length ); 4fc54: 222a 0014 movel %a2@(20),%d1 const void *address, const void *base, const void *limit ) { return (address >= base && address <= limit); 4fc58: b082 cmpl %d2,%d0 4fc5a: 623c bhis 4fc98 4fc5c: d280 addl %d0,%d1 4fc5e: b282 cmpl %d2,%d1 4fc60: 6536 bcss 4fc98 <== NEVER TAKEN return ( 4fc62: 2202 movel %d2,%d1 4fc64: 9280 subl %d0,%d1 4fc66: 2001 movel %d1,%d0 4fc68: 4c6a 0001 0018 remul %a2@(24),%d1,%d0 4fc6e: 4a81 tstl %d1 4fc70: 6626 bnes 4fc98 RTEMS_INLINE_ROUTINE void _Partition_Free_buffer ( Partition_Control *the_partition, Chain_Node *the_buffer ) { _Chain_Append( &the_partition->Memory, the_buffer ); 4fc72: 2f02 movel %d2,%sp@- 4fc74: 486a 0024 pea %a2@(36) 4fc78: 4eb9 0005 286c jsr 5286c <_Chain_Append> case OBJECTS_LOCAL: if ( _Partition_Is_buffer_valid( buffer, the_partition ) ) { _Partition_Free_buffer( the_partition, buffer ); the_partition->number_of_used_blocks -= 1; 4fc7e: 53aa 0020 subql #1,%a2@(32) _Thread_Enable_dispatch(); 4fc82: 4eb9 0005 4942 jsr 54942 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 4fc88: 508f addql #8,%sp case OBJECTS_LOCAL: if ( _Partition_Is_buffer_valid( buffer, the_partition ) ) { _Partition_Free_buffer( the_partition, buffer ); the_partition->number_of_used_blocks -= 1; _Thread_Enable_dispatch(); 4fc8a: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4fc8c: 242e fff4 movel %fp@(-12),%d2 4fc90: 246e fff8 moveal %fp@(-8),%a2 4fc94: 4e5e unlk %fp 4fc96: 4e75 rts _Partition_Free_buffer( the_partition, buffer ); the_partition->number_of_used_blocks -= 1; _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } _Thread_Enable_dispatch(); 4fc98: 4eb9 0005 4942 jsr 54942 <_Thread_Enable_dispatch> 4fc9e: 7009 moveq #9,%d0 return RTEMS_INVALID_ADDRESS; 4fca0: 60ea bras 4fc8c ... =============================================================================== 000464c0 : rtems_status_code rtems_rate_monotonic_period( rtems_id id, rtems_interval length ) { 464c0: 4e56 ffec linkw %fp,#-20 464c4: 48d7 041c moveml %d2-%d4/%a2,%sp@ RTEMS_INLINE_ROUTINE Rate_monotonic_Control *_Rate_monotonic_Get ( Objects_Id id, Objects_Locations *location ) { return (Rate_monotonic_Control *) 464c8: 486e fffc pea %fp@(-4) 464cc: 262e 0008 movel %fp@(8),%d3 464d0: 2f03 movel %d3,%sp@- 464d2: 4879 0006 0a74 pea 60a74 <_Rate_monotonic_Information> 464d8: 242e 000c movel %fp@(12),%d2 464dc: 4eb9 0004 841c jsr 4841c <_Objects_Get> rtems_rate_monotonic_period_states local_state; ISR_Level level; the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 464e2: 4fef 000c lea %sp@(12),%sp 464e6: 2440 moveal %d0,%a2 464e8: 4aae fffc tstl %fp@(-4) 464ec: 6600 0138 bnew 46626 case OBJECTS_LOCAL: if ( !_Thread_Is_executing( the_period->owner ) ) { 464f0: 2039 0006 0c32 movel 60c32 <_Thread_Executing>,%d0 464f6: b0aa 0040 cmpl %a2@(64),%d0 464fa: 670c beqs 46508 _Thread_Enable_dispatch(); 464fc: 4eb9 0004 8c8e jsr 48c8e <_Thread_Enable_dispatch> 46502: 7817 moveq #23,%d4 return RTEMS_NOT_OWNER_OF_RESOURCE; 46504: 6000 0122 braw 46628 } if ( length == RTEMS_PERIOD_STATUS ) { 46508: 4a82 tstl %d2 4650a: 6622 bnes 4652e switch ( the_period->state ) { 4650c: 202a 0038 movel %a2@(56),%d0 46510: 7204 moveq #4,%d1 46512: b280 cmpl %d0,%d1 46514: 6404 bccs 4651a <== ALWAYS TAKEN 46516: 4284 clrl %d4 <== NOT EXECUTED 46518: 600a bras 46524 <== NOT EXECUTED 4651a: 41f9 0005 de32 lea 5de32 ,%a0 46520: 2830 0c00 movel %a0@(00000000,%d0:l:4),%d4 case RATE_MONOTONIC_ACTIVE: default: /* unreached -- only to remove warnings */ return_value = RTEMS_SUCCESSFUL; break; } _Thread_Enable_dispatch(); 46524: 4eb9 0004 8c8e jsr 48c8e <_Thread_Enable_dispatch> return( return_value ); 4652a: 6000 00fc braw 46628 } _ISR_Disable( level ); 4652e: 203c 0000 0700 movel #1792,%d0 46534: 40c4 movew %sr,%d4 46536: 8084 orl %d4,%d0 46538: 46c0 movew %d0,%sr switch ( the_period->state ) { 4653a: 202a 0038 movel %a2@(56),%d0 4653e: 7202 moveq #2,%d1 46540: b280 cmpl %d0,%d1 46542: 6740 beqs 46584 46544: 123c 0004 moveb #4,%d1 46548: b280 cmpl %d0,%d1 4654a: 6700 00a4 beqw 465f0 4654e: 4a80 tstl %d0 46550: 6600 00d4 bnew 46626 case RATE_MONOTONIC_INACTIVE: { _ISR_Enable( level ); 46554: 46c4 movew %d4,%sr /* * Baseline statistics information for the beginning of a period. */ _Rate_monotonic_Initiate_statistics( the_period ); 46556: 2f0a movel %a2,%sp@- ); the_period->next_length = length; _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 46558: 4284 clrl %d4 _ISR_Enable( level ); /* * Baseline statistics information for the beginning of a period. */ _Rate_monotonic_Initiate_statistics( the_period ); 4655a: 4eb9 0004 62ac jsr 462ac <_Rate_monotonic_Initiate_statistics> Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 46560: 203c 0004 686c movel #288876,%d0 the_period->state = RATE_MONOTONIC_ACTIVE; 46566: 7202 moveq #2,%d1 46568: 2540 002c movel %d0,%a2@(44) the_watchdog->id = id; 4656c: 2543 0030 movel %d3,%a2@(48) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 46570: 2542 001c movel %d2,%a2@(28) 46574: 2541 0038 movel %d1,%a2@(56) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 46578: 42aa 0018 clrl %a2@(24) the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 4657c: 42aa 0034 clrl %a2@(52) 46580: 6000 0084 braw 46606 case RATE_MONOTONIC_ACTIVE: /* * Update statistics from the concluding period. */ _Rate_monotonic_Update_statistics( the_period ); 46584: 2f0a movel %a2,%sp@- 46586: 4eb9 0004 63cc jsr 463cc <_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; 4658c: 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; 46590: 7401 moveq #1,%d2 46592: 2542 0038 movel %d2,%a2@(56) the_period->next_length = length; _ISR_Enable( level ); 46596: 46c4 movew %d4,%sr _Thread_Executing->Wait.id = the_period->Object.id; 46598: 2079 0006 0c32 moveal 60c32 <_Thread_Executing>,%a0 4659e: 216a 0008 0020 movel %a2@(8),%a0@(32) _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 465a4: 4878 4000 pea 4000 465a8: 2f08 movel %a0,%sp@- 465aa: 4eb9 0004 94ec jsr 494ec <_Thread_Set_state> /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); 465b0: 203c 0000 0700 movel #1792,%d0 465b6: 40c1 movew %sr,%d1 465b8: 8081 orl %d1,%d0 465ba: 46c0 movew %d0,%sr local_state = the_period->state; the_period->state = RATE_MONOTONIC_ACTIVE; 465bc: 143c 0002 moveb #2,%d2 /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); local_state = the_period->state; 465c0: 202a 0038 movel %a2@(56),%d0 the_period->state = RATE_MONOTONIC_ACTIVE; 465c4: 2542 0038 movel %d2,%a2@(56) _ISR_Enable( level ); 465c8: 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 ) 465ca: 7203 moveq #3,%d1 465cc: 4fef 000c lea %sp@(12),%sp 465d0: b280 cmpl %d0,%d1 465d2: 6612 bnes 465e6 _Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 465d4: 4878 4000 pea 4000 465d8: 2f39 0006 0c32 movel 60c32 <_Thread_Executing>,%sp@- 465de: 4eb9 0004 88d4 jsr 488d4 <_Thread_Clear_state> 465e4: 508f addql #8,%sp _Thread_Enable_dispatch(); 465e6: 4eb9 0004 8c8e jsr 48c8e <_Thread_Enable_dispatch> 465ec: 4284 clrl %d4 return RTEMS_SUCCESSFUL; 465ee: 6038 bras 46628 case RATE_MONOTONIC_EXPIRED: /* * Update statistics from the concluding period */ _Rate_monotonic_Update_statistics( the_period ); 465f0: 2f0a movel %a2,%sp@- 465f2: 4eb9 0004 63cc jsr 463cc <_Rate_monotonic_Update_statistics> _ISR_Enable( level ); 465f8: 46c4 movew %d4,%sr the_period->state = RATE_MONOTONIC_ACTIVE; 465fa: 7002 moveq #2,%d0 the_period->next_length = length; _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 465fc: 7806 moveq #6,%d4 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 465fe: 2542 001c movel %d2,%a2@(28) */ _Rate_monotonic_Update_statistics( the_period ); _ISR_Enable( level ); the_period->state = RATE_MONOTONIC_ACTIVE; 46602: 2540 0038 movel %d0,%a2@(56) the_period->next_length = length; 46606: 2542 003c movel %d2,%a2@(60) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 4660a: 486a 0010 pea %a2@(16) 4660e: 4879 0006 0c50 pea 60c50 <_Watchdog_Ticks_chain> 46614: 4eb9 0004 9d1c jsr 49d1c <_Watchdog_Insert> _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 4661a: 4eb9 0004 8c8e jsr 48c8e <_Thread_Enable_dispatch> return RTEMS_TIMEOUT; 46620: 4fef 000c lea %sp@(12),%sp 46624: 6002 bras 46628 46626: 7804 moveq #4,%d4 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 46628: 2004 movel %d4,%d0 4662a: 4cee 041c ffec moveml %fp@(-20),%d2-%d4/%a2 46630: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00050818 : rtems_status_code rtems_region_get_segment_size( rtems_id id, void *segment, uintptr_t *size ) { 50818: 4e56 fffc linkw %fp,#-4 5081c: 2f03 movel %d3,%sp@- 5081e: 262e 0010 movel %fp@(16),%d3 50822: 2f02 movel %d2,%sp@- 50824: 242e 000c movel %fp@(12),%d2 Objects_Locations location; rtems_status_code return_status = RTEMS_SUCCESSFUL; register Region_Control *the_region; if ( !segment ) 50828: 6766 beqs 50890 return RTEMS_INVALID_ADDRESS; if ( !size ) 5082a: 4a83 tstl %d3 5082c: 6762 beqs 50890 return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); 5082e: 2f39 0007 7792 movel 77792 <_RTEMS_Allocator_Mutex>,%sp@- 50834: 4eb9 0005 27d8 jsr 527d8 <_API_Mutex_Lock> 5083a: 486e fffc pea %fp@(-4) 5083e: 2f2e 0008 movel %fp@(8),%sp@- 50842: 4879 0007 75de pea 775de <_Region_Information> 50848: 4eb9 0005 400c jsr 5400c <_Objects_Get_no_protection> the_region = _Region_Get( id, &location ); switch ( location ) { 5084e: 222e fffc movel %fp@(-4),%d1 50852: 4fef 0010 lea %sp@(16),%sp 50856: 670a beqs 50862 50858: 7001 moveq #1,%d0 5085a: b081 cmpl %d1,%d0 5085c: 6620 bnes 5087e <== NEVER TAKEN 5085e: 7404 moveq #4,%d2 50860: 601e bras 50880 case OBJECTS_LOCAL: if ( !_Heap_Size_of_alloc_area( &the_region->Memory, segment, size ) ) 50862: 2f03 movel %d3,%sp@- 50864: 2040 moveal %d0,%a0 50866: 2f02 movel %d2,%sp@- 50868: 4868 0068 pea %a0@(104) 5086c: 4eb9 0005 3a8c jsr 53a8c <_Heap_Size_of_alloc_area> 50872: 4fef 000c lea %sp@(12),%sp 50876: 4a00 tstb %d0 50878: 6604 bnes 5087e 5087a: 7409 moveq #9,%d2 <== NOT EXECUTED 5087c: 6002 bras 50880 <== NOT EXECUTED 5087e: 4282 clrl %d2 case OBJECTS_ERROR: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 50880: 2f39 0007 7792 movel 77792 <_RTEMS_Allocator_Mutex>,%sp@- 50886: 4eb9 0005 2838 jsr 52838 <_API_Mutex_Unlock> return return_status; 5088c: 588f addql #4,%sp 5088e: 6002 bras 50892 50890: 7409 moveq #9,%d2 } 50892: 2002 movel %d2,%d0 50894: 242e fff4 movel %fp@(-12),%d2 50898: 262e fff8 movel %fp@(-8),%d3 5089c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00050eb0 : rtems_status_code rtems_signal_send( rtems_id id, rtems_signal_set signal_set ) { 50eb0: 4e56 fffc linkw %fp,#-4 50eb4: 2f03 movel %d3,%sp@- 50eb6: 2f02 movel %d2,%sp@- 50eb8: 242e 000c movel %fp@(12),%d2 register Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; ASR_Information *asr; if ( !signal_set ) 50ebc: 6606 bnes 50ec4 50ebe: 700a moveq #10,%d0 50ec0: 6000 0084 braw 50f46 return RTEMS_INVALID_NUMBER; the_thread = _Thread_Get( id, &location ); 50ec4: 486e fffc pea %fp@(-4) 50ec8: 2f2e 0008 movel %fp@(8),%sp@- 50ecc: 4eb9 0005 4998 jsr 54998 <_Thread_Get> switch ( location ) { 50ed2: 508f addql #8,%sp 50ed4: 4aae fffc tstl %fp@(-4) 50ed8: 6704 beqs 50ede 50eda: 7004 moveq #4,%d0 50edc: 6068 bras 50f46 case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; 50ede: 2240 moveal %d0,%a1 50ee0: 2069 010a moveal %a1@(266),%a0 asr = &api->Signal; 50ee4: 4aa8 000a tstl %a0@(10) 50ee8: 6754 beqs 50f3e if ( ! _ASR_Is_null_handler( asr->handler ) ) { if ( asr->is_enabled ) { 50eea: 4a28 0008 tstb %a0@(8) 50eee: 6732 beqs 50f22 rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 50ef0: 223c 0000 0700 movel #1792,%d1 50ef6: 40c3 movew %sr,%d3 50ef8: 8283 orl %d3,%d1 50efa: 46c1 movew %d1,%sr *signal_set |= signals; 50efc: 85a8 0012 orl %d2,%a0@(18) _ISR_Enable( _level ); 50f00: 46c3 movew %d3,%sr _ASR_Post_signals( signal_set, &asr->signals_posted ); the_thread->do_post_task_switch_extension = true; if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 50f02: 2239 0007 777a movel 7777a <_ISR_Nest_level>,%d1 if ( ! _ASR_Is_null_handler( asr->handler ) ) { if ( asr->is_enabled ) { _ASR_Post_signals( signal_set, &asr->signals_posted ); the_thread->do_post_task_switch_extension = true; 50f08: 7401 moveq #1,%d2 50f0a: 1342 0074 moveb %d2,%a1@(116) if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 50f0e: 4a81 tstl %d1 50f10: 6722 beqs 50f34 50f12: b0b9 0007 779a cmpl 7779a <_Thread_Executing>,%d0 50f18: 661a bnes 50f34 <== NEVER TAKEN _ISR_Signals_to_thread_executing = true; 50f1a: 13c2 0007 7828 moveb %d2,77828 <_ISR_Signals_to_thread_executing> 50f20: 6012 bras 50f34 rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 50f22: 203c 0000 0700 movel #1792,%d0 50f28: 40c1 movew %sr,%d1 50f2a: 8081 orl %d1,%d0 50f2c: 46c0 movew %d0,%sr *signal_set |= signals; 50f2e: 85a8 0016 orl %d2,%a0@(22) _ISR_Enable( _level ); 50f32: 46c1 movew %d1,%sr } else { _ASR_Post_signals( signal_set, &asr->signals_pending ); } _Thread_Enable_dispatch(); 50f34: 4eb9 0005 4942 jsr 54942 <_Thread_Enable_dispatch> 50f3a: 4280 clrl %d0 return RTEMS_SUCCESSFUL; 50f3c: 6008 bras 50f46 } _Thread_Enable_dispatch(); 50f3e: 4eb9 0005 4942 jsr 54942 <_Thread_Enable_dispatch> 50f44: 700b moveq #11,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 50f46: 242e fff4 movel %fp@(-12),%d2 50f4a: 262e fff8 movel %fp@(-8),%d3 50f4e: 4e5e unlk %fp ... =============================================================================== 0004dc74 : rtems_status_code rtems_task_mode( rtems_mode mode_set, rtems_mode mask, rtems_mode *previous_mode_set ) { 4dc74: 4e56 ffe4 linkw %fp,#-28 4dc78: 48d7 1c3c moveml %d2-%d5/%a2-%a4,%sp@ 4dc7c: 262e 0008 movel %fp@(8),%d3 4dc80: 282e 000c movel %fp@(12),%d4 4dc84: 286e 0010 moveal %fp@(16),%a4 ASR_Information *asr; bool is_asr_enabled = false; bool needs_asr_dispatching = false; rtems_mode old_mode; if ( !previous_mode_set ) 4dc88: 4a8c tstl %a4 4dc8a: 6606 bnes 4dc92 4dc8c: 7009 moveq #9,%d0 4dc8e: 6000 00fc braw 4dd8c return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; 4dc92: 2479 0005 eff6 moveal 5eff6 <_Thread_Executing>,%a2 api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 4dc98: 4a2a 0075 tstb %a2@(117) 4dc9c: 57c0 seq %d0 4dc9e: 243c 0000 0100 movel #256,%d2 4dca4: 49c0 extbl %d0 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 4dca6: 266a 010a moveal %a2@(266),%a3 asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 4dcaa: c480 andl %d0,%d2 if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) 4dcac: 4aaa 007a tstl %a2@(122) 4dcb0: 6704 beqs 4dcb6 old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; 4dcb2: 08c2 0009 bset #9,%d2 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; 4dcb6: 4a2b 0008 tstb %a3@(8) 4dcba: 57c0 seq %d0 4dcbc: 2a3c 0000 0400 movel #1024,%d5 4dcc2: 49c0 extbl %d0 4dcc4: ca80 andl %d0,%d5 old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; old_mode |= _ISR_Get_level(); 4dcc6: 4eb9 0004 89cc jsr 489cc <_CPU_ISR_Get_level> if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; 4dccc: 8085 orl %d5,%d0 old_mode |= _ISR_Get_level(); *previous_mode_set = old_mode; 4dcce: 8082 orl %d2,%d0 4dcd0: 2880 movel %d0,%a4@ /* * These are generic thread scheduling characteristics. */ if ( mask & RTEMS_PREEMPT_MASK ) 4dcd2: 0804 0008 btst #8,%d4 4dcd6: 670e beqs 4dce6 executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; 4dcd8: 2003 movel %d3,%d0 4dcda: 7201 moveq #1,%d1 4dcdc: e088 lsrl #8,%d0 4dcde: b380 eorl %d1,%d0 4dce0: c081 andl %d1,%d0 4dce2: 1540 0075 moveb %d0,%a2@(117) if ( mask & RTEMS_TIMESLICE_MASK ) { 4dce6: 0804 0009 btst #9,%d4 4dcea: 671c beqs 4dd08 if ( _Modes_Is_timeslice(mode_set) ) { 4dcec: 0803 0009 btst #9,%d3 4dcf0: 6712 beqs 4dd04 executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 4dcf2: 41f9 0005 eeec lea 5eeec <_Thread_Ticks_per_timeslice>,%a0 if ( mask & RTEMS_PREEMPT_MASK ) executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; if ( mask & RTEMS_TIMESLICE_MASK ) { if ( _Modes_Is_timeslice(mode_set) ) { executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 4dcf8: 7001 moveq #1,%d0 executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 4dcfa: 2550 0076 movel %a0@,%a2@(118) if ( mask & RTEMS_PREEMPT_MASK ) executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; if ( mask & RTEMS_TIMESLICE_MASK ) { if ( _Modes_Is_timeslice(mode_set) ) { executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 4dcfe: 2540 007a movel %d0,%a2@(122) 4dd02: 6004 bras 4dd08 executing->cpu_time_budget = _Thread_Ticks_per_timeslice; } else executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 4dd04: 42aa 007a clrl %a2@(122) /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) 4dd08: 7007 moveq #7,%d0 4dd0a: c084 andl %d4,%d0 4dd0c: 6712 beqs 4dd20 */ RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level ( Modes_Control mode_set ) { _ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) ); 4dd0e: 40c0 movew %sr,%d0 4dd10: 7207 moveq #7,%d1 4dd12: c283 andl %d3,%d1 4dd14: 0280 0000 f8ff andil #63743,%d0 4dd1a: e189 lsll #8,%d1 4dd1c: 8081 orl %d1,%d0 4dd1e: 46c0 movew %d0,%sr */ is_asr_enabled = false; needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { 4dd20: 0804 000a btst #10,%d4 4dd24: 6744 beqs 4dd6a * Output: * *previous_mode_set - previous mode set * always return RTEMS_SUCCESSFUL; */ rtems_status_code rtems_task_mode( 4dd26: 700a moveq #10,%d0 4dd28: e0ab lsrl %d0,%d3 4dd2a: 7201 moveq #1,%d1 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; 4dd2c: 4280 clrl %d0 4dd2e: 102b 0008 moveb %a3@(8),%d0 * Output: * *previous_mode_set - previous mode set * always return RTEMS_SUCCESSFUL; */ rtems_status_code rtems_task_mode( 4dd32: b383 eorl %d1,%d3 4dd34: c681 andl %d1,%d3 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; 4dd36: b083 cmpl %d3,%d0 4dd38: 6730 beqs 4dd6a ) { rtems_signal_set _signals; ISR_Level _level; _ISR_Disable( _level ); 4dd3a: 203c 0000 0700 movel #1792,%d0 needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true; if ( is_asr_enabled != asr->is_enabled ) { asr->is_enabled = is_asr_enabled; 4dd40: 1743 0008 moveb %d3,%a3@(8) 4dd44: 40c1 movew %sr,%d1 4dd46: 8081 orl %d1,%d0 4dd48: 46c0 movew %d0,%sr _signals = information->signals_pending; 4dd4a: 202b 0016 movel %a3@(22),%d0 information->signals_pending = information->signals_posted; 4dd4e: 276b 0012 0016 movel %a3@(18),%a3@(22) information->signals_posted = _signals; 4dd54: 2740 0012 movel %d0,%a3@(18) _ISR_Enable( _level ); 4dd58: 46c1 movew %d1,%sr if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; 4dd5a: 4aab 0012 tstl %a3@(18) 4dd5e: 670a beqs 4dd6a if ( is_asr_enabled != asr->is_enabled ) { asr->is_enabled = is_asr_enabled; _ASR_Swap_signals( asr ); if ( _ASR_Are_signals_pending( asr ) ) { needs_asr_dispatching = true; executing->do_post_task_switch_extension = true; 4dd60: 7001 moveq #1,%d0 4dd62: 7401 moveq #1,%d2 4dd64: 1540 0074 moveb %d0,%a2@(116) 4dd68: 6002 bras 4dd6c 4dd6a: 4202 clrb %d2 } } } if ( _System_state_Is_up( _System_state_Get() ) ) 4dd6c: 7203 moveq #3,%d1 4dd6e: b2b9 0005 f0c4 cmpl 5f0c4 <_System_state_Current>,%d1 4dd74: 6614 bnes 4dd8a <== NEVER TAKEN if ( _Thread_Evaluate_mode() || needs_asr_dispatching ) 4dd76: 4eb9 0004 df68 jsr 4df68 <_Thread_Evaluate_mode> 4dd7c: 4a00 tstb %d0 4dd7e: 6604 bnes 4dd84 4dd80: 4a02 tstb %d2 4dd82: 6706 beqs 4dd8a _Thread_Dispatch(); 4dd84: 4eb9 0004 7560 jsr 47560 <_Thread_Dispatch> 4dd8a: 4280 clrl %d0 return RTEMS_SUCCESSFUL; } 4dd8c: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4 4dd92: 4e5e unlk %fp ... =============================================================================== 0004955c : rtems_status_code rtems_task_set_priority( rtems_id id, rtems_task_priority new_priority, rtems_task_priority *old_priority ) { 4955c: 4e56 fffc linkw %fp,#-4 49560: 2f0a movel %a2,%sp@- 49562: 246e 0010 moveal %fp@(16),%a2 49566: 2f02 movel %d2,%sp@- 49568: 242e 000c movel %fp@(12),%d2 register Thread_Control *the_thread; Objects_Locations location; if ( new_priority != RTEMS_CURRENT_PRIORITY && 4956c: 6710 beqs 4957e 4956e: 4280 clrl %d0 49570: 1039 0006 0ff2 moveb 60ff2 ,%d0 49576: b082 cmpl %d2,%d0 49578: 6404 bccs 4957e 4957a: 7013 moveq #19,%d0 4957c: 6054 bras 495d2 !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; if ( !old_priority ) 4957e: 4a8a tstl %a2 49580: 6604 bnes 49586 49582: 7009 moveq #9,%d0 49584: 604c bras 495d2 return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); 49586: 486e fffc pea %fp@(-4) 4958a: 2f2e 0008 movel %fp@(8),%sp@- 4958e: 4eb9 0004 b268 jsr 4b268 <_Thread_Get> switch ( location ) { 49594: 508f addql #8,%sp return RTEMS_INVALID_PRIORITY; if ( !old_priority ) return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); 49596: 2040 moveal %d0,%a0 switch ( location ) { 49598: 4aae fffc tstl %fp@(-4) 4959c: 6704 beqs 495a2 4959e: 7004 moveq #4,%d0 495a0: 6030 bras 495d2 case OBJECTS_LOCAL: /* XXX need helper to "convert" from core priority */ *old_priority = the_thread->current_priority; 495a2: 24a8 0014 movel %a0@(20),%a2@ if ( new_priority != RTEMS_CURRENT_PRIORITY ) { 495a6: 4a82 tstl %d2 495a8: 6720 beqs 495ca the_thread->real_priority = new_priority; 495aa: 2142 0018 movel %d2,%a0@(24) if ( the_thread->resource_count == 0 || 495ae: 4aa8 001c tstl %a0@(28) 495b2: 6706 beqs 495ba the_thread->current_priority > new_priority ) 495b4: b4a8 0014 cmpl %a0@(20),%d2 495b8: 6410 bccs 495ca <== ALWAYS TAKEN _Thread_Change_priority( the_thread, new_priority, false ); 495ba: 42a7 clrl %sp@- 495bc: 2f02 movel %d2,%sp@- 495be: 2f08 movel %a0,%sp@- 495c0: 4eb9 0004 ad18 jsr 4ad18 <_Thread_Change_priority> 495c6: 4fef 000c lea %sp@(12),%sp } _Thread_Enable_dispatch(); 495ca: 4eb9 0004 b212 jsr 4b212 <_Thread_Enable_dispatch> 495d0: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 495d2: 242e fff4 movel %fp@(-12),%d2 495d6: 246e fff8 moveal %fp@(-8),%a2 495da: 4e5e unlk %fp ... =============================================================================== 00051738 : */ rtems_status_code rtems_timer_cancel( rtems_id id ) { 51738: 4e56 fffc linkw %fp,#-4 RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Get ( Objects_Id id, Objects_Locations *location ) { return (Timer_Control *) 5173c: 486e fffc pea %fp@(-4) 51740: 2f2e 0008 movel %fp@(8),%sp@- 51744: 4879 0007 7fa2 pea 77fa2 <_Timer_Information> 5174a: 4eb9 0005 4044 jsr 54044 <_Objects_Get> Timer_Control *the_timer; Objects_Locations location; the_timer = _Timer_Get( id, &location ); switch ( location ) { 51750: 4fef 000c lea %sp@(12),%sp 51754: 4aae fffc tstl %fp@(-4) 51758: 6704 beqs 5175e 5175a: 7004 moveq #4,%d0 5175c: 601e bras 5177c case OBJECTS_LOCAL: if ( !_Timer_Is_dormant_class( the_timer->the_class ) ) 5175e: 7204 moveq #4,%d1 51760: 2040 moveal %d0,%a0 51762: b2a8 0038 cmpl %a0@(56),%d1 51766: 670c beqs 51774 <== NEVER TAKEN (void) _Watchdog_Remove( &the_timer->Ticker ); 51768: 4868 0010 pea %a0@(16) 5176c: 4eb9 0005 5cd8 jsr 55cd8 <_Watchdog_Remove> 51772: 588f addql #4,%sp _Thread_Enable_dispatch(); 51774: 4eb9 0005 4942 jsr 54942 <_Thread_Enable_dispatch> 5177a: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 5177c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00051bbc : rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ) { 51bbc: 4e56 ffe8 linkw %fp,#-24 51bc0: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 51bc4: 282e 0008 movel %fp@(8),%d4 51bc8: 262e 000c movel %fp@(12),%d3 51bcc: 242e 0010 movel %fp@(16),%d2 Timer_Control *the_timer; Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; 51bd0: 2679 0007 7fdc moveal 77fdc <_Timer_server>,%a3 if ( !timer_server ) 51bd6: 4a8b tstl %a3 51bd8: 6606 bnes 51be0 51bda: 700e moveq #14,%d0 51bdc: 6000 00a4 braw 51c82 return RTEMS_INCORRECT_STATE; if ( !_TOD_Is_set ) 51be0: 4a39 0007 76f4 tstb 776f4 <_TOD_Is_set> 51be6: 6606 bnes 51bee <== ALWAYS TAKEN 51be8: 700b moveq #11,%d0 <== NOT EXECUTED 51bea: 6000 0096 braw 51c82 <== NOT EXECUTED return RTEMS_NOT_DEFINED; if ( !routine ) 51bee: 4a82 tstl %d2 51bf0: 6606 bnes 51bf8 51bf2: 7009 moveq #9,%d0 51bf4: 6000 008c braw 51c82 return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) 51bf8: 2f03 movel %d3,%sp@- 51bfa: 4eb9 0004 f038 jsr 4f038 <_TOD_Validate> 51c00: 588f addql #4,%sp 51c02: 4a00 tstb %d0 51c04: 677a beqs 51c80 return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 51c06: 2f03 movel %d3,%sp@- 51c08: 4eb9 0004 ef98 jsr 4ef98 <_TOD_To_seconds> if ( seconds <= _TOD_Seconds_since_epoch() ) 51c0e: 588f addql #4,%sp return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 51c10: 2600 movel %d0,%d3 if ( seconds <= _TOD_Seconds_since_epoch() ) 51c12: b0b9 0007 7772 cmpl 77772 <_TOD_Now>,%d0 51c18: 6366 blss 51c80 51c1a: 486e fffc pea %fp@(-4) 51c1e: 2f04 movel %d4,%sp@- 51c20: 4879 0007 7fa2 pea 77fa2 <_Timer_Information> 51c26: 4eb9 0005 4044 jsr 54044 <_Objects_Get> return RTEMS_INVALID_CLOCK; the_timer = _Timer_Get( id, &location ); switch ( location ) { 51c2c: 4fef 000c lea %sp@(12),%sp 51c30: 2440 moveal %d0,%a2 51c32: 4aae fffc tstl %fp@(-4) 51c36: 6704 beqs 51c3c 51c38: 7004 moveq #4,%d0 51c3a: 6046 bras 51c82 case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); 51c3c: 486a 0010 pea %a2@(16) 51c40: 4eb9 0005 5cd8 jsr 55cd8 <_Watchdog_Remove> the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 51c46: 256e 0014 0034 movel %fp@(20),%a2@(52) the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK; 51c4c: 7003 moveq #3,%d0 void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; 51c4e: 2544 0030 movel %d4,%a2@(48) _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); 51c52: 96b9 0007 7772 subl 77772 <_TOD_Now>,%d3 the_timer = _Timer_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK; 51c58: 2540 0038 movel %d0,%a2@(56) _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); 51c5c: 2543 001c movel %d3,%a2@(28) Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 51c60: 2542 002c movel %d2,%a2@(44) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 51c64: 42aa 0018 clrl %a2@(24) (*timer_server->schedule_operation)( timer_server, the_timer ); 51c68: 2f0a movel %a2,%sp@- 51c6a: 2f0b movel %a3,%sp@- 51c6c: 206b 0004 moveal %a3@(4),%a0 51c70: 4e90 jsr %a0@ _Thread_Enable_dispatch(); 51c72: 4eb9 0005 4942 jsr 54942 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 51c78: 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(); 51c7c: 4280 clrl %d0 return RTEMS_SUCCESSFUL; 51c7e: 6002 bras 51c82 51c80: 7014 moveq #20,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 51c82: 4cee 0c1c ffe8 moveml %fp@(-24),%d2-%d4/%a2-%a3 51c88: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00045f3c : int sched_get_priority_max( int policy ) { switch ( policy ) { 45f3c: 7004 moveq #4,%d0 #include int sched_get_priority_max( int policy ) { 45f3e: 4e56 0000 linkw %fp,#0 45f42: 222e 0008 movel %fp@(8),%d1 switch ( policy ) { 45f46: b081 cmpl %d1,%d0 45f48: 650c bcss 45f56 45f4a: 103c 0001 moveb #1,%d0 45f4e: e3a8 lsll %d1,%d0 45f50: 7217 moveq #23,%d1 45f52: c081 andl %d1,%d0 45f54: 6610 bnes 45f66 <== ALWAYS TAKEN case SCHED_RR: case SCHED_SPORADIC: break; default: rtems_set_errno_and_return_minus_one( EINVAL ); 45f56: 4eb9 0004 ed28 jsr 4ed28 <__errno> 45f5c: 7216 moveq #22,%d1 45f5e: 2040 moveal %d0,%a0 45f60: 70ff moveq #-1,%d0 45f62: 2081 movel %d1,%a0@ 45f64: 600a bras 45f70 } return POSIX_SCHEDULER_MAXIMUM_PRIORITY; 45f66: 4280 clrl %d0 45f68: 1039 0005 e7a6 moveb 5e7a6 ,%d0 45f6e: 5380 subql #1,%d0 } 45f70: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00045f74 : int sched_get_priority_min( int policy ) { switch ( policy ) { 45f74: 7004 moveq #4,%d0 #include int sched_get_priority_min( int policy ) { 45f76: 4e56 0000 linkw %fp,#0 45f7a: 222e 0008 movel %fp@(8),%d1 switch ( policy ) { 45f7e: b081 cmpl %d1,%d0 45f80: 6510 bcss 45f92 45f82: 103c 0001 moveb #1,%d0 45f86: e3a8 lsll %d1,%d0 45f88: 7217 moveq #23,%d1 45f8a: c081 andl %d1,%d0 45f8c: 6704 beqs 45f92 <== NEVER TAKEN 45f8e: 7001 moveq #1,%d0 45f90: 600e bras 45fa0 case SCHED_RR: case SCHED_SPORADIC: break; default: rtems_set_errno_and_return_minus_one( EINVAL ); 45f92: 4eb9 0004 ed28 jsr 4ed28 <__errno> 45f98: 7216 moveq #22,%d1 45f9a: 2040 moveal %d0,%a0 45f9c: 70ff moveq #-1,%d0 45f9e: 2081 movel %d1,%a0@ } return POSIX_SCHEDULER_MINIMUM_PRIORITY; } 45fa0: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00045fa4 : int sched_rr_get_interval( pid_t pid, struct timespec *interval ) { 45fa4: 4e56 0000 linkw %fp,#0 45fa8: 2f03 movel %d3,%sp@- 45faa: 262e 0008 movel %fp@(8),%d3 45fae: 2f02 movel %d2,%sp@- 45fb0: 242e 000c movel %fp@(12),%d2 /* * Only supported for the "calling process" (i.e. this node). */ if ( pid && pid != getpid() ) 45fb4: 4a83 tstl %d3 45fb6: 671a beqs 45fd2 <== NEVER TAKEN 45fb8: 4eb9 0004 2f3c jsr 42f3c 45fbe: b083 cmpl %d3,%d0 45fc0: 6710 beqs 45fd2 rtems_set_errno_and_return_minus_one( ESRCH ); 45fc2: 4eb9 0004 ed28 jsr 4ed28 <__errno> 45fc8: 7403 moveq #3,%d2 45fca: 72ff moveq #-1,%d1 45fcc: 2040 moveal %d0,%a0 45fce: 2082 movel %d2,%a0@ 45fd0: 6026 bras 45ff8 if ( !interval ) 45fd2: 4a82 tstl %d2 45fd4: 6610 bnes 45fe6 rtems_set_errno_and_return_minus_one( EINVAL ); 45fd6: 4eb9 0004 ed28 jsr 4ed28 <__errno> 45fdc: 72ff moveq #-1,%d1 45fde: 2040 moveal %d0,%a0 45fe0: 7016 moveq #22,%d0 45fe2: 2080 movel %d0,%a0@ 45fe4: 6012 bras 45ff8 _Timespec_From_ticks( _Thread_Ticks_per_timeslice, interval ); 45fe6: 2f02 movel %d2,%sp@- 45fe8: 2f39 0005 fefc movel 5fefc <_Thread_Ticks_per_timeslice>,%sp@- 45fee: 4eb9 0004 9228 jsr 49228 <_Timespec_From_ticks> return 0; 45ff4: 508f addql #8,%sp rtems_set_errno_and_return_minus_one( ESRCH ); if ( !interval ) rtems_set_errno_and_return_minus_one( EINVAL ); _Timespec_From_ticks( _Thread_Ticks_per_timeslice, interval ); 45ff6: 4281 clrl %d1 return 0; } 45ff8: 242e fff8 movel %fp@(-8),%d2 45ffc: 2001 movel %d1,%d0 45ffe: 262e fffc movel %fp@(-4),%d3 46002: 4e5e unlk %fp ... =============================================================================== 00048578 : int oflag, ... /* mode_t mode, */ /* unsigned int value */ ) { 48578: 4e56 ffe0 linkw %fp,#-32 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 4857c: 2039 0006 3d18 movel 63d18 <_Thread_Dispatch_disable_level>,%d0 48582: 5280 addql #1,%d0 48584: 48d7 043c moveml %d2-%d5/%a2,%sp@ 48588: 23c0 0006 3d18 movel %d0,63d18 <_Thread_Dispatch_disable_level> 4858e: 242e 0008 movel %fp@(8),%d2 48592: 282e 000c movel %fp@(12),%d4 POSIX_Semaphore_Control *the_semaphore; Objects_Locations location; _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { 48596: 2a04 movel %d4,%d5 48598: 0285 0000 0200 andil #512,%d5 4859e: 6604 bnes 485a4 485a0: 4283 clrl %d3 485a2: 6004 bras 485a8 va_start(arg, oflag); mode = (mode_t) va_arg( arg, unsigned int ); value = va_arg( arg, unsigned int ); 485a4: 262e 0014 movel %fp@(20),%d3 va_end(arg); } status = _POSIX_Semaphore_Name_to_id( name, &the_semaphore_id ); 485a8: 486e fffc pea %fp@(-4) 485ac: 2f02 movel %d2,%sp@- 485ae: 4eb9 0004 e8e0 jsr 4e8e0 <_POSIX_Semaphore_Name_to_id> * and we can just return a pointer to the id. Otherwise we may * need to check to see if this is a "semaphore does not exist" * or some other miscellaneous error on the name. */ if ( status ) { 485b4: 508f addql #8,%sp mode = (mode_t) va_arg( arg, unsigned int ); value = va_arg( arg, unsigned int ); va_end(arg); } status = _POSIX_Semaphore_Name_to_id( name, &the_semaphore_id ); 485b6: 2440 moveal %d0,%a2 * and we can just return a pointer to the id. Otherwise we may * need to check to see if this is a "semaphore does not exist" * or some other miscellaneous error on the name. */ if ( status ) { 485b8: 4a80 tstl %d0 485ba: 671e beqs 485da /* * Unless provided a valid name that did not already exist * and we are willing to create then it is an error. */ if ( !( status == ENOENT && (oflag & O_CREAT) ) ) { 485bc: 7002 moveq #2,%d0 485be: b08a cmpl %a2,%d0 485c0: 6604 bnes 485c6 <== NEVER TAKEN 485c2: 4a85 tstl %d5 485c4: 6662 bnes 48628 _Thread_Enable_dispatch(); 485c6: 4eb9 0004 ac4a jsr 4ac4a <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one_cast( status, sem_t * ); 485cc: 4eb9 0005 1f28 jsr 51f28 <__errno> 485d2: 72ff moveq #-1,%d1 485d4: 2040 moveal %d0,%a0 485d6: 208a movel %a2,%a0@ 485d8: 607a bras 48654 485da: 45f9 0004 ac4a lea 4ac4a <_Thread_Enable_dispatch>,%a2 /* * Check for existence with creation. */ if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { 485e0: 0284 0000 0a00 andil #2560,%d4 485e6: 0c84 0000 0a00 cmpil #2560,%d4 485ec: 6612 bnes 48600 _Thread_Enable_dispatch(); 485ee: 4e92 jsr %a2@ rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * ); 485f0: 4eb9 0005 1f28 jsr 51f28 <__errno> 485f6: 72ff moveq #-1,%d1 485f8: 2040 moveal %d0,%a0 485fa: 7011 moveq #17,%d0 485fc: 2080 movel %d0,%a0@ 485fe: 6054 bras 48654 48600: 486e fff4 pea %fp@(-12) 48604: 2f2e fffc movel %fp@(-4),%sp@- 48608: 4879 0006 3f72 pea 63f72 <_POSIX_Semaphore_Information> 4860e: 4eb9 0004 a3f8 jsr 4a3f8 <_Objects_Get> } the_semaphore = _POSIX_Semaphore_Get( &the_semaphore_id, &location ); the_semaphore->open_count += 1; 48614: 2040 moveal %d0,%a0 48616: 52a8 0016 addql #1,%a0@(22) if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * ); } the_semaphore = _POSIX_Semaphore_Get( &the_semaphore_id, &location ); 4861a: 2d40 fff8 movel %d0,%fp@(-8) the_semaphore->open_count += 1; _Thread_Enable_dispatch(); 4861e: 4e92 jsr %a2@ _Thread_Enable_dispatch(); 48620: 4e92 jsr %a2@ goto return_id; 48622: 4fef 000c lea %sp@(12),%sp 48626: 6026 bras 4864e /* * At this point, the semaphore does not exist and everything has been * checked. We should go ahead and create a semaphore. */ status =_POSIX_Semaphore_Create_support( 48628: 486e fff8 pea %fp@(-8) 4862c: 2f03 movel %d3,%sp@- 4862e: 42a7 clrl %sp@- 48630: 2f02 movel %d2,%sp@- 48632: 4eb9 0004 e798 jsr 4e798 <_POSIX_Semaphore_Create_support> 48638: 2400 movel %d0,%d2 /* * errno was set by Create_support, so don't set it again. */ _Thread_Enable_dispatch(); 4863a: 4eb9 0004 ac4a jsr 4ac4a <_Thread_Enable_dispatch> if ( status == -1 ) 48640: 4fef 0010 lea %sp@(16),%sp 48644: 70ff moveq #-1,%d0 48646: b082 cmpl %d2,%d0 48648: 6604 bnes 4864e 4864a: 72ff moveq #-1,%d1 4864c: 6006 bras 48654 return_id: #if defined(RTEMS_USE_16_BIT_OBJECT) the_semaphore->Semaphore_id = the_semaphore->Object.id; id = &the_semaphore->Semaphore_id; #else id = (sem_t *)&the_semaphore->Object.id; 4864e: 222e fff8 movel %fp@(-8),%d1 48652: 5081 addql #8,%d1 #endif return id; } 48654: 2001 movel %d1,%d0 48656: 4cee 043c ffe0 moveml %fp@(-32),%d2-%d5/%a2 4865c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00045e74 : int sigaction( int sig, const struct sigaction *act, struct sigaction *oact ) { 45e74: 4e56 ffec linkw %fp,#-20 45e78: 222e 0010 movel %fp@(16),%d1 45e7c: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 45e80: 242e 0008 movel %fp@(8),%d2 45e84: 246e 000c moveal %fp@(12),%a2 ISR_Level level; if ( oact ) 45e88: 4a81 tstl %d1 45e8a: 6722 beqs 45eae *oact = _POSIX_signals_Vectors[ sig ]; 45e8c: 2602 movel %d2,%d3 45e8e: 2002 movel %d2,%d0 45e90: 4878 000c pea c 45e94: e58b lsll #2,%d3 45e96: e988 lsll #4,%d0 45e98: 9083 subl %d3,%d0 45e9a: 0680 0006 0fbe addil #397246,%d0 45ea0: 2f00 movel %d0,%sp@- 45ea2: 2f01 movel %d1,%sp@- 45ea4: 4eb9 0004 f6d4 jsr 4f6d4 45eaa: 4fef 000c lea %sp@(12),%sp if ( !sig ) 45eae: 4a82 tstl %d2 45eb0: 6710 beqs 45ec2 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 45eb2: 2002 movel %d2,%d0 45eb4: 5380 subql #1,%d0 45eb6: 721f moveq #31,%d1 45eb8: b280 cmpl %d0,%d1 45eba: 6506 bcss 45ec2 * * NOTE: Solaris documentation claims to "silently enforce" this which * contradicts the POSIX specification. */ if ( sig == SIGKILL ) 45ebc: 7009 moveq #9,%d0 45ebe: b082 cmpl %d2,%d0 45ec0: 6610 bnes 45ed2 rtems_set_errno_and_return_minus_one( EINVAL ); 45ec2: 4eb9 0004 ee9c jsr 4ee9c <__errno> 45ec8: 72ff moveq #-1,%d1 45eca: 2040 moveal %d0,%a0 45ecc: 7016 moveq #22,%d0 45ece: 2080 movel %d0,%a0@ 45ed0: 6060 bras 45f32 /* * Evaluate the new action structure and set the global signal vector * appropriately. */ if ( act ) { 45ed2: 4a8a tstl %a2 45ed4: 675a beqs 45f30 <== NEVER TAKEN /* * Unless the user is installing the default signal actions, then * we can just copy the provided sigaction structure into the vectors. */ _ISR_Disable( level ); 45ed6: 203c 0000 0700 movel #1792,%d0 45edc: 40c3 movew %sr,%d3 45ede: 8083 orl %d3,%d0 45ee0: 46c0 movew %d0,%sr 45ee2: 780c moveq #12,%d4 45ee4: 47f9 0004 f6d4 lea 4f6d4 ,%a3 45eea: 4c02 4800 mulsl %d2,%d4 if ( act->sa_handler == SIG_DFL ) { 45eee: 4aaa 0008 tstl %a2@(8) 45ef2: 661e bnes 45f12 _POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ]; 45ef4: 4878 000c pea c 45ef8: 2004 movel %d4,%d0 45efa: 0680 0005 e3d8 addil #386008,%d0 45f00: 2f00 movel %d0,%sp@- 45f02: 0684 0006 0fbe addil #397246,%d4 45f08: 2f04 movel %d4,%sp@- 45f0a: 4e93 jsr %a3@ 45f0c: 4fef 000c lea %sp@(12),%sp 45f10: 601c bras 45f2e } else { _POSIX_signals_Clear_process_signals( sig ); 45f12: 2f02 movel %d2,%sp@- _POSIX_signals_Vectors[ sig ] = *act; 45f14: 0684 0006 0fbe addil #397246,%d4 _ISR_Disable( level ); if ( act->sa_handler == SIG_DFL ) { _POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ]; } else { _POSIX_signals_Clear_process_signals( sig ); 45f1a: 4eb9 0004 ba28 jsr 4ba28 <_POSIX_signals_Clear_process_signals> _POSIX_signals_Vectors[ sig ] = *act; 45f20: 4878 000c pea c 45f24: 2f0a movel %a2,%sp@- 45f26: 2f04 movel %d4,%sp@- 45f28: 4e93 jsr %a3@ 45f2a: 4fef 0010 lea %sp@(16),%sp } _ISR_Enable( level ); 45f2e: 46c3 movew %d3,%sr 45f30: 4281 clrl %d1 * + If we are now ignoring a signal that was previously pending, * we clear the pending signal indicator. */ return 0; } 45f32: 2001 movel %d1,%d0 45f34: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 45f3a: 4e5e unlk %fp ... =============================================================================== 00047bfc : #include int sigsuspend( const sigset_t *sigmask ) { 47bfc: 4e56 ffec linkw %fp,#-20 47c00: 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 ); 47c04: 240e movel %fp,%d2 47c06: 5982 subql #4,%d2 47c08: 45f9 0004 7bd4 lea 47bd4 ,%a2 (void) sigfillset( &all_signals ); 47c0e: 260e movel %fp,%d3 47c10: 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 ); 47c12: 2f02 movel %d2,%sp@- 47c14: 2f2e 0008 movel %fp@(8),%sp@- 47c18: 4878 0001 pea 1 47c1c: 4e92 jsr %a2@ (void) sigfillset( &all_signals ); 47c1e: 2f03 movel %d3,%sp@- 47c20: 4eb9 0004 7b34 jsr 47b34 status = sigtimedwait( &all_signals, NULL, NULL ); 47c26: 42a7 clrl %sp@- 47c28: 42a7 clrl %sp@- 47c2a: 2f03 movel %d3,%sp@- 47c2c: 4eb9 0004 7cac jsr 47cac 47c32: 2600 movel %d0,%d3 (void) sigprocmask( SIG_SETMASK, &saved_signals_blocked, NULL ); 47c34: 42a7 clrl %sp@- 47c36: 2f02 movel %d2,%sp@- 47c38: 42a7 clrl %sp@- 47c3a: 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 ) 47c3c: 4fef 0028 lea %sp@(40),%sp 47c40: 70ff moveq #-1,%d0 47c42: b083 cmpl %d3,%d0 47c44: 670c beqs 47c52 <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EINTR ); 47c46: 4eb9 0005 09c0 jsr 509c0 <__errno> 47c4c: 2040 moveal %d0,%a0 47c4e: 7004 moveq #4,%d0 47c50: 2080 movel %d0,%a0@ return status; } 47c52: 70ff moveq #-1,%d0 47c54: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 47c5a: 4e5e unlk %fp ... =============================================================================== 0004625c : int sigtimedwait( const sigset_t *set, siginfo_t *info, const struct timespec *timeout ) { 4625c: 4e56 ffd8 linkw %fp,#-40 46260: 48d7 3c1c moveml %d2-%d4/%a2-%a5,%sp@ 46264: 286e 0008 moveal %fp@(8),%a4 46268: 246e 000c moveal %fp@(12),%a2 4626c: 242e 0010 movel %fp@(16),%d2 ISR_Level level; /* * Error check parameters before disabling interrupts. */ if ( !set ) 46270: 4a8c tstl %a4 46272: 6732 beqs 462a6 /* NOTE: This is very specifically a RELATIVE not ABSOLUTE time * in the Open Group specification. */ interval = 0; if ( timeout ) { 46274: 4a82 tstl %d2 46276: 6740 beqs 462b8 if ( !_Timespec_Is_valid( timeout ) ) 46278: 2f02 movel %d2,%sp@- 4627a: 4eb9 0004 9508 jsr 49508 <_Timespec_Is_valid> 46280: 588f addql #4,%sp 46282: 4a00 tstb %d0 46284: 6612 bnes 46298 rtems_set_errno_and_return_minus_one( EINVAL ); 46286: 4eb9 0004 f190 jsr 4f190 <__errno> 4628c: 7816 moveq #22,%d4 4628e: 74ff moveq #-1,%d2 46290: 2240 moveal %d0,%a1 46292: 2284 movel %d4,%a1@ 46294: 6000 012e braw 463c4 interval = _Timespec_To_ticks( timeout ); 46298: 2f02 movel %d2,%sp@- 4629a: 4eb9 0004 9578 jsr 49578 <_Timespec_To_ticks> if ( !interval ) 462a0: 588f addql #4,%sp 462a2: 4a80 tstl %d0 462a4: 6614 bnes 462ba <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); 462a6: 4eb9 0004 f190 jsr 4f190 <__errno> 462ac: 7616 moveq #22,%d3 462ae: 74ff moveq #-1,%d2 462b0: 2040 moveal %d0,%a0 462b2: 2083 movel %d3,%a0@ 462b4: 6000 010e braw 463c4 462b8: 4280 clrl %d0 /* * Initialize local variables. */ the_info = ( info ) ? info : &signal_information; 462ba: 4a8a tstl %a2 462bc: 6604 bnes 462c2 462be: 45ee fff4 lea %fp@(-12),%a2 the_thread = _Thread_Executing; 462c2: 2079 0006 0f66 moveal 60f66 <_Thread_Executing>,%a0 * What if they are already pending? */ /* API signals pending? */ _ISR_Disable( level ); 462c8: 223c 0000 0700 movel #1792,%d1 the_info = ( info ) ? info : &signal_information; the_thread = _Thread_Executing; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 462ce: 2668 010e moveal %a0@(270),%a3 * What if they are already pending? */ /* API signals pending? */ _ISR_Disable( level ); 462d2: 40c3 movew %sr,%d3 462d4: 8283 orl %d3,%d1 462d6: 46c1 movew %d1,%sr if ( *set & api->signals_pending ) { 462d8: 2414 movel %a4@,%d2 462da: 2802 movel %d2,%d4 462dc: 222b 00d0 movel %a3@(208),%d1 462e0: c881 andl %d1,%d4 462e2: 6730 beqs 46314 /* XXX real info later */ the_info->si_signo = _POSIX_signals_Get_highest( api->signals_pending ); 462e4: 2f01 movel %d1,%sp@- 462e6: 4eb9 0004 6210 jsr 46210 <_POSIX_signals_Get_highest> 462ec: 2480 movel %d0,%a2@ _POSIX_signals_Clear_signals( 462ee: 42a7 clrl %sp@- 462f0: 42a7 clrl %sp@- 462f2: 2f0a movel %a2,%sp@- 462f4: 2f00 movel %d0,%sp@- 462f6: 2f0b movel %a3,%sp@- 462f8: 4eb9 0004 c034 jsr 4c034 <_POSIX_signals_Clear_signals> the_info->si_signo, the_info, false, false ); _ISR_Enable( level ); 462fe: 46c3 movew %d3,%sr the_info->si_code = SI_USER; 46300: 7001 moveq #1,%d0 the_info->si_value.sival_int = 0; return the_info->si_signo; 46302: 4fef 0018 lea %sp@(24),%sp false, false ); _ISR_Enable( level ); the_info->si_code = SI_USER; 46306: 2540 0004 movel %d0,%a2@(4) the_info->si_value.sival_int = 0; return the_info->si_signo; 4630a: 2412 movel %a2@,%d2 false ); _ISR_Enable( level ); the_info->si_code = SI_USER; the_info->si_value.sival_int = 0; 4630c: 42aa 0008 clrl %a2@(8) return the_info->si_signo; 46310: 6000 00b2 braw 463c4 } /* Process pending signals? */ if ( *set & _POSIX_signals_Pending ) { 46314: 2239 0006 1542 movel 61542 <_POSIX_signals_Pending>,%d1 4631a: 4bf9 0004 c034 lea 4c034 <_POSIX_signals_Clear_signals>,%a5 46320: c481 andl %d1,%d2 46322: 672c beqs 46350 signo = _POSIX_signals_Get_highest( _POSIX_signals_Pending ); 46324: 2f01 movel %d1,%sp@- 46326: 4eb9 0004 6210 jsr 46210 <_POSIX_signals_Get_highest> 4632c: 2400 movel %d0,%d2 _POSIX_signals_Clear_signals( api, signo, the_info, true, false ); 4632e: 42a7 clrl %sp@- 46330: 4878 0001 pea 1 46334: 2f0a movel %a2,%sp@- 46336: 2f00 movel %d0,%sp@- 46338: 2f0b movel %a3,%sp@- 4633a: 4e95 jsr %a5@ _ISR_Enable( level ); 4633c: 46c3 movew %d3,%sr the_info->si_signo = signo; the_info->si_code = SI_USER; 4633e: 7201 moveq #1,%d1 the_info->si_value.sival_int = 0; return signo; 46340: 4fef 0018 lea %sp@(24),%sp _POSIX_signals_Clear_signals( api, signo, the_info, true, false ); _ISR_Enable( level ); the_info->si_signo = signo; the_info->si_code = SI_USER; the_info->si_value.sival_int = 0; 46344: 42aa 0008 clrl %a2@(8) if ( *set & _POSIX_signals_Pending ) { signo = _POSIX_signals_Get_highest( _POSIX_signals_Pending ); _POSIX_signals_Clear_signals( api, signo, the_info, true, false ); _ISR_Enable( level ); the_info->si_signo = signo; 46348: 2482 movel %d2,%a2@ the_info->si_code = SI_USER; 4634a: 2541 0004 movel %d1,%a2@(4) the_info->si_value.sival_int = 0; return signo; 4634e: 6074 bras 463c4 46350: 2239 0006 0eac movel 60eac <_Thread_Dispatch_disable_level>,%d1 46356: 5281 addql #1,%d1 46358: 23c1 0006 0eac movel %d1,60eac <_Thread_Dispatch_disable_level> } the_info->si_signo = -1; 4635e: 72ff moveq #-1,%d1 46360: 2481 movel %d1,%a2@ _Thread_Disable_dispatch(); the_thread->Wait.queue = &_POSIX_signals_Wait_queue; the_thread->Wait.return_code = EINTR; 46362: 7204 moveq #4,%d1 } the_info->si_signo = -1; _Thread_Disable_dispatch(); the_thread->Wait.queue = &_POSIX_signals_Wait_queue; 46364: 43f9 0006 14da lea 614da <_POSIX_signals_Wait_queue>,%a1 the_thread->Wait.return_code = EINTR; 4636a: 2141 0034 movel %d1,%a0@(52) the_thread->Wait.option = *set; 4636e: 2154 0030 movel %a4@,%a0@(48) 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; 46372: 123c 0001 moveb #1,%d1 the_thread->Wait.return_argument = the_info; 46376: 214a 0028 movel %a2,%a0@(40) } the_info->si_signo = -1; _Thread_Disable_dispatch(); the_thread->Wait.queue = &_POSIX_signals_Wait_queue; 4637a: 2149 0044 movel %a1,%a0@(68) 4637e: 23c1 0006 150a movel %d1,6150a <_POSIX_signals_Wait_queue+0x30> the_thread->Wait.return_code = EINTR; the_thread->Wait.option = *set; the_thread->Wait.return_argument = the_info; _Thread_queue_Enter_critical_section( &_POSIX_signals_Wait_queue ); _ISR_Enable( level ); 46384: 46c3 movew %d3,%sr _Thread_queue_Enqueue( &_POSIX_signals_Wait_queue, interval ); 46386: 4879 0004 8fd0 pea 48fd0 <_Thread_queue_Timeout> 4638c: 2f00 movel %d0,%sp@- 4638e: 4879 0006 14da pea 614da <_POSIX_signals_Wait_queue> 46394: 4eb9 0004 8ce4 jsr 48ce4 <_Thread_queue_Enqueue_with_handler> _Thread_Enable_dispatch(); 4639a: 4eb9 0004 884a jsr 4884a <_Thread_Enable_dispatch> /* * When the thread is set free by a signal, it is need to eliminate * the signal. */ _POSIX_signals_Clear_signals( api, the_info->si_signo, the_info, false, false ); 463a0: 42a7 clrl %sp@- 463a2: 42a7 clrl %sp@- 463a4: 2f0a movel %a2,%sp@- 463a6: 2f12 movel %a2@,%sp@- 463a8: 2f0b movel %a3,%sp@- 463aa: 4e95 jsr %a5@ errno = _Thread_Executing->Wait.return_code; 463ac: 4fef 0020 lea %sp@(32),%sp 463b0: 4eb9 0004 f190 jsr 4f190 <__errno> 463b6: 2079 0006 0f66 moveal 60f66 <_Thread_Executing>,%a0 463bc: 2240 moveal %d0,%a1 463be: 22a8 0034 movel %a0@(52),%a1@ return the_info->si_signo; 463c2: 2412 movel %a2@,%d2 } 463c4: 2002 movel %d2,%d0 463c6: 4cee 3c1c ffd8 moveml %fp@(-40),%d2-%d4/%a2-%a5 463cc: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00047e38 : int sigwait( const sigset_t *set, int *sig ) { 47e38: 4e56 0000 linkw %fp,#0 47e3c: 2f0a movel %a2,%sp@- 47e3e: 246e 000c moveal %fp@(12),%a2 int status; status = sigtimedwait( set, NULL, NULL ); 47e42: 42a7 clrl %sp@- 47e44: 42a7 clrl %sp@- 47e46: 2f2e 0008 movel %fp@(8),%sp@- 47e4a: 4eb9 0004 7cac jsr 47cac if ( status != -1 ) { 47e50: 4fef 000c lea %sp@(12),%sp 47e54: 72ff moveq #-1,%d1 47e56: b280 cmpl %d0,%d1 47e58: 670a beqs 47e64 if ( sig ) 47e5a: 4a8a tstl %a2 47e5c: 6702 beqs 47e60 <== NEVER TAKEN *sig = status; 47e5e: 2480 movel %d0,%a2@ 47e60: 4280 clrl %d0 47e62: 600a bras 47e6e return 0; } return errno; 47e64: 4eb9 0005 09c0 jsr 509c0 <__errno> 47e6a: 2040 moveal %d0,%a0 47e6c: 2010 movel %a0@,%d0 } 47e6e: 246e fffc moveal %fp@(-4),%a2 47e72: 4e5e unlk %fp ... =============================================================================== 000453b8 : long sysconf( int name ) { if ( name == _SC_CLK_TCK ) 453b8: 7002 moveq #2,%d0 */ long sysconf( int name ) { 453ba: 4e56 0000 linkw %fp,#0 453be: 222e 0008 movel %fp@(8),%d1 453c2: 2f02 movel %d2,%sp@- if ( name == _SC_CLK_TCK ) 453c4: b081 cmpl %d1,%d0 453c6: 6612 bnes 453da return (TOD_MICROSECONDS_PER_SECOND / 453c8: 41f9 0005 dcc4 lea 5dcc4 ,%a0 453ce: 203c 000f 4240 movel #1000000,%d0 453d4: 4c50 0000 remul %a0@,%d0,%d0 453d8: 6034 bras 4540e rtems_configuration_get_microseconds_per_tick()); if ( name == _SC_OPEN_MAX ) 453da: 7004 moveq #4,%d0 453dc: b081 cmpl %d1,%d0 453de: 6608 bnes 453e8 return rtems_libio_number_iops; 453e0: 2039 0005 dbe4 movel 5dbe4 ,%d0 453e6: 6026 bras 4540e if ( name == _SC_GETPW_R_SIZE_MAX ) 453e8: 203c 0000 0400 movel #1024,%d0 453ee: 7433 moveq #51,%d2 453f0: b481 cmpl %d1,%d2 453f2: 671a beqs 4540e <== NEVER TAKEN return 1024; if ( name == _SC_PAGESIZE ) 453f4: 143c 0008 moveb #8,%d2 453f8: 303c 1000 movew #4096,%d0 453fc: b481 cmpl %d1,%d2 453fe: 670e beqs 4540e #if defined(__sparc__) if ( name == 515 ) /* Solaris _SC_STACK_PROT */ return 0; #endif rtems_set_errno_and_return_minus_one( EINVAL ); 45400: 4eb9 0004 e664 jsr 4e664 <__errno> 45406: 7216 moveq #22,%d1 45408: 2040 moveal %d0,%a0 4540a: 70ff moveq #-1,%d0 4540c: 2081 movel %d1,%a0@ } 4540e: 242e fffc movel %fp@(-4),%d2 45412: 4e5e unlk %fp ... =============================================================================== 00045460 : timer_t *timerid ) { POSIX_Timer_Control *ptimer; if ( clock_id != CLOCK_REALTIME ) 45460: 7001 moveq #1,%d0 int timer_create( clockid_t clock_id, struct sigevent *evp, timer_t *timerid ) { 45462: 4e56 0000 linkw %fp,#0 45466: 2f0b movel %a3,%sp@- 45468: 266e 0010 moveal %fp@(16),%a3 4546c: 2f0a movel %a2,%sp@- 4546e: 246e 000c moveal %fp@(12),%a2 POSIX_Timer_Control *ptimer; if ( clock_id != CLOCK_REALTIME ) 45472: b0ae 0008 cmpl %fp@(8),%d0 45476: 6620 bnes 45498 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !timerid ) 45478: 4a8b tstl %a3 4547a: 671c beqs 45498 /* * The data of the structure evp are checked in order to verify if they * are coherent. */ if (evp != NULL) { 4547c: 4a8a tstl %a2 4547e: 672a beqs 454aa /* The structure has data */ if ( ( evp->sigev_notify != SIGEV_NONE ) && 45480: 2012 movel %a2@,%d0 45482: 7201 moveq #1,%d1 45484: 5380 subql #1,%d0 45486: b280 cmpl %d0,%d1 45488: 650e bcss 45498 <== NEVER TAKEN ( evp->sigev_notify != SIGEV_SIGNAL ) ) { /* The value of the field sigev_notify is not valid */ rtems_set_errno_and_return_minus_one( EINVAL ); } if ( !evp->sigev_signo ) 4548a: 202a 0004 movel %a2@(4),%d0 4548e: 6708 beqs 45498 <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(evp->sigev_signo) ) 45490: 5380 subql #1,%d0 45492: 721f moveq #31,%d1 45494: b280 cmpl %d0,%d1 45496: 6412 bccs 454aa <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); 45498: 4eb9 0004 e8bc jsr 4e8bc <__errno> 4549e: 72ff moveq #-1,%d1 454a0: 2040 moveal %d0,%a0 454a2: 7016 moveq #22,%d0 454a4: 2080 movel %d0,%a0@ 454a6: 6000 00a4 braw 4554c rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 454aa: 2039 0005 fa9c movel 5fa9c <_Thread_Dispatch_disable_level>,%d0 454b0: 5280 addql #1,%d0 454b2: 23c0 0005 fa9c movel %d0,5fa9c <_Thread_Dispatch_disable_level> * the inactive chain of free timer control blocks. */ RTEMS_INLINE_ROUTINE POSIX_Timer_Control *_POSIX_Timer_Allocate( void ) { return (POSIX_Timer_Control *) _Objects_Allocate( &_POSIX_Timer_Information ); 454b8: 4879 0005 fd30 pea 5fd30 <_POSIX_Timer_Information> 454be: 4eb9 0004 70e0 jsr 470e0 <_Objects_Allocate> /* * Allocate a timer */ ptimer = _POSIX_Timer_Allocate(); if ( !ptimer ) { 454c4: 588f addql #4,%sp 454c6: 2040 moveal %d0,%a0 454c8: 4a80 tstl %d0 454ca: 6616 bnes 454e2 _Thread_Enable_dispatch(); 454cc: 4eb9 0004 7d2e jsr 47d2e <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EAGAIN ); 454d2: 4eb9 0004 e8bc jsr 4e8bc <__errno> 454d8: 72ff moveq #-1,%d1 454da: 2040 moveal %d0,%a0 454dc: 700b moveq #11,%d0 454de: 2080 movel %d0,%a0@ 454e0: 606a bras 4554c } /* The data of the created timer are stored to use them later */ ptimer->state = POSIX_TIMER_STATE_CREATE_NEW; 454e2: 7002 moveq #2,%d0 454e4: 1140 003c moveb %d0,%a0@(60) ptimer->thread_id = _Thread_Executing->Object.id; 454e8: 2279 0005 fb56 moveal 5fb56 <_Thread_Executing>,%a1 454ee: 2169 0008 0038 movel %a1@(8),%a0@(56) if ( evp != NULL ) { 454f4: 4a8a tstl %a2 454f6: 6710 beqs 45508 ptimer->inf.sigev_notify = evp->sigev_notify; 454f8: 2152 003e movel %a2@,%a0@(62) ptimer->inf.sigev_signo = evp->sigev_signo; ptimer->inf.sigev_value = evp->sigev_value; 454fc: 216a 0008 0046 movel %a2@(8),%a0@(70) ptimer->state = POSIX_TIMER_STATE_CREATE_NEW; ptimer->thread_id = _Thread_Executing->Object.id; if ( evp != NULL ) { ptimer->inf.sigev_notify = evp->sigev_notify; ptimer->inf.sigev_signo = evp->sigev_signo; 45502: 216a 0004 0042 movel %a2@(4),%a0@(66) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 45508: 2028 0008 movel %a0@(8),%d0 4550c: 4281 clrl %d1 4550e: 2279 0005 fd48 moveal 5fd48 <_POSIX_Timer_Information+0x18>,%a1 45514: 3200 movew %d0,%d1 ptimer->inf.sigev_value = evp->sigev_value; } ptimer->overrun = 0; 45516: 42a8 0066 clrl %a0@(102) 4551a: 2388 1c00 movel %a0,%a1@(00000000,%d1:l:4) ptimer->timer_data.it_value.tv_sec = 0; 4551e: 42a8 005a clrl %a0@(90) _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 45522: 42a8 000c clrl %a0@(12) ptimer->timer_data.it_value.tv_nsec = 0; 45526: 42a8 005e clrl %a0@(94) ptimer->timer_data.it_interval.tv_sec = 0; 4552a: 42a8 0052 clrl %a0@(82) ptimer->timer_data.it_interval.tv_nsec = 0; 4552e: 42a8 0056 clrl %a0@(86) void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; 45532: 42a8 0030 clrl %a0@(48) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 45536: 42a8 0018 clrl %a0@(24) _Watchdog_Initialize( &ptimer->Timer, NULL, 0, NULL ); _Objects_Open_u32(&_POSIX_Timer_Information, &ptimer->Object, 0); *timerid = ptimer->Object.id; 4553a: 2680 movel %d0,%a3@ the_watchdog->routine = routine; 4553c: 42a8 002c clrl %a0@(44) the_watchdog->id = id; the_watchdog->user_data = user_data; 45540: 42a8 0034 clrl %a0@(52) _Thread_Enable_dispatch(); 45544: 4eb9 0004 7d2e jsr 47d2e <_Thread_Enable_dispatch> 4554a: 4281 clrl %d1 return 0; } 4554c: 246e fff8 moveal %fp@(-8),%a2 45550: 2001 movel %d1,%d0 45552: 266e fffc moveal %fp@(-4),%a3 45556: 4e5e unlk %fp ... =============================================================================== 000455f0 : useconds_t ualarm( useconds_t useconds, useconds_t interval ) { 455f0: 4e56 ffe8 linkw %fp,#-24 455f4: 48d7 041c moveml %d2-%d4/%a2,%sp@ 455f8: 262e 0008 movel %fp@(8),%d3 /* * Initialize the timer used to implement alarm(). */ if ( !the_timer->routine ) { 455fc: 4ab9 0006 0f02 tstl 60f02 <_POSIX_signals_Ualarm_timer+0x1c> 45602: 6622 bnes 45626 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 45604: 42b9 0006 0eee clrl 60eee <_POSIX_signals_Ualarm_timer+0x8> the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 4560a: 4282 clrl %d2 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 4560c: 203c 0004 56dc movel #284380,%d0 the_watchdog->id = id; 45612: 42b9 0006 0f06 clrl 60f06 <_POSIX_signals_Ualarm_timer+0x20> Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 45618: 23c0 0006 0f02 movel %d0,60f02 <_POSIX_signals_Ualarm_timer+0x1c> the_watchdog->id = id; the_watchdog->user_data = user_data; 4561e: 42b9 0006 0f0a clrl 60f0a <_POSIX_signals_Ualarm_timer+0x24> 45624: 6058 bras 4567e _Watchdog_Initialize( the_timer, _POSIX_signals_Ualarm_TSR, 0, NULL ); } else { Watchdog_States state; state = _Watchdog_Remove( the_timer ); 45626: 4879 0006 0ee6 pea 60ee6 <_POSIX_signals_Ualarm_timer> 4562c: 4eb9 0004 8d08 jsr 48d08 <_Watchdog_Remove> if ( (state == WATCHDOG_ACTIVE) || (state == WATCHDOG_REMOVE_IT) ) { 45632: 588f addql #4,%sp 45634: 7201 moveq #1,%d1 45636: 5580 subql #2,%d0 45638: b280 cmpl %d0,%d1 4563a: 6404 bccs 45640 <== ALWAYS TAKEN 4563c: 4282 clrl %d2 <== NOT EXECUTED 4563e: 603e bras 4567e <== NOT EXECUTED * 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); 45640: 2039 0006 0efa movel 60efa <_POSIX_signals_Ualarm_timer+0x14>,%d0 45646: d0b9 0006 0ef2 addl 60ef2 <_POSIX_signals_Ualarm_timer+0xc>,%d0 /* remaining is now in ticks */ _Timespec_From_ticks( ticks, &tp ); 4564c: 486e fff8 pea %fp@(-8) 45650: 90b9 0006 0efe subl 60efe <_POSIX_signals_Ualarm_timer+0x18>,%d0 remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND; 45656: 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 ); 4565c: 2f00 movel %d0,%sp@- 4565e: 4eb9 0004 8830 jsr 48830 <_Timespec_From_ticks> remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND; 45664: 202e fff8 movel %fp@(-8),%d0 45668: 4c04 0800 mulsl %d4,%d0 remaining += tp.tv_nsec / 1000; 4566c: 283c 0000 03e8 movel #1000,%d4 45672: 508f addql #8,%sp 45674: 242e fffc movel %fp@(-4),%d2 45678: 4c44 2802 remsl %d4,%d2,%d2 4567c: d480 addl %d0,%d2 /* * 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 ) { 4567e: 4a83 tstl %d3 45680: 674e beqs 456d0 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 ); 45682: 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; 45684: 223c 000f 4240 movel #1000000,%d1 tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; ticks = _Timespec_To_ticks( &tp ); 4568a: 5184 subql #8,%d4 4568c: 45f9 0004 88b4 lea 488b4 <_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; 45692: 4c41 3000 remul %d1,%d0,%d3 45696: 4c41 3003 remul %d1,%d3,%d3 tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; 4569a: 223c 0000 03e8 movel #1000,%d1 456a0: 4c00 1800 mulsl %d0,%d1 ticks = _Timespec_To_ticks( &tp ); 456a4: 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; 456a6: 2d41 fffc movel %d1,%fp@(-4) * 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; 456aa: 2d43 fff8 movel %d3,%fp@(-8) tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; ticks = _Timespec_To_ticks( &tp ); 456ae: 4e92 jsr %a2@ if ( ticks == 0 ) ticks = 1; _Watchdog_Insert_ticks( the_timer, _Timespec_To_ticks( &tp ) ); 456b0: 2f04 movel %d4,%sp@- 456b2: 4e92 jsr %a2@ ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 456b4: 4879 0006 0ee6 pea 60ee6 <_POSIX_signals_Ualarm_timer> 456ba: 4879 0006 07a4 pea 607a4 <_Watchdog_Ticks_chain> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 456c0: 23c0 0006 0ef2 movel %d0,60ef2 <_POSIX_signals_Ualarm_timer+0xc> _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 456c6: 4eb9 0004 8bec jsr 48bec <_Watchdog_Insert> 456cc: 4fef 0010 lea %sp@(16),%sp } return remaining; } 456d0: 2002 movel %d2,%d0 456d2: 4cee 041c ffe8 moveml %fp@(-24),%d2-%d4/%a2 456d8: 4e5e unlk %fp <== NOT EXECUTED