0004589c <_API_Mutex_Unlock>: #include void _API_Mutex_Unlock( API_Mutex_Control *the_mutex ) { 4589c: 4e56 0000 linkw %fp,#0 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 458a0: 2039 0005 cd08 movel 5cd08 <_Thread_Dispatch_disable_level>,%d0 458a6: 5280 addql #1,%d0 458a8: 206e 0008 moveal %fp@(8),%a0 458ac: 23c0 0005 cd08 movel %d0,5cd08 <_Thread_Dispatch_disable_level> _Thread_Disable_dispatch(); _CORE_mutex_Surrender( 458b2: 42a7 clrl %sp@- 458b4: 2f28 0008 movel %a0@(8),%sp@- 458b8: 4868 0010 pea %a0@(16) 458bc: 4eb9 0004 5ac8 jsr 45ac8 <_CORE_mutex_Surrender> &the_mutex->Mutex, the_mutex->Object.id, NULL ); _Thread_Enable_dispatch(); 458c2: 4fef 000c lea %sp@(12),%sp } 458c6: 4e5e unlk %fp _CORE_mutex_Surrender( &the_mutex->Mutex, the_mutex->Object.id, NULL ); _Thread_Enable_dispatch(); 458c8: 4ef9 0004 6ce2 jmp 46ce2 <_Thread_Enable_dispatch> ... 000477f8 <_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 ); 477f8: 203c 0000 0700 movel #1792,%d0 Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_RWLock_API_mp_support_callout api_rwlock_mp_support ) { 477fe: 4e56 ffe8 linkw %fp,#-24 47802: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@ 47806: 246e 0008 moveal %fp@(8),%a2 4780a: 282e 000c movel %fp@(12),%d4 4780e: 262e 0014 movel %fp@(20),%d3 47812: 1a2e 0013 moveb %fp@(19),%d5 ISR_Level level; Thread_Control *executing = _Thread_Executing; 47816: 2679 0005 f766 moveal 5f766 <_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 ); 4781c: 40c2 movew %sr,%d2 4781e: 8082 orl %d2,%d0 47820: 46c0 movew %d0,%sr switch ( the_rwlock->current_state ) { 47822: 202a 0044 movel %a2@(68),%d0 47826: 6708 beqs 47830 <_CORE_RWLock_Obtain_for_reading+0x38> 47828: 7201 moveq #1,%d1 4782a: b280 cmpl %d0,%d1 4782c: 662a bnes 47858 <_CORE_RWLock_Obtain_for_reading+0x60> 4782e: 600e bras 4783e <_CORE_RWLock_Obtain_for_reading+0x46> case CORE_RWLOCK_UNLOCKED: the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING; 47830: 7001 moveq #1,%d0 the_rwlock->number_of_readers += 1; 47832: 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; 47836: 2540 0044 movel %d0,%a2@(68) the_rwlock->number_of_readers += 1; _ISR_Enable( level ); 4783a: 46c2 movew %d2,%sr 4783c: 6014 bras 47852 <_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 ); 4783e: 2f0a movel %a2,%sp@- 47840: 4eb9 0004 9300 jsr 49300 <_Thread_queue_First> if ( !waiter ) { 47846: 588f addql #4,%sp 47848: 4a80 tstl %d0 4784a: 660c bnes 47858 <_CORE_RWLock_Obtain_for_reading+0x60><== NEVER TAKEN the_rwlock->number_of_readers += 1; 4784c: 52aa 0048 addql #1,%a2@(72) _ISR_Enable( level ); 47850: 46c2 movew %d2,%sr executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 47852: 42ab 0034 clrl %a3@(52) return; 47856: 6046 bras 4789e <_CORE_RWLock_Obtain_for_reading+0xa6> /* * If the thread is not willing to wait, then return immediately. */ if ( !wait ) { 47858: 4a05 tstb %d5 4785a: 660a bnes 47866 <_CORE_RWLock_Obtain_for_reading+0x6e> _ISR_Enable( level ); 4785c: 46c2 movew %d2,%sr executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; 4785e: 7202 moveq #2,%d1 47860: 2741 0034 movel %d1,%a3@(52) 47864: 6038 bras 4789e <_CORE_RWLock_Obtain_for_reading+0xa6> 47866: 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; 47868: 2744 0020 movel %d4,%a3@(32) executing->Wait.option = CORE_RWLOCK_THREAD_WAITING_FOR_READ; executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 4786c: 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; 47870: 274a 0044 movel %a2,%a3@(68) executing->Wait.id = id; executing->Wait.option = CORE_RWLOCK_THREAD_WAITING_FOR_READ; 47874: 42ab 0030 clrl %a3@(48) 47878: 2540 0030 movel %d0,%a2@(48) executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; _ISR_Enable( level ); 4787c: 46c2 movew %d2,%sr _Thread_queue_Enqueue_with_handler( 4787e: 2d43 000c movel %d3,%fp@(12) 47882: 223c 0004 79e8 movel #293352,%d1 47888: 2d4a 0008 movel %a2,%fp@(8) timeout, _CORE_RWLock_Timeout ); /* return to API level so it can dispatch and we block */ } 4788c: 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( 47892: 2d41 0010 movel %d1,%fp@(16) timeout, _CORE_RWLock_Timeout ); /* return to API level so it can dispatch and we block */ } 47896: 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( 47898: 4ef9 0004 9000 jmp 49000 <_Thread_queue_Enqueue_with_handler> timeout, _CORE_RWLock_Timeout ); /* return to API level so it can dispatch and we block */ } 4789e: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 478a4: 4e5e unlk %fp <== NOT EXECUTED 00047934 <_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 ); 47934: 223c 0000 0700 movel #1792,%d1 */ CORE_RWLock_Status _CORE_RWLock_Release( CORE_RWLock_Control *the_rwlock ) { 4793a: 4e56 fff0 linkw %fp,#-16 ISR_Level level; Thread_Control *executing = _Thread_Executing; 4793e: 2079 0005 f766 moveal 5f766 <_Thread_Executing>,%a0 */ CORE_RWLock_Status _CORE_RWLock_Release( CORE_RWLock_Control *the_rwlock ) { 47944: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ 47948: 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 ); 4794c: 40c0 movew %sr,%d0 4794e: 8280 orl %d0,%d1 47950: 46c1 movew %d1,%sr if ( the_rwlock->current_state == CORE_RWLOCK_UNLOCKED){ 47952: 222a 0044 movel %a2@(68),%d1 47956: 660a bnes 47962 <_CORE_RWLock_Release+0x2e> _ISR_Enable( level ); 47958: 46c0 movew %d0,%sr executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; 4795a: 7002 moveq #2,%d0 4795c: 2140 0034 movel %d0,%a0@(52) return CORE_RWLOCK_SUCCESSFUL; 47960: 6078 bras 479da <_CORE_RWLock_Release+0xa6> } if ( the_rwlock->current_state == CORE_RWLOCK_LOCKED_FOR_READING ) { 47962: 7401 moveq #1,%d2 47964: b481 cmpl %d1,%d2 47966: 6610 bnes 47978 <_CORE_RWLock_Release+0x44> the_rwlock->number_of_readers -= 1; 47968: 222a 0048 movel %a2@(72),%d1 4796c: 5381 subql #1,%d1 4796e: 2541 0048 movel %d1,%a2@(72) if ( the_rwlock->number_of_readers != 0 ) { 47972: 6704 beqs 47978 <_CORE_RWLock_Release+0x44> /* must be unlocked again */ _ISR_Enable( level ); 47974: 46c0 movew %d0,%sr return CORE_RWLOCK_SUCCESSFUL; 47976: 6062 bras 479da <_CORE_RWLock_Release+0xa6> } } /* CORE_RWLOCK_LOCKED_FOR_WRITING or READING with readers */ executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 47978: 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; 4797c: 42aa 0044 clrl %a2@(68) _ISR_Enable( level ); 47980: 46c0 movew %d0,%sr next = _Thread_queue_Dequeue( &the_rwlock->Wait_queue ); 47982: 2f0a movel %a2,%sp@- 47984: 4eb9 0004 8ec0 jsr 48ec0 <_Thread_queue_Dequeue> if ( next ) { 4798a: 588f addql #4,%sp 4798c: 4a80 tstl %d0 4798e: 674a beqs 479da <_CORE_RWLock_Release+0xa6> if ( next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) { 47990: 7201 moveq #1,%d1 47992: 2040 moveal %d0,%a0 47994: b2a8 0030 cmpl %a0@(48),%d1 47998: 6608 bnes 479a2 <_CORE_RWLock_Release+0x6e> the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_WRITING; 4799a: 7002 moveq #2,%d0 4799c: 2540 0044 movel %d0,%a2@(68) return CORE_RWLOCK_SUCCESSFUL; 479a0: 6038 bras 479da <_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; 479a2: 7201 moveq #1,%d1 } /* * Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING */ the_rwlock->number_of_readers += 1; 479a4: 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 ); 479a8: 49f9 0004 9300 lea 49300 <_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 ); 479ae: 47f9 0004 91d4 lea 491d4 <_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; 479b4: 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 ); 479b8: 2f0a movel %a2,%sp@- 479ba: 4e94 jsr %a4@ if ( !next || 479bc: 588f addql #4,%sp 479be: 4a80 tstl %d0 479c0: 6718 beqs 479da <_CORE_RWLock_Release+0xa6> next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) 479c2: 7401 moveq #1,%d2 479c4: 2040 moveal %d0,%a0 479c6: b4a8 0030 cmpl %a0@(48),%d2 479ca: 670e beqs 479da <_CORE_RWLock_Release+0xa6> <== NEVER TAKEN return CORE_RWLOCK_SUCCESSFUL; the_rwlock->number_of_readers += 1; 479cc: 52aa 0048 addql #1,%a2@(72) _Thread_queue_Extract( &the_rwlock->Wait_queue, next ); 479d0: 2f00 movel %d0,%sp@- 479d2: 2f0a movel %a2,%sp@- 479d4: 4e93 jsr %a3@ } 479d6: 508f addql #8,%sp 479d8: 60de bras 479b8 <_CORE_RWLock_Release+0x84> } /* indentation is to match _ISR_Disable at top */ return CORE_RWLOCK_SUCCESSFUL; } 479da: 4280 clrl %d0 479dc: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 479e2: 4e5e unlk %fp ... 000479e8 <_CORE_RWLock_Timeout>: void _CORE_RWLock_Timeout( Objects_Id id, void *ignored ) { 479e8: 4e56 fffc linkw %fp,#-4 Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 479ec: 486e fffc pea %fp@(-4) 479f0: 2f2e 0008 movel %fp@(8),%sp@- 479f4: 4eb9 0004 8b8c jsr 48b8c <_Thread_Get> switch ( location ) { 479fa: 508f addql #8,%sp 479fc: 4aae fffc tstl %fp@(-4) 47a00: 6618 bnes 47a1a <_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 ); 47a02: 2f00 movel %d0,%sp@- 47a04: 4eb9 0004 93e4 jsr 493e4 <_Thread_queue_Process_timeout> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 47a0a: 588f addql #4,%sp 47a0c: 2039 0005 f6ac movel 5f6ac <_Thread_Dispatch_disable_level>,%d0 47a12: 5380 subql #1,%d0 47a14: 23c0 0005 f6ac movel %d0,5f6ac <_Thread_Dispatch_disable_level> _Thread_Unnest_dispatch(); break; } } 47a1a: 4e5e unlk %fp ... 0004bfe8 <_CORE_barrier_Wait>: Thread_Control *executing; ISR_Level level; executing = _Thread_Executing; executing->Wait.return_code = CORE_BARRIER_STATUS_SUCCESSFUL; _ISR_Disable( level ); 4bfe8: 203c 0000 0700 movel #1792,%d0 Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_barrier_API_mp_support_callout api_barrier_mp_support ) { 4bfee: 4e56 fff4 linkw %fp,#-12 Thread_Control *executing; ISR_Level level; executing = _Thread_Executing; 4bff2: 2279 0005 cdc2 moveal 5cdc2 <_Thread_Executing>,%a1 Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_barrier_API_mp_support_callout api_barrier_mp_support ) { 4bff8: 48d7 001c moveml %d2-%d4,%sp@ 4bffc: 242e 000c movel %fp@(12),%d2 4c000: 262e 0014 movel %fp@(20),%d3 Thread_Control *executing; ISR_Level level; executing = _Thread_Executing; executing->Wait.return_code = CORE_BARRIER_STATUS_SUCCESSFUL; 4c004: 42a9 0034 clrl %a1@(52) Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_barrier_API_mp_support_callout api_barrier_mp_support ) { 4c008: 206e 0008 moveal %fp@(8),%a0 4c00c: 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 ); 4c010: 40c1 movew %sr,%d1 4c012: 8081 orl %d1,%d0 4c014: 46c0 movew %d0,%sr the_barrier->number_of_waiting_threads++; 4c016: 2028 0048 movel %a0@(72),%d0 4c01a: 5280 addql #1,%d0 4c01c: 2140 0048 movel %d0,%a0@(72) if ( _CORE_barrier_Is_automatic( &the_barrier->Attributes ) ) { 4c020: 4aa8 0040 tstl %a0@(64) 4c024: 6626 bnes 4c04c <_CORE_barrier_Wait+0x64> if ( the_barrier->number_of_waiting_threads == the_barrier->Attributes.maximum_count) { 4c026: b0a8 0044 cmpl %a0@(68),%d0 4c02a: 6620 bnes 4c04c <_CORE_barrier_Wait+0x64> executing->Wait.return_code = CORE_BARRIER_STATUS_AUTOMATICALLY_RELEASED; 4c02c: 7001 moveq #1,%d0 4c02e: 2340 0034 movel %d0,%a1@(52) _ISR_Enable( level ); 4c032: 46c1 movew %d1,%sr _CORE_barrier_Release( the_barrier, id, api_barrier_mp_support ); 4c034: 2d44 0010 movel %d4,%fp@(16) 4c038: 2d42 000c movel %d2,%fp@(12) 4c03c: 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 ); } 4c040: 4cd7 001c moveml %sp@,%d2-%d4 4c044: 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 ); 4c046: 4ef9 0004 bfb4 jmp 4bfb4 <_CORE_barrier_Release> 4c04c: 7001 moveq #1,%d0 } } _Thread_queue_Enter_critical_section( &the_barrier->Wait_queue ); executing->Wait.queue = &the_barrier->Wait_queue; executing->Wait.id = id; 4c04e: 2342 0020 movel %d2,%a1@(32) return; } } _Thread_queue_Enter_critical_section( &the_barrier->Wait_queue ); executing->Wait.queue = &the_barrier->Wait_queue; 4c052: 2348 0044 movel %a0,%a1@(68) 4c056: 2140 0030 movel %d0,%a0@(48) executing->Wait.id = id; _ISR_Enable( level ); 4c05a: 46c1 movew %d1,%sr _Thread_queue_Enqueue( &the_barrier->Wait_queue, timeout ); 4c05c: 2d43 000c movel %d3,%fp@(12) 4c060: 203c 0004 7468 movel #291944,%d0 4c066: 2d48 0008 movel %a0,%fp@(8) 4c06a: 2d40 0010 movel %d0,%fp@(16) } 4c06e: 4cd7 001c moveml %sp@,%d2-%d4 4c072: 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 ); 4c074: 4ef9 0004 717c jmp 4717c <_Thread_queue_Enqueue_with_handler> ... 00052088 <_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 ) { 52088: 4e56 ffe0 linkw %fp,#-32 5208c: 48d7 3c3c moveml %d2-%d5/%a2-%a5,%sp@ 52090: 246e 0008 moveal %fp@(8),%a2 52094: 2a2e 000c movel %fp@(12),%d5 52098: 262e 0010 movel %fp@(16),%d3 5209c: 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 ) { 520a0: b6aa 004c cmpl %a2@(76),%d3 520a4: 6304 blss 520aa <_CORE_message_queue_Broadcast+0x22><== ALWAYS TAKEN 520a6: 7001 moveq #1,%d0 <== NOT EXECUTED 520a8: 6042 bras 520ec <_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 ) { 520aa: 4aaa 0048 tstl %a2@(72) 520ae: 6610 bnes 520c0 <_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))) { 520b0: 4282 clrl %d2 520b2: 283c 0005 439c movel #344988,%d4 const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 520b8: 4bf9 0005 a3f4 lea 5a3f4 ,%a5 520be: 601a bras 520da <_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; 520c0: 4294 clrl %a4@ 520c2: 6026 bras 520ea <_CORE_message_queue_Broadcast+0x62> 520c4: 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; 520c6: 5282 addql #1,%d2 520c8: 2f05 movel %d5,%sp@- 520ca: 2f2b 002c movel %a3@(44),%sp@- 520ce: 4e95 jsr %a5@ buffer, waitp->return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; 520d0: 206b 0028 moveal %a3@(40),%a0 520d4: 4fef 000c lea %sp@(12),%sp 520d8: 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))) { 520da: 2f0a movel %a2,%sp@- 520dc: 2044 moveal %d4,%a0 520de: 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 = 520e0: 588f addql #4,%sp _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { 520e2: 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 = 520e4: 4a80 tstl %d0 520e6: 66dc bnes 520c4 <_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; 520e8: 2882 movel %d2,%a4@ 520ea: 4280 clrl %d0 return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; } 520ec: 4cee 3c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a5 520f2: 4e5e unlk %fp ... 0004dcf0 <_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)) { 4dcf0: 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 ) { 4dcf2: 4e56 fff4 linkw %fp,#-12 4dcf6: 222e 0014 movel %fp@(20),%d1 4dcfa: 48d7 040c moveml %d2-%d3/%a2,%sp@ 4dcfe: 246e 0008 moveal %fp@(8),%a2 4dd02: 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)) { 4dd06: c081 andl %d1,%d0 ) { size_t message_buffering_required; size_t allocated_message_size; the_message_queue->maximum_pending_messages = maximum_pending_messages; 4dd08: 2542 0044 movel %d2,%a2@(68) the_message_queue->number_of_pending_messages = 0; 4dd0c: 42aa 0048 clrl %a2@(72) the_message_queue->maximum_message_size = maximum_message_size; 4dd10: 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; 4dd14: 42aa 0060 clrl %a2@(96) the_message_queue->notify_argument = the_argument; 4dd18: 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)) { 4dd1c: 4a80 tstl %d0 4dd1e: 6604 bnes 4dd24 <_CORE_message_queue_Initialize+0x34> 4dd20: 2001 movel %d1,%d0 4dd22: 600c bras 4dd30 <_CORE_message_queue_Initialize+0x40> allocated_message_size += sizeof(uint32_t); 4dd24: 2001 movel %d1,%d0 4dd26: 5880 addql #4,%d0 allocated_message_size &= ~(sizeof(uint32_t) - 1); 4dd28: 76fc moveq #-4,%d3 4dd2a: c083 andl %d3,%d0 } if (allocated_message_size < maximum_message_size) 4dd2c: b280 cmpl %d0,%d1 4dd2e: 626e bhis 4dd9e <_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)); 4dd30: 2600 movel %d0,%d3 4dd32: 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 * 4dd38: 2203 movel %d3,%d1 4dd3a: 4c02 1800 mulsl %d2,%d1 (allocated_message_size + sizeof(CORE_message_queue_Buffer_control)); if (message_buffering_required < allocated_message_size) 4dd3e: b081 cmpl %d1,%d0 4dd40: 625c bhis 4dd9e <_CORE_message_queue_Initialize+0xae><== NEVER TAKEN return false; /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) 4dd42: 2f01 movel %d1,%sp@- 4dd44: 4eb9 0005 06b0 jsr 506b0 <_Workspace_Allocate> _Workspace_Allocate( message_buffering_required ); if (the_message_queue->message_buffers == 0) 4dd4a: 588f addql #4,%sp return false; /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) 4dd4c: 2540 005c movel %d0,%a2@(92) _Workspace_Allocate( message_buffering_required ); if (the_message_queue->message_buffers == 0) 4dd50: 674c beqs 4dd9e <_CORE_message_queue_Initialize+0xae> /* * Initialize the pool of inactive messages, pending messages, * and set of waiting threads. */ _Chain_Initialize ( 4dd52: 2f03 movel %d3,%sp@- 4dd54: 2f02 movel %d2,%sp@- 4dd56: 2f00 movel %d0,%sp@- 4dd58: 486a 0068 pea %a2@(104) 4dd5c: 4eb9 0005 265c jsr 5265c <_Chain_Initialize> allocated_message_size + sizeof( CORE_message_queue_Buffer_control ) ); _Chain_Initialize_empty( &the_message_queue->Pending_messages ); _Thread_queue_Initialize( 4dd62: 4878 0006 pea 6 4dd66: 7001 moveq #1,%d0 4dd68: 206e 000c moveal %fp@(12),%a0 4dd6c: b090 cmpl %a0@,%d0 4dd6e: 57c0 seq %d0 4dd70: 4878 0080 pea 80 4dd74: 49c0 extbl %d0 4dd76: 4480 negl %d0 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 4dd78: 41ea 0054 lea %a2@(84),%a0 4dd7c: 2f00 movel %d0,%sp@- 4dd7e: 2548 0050 movel %a0,%a2@(80) the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 4dd82: 41ea 0050 lea %a2@(80),%a0 4dd86: 2548 0058 movel %a0,%a2@(88) 4dd8a: 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; 4dd8c: 42aa 0054 clrl %a2@(84) 4dd90: 4eb9 0004 fbc4 jsr 4fbc4 <_Thread_queue_Initialize> THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; 4dd96: 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( 4dd9a: 7001 moveq #1,%d0 THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; 4dd9c: 6002 bras 4dda0 <_CORE_message_queue_Initialize+0xb0> 4dd9e: 4200 clrb %d0 } 4dda0: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 4dda6: 4e5e unlk %fp ... 0004ddac <_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 ); 4ddac: 223c 0000 0700 movel #1792,%d1 void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 4ddb2: 4e56 ffe0 linkw %fp,#-32 ISR_Level level; CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; 4ddb6: 2079 0006 6446 moveal 66446 <_Thread_Executing>,%a0 void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 4ddbc: 48d7 3c3c moveml %d2-%d5/%a2-%a5,%sp@ 4ddc0: 282e 000c movel %fp@(12),%d4 4ddc4: 242e 001c movel %fp@(28),%d2 4ddc8: 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; 4ddcc: 42a8 0034 clrl %a0@(52) void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 4ddd0: 262e 0010 movel %fp@(16),%d3 4ddd4: 226e 0014 moveal %fp@(20),%a1 4ddd8: 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 ); 4dddc: 40c0 movew %sr,%d0 4ddde: 8280 orl %d0,%d1 4dde0: 46c1 movew %d1,%sr */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4dde2: 220a movel %a2,%d1 4dde4: 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)); 4ddea: 266a 0050 moveal %a2@(80),%a3 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4ddee: b28b cmpl %a3,%d1 4ddf0: 6700 00a6 beqw 4de98 <_CORE_message_queue_Seize+0xec> { Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; 4ddf4: 2853 moveal %a3@,%a4 the_chain->first = new_first; new_first->previous = _Chain_Head(the_chain); 4ddf6: 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; 4ddfa: 254c 0050 movel %a4,%a2@(80) new_first->previous = _Chain_Head(the_chain); 4ddfe: 294d 0004 movel %a5,%a4@(4) the_message = _CORE_message_queue_Get_pending_message( the_message_queue ); if ( the_message != NULL ) { 4de02: 4a8b tstl %a3 4de04: 6700 0092 beqw 4de98 <_CORE_message_queue_Seize+0xec> the_message_queue->number_of_pending_messages -= 1; 4de08: 53aa 0048 subql #1,%a2@(72) _ISR_Enable( level ); 4de0c: 46c0 movew %d0,%sr *size_p = the_message->Contents.size; _Thread_Executing->Wait.count = 4de0e: 2079 0006 6446 moveal 66446 <_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; 4de14: 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, 4de18: 240b movel %a3,%d2 4de1a: 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 = 4de20: 216b 0008 0024 movel %a3@(8),%a0@(36) const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 4de26: 49f9 0005 5674 lea 55674 ,%a4 4de2c: 2f11 movel %a1@,%sp@- 4de2e: 2f02 movel %d2,%sp@- 4de30: 2f03 movel %d3,%sp@- 4de32: 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 ); 4de34: 2f0a movel %a2,%sp@- 4de36: 4eb9 0004 f854 jsr 4f854 <_Thread_queue_Dequeue> if ( !the_thread ) { 4de3c: 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 ); 4de40: 2040 moveal %d0,%a0 if ( !the_thread ) { 4de42: 4a80 tstl %d0 4de44: 661a bnes 4de60 <_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 ); 4de46: 45ea 0068 lea %a2@(104),%a2 4de4a: 2d4b 000c movel %a3,%fp@(12) 4de4e: 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 ); } 4de52: 4cee 3c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a5 4de58: 4e5e unlk %fp 4de5a: 4ef9 0004 dc2c jmp 4dc2c <_Chain_Append> */ _CORE_message_queue_Set_message_priority( the_message, the_thread->Wait.count ); the_message->Contents.size = (size_t) the_thread->Wait.option; 4de60: 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; 4de64: 2768 0024 0008 movel %a0@(36),%a3@(8) 4de6a: 2740 000c movel %d0,%a3@(12) const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 4de6e: 2f00 movel %d0,%sp@- 4de70: 2f28 002c movel %a0@(44),%sp@- 4de74: 2f02 movel %d2,%sp@- 4de76: 4e94 jsr %a4@ the_thread->Wait.return_argument_second.immutable_object, the_message->Contents.buffer, the_message->Contents.size ); _CORE_message_queue_Insert_message( 4de78: 2d6b 0008 0010 movel %a3@(8),%fp@(16) 4de7e: 4fef 000c lea %sp@(12),%sp 4de82: 2d4b 000c movel %a3,%fp@(12) 4de86: 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 ); } 4de8a: 4cee 3c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a5 4de90: 4e5e unlk %fp the_thread->Wait.return_argument_second.immutable_object, the_message->Contents.buffer, the_message->Contents.size ); _CORE_message_queue_Insert_message( 4de92: 4ef9 0005 269c jmp 5269c <_CORE_message_queue_Insert_message> return; } #endif } if ( !wait ) { 4de98: 4a05 tstb %d5 4de9a: 6612 bnes 4deae <_CORE_message_queue_Seize+0x102> _ISR_Enable( level ); 4de9c: 46c0 movew %d0,%sr executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT; 4de9e: 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 ); } 4dea0: 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; 4dea6: 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 ); } 4deaa: 4e5e unlk %fp 4deac: 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; 4deae: 7201 moveq #1,%d1 4deb0: 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; 4deb4: 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; 4deb8: 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; 4debc: 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; 4dec0: 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 ); 4dec4: 46c0 movew %d0,%sr _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); 4dec6: 4bf9 0004 fc80 lea 4fc80 <_Thread_queue_Timeout>,%a5 4decc: 2d42 000c movel %d2,%fp@(12) 4ded0: 2d4d 0010 movel %a5,%fp@(16) 4ded4: 2d4a 0008 movel %a2,%fp@(8) } 4ded8: 4cee 3c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a5 4dede: 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 ); 4dee0: 4ef9 0004 f994 jmp 4f994 <_Thread_queue_Enqueue_with_handler> ... 00045a20 <_CORE_mutex_Seize>: Objects_Id _id, bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { 45a20: 4e56 0000 linkw %fp,#0 45a24: 202e 0010 movel %fp@(16),%d0 45a28: 2f0a movel %a2,%sp@- 45a2a: 246e 0008 moveal %fp@(8),%a2 45a2e: 2f02 movel %d2,%sp@- _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); 45a30: 2239 0005 cd08 movel 5cd08 <_Thread_Dispatch_disable_level>,%d1 Objects_Id _id, bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { 45a36: 1400 moveb %d0,%d2 _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); 45a38: 4a81 tstl %d1 45a3a: 671c beqs 45a58 <_CORE_mutex_Seize+0x38> 45a3c: 4a00 tstb %d0 45a3e: 6718 beqs 45a58 <_CORE_mutex_Seize+0x38> <== NEVER TAKEN 45a40: 7001 moveq #1,%d0 45a42: b0b9 0005 ce90 cmpl 5ce90 <_System_state_Current>,%d0 45a48: 640e bccs 45a58 <_CORE_mutex_Seize+0x38> 45a4a: 4878 0013 pea 13 45a4e: 42a7 clrl %sp@- 45a50: 42a7 clrl %sp@- 45a52: 4eb9 0004 5fd8 jsr 45fd8 <_Internal_error_Occurred> 45a58: 486e 0018 pea %fp@(24) 45a5c: 2f0a movel %a2,%sp@- 45a5e: 4eb9 0004 a0e4 jsr 4a0e4 <_CORE_mutex_Seize_interrupt_trylock> 45a64: 508f addql #8,%sp 45a66: 4a80 tstl %d0 45a68: 6750 beqs 45aba <_CORE_mutex_Seize+0x9a> 45a6a: 4a02 tstb %d2 45a6c: 6614 bnes 45a82 <_CORE_mutex_Seize+0x62> 45a6e: 202e 0018 movel %fp@(24),%d0 45a72: 46c0 movew %d0,%sr 45a74: 2079 0005 cdc2 moveal 5cdc2 <_Thread_Executing>,%a0 45a7a: 7001 moveq #1,%d0 45a7c: 2140 0034 movel %d0,%a0@(52) 45a80: 6038 bras 45aba <_CORE_mutex_Seize+0x9a> 45a82: 2039 0005 cd08 movel 5cd08 <_Thread_Dispatch_disable_level>,%d0 45a88: 5280 addql #1,%d0 45a8a: 2079 0005 cdc2 moveal 5cdc2 <_Thread_Executing>,%a0 45a90: 216e 000c 0020 movel %fp@(12),%a0@(32) 45a96: 23c0 0005 cd08 movel %d0,5cd08 <_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; 45a9c: 7001 moveq #1,%d0 45a9e: 214a 0044 movel %a2,%a0@(68) 45aa2: 2540 0030 movel %d0,%a2@(48) 45aa6: 202e 0018 movel %fp@(24),%d0 45aaa: 46c0 movew %d0,%sr 45aac: 2f2e 0014 movel %fp@(20),%sp@- 45ab0: 2f0a movel %a2,%sp@- 45ab2: 4eb9 0004 59bc jsr 459bc <_CORE_mutex_Seize_interrupt_blocking> 45ab8: 508f addql #8,%sp } 45aba: 242e fff8 movel %fp@(-8),%d2 45abe: 246e fffc moveal %fp@(-4),%a2 45ac2: 4e5e unlk %fp ... 00045c14 <_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 ) { 45c14: 4e56 0000 linkw %fp,#0 45c18: 2f0a movel %a2,%sp@- 45c1a: 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)) ) { 45c1e: 2f0a movel %a2,%sp@- 45c20: 4eb9 0004 703c jsr 4703c <_Thread_queue_Dequeue> 45c26: 588f addql #4,%sp 45c28: 4a80 tstl %d0 45c2a: 6704 beqs 45c30 <_CORE_semaphore_Surrender+0x1c> 45c2c: 4280 clrl %d0 45c2e: 6024 bras 45c54 <_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 ); 45c30: 203c 0000 0700 movel #1792,%d0 45c36: 40c1 movew %sr,%d1 45c38: 8081 orl %d1,%d0 45c3a: 46c0 movew %d0,%sr if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 45c3c: 202a 0048 movel %a2@(72),%d0 45c40: b0aa 0040 cmpl %a2@(64),%d0 45c44: 6504 bcss 45c4a <_CORE_semaphore_Surrender+0x36> <== ALWAYS TAKEN 45c46: 7004 moveq #4,%d0 <== NOT EXECUTED 45c48: 6008 bras 45c52 <_CORE_semaphore_Surrender+0x3e> <== NOT EXECUTED the_semaphore->count += 1; 45c4a: 5280 addql #1,%d0 45c4c: 2540 0048 movel %d0,%a2@(72) 45c50: 4280 clrl %d0 else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); 45c52: 46c1 movew %d1,%sr } return status; } 45c54: 246e fffc moveal %fp@(-4),%a2 45c58: 4e5e unlk %fp <== NOT EXECUTED 000449d8 <_Event_Seize>: executing = _Thread_Executing; executing->Wait.return_code = RTEMS_SUCCESSFUL; api = executing->API_Extensions[ THREAD_API_RTEMS ]; _ISR_Disable( level ); 449d8: 203c 0000 0700 movel #1792,%d0 rtems_event_set event_in, rtems_option option_set, rtems_interval ticks, rtems_event_set *event_out ) { 449de: 4e56 ffec linkw %fp,#-20 449e2: 226e 0010 moveal %fp@(16),%a1 449e6: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ rtems_event_set pending_events; ISR_Level level; RTEMS_API_Control *api; Thread_blocking_operation_States sync_state; executing = _Thread_Executing; 449ea: 2479 0005 cdc2 moveal 5cdc2 <_Thread_Executing>,%a2 rtems_event_set event_in, rtems_option option_set, rtems_interval ticks, rtems_event_set *event_out ) { 449f0: 242e 0008 movel %fp@(8),%d2 449f4: 262e 000c movel %fp@(12),%d3 ISR_Level level; RTEMS_API_Control *api; Thread_blocking_operation_States sync_state; executing = _Thread_Executing; executing->Wait.return_code = RTEMS_SUCCESSFUL; 449f8: 42aa 0034 clrl %a2@(52) rtems_event_set event_in, rtems_option option_set, rtems_interval ticks, rtems_event_set *event_out ) { 449fc: 206e 0014 moveal %fp@(20),%a0 Thread_blocking_operation_States sync_state; executing = _Thread_Executing; executing->Wait.return_code = RTEMS_SUCCESSFUL; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 44a00: 266a 010a moveal %a2@(266),%a3 _ISR_Disable( level ); 44a04: 40c1 movew %sr,%d1 44a06: 8081 orl %d1,%d0 44a08: 46c0 movew %d0,%sr pending_events = api->pending_events; 44a0a: 2813 movel %a3@,%d4 RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Get( rtems_event_set the_event_set, rtems_event_set the_event_condition ) { return ( the_event_set & the_event_condition ); 44a0c: 2002 movel %d2,%d0 44a0e: c084 andl %d4,%d0 seized_events = _Event_sets_Get( pending_events, event_in ); if ( !_Event_sets_Is_empty( seized_events ) && 44a10: 6716 beqs 44a28 <_Event_Seize+0x50> 44a12: b480 cmpl %d0,%d2 44a14: 6706 beqs 44a1c <_Event_Seize+0x44> 44a16: 0803 0001 btst #1,%d3 44a1a: 670c beqs 44a28 <_Event_Seize+0x50> <== NEVER TAKEN (seized_events == event_in || _Options_Is_any( option_set )) ) { api->pending_events = 44a1c: 2400 movel %d0,%d2 44a1e: 4682 notl %d2 44a20: c484 andl %d4,%d2 44a22: 2682 movel %d2,%a3@ _Event_sets_Clear( pending_events, seized_events ); _ISR_Enable( level ); 44a24: 46c1 movew %d1,%sr 44a26: 600e bras 44a36 <_Event_Seize+0x5e> *event_out = seized_events; return; } if ( _Options_Is_no_wait( option_set ) ) { 44a28: 0803 0000 btst #0,%d3 44a2c: 670e beqs 44a3c <_Event_Seize+0x64> _ISR_Enable( level ); 44a2e: 46c1 movew %d1,%sr executing->Wait.return_code = RTEMS_UNSATISFIED; 44a30: 720d moveq #13,%d1 44a32: 2541 0034 movel %d1,%a2@(52) *event_out = seized_events; 44a36: 2080 movel %d0,%a0@ return; 44a38: 6000 0096 braw 44ad0 <_Event_Seize+0xf8> * * NOTE: Since interrupts are disabled, this isn't that much of an * issue but better safe than sorry. */ executing->Wait.option = (uint32_t) option_set; executing->Wait.count = (uint32_t) event_in; 44a3c: 2542 0024 movel %d2,%a2@(36) executing->Wait.return_argument = event_out; _Event_Sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 44a40: 7401 moveq #1,%d2 * set properly when we are marked as in the event critical section. * * NOTE: Since interrupts are disabled, this isn't that much of an * issue but better safe than sorry. */ executing->Wait.option = (uint32_t) option_set; 44a42: 2543 0030 movel %d3,%a2@(48) executing->Wait.count = (uint32_t) event_in; executing->Wait.return_argument = event_out; 44a46: 2548 0028 movel %a0,%a2@(40) _Event_Sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 44a4a: 23c2 0005 d556 movel %d2,5d556 <_Event_Sync_state> _ISR_Enable( level ); 44a50: 46c1 movew %d1,%sr if ( ticks ) { 44a52: 4a89 tstl %a1 44a54: 6730 beqs 44a86 <_Event_Seize+0xae> _Watchdog_Initialize( 44a56: 202a 0008 movel %a2@(8),%d0 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 44a5a: 223c 0004 4c38 movel #281656,%d1 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 44a60: 2549 0054 movel %a1,%a2@(84) Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 44a64: 2541 0064 movel %d1,%a2@(100) the_watchdog->id = id; 44a68: 2540 0068 movel %d0,%a2@(104) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 44a6c: 42aa 0050 clrl %a2@(80) the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 44a70: 42aa 006c clrl %a2@(108) ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 44a74: 486a 0048 pea %a2@(72) 44a78: 4879 0005 cde0 pea 5cde0 <_Watchdog_Ticks_chain> 44a7e: 4eb9 0004 7c50 jsr 47c50 <_Watchdog_Insert> 44a84: 508f addql #8,%sp NULL ); _Watchdog_Insert_ticks( &executing->Timer, ticks ); } _Thread_Set_state( executing, STATES_WAITING_FOR_EVENT ); 44a86: 4878 0100 pea 100 44a8a: 2f0a movel %a2,%sp@- 44a8c: 4eb9 0004 7510 jsr 47510 <_Thread_Set_state> _ISR_Disable( level ); 44a92: 203c 0000 0700 movel #1792,%d0 44a98: 40c1 movew %sr,%d1 44a9a: 8081 orl %d1,%d0 44a9c: 46c0 movew %d0,%sr sync_state = _Event_Sync_state; _Event_Sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) { 44a9e: 7401 moveq #1,%d2 44aa0: 508f addql #8,%sp _Thread_Set_state( executing, STATES_WAITING_FOR_EVENT ); _ISR_Disable( level ); sync_state = _Event_Sync_state; 44aa2: 2039 0005 d556 movel 5d556 <_Event_Sync_state>,%d0 _Event_Sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 44aa8: 42b9 0005 d556 clrl 5d556 <_Event_Sync_state> if ( sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) { 44aae: b480 cmpl %d0,%d2 44ab0: 6604 bnes 44ab6 <_Event_Seize+0xde> _ISR_Enable( level ); 44ab2: 46c1 movew %d1,%sr 44ab4: 601a bras 44ad0 <_Event_Seize+0xf8> * An interrupt completed the thread's blocking request. * The blocking thread was satisfied by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ _Thread_blocking_operation_Cancel( sync_state, executing, level ); 44ab6: 2d4a 000c movel %a2,%fp@(12) 44aba: 2d41 0010 movel %d1,%fp@(16) } 44abe: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 * An interrupt completed the thread's blocking request. * The blocking thread was satisfied by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ _Thread_blocking_operation_Cancel( sync_state, executing, level ); 44ac4: 2d40 0008 movel %d0,%fp@(8) } 44ac8: 4e5e unlk %fp * An interrupt completed the thread's blocking request. * The blocking thread was satisfied by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ _Thread_blocking_operation_Cancel( sync_state, executing, level ); 44aca: 4ef9 0004 6798 jmp 46798 <_Thread_blocking_operation_Cancel> } 44ad0: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 44ad6: 4e5e unlk %fp ... 00044b30 <_Event_Surrender>: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; option_set = (rtems_option) the_thread->Wait.option; _ISR_Disable( level ); 44b30: 203c 0000 0700 movel #1792,%d0 */ void _Event_Surrender( Thread_Control *the_thread ) { 44b36: 4e56 ffe8 linkw %fp,#-24 44b3a: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@ 44b3e: 246e 0008 moveal %fp@(8),%a2 rtems_event_set event_condition; rtems_event_set seized_events; rtems_option option_set; RTEMS_API_Control *api; api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; 44b42: 206a 010a moveal %a2@(266),%a0 option_set = (rtems_option) the_thread->Wait.option; 44b46: 282a 0030 movel %a2@(48),%d4 _ISR_Disable( level ); 44b4a: 40c1 movew %sr,%d1 44b4c: 8081 orl %d1,%d0 44b4e: 46c0 movew %d0,%sr pending_events = api->pending_events; event_condition = (rtems_event_set) the_thread->Wait.count; 44b50: 262a 0024 movel %a2@(36),%d3 RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Get( rtems_event_set the_event_set, rtems_event_set the_event_condition ) { return ( the_event_set & the_event_condition ); 44b54: 2003 movel %d3,%d0 api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; option_set = (rtems_option) the_thread->Wait.option; _ISR_Disable( level ); pending_events = api->pending_events; 44b56: 2410 movel %a0@,%d2 44b58: c082 andl %d2,%d0 seized_events = _Event_sets_Get( pending_events, event_condition ); /* * No events were seized in this operation */ if ( _Event_sets_Is_empty( seized_events ) ) { 44b5a: 6606 bnes 44b62 <_Event_Surrender+0x32> _ISR_Enable( level ); 44b5c: 46c1 movew %d1,%sr return; 44b5e: 6000 00cc braw 44c2c <_Event_Surrender+0xfc> /* * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && 44b62: 2279 0005 cda2 moveal 5cda2 <_ISR_Nest_level>,%a1 44b68: 4a89 tstl %a1 44b6a: 674a beqs 44bb6 <_Event_Surrender+0x86> 44b6c: b5f9 0005 cdc2 cmpal 5cdc2 <_Thread_Executing>,%a2 44b72: 6642 bnes 44bb6 <_Event_Surrender+0x86> _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 44b74: 2279 0005 d556 moveal 5d556 <_Event_Sync_state>,%a1 /* * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && 44b7a: 7a02 moveq #2,%d5 44b7c: ba89 cmpl %a1,%d5 44b7e: 670e beqs 44b8e <_Event_Surrender+0x5e> <== NEVER TAKEN _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { 44b80: 2279 0005 d556 moveal 5d556 <_Event_Sync_state>,%a1 /* * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && 44b86: 1a3c 0001 moveb #1,%d5 44b8a: ba89 cmpl %a1,%d5 44b8c: 6628 bnes 44bb6 <_Event_Surrender+0x86> _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { 44b8e: b680 cmpl %d0,%d3 44b90: 6706 beqs 44b98 <_Event_Surrender+0x68> 44b92: 0804 0001 btst #1,%d4 44b96: 671a beqs 44bb2 <_Event_Surrender+0x82> <== NEVER TAKEN api->pending_events = _Event_sets_Clear( pending_events,seized_events ); 44b98: 2600 movel %d0,%d3 44b9a: 4683 notl %d3 44b9c: c682 andl %d2,%d3 44b9e: 2083 movel %d3,%a0@ the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 44ba0: 206a 0028 moveal %a2@(40),%a0 _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { api->pending_events = _Event_sets_Clear( pending_events,seized_events ); the_thread->Wait.count = 0; 44ba4: 42aa 0024 clrl %a2@(36) *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 44ba8: 2080 movel %d0,%a0@ _Event_Sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 44baa: 7003 moveq #3,%d0 44bac: 23c0 0005 d556 movel %d0,5d556 <_Event_Sync_state> } _ISR_Enable( level ); 44bb2: 46c1 movew %d1,%sr return; 44bb4: 6076 bras 44c2c <_Event_Surrender+0xfc> } /* * Otherwise, this is a normal send to another thread */ if ( _States_Is_waiting_for_event( the_thread->current_state ) ) { 44bb6: 2a2a 0010 movel %a2@(16),%d5 44bba: 0285 0000 0100 andil #256,%d5 44bc0: 6768 beqs 44c2a <_Event_Surrender+0xfa> if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { 44bc2: b680 cmpl %d0,%d3 44bc4: 6706 beqs 44bcc <_Event_Surrender+0x9c> 44bc6: 0804 0001 btst #1,%d4 44bca: 675e beqs 44c2a <_Event_Surrender+0xfa> <== NEVER TAKEN api->pending_events = _Event_sets_Clear( pending_events, seized_events ); 44bcc: 2600 movel %d0,%d3 44bce: 4683 notl %d3 44bd0: c682 andl %d2,%d3 44bd2: 2083 movel %d3,%a0@ the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 44bd4: 206a 0028 moveal %a2@(40),%a0 * Otherwise, this is a normal send to another thread */ if ( _States_Is_waiting_for_event( the_thread->current_state ) ) { if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { api->pending_events = _Event_sets_Clear( pending_events, seized_events ); the_thread->Wait.count = 0; 44bd8: 42aa 0024 clrl %a2@(36) *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 44bdc: 2080 movel %d0,%a0@ _ISR_Flash( level ); 44bde: 203c 0000 0700 movel #1792,%d0 44be4: 46c1 movew %d1,%sr 44be6: 8081 orl %d1,%d0 44be8: 46c0 movew %d0,%sr 44bea: 47f9 0004 6928 lea 46928 <_Thread_Clear_state>,%a3 if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 44bf0: 7a02 moveq #2,%d5 44bf2: baaa 0050 cmpl %a2@(80),%d5 44bf6: 6710 beqs 44c08 <_Event_Surrender+0xd8> _ISR_Enable( level ); 44bf8: 46c1 movew %d1,%sr RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 44bfa: 2f3c 1003 fff8 movel #268697592,%sp@- 44c00: 2f0a movel %a2,%sp@- 44c02: 4e93 jsr %a3@ 44c04: 508f addql #8,%sp 44c06: 6024 bras 44c2c <_Event_Surrender+0xfc> RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 44c08: 7003 moveq #3,%d0 44c0a: 2540 0050 movel %d0,%a2@(80) _Thread_Unblock( the_thread ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 44c0e: 46c1 movew %d1,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 44c10: 486a 0048 pea %a2@(72) 44c14: 4eb9 0004 7d6c jsr 47d6c <_Watchdog_Remove> 44c1a: 2f3c 1003 fff8 movel #268697592,%sp@- 44c20: 2f0a movel %a2,%sp@- 44c22: 4e93 jsr %a3@ 44c24: 4fef 000c lea %sp@(12),%sp 44c28: 6002 bras 44c2c <_Event_Surrender+0xfc> _Thread_Unblock( the_thread ); } return; } } _ISR_Enable( level ); 44c2a: 46c1 movew %d1,%sr } 44c2c: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 44c32: 4e5e unlk %fp ... 00044c38 <_Event_Timeout>: void _Event_Timeout( Objects_Id id, void *ignored ) { 44c38: 4e56 fffc linkw %fp,#-4 44c3c: 2f03 movel %d3,%sp@- 44c3e: 2f02 movel %d2,%sp@- Thread_Control *the_thread; Objects_Locations location; ISR_Level level; the_thread = _Thread_Get( id, &location ); 44c40: 486e fffc pea %fp@(-4) 44c44: 2f2e 0008 movel %fp@(8),%sp@- 44c48: 4eb9 0004 6d08 jsr 46d08 <_Thread_Get> switch ( location ) { 44c4e: 508f addql #8,%sp 44c50: 4aae fffc tstl %fp@(-4) 44c54: 6656 bnes 44cac <_Event_Timeout+0x74> <== NEVER TAKEN * * If it is not satisfied, then it is "nothing happened" and * this is the "timeout" transition. After a request is satisfied, * a timeout is not allowed to occur. */ _ISR_Disable( level ); 44c56: 223c 0000 0700 movel #1792,%d1 44c5c: 40c2 movew %sr,%d2 44c5e: 8282 orl %d2,%d1 44c60: 46c1 movew %d1,%sr _ISR_Enable( level ); return; } #endif the_thread->Wait.count = 0; 44c62: 2040 moveal %d0,%a0 44c64: 42a8 0024 clrl %a0@(36) if ( _Thread_Is_executing( the_thread ) ) { 44c68: b0b9 0005 cdc2 cmpl 5cdc2 <_Thread_Executing>,%d0 44c6e: 6614 bnes 44c84 <_Event_Timeout+0x4c> if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 44c70: 2239 0005 d556 movel 5d556 <_Event_Sync_state>,%d1 44c76: 7601 moveq #1,%d3 44c78: b681 cmpl %d1,%d3 44c7a: 6608 bnes 44c84 <_Event_Timeout+0x4c> _Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 44c7c: 7202 moveq #2,%d1 44c7e: 23c1 0005 d556 movel %d1,5d556 <_Event_Sync_state> } the_thread->Wait.return_code = RTEMS_TIMEOUT; 44c84: 7606 moveq #6,%d3 44c86: 2040 moveal %d0,%a0 44c88: 2143 0034 movel %d3,%a0@(52) _ISR_Enable( level ); 44c8c: 46c2 movew %d2,%sr 44c8e: 2f3c 1003 fff8 movel #268697592,%sp@- 44c94: 2f00 movel %d0,%sp@- 44c96: 4eb9 0004 6928 jsr 46928 <_Thread_Clear_state> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 44c9c: 508f addql #8,%sp 44c9e: 2039 0005 cd08 movel 5cd08 <_Thread_Dispatch_disable_level>,%d0 44ca4: 5380 subql #1,%d0 44ca6: 23c0 0005 cd08 movel %d0,5cd08 <_Thread_Dispatch_disable_level> case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 44cac: 242e fff4 movel %fp@(-12),%d2 44cb0: 262e fff8 movel %fp@(-8),%d3 44cb4: 4e5e unlk %fp <== NOT EXECUTED 0004a2b0 <_Heap_Allocate_aligned_with_boundary>: Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 4a2b0: 4e56 ffc8 linkw %fp,#-56 4a2b4: 202e 000c movel %fp@(12),%d0 4a2b8: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 4a2bc: 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; 4a2c0: 2840 moveal %d0,%a4 4a2c2: 588c addql #4,%a4 Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 4a2c4: 222e 0010 movel %fp@(16),%d1 4a2c8: 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; 4a2cc: 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; 4a2d0: 2e2a 0010 movel %a2@(16),%d7 uintptr_t alloc_begin = 0; uint32_t search_count = 0; if ( block_size_floor < alloc_size ) { 4a2d4: b08c cmpl %a4,%d0 4a2d6: 6200 0120 bhiw 4a3f8 <_Heap_Allocate_aligned_with_boundary+0x148> /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { 4a2da: 4a85 tstl %d5 4a2dc: 670c beqs 4a2ea <_Heap_Allocate_aligned_with_boundary+0x3a> if ( boundary < alloc_size ) { 4a2de: b085 cmpl %d5,%d0 4a2e0: 6200 0116 bhiw 4a3f8 <_Heap_Allocate_aligned_with_boundary+0x148> return NULL; } if ( alignment == 0 ) { 4a2e4: 4a81 tstl %d1 4a2e6: 6602 bnes 4a2ea <_Heap_Allocate_aligned_with_boundary+0x3a> 4a2e8: 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; 4a2ea: 2407 movel %d7,%d2 4a2ec: 5e82 addql #7,%d2 if ( boundary != 0 ) { if ( boundary < alloc_size ) { return NULL; } if ( alignment == 0 ) { 4a2ee: 4283 clrl %d3 4a2f0: 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; 4a2f2: 2d42 fff8 movel %d2,%fp@(-8) uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; 4a2f6: 7404 moveq #4,%d2 4a2f8: 9480 subl %d0,%d2 4a2fa: 2d42 fff4 movel %d2,%fp@(-12) 4a2fe: 6000 00c6 braw 4a3c6 <_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 ) { 4a302: 2628 0004 movel %a0@(4),%d3 while ( block != free_list_tail ) { _HAssert( _Heap_Is_prev_used( block ) ); /* Statistics */ ++search_count; 4a306: 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 ) { 4a308: b9c3 cmpal %d3,%a4 4a30a: 6400 00b6 bccw 4a3c2 <_Heap_Allocate_aligned_with_boundary+0x112> 4a30e: 43e8 0008 lea %a0@(8),%a1 if ( alignment == 0 ) { 4a312: 4a81 tstl %d1 4a314: 6606 bnes 4a31c <_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; 4a316: 2409 movel %a1,%d2 4a318: 6000 00a4 braw 4a3be <_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; 4a31c: 74fe moveq #-2,%d2 4a31e: 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; 4a320: 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; 4a324: 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; 4a326: 282e fff8 movel %fp@(-8),%d4 4a32a: 988b subl %a3,%d4 uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; 4a32c: 242e fff4 movel %fp@(-12),%d2 4a330: d483 addl %d3,%d2 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4a332: 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; 4a334: d684 addl %d4,%d3 4a336: 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; 4a33a: 2d4b fff0 movel %a3,%fp@(-16) 4a33e: 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 ) { 4a340: b682 cmpl %d2,%d3 4a342: 640a bccs 4a34e <_Heap_Allocate_aligned_with_boundary+0x9e> 4a344: 2803 movel %d3,%d4 4a346: 4c41 4002 remul %d1,%d2,%d4 4a34a: 9682 subl %d2,%d3 4a34c: 2403 movel %d3,%d2 } alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { 4a34e: 4a85 tstl %d5 4a350: 674e beqs 4a3a0 <_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; 4a352: 2802 movel %d2,%d4 4a354: d880 addl %d0,%d4 4a356: 2604 movel %d4,%d3 /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; 4a358: 47f1 0800 lea %a1@(00000000,%d0:l),%a3 4a35c: 4c45 3006 remul %d5,%d6,%d3 4a360: 2d4b fffc movel %a3,%fp@(-4) 4a364: 2604 movel %d4,%d3 4a366: 9686 subl %d6,%d3 4a368: 2c03 movel %d3,%d6 4a36a: 266e fff0 moveal %fp@(-16),%a3 4a36e: 6020 bras 4a390 <_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 ) { 4a370: bcae fffc cmpl %fp@(-4),%d6 4a374: 654c bcss 4a3c2 <_Heap_Allocate_aligned_with_boundary+0x112> 4a376: 2803 movel %d3,%d4 4a378: 4c41 4002 remul %d1,%d2,%d4 4a37c: 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; 4a37e: 2803 movel %d3,%d4 4a380: d880 addl %d0,%d4 4a382: 2403 movel %d3,%d2 4a384: 2604 movel %d4,%d3 4a386: 4c45 3006 remul %d5,%d6,%d3 4a38a: 2604 movel %d4,%d3 4a38c: 9686 subl %d6,%d3 4a38e: 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; 4a390: 2606 movel %d6,%d3 4a392: 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 ) { 4a394: bc82 cmpl %d2,%d6 4a396: 6304 blss 4a39c <_Heap_Allocate_aligned_with_boundary+0xec> 4a398: b886 cmpl %d6,%d4 4a39a: 62d4 bhis 4a370 <_Heap_Allocate_aligned_with_boundary+0xc0> 4a39c: 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 ) { 4a3a0: b3c2 cmpal %d2,%a1 4a3a2: 621e bhis 4a3c2 <_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; 4a3a4: 2802 movel %d2,%d4 4a3a6: 327c fff8 moveaw #-8,%a1 4a3aa: 93c8 subal %a0,%a1 4a3ac: d3c2 addal %d2,%a1 4a3ae: 4c47 4003 remul %d7,%d3,%d4 4a3b2: 93c3 subal %d3,%a1 if ( free_size >= min_block_size || free_size == 0 ) { 4a3b4: b3ee fff0 cmpal %fp@(-16),%a1 4a3b8: 6404 bccs 4a3be <_Heap_Allocate_aligned_with_boundary+0x10e> 4a3ba: 4a89 tstl %a1 4a3bc: 6604 bnes 4a3c2 <_Heap_Allocate_aligned_with_boundary+0x112> boundary ); } } if ( alloc_begin != 0 ) { 4a3be: 4a82 tstl %d2 4a3c0: 6610 bnes 4a3d2 <_Heap_Allocate_aligned_with_boundary+0x122><== ALWAYS TAKEN break; } block = block->next; 4a3c2: 2068 0008 moveal %a0@(8),%a0 if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { 4a3c6: b5c8 cmpal %a0,%a2 4a3c8: 6600 ff38 bnew 4a302 <_Heap_Allocate_aligned_with_boundary+0x52> 4a3cc: 260d movel %a5,%d3 4a3ce: 4282 clrl %d2 4a3d0: 6018 bras 4a3ea <_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 ); 4a3d2: 2f00 movel %d0,%sp@- 4a3d4: 260d movel %a5,%d3 block = block->next; } if ( alloc_begin != 0 ) { /* Statistics */ stats->searches += search_count; 4a3d6: d7aa 004c addl %d3,%a2@(76) block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 4a3da: 2f02 movel %d2,%sp@- 4a3dc: 2f08 movel %a0,%sp@- 4a3de: 2f0a movel %a2,%sp@- 4a3e0: 4eb9 0004 5ee2 jsr 45ee2 <_Heap_Block_allocate> 4a3e6: 4fef 0010 lea %sp@(16),%sp uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { Heap_Statistics *const stats = &heap->stats; 4a3ea: b6aa 0044 cmpl %a2@(68),%d3 4a3ee: 6304 blss 4a3f4 <_Heap_Allocate_aligned_with_boundary+0x144> ); } /* Statistics */ if ( stats->max_search < search_count ) { stats->max_search = search_count; 4a3f0: 2543 0044 movel %d3,%a2@(68) } return (void *) alloc_begin; 4a3f4: 2002 movel %d2,%d0 4a3f6: 6002 bras 4a3fa <_Heap_Allocate_aligned_with_boundary+0x14a> 4a3f8: 4280 clrl %d0 } 4a3fa: 4cee 3cfc ffc8 moveml %fp@(-56),%d2-%d7/%a2-%a5 4a400: 4e5e unlk %fp <== NOT EXECUTED 0004e530 <_Heap_Extend>: Heap_Control *heap, void *area_begin_ptr, uintptr_t area_size, uintptr_t *amount_extended ) { 4e530: 4e56 fff4 linkw %fp,#-12 4e534: 206e 0008 moveal %fp@(8),%a0 4e538: 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; 4e53c: 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; 4e540: 2268 0024 moveal %a0@(36),%a1 Heap_Control *heap, void *area_begin_ptr, uintptr_t area_size, uintptr_t *amount_extended ) { 4e544: 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; 4e548: b0a8 0018 cmpl %a0@(24),%d0 4e54c: 6508 bcss 4e556 <_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 ) { 4e54e: b280 cmpl %d0,%d1 4e550: 6304 blss 4e556 <_Heap_Extend+0x26> 4e552: 7001 moveq #1,%d0 4e554: 606c bras 4e5c2 <_Heap_Extend+0x92> return HEAP_EXTEND_ERROR; /* case 3 */ } else if ( area_begin != heap_area_end ) { 4e556: b280 cmpl %d0,%d1 4e558: 6704 beqs 4e55e <_Heap_Extend+0x2e> 4e55a: 7002 moveq #2,%d0 4e55c: 6064 bras 4e5c2 <_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; 4e55e: 2200 movel %d0,%d1 4e560: d2ae 0010 addl %fp@(16),%d1 * block and free it. */ heap->area_end = new_heap_area_end; extend_size = new_heap_area_end 4e564: 70f8 moveq #-8,%d0 4e566: 9089 subl %a1,%d0 4e568: d081 addl %d1,%d0 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4e56a: 2600 movel %d0,%d3 4e56c: 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; 4e572: 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; 4e576: 246e 0014 moveal %fp@(20),%a2 4e57a: 9082 subl %d2,%d0 4e57c: 2480 movel %d0,%a2@ if( extend_size >= heap->min_block_size ) { 4e57e: b0a8 0014 cmpl %a0@(20),%d0 4e582: 653c bcss 4e5c0 <_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; 4e584: 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); 4e586: 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; 4e58a: 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 = 4e58e: 2228 0020 movel %a0@(32),%d1 4e592: 928a subl %a2,%d1 4e594: 8480 orl %d0,%d2 ((uintptr_t) heap->first_block - (uintptr_t) new_last_block) | HEAP_PREV_BLOCK_USED; heap->last_block = new_last_block; 4e596: 214a 0024 movel %a2,%a0@(36) 4e59a: 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 = 4e59e: 7401 moveq #1,%d2 4e5a0: 8481 orl %d1,%d2 4e5a2: 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 )); 4e5a6: 4869 0008 pea %a1@(8) | HEAP_PREV_BLOCK_USED; heap->last_block = new_last_block; /* Statistics */ stats->size += extend_size; 4e5aa: d1a8 002c addl %d0,%a0@(44) ++stats->used_blocks; 4e5ae: 52a8 0040 addql #1,%a0@(64) --stats->frees; /* Do not count subsequent call as actual free() */ 4e5b2: 53a8 0050 subql #1,%a0@(80) _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( last_block )); 4e5b6: 2f08 movel %a0,%sp@- 4e5b8: 4eb9 0004 9978 jsr 49978 <_Heap_Free> 4e5be: 508f addql #8,%sp 4e5c0: 4280 clrl %d0 } return HEAP_EXTEND_SUCCESSFUL; } 4e5c2: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 4e5c8: 4e5e unlk %fp <== NOT EXECUTED 000598a4 <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { 598a4: 4e56 0000 linkw %fp,#0 598a8: 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 ) 598ac: 2040 moveal %d0,%a0 598ae: 5188 subql #8,%a0 598b0: 226e 0008 moveal %fp@(8),%a1 598b4: 2f02 movel %d2,%sp@- 598b6: 2400 movel %d0,%d2 598b8: 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; 598be: 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 ) 598c2: 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 598c4: b488 cmpl %a0,%d2 598c6: 6244 bhis 5990c <_Heap_Size_of_alloc_area+0x68> 598c8: b1e9 0024 cmpal %a1@(36),%a0 598cc: 53c1 sls %d1 598ce: 49c1 extbl %d1 598d0: 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 ) ) { 598d2: 4a01 tstb %d1 598d4: 6736 beqs 5990c <_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); 598d6: 72fe moveq #-2,%d1 598d8: c2a8 0004 andl %a0@(4),%d1 598dc: 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 598de: b488 cmpl %a0,%d2 598e0: 622a bhis 5990c <_Heap_Size_of_alloc_area+0x68> <== NEVER TAKEN 598e2: b1e9 0024 cmpal %a1@(36),%a0 598e6: 53c1 sls %d1 598e8: 49c1 extbl %d1 598ea: 4481 negl %d1 } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( 598ec: 4a01 tstb %d1 598ee: 671c beqs 5990c <_Heap_Size_of_alloc_area+0x68> <== NEVER TAKEN 598f0: 7201 moveq #1,%d1 598f2: c2a8 0004 andl %a0@(4),%d1 598f6: 4a01 tstb %d1 598f8: 6712 beqs 5990c <_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; 598fa: 7204 moveq #4,%d1 598fc: 9280 subl %d0,%d1 598fe: 2001 movel %d1,%d0 59900: d088 addl %a0,%d0 59902: 226e 0010 moveal %fp@(16),%a1 59906: 2280 movel %d0,%a1@ 59908: 7001 moveq #1,%d0 return true; 5990a: 6002 bras 5990e <_Heap_Size_of_alloc_area+0x6a> 5990c: 4200 clrb %d0 } 5990e: 241f movel %sp@+,%d2 59910: 4e5e unlk %fp <== NOT EXECUTED 0004699c <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 4699c: 4e56 ffd0 linkw %fp,#-48 469a0: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 469a4: 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; 469a8: 47fa 031a lea %pc@(46cc4 <_Heap_Walk_print>),%a3 bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 469ac: 242e 000c movel %fp@(12),%d2 uintptr_t const page_size = heap->page_size; 469b0: 2c2c 0010 movel %a4@(16),%d6 uintptr_t const min_block_size = heap->min_block_size; 469b4: 262c 0014 movel %a4@(20),%d3 Heap_Block *const last_block = heap->last_block; 469b8: 2a2c 0024 movel %a4@(36),%d5 Heap_Block *block = heap->first_block; 469bc: 246c 0020 moveal %a4@(32),%a2 Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 469c0: 4a2e 0013 tstb %fp@(19) 469c4: 6604 bnes 469ca <_Heap_Walk+0x2e> 469c6: 47fa ffcc lea %pc@(46994 <_Heap_Walk_print_nothing>),%a3 if ( !_System_state_Is_up( _System_state_Get() ) ) { 469ca: 7003 moveq #3,%d0 469cc: b0b9 0005 f228 cmpl 5f228 <_System_state_Current>,%d0 469d2: 6600 02da bnew 46cae <_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)( 469d6: 2f2c 000c movel %a4@(12),%sp@- 469da: 2f2c 0008 movel %a4@(8),%sp@- 469de: 2f05 movel %d5,%sp@- 469e0: 2f0a movel %a2,%sp@- 469e2: 2f2c 001c movel %a4@(28),%sp@- 469e6: 2f2c 0018 movel %a4@(24),%sp@- 469ea: 2f03 movel %d3,%sp@- 469ec: 2f06 movel %d6,%sp@- 469ee: 4879 0005 b3a2 pea 5b3a2 469f4: 42a7 clrl %sp@- 469f6: 2f02 movel %d2,%sp@- 469f8: 4e93 jsr %a3@ heap->area_begin, heap->area_end, first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { 469fa: 4fef 002c lea %sp@(44),%sp 469fe: 4a86 tstl %d6 46a00: 6608 bnes 46a0a <_Heap_Walk+0x6e> (*printer)( source, true, "page size is zero\n" ); 46a02: 4879 0005 b433 pea 5b433 46a08: 607e bras 46a88 <_Heap_Walk+0xec> return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 46a0a: 7003 moveq #3,%d0 46a0c: c086 andl %d6,%d0 46a0e: 670c beqs 46a1c <_Heap_Walk+0x80> (*printer)( 46a10: 2f06 movel %d6,%sp@- 46a12: 4879 0005 b446 pea 5b446 46a18: 6000 0268 braw 46c82 <_Heap_Walk+0x2e6> ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 46a1c: 2203 movel %d3,%d1 46a1e: 4c46 1000 remul %d6,%d0,%d1 46a22: 4a80 tstl %d0 46a24: 670c beqs 46a32 <_Heap_Walk+0x96> (*printer)( 46a26: 2f03 movel %d3,%sp@- 46a28: 4879 0005 b464 pea 5b464 46a2e: 6000 0252 braw 46c82 <_Heap_Walk+0x2e6> ); return false; } if ( 46a32: 200a movel %a2,%d0 46a34: 5080 addql #8,%d0 46a36: 4c46 0001 remul %d6,%d1,%d0 46a3a: 4a81 tstl %d1 46a3c: 670c beqs 46a4a <_Heap_Walk+0xae> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 46a3e: 2f0a movel %a2,%sp@- 46a40: 4879 0005 b488 pea 5b488 46a46: 6000 023a braw 46c82 <_Heap_Walk+0x2e6> ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 46a4a: 7001 moveq #1,%d0 46a4c: c0aa 0004 andl %a2@(4),%d0 46a50: 4a00 tstb %d0 46a52: 6608 bnes 46a5c <_Heap_Walk+0xc0> (*printer)( 46a54: 4879 0005 b4b9 pea 5b4b9 46a5a: 602c bras 46a88 <_Heap_Walk+0xec> ); return false; } if ( first_block->prev_size != page_size ) { 46a5c: 2812 movel %a2@,%d4 46a5e: bc84 cmpl %d4,%d6 46a60: 670e beqs 46a70 <_Heap_Walk+0xd4> (*printer)( 46a62: 2f06 movel %d6,%sp@- 46a64: 2f04 movel %d4,%sp@- 46a66: 4879 0005 b4e7 pea 5b4e7 46a6c: 6000 0150 braw 46bbe <_Heap_Walk+0x222> ); return false; } if ( _Heap_Is_free( last_block ) ) { 46a70: 2045 moveal %d5,%a0 46a72: 70fe moveq #-2,%d0 46a74: 7201 moveq #1,%d1 46a76: c0a8 0004 andl %a0@(4),%d0 46a7a: c2b0 0804 andl %a0@(00000004,%d0:l),%d1 46a7e: 4a01 tstb %d1 46a80: 6616 bnes 46a98 <_Heap_Walk+0xfc> (*printer)( 46a82: 4879 0005 b512 pea 5b512 46a88: 4878 0001 pea 1 46a8c: 2f02 movel %d2,%sp@- 46a8e: 4e93 jsr %a3@ 46a90: 4fef 000c lea %sp@(12),%sp 46a94: 6000 01f8 braw 46c8e <_Heap_Walk+0x2f2> int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 46a98: 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; 46a9c: 220c movel %a4,%d1 46a9e: 206c 0008 moveal %a4@(8),%a0 46aa2: 606a bras 46b0e <_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 46aa4: b1ec 0020 cmpal %a4@(32),%a0 46aa8: 650e bcss 46ab8 <_Heap_Walk+0x11c> 46aaa: b1ec 0024 cmpal %a4@(36),%a0 46aae: 53c0 sls %d0 46ab0: 49c0 extbl %d0 46ab2: 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 ) ) { 46ab4: 4a00 tstb %d0 46ab6: 660c bnes 46ac4 <_Heap_Walk+0x128> <== ALWAYS TAKEN (*printer)( 46ab8: 2f08 movel %a0,%sp@- 46aba: 4879 0005 b527 pea 5b527 46ac0: 6000 01c0 braw 46c82 <_Heap_Walk+0x2e6> ); return false; } if ( 46ac4: 4c46 7000 remul %d6,%d0,%d7 46ac8: 4a80 tstl %d0 46aca: 670c beqs 46ad8 <_Heap_Walk+0x13c> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 46acc: 2f08 movel %a0,%sp@- 46ace: 4879 0005 b547 pea 5b547 46ad4: 6000 01ac braw 46c82 <_Heap_Walk+0x2e6> ); return false; } if ( _Heap_Is_used( free_block ) ) { 46ad8: 70fe moveq #-2,%d0 46ada: 7e01 moveq #1,%d7 46adc: c0a8 0004 andl %a0@(4),%d0 46ae0: ceb0 0804 andl %a0@(00000004,%d0:l),%d7 46ae4: 670c beqs 46af2 <_Heap_Walk+0x156> (*printer)( 46ae6: 2f08 movel %a0,%sp@- 46ae8: 4879 0005 b577 pea 5b577 46aee: 6000 0192 braw 46c82 <_Heap_Walk+0x2e6> ); return false; } if ( free_block->prev != prev_block ) { 46af2: 2028 000c movel %a0@(12),%d0 46af6: b280 cmpl %d0,%d1 46af8: 670e beqs 46b08 <_Heap_Walk+0x16c> (*printer)( 46afa: 2f00 movel %d0,%sp@- 46afc: 2f08 movel %a0,%sp@- 46afe: 4879 0005 b593 pea 5b593 46b04: 6000 00b8 braw 46bbe <_Heap_Walk+0x222> return false; } prev_block = free_block; free_block = free_block->next; 46b08: 2208 movel %a0,%d1 46b0a: 2068 0008 moveal %a0@(8),%a0 ); return false; } if ( 46b0e: 2e08 movel %a0,%d7 46b10: 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 ) { 46b12: b9c8 cmpal %a0,%a4 46b14: 668e bnes 46aa4 <_Heap_Walk+0x108> 46b16: 6000 0190 braw 46ca8 <_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; 46b1a: 202a 0004 movel %a2@(4),%d0 46b1e: 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 ) { 46b20: 7201 moveq #1,%d1 46b22: cc80 andl %d0,%d6 46b24: 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); 46b26: 4bf2 6800 lea %a2@(00000000,%d6:l),%a5 46b2a: 4a00 tstb %d0 46b2c: 6716 beqs 46b44 <_Heap_Walk+0x1a8> (*printer)( 46b2e: 2f06 movel %d6,%sp@- 46b30: 2f0a movel %a2,%sp@- 46b32: 4879 0005 b5c5 pea 5b5c5 46b38: 42a7 clrl %sp@- 46b3a: 2f02 movel %d2,%sp@- 46b3c: 4e93 jsr %a3@ 46b3e: 4fef 0014 lea %sp@(20),%sp 46b42: 6016 bras 46b5a <_Heap_Walk+0x1be> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 46b44: 2f12 movel %a2@,%sp@- 46b46: 2f06 movel %d6,%sp@- 46b48: 2f0a movel %a2,%sp@- 46b4a: 4879 0005 b5dc pea 5b5dc 46b50: 42a7 clrl %sp@- 46b52: 2f02 movel %d2,%sp@- 46b54: 4e93 jsr %a3@ 46b56: 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 46b5a: bbec 0020 cmpal %a4@(32),%a5 46b5e: 650e bcss 46b6e <_Heap_Walk+0x1d2> <== NEVER TAKEN 46b60: bbec 0024 cmpal %a4@(36),%a5 46b64: 53c0 sls %d0 46b66: 49c0 extbl %d0 46b68: 4480 negl %d0 block_size, block->prev_size ); } if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 46b6a: 4a00 tstb %d0 46b6c: 660c bnes 46b7a <_Heap_Walk+0x1de> (*printer)( 46b6e: 2f0d movel %a5,%sp@- 46b70: 2f0a movel %a2,%sp@- 46b72: 4879 0005 b601 pea 5b601 46b78: 6044 bras 46bbe <_Heap_Walk+0x222> ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) ) { 46b7a: 2206 movel %d6,%d1 46b7c: 4c44 1000 remul %d4,%d0,%d1 46b80: 4a80 tstl %d0 46b82: 670c beqs 46b90 <_Heap_Walk+0x1f4> (*printer)( 46b84: 2f06 movel %d6,%sp@- 46b86: 2f0a movel %a2,%sp@- 46b88: 4879 0005 b62e pea 5b62e 46b8e: 602e bras 46bbe <_Heap_Walk+0x222> ); return false; } if ( block_size < min_block_size ) { 46b90: b686 cmpl %d6,%d3 46b92: 631c blss 46bb0 <_Heap_Walk+0x214> (*printer)( 46b94: 2f03 movel %d3,%sp@- 46b96: 2f06 movel %d6,%sp@- 46b98: 2f0a movel %a2,%sp@- 46b9a: 4879 0005 b65c pea 5b65c 46ba0: 4878 0001 pea 1 46ba4: 2f02 movel %d2,%sp@- 46ba6: 4e93 jsr %a3@ block, block_size, min_block_size ); return false; 46ba8: 4fef 0018 lea %sp@(24),%sp 46bac: 6000 00e0 braw 46c8e <_Heap_Walk+0x2f2> } if ( next_block_begin <= block_begin ) { 46bb0: b5cd cmpal %a5,%a2 46bb2: 651a bcss 46bce <_Heap_Walk+0x232> (*printer)( 46bb4: 2f0d movel %a5,%sp@- 46bb6: 2f0a movel %a2,%sp@- 46bb8: 4879 0005 b687 pea 5b687 46bbe: 4878 0001 pea 1 46bc2: 2f02 movel %d2,%sp@- 46bc4: 4e93 jsr %a3@ "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 46bc6: 4fef 0014 lea %sp@(20),%sp 46bca: 6000 00c2 braw 46c8e <_Heap_Walk+0x2f2> } if ( !_Heap_Is_prev_used( next_block ) ) { 46bce: 7001 moveq #1,%d0 46bd0: c0ad 0004 andl %a5@(4),%d0 46bd4: 4a00 tstb %d0 46bd6: 6600 00ce bnew 46ca6 <_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; 46bda: 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; 46bde: 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; 46be0: 43f9 0005 b6bb lea 5b6bb ,%a1 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 46be6: 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; 46bea: 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; 46bec: 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); 46bf0: 2e0a movel %a2,%d7 46bf2: 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; 46bf4: 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)( 46bf8: 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; 46bfc: b1ec 000c cmpal %a4@(12),%a0 46c00: 6710 beqs 46c12 <_Heap_Walk+0x276> " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") 46c02: 43f9 0005 b6c5 lea 5b6c5 ,%a1 46c08: b9c8 cmpal %a0,%a4 46c0a: 6706 beqs 46c12 <_Heap_Walk+0x276> 46c0c: 43f9 0005 b2f2 lea 5b2f2 ,%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)( 46c12: 202a 000c movel %a2@(12),%d0 46c16: 223c 0005 b6cf movel #374479,%d1 46c1c: b0ae fff8 cmpl %fp@(-8),%d0 46c20: 6710 beqs 46c32 <_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)" : ""), 46c22: 223c 0005 b6da movel #374490,%d1 46c28: b9c0 cmpal %d0,%a4 46c2a: 6706 beqs 46c32 <_Heap_Walk+0x296> 46c2c: 223c 0005 b2f2 movel #373490,%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)( 46c32: 2f09 movel %a1,%sp@- 46c34: 2f08 movel %a0,%sp@- 46c36: 2f01 movel %d1,%sp@- 46c38: 2f00 movel %d0,%sp@- 46c3a: 2f0a movel %a2,%sp@- 46c3c: 4879 0005 b6e4 pea 5b6e4 46c42: 42a7 clrl %sp@- 46c44: 2f02 movel %d2,%sp@- 46c46: 4e93 jsr %a3@ block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { 46c48: 4fef 0020 lea %sp@(32),%sp 46c4c: 2047 moveal %d7,%a0 46c4e: 2010 movel %a0@,%d0 46c50: b086 cmpl %d6,%d0 46c52: 671c beqs 46c70 <_Heap_Walk+0x2d4> (*printer)( 46c54: 2f07 movel %d7,%sp@- 46c56: 2f00 movel %d0,%sp@- 46c58: 2f06 movel %d6,%sp@- 46c5a: 2f0a movel %a2,%sp@- 46c5c: 4879 0005 b710 pea 5b710 46c62: 4878 0001 pea 1 46c66: 2f02 movel %d2,%sp@- 46c68: 4e93 jsr %a3@ 46c6a: 4fef 001c lea %sp@(28),%sp 46c6e: 601e bras 46c8e <_Heap_Walk+0x2f2> ); return false; } if ( !prev_used ) { 46c70: 7001 moveq #1,%d0 46c72: c0ae fffc andl %fp@(-4),%d0 46c76: 4a00 tstb %d0 46c78: 6618 bnes 46c92 <_Heap_Walk+0x2f6> (*printer)( 46c7a: 2f0a movel %a2,%sp@- 46c7c: 4879 0005 b749 pea 5b749 46c82: 4878 0001 pea 1 46c86: 2f02 movel %d2,%sp@- 46c88: 4e93 jsr %a3@ 46c8a: 4fef 0010 lea %sp@(16),%sp 46c8e: 4200 clrb %d0 46c90: 601e bras 46cb0 <_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; 46c92: 206c 0008 moveal %a4@(8),%a0 46c96: 6008 bras 46ca0 <_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 ) { 46c98: b5c8 cmpal %a0,%a2 46c9a: 670a beqs 46ca6 <_Heap_Walk+0x30a> return true; } free_block = free_block->next; 46c9c: 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 ) { 46ca0: b9c8 cmpal %a0,%a4 46ca2: 66f4 bnes 46c98 <_Heap_Walk+0x2fc> 46ca4: 6014 bras 46cba <_Heap_Walk+0x31e> 46ca6: 244d moveal %a5,%a2 if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; } while ( block != last_block ) { 46ca8: ba8a cmpl %a2,%d5 46caa: 6600 fe6e bnew 46b1a <_Heap_Walk+0x17e> 46cae: 7001 moveq #1,%d0 block = next_block; } return true; } 46cb0: 4cee 3cfc ffd0 moveml %fp@(-48),%d2-%d7/%a2-%a5 46cb6: 4e5e unlk %fp 46cb8: 4e75 rts return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 46cba: 2f0a movel %a2,%sp@- 46cbc: 4879 0005 b778 pea 5b778 46cc2: 60be bras 46c82 <_Heap_Walk+0x2e6> 00045fd8 <_Internal_error_Occurred>: void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 45fd8: 4e56 0000 linkw %fp,#0 45fdc: 222e 000c movel %fp@(12),%d1 45fe0: 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 ); 45fe2: 4283 clrl %d3 45fe4: 1601 moveb %d1,%d3 void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 45fe6: 2f02 movel %d2,%sp@- 45fe8: 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 ); 45fec: 2f02 movel %d2,%sp@- void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 45fee: 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 ); 45ff2: 2f03 movel %d3,%sp@- _System_state_Set( SYSTEM_STATE_FAILED ); _CPU_Fatal_halt( the_error ); 45ff4: 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 ); 45ffa: 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; 45ffc: 13c1 0005 cdb2 moveb %d1,5cdb2 <_Internal_errors_What_happened+0x4> bool is_internal, Internal_errors_t the_error ) { _Internal_errors_What_happened.the_source = the_source; 46002: 23c0 0005 cdae movel %d0,5cdae <_Internal_errors_What_happened> _Internal_errors_What_happened.is_internal = is_internal; _Internal_errors_What_happened.the_error = the_error; 46008: 23c2 0005 cdb4 movel %d2,5cdb4 <_Internal_errors_What_happened+0x6> _User_extensions_Fatal( the_source, is_internal, the_error ); 4600e: 4eb9 0004 7b0a jsr 47b0a <_User_extensions_Fatal> _System_state_Set( SYSTEM_STATE_FAILED ); _CPU_Fatal_halt( the_error ); 46014: 40c0 movew %sr,%d0 46016: 8083 orl %d3,%d0 46018: 46c0 movew %d0,%sr 4601a: 2002 movel %d2,%d0 <== NOT EXECUTED 4601c: 223c dead beef movel #-559038737,%d1 <== NOT EXECUTED 46022: 4ac8 halt <== NOT EXECUTED RTEMS_INLINE_ROUTINE void _System_state_Set ( System_state_Codes state ) { _System_state_Current = state; 46024: 7005 moveq #5,%d0 46026: 4fef 000c lea %sp@(12),%sp 4602a: 23c0 0005 ce90 movel %d0,5ce90 <_System_state_Current> 46030: 60fe bras 46030 <_Internal_error_Occurred+0x58> ... 0004609c <_Objects_Allocate>: */ Objects_Control *_Objects_Allocate( Objects_Information *information ) { 4609c: 4e56 fff0 linkw %fp,#-16 460a0: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ 460a4: 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 ) 460a8: 4aaa 0014 tstl %a2@(20) 460ac: 6604 bnes 460b2 <_Objects_Allocate+0x16> <== ALWAYS TAKEN 460ae: 4280 clrl %d0 <== NOT EXECUTED 460b0: 605e bras 46110 <_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 ); 460b2: 240a movel %a2,%d2 460b4: 0682 0000 001c addil #28,%d2 460ba: 47f9 0004 a070 lea 4a070 <_Chain_Get>,%a3 460c0: 2f02 movel %d2,%sp@- 460c2: 4e93 jsr %a3@ if ( information->auto_extend ) { 460c4: 588f addql #4,%sp 460c6: 4a2a 0010 tstb %a2@(16) 460ca: 6744 beqs 46110 <_Objects_Allocate+0x74> /* * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { 460cc: 4a80 tstl %d0 460ce: 6612 bnes 460e2 <_Objects_Allocate+0x46> _Objects_Extend_information( information ); 460d0: 2f0a movel %a2,%sp@- 460d2: 4eb9 0004 6148 jsr 46148 <_Objects_Extend_information> the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 460d8: 2f02 movel %d2,%sp@- 460da: 4e93 jsr %a3@ } if ( the_object ) { 460dc: 508f addql #8,%sp 460de: 4a80 tstl %d0 460e0: 672e beqs 46110 <_Objects_Allocate+0x74> uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 460e2: 2040 moveal %d0,%a0 460e4: 4281 clrl %d1 460e6: 4283 clrl %d3 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 460e8: 4282 clrl %d2 } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 460ea: 362a 0008 movew %a2@(8),%d3 460ee: 3228 000a movew %a0@(10),%d1 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 460f2: 342a 0012 movew %a2@(18),%d2 information->inactive--; 460f6: 306a 0028 moveaw %a2@(40),%a0 } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 460fa: 9283 subl %d3,%d1 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 460fc: 4c42 1001 remul %d2,%d1,%d1 information->inactive--; 46100: 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 ]--; 46102: e589 lsll #2,%d1 information->inactive--; 46104: 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 ]--; 46108: 206a 002a moveal %a2@(42),%a0 4610c: d1c1 addal %d1,%a0 4610e: 5390 subql #1,%a0@ information->inactive--; } } return the_object; } 46110: 4cee 0c0c fff0 moveml %fp@(-16),%d2-%d3/%a2-%a3 46116: 4e5e unlk %fp ... 0004611c <_Objects_Close>: #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4611c: 4280 clrl %d0 void _Objects_Close( Objects_Information *information, Objects_Control *the_object ) { 4611e: 4e56 0000 linkw %fp,#0 46122: 226e 000c moveal %fp@(12),%a1 46126: 206e 0008 moveal %fp@(8),%a0 4612a: 2f0a movel %a2,%sp@- 4612c: 2468 0018 moveal %a0@(24),%a2 46130: 3029 000a movew %a1@(10),%d0 46134: 42b2 0c00 clrl %a2@(00000000,%d0:l:4) _Objects_Invalidate_Id( information, the_object ); _Objects_Namespace_remove( information, the_object ); 46138: 2d49 000c movel %a1,%fp@(12) } 4613c: 245f moveal %sp@+,%a2 4613e: 4e5e unlk %fp Objects_Control *the_object ) { _Objects_Invalidate_Id( information, the_object ); _Objects_Namespace_remove( information, the_object ); 46140: 4ef9 0004 6640 jmp 46640 <_Objects_Namespace_remove> ... 00046440 <_Objects_Get_information>: Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint32_t the_class ) { 46440: 4e56 0000 linkw %fp,#0 46444: 2f03 movel %d3,%sp@- 46446: 262e 0008 movel %fp@(8),%d3 4644a: 2f02 movel %d2,%sp@- 4644c: 242e 000c movel %fp@(12),%d2 Objects_Information *info; int the_class_api_maximum; if ( !the_class ) 46450: 672e beqs 46480 <_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 ); 46452: 2f03 movel %d3,%sp@- 46454: 4eb9 0004 a574 jsr 4a574 <_Objects_API_maximum_class> if ( the_class_api_maximum == 0 ) 4645a: 588f addql #4,%sp 4645c: 4a80 tstl %d0 4645e: 6720 beqs 46480 <_Objects_Get_information+0x40> return NULL; if ( the_class > (uint32_t) the_class_api_maximum ) 46460: b082 cmpl %d2,%d0 46462: 651c bcss 46480 <_Objects_Get_information+0x40> return NULL; if ( !_Objects_Information_table[ the_api ] ) 46464: 41f9 0005 ccc0 lea 5ccc0 <_Objects_Information_table>,%a0 4646a: 2070 3c00 moveal %a0@(00000000,%d3:l:4),%a0 4646e: 4a88 tstl %a0 46470: 670e beqs 46480 <_Objects_Get_information+0x40> <== NEVER TAKEN return NULL; info = _Objects_Information_table[ the_api ][ the_class ]; 46472: 2030 2c00 movel %a0@(00000000,%d2:l:4),%d0 if ( !info ) 46476: 670a beqs 46482 <_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 ) 46478: 2040 moveal %d0,%a0 4647a: 4a68 000e tstw %a0@(14) 4647e: 6602 bnes 46482 <_Objects_Get_information+0x42> 46480: 4280 clrl %d0 return NULL; #endif return info; } 46482: 242e fff8 movel %fp@(-8),%d2 46486: 262e fffc movel %fp@(-4),%d3 4648a: 4e5e unlk %fp ... 0004783c <_Objects_Get_name_as_string>: char *_Objects_Get_name_as_string( Objects_Id id, size_t length, char *name ) { 4783c: 4e56 ffe0 linkw %fp,#-32 47840: 48d7 043c moveml %d2-%d5/%a2,%sp@ 47844: 262e 0008 movel %fp@(8),%d3 47848: 282e 000c movel %fp@(12),%d4 4784c: 242e 0010 movel %fp@(16),%d2 char lname[5]; Objects_Control *the_object; Objects_Locations location; Objects_Id tmpId; if ( length == 0 ) 47850: 4a84 tstl %d4 47852: 6700 00be beqw 47912 <_Objects_Get_name_as_string+0xd6> return NULL; if ( name == NULL ) 47856: 4a82 tstl %d2 47858: 6700 00ba beqw 47914 <_Objects_Get_name_as_string+0xd8> return NULL; tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 4785c: 4a83 tstl %d3 4785e: 660a bnes 4786a <_Objects_Get_name_as_string+0x2e> 47860: 2079 0006 6ce2 moveal 66ce2 <_Thread_Executing>,%a0 47866: 2628 0008 movel %a0@(8),%d3 information = _Objects_Get_information_id( tmpId ); 4786a: 2f03 movel %d3,%sp@- 4786c: 4eb9 0004 7768 jsr 47768 <_Objects_Get_information_id> if ( !information ) 47872: 588f addql #4,%sp if ( name == NULL ) return NULL; tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; information = _Objects_Get_information_id( tmpId ); 47874: 2440 moveal %d0,%a2 if ( !information ) 47876: 4a80 tstl %d0 47878: 6700 0098 beqw 47912 <_Objects_Get_name_as_string+0xd6> return NULL; the_object = _Objects_Get( information, tmpId, &location ); 4787c: 486e fffc pea %fp@(-4) 47880: 2f03 movel %d3,%sp@- 47882: 2f00 movel %d0,%sp@- 47884: 4eb9 0004 7920 jsr 47920 <_Objects_Get> switch ( location ) { 4788a: 4fef 000c lea %sp@(12),%sp 4788e: 4aae fffc tstl %fp@(-4) 47892: 667e bnes 47912 <_Objects_Get_name_as_string+0xd6><== NEVER TAKEN return NULL; case OBJECTS_LOCAL: #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) { 47894: 4a2a 0032 tstb %a2@(50) 47898: 670e beqs 478a8 <_Objects_Get_name_as_string+0x6c> s = the_object->name.name_p; 4789a: 2040 moveal %d0,%a0 4789c: 2268 000c moveal %a0@(12),%a1 lname[ 4 ] = '\0'; s = lname; } d = name; if ( s ) { 478a0: 4a89 tstl %a1 478a2: 6634 bnes 478d8 <_Objects_Get_name_as_string+0x9c> 478a4: 2042 moveal %d2,%a0 478a6: 6060 bras 47908 <_Objects_Get_name_as_string+0xcc> if ( information->is_string ) { s = the_object->name.name_p; } else #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; 478a8: 2040 moveal %d0,%a0 lname[ 0 ] = (u32_name >> 24) & 0xff; 478aa: 7218 moveq #24,%d1 lname[ 1 ] = (u32_name >> 16) & 0xff; lname[ 2 ] = (u32_name >> 8) & 0xff; lname[ 3 ] = (u32_name >> 0) & 0xff; lname[ 4 ] = '\0'; 478ac: 43ee fff7 lea %fp@(-9),%a1 if ( information->is_string ) { s = the_object->name.name_p; } else #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; 478b0: 2028 000c movel %a0@(12),%d0 lname[ 0 ] = (u32_name >> 24) & 0xff; 478b4: 2a00 movel %d0,%d5 478b6: e2ad lsrl %d1,%d5 lname[ 1 ] = (u32_name >> 16) & 0xff; lname[ 2 ] = (u32_name >> 8) & 0xff; 478b8: 2200 movel %d0,%d1 #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; lname[ 0 ] = (u32_name >> 24) & 0xff; lname[ 1 ] = (u32_name >> 16) & 0xff; 478ba: 2600 movel %d0,%d3 lname[ 2 ] = (u32_name >> 8) & 0xff; 478bc: e089 lsrl #8,%d1 lname[ 3 ] = (u32_name >> 0) & 0xff; 478be: 1d40 fffa moveb %d0,%fp@(-6) #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; lname[ 0 ] = (u32_name >> 24) & 0xff; lname[ 1 ] = (u32_name >> 16) & 0xff; 478c2: 4243 clrw %d3 478c4: 4843 swap %d3 lname[ 2 ] = (u32_name >> 8) & 0xff; lname[ 3 ] = (u32_name >> 0) & 0xff; lname[ 4 ] = '\0'; 478c6: 4200 clrb %d0 } else #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; lname[ 0 ] = (u32_name >> 24) & 0xff; 478c8: 1d45 fff7 moveb %d5,%fp@(-9) lname[ 1 ] = (u32_name >> 16) & 0xff; 478cc: 1d43 fff8 moveb %d3,%fp@(-8) lname[ 2 ] = (u32_name >> 8) & 0xff; 478d0: 1d41 fff9 moveb %d1,%fp@(-7) lname[ 3 ] = (u32_name >> 0) & 0xff; lname[ 4 ] = '\0'; 478d4: 1d40 fffb moveb %d0,%fp@(-5) s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 478d8: 5384 subql #1,%d4 lname[ 0 ] = (u32_name >> 24) & 0xff; lname[ 1 ] = (u32_name >> 16) & 0xff; lname[ 2 ] = (u32_name >> 8) & 0xff; lname[ 3 ] = (u32_name >> 0) & 0xff; lname[ 4 ] = '\0'; 478da: 2042 moveal %d2,%a0 478dc: 4280 clrl %d0 478de: 6018 bras 478f8 <_Objects_Get_name_as_string+0xbc> } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { *d = (isprint((unsigned char)*s)) ? *s : '*'; 478e0: 2479 0005 d7ec moveal 5d7ec <__ctype_ptr__>,%a2 478e6: 1632 3801 moveb %a2@(00000001,%d3:l),%d3 478ea: 49c3 extbl %d3 478ec: 0283 0000 0097 andil #151,%d3 478f2: 6602 bnes 478f6 <_Objects_Get_name_as_string+0xba> 478f4: 722a moveq #42,%d1 478f6: 10c1 moveb %d1,%a0@+ s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 478f8: b880 cmpl %d0,%d4 478fa: 630c blss 47908 <_Objects_Get_name_as_string+0xcc> *d = (isprint((unsigned char)*s)) ? *s : '*'; 478fc: 4283 clrl %d3 s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 478fe: 1231 0800 moveb %a1@(00000000,%d0:l),%d1 47902: 5280 addql #1,%d0 *d = (isprint((unsigned char)*s)) ? *s : '*'; 47904: 1601 moveb %d1,%d3 s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 47906: 66d8 bnes 478e0 <_Objects_Get_name_as_string+0xa4> *d = (isprint((unsigned char)*s)) ? *s : '*'; } } *d = '\0'; 47908: 4210 clrb %a0@ _Thread_Enable_dispatch(); 4790a: 4eb9 0004 80aa jsr 480aa <_Thread_Enable_dispatch> return name; 47910: 6002 bras 47914 <_Objects_Get_name_as_string+0xd8> 47912: 4282 clrl %d2 } return NULL; /* unreachable path */ } 47914: 2002 movel %d2,%d0 47916: 4cee 043c ffe0 moveml %fp@(-32),%d2-%d5/%a2 4791c: 4e5e unlk %fp <== NOT EXECUTED 00053754 <_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; 53754: 7001 moveq #1,%d0 if ( information->maximum >= index ) { 53756: 4281 clrl %d1 Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 53758: 4e56 0000 linkw %fp,#0 5375c: 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; 53760: 90a8 0006 subl %a0@(6),%d0 53764: d0ae 000c addl %fp@(12),%d0 if ( information->maximum >= index ) { 53768: 3228 000e movew %a0@(14),%d1 Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 5376c: 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 ) { 53770: b081 cmpl %d1,%d0 53772: 620e bhis 53782 <_Objects_Get_no_protection+0x2e> if ( (the_object = information->local_table[ index ]) != NULL ) { 53774: 2068 0018 moveal %a0@(24),%a0 53778: 2030 0c00 movel %a0@(00000000,%d0:l:4),%d0 5377c: 6704 beqs 53782 <_Objects_Get_no_protection+0x2e><== NEVER TAKEN *location = OBJECTS_LOCAL; 5377e: 4291 clrl %a1@ return the_object; 53780: 6006 bras 53788 <_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; 53782: 7001 moveq #1,%d0 53784: 2280 movel %d0,%a1@ 53786: 4280 clrl %d0 return NULL; } 53788: 4e5e unlk %fp <== NOT EXECUTED 00047370 <_Objects_Id_to_name>: */ Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { 47370: 4e56 fffc linkw %fp,#-4 47374: 222e 0008 movel %fp@(8),%d1 47378: 2f02 movel %d2,%sp@- /* * Caller is trusted for name != NULL. */ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 4737a: 4a81 tstl %d1 4737c: 660a bnes 47388 <_Objects_Id_to_name+0x18> 4737e: 2079 0005 e1ea moveal 5e1ea <_Thread_Executing>,%a0 47384: 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); 47388: 7418 moveq #24,%d2 4738a: 2001 movel %d1,%d0 4738c: e4a8 lsrl %d2,%d0 4738e: 143c 0007 moveb #7,%d2 47392: c082 andl %d2,%d0 */ RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid( uint32_t the_api ) { if ( !the_api || the_api > OBJECTS_APIS_LAST ) 47394: 143c 0003 moveb #3,%d2 47398: 2040 moveal %d0,%a0 4739a: 5388 subql #1,%a0 4739c: b488 cmpl %a0,%d2 4739e: 6540 bcss 473e0 <_Objects_Id_to_name+0x70> 473a0: 6048 bras 473ea <_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 ]; 473a2: 2001 movel %d1,%d0 473a4: 741b moveq #27,%d2 473a6: e4a8 lsrl %d2,%d0 473a8: 2070 0c00 moveal %a0@(00000000,%d0:l:4),%a0 if ( !information ) 473ac: 4a88 tstl %a0 473ae: 6730 beqs 473e0 <_Objects_Id_to_name+0x70> <== NEVER TAKEN return OBJECTS_INVALID_ID; #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) 473b0: 4a28 0032 tstb %a0@(50) 473b4: 662a bnes 473e0 <_Objects_Id_to_name+0x70> <== NEVER TAKEN return OBJECTS_INVALID_ID; #endif the_object = _Objects_Get( information, tmpId, &ignored_location ); 473b6: 486e fffc pea %fp@(-4) 473ba: 2f01 movel %d1,%sp@- 473bc: 2f08 movel %a0,%sp@- 473be: 4eb9 0004 7310 jsr 47310 <_Objects_Get> if ( !the_object ) 473c4: 4fef 000c lea %sp@(12),%sp 473c8: 4a80 tstl %d0 473ca: 6714 beqs 473e0 <_Objects_Id_to_name+0x70> return OBJECTS_INVALID_ID; *name = the_object->name; 473cc: 206e 000c moveal %fp@(12),%a0 473d0: 2240 moveal %d0,%a1 473d2: 20a9 000c movel %a1@(12),%a0@ _Thread_Enable_dispatch(); 473d6: 4eb9 0004 7b96 jsr 47b96 <_Thread_Enable_dispatch> 473dc: 4280 clrl %d0 return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; 473de: 6002 bras 473e2 <_Objects_Id_to_name+0x72> 473e0: 7003 moveq #3,%d0 } 473e2: 242e fff8 movel %fp@(-8),%d2 473e6: 4e5e unlk %fp 473e8: 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 ] ) 473ea: 41f9 0005 e0e8 lea 5e0e8 <_Objects_Information_table>,%a0 473f0: 2070 0c00 moveal %a0@(00000000,%d0:l:4),%a0 473f4: 4a88 tstl %a0 473f6: 66aa bnes 473a2 <_Objects_Id_to_name+0x32> 473f8: 60e6 bras 473e0 <_Objects_Id_to_name+0x70> ... 00046a50 <_Objects_Set_name>: { size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 46a50: 4280 clrl %d0 bool _Objects_Set_name( Objects_Information *information, Objects_Control *the_object, const char *name ) { 46a52: 4e56 ffe0 linkw %fp,#-32 46a56: 48d7 3c3c moveml %d2-%d5/%a2-%a5,%sp@ 46a5a: 2a6e 0008 moveal %fp@(8),%a5 size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 46a5e: 302d 0034 movew %a5@(52),%d0 bool _Objects_Set_name( Objects_Information *information, Objects_Control *the_object, const char *name ) { 46a62: 246e 0010 moveal %fp@(16),%a2 size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 46a66: 2f00 movel %d0,%sp@- bool _Objects_Set_name( Objects_Information *information, Objects_Control *the_object, const char *name ) { 46a68: 286e 000c moveal %fp@(12),%a4 size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 46a6c: 2f0a movel %a2,%sp@- 46a6e: 4eb9 0004 e5c0 jsr 4e5c0 #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) { 46a74: 508f addql #8,%sp { size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 46a76: 2640 moveal %d0,%a3 #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) { 46a78: 4a2d 0032 tstb %a5@(50) 46a7c: 6748 beqs 46ac6 <_Objects_Set_name+0x76> char *d; d = _Workspace_Allocate( length + 1 ); 46a7e: 486b 0001 pea %a3@(1) 46a82: 4eb9 0004 82dc jsr 482dc <_Workspace_Allocate> if ( !d ) 46a88: 588f addql #4,%sp #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) { char *d; d = _Workspace_Allocate( length + 1 ); 46a8a: 2a40 moveal %d0,%a5 if ( !d ) 46a8c: 4a80 tstl %d0 46a8e: 6604 bnes 46a94 <_Objects_Set_name+0x44> <== ALWAYS TAKEN 46a90: 4200 clrb %d0 <== NOT EXECUTED 46a92: 6076 bras 46b0a <_Objects_Set_name+0xba> <== NOT EXECUTED return false; if ( the_object->name.name_p ) { 46a94: 202c 000c movel %a4@(12),%d0 46a98: 670e beqs 46aa8 <_Objects_Set_name+0x58> _Workspace_Free( (void *)the_object->name.name_p ); 46a9a: 2f00 movel %d0,%sp@- 46a9c: 4eb9 0004 82f8 jsr 482f8 <_Workspace_Free> the_object->name.name_p = NULL; 46aa2: 588f addql #4,%sp 46aa4: 42ac 000c clrl %a4@(12) } strncpy( d, name, length ); 46aa8: 2f0b movel %a3,%sp@- 46aaa: 2f0a movel %a2,%sp@- 46aac: 2f0d movel %a5,%sp@- 46aae: 4eb9 0004 e538 jsr 4e538 d[length] = '\0'; the_object->name.name_p = d; 46ab4: 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'; 46ab8: 4200 clrb %d0 46aba: 1b80 b800 moveb %d0,%a5@(00000000,%a3:l) the_object->name.name_p = d; 46abe: 7001 moveq #1,%d0 46ac0: 294d 000c movel %a5,%a4@(12) 46ac4: 6044 bras 46b0a <_Objects_Set_name+0xba> } else #endif { the_object->name.name_u32 = _Objects_Build_name( 46ac6: 7201 moveq #1,%d1 46ac8: 1012 moveb %a2@,%d0 46aca: b28b cmpl %a3,%d1 46acc: 6446 bccs 46b14 <_Objects_Set_name+0xc4> 46ace: 7602 moveq #2,%d3 46ad0: 142a 0001 moveb %a2@(1),%d2 46ad4: 49c2 extbl %d2 46ad6: 4842 swap %d2 46ad8: 4242 clrw %d2 46ada: b68b cmpl %a3,%d3 46adc: 643a bccs 46b18 <_Objects_Set_name+0xc8> 46ade: 7a03 moveq #3,%d5 46ae0: 122a 0002 moveb %a2@(2),%d1 46ae4: 49c1 extbl %d1 46ae6: e189 lsll #8,%d1 46ae8: ba8b cmpl %a3,%d5 46aea: 6506 bcss 46af2 <_Objects_Set_name+0xa2> 46aec: 163c 0020 moveb #32,%d3 46af0: 6006 bras 46af8 <_Objects_Set_name+0xa8> 46af2: 162a 0003 moveb %a2@(3),%d3 46af6: 49c3 extbl %d3 46af8: 2800 movel %d0,%d4 46afa: 7a18 moveq #24,%d5 46afc: ebac lsll %d5,%d4 46afe: 7001 moveq #1,%d0 46b00: 8484 orl %d4,%d2 46b02: 8481 orl %d1,%d2 46b04: 8483 orl %d3,%d2 46b06: 2942 000c movel %d2,%a4@(12) ); } return true; } 46b0a: 4cee 3c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a5 46b10: 4e5e unlk %fp 46b12: 4e75 rts d[length] = '\0'; the_object->name.name_p = d; } else #endif { the_object->name.name_u32 = _Objects_Build_name( 46b14: 7420 moveq #32,%d2 46b16: 4842 swap %d2 46b18: 223c 0000 2000 movel #8192,%d1 46b1e: 7620 moveq #32,%d3 46b20: 60d6 bras 46af8 <_Objects_Set_name+0xa8> ... 00045bbc <_POSIX_Condition_variables_Wait_support>: pthread_cond_t *cond, pthread_mutex_t *mutex, Watchdog_Interval timeout, bool already_timedout ) { 45bbc: 4e56 ffe4 linkw %fp,#-28 45bc0: 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 ) ) { 45bc4: 240e movel %fp,%d2 45bc6: 5982 subql #4,%d2 pthread_cond_t *cond, pthread_mutex_t *mutex, Watchdog_Interval timeout, bool already_timedout ) { 45bc8: 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 ) ) { 45bcc: 2f02 movel %d2,%sp@- pthread_cond_t *cond, pthread_mutex_t *mutex, Watchdog_Interval timeout, bool already_timedout ) { 45bce: 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 ) ) { 45bd2: 2f0a movel %a2,%sp@- pthread_cond_t *cond, pthread_mutex_t *mutex, Watchdog_Interval timeout, bool already_timedout ) { 45bd4: 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 ) ) { 45bd8: 4eb9 0004 5d6e jsr 45d6e <_POSIX_Mutex_Get> 45bde: 508f addql #8,%sp 45be0: 4a80 tstl %d0 45be2: 6700 00ae beqw 45c92 <_POSIX_Condition_variables_Wait_support+0xd6> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 45be6: 2039 0005 f248 movel 5f248 <_Thread_Dispatch_disable_level>,%d0 45bec: 5380 subql #1,%d0 return EINVAL; } _Thread_Unnest_dispatch(); the_cond = _POSIX_Condition_variables_Get( cond, &location ); 45bee: 2f02 movel %d2,%sp@- 45bf0: 23c0 0005 f248 movel %d0,5f248 <_Thread_Dispatch_disable_level> 45bf6: 2f0d movel %a5,%sp@- 45bf8: 4eb9 0004 59ec jsr 459ec <_POSIX_Condition_variables_Get> switch ( location ) { 45bfe: 508f addql #8,%sp return EINVAL; } _Thread_Unnest_dispatch(); the_cond = _POSIX_Condition_variables_Get( cond, &location ); 45c00: 2640 moveal %d0,%a3 switch ( location ) { 45c02: 4aae fffc tstl %fp@(-4) 45c06: 6600 008a bnew 45c92 <_POSIX_Condition_variables_Wait_support+0xd6> case OBJECTS_LOCAL: if ( the_cond->Mutex && ( the_cond->Mutex != *mutex ) ) { 45c0a: 202b 0014 movel %a3@(20),%d0 45c0e: 670c beqs 45c1c <_POSIX_Condition_variables_Wait_support+0x60> 45c10: b092 cmpl %a2@,%d0 45c12: 6708 beqs 45c1c <_POSIX_Condition_variables_Wait_support+0x60> _Thread_Enable_dispatch(); 45c14: 4eb9 0004 89a6 jsr 489a6 <_Thread_Enable_dispatch> 45c1a: 6076 bras 45c92 <_POSIX_Condition_variables_Wait_support+0xd6> return EINVAL; } (void) pthread_mutex_unlock( mutex ); 45c1c: 2f0a movel %a2,%sp@- 45c1e: 49f9 0004 89a6 lea 489a6 <_Thread_Enable_dispatch>,%a4 45c24: 4eb9 0004 5f74 jsr 45f74 _Thread_Enable_dispatch(); return EINVAL; } */ if ( !already_timedout ) { 45c2a: 588f addql #4,%sp 45c2c: 4a03 tstb %d3 45c2e: 6650 bnes 45c80 <_POSIX_Condition_variables_Wait_support+0xc4> the_cond->Mutex = *mutex; 45c30: 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; 45c34: 200b movel %a3,%d0 45c36: 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; 45c3c: 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; 45c3e: 2079 0005 f302 moveal 5f302 <_Thread_Executing>,%a0 45c44: 42a8 0034 clrl %a0@(52) _Thread_Executing->Wait.queue = &the_cond->Wait_queue; _Thread_Executing->Wait.id = *cond; 45c48: 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; 45c4c: 2140 0044 movel %d0,%a0@(68) 45c50: 2741 0048 movel %d1,%a3@(72) _Thread_Executing->Wait.id = *cond; _Thread_queue_Enqueue( &the_cond->Wait_queue, timeout ); 45c54: 4879 0004 9184 pea 49184 <_Thread_queue_Timeout> 45c5a: 2f2e 0010 movel %fp@(16),%sp@- 45c5e: 2f00 movel %d0,%sp@- 45c60: 4eb9 0004 8e40 jsr 48e40 <_Thread_queue_Enqueue_with_handler> _Thread_Enable_dispatch(); 45c66: 4e94 jsr %a4@ /* * Switch ourself out because we blocked as a result of the * _Thread_queue_Enqueue. */ status = _Thread_Executing->Wait.return_code; 45c68: 2079 0005 f302 moveal 5f302 <_Thread_Executing>,%a0 if ( status && status != ETIMEDOUT ) 45c6e: 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; 45c72: 2428 0034 movel %a0@(52),%d2 if ( status && status != ETIMEDOUT ) 45c76: 670c beqs 45c84 <_POSIX_Condition_variables_Wait_support+0xc8> 45c78: 7074 moveq #116,%d0 45c7a: b082 cmpl %d2,%d0 45c7c: 6616 bnes 45c94 <_POSIX_Condition_variables_Wait_support+0xd8><== NEVER TAKEN 45c7e: 6004 bras 45c84 <_POSIX_Condition_variables_Wait_support+0xc8> return status; } else { _Thread_Enable_dispatch(); 45c80: 4e94 jsr %a4@ 45c82: 7474 moveq #116,%d2 /* * When we get here the dispatch disable level is 0. */ mutex_status = pthread_mutex_lock( mutex ); 45c84: 2f0a movel %a2,%sp@- 45c86: 4eb9 0004 5edc jsr 45edc if ( mutex_status ) 45c8c: 588f addql #4,%sp 45c8e: 4a80 tstl %d0 45c90: 6702 beqs 45c94 <_POSIX_Condition_variables_Wait_support+0xd8> 45c92: 7416 moveq #22,%d2 case OBJECTS_ERROR: break; } return EINVAL; } 45c94: 2002 movel %d2,%d0 45c96: 4cee 3c0c ffe4 moveml %fp@(-28),%d2-%d3/%a2-%a5 45c9c: 4e5e unlk %fp <== NOT EXECUTED 0004948c <_POSIX_Message_queue_Receive_support>: size_t msg_len, unsigned int *msg_prio, bool wait, Watchdog_Interval timeout ) { 4948c: 4e56 ffe4 linkw %fp,#-28 49490: 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( 49494: 486e fffc pea %fp@(-4) 49498: 242e 0008 movel %fp@(8),%d2 4949c: 2f02 movel %d2,%sp@- 4949e: 4879 0006 5070 pea 65070 <_POSIX_Message_queue_Information_fds> 494a4: 246e 0014 moveal %fp@(20),%a2 494a8: 262e 0018 movel %fp@(24),%d3 494ac: 4eb9 0004 c188 jsr 4c188 <_Objects_Get> Objects_Locations location; size_t length_out; bool do_wait; the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); switch ( location ) { 494b2: 4fef 000c lea %sp@(12),%sp 494b6: 4aae fffc tstl %fp@(-4) 494ba: 6600 00c4 bnew 49580 <_POSIX_Message_queue_Receive_support+0xf4> case OBJECTS_LOCAL: if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) { 494be: 2040 moveal %d0,%a0 494c0: 7803 moveq #3,%d4 494c2: 7a01 moveq #1,%d5 494c4: 2228 0014 movel %a0@(20),%d1 494c8: c881 andl %d1,%d4 494ca: ba84 cmpl %d4,%d5 494cc: 660a bnes 494d8 <_POSIX_Message_queue_Receive_support+0x4c> _Thread_Enable_dispatch(); 494ce: 4eb9 0004 c9da jsr 4c9da <_Thread_Enable_dispatch> 494d4: 6000 00aa braw 49580 <_POSIX_Message_queue_Receive_support+0xf4> rtems_set_errno_and_return_minus_one( EBADF ); } the_mq = the_mq_fd->Queue; 494d8: 2240 moveal %d0,%a1 494da: 2069 0010 moveal %a1@(16),%a0 if ( msg_len < the_mq->Message_queue.maximum_message_size ) { 494de: 2028 0066 movel %a0@(102),%d0 494e2: b0ae 0010 cmpl %fp@(16),%d0 494e6: 6318 blss 49500 <_POSIX_Message_queue_Receive_support+0x74> _Thread_Enable_dispatch(); 494e8: 4eb9 0004 c9da jsr 4c9da <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EMSGSIZE ); 494ee: 747a moveq #122,%d2 494f0: 4eb9 0005 28c4 jsr 528c4 <__errno> 494f6: 72ff moveq #-1,%d1 494f8: 2040 moveal %d0,%a0 494fa: 2082 movel %d2,%a0@ 494fc: 6000 0090 braw 4958e <_POSIX_Message_queue_Receive_support+0x102> length_out = -1; /* * A timed receive with a bad time will do a poll regardless. */ if ( wait ) 49500: 4a03 tstb %d3 49502: 6604 bnes 49508 <_POSIX_Message_queue_Receive_support+0x7c><== ALWAYS TAKEN 49504: 4200 clrb %d0 <== NOT EXECUTED 49506: 600c bras 49514 <_POSIX_Message_queue_Receive_support+0x88><== NOT EXECUTED do_wait = (the_mq_fd->oflag & O_NONBLOCK) ? false : true; 49508: 2001 movel %d1,%d0 4950a: 760e moveq #14,%d3 4950c: 7a01 moveq #1,%d5 4950e: e6a8 lsrl %d3,%d0 49510: bb80 eorl %d5,%d0 49512: c085 andl %d5,%d0 do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 49514: 2f2e 001c movel %fp@(28),%sp@- 49518: 7201 moveq #1,%d1 /* * Now if something goes wrong, we return a "length" of -1 * to indicate an error. */ length_out = -1; 4951a: 76ff moveq #-1,%d3 do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 4951c: c280 andl %d0,%d1 /* * Now if something goes wrong, we return a "length" of -1 * to indicate an error. */ length_out = -1; 4951e: 2d43 fff8 movel %d3,%fp@(-8) do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 49522: 2f01 movel %d1,%sp@- 49524: 486e fff8 pea %fp@(-8) 49528: 2f2e 000c movel %fp@(12),%sp@- 4952c: 2f02 movel %d2,%sp@- 4952e: 4868 001a pea %a0@(26) 49532: 4eb9 0004 b2d0 jsr 4b2d0 <_CORE_message_queue_Seize> &length_out, do_wait, timeout ); _Thread_Enable_dispatch(); 49538: 4eb9 0004 c9da jsr 4c9da <_Thread_Enable_dispatch> *msg_prio = _POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count); 4953e: 2079 0006 4cee moveal 64cee <_Thread_Executing>,%a0 do_wait, timeout ); _Thread_Enable_dispatch(); *msg_prio = 49544: 24a8 0024 movel %a0@(36),%a2@ 49548: 6c06 bges 49550 <_POSIX_Message_queue_Receive_support+0xc4> 4954a: 2a12 movel %a2@,%d5 4954c: 4485 negl %d5 4954e: 2485 movel %d5,%a2@ _POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count); if ( !_Thread_Executing->Wait.return_code ) 49550: 4fef 0018 lea %sp@(24),%sp 49554: 4aa8 0034 tstl %a0@(52) 49558: 6606 bnes 49560 <_POSIX_Message_queue_Receive_support+0xd4> return length_out; 4955a: 222e fff8 movel %fp@(-8),%d1 4955e: 602e bras 4958e <_POSIX_Message_queue_Receive_support+0x102> rtems_set_errno_and_return_minus_one( 49560: 4eb9 0005 28c4 jsr 528c4 <__errno> 49566: 2079 0006 4cee moveal 64cee <_Thread_Executing>,%a0 4956c: 2440 moveal %d0,%a2 4956e: 2f28 0034 movel %a0@(52),%sp@- 49572: 4eb9 0004 97b8 jsr 497b8 <_POSIX_Message_queue_Translate_core_message_queue_return_code> 49578: 588f addql #4,%sp 4957a: 72ff moveq #-1,%d1 4957c: 2480 movel %d0,%a2@ 4957e: 600e bras 4958e <_POSIX_Message_queue_Receive_support+0x102> #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); 49580: 4eb9 0005 28c4 jsr 528c4 <__errno> 49586: 72ff moveq #-1,%d1 49588: 2040 moveal %d0,%a0 4958a: 7009 moveq #9,%d0 4958c: 2080 movel %d0,%a0@ } 4958e: 2001 movel %d1,%d0 49590: 4cee 043c ffe4 moveml %fp@(-28),%d2-%d5/%a2 49596: 4e5e unlk %fp ... 00049864 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch>: #include void _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch( Thread_Control *the_thread ) { 49864: 4e56 0000 linkw %fp,#0 49868: 226e 0008 moveal %fp@(8),%a1 POSIX_API_Control *thread_support; thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4986c: 2069 010e moveal %a1@(270),%a0 if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 49870: 4aa8 00d4 tstl %a0@(212) 49874: 662e bnes 498a4 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x40><== NEVER TAKEN thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS && 49876: 7001 moveq #1,%d0 49878: b0a8 00d8 cmpl %a0@(216),%d0 4987c: 6626 bnes 498a4 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x40> thread_support->cancelation_requested ) { 4987e: 4aa8 00dc tstl %a0@(220) 49882: 6720 beqs 498a4 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x40> _Thread_Unnest_dispatch(); _POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED ); 49884: 4878 ffff pea ffffffff */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 49888: 2039 0005 d39c movel 5d39c <_Thread_Dispatch_disable_level>,%d0 4988e: 5380 subql #1,%d0 49890: 2f09 movel %a1,%sp@- 49892: 23c0 0005 d39c movel %d0,5d39c <_Thread_Dispatch_disable_level> 49898: 4eb9 0004 9e90 jsr 49e90 <_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 && 4989e: 508f addql #8,%sp _Thread_Unnest_dispatch(); _POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED ); } else _Thread_Enable_dispatch(); } 498a0: 4e5e unlk %fp 498a2: 4e75 rts 498a4: 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(); 498a6: 4ef9 0004 700e jmp 4700e <_Thread_Enable_dispatch> 0004a918 <_POSIX_Thread_Translate_sched_param>: int policy, struct sched_param *param, Thread_CPU_budget_algorithms *budget_algorithm, Thread_CPU_budget_algorithm_callout *budget_callout ) { 4a918: 4e56 ffec linkw %fp,#-20 4a91c: 48d7 3c04 moveml %d2/%a2-%a5,%sp@ 4a920: 246e 000c moveal %fp@(12),%a2 if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) 4a924: 2f12 movel %a2@,%sp@- int policy, struct sched_param *param, Thread_CPU_budget_algorithms *budget_algorithm, Thread_CPU_budget_algorithm_callout *budget_callout ) { 4a926: 242e 0008 movel %fp@(8),%d2 4a92a: 266e 0010 moveal %fp@(16),%a3 4a92e: 286e 0014 moveal %fp@(20),%a4 if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) 4a932: 4eb9 0004 a8f4 jsr 4a8f4 <_POSIX_Priority_Is_valid> 4a938: 588f addql #4,%sp 4a93a: 4a00 tstb %d0 4a93c: 677c beqs 4a9ba <_POSIX_Thread_Translate_sched_param+0xa2><== NEVER TAKEN return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 4a93e: 4293 clrl %a3@ *budget_callout = NULL; 4a940: 4294 clrl %a4@ if ( policy == SCHED_OTHER ) { 4a942: 4a82 tstl %d2 4a944: 6608 bnes 4a94e <_POSIX_Thread_Translate_sched_param+0x36> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 4a946: 7201 moveq #1,%d1 4a948: 4280 clrl %d0 4a94a: 2681 movel %d1,%a3@ return 0; 4a94c: 606e bras 4a9bc <_POSIX_Thread_Translate_sched_param+0xa4> } if ( policy == SCHED_FIFO ) { 4a94e: 7001 moveq #1,%d0 4a950: b082 cmpl %d2,%d0 4a952: 6604 bnes 4a958 <_POSIX_Thread_Translate_sched_param+0x40> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 4a954: 4293 clrl %a3@ 4a956: 6008 bras 4a960 <_POSIX_Thread_Translate_sched_param+0x48> return 0; } if ( policy == SCHED_RR ) { 4a958: 7002 moveq #2,%d0 4a95a: b082 cmpl %d2,%d0 4a95c: 6606 bnes 4a964 <_POSIX_Thread_Translate_sched_param+0x4c> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; 4a95e: 2680 movel %d0,%a3@ 4a960: 4200 clrb %d0 return 0; 4a962: 6058 bras 4a9bc <_POSIX_Thread_Translate_sched_param+0xa4> } if ( policy == SCHED_SPORADIC ) { 4a964: 7004 moveq #4,%d0 4a966: b082 cmpl %d2,%d0 4a968: 6650 bnes 4a9ba <_POSIX_Thread_Translate_sched_param+0xa2> if ( (param->sched_ss_repl_period.tv_sec == 0) && 4a96a: 4aaa 0008 tstl %a2@(8) 4a96e: 6606 bnes 4a976 <_POSIX_Thread_Translate_sched_param+0x5e> (param->sched_ss_repl_period.tv_nsec == 0) ) 4a970: 4aaa 000c tstl %a2@(12) 4a974: 6744 beqs 4a9ba <_POSIX_Thread_Translate_sched_param+0xa2> return EINVAL; if ( (param->sched_ss_init_budget.tv_sec == 0) && 4a976: 4aaa 0010 tstl %a2@(16) 4a97a: 6606 bnes 4a982 <_POSIX_Thread_Translate_sched_param+0x6a> (param->sched_ss_init_budget.tv_nsec == 0) ) 4a97c: 4aaa 0014 tstl %a2@(20) 4a980: 6738 beqs 4a9ba <_POSIX_Thread_Translate_sched_param+0xa2> return EINVAL; if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) < 4a982: 486a 0008 pea %a2@(8) 4a986: 4bf9 0004 88dc lea 488dc <_Timespec_To_ticks>,%a5 4a98c: 4e95 jsr %a5@ 4a98e: 486a 0010 pea %a2@(16) 4a992: 2400 movel %d0,%d2 4a994: 4e95 jsr %a5@ 4a996: 508f addql #8,%sp 4a998: b082 cmpl %d2,%d0 4a99a: 621e bhis 4a9ba <_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 ) ) 4a99c: 2f2a 0004 movel %a2@(4),%sp@- 4a9a0: 4eb9 0004 a8f4 jsr 4a8f4 <_POSIX_Priority_Is_valid> 4a9a6: 588f addql #4,%sp 4a9a8: 4a00 tstb %d0 4a9aa: 670e beqs 4a9ba <_POSIX_Thread_Translate_sched_param+0xa2> return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; 4a9ac: 7003 moveq #3,%d0 *budget_callout = _POSIX_Threads_Sporadic_budget_callout; 4a9ae: 28bc 0004 5568 movel #284008,%a4@ return EINVAL; if ( !_POSIX_Priority_Is_valid( param->sched_ss_low_priority ) ) return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; 4a9b4: 2680 movel %d0,%a3@ *budget_callout = _POSIX_Threads_Sporadic_budget_callout; 4a9b6: 4280 clrl %d0 return 0; 4a9b8: 6002 bras 4a9bc <_POSIX_Thread_Translate_sched_param+0xa4> 4a9ba: 7016 moveq #22,%d0 } return EINVAL; } 4a9bc: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 4a9c2: 4e5e unlk %fp ... 000452cc <_POSIX_Threads_Initialize_user_threads_body>: * * Output parameters: NONE */ void _POSIX_Threads_Initialize_user_threads_body(void) { 452cc: 4e56 ff9c linkw %fp,#-100 452d0: 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; 452d4: 2479 0005 c58e moveal 5c58e ,%a2 maximum = Configuration_POSIX_API.number_of_initialization_threads; 452da: 2839 0005 c58a movel 5c58a ,%d4 if ( !user_threads || maximum == 0 ) 452e0: 4a8a tstl %a2 452e2: 676a beqs 4534e <_POSIX_Threads_Initialize_user_threads_body+0x82><== NEVER TAKEN 452e4: 4a84 tstl %d4 452e6: 6766 beqs 4534e <_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 ); 452e8: 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( 452ea: 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 ) 452ec: 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 ); 452ee: 0682 ffff ffc0 addil #-64,%d2 452f4: 2c3c 0004 a9c8 movel #305608,%d6 (void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); 452fa: 4bf9 0004 a9f4 lea 4a9f4 ,%a5 (void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size); 45300: 49f9 0004 aa2c lea 4aa2c ,%a4 status = pthread_create( 45306: 5985 subql #4,%d5 45308: 47f9 0004 5024 lea 45024 ,%a3 for ( index=0 ; index < maximum ; index++ ) { /* * There is no way for these calls to fail in this situation. */ (void) pthread_attr_init( &attr ); 4530e: 2f02 movel %d2,%sp@- 45310: 2046 moveal %d6,%a0 45312: 4e90 jsr %a0@ (void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); 45314: 4878 0002 pea 2 45318: 2f02 movel %d2,%sp@- 4531a: 4e95 jsr %a5@ (void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size); 4531c: 2f2a 0004 movel %a2@(4),%sp@- 45320: 2f02 movel %d2,%sp@- 45322: 4e94 jsr %a4@ status = pthread_create( 45324: 42a7 clrl %sp@- 45326: 2f12 movel %a2@,%sp@- 45328: 2f02 movel %d2,%sp@- 4532a: 2f05 movel %d5,%sp@- 4532c: 4e93 jsr %a3@ &thread_id, &attr, user_threads[ index ].thread_entry, NULL ); if ( status ) 4532e: 4fef 0024 lea %sp@(36),%sp 45332: 4a80 tstl %d0 45334: 6710 beqs 45346 <_POSIX_Threads_Initialize_user_threads_body+0x7a> _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status ); 45336: 2f00 movel %d0,%sp@- 45338: 4878 0001 pea 1 4533c: 4878 0002 pea 2 45340: 4eb9 0004 6ed0 jsr 46ed0 <_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++ ) { 45346: 5283 addql #1,%d3 45348: 508a addql #8,%a2 4534a: b883 cmpl %d3,%d4 4534c: 62c0 bhis 4530e <_POSIX_Threads_Initialize_user_threads_body+0x42><== NEVER TAKEN NULL ); if ( status ) _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status ); } } 4534e: 4cee 3c7c ff9c moveml %fp@(-100),%d2-%d6/%a2-%a5 45354: 4e5e unlk %fp <== NOT EXECUTED 00049ad4 <_POSIX_Threads_Sporadic_budget_TSR>: */ void _POSIX_Threads_Sporadic_budget_TSR( Objects_Id id __attribute__((unused)), void *argument ) { 49ad4: 4e56 0000 linkw %fp,#0 49ad8: 2f0b movel %a3,%sp@- 49ada: 2f0a movel %a2,%sp@- 49adc: 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 ]; 49ae0: 266a 010e moveal %a2@(270),%a3 /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_init_budget ); 49ae4: 486b 0094 pea %a3@(148) 49ae8: 4eb9 0004 a9e8 jsr 4a9e8 <_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 ) { 49aee: 588f addql #4,%sp 49af0: 4281 clrl %d1 49af2: 1239 0005 b552 moveb 5b552 ,%d1 49af8: 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; 49afc: 2540 0076 movel %d0,%a2@(118) new_priority = _POSIX_Priority_To_core( api->schedparam.sched_priority ); the_thread->real_priority = new_priority; 49b00: 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 ) { 49b04: 4aaa 001c tstl %a2@(28) 49b08: 6618 bnes 49b22 <_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 ) { 49b0a: b2aa 0014 cmpl %a2@(20),%d1 49b0e: 6412 bccs 49b22 <_POSIX_Threads_Sporadic_budget_TSR+0x4e> _Thread_Change_priority( the_thread, new_priority, true ); 49b10: 4878 0001 pea 1 49b14: 2f01 movel %d1,%sp@- 49b16: 2f0a movel %a2,%sp@- 49b18: 4eb9 0004 67e8 jsr 467e8 <_Thread_Change_priority> 49b1e: 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 ); 49b22: 486b 008c pea %a3@(140) 49b26: 4eb9 0004 a9e8 jsr 4a9e8 <_Timespec_To_ticks> _Watchdog_Insert_ticks( &api->Sporadic_timer, ticks ); } 49b2c: 246e fff8 moveal %fp@(-8),%a2 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 49b30: 588f addql #4,%sp Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 49b32: 2740 00b0 movel %d0,%a3@(176) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 49b36: 47eb 00a4 lea %a3@(164),%a3 49b3a: 203c 0005 cde0 movel #380384,%d0 49b40: 2d4b 000c movel %a3,%fp@(12) 49b44: 266e fffc moveal %fp@(-4),%a3 49b48: 2d40 0008 movel %d0,%fp@(8) 49b4c: 4e5e unlk %fp 49b4e: 4ef9 0004 7c50 jmp 47c50 <_Watchdog_Insert> 00049a90 <_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); 49a90: 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 */ 49a92: 72ff moveq #-1,%d1 * _POSIX_Threads_Sporadic_budget_callout */ void _POSIX_Threads_Sporadic_budget_callout( Thread_Control *the_thread ) { 49a94: 4e56 0000 linkw %fp,#0 49a98: 206e 0008 moveal %fp@(8),%a0 49a9c: 1039 0005 b552 moveb 5b552 ,%d0 POSIX_API_Control *api; uint32_t new_priority; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 49aa2: 2268 010e moveal %a0@(270),%a1 49aa6: 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 */ 49aaa: 2141 0076 movel %d1,%a0@(118) new_priority = _POSIX_Priority_To_core(api->schedparam.sched_ss_low_priority); the_thread->real_priority = new_priority; 49aae: 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 ) { 49ab2: 4aa8 001c tstl %a0@(28) 49ab6: 6618 bnes 49ad0 <_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 ) { 49ab8: b0a8 0014 cmpl %a0@(20),%d0 49abc: 6312 blss 49ad0 <_POSIX_Threads_Sporadic_budget_callout+0x40><== NEVER TAKEN _Thread_Change_priority( the_thread, new_priority, true ); 49abe: 4878 0001 pea 1 49ac2: 2f00 movel %d0,%sp@- 49ac4: 2f08 movel %a0,%sp@- 49ac6: 4eb9 0004 67e8 jsr 467e8 <_Thread_Change_priority> 49acc: 4fef 000c lea %sp@(12),%sp #if 0 printk( "lower priority\n" ); #endif } } } 49ad0: 4e5e unlk %fp <== NOT EXECUTED 00044e70 <_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) { 44e70: 4e56 0000 linkw %fp,#0 44e74: 2f0a movel %a2,%sp@- 44e76: 246e 000c moveal %fp@(12),%a2 bool activated; ptimer = (POSIX_Timer_Control *)data; /* Increment the number of expirations. */ ptimer->overrun = ptimer->overrun + 1; 44e7a: 52aa 0066 addql #1,%a2@(102) /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || 44e7e: 4aaa 0052 tstl %a2@(82) 44e82: 6606 bnes 44e8a <_POSIX_Timer_TSR+0x1a> ( ptimer->timer_data.it_interval.tv_nsec != 0 ) ) { 44e84: 4aaa 0056 tstl %a2@(86) 44e88: 6732 beqs 44ebc <_POSIX_Timer_TSR+0x4c> <== NEVER TAKEN activated = _POSIX_Timer_Insert_helper( 44e8a: 2f0a movel %a2,%sp@- 44e8c: 4879 0004 4e70 pea 44e70 <_POSIX_Timer_TSR> 44e92: 2f2a 0008 movel %a2@(8),%sp@- 44e96: 2f2a 0062 movel %a2@(98),%sp@- 44e9a: 486a 0010 pea %a2@(16) 44e9e: 4eb9 0004 a408 jsr 4a408 <_POSIX_Timer_Insert_helper> ptimer->ticks, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) 44ea4: 4fef 0014 lea %sp@(20),%sp 44ea8: 4a00 tstb %d0 44eaa: 672a beqs 44ed6 <_POSIX_Timer_TSR+0x66> <== NEVER TAKEN return; /* Store the time when the timer was started again */ _TOD_Get( &ptimer->time ); 44eac: 486a 006a pea %a2@(106) 44eb0: 4eb9 0004 6348 jsr 46348 <_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 ) || 44eb6: 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; 44eb8: 7003 moveq #3,%d0 44eba: 6002 bras 44ebe <_POSIX_Timer_TSR+0x4e> } else { /* Indicates that the timer is stopped */ ptimer->state = POSIX_TIMER_STATE_CREATE_STOP; 44ebc: 7004 moveq #4,%d0 <== NOT EXECUTED 44ebe: 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 ) ) { 44ec2: 2f2a 0042 movel %a2@(66),%sp@- 44ec6: 2f2a 0038 movel %a2@(56),%sp@- 44eca: 4eb9 0004 9fe8 jsr 49fe8 } /* After the signal handler returns, the count of expirations of the * timer must be set to 0. */ ptimer->overrun = 0; 44ed0: 508f addql #8,%sp 44ed2: 42aa 0066 clrl %a2@(102) } 44ed6: 246e fffc moveal %fp@(-4),%a2 44eda: 4e5e unlk %fp ... 0004b8a0 <_POSIX_signals_Check_signal>: ) { siginfo_t siginfo_struct; sigset_t saved_signals_blocked; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 4b8a0: 4280 clrl %d0 bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 4b8a2: 4e56 ffdc linkw %fp,#-36 siginfo_t siginfo_struct; sigset_t saved_signals_blocked; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 4b8a6: 102e 0013 moveb %fp@(19),%d0 bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 4b8aa: 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, 4b8ae: 4878 0001 pea 1 4b8b2: 260e movel %fp,%d3 4b8b4: 0683 ffff fff4 addil #-12,%d3 4b8ba: 2f00 movel %d0,%sp@- bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 4b8bc: 242e 000c movel %fp@(12),%d2 siginfo_t siginfo_struct; sigset_t saved_signals_blocked; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 4b8c0: 2f03 movel %d3,%sp@- bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 4b8c2: 246e 0008 moveal %fp@(8),%a2 siginfo_t siginfo_struct; sigset_t saved_signals_blocked; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 4b8c6: 2f02 movel %d2,%sp@- 4b8c8: 2f0a movel %a2,%sp@- 4b8ca: 4eb9 0004 b93c jsr 4b93c <_POSIX_signals_Clear_signals> 4b8d0: 4fef 0014 lea %sp@(20),%sp 4b8d4: 4a00 tstb %d0 4b8d6: 6758 beqs 4b930 <_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 ) 4b8d8: 2202 movel %d2,%d1 4b8da: 2002 movel %d2,%d0 4b8dc: 43f9 0005 d1b6 lea 5d1b6 <_POSIX_signals_Vectors>,%a1 4b8e2: e589 lsll #2,%d1 4b8e4: e988 lsll #4,%d0 4b8e6: 9081 subl %d1,%d0 4b8e8: 2040 moveal %d0,%a0 4b8ea: d1fc 0005 d1be addal #381374,%a0 4b8f0: 7201 moveq #1,%d1 4b8f2: 2050 moveal %a0@,%a0 4b8f4: b288 cmpl %a0,%d1 4b8f6: 6738 beqs 4b930 <_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; 4b8f8: 2842 moveal %d2,%a4 4b8fa: 47f4 2a01 lea %a4@(00000001,%d2:l:2),%a3 return false; /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; 4b8fe: 282a 00cc movel %a2@(204),%d4 api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; 4b902: 2231 bc00 movel %a1@(00000000,%a3:l:4),%d1 4b906: 8284 orl %d4,%d1 4b908: 2541 00cc movel %d1,%a2@(204) /* * Here, the signal handler function executes */ switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) { 4b90c: 7202 moveq #2,%d1 4b90e: b2b1 0800 cmpl %a1@(00000000,%d0:l),%d1 4b912: 660e bnes 4b922 <_POSIX_signals_Check_signal+0x82> case SA_SIGINFO: (*_POSIX_signals_Vectors[ signo ].sa_sigaction)( 4b914: 42a7 clrl %sp@- 4b916: 2f03 movel %d3,%sp@- 4b918: 2f02 movel %d2,%sp@- 4b91a: 4e90 jsr %a0@ signo, &siginfo_struct, NULL /* context is undefined per 1003.1b-1993, p. 66 */ ); break; 4b91c: 4fef 000c lea %sp@(12),%sp 4b920: 6006 bras 4b928 <_POSIX_signals_Check_signal+0x88> default: (*_POSIX_signals_Vectors[ signo ].sa_handler)( signo ); 4b922: 2f02 movel %d2,%sp@- 4b924: 4e90 jsr %a0@ 4b926: 588f addql #4,%sp } /* * Restore the previous set of blocked signals */ api->signals_blocked = saved_signals_blocked; 4b928: 2544 00cc movel %d4,%a2@(204) 4b92c: 7001 moveq #1,%d0 return true; 4b92e: 6002 bras 4b932 <_POSIX_signals_Check_signal+0x92> 4b930: 4200 clrb %d0 } 4b932: 4cee 1c1c ffdc moveml %fp@(-36),%d2-%d4/%a2-%a4 4b938: 4e5e unlk %fp <== NOT EXECUTED 0004c7d8 <_POSIX_signals_Clear_process_signals>: clear_signal = true; mask = signo_to_mask( signo ); ISR_Level level; _ISR_Disable( level ); 4c7d8: 203c 0000 0700 movel #1792,%d0 */ void _POSIX_signals_Clear_process_signals( int signo ) { 4c7de: 4e56 0000 linkw %fp,#0 4c7e2: 222e 0008 movel %fp@(8),%d1 4c7e6: 2f03 movel %d3,%sp@- 4c7e8: 2f02 movel %d2,%sp@- clear_signal = true; mask = signo_to_mask( signo ); ISR_Level level; _ISR_Disable( level ); 4c7ea: 40c2 movew %sr,%d2 4c7ec: 8082 orl %d2,%d0 4c7ee: 46c0 movew %d0,%sr if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { 4c7f0: 2601 movel %d1,%d3 4c7f2: 2001 movel %d1,%d0 4c7f4: 41f9 0005 d1b6 lea 5d1b6 <_POSIX_signals_Vectors>,%a0 4c7fa: e58b lsll #2,%d3 4c7fc: e988 lsll #4,%d0 4c7fe: 9083 subl %d3,%d0 4c800: 7602 moveq #2,%d3 4c802: b6b0 0800 cmpl %a0@(00000000,%d0:l),%d3 4c806: 6610 bnes 4c818 <_POSIX_signals_Clear_process_signals+0x40> if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) 4c808: 2040 moveal %d0,%a0 4c80a: d1fc 0005 d3ae addal #381870,%a0 4c810: 2008 movel %a0,%d0 4c812: 5880 addql #4,%d0 4c814: b090 cmpl %a0@,%d0 4c816: 661c bnes 4c834 <_POSIX_signals_Clear_process_signals+0x5c><== NEVER TAKEN clear_signal = false; } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; 4c818: 5381 subql #1,%d1 4c81a: 7001 moveq #1,%d0 4c81c: e3a8 lsll %d1,%d0 4c81e: 4680 notl %d0 4c820: c0b9 0005 d3aa andl 5d3aa <_POSIX_signals_Pending>,%d0 4c826: 23c0 0005 d3aa movel %d0,5d3aa <_POSIX_signals_Pending> if ( !_POSIX_signals_Pending ) 4c82c: 6606 bnes 4c834 <_POSIX_signals_Clear_process_signals+0x5c><== NEVER TAKEN _Thread_Do_post_task_switch_extension--; 4c82e: 53b9 0005 cdaa subql #1,5cdaa <_Thread_Do_post_task_switch_extension> } _ISR_Enable( level ); 4c834: 46c2 movew %d2,%sr } 4c836: 241f movel %sp@+,%d2 4c838: 261f movel %sp@+,%d3 4c83a: 4e5e unlk %fp ... 00045980 <_POSIX_signals_Get_highest>: #include int _POSIX_signals_Get_highest( sigset_t set ) { 45980: 701b moveq #27,%d0 45982: 4e56 fff4 linkw %fp,#-12 45986: 48d7 001c moveml %d2-%d4,%sp@ 4598a: 242e 0008 movel %fp@(8),%d2 int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { if ( set & signo_to_mask( signo ) ) { 4598e: 7601 moveq #1,%d3 45990: 2200 movel %d0,%d1 45992: 5381 subql #1,%d1 45994: 2803 movel %d3,%d4 45996: e3ac lsll %d1,%d4 45998: 2204 movel %d4,%d1 4599a: c282 andl %d2,%d1 4599c: 6626 bnes 459c4 <_POSIX_signals_Get_highest+0x44><== NEVER TAKEN sigset_t set ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 4599e: 5280 addql #1,%d0 459a0: 123c 0020 moveb #32,%d1 459a4: b280 cmpl %d0,%d1 459a6: 66e8 bnes 45990 <_POSIX_signals_Get_highest+0x10> 459a8: 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 ) ) { 459aa: 7601 moveq #1,%d3 459ac: 2200 movel %d0,%d1 459ae: 5381 subql #1,%d1 459b0: 2803 movel %d3,%d4 459b2: e3ac lsll %d1,%d4 459b4: 2204 movel %d4,%d1 459b6: c282 andl %d2,%d1 459b8: 660a bnes 459c4 <_POSIX_signals_Get_highest+0x44> */ #if (SIGHUP != 1) #error "Assumption that SIGHUP==1 violated!!" #endif for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { 459ba: 5280 addql #1,%d0 459bc: 123c 001b moveb #27,%d1 459c0: b280 cmpl %d0,%d1 459c2: 66e8 bnes 459ac <_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; } 459c4: 4cd7 001c moveml %sp@,%d2-%d4 459c8: 4e5e unlk %fp <== NOT EXECUTED 00044e4c <_POSIX_signals_Ualarm_TSR>: void _POSIX_signals_Ualarm_TSR( Objects_Id id __attribute__((unused)), void *argument __attribute__((unused)) ) { 44e4c: 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 ); 44e50: 4eb9 0004 24e8 jsr 424e8 44e56: 4878 000e pea e 44e5a: 2f00 movel %d0,%sp@- 44e5c: 4eb9 0004 4b6c jsr 44b6c RTEMS_INLINE_ROUTINE void _Watchdog_Reset( Watchdog_Control *the_watchdog ) { (void) _Watchdog_Remove( the_watchdog ); 44e62: 4879 0005 ecde pea 5ecde <_POSIX_signals_Ualarm_timer> 44e68: 4eb9 0004 8338 jsr 48338 <_Watchdog_Remove> _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 44e6e: 4fef 000c lea %sp@(12),%sp 44e72: 203c 0005 ecde movel #388318,%d0 44e78: 2d40 000c movel %d0,%fp@(12) 44e7c: 203c 0005 e590 movel #386448,%d0 44e82: 2d40 0008 movel %d0,%fp@(8) /* * If the reset interval is non-zero, reschedule ourselves. */ _Watchdog_Reset( &_POSIX_signals_Ualarm_timer ); } 44e86: 4e5e unlk %fp 44e88: 4ef9 0004 821c jmp 4821c <_Watchdog_Insert> ... 0004c870 <_POSIX_signals_Unblock_thread>: 4c870: 7001 moveq #1,%d0 bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, siginfo_t *info ) { 4c872: 4e56 fff4 linkw %fp,#-12 4c876: 226e 000c moveal %fp@(12),%a1 4c87a: 48d7 040c moveml %d2-%d3/%a2,%sp@ 4c87e: 246e 0008 moveal %fp@(8),%a2 4c882: 2609 movel %a1,%d3 4c884: 5383 subql #1,%d3 /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 4c886: 242a 0010 movel %a2@(16),%d2 4c88a: 0282 1000 8000 andil #268468224,%d2 bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, siginfo_t *info ) { 4c890: 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 ]; 4c894: 206a 010e moveal %a2@(270),%a0 4c898: e7a8 lsll %d3,%d0 /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 4c89a: 0c82 1000 8000 cmpil #268468224,%d2 4c8a0: 6652 bnes 4c8f4 <_POSIX_signals_Unblock_thread+0x84> if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { 4c8a2: 2400 movel %d0,%d2 4c8a4: c4aa 0030 andl %a2@(48),%d2 4c8a8: 660c bnes 4c8b6 <_POSIX_signals_Unblock_thread+0x46> 4c8aa: 2428 00cc movel %a0@(204),%d2 4c8ae: 4682 notl %d2 4c8b0: c082 andl %d2,%d0 4c8b2: 6700 00ac beqw 4c960 <_POSIX_signals_Unblock_thread+0xf0> the_thread->Wait.return_code = EINTR; 4c8b6: 7004 moveq #4,%d0 the_info = (siginfo_t *) the_thread->Wait.return_argument; 4c8b8: 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; 4c8bc: 2540 0034 movel %d0,%a2@(52) the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { 4c8c0: 4a81 tstl %d1 4c8c2: 6610 bnes 4c8d4 <_POSIX_signals_Unblock_thread+0x64> the_info->si_signo = signo; the_info->si_code = SI_USER; 4c8c4: 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; 4c8c8: 2089 movel %a1,%a0@ the_info->si_code = SI_USER; the_info->si_value.sival_int = 0; 4c8ca: 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; 4c8ce: 2141 0004 movel %d1,%a0@(4) 4c8d2: 6012 bras 4c8e6 <_POSIX_signals_Unblock_thread+0x76> the_info->si_value.sival_int = 0; } else { *the_info = *info; 4c8d4: 4878 000c pea c 4c8d8: 2f01 movel %d1,%sp@- 4c8da: 2f08 movel %a0,%sp@- 4c8dc: 4eb9 0004 d2a8 jsr 4d2a8 4c8e2: 4fef 000c lea %sp@(12),%sp } _Thread_queue_Extract_with_proxy( the_thread ); 4c8e6: 2f0a movel %a2,%sp@- 4c8e8: 4eb9 0004 7350 jsr 47350 <_Thread_queue_Extract_with_proxy> return true; 4c8ee: 588f addql #4,%sp the_info->si_value.sival_int = 0; } else { *the_info = *info; } _Thread_queue_Extract_with_proxy( the_thread ); 4c8f0: 7001 moveq #1,%d0 return true; 4c8f2: 606e bras 4c962 <_POSIX_signals_Unblock_thread+0xf2> } /* * Thread is not waiting due to a sigwait. */ if ( ~api->signals_blocked & mask ) { 4c8f4: 2228 00cc movel %a0@(204),%d1 4c8f8: 4681 notl %d1 4c8fa: c081 andl %d1,%d0 4c8fc: 6762 beqs 4c960 <_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 ) { 4c8fe: 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; 4c902: 7201 moveq #1,%d1 4c904: 1541 0074 moveb %d1,%a2@(116) if ( the_thread->current_state & STATES_INTERRUPTIBLE_BY_SIGNAL ) { 4c908: 0800 001c btst #28,%d0 4c90c: 6736 beqs 4c944 <_POSIX_signals_Unblock_thread+0xd4> the_thread->Wait.return_code = EINTR; 4c90e: 7004 moveq #4,%d0 4c910: 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) ){ 4c914: 103c 0008 moveb #8,%d0 4c918: c0aa 0010 andl %a2@(16),%d0 4c91c: 6742 beqs 4c960 <_POSIX_signals_Unblock_thread+0xf0><== NEVER TAKEN if ( _Watchdog_Is_active( &the_thread->Timer ) ) 4c91e: 7202 moveq #2,%d1 4c920: b2aa 0050 cmpl %a2@(80),%d1 4c924: 660c bnes 4c932 <_POSIX_signals_Unblock_thread+0xc2><== NEVER TAKEN (void) _Watchdog_Remove( &the_thread->Timer ); 4c926: 486a 0048 pea %a2@(72) 4c92a: 4eb9 0004 7d6c jsr 47d6c <_Watchdog_Remove> 4c930: 588f addql #4,%sp RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 4c932: 2f3c 1003 fff8 movel #268697592,%sp@- 4c938: 2f0a movel %a2,%sp@- 4c93a: 4eb9 0004 6928 jsr 46928 <_Thread_Clear_state> 4c940: 508f addql #8,%sp 4c942: 601c bras 4c960 <_POSIX_signals_Unblock_thread+0xf0> _Thread_Unblock( the_thread ); } } else if ( the_thread->current_state == STATES_READY ) { 4c944: 4a80 tstl %d0 4c946: 6618 bnes 4c960 <_POSIX_signals_Unblock_thread+0xf0><== NEVER TAKEN if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 4c948: 2039 0005 cda2 movel 5cda2 <_ISR_Nest_level>,%d0 4c94e: 6710 beqs 4c960 <_POSIX_signals_Unblock_thread+0xf0> 4c950: b5f9 0005 cdc2 cmpal 5cdc2 <_Thread_Executing>,%a2 4c956: 6608 bnes 4c960 <_POSIX_signals_Unblock_thread+0xf0><== NEVER TAKEN _ISR_Signals_to_thread_executing = true; 4c958: 7001 moveq #1,%d0 4c95a: 13c0 0005 ce50 moveb %d0,5ce50 <_ISR_Signals_to_thread_executing> 4c960: 4200 clrb %d0 } } return false; } 4c962: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 4c968: 4e5e unlk %fp <== NOT EXECUTED 00049e32 <_RTEMS_tasks_Post_switch_extension>: */ void _RTEMS_tasks_Post_switch_extension( Thread_Control *executing ) { 49e32: 4e56 ffec linkw %fp,#-20 49e36: 206e 0008 moveal %fp@(8),%a0 49e3a: 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 ]; 49e3e: 2468 010a moveal %a0@(266),%a2 if ( !api ) 49e42: 4a8a tstl %a2 49e44: 6754 beqs 49e9a <_RTEMS_tasks_Post_switch_extension+0x68><== NEVER TAKEN * Signal Processing */ asr = &api->Signal; _ISR_Disable( level ); 49e46: 203c 0000 0700 movel #1792,%d0 49e4c: 40c1 movew %sr,%d1 49e4e: 8081 orl %d1,%d0 49e50: 46c0 movew %d0,%sr signal_set = asr->signals_posted; 49e52: 262a 0012 movel %a2@(18),%d3 asr->signals_posted = 0; 49e56: 42aa 0012 clrl %a2@(18) _ISR_Enable( level ); 49e5a: 46c1 movew %d1,%sr if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ 49e5c: 4a83 tstl %d3 49e5e: 673a beqs 49e9a <_RTEMS_tasks_Post_switch_extension+0x68> return; asr->nest_level += 1; 49e60: 52aa 001a addql #1,%a2@(26) rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 49e64: 240e movel %fp,%d2 49e66: 5982 subql #4,%d2 49e68: 47f9 0004 bc9c lea 4bc9c ,%a3 49e6e: 2f02 movel %d2,%sp@- 49e70: 2f3c 0000 ffff movel #65535,%sp@- 49e76: 2f2a 000e movel %a2@(14),%sp@- 49e7a: 4e93 jsr %a3@ (*asr->handler)( signal_set ); 49e7c: 2f03 movel %d3,%sp@- 49e7e: 206a 000a moveal %a2@(10),%a0 49e82: 4e90 jsr %a0@ asr->nest_level -= 1; 49e84: 53aa 001a subql #1,%a2@(26) rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 49e88: 2f02 movel %d2,%sp@- 49e8a: 2f3c 0000 ffff movel #65535,%sp@- 49e90: 2f2e fffc movel %fp@(-4),%sp@- 49e94: 4e93 jsr %a3@ 49e96: 4fef 001c lea %sp@(28),%sp } 49e9a: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3 49ea0: 4e5e unlk %fp <== NOT EXECUTED 00049d92 <_RTEMS_tasks_Switch_extension>: void _RTEMS_tasks_Switch_extension( Thread_Control *executing, Thread_Control *heir ) { 49d92: 4e56 0000 linkw %fp,#0 49d96: 206e 0008 moveal %fp@(8),%a0 /* * Per Task Variables */ tvp = executing->task_variables; 49d9a: 2068 011a moveal %a0@(282),%a0 while (tvp) { 49d9e: 600e bras 49dae <_RTEMS_tasks_Switch_extension+0x1c> tvp->tval = *tvp->ptr; 49da0: 2268 0004 moveal %a0@(4),%a1 49da4: 2151 000c movel %a1@,%a0@(12) *tvp->ptr = tvp->gval; 49da8: 22a8 0008 movel %a0@(8),%a1@ tvp = (rtems_task_variable_t *)tvp->next; 49dac: 2050 moveal %a0@,%a0 /* * Per Task Variables */ tvp = executing->task_variables; while (tvp) { 49dae: 4a88 tstl %a0 49db0: 66ee bnes 49da0 <_RTEMS_tasks_Switch_extension+0xe><== NEVER TAKEN tvp->tval = *tvp->ptr; *tvp->ptr = tvp->gval; tvp = (rtems_task_variable_t *)tvp->next; } tvp = heir->task_variables; 49db2: 206e 000c moveal %fp@(12),%a0 49db6: 2068 011a moveal %a0@(282),%a0 while (tvp) { 49dba: 600e bras 49dca <_RTEMS_tasks_Switch_extension+0x38> tvp->gval = *tvp->ptr; 49dbc: 2268 0004 moveal %a0@(4),%a1 49dc0: 2151 0008 movel %a1@,%a0@(8) *tvp->ptr = tvp->tval; 49dc4: 22a8 000c movel %a0@(12),%a1@ tvp = (rtems_task_variable_t *)tvp->next; 49dc8: 2050 moveal %a0@,%a0 *tvp->ptr = tvp->gval; tvp = (rtems_task_variable_t *)tvp->next; } tvp = heir->task_variables; while (tvp) { 49dca: 4a88 tstl %a0 49dcc: 66ee bnes 49dbc <_RTEMS_tasks_Switch_extension+0x2a> tvp->gval = *tvp->ptr; *tvp->ptr = tvp->tval; tvp = (rtems_task_variable_t *)tvp->next; } } 49dce: 4e5e unlk %fp <== NOT EXECUTED 00057360 <_Region_Process_queue>: */ void _Region_Process_queue( Region_Control *the_region ) { 57360: 4e56 ffe4 linkw %fp,#-28 57364: 2039 0007 545c movel 7545c <_Thread_Dispatch_disable_level>,%d0 5736a: 5280 addql #1,%d0 5736c: 48d7 3c1c moveml %d2-%d4/%a2-%a5,%sp@ 57370: 266e 0008 moveal %fp@(8),%a3 57374: 23c0 0007 545c movel %d0,7545c <_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(); 5737a: 2f39 0007 550e movel 7550e <_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 ); 57380: 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 ); 57382: 280b movel %a3,%d4 57384: 0682 0000 0010 addil #16,%d2 5738a: 0684 0000 0068 addil #104,%d4 57390: 4bf9 0005 2a14 lea 52a14 <_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 ); 57396: 49f9 0005 7a6c lea 57a6c <_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(); 5739c: 4eb9 0005 1fa8 jsr 51fa8 <_API_Mutex_Unlock> 573a2: 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 ); 573a4: 263c 0005 7b70 movel #359280,%d3 573aa: 2f02 movel %d2,%sp@- 573ac: 2043 moveal %d3,%a0 573ae: 4e90 jsr %a0@ if ( the_thread == NULL ) 573b0: 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 ); 573b2: 2440 moveal %d0,%a2 if ( the_thread == NULL ) 573b4: 4a80 tstl %d0 573b6: 672c beqs 573e4 <_Region_Process_queue+0x84> 573b8: 42a7 clrl %sp@- 573ba: 42a7 clrl %sp@- 573bc: 2f2a 0024 movel %a2@(36),%sp@- 573c0: 2f04 movel %d4,%sp@- 573c2: 4e95 jsr %a5@ the_segment = (void **) _Region_Allocate_segment( the_region, the_thread->Wait.count ); if ( the_segment == NULL ) 573c4: 4fef 0010 lea %sp@(16),%sp 573c8: 4a80 tstl %d0 573ca: 6718 beqs 573e4 <_Region_Process_queue+0x84> break; *(void **)the_thread->Wait.return_argument = the_segment; 573cc: 206a 0028 moveal %a2@(40),%a0 the_region->number_of_used_blocks += 1; 573d0: 52ab 0064 addql #1,%a3@(100) ); if ( the_segment == NULL ) break; *(void **)the_thread->Wait.return_argument = the_segment; 573d4: 2080 movel %d0,%a0@ the_region->number_of_used_blocks += 1; _Thread_queue_Extract( &the_region->Wait_queue, the_thread ); 573d6: 2f0a movel %a2,%sp@- 573d8: 2f02 movel %d2,%sp@- 573da: 4e94 jsr %a4@ the_thread->Wait.return_code = RTEMS_SUCCESSFUL; } 573dc: 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; 573de: 42aa 0034 clrl %a2@(52) } 573e2: 60c6 bras 573aa <_Region_Process_queue+0x4a> _Thread_Enable_dispatch(); } 573e4: 4cee 3c1c ffe4 moveml %fp@(-28),%d2-%d4/%a2-%a5 573ea: 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(); 573ec: 4ef9 0005 4012 jmp 54012 <_Thread_Enable_dispatch> ... 000458e4 <_TOD_Validate>: */ bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 458e4: 4e56 0000 linkw %fp,#0 458e8: 206e 0008 moveal %fp@(8),%a0 458ec: 2f03 movel %d3,%sp@- uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); 458ee: 2039 0005 d6b0 movel 5d6b0 ,%d0 */ bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 458f4: 2f02 movel %d2,%sp@- uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 458f6: 4a88 tstl %a0 458f8: 6762 beqs 4595c <_TOD_Validate+0x78> <== NEVER TAKEN (the_tod->ticks >= ticks_per_second) || 458fa: 243c 000f 4240 movel #1000000,%d2 45900: 4c40 2002 remul %d0,%d2,%d2 45904: b4a8 0018 cmpl %a0@(24),%d2 45908: 6352 blss 4595c <_TOD_Validate+0x78> <== NEVER TAKEN (the_tod->second >= TOD_SECONDS_PER_MINUTE) || 4590a: 763b moveq #59,%d3 4590c: b6a8 0014 cmpl %a0@(20),%d3 45910: 654a bcss 4595c <_TOD_Validate+0x78> <== NEVER TAKEN (the_tod->minute >= TOD_MINUTES_PER_HOUR) || 45912: b6a8 0010 cmpl %a0@(16),%d3 45916: 6544 bcss 4595c <_TOD_Validate+0x78> <== NEVER TAKEN (the_tod->hour >= TOD_HOURS_PER_DAY) || 45918: 7017 moveq #23,%d0 4591a: b0a8 000c cmpl %a0@(12),%d0 4591e: 653c bcss 4595c <_TOD_Validate+0x78> <== NEVER TAKEN (the_tod->month == 0) || 45920: 2028 0004 movel %a0@(4),%d0 uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 45924: 6736 beqs 4595c <_TOD_Validate+0x78> <== NEVER TAKEN 45926: 720c moveq #12,%d1 45928: b280 cmpl %d0,%d1 4592a: 6530 bcss 4595c <_TOD_Validate+0x78> <== NEVER TAKEN (the_tod->second >= TOD_SECONDS_PER_MINUTE) || (the_tod->minute >= TOD_MINUTES_PER_HOUR) || (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || 4592c: 2410 movel %a0@,%d2 uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 4592e: 0c82 0000 07c3 cmpil #1987,%d2 45934: 6326 blss 4595c <_TOD_Validate+0x78> <== NEVER TAKEN (the_tod->minute >= TOD_MINUTES_PER_HOUR) || (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) 45936: 2228 0008 movel %a0@(8),%d1 uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 4593a: 6720 beqs 4595c <_TOD_Validate+0x78> <== NEVER TAKEN (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) return false; if ( (the_tod->year % 4) == 0 ) 4593c: 163c 0003 moveb #3,%d3 45940: 41f9 0005 c47e lea 5c47e <_TOD_Days_per_month>,%a0 45946: c483 andl %d3,%d2 45948: 6606 bnes 45950 <_TOD_Validate+0x6c> days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; 4594a: 2030 0c34 movel %a0@(00000034,%d0:l:4),%d0 4594e: 6004 bras 45954 <_TOD_Validate+0x70> else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; 45950: 2030 0c00 movel %a0@(00000000,%d0:l:4),%d0 * false - if the the_tod is invalid * * NOTE: This routine only works for leap-years through 2099. */ bool _TOD_Validate( 45954: b081 cmpl %d1,%d0 45956: 54c0 scc %d0 45958: 4480 negl %d0 4595a: 6002 bras 4595e <_TOD_Validate+0x7a> 4595c: 4200 clrb %d0 if ( the_tod->day > days_in_month ) return false; return true; } 4595e: 241f movel %sp@+,%d2 45960: 261f movel %sp@+,%d3 45962: 4e5e unlk %fp ... 000467e8 <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 467e8: 4e56 fff0 linkw %fp,#-16 467ec: 48d7 041c moveml %d2-%d4/%a2,%sp@ 467f0: 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 ); 467f4: 2f0a movel %a2,%sp@- void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 467f6: 262e 000c movel %fp@(12),%d3 */ /* * Save original state */ original_state = the_thread->current_state; 467fa: 242a 0010 movel %a2@(16),%d2 void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 467fe: 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 ); 46802: 4eb9 0004 75f8 jsr 475f8 <_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 ) 46808: 588f addql #4,%sp 4680a: b6aa 0014 cmpl %a2@(20),%d3 4680e: 670c beqs 4681c <_Thread_Change_priority+0x34> _Thread_Set_priority( the_thread, new_priority ); 46810: 2f03 movel %d3,%sp@- 46812: 2f0a movel %a2,%sp@- 46814: 4eb9 0004 74a0 jsr 474a0 <_Thread_Set_priority> 4681a: 508f addql #8,%sp _ISR_Disable( level ); 4681c: 223c 0000 0700 movel #1792,%d1 46822: 40c0 movew %sr,%d0 46824: 8280 orl %d0,%d1 46826: 46c1 movew %d1,%sr 46828: 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; 4682a: 222a 0010 movel %a2@(16),%d1 4682e: c483 andl %d3,%d2 if ( state != STATES_TRANSIENT ) { 46830: b681 cmpl %d1,%d3 46832: 6730 beqs 46864 <_Thread_Change_priority+0x7c> /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) 46834: 4a82 tstl %d2 46836: 6608 bnes 46840 <_Thread_Change_priority+0x58> <== NEVER TAKEN the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); 46838: 74fb moveq #-5,%d2 4683a: c481 andl %d1,%d2 4683c: 2542 0010 movel %d2,%a2@(16) _ISR_Enable( level ); 46840: 46c0 movew %d0,%sr if ( _States_Is_waiting_on_thread_queue( state ) ) { 46842: 0281 0003 bee0 andil #245472,%d1 46848: 6700 00d2 beqw 4691c <_Thread_Change_priority+0x134> _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); 4684c: 2d4a 000c movel %a2,%fp@(12) 46850: 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 ); } 46856: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 4685c: 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 ); 4685e: 4ef9 0004 7404 jmp 47404 <_Thread_queue_Requeue> } return; } /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) { 46864: 4a82 tstl %d2 46866: 6650 bnes 468b8 <_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; 46868: 226a 008e moveal %a2@(142),%a1 4686c: 322a 0094 movew %a2@(148),%d1 46870: 3411 movew %a1@,%d2 46872: 206a 008a moveal %a2@(138),%a0 46876: 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 ); 46878: 42aa 0010 clrl %a2@(16) 4687c: 3281 movew %d1,%a1@ _Priority_Major_bit_map |= the_priority_map->ready_major; 4687e: 3239 0005 cdb8 movew 5cdb8 <_Priority_Major_bit_map>,%d1 46884: 342a 0092 movew %a2@(146),%d2 46888: 8282 orl %d2,%d1 4688a: 33c1 0005 cdb8 movew %d1,5cdb8 <_Priority_Major_bit_map> _Priority_Add_to_bit_map( &the_thread->Priority_map ); if ( prepend_it ) 46890: 4a04 tstb %d4 46892: 6710 beqs 468a4 <_Thread_Change_priority+0xbc> ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 46894: 2250 moveal %a0@,%a1 Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 46896: 2548 0004 movel %a0,%a2@(4) before_node = after_node->next; after_node->next = the_node; 4689a: 208a movel %a2,%a0@ the_node->next = before_node; before_node->previous = the_node; 4689c: 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; 468a0: 2489 movel %a1,%a2@ 468a2: 6014 bras 468b8 <_Thread_Change_priority+0xd0> Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 468a4: 2608 movel %a0,%d3 468a6: 5883 addql #4,%d3 468a8: 2483 movel %d3,%a2@ old_last_node = the_chain->last; 468aa: 2268 0008 moveal %a0@(8),%a1 the_chain->last = the_node; 468ae: 214a 0008 movel %a2,%a0@(8) old_last_node->next = the_node; the_node->previous = old_last_node; 468b2: 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; 468b6: 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 ); 468b8: 223c 0000 0700 movel #1792,%d1 468be: 46c0 movew %d0,%sr 468c0: 8280 orl %d0,%d1 468c2: 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 ); 468c4: 3239 0005 cdb8 movew 5cdb8 <_Priority_Major_bit_map>,%d1 468ca: 4841 swap %d1 468cc: 04c1 ff1 %d1 _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 468ce: 4282 clrl %d2 468d0: 41f9 0005 ce28 lea 5ce28 <_Priority_Bit_map>,%a0 468d6: 3401 movew %d1,%d2 468d8: 3230 2a00 movew %a0@(00000000,%d2:l:2),%d1 468dc: 4841 swap %d1 468de: 04c1 ff1 %d1 * ready thread. */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) 468e0: 4283 clrl %d3 468e2: e98a lsll #4,%d2 468e4: 3601 movew %d1,%d3 468e6: 2279 0005 ccb4 moveal 5ccb4 <_Thread_Ready_chain>,%a1 468ec: 2202 movel %d2,%d1 468ee: d283 addl %d3,%d1 468f0: 2401 movel %d1,%d2 468f2: e58a lsll #2,%d2 468f4: 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 ); 468f6: 2079 0005 cdc2 moveal 5cdc2 <_Thread_Executing>,%a0 * ready thread. */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) 468fc: 93c2 subal %d2,%a1 468fe: 2231 1800 movel %a1@(00000000,%d1:l),%d1 46902: 23c1 0005 cd96 movel %d1,5cd96 <_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() && 46908: b288 cmpl %a0,%d1 4690a: 670e beqs 4691a <_Thread_Change_priority+0x132> _Thread_Executing->is_preemptible ) 4690c: 4a28 0075 tstb %a0@(117) 46910: 6708 beqs 4691a <_Thread_Change_priority+0x132> _Context_Switch_necessary = true; 46912: 7201 moveq #1,%d1 46914: 13c1 0005 cdd2 moveb %d1,5cdd2 <_Context_Switch_necessary> _ISR_Enable( level ); 4691a: 46c0 movew %d0,%sr } 4691c: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 46922: 4e5e unlk %fp ... 00046928 <_Thread_Clear_state>: void _Thread_Clear_state( Thread_Control *the_thread, States_Control state ) { 46928: 4e56 ffec linkw %fp,#-20 4692c: 206e 0008 moveal %fp@(8),%a0 46930: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ ISR_Level level; States_Control current_state; _ISR_Disable( level ); 46934: 263c 0000 0700 movel #1792,%d3 4693a: 2203 movel %d3,%d1 void _Thread_Clear_state( Thread_Control *the_thread, States_Control state ) { 4693c: 202e 000c movel %fp@(12),%d0 ISR_Level level; States_Control current_state; _ISR_Disable( level ); 46940: 40c2 movew %sr,%d2 46942: 8282 orl %d2,%d1 46944: 46c1 movew %d1,%sr current_state = the_thread->current_state; 46946: 2228 0010 movel %a0@(16),%d1 if ( current_state & state ) { 4694a: 2800 movel %d0,%d4 4694c: c881 andl %d1,%d4 4694e: 6778 beqs 469c8 <_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); 46950: 4680 notl %d0 46952: c081 andl %d1,%d0 current_state = 46954: 2140 0010 movel %d0,%a0@(16) the_thread->current_state = _States_Clear( state, current_state ); if ( _States_Is_ready( current_state ) ) { 46958: 666e bnes 469c8 <_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; 4695a: 2668 008e moveal %a0@(142),%a3 4695e: 3028 0094 movew %a0@(148),%d0 46962: 3213 movew %a3@,%d1 _Priority_Add_to_bit_map( &the_thread->Priority_map ); _Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node); 46964: 2268 008a moveal %a0@(138),%a1 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 46968: 2809 movel %a1,%d4 4696a: 5884 addql #4,%d4 4696c: 8081 orl %d1,%d0 4696e: 2084 movel %d4,%a0@ old_last_node = the_chain->last; 46970: 2469 0008 moveal %a1@(8),%a2 46974: 3680 movew %d0,%a3@ the_chain->last = the_node; 46976: 2348 0008 movel %a0,%a1@(8) _Priority_Major_bit_map |= the_priority_map->ready_major; 4697a: 3039 0005 cdb8 movew 5cdb8 <_Priority_Major_bit_map>,%d0 46980: 3228 0092 movew %a0@(146),%d1 old_last_node->next = the_node; the_node->previous = old_last_node; 46984: 214a 0004 movel %a2,%a0@(4) 46988: 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; 4698a: 2488 movel %a0,%a2@ 4698c: 33c0 0005 cdb8 movew %d0,5cdb8 <_Priority_Major_bit_map> _ISR_Flash( level ); 46992: 2003 movel %d3,%d0 46994: 46c2 movew %d2,%sr 46996: 8082 orl %d2,%d0 46998: 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 ) { 4699a: 2028 0014 movel %a0@(20),%d0 4699e: 2279 0005 cd96 moveal 5cd96 <_Thread_Heir>,%a1 469a4: b0a9 0014 cmpl %a1@(20),%d0 469a8: 641e bccs 469c8 <_Thread_Clear_state+0xa0> _Thread_Heir = the_thread; 469aa: 23c8 0005 cd96 movel %a0,5cd96 <_Thread_Heir> if ( _Thread_Executing->is_preemptible || 469b0: 2079 0005 cdc2 moveal 5cdc2 <_Thread_Executing>,%a0 469b6: 4a28 0075 tstb %a0@(117) 469ba: 6604 bnes 469c0 <_Thread_Clear_state+0x98> 469bc: 4a80 tstl %d0 469be: 6608 bnes 469c8 <_Thread_Clear_state+0xa0> <== ALWAYS TAKEN the_thread->current_priority == 0 ) _Context_Switch_necessary = true; 469c0: 7001 moveq #1,%d0 469c2: 13c0 0005 cdd2 moveb %d0,5cdd2 <_Context_Switch_necessary> } } } _ISR_Enable( level ); 469c8: 46c2 movew %d2,%sr } 469ca: 4cd7 0c1c moveml %sp@,%d2-%d4/%a2-%a3 469ce: 4e5e unlk %fp ... 00046b54 <_Thread_Delay_ended>: void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { 46b54: 4e56 fffc linkw %fp,#-4 Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 46b58: 486e fffc pea %fp@(-4) 46b5c: 2f2e 0008 movel %fp@(8),%sp@- 46b60: 4eb9 0004 6d08 jsr 46d08 <_Thread_Get> switch ( location ) { 46b66: 508f addql #8,%sp 46b68: 4aae fffc tstl %fp@(-4) 46b6c: 661e bnes 46b8c <_Thread_Delay_ended+0x38> <== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_Clear_state( 46b6e: 2f3c 1000 0018 movel #268435480,%sp@- 46b74: 2f00 movel %d0,%sp@- 46b76: 4eb9 0004 6928 jsr 46928 <_Thread_Clear_state> 46b7c: 508f addql #8,%sp 46b7e: 2039 0005 cd08 movel 5cd08 <_Thread_Dispatch_disable_level>,%d0 46b84: 5380 subql #1,%d0 46b86: 23c0 0005 cd08 movel %d0,5cd08 <_Thread_Dispatch_disable_level> | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Thread_Unnest_dispatch(); break; } } 46b8c: 4e5e unlk %fp <== NOT EXECUTED 00046b90 <_Thread_Dispatch>: Thread_Control *executing; Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); 46b90: 307c 0700 moveaw #1792,%a0 46b94: 2208 movel %a0,%d1 * dispatch thread * no dispatch thread */ void _Thread_Dispatch( void ) { 46b96: 4e56 ffc8 linkw %fp,#-56 46b9a: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ Thread_Control *executing; Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; 46b9e: 2479 0005 cdc2 moveal 5cdc2 <_Thread_Executing>,%a2 _ISR_Disable( level ); 46ba4: 40c0 movew %sr,%d0 46ba6: 8280 orl %d0,%d1 46ba8: 46c1 movew %d1,%sr _ISR_Enable( level ); #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 46baa: 260e movel %fp,%d3 _Timestamp_Subtract( 46bac: 240e movel %fp,%d2 _ISR_Enable( level ); #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 46bae: 5183 subql #8,%d3 _Timestamp_Subtract( 46bb0: 0682 ffff fff0 addil #-16,%d2 46bb6: 2e3c 0004 79a0 movel #293280,%d7 &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); 46bbc: 2c3c 0004 7968 movel #293224,%d6 if ( _Thread_libc_reent ) { executing->libc_reent = *_Thread_libc_reent; *_Thread_libc_reent = heir->libc_reent; } _User_extensions_Thread_switch( executing, heir ); 46bc2: 2a3c 0004 7c18 movel #293912,%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 ); 46bc8: 4bf9 0004 8088 lea 48088 <_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 ); 46bce: 49f9 0004 8066 lea 48066 <_CPU_Context_save_fp>,%a4 if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 46bd4: 283c 0004 7f30 movel #294704,%d4 Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { 46bda: 6000 00d0 braw 46cac <_Thread_Dispatch+0x11c> heir = _Thread_Heir; _Thread_Dispatch_disable_level = 1; 46bde: 7201 moveq #1,%d1 46be0: 23c1 0005 cd08 movel %d1,5cd08 <_Thread_Dispatch_disable_level> ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { heir = _Thread_Heir; 46be6: 2679 0005 cd96 moveal 5cd96 <_Thread_Heir>,%a3 _Thread_Dispatch_disable_level = 1; _Context_Switch_necessary = false; 46bec: 4201 clrb %d1 _Thread_Executing = heir; 46bee: 23cb 0005 cdc2 movel %a3,5cdc2 <_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; 46bf4: 13c1 0005 cdd2 moveb %d1,5cdd2 <_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 ) 46bfa: 7201 moveq #1,%d1 46bfc: b2ab 007a cmpl %a3@(122),%d1 46c00: 660a bnes 46c0c <_Thread_Dispatch+0x7c> heir->cpu_time_budget = _Thread_Ticks_per_timeslice; 46c02: 41f9 0005 ccb8 lea 5ccb8 <_Thread_Ticks_per_timeslice>,%a0 46c08: 2750 0076 movel %a0@,%a3@(118) _ISR_Enable( level ); 46c0c: 46c0 movew %d0,%sr #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 46c0e: 2f03 movel %d3,%sp@- 46c10: 4eb9 0004 a244 jsr 4a244 <_TOD_Get_uptime> _Timestamp_Subtract( 46c16: 2047 moveal %d7,%a0 46c18: 2f02 movel %d2,%sp@- 46c1a: 2f03 movel %d3,%sp@- 46c1c: 4879 0005 cdca pea 5cdca <_Thread_Time_of_last_context_switch> 46c22: 4e90 jsr %a0@ &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); 46c24: 2046 moveal %d6,%a0 46c26: 2f02 movel %d2,%sp@- 46c28: 486a 0082 pea %a2@(130) 46c2c: 4e90 jsr %a0@ #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 46c2e: 2079 0005 cd92 moveal 5cd92 <_Thread_libc_reent>,%a0 46c34: 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; 46c38: 202e fff8 movel %fp@(-8),%d0 46c3c: 222e fffc movel %fp@(-4),%d1 46c40: 23c0 0005 cdca movel %d0,5cdca <_Thread_Time_of_last_context_switch> 46c46: 23c1 0005 cdce movel %d1,5cdce <_Thread_Time_of_last_context_switch+0x4> #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 46c4c: 4a88 tstl %a0 46c4e: 6708 beqs 46c58 <_Thread_Dispatch+0xc8> <== NEVER TAKEN executing->libc_reent = *_Thread_libc_reent; 46c50: 2550 0106 movel %a0@,%a2@(262) *_Thread_libc_reent = heir->libc_reent; 46c54: 20ab 0106 movel %a3@(262),%a0@ } _User_extensions_Thread_switch( executing, heir ); 46c58: 2f0b movel %a3,%sp@- 46c5a: 2045 moveal %d5,%a0 46c5c: 2f0a movel %a2,%sp@- 46c5e: 4e90 jsr %a0@ if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 46c60: 486b 00ce pea %a3@(206) 46c64: 2044 moveal %d4,%a0 46c66: 486a 00ce pea %a2@(206) 46c6a: 4e90 jsr %a0@ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && 46c6c: 4fef 0010 lea %sp@(16),%sp 46c70: 4aaa 0102 tstl %a2@(258) 46c74: 6724 beqs 46c9a <_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 ); 46c76: 2079 0005 cd8e moveal 5cd8e <_Thread_Allocated_fp>,%a0 46c7c: b1ca cmpal %a2,%a0 46c7e: 671a beqs 46c9a <_Thread_Dispatch+0x10a> !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) 46c80: 4a88 tstl %a0 46c82: 6708 beqs 46c8c <_Thread_Dispatch+0xfc> _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 46c84: 4868 0102 pea %a0@(258) 46c88: 4e94 jsr %a4@ 46c8a: 588f addql #4,%sp _Context_Restore_fp( &executing->fp_context ); 46c8c: 486a 0102 pea %a2@(258) 46c90: 4e95 jsr %a5@ _Thread_Allocated_fp = executing; 46c92: 588f addql #4,%sp 46c94: 23ca 0005 cd8e movel %a2,5cd8e <_Thread_Allocated_fp> if ( executing->fp_context != NULL ) _Context_Restore_fp( &executing->fp_context ); #endif #endif executing = _Thread_Executing; 46c9a: 2479 0005 cdc2 moveal 5cdc2 <_Thread_Executing>,%a2 _ISR_Disable( level ); 46ca0: 223c 0000 0700 movel #1792,%d1 46ca6: 40c0 movew %sr,%d0 46ca8: 8280 orl %d0,%d1 46caa: 46c1 movew %d1,%sr Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { 46cac: 1239 0005 cdd2 moveb 5cdd2 <_Context_Switch_necessary>,%d1 46cb2: 6600 ff2a bnew 46bde <_Thread_Dispatch+0x4e> executing = _Thread_Executing; _ISR_Disable( level ); } _Thread_Dispatch_disable_level = 0; 46cb6: 42b9 0005 cd08 clrl 5cd08 <_Thread_Dispatch_disable_level> _ISR_Enable( level ); 46cbc: 46c0 movew %d0,%sr if ( _Thread_Do_post_task_switch_extension || 46cbe: 4ab9 0005 cdaa tstl 5cdaa <_Thread_Do_post_task_switch_extension> 46cc4: 6606 bnes 46ccc <_Thread_Dispatch+0x13c> executing->do_post_task_switch_extension ) { 46cc6: 4a2a 0074 tstb %a2@(116) 46cca: 670c beqs 46cd8 <_Thread_Dispatch+0x148> executing->do_post_task_switch_extension = false; 46ccc: 4200 clrb %d0 46cce: 1540 0074 moveb %d0,%a2@(116) _API_extensions_Run_postswitch(); 46cd2: 4eb9 0004 5786 jsr 45786 <_API_extensions_Run_postswitch> } } 46cd8: 4cee 3cfc ffc8 moveml %fp@(-56),%d2-%d7/%a2-%a5 46cde: 4e5e unlk %fp <== NOT EXECUTED 0004c094 <_Thread_Evaluate_mode>: * * XXX */ bool _Thread_Evaluate_mode( void ) { 4c094: 4e56 0000 linkw %fp,#0 Thread_Control *executing; executing = _Thread_Executing; 4c098: 2079 0005 cdc2 moveal 5cdc2 <_Thread_Executing>,%a0 if ( !_States_Is_ready( executing->current_state ) || 4c09e: 4aa8 0010 tstl %a0@(16) 4c0a2: 660e bnes 4c0b2 <_Thread_Evaluate_mode+0x1e> <== NEVER TAKEN 4c0a4: b1f9 0005 cd96 cmpal 5cd96 <_Thread_Heir>,%a0 4c0aa: 6710 beqs 4c0bc <_Thread_Evaluate_mode+0x28> ( !_Thread_Is_heir( executing ) && executing->is_preemptible ) ) { 4c0ac: 4a28 0075 tstb %a0@(117) 4c0b0: 670a beqs 4c0bc <_Thread_Evaluate_mode+0x28> <== NEVER TAKEN _Context_Switch_necessary = true; 4c0b2: 7001 moveq #1,%d0 4c0b4: 13c0 0005 cdd2 moveb %d0,5cdd2 <_Context_Switch_necessary> return true; 4c0ba: 6002 bras 4c0be <_Thread_Evaluate_mode+0x2a> 4c0bc: 4200 clrb %d0 } return false; } 4c0be: 4e5e unlk %fp ... 0004c0c4 <_Thread_Handler>: * * Output parameters: NONE */ void _Thread_Handler( void ) { 4c0c4: 4e56 0000 linkw %fp,#0 4c0c8: 2f0a movel %a2,%sp@- #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static char doneConstructors; char doneCons; #endif executing = _Thread_Executing; 4c0ca: 2479 0005 cdc2 moveal 5cdc2 <_Thread_Executing>,%a2 * * Output parameters: NONE */ void _Thread_Handler( void ) { 4c0d0: 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; 4c0d2: 222a 00b4 movel %a2@(180),%d1 _ISR_Set_level(level); 4c0d6: 40c0 movew %sr,%d0 4c0d8: e189 lsll #8,%d1 4c0da: 0280 0000 f8ff andil #63743,%d0 4c0e0: 8081 orl %d1,%d0 4c0e2: 46c0 movew %d0,%sr #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) doneCons = doneConstructors; doneConstructors = 1; 4c0e4: 7001 moveq #1,%d0 level = executing->Start.isr_level; _ISR_Set_level(level); #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) doneCons = doneConstructors; 4c0e6: 1439 0005 c4b8 moveb 5c4b8 ,%d2 doneConstructors = 1; 4c0ec: 13c0 0005 c4b8 moveb %d0,5c4b8 #endif #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && 4c0f2: 4aaa 0102 tstl %a2@(258) 4c0f6: 6720 beqs 4c118 <_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 ); 4c0f8: 2079 0005 cd8e moveal 5cd8e <_Thread_Allocated_fp>,%a0 4c0fe: b1ca cmpal %a2,%a0 4c100: 6716 beqs 4c118 <_Thread_Handler+0x54> !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) 4c102: 4a88 tstl %a0 4c104: 670c beqs 4c112 <_Thread_Handler+0x4e> _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 4c106: 4868 0102 pea %a0@(258) 4c10a: 4eb9 0004 8066 jsr 48066 <_CPU_Context_save_fp> 4c110: 588f addql #4,%sp _Thread_Allocated_fp = executing; 4c112: 23ca 0005 cd8e movel %a2,5cd8e <_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 ); 4c118: 2f0a movel %a2,%sp@- 4c11a: 4eb9 0004 7a98 jsr 47a98 <_User_extensions_Thread_begin> /* * At this point, the dispatch disable level BETTER be 1. */ _Thread_Enable_dispatch(); 4c120: 4eb9 0004 6ce2 jsr 46ce2 <_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) */ { 4c126: 588f addql #4,%sp 4c128: 4a02 tstb %d2 4c12a: 6606 bnes 4c132 <_Thread_Handler+0x6e> INIT_NAME (); 4c12c: 4eb9 0005 99ac jsr 599ac <_init> } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 4c132: 202a 009e movel %a2@(158),%d0 4c136: 6606 bnes 4c13e <_Thread_Handler+0x7a> executing->Wait.return_argument = (*(Thread_Entry_numeric) executing->Start.entry_point)( 4c138: 2f2a 00a6 movel %a2@(166),%sp@- 4c13c: 600a bras 4c148 <_Thread_Handler+0x84> executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { 4c13e: 7201 moveq #1,%d1 4c140: b280 cmpl %d0,%d1 4c142: 6610 bnes 4c154 <_Thread_Handler+0x90> <== NEVER TAKEN executing->Wait.return_argument = (*(Thread_Entry_pointer) executing->Start.entry_point)( 4c144: 2f2a 00a2 movel %a2@(162),%sp@- 4c148: 206a 009a moveal %a2@(154),%a0 4c14c: 4e90 jsr %a0@ executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { executing->Wait.return_argument = 4c14e: 588f addql #4,%sp 4c150: 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 ); 4c154: 2f0a movel %a2,%sp@- 4c156: 4eb9 0004 7ad0 jsr 47ad0 <_User_extensions_Thread_exitted> _Internal_error_Occurred( 4c15c: 4878 0006 pea 6 4c160: 4878 0001 pea 1 4c164: 42a7 clrl %sp@- 4c166: 4eb9 0004 5fd8 jsr 45fd8 <_Internal_error_Occurred> 00046d94 <_Thread_Initialize>: Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 46d94: 4e56 ffe8 linkw %fp,#-24 46d98: 222e 0010 movel %fp@(16),%d1 46d9c: 48d7 047c moveml %d2-%d6/%a2,%sp@ 46da0: 246e 000c moveal %fp@(12),%a2 46da4: 242e 0014 movel %fp@(20),%d2 46da8: 282e 001c movel %fp@(28),%d4 46dac: 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; 46db0: 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 ) { 46db4: 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; 46db8: 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 ) { 46dbc: 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; 46dc0: 42aa 0112 clrl %a2@(274) extensions_area = NULL; the_thread->libc_reent = NULL; 46dc4: 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 ) { 46dc8: 4a81 tstl %d1 46dca: 6620 bnes 46dec <_Thread_Initialize+0x58> actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); 46dcc: 2f02 movel %d2,%sp@- 46dce: 2f0a movel %a2,%sp@- 46dd0: 4eb9 0004 7674 jsr 47674 <_Thread_Stack_Allocate> if ( !actual_stack_size || actual_stack_size < stack_size ) 46dd6: 508f addql #8,%sp 46dd8: 4a80 tstl %d0 46dda: 6700 0176 beqw 46f52 <_Thread_Initialize+0x1be> 46dde: b480 cmpl %d0,%d2 46de0: 6200 0170 bhiw 46f52 <_Thread_Initialize+0x1be> return false; /* stack allocation failed */ stack = the_thread->Start.stack; 46de4: 222a 00ca movel %a2@(202),%d1 the_thread->Start.core_allocated_stack = true; 46de8: 7401 moveq #1,%d2 46dea: 6004 bras 46df0 <_Thread_Initialize+0x5c> } else { stack = stack_area; actual_stack_size = stack_size; the_thread->Start.core_allocated_stack = false; 46dec: 2002 movel %d2,%d0 46dee: 4202 clrb %d2 Stack_Control *the_stack, void *starting_address, size_t size ) { the_stack->area = starting_address; 46df0: 2541 00c2 movel %d1,%a2@(194) 46df4: 1542 00bc moveb %d2,%a2@(188) the_stack->size = size; 46df8: 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 ) { 46dfc: 4a03 tstb %d3 46dfe: 6604 bnes 46e04 <_Thread_Initialize+0x70> 46e00: 4283 clrl %d3 46e02: 6016 bras 46e1a <_Thread_Initialize+0x86> fp_area = _Workspace_Allocate( CONTEXT_FP_SIZE ); 46e04: 4878 001c pea 1c 46e08: 4eb9 0004 7e98 jsr 47e98 <_Workspace_Allocate> if ( !fp_area ) 46e0e: 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 ); 46e10: 2600 movel %d0,%d3 if ( !fp_area ) 46e12: 6606 bnes 46e1a <_Thread_Initialize+0x86> 46e14: 4282 clrl %d2 46e16: 6000 00d4 braw 46eec <_Thread_Initialize+0x158> #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { 46e1a: 2039 0005 cda6 movel 5cda6 <_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; 46e20: 2543 0102 movel %d3,%a2@(258) the_thread->Start.fp_context = fp_area; 46e24: 2543 00c6 movel %d3,%a2@(198) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 46e28: 42aa 0050 clrl %a2@(80) the_watchdog->routine = routine; 46e2c: 42aa 0064 clrl %a2@(100) the_watchdog->id = id; 46e30: 42aa 0068 clrl %a2@(104) the_watchdog->user_data = user_data; 46e34: 42aa 006c clrl %a2@(108) #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { 46e38: 4a80 tstl %d0 46e3a: 6604 bnes 46e40 <_Thread_Initialize+0xac> 46e3c: 4282 clrl %d2 46e3e: 6016 bras 46e56 <_Thread_Initialize+0xc2> extensions_area = _Workspace_Allocate( 46e40: e588 lsll #2,%d0 46e42: 2040 moveal %d0,%a0 46e44: 4868 0004 pea %a0@(4) 46e48: 4eb9 0004 7e98 jsr 47e98 <_Workspace_Allocate> (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) 46e4e: 588f addql #4,%sp /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { extensions_area = _Workspace_Allocate( 46e50: 2400 movel %d0,%d2 (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) 46e52: 6700 0098 beqw 46eec <_Thread_Initialize+0x158> goto failed; } the_thread->extensions = (void **) extensions_area; 46e56: 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 ) { 46e5a: 6718 beqs 46e74 <_Thread_Initialize+0xe0> for ( i = 0; i <= _Thread_Maximum_extensions ; i++ ) 46e5c: 2239 0005 cda6 movel 5cda6 <_Thread_Maximum_extensions>,%d1 46e62: 4280 clrl %d0 46e64: 600a bras 46e70 <_Thread_Initialize+0xdc> the_thread->extensions[i] = NULL; 46e66: 206a 0116 moveal %a2@(278),%a0 46e6a: 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++ ) 46e6e: 5280 addql #1,%d0 46e70: b280 cmpl %d0,%d1 46e72: 64f2 bccs 46e66 <_Thread_Initialize+0xd2> /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; 46e74: 2545 00ac movel %d5,%a2@(172) the_thread->Start.budget_callout = budget_callout; switch ( budget_algorithm ) { 46e78: 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; 46e7a: 256e 0028 00b0 movel %fp@(40),%a2@(176) /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; 46e80: 1546 00aa moveb %d6,%a2@(170) the_thread->Start.budget_algorithm = budget_algorithm; the_thread->Start.budget_callout = budget_callout; switch ( budget_algorithm ) { 46e84: b085 cmpl %d5,%d0 46e86: 660a bnes 46e92 <_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; 46e88: 41f9 0005 ccb8 lea 5ccb8 <_Thread_Ticks_per_timeslice>,%a0 46e8e: 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 ); 46e92: 2f04 movel %d4,%sp@- case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; 46e94: 256e 002c 00b4 movel %fp@(44),%a2@(180) the_thread->current_state = STATES_DORMANT; 46e9a: 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 ); 46e9c: 2f0a movel %a2,%sp@- #endif } the_thread->Start.isr_level = isr_level; the_thread->current_state = STATES_DORMANT; 46e9e: 2540 0010 movel %d0,%a2@(16) the_thread->Wait.queue = NULL; 46ea2: 42aa 0044 clrl %a2@(68) the_thread->resource_count = 0; 46ea6: 42aa 001c clrl %a2@(28) #if defined(RTEMS_ITRON_API) the_thread->suspend_count = 0; #endif the_thread->real_priority = priority; 46eaa: 2544 0018 movel %d4,%a2@(24) the_thread->Start.initial_priority = priority; 46eae: 2544 00b8 movel %d4,%a2@(184) _Thread_Set_priority( the_thread, priority ); 46eb2: 4eb9 0004 74a0 jsr 474a0 <_Thread_Set_priority> #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 46eb8: 206e 0008 moveal %fp@(8),%a0 46ebc: 4280 clrl %d0 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 46ebe: 256e 0030 000c movel %fp@(48),%a2@(12) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 46ec4: 2068 0018 moveal %a0@(24),%a0 46ec8: 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 ); 46ecc: 42aa 0082 clrl %a2@(130) 46ed0: 218a 0c00 movel %a2,%a0@(00000000,%d0:l:4) 46ed4: 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 ); 46ed8: 2f0a movel %a2,%sp@- 46eda: 4eb9 0004 7b54 jsr 47b54 <_User_extensions_Thread_create> if ( extension_status ) 46ee0: 4fef 000c lea %sp@(12),%sp 46ee4: 4a00 tstb %d0 46ee6: 6704 beqs 46eec <_Thread_Initialize+0x158> 46ee8: 7001 moveq #1,%d0 46eea: 6068 bras 46f54 <_Thread_Initialize+0x1c0> return true; failed: if ( the_thread->libc_reent ) 46eec: 202a 0106 movel %a2@(262),%d0 46ef0: 670a beqs 46efc <_Thread_Initialize+0x168> _Workspace_Free( the_thread->libc_reent ); 46ef2: 2f00 movel %d0,%sp@- 46ef4: 4eb9 0004 7eb4 jsr 47eb4 <_Workspace_Free> 46efa: 588f addql #4,%sp for ( i=0 ; i <= THREAD_API_LAST ; i++ ) if ( the_thread->API_Extensions[i] ) 46efc: 202a 010a movel %a2@(266),%d0 46f00: 670a beqs 46f0c <_Thread_Initialize+0x178> _Workspace_Free( the_thread->API_Extensions[i] ); 46f02: 2f00 movel %d0,%sp@- 46f04: 4eb9 0004 7eb4 jsr 47eb4 <_Workspace_Free> 46f0a: 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] ) 46f0c: 202a 010e movel %a2@(270),%d0 46f10: 670a beqs 46f1c <_Thread_Initialize+0x188> _Workspace_Free( the_thread->API_Extensions[i] ); 46f12: 2f00 movel %d0,%sp@- 46f14: 4eb9 0004 7eb4 jsr 47eb4 <_Workspace_Free> 46f1a: 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] ) 46f1c: 202a 0112 movel %a2@(274),%d0 46f20: 670a beqs 46f2c <_Thread_Initialize+0x198> <== ALWAYS TAKEN _Workspace_Free( the_thread->API_Extensions[i] ); 46f22: 2f00 movel %d0,%sp@- <== NOT EXECUTED 46f24: 4eb9 0004 7eb4 jsr 47eb4 <_Workspace_Free> <== NOT EXECUTED 46f2a: 588f addql #4,%sp <== NOT EXECUTED if ( extensions_area ) 46f2c: 4a82 tstl %d2 46f2e: 670a beqs 46f3a <_Thread_Initialize+0x1a6> (void) _Workspace_Free( extensions_area ); 46f30: 2f02 movel %d2,%sp@- 46f32: 4eb9 0004 7eb4 jsr 47eb4 <_Workspace_Free> 46f38: 588f addql #4,%sp #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( fp_area ) 46f3a: 4a83 tstl %d3 46f3c: 670a beqs 46f48 <_Thread_Initialize+0x1b4> (void) _Workspace_Free( fp_area ); 46f3e: 2f03 movel %d3,%sp@- 46f40: 4eb9 0004 7eb4 jsr 47eb4 <_Workspace_Free> 46f46: 588f addql #4,%sp #endif _Thread_Stack_Free( the_thread ); 46f48: 2f0a movel %a2,%sp@- 46f4a: 4eb9 0004 76c0 jsr 476c0 <_Thread_Stack_Free> return false; 46f50: 588f addql #4,%sp 46f52: 4200 clrb %d0 } 46f54: 4cee 047c ffe8 moveml %fp@(-24),%d2-%d6/%a2 46f5a: 4e5e unlk %fp ... 00047c14 <_Thread_Restart>: Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { if ( !_States_Is_dormant( the_thread->current_state ) ) { 47c14: 7001 moveq #1,%d0 bool _Thread_Restart( Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { 47c16: 4e56 0000 linkw %fp,#0 47c1a: 2f0a movel %a2,%sp@- 47c1c: 246e 0008 moveal %fp@(8),%a2 if ( !_States_Is_dormant( the_thread->current_state ) ) { 47c20: c0aa 0010 andl %a2@(16),%d0 47c24: 4a00 tstb %d0 47c26: 6704 beqs 47c2c <_Thread_Restart+0x18> 47c28: 4200 clrb %d0 47c2a: 6064 bras 47c90 <_Thread_Restart+0x7c> _Thread_Set_transient( the_thread ); 47c2c: 2f0a movel %a2,%sp@- 47c2e: 4eb9 0004 7df0 jsr 47df0 <_Thread_Set_transient> _Thread_Reset( the_thread, pointer_argument, numeric_argument ); 47c34: 2f2e 0010 movel %fp@(16),%sp@- 47c38: 2f2e 000c movel %fp@(12),%sp@- 47c3c: 2f0a movel %a2,%sp@- 47c3e: 4eb9 0004 b1ac jsr 4b1ac <_Thread_Reset> _Thread_Load_environment( the_thread ); 47c44: 2f0a movel %a2,%sp@- 47c46: 4eb9 0004 ae48 jsr 4ae48 <_Thread_Load_environment> _Thread_Ready( the_thread ); 47c4c: 2f0a movel %a2,%sp@- 47c4e: 4eb9 0004 b0ec jsr 4b0ec <_Thread_Ready> _User_extensions_Thread_restart( the_thread ); 47c54: 2f0a movel %a2,%sp@- 47c56: 4eb9 0004 83d0 jsr 483d0 <_User_extensions_Thread_restart> if ( _Thread_Is_executing ( the_thread ) ) 47c5c: 4fef 001c lea %sp@(28),%sp 47c60: b5f9 0005 d89a cmpal 5d89a <_Thread_Executing>,%a2 47c66: 6626 bnes 47c8e <_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 ) 47c68: 4aaa 0102 tstl %a2@(258) 47c6c: 670c beqs 47c7a <_Thread_Restart+0x66> _Context_Restore_fp( &_Thread_Executing->fp_context ); 47c6e: 486a 0102 pea %a2@(258) 47c72: 4eb9 0004 88c0 jsr 488c0 <_CPU_Context_restore_fp> 47c78: 588f addql #4,%sp #endif _CPU_Context_Restart_self( &_Thread_Executing->Registers ); 47c7a: 2079 0005 d89a moveal 5d89a <_Thread_Executing>,%a0 47c80: 41e8 00ce lea %a0@(206),%a0 47c84: 2f08 movel %a0,%sp@- 47c86: 4eb9 0004 877e jsr 4877e <_CPU_Context_Restart_self> 47c8c: 588f addql #4,%sp <== NOT EXECUTED 47c8e: 7001 moveq #1,%d0 return true; } return false; } 47c90: 246e fffc moveal %fp@(-4),%a2 47c94: 4e5e unlk %fp <== NOT EXECUTED 0004acc8 <_Thread_Resume>: void _Thread_Resume( Thread_Control *the_thread, bool force ) { 4acc8: 4e56 ffec linkw %fp,#-20 4accc: 206e 0008 moveal %fp@(8),%a0 4acd0: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ ISR_Level level; States_Control current_state; _ISR_Disable( level ); 4acd4: 243c 0000 0700 movel #1792,%d2 4acda: 2002 movel %d2,%d0 4acdc: 40c1 movew %sr,%d1 4acde: 8081 orl %d1,%d0 4ace0: 46c0 movew %d0,%sr _ISR_Enable( level ); return; } #endif current_state = the_thread->current_state; 4ace2: 2028 0010 movel %a0@(16),%d0 if ( current_state & STATES_SUSPENDED ) { 4ace6: 0800 0001 btst #1,%d0 4acea: 6778 beqs 4ad64 <_Thread_Resume+0x9c> <== NEVER TAKEN 4acec: 76fd moveq #-3,%d3 4acee: c083 andl %d3,%d0 current_state = 4acf0: 2140 0010 movel %d0,%a0@(16) the_thread->current_state = _States_Clear(STATES_SUSPENDED, current_state); if ( _States_Is_ready( current_state ) ) { 4acf4: 666e bnes 4ad64 <_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; 4acf6: 2668 008e moveal %a0@(142),%a3 4acfa: 3028 0094 movew %a0@(148),%d0 4acfe: 3613 movew %a3@,%d3 _Priority_Add_to_bit_map( &the_thread->Priority_map ); _Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node); 4ad00: 2268 008a moveal %a0@(138),%a1 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 4ad04: 2809 movel %a1,%d4 4ad06: 5884 addql #4,%d4 4ad08: 8083 orl %d3,%d0 4ad0a: 2084 movel %d4,%a0@ old_last_node = the_chain->last; 4ad0c: 2469 0008 moveal %a1@(8),%a2 4ad10: 3680 movew %d0,%a3@ the_chain->last = the_node; 4ad12: 2348 0008 movel %a0,%a1@(8) _Priority_Major_bit_map |= the_priority_map->ready_major; 4ad16: 3039 0006 1fa0 movew 61fa0 <_Priority_Major_bit_map>,%d0 4ad1c: 3628 0092 movew %a0@(146),%d3 old_last_node->next = the_node; the_node->previous = old_last_node; 4ad20: 214a 0004 movel %a2,%a0@(4) 4ad24: 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; 4ad26: 2488 movel %a0,%a2@ 4ad28: 33c0 0006 1fa0 movew %d0,61fa0 <_Priority_Major_bit_map> _ISR_Flash( level ); 4ad2e: 2002 movel %d2,%d0 4ad30: 46c1 movew %d1,%sr 4ad32: 8081 orl %d1,%d0 4ad34: 46c0 movew %d0,%sr if ( the_thread->current_priority < _Thread_Heir->current_priority ) { 4ad36: 2028 0014 movel %a0@(20),%d0 4ad3a: 2279 0006 1f7e moveal 61f7e <_Thread_Heir>,%a1 4ad40: b0a9 0014 cmpl %a1@(20),%d0 4ad44: 641e bccs 4ad64 <_Thread_Resume+0x9c> _Thread_Heir = the_thread; 4ad46: 23c8 0006 1f7e movel %a0,61f7e <_Thread_Heir> if ( _Thread_Executing->is_preemptible || 4ad4c: 2079 0006 1faa moveal 61faa <_Thread_Executing>,%a0 4ad52: 4a28 0075 tstb %a0@(117) 4ad56: 6604 bnes 4ad5c <_Thread_Resume+0x94> 4ad58: 4a80 tstl %d0 4ad5a: 6608 bnes 4ad64 <_Thread_Resume+0x9c> <== ALWAYS TAKEN the_thread->current_priority == 0 ) _Context_Switch_necessary = true; 4ad5c: 7001 moveq #1,%d0 4ad5e: 13c0 0006 1fba moveb %d0,61fba <_Context_Switch_necessary> } } } _ISR_Enable( level ); 4ad64: 46c1 movew %d1,%sr } 4ad66: 4cd7 0c1c moveml %sp@,%d2-%d4/%a2-%a3 4ad6a: 4e5e unlk %fp ... 00047744 <_Thread_Start>: void *entry_point, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { if ( _States_Is_dormant( the_thread->current_state ) ) { 47744: 7001 moveq #1,%d0 Thread_Start_types the_prototype, void *entry_point, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { 47746: 4e56 0000 linkw %fp,#0 4774a: 2f0a movel %a2,%sp@- 4774c: 246e 0008 moveal %fp@(8),%a2 if ( _States_Is_dormant( the_thread->current_state ) ) { 47750: c0aa 0010 andl %a2@(16),%d0 47754: 6736 beqs 4778c <_Thread_Start+0x48> <== NEVER TAKEN the_thread->Start.entry_point = (Thread_Entry) entry_point; 47756: 256e 0010 009a movel %fp@(16),%a2@(154) the_thread->Start.prototype = the_prototype; 4775c: 256e 000c 009e movel %fp@(12),%a2@(158) the_thread->Start.pointer_argument = pointer_argument; 47762: 256e 0014 00a2 movel %fp@(20),%a2@(162) the_thread->Start.numeric_argument = numeric_argument; 47768: 256e 0018 00a6 movel %fp@(24),%a2@(166) _Thread_Load_environment( the_thread ); 4776e: 2f0a movel %a2,%sp@- 47770: 4eb9 0004 a610 jsr 4a610 <_Thread_Load_environment> _Thread_Ready( the_thread ); 47776: 2f0a movel %a2,%sp@- 47778: 4eb9 0004 a8b4 jsr 4a8b4 <_Thread_Ready> _User_extensions_Thread_start( the_thread ); 4777e: 2f0a movel %a2,%sp@- 47780: 4eb9 0004 7bd8 jsr 47bd8 <_User_extensions_Thread_start> return true; 47786: 4fef 000c lea %sp@(12),%sp _Thread_Load_environment( the_thread ); _Thread_Ready( the_thread ); _User_extensions_Thread_start( the_thread ); 4778a: 7001 moveq #1,%d0 return true; } return false; } 4778c: 246e fffc moveal %fp@(-4),%a2 47790: 4e5e unlk %fp <== NOT EXECUTED 0004787c <_Thread_Tickle_timeslice>: * * Output parameters: NONE */ void _Thread_Tickle_timeslice( void ) { 4787c: 4e56 0000 linkw %fp,#0 47880: 2f0a movel %a2,%sp@- Thread_Control *executing; executing = _Thread_Executing; 47882: 2479 0005 cdc2 moveal 5cdc2 <_Thread_Executing>,%a2 /* * If the thread is not preemptible or is not ready, then * just return. */ if ( !executing->is_preemptible ) 47888: 4a2a 0075 tstb %a2@(117) 4788c: 6756 beqs 478e4 <_Thread_Tickle_timeslice+0x68> return; if ( !_States_Is_ready( executing->current_state ) ) 4788e: 4aaa 0010 tstl %a2@(16) 47892: 6650 bnes 478e4 <_Thread_Tickle_timeslice+0x68> /* * The cpu budget algorithm determines what happens next. */ switch ( executing->budget_algorithm ) { 47894: 202a 007a movel %a2@(122),%d0 47898: 7201 moveq #1,%d1 4789a: b280 cmpl %d0,%d1 4789c: 6246 bhis 478e4 <_Thread_Tickle_timeslice+0x68> 4789e: 123c 0002 moveb #2,%d1 478a2: b280 cmpl %d0,%d1 478a4: 640a bccs 478b0 <_Thread_Tickle_timeslice+0x34> 478a6: 123c 0003 moveb #3,%d1 478aa: b280 cmpl %d0,%d1 478ac: 6636 bnes 478e4 <_Thread_Tickle_timeslice+0x68> <== NEVER TAKEN 478ae: 601e bras 478ce <_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 ) { 478b0: 202a 0076 movel %a2@(118),%d0 478b4: 5380 subql #1,%d0 478b6: 2540 0076 movel %d0,%a2@(118) 478ba: 6e28 bgts 478e4 <_Thread_Tickle_timeslice+0x68> _Thread_Reset_timeslice(); 478bc: 4eb9 0004 a974 jsr 4a974 <_Thread_Reset_timeslice> executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 478c2: 41f9 0005 ccb8 lea 5ccb8 <_Thread_Ticks_per_timeslice>,%a0 478c8: 2550 0076 movel %a0@,%a2@(118) 478cc: 6016 bras 478e4 <_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 ) 478ce: 202a 0076 movel %a2@(118),%d0 478d2: 5380 subql #1,%d0 478d4: 2540 0076 movel %d0,%a2@(118) 478d8: 660a bnes 478e4 <_Thread_Tickle_timeslice+0x68> (*executing->budget_callout)( executing ); 478da: 2f0a movel %a2,%sp@- 478dc: 206a 007e moveal %a2@(126),%a0 478e0: 4e90 jsr %a0@ 478e2: 588f addql #4,%sp break; #endif } } 478e4: 246e fffc moveal %fp@(-4),%a2 478e8: 4e5e unlk %fp <== NOT EXECUTED 000478ec <_Thread_Yield_processor>: * ready chain * select heir */ void _Thread_Yield_processor( void ) { 478ec: 4e56 fff4 linkw %fp,#-12 ISR_Level level; Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; 478f0: 2079 0005 cdc2 moveal 5cdc2 <_Thread_Executing>,%a0 * ready chain * select heir */ void _Thread_Yield_processor( void ) { 478f6: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; ready = executing->ready; _ISR_Disable( level ); 478fa: 243c 0000 0700 movel #1792,%d2 47900: 2002 movel %d2,%d0 ISR_Level level; Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; ready = executing->ready; 47902: 2268 008a moveal %a0@(138),%a1 _ISR_Disable( level ); 47906: 40c1 movew %sr,%d1 47908: 8081 orl %d1,%d0 4790a: 46c0 movew %d0,%sr if ( !_Chain_Has_only_one_node( ready ) ) { 4790c: 2029 0008 movel %a1@(8),%d0 47910: b091 cmpl %a1@,%d0 47912: 6738 beqs 4794c <_Thread_Yield_processor+0x60> ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 47914: 2450 moveal %a0@,%a2 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 47916: 2009 movel %a1,%d0 47918: 5880 addql #4,%d0 { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 4791a: 2668 0004 moveal %a0@(4),%a3 next->previous = previous; previous->next = next; 4791e: 268a movel %a2,%a3@ Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 47920: 254b 0004 movel %a3,%a2@(4) Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 47924: 2080 movel %d0,%a0@ old_last_node = the_chain->last; 47926: 2469 0008 moveal %a1@(8),%a2 the_chain->last = the_node; 4792a: 2348 0008 movel %a0,%a1@(8) old_last_node->next = the_node; the_node->previous = old_last_node; 4792e: 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; 47932: 2488 movel %a0,%a2@ _Chain_Extract_unprotected( &executing->Object.Node ); _Chain_Append_unprotected( ready, &executing->Object.Node ); _ISR_Flash( level ); 47934: 2002 movel %d2,%d0 47936: 46c1 movew %d1,%sr 47938: 8081 orl %d1,%d0 4793a: 46c0 movew %d0,%sr if ( _Thread_Is_heir( executing ) ) 4793c: b1f9 0005 cd96 cmpal 5cd96 <_Thread_Heir>,%a0 47942: 6610 bnes 47954 <_Thread_Yield_processor+0x68> <== NEVER TAKEN _Thread_Heir = (Thread_Control *) ready->first; 47944: 23d1 0005 cd96 movel %a1@,5cd96 <_Thread_Heir> 4794a: 6008 bras 47954 <_Thread_Yield_processor+0x68> _Context_Switch_necessary = true; } else if ( !_Thread_Is_heir( executing ) ) 4794c: b1f9 0005 cd96 cmpal 5cd96 <_Thread_Heir>,%a0 47952: 6708 beqs 4795c <_Thread_Yield_processor+0x70> <== ALWAYS TAKEN _Context_Switch_necessary = true; 47954: 7001 moveq #1,%d0 47956: 13c0 0005 cdd2 moveb %d0,5cdd2 <_Context_Switch_necessary> _ISR_Enable( level ); 4795c: 46c1 movew %d1,%sr } 4795e: 4cd7 0c04 moveml %sp@,%d2/%a2-%a3 47962: 4e5e unlk %fp ... 00046798 <_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 ) ) { 46798: 7202 moveq #2,%d1 Thread_blocking_operation_States sync_state __attribute__((unused)), #endif Thread_Control *the_thread, ISR_Level level ) { 4679a: 4e56 0000 linkw %fp,#0 4679e: 202e 0010 movel %fp@(16),%d0 467a2: 2f0a movel %a2,%sp@- 467a4: 246e 000c moveal %fp@(12),%a2 #endif /* * The thread is not waiting on anything after this completes. */ the_thread->Wait.queue = NULL; 467a8: 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 ) ) { 467ac: b2aa 0050 cmpl %a2@(80),%d1 467b0: 6618 bnes 467ca <_Thread_blocking_operation_Cancel+0x32> RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 467b2: 123c 0003 moveb #3,%d1 467b6: 2541 0050 movel %d1,%a2@(80) _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 467ba: 46c0 movew %d0,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 467bc: 486a 0048 pea %a2@(72) 467c0: 4eb9 0004 7d6c jsr 47d6c <_Watchdog_Remove> 467c6: 588f addql #4,%sp 467c8: 6002 bras 467cc <_Thread_blocking_operation_Cancel+0x34> } else _ISR_Enable( level ); 467ca: 46c0 movew %d0,%sr RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 467cc: 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 } 467d0: 246e fffc moveal %fp@(-4),%a2 467d4: 203c 1003 fff8 movel #268697592,%d0 467da: 2d40 000c movel %d0,%fp@(12) 467de: 4e5e unlk %fp 467e0: 4ef9 0004 6928 jmp 46928 <_Thread_Clear_state> ... 00047214 <_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 ) { 47214: 4e56 ffe4 linkw %fp,#-28 47218: 206e 000c moveal %fp@(12),%a0 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 4721c: 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; 47220: 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 ) { 47224: 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 ]; 47228: 2400 movel %d0,%d2 4722a: ec8a lsrl #6,%d2 4722c: 2202 movel %d2,%d1 return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); 4722e: 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 ]; 47234: e989 lsll #4,%d1 47236: 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 ) { 47238: 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 ]; 4723c: 9282 subl %d2,%d1 4723e: 47f2 1800 lea %a2@(00000000,%d1:l),%a3 47242: 2149 0038 movel %a1,%a0@(56) the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 47246: 43e8 0038 lea %a0@(56),%a1 block_state = the_thread_queue->state; 4724a: 2a2a 0038 movel %a2@(56),%d5 4724e: 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; 47252: 42a8 003c clrl %a0@(60) if ( _Thread_queue_Is_reverse_search( priority ) ) 47256: 0800 0005 btst #5,%d0 4725a: 6660 bnes 472bc <_Thread_queue_Enqueue_priority+0xa8> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4725c: 2c0b movel %a3,%d6 4725e: 5886 addql #4,%d6 goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); 47260: 2404 movel %d4,%d2 47262: 40c1 movew %sr,%d1 47264: 8481 orl %d1,%d2 47266: 46c2 movew %d2,%sr search_thread = (Thread_Control *) header->first; 47268: 2253 moveal %a3@,%a1 4726a: 76ff moveq #-1,%d3 while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 4726c: 601e bras 4728c <_Thread_queue_Enqueue_priority+0x78> search_priority = search_thread->current_priority; 4726e: 2629 0014 movel %a1@(20),%d3 if ( priority <= search_priority ) 47272: b680 cmpl %d0,%d3 47274: 641a bccs 47290 <_Thread_queue_Enqueue_priority+0x7c> break; search_priority = search_thread->current_priority; if ( priority <= search_priority ) break; #endif _ISR_Flash( level ); 47276: 2404 movel %d4,%d2 47278: 46c1 movew %d1,%sr 4727a: 8481 orl %d1,%d2 4727c: 46c2 movew %d2,%sr if ( !_States_Are_set( search_thread->current_state, block_state) ) { 4727e: 2405 movel %d5,%d2 47280: c4a9 0010 andl %a1@(16),%d2 47284: 6604 bnes 4728a <_Thread_queue_Enqueue_priority+0x76><== ALWAYS TAKEN _ISR_Enable( level ); 47286: 46c1 movew %d1,%sr <== NOT EXECUTED goto restart_forward_search; 47288: 60d6 bras 47260 <_Thread_queue_Enqueue_priority+0x4c><== NOT EXECUTED } search_thread = (Thread_Control *)search_thread->Object.Node.next; 4728a: 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 ) ) { 4728c: bc89 cmpl %a1,%d6 4728e: 66de bnes 4726e <_Thread_queue_Enqueue_priority+0x5a> 47290: 2401 movel %d1,%d2 } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 47292: 7801 moveq #1,%d4 47294: b8aa 0030 cmpl %a2@(48),%d4 47298: 6600 00a4 bnew 4733e <_Thread_queue_Enqueue_priority+0x12a> THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 4729c: 42aa 0030 clrl %a2@(48) if ( priority == search_priority ) 472a0: b680 cmpl %d0,%d3 472a2: 677e beqs 47322 <_Thread_queue_Enqueue_priority+0x10e> goto equal_priority; search_node = (Chain_Node *) search_thread; previous_node = search_node->previous; 472a4: 2669 0004 moveal %a1@(4),%a3 the_node = (Chain_Node *) the_thread; the_node->next = search_node; 472a8: 2089 movel %a1,%a0@ the_node->previous = previous_node; 472aa: 214b 0004 movel %a3,%a0@(4) previous_node->next = the_node; search_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 472ae: 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; 472b2: 2688 movel %a0,%a3@ search_node->previous = the_node; 472b4: 2348 0004 movel %a0,%a1@(4) the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 472b8: 46c1 movew %d1,%sr 472ba: 6062 bras 4731e <_Thread_queue_Enqueue_priority+0x10a> return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 472bc: 4283 clrl %d3 472be: 1639 0005 b552 moveb 5b552 ,%d3 _ISR_Disable( level ); 472c4: 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; 472c6: 5283 addql #1,%d3 _ISR_Disable( level ); 472c8: 40c1 movew %sr,%d1 472ca: 8481 orl %d1,%d2 472cc: 46c2 movew %d2,%sr search_thread = (Thread_Control *) header->last; 472ce: 226b 0008 moveal %a3@(8),%a1 while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 472d2: 6020 bras 472f4 <_Thread_queue_Enqueue_priority+0xe0> search_priority = search_thread->current_priority; 472d4: 2629 0014 movel %a1@(20),%d3 if ( priority >= search_priority ) 472d8: b680 cmpl %d0,%d3 472da: 631c blss 472f8 <_Thread_queue_Enqueue_priority+0xe4> break; search_priority = search_thread->current_priority; if ( priority >= search_priority ) break; #endif _ISR_Flash( level ); 472dc: 2404 movel %d4,%d2 472de: 46c1 movew %d1,%sr 472e0: 8481 orl %d1,%d2 472e2: 46c2 movew %d2,%sr if ( !_States_Are_set( search_thread->current_state, block_state) ) { 472e4: 2405 movel %d5,%d2 472e6: c4a9 0010 andl %a1@(16),%d2 472ea: 6604 bnes 472f0 <_Thread_queue_Enqueue_priority+0xdc> _ISR_Enable( level ); 472ec: 46c1 movew %d1,%sr goto restart_reverse_search; 472ee: 60cc bras 472bc <_Thread_queue_Enqueue_priority+0xa8> } search_thread = (Thread_Control *) 472f0: 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 ) ) { 472f4: b7c9 cmpal %a1,%a3 472f6: 66dc bnes 472d4 <_Thread_queue_Enqueue_priority+0xc0> 472f8: 2401 movel %d1,%d2 } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 472fa: 7801 moveq #1,%d4 472fc: b8aa 0030 cmpl %a2@(48),%d4 47300: 663c bnes 4733e <_Thread_queue_Enqueue_priority+0x12a> THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 47302: 42aa 0030 clrl %a2@(48) if ( priority == search_priority ) 47306: b680 cmpl %d0,%d3 47308: 6718 beqs 47322 <_Thread_queue_Enqueue_priority+0x10e> goto equal_priority; search_node = (Chain_Node *) search_thread; next_node = search_node->next; 4730a: 2651 moveal %a1@,%a3 the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; 4730c: 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; 47310: 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; 47312: 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; 47316: 2288 movel %a0,%a1@ next_node->previous = the_node; 47318: 2748 0004 movel %a0,%a3@(4) the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 4731c: 46c1 movew %d1,%sr 4731e: 7001 moveq #1,%d0 return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 47320: 6026 bras 47348 <_Thread_queue_Enqueue_priority+0x134> 47322: 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; 47326: 2669 0004 moveal %a1@(4),%a3 the_node = (Chain_Node *) the_thread; the_node->next = search_node; 4732a: 2089 movel %a1,%a0@ the_node->previous = previous_node; 4732c: 214b 0004 movel %a3,%a0@(4) previous_node->next = the_node; search_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 47330: 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; 47334: 2688 movel %a0,%a3@ search_node->previous = the_node; 47336: 2348 0004 movel %a0,%a1@(4) the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 4733a: 46c2 movew %d2,%sr 4733c: 60e0 bras 4731e <_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; 4733e: 206e 0010 moveal %fp@(16),%a0 return the_thread_queue->sync_state; 47342: 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; 47346: 2082 movel %d2,%a0@ return the_thread_queue->sync_state; } 47348: 4cd7 0c7c moveml %sp@,%d2-%d6/%a2-%a3 4734c: 4e5e unlk %fp <== NOT EXECUTED 0004c16c <_Thread_queue_Extract_fifo>: Thread_Control *the_thread ) { ISR_Level level; _ISR_Disable( level ); 4c16c: 223c 0000 0700 movel #1792,%d1 void _Thread_queue_Extract_fifo( Thread_queue_Control *the_thread_queue __attribute__((unused)), Thread_Control *the_thread ) { 4c172: 4e56 0000 linkw %fp,#0 4c176: 2f0a movel %a2,%sp@- 4c178: 246e 000c moveal %fp@(12),%a2 ISR_Level level; _ISR_Disable( level ); 4c17c: 40c0 movew %sr,%d0 4c17e: 8280 orl %d0,%d1 4c180: 46c1 movew %d1,%sr if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 4c182: 222a 0010 movel %a2@(16),%d1 4c186: 0281 0003 bee0 andil #245472,%d1 4c18c: 660a bnes 4c198 <_Thread_queue_Extract_fifo+0x2c> _ISR_Enable( level ); 4c18e: 46c0 movew %d0,%sr #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); #endif } 4c190: 246e fffc moveal %fp@(-4),%a2 4c194: 4e5e unlk %fp 4c196: 4e75 rts ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 4c198: 2052 moveal %a2@,%a0 _Chain_Extract_unprotected( &the_thread->Object.Node ); the_thread->Wait.queue = NULL; if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 4c19a: 7202 moveq #2,%d1 previous = the_node->previous; 4c19c: 226a 0004 moveal %a2@(4),%a1 return; } _Chain_Extract_unprotected( &the_thread->Object.Node ); the_thread->Wait.queue = NULL; 4c1a0: 42aa 0044 clrl %a2@(68) next->previous = previous; previous->next = next; 4c1a4: 2288 movel %a0,%a1@ Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 4c1a6: 2149 0004 movel %a1,%a0@(4) if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 4c1aa: b2aa 0050 cmpl %a2@(80),%d1 4c1ae: 6704 beqs 4c1b4 <_Thread_queue_Extract_fifo+0x48> _ISR_Enable( level ); 4c1b0: 46c0 movew %d0,%sr 4c1b2: 6014 bras 4c1c8 <_Thread_queue_Extract_fifo+0x5c> 4c1b4: 7203 moveq #3,%d1 4c1b6: 2541 0050 movel %d1,%a2@(80) } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 4c1ba: 46c0 movew %d0,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 4c1bc: 486a 0048 pea %a2@(72) 4c1c0: 4eb9 0004 7d6c jsr 47d6c <_Watchdog_Remove> 4c1c6: 588f addql #4,%sp RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 4c1c8: 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 } 4c1cc: 246e fffc moveal %fp@(-4),%a2 4c1d0: 203c 1003 fff8 movel #268697592,%d0 4c1d6: 2d40 000c movel %d0,%fp@(12) 4c1da: 4e5e unlk %fp 4c1dc: 4ef9 0004 6928 jmp 46928 <_Thread_Clear_state> ... 0004a86c <_Thread_queue_Process_timeout>: #include void _Thread_queue_Process_timeout( Thread_Control *the_thread ) { 4a86c: 4e56 0000 linkw %fp,#0 4a870: 206e 0008 moveal %fp@(8),%a0 Thread_queue_Control *the_thread_queue = the_thread->Wait.queue; 4a874: 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 && 4a878: 2029 0030 movel %a1@(48),%d0 4a87c: 671c beqs 4a89a <_Thread_queue_Process_timeout+0x2e> 4a87e: b1f9 0005 cdc2 cmpal 5cdc2 <_Thread_Executing>,%a0 4a884: 6614 bnes 4a89a <_Thread_queue_Process_timeout+0x2e><== NEVER TAKEN _Thread_Is_executing( the_thread ) ) { if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) { 4a886: 7203 moveq #3,%d1 4a888: b280 cmpl %d0,%d1 4a88a: 6722 beqs 4a8ae <_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; 4a88c: 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; 4a88e: 2169 003c 0034 movel %a1@(60),%a0@(52) the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 4a894: 2340 0030 movel %d0,%a1@(48) 4a898: 6014 bras 4a8ae <_Thread_queue_Process_timeout+0x42> } } else { the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; 4a89a: 2169 003c 0034 movel %a1@(60),%a0@(52) _Thread_queue_Extract( the_thread->Wait.queue, the_thread ); 4a8a0: 2f08 movel %a0,%sp@- 4a8a2: 2f28 0044 movel %a0@(68),%sp@- 4a8a6: 4eb9 0004 a768 jsr 4a768 <_Thread_queue_Extract> 4a8ac: 508f addql #8,%sp } } 4a8ae: 4e5e unlk %fp ... 00047404 <_Thread_queue_Requeue>: void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { 47404: 4e56 fff0 linkw %fp,#-16 47408: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 4740c: 246e 0008 moveal %fp@(8),%a2 47410: 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 ) 47414: 4a8a tstl %a2 47416: 6746 beqs 4745e <_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 ) { 47418: 7001 moveq #1,%d0 4741a: b0aa 0034 cmpl %a2@(52),%d0 4741e: 663e bnes 4745e <_Thread_queue_Requeue+0x5a> <== NEVER TAKEN Thread_queue_Control *tq = the_thread_queue; ISR_Level level; ISR_Level level_ignored; _ISR_Disable( level ); 47420: 303c 0700 movew #1792,%d0 47424: 40c2 movew %sr,%d2 47426: 8082 orl %d2,%d0 47428: 46c0 movew %d0,%sr if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 4742a: 202b 0010 movel %a3@(16),%d0 4742e: 0280 0003 bee0 andil #245472,%d0 47434: 6726 beqs 4745c <_Thread_queue_Requeue+0x58> <== NEVER TAKEN _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); 47436: 4878 0001 pea 1 4743a: 7001 moveq #1,%d0 4743c: 2f0b movel %a3,%sp@- 4743e: 2540 0030 movel %d0,%a2@(48) 47442: 2f0a movel %a2,%sp@- 47444: 4eb9 0004 a7a0 jsr 4a7a0 <_Thread_queue_Extract_priority_helper> (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); 4744a: 486e fffc pea %fp@(-4) 4744e: 2f0b movel %a3,%sp@- 47450: 2f0a movel %a2,%sp@- 47452: 4eb9 0004 7214 jsr 47214 <_Thread_queue_Enqueue_priority> 47458: 4fef 0018 lea %sp@(24),%sp } _ISR_Enable( level ); 4745c: 46c2 movew %d2,%sr } } 4745e: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3 47464: 4e5e unlk %fp <== NOT EXECUTED 00047468 <_Thread_queue_Timeout>: void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { 47468: 4e56 fffc linkw %fp,#-4 Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 4746c: 486e fffc pea %fp@(-4) 47470: 2f2e 0008 movel %fp@(8),%sp@- 47474: 4eb9 0004 6d08 jsr 46d08 <_Thread_Get> switch ( location ) { 4747a: 508f addql #8,%sp 4747c: 4aae fffc tstl %fp@(-4) 47480: 6618 bnes 4749a <_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 ); 47482: 2f00 movel %d0,%sp@- 47484: 4eb9 0004 a86c jsr 4a86c <_Thread_queue_Process_timeout> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 4748a: 588f addql #4,%sp 4748c: 2039 0005 cd08 movel 5cd08 <_Thread_Dispatch_disable_level>,%d0 47492: 5380 subql #1,%d0 47494: 23c0 0005 cd08 movel %d0,5cd08 <_Thread_Dispatch_disable_level> _Thread_Unnest_dispatch(); break; } } 4749a: 4e5e unlk %fp ... 00051644 <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 51644: 4e56 ffb4 linkw %fp,#-76 51648: 200e movel %fp,%d0 5164a: 0680 ffff fff4 addil #-12,%d0 51650: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 51654: 246e 0008 moveal %fp@(8),%a2 51658: 240e movel %fp,%d2 5165a: 2a0e movel %fp,%d5 5165c: 260e movel %fp,%d3 5165e: 0682 ffff ffe8 addil #-24,%d2 51664: 5185 subql #8,%d5 51666: 0683 ffff ffec addil #-20,%d3 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 5166c: 41ea 0008 lea %a2@(8),%a0 static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 51670: 4bea 0040 lea %a2@(64),%a5 */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 51674: 2e0a movel %a2,%d7 /* * This path is for normal forward movement and cases where the * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 51676: 280a movel %a2,%d4 */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 51678: 0687 0000 0030 addil #48,%d7 /* * This path is for normal forward movement and cases where the * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 5167e: 0684 0000 0068 addil #104,%d4 */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 51684: 49f9 0005 51fc lea 551fc <_Watchdog_Adjust_to_chain>,%a4 ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 5168a: 47f9 0005 528c lea 5528c <_Watchdog_Insert>,%a3 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 51690: 2d48 ffe4 movel %a0,%fp@(-28) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 51694: 2d45 fff4 movel %d5,%fp@(-12) the_chain->permanent_null = NULL; 51698: 42ae fff8 clrl %fp@(-8) the_chain->last = _Chain_Head(the_chain); 5169c: 2d40 fffc movel %d0,%fp@(-4) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 516a0: 2d43 ffe8 movel %d3,%fp@(-24) the_chain->permanent_null = NULL; 516a4: 42ae ffec clrl %fp@(-20) the_chain->last = _Chain_Head(the_chain); 516a8: 2d42 fff0 movel %d2,%fp@(-16) 516ac: 2d4d ffe0 movel %a5,%fp@(-32) { /* * Afterwards all timer inserts are directed to this chain and the interval * and TOD chains will be no more modified by other parties. */ ts->insert_chain = insert_chain; 516b0: 41ee fff4 lea %fp@(-12),%a0 * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); 516b4: 3a7c 0700 moveaw #1792,%a5 { /* * Afterwards all timer inserts are directed to this chain and the interval * and TOD chains will be no more modified by other parties. */ ts->insert_chain = insert_chain; 516b8: 2548 0078 movel %a0,%a2@(120) static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 516bc: 2039 0007 55a0 movel 755a0 <_Watchdog_Ticks_since_boot>,%d0 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 516c2: 222a 003c movel %a2@(60),%d1 watchdogs->last_snapshot = snapshot; 516c6: 2540 003c movel %d0,%a2@(60) _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 516ca: 486e ffe8 pea %fp@(-24) 516ce: 9081 subl %d1,%d0 516d0: 2f00 movel %d0,%sp@- 516d2: 2f07 movel %d7,%sp@- 516d4: 4e94 jsr %a4@ static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 516d6: 2039 0007 54ee movel 754ee <_TOD_Now>,%d0 /* * Process the seconds chain. Start by checking that the Time * of Day (TOD) has not been set backwards. If it has then * we want to adjust the watchdogs->Chain to indicate this. */ if ( snapshot > last_snapshot ) { 516dc: 4fef 000c lea %sp@(12),%sp Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); Watchdog_Interval last_snapshot = watchdogs->last_snapshot; 516e0: 222a 0074 movel %a2@(116),%d1 /* * Process the seconds chain. Start by checking that the Time * of Day (TOD) has not been set backwards. If it has then * we want to adjust the watchdogs->Chain to indicate this. */ if ( snapshot > last_snapshot ) { 516e4: b280 cmpl %d0,%d1 516e6: 6414 bccs 516fc <_Timer_server_Body+0xb8> /* * This path is for normal forward movement and cases where the * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 516e8: 486e ffe8 pea %fp@(-24) 516ec: 2c00 movel %d0,%d6 516ee: 9c81 subl %d1,%d6 516f0: 2f06 movel %d6,%sp@- 516f2: 2d40 ffdc movel %d0,%fp@(-36) 516f6: 2f04 movel %d4,%sp@- 516f8: 4e94 jsr %a4@ 516fa: 6018 bras 51714 <_Timer_server_Body+0xd0> } else if ( snapshot < last_snapshot ) { 516fc: b280 cmpl %d0,%d1 516fe: 631c blss 5171c <_Timer_server_Body+0xd8> /* * The current TOD is before the last TOD which indicates that * TOD has been set backwards. */ delta = last_snapshot - snapshot; _Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta ); 51700: 9280 subl %d0,%d1 51702: 2f01 movel %d1,%sp@- 51704: 4878 0001 pea 1 51708: 2d40 ffdc movel %d0,%fp@(-36) 5170c: 2f04 movel %d4,%sp@- 5170e: 4eb9 0005 517c jsr 5517c <_Watchdog_Adjust> 51714: 202e ffdc movel %fp@(-36),%d0 51718: 4fef 000c lea %sp@(12),%sp } watchdogs->last_snapshot = snapshot; 5171c: 2540 0074 movel %d0,%a2@(116) } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 51720: 202a 0078 movel %a2@(120),%d0 51724: 2f00 movel %d0,%sp@- 51726: 4eb9 0005 2014 jsr 52014 <_Chain_Get> if ( timer == NULL ) { 5172c: 588f addql #4,%sp } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 5172e: 2040 moveal %d0,%a0 if ( timer == NULL ) { 51730: 4a80 tstl %d0 51732: 6724 beqs 51758 <_Timer_server_Body+0x114> static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 51734: 2028 0038 movel %a0@(56),%d0 51738: 7201 moveq #1,%d1 5173a: b280 cmpl %d0,%d1 5173c: 6608 bnes 51746 <_Timer_server_Body+0x102> _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 5173e: 4868 0010 pea %a0@(16) 51742: 2f07 movel %d7,%sp@- 51744: 600c bras 51752 <_Timer_server_Body+0x10e> } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 51746: 7c03 moveq #3,%d6 51748: bc80 cmpl %d0,%d6 5174a: 66d4 bnes 51720 <_Timer_server_Body+0xdc> <== NEVER TAKEN _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 5174c: 4868 0010 pea %a0@(16) 51750: 2f04 movel %d4,%sp@- 51752: 4e93 jsr %a3@ 51754: 508f addql #8,%sp 51756: 60c8 bras 51720 <_Timer_server_Body+0xdc> * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); 51758: 200d movel %a5,%d0 5175a: 40c1 movew %sr,%d1 5175c: 8081 orl %d1,%d0 5175e: 46c0 movew %d0,%sr if ( _Chain_Is_empty( insert_chain ) ) { 51760: baae fff4 cmpl %fp@(-12),%d5 51764: 6612 bnes 51778 <_Timer_server_Body+0x134> <== NEVER TAKEN ts->insert_chain = NULL; 51766: 42aa 0078 clrl %a2@(120) _ISR_Enable( level ); 5176a: 46c1 movew %d1,%sr /* * It is essential that interrupts are disable here since an interrupt * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); 5176c: 3a7c 0700 moveaw #1792,%a5 _Chain_Initialize_empty( &fire_chain ); while ( true ) { _Timer_server_Get_watchdogs_that_fire_now( ts, &insert_chain, &fire_chain ); if ( !_Chain_Is_empty( &fire_chain ) ) { 51770: b6ae ffe8 cmpl %fp@(-24),%d3 51774: 6608 bnes 5177e <_Timer_server_Body+0x13a> 51776: 6042 bras 517ba <_Timer_server_Body+0x176> ts->insert_chain = NULL; _ISR_Enable( level ); break; } else { _ISR_Enable( level ); 51778: 46c1 movew %d1,%sr <== NOT EXECUTED 5177a: 6000 ff40 braw 516bc <_Timer_server_Body+0x78> <== NOT EXECUTED /* * It is essential that interrupts are disable here since an interrupt * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); 5177e: 220d movel %a5,%d1 51780: 40c0 movew %sr,%d0 51782: 8280 orl %d0,%d1 51784: 46c1 movew %d1,%sr */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 51786: 206e ffe8 moveal %fp@(-24),%a0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 5178a: b688 cmpl %a0,%d3 5178c: 6726 beqs 517b4 <_Timer_server_Body+0x170> { Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; 5178e: 2250 moveal %a0@,%a1 the_chain->first = new_first; 51790: 2d49 ffe8 movel %a1,%fp@(-24) new_first->previous = _Chain_Head(the_chain); 51794: 2342 0004 movel %d2,%a1@(4) watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { 51798: 4a88 tstl %a0 5179a: 6718 beqs 517b4 <_Timer_server_Body+0x170> <== NEVER TAKEN watchdog->state = WATCHDOG_INACTIVE; 5179c: 42a8 0008 clrl %a0@(8) _ISR_Enable( level ); 517a0: 46c0 movew %d0,%sr /* * The timer server may block here and wait for resources or time. * The system watchdogs are inactive and will remain inactive since * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); 517a2: 2f28 0024 movel %a0@(36),%sp@- 517a6: 2f28 0020 movel %a0@(32),%sp@- 517aa: 2068 001c moveal %a0@(28),%a0 517ae: 4e90 jsr %a0@ } 517b0: 508f addql #8,%sp 517b2: 60ca bras 5177e <_Timer_server_Body+0x13a> watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; _ISR_Enable( level ); } else { _ISR_Enable( level ); 517b4: 46c0 movew %d0,%sr 517b6: 6000 fef8 braw 516b0 <_Timer_server_Body+0x6c> * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); } } else { ts->active = false; 517ba: 4200 clrb %d0 517bc: 1540 007c moveb %d0,%a2@(124) 517c0: 2039 0007 545c movel 7545c <_Thread_Dispatch_disable_level>,%d0 517c6: 5280 addql #1,%d0 517c8: 23c0 0007 545c movel %d0,7545c <_Thread_Dispatch_disable_level> /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); 517ce: 4878 0008 pea 8 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 517d2: 4bf9 0005 53a8 lea 553a8 <_Watchdog_Remove>,%a5 /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); 517d8: 2f12 movel %a2@,%sp@- 517da: 4eb9 0005 499c jsr 5499c <_Thread_Set_state> _Timer_server_Reset_interval_system_watchdog( ts ); 517e0: 2f0a movel %a2,%sp@- 517e2: 4eba fd9c jsr %pc@(51580 <_Timer_server_Reset_interval_system_watchdog>) _Timer_server_Reset_tod_system_watchdog( ts ); 517e6: 2f0a movel %a2,%sp@- 517e8: 4eba fdf6 jsr %pc@(515e0 <_Timer_server_Reset_tod_system_watchdog>) _Thread_Enable_dispatch(); 517ec: 4eb9 0005 4012 jsr 54012 <_Thread_Enable_dispatch> ts->active = true; 517f2: 7201 moveq #1,%d1 517f4: 1541 007c moveb %d1,%a2@(124) static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 517f8: 2f2e ffe4 movel %fp@(-28),%sp@- 517fc: 4e95 jsr %a5@ static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 517fe: 2f2e ffe0 movel %fp@(-32),%sp@- 51802: 4e95 jsr %a5@ 51804: 4fef 0018 lea %sp@(24),%sp 51808: 6000 fea6 braw 516b0 <_Timer_server_Body+0x6c> 0005180c <_Timer_server_Schedule_operation_method>: static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 5180c: 4e56 fff0 linkw %fp,#-16 51810: 206e 000c moveal %fp@(12),%a0 51814: 48d7 041c moveml %d2-%d4/%a2,%sp@ 51818: 246e 0008 moveal %fp@(8),%a2 if ( ts->insert_chain == NULL ) { 5181c: 202a 0078 movel %a2@(120),%d0 51820: 6600 00f8 bnew 5191a <_Timer_server_Schedule_operation_method+0x10e> 51824: 2039 0007 545c movel 7545c <_Thread_Dispatch_disable_level>,%d0 5182a: 5280 addql #1,%d0 5182c: 23c0 0007 545c movel %d0,7545c <_Thread_Dispatch_disable_level> * being inserted. This could result in an integer overflow. */ _Thread_Disable_dispatch(); if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 51832: 2028 0038 movel %a0@(56),%d0 51836: 7201 moveq #1,%d1 51838: b280 cmpl %d0,%d1 5183a: 6660 bnes 5189c <_Timer_server_Schedule_operation_method+0x90> /* * We have to advance the last known ticks value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 5183c: 203c 0000 0700 movel #1792,%d0 51842: 40c3 movew %sr,%d3 51844: 8083 orl %d3,%d0 51846: 46c0 movew %d0,%sr snapshot = _Watchdog_Ticks_since_boot; 51848: 2039 0007 55a0 movel 755a0 <_Watchdog_Ticks_since_boot>,%d0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 5184e: 220a movel %a2,%d1 51850: 0681 0000 0034 addil #52,%d1 last_snapshot = ts->Interval_watchdogs.last_snapshot; 51856: 242a 003c movel %a2@(60),%d2 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 5185a: 226a 0030 moveal %a2@(48),%a1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 5185e: b289 cmpl %a1,%d1 51860: 6716 beqs 51878 <_Timer_server_Schedule_operation_method+0x6c> first_watchdog = _Watchdog_First( &ts->Interval_watchdogs.Chain ); /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; 51862: 2800 movel %d0,%d4 51864: 9882 subl %d2,%d4 delta_interval = first_watchdog->delta_interval; 51866: 2229 0010 movel %a1@(16),%d1 if (delta_interval > delta) { 5186a: b881 cmpl %d1,%d4 5186c: 6504 bcss 51872 <_Timer_server_Schedule_operation_method+0x66> 5186e: 4281 clrl %d1 51870: 6002 bras 51874 <_Timer_server_Schedule_operation_method+0x68> delta_interval -= delta; 51872: 9284 subl %d4,%d1 } else { delta_interval = 0; } first_watchdog->delta_interval = delta_interval; 51874: 2341 0010 movel %d1,%a1@(16) } ts->Interval_watchdogs.last_snapshot = snapshot; 51878: 2540 003c movel %d0,%a2@(60) _ISR_Enable( level ); 5187c: 46c3 movew %d3,%sr _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 5187e: 4868 0010 pea %a0@(16) 51882: 486a 0030 pea %a2@(48) 51886: 4eb9 0005 528c jsr 5528c <_Watchdog_Insert> if ( !ts->active ) { 5188c: 508f addql #8,%sp 5188e: 102a 007c moveb %a2@(124),%d0 51892: 6678 bnes 5190c <_Timer_server_Schedule_operation_method+0x100> _Timer_server_Reset_interval_system_watchdog( ts ); 51894: 2f0a movel %a2,%sp@- 51896: 4eba fce8 jsr %pc@(51580 <_Timer_server_Reset_interval_system_watchdog>) 5189a: 606e bras 5190a <_Timer_server_Schedule_operation_method+0xfe> } } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 5189c: 7203 moveq #3,%d1 5189e: b280 cmpl %d0,%d1 518a0: 666a bnes 5190c <_Timer_server_Schedule_operation_method+0x100> /* * We have to advance the last known seconds value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 518a2: 203c 0000 0700 movel #1792,%d0 518a8: 40c3 movew %sr,%d3 518aa: 8083 orl %d3,%d0 518ac: 46c0 movew %d0,%sr 518ae: 200a movel %a2,%d0 518b0: 0680 0000 006c addil #108,%d0 snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 518b6: 2239 0007 54ee movel 754ee <_TOD_Now>,%d1 last_snapshot = ts->TOD_watchdogs.last_snapshot; 518bc: 242a 0074 movel %a2@(116),%d2 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 518c0: 226a 0068 moveal %a2@(104),%a1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 518c4: b089 cmpl %a1,%d0 518c6: 6720 beqs 518e8 <_Timer_server_Schedule_operation_method+0xdc> if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; 518c8: 2029 0010 movel %a1@(16),%d0 if ( snapshot > last_snapshot ) { 518cc: b481 cmpl %d1,%d2 518ce: 6410 bccs 518e0 <_Timer_server_Schedule_operation_method+0xd4> /* * We advanced in time. */ delta = snapshot - last_snapshot; 518d0: 2801 movel %d1,%d4 518d2: 9882 subl %d2,%d4 if (delta_interval > delta) { 518d4: b880 cmpl %d0,%d4 518d6: 6504 bcss 518dc <_Timer_server_Schedule_operation_method+0xd0><== ALWAYS TAKEN 518d8: 4280 clrl %d0 <== NOT EXECUTED 518da: 6008 bras 518e4 <_Timer_server_Schedule_operation_method+0xd8><== NOT EXECUTED delta_interval -= delta; 518dc: 9084 subl %d4,%d0 518de: 6004 bras 518e4 <_Timer_server_Schedule_operation_method+0xd8> } } else { /* * Someone put us in the past. */ delta = last_snapshot - snapshot; 518e0: d082 addl %d2,%d0 delta_interval += delta; 518e2: 9081 subl %d1,%d0 } first_watchdog->delta_interval = delta_interval; 518e4: 2340 0010 movel %d0,%a1@(16) } ts->TOD_watchdogs.last_snapshot = snapshot; 518e8: 2541 0074 movel %d1,%a2@(116) _ISR_Enable( level ); 518ec: 46c3 movew %d3,%sr _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 518ee: 4868 0010 pea %a0@(16) 518f2: 486a 0068 pea %a2@(104) 518f6: 4eb9 0005 528c jsr 5528c <_Watchdog_Insert> if ( !ts->active ) { 518fc: 508f addql #8,%sp 518fe: 102a 007c moveb %a2@(124),%d0 51902: 6608 bnes 5190c <_Timer_server_Schedule_operation_method+0x100> _Timer_server_Reset_tod_system_watchdog( ts ); 51904: 2f0a movel %a2,%sp@- 51906: 4eba fcd8 jsr %pc@(515e0 <_Timer_server_Reset_tod_system_watchdog>) 5190a: 588f addql #4,%sp * critical section. We have to use the protected chain methods because * we may be interrupted by a higher priority interrupt. */ _Chain_Append( ts->insert_chain, &timer->Object.Node ); } } 5190c: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 51912: 4e5e unlk %fp if ( !ts->active ) { _Timer_server_Reset_tod_system_watchdog( ts ); } } _Thread_Enable_dispatch(); 51914: 4ef9 0005 4012 jmp 54012 <_Thread_Enable_dispatch> * server is not preemptible, so we must be in interrupt context here. No * thread dispatch will happen until the timer server finishes its * critical section. We have to use the protected chain methods because * we may be interrupted by a higher priority interrupt. */ _Chain_Append( ts->insert_chain, &timer->Object.Node ); 5191a: 202a 0078 movel %a2@(120),%d0 5191e: 2d48 000c movel %a0,%fp@(12) } } 51922: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 * server is not preemptible, so we must be in interrupt context here. No * thread dispatch will happen until the timer server finishes its * critical section. We have to use the protected chain methods because * we may be interrupted by a higher priority interrupt. */ _Chain_Append( ts->insert_chain, &timer->Object.Node ); 51928: 2d40 0008 movel %d0,%fp@(8) } } 5192c: 4e5e unlk %fp * server is not preemptible, so we must be in interrupt context here. No * thread dispatch will happen until the timer server finishes its * critical section. We have to use the protected chain methods because * we may be interrupted by a higher priority interrupt. */ _Chain_Append( ts->insert_chain, &timer->Object.Node ); 5192e: 4ef9 0005 1fdc jmp 51fdc <_Chain_Append> 0004920c <_Watchdog_Adjust>: Watchdog_Interval units ) { ISR_Level level; _ISR_Disable( level ); 4920c: 327c 0700 moveaw #1792,%a1 49210: 2209 movel %a1,%d1 void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 49212: 4e56 ffe8 linkw %fp,#-24 49216: 48d7 1c1c moveml %d2-%d4/%a2-%a4,%sp@ 4921a: 266e 0008 moveal %fp@(8),%a3 4921e: 262e 000c movel %fp@(12),%d3 49222: 242e 0010 movel %fp@(16),%d2 ISR_Level level; _ISR_Disable( level ); 49226: 40c0 movew %sr,%d0 49228: 8280 orl %d0,%d1 4922a: 46c1 movew %d1,%sr */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 4922c: 244b moveal %a3,%a2 4922e: 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 ) ) { 49230: b5c8 cmpal %a0,%a2 49232: 674c beqs 49280 <_Watchdog_Adjust+0x74> switch ( direction ) { 49234: 4a83 tstl %d3 49236: 673c beqs 49274 <_Watchdog_Adjust+0x68> 49238: 7201 moveq #1,%d1 4923a: b283 cmpl %d3,%d1 4923c: 6642 bnes 49280 <_Watchdog_Adjust+0x74> <== NEVER TAKEN case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; 4923e: d5a8 0010 addl %d2,%a0@(16) break; 49242: 603c bras 49280 <_Watchdog_Adjust+0x74> RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First( Chain_Control *header ) { return ( (Watchdog_Control *) header->first ); 49244: 2053 moveal %a3@,%a0 case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { 49246: 2628 0010 movel %a0@(16),%d3 4924a: b682 cmpl %d2,%d3 4924c: 6308 blss 49256 <_Watchdog_Adjust+0x4a> _Watchdog_First( header )->delta_interval -= units; 4924e: 9682 subl %d2,%d3 49250: 2143 0010 movel %d3,%a0@(16) break; 49254: 602a bras 49280 <_Watchdog_Adjust+0x74> } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; 49256: 7201 moveq #1,%d1 49258: 2141 0010 movel %d1,%a0@(16) _ISR_Enable( level ); 4925c: 46c0 movew %d0,%sr _Watchdog_Tickle( header ); 4925e: 2f0b movel %a3,%sp@- 49260: 4e94 jsr %a4@ _ISR_Disable( level ); 49262: 2204 movel %d4,%d1 49264: 40c0 movew %sr,%d0 49266: 8280 orl %d0,%d1 49268: 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; 4926a: 9483 subl %d3,%d2 _Watchdog_Tickle( header ); _ISR_Disable( level ); if ( _Chain_Is_empty( header ) ) 4926c: 588f addql #4,%sp 4926e: b5d3 cmpal %a3@,%a2 49270: 660a bnes 4927c <_Watchdog_Adjust+0x70> 49272: 600c bras 49280 <_Watchdog_Adjust+0x74> _ISR_Enable( level ); _Watchdog_Tickle( header ); _ISR_Disable( level ); 49274: 2809 movel %a1,%d4 units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; _ISR_Enable( level ); _Watchdog_Tickle( header ); 49276: 49f9 0004 9424 lea 49424 <_Watchdog_Tickle>,%a4 switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 4927c: 4a82 tstl %d2 4927e: 66c4 bnes 49244 <_Watchdog_Adjust+0x38> <== ALWAYS TAKEN } break; } } _ISR_Enable( level ); 49280: 46c0 movew %d0,%sr } 49282: 4cee 1c1c ffe8 moveml %fp@(-24),%d2-%d4/%a2-%a4 49288: 4e5e unlk %fp <== NOT EXECUTED 00047d6c <_Watchdog_Remove>: { ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 47d6c: 203c 0000 0700 movel #1792,%d0 */ Watchdog_States _Watchdog_Remove( Watchdog_Control *the_watchdog ) { 47d72: 4e56 0000 linkw %fp,#0 47d76: 206e 0008 moveal %fp@(8),%a0 47d7a: 2f0a movel %a2,%sp@- 47d7c: 2f02 movel %d2,%sp@- ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 47d7e: 40c1 movew %sr,%d1 47d80: 8081 orl %d1,%d0 47d82: 46c0 movew %d0,%sr previous_state = the_watchdog->state; 47d84: 2028 0008 movel %a0@(8),%d0 switch ( previous_state ) { 47d88: 7401 moveq #1,%d2 47d8a: b480 cmpl %d0,%d2 47d8c: 670c beqs 47d9a <_Watchdog_Remove+0x2e> 47d8e: 6244 bhis 47dd4 <_Watchdog_Remove+0x68> 47d90: 143c 0003 moveb #3,%d2 47d94: b480 cmpl %d0,%d2 47d96: 653c bcss 47dd4 <_Watchdog_Remove+0x68> <== NEVER TAKEN 47d98: 6006 bras 47da0 <_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; 47d9a: 42a8 0008 clrl %a0@(8) break; 47d9e: 6034 bras 47dd4 <_Watchdog_Remove+0x68> RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_Next( Watchdog_Control *the_watchdog ) { return ( (Watchdog_Control *) the_watchdog->Node.next ); 47da0: 2250 moveal %a0@,%a1 case WATCHDOG_ACTIVE: case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; 47da2: 42a8 0008 clrl %a0@(8) next_watchdog = _Watchdog_Next( the_watchdog ); if ( _Watchdog_Next(next_watchdog) ) 47da6: 4a91 tstl %a1@ 47da8: 6708 beqs 47db2 <_Watchdog_Remove+0x46> next_watchdog->delta_interval += the_watchdog->delta_interval; 47daa: 2428 0010 movel %a0@(16),%d2 47dae: d5a9 0010 addl %d2,%a1@(16) if ( _Watchdog_Sync_count ) 47db2: 2279 0005 ce48 moveal 5ce48 <_Watchdog_Sync_count>,%a1 47db8: 4a89 tstl %a1 47dba: 670c beqs 47dc8 <_Watchdog_Remove+0x5c> _Watchdog_Sync_level = _ISR_Nest_level; 47dbc: 2279 0005 cda2 moveal 5cda2 <_ISR_Nest_level>,%a1 47dc2: 23c9 0005 cdbe movel %a1,5cdbe <_Watchdog_Sync_level> ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 47dc8: 2250 moveal %a0@,%a1 previous = the_node->previous; 47dca: 2468 0004 moveal %a0@(4),%a2 next->previous = previous; previous->next = next; 47dce: 2489 movel %a1,%a2@ Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 47dd0: 234a 0004 movel %a2,%a1@(4) _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 47dd4: 2279 0005 ce4c moveal 5ce4c <_Watchdog_Ticks_since_boot>,%a1 47dda: 2149 0018 movel %a1,%a0@(24) _ISR_Enable( level ); 47dde: 46c1 movew %d1,%sr return( previous_state ); } 47de0: 241f movel %sp@+,%d2 47de2: 245f moveal %sp@+,%a2 47de4: 4e5e unlk %fp <== NOT EXECUTED 00048dfc <_Watchdog_Report_chain>: ) { ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 48dfc: 203c 0000 0700 movel #1792,%d0 void _Watchdog_Report_chain( const char *name, Chain_Control *header ) { 48e02: 4e56 ffec linkw %fp,#-20 48e06: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@ 48e0a: 242e 0008 movel %fp@(8),%d2 48e0e: 266e 000c moveal %fp@(12),%a3 ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 48e12: 40c3 movew %sr,%d3 48e14: 8083 orl %d3,%d0 48e16: 46c0 movew %d0,%sr printk( "Watchdog Chain: %s %p\n", name, header ); 48e18: 2f0b movel %a3,%sp@- 48e1a: 49f9 0004 3698 lea 43698 ,%a4 48e20: 2f02 movel %d2,%sp@- 48e22: 4879 0005 c030 pea 5c030 48e28: 4e94 jsr %a4@ */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 48e2a: 245b moveal %a3@+,%a2 if ( !_Chain_Is_empty( header ) ) { 48e2c: 4fef 000c lea %sp@(12),%sp 48e30: b7ca cmpal %a2,%a3 48e32: 6726 beqs 48e5a <_Watchdog_Report_chain+0x5e> node != _Chain_Tail(header) ; node = node->next ) { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); 48e34: 49f9 0004 8e70 lea 48e70 <_Watchdog_Report>,%a4 48e3a: 2f0a movel %a2,%sp@- 48e3c: 42a7 clrl %sp@- 48e3e: 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 ) 48e40: 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 ; 48e42: 508f addql #8,%sp 48e44: b7ca cmpal %a2,%a3 48e46: 66f2 bnes 48e3a <_Watchdog_Report_chain+0x3e> <== NEVER TAKEN { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); 48e48: 2f02 movel %d2,%sp@- 48e4a: 4879 0005 c047 pea 5c047 48e50: 4eb9 0004 3698 jsr 43698 48e56: 508f addql #8,%sp 48e58: 600a bras 48e64 <_Watchdog_Report_chain+0x68> } else { printk( "Chain is empty\n" ); 48e5a: 4879 0005 c056 pea 5c056 48e60: 4e94 jsr %a4@ 48e62: 588f addql #4,%sp } _ISR_Enable( level ); 48e64: 46c3 movew %d3,%sr } 48e66: 4cee 1c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a4 48e6c: 4e5e unlk %fp <== NOT EXECUTED 00047de8 <_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 ); 47de8: 203c 0000 0700 movel #1792,%d0 */ void _Watchdog_Tickle( Chain_Control *header ) { 47dee: 4e56 ffe8 linkw %fp,#-24 47df2: 48d7 3c0c moveml %d2-%d3/%a2-%a5,%sp@ 47df6: 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 ); 47dfa: 40c2 movew %sr,%d2 47dfc: 8082 orl %d2,%d0 47dfe: 46c0 movew %d0,%sr */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 47e00: 264c moveal %a4,%a3 47e02: 245b moveal %a3@+,%a2 if ( _Chain_Is_empty( header ) ) 47e04: b7ca cmpal %a2,%a3 47e06: 674e beqs 47e56 <_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) { 47e08: 202a 0010 movel %a2@(16),%d0 47e0c: 6708 beqs 47e16 <_Watchdog_Tickle+0x2e> the_watchdog->delta_interval--; 47e0e: 5380 subql #1,%d0 47e10: 2540 0010 movel %d0,%a2@(16) if ( the_watchdog->delta_interval != 0 ) 47e14: 6640 bnes 47e56 <_Watchdog_Tickle+0x6e> goto leave; } do { watchdog_state = _Watchdog_Remove( the_watchdog ); 47e16: 4bf9 0004 7d6c lea 47d6c <_Watchdog_Remove>,%a5 case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 47e1c: 263c 0000 0700 movel #1792,%d3 if ( the_watchdog->delta_interval != 0 ) goto leave; } do { watchdog_state = _Watchdog_Remove( the_watchdog ); 47e22: 2f0a movel %a2,%sp@- 47e24: 4e95 jsr %a5@ _ISR_Enable( level ); 47e26: 46c2 movew %d2,%sr switch( watchdog_state ) { 47e28: 7202 moveq #2,%d1 47e2a: 588f addql #4,%sp 47e2c: b280 cmpl %d0,%d1 47e2e: 6610 bnes 47e40 <_Watchdog_Tickle+0x58> <== NEVER TAKEN case WATCHDOG_ACTIVE: (*the_watchdog->routine)( 47e30: 2f2a 0024 movel %a2@(36),%sp@- 47e34: 2f2a 0020 movel %a2@(32),%sp@- 47e38: 206a 001c moveal %a2@(28),%a0 47e3c: 4e90 jsr %a0@ 47e3e: 508f addql #8,%sp case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 47e40: 2003 movel %d3,%d0 47e42: 40c2 movew %sr,%d2 47e44: 8082 orl %d2,%d0 47e46: 46c0 movew %d0,%sr RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First( Chain_Control *header ) { return ( (Watchdog_Control *) header->first ); 47e48: 2014 movel %a4@,%d0 47e4a: 2440 moveal %d0,%a2 the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); 47e4c: b7c0 cmpal %d0,%a3 47e4e: 6706 beqs 47e56 <_Watchdog_Tickle+0x6e> 47e50: 4aaa 0010 tstl %a2@(16) 47e54: 67cc beqs 47e22 <_Watchdog_Tickle+0x3a> leave: _ISR_Enable(level); 47e56: 46c2 movew %d2,%sr } 47e58: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 47e5e: 4e5e unlk %fp ... 00044eb0 : int adjtime( struct timeval *delta, struct timeval *olddelta ) { 44eb0: 4e56 fff8 linkw %fp,#-8 44eb4: 2f0b movel %a3,%sp@- 44eb6: 266e 000c moveal %fp@(12),%a3 44eba: 2f0a movel %a2,%sp@- 44ebc: 246e 0008 moveal %fp@(8),%a2 long adjustment; /* * Simple validations */ if ( !delta ) 44ec0: 4a8a tstl %a2 44ec2: 670c beqs 44ed0 rtems_set_errno_and_return_minus_one( EINVAL ); if ( delta->tv_usec >= TOD_MICROSECONDS_PER_SECOND ) 44ec4: 227c 000f 423f moveal #999999,%a1 44eca: b3ea 0004 cmpal %a2@(4),%a1 44ece: 6412 bccs 44ee2 rtems_set_errno_and_return_minus_one( EINVAL ); 44ed0: 4eb9 0004 d3d0 jsr 4d3d0 <__errno> 44ed6: 72ff moveq #-1,%d1 44ed8: 2040 moveal %d0,%a0 44eda: 7016 moveq #22,%d0 44edc: 2080 movel %d0,%a0@ 44ede: 6000 00b2 braw 44f92 if ( olddelta ) { 44ee2: 4a8b tstl %a3 44ee4: 6706 beqs 44eec olddelta->tv_sec = 0; 44ee6: 4293 clrl %a3@ olddelta->tv_usec = 0; 44ee8: 42ab 0004 clrl %a3@(4) } /* convert delta to microseconds */ adjustment = (delta->tv_sec * TOD_MICROSECONDS_PER_SECOND); 44eec: 203c 000f 4240 movel #1000000,%d0 44ef2: 4c12 0800 mulsl %a2@,%d0 adjustment += delta->tv_usec; 44ef6: d0aa 0004 addl %a2@(4),%d0 /* too small to account for */ if ( adjustment < rtems_configuration_get_microseconds_per_tick() ) 44efa: b0b9 0005 c850 cmpl 5c850 ,%d0 44f00: 6500 008e bcsw 44f90 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 44f04: 2039 0005 e130 movel 5e130 <_Thread_Dispatch_disable_level>,%d0 44f0a: 5280 addql #1,%d0 44f0c: 23c0 0005 e130 movel %d0,5e130 <_Thread_Dispatch_disable_level> * This prevents context switches while we are adjusting the TOD */ _Thread_Disable_dispatch(); _TOD_Get( &ts ); 44f12: 486e fff8 pea %fp@(-8) 44f16: 4eb9 0004 650c jsr 4650c <_TOD_Get> ts.tv_sec += delta->tv_sec; ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; 44f1c: 202a 0004 movel %a2@(4),%d0 44f20: 223c 0000 03e8 movel #1000,%d1 44f26: 4c01 0800 mulsl %d1,%d0 /* if adjustment is too much positive */ while ( ts.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 44f2a: 588f addql #4,%sp _Thread_Disable_dispatch(); _TOD_Get( &ts ); ts.tv_sec += delta->tv_sec; 44f2c: 2212 movel %a2@,%d1 44f2e: d3ae fff8 addl %d1,%fp@(-8) ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; 44f32: d0ae fffc addl %fp@(-4),%d0 44f36: 206e fff8 moveal %fp@(-8),%a0 /* if adjustment is too much positive */ while ( ts.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 44f3a: 6006 bras 44f42 44f3c: 0680 c465 3600 addil #-1000000000,%d0 44f42: 2208 movel %a0,%d1 44f44: 5288 addql #1,%a0 44f46: 0c80 3b9a c9ff cmpil #999999999,%d0 44f4c: 62ee bhis 44f3c 44f4e: 6006 bras 44f56 44f50: 0680 3b9a ca00 addil #1000000000,%d0 44f56: 2041 moveal %d1,%a0 44f58: 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) ) { 44f5a: 0c80 c465 3600 cmpil #-1000000000,%d0 44f60: 63ee blss 44f50 ts.tv_nsec += TOD_NANOSECONDS_PER_SECOND; ts.tv_sec--; } _TOD_Set( &ts ); 44f62: 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) ) { 44f66: 2d40 fffc movel %d0,%fp@(-4) 44f6a: 2d48 fff8 movel %a0,%fp@(-8) ts.tv_nsec += TOD_NANOSECONDS_PER_SECOND; ts.tv_sec--; } _TOD_Set( &ts ); 44f6e: 4eb9 0004 65a8 jsr 465a8 <_TOD_Set> _Thread_Enable_dispatch(); 44f74: 4eb9 0004 75f6 jsr 475f6 <_Thread_Enable_dispatch> /* set the user's output */ if ( olddelta ) 44f7a: 588f addql #4,%sp 44f7c: 4a8b tstl %a3 44f7e: 6710 beqs 44f90 <== NEVER TAKEN *olddelta = *delta; 44f80: 4281 clrl %d1 44f82: 2052 moveal %a2@,%a0 44f84: 226a 0004 moveal %a2@(4),%a1 44f88: 2688 movel %a0,%a3@ 44f8a: 2749 0004 movel %a1,%a3@(4) 44f8e: 6002 bras 44f92 44f90: 4281 clrl %d1 return 0; } 44f92: 246e fff0 moveal %fp@(-16),%a2 44f96: 2001 movel %d1,%d0 44f98: 266e fff4 moveal %fp@(-12),%a3 44f9c: 4e5e unlk %fp <== NOT EXECUTED 00044da8 : int clock_gettime( clockid_t clock_id, struct timespec *tp ) { 44da8: 4e56 0000 linkw %fp,#0 44dac: 222e 0008 movel %fp@(8),%d1 44db0: 202e 000c movel %fp@(12),%d0 44db4: 2f02 movel %d2,%sp@- if ( !tp ) 44db6: 4a80 tstl %d0 44db8: 6608 bnes 44dc2 rtems_set_errno_and_return_minus_one( EINVAL ); 44dba: 4eb9 0004 d780 jsr 4d780 <__errno> 44dc0: 6044 bras 44e06 if ( clock_id == CLOCK_REALTIME ) { 44dc2: 7401 moveq #1,%d2 44dc4: b481 cmpl %d1,%d2 44dc6: 660a bnes 44dd2 _TOD_Get(tp); 44dc8: 2f00 movel %d0,%sp@- 44dca: 4eb9 0004 69ec jsr 469ec <_TOD_Get> 44dd0: 600e bras 44de0 return 0; } #ifdef CLOCK_MONOTONIC if ( clock_id == CLOCK_MONOTONIC ) { 44dd2: 7404 moveq #4,%d2 44dd4: b481 cmpl %d1,%d2 44dd6: 660e bnes 44de6 <== ALWAYS TAKEN _TOD_Get_uptime_as_timespec( tp ); 44dd8: 2f00 movel %d0,%sp@- 44dda: 4eb9 0004 6a58 jsr 46a58 <_TOD_Get_uptime_as_timespec> return 0; 44de0: 588f addql #4,%sp _TOD_Get(tp); return 0; } #ifdef CLOCK_MONOTONIC if ( clock_id == CLOCK_MONOTONIC ) { _TOD_Get_uptime_as_timespec( tp ); 44de2: 4281 clrl %d1 return 0; 44de4: 6028 bras 44e0e } #endif #ifdef _POSIX_CPUTIME if ( clock_id == CLOCK_PROCESS_CPUTIME ) { 44de6: 7402 moveq #2,%d2 44de8: b481 cmpl %d1,%d2 44dea: 67ec beqs 44dd8 44dec: 41f9 0004 d780 lea 4d780 <__errno>,%a0 return 0; } #endif #ifdef _POSIX_THREAD_CPUTIME if ( clock_id == CLOCK_THREAD_CPUTIME ) 44df2: 7003 moveq #3,%d0 44df4: b081 cmpl %d1,%d0 44df6: 660c bnes 44e04 rtems_set_errno_and_return_minus_one( ENOSYS ); 44df8: 4e90 jsr %a0@ 44dfa: 7458 moveq #88,%d2 44dfc: 72ff moveq #-1,%d1 44dfe: 2040 moveal %d0,%a0 44e00: 2082 movel %d2,%a0@ 44e02: 600a bras 44e0e #endif rtems_set_errno_and_return_minus_one( EINVAL ); 44e04: 4e90 jsr %a0@ 44e06: 2040 moveal %d0,%a0 44e08: 7016 moveq #22,%d0 44e0a: 72ff moveq #-1,%d1 44e0c: 2080 movel %d0,%a0@ return 0; } 44e0e: 242e fffc movel %fp@(-4),%d2 44e12: 2001 movel %d1,%d0 44e14: 4e5e unlk %fp <== NOT EXECUTED 00044e18 : int clock_settime( clockid_t clock_id, const struct timespec *tp ) { 44e18: 4e56 0000 linkw %fp,#0 44e1c: 222e 0008 movel %fp@(8),%d1 44e20: 206e 000c moveal %fp@(12),%a0 if ( !tp ) 44e24: 4a88 tstl %a0 44e26: 6710 beqs 44e38 <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { 44e28: 7001 moveq #1,%d0 44e2a: b081 cmpl %d1,%d0 44e2c: 6634 bnes 44e62 if ( tp->tv_sec < TOD_SECONDS_1970_THROUGH_1988 ) 44e2e: 203c 21da e4ff movel #567993599,%d0 44e34: b090 cmpl %a0@,%d0 44e36: 6508 bcss 44e40 rtems_set_errno_and_return_minus_one( EINVAL ); 44e38: 4eb9 0004 d780 jsr 4d780 <__errno> 44e3e: 604a bras 44e8a rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 44e40: 2039 0005 e908 movel 5e908 <_Thread_Dispatch_disable_level>,%d0 44e46: 5280 addql #1,%d0 44e48: 23c0 0005 e908 movel %d0,5e908 <_Thread_Dispatch_disable_level> _Thread_Disable_dispatch(); _TOD_Set( tp ); 44e4e: 2f08 movel %a0,%sp@- 44e50: 4eb9 0004 6ab0 jsr 46ab0 <_TOD_Set> _Thread_Enable_dispatch(); 44e56: 4eb9 0004 7afe jsr 47afe <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( ENOSYS ); #endif else rtems_set_errno_and_return_minus_one( EINVAL ); return 0; 44e5c: 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(); 44e5e: 4281 clrl %d1 rtems_set_errno_and_return_minus_one( ENOSYS ); #endif else rtems_set_errno_and_return_minus_one( EINVAL ); return 0; 44e60: 6030 bras 44e92 _Thread_Disable_dispatch(); _TOD_Set( tp ); _Thread_Enable_dispatch(); } #ifdef _POSIX_CPUTIME else if ( clock_id == CLOCK_PROCESS_CPUTIME ) 44e62: 7002 moveq #2,%d0 44e64: b081 cmpl %d1,%d0 44e66: 6608 bnes 44e70 rtems_set_errno_and_return_minus_one( ENOSYS ); 44e68: 4eb9 0004 d780 jsr 4d780 <__errno> 44e6e: 600e bras 44e7e 44e70: 41f9 0004 d780 lea 4d780 <__errno>,%a0 #endif #ifdef _POSIX_THREAD_CPUTIME else if ( clock_id == CLOCK_THREAD_CPUTIME ) 44e76: 7003 moveq #3,%d0 44e78: b081 cmpl %d1,%d0 44e7a: 660c bnes 44e88 rtems_set_errno_and_return_minus_one( ENOSYS ); 44e7c: 4e90 jsr %a0@ 44e7e: 2040 moveal %d0,%a0 44e80: 7058 moveq #88,%d0 44e82: 72ff moveq #-1,%d1 44e84: 2080 movel %d0,%a0@ 44e86: 600a bras 44e92 #endif else rtems_set_errno_and_return_minus_one( EINVAL ); 44e88: 4e90 jsr %a0@ 44e8a: 2040 moveal %d0,%a0 44e8c: 7016 moveq #22,%d0 44e8e: 72ff moveq #-1,%d1 44e90: 2080 movel %d0,%a0@ return 0; } 44e92: 2001 movel %d1,%d0 44e94: 4e5e unlk %fp <== NOT EXECUTED 0004c5b4 : int killinfo( pid_t pid, int sig, const union sigval *value ) { 4c5b4: 4e56 ffd0 linkw %fp,#-48 4c5b8: 48d7 1cfc moveml %d2-%d7/%a2-%a4,%sp@ 4c5bc: 242e 000c movel %fp@(12),%d2 4c5c0: 246e 0010 moveal %fp@(16),%a2 POSIX_signals_Siginfo_node *psiginfo; /* * Only supported for the "calling process" (i.e. this node). */ if ( pid != getpid() ) 4c5c4: 4eb9 0004 b788 jsr 4b788 4c5ca: b0ae 0008 cmpl %fp@(8),%d0 4c5ce: 6712 beqs 4c5e2 rtems_set_errno_and_return_minus_one( ESRCH ); 4c5d0: 4eb9 0004 ca88 jsr 4ca88 <__errno> 4c5d6: 7603 moveq #3,%d3 4c5d8: 72ff moveq #-1,%d1 4c5da: 2040 moveal %d0,%a0 4c5dc: 2083 movel %d3,%a0@ 4c5de: 6000 01ec braw 4c7cc /* * Validate the signal passed. */ if ( !sig ) 4c5e2: 4a82 tstl %d2 4c5e4: 670a beqs 4c5f0 static inline bool is_valid_signo( int signo ) { return ((signo) >= 1 && (signo) <= 32 ); 4c5e6: 2202 movel %d2,%d1 4c5e8: 5381 subql #1,%d1 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 4c5ea: 701f moveq #31,%d0 4c5ec: b081 cmpl %d1,%d0 4c5ee: 6412 bccs 4c602 rtems_set_errno_and_return_minus_one( EINVAL ); 4c5f0: 4eb9 0004 ca88 jsr 4ca88 <__errno> 4c5f6: 7416 moveq #22,%d2 4c5f8: 72ff moveq #-1,%d1 4c5fa: 2040 moveal %d0,%a0 4c5fc: 2082 movel %d2,%a0@ 4c5fe: 6000 01cc braw 4c7cc /* * If the signal is being ignored, then we are out of here. */ if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) 4c602: 2602 movel %d2,%d3 4c604: 2002 movel %d2,%d0 4c606: e58b lsll #2,%d3 4c608: e988 lsll #4,%d0 4c60a: 9083 subl %d3,%d0 4c60c: 0680 0005 d1be addil #381374,%d0 4c612: 7601 moveq #1,%d3 4c614: 2040 moveal %d0,%a0 4c616: b690 cmpl %a0@,%d3 4c618: 6700 01b0 beqw 4c7ca /* * 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 ) ) 4c61c: 7008 moveq #8,%d0 4c61e: b082 cmpl %d2,%d0 4c620: 670e beqs 4c630 4c622: 7604 moveq #4,%d3 4c624: b682 cmpl %d2,%d3 4c626: 6708 beqs 4c630 4c628: 103c 000b moveb #11,%d0 4c62c: b082 cmpl %d2,%d0 4c62e: 6618 bnes 4c648 return pthread_kill( pthread_self(), sig ); 4c630: 4eb9 0004 ca2c jsr 4ca2c 4c636: 2f02 movel %d2,%sp@- 4c638: 2f00 movel %d0,%sp@- 4c63a: 4eb9 0004 c96c jsr 4c96c 4c640: 508f addql #8,%sp 4c642: 2200 movel %d0,%d1 4c644: 6000 0186 braw 4c7cc static inline sigset_t signo_to_mask( uint32_t sig ) { return 1u << (sig - 1); 4c648: 7601 moveq #1,%d3 /* * Build up a siginfo structure */ siginfo = &siginfo_struct; siginfo->si_signo = sig; siginfo->si_code = SI_USER; 4c64a: 7001 moveq #1,%d0 4c64c: e3ab lsll %d1,%d3 /* * Build up a siginfo structure */ siginfo = &siginfo_struct; siginfo->si_signo = sig; 4c64e: 2d42 fff4 movel %d2,%fp@(-12) siginfo->si_code = SI_USER; 4c652: 2d40 fff8 movel %d0,%fp@(-8) if ( !value ) { 4c656: 4a8a tstl %a2 4c658: 6606 bnes 4c660 siginfo->si_value.sival_int = 0; 4c65a: 42ae fffc clrl %fp@(-4) 4c65e: 6004 bras 4c664 } else { siginfo->si_value = *value; 4c660: 2d52 fffc movel %a2@,%fp@(-4) 4c664: 2039 0005 cd08 movel 5cd08 <_Thread_Dispatch_disable_level>,%d0 4c66a: 5280 addql #1,%d0 4c66c: 23c0 0005 cd08 movel %d0,5cd08 <_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; 4c672: 2279 0005 cdc2 moveal 5cdc2 <_Thread_Executing>,%a1 api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4c678: 2069 010e moveal %a1@(270),%a0 4c67c: 2028 00cc movel %a0@(204),%d0 4c680: 4680 notl %d0 4c682: c083 andl %d3,%d0 4c684: 6600 00b2 bnew 4c738 /* XXX violation of visibility -- need to define thread queue support */ the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = the_chain->first ; 4c688: 2079 0005 d342 moveal 5d342 <_POSIX_signals_Wait_queue>,%a0 4c68e: 601c bras 4c6ac #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 4c690: 2003 movel %d3,%d0 4c692: 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 ]; 4c696: 2468 010e moveal %a0@(270),%a2 #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 4c69a: 6600 009c bnew 4c738 /* * Is this thread is blocked waiting for another signal but has * not blocked this one? */ if (~api->signals_blocked & mask) 4c69e: 202a 00cc movel %a2@(204),%d0 4c6a2: 4680 notl %d0 4c6a4: c083 andl %d3,%d0 4c6a6: 6600 0090 bnew 4c738 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 ) { 4c6aa: 2050 moveal %a0@,%a0 the_thread = (Thread_Control *)the_node; 4c6ac: 2248 moveal %a0,%a1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4c6ae: b1fc 0005 d346 cmpal #381766,%a0 4c6b4: 66da bnes 4c690 * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 4c6b6: 4280 clrl %d0 4c6b8: 1039 0005 b552 moveb 5b552 ,%d0 4c6be: 45f9 0005 ccc8 lea 5ccc8 <_Objects_Information_table+0x8>,%a2 */ #define _POSIX_signals_Is_interested( _api, _mask ) \ ( ~(_api)->signals_blocked & (_mask) ) int killinfo( 4c6c4: 93c9 subal %a1,%a1 * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 4c6c6: 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 ] ) 4c6c8: 2052 moveal %a2@,%a0 4c6ca: 4a88 tstl %a0 4c6cc: 675c beqs 4c72a continue; the_info = _Objects_Information_table[ the_api ][ 1 ]; 4c6ce: 2068 0004 moveal %a0@(4),%a0 */ if ( !the_info ) continue; #endif maximum = the_info->maximum; 4c6d2: 4287 clrl %d7 4c6d4: 7801 moveq #1,%d4 4c6d6: 2668 0018 moveal %a0@(24),%a3 4c6da: 588b addql #4,%a3 4c6dc: 3e28 000e movew %a0@(14),%d7 object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 4c6e0: 6044 bras 4c726 the_thread = (Thread_Control *) object_table[ index ]; 4c6e2: 2053 moveal %a3@,%a0 if ( !the_thread ) 4c6e4: 4a88 tstl %a0 4c6e6: 6732 beqs 4c71a /* * If this thread is of lower priority than the interested thread, * go on to the next thread. */ if ( the_thread->current_priority > interested_priority ) 4c6e8: 2228 0014 movel %a0@(20),%d1 4c6ec: b081 cmpl %d1,%d0 4c6ee: 652a bcss 4c71a DEBUG_STEP("2"); /* * If this thread is not interested, then go on to the next thread. */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4c6f0: 2868 010e moveal %a0@(270),%a4 4c6f4: 2a2c 00cc movel %a4@(204),%d5 4c6f8: 4685 notl %d5 4c6fa: ca83 andl %d3,%d5 4c6fc: 671c beqs 4c71a * * 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 ) { 4c6fe: b081 cmpl %d1,%d0 4c700: 621c bhis 4c71e * and blocking interruptibutable by signal. * * If the interested thread is ready, don't think about changing. */ if ( !_States_Is_ready( interested->current_state ) ) { 4c702: 2c29 0010 movel %a1@(16),%d6 4c706: 6712 beqs 4c71a <== NEVER TAKEN /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 4c708: 2a28 0010 movel %a0@(16),%d5 4c70c: 6710 beqs 4c71e continue; } DEBUG_STEP("6"); /* prefer blocked/interruptible over blocked/not interruptible */ if ( !_States_Is_interruptible_by_signal(interested->current_state) ) { 4c70e: 0806 001c btst #28,%d6 4c712: 6606 bnes 4c71a DEBUG_STEP("7"); if ( _States_Is_interruptible_by_signal(the_thread->current_state) ) { 4c714: 0805 001c btst #28,%d5 4c718: 6604 bnes 4c71e 4c71a: 2200 movel %d0,%d1 4c71c: 6002 bras 4c720 4c71e: 2248 moveal %a0,%a1 #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 4c720: 5284 addql #1,%d4 4c722: 588b addql #4,%a3 4c724: 2001 movel %d1,%d0 4c726: be84 cmpl %d4,%d7 4c728: 64b8 bccs 4c6e2 4c72a: 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++) { 4c72c: b5fc 0005 ccd4 cmpal #380116,%a2 4c732: 6694 bnes 4c6c8 } } } } if ( interested ) { 4c734: 4a89 tstl %a1 4c736: 671c beqs 4c754 * 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; 4c738: 7001 moveq #1,%d0 4c73a: 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 ) ) { 4c73e: 486e fff4 pea %fp@(-12) 4c742: 2f02 movel %d2,%sp@- 4c744: 2f09 movel %a1,%sp@- 4c746: 4eb9 0004 c870 jsr 4c870 <_POSIX_signals_Unblock_thread> 4c74c: 4fef 000c lea %sp@(12),%sp 4c750: 4a00 tstb %d0 4c752: 6670 bnes 4c7c4 /* * 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 ); 4c754: 2f03 movel %d3,%sp@- if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { 4c756: 2602 movel %d2,%d3 4c758: e58a lsll #2,%d2 4c75a: 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 ); 4c75c: 4eb9 0004 c840 jsr 4c840 <_POSIX_signals_Set_process_signals> if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { 4c762: 588f addql #4,%sp 4c764: 9682 subl %d2,%d3 4c766: 41f9 0005 d1b6 lea 5d1b6 <_POSIX_signals_Vectors>,%a0 4c76c: 7002 moveq #2,%d0 4c76e: b0b0 3800 cmpl %a0@(00000000,%d3:l),%d0 4c772: 6650 bnes 4c7c4 psiginfo = (POSIX_signals_Siginfo_node *) 4c774: 4879 0005 d336 pea 5d336 <_POSIX_signals_Inactive_siginfo> 4c77a: 4eb9 0004 a070 jsr 4a070 <_Chain_Get> _Chain_Get( &_POSIX_signals_Inactive_siginfo ); if ( !psiginfo ) { 4c780: 588f addql #4,%sp */ _POSIX_signals_Set_process_signals( mask ); if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { psiginfo = (POSIX_signals_Siginfo_node *) 4c782: 2440 moveal %d0,%a2 _Chain_Get( &_POSIX_signals_Inactive_siginfo ); if ( !psiginfo ) { 4c784: 4a80 tstl %d0 4c786: 6616 bnes 4c79e _Thread_Enable_dispatch(); 4c788: 4eb9 0004 6ce2 jsr 46ce2 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EAGAIN ); 4c78e: 4eb9 0004 ca88 jsr 4ca88 <__errno> 4c794: 72ff moveq #-1,%d1 4c796: 2040 moveal %d0,%a0 4c798: 700b moveq #11,%d0 4c79a: 2080 movel %d0,%a0@ 4c79c: 602e bras 4c7cc } psiginfo->Info = *siginfo; 4c79e: 4878 000c pea c _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 4c7a2: 0683 0005 d3ae addil #381870,%d3 if ( !psiginfo ) { _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EAGAIN ); } psiginfo->Info = *siginfo; 4c7a8: 486e fff4 pea %fp@(-12) 4c7ac: 486a 0008 pea %a2@(8) 4c7b0: 4eb9 0004 d2a8 jsr 4d2a8 _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 4c7b6: 2f0a movel %a2,%sp@- 4c7b8: 2f03 movel %d3,%sp@- 4c7ba: 4eb9 0004 58d0 jsr 458d0 <_Chain_Append> 4c7c0: 4fef 0014 lea %sp@(20),%sp } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); 4c7c4: 4eb9 0004 6ce2 jsr 46ce2 <_Thread_Enable_dispatch> 4c7ca: 4281 clrl %d1 return 0; } 4c7cc: 2001 movel %d1,%d0 4c7ce: 4cee 1cfc ffd0 moveml %fp@(-48),%d2-%d7/%a2-%a4 4c7d4: 4e5e unlk %fp <== NOT EXECUTED 0005a070 : int nanosleep( const struct timespec *rqtp, struct timespec *rmtp ) { 5a070: 4e56 fff4 linkw %fp,#-12 5a074: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 5a078: 266e 0008 moveal %fp@(8),%a3 5a07c: 246e 000c moveal %fp@(12),%a2 Watchdog_Interval ticks; if ( !_Timespec_Is_valid( rqtp ) ) 5a080: 2f0b movel %a3,%sp@- 5a082: 4eb9 0005 a1c0 jsr 5a1c0 <_Timespec_Is_valid> 5a088: 588f addql #4,%sp 5a08a: 4a00 tstb %d0 5a08c: 670a beqs 5a098 * 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 ) 5a08e: 4a93 tstl %a3@ 5a090: 6d06 blts 5a098 <== NEVER TAKEN 5a092: 4aab 0004 tstl %a3@(4) 5a096: 6c12 bges 5a0aa <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); 5a098: 4eb9 0004 cec8 jsr 4cec8 <__errno> 5a09e: 7416 moveq #22,%d2 5a0a0: 72ff moveq #-1,%d1 5a0a2: 2040 moveal %d0,%a0 5a0a4: 2082 movel %d2,%a0@ 5a0a6: 6000 00ce braw 5a176 ticks = _Timespec_To_ticks( rqtp ); 5a0aa: 2f0b movel %a3,%sp@- 5a0ac: 47f9 0004 70ea lea 470ea <_Thread_Enable_dispatch>,%a3 5a0b2: 4eb9 0004 ae04 jsr 4ae04 <_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 ) { 5a0b8: 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 ); 5a0ba: 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 ) { 5a0bc: 6628 bnes 5a0e6 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 5a0be: 2039 0005 db40 movel 5db40 <_Thread_Dispatch_disable_level>,%d0 5a0c4: 5280 addql #1,%d0 5a0c6: 23c0 0005 db40 movel %d0,5db40 <_Thread_Dispatch_disable_level> _Thread_Disable_dispatch(); _Thread_Yield_processor(); 5a0cc: 4eb9 0004 7cf4 jsr 47cf4 <_Thread_Yield_processor> _Thread_Enable_dispatch(); 5a0d2: 4e93 jsr %a3@ if ( rmtp ) { 5a0d4: 4a8a tstl %a2 5a0d6: 6700 009c beqw 5a174 rmtp->tv_sec = 0; rmtp->tv_nsec = 0; 5a0da: 42aa 0004 clrl %a2@(4) 5a0de: 4281 clrl %d1 if ( !ticks ) { _Thread_Disable_dispatch(); _Thread_Yield_processor(); _Thread_Enable_dispatch(); if ( rmtp ) { rmtp->tv_sec = 0; 5a0e0: 4292 clrl %a2@ 5a0e2: 6000 0092 braw 5a176 5a0e6: 2039 0005 db40 movel 5db40 <_Thread_Dispatch_disable_level>,%d0 5a0ec: 5280 addql #1,%d0 5a0ee: 23c0 0005 db40 movel %d0,5db40 <_Thread_Dispatch_disable_level> /* * Block for the desired amount of time */ _Thread_Disable_dispatch(); _Thread_Set_state( 5a0f4: 2f3c 1000 0008 movel #268435464,%sp@- 5a0fa: 2f39 0005 dbfa movel 5dbfa <_Thread_Executing>,%sp@- 5a100: 4eb9 0004 7918 jsr 47918 <_Thread_Set_state> STATES_DELAYING | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Watchdog_Initialize( &_Thread_Executing->Timer, _Thread_Delay_ended, _Thread_Executing->Object.id, 5a106: 2079 0005 dbfa moveal 5dbfa <_Thread_Executing>,%a0 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 5a10c: 203c 0004 6f5c movel #290652,%d0 5a112: 2140 0064 movel %d0,%a0@(100) _Thread_Disable_dispatch(); _Thread_Set_state( _Thread_Executing, STATES_DELAYING | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Watchdog_Initialize( 5a116: 2028 0008 movel %a0@(8),%d0 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 5a11a: 42a8 0050 clrl %a0@(80) the_watchdog->routine = routine; the_watchdog->id = id; 5a11e: 2140 0068 movel %d0,%a0@(104) the_watchdog->user_data = user_data; 5a122: 42a8 006c clrl %a0@(108) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 5a126: 2142 0054 movel %d2,%a0@(84) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 5a12a: 4868 0048 pea %a0@(72) 5a12e: 4879 0005 dc18 pea 5dc18 <_Watchdog_Ticks_chain> 5a134: 4eb9 0004 80d8 jsr 480d8 <_Watchdog_Insert> _Thread_Delay_ended, _Thread_Executing->Object.id, NULL ); _Watchdog_Insert_ticks( &_Thread_Executing->Timer, ticks ); _Thread_Enable_dispatch(); 5a13a: 4e93 jsr %a3@ /* calculate time remaining */ if ( rmtp ) { 5a13c: 4fef 0010 lea %sp@(16),%sp 5a140: 4a8a tstl %a2 5a142: 6730 beqs 5a174 ticks -= _Thread_Executing->Timer.stop_time - _Thread_Executing->Timer.start_time; 5a144: 2079 0005 dbfa moveal 5dbfa <_Thread_Executing>,%a0 _Thread_Enable_dispatch(); /* calculate time remaining */ if ( rmtp ) { ticks -= 5a14a: 2028 005c movel %a0@(92),%d0 5a14e: 90a8 0060 subl %a0@(96),%d0 5a152: d480 addl %d0,%d2 _Thread_Executing->Timer.stop_time - _Thread_Executing->Timer.start_time; _Timespec_From_ticks( ticks, rmtp ); 5a154: 2f0a movel %a2,%sp@- 5a156: 2f02 movel %d2,%sp@- 5a158: 4eb9 0005 a184 jsr 5a184 <_Timespec_From_ticks> */ #if defined(RTEMS_POSIX_API) /* * If there is time remaining, then we were interrupted by a signal. */ if ( ticks ) 5a15e: 508f addql #8,%sp 5a160: 4a82 tstl %d2 5a162: 6710 beqs 5a174 rtems_set_errno_and_return_minus_one( EINTR ); 5a164: 4eb9 0004 cec8 jsr 4cec8 <__errno> 5a16a: 72ff moveq #-1,%d1 5a16c: 2040 moveal %d0,%a0 5a16e: 7004 moveq #4,%d0 5a170: 2080 movel %d0,%a0@ 5a172: 6002 bras 5a176 5a174: 4281 clrl %d1 #endif } return 0; } 5a176: 2001 movel %d1,%d0 5a178: 4cee 0c04 fff4 moveml %fp@(-12),%d2/%a2-%a3 5a17e: 4e5e unlk %fp ... 00049160 : int pthread_attr_setschedpolicy( pthread_attr_t *attr, int policy ) { 49160: 4e56 0000 linkw %fp,#0 49164: 206e 0008 moveal %fp@(8),%a0 49168: 222e 000c movel %fp@(12),%d1 4916c: 2f02 movel %d2,%sp@- if ( !attr || !attr->is_initialized ) 4916e: 4a88 tstl %a0 49170: 6726 beqs 49198 49172: 4a90 tstl %a0@ 49174: 6722 beqs 49198 return EINVAL; switch ( policy ) { 49176: 7004 moveq #4,%d0 49178: b081 cmpl %d1,%d0 4917a: 650c bcss 49188 4917c: 103c 0001 moveb #1,%d0 49180: 7417 moveq #23,%d2 49182: e3a8 lsll %d1,%d0 49184: c082 andl %d2,%d0 49186: 6608 bnes 49190 <== ALWAYS TAKEN 49188: 203c 0000 0086 movel #134,%d0 4918e: 600a bras 4919a case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: case SCHED_SPORADIC: attr->schedpolicy = policy; 49190: 2141 0014 movel %d1,%a0@(20) 49194: 4280 clrl %d0 return 0; 49196: 6002 bras 4919a 49198: 7016 moveq #22,%d0 default: return ENOTSUP; } } 4919a: 241f movel %sp@+,%d2 4919c: 4e5e unlk %fp <== NOT EXECUTED 000452b4 : int pthread_barrier_init( pthread_barrier_t *barrier, const pthread_barrierattr_t *attr, unsigned int count ) { 452b4: 4e56 ffe0 linkw %fp,#-32 452b8: 206e 000c moveal %fp@(12),%a0 452bc: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ 452c0: 266e 0008 moveal %fp@(8),%a3 452c4: 246e 0010 moveal %fp@(16),%a2 const pthread_barrierattr_t *the_attr; /* * Error check parameters */ if ( !barrier ) 452c8: 4a8b tstl %a3 452ca: 6700 008e beqw 4535a return EINVAL; if ( count == 0 ) 452ce: 4a8a tstl %a2 452d0: 6700 0088 beqw 4535a return EINVAL; /* * If the user passed in NULL, use the default attributes */ if ( attr ) { 452d4: 4a88 tstl %a0 452d6: 6614 bnes 452ec the_attr = attr; } else { (void) pthread_barrierattr_init( &my_attr ); 452d8: 240e movel %fp,%d2 452da: 0682 ffff fff0 addil #-16,%d2 452e0: 2f02 movel %d2,%sp@- 452e2: 4eb9 0004 51f8 jsr 451f8 452e8: 588f addql #4,%sp 452ea: 2042 moveal %d2,%a0 } /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) 452ec: 4a90 tstl %a0@ 452ee: 676a beqs 4535a return EINVAL; switch ( the_attr->process_shared ) { 452f0: 4aa8 0004 tstl %a0@(4) 452f4: 6664 bnes 4535a <== NEVER TAKEN rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 452f6: 2039 0005 e1dc movel 5e1dc <_Thread_Dispatch_disable_level>,%d0 452fc: 5280 addql #1,%d0 /* * Convert from POSIX attributes to Core Barrier attributes */ the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE; the_attributes.maximum_count = count; 452fe: 2d4a fffc movel %a2,%fp@(-4) 45302: 23c0 0005 e1dc movel %d0,5e1dc <_Thread_Dispatch_disable_level> } /* * Convert from POSIX attributes to Core Barrier attributes */ the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE; 45308: 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 *) 4530c: 4879 0005 e51e pea 5e51e <_POSIX_Barrier_Information> 45312: 45f9 0004 7ca2 lea 47ca2 <_Thread_Enable_dispatch>,%a2 45318: 4eb9 0004 70cc jsr 470cc <_Objects_Allocate> */ _Thread_Disable_dispatch(); /* prevents deletion */ the_barrier = _POSIX_Barrier_Allocate(); if ( !the_barrier ) { 4531e: 588f addql #4,%sp 45320: 2840 moveal %d0,%a4 45322: 4a80 tstl %d0 45324: 6606 bnes 4532c _Thread_Enable_dispatch(); 45326: 4e92 jsr %a2@ 45328: 700b moveq #11,%d0 return EAGAIN; 4532a: 6030 bras 4535c } _CORE_barrier_Initialize( &the_barrier->Barrier, &the_attributes ); 4532c: 486e fff8 pea %fp@(-8) 45330: 486c 0010 pea %a4@(16) 45334: 4eb9 0004 6868 jsr 46868 <_CORE_barrier_Initialize> #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4533a: 202c 0008 movel %a4@(8),%d0 4533e: 4281 clrl %d1 45340: 2079 0005 e536 moveal 5e536 <_POSIX_Barrier_Information+0x18>,%a0 45346: 3200 movew %d0,%d1 45348: 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; 4534c: 42ac 000c clrl %a4@(12) ); /* * Exit the critical section and return the user an operational barrier */ *barrier = the_barrier->Object.id; 45350: 2680 movel %d0,%a3@ _Thread_Enable_dispatch(); 45352: 4e92 jsr %a2@ return 0; 45354: 508f addql #8,%sp /* * Exit the critical section and return the user an operational barrier */ *barrier = the_barrier->Object.id; _Thread_Enable_dispatch(); 45356: 4280 clrl %d0 return 0; 45358: 6002 bras 4535c 4535a: 7016 moveq #22,%d0 } 4535c: 4cee 1c04 ffe0 moveml %fp@(-32),%d2/%a2-%a4 45362: 4e5e unlk %fp ... 00044cf8 : void pthread_cleanup_push( void (*routine)( void * ), void *arg ) { 44cf8: 4e56 0000 linkw %fp,#0 44cfc: 2f03 movel %d3,%sp@- 44cfe: 262e 000c movel %fp@(12),%d3 44d02: 2f02 movel %d2,%sp@- 44d04: 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 ) 44d08: 6754 beqs 44d5e rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 44d0a: 2039 0005 dc44 movel 5dc44 <_Thread_Dispatch_disable_level>,%d0 44d10: 5280 addql #1,%d0 44d12: 23c0 0005 dc44 movel %d0,5dc44 <_Thread_Dispatch_disable_level> return; _Thread_Disable_dispatch(); handler = _Workspace_Allocate( sizeof( POSIX_Cancel_Handler_control ) ); 44d18: 4878 0010 pea 10 44d1c: 4eb9 0004 8974 jsr 48974 <_Workspace_Allocate> if ( handler ) { 44d22: 588f addql #4,%sp 44d24: 4a80 tstl %d0 44d26: 6726 beqs 44d4e <== NEVER TAKEN thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; handler_stack = &thread_support->Cancellation_Handlers; 44d28: 2079 0005 dcfe moveal 5dcfe <_Thread_Executing>,%a0 44d2e: 2228 010e movel %a0@(270),%d1 handler->routine = routine; 44d32: 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; 44d34: 0681 0000 00e0 addil #224,%d1 handler->routine = routine; 44d3a: 2142 0008 movel %d2,%a0@(8) handler->arg = arg; 44d3e: 2143 000c movel %d3,%a0@(12) _Chain_Append( handler_stack, &handler->Node ); 44d42: 2f00 movel %d0,%sp@- 44d44: 2f01 movel %d1,%sp@- 44d46: 4eb9 0004 6388 jsr 46388 <_Chain_Append> 44d4c: 508f addql #8,%sp } _Thread_Enable_dispatch(); } 44d4e: 242e fff8 movel %fp@(-8),%d2 44d52: 262e fffc movel %fp@(-4),%d3 44d56: 4e5e unlk %fp handler->routine = routine; handler->arg = arg; _Chain_Append( handler_stack, &handler->Node ); } _Thread_Enable_dispatch(); 44d58: 4ef9 0004 772a jmp 4772a <_Thread_Enable_dispatch> } 44d5e: 242e fff8 movel %fp@(-8),%d2 44d62: 262e fffc movel %fp@(-4),%d3 44d66: 4e5e unlk %fp ... 00045a40 : int pthread_cond_init( pthread_cond_t *cond, const pthread_condattr_t *attr ) { 45a40: 4e56 fff4 linkw %fp,#-12 45a44: 202e 000c movel %fp@(12),%d0 45a48: 48d7 1c00 moveml %a2-%a4,%sp@ POSIX_Condition_variables_Control *the_cond; const pthread_condattr_t *the_attr; if ( attr ) the_attr = attr; 45a4c: 45f9 0005 c91c lea 5c91c <_POSIX_Condition_variables_Default_attributes>,%a2 45a52: 4a80 tstl %d0 45a54: 6702 beqs 45a58 45a56: 2440 moveal %d0,%a2 /* * Be careful about attributes when global!!! */ if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) 45a58: 7001 moveq #1,%d0 45a5a: b0aa 0004 cmpl %a2@(4),%d0 45a5e: 6776 beqs 45ad6 <== NEVER TAKEN return EINVAL; if ( !the_attr->is_initialized ) 45a60: 4a92 tstl %a2@ 45a62: 6772 beqs 45ad6 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 45a64: 2039 0005 f248 movel 5f248 <_Thread_Dispatch_disable_level>,%d0 45a6a: 5280 addql #1,%d0 45a6c: 23c0 0005 f248 movel %d0,5f248 <_Thread_Dispatch_disable_level> */ RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *_POSIX_Condition_variables_Allocate( void ) { return (POSIX_Condition_variables_Control *) 45a72: 4879 0005 f616 pea 5f616 <_POSIX_Condition_variables_Information> 45a78: 47f9 0004 89a6 lea 489a6 <_Thread_Enable_dispatch>,%a3 45a7e: 4eb9 0004 7dd0 jsr 47dd0 <_Objects_Allocate> _Thread_Disable_dispatch(); the_cond = _POSIX_Condition_variables_Allocate(); if ( !the_cond ) { 45a84: 588f addql #4,%sp 45a86: 2840 moveal %d0,%a4 45a88: 4a80 tstl %d0 45a8a: 6606 bnes 45a92 _Thread_Enable_dispatch(); 45a8c: 4e93 jsr %a3@ 45a8e: 700c moveq #12,%d0 return ENOMEM; 45a90: 6046 bras 45ad8 } the_cond->process_shared = the_attr->process_shared; the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX; 45a92: 42ac 0014 clrl %a4@(20) if ( !the_cond ) { _Thread_Enable_dispatch(); return ENOMEM; } the_cond->process_shared = the_attr->process_shared; 45a96: 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( 45a9c: 4878 0074 pea 74 45aa0: 4878 0800 pea 800 45aa4: 42a7 clrl %sp@- 45aa6: 486c 0018 pea %a4@(24) 45aaa: 4eb9 0004 90c8 jsr 490c8 <_Thread_queue_Initialize> #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 45ab0: 202c 0008 movel %a4@(8),%d0 45ab4: 4281 clrl %d1 45ab6: 2079 0005 f62e moveal 5f62e <_POSIX_Condition_variables_Information+0x18>,%a0 45abc: 3200 movew %d0,%d1 45abe: 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; 45ac2: 42ac 000c clrl %a4@(12) &_POSIX_Condition_variables_Information, &the_cond->Object, 0 ); *cond = the_cond->Object.id; 45ac6: 206e 0008 moveal %fp@(8),%a0 45aca: 2080 movel %d0,%a0@ _Thread_Enable_dispatch(); 45acc: 4e93 jsr %a3@ return 0; 45ace: 4fef 0010 lea %sp@(16),%sp 0 ); *cond = the_cond->Object.id; _Thread_Enable_dispatch(); 45ad2: 4280 clrl %d0 return 0; 45ad4: 6002 bras 45ad8 45ad6: 7016 moveq #22,%d0 } 45ad8: 4cee 1c00 fff4 moveml %fp@(-12),%a2-%a4 45ade: 4e5e unlk %fp ... 000458d8 : */ int pthread_condattr_destroy( pthread_condattr_t *attr ) { 458d8: 4e56 0000 linkw %fp,#0 458dc: 206e 0008 moveal %fp@(8),%a0 if ( !attr || attr->is_initialized == false ) 458e0: 4a88 tstl %a0 458e2: 670a beqs 458ee 458e4: 4a90 tstl %a0@ 458e6: 6706 beqs 458ee <== NEVER TAKEN return EINVAL; attr->is_initialized = false; 458e8: 4290 clrl %a0@ 458ea: 4280 clrl %d0 return 0; 458ec: 6002 bras 458f0 458ee: 7016 moveq #22,%d0 } 458f0: 4e5e unlk %fp <== NOT EXECUTED 0004ba98 : } void pthread_exit( void *value_ptr ) { 4ba98: 4e56 0000 linkw %fp,#0 _POSIX_Thread_Exit( _Thread_Executing, value_ptr ); 4ba9c: 2f2e 0008 movel %fp@(8),%sp@- 4baa0: 2f39 0005 cdc2 movel 5cdc2 <_Thread_Executing>,%sp@- 4baa6: 4eb9 0004 ba28 jsr 4ba28 <_POSIX_Thread_Exit> 4baac: 508f addql #8,%sp <== NOT EXECUTED } 4baae: 4e5e unlk %fp <== NOT EXECUTED ... 00044b58 : #if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES) int pthread_mutexattr_gettype( const pthread_mutexattr_t *attr, int *type ) { 44b58: 4e56 0000 linkw %fp,#0 44b5c: 206e 0008 moveal %fp@(8),%a0 44b60: 226e 000c moveal %fp@(12),%a1 if ( !attr ) 44b64: 4a88 tstl %a0 44b66: 6710 beqs 44b78 return EINVAL; if ( !attr->is_initialized ) 44b68: 4a90 tstl %a0@ 44b6a: 670c beqs 44b78 return EINVAL; if ( !type ) 44b6c: 4a89 tstl %a1 44b6e: 6708 beqs 44b78 <== NEVER TAKEN return EINVAL; *type = attr->type; 44b70: 22a8 0010 movel %a0@(16),%a1@ 44b74: 4280 clrl %d0 return 0; 44b76: 6002 bras 44b7a 44b78: 7016 moveq #22,%d0 } 44b7a: 4e5e unlk %fp ... 00046978 : int pthread_mutexattr_setpshared( pthread_mutexattr_t *attr, int pshared ) { 46978: 4e56 0000 linkw %fp,#0 4697c: 206e 0008 moveal %fp@(8),%a0 46980: 202e 000c movel %fp@(12),%d0 if ( !attr || !attr->is_initialized ) 46984: 4a88 tstl %a0 46986: 6712 beqs 4699a 46988: 4a90 tstl %a0@ 4698a: 670e beqs 4699a return EINVAL; switch ( pshared ) { 4698c: 7201 moveq #1,%d1 4698e: b280 cmpl %d0,%d1 46990: 6508 bcss 4699a <== NEVER TAKEN case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; 46992: 2140 0004 movel %d0,%a0@(4) 46996: 4280 clrl %d0 return 0; 46998: 6002 bras 4699c 4699a: 7016 moveq #22,%d0 default: return EINVAL; } } 4699c: 4e5e unlk %fp <== NOT EXECUTED 00044bac : #if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES) int pthread_mutexattr_settype( pthread_mutexattr_t *attr, int type ) { 44bac: 4e56 0000 linkw %fp,#0 44bb0: 206e 0008 moveal %fp@(8),%a0 44bb4: 202e 000c movel %fp@(12),%d0 if ( !attr || !attr->is_initialized ) 44bb8: 4a88 tstl %a0 44bba: 6712 beqs 44bce 44bbc: 4a90 tstl %a0@ 44bbe: 670e beqs 44bce <== NEVER TAKEN return EINVAL; switch ( type ) { 44bc0: 7203 moveq #3,%d1 44bc2: b280 cmpl %d0,%d1 44bc4: 6508 bcss 44bce case PTHREAD_MUTEX_NORMAL: case PTHREAD_MUTEX_RECURSIVE: case PTHREAD_MUTEX_ERRORCHECK: case PTHREAD_MUTEX_DEFAULT: attr->type = type; 44bc6: 2140 0010 movel %d0,%a0@(16) 44bca: 4280 clrl %d0 return 0; 44bcc: 6002 bras 44bd0 44bce: 7016 moveq #22,%d0 default: return EINVAL; } } 44bd0: 4e5e unlk %fp <== NOT EXECUTED 0004562c : int pthread_once( pthread_once_t *once_control, void (*init_routine)(void) ) { 4562c: 4e56 fffc linkw %fp,#-4 45630: 2f0b movel %a3,%sp@- 45632: 266e 000c moveal %fp@(12),%a3 45636: 2f0a movel %a2,%sp@- 45638: 246e 0008 moveal %fp@(8),%a2 if ( !once_control || !init_routine ) 4563c: 4a8a tstl %a2 4563e: 674a beqs 4568a 45640: 4a8b tstl %a3 45642: 6746 beqs 4568a return EINVAL; if ( !once_control->init_executed ) { 45644: 4aaa 0004 tstl %a2@(4) 45648: 663c bnes 45686 rtems_mode saveMode; rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode); 4564a: 486e fffc pea %fp@(-4) 4564e: 4878 0100 pea 100 45652: 4878 0100 pea 100 45656: 4eb9 0004 6134 jsr 46134 if ( !once_control->init_executed ) { 4565c: 4fef 000c lea %sp@(12),%sp 45660: 4aaa 0004 tstl %a2@(4) 45664: 660a bnes 45670 <== NEVER TAKEN once_control->is_initialized = true; once_control->init_executed = true; 45666: 7001 moveq #1,%d0 45668: 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; 4566c: 2480 movel %d0,%a2@ once_control->init_executed = true; (*init_routine)(); 4566e: 4e93 jsr %a3@ } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); 45670: 486e fffc pea %fp@(-4) 45674: 4878 0100 pea 100 45678: 2f2e fffc movel %fp@(-4),%sp@- 4567c: 4eb9 0004 6134 jsr 46134 45682: 4fef 000c lea %sp@(12),%sp 45686: 4280 clrl %d0 45688: 6002 bras 4568c 4568a: 7016 moveq #22,%d0 } return 0; } 4568c: 246e fff4 moveal %fp@(-12),%a2 45690: 266e fff8 moveal %fp@(-8),%a3 45694: 4e5e unlk %fp <== NOT EXECUTED 00045bf4 : int pthread_rwlock_init( pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr ) { 45bf4: 4e56 ffe8 linkw %fp,#-24 45bf8: 48d7 1c00 moveml %a2-%a4,%sp@ 45bfc: 266e 0008 moveal %fp@(8),%a3 45c00: 246e 000c moveal %fp@(12),%a2 const pthread_rwlockattr_t *the_attr; /* * Error check parameters */ if ( !rwlock ) 45c04: 4a8b tstl %a3 45c06: 6778 beqs 45c80 return EINVAL; /* * If the user passed in NULL, use the default attributes */ if ( attr ) { 45c08: 4a8a tstl %a2 45c0a: 660e bnes 45c1a the_attr = attr; } else { (void) pthread_rwlockattr_init( &default_attr ); 45c0c: 45ee fff4 lea %fp@(-12),%a2 45c10: 2f0a movel %a2,%sp@- 45c12: 4eb9 0004 6500 jsr 46500 45c18: 588f addql #4,%sp } /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) 45c1a: 4a92 tstl %a2@ 45c1c: 6762 beqs 45c80 <== NEVER TAKEN return EINVAL; switch ( the_attr->process_shared ) { 45c1e: 4aaa 0004 tstl %a2@(4) 45c22: 665c bnes 45c80 <== NEVER TAKEN rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 45c24: 2039 0005 f6ac movel 5f6ac <_Thread_Dispatch_disable_level>,%d0 45c2a: 5280 addql #1,%d0 45c2c: 23c0 0005 f6ac movel %d0,5f6ac <_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 *) 45c32: 4879 0005 f858 pea 5f858 <_POSIX_RWLock_Information> 45c38: 45f9 0004 8b66 lea 48b66 <_Thread_Enable_dispatch>,%a2 45c3e: 4eb9 0004 7f90 jsr 47f90 <_Objects_Allocate> */ _Thread_Disable_dispatch(); /* prevents deletion */ the_rwlock = _POSIX_RWLock_Allocate(); if ( !the_rwlock ) { 45c44: 588f addql #4,%sp 45c46: 2840 moveal %d0,%a4 45c48: 4a80 tstl %d0 45c4a: 6606 bnes 45c52 _Thread_Enable_dispatch(); 45c4c: 4e92 jsr %a2@ 45c4e: 700b moveq #11,%d0 return EAGAIN; 45c50: 6030 bras 45c82 } _CORE_RWLock_Initialize( &the_rwlock->RWLock, &the_attributes ); 45c52: 486e fffc pea %fp@(-4) 45c56: 486c 0010 pea %a4@(16) 45c5a: 4eb9 0004 77c4 jsr 477c4 <_CORE_RWLock_Initialize> #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 45c60: 202c 0008 movel %a4@(8),%d0 45c64: 4281 clrl %d1 45c66: 2079 0005 f870 moveal 5f870 <_POSIX_RWLock_Information+0x18>,%a0 45c6c: 3200 movew %d0,%d1 45c6e: 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; 45c72: 42ac 000c clrl %a4@(12) &_POSIX_RWLock_Information, &the_rwlock->Object, 0 ); *rwlock = the_rwlock->Object.id; 45c76: 2680 movel %d0,%a3@ _Thread_Enable_dispatch(); 45c78: 4e92 jsr %a2@ return 0; 45c7a: 508f addql #8,%sp 0 ); *rwlock = the_rwlock->Object.id; _Thread_Enable_dispatch(); 45c7c: 4280 clrl %d0 return 0; 45c7e: 6002 bras 45c82 45c80: 7016 moveq #22,%d0 } 45c82: 4cee 1c00 ffe8 moveml %fp@(-24),%a2-%a4 45c88: 4e5e unlk %fp <== NOT EXECUTED 00045cf4 : int pthread_rwlock_timedrdlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { 45cf4: 4e56 ffec linkw %fp,#-20 45cf8: 48d7 040c moveml %d2-%d3/%a2,%sp@ 45cfc: 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 ) 45d00: 4a8a tstl %a2 45d02: 6700 008e beqw 45d92 * * 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 ); 45d06: 486e fff8 pea %fp@(-8) 45d0a: 2f2e 000c movel %fp@(12),%sp@- 45d0e: 4eb9 0004 b83c jsr 4b83c <_POSIX_Absolute_timeout_to_ticks> 45d14: 486e fffc pea %fp@(-4) 45d18: 2400 movel %d0,%d2 45d1a: 2f12 movel %a2@,%sp@- 45d1c: 4879 0005 f858 pea 5f858 <_POSIX_RWLock_Information> 45d22: 4eb9 0004 83dc jsr 483dc <_Objects_Get> if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { 45d28: 4fef 0014 lea %sp@(20),%sp 45d2c: 4aae fffc tstl %fp@(-4) 45d30: 6660 bnes 45d92 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, 45d32: 7203 moveq #3,%d1 45d34: b282 cmpl %d2,%d1 45d36: 57c3 seq %d3 case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_reading( 45d38: 42a7 clrl %sp@- 45d3a: 2f2e fff8 movel %fp@(-8),%sp@- 45d3e: 4483 negl %d3 45d40: 4281 clrl %d1 45d42: 1203 moveb %d3,%d1 45d44: 2040 moveal %d0,%a0 45d46: 2f01 movel %d1,%sp@- 45d48: 2f12 movel %a2@,%sp@- 45d4a: 4868 0010 pea %a0@(16) 45d4e: 4eb9 0004 77f8 jsr 477f8 <_CORE_RWLock_Obtain_for_reading> do_wait, ticks, NULL ); _Thread_Enable_dispatch(); 45d54: 4eb9 0004 8b66 jsr 48b66 <_Thread_Enable_dispatch> if ( !do_wait ) { 45d5a: 4fef 0014 lea %sp@(20),%sp 45d5e: 4a03 tstb %d3 45d60: 661c bnes 45d7e if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) { 45d62: 2079 0005 f766 moveal 5f766 <_Thread_Executing>,%a0 45d68: 7002 moveq #2,%d0 45d6a: b0a8 0034 cmpl %a0@(52),%d0 45d6e: 660e bnes 45d7e switch (status) { 45d70: 4a82 tstl %d2 45d72: 671e beqs 45d92 <== NEVER TAKEN 45d74: b082 cmpl %d2,%d0 45d76: 6506 bcss 45d7e <== NEVER TAKEN 45d78: 103c 0074 moveb #116,%d0 45d7c: 6016 bras 45d94 break; } } } return _POSIX_RWLock_Translate_core_RWLock_return_code( 45d7e: 2079 0005 f766 moveal 5f766 <_Thread_Executing>,%a0 45d84: 2f28 0034 movel %a0@(52),%sp@- 45d88: 4eb9 0004 5e4c jsr 45e4c <_POSIX_RWLock_Translate_core_RWLock_return_code> 45d8e: 588f addql #4,%sp 45d90: 6002 bras 45d94 45d92: 7016 moveq #22,%d0 case OBJECTS_ERROR: break; } return EINVAL; } 45d94: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 45d9a: 4e5e unlk %fp ... 00045da0 : int pthread_rwlock_timedwrlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { 45da0: 4e56 ffec linkw %fp,#-20 45da4: 48d7 040c moveml %d2-%d3/%a2,%sp@ 45da8: 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 ) 45dac: 4a8a tstl %a2 45dae: 6700 008e beqw 45e3e * * 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 ); 45db2: 486e fff8 pea %fp@(-8) 45db6: 2f2e 000c movel %fp@(12),%sp@- 45dba: 4eb9 0004 b83c jsr 4b83c <_POSIX_Absolute_timeout_to_ticks> 45dc0: 486e fffc pea %fp@(-4) 45dc4: 2400 movel %d0,%d2 45dc6: 2f12 movel %a2@,%sp@- 45dc8: 4879 0005 f858 pea 5f858 <_POSIX_RWLock_Information> 45dce: 4eb9 0004 83dc jsr 483dc <_Objects_Get> if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { 45dd4: 4fef 0014 lea %sp@(20),%sp 45dd8: 4aae fffc tstl %fp@(-4) 45ddc: 6660 bnes 45e3e (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, 45dde: 7203 moveq #3,%d1 45de0: b282 cmpl %d2,%d1 45de2: 57c3 seq %d3 case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_writing( 45de4: 42a7 clrl %sp@- 45de6: 2f2e fff8 movel %fp@(-8),%sp@- 45dea: 4483 negl %d3 45dec: 4281 clrl %d1 45dee: 1203 moveb %d3,%d1 45df0: 2040 moveal %d0,%a0 45df2: 2f01 movel %d1,%sp@- 45df4: 2f12 movel %a2@,%sp@- 45df6: 4868 0010 pea %a0@(16) 45dfa: 4eb9 0004 78a8 jsr 478a8 <_CORE_RWLock_Obtain_for_writing> do_wait, ticks, NULL ); _Thread_Enable_dispatch(); 45e00: 4eb9 0004 8b66 jsr 48b66 <_Thread_Enable_dispatch> if ( !do_wait && 45e06: 4fef 0014 lea %sp@(20),%sp 45e0a: 4a03 tstb %d3 45e0c: 661c bnes 45e2a (_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) { 45e0e: 2079 0005 f766 moveal 5f766 <_Thread_Executing>,%a0 45e14: 7002 moveq #2,%d0 45e16: b0a8 0034 cmpl %a0@(52),%d0 45e1a: 660e bnes 45e2a switch (status) { 45e1c: 4a82 tstl %d2 45e1e: 671e beqs 45e3e <== NEVER TAKEN 45e20: b082 cmpl %d2,%d0 45e22: 6506 bcss 45e2a <== NEVER TAKEN 45e24: 103c 0074 moveb #116,%d0 45e28: 6016 bras 45e40 case POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE: break; } } return _POSIX_RWLock_Translate_core_RWLock_return_code( 45e2a: 2079 0005 f766 moveal 5f766 <_Thread_Executing>,%a0 45e30: 2f28 0034 movel %a0@(52),%sp@- 45e34: 4eb9 0004 5e4c jsr 45e4c <_POSIX_RWLock_Translate_core_RWLock_return_code> 45e3a: 588f addql #4,%sp 45e3c: 6002 bras 45e40 45e3e: 7016 moveq #22,%d0 case OBJECTS_ERROR: break; } return EINVAL; } 45e40: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 45e46: 4e5e unlk %fp ... 00046520 : int pthread_rwlockattr_setpshared( pthread_rwlockattr_t *attr, int pshared ) { 46520: 4e56 0000 linkw %fp,#0 46524: 206e 0008 moveal %fp@(8),%a0 46528: 202e 000c movel %fp@(12),%d0 if ( !attr ) 4652c: 4a88 tstl %a0 4652e: 6712 beqs 46542 return EINVAL; if ( !attr->is_initialized ) 46530: 4a90 tstl %a0@ 46532: 670e beqs 46542 return EINVAL; switch ( pshared ) { 46534: 7201 moveq #1,%d1 46536: b280 cmpl %d0,%d1 46538: 6508 bcss 46542 <== NEVER TAKEN case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; 4653a: 2140 0004 movel %d0,%a0@(4) 4653e: 4280 clrl %d0 return 0; 46540: 6002 bras 46544 46542: 7016 moveq #22,%d0 default: return EINVAL; } } 46544: 4e5e unlk %fp <== NOT EXECUTED 00044bcc : int pthread_setcanceltype( int type, int *oldtype ) { 44bcc: 4e56 0000 linkw %fp,#0 44bd0: 202e 0008 movel %fp@(8),%d0 44bd4: 226e 000c moveal %fp@(12),%a1 * 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() ) 44bd8: 2239 0005 d436 movel 5d436 <_ISR_Nest_level>,%d1 44bde: 6704 beqs 44be4 44be0: 7047 moveq #71,%d0 44be2: 603e bras 44c22 return EPROTO; if ( !oldtype ) 44be4: 4a89 tstl %a1 44be6: 6738 beqs 44c20 <== NEVER TAKEN return EINVAL; if ( type != PTHREAD_CANCEL_DEFERRED && type != PTHREAD_CANCEL_ASYNCHRONOUS ) 44be8: 7201 moveq #1,%d1 44bea: b280 cmpl %d0,%d1 44bec: 6532 bcss 44c20 <== NEVER TAKEN 44bee: 2239 0005 d39c movel 5d39c <_Thread_Dispatch_disable_level>,%d1 44bf4: 5281 addql #1,%d1 return EINVAL; thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 44bf6: 2079 0005 d456 moveal 5d456 <_Thread_Executing>,%a0 44bfc: 23c1 0005 d39c movel %d1,5d39c <_Thread_Dispatch_disable_level> 44c02: 2068 010e moveal %a0@(270),%a0 _Thread_Disable_dispatch(); *oldtype = thread_support->cancelability_type; 44c06: 22a8 00d8 movel %a0@(216),%a1@ thread_support->cancelability_type = type; 44c0a: 2140 00d8 movel %d0,%a0@(216) _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch(_Thread_Executing); 44c0e: 2f39 0005 d456 movel 5d456 <_Thread_Executing>,%sp@- 44c14: 4eb9 0004 9864 jsr 49864 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch> /* * _Thread_Enable_dispatch is invoked by above call. */ return 0; 44c1a: 588f addql #4,%sp _Thread_Disable_dispatch(); *oldtype = thread_support->cancelability_type; thread_support->cancelability_type = type; _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch(_Thread_Executing); 44c1c: 4280 clrl %d0 /* * _Thread_Enable_dispatch is invoked by above call. */ return 0; 44c1e: 6002 bras 44c22 44c20: 7016 moveq #22,%d0 } 44c22: 4e5e unlk %fp ... 00047504 : int pthread_setschedparam( pthread_t thread, int policy, struct sched_param *param ) { 47504: 4e56 ffe0 linkw %fp,#-32 47508: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 4750c: 282e 000c movel %fp@(12),%d4 47510: 262e 0010 movel %fp@(16),%d3 int rc; /* * Check all the parameters */ if ( !param ) 47514: 6606 bnes 4751c 47516: 7416 moveq #22,%d2 47518: 6000 00e6 braw 47600 return EINVAL; rc = _POSIX_Thread_Translate_sched_param( 4751c: 486e fff8 pea %fp@(-8) 47520: 486e fffc pea %fp@(-4) 47524: 2f03 movel %d3,%sp@- 47526: 2f04 movel %d4,%sp@- 47528: 4eb9 0004 c734 jsr 4c734 <_POSIX_Thread_Translate_sched_param> policy, param, &budget_algorithm, &budget_callout ); if ( rc ) 4752e: 4fef 0010 lea %sp@(16),%sp * Check all the parameters */ if ( !param ) return EINVAL; rc = _POSIX_Thread_Translate_sched_param( 47532: 2400 movel %d0,%d2 policy, param, &budget_algorithm, &budget_callout ); if ( rc ) 47534: 6600 00ca bnew 47600 47538: 486e fff4 pea %fp@(-12) 4753c: 2f2e 0008 movel %fp@(8),%sp@- 47540: 4879 0006 19ee pea 619ee <_POSIX_Threads_Information> 47546: 4eb9 0004 9238 jsr 49238 <_Objects_Get> /* * Actually change the scheduling policy and parameters */ the_thread = _POSIX_Threads_Get( thread, &location ); switch ( location ) { 4754c: 4fef 000c lea %sp@(12),%sp 47550: 2640 moveal %d0,%a3 47552: 4aae fff4 tstl %fp@(-12) 47556: 6708 beqs 47560 47558: 143c 0003 moveb #3,%d2 4755c: 6000 00a2 braw 47600 case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 47560: 246b 010e moveal %a3@(270),%a2 if ( api->schedpolicy == SCHED_SPORADIC ) 47564: 7004 moveq #4,%d0 47566: b0aa 0080 cmpl %a2@(128),%d0 4756a: 660c bnes 47578 (void) _Watchdog_Remove( &api->Sporadic_timer ); 4756c: 486a 00a4 pea %a2@(164) 47570: 4eb9 0004 abb8 jsr 4abb8 <_Watchdog_Remove> 47576: 588f addql #4,%sp api->schedpolicy = policy; 47578: 2544 0080 movel %d4,%a2@(128) api->schedparam = *param; 4757c: 4878 001c pea 1c 47580: 2f03 movel %d3,%sp@- 47582: 486a 0084 pea %a2@(132) 47586: 4eb9 0004 fd44 jsr 4fd44 the_thread->budget_algorithm = budget_algorithm; 4758c: 276e fffc 007a movel %fp@(-4),%a3@(122) the_thread->budget_callout = budget_callout; switch ( api->schedpolicy ) { 47592: 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; 47596: 276e fff8 007e movel %fp@(-8),%a3@(126) switch ( api->schedpolicy ) { 4759c: 202a 0080 movel %a2@(128),%d0 475a0: 6d58 blts 475fa <== NEVER TAKEN 475a2: 7202 moveq #2,%d1 475a4: b280 cmpl %d0,%d1 475a6: 6c0a bges 475b2 475a8: 123c 0004 moveb #4,%d1 475ac: b280 cmpl %d0,%d1 475ae: 664a bnes 475fa <== NEVER TAKEN 475b0: 602a bras 475dc 475b2: 4280 clrl %d0 475b4: 1039 0006 0016 moveb 60016 ,%d0 case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; 475ba: 41f9 0006 17b8 lea 617b8 <_Thread_Ticks_per_timeslice>,%a0 475c0: 90aa 0084 subl %a2@(132),%d0 475c4: 2750 0076 movel %a0@,%a3@(118) the_thread->real_priority = 475c8: 2740 0018 movel %d0,%a3@(24) _POSIX_Priority_To_core( api->schedparam.sched_priority ); _Thread_Change_priority( 475cc: 4878 0001 pea 1 475d0: 2f00 movel %d0,%sp@- 475d2: 2f0b movel %a3,%sp@- 475d4: 4eb9 0004 94c8 jsr 494c8 <_Thread_Change_priority> 475da: 601a bras 475f6 true ); break; case SCHED_SPORADIC: api->ss_high_priority = api->schedparam.sched_priority; 475dc: 256a 0084 00a0 movel %a2@(132),%a2@(160) _Watchdog_Remove( &api->Sporadic_timer ); 475e2: 486a 00a4 pea %a2@(164) 475e6: 4eb9 0004 abb8 jsr 4abb8 <_Watchdog_Remove> _POSIX_Threads_Sporadic_budget_TSR( 0, the_thread ); 475ec: 2f0b movel %a3,%sp@- 475ee: 42a7 clrl %sp@- 475f0: 4eb9 0004 7470 jsr 47470 <_POSIX_Threads_Sporadic_budget_TSR> 475f6: 4fef 000c lea %sp@(12),%sp break; } _Thread_Enable_dispatch(); 475fa: 4eb9 0004 99c2 jsr 499c2 <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return ESRCH; } 47600: 2002 movel %d2,%d0 47602: 4cee 0c1c ffe0 moveml %fp@(-32),%d2-%d4/%a2-%a3 47608: 4e5e unlk %fp <== NOT EXECUTED 00045420 : * * 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183 */ void pthread_testcancel( void ) { 45420: 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() ) 45424: 2039 0005 dcde movel 5dcde <_ISR_Nest_level>,%d0 * * 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183 */ void pthread_testcancel( void ) { 4542a: 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() ) 4542c: 4a80 tstl %d0 4542e: 6646 bnes 45476 <== NEVER TAKEN return; thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 45430: 2079 0005 dcfe moveal 5dcfe <_Thread_Executing>,%a0 45436: 2039 0005 dc44 movel 5dc44 <_Thread_Dispatch_disable_level>,%d0 4543c: 5280 addql #1,%d0 4543e: 2068 010e moveal %a0@(270),%a0 45442: 23c0 0005 dc44 movel %d0,5dc44 <_Thread_Dispatch_disable_level> _Thread_Disable_dispatch(); if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 45448: 4aa8 00d4 tstl %a0@(212) 4544c: 6704 beqs 45452 <== ALWAYS TAKEN 4544e: 4202 clrb %d2 <== NOT EXECUTED 45450: 6008 bras 4545a <== 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)); 45452: 4aa8 00dc tstl %a0@(220) 45456: 56c2 sne %d2 45458: 4482 negl %d2 thread_support->cancelation_requested ) cancel = true; _Thread_Enable_dispatch(); 4545a: 4eb9 0004 772a jsr 4772a <_Thread_Enable_dispatch> if ( cancel ) 45460: 4a02 tstb %d2 45462: 6712 beqs 45476 _POSIX_Thread_Exit( _Thread_Executing, PTHREAD_CANCELED ); 45464: 4878 ffff pea ffffffff 45468: 2f39 0005 dcfe movel 5dcfe <_Thread_Executing>,%sp@- 4546e: 4eb9 0004 a5fc jsr 4a5fc <_POSIX_Thread_Exit> 45474: 508f addql #8,%sp <== NOT EXECUTED } 45476: 242e fffc movel %fp@(-4),%d2 4547a: 4e5e unlk %fp ... 000454b2 : #endif Objects_Information *_Internal_Objects[ OBJECTS_INTERNAL_CLASSES_LAST + 1 ]; void rtems_initialize_data_structures(void) { 454b2: 4e56 0000 linkw %fp,#0 454b6: 42b9 0005 ce90 clrl 5ce90 <_System_state_Current> #endif /* * Initialize any target architecture specific support as early as possible */ _CPU_Initialize(); 454bc: 4eb9 0004 7ff4 jsr 47ff4 <_CPU_Initialize> /* * Do this as early as possible to ensure no debugging output * is even attempted to be printed. */ _Debug_Manager_initialization(); 454c2: 4eb9 0004 9fa4 jsr 49fa4 <_Debug_Manager_initialization> _API_extensions_Initialization(); 454c8: 4eb9 0004 5740 jsr 45740 <_API_extensions_Initialization> * This routine initializes the thread dispatching subsystem. */ RTEMS_INLINE_ROUTINE void _Thread_Dispatch_initialization( void ) { _Thread_Dispatch_disable_level = 1; 454ce: 7001 moveq #1,%d0 454d0: 23c0 0005 cd08 movel %d0,5cd08 <_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(); 454d6: 4eb9 0004 7ecc jsr 47ecc <_Workspace_Handler_initialization> _User_extensions_Handler_initialization(); 454dc: 4eb9 0004 79e8 jsr 479e8 <_User_extensions_Handler_initialization> _ISR_Handler_initialization(); 454e2: 4eb9 0004 6034 jsr 46034 <_ISR_Handler_initialization> /* * Initialize the internal support API and allocator Mutex */ _Objects_Information_table[OBJECTS_INTERNAL_API] = _Internal_Objects; _API_Mutex_Initialization( 1 ); 454e8: 4878 0001 pea 1 _ISR_Handler_initialization(); /* * Initialize the internal support API and allocator Mutex */ _Objects_Information_table[OBJECTS_INTERNAL_API] = _Internal_Objects; 454ec: 203c 0005 cd1e movel #380190,%d0 454f2: 23c0 0005 ccc4 movel %d0,5ccc4 <_Objects_Information_table+0x4> _API_Mutex_Initialization( 1 ); 454f8: 4eb9 0004 5870 jsr 45870 <_API_Mutex_Initialization> _API_Mutex_Allocate( &_RTEMS_Allocator_Mutex ); 454fe: 4879 0005 cdba pea 5cdba <_RTEMS_Allocator_Mutex> 45504: 4eb9 0004 57d0 jsr 457d0 <_API_Mutex_Allocate> #include #endif Objects_Information *_Internal_Objects[ OBJECTS_INTERNAL_CLASSES_LAST + 1 ]; void rtems_initialize_data_structures(void) 4550a: 508f addql #8,%sp RTEMS_INLINE_ROUTINE void _Priority_Handler_initialization( void ) { int index; _Priority_Major_bit_map = 0; 4550c: 41f9 0005 ce28 lea 5ce28 <_Priority_Bit_map>,%a0 45512: 4240 clrw %d0 45514: 33c0 0005 cdb8 movew %d0,5cdb8 <_Priority_Major_bit_map> for ( index=0 ; index <16 ; index++ ) _Priority_Bit_map[ index ] = 0; 4551a: 4258 clrw %a0@+ RTEMS_INLINE_ROUTINE void _Priority_Handler_initialization( void ) { int index; _Priority_Major_bit_map = 0; for ( index=0 ; index <16 ; index++ ) 4551c: b1fc 0005 ce48 cmpal #380488,%a0 45522: 66f6 bnes 4551a _API_Mutex_Initialization( 1 ); _API_Mutex_Allocate( &_RTEMS_Allocator_Mutex ); _Priority_Handler_initialization(); _Watchdog_Handler_initialization(); 45524: 4eb9 0004 7d20 jsr 47d20 <_Watchdog_Handler_initialization> _TOD_Handler_initialization(); 4552a: 4eb9 0004 5c5c jsr 45c5c <_TOD_Handler_initialization> _Thread_Handler_initialization(); 45530: 4eb9 0004 6f60 jsr 46f60 <_Thread_Handler_initialization> _MPCI_Handler_initialization( RTEMS_TIMEOUT ); #endif /* MANAGERS */ _RTEMS_API_Initialize(); 45536: 4eb9 0004 56ec jsr 456ec <_RTEMS_API_Initialize> _Extension_Manager_initialization(); 4553c: 4eb9 0004 558c jsr 4558c <_Extension_Manager_initialization> _IO_Manager_initialization(); 45542: 4eb9 0004 5604 jsr 45604 <_IO_Manager_initialization> #ifdef RTEMS_POSIX_API _POSIX_API_Initialize(); 45548: 4eb9 0004 5698 jsr 45698 <_POSIX_API_Initialize> _Thread_Create_idle(); /* * Scheduling can properly occur now as long as we avoid dispatching. */ } 4554e: 4e5e unlk %fp 45550: 7001 moveq #1,%d0 45552: 23c0 0005 ce90 movel %d0,5ce90 <_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(); 45558: 4ef9 0004 6aa4 jmp 46aa4 <_Thread_Create_idle> ... 00046da4 : 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 ) { 46da4: 4e56 0000 linkw %fp,#0 46da8: 206e 000c moveal %fp@(12),%a0 46dac: 2f0a movel %a2,%sp@- 46dae: 226e 0010 moveal %fp@(16),%a1 46db2: 2f02 movel %d2,%sp@- 46db4: 242e 0008 movel %fp@(8),%d2 rtems_device_major_number major_limit = _IO_Number_of_drivers; 46db8: 2039 0006 2a0a movel 62a0a <_IO_Number_of_drivers>,%d0 if ( rtems_interrupt_is_in_progress() ) 46dbe: 2239 0006 21ea movel 621ea <_ISR_Nest_level>,%d1 46dc4: 6706 beqs 46dcc 46dc6: 7012 moveq #18,%d0 46dc8: 6000 00d6 braw 46ea0 return RTEMS_CALLED_FROM_ISR; if ( registered_major == NULL ) 46dcc: 4a89 tstl %a1 46dce: 6700 00ce beqw 46e9e return RTEMS_INVALID_ADDRESS; /* Set it to an invalid value */ *registered_major = major_limit; 46dd2: 2280 movel %d0,%a1@ if ( driver_table == NULL ) 46dd4: 4a88 tstl %a0 46dd6: 6700 00c6 beqw 46e9e static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 46dda: 4a90 tstl %a0@ 46ddc: 6600 00ce bnew 46eac 46de0: 4aa8 0004 tstl %a0@(4) 46de4: 6600 00c6 bnew 46eac 46de8: 6000 00b4 braw 46e9e rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 46dec: 2039 0006 2150 movel 62150 <_Thread_Dispatch_disable_level>,%d0 46df2: 5280 addql #1,%d0 46df4: 23c0 0006 2150 movel %d0,62150 <_Thread_Dispatch_disable_level> if ( major >= major_limit ) return RTEMS_INVALID_NUMBER; _Thread_Disable_dispatch(); if ( major == 0 ) { 46dfa: 4a82 tstl %d2 46dfc: 662c bnes 46e2a static rtems_status_code rtems_io_obtain_major_number( rtems_device_major_number *major ) { rtems_device_major_number n = _IO_Number_of_drivers; 46dfe: 2039 0006 2a0a movel 62a0a <_IO_Number_of_drivers>,%d0 46e04: 2479 0006 2a0e moveal 62a0e <_IO_Driver_address_table>,%a2 46e0a: 6010 bras 46e1c static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 46e0c: 4a92 tstl %a2@ 46e0e: 6600 00a6 bnew 46eb6 46e12: 4aaa 0004 tstl %a2@(4) 46e16: 6600 009e bnew 46eb6 46e1a: 6004 bras 46e20 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 ) { 46e1c: b082 cmpl %d2,%d0 46e1e: 62ec bhis 46e0c if ( rtems_io_is_empty_table( table ) ) break; } /* Assigns invalid value in case of failure */ *major = m; 46e20: 2282 movel %d2,%a1@ if ( m != n ) 46e22: b082 cmpl %d2,%d0 46e24: 6634 bnes 46e5a 46e26: 6000 0098 braw 46ec0 _Thread_Enable_dispatch(); return sc; } major = *registered_major; } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major; 46e2a: 2202 movel %d2,%d1 46e2c: 2002 movel %d2,%d0 46e2e: e789 lsll #3,%d1 46e30: eb88 lsll #5,%d0 46e32: 2479 0006 2a0e moveal 62a0e <_IO_Driver_address_table>,%a2 46e38: 9081 subl %d1,%d0 46e3a: 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; 46e3c: 4a92 tstl %a2@ 46e3e: 660e bnes 46e4e 46e40: 4aaa 0004 tstl %a2@(4) 46e44: 57c0 seq %d0 46e46: 49c0 extbl %d0 46e48: 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 ) ) { 46e4a: 4a00 tstb %d0 46e4c: 660a bnes 46e58 _Thread_Enable_dispatch(); 46e4e: 4eb9 0004 86ca jsr 486ca <_Thread_Enable_dispatch> 46e54: 700c moveq #12,%d0 return RTEMS_RESOURCE_IN_USE; 46e56: 6048 bras 46ea0 } *registered_major = major; 46e58: 2282 movel %d2,%a1@ } _IO_Driver_address_table [major] = *driver_table; 46e5a: 4878 0018 pea 18 46e5e: 2202 movel %d2,%d1 46e60: 2002 movel %d2,%d0 46e62: e789 lsll #3,%d1 46e64: eb88 lsll #5,%d0 46e66: 2f08 movel %a0,%sp@- 46e68: 9081 subl %d1,%d0 46e6a: d0b9 0006 2a0e addl 62a0e <_IO_Driver_address_table>,%d0 46e70: 2f00 movel %d0,%sp@- 46e72: 4eb9 0005 1d70 jsr 51d70 _Thread_Enable_dispatch(); 46e78: 4eb9 0004 86ca jsr 486ca <_Thread_Enable_dispatch> return rtems_io_initialize( major, 0, NULL ); } 46e7e: 246e fffc moveal %fp@(-4),%a2 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 46e82: 4fef 000c lea %sp@(12),%sp 46e86: 2d42 0008 movel %d2,%fp@(8) } 46e8a: 242e fff8 movel %fp@(-8),%d2 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 46e8e: 42ae 0010 clrl %fp@(16) 46e92: 42ae 000c clrl %fp@(12) } 46e96: 4e5e unlk %fp _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 46e98: 4ef9 0004 ea34 jmp 4ea34 46e9e: 7009 moveq #9,%d0 } 46ea0: 242e fff8 movel %fp@(-8),%d2 46ea4: 246e fffc moveal %fp@(-4),%a2 46ea8: 4e5e unlk %fp 46eaa: 4e75 rts return RTEMS_INVALID_ADDRESS; if ( rtems_io_is_empty_table( driver_table ) ) return RTEMS_INVALID_ADDRESS; if ( major >= major_limit ) 46eac: b082 cmpl %d2,%d0 46eae: 6200 ff3c bhiw 46dec 46eb2: 700a moveq #10,%d0 46eb4: 60ea bras 46ea0 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 ) { 46eb6: 5282 addql #1,%d2 46eb8: 45ea 0018 lea %a2@(24),%a2 46ebc: 6000 ff5e braw 46e1c if ( major == 0 ) { rtems_status_code sc = rtems_io_obtain_major_number( registered_major ); if ( sc != RTEMS_SUCCESSFUL ) { _Thread_Enable_dispatch(); 46ec0: 4eb9 0004 86ca jsr 486ca <_Thread_Enable_dispatch> 46ec6: 7005 moveq #5,%d0 return sc; 46ec8: 60d6 bras 46ea0 ... 00047394 : #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) { 47394: 4e56 fff0 linkw %fp,#-16 47398: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ 4739c: 286e 0008 moveal %fp@(8),%a4 uint32_t i; uint32_t api_index; Thread_Control *the_thread; Objects_Information *information; if ( !routine ) 473a0: 4a8c tstl %a4 473a2: 6740 beqs 473e4 <== NEVER TAKEN 473a4: 45f9 0006 6be4 lea 66be4 <_Objects_Information_table+0x4>,%a2 return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { if ( !_Objects_Information_table[ api_index ] ) 473aa: 2052 moveal %a2@,%a0 473ac: 4a88 tstl %a0 473ae: 672a beqs 473da continue; information = _Objects_Information_table[ api_index ][ 1 ]; 473b0: 2668 0004 moveal %a0@(4),%a3 if ( !information ) 473b4: 4a8b tstl %a3 473b6: 6722 beqs 473da 473b8: 7401 moveq #1,%d2 473ba: 6014 bras 473d0 continue; for ( i=1 ; i <= information->maximum ; i++ ) { the_thread = (Thread_Control *)information->local_table[ i ]; 473bc: 206b 0018 moveal %a3@(24),%a0 473c0: 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++ ) { 473c4: 5282 addql #1,%d2 the_thread = (Thread_Control *)information->local_table[ i ]; if ( !the_thread ) 473c6: 4a80 tstl %d0 473c8: 6706 beqs 473d0 <== NEVER TAKEN continue; (*routine)(the_thread); 473ca: 2f00 movel %d0,%sp@- 473cc: 4e94 jsr %a4@ 473ce: 588f addql #4,%sp information = _Objects_Information_table[ api_index ][ 1 ]; if ( !information ) continue; for ( i=1 ; i <= information->maximum ; i++ ) { 473d0: 4280 clrl %d0 473d2: 302b 000e movew %a3@(14),%d0 473d6: b082 cmpl %d2,%d0 473d8: 64e2 bccs 473bc 473da: 588a addql #4,%a2 Objects_Information *information; if ( !routine ) return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { 473dc: b5fc 0006 6bf4 cmpal #420852,%a2 473e2: 66c6 bnes 473aa (*routine)(the_thread); } } } 473e4: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 473ea: 4e5e unlk %fp ... 0004f390 : rtems_status_code rtems_partition_return_buffer( rtems_id id, void *buffer ) { 4f390: 4e56 fffc linkw %fp,#-4 4f394: 2f0a movel %a2,%sp@- 4f396: 2f02 movel %d2,%sp@- RTEMS_INLINE_ROUTINE Partition_Control *_Partition_Get ( Objects_Id id, Objects_Locations *location ) { return (Partition_Control *) 4f398: 486e fffc pea %fp@(-4) 4f39c: 2f2e 0008 movel %fp@(8),%sp@- 4f3a0: 4879 0007 52e6 pea 752e6 <_Partition_Information> 4f3a6: 242e 000c movel %fp@(12),%d2 4f3aa: 4eb9 0005 378c jsr 5378c <_Objects_Get> register Partition_Control *the_partition; Objects_Locations location; the_partition = _Partition_Get( id, &location ); switch ( location ) { 4f3b0: 4fef 000c lea %sp@(12),%sp 4f3b4: 2440 moveal %d0,%a2 4f3b6: 4aae fffc tstl %fp@(-4) 4f3ba: 6704 beqs 4f3c0 4f3bc: 7004 moveq #4,%d0 4f3be: 603c bras 4f3fc ) { void *starting; void *ending; starting = the_partition->starting_address; 4f3c0: 202a 0010 movel %a2@(16),%d0 ending = _Addresses_Add_offset( starting, the_partition->length ); 4f3c4: 222a 0014 movel %a2@(20),%d1 const void *address, const void *base, const void *limit ) { return (address >= base && address <= limit); 4f3c8: b082 cmpl %d2,%d0 4f3ca: 623c bhis 4f408 <== NEVER TAKEN 4f3cc: d280 addl %d0,%d1 4f3ce: b282 cmpl %d2,%d1 4f3d0: 6536 bcss 4f408 <== NEVER TAKEN return ( 4f3d2: 2202 movel %d2,%d1 4f3d4: 9280 subl %d0,%d1 4f3d6: 2001 movel %d1,%d0 4f3d8: 4c6a 0001 0018 remul %a2@(24),%d1,%d0 4f3de: 4a81 tstl %d1 4f3e0: 6626 bnes 4f408 <== NEVER TAKEN RTEMS_INLINE_ROUTINE void _Partition_Free_buffer ( Partition_Control *the_partition, Chain_Node *the_buffer ) { _Chain_Append( &the_partition->Memory, the_buffer ); 4f3e2: 2f02 movel %d2,%sp@- 4f3e4: 486a 0024 pea %a2@(36) 4f3e8: 4eb9 0005 1fdc jsr 51fdc <_Chain_Append> case OBJECTS_LOCAL: if ( _Partition_Is_buffer_valid( buffer, the_partition ) ) { _Partition_Free_buffer( the_partition, buffer ); the_partition->number_of_used_blocks -= 1; 4f3ee: 53aa 0020 subql #1,%a2@(32) _Thread_Enable_dispatch(); 4f3f2: 4eb9 0005 4012 jsr 54012 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 4f3f8: 508f addql #8,%sp case OBJECTS_LOCAL: if ( _Partition_Is_buffer_valid( buffer, the_partition ) ) { _Partition_Free_buffer( the_partition, buffer ); the_partition->number_of_used_blocks -= 1; _Thread_Enable_dispatch(); 4f3fa: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4f3fc: 242e fff4 movel %fp@(-12),%d2 4f400: 246e fff8 moveal %fp@(-8),%a2 4f404: 4e5e unlk %fp 4f406: 4e75 rts _Partition_Free_buffer( the_partition, buffer ); the_partition->number_of_used_blocks -= 1; _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } _Thread_Enable_dispatch(); 4f408: 4eb9 0005 4012 jsr 54012 <_Thread_Enable_dispatch> 4f40e: 7009 moveq #9,%d0 return RTEMS_INVALID_ADDRESS; 4f410: 60ea bras 4f3fc ... 00045c30 : rtems_status_code rtems_rate_monotonic_period( rtems_id id, rtems_interval length ) { 45c30: 4e56 ffec linkw %fp,#-20 45c34: 48d7 041c moveml %d2-%d4/%a2,%sp@ RTEMS_INLINE_ROUTINE Rate_monotonic_Control *_Rate_monotonic_Get ( Objects_Id id, Objects_Locations *location ) { return (Rate_monotonic_Control *) 45c38: 486e fffc pea %fp@(-4) 45c3c: 262e 0008 movel %fp@(8),%d3 45c40: 2f03 movel %d3,%sp@- 45c42: 4879 0005 e840 pea 5e840 <_Rate_monotonic_Information> 45c48: 242e 000c movel %fp@(12),%d2 45c4c: 4eb9 0004 7ac4 jsr 47ac4 <_Objects_Get> rtems_rate_monotonic_period_states local_state; ISR_Level level; the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 45c52: 4fef 000c lea %sp@(12),%sp 45c56: 2440 moveal %d0,%a2 45c58: 4aae fffc tstl %fp@(-4) 45c5c: 6600 0138 bnew 45d96 case OBJECTS_LOCAL: if ( !_Thread_Is_executing( the_period->owner ) ) { 45c60: 2039 0005 e9fe movel 5e9fe <_Thread_Executing>,%d0 45c66: b0aa 0040 cmpl %a2@(64),%d0 45c6a: 670c beqs 45c78 _Thread_Enable_dispatch(); 45c6c: 4eb9 0004 82be jsr 482be <_Thread_Enable_dispatch> 45c72: 7817 moveq #23,%d4 return RTEMS_NOT_OWNER_OF_RESOURCE; 45c74: 6000 0122 braw 45d98 } if ( length == RTEMS_PERIOD_STATUS ) { 45c78: 4a82 tstl %d2 45c7a: 6622 bnes 45c9e switch ( the_period->state ) { 45c7c: 202a 0038 movel %a2@(56),%d0 45c80: 7204 moveq #4,%d1 45c82: b280 cmpl %d0,%d1 45c84: 6404 bccs 45c8a <== ALWAYS TAKEN 45c86: 4284 clrl %d4 <== NOT EXECUTED 45c88: 600a bras 45c94 <== NOT EXECUTED 45c8a: 41f9 0005 bdf2 lea 5bdf2 ,%a0 45c90: 2830 0c00 movel %a0@(00000000,%d0:l:4),%d4 case RATE_MONOTONIC_ACTIVE: default: /* unreached -- only to remove warnings */ return_value = RTEMS_SUCCESSFUL; break; } _Thread_Enable_dispatch(); 45c94: 4eb9 0004 82be jsr 482be <_Thread_Enable_dispatch> return( return_value ); 45c9a: 6000 00fc braw 45d98 } _ISR_Disable( level ); 45c9e: 203c 0000 0700 movel #1792,%d0 45ca4: 40c4 movew %sr,%d4 45ca6: 8084 orl %d4,%d0 45ca8: 46c0 movew %d0,%sr switch ( the_period->state ) { 45caa: 202a 0038 movel %a2@(56),%d0 45cae: 7202 moveq #2,%d1 45cb0: b280 cmpl %d0,%d1 45cb2: 6740 beqs 45cf4 45cb4: 123c 0004 moveb #4,%d1 45cb8: b280 cmpl %d0,%d1 45cba: 6700 00a4 beqw 45d60 45cbe: 4a80 tstl %d0 45cc0: 6600 00d4 bnew 45d96 case RATE_MONOTONIC_INACTIVE: { _ISR_Enable( level ); 45cc4: 46c4 movew %d4,%sr /* * Baseline statistics information for the beginning of a period. */ _Rate_monotonic_Initiate_statistics( the_period ); 45cc6: 2f0a movel %a2,%sp@- ); the_period->next_length = length; _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 45cc8: 4284 clrl %d4 _ISR_Enable( level ); /* * Baseline statistics information for the beginning of a period. */ _Rate_monotonic_Initiate_statistics( the_period ); 45cca: 4eb9 0004 5a1c jsr 45a1c <_Rate_monotonic_Initiate_statistics> Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 45cd0: 203c 0004 5fdc movel #286684,%d0 the_period->state = RATE_MONOTONIC_ACTIVE; 45cd6: 7202 moveq #2,%d1 45cd8: 2540 002c movel %d0,%a2@(44) the_watchdog->id = id; 45cdc: 2543 0030 movel %d3,%a2@(48) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 45ce0: 2542 001c movel %d2,%a2@(28) 45ce4: 2541 0038 movel %d1,%a2@(56) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 45ce8: 42aa 0018 clrl %a2@(24) the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 45cec: 42aa 0034 clrl %a2@(52) 45cf0: 6000 0084 braw 45d76 case RATE_MONOTONIC_ACTIVE: /* * Update statistics from the concluding period. */ _Rate_monotonic_Update_statistics( the_period ); 45cf4: 2f0a movel %a2,%sp@- 45cf6: 4eb9 0004 5b3c jsr 45b3c <_Rate_monotonic_Update_statistics> * This tells the _Rate_monotonic_Timeout that this task is * in the process of blocking on the period and that we * may be changing the length of the next period. */ the_period->state = RATE_MONOTONIC_OWNER_IS_BLOCKING; the_period->next_length = length; 45cfc: 2542 003c movel %d2,%a2@(60) /* * This tells the _Rate_monotonic_Timeout that this task is * in the process of blocking on the period and that we * may be changing the length of the next period. */ the_period->state = RATE_MONOTONIC_OWNER_IS_BLOCKING; 45d00: 7401 moveq #1,%d2 45d02: 2542 0038 movel %d2,%a2@(56) the_period->next_length = length; _ISR_Enable( level ); 45d06: 46c4 movew %d4,%sr _Thread_Executing->Wait.id = the_period->Object.id; 45d08: 2079 0005 e9fe moveal 5e9fe <_Thread_Executing>,%a0 45d0e: 216a 0008 0020 movel %a2@(8),%a0@(32) _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 45d14: 4878 4000 pea 4000 45d18: 2f08 movel %a0,%sp@- 45d1a: 4eb9 0004 8b1c jsr 48b1c <_Thread_Set_state> /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); 45d20: 203c 0000 0700 movel #1792,%d0 45d26: 40c1 movew %sr,%d1 45d28: 8081 orl %d1,%d0 45d2a: 46c0 movew %d0,%sr local_state = the_period->state; the_period->state = RATE_MONOTONIC_ACTIVE; 45d2c: 143c 0002 moveb #2,%d2 /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); local_state = the_period->state; 45d30: 202a 0038 movel %a2@(56),%d0 the_period->state = RATE_MONOTONIC_ACTIVE; 45d34: 2542 0038 movel %d2,%a2@(56) _ISR_Enable( level ); 45d38: 46c1 movew %d1,%sr /* * If it did, then we want to unblock ourself and continue as * if nothing happen. The period was reset in the timeout routine. */ if ( local_state == RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING ) 45d3a: 7203 moveq #3,%d1 45d3c: 4fef 000c lea %sp@(12),%sp 45d40: b280 cmpl %d0,%d1 45d42: 6612 bnes 45d56 _Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 45d44: 4878 4000 pea 4000 45d48: 2f39 0005 e9fe movel 5e9fe <_Thread_Executing>,%sp@- 45d4e: 4eb9 0004 7f04 jsr 47f04 <_Thread_Clear_state> 45d54: 508f addql #8,%sp _Thread_Enable_dispatch(); 45d56: 4eb9 0004 82be jsr 482be <_Thread_Enable_dispatch> 45d5c: 4284 clrl %d4 return RTEMS_SUCCESSFUL; 45d5e: 6038 bras 45d98 case RATE_MONOTONIC_EXPIRED: /* * Update statistics from the concluding period */ _Rate_monotonic_Update_statistics( the_period ); 45d60: 2f0a movel %a2,%sp@- 45d62: 4eb9 0004 5b3c jsr 45b3c <_Rate_monotonic_Update_statistics> _ISR_Enable( level ); 45d68: 46c4 movew %d4,%sr the_period->state = RATE_MONOTONIC_ACTIVE; 45d6a: 7002 moveq #2,%d0 the_period->next_length = length; _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 45d6c: 7806 moveq #6,%d4 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 45d6e: 2542 001c movel %d2,%a2@(28) */ _Rate_monotonic_Update_statistics( the_period ); _ISR_Enable( level ); the_period->state = RATE_MONOTONIC_ACTIVE; 45d72: 2540 0038 movel %d0,%a2@(56) the_period->next_length = length; 45d76: 2542 003c movel %d2,%a2@(60) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 45d7a: 486a 0010 pea %a2@(16) 45d7e: 4879 0005 ea1c pea 5ea1c <_Watchdog_Ticks_chain> 45d84: 4eb9 0004 934c jsr 4934c <_Watchdog_Insert> _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 45d8a: 4eb9 0004 82be jsr 482be <_Thread_Enable_dispatch> return RTEMS_TIMEOUT; 45d90: 4fef 000c lea %sp@(12),%sp 45d94: 6002 bras 45d98 45d96: 7804 moveq #4,%d4 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 45d98: 2004 movel %d4,%d0 45d9a: 4cee 041c ffec moveml %fp@(-20),%d2-%d4/%a2 45da0: 4e5e unlk %fp <== NOT EXECUTED 0004ff88 : rtems_status_code rtems_region_get_segment_size( rtems_id id, void *segment, uintptr_t *size ) { 4ff88: 4e56 fffc linkw %fp,#-4 4ff8c: 2f03 movel %d3,%sp@- 4ff8e: 262e 0010 movel %fp@(16),%d3 4ff92: 2f02 movel %d2,%sp@- 4ff94: 242e 000c movel %fp@(12),%d2 Objects_Locations location; rtems_status_code return_status = RTEMS_SUCCESSFUL; register Region_Control *the_region; if ( !segment ) 4ff98: 6766 beqs 50000 <== NEVER TAKEN return RTEMS_INVALID_ADDRESS; if ( !size ) 4ff9a: 4a83 tstl %d3 4ff9c: 6762 beqs 50000 <== NEVER TAKEN return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); 4ff9e: 2f39 0007 550e movel 7550e <_RTEMS_Allocator_Mutex>,%sp@- 4ffa4: 4eb9 0005 1f48 jsr 51f48 <_API_Mutex_Lock> 4ffaa: 486e fffc pea %fp@(-4) 4ffae: 2f2e 0008 movel %fp@(8),%sp@- 4ffb2: 4879 0007 535a pea 7535a <_Region_Information> 4ffb8: 4eb9 0005 3754 jsr 53754 <_Objects_Get_no_protection> the_region = _Region_Get( id, &location ); switch ( location ) { 4ffbe: 222e fffc movel %fp@(-4),%d1 4ffc2: 4fef 0010 lea %sp@(16),%sp 4ffc6: 670a beqs 4ffd2 4ffc8: 7001 moveq #1,%d0 4ffca: b081 cmpl %d1,%d0 4ffcc: 6620 bnes 4ffee <== NEVER TAKEN 4ffce: 7404 moveq #4,%d2 4ffd0: 601e bras 4fff0 case OBJECTS_LOCAL: if ( !_Heap_Size_of_alloc_area( &the_region->Memory, segment, size ) ) 4ffd2: 2f03 movel %d3,%sp@- 4ffd4: 2040 moveal %d0,%a0 4ffd6: 2f02 movel %d2,%sp@- 4ffd8: 4868 0068 pea %a0@(104) 4ffdc: 4eb9 0005 31d4 jsr 531d4 <_Heap_Size_of_alloc_area> 4ffe2: 4fef 000c lea %sp@(12),%sp 4ffe6: 4a00 tstb %d0 4ffe8: 6604 bnes 4ffee <== ALWAYS TAKEN 4ffea: 7409 moveq #9,%d2 <== NOT EXECUTED 4ffec: 6002 bras 4fff0 <== NOT EXECUTED 4ffee: 4282 clrl %d2 case OBJECTS_ERROR: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 4fff0: 2f39 0007 550e movel 7550e <_RTEMS_Allocator_Mutex>,%sp@- 4fff6: 4eb9 0005 1fa8 jsr 51fa8 <_API_Mutex_Unlock> return return_status; 4fffc: 588f addql #4,%sp 4fffe: 6002 bras 50002 50000: 7409 moveq #9,%d2 } 50002: 2002 movel %d2,%d0 50004: 242e fff4 movel %fp@(-12),%d2 50008: 262e fff8 movel %fp@(-8),%d3 5000c: 4e5e unlk %fp <== NOT EXECUTED 00050620 : rtems_status_code rtems_signal_send( rtems_id id, rtems_signal_set signal_set ) { 50620: 4e56 fffc linkw %fp,#-4 50624: 2f03 movel %d3,%sp@- 50626: 2f02 movel %d2,%sp@- 50628: 242e 000c movel %fp@(12),%d2 register Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; ASR_Information *asr; if ( !signal_set ) 5062c: 6606 bnes 50634 5062e: 700a moveq #10,%d0 50630: 6000 0084 braw 506b6 return RTEMS_INVALID_NUMBER; the_thread = _Thread_Get( id, &location ); 50634: 486e fffc pea %fp@(-4) 50638: 2f2e 0008 movel %fp@(8),%sp@- 5063c: 4eb9 0005 4068 jsr 54068 <_Thread_Get> switch ( location ) { 50642: 508f addql #8,%sp 50644: 4aae fffc tstl %fp@(-4) 50648: 6704 beqs 5064e 5064a: 7004 moveq #4,%d0 5064c: 6068 bras 506b6 case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; 5064e: 2240 moveal %d0,%a1 50650: 2069 010a moveal %a1@(266),%a0 asr = &api->Signal; 50654: 4aa8 000a tstl %a0@(10) 50658: 6754 beqs 506ae if ( ! _ASR_Is_null_handler( asr->handler ) ) { if ( asr->is_enabled ) { 5065a: 4a28 0008 tstb %a0@(8) 5065e: 6732 beqs 50692 rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 50660: 223c 0000 0700 movel #1792,%d1 50666: 40c3 movew %sr,%d3 50668: 8283 orl %d3,%d1 5066a: 46c1 movew %d1,%sr *signal_set |= signals; 5066c: 85a8 0012 orl %d2,%a0@(18) _ISR_Enable( _level ); 50670: 46c3 movew %d3,%sr _ASR_Post_signals( signal_set, &asr->signals_posted ); the_thread->do_post_task_switch_extension = true; if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 50672: 2239 0007 54f6 movel 754f6 <_ISR_Nest_level>,%d1 if ( ! _ASR_Is_null_handler( asr->handler ) ) { if ( asr->is_enabled ) { _ASR_Post_signals( signal_set, &asr->signals_posted ); the_thread->do_post_task_switch_extension = true; 50678: 7401 moveq #1,%d2 5067a: 1342 0074 moveb %d2,%a1@(116) if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 5067e: 4a81 tstl %d1 50680: 6722 beqs 506a4 50682: b0b9 0007 5516 cmpl 75516 <_Thread_Executing>,%d0 50688: 661a bnes 506a4 <== NEVER TAKEN _ISR_Signals_to_thread_executing = true; 5068a: 13c2 0007 55a4 moveb %d2,755a4 <_ISR_Signals_to_thread_executing> 50690: 6012 bras 506a4 rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 50692: 203c 0000 0700 movel #1792,%d0 50698: 40c1 movew %sr,%d1 5069a: 8081 orl %d1,%d0 5069c: 46c0 movew %d0,%sr *signal_set |= signals; 5069e: 85a8 0016 orl %d2,%a0@(22) _ISR_Enable( _level ); 506a2: 46c1 movew %d1,%sr } else { _ASR_Post_signals( signal_set, &asr->signals_pending ); } _Thread_Enable_dispatch(); 506a4: 4eb9 0005 4012 jsr 54012 <_Thread_Enable_dispatch> 506aa: 4280 clrl %d0 return RTEMS_SUCCESSFUL; 506ac: 6008 bras 506b6 } _Thread_Enable_dispatch(); 506ae: 4eb9 0005 4012 jsr 54012 <_Thread_Enable_dispatch> 506b4: 700b moveq #11,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 506b6: 242e fff4 movel %fp@(-12),%d2 506ba: 262e fff8 movel %fp@(-8),%d3 506be: 4e5e unlk %fp ... 0004bc9c : rtems_status_code rtems_task_mode( rtems_mode mode_set, rtems_mode mask, rtems_mode *previous_mode_set ) { 4bc9c: 4e56 ffe4 linkw %fp,#-28 4bca0: 48d7 1c3c moveml %d2-%d5/%a2-%a4,%sp@ 4bca4: 262e 0008 movel %fp@(8),%d3 4bca8: 282e 000c movel %fp@(12),%d4 4bcac: 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 ) 4bcb0: 4a8c tstl %a4 4bcb2: 6606 bnes 4bcba 4bcb4: 7009 moveq #9,%d0 4bcb6: 6000 00fc braw 4bdb4 return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; 4bcba: 2479 0005 cdc2 moveal 5cdc2 <_Thread_Executing>,%a2 api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 4bcc0: 4a2a 0075 tstb %a2@(117) 4bcc4: 57c0 seq %d0 4bcc6: 243c 0000 0100 movel #256,%d2 4bccc: 49c0 extbl %d0 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 4bcce: 266a 010a moveal %a2@(266),%a3 asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 4bcd2: c480 andl %d0,%d2 if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) 4bcd4: 4aaa 007a tstl %a2@(122) 4bcd8: 6704 beqs 4bcde old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; 4bcda: 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; 4bcde: 4a2b 0008 tstb %a3@(8) 4bce2: 57c0 seq %d0 4bce4: 2a3c 0000 0400 movel #1024,%d5 4bcea: 49c0 extbl %d0 4bcec: 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(); 4bcee: 4eb9 0004 7ffc jsr 47ffc <_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; 4bcf4: 8085 orl %d5,%d0 old_mode |= _ISR_Get_level(); *previous_mode_set = old_mode; 4bcf6: 8082 orl %d2,%d0 4bcf8: 2880 movel %d0,%a4@ /* * These are generic thread scheduling characteristics. */ if ( mask & RTEMS_PREEMPT_MASK ) 4bcfa: 0804 0008 btst #8,%d4 4bcfe: 670e beqs 4bd0e executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; 4bd00: 2003 movel %d3,%d0 4bd02: 7201 moveq #1,%d1 4bd04: e088 lsrl #8,%d0 4bd06: b380 eorl %d1,%d0 4bd08: c081 andl %d1,%d0 4bd0a: 1540 0075 moveb %d0,%a2@(117) if ( mask & RTEMS_TIMESLICE_MASK ) { 4bd0e: 0804 0009 btst #9,%d4 4bd12: 671c beqs 4bd30 if ( _Modes_Is_timeslice(mode_set) ) { 4bd14: 0803 0009 btst #9,%d3 4bd18: 6712 beqs 4bd2c executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 4bd1a: 41f9 0005 ccb8 lea 5ccb8 <_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; 4bd20: 7001 moveq #1,%d0 executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 4bd22: 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; 4bd26: 2540 007a movel %d0,%a2@(122) 4bd2a: 6004 bras 4bd30 executing->cpu_time_budget = _Thread_Ticks_per_timeslice; } else executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 4bd2c: 42aa 007a clrl %a2@(122) /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) 4bd30: 7007 moveq #7,%d0 4bd32: c084 andl %d4,%d0 4bd34: 6712 beqs 4bd48 */ RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level ( Modes_Control mode_set ) { _ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) ); 4bd36: 40c0 movew %sr,%d0 4bd38: 7207 moveq #7,%d1 4bd3a: c283 andl %d3,%d1 4bd3c: 0280 0000 f8ff andil #63743,%d0 4bd42: e189 lsll #8,%d1 4bd44: 8081 orl %d1,%d0 4bd46: 46c0 movew %d0,%sr */ is_asr_enabled = false; needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { 4bd48: 0804 000a btst #10,%d4 4bd4c: 6744 beqs 4bd92 * Output: * *previous_mode_set - previous mode set * always return RTEMS_SUCCESSFUL; */ rtems_status_code rtems_task_mode( 4bd4e: 700a moveq #10,%d0 4bd50: e0ab lsrl %d0,%d3 4bd52: 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; 4bd54: 4280 clrl %d0 4bd56: 102b 0008 moveb %a3@(8),%d0 * Output: * *previous_mode_set - previous mode set * always return RTEMS_SUCCESSFUL; */ rtems_status_code rtems_task_mode( 4bd5a: b383 eorl %d1,%d3 4bd5c: 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; 4bd5e: b083 cmpl %d3,%d0 4bd60: 6730 beqs 4bd92 ) { rtems_signal_set _signals; ISR_Level _level; _ISR_Disable( _level ); 4bd62: 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; 4bd68: 1743 0008 moveb %d3,%a3@(8) 4bd6c: 40c1 movew %sr,%d1 4bd6e: 8081 orl %d1,%d0 4bd70: 46c0 movew %d0,%sr _signals = information->signals_pending; 4bd72: 202b 0016 movel %a3@(22),%d0 information->signals_pending = information->signals_posted; 4bd76: 276b 0012 0016 movel %a3@(18),%a3@(22) information->signals_posted = _signals; 4bd7c: 2740 0012 movel %d0,%a3@(18) _ISR_Enable( _level ); 4bd80: 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; 4bd82: 4aab 0012 tstl %a3@(18) 4bd86: 670a beqs 4bd92 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; 4bd88: 7001 moveq #1,%d0 4bd8a: 7401 moveq #1,%d2 4bd8c: 1540 0074 moveb %d0,%a2@(116) 4bd90: 6002 bras 4bd94 4bd92: 4202 clrb %d2 } } } if ( _System_state_Is_up( _System_state_Get() ) ) 4bd94: 7203 moveq #3,%d1 4bd96: b2b9 0005 ce90 cmpl 5ce90 <_System_state_Current>,%d1 4bd9c: 6614 bnes 4bdb2 <== NEVER TAKEN if ( _Thread_Evaluate_mode() || needs_asr_dispatching ) 4bd9e: 4eb9 0004 c094 jsr 4c094 <_Thread_Evaluate_mode> 4bda4: 4a00 tstb %d0 4bda6: 6604 bnes 4bdac 4bda8: 4a02 tstb %d2 4bdaa: 6706 beqs 4bdb2 _Thread_Dispatch(); 4bdac: 4eb9 0004 6b90 jsr 46b90 <_Thread_Dispatch> 4bdb2: 4280 clrl %d0 return RTEMS_SUCCESSFUL; } 4bdb4: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4 4bdba: 4e5e unlk %fp ... 000494cc : rtems_status_code rtems_task_set_priority( rtems_id id, rtems_task_priority new_priority, rtems_task_priority *old_priority ) { 494cc: 4e56 fffc linkw %fp,#-4 494d0: 2f0a movel %a2,%sp@- 494d2: 246e 0010 moveal %fp@(16),%a2 494d6: 2f02 movel %d2,%sp@- 494d8: 242e 000c movel %fp@(12),%d2 register Thread_Control *the_thread; Objects_Locations location; if ( new_priority != RTEMS_CURRENT_PRIORITY && 494dc: 6710 beqs 494ee 494de: 4280 clrl %d0 494e0: 1039 0006 0c82 moveb 60c82 ,%d0 494e6: b082 cmpl %d2,%d0 494e8: 6404 bccs 494ee 494ea: 7013 moveq #19,%d0 494ec: 6054 bras 49542 !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; if ( !old_priority ) 494ee: 4a8a tstl %a2 494f0: 6604 bnes 494f6 494f2: 7009 moveq #9,%d0 494f4: 604c bras 49542 return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); 494f6: 486e fffc pea %fp@(-4) 494fa: 2f2e 0008 movel %fp@(8),%sp@- 494fe: 4eb9 0004 b1d8 jsr 4b1d8 <_Thread_Get> switch ( location ) { 49504: 508f addql #8,%sp return RTEMS_INVALID_PRIORITY; if ( !old_priority ) return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); 49506: 2040 moveal %d0,%a0 switch ( location ) { 49508: 4aae fffc tstl %fp@(-4) 4950c: 6704 beqs 49512 4950e: 7004 moveq #4,%d0 49510: 6030 bras 49542 case OBJECTS_LOCAL: /* XXX need helper to "convert" from core priority */ *old_priority = the_thread->current_priority; 49512: 24a8 0014 movel %a0@(20),%a2@ if ( new_priority != RTEMS_CURRENT_PRIORITY ) { 49516: 4a82 tstl %d2 49518: 6720 beqs 4953a the_thread->real_priority = new_priority; 4951a: 2142 0018 movel %d2,%a0@(24) if ( the_thread->resource_count == 0 || 4951e: 4aa8 001c tstl %a0@(28) 49522: 6706 beqs 4952a the_thread->current_priority > new_priority ) 49524: b4a8 0014 cmpl %a0@(20),%d2 49528: 6410 bccs 4953a <== ALWAYS TAKEN _Thread_Change_priority( the_thread, new_priority, false ); 4952a: 42a7 clrl %sp@- 4952c: 2f02 movel %d2,%sp@- 4952e: 2f08 movel %a0,%sp@- 49530: 4eb9 0004 ac88 jsr 4ac88 <_Thread_Change_priority> 49536: 4fef 000c lea %sp@(12),%sp } _Thread_Enable_dispatch(); 4953a: 4eb9 0004 b182 jsr 4b182 <_Thread_Enable_dispatch> 49540: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 49542: 242e fff4 movel %fp@(-12),%d2 49546: 246e fff8 moveal %fp@(-8),%a2 4954a: 4e5e unlk %fp ... 00050ea8 : */ rtems_status_code rtems_timer_cancel( rtems_id id ) { 50ea8: 4e56 fffc linkw %fp,#-4 RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Get ( Objects_Id id, Objects_Locations *location ) { return (Timer_Control *) 50eac: 486e fffc pea %fp@(-4) 50eb0: 2f2e 0008 movel %fp@(8),%sp@- 50eb4: 4879 0007 5cf0 pea 75cf0 <_Timer_Information> 50eba: 4eb9 0005 378c jsr 5378c <_Objects_Get> Timer_Control *the_timer; Objects_Locations location; the_timer = _Timer_Get( id, &location ); switch ( location ) { 50ec0: 4fef 000c lea %sp@(12),%sp 50ec4: 4aae fffc tstl %fp@(-4) 50ec8: 6704 beqs 50ece 50eca: 7004 moveq #4,%d0 50ecc: 601e bras 50eec case OBJECTS_LOCAL: if ( !_Timer_Is_dormant_class( the_timer->the_class ) ) 50ece: 7204 moveq #4,%d1 50ed0: 2040 moveal %d0,%a0 50ed2: b2a8 0038 cmpl %a0@(56),%d1 50ed6: 670c beqs 50ee4 <== NEVER TAKEN (void) _Watchdog_Remove( &the_timer->Ticker ); 50ed8: 4868 0010 pea %a0@(16) 50edc: 4eb9 0005 53a8 jsr 553a8 <_Watchdog_Remove> 50ee2: 588f addql #4,%sp _Thread_Enable_dispatch(); 50ee4: 4eb9 0005 4012 jsr 54012 <_Thread_Enable_dispatch> 50eea: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 50eec: 4e5e unlk %fp <== NOT EXECUTED 0005132c : rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ) { 5132c: 4e56 ffe8 linkw %fp,#-24 51330: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 51334: 282e 0008 movel %fp@(8),%d4 51338: 262e 000c movel %fp@(12),%d3 5133c: 242e 0010 movel %fp@(16),%d2 Timer_Control *the_timer; Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; 51340: 2679 0007 5d2a moveal 75d2a <_Timer_server>,%a3 if ( !timer_server ) 51346: 4a8b tstl %a3 51348: 6606 bnes 51350 5134a: 700e moveq #14,%d0 5134c: 6000 00a4 braw 513f2 return RTEMS_INCORRECT_STATE; if ( !_TOD_Is_set ) 51350: 4a39 0007 5470 tstb 75470 <_TOD_Is_set> 51356: 6606 bnes 5135e <== ALWAYS TAKEN 51358: 700b moveq #11,%d0 <== NOT EXECUTED 5135a: 6000 0096 braw 513f2 <== NOT EXECUTED return RTEMS_NOT_DEFINED; if ( !routine ) 5135e: 4a82 tstl %d2 51360: 6606 bnes 51368 51362: 7009 moveq #9,%d0 51364: 6000 008c braw 513f2 return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) 51368: 2f03 movel %d3,%sp@- 5136a: 4eb9 0004 e7a8 jsr 4e7a8 <_TOD_Validate> 51370: 588f addql #4,%sp 51372: 4a00 tstb %d0 51374: 677a beqs 513f0 return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 51376: 2f03 movel %d3,%sp@- 51378: 4eb9 0004 e708 jsr 4e708 <_TOD_To_seconds> if ( seconds <= _TOD_Seconds_since_epoch() ) 5137e: 588f addql #4,%sp return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 51380: 2600 movel %d0,%d3 if ( seconds <= _TOD_Seconds_since_epoch() ) 51382: b0b9 0007 54ee cmpl 754ee <_TOD_Now>,%d0 51388: 6366 blss 513f0 5138a: 486e fffc pea %fp@(-4) 5138e: 2f04 movel %d4,%sp@- 51390: 4879 0007 5cf0 pea 75cf0 <_Timer_Information> 51396: 4eb9 0005 378c jsr 5378c <_Objects_Get> return RTEMS_INVALID_CLOCK; the_timer = _Timer_Get( id, &location ); switch ( location ) { 5139c: 4fef 000c lea %sp@(12),%sp 513a0: 2440 moveal %d0,%a2 513a2: 4aae fffc tstl %fp@(-4) 513a6: 6704 beqs 513ac 513a8: 7004 moveq #4,%d0 513aa: 6046 bras 513f2 case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); 513ac: 486a 0010 pea %a2@(16) 513b0: 4eb9 0005 53a8 jsr 553a8 <_Watchdog_Remove> the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 513b6: 256e 0014 0034 movel %fp@(20),%a2@(52) the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK; 513bc: 7003 moveq #3,%d0 void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; 513be: 2544 0030 movel %d4,%a2@(48) _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); 513c2: 96b9 0007 54ee subl 754ee <_TOD_Now>,%d3 the_timer = _Timer_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK; 513c8: 2540 0038 movel %d0,%a2@(56) _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); 513cc: 2543 001c movel %d3,%a2@(28) Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 513d0: 2542 002c movel %d2,%a2@(44) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 513d4: 42aa 0018 clrl %a2@(24) (*timer_server->schedule_operation)( timer_server, the_timer ); 513d8: 2f0a movel %a2,%sp@- 513da: 2f0b movel %a3,%sp@- 513dc: 206b 0004 moveal %a3@(4),%a0 513e0: 4e90 jsr %a0@ _Thread_Enable_dispatch(); 513e2: 4eb9 0005 4012 jsr 54012 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 513e8: 4fef 000c lea %sp@(12),%sp _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); (*timer_server->schedule_operation)( timer_server, the_timer ); _Thread_Enable_dispatch(); 513ec: 4280 clrl %d0 return RTEMS_SUCCESSFUL; 513ee: 6002 bras 513f2 513f0: 7014 moveq #20,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 513f2: 4cee 0c1c ffe8 moveml %fp@(-24),%d2-%d4/%a2-%a3 513f8: 4e5e unlk %fp <== NOT EXECUTED 000456ac : int sched_get_priority_max( int policy ) { switch ( policy ) { 456ac: 7004 moveq #4,%d0 #include int sched_get_priority_max( int policy ) { 456ae: 4e56 0000 linkw %fp,#0 456b2: 222e 0008 movel %fp@(8),%d1 switch ( policy ) { 456b6: b081 cmpl %d1,%d0 456b8: 650c bcss 456c6 456ba: 103c 0001 moveb #1,%d0 456be: e3a8 lsll %d1,%d0 456c0: 7217 moveq #23,%d1 456c2: c081 andl %d1,%d0 456c4: 6610 bnes 456d6 <== ALWAYS TAKEN case SCHED_RR: case SCHED_SPORADIC: break; default: rtems_set_errno_and_return_minus_one( EINVAL ); 456c6: 4eb9 0004 d60c jsr 4d60c <__errno> 456cc: 7216 moveq #22,%d1 456ce: 2040 moveal %d0,%a0 456d0: 70ff moveq #-1,%d0 456d2: 2081 movel %d1,%a0@ 456d4: 600a bras 456e0 } return POSIX_SCHEDULER_MAXIMUM_PRIORITY; 456d6: 4280 clrl %d0 456d8: 1039 0005 c596 moveb 5c596 ,%d0 456de: 5380 subql #1,%d0 } 456e0: 4e5e unlk %fp <== NOT EXECUTED 000456e4 : int sched_get_priority_min( int policy ) { switch ( policy ) { 456e4: 7004 moveq #4,%d0 #include int sched_get_priority_min( int policy ) { 456e6: 4e56 0000 linkw %fp,#0 456ea: 222e 0008 movel %fp@(8),%d1 switch ( policy ) { 456ee: b081 cmpl %d1,%d0 456f0: 6510 bcss 45702 456f2: 103c 0001 moveb #1,%d0 456f6: e3a8 lsll %d1,%d0 456f8: 7217 moveq #23,%d1 456fa: c081 andl %d1,%d0 456fc: 6704 beqs 45702 <== NEVER TAKEN 456fe: 7001 moveq #1,%d0 45700: 600e bras 45710 case SCHED_RR: case SCHED_SPORADIC: break; default: rtems_set_errno_and_return_minus_one( EINVAL ); 45702: 4eb9 0004 d60c jsr 4d60c <__errno> 45708: 7216 moveq #22,%d1 4570a: 2040 moveal %d0,%a0 4570c: 70ff moveq #-1,%d0 4570e: 2081 movel %d1,%a0@ } return POSIX_SCHEDULER_MINIMUM_PRIORITY; } 45710: 4e5e unlk %fp <== NOT EXECUTED 00045714 : int sched_rr_get_interval( pid_t pid, struct timespec *interval ) { 45714: 4e56 0000 linkw %fp,#0 45718: 2f03 movel %d3,%sp@- 4571a: 262e 0008 movel %fp@(8),%d3 4571e: 2f02 movel %d2,%sp@- 45720: 242e 000c movel %fp@(12),%d2 /* * Only supported for the "calling process" (i.e. this node). */ if ( pid && pid != getpid() ) 45724: 4a83 tstl %d3 45726: 671a beqs 45742 <== NEVER TAKEN 45728: 4eb9 0004 2994 jsr 42994 4572e: b083 cmpl %d3,%d0 45730: 6710 beqs 45742 rtems_set_errno_and_return_minus_one( ESRCH ); 45732: 4eb9 0004 d60c jsr 4d60c <__errno> 45738: 7403 moveq #3,%d2 4573a: 72ff moveq #-1,%d1 4573c: 2040 moveal %d0,%a0 4573e: 2082 movel %d2,%a0@ 45740: 6026 bras 45768 if ( !interval ) 45742: 4a82 tstl %d2 45744: 6610 bnes 45756 rtems_set_errno_and_return_minus_one( EINVAL ); 45746: 4eb9 0004 d60c jsr 4d60c <__errno> 4574c: 72ff moveq #-1,%d1 4574e: 2040 moveal %d0,%a0 45750: 7016 moveq #22,%d0 45752: 2080 movel %d0,%a0@ 45754: 6012 bras 45768 _Timespec_From_ticks( _Thread_Ticks_per_timeslice, interval ); 45756: 2f02 movel %d2,%sp@- 45758: 2f39 0005 dcd8 movel 5dcd8 <_Thread_Ticks_per_timeslice>,%sp@- 4575e: 4eb9 0004 8858 jsr 48858 <_Timespec_From_ticks> return 0; 45764: 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 ); 45766: 4281 clrl %d1 return 0; } 45768: 242e fff8 movel %fp@(-8),%d2 4576c: 2001 movel %d1,%d0 4576e: 262e fffc movel %fp@(-4),%d3 45772: 4e5e unlk %fp ... 00047ce8 : int oflag, ... /* mode_t mode, */ /* unsigned int value */ ) { 47ce8: 4e56 ffe0 linkw %fp,#-32 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 47cec: 2039 0006 1b04 movel 61b04 <_Thread_Dispatch_disable_level>,%d0 47cf2: 5280 addql #1,%d0 47cf4: 48d7 043c moveml %d2-%d5/%a2,%sp@ 47cf8: 23c0 0006 1b04 movel %d0,61b04 <_Thread_Dispatch_disable_level> 47cfe: 242e 0008 movel %fp@(8),%d2 47d02: 282e 000c movel %fp@(12),%d4 POSIX_Semaphore_Control *the_semaphore; Objects_Locations location; _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { 47d06: 2a04 movel %d4,%d5 47d08: 0285 0000 0200 andil #512,%d5 47d0e: 6604 bnes 47d14 47d10: 4283 clrl %d3 47d12: 6004 bras 47d18 va_start(arg, oflag); mode = (mode_t) va_arg( arg, unsigned int ); value = va_arg( arg, unsigned int ); 47d14: 262e 0014 movel %fp@(20),%d3 va_end(arg); } status = _POSIX_Semaphore_Name_to_id( name, &the_semaphore_id ); 47d18: 486e fffc pea %fp@(-4) 47d1c: 2f02 movel %d2,%sp@- 47d1e: 4eb9 0004 d5f8 jsr 4d5f8 <_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 ) { 47d24: 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 ); 47d26: 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 ) { 47d28: 4a80 tstl %d0 47d2a: 671e beqs 47d4a /* * 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) ) ) { 47d2c: 7002 moveq #2,%d0 47d2e: b08a cmpl %a2,%d0 47d30: 6604 bnes 47d36 <== NEVER TAKEN 47d32: 4a85 tstl %d5 47d34: 6662 bnes 47d98 _Thread_Enable_dispatch(); 47d36: 4eb9 0004 a2f2 jsr 4a2f2 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one_cast( status, sem_t * ); 47d3c: 4eb9 0005 080c jsr 5080c <__errno> 47d42: 72ff moveq #-1,%d1 47d44: 2040 moveal %d0,%a0 47d46: 208a movel %a2,%a0@ 47d48: 607a bras 47dc4 47d4a: 45f9 0004 a2f2 lea 4a2f2 <_Thread_Enable_dispatch>,%a2 /* * Check for existence with creation. */ if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { 47d50: 0284 0000 0a00 andil #2560,%d4 47d56: 0c84 0000 0a00 cmpil #2560,%d4 47d5c: 6612 bnes 47d70 _Thread_Enable_dispatch(); 47d5e: 4e92 jsr %a2@ rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * ); 47d60: 4eb9 0005 080c jsr 5080c <__errno> 47d66: 72ff moveq #-1,%d1 47d68: 2040 moveal %d0,%a0 47d6a: 7011 moveq #17,%d0 47d6c: 2080 movel %d0,%a0@ 47d6e: 6054 bras 47dc4 47d70: 486e fff4 pea %fp@(-12) 47d74: 2f2e fffc movel %fp@(-4),%sp@- 47d78: 4879 0006 1d5e pea 61d5e <_POSIX_Semaphore_Information> 47d7e: 4eb9 0004 9aa0 jsr 49aa0 <_Objects_Get> } the_semaphore = _POSIX_Semaphore_Get( &the_semaphore_id, &location ); the_semaphore->open_count += 1; 47d84: 2040 moveal %d0,%a0 47d86: 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 ); 47d8a: 2d40 fff8 movel %d0,%fp@(-8) the_semaphore->open_count += 1; _Thread_Enable_dispatch(); 47d8e: 4e92 jsr %a2@ _Thread_Enable_dispatch(); 47d90: 4e92 jsr %a2@ goto return_id; 47d92: 4fef 000c lea %sp@(12),%sp 47d96: 6026 bras 47dbe /* * 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( 47d98: 486e fff8 pea %fp@(-8) 47d9c: 2f03 movel %d3,%sp@- 47d9e: 42a7 clrl %sp@- 47da0: 2f02 movel %d2,%sp@- 47da2: 4eb9 0004 d4b0 jsr 4d4b0 <_POSIX_Semaphore_Create_support> 47da8: 2400 movel %d0,%d2 /* * errno was set by Create_support, so don't set it again. */ _Thread_Enable_dispatch(); 47daa: 4eb9 0004 a2f2 jsr 4a2f2 <_Thread_Enable_dispatch> if ( status == -1 ) 47db0: 4fef 0010 lea %sp@(16),%sp 47db4: 70ff moveq #-1,%d0 47db6: b082 cmpl %d2,%d0 47db8: 6604 bnes 47dbe 47dba: 72ff moveq #-1,%d1 47dbc: 6006 bras 47dc4 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; 47dbe: 222e fff8 movel %fp@(-8),%d1 47dc2: 5081 addql #8,%d1 #endif return id; } 47dc4: 2001 movel %d1,%d0 47dc6: 4cee 043c ffe0 moveml %fp@(-32),%d2-%d5/%a2 47dcc: 4e5e unlk %fp <== NOT EXECUTED 000455e4 : int sigaction( int sig, const struct sigaction *act, struct sigaction *oact ) { 455e4: 4e56 ffec linkw %fp,#-20 455e8: 222e 0010 movel %fp@(16),%d1 455ec: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 455f0: 242e 0008 movel %fp@(8),%d2 455f4: 246e 000c moveal %fp@(12),%a2 ISR_Level level; if ( oact ) 455f8: 4a81 tstl %d1 455fa: 6722 beqs 4561e *oact = _POSIX_signals_Vectors[ sig ]; 455fc: 2602 movel %d2,%d3 455fe: 2002 movel %d2,%d0 45600: 4878 000c pea c 45604: e58b lsll #2,%d3 45606: e988 lsll #4,%d0 45608: 9083 subl %d3,%d0 4560a: 0680 0005 edb6 addil #388534,%d0 45610: 2f00 movel %d0,%sp@- 45612: 2f01 movel %d1,%sp@- 45614: 4eb9 0004 dfb8 jsr 4dfb8 4561a: 4fef 000c lea %sp@(12),%sp if ( !sig ) 4561e: 4a82 tstl %d2 45620: 6710 beqs 45632 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 45622: 2002 movel %d2,%d0 45624: 5380 subql #1,%d0 45626: 721f moveq #31,%d1 45628: b280 cmpl %d0,%d1 4562a: 6506 bcss 45632 * * NOTE: Solaris documentation claims to "silently enforce" this which * contradicts the POSIX specification. */ if ( sig == SIGKILL ) 4562c: 7009 moveq #9,%d0 4562e: b082 cmpl %d2,%d0 45630: 6610 bnes 45642 rtems_set_errno_and_return_minus_one( EINVAL ); 45632: 4eb9 0004 d780 jsr 4d780 <__errno> 45638: 72ff moveq #-1,%d1 4563a: 2040 moveal %d0,%a0 4563c: 7016 moveq #22,%d0 4563e: 2080 movel %d0,%a0@ 45640: 6060 bras 456a2 /* * Evaluate the new action structure and set the global signal vector * appropriately. */ if ( act ) { 45642: 4a8a tstl %a2 45644: 675a beqs 456a0 <== 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 ); 45646: 203c 0000 0700 movel #1792,%d0 4564c: 40c3 movew %sr,%d3 4564e: 8083 orl %d3,%d0 45650: 46c0 movew %d0,%sr 45652: 780c moveq #12,%d4 45654: 47f9 0004 dfb8 lea 4dfb8 ,%a3 4565a: 4c02 4800 mulsl %d2,%d4 if ( act->sa_handler == SIG_DFL ) { 4565e: 4aaa 0008 tstl %a2@(8) 45662: 661e bnes 45682 _POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ]; 45664: 4878 000c pea c 45668: 2004 movel %d4,%d0 4566a: 0680 0005 c304 addil #377604,%d0 45670: 2f00 movel %d0,%sp@- 45672: 0684 0005 edb6 addil #388534,%d4 45678: 2f04 movel %d4,%sp@- 4567a: 4e93 jsr %a3@ 4567c: 4fef 000c lea %sp@(12),%sp 45680: 601c bras 4569e } else { _POSIX_signals_Clear_process_signals( sig ); 45682: 2f02 movel %d2,%sp@- _POSIX_signals_Vectors[ sig ] = *act; 45684: 0684 0005 edb6 addil #388534,%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 ); 4568a: 4eb9 0004 a748 jsr 4a748 <_POSIX_signals_Clear_process_signals> _POSIX_signals_Vectors[ sig ] = *act; 45690: 4878 000c pea c 45694: 2f0a movel %a2,%sp@- 45696: 2f04 movel %d4,%sp@- 45698: 4e93 jsr %a3@ 4569a: 4fef 0010 lea %sp@(16),%sp } _ISR_Enable( level ); 4569e: 46c3 movew %d3,%sr 456a0: 4281 clrl %d1 * + If we are now ignoring a signal that was previously pending, * we clear the pending signal indicator. */ return 0; } 456a2: 2001 movel %d1,%d0 456a4: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 456aa: 4e5e unlk %fp ... 00047364 : #include int sigsuspend( const sigset_t *sigmask ) { 47364: 4e56 ffec linkw %fp,#-20 47368: 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 ); 4736c: 240e movel %fp,%d2 4736e: 5982 subql #4,%d2 47370: 45f9 0004 733c lea 4733c ,%a2 (void) sigfillset( &all_signals ); 47376: 260e movel %fp,%d3 47378: 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 ); 4737a: 2f02 movel %d2,%sp@- 4737c: 2f2e 0008 movel %fp@(8),%sp@- 47380: 4878 0001 pea 1 47384: 4e92 jsr %a2@ (void) sigfillset( &all_signals ); 47386: 2f03 movel %d3,%sp@- 47388: 4eb9 0004 729c jsr 4729c status = sigtimedwait( &all_signals, NULL, NULL ); 4738e: 42a7 clrl %sp@- 47390: 42a7 clrl %sp@- 47392: 2f03 movel %d3,%sp@- 47394: 4eb9 0004 7414 jsr 47414 4739a: 2600 movel %d0,%d3 (void) sigprocmask( SIG_SETMASK, &saved_signals_blocked, NULL ); 4739c: 42a7 clrl %sp@- 4739e: 2f02 movel %d2,%sp@- 473a0: 42a7 clrl %sp@- 473a2: 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 ) 473a4: 4fef 0028 lea %sp@(40),%sp 473a8: 70ff moveq #-1,%d0 473aa: b083 cmpl %d3,%d0 473ac: 670c beqs 473ba <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EINTR ); 473ae: 4eb9 0004 f2a4 jsr 4f2a4 <__errno> 473b4: 2040 moveal %d0,%a0 473b6: 7004 moveq #4,%d0 473b8: 2080 movel %d0,%a0@ return status; } 473ba: 70ff moveq #-1,%d0 473bc: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 473c2: 4e5e unlk %fp ... 000459cc : int sigtimedwait( const sigset_t *set, siginfo_t *info, const struct timespec *timeout ) { 459cc: 4e56 ffd8 linkw %fp,#-40 459d0: 48d7 3c1c moveml %d2-%d4/%a2-%a5,%sp@ 459d4: 286e 0008 moveal %fp@(8),%a4 459d8: 246e 000c moveal %fp@(12),%a2 459dc: 242e 0010 movel %fp@(16),%d2 ISR_Level level; /* * Error check parameters before disabling interrupts. */ if ( !set ) 459e0: 4a8c tstl %a4 459e2: 6732 beqs 45a16 /* NOTE: This is very specifically a RELATIVE not ABSOLUTE time * in the Open Group specification. */ interval = 0; if ( timeout ) { 459e4: 4a82 tstl %d2 459e6: 6740 beqs 45a28 if ( !_Timespec_Is_valid( timeout ) ) 459e8: 2f02 movel %d2,%sp@- 459ea: 4eb9 0004 8ba4 jsr 48ba4 <_Timespec_Is_valid> 459f0: 588f addql #4,%sp 459f2: 4a00 tstb %d0 459f4: 6612 bnes 45a08 rtems_set_errno_and_return_minus_one( EINVAL ); 459f6: 4eb9 0004 da74 jsr 4da74 <__errno> 459fc: 7816 moveq #22,%d4 459fe: 74ff moveq #-1,%d2 45a00: 2240 moveal %d0,%a1 45a02: 2284 movel %d4,%a1@ 45a04: 6000 012e braw 45b34 interval = _Timespec_To_ticks( timeout ); 45a08: 2f02 movel %d2,%sp@- 45a0a: 4eb9 0004 8c14 jsr 48c14 <_Timespec_To_ticks> if ( !interval ) 45a10: 588f addql #4,%sp 45a12: 4a80 tstl %d0 45a14: 6614 bnes 45a2a <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); 45a16: 4eb9 0004 da74 jsr 4da74 <__errno> 45a1c: 7616 moveq #22,%d3 45a1e: 74ff moveq #-1,%d2 45a20: 2040 moveal %d0,%a0 45a22: 2083 movel %d3,%a0@ 45a24: 6000 010e braw 45b34 45a28: 4280 clrl %d0 /* * Initialize local variables. */ the_info = ( info ) ? info : &signal_information; 45a2a: 4a8a tstl %a2 45a2c: 6604 bnes 45a32 45a2e: 45ee fff4 lea %fp@(-12),%a2 the_thread = _Thread_Executing; 45a32: 2079 0005 ed42 moveal 5ed42 <_Thread_Executing>,%a0 * What if they are already pending? */ /* API signals pending? */ _ISR_Disable( level ); 45a38: 223c 0000 0700 movel #1792,%d1 the_info = ( info ) ? info : &signal_information; the_thread = _Thread_Executing; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 45a3e: 2668 010e moveal %a0@(270),%a3 * What if they are already pending? */ /* API signals pending? */ _ISR_Disable( level ); 45a42: 40c3 movew %sr,%d3 45a44: 8283 orl %d3,%d1 45a46: 46c1 movew %d1,%sr if ( *set & api->signals_pending ) { 45a48: 2414 movel %a4@,%d2 45a4a: 2802 movel %d2,%d4 45a4c: 222b 00d0 movel %a3@(208),%d1 45a50: c881 andl %d1,%d4 45a52: 6730 beqs 45a84 /* XXX real info later */ the_info->si_signo = _POSIX_signals_Get_highest( api->signals_pending ); 45a54: 2f01 movel %d1,%sp@- 45a56: 4eb9 0004 5980 jsr 45980 <_POSIX_signals_Get_highest> 45a5c: 2480 movel %d0,%a2@ _POSIX_signals_Clear_signals( 45a5e: 42a7 clrl %sp@- 45a60: 42a7 clrl %sp@- 45a62: 2f0a movel %a2,%sp@- 45a64: 2f00 movel %d0,%sp@- 45a66: 2f0b movel %a3,%sp@- 45a68: 4eb9 0004 ad80 jsr 4ad80 <_POSIX_signals_Clear_signals> the_info->si_signo, the_info, false, false ); _ISR_Enable( level ); 45a6e: 46c3 movew %d3,%sr the_info->si_code = SI_USER; 45a70: 7001 moveq #1,%d0 the_info->si_value.sival_int = 0; return the_info->si_signo; 45a72: 4fef 0018 lea %sp@(24),%sp false, false ); _ISR_Enable( level ); the_info->si_code = SI_USER; 45a76: 2540 0004 movel %d0,%a2@(4) the_info->si_value.sival_int = 0; return the_info->si_signo; 45a7a: 2412 movel %a2@,%d2 false ); _ISR_Enable( level ); the_info->si_code = SI_USER; the_info->si_value.sival_int = 0; 45a7c: 42aa 0008 clrl %a2@(8) return the_info->si_signo; 45a80: 6000 00b2 braw 45b34 } /* Process pending signals? */ if ( *set & _POSIX_signals_Pending ) { 45a84: 2239 0005 f32a movel 5f32a <_POSIX_signals_Pending>,%d1 45a8a: 4bf9 0004 ad80 lea 4ad80 <_POSIX_signals_Clear_signals>,%a5 45a90: c481 andl %d1,%d2 45a92: 672c beqs 45ac0 signo = _POSIX_signals_Get_highest( _POSIX_signals_Pending ); 45a94: 2f01 movel %d1,%sp@- 45a96: 4eb9 0004 5980 jsr 45980 <_POSIX_signals_Get_highest> 45a9c: 2400 movel %d0,%d2 _POSIX_signals_Clear_signals( api, signo, the_info, true, false ); 45a9e: 42a7 clrl %sp@- 45aa0: 4878 0001 pea 1 45aa4: 2f0a movel %a2,%sp@- 45aa6: 2f00 movel %d0,%sp@- 45aa8: 2f0b movel %a3,%sp@- 45aaa: 4e95 jsr %a5@ _ISR_Enable( level ); 45aac: 46c3 movew %d3,%sr the_info->si_signo = signo; the_info->si_code = SI_USER; 45aae: 7201 moveq #1,%d1 the_info->si_value.sival_int = 0; return signo; 45ab0: 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; 45ab4: 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; 45ab8: 2482 movel %d2,%a2@ the_info->si_code = SI_USER; 45aba: 2541 0004 movel %d1,%a2@(4) the_info->si_value.sival_int = 0; return signo; 45abe: 6074 bras 45b34 45ac0: 2239 0005 ec88 movel 5ec88 <_Thread_Dispatch_disable_level>,%d1 45ac6: 5281 addql #1,%d1 45ac8: 23c1 0005 ec88 movel %d1,5ec88 <_Thread_Dispatch_disable_level> } the_info->si_signo = -1; 45ace: 72ff moveq #-1,%d1 45ad0: 2481 movel %d1,%a2@ _Thread_Disable_dispatch(); the_thread->Wait.queue = &_POSIX_signals_Wait_queue; the_thread->Wait.return_code = EINTR; 45ad2: 7204 moveq #4,%d1 } the_info->si_signo = -1; _Thread_Disable_dispatch(); the_thread->Wait.queue = &_POSIX_signals_Wait_queue; 45ad4: 43f9 0005 f2c2 lea 5f2c2 <_POSIX_signals_Wait_queue>,%a1 the_thread->Wait.return_code = EINTR; 45ada: 2141 0034 movel %d1,%a0@(52) the_thread->Wait.option = *set; 45ade: 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; 45ae2: 123c 0001 moveb #1,%d1 the_thread->Wait.return_argument = the_info; 45ae6: 214a 0028 movel %a2,%a0@(40) } the_info->si_signo = -1; _Thread_Disable_dispatch(); the_thread->Wait.queue = &_POSIX_signals_Wait_queue; 45aea: 2149 0044 movel %a1,%a0@(68) 45aee: 23c1 0005 f2f2 movel %d1,5f2f2 <_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 ); 45af4: 46c3 movew %d3,%sr _Thread_queue_Enqueue( &_POSIX_signals_Wait_queue, interval ); 45af6: 4879 0004 866c pea 4866c <_Thread_queue_Timeout> 45afc: 2f00 movel %d0,%sp@- 45afe: 4879 0005 f2c2 pea 5f2c2 <_POSIX_signals_Wait_queue> 45b04: 4eb9 0004 8380 jsr 48380 <_Thread_queue_Enqueue_with_handler> _Thread_Enable_dispatch(); 45b0a: 4eb9 0004 7ee6 jsr 47ee6 <_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 ); 45b10: 42a7 clrl %sp@- 45b12: 42a7 clrl %sp@- 45b14: 2f0a movel %a2,%sp@- 45b16: 2f12 movel %a2@,%sp@- 45b18: 2f0b movel %a3,%sp@- 45b1a: 4e95 jsr %a5@ errno = _Thread_Executing->Wait.return_code; 45b1c: 4fef 0020 lea %sp@(32),%sp 45b20: 4eb9 0004 da74 jsr 4da74 <__errno> 45b26: 2079 0005 ed42 moveal 5ed42 <_Thread_Executing>,%a0 45b2c: 2240 moveal %d0,%a1 45b2e: 22a8 0034 movel %a0@(52),%a1@ return the_info->si_signo; 45b32: 2412 movel %a2@,%d2 } 45b34: 2002 movel %d2,%d0 45b36: 4cee 3c1c ffd8 moveml %fp@(-40),%d2-%d4/%a2-%a5 45b3c: 4e5e unlk %fp <== NOT EXECUTED 000475a0 : int sigwait( const sigset_t *set, int *sig ) { 475a0: 4e56 0000 linkw %fp,#0 475a4: 2f0a movel %a2,%sp@- 475a6: 246e 000c moveal %fp@(12),%a2 int status; status = sigtimedwait( set, NULL, NULL ); 475aa: 42a7 clrl %sp@- 475ac: 42a7 clrl %sp@- 475ae: 2f2e 0008 movel %fp@(8),%sp@- 475b2: 4eb9 0004 7414 jsr 47414 if ( status != -1 ) { 475b8: 4fef 000c lea %sp@(12),%sp 475bc: 72ff moveq #-1,%d1 475be: b280 cmpl %d0,%d1 475c0: 670a beqs 475cc if ( sig ) 475c2: 4a8a tstl %a2 475c4: 6702 beqs 475c8 <== NEVER TAKEN *sig = status; 475c6: 2480 movel %d0,%a2@ 475c8: 4280 clrl %d0 475ca: 600a bras 475d6 return 0; } return errno; 475cc: 4eb9 0004 f2a4 jsr 4f2a4 <__errno> 475d2: 2040 moveal %d0,%a0 475d4: 2010 movel %a0@,%d0 } 475d6: 246e fffc moveal %fp@(-4),%a2 475da: 4e5e unlk %fp ... 00044bd0 : timer_t *timerid ) { POSIX_Timer_Control *ptimer; if ( clock_id != CLOCK_REALTIME ) 44bd0: 7001 moveq #1,%d0 int timer_create( clockid_t clock_id, struct sigevent *evp, timer_t *timerid ) { 44bd2: 4e56 0000 linkw %fp,#0 44bd6: 2f0b movel %a3,%sp@- 44bd8: 266e 0010 moveal %fp@(16),%a3 44bdc: 2f0a movel %a2,%sp@- 44bde: 246e 000c moveal %fp@(12),%a2 POSIX_Timer_Control *ptimer; if ( clock_id != CLOCK_REALTIME ) 44be2: b0ae 0008 cmpl %fp@(8),%d0 44be6: 6620 bnes 44c08 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !timerid ) 44be8: 4a8b tstl %a3 44bea: 671c beqs 44c08 /* * The data of the structure evp are checked in order to verify if they * are coherent. */ if (evp != NULL) { 44bec: 4a8a tstl %a2 44bee: 672a beqs 44c1a <== NEVER TAKEN /* The structure has data */ if ( ( evp->sigev_notify != SIGEV_NONE ) && 44bf0: 2012 movel %a2@,%d0 44bf2: 7201 moveq #1,%d1 44bf4: 5380 subql #1,%d0 44bf6: b280 cmpl %d0,%d1 44bf8: 650e bcss 44c08 <== 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 ) 44bfa: 202a 0004 movel %a2@(4),%d0 44bfe: 6708 beqs 44c08 <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(evp->sigev_signo) ) 44c00: 5380 subql #1,%d0 44c02: 721f moveq #31,%d1 44c04: b280 cmpl %d0,%d1 44c06: 6412 bccs 44c1a <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); 44c08: 4eb9 0004 d1a0 jsr 4d1a0 <__errno> 44c0e: 72ff moveq #-1,%d1 44c10: 2040 moveal %d0,%a0 44c12: 7016 moveq #22,%d0 44c14: 2080 movel %d0,%a0@ 44c16: 6000 00a4 braw 44cbc rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 44c1a: 2039 0005 d878 movel 5d878 <_Thread_Dispatch_disable_level>,%d0 44c20: 5280 addql #1,%d0 44c22: 23c0 0005 d878 movel %d0,5d878 <_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 ); 44c28: 4879 0005 db0c pea 5db0c <_POSIX_Timer_Information> 44c2e: 4eb9 0004 67f4 jsr 467f4 <_Objects_Allocate> /* * Allocate a timer */ ptimer = _POSIX_Timer_Allocate(); if ( !ptimer ) { 44c34: 588f addql #4,%sp 44c36: 2040 moveal %d0,%a0 44c38: 4a80 tstl %d0 44c3a: 6616 bnes 44c52 _Thread_Enable_dispatch(); 44c3c: 4eb9 0004 73ca jsr 473ca <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EAGAIN ); 44c42: 4eb9 0004 d1a0 jsr 4d1a0 <__errno> 44c48: 72ff moveq #-1,%d1 44c4a: 2040 moveal %d0,%a0 44c4c: 700b moveq #11,%d0 44c4e: 2080 movel %d0,%a0@ 44c50: 606a bras 44cbc } /* The data of the created timer are stored to use them later */ ptimer->state = POSIX_TIMER_STATE_CREATE_NEW; 44c52: 7002 moveq #2,%d0 44c54: 1140 003c moveb %d0,%a0@(60) ptimer->thread_id = _Thread_Executing->Object.id; 44c58: 2279 0005 d932 moveal 5d932 <_Thread_Executing>,%a1 44c5e: 2169 0008 0038 movel %a1@(8),%a0@(56) if ( evp != NULL ) { 44c64: 4a8a tstl %a2 44c66: 6710 beqs 44c78 ptimer->inf.sigev_notify = evp->sigev_notify; 44c68: 2152 003e movel %a2@,%a0@(62) ptimer->inf.sigev_signo = evp->sigev_signo; ptimer->inf.sigev_value = evp->sigev_value; 44c6c: 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; 44c72: 216a 0004 0042 movel %a2@(4),%a0@(66) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 44c78: 2028 0008 movel %a0@(8),%d0 44c7c: 4281 clrl %d1 44c7e: 2279 0005 db24 moveal 5db24 <_POSIX_Timer_Information+0x18>,%a1 44c84: 3200 movew %d0,%d1 ptimer->inf.sigev_value = evp->sigev_value; } ptimer->overrun = 0; 44c86: 42a8 0066 clrl %a0@(102) 44c8a: 2388 1c00 movel %a0,%a1@(00000000,%d1:l:4) ptimer->timer_data.it_value.tv_sec = 0; 44c8e: 42a8 005a clrl %a0@(90) _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 44c92: 42a8 000c clrl %a0@(12) ptimer->timer_data.it_value.tv_nsec = 0; 44c96: 42a8 005e clrl %a0@(94) ptimer->timer_data.it_interval.tv_sec = 0; 44c9a: 42a8 0052 clrl %a0@(82) ptimer->timer_data.it_interval.tv_nsec = 0; 44c9e: 42a8 0056 clrl %a0@(86) void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; 44ca2: 42a8 0030 clrl %a0@(48) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 44ca6: 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; 44caa: 2680 movel %d0,%a3@ the_watchdog->routine = routine; 44cac: 42a8 002c clrl %a0@(44) the_watchdog->id = id; the_watchdog->user_data = user_data; 44cb0: 42a8 0034 clrl %a0@(52) _Thread_Enable_dispatch(); 44cb4: 4eb9 0004 73ca jsr 473ca <_Thread_Enable_dispatch> 44cba: 4281 clrl %d1 return 0; } 44cbc: 246e fff8 moveal %fp@(-8),%a2 44cc0: 2001 movel %d1,%d0 44cc2: 266e fffc moveal %fp@(-4),%a3 44cc6: 4e5e unlk %fp ... 00044d60 : useconds_t ualarm( useconds_t useconds, useconds_t interval ) { 44d60: 4e56 ffe8 linkw %fp,#-24 44d64: 48d7 041c moveml %d2-%d4/%a2,%sp@ 44d68: 262e 0008 movel %fp@(8),%d3 /* * Initialize the timer used to implement alarm(). */ if ( !the_timer->routine ) { 44d6c: 4ab9 0005 ecfa tstl 5ecfa <_POSIX_signals_Ualarm_timer+0x1c> 44d72: 6622 bnes 44d96 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 44d74: 42b9 0005 ece6 clrl 5ece6 <_POSIX_signals_Ualarm_timer+0x8> the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 44d7a: 4282 clrl %d2 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 44d7c: 203c 0004 4e4c movel #282188,%d0 the_watchdog->id = id; 44d82: 42b9 0005 ecfe clrl 5ecfe <_POSIX_signals_Ualarm_timer+0x20> Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 44d88: 23c0 0005 ecfa movel %d0,5ecfa <_POSIX_signals_Ualarm_timer+0x1c> the_watchdog->id = id; the_watchdog->user_data = user_data; 44d8e: 42b9 0005 ed02 clrl 5ed02 <_POSIX_signals_Ualarm_timer+0x24> 44d94: 6058 bras 44dee _Watchdog_Initialize( the_timer, _POSIX_signals_Ualarm_TSR, 0, NULL ); } else { Watchdog_States state; state = _Watchdog_Remove( the_timer ); 44d96: 4879 0005 ecde pea 5ecde <_POSIX_signals_Ualarm_timer> 44d9c: 4eb9 0004 8338 jsr 48338 <_Watchdog_Remove> if ( (state == WATCHDOG_ACTIVE) || (state == WATCHDOG_REMOVE_IT) ) { 44da2: 588f addql #4,%sp 44da4: 7201 moveq #1,%d1 44da6: 5580 subql #2,%d0 44da8: b280 cmpl %d0,%d1 44daa: 6404 bccs 44db0 <== ALWAYS TAKEN 44dac: 4282 clrl %d2 <== NOT EXECUTED 44dae: 603e bras 44dee <== 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); 44db0: 2039 0005 ecf2 movel 5ecf2 <_POSIX_signals_Ualarm_timer+0x14>,%d0 44db6: d0b9 0005 ecea addl 5ecea <_POSIX_signals_Ualarm_timer+0xc>,%d0 /* remaining is now in ticks */ _Timespec_From_ticks( ticks, &tp ); 44dbc: 486e fff8 pea %fp@(-8) 44dc0: 90b9 0005 ecf6 subl 5ecf6 <_POSIX_signals_Ualarm_timer+0x18>,%d0 remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND; 44dc6: 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 ); 44dcc: 2f00 movel %d0,%sp@- 44dce: 4eb9 0004 7e60 jsr 47e60 <_Timespec_From_ticks> remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND; 44dd4: 202e fff8 movel %fp@(-8),%d0 44dd8: 4c04 0800 mulsl %d4,%d0 remaining += tp.tv_nsec / 1000; 44ddc: 283c 0000 03e8 movel #1000,%d4 44de2: 508f addql #8,%sp 44de4: 242e fffc movel %fp@(-4),%d2 44de8: 4c44 2802 remsl %d4,%d2,%d2 44dec: 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 ) { 44dee: 4a83 tstl %d3 44df0: 674e beqs 44e40 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 ); 44df2: 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; 44df4: 223c 000f 4240 movel #1000000,%d1 tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; ticks = _Timespec_To_ticks( &tp ); 44dfa: 5184 subql #8,%d4 44dfc: 45f9 0004 7ee4 lea 47ee4 <_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; 44e02: 4c41 3000 remul %d1,%d0,%d3 44e06: 4c41 3003 remul %d1,%d3,%d3 tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; 44e0a: 223c 0000 03e8 movel #1000,%d1 44e10: 4c00 1800 mulsl %d0,%d1 ticks = _Timespec_To_ticks( &tp ); 44e14: 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; 44e16: 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; 44e1a: 2d43 fff8 movel %d3,%fp@(-8) tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; ticks = _Timespec_To_ticks( &tp ); 44e1e: 4e92 jsr %a2@ if ( ticks == 0 ) ticks = 1; _Watchdog_Insert_ticks( the_timer, _Timespec_To_ticks( &tp ) ); 44e20: 2f04 movel %d4,%sp@- 44e22: 4e92 jsr %a2@ ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 44e24: 4879 0005 ecde pea 5ecde <_POSIX_signals_Ualarm_timer> 44e2a: 4879 0005 e590 pea 5e590 <_Watchdog_Ticks_chain> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 44e30: 23c0 0005 ecea movel %d0,5ecea <_POSIX_signals_Ualarm_timer+0xc> _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 44e36: 4eb9 0004 821c jsr 4821c <_Watchdog_Insert> 44e3c: 4fef 0010 lea %sp@(16),%sp } return remaining; } 44e40: 2002 movel %d2,%d0 44e42: 4cee 041c ffe8 moveml %fp@(-24),%d2-%d4/%a2 44e48: 4e5e unlk %fp <== NOT EXECUTED