=============================================================================== 0004cc84 : * We should ensure the ticks not be truncated by integer division. We * need to have it be greater than or equal to the requested time. It * should not be shorter. */ microseconds_per_tick = rtems_configuration_get_microseconds_per_tick(); ticks = microseconds / microseconds_per_tick; 4cc84: 41f9 0006 4ca8 lea 64ca8 ,%a0 #include uint32_t TOD_MICROSECONDS_TO_TICKS( uint32_t microseconds ) { 4cc8a: 4e56 0000 linkw %fp,#0 * We should ensure the ticks not be truncated by integer division. We * need to have it be greater than or equal to the requested time. It * should not be shorter. */ microseconds_per_tick = rtems_configuration_get_microseconds_per_tick(); ticks = microseconds / microseconds_per_tick; 4cc8e: 202e 0008 movel %fp@(8),%d0 4cc92: 4c50 0001 remul %a0@,%d1,%d0 4cc96: 4c50 0000 remul %a0@,%d0,%d0 if ( (microseconds % microseconds_per_tick) != 0 ) 4cc9a: 4a81 tstl %d1 4cc9c: 6702 beqs 4cca0 <== ALWAYS TAKEN ticks += 1; 4cc9e: 5280 addql #1,%d0 <== NOT EXECUTED return ticks; } 4cca0: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000482d4 : #include uint32_t TOD_MILLISECONDS_TO_TICKS( uint32_t milliseconds ) { 482d4: 4e56 0000 linkw %fp,#0 /** * We should ensure the ticks not be truncated by integer division. We * need to have it be greater than or equal to the requested time. It * should not be shorter. */ milliseconds_per_tick = rtems_configuration_get_milliseconds_per_tick(); 482d8: 2039 0006 0838 movel 60838 ,%d0 #include uint32_t TOD_MILLISECONDS_TO_TICKS( uint32_t milliseconds ) { 482de: 2f02 movel %d2,%sp@- /** * We should ensure the ticks not be truncated by integer division. We * need to have it be greater than or equal to the requested time. It * should not be shorter. */ milliseconds_per_tick = rtems_configuration_get_milliseconds_per_tick(); 482e0: 243c 0000 03e8 movel #1000,%d2 482e6: 4c42 0000 remul %d2,%d0,%d0 ticks = milliseconds / milliseconds_per_tick; 482ea: 242e 0008 movel %fp@(8),%d2 482ee: 4c40 2001 remul %d0,%d1,%d2 482f2: 4c40 2002 remul %d0,%d2,%d2 482f6: 2002 movel %d2,%d0 if ( (milliseconds % milliseconds_per_tick) != 0 ) 482f8: 4a81 tstl %d1 482fa: 6702 beqs 482fe <== ALWAYS TAKEN ticks += 1; 482fc: 5280 addql #1,%d0 <== NOT EXECUTED return ticks; } 482fe: 241f movel %sp@+,%d2 48300: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00047416 <_API_extensions_Run_postdriver>: /* * _API_extensions_Run_postdriver */ void _API_extensions_Run_postdriver( void ) { 47416: 4e56 0000 linkw %fp,#0 4741a: 2f0a movel %a2,%sp@- */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 4741c: 2479 0006 119c moveal 6119c <_API_extensions_List>,%a2 Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _Chain_First( &_API_extensions_List ); 47422: b5fc 0006 11a0 cmpal #397728,%a2 47428: 6710 beqs 4743a <_API_extensions_Run_postdriver+0x24><== NEVER TAKEN * Currently all APIs configure this hook so it is always non-NULL. */ #if defined(FUNCTIONALITY_NOT_CURRENTLY_USED_BY_ANY_API) if ( the_extension->postdriver_hook ) #endif (*the_extension->postdriver_hook)(); 4742a: 206a 0008 moveal %a2@(8),%a0 4742e: 4e90 jsr %a0@ Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _Chain_First( &_API_extensions_List ); !_Chain_Is_tail( &_API_extensions_List, the_node ) ; the_node = the_node->next ) { 47430: 2452 moveal %a2@,%a2 void _API_extensions_Run_postdriver( void ) { Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _Chain_First( &_API_extensions_List ); 47432: b5fc 0006 11a0 cmpal #397728,%a2 47438: 66f0 bnes 4742a <_API_extensions_Run_postdriver+0x14> #if defined(FUNCTIONALITY_NOT_CURRENTLY_USED_BY_ANY_API) if ( the_extension->postdriver_hook ) #endif (*the_extension->postdriver_hook)(); } } 4743a: 246e fffc moveal %fp@(-4),%a2 4743e: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00047442 <_API_extensions_Run_postswitch>: /* * _API_extensions_Run_postswitch */ void _API_extensions_Run_postswitch( void ) { 47442: 4e56 0000 linkw %fp,#0 47446: 2f0a movel %a2,%sp@- 47448: 2479 0006 119c moveal 6119c <_API_extensions_List>,%a2 Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _Chain_First( &_API_extensions_List ); 4744e: b5fc 0006 11a0 cmpal #397728,%a2 47454: 6718 beqs 4746e <_API_extensions_Run_postswitch+0x2c><== NEVER TAKEN !_Chain_Is_tail( &_API_extensions_List, the_node ) ; the_node = the_node->next ) { the_extension = (API_extensions_Control *) the_node; (*the_extension->postswitch_hook)( _Thread_Executing ); 47456: 2f39 0006 14aa movel 614aa <_Per_CPU_Information+0xc>,%sp@- 4745c: 206a 000c moveal %a2@(12),%a0 47460: 4e90 jsr %a0@ Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _Chain_First( &_API_extensions_List ); !_Chain_Is_tail( &_API_extensions_List, the_node ) ; the_node = the_node->next ) { 47462: 2452 moveal %a2@,%a2 void _API_extensions_Run_postswitch( void ) { Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _Chain_First( &_API_extensions_List ); 47464: 588f addql #4,%sp 47466: b5fc 0006 11a0 cmpal #397728,%a2 4746c: 66e8 bnes 47456 <_API_extensions_Run_postswitch+0x14> the_extension = (API_extensions_Control *) the_node; (*the_extension->postswitch_hook)( _Thread_Executing ); } } 4746e: 246e fffc moveal %fp@(-4),%a2 47472: 4e5e unlk %fp ... =============================================================================== 000498e0 <_CORE_RWLock_Obtain_for_writing>: * Otherwise, we have to block. * If locked for reading and no waiters, then OK to read. * If any thread is waiting, then we wait. */ _ISR_Disable( level ); 498e0: 203c 0000 0700 movel #1792,%d0 Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_RWLock_API_mp_support_callout api_rwlock_mp_support ) { 498e6: 4e56 fff4 linkw %fp,#-12 498ea: 206e 0008 moveal %fp@(8),%a0 498ee: 48d7 001c moveml %d2-%d4,%sp@ 498f2: 282e 000c movel %fp@(12),%d4 498f6: 262e 0014 movel %fp@(20),%d3 ISR_Level level; Thread_Control *executing = _Thread_Executing; 498fa: 2279 0006 40ce moveal 640ce <_Per_CPU_Information+0xc>,%a1 Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_RWLock_API_mp_support_callout api_rwlock_mp_support ) { 49900: 142e 0013 moveb %fp@(19),%d2 * 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 ); 49904: 40c1 movew %sr,%d1 49906: 8081 orl %d1,%d0 49908: 46c0 movew %d0,%sr switch ( the_rwlock->current_state ) { 4990a: 4aa8 0044 tstl %a0@(68) 4990e: 6614 bnes 49924 <_CORE_RWLock_Obtain_for_writing+0x44> case CORE_RWLOCK_UNLOCKED: the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_WRITING; 49910: 7002 moveq #2,%d0 49912: 2140 0044 movel %d0,%a0@(68) _ISR_Enable( level ); 49916: 46c1 movew %d1,%sr executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 49918: 42a9 0034 clrl %a1@(52) _CORE_RWLock_Timeout ); /* return to API level so it can dispatch and we block */ } 4991c: 4cd7 001c moveml %sp@,%d2-%d4 49920: 4e5e unlk %fp 49922: 4e75 rts /* * If the thread is not willing to wait, then return immediately. */ if ( !wait ) { 49924: 4a02 tstb %d2 49926: 6610 bnes 49938 <_CORE_RWLock_Obtain_for_writing+0x58> _ISR_Enable( level ); 49928: 46c1 movew %d1,%sr executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; 4992a: 7002 moveq #2,%d0 _CORE_RWLock_Timeout ); /* return to API level so it can dispatch and we block */ } 4992c: 4cd7 001c moveml %sp@,%d2-%d4 * If the thread is not willing to wait, then return immediately. */ if ( !wait ) { _ISR_Enable( level ); executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; 49930: 2340 0034 movel %d0,%a1@(52) _CORE_RWLock_Timeout ); /* return to API level so it can dispatch and we block */ } 49934: 4e5e unlk %fp 49936: 4e75 rts 49938: 7001 moveq #1,%d0 4993a: 2140 0030 movel %d0,%a0@(48) /* * 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; 4993e: 2348 0044 movel %a0,%a1@(68) executing->Wait.id = id; 49942: 2344 0020 movel %d4,%a1@(32) executing->Wait.option = CORE_RWLOCK_THREAD_WAITING_FOR_WRITE; 49946: 2340 0030 movel %d0,%a1@(48) executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 4994a: 42a9 0034 clrl %a1@(52) _ISR_Enable( level ); 4994e: 46c1 movew %d1,%sr _Thread_queue_Enqueue_with_handler( 49950: 2d43 000c movel %d3,%fp@(12) 49954: 203c 0004 9a4c movel #301644,%d0 4995a: 2d48 0008 movel %a0,%fp@(8) _CORE_RWLock_Timeout ); /* return to API level so it can dispatch and we block */ } 4995e: 4cd7 001c moveml %sp@,%d2-%d4 executing->Wait.id = id; executing->Wait.option = CORE_RWLOCK_THREAD_WAITING_FOR_WRITE; executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; _ISR_Enable( level ); _Thread_queue_Enqueue_with_handler( 49962: 2d40 0010 movel %d0,%fp@(16) _CORE_RWLock_Timeout ); /* return to API level so it can dispatch and we block */ } 49966: 4e5e unlk %fp executing->Wait.id = id; executing->Wait.option = CORE_RWLOCK_THREAD_WAITING_FOR_WRITE; executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; _ISR_Enable( level ); _Thread_queue_Enqueue_with_handler( 49968: 4ef9 0004 b7ec jmp 4b7ec <_Thread_queue_Enqueue_with_handler> ... =============================================================================== 00049970 <_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 ); 49970: 203c 0000 0700 movel #1792,%d0 */ CORE_RWLock_Status _CORE_RWLock_Release( CORE_RWLock_Control *the_rwlock ) { 49976: 4e56 fff0 linkw %fp,#-16 ISR_Level level; Thread_Control *executing = _Thread_Executing; 4997a: 2079 0006 40ce moveal 640ce <_Per_CPU_Information+0xc>,%a0 */ CORE_RWLock_Status _CORE_RWLock_Release( CORE_RWLock_Control *the_rwlock ) { 49980: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ 49984: 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 ); 49988: 40c1 movew %sr,%d1 4998a: 8081 orl %d1,%d0 4998c: 46c0 movew %d0,%sr if ( the_rwlock->current_state == CORE_RWLOCK_UNLOCKED){ 4998e: 202a 0044 movel %a2@(68),%d0 49992: 6700 0090 beqw 49a24 <_CORE_RWLock_Release+0xb4> _ISR_Enable( level ); executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; return CORE_RWLOCK_SUCCESSFUL; } if ( the_rwlock->current_state == CORE_RWLOCK_LOCKED_FOR_READING ) { 49996: 7401 moveq #1,%d2 49998: b480 cmpl %d0,%d2 4999a: 676e beqs 49a0a <_CORE_RWLock_Release+0x9a> return CORE_RWLOCK_SUCCESSFUL; } } /* CORE_RWLOCK_LOCKED_FOR_WRITING or READING with readers */ executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 4999c: 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; 499a0: 42aa 0044 clrl %a2@(68) _ISR_Enable( level ); 499a4: 46c1 movew %d1,%sr next = _Thread_queue_Dequeue( &the_rwlock->Wait_queue ); 499a6: 2f0a movel %a2,%sp@- 499a8: 4eb9 0004 b67c jsr 4b67c <_Thread_queue_Dequeue> if ( next ) { 499ae: 588f addql #4,%sp 499b0: 4a80 tstl %d0 499b2: 674a beqs 499fe <_CORE_RWLock_Release+0x8e> if ( next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) { 499b4: 7201 moveq #1,%d1 499b6: 2040 moveal %d0,%a0 499b8: b2a8 0030 cmpl %a0@(48),%d1 499bc: 677c beqs 49a3a <_CORE_RWLock_Release+0xca> /* * Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING */ the_rwlock->number_of_readers += 1; the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING; 499be: 7201 moveq #1,%d1 } /* * Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING */ the_rwlock->number_of_readers += 1; 499c0: 52aa 0048 addql #1,%a2@(72) 499c4: 47f9 0004 bb58 lea 4bb58 <_Thread_queue_First>,%a3 next = _Thread_queue_First( &the_rwlock->Wait_queue ); 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 ); 499ca: 49f9 0004 ba0c lea 4ba0c <_Thread_queue_Extract>,%a4 /* * Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING */ the_rwlock->number_of_readers += 1; the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING; 499d0: 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 ); 499d4: 2f0a movel %a2,%sp@- 499d6: 4e93 jsr %a3@ if ( !next || 499d8: 588f addql #4,%sp 499da: 4a80 tstl %d0 499dc: 6720 beqs 499fe <_CORE_RWLock_Release+0x8e> 499de: 7401 moveq #1,%d2 499e0: 2040 moveal %d0,%a0 499e2: b4a8 0030 cmpl %a0@(48),%d2 499e6: 6716 beqs 499fe <_CORE_RWLock_Release+0x8e> <== NEVER TAKEN next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) return CORE_RWLOCK_SUCCESSFUL; the_rwlock->number_of_readers += 1; 499e8: 52aa 0048 addql #1,%a2@(72) _Thread_queue_Extract( &the_rwlock->Wait_queue, next ); 499ec: 2f00 movel %d0,%sp@- 499ee: 2f0a movel %a2,%sp@- 499f0: 4e94 jsr %a4@ } 499f2: 508f addql #8,%sp /* * Now see if more readers can be let go. */ while ( 1 ) { next = _Thread_queue_First( &the_rwlock->Wait_queue ); 499f4: 2f0a movel %a2,%sp@- 499f6: 4e93 jsr %a3@ if ( !next || 499f8: 588f addql #4,%sp 499fa: 4a80 tstl %d0 499fc: 66e0 bnes 499de <_CORE_RWLock_Release+0x6e> <== NEVER TAKEN } /* indentation is to match _ISR_Disable at top */ return CORE_RWLOCK_SUCCESSFUL; } 499fe: 4280 clrl %d0 49a00: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 49a06: 4e5e unlk %fp 49a08: 4e75 rts _ISR_Enable( level ); executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; return CORE_RWLOCK_SUCCESSFUL; } if ( the_rwlock->current_state == CORE_RWLOCK_LOCKED_FOR_READING ) { the_rwlock->number_of_readers -= 1; 49a0a: 202a 0048 movel %a2@(72),%d0 49a0e: 5380 subql #1,%d0 49a10: 2540 0048 movel %d0,%a2@(72) if ( the_rwlock->number_of_readers != 0 ) { 49a14: 6786 beqs 4999c <_CORE_RWLock_Release+0x2c> /* must be unlocked again */ _ISR_Enable( level ); 49a16: 46c1 movew %d1,%sr } /* indentation is to match _ISR_Disable at top */ return CORE_RWLOCK_SUCCESSFUL; } 49a18: 4280 clrl %d0 49a1a: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 49a20: 4e5e unlk %fp 49a22: 4e75 rts * If any thread is waiting, then we wait. */ _ISR_Disable( level ); if ( the_rwlock->current_state == CORE_RWLOCK_UNLOCKED){ _ISR_Enable( level ); 49a24: 46c1 movew %d1,%sr executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; 49a26: 103c 0002 moveb #2,%d0 } /* indentation is to match _ISR_Disable at top */ return CORE_RWLOCK_SUCCESSFUL; } 49a2a: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 */ _ISR_Disable( level ); if ( the_rwlock->current_state == CORE_RWLOCK_UNLOCKED){ _ISR_Enable( level ); executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; 49a30: 2140 0034 movel %d0,%a0@(52) } /* indentation is to match _ISR_Disable at top */ return CORE_RWLOCK_SUCCESSFUL; } 49a34: 4280 clrl %d0 49a36: 4e5e unlk %fp 49a38: 4e75 rts next = _Thread_queue_Dequeue( &the_rwlock->Wait_queue ); if ( next ) { if ( next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) { the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_WRITING; 49a3a: 7002 moveq #2,%d0 49a3c: 2540 0044 movel %d0,%a2@(68) } /* indentation is to match _ISR_Disable at top */ return CORE_RWLOCK_SUCCESSFUL; } 49a40: 4280 clrl %d0 49a42: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 49a48: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00049a4c <_CORE_RWLock_Timeout>: void _CORE_RWLock_Timeout( Objects_Id id, void *ignored ) { 49a4c: 4e56 fffc linkw %fp,#-4 Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 49a50: 486e fffc pea %fp@(-4) 49a54: 2f2e 0008 movel %fp@(8),%sp@- 49a58: 4eb9 0004 b318 jsr 4b318 <_Thread_Get> switch ( location ) { 49a5e: 508f addql #8,%sp 49a60: 4aae fffc tstl %fp@(-4) 49a64: 661e bnes 49a84 <_CORE_RWLock_Timeout+0x38> <== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 49a66: 2f00 movel %d0,%sp@- 49a68: 4eb9 0004 bc78 jsr 4bc78 <_Thread_queue_Process_timeout> * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { _Thread_Dispatch_disable_level--; return _Thread_Dispatch_disable_level; 49a6e: 588f addql #4,%sp * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { _Thread_Dispatch_disable_level--; 49a70: 2039 0006 3c6c movel 63c6c <_Thread_Dispatch_disable_level>,%d0 49a76: 5380 subql #1,%d0 49a78: 23c0 0006 3c6c movel %d0,63c6c <_Thread_Dispatch_disable_level> return _Thread_Dispatch_disable_level; 49a7e: 2039 0006 3c6c movel 63c6c <_Thread_Dispatch_disable_level>,%d0 _Thread_Unnest_dispatch(); break; } } 49a84: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000485c8 <_CORE_barrier_Wait>: Thread_Control *executing; ISR_Level level; executing = _Thread_Executing; executing->Wait.return_code = CORE_BARRIER_STATUS_SUCCESSFUL; _ISR_Disable( level ); 485c8: 203c 0000 0700 movel #1792,%d0 Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_barrier_API_mp_support_callout api_barrier_mp_support ) { 485ce: 4e56 fff4 linkw %fp,#-12 Thread_Control *executing; ISR_Level level; executing = _Thread_Executing; 485d2: 2279 0006 29be moveal 629be <_Per_CPU_Information+0xc>,%a1 Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_barrier_API_mp_support_callout api_barrier_mp_support ) { 485d8: 48d7 001c moveml %d2-%d4,%sp@ 485dc: 206e 0008 moveal %fp@(8),%a0 Thread_Control *executing; ISR_Level level; executing = _Thread_Executing; executing->Wait.return_code = CORE_BARRIER_STATUS_SUCCESSFUL; 485e0: 42a9 0034 clrl %a1@(52) Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_barrier_API_mp_support_callout api_barrier_mp_support ) { 485e4: 242e 000c movel %fp@(12),%d2 485e8: 262e 0014 movel %fp@(20),%d3 485ec: 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 ); 485f0: 40c1 movew %sr,%d1 485f2: 8081 orl %d1,%d0 485f4: 46c0 movew %d0,%sr the_barrier->number_of_waiting_threads++; 485f6: 2028 0048 movel %a0@(72),%d0 485fa: 5280 addql #1,%d0 485fc: 2140 0048 movel %d0,%a0@(72) if ( _CORE_barrier_Is_automatic( &the_barrier->Attributes ) ) { 48600: 4aa8 0040 tstl %a0@(64) 48604: 6606 bnes 4860c <_CORE_barrier_Wait+0x44> if ( the_barrier->number_of_waiting_threads == 48606: b0a8 0044 cmpl %a0@(68),%d0 4860a: 672e beqs 4863a <_CORE_barrier_Wait+0x72> 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; 4860c: 7001 moveq #1,%d0 4860e: 2140 0030 movel %d0,%a0@(48) return; } } _Thread_queue_Enter_critical_section( &the_barrier->Wait_queue ); executing->Wait.queue = &the_barrier->Wait_queue; 48612: 2348 0044 movel %a0,%a1@(68) executing->Wait.id = id; 48616: 2342 0020 movel %d2,%a1@(32) _ISR_Enable( level ); 4861a: 46c1 movew %d1,%sr _Thread_queue_Enqueue( &the_barrier->Wait_queue, timeout ); 4861c: 2d43 000c movel %d3,%fp@(12) 48620: 203c 0004 aa68 movel #305768,%d0 48626: 2d48 0008 movel %a0,%fp@(8) } 4862a: 4cd7 001c moveml %sp@,%d2-%d4 _Thread_queue_Enter_critical_section( &the_barrier->Wait_queue ); executing->Wait.queue = &the_barrier->Wait_queue; executing->Wait.id = id; _ISR_Enable( level ); _Thread_queue_Enqueue( &the_barrier->Wait_queue, timeout ); 4862e: 2d40 0010 movel %d0,%fp@(16) } 48632: 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 ); 48634: 4ef9 0004 a6e0 jmp 4a6e0 <_Thread_queue_Enqueue_with_handler> _ISR_Disable( level ); the_barrier->number_of_waiting_threads++; if ( _CORE_barrier_Is_automatic( &the_barrier->Attributes ) ) { if ( the_barrier->number_of_waiting_threads == the_barrier->Attributes.maximum_count) { executing->Wait.return_code = CORE_BARRIER_STATUS_AUTOMATICALLY_RELEASED; 4863a: 7001 moveq #1,%d0 4863c: 2340 0034 movel %d0,%a1@(52) _ISR_Enable( level ); 48640: 46c1 movew %d1,%sr _CORE_barrier_Release( the_barrier, id, api_barrier_mp_support ); 48642: 2d44 0010 movel %d4,%fp@(16) 48646: 2d42 000c movel %d2,%fp@(12) executing->Wait.queue = &the_barrier->Wait_queue; executing->Wait.id = id; _ISR_Enable( level ); _Thread_queue_Enqueue( &the_barrier->Wait_queue, timeout ); } 4864a: 4cd7 001c moveml %sp@,%d2-%d4 if ( _CORE_barrier_Is_automatic( &the_barrier->Attributes ) ) { if ( the_barrier->number_of_waiting_threads == the_barrier->Attributes.maximum_count) { executing->Wait.return_code = CORE_BARRIER_STATUS_AUTOMATICALLY_RELEASED; _ISR_Enable( level ); _CORE_barrier_Release( the_barrier, id, api_barrier_mp_support ); 4864e: 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 ); } 48652: 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 ); 48654: 4ef9 0004 dcd8 jmp 4dcd8 <_CORE_barrier_Release> ... =============================================================================== 0004dd18 <_CORE_message_queue_Close>: void _CORE_message_queue_Close( CORE_message_queue_Control *the_message_queue, Thread_queue_Flush_callout remote_extract_callout, uint32_t status ) { 4dd18: 4e56 0000 linkw %fp,#0 4dd1c: 2f0a movel %a2,%sp@- /* * This will flush blocked threads whether they were blocked on * a send or receive. */ _Thread_queue_Flush( 4dd1e: 2f2e 0010 movel %fp@(16),%sp@- 4dd22: 2f2e 000c movel %fp@(12),%sp@- void _CORE_message_queue_Close( CORE_message_queue_Control *the_message_queue, Thread_queue_Flush_callout remote_extract_callout, uint32_t status ) { 4dd26: 246e 0008 moveal %fp@(8),%a2 /* * This will flush blocked threads whether they were blocked on * a send or receive. */ _Thread_queue_Flush( 4dd2a: 2f0a movel %a2,%sp@- 4dd2c: 4eb9 0004 a374 jsr 4a374 <_Thread_queue_Flush> * This removes all messages from the pending message queue. Since * we just flushed all waiting threads, we don't have to worry about * the flush satisfying any blocked senders as a side-effect. */ if ( the_message_queue->number_of_pending_messages != 0 ) 4dd32: 4fef 000c lea %sp@(12),%sp 4dd36: 4aaa 0048 tstl %a2@(72) 4dd3a: 6612 bnes 4dd4e <_CORE_message_queue_Close+0x36> (void) _CORE_message_queue_Flush_support( the_message_queue ); (void) _Workspace_Free( the_message_queue->message_buffers ); 4dd3c: 2d6a 005c 0008 movel %a2@(92),%fp@(8) } 4dd42: 246e fffc moveal %fp@(-4),%a2 4dd46: 4e5e unlk %fp */ if ( the_message_queue->number_of_pending_messages != 0 ) (void) _CORE_message_queue_Flush_support( the_message_queue ); (void) _Workspace_Free( the_message_queue->message_buffers ); 4dd48: 4ef9 0004 ad0e jmp 4ad0e <_Workspace_Free> * we just flushed all waiting threads, we don't have to worry about * the flush satisfying any blocked senders as a side-effect. */ if ( the_message_queue->number_of_pending_messages != 0 ) (void) _CORE_message_queue_Flush_support( the_message_queue ); 4dd4e: 2f0a movel %a2,%sp@- 4dd50: 4eb9 0004 dd6c jsr 4dd6c <_CORE_message_queue_Flush_support> (void) _Workspace_Free( the_message_queue->message_buffers ); 4dd56: 2d6a 005c 0008 movel %a2@(92),%fp@(8) * we just flushed all waiting threads, we don't have to worry about * the flush satisfying any blocked senders as a side-effect. */ if ( the_message_queue->number_of_pending_messages != 0 ) (void) _CORE_message_queue_Flush_support( the_message_queue ); 4dd5c: 588f addql #4,%sp (void) _Workspace_Free( the_message_queue->message_buffers ); } 4dd5e: 246e fffc moveal %fp@(-4),%a2 4dd62: 4e5e unlk %fp */ if ( the_message_queue->number_of_pending_messages != 0 ) (void) _CORE_message_queue_Flush_support( the_message_queue ); (void) _Workspace_Free( the_message_queue->message_buffers ); 4dd64: 4ef9 0004 ad0e jmp 4ad0e <_Workspace_Free> ... =============================================================================== 00050438 <_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)) { 50438: 7203 moveq #3,%d1 CORE_message_queue_Control *the_message_queue, CORE_message_queue_Attributes *the_message_queue_attributes, uint32_t maximum_pending_messages, size_t maximum_message_size ) { 5043a: 4e56 ffe4 linkw %fp,#-28 5043e: 202e 0014 movel %fp@(20),%d0 50442: 48d7 04fc moveml %d2-%d7/%a2,%sp@ 50446: 246e 0008 moveal %fp@(8),%a2 * Round size up to multiple of a pointer for chain init and * check for overflow on adding overhead to each message. */ allocated_message_size = maximum_message_size; if (allocated_message_size & (sizeof(uint32_t) - 1)) { allocated_message_size += sizeof(uint32_t); 5044a: 2600 movel %d0,%d3 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 ) { 5044c: 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)) { 50450: c280 andl %d0,%d1 ) { size_t message_buffering_required = 0; size_t allocated_message_size; the_message_queue->maximum_pending_messages = maximum_pending_messages; 50452: 2542 0044 movel %d2,%a2@(68) the_message_queue->number_of_pending_messages = 0; 50456: 42aa 0048 clrl %a2@(72) the_message_queue->maximum_message_size = maximum_message_size; 5045a: 2540 004c movel %d0,%a2@(76) CORE_message_queue_Control *the_message_queue, CORE_message_queue_Notify_Handler the_handler, void *the_argument ) { the_message_queue->notify_handler = the_handler; 5045e: 42aa 0060 clrl %a2@(96) the_message_queue->notify_argument = the_argument; 50462: 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)) { 50466: 4a81 tstl %d1 50468: 6716 beqs 50480 <_CORE_message_queue_Initialize+0x48> allocated_message_size += sizeof(uint32_t); 5046a: 5883 addql #4,%d3 allocated_message_size &= ~(sizeof(uint32_t) - 1); 5046c: 72fc moveq #-4,%d1 5046e: c681 andl %d1,%d3 } if (allocated_message_size < maximum_message_size) 50470: b680 cmpl %d0,%d3 50472: 640c bccs 50480 <_CORE_message_queue_Initialize+0x48><== ALWAYS TAKEN STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; } 50474: 4cee 04fc ffe4 moveml %fp@(-28),%d2-%d7/%a2 */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) _Workspace_Allocate( message_buffering_required ); if (the_message_queue->message_buffers == 0) return false; 5047a: 4200 clrb %d0 STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; } 5047c: 4e5e unlk %fp 5047e: 4e75 rts /* * Calculate how much total memory is required for message buffering and * check for overflow on the multiplication. */ if ( !size_t_mult32_with_overflow( 50480: 0683 0000 0014 addil #20,%d3 size_t a, size_t b, size_t *c ) { long long x = (long long)a*b; 50486: 2f03 movel %d3,%sp@- if ( x > SIZE_MAX ) 50488: 4286 clrl %d6 5048a: 7eff moveq #-1,%d7 size_t a, size_t b, size_t *c ) { long long x = (long long)a*b; 5048c: 42a7 clrl %sp@- 5048e: 2f02 movel %d2,%sp@- 50490: 42a7 clrl %sp@- 50492: 4eb9 0006 4928 jsr 64928 <__muldi3> 50498: 4fef 0010 lea %sp@(16),%sp 5049c: 2800 movel %d0,%d4 5049e: 2a01 movel %d1,%d5 if ( x > SIZE_MAX ) 504a0: 9e85 subl %d5,%d7 504a2: 9d84 subxl %d4,%d6 504a4: 6dce blts 50474 <_CORE_message_queue_Initialize+0x3c> /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) _Workspace_Allocate( message_buffering_required ); 504a6: 2f01 movel %d1,%sp@- 504a8: 4eb9 0005 34de jsr 534de <_Workspace_Allocate> if (the_message_queue->message_buffers == 0) 504ae: 588f addql #4,%sp return false; /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) 504b0: 2540 005c movel %d0,%a2@(92) _Workspace_Allocate( message_buffering_required ); if (the_message_queue->message_buffers == 0) 504b4: 67be beqs 50474 <_CORE_message_queue_Initialize+0x3c> /* * Initialize the pool of inactive messages, pending messages, * and set of waiting threads. */ _Chain_Initialize ( 504b6: 2f03 movel %d3,%sp@- allocated_message_size + sizeof( CORE_message_queue_Buffer_control ) ); _Chain_Initialize_empty( &the_message_queue->Pending_messages ); _Thread_queue_Initialize( 504b8: 7e01 moveq #1,%d7 /* * Initialize the pool of inactive messages, pending messages, * and set of waiting threads. */ _Chain_Initialize ( 504ba: 2f02 movel %d2,%sp@- 504bc: 2f00 movel %d0,%sp@- 504be: 486a 0068 pea %a2@(104) 504c2: 4eb9 0005 5e0c jsr 55e0c <_Chain_Initialize> allocated_message_size + sizeof( CORE_message_queue_Buffer_control ) ); _Chain_Initialize_empty( &the_message_queue->Pending_messages ); _Thread_queue_Initialize( 504c8: 4878 0006 pea 6 504cc: 206e 000c moveal %fp@(12),%a0 504d0: be90 cmpl %a0@,%d7 504d2: 57c0 seq %d0 504d4: 4878 0080 pea 80 504d8: 49c0 extbl %d0 504da: 4480 negl %d0 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 504dc: 41ea 0054 lea %a2@(84),%a0 504e0: 2f00 movel %d0,%sp@- 504e2: 2548 0050 movel %a0,%a2@(80) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); 504e6: 41ea 0050 lea %a2@(80),%a0 Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; 504ea: 42aa 0054 clrl %a2@(84) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); 504ee: 2548 0058 movel %a0,%a2@(88) 504f2: 2f0a movel %a2,%sp@- 504f4: 4eb9 0005 2b9c jsr 52b9c <_Thread_queue_Initialize> THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; 504fa: 4fef 0020 lea %sp@(32),%sp } 504fe: 4cee 04fc ffe4 moveml %fp@(-28),%d2-%d7/%a2 THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; 50504: 7001 moveq #1,%d0 } 50506: 4e5e unlk %fp ... =============================================================================== 00055e80 <_CORE_message_queue_Insert_message>: void _CORE_message_queue_Insert_message( CORE_message_queue_Control *the_message_queue, CORE_message_queue_Buffer_control *the_message, CORE_message_queue_Submit_types submit_type ) { 55e80: 4e56 fff4 linkw %fp,#-12 55e84: 226e 000c moveal %fp@(12),%a1 55e88: 202e 0010 movel %fp@(16),%d0 55e8c: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 55e90: 206e 0008 moveal %fp@(8),%a0 55e94: 2340 0008 movel %d0,%a1@(8) _CORE_message_queue_Append_unprotected(the_message_queue, the_message); else _CORE_message_queue_Prepend_unprotected(the_message_queue, the_message); _ISR_Enable( level ); #else if ( submit_type == CORE_MESSAGE_QUEUE_SEND_REQUEST ) { 55e98: 0c80 7fff ffff cmpil #2147483647,%d0 55e9e: 6700 0082 beqw 55f22 <_CORE_message_queue_Insert_message+0xa2> _ISR_Disable( level ); SET_NOTIFY(); the_message_queue->number_of_pending_messages++; _CORE_message_queue_Append_unprotected(the_message_queue, the_message); _ISR_Enable( level ); } else if ( submit_type == CORE_MESSAGE_QUEUE_URGENT_REQUEST ) { 55ea2: 0c80 8000 0000 cmpil #-2147483648,%d0 55ea8: 6700 00ae beqw 55f58 <_CORE_message_queue_Insert_message+0xd8> RTEMS_INLINE_ROUTINE bool _Chain_Is_tail( Chain_Control *the_chain, const Chain_Node *the_node ) { return (the_node == _Chain_Tail(the_chain)); 55eac: 2208 movel %a0,%d1 55eae: 0681 0000 0054 addil #84,%d1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 55eb4: 2468 0050 moveal %a0@(80),%a2 int the_priority; the_priority = _CORE_message_queue_Get_message_priority(the_message); the_header = &the_message_queue->Pending_messages; the_node = _Chain_First( the_header ); while ( !_Chain_Is_tail( the_header, the_node ) ) { 55eb8: b5c1 cmpal %d1,%a2 55eba: 6712 beqs 55ece <_CORE_message_queue_Insert_message+0x4e> this_message = (CORE_message_queue_Buffer_control *) the_node; this_priority = _CORE_message_queue_Get_message_priority(this_message); if ( this_priority <= the_priority ) { 55ebc: b0aa 0008 cmpl %a2@(8),%d0 55ec0: 6d0c blts 55ece <_CORE_message_queue_Insert_message+0x4e> the_node = the_node->next; 55ec2: 2452 moveal %a2@,%a2 int the_priority; the_priority = _CORE_message_queue_Get_message_priority(the_message); the_header = &the_message_queue->Pending_messages; the_node = _Chain_First( the_header ); while ( !_Chain_Is_tail( the_header, the_node ) ) { 55ec4: b5c1 cmpal %d1,%a2 55ec6: 6706 beqs 55ece <_CORE_message_queue_Insert_message+0x4e> this_message = (CORE_message_queue_Buffer_control *) the_node; this_priority = _CORE_message_queue_Get_message_priority(this_message); if ( this_priority <= the_priority ) { 55ec8: b0aa 0008 cmpl %a2@(8),%d0 55ecc: 6cf4 bges 55ec2 <_CORE_message_queue_Insert_message+0x42> the_node = the_node->next; continue; } break; } _ISR_Disable( level ); 55ece: 203c 0000 0700 movel #1792,%d0 55ed4: 40c1 movew %sr,%d1 55ed6: 8081 orl %d1,%d0 55ed8: 46c0 movew %d0,%sr SET_NOTIFY(); 55eda: 2028 0048 movel %a0@(72),%d0 the_message_queue->number_of_pending_messages++; 55ede: 2400 movel %d0,%d2 55ee0: 5282 addql #1,%d2 * * INTERRUPT LATENCY: * insert */ void _CORE_message_queue_Insert_message( 55ee2: 4a80 tstl %d0 55ee4: 57c0 seq %d0 break; } _ISR_Disable( level ); SET_NOTIFY(); the_message_queue->number_of_pending_messages++; _Chain_Insert_unprotected( the_node->previous, &the_message->Node ); 55ee6: 246a 0004 moveal %a2@(4),%a2 * * INTERRUPT LATENCY: * insert */ void _CORE_message_queue_Insert_message( 55eea: 4480 negl %d0 } break; } _ISR_Disable( level ); SET_NOTIFY(); the_message_queue->number_of_pending_messages++; 55eec: 2142 0048 movel %d2,%a0@(72) ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 55ef0: 2652 moveal %a2@,%a3 Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 55ef2: 234a 0004 movel %a2,%a1@(4) before_node = after_node->next; after_node->next = the_node; 55ef6: 2489 movel %a1,%a2@ the_node->next = before_node; before_node->previous = the_node; 55ef8: 2749 0004 movel %a1,%a3@(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; 55efc: 228b movel %a3,%a1@ _Chain_Insert_unprotected( the_node->previous, &the_message->Node ); _ISR_Enable( level ); 55efe: 46c1 movew %d1,%sr /* * According to POSIX, does this happen before or after the message * is actually enqueued. It is logical to think afterwards, because * the message is actually in the queue at this point. */ if ( notify && the_message_queue->notify_handler ) 55f00: 4a00 tstb %d0 55f02: 6716 beqs 55f1a <_CORE_message_queue_Insert_message+0x9a> 55f04: 2268 0060 moveal %a0@(96),%a1 55f08: 4a89 tstl %a1 55f0a: 670e beqs 55f1a <_CORE_message_queue_Insert_message+0x9a> (*the_message_queue->notify_handler)(the_message_queue->notify_argument); 55f0c: 2d68 0064 0008 movel %a0@(100),%fp@(8) #endif } 55f12: 4cd7 0c04 moveml %sp@,%d2/%a2-%a3 55f16: 4e5e unlk %fp * According to POSIX, does this happen before or after the message * is actually enqueued. It is logical to think afterwards, because * the message is actually in the queue at this point. */ if ( notify && the_message_queue->notify_handler ) (*the_message_queue->notify_handler)(the_message_queue->notify_argument); 55f18: 4ed1 jmp %a1@ #endif } 55f1a: 4cd7 0c04 moveml %sp@,%d2/%a2-%a3 55f1e: 4e5e unlk %fp 55f20: 4e75 rts else _CORE_message_queue_Prepend_unprotected(the_message_queue, the_message); _ISR_Enable( level ); #else if ( submit_type == CORE_MESSAGE_QUEUE_SEND_REQUEST ) { _ISR_Disable( level ); 55f22: 203c 0000 0700 movel #1792,%d0 55f28: 40c1 movew %sr,%d1 55f2a: 8081 orl %d1,%d0 55f2c: 46c0 movew %d0,%sr SET_NOTIFY(); 55f2e: 2028 0048 movel %a0@(72),%d0 the_message_queue->number_of_pending_messages++; 55f32: 2400 movel %d0,%d2 55f34: 5282 addql #1,%d2 RTEMS_INLINE_ROUTINE void _Chain_Append_unprotected( Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); 55f36: 47e8 0054 lea %a0@(84),%a3 * * INTERRUPT LATENCY: * insert */ void _CORE_message_queue_Insert_message( 55f3a: 4a80 tstl %d0 55f3c: 57c0 seq %d0 _ISR_Enable( level ); #else if ( submit_type == CORE_MESSAGE_QUEUE_SEND_REQUEST ) { _ISR_Disable( level ); SET_NOTIFY(); the_message_queue->number_of_pending_messages++; 55f3e: 2142 0048 movel %d2,%a0@(72) Chain_Node *old_last = tail->previous; 55f42: 2468 0058 moveal %a0@(88),%a2 * * INTERRUPT LATENCY: * insert */ void _CORE_message_queue_Insert_message( 55f46: 4480 negl %d0 RTEMS_INLINE_ROUTINE void _Chain_Append_unprotected( Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); 55f48: 228b movel %a3,%a1@ Chain_Node *old_last = tail->previous; the_node->next = tail; tail->previous = the_node; 55f4a: 2149 0058 movel %a1,%a0@(88) old_last->next = the_node; 55f4e: 2489 movel %a1,%a2@ the_node->previous = old_last; 55f50: 234a 0004 movel %a2,%a1@(4) if ( submit_type == CORE_MESSAGE_QUEUE_SEND_REQUEST ) { _ISR_Disable( level ); SET_NOTIFY(); the_message_queue->number_of_pending_messages++; _CORE_message_queue_Append_unprotected(the_message_queue, the_message); _ISR_Enable( level ); 55f54: 46c1 movew %d1,%sr 55f56: 60a8 bras 55f00 <_CORE_message_queue_Insert_message+0x80> } else if ( submit_type == CORE_MESSAGE_QUEUE_URGENT_REQUEST ) { _ISR_Disable( level ); 55f58: 203c 0000 0700 movel #1792,%d0 55f5e: 40c1 movew %sr,%d1 55f60: 8081 orl %d1,%d0 55f62: 46c0 movew %d0,%sr SET_NOTIFY(); 55f64: 2028 0048 movel %a0@(72),%d0 the_message_queue->number_of_pending_messages++; 55f68: 2400 movel %d0,%d2 55f6a: 5282 addql #1,%d2 RTEMS_INLINE_ROUTINE void _Chain_Prepend_unprotected( Chain_Control *the_chain, Chain_Node *the_node ) { _Chain_Insert_unprotected(_Chain_Head(the_chain), the_node); 55f6c: 47e8 0050 lea %a0@(80),%a3 * * INTERRUPT LATENCY: * insert */ void _CORE_message_queue_Insert_message( 55f70: 4a80 tstl %d0 55f72: 57c0 seq %d0 _CORE_message_queue_Append_unprotected(the_message_queue, the_message); _ISR_Enable( level ); } else if ( submit_type == CORE_MESSAGE_QUEUE_URGENT_REQUEST ) { _ISR_Disable( level ); SET_NOTIFY(); the_message_queue->number_of_pending_messages++; 55f74: 2142 0048 movel %d2,%a0@(72) ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 55f78: 2468 0050 moveal %a0@(80),%a2 * * INTERRUPT LATENCY: * insert */ void _CORE_message_queue_Insert_message( 55f7c: 4480 negl %d0 RTEMS_INLINE_ROUTINE void _Chain_Prepend_unprotected( Chain_Control *the_chain, Chain_Node *the_node ) { _Chain_Insert_unprotected(_Chain_Head(the_chain), the_node); 55f7e: 234b 0004 movel %a3,%a1@(4) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; after_node->next = the_node; 55f82: 2149 0050 movel %a1,%a0@(80) the_node->next = before_node; before_node->previous = the_node; 55f86: 2549 0004 movel %a1,%a2@(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; 55f8a: 228a movel %a2,%a1@ } else if ( submit_type == CORE_MESSAGE_QUEUE_URGENT_REQUEST ) { _ISR_Disable( level ); SET_NOTIFY(); the_message_queue->number_of_pending_messages++; _CORE_message_queue_Prepend_unprotected(the_message_queue, the_message); _ISR_Enable( level ); 55f8c: 46c1 movew %d1,%sr 55f8e: 6000 ff70 braw 55f00 <_CORE_message_queue_Insert_message+0x80> ... =============================================================================== 0005050c <_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 ); 5050c: 203c 0000 0700 movel #1792,%d0 void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 50512: 4e56 ffe4 linkw %fp,#-28 ISR_Level level; CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; 50516: 2279 0006 b032 moveal 6b032 <_Per_CPU_Information+0xc>,%a1 void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 5051c: 48d7 1c3c moveml %d2-%d5/%a2-%a4,%sp@ 50520: 246e 0008 moveal %fp@(8),%a2 50524: 2a2e 000c movel %fp@(12),%d5 50528: 262e 0010 movel %fp@(16),%d3 5052c: 206e 0014 moveal %fp@(20),%a0 50530: 286e 001c moveal %fp@(28),%a4 50534: 182e 001b moveb %fp@(27),%d4 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; 50538: 42a9 0034 clrl %a1@(52) _ISR_Disable( level ); 5053c: 40c1 movew %sr,%d1 5053e: 8081 orl %d1,%d0 50540: 46c0 movew %d0,%sr RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 50542: 240a movel %a2,%d2 50544: 200a movel %a2,%d0 50546: 0682 0000 0050 addil #80,%d2 5054c: 0680 0000 0054 addil #84,%d0 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 50552: 266a 0050 moveal %a2@(80),%a3 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 50556: b08b cmpl %a3,%d0 50558: 6700 0084 beqw 505de <_CORE_message_queue_Seize+0xd2> Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; 5055c: 2253 moveal %a3@,%a1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_first_unprotected( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); 5055e: 2342 0004 movel %d2,%a1@(4) the_message = _CORE_message_queue_Get_pending_message( the_message_queue ); if ( the_message != NULL ) { the_message_queue->number_of_pending_messages -= 1; 50562: 53aa 0048 subql #1,%a2@(72) Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; head->next = new_first; 50566: 2549 0050 movel %a1,%a2@(80) _ISR_Enable( level ); 5056a: 46c1 movew %d1,%sr *size_p = the_message->Contents.size; _Thread_Executing->Wait.count = 5056c: 2279 0006 b032 moveal 6b032 <_Per_CPU_Information+0xc>,%a1 _CORE_message_queue_Get_message_priority( the_message ); _CORE_message_queue_Copy_buffer( the_message->Contents.buffer, 50572: 240b movel %a3,%d2 50574: 0682 0000 0010 addil #16,%d2 const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 5057a: 49f9 0005 8b6c lea 58b6c ,%a4 the_message = _CORE_message_queue_Get_pending_message( the_message_queue ); if ( the_message != NULL ) { the_message_queue->number_of_pending_messages -= 1; _ISR_Enable( level ); *size_p = the_message->Contents.size; 50580: 20ab 000c movel %a3@(12),%a0@ _Thread_Executing->Wait.count = 50584: 236b 0008 0024 movel %a3@(8),%a1@(36) 5058a: 2f10 movel %a0@,%sp@- 5058c: 2f02 movel %d2,%sp@- 5058e: 2f03 movel %d3,%sp@- 50590: 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 ); 50592: 2f0a movel %a2,%sp@- 50594: 4eb9 0005 27a0 jsr 527a0 <_Thread_queue_Dequeue> if ( !the_thread ) { 5059a: 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 ); 5059e: 2040 moveal %d0,%a0 if ( !the_thread ) { 505a0: 4a80 tstl %d0 505a2: 6700 0088 beqw 5062c <_CORE_message_queue_Seize+0x120> */ _CORE_message_queue_Set_message_priority( the_message, the_thread->Wait.count ); the_message->Contents.size = (size_t) the_thread->Wait.option; 505a6: 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; 505aa: 2768 0024 0008 movel %a0@(36),%a3@(8) 505b0: 2740 000c movel %d0,%a3@(12) const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 505b4: 2f00 movel %d0,%sp@- 505b6: 2f28 002c movel %a0@(44),%sp@- 505ba: 2f02 movel %d2,%sp@- 505bc: 4e94 jsr %a4@ the_thread->Wait.return_argument_second.immutable_object, the_message->Contents.buffer, the_message->Contents.size ); _CORE_message_queue_Insert_message( 505be: 2d6b 0008 0010 movel %a3@(8),%fp@(16) 505c4: 4fef 000c lea %sp@(12),%sp 505c8: 2d4b 000c movel %a3,%fp@(12) 505cc: 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 ); } 505d0: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4 505d6: 4e5e unlk %fp the_thread->Wait.return_argument_second.immutable_object, the_message->Contents.buffer, the_message->Contents.size ); _CORE_message_queue_Insert_message( 505d8: 4ef9 0005 5e80 jmp 55e80 <_CORE_message_queue_Insert_message> return; } #endif } if ( !wait ) { 505de: 4a04 tstb %d4 505e0: 6612 bnes 505f4 <_CORE_message_queue_Seize+0xe8> _ISR_Enable( level ); 505e2: 46c1 movew %d1,%sr executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT; 505e4: 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 ); } 505e6: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4 #endif } if ( !wait ) { _ISR_Enable( level ); executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT; 505ec: 2340 0034 movel %d0,%a1@(52) executing->Wait.return_argument = size_p; /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); } 505f0: 4e5e unlk %fp 505f2: 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; 505f4: 7001 moveq #1,%d0 505f6: 2540 0030 movel %d0,%a2@(48) } _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue ); executing->Wait.queue = &the_message_queue->Wait_queue; executing->Wait.id = id; executing->Wait.return_argument_second.mutable_object = buffer; 505fa: 2343 002c movel %d3,%a1@(44) executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT; return; } _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue ); executing->Wait.queue = &the_message_queue->Wait_queue; 505fe: 234a 0044 movel %a2,%a1@(68) executing->Wait.id = id; 50602: 2345 0020 movel %d5,%a1@(32) executing->Wait.return_argument_second.mutable_object = buffer; executing->Wait.return_argument = size_p; 50606: 2348 0028 movel %a0,%a1@(40) /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); 5060a: 46c1 movew %d1,%sr _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); 5060c: 2d4c 000c movel %a4,%fp@(12) 50610: 203c 0005 2c98 movel #339096,%d0 50616: 2d4a 0008 movel %a2,%fp@(8) } 5061a: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4 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 ); 50620: 2d40 0010 movel %d0,%fp@(16) } 50624: 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 ); 50626: 4ef9 0005 2910 jmp 52910 <_Thread_queue_Enqueue_with_handler> RTEMS_INLINE_ROUTINE void _CORE_message_queue_Free_message_buffer ( CORE_message_queue_Control *the_message_queue, CORE_message_queue_Buffer_control *the_message ) { _Chain_Append( &the_message_queue->Inactive_messages, &the_message->Node ); 5062c: 45ea 0068 lea %a2@(104),%a2 50630: 2d4b 000c movel %a3,%fp@(12) 50634: 2d4a 0008 movel %a2,%fp@(8) } 50638: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4 5063e: 4e5e unlk %fp 50640: 4ef9 0005 036c jmp 5036c <_Chain_Append> ... =============================================================================== 000479ac <_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 ) { 479ac: 4e56 0000 linkw %fp,#0 479b0: 2f0a movel %a2,%sp@- 479b2: 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)) ) { 479b6: 2f0a movel %a2,%sp@- 479b8: 4eb9 0004 95a4 jsr 495a4 <_Thread_queue_Dequeue> 479be: 588f addql #4,%sp 479c0: 4a80 tstl %d0 479c2: 670a beqs 479ce <_CORE_semaphore_Surrender+0x22> status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); } return status; } 479c4: 246e fffc moveal %fp@(-4),%a2 { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 479c8: 4280 clrl %d0 status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); } return status; } 479ca: 4e5e unlk %fp 479cc: 4e75 rts if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_semaphore_mp_support) ( the_thread, id ); #endif } else { _ISR_Disable( level ); 479ce: 303c 0700 movew #1792,%d0 479d2: 40c1 movew %sr,%d1 479d4: 8081 orl %d1,%d0 479d6: 46c0 movew %d0,%sr if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 479d8: 202a 0048 movel %a2@(72),%d0 479dc: b0aa 0040 cmpl %a2@(64),%d0 479e0: 6412 bccs 479f4 <_CORE_semaphore_Surrender+0x48> <== NEVER TAKEN the_semaphore->count += 1; 479e2: 5280 addql #1,%d0 479e4: 2540 0048 movel %d0,%a2@(72) { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 479e8: 4280 clrl %d0 _ISR_Disable( level ); if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) the_semaphore->count += 1; else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); 479ea: 46c1 movew %d1,%sr } return status; } 479ec: 246e fffc moveal %fp@(-4),%a2 479f0: 4e5e unlk %fp 479f2: 4e75 rts } else { _ISR_Disable( level ); if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) the_semaphore->count += 1; else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; 479f4: 7004 moveq #4,%d0 <== NOT EXECUTED _ISR_Enable( level ); 479f6: 46c1 movew %d1,%sr <== NOT EXECUTED 479f8: 60f2 bras 479ec <_CORE_semaphore_Surrender+0x40> <== NOT EXECUTED ... =============================================================================== 0004cbfc <_Chain_Initialize>: Chain_Control *the_chain, void *starting_address, size_t number_nodes, size_t node_size ) { 4cbfc: 4e56 ffec linkw %fp,#-20 4cc00: 202e 0010 movel %fp@(16),%d0 4cc04: 48d7 043c moveml %d2-%d5/%a2,%sp@ 4cc08: 246e 0008 moveal %fp@(8),%a2 size_t count = number_nodes; Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 4cc0c: 280a movel %a2,%d4 4cc0e: 5884 addql #4,%d4 Chain_Control *the_chain, void *starting_address, size_t number_nodes, size_t node_size ) { 4cc10: 262e 000c movel %fp@(12),%d3 4cc14: 242e 0014 movel %fp@(20),%d2 Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *current = head; Chain_Node *next = starting_address; head->previous = NULL; 4cc18: 42aa 0004 clrl %a2@(4) while ( count-- ) { 4cc1c: 4a80 tstl %d0 4cc1e: 6740 beqs 4cc60 <_Chain_Initialize+0x64> <== NEVER TAKEN { size_t count = number_nodes; Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *current = head; Chain_Node *next = starting_address; 4cc20: 2043 moveal %d3,%a0 ) { size_t count = number_nodes; Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *current = head; 4cc22: 224a moveal %a2,%a1 Chain_Node *next = starting_address; head->previous = NULL; while ( count-- ) { 4cc24: 5380 subql #1,%d0 * node_size - size of node in bytes * * Output parameters: NONE */ void _Chain_Initialize( 4cc26: 2208 movel %a0,%d1 Chain_Node *current = head; Chain_Node *next = starting_address; head->previous = NULL; while ( count-- ) { 4cc28: 2a00 movel %d0,%d5 * node_size - size of node in bytes * * Output parameters: NONE */ void _Chain_Initialize( 4cc2a: d282 addl %d2,%d1 Chain_Node *next = starting_address; head->previous = NULL; while ( count-- ) { current->next = next; 4cc2c: 2288 movel %a0,%a1@ next->previous = current; 4cc2e: 2149 0004 movel %a1,%a0@(4) Chain_Node *current = head; Chain_Node *next = starting_address; head->previous = NULL; while ( count-- ) { 4cc32: 4a80 tstl %d0 4cc34: 6714 beqs 4cc4a <_Chain_Initialize+0x4e> 4cc36: 2248 moveal %a0,%a1 current->next = next; next->previous = current; current = next; next = (Chain_Node *) 4cc38: 2041 moveal %d1,%a0 * node_size - size of node in bytes * * Output parameters: NONE */ void _Chain_Initialize( 4cc3a: 2208 movel %a0,%d1 4cc3c: 5380 subql #1,%d0 4cc3e: d282 addl %d2,%d1 Chain_Node *next = starting_address; head->previous = NULL; while ( count-- ) { current->next = next; 4cc40: 2288 movel %a0,%a1@ next->previous = current; 4cc42: 2149 0004 movel %a1,%a0@(4) Chain_Node *current = head; Chain_Node *next = starting_address; head->previous = NULL; while ( count-- ) { 4cc46: 4a80 tstl %d0 4cc48: 66ec bnes 4cc36 <_Chain_Initialize+0x3a> * node_size - size of node in bytes * * Output parameters: NONE */ void _Chain_Initialize( 4cc4a: 4c05 2800 mulsl %d5,%d2 Chain_Node *current = head; Chain_Node *next = starting_address; head->previous = NULL; while ( count-- ) { 4cc4e: 2043 moveal %d3,%a0 4cc50: d1c2 addal %d2,%a0 current = next; next = (Chain_Node *) _Addresses_Add_offset( (void *) next, node_size ); } current->next = tail; 4cc52: 2084 movel %d4,%a0@ tail->previous = current; 4cc54: 2548 0008 movel %a0,%a2@(8) } 4cc58: 4cd7 043c moveml %sp@,%d2-%d5/%a2 4cc5c: 4e5e unlk %fp 4cc5e: 4e75 rts ) { size_t count = number_nodes; Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *current = head; 4cc60: 204a moveal %a2,%a0 <== NOT EXECUTED current = next; next = (Chain_Node *) _Addresses_Add_offset( (void *) next, node_size ); } current->next = tail; 4cc62: 2084 movel %d4,%a0@ <== NOT EXECUTED tail->previous = current; 4cc64: 2548 0008 movel %a0,%a2@(8) <== NOT EXECUTED } 4cc68: 4cd7 043c moveml %sp@,%d2-%d5/%a2 <== NOT EXECUTED 4cc6c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004661c <_Event_Surrender>: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; option_set = (rtems_option) the_thread->Wait.option; _ISR_Disable( level ); 4661c: 203c 0000 0700 movel #1792,%d0 */ void _Event_Surrender( Thread_Control *the_thread ) { 46622: 4e56 ffec linkw %fp,#-20 46626: 48d7 043c moveml %d2-%d5/%a2,%sp@ 4662a: 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 ]; 4662e: 206a 00fe moveal %a2@(254),%a0 option_set = (rtems_option) the_thread->Wait.option; 46632: 282a 0030 movel %a2@(48),%d4 _ISR_Disable( level ); 46636: 40c3 movew %sr,%d3 46638: 8083 orl %d3,%d0 4663a: 46c0 movew %d0,%sr pending_events = api->pending_events; event_condition = (rtems_event_set) the_thread->Wait.count; 4663c: 222a 0024 movel %a2@(36),%d1 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 ); 46640: 2001 movel %d1,%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; 46642: 2410 movel %a0@,%d2 46644: 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 ) ) { 46646: 6700 00ac beqw 466f4 <_Event_Surrender+0xd8> /* * 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() && 4664a: 4ab9 0006 14a6 tstl 614a6 <_Per_CPU_Information+0x8> 46650: 6708 beqs 4665a <_Event_Surrender+0x3e> 46652: b5f9 0006 14aa cmpal 614aa <_Per_CPU_Information+0xc>,%a2 46658: 675c beqs 466b6 <_Event_Surrender+0x9a> */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_for_event ( States_Control the_states ) { return (the_states & STATES_WAITING_FOR_EVENT); 4665a: 2a2a 0010 movel %a2@(16),%d5 4665e: 0285 0000 0100 andil #256,%d5 } /* * Otherwise, this is a normal send to another thread */ if ( _States_Is_waiting_for_event( the_thread->current_state ) ) { 46664: 6700 008e beqw 466f4 <_Event_Surrender+0xd8> if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { 46668: b081 cmpl %d1,%d0 4666a: 6708 beqs 46674 <_Event_Surrender+0x58> 4666c: 0804 0001 btst #1,%d4 46670: 6700 0082 beqw 466f4 <_Event_Surrender+0xd8> RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Clear( rtems_event_set the_event_set, rtems_event_set the_mask ) { return ( the_event_set & ~(the_mask) ); 46674: 2200 movel %d0,%d1 46676: 4681 notl %d1 46678: c282 andl %d2,%d1 4667a: 2081 movel %d1,%a0@ api->pending_events = _Event_sets_Clear( pending_events, seized_events ); the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 4667c: 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; 46680: 42aa 0024 clrl %a2@(36) *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 46684: 2080 movel %d0,%a0@ _ISR_Flash( level ); 46686: 203c 0000 0700 movel #1792,%d0 4668c: 46c3 movew %d3,%sr 4668e: 8083 orl %d3,%d0 46690: 46c0 movew %d0,%sr if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 46692: 7a02 moveq #2,%d5 46694: baaa 0050 cmpl %a2@(80),%d5 46698: 6766 beqs 46700 <_Event_Surrender+0xe4> _ISR_Enable( level ); 4669a: 46c3 movew %d3,%sr RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 4669c: 2f3c 1003 fff8 movel #268697592,%sp@- 466a2: 2f0a movel %a2,%sp@- 466a4: 4eb9 0004 8e1c jsr 48e1c <_Thread_Clear_state> 466aa: 508f addql #8,%sp } return; } } _ISR_Enable( level ); } 466ac: 4cee 043c ffec moveml %fp@(-20),%d2-%d5/%a2 466b2: 4e5e unlk %fp 466b4: 4e75 rts * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 466b6: 2279 0006 1884 moveal 61884 <_Event_Sync_state>,%a1 /* * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) && 466bc: 7a02 moveq #2,%d5 466be: ba89 cmpl %a1,%d5 466c0: 670e beqs 466d0 <_Event_Surrender+0xb4> <== NEVER TAKEN ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { 466c2: 2279 0006 1884 moveal 61884 <_Event_Sync_state>,%a1 * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 466c8: 1a3c 0001 moveb #1,%d5 466cc: ba89 cmpl %a1,%d5 466ce: 668a bnes 4665a <_Event_Surrender+0x3e> (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { 466d0: b081 cmpl %d1,%d0 466d2: 6706 beqs 466da <_Event_Surrender+0xbe> 466d4: 0804 0001 btst #1,%d4 466d8: 671a beqs 466f4 <_Event_Surrender+0xd8> <== NEVER TAKEN 466da: 2200 movel %d0,%d1 466dc: 4681 notl %d1 466de: c282 andl %d2,%d1 466e0: 2081 movel %d1,%a0@ api->pending_events = _Event_sets_Clear( pending_events,seized_events ); the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 466e2: 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; 466e6: 42aa 0024 clrl %a2@(36) *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 466ea: 2080 movel %d0,%a0@ _Event_Sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 466ec: 7003 moveq #3,%d0 466ee: 23c0 0006 1884 movel %d0,61884 <_Event_Sync_state> _Thread_Unblock( the_thread ); } return; } } _ISR_Enable( level ); 466f4: 46c3 movew %d3,%sr } 466f6: 4cee 043c ffec moveml %fp@(-20),%d2-%d5/%a2 466fc: 4e5e unlk %fp 466fe: 4e75 rts RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 46700: 7003 moveq #3,%d0 46702: 2540 0050 movel %d0,%a2@(80) if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { _ISR_Enable( level ); _Thread_Unblock( the_thread ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 46706: 46c3 movew %d3,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 46708: 486a 0048 pea %a2@(72) 4670c: 4eb9 0004 a160 jsr 4a160 <_Watchdog_Remove> 46712: 2f3c 1003 fff8 movel #268697592,%sp@- 46718: 2f0a movel %a2,%sp@- 4671a: 4eb9 0004 8e1c jsr 48e1c <_Thread_Clear_state> 46720: 4fef 000c lea %sp@(12),%sp } return; } } _ISR_Enable( level ); } 46724: 4cee 043c ffec moveml %fp@(-20),%d2-%d5/%a2 4672a: 4e5e unlk %fp ... =============================================================================== 00046730 <_Event_Timeout>: void _Event_Timeout( Objects_Id id, void *ignored ) { 46730: 4e56 fffc linkw %fp,#-4 46734: 2f03 movel %d3,%sp@- 46736: 2f02 movel %d2,%sp@- Thread_Control *the_thread; Objects_Locations location; ISR_Level level; the_thread = _Thread_Get( id, &location ); 46738: 486e fffc pea %fp@(-4) 4673c: 2f2e 0008 movel %fp@(8),%sp@- 46740: 4eb9 0004 9240 jsr 49240 <_Thread_Get> switch ( location ) { 46746: 508f addql #8,%sp 46748: 4aae fffc tstl %fp@(-4) 4674c: 6648 bnes 46796 <_Event_Timeout+0x66> <== 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 ); 4674e: 223c 0000 0700 movel #1792,%d1 46754: 40c2 movew %sr,%d2 46756: 8282 orl %d2,%d1 46758: 46c1 movew %d1,%sr _ISR_Enable( level ); return; } #endif the_thread->Wait.count = 0; 4675a: 2040 moveal %d0,%a0 4675c: 42a8 0024 clrl %a0@(36) if ( _Thread_Is_executing( the_thread ) ) { 46760: b0b9 0006 14aa cmpl 614aa <_Per_CPU_Information+0xc>,%d0 46766: 673a beqs 467a2 <_Event_Timeout+0x72> if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) _Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; } the_thread->Wait.return_code = RTEMS_TIMEOUT; 46768: 7606 moveq #6,%d3 4676a: 2040 moveal %d0,%a0 4676c: 2143 0034 movel %d3,%a0@(52) _ISR_Enable( level ); 46770: 46c2 movew %d2,%sr 46772: 2f3c 1003 fff8 movel #268697592,%sp@- 46778: 2f00 movel %d0,%sp@- 4677a: 4eb9 0004 8e1c jsr 48e1c <_Thread_Clear_state> * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { _Thread_Dispatch_disable_level--; return _Thread_Dispatch_disable_level; 46780: 508f addql #8,%sp * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { _Thread_Dispatch_disable_level--; 46782: 2039 0006 1048 movel 61048 <_Thread_Dispatch_disable_level>,%d0 46788: 5380 subql #1,%d0 4678a: 23c0 0006 1048 movel %d0,61048 <_Thread_Dispatch_disable_level> return _Thread_Dispatch_disable_level; 46790: 2039 0006 1048 movel 61048 <_Thread_Dispatch_disable_level>,%d0 case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 46796: 242e fff4 movel %fp@(-12),%d2 4679a: 262e fff8 movel %fp@(-8),%d3 4679e: 4e5e unlk %fp 467a0: 4e75 rts } #endif the_thread->Wait.count = 0; if ( _Thread_Is_executing( the_thread ) ) { if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 467a2: 2239 0006 1884 movel 61884 <_Event_Sync_state>,%d1 467a8: 7601 moveq #1,%d3 467aa: b681 cmpl %d1,%d3 467ac: 66ba bnes 46768 <_Event_Timeout+0x38> _Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; } the_thread->Wait.return_code = RTEMS_TIMEOUT; 467ae: 7606 moveq #6,%d3 467b0: 2040 moveal %d0,%a0 #endif the_thread->Wait.count = 0; if ( _Thread_Is_executing( the_thread ) ) { if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) _Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 467b2: 7202 moveq #2,%d1 } the_thread->Wait.return_code = RTEMS_TIMEOUT; 467b4: 2143 0034 movel %d3,%a0@(52) #endif the_thread->Wait.count = 0; if ( _Thread_Is_executing( the_thread ) ) { if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) _Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 467b8: 23c1 0006 1884 movel %d1,61884 <_Event_Sync_state> } the_thread->Wait.return_code = RTEMS_TIMEOUT; _ISR_Enable( level ); 467be: 46c2 movew %d2,%sr RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 467c0: 2f3c 1003 fff8 movel #268697592,%sp@- 467c6: 2f00 movel %d0,%sp@- 467c8: 4eb9 0004 8e1c jsr 48e1c <_Thread_Clear_state> * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { _Thread_Dispatch_disable_level--; return _Thread_Dispatch_disable_level; 467ce: 508f addql #8,%sp * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { _Thread_Dispatch_disable_level--; 467d0: 2039 0006 1048 movel 61048 <_Thread_Dispatch_disable_level>,%d0 467d6: 5380 subql #1,%d0 467d8: 23c0 0006 1048 movel %d0,61048 <_Thread_Dispatch_disable_level> return _Thread_Dispatch_disable_level; 467de: 2039 0006 1048 movel 61048 <_Thread_Dispatch_disable_level>,%d0 467e4: 60b0 bras 46796 <_Event_Timeout+0x66> ... =============================================================================== 0004ce00 <_Heap_Allocate_aligned_with_boundary>: Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 4ce00: 4e56 ffcc linkw %fp,#-52 4ce04: 226e 000c moveal %fp@(12),%a1 4ce08: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 4ce0c: 246e 0008 moveal %fp@(8),%a2 Heap_Statistics *const stats = &heap->stats; uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE 4ce10: 2c09 movel %a1,%d6 4ce12: 5886 addql #4,%d6 - HEAP_ALLOC_BONUS; uintptr_t const page_size = heap->page_size; 4ce14: 202a 0010 movel %a2@(16),%d0 Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 4ce18: 222e 0010 movel %fp@(16),%d1 4ce1c: 282e 0014 movel %fp@(20),%d4 Heap_Statistics *const stats = &heap->stats; uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE - HEAP_ALLOC_BONUS; uintptr_t const page_size = heap->page_size; 4ce20: 2d40 fffc movel %d0,%fp@(-4) Heap_Block *block = NULL; uintptr_t alloc_begin = 0; uint32_t search_count = 0; bool search_again = false; if ( block_size_floor < alloc_size ) { 4ce24: bc89 cmpl %a1,%d6 4ce26: 6500 0148 bcsw 4cf70 <_Heap_Allocate_aligned_with_boundary+0x170> /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { 4ce2a: 4a84 tstl %d4 4ce2c: 670c beqs 4ce3a <_Heap_Allocate_aligned_with_boundary+0x3a> if ( boundary < alloc_size ) { 4ce2e: b889 cmpl %a1,%d4 4ce30: 6500 013e bcsw 4cf70 <_Heap_Allocate_aligned_with_boundary+0x170> return NULL; } if ( alignment == 0 ) { 4ce34: 4a81 tstl %d1 4ce36: 6602 bnes 4ce3a <_Heap_Allocate_aligned_with_boundary+0x3a> alignment = page_size; 4ce38: 2200 movel %d0,%d1 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 4ce3a: 206a 0008 moveal %a2@(8),%a0 do { Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); block = _Heap_Free_list_first( heap ); while ( block != free_list_tail ) { 4ce3e: 4283 clrl %d3 4ce40: b1ca cmpal %a2,%a0 4ce42: 6732 beqs 4ce76 <_Heap_Allocate_aligned_with_boundary+0x76> uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size 4ce44: 242e fffc movel %fp@(-4),%d2 + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS; 4ce48: 7a04 moveq #4,%d5 uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size 4ce4a: 5e82 addql #7,%d2 + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS; 4ce4c: 9a89 subl %a1,%d5 uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size 4ce4e: 2d42 fff8 movel %d2,%fp@(-8) + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS; 4ce52: 2d45 fff4 movel %d5,%fp@(-12) /* * The HEAP_PREV_BLOCK_USED flag is always set in the block size_and_flag * field. Thus the value is about one unit larger than the real block * size. The greater than operator takes this into account. */ if ( block->size_and_flag > block_size_floor ) { 4ce56: 2028 0004 movel %a0@(4),%d0 4ce5a: b086 cmpl %d6,%d0 4ce5c: 6330 blss 4ce8e <_Heap_Allocate_aligned_with_boundary+0x8e> if ( alignment == 0 ) { 4ce5e: 4a81 tstl %d1 4ce60: 6638 bnes 4ce9a <_Heap_Allocate_aligned_with_boundary+0x9a> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 4ce62: 2408 movel %a0,%d2 4ce64: 5082 addql #8,%d2 ); } } /* Statistics */ ++search_count; 4ce66: 5283 addql #1,%d3 if ( alloc_begin != 0 ) { 4ce68: 4a82 tstl %d2 4ce6a: 6600 00e6 bnew 4cf52 <_Heap_Allocate_aligned_with_boundary+0x152> break; } block = block->next; 4ce6e: 2068 0008 moveal %a0@(8),%a0 do { Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); block = _Heap_Free_list_first( heap ); while ( block != free_list_tail ) { 4ce72: b1ca cmpal %a2,%a0 4ce74: 66e0 bnes 4ce56 <_Heap_Allocate_aligned_with_boundary+0x56> 4ce76: 4282 clrl %d2 boundary ); } /* Statistics */ if ( stats->max_search < search_count ) { 4ce78: b6aa 0044 cmpl %a2@(68),%d3 4ce7c: 6304 blss 4ce82 <_Heap_Allocate_aligned_with_boundary+0x82> stats->max_search = search_count; 4ce7e: 2543 0044 movel %d3,%a2@(68) } return (void *) alloc_begin; 4ce82: 2002 movel %d2,%d0 } 4ce84: 4cee 3cfc ffcc moveml %fp@(-52),%d2-%d7/%a2-%a5 4ce8a: 4e5e unlk %fp 4ce8c: 4e75 rts if ( alloc_begin != 0 ) { break; } block = block->next; 4ce8e: 2068 0008 moveal %a0@(8),%a0 ); } } /* Statistics */ ++search_count; 4ce92: 5283 addql #1,%d3 do { Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); block = _Heap_Free_list_first( heap ); while ( block != free_list_tail ) { 4ce94: b1ca cmpal %a2,%a0 4ce96: 66be bnes 4ce56 <_Heap_Allocate_aligned_with_boundary+0x56> 4ce98: 60dc bras 4ce76 <_Heap_Allocate_aligned_with_boundary+0x76> - 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; 4ce9a: 7efe moveq #-2,%d7 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 4ce9c: 4be8 0008 lea %a0@(8),%a5 - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 4cea0: c087 andl %d7,%d0 if ( stats->max_search < search_count ) { stats->max_search = search_count; } return (void *) alloc_begin; } 4cea2: 286a 0014 moveal %a2@(20),%a4 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; 4cea6: d088 addl %a0,%d0 uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; 4cea8: 2a2e fff8 movel %fp@(-8),%d5 4ceac: 9a8c subl %a4,%d5 uintptr_t alloc_end = block_end + HEAP_ALLOC_BONUS; uintptr_t alloc_begin = alloc_end - alloc_size; 4ceae: 242e fff4 movel %fp@(-12),%d2 4ceb2: d480 addl %d0,%d2 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4ceb4: 2e02 movel %d2,%d7 uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size 4ceb6: d085 addl %d5,%d0 4ceb8: 4c41 7005 remul %d1,%d5,%d7 4cebc: 9485 subl %d5,%d2 uintptr_t alloc_begin = alloc_end - alloc_size; alloc_begin = _Heap_Align_down( alloc_begin, alignment ); /* Ensure that the we have a valid new block at the end */ if ( alloc_begin > alloc_begin_ceiling ) { 4cebe: b480 cmpl %d0,%d2 4cec0: 630a blss 4cecc <_Heap_Allocate_aligned_with_boundary+0xcc> 4cec2: 2a00 movel %d0,%d5 4cec4: 4c41 5002 remul %d1,%d2,%d5 4cec8: 9082 subl %d2,%d0 4ceca: 2400 movel %d0,%d2 } alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { 4cecc: 4a84 tstl %d4 4cece: 6756 beqs 4cf26 <_Heap_Allocate_aligned_with_boundary+0x126> /* Ensure that the we have a valid new block at the end */ if ( alloc_begin > alloc_begin_ceiling ) { alloc_begin = _Heap_Align_down( alloc_begin_ceiling, alignment ); } alloc_end = alloc_begin + alloc_size; 4ced0: 2002 movel %d2,%d0 4ced2: d089 addl %a1,%d0 4ced4: 2e00 movel %d0,%d7 4ced6: 4c44 7005 remul %d4,%d5,%d7 4ceda: 2e00 movel %d0,%d7 4cedc: 9e85 subl %d5,%d7 4cede: 2a07 movel %d7,%d5 /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { 4cee0: be82 cmpl %d2,%d7 4cee2: 6342 blss 4cf26 <_Heap_Allocate_aligned_with_boundary+0x126> 4cee4: be80 cmpl %d0,%d7 4cee6: 643e bccs 4cf26 <_Heap_Allocate_aligned_with_boundary+0x126> alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; 4cee8: 2e0d movel %a5,%d7 4ceea: de89 addl %a1,%d7 uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { if ( boundary_line < boundary_floor ) { 4ceec: ba87 cmpl %d7,%d5 4ceee: 652a bcss 4cf1a <_Heap_Allocate_aligned_with_boundary+0x11a> 4cef0: 2647 moveal %d7,%a3 return 0; } alloc_begin = boundary_line - alloc_size; 4cef2: 2405 movel %d5,%d2 4cef4: 9489 subl %a1,%d2 4cef6: 2a02 movel %d2,%d5 4cef8: 4c41 5000 remul %d1,%d0,%d5 4cefc: 9480 subl %d0,%d2 alloc_begin = _Heap_Align_down( alloc_begin, alignment ); alloc_end = alloc_begin + alloc_size; 4cefe: 2002 movel %d2,%d0 4cf00: d089 addl %a1,%d0 4cf02: 2e00 movel %d0,%d7 4cf04: 4c44 7005 remul %d4,%d5,%d7 4cf08: 2e00 movel %d0,%d7 4cf0a: 9e85 subl %d5,%d7 4cf0c: 2a07 movel %d7,%d5 /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { 4cf0e: be82 cmpl %d2,%d7 4cf10: 6314 blss 4cf26 <_Heap_Allocate_aligned_with_boundary+0x126> 4cf12: be80 cmpl %d0,%d7 4cf14: 6410 bccs 4cf26 <_Heap_Allocate_aligned_with_boundary+0x126> if ( boundary_line < boundary_floor ) { 4cf16: ba8b cmpl %a3,%d5 4cf18: 64d8 bccs 4cef2 <_Heap_Allocate_aligned_with_boundary+0xf2><== ALWAYS TAKEN if ( free_size >= min_block_size || free_size == 0 ) { return alloc_begin; } } return 0; 4cf1a: 4282 clrl %d2 ); } } /* Statistics */ ++search_count; 4cf1c: 5283 addql #1,%d3 if ( alloc_begin != 0 ) { 4cf1e: 4a82 tstl %d2 4cf20: 6700 ff4c beqw 4ce6e <_Heap_Allocate_aligned_with_boundary+0x6e> 4cf24: 602c bras 4cf52 <_Heap_Allocate_aligned_with_boundary+0x152><== NOT EXECUTED 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 ) { 4cf26: b48d cmpl %a5,%d2 4cf28: 65f0 bcss 4cf1a <_Heap_Allocate_aligned_with_boundary+0x11a> 4cf2a: 70f8 moveq #-8,%d0 4cf2c: 9088 subl %a0,%d0 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 4cf2e: 2a40 moveal %d0,%a5 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4cf30: 2e02 movel %d2,%d7 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 4cf32: dbc2 addal %d2,%a5 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4cf34: 202e fffc movel %fp@(-4),%d0 4cf38: 4c40 7005 remul %d0,%d5,%d7 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; 4cf3c: 9bc5 subal %d5,%a5 if ( free_size >= min_block_size || free_size == 0 ) { 4cf3e: bbcc cmpal %a4,%a5 4cf40: 6400 ff24 bccw 4ce66 <_Heap_Allocate_aligned_with_boundary+0x66> return alloc_begin; } } return 0; 4cf44: 4a8d tstl %a5 4cf46: 57c0 seq %d0 ); } } /* Statistics */ ++search_count; 4cf48: 5283 addql #1,%d3 if ( free_size >= min_block_size || free_size == 0 ) { return alloc_begin; } } return 0; 4cf4a: 49c0 extbl %d0 4cf4c: c480 andl %d0,%d2 } /* Statistics */ ++search_count; if ( alloc_begin != 0 ) { 4cf4e: 6700 ff1e beqw 4ce6e <_Heap_Allocate_aligned_with_boundary+0x6e> if ( alloc_begin != 0 ) { /* Statistics */ ++stats->allocs; stats->searches += search_count; block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 4cf52: 2f09 movel %a1,%sp@- search_again = _Heap_Protection_free_delayed_blocks( heap, alloc_begin ); } while ( search_again ); if ( alloc_begin != 0 ) { /* Statistics */ ++stats->allocs; 4cf54: 52aa 0048 addql #1,%a2@(72) stats->searches += search_count; 4cf58: d7aa 004c addl %d3,%a2@(76) block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 4cf5c: 2f02 movel %d2,%sp@- 4cf5e: 2f08 movel %a0,%sp@- 4cf60: 2f0a movel %a2,%sp@- 4cf62: 4eb9 0004 7dac jsr 47dac <_Heap_Block_allocate> 4cf68: 4fef 0010 lea %sp@(16),%sp 4cf6c: 6000 ff0a braw 4ce78 <_Heap_Allocate_aligned_with_boundary+0x78> return NULL; } if ( boundary != 0 ) { if ( boundary < alloc_size ) { return NULL; 4cf70: 4280 clrl %d0 if ( stats->max_search < search_count ) { stats->max_search = search_count; } return (void *) alloc_begin; } 4cf72: 4cee 3cfc ffcc moveml %fp@(-52),%d2-%d7/%a2-%a5 4cf78: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004cf30 <_Heap_Extend>: Heap_Control *heap, void *extend_area_begin_ptr, uintptr_t extend_area_size, uintptr_t *extended_size_ptr ) { 4cf30: 4e56 ffcc linkw %fp,#-52 4cf34: 202e 0010 movel %fp@(16),%d0 4cf38: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 4cf3c: 246e 0008 moveal %fp@(8),%a2 4cf40: 242e 000c movel %fp@(12),%d2 Heap_Block *extend_first_block = NULL; Heap_Block *extend_last_block = NULL; uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; uintptr_t const extend_area_begin = (uintptr_t) extend_area_begin_ptr; uintptr_t const extend_area_end = extend_area_begin + extend_area_size; 4cf44: 2602 movel %d2,%d3 4cf46: d680 addl %d0,%d3 uintptr_t extend_area_size, uintptr_t *extended_size_ptr ) { Heap_Statistics *const stats = &heap->stats; Heap_Block *const first_block = heap->first_block; 4cf48: 2a2a 0020 movel %a2@(32),%d5 Heap_Block *merge_above_block = NULL; Heap_Block *link_below_block = NULL; Heap_Block *link_above_block = NULL; Heap_Block *extend_first_block = NULL; Heap_Block *extend_last_block = NULL; uintptr_t const page_size = heap->page_size; 4cf4c: 282a 0010 movel %a2@(16),%d4 uintptr_t const min_block_size = heap->min_block_size; 4cf50: 222a 0014 movel %a2@(20),%d1 uintptr_t const extend_area_begin = (uintptr_t) extend_area_begin_ptr; uintptr_t const extend_area_end = extend_area_begin + extend_area_size; uintptr_t const free_size = stats->free_size; 4cf54: 2c2a 0030 movel %a2@(48),%d6 Heap_Block *start_block = first_block; Heap_Block *merge_below_block = NULL; Heap_Block *merge_above_block = NULL; Heap_Block *link_below_block = NULL; Heap_Block *link_above_block = NULL; Heap_Block *extend_first_block = NULL; 4cf58: 42ae fff8 clrl %fp@(-8) Heap_Block *extend_last_block = NULL; 4cf5c: 42ae fffc clrl %fp@(-4) uintptr_t const free_size = stats->free_size; uintptr_t extend_first_block_size = 0; uintptr_t extended_size = 0; bool extend_area_ok = false; if ( extend_area_end < extend_area_begin ) { 4cf60: b682 cmpl %d2,%d3 4cf62: 640c bccs 4cf70 <_Heap_Extend+0x40> if ( extended_size_ptr != NULL ) *extended_size_ptr = extended_size; return true; } 4cf64: 4cee 3cfc ffcc moveml %fp@(-52),%d2-%d7/%a2-%a5 _Heap_Block_of_alloc_area( sub_area_end, page_size ); if ( sub_area_end > extend_area_begin && extend_area_end > sub_area_begin ) { return false; 4cf6a: 4200 clrb %d0 if ( extended_size_ptr != NULL ) *extended_size_ptr = extended_size; return true; } 4cf6c: 4e5e unlk %fp 4cf6e: 4e75 rts if ( extend_area_end < extend_area_begin ) { return false; } extend_area_ok = _Heap_Get_first_and_last_block( 4cf70: 486e fffc pea %fp@(-4) 4cf74: 486e fff8 pea %fp@(-8) 4cf78: 2f01 movel %d1,%sp@- 4cf7a: 2f04 movel %d4,%sp@- 4cf7c: 2f00 movel %d0,%sp@- 4cf7e: 2f02 movel %d2,%sp@- 4cf80: 4eb9 0004 7bd0 jsr 47bd0 <_Heap_Get_first_and_last_block> page_size, min_block_size, &extend_first_block, &extend_last_block ); if (!extend_area_ok ) { 4cf86: 4fef 0018 lea %sp@(24),%sp 4cf8a: 4a00 tstb %d0 4cf8c: 67d6 beqs 4cf64 <_Heap_Extend+0x34> 4cf8e: 2045 moveal %d5,%a0 4cf90: 9bcd subal %a5,%a5 4cf92: 97cb subal %a3,%a3 4cf94: 99cc subal %a4,%a4 4cf96: 42ae fff4 clrl %fp@(-12) return false; } do { uintptr_t const sub_area_begin = (start_block != first_block) ? (uintptr_t) start_block : heap->area_begin; 4cf9a: ba88 cmpl %a0,%d5 4cf9c: 6700 0148 beqw 4d0e6 <_Heap_Extend+0x1b6> 4cfa0: 2208 movel %a0,%d1 uintptr_t const sub_area_end = start_block->prev_size; 4cfa2: 2010 movel %a0@,%d0 Heap_Block *const end_block = _Heap_Block_of_alloc_area( sub_area_end, page_size ); if ( 4cfa4: b082 cmpl %d2,%d0 4cfa6: 6304 blss 4cfac <_Heap_Extend+0x7c> sub_area_end > extend_area_begin && extend_area_end > sub_area_begin 4cfa8: b681 cmpl %d1,%d3 4cfaa: 62b8 bhis 4cf64 <_Heap_Extend+0x34> <== NEVER TAKEN ) { return false; } if ( extend_area_end == sub_area_begin ) { 4cfac: b681 cmpl %d1,%d3 4cfae: 6700 0130 beqw 4d0e0 <_Heap_Extend+0x1b0> merge_below_block = start_block; } else if ( extend_area_end < sub_area_end ) { 4cfb2: b083 cmpl %d3,%d0 4cfb4: 6304 blss 4cfba <_Heap_Extend+0x8a> 4cfb6: 2d48 fff4 movel %a0,%fp@(-12) 4cfba: 2e00 movel %d0,%d7 4cfbc: 2240 moveal %d0,%a1 4cfbe: 5189 subql #8,%a1 4cfc0: 4c44 7001 remul %d4,%d1,%d7 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 4cfc4: 93c1 subal %d1,%a1 link_below_block = start_block; } if ( sub_area_end == extend_area_begin ) { 4cfc6: b480 cmpl %d0,%d2 4cfc8: 6700 00fe beqw 4d0c8 <_Heap_Extend+0x198> start_block->prev_size = extend_area_end; merge_above_block = end_block; } else if ( sub_area_end < extend_area_begin ) { 4cfcc: b082 cmpl %d2,%d0 4cfce: 6402 bccs 4cfd2 <_Heap_Extend+0xa2> 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 ) 4cfd0: 2a49 moveal %a1,%a5 - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 4cfd2: 70fe moveq #-2,%d0 4cfd4: c0a9 0004 andl %a1@(4),%d0 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4cfd8: 41f1 0800 lea %a1@(00000000,%d0:l),%a0 link_above_block = end_block; } start_block = _Heap_Block_at( end_block, _Heap_Block_size( end_block ) ); } while ( start_block != first_block ); 4cfdc: b1c5 cmpal %d5,%a0 4cfde: 66ba bnes 4cf9a <_Heap_Extend+0x6a> if ( extend_area_begin < heap->area_begin ) { 4cfe0: b4aa 0018 cmpl %a2@(24),%d2 4cfe4: 6500 0108 bcsw 4d0ee <_Heap_Extend+0x1be> heap->area_begin = extend_area_begin; } else if ( heap->area_end < extend_area_end ) { 4cfe8: b6aa 001c cmpl %a2@(28),%d3 4cfec: 6304 blss 4cff2 <_Heap_Extend+0xc2> heap->area_end = extend_area_end; 4cfee: 2543 001c movel %d3,%a2@(28) } extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; 4cff2: 226e fffc moveal %fp@(-4),%a1 heap->area_begin = extend_area_begin; } else if ( heap->area_end < extend_area_end ) { heap->area_end = extend_area_end; } extend_first_block_size = 4cff6: 2009 movel %a1,%d0 (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; extend_first_block->prev_size = extend_area_end; extend_first_block->size_and_flag = extend_first_block_size | HEAP_PREV_BLOCK_USED; 4cff8: 7201 moveq #1,%d1 } else if ( heap->area_end < extend_area_end ) { heap->area_end = extend_area_end; } extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; 4cffa: 206e fff8 moveal %fp@(-8),%a0 heap->area_begin = extend_area_begin; } else if ( heap->area_end < extend_area_end ) { heap->area_end = extend_area_end; } extend_first_block_size = 4cffe: 9088 subl %a0,%d0 (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; extend_first_block->prev_size = extend_area_end; extend_first_block->size_and_flag = extend_first_block_size | HEAP_PREV_BLOCK_USED; 4d000: 8280 orl %d0,%d1 } extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; extend_first_block->prev_size = extend_area_end; 4d002: 2083 movel %d3,%a0@ extend_first_block->size_and_flag = extend_first_block_size | HEAP_PREV_BLOCK_USED; 4d004: 2141 0004 movel %d1,%a0@(4) _Heap_Protection_block_initialize( heap, extend_first_block ); extend_last_block->prev_size = extend_first_block_size; 4d008: 2280 movel %d0,%a1@ extend_last_block->size_and_flag = 0; 4d00a: 42a9 0004 clrl %a1@(4) _Heap_Protection_block_initialize( heap, extend_last_block ); if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) { 4d00e: b1ea 0020 cmpal %a2@(32),%a0 4d012: 6400 0102 bccw 4d116 <_Heap_Extend+0x1e6> heap->first_block = extend_first_block; 4d016: 2548 0020 movel %a0,%a2@(32) } else if ( (uintptr_t) extend_last_block > (uintptr_t) heap->last_block ) { heap->last_block = extend_last_block; } if ( merge_below_block != NULL ) { 4d01a: 4a8c tstl %a4 4d01c: 6700 0146 beqw 4d164 <_Heap_Extend+0x234> Heap_Control *heap, uintptr_t extend_area_begin, Heap_Block *first_block ) { uintptr_t const page_size = heap->page_size; 4d020: 202a 0010 movel %a2@(16),%d0 uintptr_t const new_first_block_alloc_begin = _Heap_Align_up( extend_area_begin + HEAP_BLOCK_HEADER_SIZE, page_size ); 4d024: 5082 addql #8,%d2 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up( uintptr_t value, uintptr_t alignment ) { uintptr_t remainder = value % alignment; 4d026: 2802 movel %d2,%d4 4d028: 4c40 4001 remul %d0,%d1,%d4 if ( remainder != 0 ) { 4d02c: 4a81 tstl %d1 4d02e: 6704 beqs 4d034 <_Heap_Extend+0x104> return value - remainder + alignment; 4d030: d480 addl %d0,%d2 4d032: 9481 subl %d1,%d2 uintptr_t const new_first_block_begin = 4d034: 2042 moveal %d2,%a0 4d036: 5188 subql #8,%a0 new_first_block_alloc_begin - HEAP_BLOCK_HEADER_SIZE; uintptr_t const first_block_begin = (uintptr_t) first_block; uintptr_t const new_first_block_size = 4d038: 200c movel %a4,%d0 4d03a: 9088 subl %a0,%d0 first_block_begin - new_first_block_begin; Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin; new_first_block->prev_size = first_block->prev_size; new_first_block->size_and_flag = new_first_block_size | HEAP_PREV_BLOCK_USED; 4d03c: 7201 moveq #1,%d1 4d03e: 8280 orl %d0,%d1 uintptr_t const first_block_begin = (uintptr_t) first_block; uintptr_t const new_first_block_size = first_block_begin - new_first_block_begin; Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin; new_first_block->prev_size = first_block->prev_size; 4d040: 2094 movel %a4@,%a0@ new_first_block->size_and_flag = new_first_block_size | HEAP_PREV_BLOCK_USED; 4d042: 2141 0004 movel %d1,%a0@(4) _Heap_Free_block( heap, new_first_block ); 4d046: 2f08 movel %a0,%sp@- 4d048: 2f0a movel %a2,%sp@- 4d04a: 4eba fec8 jsr %pc@(4cf14 <_Heap_Free_block>) 4d04e: 508f addql #8,%sp link_below_block, extend_last_block ); } if ( merge_above_block != NULL ) { 4d050: 4a8b tstl %a3 4d052: 6700 00d2 beqw 4d126 <_Heap_Extend+0x1f6> ) { uintptr_t const page_size = heap->page_size; uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const last_block_new_size = _Heap_Align_down( extend_area_end - last_block_begin - HEAP_BLOCK_HEADER_SIZE, 4d056: 5183 subql #8,%d3 uintptr_t extend_area_end ) { uintptr_t const page_size = heap->page_size; uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const last_block_new_size = _Heap_Align_down( 4d058: 968b subl %a3,%d3 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4d05a: 2203 movel %d3,%d1 4d05c: 4c6a 1000 0010 remul %a2@(16),%d0,%d1 Heap_Block *const new_last_block = _Heap_Block_at( last_block, last_block_new_size ); new_last_block->size_and_flag = (last_block->size_and_flag - last_block_new_size) | HEAP_PREV_BLOCK_USED; 4d062: 7201 moveq #1,%d1 4d064: 9680 subl %d0,%d3 ); Heap_Block *const new_last_block = _Heap_Block_at( last_block, last_block_new_size ); new_last_block->size_and_flag = (last_block->size_and_flag - last_block_new_size) 4d066: 202b 0004 movel %a3@(4),%d0 4d06a: 9083 subl %d3,%d0 | HEAP_PREV_BLOCK_USED; 4d06c: 8280 orl %d0,%d1 RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 4d06e: 7001 moveq #1,%d0 4d070: 2781 3804 movel %d1,%a3@(00000004,%d3:l) 4d074: c0ab 0004 andl %a3@(4),%d0 block->size_and_flag = size | flag; 4d078: 8680 orl %d0,%d3 4d07a: 2743 0004 movel %d3,%a3@(4) _Heap_Block_set_size( last_block, last_block_new_size ); _Heap_Free_block( heap, last_block ); 4d07e: 2f0b movel %a3,%sp@- 4d080: 2f0a movel %a2,%sp@- 4d082: 4eba fe90 jsr %pc@(4cf14 <_Heap_Free_block>) 4d086: 508f addql #8,%sp extend_first_block, extend_last_block ); } if ( merge_below_block == NULL && merge_above_block == NULL ) { 4d088: 4a8c tstl %a4 4d08a: 6700 00c2 beqw 4d14e <_Heap_Extend+0x21e> if ( extended_size_ptr != NULL ) *extended_size_ptr = extended_size; return true; } 4d08e: 206a 0024 moveal %a2@(36),%a0 RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 4d092: 7201 moveq #1,%d1 * This feature will be used to terminate the scattered heap area list. See * also _Heap_Extend(). */ RTEMS_INLINE_ROUTINE void _Heap_Set_last_block_size( Heap_Control *heap ) { _Heap_Block_set_size( 4d094: 202a 0020 movel %a2@(32),%d0 4d098: 9088 subl %a0,%d0 RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 4d09a: c2a8 0004 andl %a0@(4),%d1 block->size_and_flag = size | flag; 4d09e: 8280 orl %d0,%d1 4d0a0: 2141 0004 movel %d1,%a0@(4) _Heap_Free_block( heap, extend_first_block ); } _Heap_Set_last_block_size( heap ); extended_size = stats->free_size - free_size; 4d0a4: 222a 0030 movel %a2@(48),%d1 4d0a8: 9286 subl %d6,%d1 /* Statistics */ stats->size += extended_size; 4d0aa: d3aa 002c addl %d1,%a2@(44) if ( extended_size_ptr != NULL ) 4d0ae: 4aae 0014 tstl %fp@(20) 4d0b2: 6700 00ca beqw 4d17e <_Heap_Extend+0x24e> *extended_size_ptr = extended_size; 4d0b6: 206e 0014 moveal %fp@(20),%a0 return true; } 4d0ba: 4cee 3cfc ffcc moveml %fp@(-52),%d2-%d7/%a2-%a5 stats->size += extended_size; if ( extended_size_ptr != NULL ) *extended_size_ptr = extended_size; return true; 4d0c0: 7001 moveq #1,%d0 /* Statistics */ stats->size += extended_size; if ( extended_size_ptr != NULL ) *extended_size_ptr = extended_size; 4d0c2: 2081 movel %d1,%a0@ return true; } 4d0c4: 4e5e unlk %fp 4d0c6: 4e75 rts - 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; 4d0c8: 70fe moveq #-2,%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 ) 4d0ca: 2649 moveal %a1,%a3 } else if ( extend_area_end < sub_area_end ) { link_below_block = start_block; } if ( sub_area_end == extend_area_begin ) { start_block->prev_size = extend_area_end; 4d0cc: 2083 movel %d3,%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; 4d0ce: c0a9 0004 andl %a1@(4),%d0 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4d0d2: 41f1 0800 lea %a1@(00000000,%d0:l),%a0 } else if ( sub_area_end < extend_area_begin ) { link_above_block = end_block; } start_block = _Heap_Block_at( end_block, _Heap_Block_size( end_block ) ); } while ( start_block != first_block ); 4d0d6: b1c5 cmpal %d5,%a0 4d0d8: 6600 fec0 bnew 4cf9a <_Heap_Extend+0x6a> 4d0dc: 6000 ff02 braw 4cfe0 <_Heap_Extend+0xb0> sub_area_end > extend_area_begin && extend_area_end > sub_area_begin ) { return false; } if ( extend_area_end == sub_area_begin ) { 4d0e0: 2848 moveal %a0,%a4 4d0e2: 6000 fed6 braw 4cfba <_Heap_Extend+0x8a> return false; } do { uintptr_t const sub_area_begin = (start_block != first_block) ? (uintptr_t) start_block : heap->area_begin; 4d0e6: 222a 0018 movel %a2@(24),%d1 4d0ea: 6000 feb6 braw 4cfa2 <_Heap_Extend+0x72> } else if ( heap->area_end < extend_area_end ) { heap->area_end = extend_area_end; } extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; 4d0ee: 226e fffc moveal %fp@(-4),%a1 heap->area_begin = extend_area_begin; } else if ( heap->area_end < extend_area_end ) { heap->area_end = extend_area_end; } extend_first_block_size = 4d0f2: 2009 movel %a1,%d0 (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; extend_first_block->prev_size = extend_area_end; extend_first_block->size_and_flag = extend_first_block_size | HEAP_PREV_BLOCK_USED; 4d0f4: 7201 moveq #1,%d1 } else if ( heap->area_end < extend_area_end ) { heap->area_end = extend_area_end; } extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; 4d0f6: 206e fff8 moveal %fp@(-8),%a0 heap->area_begin = extend_area_begin; } else if ( heap->area_end < extend_area_end ) { heap->area_end = extend_area_end; } extend_first_block_size = 4d0fa: 9088 subl %a0,%d0 start_block = _Heap_Block_at( end_block, _Heap_Block_size( end_block ) ); } while ( start_block != first_block ); if ( extend_area_begin < heap->area_begin ) { heap->area_begin = extend_area_begin; 4d0fc: 2542 0018 movel %d2,%a2@(24) extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; extend_first_block->prev_size = extend_area_end; extend_first_block->size_and_flag = extend_first_block_size | HEAP_PREV_BLOCK_USED; 4d100: 8280 orl %d0,%d1 } extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; extend_first_block->prev_size = extend_area_end; 4d102: 2083 movel %d3,%a0@ extend_first_block->size_and_flag = extend_first_block_size | HEAP_PREV_BLOCK_USED; 4d104: 2141 0004 movel %d1,%a0@(4) _Heap_Protection_block_initialize( heap, extend_first_block ); extend_last_block->prev_size = extend_first_block_size; 4d108: 2280 movel %d0,%a1@ extend_last_block->size_and_flag = 0; 4d10a: 42a9 0004 clrl %a1@(4) _Heap_Protection_block_initialize( heap, extend_last_block ); if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) { 4d10e: b1ea 0020 cmpal %a2@(32),%a0 4d112: 6500 ff02 bcsw 4d016 <_Heap_Extend+0xe6> heap->first_block = extend_first_block; } else if ( (uintptr_t) extend_last_block > (uintptr_t) heap->last_block ) { 4d116: b3ea 0024 cmpal %a2@(36),%a1 4d11a: 6300 fefe blsw 4d01a <_Heap_Extend+0xea> heap->last_block = extend_last_block; 4d11e: 2549 0024 movel %a1,%a2@(36) 4d122: 6000 fef6 braw 4d01a <_Heap_Extend+0xea> ); } if ( merge_above_block != NULL ) { _Heap_Merge_above( heap, merge_above_block, extend_area_end ); } else if ( link_above_block != NULL ) { 4d126: 4a8d tstl %a5 4d128: 6700 ff5e beqw 4d088 <_Heap_Extend+0x158> RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 4d12c: 7201 moveq #1,%d1 ) { uintptr_t const link_begin = (uintptr_t) link; uintptr_t const first_block_begin = (uintptr_t) first_block; _Heap_Block_set_size( link, first_block_begin - link_begin ); 4d12e: 202e fff8 movel %fp@(-8),%d0 4d132: 908d subl %a5,%d0 4d134: c2ad 0004 andl %a5@(4),%d1 } if ( merge_above_block != NULL ) { _Heap_Merge_above( heap, merge_above_block, extend_area_end ); } else if ( link_above_block != NULL ) { _Heap_Link_above( 4d138: 206e fffc moveal %fp@(-4),%a0 block->size_and_flag = size | flag; 4d13c: 8280 orl %d0,%d1 uintptr_t const link_begin = (uintptr_t) link; uintptr_t const first_block_begin = (uintptr_t) first_block; _Heap_Block_set_size( link, first_block_begin - link_begin ); last_block->size_and_flag |= HEAP_PREV_BLOCK_USED; 4d13e: 7001 moveq #1,%d0 4d140: 2b41 0004 movel %d1,%a5@(4) 4d144: 81a8 0004 orl %d0,%a0@(4) extend_first_block, extend_last_block ); } if ( merge_below_block == NULL && merge_above_block == NULL ) { 4d148: 4a8c tstl %a4 4d14a: 6600 ff42 bnew 4d08e <_Heap_Extend+0x15e> 4d14e: 4a8b tstl %a3 4d150: 6600 ff3c bnew 4d08e <_Heap_Extend+0x15e> _Heap_Free_block( heap, extend_first_block ); 4d154: 2f2e fff8 movel %fp@(-8),%sp@- 4d158: 2f0a movel %a2,%sp@- 4d15a: 4eba fdb8 jsr %pc@(4cf14 <_Heap_Free_block>) 4d15e: 508f addql #8,%sp 4d160: 6000 ff2c braw 4d08e <_Heap_Extend+0x15e> heap->last_block = extend_last_block; } if ( merge_below_block != NULL ) { _Heap_Merge_below( heap, extend_area_begin, merge_below_block ); } else if ( link_below_block != NULL ) { 4d164: 4aae fff4 tstl %fp@(-12) 4d168: 6700 fee6 beqw 4d050 <_Heap_Extend+0x120> { uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const link_begin = (uintptr_t) link; last_block->size_and_flag = (link_begin - last_block_begin) | HEAP_PREV_BLOCK_USED; 4d16c: 202e fff4 movel %fp@(-12),%d0 4d170: 7201 moveq #1,%d1 4d172: 9089 subl %a1,%d0 4d174: 8280 orl %d0,%d1 4d176: 2341 0004 movel %d1,%a1@(4) 4d17a: 6000 fed4 braw 4d050 <_Heap_Extend+0x120> if ( extended_size_ptr != NULL ) *extended_size_ptr = extended_size; return true; } 4d17e: 4cee 3cfc ffcc moveml %fp@(-52),%d2-%d7/%a2-%a5 <== NOT EXECUTED stats->size += extended_size; if ( extended_size_ptr != NULL ) *extended_size_ptr = extended_size; return true; 4d184: 7001 moveq #1,%d0 <== NOT EXECUTED } 4d186: 4e5e unlk %fp <== NOT EXECUTED ... =============================================================================== 0004cf7c <_Heap_Free>: return do_free; } #endif bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { 4cf7c: 4e56 ffe8 linkw %fp,#-24 4cf80: 206e 0008 moveal %fp@(8),%a0 4cf84: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@ 4cf88: 202e 000c movel %fp@(12),%d0 /* * If NULL return true so a free on NULL is considered a valid release. This * is a special case that could be handled by the in heap check how-ever that * would result in false being returned which is wrong. */ if ( alloc_begin_ptr == NULL ) { 4cf8c: 6700 00f2 beqw 4d080 <_Heap_Free+0x104> 4cf90: 2240 moveal %d0,%a1 4cf92: 5189 subql #8,%a1 4cf94: 4c68 0001 0010 remul %a0@(16),%d1,%d0 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 4cf9a: 2028 0020 movel %a0@(32),%d0 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 4cf9e: 93c1 subal %d1,%a1 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 4cfa0: b089 cmpl %a1,%d0 4cfa2: 6200 0098 bhiw 4d03c <_Heap_Free+0xc0> 4cfa6: 2228 0024 movel %a0@(36),%d1 4cfaa: b289 cmpl %a1,%d1 4cfac: 6500 008e bcsw 4d03c <_Heap_Free+0xc0> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 4cfb0: 2629 0004 movel %a1@(4),%d3 - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 4cfb4: 74fe moveq #-2,%d2 4cfb6: c483 andl %d3,%d2 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4cfb8: 45f1 2800 lea %a1@(00000000,%d2:l),%a2 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 4cfbc: b5c0 cmpal %d0,%a2 4cfbe: 657c bcss 4d03c <_Heap_Free+0xc0> <== NEVER TAKEN 4cfc0: b5c1 cmpal %d1,%a2 4cfc2: 6278 bhis 4d03c <_Heap_Free+0xc0> <== NEVER TAKEN 4cfc4: 282a 0004 movel %a2@(4),%d4 return false; } _Heap_Protection_block_check( heap, next_block ); if ( !_Heap_Is_prev_used( next_block ) ) { 4cfc8: 0804 0000 btst #0,%d4 4cfcc: 676e beqs 4d03c <_Heap_Free+0xc0> <== NEVER TAKEN - 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; 4cfce: 7afe moveq #-2,%d5 4cfd0: c885 andl %d5,%d4 return true; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); 4cfd2: b5c1 cmpal %d1,%a2 4cfd4: 6700 00fa beqw 4d0d0 <_Heap_Free+0x154> 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; 4cfd8: 7a01 moveq #1,%d5 4cfda: cab2 4804 andl %a2@(00000004,%d4:l),%d5 return do_free; } #endif bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) 4cfde: 57c5 seq %d5 4cfe0: 4485 negl %d5 next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); if ( !_Heap_Is_prev_used( block ) ) { 4cfe2: 0803 0000 btst #0,%d3 4cfe6: 665e bnes 4d046 <_Heap_Free+0xca> uintptr_t const prev_size = block->prev_size; 4cfe8: 2611 movel %a1@,%d3 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4cfea: 93c3 subal %d3,%a1 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 4cfec: b3c0 cmpal %d0,%a1 4cfee: 654c bcss 4d03c <_Heap_Free+0xc0> <== NEVER TAKEN 4cff0: b3c1 cmpal %d1,%a1 4cff2: 6248 bhis 4d03c <_Heap_Free+0xc0> <== NEVER TAKEN block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 4cff4: 7001 moveq #1,%d0 4cff6: c0a9 0004 andl %a1@(4),%d0 return( false ); } /* As we always coalesce free blocks, the block that preceedes prev_block must have been used. */ if ( !_Heap_Is_prev_used ( prev_block) ) { 4cffa: 6740 beqs 4d03c <_Heap_Free+0xc0> <== NEVER TAKEN _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ 4cffc: 4a05 tstb %d5 4cffe: 6700 00d6 beqw 4d0d6 <_Heap_Free+0x15a> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 4d002: 266a 0008 moveal %a2@(8),%a3 _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ uintptr_t const size = block_size + prev_size + next_block_size; 4d006: d682 addl %d2,%d3 4d008: d883 addl %d3,%d4 _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4d00a: 7001 moveq #1,%d0 --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 4d00c: 246a 000c moveal %a2@(12),%a2 RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; Heap_Block *prev = block->prev; prev->next = next; 4d010: 254b 0008 movel %a3,%a2@(8) if ( next_is_free ) { /* coalesce both */ uintptr_t const size = block_size + prev_size + next_block_size; _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4d014: 8084 orl %d4,%d0 next->prev = prev; 4d016: 274a 000c movel %a2,%a3@(12) } if ( next_is_free ) { /* coalesce both */ uintptr_t const size = block_size + prev_size + next_block_size; _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 4d01a: 53a8 0038 subql #1,%a0@(56) prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; 4d01e: 2384 4800 movel %d4,%a1@(00000000,%d4:l) if ( next_is_free ) { /* coalesce both */ uintptr_t const size = block_size + prev_size + next_block_size; _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4d022: 2340 0004 movel %d0,%a1@(4) stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 4d026: 53a8 0040 subql #1,%a0@(64) ++stats->frees; 4d02a: 52a8 0050 addql #1,%a0@(80) stats->free_size += block_size; 4d02e: d5a8 0030 addl %d2,%a0@(48) return( true ); 4d032: 7001 moveq #1,%d0 } 4d034: 4cd7 0c3c moveml %sp@,%d2-%d5/%a2-%a3 4d038: 4e5e unlk %fp 4d03a: 4e75 rts 4d03c: 4cd7 0c3c moveml %sp@,%d2-%d5/%a2-%a3 /* As we always coalesce free blocks, the block that preceedes prev_block must have been used. */ if ( !_Heap_Is_prev_used ( prev_block) ) { _HAssert( false ); return( false ); 4d040: 4200 clrb %d0 --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 4d042: 4e5e unlk %fp 4d044: 4e75 rts uintptr_t const size = block_size + prev_size; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ 4d046: 4a05 tstb %d5 4d048: 673a beqs 4d084 <_Heap_Free+0x108> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 4d04a: 266a 0008 moveal %a2@(8),%a3 prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ uintptr_t const size = block_size + next_block_size; 4d04e: d882 addl %d2,%d4 _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4d050: 7001 moveq #1,%d0 --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 4d052: 246a 000c moveal %a2@(12),%a2 next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ uintptr_t const size = block_size + next_block_size; _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4d056: 8084 orl %d4,%d0 ) { Heap_Block *next = old_block->next; Heap_Block *prev = old_block->prev; new_block->next = next; 4d058: 234b 0008 movel %a3,%a1@(8) next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; 4d05c: 2384 4800 movel %d4,%a1@(00000000,%d4:l) new_block->prev = prev; 4d060: 234a 000c movel %a2,%a1@(12) next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ uintptr_t const size = block_size + next_block_size; _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4d064: 2340 0004 movel %d0,%a1@(4) /* Statistics */ --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); 4d068: 7001 moveq #1,%d0 next->prev = new_block; prev->next = new_block; 4d06a: 2549 0008 movel %a1,%a2@(8) Heap_Block *prev = old_block->prev; new_block->next = next; new_block->prev = prev; next->prev = new_block; 4d06e: 2749 000c movel %a1,%a3@(12) stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 4d072: 53a8 0040 subql #1,%a0@(64) ++stats->frees; 4d076: 52a8 0050 addql #1,%a0@(80) stats->free_size += block_size; 4d07a: d5a8 0030 addl %d2,%a0@(48) 4d07e: 60b4 bras 4d034 <_Heap_Free+0xb8> * If NULL return true so a free on NULL is considered a valid release. This * is a special case that could be handled by the in heap check how-ever that * would result in false being returned which is wrong. */ if ( alloc_begin_ptr == NULL ) { return true; 4d080: 7001 moveq #1,%d0 4d082: 60b0 bras 4d034 <_Heap_Free+0xb8> block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; 4d084: 2028 0038 movel %a0@(56),%d0 next_block->prev_size = size; } else { /* no coalesce */ /* Add 'block' to the head of the free blocks list as it tends to produce less fragmentation than adding to the tail. */ _Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block ); block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; 4d088: 7201 moveq #1,%d1 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4d08a: 7afe moveq #-2,%d5 next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; 4d08c: 5280 addql #1,%d0 RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after( Heap_Block *block_before, Heap_Block *new_block ) { Heap_Block *next = block_before->next; 4d08e: 2668 0008 moveal %a0@(8),%a3 new_block->next = next; new_block->prev = block_before; 4d092: 2348 000c movel %a0,%a1@(12) next_block->prev_size = size; } else { /* no coalesce */ /* Add 'block' to the head of the free blocks list as it tends to produce less fragmentation than adding to the tail. */ _Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block ); block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; 4d096: 8282 orl %d2,%d1 Heap_Block *new_block ) { Heap_Block *next = block_before->next; new_block->next = next; 4d098: 234b 0008 movel %a3,%a1@(8) 4d09c: 2341 0004 movel %d1,%a1@(4) next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4d0a0: cbaa 0004 andl %d5,%a2@(4) new_block->prev = block_before; block_before->next = new_block; next->prev = new_block; 4d0a4: 2749 000c movel %a1,%a3@(12) next_block->prev_size = block_size; 4d0a8: 2482 movel %d2,%a2@ { Heap_Block *next = block_before->next; new_block->next = next; new_block->prev = block_before; block_before->next = new_block; 4d0aa: 2149 0008 movel %a1,%a0@(8) /* Statistics */ ++stats->free_blocks; 4d0ae: 2140 0038 movel %d0,%a0@(56) if ( stats->max_free_blocks < stats->free_blocks ) { 4d0b2: b0a8 003c cmpl %a0@(60),%d0 4d0b6: 6300 ff6e blsw 4d026 <_Heap_Free+0xaa> stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 4d0ba: 53a8 0040 subql #1,%a0@(64) ++stats->frees; 4d0be: 52a8 0050 addql #1,%a0@(80) stats->free_size += block_size; 4d0c2: d5a8 0030 addl %d2,%a0@(48) next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; if ( stats->max_free_blocks < stats->free_blocks ) { stats->max_free_blocks = stats->free_blocks; 4d0c6: 2140 003c movel %d0,%a0@(60) /* Statistics */ --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); 4d0ca: 7001 moveq #1,%d0 4d0cc: 6000 ff66 braw 4d034 <_Heap_Free+0xb8> return true; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); 4d0d0: 4205 clrb %d5 4d0d2: 6000 ff0e braw 4cfe2 <_Heap_Free+0x66> prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; } else { /* coalesce prev */ uintptr_t const size = block_size + prev_size; 4d0d6: d682 addl %d2,%d3 prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4d0d8: 7201 moveq #1,%d1 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4d0da: 7afe moveq #-2,%d5 next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; } else { /* coalesce prev */ uintptr_t const size = block_size + prev_size; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4d0dc: 8283 orl %d3,%d1 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = size; 4d0de: 2483 movel %d3,%a2@ /* Statistics */ --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); 4d0e0: 7001 moveq #1,%d0 next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; } else { /* coalesce prev */ uintptr_t const size = block_size + prev_size; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4d0e2: 2341 0004 movel %d1,%a1@(4) next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4d0e6: cbaa 0004 andl %d5,%a2@(4) stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 4d0ea: 53a8 0040 subql #1,%a0@(64) ++stats->frees; 4d0ee: 52a8 0050 addql #1,%a0@(80) stats->free_size += block_size; 4d0f2: d5a8 0030 addl %d2,%a0@(48) 4d0f6: 6000 ff3c braw 4d034 <_Heap_Free+0xb8> ... =============================================================================== 0004d99c <_Heap_Get_information>: void _Heap_Get_information( Heap_Control *the_heap, Heap_Information_block *the_info ) { 4d99c: 4e56 fff0 linkw %fp,#-16 4d9a0: 48d7 041c moveml %d2-%d4/%a2,%sp@ 4d9a4: 246e 0008 moveal %fp@(8),%a2 4d9a8: 282e 000c movel %fp@(12),%d4 Heap_Block *the_block = the_heap->first_block; Heap_Block *const end = the_heap->last_block; memset(the_info, 0, sizeof(*the_info)); 4d9ac: 2044 moveal %d4,%a0 void _Heap_Get_information( Heap_Control *the_heap, Heap_Information_block *the_info ) { Heap_Block *the_block = the_heap->first_block; 4d9ae: 226a 0020 moveal %a2@(32),%a1 Heap_Block *const end = the_heap->last_block; 4d9b2: 242a 0024 movel %a2@(36),%d2 memset(the_info, 0, sizeof(*the_info)); 4d9b6: 4298 clrl %a0@+ 4d9b8: 4298 clrl %a0@+ 4d9ba: 4298 clrl %a0@+ 4d9bc: 4298 clrl %a0@+ 4d9be: 4298 clrl %a0@+ 4d9c0: 4290 clrl %a0@ while ( the_block != end ) { 4d9c2: b489 cmpl %a1,%d2 4d9c4: 6734 beqs 4d9fa <_Heap_Get_information+0x5e> <== NEVER TAKEN uintptr_t const the_size = _Heap_Block_size(the_block); Heap_Block *const next_block = _Heap_Block_at(the_block, the_size); Heap_Information *info; if ( _Heap_Is_prev_used(next_block) ) info = &the_info->Used; 4d9c6: 2604 movel %d4,%d3 4d9c8: 0683 0000 000c addil #12,%d3 Heap_Block *the_block = the_heap->first_block; Heap_Block *const end = the_heap->last_block; memset(the_info, 0, sizeof(*the_info)); while ( the_block != end ) { 4d9ce: 2229 0004 movel %a1@(4),%d1 - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 4d9d2: 70fe moveq #-2,%d0 uintptr_t const the_size = _Heap_Block_size(the_block); Heap_Block *const next_block = _Heap_Block_at(the_block, the_size); Heap_Information *info; if ( _Heap_Is_prev_used(next_block) ) info = &the_info->Used; 4d9d4: 2043 moveal %d3,%a0 4d9d6: 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); 4d9d8: d3c0 addal %d0,%a1 if ( info->largest < the_size ) info->largest = the_size; the_block = next_block; } } 4d9da: 2229 0004 movel %a1@(4),%d1 while ( the_block != end ) { uintptr_t const the_size = _Heap_Block_size(the_block); Heap_Block *const next_block = _Heap_Block_at(the_block, the_size); Heap_Information *info; if ( _Heap_Is_prev_used(next_block) ) 4d9de: 0801 0000 btst #0,%d1 4d9e2: 6602 bnes 4d9e6 <_Heap_Get_information+0x4a> info = &the_info->Used; else info = &the_info->Free; 4d9e4: 2044 moveal %d4,%a0 info->number++; 4d9e6: 5290 addql #1,%a0@ info->total += the_size; 4d9e8: d1a8 0008 addl %d0,%a0@(8) if ( info->largest < the_size ) 4d9ec: b0a8 0004 cmpl %a0@(4),%d0 4d9f0: 6304 blss 4d9f6 <_Heap_Get_information+0x5a> info->largest = the_size; 4d9f2: 2140 0004 movel %d0,%a0@(4) Heap_Block *the_block = the_heap->first_block; Heap_Block *const end = the_heap->last_block; memset(the_info, 0, sizeof(*the_info)); while ( the_block != end ) { 4d9f6: b3c2 cmpal %d2,%a1 4d9f8: 66d8 bnes 4d9d2 <_Heap_Get_information+0x36> if ( info->largest < the_size ) info->largest = the_size; the_block = next_block; } } 4d9fa: 4cd7 041c moveml %sp@,%d2-%d4/%a2 4d9fe: 4e5e unlk %fp ... =============================================================================== 0005d654 <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { 5d654: 4e56 0000 linkw %fp,#0 5d658: 202e 000c movel %fp@(12),%d0 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 5d65c: 2040 moveal %d0,%a0 5d65e: 5188 subql #8,%a0 5d660: 226e 0008 moveal %fp@(8),%a1 5d664: 2f02 movel %d2,%sp@- 5d666: 2400 movel %d0,%d2 5d668: 4c69 2001 0010 remul %a1@(16),%d1,%d2 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 5d66e: 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 5d670: 2229 0020 movel %a1@(32),%d1 && (uintptr_t) block <= (uintptr_t) heap->last_block; 5d674: b288 cmpl %a0,%d1 5d676: 6238 bhis 5d6b0 <_Heap_Size_of_alloc_area+0x5c> 5d678: 2269 0024 moveal %a1@(36),%a1 5d67c: b3c8 cmpal %a0,%a1 5d67e: 6530 bcss 5d6b0 <_Heap_Size_of_alloc_area+0x5c> <== NEVER TAKEN - 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; 5d680: 74fe moveq #-2,%d2 5d682: c4a8 0004 andl %a0@(4),%d2 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 5d686: 41f0 2800 lea %a0@(00000000,%d2:l),%a0 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 5d68a: b1c1 cmpal %d1,%a0 5d68c: 6522 bcss 5d6b0 <_Heap_Size_of_alloc_area+0x5c> <== NEVER TAKEN 5d68e: b1c9 cmpal %a1,%a0 5d690: 621e bhis 5d6b0 <_Heap_Size_of_alloc_area+0x5c> <== NEVER TAKEN block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 5d692: 7201 moveq #1,%d1 5d694: c2a8 0004 andl %a0@(4),%d1 block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) 5d698: 6716 beqs 5d6b0 <_Heap_Size_of_alloc_area+0x5c> <== NEVER TAKEN ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; 5d69a: 7204 moveq #4,%d1 5d69c: 9280 subl %d0,%d1 5d69e: 2001 movel %d1,%d0 5d6a0: d088 addl %a0,%d0 5d6a2: 226e 0010 moveal %fp@(16),%a1 return true; } 5d6a6: 241f movel %sp@+,%d2 5d6a8: 4e5e unlk %fp || !_Heap_Is_prev_used( next_block ) ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; 5d6aa: 2280 movel %d0,%a1@ return true; 5d6ac: 7001 moveq #1,%d0 } 5d6ae: 4e75 rts 5d6b0: 241f movel %sp@+,%d2 5d6b2: 4e5e unlk %fp if ( !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) ) { return false; 5d6b4: 4200 clrb %d0 <== NOT EXECUTED } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; return true; } =============================================================================== 0004864a <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 4864a: 4e56 ffc4 linkw %fp,#-60 4864e: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 48652: 246e 0008 moveal %fp@(8),%a2 uintptr_t const min_block_size = heap->min_block_size; Heap_Block *const first_block = heap->first_block; Heap_Block *const last_block = heap->last_block; Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 48656: 4bfa ff94 lea %pc@(485ec <_Heap_Walk_print_nothing>),%a5 bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 4865a: 2a2e 000c movel %fp@(12),%d5 uintptr_t const page_size = heap->page_size; 4865e: 262a 0010 movel %a2@(16),%d3 uintptr_t const min_block_size = heap->min_block_size; 48662: 2c2a 0014 movel %a2@(20),%d6 Heap_Block *const first_block = heap->first_block; 48666: 282a 0020 movel %a2@(32),%d4 Heap_Block *const last_block = heap->last_block; 4866a: 2e2a 0024 movel %a2@(36),%d7 Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 4866e: 4a2e 0013 tstb %fp@(19) 48672: 6704 beqs 48678 <_Heap_Walk+0x2e> 48674: 4bfa ff7e lea %pc@(485f4 <_Heap_Walk_print>),%a5 if ( !_System_state_Is_up( _System_state_Get() ) ) { 48678: 7003 moveq #3,%d0 4867a: b0b9 0006 3364 cmpl 63364 <_System_state_Current>,%d0 48680: 670c beqs 4868e <_Heap_Walk+0x44> block = next_block; } while ( block != first_block ); return true; } 48682: 4cee 3cfc ffc4 moveml %fp@(-60),%d2-%d7/%a2-%a5 } block = next_block; } while ( block != first_block ); return true; 48688: 7001 moveq #1,%d0 } 4868a: 4e5e unlk %fp 4868c: 4e75 rts 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)( 4868e: 2f2a 000c movel %a2@(12),%sp@- 48692: 2f2a 0008 movel %a2@(8),%sp@- 48696: 2f07 movel %d7,%sp@- 48698: 2f04 movel %d4,%sp@- 4869a: 2f2a 001c movel %a2@(28),%sp@- 4869e: 2f2a 0018 movel %a2@(24),%sp@- 486a2: 2f06 movel %d6,%sp@- 486a4: 2f03 movel %d3,%sp@- 486a6: 4879 0005 f5eb pea 5f5eb <_Status_Object_name_errors_to_status+0x5d> 486ac: 42a7 clrl %sp@- 486ae: 2f05 movel %d5,%sp@- 486b0: 4e95 jsr %a5@ heap->area_begin, heap->area_end, first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { 486b2: 4fef 002c lea %sp@(44),%sp 486b6: 4a83 tstl %d3 486b8: 6700 0082 beqw 4873c <_Heap_Walk+0xf2> ) { #if (CPU_ALIGNMENT == 0) return true; #else return (((uintptr_t)address % CPU_ALIGNMENT) == 0); 486bc: 7003 moveq #3,%d0 486be: c083 andl %d3,%d0 (*printer)( source, true, "page size is zero\n" ); return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 486c0: 6600 0090 bnew 48752 <_Heap_Walk+0x108> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 486c4: 2206 movel %d6,%d1 486c6: 4c43 1000 remul %d3,%d0,%d1 ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 486ca: 4a80 tstl %d0 486cc: 6600 00a4 bnew 48772 <_Heap_Walk+0x128> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 486d0: 2004 movel %d4,%d0 486d2: 5080 addql #8,%d0 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 486d4: 4c43 0001 remul %d3,%d1,%d0 ); return false; } if ( 486d8: 4a81 tstl %d1 486da: 6600 00ae bnew 4878a <_Heap_Walk+0x140> block = next_block; } while ( block != first_block ); return true; } 486de: 2044 moveal %d4,%a0 486e0: 2228 0004 movel %a0@(4),%d1 486e4: 2d41 fff0 movel %d1,%fp@(-16) ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 486e8: 0801 0000 btst #0,%d1 486ec: 6700 00b4 beqw 487a2 <_Heap_Walk+0x158> - 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; 486f0: 2047 moveal %d7,%a0 486f2: 72fe moveq #-2,%d1 486f4: c2a8 0004 andl %a0@(4),%d1 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 486f8: d1c1 addal %d1,%a0 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; 486fa: 7201 moveq #1,%d1 486fc: c2a8 0004 andl %a0@(4),%d1 ); return false; } if ( _Heap_Is_free( last_block ) ) { 48700: 6724 beqs 48726 <_Heap_Walk+0xdc> ); return false; } if ( 48702: b1c4 cmpal %d4,%a0 48704: 6700 00b4 beqw 487ba <_Heap_Walk+0x170> _Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block ) { (*printer)( 48708: 4879 0005 f745 pea 5f745 <_Status_Object_name_errors_to_status+0x1b7> return false; } if ( !_Heap_Is_prev_used( first_block ) ) { (*printer)( 4870e: 4878 0001 pea 1 48712: 2f05 movel %d5,%sp@- 48714: 4e95 jsr %a5@ 48716: 4fef 000c lea %sp@(12),%sp if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 4871a: 4200 clrb %d0 block = next_block; } while ( block != first_block ); return true; } 4871c: 4cee 3cfc ffc4 moveml %fp@(-60),%d2-%d7/%a2-%a5 48722: 4e5e unlk %fp 48724: 4e75 rts return false; } if ( _Heap_Is_free( last_block ) ) { (*printer)( 48726: 4879 0005 f730 pea 5f730 <_Status_Object_name_errors_to_status+0x1a2> return false; } if ( !_Heap_Is_prev_used( first_block ) ) { (*printer)( 4872c: 4878 0001 pea 1 48730: 2f05 movel %d5,%sp@- 48732: 4e95 jsr %a5@ 48734: 4fef 000c lea %sp@(12),%sp if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 48738: 4200 clrb %d0 4873a: 60e0 bras 4871c <_Heap_Walk+0xd2> first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { (*printer)( source, true, "page size is zero\n" ); 4873c: 4879 0005 f67c pea 5f67c <_Status_Object_name_errors_to_status+0xee> return false; } if ( !_Heap_Is_prev_used( first_block ) ) { (*printer)( 48742: 4878 0001 pea 1 48746: 2f05 movel %d5,%sp@- 48748: 4e95 jsr %a5@ 4874a: 4fef 000c lea %sp@(12),%sp if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 4874e: 4200 clrb %d0 48750: 60ca bras 4871c <_Heap_Walk+0xd2> return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { (*printer)( 48752: 2f03 movel %d3,%sp@- 48754: 4879 0005 f68f pea 5f68f <_Status_Object_name_errors_to_status+0x101> 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 ) ) { (*printer)( 4875a: 4878 0001 pea 1 4875e: 2f05 movel %d5,%sp@- 48760: 4e95 jsr %a5@ 48762: 4fef 0010 lea %sp@(16),%sp if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 48766: 4200 clrb %d0 block = next_block; } while ( block != first_block ); return true; } 48768: 4cee 3cfc ffc4 moveml %fp@(-60),%d2-%d7/%a2-%a5 4876e: 4e5e unlk %fp 48770: 4e75 rts return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { (*printer)( 48772: 2f06 movel %d6,%sp@- 48774: 4879 0005 f6ad pea 5f6ad <_Status_Object_name_errors_to_status+0x11f> 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 ) ) { (*printer)( 4877a: 4878 0001 pea 1 4877e: 2f05 movel %d5,%sp@- 48780: 4e95 jsr %a5@ 48782: 4fef 0010 lea %sp@(16),%sp if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 48786: 4200 clrb %d0 48788: 60de bras 48768 <_Heap_Walk+0x11e> } if ( !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 4878a: 2f04 movel %d4,%sp@- 4878c: 4879 0005 f6d1 pea 5f6d1 <_Status_Object_name_errors_to_status+0x143> 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 ) ) { (*printer)( 48792: 4878 0001 pea 1 48796: 2f05 movel %d5,%sp@- 48798: 4e95 jsr %a5@ 4879a: 4fef 0010 lea %sp@(16),%sp if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 4879e: 4200 clrb %d0 487a0: 60c6 bras 48768 <_Heap_Walk+0x11e> return false; } if ( !_Heap_Is_prev_used( first_block ) ) { (*printer)( 487a2: 4879 0005 f702 pea 5f702 <_Status_Object_name_errors_to_status+0x174> 487a8: 4878 0001 pea 1 487ac: 2f05 movel %d5,%sp@- 487ae: 4e95 jsr %a5@ 487b0: 4fef 000c lea %sp@(12),%sp if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 487b4: 4200 clrb %d0 487b6: 6000 ff64 braw 4871c <_Heap_Walk+0xd2> int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 487ba: 202a 0010 movel %a2@(16),%d0 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 487be: 206a 0008 moveal %a2@(8),%a0 487c2: 2d40 fffc movel %d0,%fp@(-4) 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 ) { 487c6: b1ca cmpal %a2,%a0 487c8: 6700 0316 beqw 48ae0 <_Heap_Walk+0x496> block = next_block; } while ( block != first_block ); return true; } 487cc: 242a 0020 movel %a2@(32),%d2 487d0: 2d42 fff4 movel %d2,%fp@(-12) 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; 487d4: b1c2 cmpal %d2,%a0 487d6: 6500 0090 bcsw 48868 <_Heap_Walk+0x21e> 487da: 266a 0024 moveal %a2@(36),%a3 487de: b7c8 cmpal %a0,%a3 487e0: 6500 0086 bcsw 48868 <_Heap_Walk+0x21e> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 487e4: 49e8 0008 lea %a0@(8),%a4 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 487e8: 200c movel %a4,%d0 487ea: 222e fffc movel %fp@(-4),%d1 487ee: 4c41 0002 remul %d1,%d2,%d0 ); return false; } if ( 487f2: 4a82 tstl %d2 487f4: 6600 00ae bnew 488a4 <_Heap_Walk+0x25a> - 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; 487f8: 74fe moveq #-2,%d2 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; 487fa: 7001 moveq #1,%d0 - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 487fc: c4a8 0004 andl %a0@(4),%d2 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; 48800: c0b0 2804 andl %a0@(00000004,%d2:l),%d0 ); return false; } if ( _Heap_Is_used( free_block ) ) { 48804: 6648 bnes 4884e <_Heap_Walk+0x204> <== NEVER TAKEN 48806: 222e fff4 movel %fp@(-12),%d1 4880a: 224a moveal %a2,%a1 4880c: 2848 moveal %a0,%a4 4880e: 2d43 fff8 movel %d3,%fp@(-8) ); return false; } if ( free_block->prev != prev_block ) { 48812: 2428 000c movel %a0@(12),%d2 48816: b3c2 cmpal %d2,%a1 48818: 6668 bnes 48882 <_Heap_Walk+0x238> return false; } prev_block = free_block; free_block = free_block->next; 4881a: 2068 0008 moveal %a0@(8),%a0 const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); const Heap_Block *prev_block = free_list_tail; const Heap_Block *free_block = first_free_block; while ( free_block != free_list_tail ) { 4881e: b1ca cmpal %a2,%a0 48820: 6700 009c beqw 488be <_Heap_Walk+0x274> 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; 48824: b288 cmpl %a0,%d1 48826: 6240 bhis 48868 <_Heap_Walk+0x21e> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 48828: 2408 movel %a0,%d2 4882a: 5082 addql #8,%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; 4882c: b7c8 cmpal %a0,%a3 4882e: 6538 bcss 48868 <_Heap_Walk+0x21e> <== NEVER TAKEN RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 48830: 202e fffc movel %fp@(-4),%d0 ); return false; } if ( _Heap_Is_used( free_block ) ) { 48834: 224c moveal %a4,%a1 48836: 2848 moveal %a0,%a4 48838: 4c40 2003 remul %d0,%d3,%d2 ); return false; } if ( 4883c: 4a83 tstl %d3 4883e: 6664 bnes 488a4 <_Heap_Walk+0x25a> - 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; 48840: 74fe moveq #-2,%d2 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; 48842: 7001 moveq #1,%d0 - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 48844: c4a8 0004 andl %a0@(4),%d2 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; 48848: c0b0 2804 andl %a0@(00000004,%d2:l),%d0 ); return false; } if ( _Heap_Is_used( free_block ) ) { 4884c: 67c4 beqs 48812 <_Heap_Walk+0x1c8> (*printer)( 4884e: 2f08 movel %a0,%sp@- 48850: 4879 0005 f7c4 pea 5f7c4 <_Status_Object_name_errors_to_status+0x236> 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 ) ) { (*printer)( 48856: 4878 0001 pea 1 4885a: 2f05 movel %d5,%sp@- 4885c: 4e95 jsr %a5@ 4885e: 4fef 0010 lea %sp@(16),%sp if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 48862: 4200 clrb %d0 48864: 6000 ff02 braw 48768 <_Heap_Walk+0x11e> 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 ) ) { (*printer)( 48868: 2f08 movel %a0,%sp@- 4886a: 4879 0005 f774 pea 5f774 <_Status_Object_name_errors_to_status+0x1e6> 48870: 4878 0001 pea 1 48874: 2f05 movel %d5,%sp@- 48876: 4e95 jsr %a5@ 48878: 4fef 0010 lea %sp@(16),%sp if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 4887c: 4200 clrb %d0 4887e: 6000 fee8 braw 48768 <_Heap_Walk+0x11e> return false; } if ( free_block->prev != prev_block ) { (*printer)( 48882: 2f02 movel %d2,%sp@- 48884: 2f08 movel %a0,%sp@- 48886: 4879 0005 f7e0 pea 5f7e0 <_Status_Object_name_errors_to_status+0x252> return false; } if ( next_block_begin <= block_begin && is_not_last_block ) { (*printer)( 4888c: 4878 0001 pea 1 48890: 2f05 movel %d5,%sp@- 48892: 4e95 jsr %a5@ "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 48894: 4fef 0014 lea %sp@(20),%sp 48898: 4200 clrb %d0 block = next_block; } while ( block != first_block ); return true; } 4889a: 4cee 3cfc ffc4 moveml %fp@(-60),%d2-%d7/%a2-%a5 488a0: 4e5e unlk %fp 488a2: 4e75 rts } if ( !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 488a4: 2f08 movel %a0,%sp@- 488a6: 4879 0005 f794 pea 5f794 <_Status_Object_name_errors_to_status+0x206> 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 ) ) { (*printer)( 488ac: 4878 0001 pea 1 488b0: 2f05 movel %d5,%sp@- 488b2: 4e95 jsr %a5@ 488b4: 4fef 0010 lea %sp@(16),%sp if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 488b8: 4200 clrb %d0 488ba: 6000 feac braw 48768 <_Heap_Walk+0x11e> 488be: 262e fff8 movel %fp@(-8),%d3 ); return false; } if ( _Heap_Is_used( free_block ) ) { 488c2: 2844 moveal %d4,%a4 488c4: 2d41 fff4 movel %d1,%fp@(-12) 488c8: 222e fff4 movel %fp@(-12),%d1 488cc: 2d43 fffc movel %d3,%fp@(-4) 488d0: 262e fff0 movel %fp@(-16),%d3 488d4: 2d47 ffec movel %d7,%fp@(-20) - 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; 488d8: 74fe moveq #-2,%d2 488da: c483 andl %d3,%d2 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 488dc: 47f4 2800 lea %a4@(00000000,%d2:l),%a3 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; 488e0: b7c1 cmpal %d1,%a3 488e2: 657e bcss 48962 <_Heap_Walk+0x318> <== NEVER TAKEN 488e4: b7ea 0024 cmpal %a2@(36),%a3 488e8: 6278 bhis 48962 <_Heap_Walk+0x318> uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); bool const prev_used = _Heap_Is_prev_used( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); uintptr_t const next_block_begin = (uintptr_t) next_block; bool const is_not_last_block = block != last_block; 488ea: b9ee ffec cmpal %fp@(-20),%a4 488ee: 56c1 sne %d1 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 488f0: 202e fffc movel %fp@(-4),%d0 488f4: 2e02 movel %d2,%d7 488f6: 3241 moveaw %d1,%a1 488f8: 4c40 7001 remul %d0,%d1,%d7 488fc: 2009 movel %a1,%d0 488fe: 4480 negl %d0 ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { 48900: 4a81 tstl %d1 48902: 6704 beqs 48908 <_Heap_Walk+0x2be> 48904: 4a00 tstb %d0 48906: 6676 bnes 4897e <_Heap_Walk+0x334> ); return false; } if ( block_size < min_block_size && is_not_last_block ) { 48908: b486 cmpl %d6,%d2 4890a: 6406 bccs 48912 <_Heap_Walk+0x2c8> 4890c: 4a00 tstb %d0 4890e: 6600 008a bnew 4899a <_Heap_Walk+0x350> ); return false; } if ( next_block_begin <= block_begin && is_not_last_block ) { 48912: b7cc cmpal %a4,%a3 48914: 6206 bhis 4891c <_Heap_Walk+0x2d2> 48916: 4a00 tstb %d0 48918: 6600 00a4 bnew 489be <_Heap_Walk+0x374> 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; 4891c: 7001 moveq #1,%d0 4891e: 7e01 moveq #1,%d7 48920: c0ab 0004 andl %a3@(4),%d0 48924: c687 andl %d7,%d3 ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 48926: 4a80 tstl %d0 48928: 6700 00ca beqw 489f4 <_Heap_Walk+0x3aa> if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { 4892c: 4a83 tstl %d3 4892e: 6700 00aa beqw 489da <_Heap_Walk+0x390> (*printer)( 48932: 2f02 movel %d2,%sp@- 48934: 2f0c movel %a4,%sp@- 48936: 4879 0005 f969 pea 5f969 <_Status_Object_name_errors_to_status+0x3db> 4893c: 42a7 clrl %sp@- 4893e: 2f05 movel %d5,%sp@- 48940: 4e95 jsr %a5@ 48942: 4fef 0014 lea %sp@(20),%sp block->prev_size ); } block = next_block; } while ( block != first_block ); 48946: b7c4 cmpal %d4,%a3 48948: 6700 fd38 beqw 48682 <_Heap_Walk+0x38> 4894c: 262b 0004 movel %a3@(4),%d3 - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 48950: 74fe moveq #-2,%d2 48952: 284b moveal %a3,%a4 48954: c483 andl %d3,%d2 48956: 222a 0020 movel %a2@(32),%d1 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4895a: 47f4 2800 lea %a4@(00000000,%d2:l),%a3 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; 4895e: b7c1 cmpal %d1,%a3 48960: 6482 bccs 488e4 <_Heap_Walk+0x29a> <== ALWAYS TAKEN Heap_Block *const next_block = _Heap_Block_at( block, block_size ); uintptr_t const next_block_begin = (uintptr_t) next_block; bool const is_not_last_block = block != last_block; if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { (*printer)( 48962: 2f0b movel %a3,%sp@- 48964: 2f0c movel %a4,%sp@- 48966: 4879 0005 f812 pea 5f812 <_Status_Object_name_errors_to_status+0x284> return false; } if ( next_block_begin <= block_begin && is_not_last_block ) { (*printer)( 4896c: 4878 0001 pea 1 48970: 2f05 movel %d5,%sp@- 48972: 4e95 jsr %a5@ "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 48974: 4fef 0014 lea %sp@(20),%sp 48978: 4200 clrb %d0 4897a: 6000 ff1e braw 4889a <_Heap_Walk+0x250> return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { (*printer)( 4897e: 2f02 movel %d2,%sp@- 48980: 2f0c movel %a4,%sp@- 48982: 4879 0005 f83f pea 5f83f <_Status_Object_name_errors_to_status+0x2b1> return false; } if ( next_block_begin <= block_begin && is_not_last_block ) { (*printer)( 48988: 4878 0001 pea 1 4898c: 2f05 movel %d5,%sp@- 4898e: 4e95 jsr %a5@ "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 48990: 4fef 0014 lea %sp@(20),%sp 48994: 4200 clrb %d0 48996: 6000 ff02 braw 4889a <_Heap_Walk+0x250> return false; } if ( block_size < min_block_size && is_not_last_block ) { (*printer)( 4899a: 2f06 movel %d6,%sp@- 4899c: 2f02 movel %d2,%sp@- 4899e: 2f0c movel %a4,%sp@- 489a0: 4879 0005 f86d pea 5f86d <_Status_Object_name_errors_to_status+0x2df> 489a6: 4878 0001 pea 1 489aa: 2f05 movel %d5,%sp@- 489ac: 4e95 jsr %a5@ block, block_size, min_block_size ); return false; 489ae: 4fef 0018 lea %sp@(24),%sp block = next_block; } while ( block != first_block ); return true; } 489b2: 4cee 3cfc ffc4 moveml %fp@(-60),%d2-%d7/%a2-%a5 block, block_size, min_block_size ); return false; 489b8: 4200 clrb %d0 block = next_block; } while ( block != first_block ); return true; } 489ba: 4e5e unlk %fp 489bc: 4e75 rts return false; } if ( next_block_begin <= block_begin && is_not_last_block ) { (*printer)( 489be: 2f0b movel %a3,%sp@- 489c0: 2f0c movel %a4,%sp@- 489c2: 4879 0005 f898 pea 5f898 <_Status_Object_name_errors_to_status+0x30a> 489c8: 4878 0001 pea 1 489cc: 2f05 movel %d5,%sp@- 489ce: 4e95 jsr %a5@ "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 489d0: 4fef 0014 lea %sp@(20),%sp 489d4: 4200 clrb %d0 489d6: 6000 fec2 braw 4889a <_Heap_Walk+0x250> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 489da: 2f14 movel %a4@,%sp@- 489dc: 2f02 movel %d2,%sp@- 489de: 2f0c movel %a4,%sp@- 489e0: 4879 0005 f980 pea 5f980 <_Status_Object_name_errors_to_status+0x3f2> 489e6: 42a7 clrl %sp@- 489e8: 2f05 movel %d5,%sp@- 489ea: 4e95 jsr %a5@ 489ec: 4fef 0018 lea %sp@(24),%sp 489f0: 6000 ff54 braw 48946 <_Heap_Walk+0x2fc> return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 489f4: 2e2a 0008 movel %a2@(8),%d7 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)( 489f8: 43f9 0005 f5b8 lea 5f5b8 <_Status_Object_name_errors_to_status+0x2a>,%a1 block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? 489fe: 222c 0008 movel %a4@(8),%d1 Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 48a02: b2aa 000c cmpl %a2@(12),%d1 48a06: 670a beqs 48a12 <_Heap_Walk+0x3c8> " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 48a08: 43f9 0005 f500 lea 5f500 ,%a1 48a0e: b28a cmpl %a2,%d1 48a10: 676c beqs 48a7e <_Heap_Walk+0x434> false, "block 0x%08x: size %u, prev 0x%08x%s, next 0x%08x%s\n", block, block_size, block->prev, block->prev == first_free_block ? 48a12: 202c 000c movel %a4@(12),%d0 Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 48a16: 41f9 0005 f5d1 lea 5f5d1 <_Status_Object_name_errors_to_status+0x43>,%a0 48a1c: b087 cmpl %d7,%d0 48a1e: 670a beqs 48a2a <_Heap_Walk+0x3e0> block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 48a20: 41f9 0005 f500 lea 5f500 ,%a0 48a26: b08a cmpl %a2,%d0 48a28: 674c beqs 48a76 <_Heap_Walk+0x42c> 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)( 48a2a: 2f09 movel %a1,%sp@- 48a2c: 2f01 movel %d1,%sp@- 48a2e: 2f08 movel %a0,%sp@- 48a30: 2f00 movel %d0,%sp@- 48a32: 2f02 movel %d2,%sp@- 48a34: 2f0c movel %a4,%sp@- 48a36: 4879 0005 f8cc pea 5f8cc <_Status_Object_name_errors_to_status+0x33e> 48a3c: 42a7 clrl %sp@- 48a3e: 2f05 movel %d5,%sp@- 48a40: 4e95 jsr %a5@ block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { 48a42: 2213 movel %a3@,%d1 48a44: 4fef 0024 lea %sp@(36),%sp 48a48: b282 cmpl %d2,%d1 48a4a: 663a bnes 48a86 <_Heap_Walk+0x43c> ); return false; } if ( !prev_used ) { 48a4c: 4a83 tstl %d3 48a4e: 6776 beqs 48ac6 <_Heap_Walk+0x47c> 48a50: 206a 0008 moveal %a2@(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 ) { 48a54: b1ca cmpal %a2,%a0 48a56: 6754 beqs 48aac <_Heap_Walk+0x462> <== NEVER TAKEN if ( free_block == block ) { 48a58: b1cc cmpal %a4,%a0 48a5a: 6700 feea beqw 48946 <_Heap_Walk+0x2fc> 48a5e: 2e2e ffec movel %fp@(-20),%d7 return true; } free_block = free_block->next; 48a62: 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 ) { 48a66: b1ca cmpal %a2,%a0 48a68: 6742 beqs 48aac <_Heap_Walk+0x462> if ( free_block == block ) { 48a6a: b1cc cmpal %a4,%a0 48a6c: 66f4 bnes 48a62 <_Heap_Walk+0x418> 48a6e: 2d47 ffec movel %d7,%fp@(-20) 48a72: 6000 fed2 braw 48946 <_Heap_Walk+0x2fc> block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 48a76: 41f9 0005 f5e1 lea 5f5e1 <_Status_Object_name_errors_to_status+0x53>,%a0 48a7c: 60ac bras 48a2a <_Heap_Walk+0x3e0> block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 48a7e: 43f9 0005 f5c7 lea 5f5c7 <_Status_Object_name_errors_to_status+0x39>,%a1 48a84: 608c bras 48a12 <_Heap_Walk+0x3c8> ); if ( block_size != next_block->prev_size ) { (*printer)( 48a86: 2f0b movel %a3,%sp@- 48a88: 2f01 movel %d1,%sp@- 48a8a: 2f02 movel %d2,%sp@- 48a8c: 2f0c movel %a4,%sp@- 48a8e: 4879 0005 f901 pea 5f901 <_Status_Object_name_errors_to_status+0x373> 48a94: 4878 0001 pea 1 48a98: 2f05 movel %d5,%sp@- 48a9a: 4e95 jsr %a5@ 48a9c: 4fef 001c lea %sp@(28),%sp block = next_block; } while ( block != first_block ); return true; } 48aa0: 4cee 3cfc ffc4 moveml %fp@(-60),%d2-%d7/%a2-%a5 return false; } if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; 48aa6: 4200 clrb %d0 block = next_block; } while ( block != first_block ); return true; } 48aa8: 4e5e unlk %fp 48aaa: 4e75 rts return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 48aac: 2f0c movel %a4,%sp@- 48aae: 4879 0005 f9a5 pea 5f9a5 <_Status_Object_name_errors_to_status+0x417> 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 ) ) { (*printer)( 48ab4: 4878 0001 pea 1 48ab8: 2f05 movel %d5,%sp@- 48aba: 4e95 jsr %a5@ 48abc: 4fef 0010 lea %sp@(16),%sp if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 48ac0: 4200 clrb %d0 48ac2: 6000 fca4 braw 48768 <_Heap_Walk+0x11e> return false; } if ( !prev_used ) { (*printer)( 48ac6: 2f0c movel %a4,%sp@- 48ac8: 4879 0005 f93a pea 5f93a <_Status_Object_name_errors_to_status+0x3ac> 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 ) ) { (*printer)( 48ace: 4878 0001 pea 1 48ad2: 2f05 movel %d5,%sp@- 48ad4: 4e95 jsr %a5@ 48ad6: 4fef 0010 lea %sp@(16),%sp if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 48ada: 4200 clrb %d0 48adc: 6000 fc8a braw 48768 <_Heap_Walk+0x11e> 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 ) { 48ae0: 222a 0020 movel %a2@(32),%d1 ); return false; } if ( _Heap_Is_used( free_block ) ) { 48ae4: 2844 moveal %d4,%a4 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 ) { 48ae6: 2d41 fff4 movel %d1,%fp@(-12) 48aea: 222e fff4 movel %fp@(-12),%d1 48aee: 2d43 fffc movel %d3,%fp@(-4) 48af2: 262e fff0 movel %fp@(-16),%d3 48af6: 2d47 ffec movel %d7,%fp@(-20) 48afa: 6000 fddc braw 488d8 <_Heap_Walk+0x28e> ... =============================================================================== 000472fa <_IO_Initialize_all_drivers>: * * Output Parameters: NONE */ void _IO_Initialize_all_drivers( void ) { 472fa: 4e56 0000 linkw %fp,#0 472fe: 2f0a movel %a2,%sp@- 47300: 2f02 movel %d2,%sp@- rtems_device_major_number major; for ( major=0 ; major < _IO_Number_of_drivers ; major ++ ) 47302: 4ab9 0006 18c2 tstl 618c2 <_IO_Number_of_drivers> 47308: 671e beqs 47328 <_IO_Initialize_all_drivers+0x2e><== NEVER TAKEN 4730a: 4282 clrl %d2 4730c: 45f9 0004 cbb4 lea 4cbb4 ,%a2 (void) rtems_io_initialize( major, 0, NULL ); 47312: 42a7 clrl %sp@- 47314: 42a7 clrl %sp@- 47316: 2f02 movel %d2,%sp@- void _IO_Initialize_all_drivers( void ) { rtems_device_major_number major; for ( major=0 ; major < _IO_Number_of_drivers ; major ++ ) 47318: 5282 addql #1,%d2 (void) rtems_io_initialize( major, 0, NULL ); 4731a: 4e92 jsr %a2@ void _IO_Initialize_all_drivers( void ) { rtems_device_major_number major; for ( major=0 ; major < _IO_Number_of_drivers ; major ++ ) 4731c: 4fef 000c lea %sp@(12),%sp 47320: b4b9 0006 18c2 cmpl 618c2 <_IO_Number_of_drivers>,%d2 47326: 65ea bcss 47312 <_IO_Initialize_all_drivers+0x18> (void) rtems_io_initialize( major, 0, NULL ); } 47328: 242e fff8 movel %fp@(-8),%d2 4732c: 246e fffc moveal %fp@(-4),%a2 47330: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00047260 <_IO_Manager_initialization>: * workspace. * */ void _IO_Manager_initialization(void) { 47260: 4e56 fff0 linkw %fp,#-16 47264: 48d7 003c moveml %d2-%d5,%sp@ uint32_t index; rtems_driver_address_table *driver_table; uint32_t drivers_in_table; uint32_t number_of_drivers; driver_table = Configuration.Device_driver_table; 47268: 2639 0005 f69e movel 5f69e ,%d3 drivers_in_table = Configuration.number_of_device_drivers; 4726e: 2439 0005 f69a movel 5f69a ,%d2 number_of_drivers = Configuration.maximum_drivers; 47274: 2839 0005 f696 movel 5f696 ,%d4 /* * If the user claims there are less drivers than are actually in * the table, then let's just go with the table's count. */ if ( number_of_drivers <= drivers_in_table ) 4727a: b882 cmpl %d2,%d4 4727c: 6366 blss 472e4 <_IO_Manager_initialization+0x84> * The application requested extra slots in the driver table, so we * have to allocate a new driver table and copy theirs to it. */ _IO_Driver_address_table = (rtems_driver_address_table *) _Workspace_Allocate_or_fatal_error( 4727e: 2004 movel %d4,%d0 47280: 2a04 movel %d4,%d5 47282: e788 lsll #3,%d0 47284: eb8d lsll #5,%d5 47286: 9a80 subl %d0,%d5 47288: 2f05 movel %d5,%sp@- 4728a: 4eb9 0004 a318 jsr 4a318 <_Workspace_Allocate_or_fatal_error> sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; memset( 47290: 2f05 movel %d5,%sp@- 47292: 42a7 clrl %sp@- /* * The application requested extra slots in the driver table, so we * have to allocate a new driver table and copy theirs to it. */ _IO_Driver_address_table = (rtems_driver_address_table *) 47294: 23c0 0006 18c6 movel %d0,618c6 <_IO_Driver_address_table> _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; memset( 4729a: 2f00 movel %d0,%sp@- _IO_Driver_address_table = (rtems_driver_address_table *) _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; 4729c: 23c4 0006 18c2 movel %d4,618c2 <_IO_Number_of_drivers> memset( 472a2: 4eb9 0004 f928 jsr 4f928 _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 472a8: 4fef 0010 lea %sp@(16),%sp 472ac: 4a82 tstl %d2 472ae: 672a beqs 472da <_IO_Manager_initialization+0x7a><== NEVER TAKEN 472b0: 2839 0006 18c6 movel 618c6 <_IO_Driver_address_table>,%d4 472b6: 4280 clrl %d0 472b8: 4281 clrl %d1 _IO_Driver_address_table[index] = driver_table[index]; 472ba: 2243 moveal %d3,%a1 472bc: 2044 moveal %d4,%a0 472be: d3c0 addal %d0,%a1 472c0: d1c0 addal %d0,%a0 memset( _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 472c2: 5281 addql #1,%d1 472c4: 0680 0000 0018 addil #24,%d0 _IO_Driver_address_table[index] = driver_table[index]; 472ca: 20d9 movel %a1@+,%a0@+ 472cc: 20d9 movel %a1@+,%a0@+ 472ce: 20d9 movel %a1@+,%a0@+ 472d0: 20d9 movel %a1@+,%a0@+ 472d2: 20d9 movel %a1@+,%a0@+ 472d4: 2091 movel %a1@,%a0@ memset( _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 472d6: b481 cmpl %d1,%d2 472d8: 66e0 bnes 472ba <_IO_Manager_initialization+0x5a> _IO_Driver_address_table[index] = driver_table[index]; } 472da: 4cee 003c fff0 moveml %fp@(-16),%d2-%d5 472e0: 4e5e unlk %fp 472e2: 4e75 rts * If the maximum number of driver is the same as the number in the * table, then we do not have to copy the driver table. They can't * register any dynamically. */ if ( number_of_drivers == drivers_in_table ) { _IO_Driver_address_table = driver_table; 472e4: 23c3 0006 18c6 movel %d3,618c6 <_IO_Driver_address_table> _IO_Number_of_drivers = number_of_drivers; 472ea: 23c2 0006 18c2 movel %d2,618c2 <_IO_Number_of_drivers> sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) _IO_Driver_address_table[index] = driver_table[index]; } 472f0: 4cee 003c fff0 moveml %fp@(-16),%d2-%d5 472f6: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00047ec8 <_Internal_error_Occurred>: void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 47ec8: 4e56 fffc linkw %fp,#-4 47ecc: 206e 0010 moveal %fp@(16),%a0 47ed0: 2f02 movel %d2,%sp@- 47ed2: 222e 000c movel %fp@(12),%d1 _Internal_errors_What_happened.the_source = the_source; _Internal_errors_What_happened.is_internal = is_internal; _Internal_errors_What_happened.the_error = the_error; _User_extensions_Fatal( the_source, is_internal, the_error ); 47ed6: 4282 clrl %d2 47ed8: 1401 moveb %d1,%d2 47eda: 2242 moveal %d2,%a1 47edc: 2f08 movel %a0,%sp@- void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 47ede: 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 ); 47ee2: 2f09 movel %a1,%sp@- Internal_errors_t the_error ) { _Internal_errors_What_happened.the_source = the_source; _Internal_errors_What_happened.is_internal = is_internal; 47ee4: 13c1 0006 10e2 moveb %d1,610e2 <_Internal_errors_What_happened+0x4> _Internal_errors_What_happened.the_error = the_error; _User_extensions_Fatal( the_source, is_internal, the_error ); 47eea: 2d48 fffc movel %a0,%fp@(-4) bool is_internal, Internal_errors_t the_error ) { _Internal_errors_What_happened.the_source = the_source; 47eee: 23c0 0006 10de movel %d0,610de <_Internal_errors_What_happened> _Internal_errors_What_happened.is_internal = is_internal; _Internal_errors_What_happened.the_error = the_error; 47ef4: 23c8 0006 10e4 movel %a0,610e4 <_Internal_errors_What_happened+0x6> _User_extensions_Fatal( the_source, is_internal, the_error ); 47efa: 2f00 movel %d0,%sp@- 47efc: 4eb9 0004 9ea2 jsr 49ea2 <_User_extensions_Fatal> _System_state_Set( SYSTEM_STATE_FAILED ); _CPU_Fatal_halt( the_error ); 47f02: 206e fffc moveal %fp@(-4),%a0 47f06: 327c 0700 moveaw #1792,%a1 47f0a: 2409 movel %a1,%d2 47f0c: 40c0 movew %sr,%d0 47f0e: 8082 orl %d2,%d0 47f10: 46c0 movew %d0,%sr 47f12: 2008 movel %a0,%d0 <== NOT EXECUTED 47f14: 223c dead beef movel #-559038737,%d1 <== NOT EXECUTED 47f1a: 4ac8 halt <== NOT EXECUTED RTEMS_INLINE_ROUTINE void _System_state_Set ( System_state_Codes state ) { _System_state_Current = state; 47f1c: 7005 moveq #5,%d0 47f1e: 4fef 000c lea %sp@(12),%sp 47f22: 23c0 0006 118c movel %d0,6118c <_System_state_Current> 47f28: 60fe bras 47f28 <_Internal_error_Occurred+0x60> ... =============================================================================== 00047f8c <_Objects_Allocate>: */ Objects_Control *_Objects_Allocate( Objects_Information *information ) { 47f8c: 4e56 fff0 linkw %fp,#-16 47f90: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ 47f94: 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 ) 47f98: 4aaa 0014 tstl %a2@(20) 47f9c: 6756 beqs 47ff4 <_Objects_Allocate+0x68> <== NEVER TAKEN /* * OK. The manager should be initialized and configured to have objects. * With any luck, it is safe to attempt to allocate an object. */ the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 47f9e: 240a movel %a2,%d2 47fa0: 0682 0000 001c addil #28,%d2 47fa6: 47f9 0004 75d4 lea 475d4 <_Chain_Get>,%a3 47fac: 2f02 movel %d2,%sp@- 47fae: 4e93 jsr %a3@ if ( information->auto_extend ) { 47fb0: 588f addql #4,%sp 47fb2: 4a2a 0010 tstb %a2@(16) 47fb6: 6732 beqs 47fea <_Objects_Allocate+0x5e> /* * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { 47fb8: 4a80 tstl %d0 47fba: 6744 beqs 48000 <_Objects_Allocate+0x74> } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 47fbc: 2040 moveal %d0,%a0 47fbe: 4281 clrl %d1 47fc0: 4283 clrl %d3 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; 47fc2: 4282 clrl %d2 } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 47fc4: 3228 000a movew %a0@(10),%d1 47fc8: 362a 0008 movew %a2@(8),%d3 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; 47fcc: 342a 0012 movew %a2@(18),%d2 information->inactive_per_block[ block ]--; 47fd0: 206a 002a moveal %a2@(42),%a0 } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 47fd4: 9283 subl %d3,%d1 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; 47fd6: 4c42 1001 remul %d2,%d1,%d1 information->inactive_per_block[ block ]--; information->inactive--; 47fda: 326a 0028 moveaw %a2@(40),%a1 block = (uint32_t) _Objects_Get_index( the_object->id ) - _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 47fde: e589 lsll #2,%d1 information->inactive--; 47fe0: 5389 subql #1,%a1 block = (uint32_t) _Objects_Get_index( the_object->id ) - _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 47fe2: d1c1 addal %d1,%a0 47fe4: 5390 subql #1,%a0@ information->inactive--; 47fe6: 3549 0028 movew %a1,%a2@(40) ); } #endif return the_object; } 47fea: 4cee 0c0c fff0 moveml %fp@(-16),%d2-%d3/%a2-%a3 47ff0: 4e5e unlk %fp 47ff2: 4e75 rts * still attempts to create the object, the information block * should be all zeroed out because it is in the BSS. So let's * check that code for this manager is even present. */ if ( information->size == 0 ) return NULL; 47ff4: 4280 clrl %d0 <== NOT EXECUTED ); } #endif return the_object; } 47ff6: 4cee 0c0c fff0 moveml %fp@(-16),%d2-%d3/%a2-%a3 <== NOT EXECUTED 47ffc: 4e5e unlk %fp <== NOT EXECUTED 47ffe: 4e75 rts <== NOT EXECUTED * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { _Objects_Extend_information( information ); 48000: 2f0a movel %a2,%sp@- 48002: 4eb9 0004 8044 jsr 48044 <_Objects_Extend_information> the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 48008: 2f02 movel %d2,%sp@- 4800a: 4e93 jsr %a3@ } if ( the_object ) { 4800c: 508f addql #8,%sp 4800e: 4a80 tstl %d0 48010: 66aa bnes 47fbc <_Objects_Allocate+0x30> ); } #endif return the_object; } 48012: 4cee 0c0c fff0 moveml %fp@(-16),%d2-%d3/%a2-%a3 48018: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004801c <_Objects_Close>: #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4801c: 4280 clrl %d0 void _Objects_Close( Objects_Information *information, Objects_Control *the_object ) { 4801e: 4e56 0000 linkw %fp,#0 48022: 206e 0008 moveal %fp@(8),%a0 48026: 226e 000c moveal %fp@(12),%a1 4802a: 2f0a movel %a2,%sp@- 4802c: 2468 0018 moveal %a0@(24),%a2 48030: 3029 000a movew %a1@(10),%d0 48034: 42b2 0c00 clrl %a2@(00000000,%d0:l:4) _Objects_Invalidate_Id( information, the_object ); _Objects_Namespace_remove( information, the_object ); } 48038: 245f moveal %sp@+,%a2 4803a: 4e5e unlk %fp Objects_Control *the_object ) { _Objects_Invalidate_Id( information, the_object ); _Objects_Namespace_remove( information, the_object ); 4803c: 4ef9 0004 85d8 jmp 485d8 <_Objects_Namespace_remove> ... =============================================================================== 00048044 <_Objects_Extend_information>: */ void _Objects_Extend_information( Objects_Information *information ) { 48044: 4e56 ffcc linkw %fp,#-52 48048: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 4804c: 246e 0008 moveal %fp@(8),%a2 /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); 48050: 4285 clrl %d5 index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 48052: 206a 002e moveal %a2@(46),%a0 /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); 48056: 3a2a 0008 movew %a2@(8),%d5 index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 4805a: 4a88 tstl %a0 4805c: 6700 0232 beqw 48290 <_Objects_Extend_information+0x24c> block_count = 0; else { block_count = information->maximum / information->allocation_size; 48060: 322a 000e movew %a2@(14),%d1 48064: 302a 0012 movew %a2@(18),%d0 48068: 3801 movew %d1,%d4 4806a: 0284 0000 ffff andil #65535,%d4 48070: 88c0 divuw %d0,%d4 48072: 0284 0000 ffff andil #65535,%d4 for ( ; block < block_count; block++ ) { 48078: 6700 022c beqw 482a6 <_Objects_Extend_information+0x262> if ( information->object_blocks[ block ] == NULL ) { 4807c: 4a90 tstl %a0@ 4807e: 6700 0236 beqw 482b6 <_Objects_Extend_information+0x272> * information - object information table * * Output parameters: NONE */ void _Objects_Extend_information( 48082: 5888 addql #4,%a0 /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); 48084: 2605 movel %d5,%d3 index_base = minimum_index; block = 0; 48086: 4282 clrl %d2 block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { if ( information->object_blocks[ block ] == NULL ) { 48088: 0280 0000 ffff andil #65535,%d0 do_extend = false; break; } else index_base += information->allocation_size; 4808e: d680 addl %d0,%d3 if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { 48090: 5282 addql #1,%d2 48092: b484 cmpl %d4,%d2 48094: 6400 01a6 bccw 4823c <_Objects_Extend_information+0x1f8> if ( information->object_blocks[ block ] == NULL ) { 48098: 4a98 tstl %a0@+ 4809a: 66f2 bnes 4808e <_Objects_Extend_information+0x4a> do_extend = false; 4809c: 4207 clrb %d7 } else index_base += information->allocation_size; } } maximum = (uint32_t) information->maximum + information->allocation_size; 4809e: 0281 0000 ffff andil #65535,%d1 480a4: 2641 moveal %d1,%a3 480a6: d7c0 addal %d0,%a3 /* * We need to limit the number of objects to the maximum number * representable in the index portion of the object Id. In the * case of 16-bit Ids, this is only 256 object instances. */ if ( maximum > OBJECTS_ID_FINAL_INDEX ) { 480a8: b7fc 0000 ffff cmpal #65535,%a3 480ae: 6200 0182 bhiw 48232 <_Objects_Extend_information+0x1ee> /* * Allocate the name table, and the objects and if it fails either return or * generate a fatal error depending on auto-extending being active. */ block_size = information->allocation_size * information->size; 480b2: 41ea 0014 lea %a2@(20),%a0 480b6: 4c10 0800 mulsl %a0@,%d0 if ( information->auto_extend ) { 480ba: 4a2a 0010 tstb %a2@(16) 480be: 6700 0182 beqw 48242 <_Objects_Extend_information+0x1fe> new_object_block = _Workspace_Allocate( block_size ); 480c2: 2f00 movel %d0,%sp@- 480c4: 4eb9 0004 a2e2 jsr 4a2e2 <_Workspace_Allocate> if ( !new_object_block ) 480ca: 588f addql #4,%sp * Allocate the name table, and the objects and if it fails either return or * generate a fatal error depending on auto-extending being active. */ block_size = information->allocation_size * information->size; if ( information->auto_extend ) { new_object_block = _Workspace_Allocate( block_size ); 480cc: 2c00 movel %d0,%d6 if ( !new_object_block ) 480ce: 6700 0162 beqw 48232 <_Objects_Extend_information+0x1ee> } /* * Do we need to grow the tables? */ if ( do_extend ) { 480d2: 4a07 tstb %d7 480d4: 6700 00be beqw 48194 <_Objects_Extend_information+0x150> */ /* * Up the block count and maximum */ block_count++; 480d8: 2a44 moveal %d4,%a5 480da: 528d addql #1,%a5 /* * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); 480dc: 200b movel %a3,%d0 /* * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + 480de: 41f5 da00 lea %a5@(00000000,%a5:l:2),%a0 ((maximum + minimum_index) * sizeof(Objects_Control *)); 480e2: d088 addl %a0,%d0 /* * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + 480e4: d085 addl %d5,%d0 block_count++; /* * Allocate the tables and break it up. */ block_size = block_count * 480e6: e588 lsll #2,%d0 (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); object_blocks = (void**) _Workspace_Allocate( block_size ); 480e8: 2f00 movel %d0,%sp@- 480ea: 4eb9 0004 a2e2 jsr 4a2e2 <_Workspace_Allocate> if ( !object_blocks ) { 480f0: 588f addql #4,%sp * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); object_blocks = (void**) _Workspace_Allocate( block_size ); 480f2: 2840 moveal %d0,%a4 if ( !object_blocks ) { 480f4: 4a80 tstl %d0 480f6: 6700 01ce beqw 482c6 <_Objects_Extend_information+0x282> } /* * Break the block into the various sections. */ inactive_per_block = (uint32_t *) _Addresses_Add_offset( 480fa: 2e0d movel %a5,%d7 * Take the block count down. Saves all the (block_count - 1) * in the copies. */ block_count--; if ( information->maximum > minimum_index ) { 480fc: 4280 clrl %d0 } /* * Break the block into the various sections. */ inactive_per_block = (uint32_t *) _Addresses_Add_offset( 480fe: e58f lsll #2,%d7 * Take the block count down. Saves all the (block_count - 1) * in the copies. */ block_count--; if ( information->maximum > minimum_index ) { 48100: 302a 000e movew %a2@(14),%d0 48104: 4bf4 7800 lea %a4@(00000000,%d7:l),%a5 48108: de8d addl %a5,%d7 4810a: b085 cmpl %d5,%d0 4810c: 6200 0144 bhiw 48252 <_Objects_Extend_information+0x20e> } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 48110: 4a85 tstl %d5 48112: 670c beqs 48120 <_Objects_Extend_information+0xdc><== NEVER TAKEN 48114: 2047 moveal %d7,%a0 48116: 4280 clrl %d0 local_table[ index ] = NULL; 48118: 4298 clrl %a0@+ } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 4811a: 5280 addql #1,%d0 4811c: b085 cmpl %d5,%d0 4811e: 65f8 bcss 48118 <_Objects_Extend_information+0xd4><== NEVER TAKEN 48120: e58c lsll #2,%d4 */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); 48122: 4281 clrl %d1 } /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; 48124: 42b4 4800 clrl %a4@(00000000,%d4:l) inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); 48128: 322a 0012 movew %a2@(18),%d1 /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; 4812c: 42b5 4800 clrl %a5@(00000000,%d4:l) for ( index=index_base ; index < ( information->allocation_size + index_base ); 48130: d283 addl %d3,%d1 * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; 48132: b283 cmpl %d3,%d1 48134: 6310 blss 48146 <_Objects_Extend_information+0x102><== NEVER TAKEN 48136: 2247 moveal %d7,%a1 * information - object information table * * Output parameters: NONE */ void _Objects_Extend_information( 48138: 2003 movel %d3,%d0 * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; 4813a: 41f1 3c00 lea %a1@(00000000,%d3:l:4),%a0 index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; 4813e: 4298 clrl %a0@+ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); index++ ) { 48140: 5280 addql #1,%d0 * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; 48142: b081 cmpl %d1,%d0 48144: 65f8 bcss 4813e <_Objects_Extend_information+0xfa> index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; } _ISR_Disable( level ); 48146: 203c 0000 0700 movel #1792,%d0 4814c: 40c4 movew %sr,%d4 4814e: 8084 orl %d4,%d0 48150: 46c0 movew %d0,%sr uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 48152: 2012 movel %a2@,%d0 48154: 7a18 moveq #24,%d5 information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; information->local_table = local_table; information->maximum = (Objects_Maximum) maximum; information->maximum_id = _Objects_Build_id( 48156: 4281 clrl %d1 48158: eba8 lsll %d5,%d0 4815a: 322a 0004 movew %a2@(4),%d1 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 4815e: 1a3c 001b moveb #27,%d5 uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 48162: 08c0 0010 bset #16,%d0 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 48166: eba9 lsll %d5,%d1 48168: 4285 clrl %d5 4816a: 8081 orl %d1,%d0 4816c: 3a0b movew %a3,%d5 local_table[ index ] = NULL; } _ISR_Disable( level ); old_tables = information->object_blocks; 4816e: 206a 002e moveal %a2@(46),%a0 uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 48172: 8085 orl %d5,%d0 information->object_blocks = object_blocks; 48174: 254c 002e movel %a4,%a2@(46) information->inactive_per_block = inactive_per_block; information->local_table = local_table; information->maximum = (Objects_Maximum) maximum; 48178: 354b 000e movew %a3,%a2@(14) _ISR_Disable( level ); old_tables = information->object_blocks; information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; 4817c: 254d 002a movel %a5,%a2@(42) information->local_table = local_table; 48180: 2547 0018 movel %d7,%a2@(24) 48184: 2540 000a movel %d0,%a2@(10) information->the_class, _Objects_Local_node, information->maximum ); _ISR_Enable( level ); 48188: 46c4 movew %d4,%sr _Workspace_Free( old_tables ); 4818a: 2f08 movel %a0,%sp@- 4818c: 4eb9 0004 a2fe jsr 4a2fe <_Workspace_Free> 48192: 588f addql #4,%sp } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 48194: 206a 002e moveal %a2@(46),%a0 /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 48198: 4280 clrl %d0 4819a: 280e movel %fp,%d4 4819c: 0684 ffff fff4 addil #-12,%d4 481a2: 47f9 0004 75d4 lea 475d4 <_Chain_Get>,%a3 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 481a8: 2a0a movel %a2,%d5 481aa: 0685 0000 001c addil #28,%d5 481b0: 49f9 0004 7574 lea 47574 <_Chain_Append>,%a4 } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 481b6: e58a lsll #2,%d2 /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 481b8: 302a 0012 movew %a2@(18),%d0 } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 481bc: 2186 2800 movel %d6,%a0@(00000000,%d2:l) /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 481c0: 2f2a 0014 movel %a2@(20),%sp@- 481c4: 206a 002e moveal %a2@(46),%a0 481c8: 2f00 movel %d0,%sp@- 481ca: 2f30 2800 movel %a0@(00000000,%d2:l),%sp@- 481ce: 2f04 movel %d4,%sp@- 481d0: 4eb9 0004 cbfc jsr 4cbfc <_Chain_Initialize> /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { 481d6: 4fef 0010 lea %sp@(16),%sp 481da: 2f04 movel %d4,%sp@- 481dc: 4e93 jsr %a3@ 481de: 588f addql #4,%sp 481e0: 4a80 tstl %d0 481e2: 6734 beqs 48218 <_Objects_Extend_information+0x1d4><== NEVER TAKEN 481e4: 2212 movel %a2@,%d1 481e6: 7e18 moveq #24,%d7 the_object->id = _Objects_Build_id( 481e8: 4286 clrl %d6 481ea: 2040 moveal %d0,%a0 481ec: 3c2a 0004 movew %a2@(4),%d6 481f0: efa9 lsll %d7,%d1 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 481f2: 1e3c 001b moveb #27,%d7 uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 481f6: 08c1 0010 bset #16,%d1 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 481fa: efae lsll %d7,%d6 481fc: 8286 orl %d6,%d1 uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 481fe: 8283 orl %d3,%d1 index ); _Chain_Append( &information->Inactive, &the_object->Node ); index++; 48200: 5283 addql #1,%d3 48202: 2141 0008 movel %d1,%a0@(8) information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 48206: 2f00 movel %d0,%sp@- 48208: 2f05 movel %d5,%sp@- 4820a: 4e94 jsr %a4@ index++; 4820c: 508f addql #8,%sp /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { 4820e: 2f04 movel %d4,%sp@- 48210: 4e93 jsr %a3@ 48212: 588f addql #4,%sp 48214: 4a80 tstl %d0 48216: 66cc bnes 481e4 <_Objects_Extend_information+0x1a0> _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 48218: 4281 clrl %d1 4821a: 302a 0012 movew %a2@(18),%d0 information->inactive = (Objects_Maximum)(information->inactive + information->allocation_size); 4821e: 326a 0028 moveaw %a2@(40),%a1 _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 48222: 206a 002a moveal %a2@(42),%a0 48226: 3200 movew %d0,%d1 information->inactive = (Objects_Maximum)(information->inactive + information->allocation_size); 48228: d089 addl %a1,%d0 _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 4822a: 2181 2800 movel %d1,%a0@(00000000,%d2:l) information->inactive = 4822e: 3540 0028 movew %d0,%a2@(40) (Objects_Maximum)(information->inactive + information->allocation_size); } 48232: 4cee 3cfc ffcc moveml %fp@(-52),%d2-%d7/%a2-%a5 48238: 4e5e unlk %fp 4823a: 4e75 rts /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; 4823c: 7e01 moveq #1,%d7 4823e: 6000 fe5e braw 4809e <_Objects_Extend_information+0x5a> if ( information->auto_extend ) { new_object_block = _Workspace_Allocate( block_size ); if ( !new_object_block ) return; } else { new_object_block = _Workspace_Allocate_or_fatal_error( block_size ); 48242: 2f00 movel %d0,%sp@- 48244: 4eb9 0004 a318 jsr 4a318 <_Workspace_Allocate_or_fatal_error> 4824a: 588f addql #4,%sp 4824c: 2c00 movel %d0,%d6 4824e: 6000 fe82 braw 480d2 <_Objects_Extend_information+0x8e> /* * Copy each section of the table over. This has to be performed as * separate parts as size of each block has changed. */ memcpy( object_blocks, 48252: e58c lsll #2,%d4 48254: 2f04 movel %d4,%sp@- 48256: 2f2a 002e movel %a2@(46),%sp@- 4825a: 2f0c movel %a4,%sp@- 4825c: 4eb9 0004 f8b8 jsr 4f8b8 information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, 48262: 2f04 movel %d4,%sp@- 48264: 2f2a 002a movel %a2@(42),%sp@- 48268: 2f0d movel %a5,%sp@- 4826a: 4eb9 0004 f8b8 jsr 4f8b8 information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, information->local_table, (information->maximum + minimum_index) * sizeof(Objects_Control *) ); 48270: 4280 clrl %d0 48272: 302a 000e movew %a2@(14),%d0 48276: da80 addl %d0,%d5 information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, 48278: e58d lsll #2,%d5 4827a: 2f05 movel %d5,%sp@- 4827c: 2f2a 0018 movel %a2@(24),%sp@- 48280: 2f07 movel %d7,%sp@- 48282: 4eb9 0004 f8b8 jsr 4f8b8 48288: 4fef 0024 lea %sp@(36),%sp 4828c: 6000 fe94 braw 48122 <_Objects_Extend_information+0xde> minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 48290: 4280 clrl %d0 /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); 48292: 2605 movel %d5,%d3 index_base = minimum_index; block = 0; 48294: 4282 clrl %d2 /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) block_count = 0; 48296: 4284 clrl %d4 minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 48298: 322a 000e movew %a2@(14),%d1 4829c: 302a 0012 movew %a2@(18),%d0 /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; 482a0: 7e01 moveq #1,%d7 482a2: 6000 fdfa braw 4809e <_Objects_Extend_information+0x5a> minimum_index = _Objects_Get_index( information->minimum_id ); 482a6: 2605 movel %d5,%d3 <== NOT EXECUTED index_base = minimum_index; block = 0; 482a8: 4282 clrl %d2 <== NOT EXECUTED if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { 482aa: 0280 0000 ffff andil #65535,%d0 <== NOT EXECUTED /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; 482b0: 7e01 moveq #1,%d7 <== NOT EXECUTED 482b2: 6000 fdea braw 4809e <_Objects_Extend_information+0x5a><== NOT EXECUTED minimum_index = _Objects_Get_index( information->minimum_id ); 482b6: 2605 movel %d5,%d3 <== NOT EXECUTED index_base = minimum_index; block = 0; 482b8: 4282 clrl %d2 <== NOT EXECUTED block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { if ( information->object_blocks[ block ] == NULL ) { 482ba: 0280 0000 ffff andil #65535,%d0 <== NOT EXECUTED do_extend = false; 482c0: 4207 clrb %d7 <== NOT EXECUTED 482c2: 6000 fdda braw 4809e <_Objects_Extend_information+0x5a><== NOT EXECUTED (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); object_blocks = (void**) _Workspace_Allocate( block_size ); if ( !object_blocks ) { _Workspace_Free( new_object_block ); 482c6: 2f06 movel %d6,%sp@- 482c8: 4eb9 0004 a2fe jsr 4a2fe <_Workspace_Free> return; 482ce: 588f addql #4,%sp } information->inactive_per_block[ block ] = information->allocation_size; information->inactive = (Objects_Maximum)(information->inactive + information->allocation_size); } 482d0: 4cee 3cfc ffcc moveml %fp@(-52),%d2-%d7/%a2-%a5 482d6: 4e5e unlk %fp ... =============================================================================== 0004838c <_Objects_Get_information>: Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint16_t the_class ) { 4838c: 4e56 0000 linkw %fp,#0 48390: 2f03 movel %d3,%sp@- 48392: 262e 0008 movel %fp@(8),%d3 48396: 2f02 movel %d2,%sp@- 48398: 342e 000e movew %fp@(14),%d2 Objects_Information *info; int the_class_api_maximum; if ( !the_class ) 4839c: 6744 beqs 483e2 <_Objects_Get_information+0x56> /* * 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 ); 4839e: 2f03 movel %d3,%sp@- 483a0: 4eb9 0004 d0fc jsr 4d0fc <_Objects_API_maximum_class> if ( the_class_api_maximum == 0 ) 483a6: 588f addql #4,%sp 483a8: 4a80 tstl %d0 483aa: 6736 beqs 483e2 <_Objects_Get_information+0x56> return NULL; if ( the_class > (uint32_t) the_class_api_maximum ) 483ac: 0282 0000 ffff andil #65535,%d2 483b2: b480 cmpl %d0,%d2 483b4: 622c bhis 483e2 <_Objects_Get_information+0x56> return NULL; if ( !_Objects_Information_table[ the_api ] ) 483b6: 41f9 0006 1004 lea 61004 <_Objects_Information_table>,%a0 483bc: 2070 3c00 moveal %a0@(00000000,%d3:l:4),%a0 483c0: 4a88 tstl %a0 483c2: 671e beqs 483e2 <_Objects_Get_information+0x56> <== NEVER TAKEN return NULL; info = _Objects_Information_table[ the_api ][ the_class ]; 483c4: 2030 2c00 movel %a0@(00000000,%d2:l:4),%d0 if ( !info ) 483c8: 670c beqs 483d6 <_Objects_Get_information+0x4a> <== NEVER TAKEN * Thus we may have 0 local instances and still have a valid object * pointer. */ #if !defined(RTEMS_MULTIPROCESSING) if ( info->maximum == 0 ) return NULL; 483ca: 2040 moveal %d0,%a0 483cc: 4a68 000e tstw %a0@(14) 483d0: 56c1 sne %d1 483d2: 49c1 extbl %d1 483d4: c081 andl %d1,%d0 #endif return info; } 483d6: 242e fff8 movel %fp@(-8),%d2 483da: 262e fffc movel %fp@(-4),%d3 483de: 4e5e unlk %fp 483e0: 4e75 rts 483e2: 242e fff8 movel %fp@(-8),%d2 if ( the_class > (uint32_t) the_class_api_maximum ) return NULL; if ( !_Objects_Information_table[ the_api ] ) return NULL; 483e6: 4280 clrl %d0 if ( info->maximum == 0 ) return NULL; #endif return info; } 483e8: 262e fffc movel %fp@(-4),%d3 483ec: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000483a0 <_Objects_Get_next>: Objects_Information *information, Objects_Id id, Objects_Locations *location_p, Objects_Id *next_id_p ) { 483a0: 4e56 ffec linkw %fp,#-20 483a4: 48d7 3c04 moveml %d2/%a2-%a5,%sp@ 483a8: 246e 0008 moveal %fp@(8),%a2 483ac: 242e 000c movel %fp@(12),%d2 483b0: 266e 0010 moveal %fp@(16),%a3 483b4: 2a6e 0014 moveal %fp@(20),%a5 Objects_Control *object; Objects_Id next_id; if ( !information ) 483b8: 4a8a tstl %a2 483ba: 6756 beqs 48412 <_Objects_Get_next+0x72> <== NEVER TAKEN return NULL; if ( !location_p ) 483bc: 4a8b tstl %a3 483be: 6752 beqs 48412 <_Objects_Get_next+0x72> <== NEVER TAKEN return NULL; if ( !next_id_p ) 483c0: 4a8d tstl %a5 483c2: 674e beqs 48412 <_Objects_Get_next+0x72> <== NEVER TAKEN return NULL; if (_Objects_Get_index(id) == OBJECTS_ID_INITIAL_INDEX) 483c4: 4a42 tstw %d2 483c6: 6604 bnes 483cc <_Objects_Get_next+0x2c> next_id = information->minimum_id; 483c8: 242a 0006 movel %a2@(6),%d2 *location_p = OBJECTS_ERROR; goto final; } /* try to grab one */ object = _Objects_Get(information, next_id, location_p); 483cc: 49f9 0004 8420 lea 48420 <_Objects_Get>,%a4 else next_id = id; do { /* walked off end of list? */ if (_Objects_Get_index(next_id) > information->maximum) 483d2: 4281 clrl %d1 483d4: 4280 clrl %d0 483d6: 322a 000e movew %a2@(14),%d1 483da: 3002 movew %d2,%d0 483dc: b081 cmpl %d1,%d0 483de: 621e bhis 483fe <_Objects_Get_next+0x5e> *location_p = OBJECTS_ERROR; goto final; } /* try to grab one */ object = _Objects_Get(information, next_id, location_p); 483e0: 2f0b movel %a3,%sp@- 483e2: 2f02 movel %d2,%sp@- next_id++; 483e4: 5282 addql #1,%d2 *location_p = OBJECTS_ERROR; goto final; } /* try to grab one */ object = _Objects_Get(information, next_id, location_p); 483e6: 2f0a movel %a2,%sp@- 483e8: 4e94 jsr %a4@ next_id++; } while (*location_p != OBJECTS_LOCAL); 483ea: 4fef 000c lea %sp@(12),%sp 483ee: 4a93 tstl %a3@ 483f0: 66e0 bnes 483d2 <_Objects_Get_next+0x32> *next_id_p = next_id; 483f2: 2a82 movel %d2,%a5@ return object; final: *next_id_p = OBJECTS_ID_FINAL; return 0; } 483f4: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 483fa: 4e5e unlk %fp 483fc: 4e75 rts do { /* walked off end of list? */ if (_Objects_Get_index(next_id) > information->maximum) { *location_p = OBJECTS_ERROR; 483fe: 7001 moveq #1,%d0 *next_id_p = next_id; return object; final: *next_id_p = OBJECTS_ID_FINAL; 48400: 72ff moveq #-1,%d1 do { /* walked off end of list? */ if (_Objects_Get_index(next_id) > information->maximum) { *location_p = OBJECTS_ERROR; 48402: 2680 movel %d0,%a3@ *next_id_p = next_id; return object; final: *next_id_p = OBJECTS_ID_FINAL; return 0; 48404: 4280 clrl %d0 *next_id_p = next_id; return object; final: *next_id_p = OBJECTS_ID_FINAL; 48406: 2a81 movel %d1,%a5@ return 0; } 48408: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 4840e: 4e5e unlk %fp 48410: 4e75 rts if ( !location_p ) return NULL; if ( !next_id_p ) return NULL; 48412: 4280 clrl %d0 return object; final: *next_id_p = OBJECTS_ID_FINAL; return 0; } 48414: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 4841a: 4e5e unlk %fp ... =============================================================================== 00059f00 <_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; 59f00: 7001 moveq #1,%d0 if ( information->maximum >= index ) { 59f02: 4281 clrl %d1 Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 59f04: 4e56 0000 linkw %fp,#0 59f08: 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; 59f0c: 90a8 0006 subl %a0@(6),%d0 59f10: d0ae 000c addl %fp@(12),%d0 if ( information->maximum >= index ) { 59f14: 3228 000e movew %a0@(14),%d1 Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 59f18: 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 ) { 59f1c: b280 cmpl %d0,%d1 59f1e: 6510 bcss 59f30 <_Objects_Get_no_protection+0x30> if ( (the_object = information->local_table[ index ]) != NULL ) { 59f20: 2068 0018 moveal %a0@(24),%a0 59f24: 2030 0c00 movel %a0@(00000000,%d0:l:4),%d0 59f28: 6706 beqs 59f30 <_Objects_Get_no_protection+0x30><== NEVER TAKEN *location = OBJECTS_LOCAL; 59f2a: 4291 clrl %a1@ * This isn't supported or required yet for Global objects so * if it isn't local, we don't find it. */ *location = OBJECTS_ERROR; return NULL; } 59f2c: 4e5e unlk %fp 59f2e: 4e75 rts /* * This isn't supported or required yet for Global objects so * if it isn't local, we don't find it. */ *location = OBJECTS_ERROR; 59f30: 7001 moveq #1,%d0 return NULL; } 59f32: 4e5e unlk %fp /* * This isn't supported or required yet for Global objects so * if it isn't local, we don't find it. */ *location = OBJECTS_ERROR; 59f34: 2280 movel %d0,%a1@ return NULL; 59f36: 4280 clrl %d0 } ... =============================================================================== 00048e04 <_Objects_Id_to_name>: */ Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { 48e04: 4e56 fffc linkw %fp,#-4 48e08: 202e 0008 movel %fp@(8),%d0 48e0c: 2f02 movel %d2,%sp@- /* * Caller is trusted for name != NULL. */ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 48e0e: 4a80 tstl %d0 48e10: 664e bnes 48e60 <_Objects_Id_to_name+0x5c> 48e12: 2079 0006 26c2 moveal 626c2 <_Per_CPU_Information+0xc>,%a0 48e18: 2228 0008 movel %a0@(8),%d1 48e1c: 7418 moveq #24,%d2 48e1e: 2001 movel %d1,%d0 48e20: e4a8 lsrl %d2,%d0 48e22: 143c 0007 moveb #7,%d2 48e26: c082 andl %d2,%d0 */ RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid( uint32_t the_api ) { if ( !the_api || the_api > OBJECTS_APIS_LAST ) 48e28: 143c 0002 moveb #2,%d2 48e2c: 2040 moveal %d0,%a0 48e2e: 5388 subql #1,%a0 48e30: b488 cmpl %a0,%d2 48e32: 6522 bcss 48e56 <_Objects_Id_to_name+0x52> the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; if ( !_Objects_Information_table[ the_api ] ) 48e34: 41f9 0006 221c lea 6221c <_Objects_Information_table>,%a0 48e3a: 2070 0c00 moveal %a0@(00000000,%d0:l:4),%a0 48e3e: 4a88 tstl %a0 48e40: 6714 beqs 48e56 <_Objects_Id_to_name+0x52> */ RTEMS_INLINE_ROUTINE uint32_t _Objects_Get_class( Objects_Id id ) { return (uint32_t) 48e42: 2001 movel %d1,%d0 48e44: 741b moveq #27,%d2 48e46: e4a8 lsrl %d2,%d0 return OBJECTS_INVALID_ID; the_class = _Objects_Get_class( tmpId ); information = _Objects_Information_table[ the_api ][ the_class ]; 48e48: 2070 0c00 moveal %a0@(00000000,%d0:l:4),%a0 if ( !information ) 48e4c: 4a88 tstl %a0 48e4e: 6706 beqs 48e56 <_Objects_Id_to_name+0x52> <== NEVER TAKEN return OBJECTS_INVALID_ID; #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) 48e50: 4a28 0032 tstb %a0@(50) 48e54: 670e beqs 48e64 <_Objects_Id_to_name+0x60> <== ALWAYS TAKEN return OBJECTS_INVALID_ID; *name = the_object->name; _Thread_Enable_dispatch(); return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; } 48e56: 242e fff8 movel %fp@(-8),%d2 the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; if ( !_Objects_Information_table[ the_api ] ) return OBJECTS_INVALID_ID; 48e5a: 7003 moveq #3,%d0 return OBJECTS_INVALID_ID; *name = the_object->name; _Thread_Enable_dispatch(); return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; } 48e5c: 4e5e unlk %fp 48e5e: 4e75 rts /* * Caller is trusted for name != NULL. */ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 48e60: 2200 movel %d0,%d1 48e62: 60b8 bras 48e1c <_Objects_Id_to_name+0x18> #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) return OBJECTS_INVALID_ID; #endif the_object = _Objects_Get( information, tmpId, &ignored_location ); 48e64: 486e fffc pea %fp@(-4) 48e68: 2f01 movel %d1,%sp@- 48e6a: 2f08 movel %a0,%sp@- 48e6c: 4eb9 0004 8d90 jsr 48d90 <_Objects_Get> if ( !the_object ) 48e72: 4fef 000c lea %sp@(12),%sp 48e76: 4a80 tstl %d0 48e78: 67dc beqs 48e56 <_Objects_Id_to_name+0x52> <== NEVER TAKEN return OBJECTS_INVALID_ID; *name = the_object->name; 48e7a: 206e 000c moveal %fp@(12),%a0 48e7e: 2240 moveal %d0,%a1 48e80: 20a9 000c movel %a1@(12),%a0@ _Thread_Enable_dispatch(); 48e84: 4eb9 0004 9b68 jsr 49b68 <_Thread_Enable_dispatch> return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; } 48e8a: 242e fff8 movel %fp@(-8),%d2 if ( !the_object ) return OBJECTS_INVALID_ID; *name = the_object->name; _Thread_Enable_dispatch(); return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; 48e8e: 4280 clrl %d0 } 48e90: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00048780 <_Objects_Set_name>: { size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 48780: 4280 clrl %d0 bool _Objects_Set_name( Objects_Information *information, Objects_Control *the_object, const char *name ) { 48782: 4e56 fff0 linkw %fp,#-16 48786: 48d7 3c00 moveml %a2-%a5,%sp@ 4878a: 286e 0008 moveal %fp@(8),%a4 size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 4878e: 302c 0034 movew %a4@(52),%d0 bool _Objects_Set_name( Objects_Information *information, Objects_Control *the_object, const char *name ) { 48792: 246e 0010 moveal %fp@(16),%a2 size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 48796: 2f00 movel %d0,%sp@- bool _Objects_Set_name( Objects_Information *information, Objects_Control *the_object, const char *name ) { 48798: 2a6e 000c moveal %fp@(12),%a5 size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 4879c: 2f0a movel %a2,%sp@- 4879e: 4eb9 0005 0a7c jsr 50a7c #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) { 487a4: 508f addql #8,%sp { size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 487a6: 2640 moveal %d0,%a3 #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) { 487a8: 4a2c 0032 tstb %a4@(50) 487ac: 6662 bnes 48810 <_Objects_Set_name+0x90> d[length] = '\0'; the_object->name.name_p = d; } else #endif { the_object->name.name_u32 = _Objects_Build_name( 487ae: 7018 moveq #24,%d0 487b0: 1212 moveb %a2@,%d1 487b2: 49c1 extbl %d1 487b4: e1a9 lsll %d0,%d1 487b6: 103c 0001 moveb #1,%d0 487ba: b08b cmpl %a3,%d0 487bc: 643c bccs 487fa <_Objects_Set_name+0x7a> 487be: 102a 0001 moveb %a2@(1),%d0 487c2: 49c0 extbl %d0 487c4: 4840 swap %d0 487c6: 4240 clrw %d0 487c8: 8081 orl %d1,%d0 487ca: 7202 moveq #2,%d1 487cc: b28b cmpl %a3,%d1 487ce: 6730 beqs 48800 <_Objects_Set_name+0x80> 487d0: 122a 0002 moveb %a2@(2),%d1 487d4: 49c1 extbl %d1 487d6: e189 lsll #8,%d1 487d8: 8081 orl %d1,%d0 487da: 7203 moveq #3,%d1 487dc: b28b cmpl %a3,%d1 487de: 6700 0082 beqw 48862 <_Objects_Set_name+0xe2> 487e2: 122a 0003 moveb %a2@(3),%d1 487e6: 49c1 extbl %d1 487e8: 8081 orl %d1,%d0 487ea: 2b40 000c movel %d0,%a5@(12) ((3 < length) ? s[ 3 ] : ' ') ); } return true; 487ee: 7001 moveq #1,%d0 } 487f0: 4cee 3c00 fff0 moveml %fp@(-16),%a2-%a5 487f6: 4e5e unlk %fp 487f8: 4e75 rts d[length] = '\0'; the_object->name.name_p = d; } else #endif { the_object->name.name_u32 = _Objects_Build_name( 487fa: 2001 movel %d1,%d0 487fc: 08c0 0015 bset #21,%d0 48800: 7220 moveq #32,%d1 48802: 08c0 000d bset #13,%d0 48806: 8081 orl %d1,%d0 48808: 2b40 000c movel %d0,%a5@(12) ((3 < length) ? s[ 3 ] : ' ') ); } return true; 4880c: 7001 moveq #1,%d0 4880e: 60e0 bras 487f0 <_Objects_Set_name+0x70> #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) { char *d; d = _Workspace_Allocate( length + 1 ); 48810: 486b 0001 pea %a3@(1) 48814: 4eb9 0004 a4c2 jsr 4a4c2 <_Workspace_Allocate> if ( !d ) 4881a: 588f addql #4,%sp #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) { char *d; d = _Workspace_Allocate( length + 1 ); 4881c: 2840 moveal %d0,%a4 if ( !d ) 4881e: 4a80 tstl %d0 48820: 6734 beqs 48856 <_Objects_Set_name+0xd6> return false; _Workspace_Free( (void *)the_object->name.name_p ); 48822: 2f2d 000c movel %a5@(12),%sp@- 48826: 4eb9 0004 a4de jsr 4a4de <_Workspace_Free> the_object->name.name_p = NULL; strncpy( d, name, length ); 4882c: 2f0b movel %a3,%sp@- 4882e: 2f0a movel %a2,%sp@- d = _Workspace_Allocate( length + 1 ); if ( !d ) return false; _Workspace_Free( (void *)the_object->name.name_p ); the_object->name.name_p = NULL; 48830: 42ad 000c clrl %a5@(12) strncpy( d, name, length ); 48834: 2f0c movel %a4,%sp@- 48836: 4eb9 0005 09f4 jsr 509f4 d[length] = '\0'; the_object->name.name_p = d; 4883c: 4fef 0010 lea %sp@(16),%sp _Workspace_Free( (void *)the_object->name.name_p ); the_object->name.name_p = NULL; strncpy( d, name, length ); d[length] = '\0'; 48840: 4200 clrb %d0 48842: 1980 b800 moveb %d0,%a4@(00000000,%a3:l) ((3 < length) ? s[ 3 ] : ' ') ); } return true; 48846: 7001 moveq #1,%d0 _Workspace_Free( (void *)the_object->name.name_p ); the_object->name.name_p = NULL; strncpy( d, name, length ); d[length] = '\0'; the_object->name.name_p = d; 48848: 2b4c 000c movel %a4,%a5@(12) ); } return true; } 4884c: 4cee 3c00 fff0 moveml %fp@(-16),%a2-%a5 48852: 4e5e unlk %fp 48854: 4e75 rts 48856: 4cee 3c00 fff0 moveml %fp@(-16),%a2-%a5 if ( information->is_string ) { char *d; d = _Workspace_Allocate( length + 1 ); if ( !d ) return false; 4885c: 4200 clrb %d0 ); } return true; } 4885e: 4e5e unlk %fp 48860: 4e75 rts d[length] = '\0'; the_object->name.name_p = d; } else #endif { the_object->name.name_u32 = _Objects_Build_name( 48862: 7220 moveq #32,%d1 48864: 8081 orl %d1,%d0 48866: 2b40 000c movel %d0,%a5@(12) ((3 < length) ? s[ 3 ] : ' ') ); } return true; 4886a: 7001 moveq #1,%d0 4886c: 6082 bras 487f0 <_Objects_Set_name+0x70> ... =============================================================================== 00048690 <_Objects_Shrink_information>: /* * Search the list to find block or chunk with all objects inactive. */ index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / 48690: 4281 clrl %d1 */ void _Objects_Shrink_information( Objects_Information *information ) { 48692: 4e56 ffec linkw %fp,#-20 48696: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 4869a: 246e 0008 moveal %fp@(8),%a2 /* * Search the list to find block or chunk with all objects inactive. */ index_base = _Objects_Get_index( information->minimum_id ); 4869e: 4282 clrl %d2 block_count = (information->maximum - index_base) / 486a0: 4283 clrl %d3 /* * Search the list to find block or chunk with all objects inactive. */ index_base = _Objects_Get_index( information->minimum_id ); 486a2: 342a 0008 movew %a2@(8),%d2 block_count = (information->maximum - index_base) / 486a6: 362a 000e movew %a2@(14),%d3 486aa: 322a 0012 movew %a2@(18),%d1 486ae: 9682 subl %d2,%d3 486b0: 4c41 3003 remul %d1,%d3,%d3 information->allocation_size; for ( block = 0; block < block_count; block++ ) { 486b4: 6774 beqs 4872a <_Objects_Shrink_information+0x9a><== NEVER TAKEN if ( information->inactive_per_block[ block ] == 486b6: 206a 002a moveal %a2@(42),%a0 486ba: b290 cmpl %a0@,%d1 486bc: 677e beqs 4873c <_Objects_Shrink_information+0xac><== NEVER TAKEN * the_block - the block to remove * * Output parameters: NONE */ void _Objects_Shrink_information( 486be: 5888 addql #4,%a0 index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / information->allocation_size; for ( block = 0; block < block_count; block++ ) { 486c0: 4280 clrl %d0 486c2: 5280 addql #1,%d0 information->inactive -= information->allocation_size; return; } index_base += information->allocation_size; 486c4: d481 addl %d1,%d2 index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / information->allocation_size; for ( block = 0; block < block_count; block++ ) { 486c6: b680 cmpl %d0,%d3 486c8: 6760 beqs 4872a <_Objects_Shrink_information+0x9a> if ( information->inactive_per_block[ block ] == 486ca: 2800 movel %d0,%d4 486cc: e58c lsll #2,%d4 486ce: b298 cmpl %a0@+,%d1 486d0: 66f0 bnes 486c2 <_Objects_Shrink_information+0x32> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 486d2: 206a 001c moveal %a2@(28),%a0 */ extract_me = the_object; the_object = (Objects_Control *) the_object->Node.next; if ((index >= index_base) && (index < (index_base + information->allocation_size))) { _Chain_Extract( &extract_me->Node ); 486d6: 47f9 0004 75ac lea 475ac <_Chain_Extract>,%a3 * Assume the Inactive chain is never empty at this point */ the_object = (Objects_Control *) _Chain_First( &information->Inactive ); do { index = _Objects_Get_index( the_object->id ); 486dc: 4280 clrl %d0 486de: 3028 000a movew %a0@(10),%d0 /* * Get the next node before the node is extracted */ extract_me = the_object; the_object = (Objects_Control *) the_object->Node.next; 486e2: 2610 movel %a0@,%d3 if ((index >= index_base) && 486e4: b480 cmpl %d0,%d2 486e6: 620c bhis 486f4 <_Objects_Shrink_information+0x64> (index < (index_base + information->allocation_size))) { 486e8: 4281 clrl %d1 486ea: 322a 0012 movew %a2@(18),%d1 486ee: d282 addl %d2,%d1 /* * Get the next node before the node is extracted */ extract_me = the_object; the_object = (Objects_Control *) the_object->Node.next; if ((index >= index_base) && 486f0: b280 cmpl %d0,%d1 486f2: 6240 bhis 48734 <_Objects_Shrink_information+0xa4> (index < (index_base + information->allocation_size))) { _Chain_Extract( &extract_me->Node ); } } while ( the_object ); 486f4: 4a83 tstl %d3 486f6: 6704 beqs 486fc <_Objects_Shrink_information+0x6c> index = _Objects_Get_index( the_object->id ); /* * Get the next node before the node is extracted */ extract_me = the_object; the_object = (Objects_Control *) the_object->Node.next; 486f8: 2043 moveal %d3,%a0 486fa: 60e0 bras 486dc <_Objects_Shrink_information+0x4c> while ( the_object ); /* * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); 486fc: 206a 002e moveal %a2@(46),%a0 48700: 2f30 4800 movel %a0@(00000000,%d4:l),%sp@- 48704: 4eb9 0004 a2fe jsr 4a2fe <_Workspace_Free> information->object_blocks[ block ] = NULL; 4870a: 206a 002e moveal %a2@(46),%a0 information->inactive_per_block[ block ] = 0; information->inactive -= information->allocation_size; return; 4870e: 588f addql #4,%sp /* * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); information->object_blocks[ block ] = NULL; 48710: 42b0 4800 clrl %a0@(00000000,%d4:l) information->inactive_per_block[ block ] = 0; 48714: 206a 002a moveal %a2@(42),%a0 information->inactive -= information->allocation_size; 48718: 302a 0028 movew %a2@(40),%d0 4871c: 322a 0012 movew %a2@(18),%d1 * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); information->object_blocks[ block ] = NULL; information->inactive_per_block[ block ] = 0; 48720: 42b0 4800 clrl %a0@(00000000,%d4:l) information->inactive -= information->allocation_size; 48724: 9081 subl %d1,%d0 48726: 3540 0028 movew %d0,%a2@(40) return; } index_base += information->allocation_size; } } 4872a: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 48730: 4e5e unlk %fp 48732: 4e75 rts */ extract_me = the_object; the_object = (Objects_Control *) the_object->Node.next; if ((index >= index_base) && (index < (index_base + information->allocation_size))) { _Chain_Extract( &extract_me->Node ); 48734: 2f08 movel %a0,%sp@- 48736: 4e93 jsr %a3@ 48738: 588f addql #4,%sp 4873a: 60b8 bras 486f4 <_Objects_Shrink_information+0x64> 4873c: 206a 001c moveal %a2@(28),%a0 <== NOT EXECUTED index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / information->allocation_size; for ( block = 0; block < block_count; block++ ) { if ( information->inactive_per_block[ block ] == 48740: 4284 clrl %d4 <== NOT EXECUTED */ extract_me = the_object; the_object = (Objects_Control *) the_object->Node.next; if ((index >= index_base) && (index < (index_base + information->allocation_size))) { _Chain_Extract( &extract_me->Node ); 48742: 47f9 0004 75ac lea 475ac <_Chain_Extract>,%a3 <== NOT EXECUTED 48748: 6092 bras 486dc <_Objects_Shrink_information+0x4c><== NOT EXECUTED ... =============================================================================== 000474c0 <_POSIX_Condition_variables_Get>: POSIX_Condition_variables_Control *_POSIX_Condition_variables_Get ( pthread_cond_t *cond, Objects_Locations *location ) { 474c0: 4e56 0000 linkw %fp,#0 474c4: 2f0b movel %a3,%sp@- 474c6: 266e 000c moveal %fp@(12),%a3 474ca: 2f0a movel %a2,%sp@- 474cc: 246e 0008 moveal %fp@(8),%a2 int status; if ( !cond ) { 474d0: 4a8a tstl %a2 474d2: 6750 beqs 47524 <_POSIX_Condition_variables_Get+0x64> *location = OBJECTS_ERROR; return (POSIX_Condition_variables_Control *) 0; } if ( *cond == PTHREAD_COND_INITIALIZER ) { 474d4: 2012 movel %a2@,%d0 474d6: 72ff moveq #-1,%d1 474d8: b280 cmpl %d0,%d1 474da: 6720 beqs 474fc <_POSIX_Condition_variables_Get+0x3c><== NEVER TAKEN } /* * Now call Objects_Get() */ return (POSIX_Condition_variables_Control *)_Objects_Get( 474dc: 2f0b movel %a3,%sp@- 474de: 2f00 movel %d0,%sp@- 474e0: 4879 0006 3a8a pea 63a8a <_POSIX_Condition_variables_Information> 474e6: 4eb9 0004 a448 jsr 4a448 <_Objects_Get> 474ec: 4fef 000c lea %sp@(12),%sp &_POSIX_Condition_variables_Information, (Objects_Id) *cond, location ); } 474f0: 246e fff8 moveal %fp@(-8),%a2 474f4: 266e fffc moveal %fp@(-4),%a3 474f8: 4e5e unlk %fp 474fa: 4e75 rts if ( *cond == PTHREAD_COND_INITIALIZER ) { /* * Do an "auto-create" here. */ status = pthread_cond_init( cond, 0 ); 474fc: 42a7 clrl %sp@- 474fe: 2f0a movel %a2,%sp@- 47500: 4eb9 0004 7538 jsr 47538 if ( status ) { 47506: 508f addql #8,%sp 47508: 4a80 tstl %d0 4750a: 6618 bnes 47524 <_POSIX_Condition_variables_Get+0x64> 4750c: 2012 movel %a2@,%d0 } /* * Now call Objects_Get() */ return (POSIX_Condition_variables_Control *)_Objects_Get( 4750e: 2f0b movel %a3,%sp@- 47510: 2f00 movel %d0,%sp@- 47512: 4879 0006 3a8a pea 63a8a <_POSIX_Condition_variables_Information> 47518: 4eb9 0004 a448 jsr 4a448 <_Objects_Get> 4751e: 4fef 000c lea %sp@(12),%sp 47522: 60cc bras 474f0 <_POSIX_Condition_variables_Get+0x30> * Do an "auto-create" here. */ status = pthread_cond_init( cond, 0 ); if ( status ) { *location = OBJECTS_ERROR; 47524: 7001 moveq #1,%d0 47526: 2680 movel %d0,%a3@ return (POSIX_Condition_variables_Control *)_Objects_Get( &_POSIX_Condition_variables_Information, (Objects_Id) *cond, location ); } 47528: 246e fff8 moveal %fp@(-8),%a2 */ status = pthread_cond_init( cond, 0 ); if ( status ) { *location = OBJECTS_ERROR; return (POSIX_Condition_variables_Control *) 0; 4752c: 4280 clrl %d0 return (POSIX_Condition_variables_Control *)_Objects_Get( &_POSIX_Condition_variables_Information, (Objects_Id) *cond, location ); } 4752e: 266e fffc moveal %fp@(-4),%a3 47532: 4e5e unlk %fp ... =============================================================================== 000476dc <_POSIX_Condition_variables_Wait_support>: pthread_cond_t *cond, pthread_mutex_t *mutex, Watchdog_Interval timeout, bool already_timedout ) { 476dc: 4e56 ffe8 linkw %fp,#-24 476e0: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@ register POSIX_Condition_variables_Control *the_cond; Objects_Locations location; int status; int mutex_status; if ( !_POSIX_Mutex_Get( mutex, &location ) ) { 476e4: 240e movel %fp,%d2 476e6: 5982 subql #4,%d2 pthread_cond_t *cond, pthread_mutex_t *mutex, Watchdog_Interval timeout, bool already_timedout ) { 476e8: 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 ) ) { 476ec: 2f02 movel %d2,%sp@- pthread_cond_t *cond, pthread_mutex_t *mutex, Watchdog_Interval timeout, bool already_timedout ) { 476ee: 266e 0008 moveal %fp@(8),%a3 register POSIX_Condition_variables_Control *the_cond; Objects_Locations location; int status; int mutex_status; if ( !_POSIX_Mutex_Get( mutex, &location ) ) { 476f2: 2f0a movel %a2,%sp@- pthread_cond_t *cond, pthread_mutex_t *mutex, Watchdog_Interval timeout, bool already_timedout ) { 476f4: 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 ) ) { 476f8: 4eb9 0004 7864 jsr 47864 <_POSIX_Mutex_Get> 476fe: 508f addql #8,%sp 47700: 4a80 tstl %d0 47702: 676a beqs 4776e <_POSIX_Condition_variables_Wait_support+0x92> * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { _Thread_Dispatch_disable_level--; 47704: 2039 0006 3708 movel 63708 <_Thread_Dispatch_disable_level>,%d0 4770a: 5380 subql #1,%d0 return EINVAL; } _Thread_Unnest_dispatch(); the_cond = _POSIX_Condition_variables_Get( cond, &location ); 4770c: 2f02 movel %d2,%sp@- 4770e: 23c0 0006 3708 movel %d0,63708 <_Thread_Dispatch_disable_level> return _Thread_Dispatch_disable_level; 47714: 2039 0006 3708 movel 63708 <_Thread_Dispatch_disable_level>,%d0 4771a: 2f0b movel %a3,%sp@- 4771c: 4eb9 0004 74c0 jsr 474c0 <_POSIX_Condition_variables_Get> switch ( location ) { 47722: 508f addql #8,%sp return EINVAL; } _Thread_Unnest_dispatch(); the_cond = _POSIX_Condition_variables_Get( cond, &location ); 47724: 2840 moveal %d0,%a4 switch ( location ) { 47726: 4aae fffc tstl %fp@(-4) 4772a: 6642 bnes 4776e <_POSIX_Condition_variables_Wait_support+0x92> case OBJECTS_LOCAL: if ( the_cond->Mutex && ( the_cond->Mutex != *mutex ) ) { 4772c: 202c 0014 movel %a4@(20),%d0 47730: 6718 beqs 4774a <_POSIX_Condition_variables_Wait_support+0x6e> 47732: b092 cmpl %a2@,%d0 47734: 6714 beqs 4774a <_POSIX_Condition_variables_Wait_support+0x6e> _Thread_Enable_dispatch(); 47736: 4eb9 0004 b190 jsr 4b190 <_Thread_Enable_dispatch> return EINVAL; 4773c: 7416 moveq #22,%d2 case OBJECTS_ERROR: break; } return EINVAL; } 4773e: 2002 movel %d2,%d0 47740: 4cee 1c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a4 47746: 4e5e unlk %fp 47748: 4e75 rts if ( the_cond->Mutex && ( the_cond->Mutex != *mutex ) ) { _Thread_Enable_dispatch(); return EINVAL; } (void) pthread_mutex_unlock( mutex ); 4774a: 2f0a movel %a2,%sp@- 4774c: 4eb9 0004 7b2c jsr 47b2c _Thread_Enable_dispatch(); return EINVAL; } */ if ( !already_timedout ) { 47752: 588f addql #4,%sp 47754: 4a03 tstb %d3 47756: 6724 beqs 4777c <_POSIX_Condition_variables_Wait_support+0xa0> status = _Thread_Executing->Wait.return_code; if ( status == EINTR ) status = 0; } else { _Thread_Enable_dispatch(); 47758: 4eb9 0004 b190 jsr 4b190 <_Thread_Enable_dispatch> status = ETIMEDOUT; 4775e: 7474 moveq #116,%d2 /* * When we get here the dispatch disable level is 0. */ mutex_status = pthread_mutex_lock( mutex ); 47760: 2f0a movel %a2,%sp@- 47762: 4eb9 0004 7a90 jsr 47a90 if ( mutex_status ) 47768: 588f addql #4,%sp 4776a: 4a80 tstl %d0 4776c: 67d0 beqs 4773e <_POSIX_Condition_variables_Wait_support+0x62><== ALWAYS TAKEN #endif case OBJECTS_ERROR: break; } return EINVAL; 4776e: 7416 moveq #22,%d2 } 47770: 2002 movel %d2,%d0 47772: 4cee 1c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a4 47778: 4e5e unlk %fp 4777a: 4e75 rts return EINVAL; } */ if ( !already_timedout ) { the_cond->Mutex = *mutex; 4777c: 2952 0014 movel %a2@,%a4@(20) 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; 47780: 7201 moveq #1,%d1 _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); _Thread_Executing->Wait.return_code = 0; _Thread_Executing->Wait.queue = &the_cond->Wait_queue; 47782: 200c movel %a4,%d0 47784: 0680 0000 0018 addil #24,%d0 if ( !already_timedout ) { the_cond->Mutex = *mutex; _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); _Thread_Executing->Wait.return_code = 0; 4778a: 2079 0006 3b6a moveal 63b6a <_Per_CPU_Information+0xc>,%a0 47790: 2941 0048 movel %d1,%a4@(72) 47794: 42a8 0034 clrl %a0@(52) _Thread_Executing->Wait.queue = &the_cond->Wait_queue; _Thread_Executing->Wait.id = *cond; 47798: 2153 0020 movel %a3@,%a0@(32) if ( !already_timedout ) { the_cond->Mutex = *mutex; _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); _Thread_Executing->Wait.return_code = 0; _Thread_Executing->Wait.queue = &the_cond->Wait_queue; 4779c: 2140 0044 movel %d0,%a0@(68) _Thread_Executing->Wait.id = *cond; _Thread_queue_Enqueue( &the_cond->Wait_queue, timeout ); 477a0: 4879 0004 ba70 pea 4ba70 <_Thread_queue_Timeout> 477a6: 2f2e 0010 movel %fp@(16),%sp@- 477aa: 2f00 movel %d0,%sp@- 477ac: 4eb9 0004 b68c jsr 4b68c <_Thread_queue_Enqueue_with_handler> _Thread_Enable_dispatch(); 477b2: 4eb9 0004 b190 jsr 4b190 <_Thread_Enable_dispatch> * a POSIX signal, then pthread_cond_wait returns spuriously, * according to the POSIX standard. It means that pthread_cond_wait * returns a success status, except for the fact that it was not * woken up a pthread_cond_signal or a pthread_cond_broadcast. */ status = _Thread_Executing->Wait.return_code; 477b8: 2079 0006 3b6a moveal 63b6a <_Per_CPU_Information+0xc>,%a0 if ( status == EINTR ) status = 0; 477be: 7004 moveq #4,%d0 * according to the POSIX standard. It means that pthread_cond_wait * returns a success status, except for the fact that it was not * woken up a pthread_cond_signal or a pthread_cond_broadcast. */ status = _Thread_Executing->Wait.return_code; if ( status == EINTR ) 477c0: 4fef 000c lea %sp@(12),%sp * a POSIX signal, then pthread_cond_wait returns spuriously, * according to the POSIX standard. It means that pthread_cond_wait * returns a success status, except for the fact that it was not * woken up a pthread_cond_signal or a pthread_cond_broadcast. */ status = _Thread_Executing->Wait.return_code; 477c4: 2428 0034 movel %a0@(52),%d2 if ( status == EINTR ) status = 0; 477c8: b082 cmpl %d2,%d0 477ca: 56c0 sne %d0 /* * When we get here the dispatch disable level is 0. */ mutex_status = pthread_mutex_lock( mutex ); 477cc: 2f0a movel %a2,%sp@- * returns a success status, except for the fact that it was not * woken up a pthread_cond_signal or a pthread_cond_broadcast. */ status = _Thread_Executing->Wait.return_code; if ( status == EINTR ) status = 0; 477ce: 49c0 extbl %d0 477d0: c480 andl %d0,%d2 /* * When we get here the dispatch disable level is 0. */ mutex_status = pthread_mutex_lock( mutex ); 477d2: 4eb9 0004 7a90 jsr 47a90 if ( mutex_status ) 477d8: 588f addql #4,%sp 477da: 4a80 tstl %d0 477dc: 6690 bnes 4776e <_POSIX_Condition_variables_Wait_support+0x92> 477de: 6000 ff5e braw 4773e <_POSIX_Condition_variables_Wait_support+0x62> ... =============================================================================== 000468d0 <_POSIX_Keys_Free_memory>: #include void _POSIX_Keys_Free_memory( POSIX_Keys_Control *the_key ) { 468d0: 4e56 0000 linkw %fp,#0 468d4: 2f0b movel %a3,%sp@- uint32_t the_api; for ( the_api = 1; the_api <= OBJECTS_APIS_LAST; the_api++ ) _Workspace_Free( the_key->Values[ the_api ] ); 468d6: 47f9 0004 b1d6 lea 4b1d6 <_Workspace_Free>,%a3 #include void _POSIX_Keys_Free_memory( POSIX_Keys_Control *the_key ) { 468dc: 2f0a movel %a2,%sp@- 468de: 246e 0008 moveal %fp@(8),%a2 uint32_t the_api; for ( the_api = 1; the_api <= OBJECTS_APIS_LAST; the_api++ ) _Workspace_Free( the_key->Values[ the_api ] ); 468e2: 2f2a 0018 movel %a2@(24),%sp@- 468e6: 4e93 jsr %a3@ 468e8: 2f2a 001c movel %a2@(28),%sp@- 468ec: 4e93 jsr %a3@ 468ee: 2d6a 0020 0008 movel %a2@(32),%fp@(8) 468f4: 508f addql #8,%sp } 468f6: 246e fff8 moveal %fp@(-8),%a2 468fa: 266e fffc moveal %fp@(-4),%a3 468fe: 4e5e unlk %fp ) { uint32_t the_api; for ( the_api = 1; the_api <= OBJECTS_APIS_LAST; the_api++ ) _Workspace_Free( the_key->Values[ the_api ] ); 46900: 4ef9 0004 b1d6 jmp 4b1d6 <_Workspace_Free> ... =============================================================================== 0004e6bc <_POSIX_Keys_Run_destructors>: 4e6bc: 7218 moveq #24,%d1 */ void _POSIX_Keys_Run_destructors( Thread_Control *thread ) { 4e6be: 4e56 ffec linkw %fp,#-20 4e6c2: 206e 0008 moveal %fp@(8),%a0 4e6c6: 48d7 007c moveml %d2-%d6,%sp@ Objects_Maximum thread_index = _Objects_Get_index( thread->Object.id ); 4e6ca: 2628 0008 movel %a0@(8),%d3 4e6ce: 2003 movel %d3,%d0 4e6d0: e2a8 lsrl %d1,%d0 4e6d2: 123c 0007 moveb #7,%d1 4e6d6: c081 andl %d1,%d0 for ( index = 1 ; index <= max ; ++index ) { POSIX_Keys_Control *key = (POSIX_Keys_Control *) _POSIX_Keys_Information.local_table [ index ]; if ( key != NULL && key->destructor != NULL ) { void *value = key->Values [ thread_api ][ thread_index ]; 4e6d8: 0283 0000 ffff andil #65535,%d3 4e6de: 2c00 movel %d0,%d6 4e6e0: 5a86 addql #5,%d6 * * Reference: 17.1.1.2 P1003.1c/Draft 10, p. 163, line 99. */ while ( !done ) { Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; 4e6e2: 3039 0006 139e movew 6139e <_POSIX_Keys_Information+0xe>,%d0 for ( index = 1 ; index <= max ; ++index ) { POSIX_Keys_Control *key = (POSIX_Keys_Control *) _POSIX_Keys_Information.local_table [ index ]; if ( key != NULL && key->destructor != NULL ) { void *value = key->Values [ thread_api ][ thread_index ]; 4e6e8: e58b lsll #2,%d3 Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; done = true; for ( index = 1 ; index <= max ; ++index ) { 4e6ea: 4a40 tstw %d0 4e6ec: 660a bnes 4e6f8 <_POSIX_Keys_Run_destructors+0x3c> done = false; } } } } } 4e6ee: 4cee 007c ffec moveml %fp@(-20),%d2-%d6 4e6f4: 4e5e unlk %fp 4e6f6: 4e75 rts 4e6f8: 4285 clrl %d5 4e6fa: 7201 moveq #1,%d1 Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; done = true; for ( index = 1 ; index <= max ; ++index ) { 4e6fc: 7401 moveq #1,%d2 4e6fe: 7801 moveq #1,%d4 4e700: 3a00 movew %d0,%d5 POSIX_Keys_Control *key = (POSIX_Keys_Control *) 4e702: 2079 0006 13a8 moveal 613a8 <_POSIX_Keys_Information+0x18>,%a0 Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; done = true; for ( index = 1 ; index <= max ; ++index ) { 4e708: 5282 addql #1,%d2 POSIX_Keys_Control *key = (POSIX_Keys_Control *) 4e70a: 2070 1c00 moveal %a0@(00000000,%d1:l:4),%a0 _POSIX_Keys_Information.local_table [ index ]; if ( key != NULL && key->destructor != NULL ) { 4e70e: 4a88 tstl %a0 4e710: 671e beqs 4e730 <_POSIX_Keys_Run_destructors+0x74> 4e712: 4aa8 0010 tstl %a0@(16) 4e716: 6718 beqs 4e730 <_POSIX_Keys_Run_destructors+0x74> void *value = key->Values [ thread_api ][ thread_index ]; 4e718: 2270 6c00 moveal %a0@(00000000,%d6:l:4),%a1 4e71c: d3c3 addal %d3,%a1 4e71e: 2211 movel %a1@,%d1 if ( value != NULL ) { 4e720: 670e beqs 4e730 <_POSIX_Keys_Run_destructors+0x74><== ALWAYS TAKEN key->Values [ thread_api ][ thread_index ] = NULL; 4e722: 4291 clrl %a1@ <== NOT EXECUTED (*key->destructor)( value ); done = false; 4e724: 4204 clrb %d4 <== NOT EXECUTED if ( key != NULL && key->destructor != NULL ) { void *value = key->Values [ thread_api ][ thread_index ]; if ( value != NULL ) { key->Values [ thread_api ][ thread_index ] = NULL; (*key->destructor)( value ); 4e726: 2f01 movel %d1,%sp@- <== NOT EXECUTED 4e728: 2068 0010 moveal %a0@(16),%a0 <== NOT EXECUTED 4e72c: 4e90 jsr %a0@ <== NOT EXECUTED 4e72e: 588f addql #4,%sp <== NOT EXECUTED Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; done = true; for ( index = 1 ; index <= max ; ++index ) { 4e730: 4281 clrl %d1 4e732: 3202 movew %d2,%d1 4e734: b285 cmpl %d5,%d1 4e736: 63ca blss 4e702 <_POSIX_Keys_Run_destructors+0x46> * number of iterations. An infinite loop may happen if destructors set * thread specific data. This can be considered dubious. * * Reference: 17.1.1.2 P1003.1c/Draft 10, p. 163, line 99. */ while ( !done ) { 4e738: 4a04 tstb %d4 4e73a: 66b2 bnes 4e6ee <_POSIX_Keys_Run_destructors+0x32><== ALWAYS TAKEN Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; 4e73c: 3039 0006 139e movew 6139e <_POSIX_Keys_Information+0xe>,%d0<== NOT EXECUTED done = true; for ( index = 1 ; index <= max ; ++index ) { 4e742: 67aa beqs 4e6ee <_POSIX_Keys_Run_destructors+0x32><== NOT EXECUTED 4e744: 60b2 bras 4e6f8 <_POSIX_Keys_Run_destructors+0x3c><== NOT EXECUTED ... =============================================================================== 0004c288 <_POSIX_Message_queue_Receive_support>: size_t msg_len, unsigned int *msg_prio, bool wait, Watchdog_Interval timeout ) { 4c288: 4e56 ffe4 linkw %fp,#-28 4c28c: 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( 4c290: 486e fff8 pea %fp@(-8) 4c294: 242e 0008 movel %fp@(8),%d2 4c298: 2f02 movel %d2,%sp@- 4c29a: 4879 0006 abd4 pea 6abd4 <_POSIX_Message_queue_Information_fds> 4c2a0: 246e 0014 moveal %fp@(20),%a2 4c2a4: 162e 001b moveb %fp@(27),%d3 4c2a8: 4eb9 0004 f7d4 jsr 4f7d4 <_Objects_Get> Objects_Locations location; size_t length_out; bool do_wait; the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); switch ( location ) { 4c2ae: 4fef 000c lea %sp@(12),%sp 4c2b2: 4aae fff8 tstl %fp@(-8) 4c2b6: 671a beqs 4c2d2 <_POSIX_Message_queue_Receive_support+0x4a> #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); 4c2b8: 4eb9 0005 6b34 jsr 56b34 <__errno> 4c2be: 72ff moveq #-1,%d1 4c2c0: 2040 moveal %d0,%a0 4c2c2: 7009 moveq #9,%d0 } 4c2c4: 4cee 043c ffe4 moveml %fp@(-28),%d2-%d5/%a2 #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); 4c2ca: 2080 movel %d0,%a0@ } 4c2cc: 2001 movel %d1,%d0 4c2ce: 4e5e unlk %fp 4c2d0: 4e75 rts the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); switch ( location ) { case OBJECTS_LOCAL: if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) { 4c2d2: 2040 moveal %d0,%a0 4c2d4: 7803 moveq #3,%d4 4c2d6: 7a01 moveq #1,%d5 4c2d8: 2228 0014 movel %a0@(20),%d1 4c2dc: c881 andl %d1,%d4 4c2de: ba84 cmpl %d4,%d5 4c2e0: 6700 00c4 beqw 4c3a6 <_POSIX_Message_queue_Receive_support+0x11e> _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EBADF ); } the_mq = the_mq_fd->Queue; 4c2e4: 2068 0010 moveal %a0@(16),%a0 if ( msg_len < the_mq->Message_queue.maximum_message_size ) { 4c2e8: 202e 0010 movel %fp@(16),%d0 4c2ec: b0a8 0066 cmpl %a0@(102),%d0 4c2f0: 656a bcss 4c35c <_POSIX_Message_queue_Receive_support+0xd4> /* * Now if something goes wrong, we return a "length" of -1 * to indicate an error. */ length_out = -1; 4c2f2: 70ff moveq #-1,%d0 4c2f4: 2d40 fffc movel %d0,%fp@(-4) /* * A timed receive with a bad time will do a poll regardless. */ if ( wait ) 4c2f8: 4a03 tstb %d3 4c2fa: 6756 beqs 4c352 <_POSIX_Message_queue_Receive_support+0xca> 4c2fc: 0801 000e btst #14,%d1 4c300: 57c0 seq %d0 4c302: 49c0 extbl %d0 4c304: 4480 negl %d0 do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 4c306: 2f2e 001c movel %fp@(28),%sp@- 4c30a: 2f00 movel %d0,%sp@- 4c30c: 486e fffc pea %fp@(-4) 4c310: 2f2e 000c movel %fp@(12),%sp@- 4c314: 2f02 movel %d2,%sp@- 4c316: 4868 001a pea %a0@(26) 4c31a: 4eb9 0004 e6f4 jsr 4e6f4 <_CORE_message_queue_Seize> &length_out, do_wait, timeout ); _Thread_Enable_dispatch(); 4c320: 4eb9 0005 05a4 jsr 505a4 <_Thread_Enable_dispatch> if (msg_prio) { *msg_prio = _POSIX_Message_queue_Priority_from_core( _Thread_Executing->Wait.count 4c326: 2079 0006 ac46 moveal 6ac46 <_Per_CPU_Information+0xc>,%a0 do_wait, timeout ); _Thread_Enable_dispatch(); if (msg_prio) { 4c32c: 4fef 0018 lea %sp@(24),%sp 4c330: 4a8a tstl %a2 4c332: 6708 beqs 4c33c <_POSIX_Message_queue_Receive_support+0xb4><== NEVER TAKEN RTEMS_INLINE_ROUTINE unsigned int _POSIX_Message_queue_Priority_from_core( CORE_message_queue_Submit_types priority ) { /* absolute value without a library dependency */ return ((priority >= 0) ? priority : -priority); 4c334: 2028 0024 movel %a0@(36),%d0 4c338: 6d1c blts 4c356 <_POSIX_Message_queue_Receive_support+0xce> *msg_prio = _POSIX_Message_queue_Priority_from_core( 4c33a: 2480 movel %d0,%a2@ _Thread_Executing->Wait.count ); } if ( !_Thread_Executing->Wait.return_code ) 4c33c: 4aa8 0034 tstl %a0@(52) 4c340: 663a bnes 4c37c <_POSIX_Message_queue_Receive_support+0xf4> return length_out; 4c342: 222e fffc movel %fp@(-4),%d1 case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); } 4c346: 2001 movel %d1,%d0 4c348: 4cee 043c ffe4 moveml %fp@(-28),%d2-%d5/%a2 4c34e: 4e5e unlk %fp 4c350: 4e75 rts length_out = -1; /* * A timed receive with a bad time will do a poll regardless. */ if ( wait ) 4c352: 4280 clrl %d0 4c354: 60b0 bras 4c306 <_POSIX_Message_queue_Receive_support+0x7e> 4c356: 4480 negl %d0 timeout ); _Thread_Enable_dispatch(); if (msg_prio) { *msg_prio = _POSIX_Message_queue_Priority_from_core( 4c358: 2480 movel %d0,%a2@ 4c35a: 60e0 bras 4c33c <_POSIX_Message_queue_Receive_support+0xb4> } the_mq = the_mq_fd->Queue; if ( msg_len < the_mq->Message_queue.maximum_message_size ) { _Thread_Enable_dispatch(); 4c35c: 4eb9 0005 05a4 jsr 505a4 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EMSGSIZE ); 4c362: 747a moveq #122,%d2 4c364: 4eb9 0005 6b34 jsr 56b34 <__errno> 4c36a: 72ff moveq #-1,%d1 4c36c: 2040 moveal %d0,%a0 case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); } 4c36e: 2001 movel %d1,%d0 the_mq = the_mq_fd->Queue; if ( msg_len < the_mq->Message_queue.maximum_message_size ) { _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EMSGSIZE ); 4c370: 2082 movel %d2,%a0@ case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); } 4c372: 4cee 043c ffe4 moveml %fp@(-28),%d2-%d5/%a2 4c378: 4e5e unlk %fp 4c37a: 4e75 rts } if ( !_Thread_Executing->Wait.return_code ) return length_out; rtems_set_errno_and_return_minus_one( 4c37c: 4eb9 0005 6b34 jsr 56b34 <__errno> 4c382: 2079 0006 ac46 moveal 6ac46 <_Per_CPU_Information+0xc>,%a0 4c388: 2440 moveal %d0,%a2 4c38a: 2f28 0034 movel %a0@(52),%sp@- 4c38e: 4eb9 0004 c65c jsr 4c65c <_POSIX_Message_queue_Translate_core_message_queue_return_code> 4c394: 588f addql #4,%sp 4c396: 72ff moveq #-1,%d1 4c398: 2480 movel %d0,%a2@ case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); } 4c39a: 2001 movel %d1,%d0 4c39c: 4cee 043c ffe4 moveml %fp@(-28),%d2-%d5/%a2 4c3a2: 4e5e unlk %fp 4c3a4: 4e75 rts the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); switch ( location ) { case OBJECTS_LOCAL: if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) { _Thread_Enable_dispatch(); 4c3a6: 4eb9 0005 05a4 jsr 505a4 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EBADF ); 4c3ac: 7609 moveq #9,%d3 4c3ae: 4eb9 0005 6b34 jsr 56b34 <__errno> 4c3b4: 72ff moveq #-1,%d1 4c3b6: 2040 moveal %d0,%a0 case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); } 4c3b8: 2001 movel %d1,%d0 switch ( location ) { case OBJECTS_LOCAL: if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) { _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EBADF ); 4c3ba: 2083 movel %d3,%a0@ case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); } 4c3bc: 4cee 043c ffe4 moveml %fp@(-28),%d2-%d5/%a2 4c3c2: 4e5e unlk %fp ... =============================================================================== 0004c3ec <_POSIX_Message_queue_Send_support>: /* * Validate the priority. * XXX - Do not validate msg_prio is not less than 0. */ if ( msg_prio > MQ_PRIO_MAX ) 4c3ec: 7020 moveq #32,%d0 size_t msg_len, uint32_t msg_prio, bool wait, Watchdog_Interval timeout ) { 4c3ee: 4e56 ffe8 linkw %fp,#-24 4c3f2: 48d7 043c moveml %d2-%d5/%a2,%sp@ 4c3f6: 262e 0008 movel %fp@(8),%d3 4c3fa: 242e 0014 movel %fp@(20),%d2 4c3fe: 182e 001b moveb %fp@(27),%d4 /* * Validate the priority. * XXX - Do not validate msg_prio is not less than 0. */ if ( msg_prio > MQ_PRIO_MAX ) 4c402: b082 cmpl %d2,%d0 4c404: 6500 00e2 bcsw 4c4e8 <_POSIX_Message_queue_Send_support+0xfc> 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( 4c408: 486e fffc pea %fp@(-4) 4c40c: 2f03 movel %d3,%sp@- 4c40e: 4879 0006 abd4 pea 6abd4 <_POSIX_Message_queue_Information_fds> 4c414: 4eb9 0004 f7d4 jsr 4f7d4 <_Objects_Get> rtems_set_errno_and_return_minus_one( EINVAL ); the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); switch ( location ) { 4c41a: 4fef 000c lea %sp@(12),%sp 4c41e: 4aae fffc tstl %fp@(-4) 4c422: 6600 00aa bnew 4c4ce <_POSIX_Message_queue_Send_support+0xe2> case OBJECTS_LOCAL: if ( (the_mq_fd->oflag & O_ACCMODE) == O_RDONLY ) { 4c426: 2240 moveal %d0,%a1 4c428: 7a03 moveq #3,%d5 4c42a: 2229 0014 movel %a1@(20),%d1 4c42e: ca81 andl %d1,%d5 4c430: 6700 00d0 beqw 4c502 <_POSIX_Message_queue_Send_support+0x116> _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EBADF ); } the_mq = the_mq_fd->Queue; 4c434: 2240 moveal %d0,%a1 4c436: 2069 0010 moveal %a1@(16),%a0 /* * A timed receive with a bad time will do a poll regardless. */ if ( wait ) 4c43a: 4a04 tstb %d4 4c43c: 6750 beqs 4c48e <_POSIX_Message_queue_Send_support+0xa2> do_wait = wait; /* * Now perform the actual message receive */ msg_status = _CORE_message_queue_Submit( 4c43e: 2f2e 001c movel %fp@(28),%sp@- 4c442: 4482 negl %d2 the_mq = the_mq_fd->Queue; /* * A timed receive with a bad time will do a poll regardless. */ if ( wait ) 4c444: 0801 000e btst #14,%d1 4c448: 57c0 seq %d0 4c44a: 49c0 extbl %d0 4c44c: 4480 negl %d0 do_wait = wait; /* * Now perform the actual message receive */ msg_status = _CORE_message_queue_Submit( 4c44e: 2f00 movel %d0,%sp@- 4c450: 2f02 movel %d2,%sp@- 4c452: 42a7 clrl %sp@- 4c454: 2f03 movel %d3,%sp@- 4c456: 2f2e 0010 movel %fp@(16),%sp@- 4c45a: 2f2e 000c movel %fp@(12),%sp@- 4c45e: 4868 001a pea %a0@(26) 4c462: 4eb9 0004 e830 jsr 4e830 <_CORE_message_queue_Submit> _POSIX_Message_queue_Priority_to_core( msg_prio ), do_wait, timeout /* no timeout */ ); _Thread_Enable_dispatch(); 4c468: 4fef 0020 lea %sp@(32),%sp do_wait = wait; /* * Now perform the actual message receive */ msg_status = _CORE_message_queue_Submit( 4c46c: 2400 movel %d0,%d2 _POSIX_Message_queue_Priority_to_core( msg_prio ), do_wait, timeout /* no timeout */ ); _Thread_Enable_dispatch(); 4c46e: 4eb9 0005 05a4 jsr 505a4 <_Thread_Enable_dispatch> * after it wakes up. The returned status is correct for * non-blocking operations but if we blocked, then we need * to look at the status in our TCB. */ if ( msg_status == CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_WAIT ) 4c474: 7007 moveq #7,%d0 4c476: b082 cmpl %d2,%d0 4c478: 6748 beqs 4c4c2 <_POSIX_Message_queue_Send_support+0xd6> msg_status = _Thread_Executing->Wait.return_code; if ( !msg_status ) 4c47a: 4a82 tstl %d2 4c47c: 6600 00a4 bnew 4c522 <_POSIX_Message_queue_Send_support+0x136> return msg_status; 4c480: 4281 clrl %d1 case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); } 4c482: 2001 movel %d1,%d0 4c484: 4cee 043c ffe8 moveml %fp@(-24),%d2-%d5/%a2 4c48a: 4e5e unlk %fp 4c48c: 4e75 rts do_wait = wait; /* * Now perform the actual message receive */ msg_status = _CORE_message_queue_Submit( 4c48e: 2f2e 001c movel %fp@(28),%sp@- the_mq = the_mq_fd->Queue; /* * A timed receive with a bad time will do a poll regardless. */ if ( wait ) 4c492: 4280 clrl %d0 do_wait = wait; /* * Now perform the actual message receive */ msg_status = _CORE_message_queue_Submit( 4c494: 4482 negl %d2 4c496: 2f00 movel %d0,%sp@- 4c498: 2f02 movel %d2,%sp@- 4c49a: 42a7 clrl %sp@- 4c49c: 2f03 movel %d3,%sp@- 4c49e: 2f2e 0010 movel %fp@(16),%sp@- 4c4a2: 2f2e 000c movel %fp@(12),%sp@- 4c4a6: 4868 001a pea %a0@(26) 4c4aa: 4eb9 0004 e830 jsr 4e830 <_CORE_message_queue_Submit> _POSIX_Message_queue_Priority_to_core( msg_prio ), do_wait, timeout /* no timeout */ ); _Thread_Enable_dispatch(); 4c4b0: 4fef 0020 lea %sp@(32),%sp do_wait = wait; /* * Now perform the actual message receive */ msg_status = _CORE_message_queue_Submit( 4c4b4: 2400 movel %d0,%d2 _POSIX_Message_queue_Priority_to_core( msg_prio ), do_wait, timeout /* no timeout */ ); _Thread_Enable_dispatch(); 4c4b6: 4eb9 0005 05a4 jsr 505a4 <_Thread_Enable_dispatch> * after it wakes up. The returned status is correct for * non-blocking operations but if we blocked, then we need * to look at the status in our TCB. */ if ( msg_status == CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_WAIT ) 4c4bc: 7007 moveq #7,%d0 4c4be: b082 cmpl %d2,%d0 4c4c0: 66b8 bnes 4c47a <_POSIX_Message_queue_Send_support+0x8e><== ALWAYS TAKEN msg_status = _Thread_Executing->Wait.return_code; 4c4c2: 2079 0006 ac46 moveal 6ac46 <_Per_CPU_Information+0xc>,%a0 4c4c8: 2428 0034 movel %a0@(52),%d2 4c4cc: 60ac bras 4c47a <_POSIX_Message_queue_Send_support+0x8e> #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); 4c4ce: 4eb9 0005 6b34 jsr 56b34 <__errno> 4c4d4: 72ff moveq #-1,%d1 4c4d6: 2040 moveal %d0,%a0 4c4d8: 7009 moveq #9,%d0 } 4c4da: 4cee 043c ffe8 moveml %fp@(-24),%d2-%d5/%a2 #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); 4c4e0: 2080 movel %d0,%a0@ } 4c4e2: 2001 movel %d1,%d0 4c4e4: 4e5e unlk %fp 4c4e6: 4e75 rts * Validate the priority. * XXX - Do not validate msg_prio is not less than 0. */ if ( msg_prio > MQ_PRIO_MAX ) rtems_set_errno_and_return_minus_one( EINVAL ); 4c4e8: 4eb9 0005 6b34 jsr 56b34 <__errno> 4c4ee: 7616 moveq #22,%d3 4c4f0: 72ff moveq #-1,%d1 4c4f2: 2040 moveal %d0,%a0 case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); } 4c4f4: 2001 movel %d1,%d0 * Validate the priority. * XXX - Do not validate msg_prio is not less than 0. */ if ( msg_prio > MQ_PRIO_MAX ) rtems_set_errno_and_return_minus_one( EINVAL ); 4c4f6: 2083 movel %d3,%a0@ case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); } 4c4f8: 4cee 043c ffe8 moveml %fp@(-24),%d2-%d5/%a2 4c4fe: 4e5e unlk %fp 4c500: 4e75 rts the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); switch ( location ) { case OBJECTS_LOCAL: if ( (the_mq_fd->oflag & O_ACCMODE) == O_RDONLY ) { _Thread_Enable_dispatch(); 4c502: 4eb9 0005 05a4 jsr 505a4 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EBADF ); 4c508: 7409 moveq #9,%d2 4c50a: 4eb9 0005 6b34 jsr 56b34 <__errno> 4c510: 72ff moveq #-1,%d1 4c512: 2040 moveal %d0,%a0 case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); } 4c514: 2001 movel %d1,%d0 switch ( location ) { case OBJECTS_LOCAL: if ( (the_mq_fd->oflag & O_ACCMODE) == O_RDONLY ) { _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EBADF ); 4c516: 2082 movel %d2,%a0@ case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); } 4c518: 4cee 043c ffe8 moveml %fp@(-24),%d2-%d5/%a2 4c51e: 4e5e unlk %fp 4c520: 4e75 rts msg_status = _Thread_Executing->Wait.return_code; if ( !msg_status ) return msg_status; rtems_set_errno_and_return_minus_one( 4c522: 4eb9 0005 6b34 jsr 56b34 <__errno> 4c528: 2440 moveal %d0,%a2 4c52a: 2f02 movel %d2,%sp@- 4c52c: 4eb9 0004 c65c jsr 4c65c <_POSIX_Message_queue_Translate_core_message_queue_return_code> 4c532: 588f addql #4,%sp 4c534: 72ff moveq #-1,%d1 4c536: 2480 movel %d0,%a2@ case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); } 4c538: 2001 movel %d1,%d0 4c53a: 4cee 043c ffe8 moveml %fp@(-24),%d2-%d5/%a2 4c540: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004c05c <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch>: #include void _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch( Thread_Control *the_thread ) { 4c05c: 4e56 0000 linkw %fp,#0 4c060: 226e 0008 moveal %fp@(8),%a1 POSIX_API_Control *thread_support; thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4c064: 2069 0102 moveal %a1@(258),%a0 if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 4c068: 4aa8 00d8 tstl %a0@(216) 4c06c: 6608 bnes 4c076 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x1a><== NEVER TAKEN 4c06e: 7001 moveq #1,%d0 4c070: b0a8 00dc cmpl %a0@(220),%d0 4c074: 6708 beqs 4c07e <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x22> _Thread_Unnest_dispatch(); _POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED ); } else _Thread_Enable_dispatch(); } 4c076: 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(); 4c078: 4ef9 0004 92d8 jmp 492d8 <_Thread_Enable_dispatch> POSIX_API_Control *thread_support; thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS && 4c07e: 4aa8 00e0 tstl %a0@(224) 4c082: 67f2 beqs 4c076 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x1a> * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { _Thread_Dispatch_disable_level--; 4c084: 2039 0006 14bc movel 614bc <_Thread_Dispatch_disable_level>,%d0 thread_support->cancelation_requested ) { _Thread_Unnest_dispatch(); _POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED ); 4c08a: 4878 ffff pea ffffffff 4c08e: 5380 subql #1,%d0 4c090: 23c0 0006 14bc movel %d0,614bc <_Thread_Dispatch_disable_level> return _Thread_Dispatch_disable_level; 4c096: 2039 0006 14bc movel 614bc <_Thread_Dispatch_disable_level>,%d0 4c09c: 2f09 movel %a1,%sp@- 4c09e: 4eb9 0004 c798 jsr 4c798 <_POSIX_Thread_Exit> 4c0a4: 508f addql #8,%sp } else _Thread_Enable_dispatch(); } 4c0a6: 4e5e unlk %fp ... =============================================================================== 0004d6b0 <_POSIX_Thread_Translate_sched_param>: int policy, struct sched_param *param, Thread_CPU_budget_algorithms *budget_algorithm, Thread_CPU_budget_algorithm_callout *budget_callout ) { 4d6b0: 4e56 ffe8 linkw %fp,#-24 4d6b4: 48d7 3c0c moveml %d2-%d3/%a2-%a5,%sp@ 4d6b8: 246e 000c moveal %fp@(12),%a2 if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) 4d6bc: 47f9 0004 d68c lea 4d68c <_POSIX_Priority_Is_valid>,%a3 4d6c2: 2f12 movel %a2@,%sp@- int policy, struct sched_param *param, Thread_CPU_budget_algorithms *budget_algorithm, Thread_CPU_budget_algorithm_callout *budget_callout ) { 4d6c4: 242e 0008 movel %fp@(8),%d2 4d6c8: 286e 0010 moveal %fp@(16),%a4 4d6cc: 2a6e 0014 moveal %fp@(20),%a5 if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) 4d6d0: 4e93 jsr %a3@ 4d6d2: 588f addql #4,%sp 4d6d4: 4a00 tstb %d0 4d6d6: 660c bnes 4d6e4 <_POSIX_Thread_Translate_sched_param+0x34><== ALWAYS TAKEN if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) < _Timespec_To_ticks( ¶m->sched_ss_init_budget ) ) return EINVAL; if ( !_POSIX_Priority_Is_valid( param->sched_ss_low_priority ) ) return EINVAL; 4d6d8: 7016 moveq #22,%d0 *budget_callout = _POSIX_Threads_Sporadic_budget_callout; return 0; } return EINVAL; } 4d6da: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 4d6e0: 4e5e unlk %fp 4d6e2: 4e75 rts ) { if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 4d6e4: 4294 clrl %a4@ *budget_callout = NULL; 4d6e6: 4295 clrl %a5@ if ( policy == SCHED_OTHER ) { 4d6e8: 4a82 tstl %d2 4d6ea: 676c beqs 4d758 <_POSIX_Thread_Translate_sched_param+0xa8> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; return 0; } if ( policy == SCHED_FIFO ) { 4d6ec: 7001 moveq #1,%d0 4d6ee: b082 cmpl %d2,%d0 4d6f0: 6776 beqs 4d768 <_POSIX_Thread_Translate_sched_param+0xb8> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; return 0; } if ( policy == SCHED_RR ) { 4d6f2: 103c 0002 moveb #2,%d0 4d6f6: b082 cmpl %d2,%d0 4d6f8: 677a beqs 4d774 <_POSIX_Thread_Translate_sched_param+0xc4> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; return 0; } if ( policy == SCHED_SPORADIC ) { 4d6fa: 7004 moveq #4,%d0 4d6fc: b082 cmpl %d2,%d0 4d6fe: 66d8 bnes 4d6d8 <_POSIX_Thread_Translate_sched_param+0x28> if ( (param->sched_ss_repl_period.tv_sec == 0) && 4d700: 4aaa 0008 tstl %a2@(8) 4d704: 6606 bnes 4d70c <_POSIX_Thread_Translate_sched_param+0x5c> 4d706: 4aaa 000c tstl %a2@(12) 4d70a: 67cc beqs 4d6d8 <_POSIX_Thread_Translate_sched_param+0x28> (param->sched_ss_repl_period.tv_nsec == 0) ) return EINVAL; if ( (param->sched_ss_init_budget.tv_sec == 0) && 4d70c: 4aaa 0010 tstl %a2@(16) 4d710: 6606 bnes 4d718 <_POSIX_Thread_Translate_sched_param+0x68> 4d712: 4aaa 0014 tstl %a2@(20) 4d716: 67c0 beqs 4d6d8 <_POSIX_Thread_Translate_sched_param+0x28> (param->sched_ss_init_budget.tv_nsec == 0) ) return EINVAL; if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) < 4d718: 486a 0008 pea %a2@(8) 4d71c: 243c 0004 aeec movel #306924,%d2 4d722: 2042 moveal %d2,%a0 4d724: 4e90 jsr %a0@ _Timespec_To_ticks( ¶m->sched_ss_init_budget ) ) 4d726: 486a 0010 pea %a2@(16) if ( (param->sched_ss_init_budget.tv_sec == 0) && (param->sched_ss_init_budget.tv_nsec == 0) ) return EINVAL; if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) < 4d72a: 2600 movel %d0,%d3 _Timespec_To_ticks( ¶m->sched_ss_init_budget ) ) 4d72c: 2042 moveal %d2,%a0 4d72e: 4e90 jsr %a0@ if ( (param->sched_ss_init_budget.tv_sec == 0) && (param->sched_ss_init_budget.tv_nsec == 0) ) return EINVAL; if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) < 4d730: 508f addql #8,%sp 4d732: b083 cmpl %d3,%d0 4d734: 62a2 bhis 4d6d8 <_POSIX_Thread_Translate_sched_param+0x28> _Timespec_To_ticks( ¶m->sched_ss_init_budget ) ) return EINVAL; if ( !_POSIX_Priority_Is_valid( param->sched_ss_low_priority ) ) 4d736: 2f2a 0004 movel %a2@(4),%sp@- 4d73a: 4e93 jsr %a3@ 4d73c: 588f addql #4,%sp 4d73e: 4a00 tstb %d0 4d740: 6796 beqs 4d6d8 <_POSIX_Thread_Translate_sched_param+0x28> return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; 4d742: 7003 moveq #3,%d0 4d744: 2880 movel %d0,%a4@ *budget_callout = _POSIX_Threads_Sporadic_budget_callout; return 0; 4d746: 4280 clrl %d0 if ( !_POSIX_Priority_Is_valid( param->sched_ss_low_priority ) ) return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; *budget_callout = _POSIX_Threads_Sporadic_budget_callout; 4d748: 2abc 0004 726e movel #291438,%a5@ return 0; } return EINVAL; } 4d74e: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 4d754: 4e5e unlk %fp 4d756: 4e75 rts *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; *budget_callout = NULL; if ( policy == SCHED_OTHER ) { *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 4d758: 7401 moveq #1,%d2 return 0; 4d75a: 4280 clrl %d0 *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; *budget_callout = NULL; if ( policy == SCHED_OTHER ) { *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 4d75c: 2882 movel %d2,%a4@ *budget_callout = _POSIX_Threads_Sporadic_budget_callout; return 0; } return EINVAL; } 4d75e: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 4d764: 4e5e unlk %fp 4d766: 4e75 rts return 0; } if ( policy == SCHED_FIFO ) { *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; return 0; 4d768: 4280 clrl %d0 *budget_callout = _POSIX_Threads_Sporadic_budget_callout; return 0; } return EINVAL; } 4d76a: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 4d770: 4e5e unlk %fp 4d772: 4e75 rts *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; return 0; } if ( policy == SCHED_RR ) { *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; 4d774: 7202 moveq #2,%d1 return 0; 4d776: 4200 clrb %d0 *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; return 0; } if ( policy == SCHED_RR ) { *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; 4d778: 2881 movel %d1,%a4@ *budget_callout = _POSIX_Threads_Sporadic_budget_callout; return 0; } return EINVAL; } 4d77a: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 4d780: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004c3aa <_POSIX_Threads_Delete_extension>: */ void _POSIX_Threads_Delete_extension( Thread_Control *executing __attribute__((unused)), Thread_Control *deleted ) { 4c3aa: 4e56 ffec linkw %fp,#-20 4c3ae: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@ 4c3b2: 266e 000c moveal %fp@(12),%a3 4c3b6: 45f9 0004 95a4 lea 495a4 <_Thread_queue_Dequeue>,%a2 api = deleted->API_Extensions[ THREAD_API_POSIX ]; /* * Run the POSIX cancellation handlers */ _POSIX_Threads_cancel_run( deleted ); 4c3bc: 2f0b movel %a3,%sp@- { Thread_Control *the_thread; POSIX_API_Control *api; void **value_ptr; api = deleted->API_Extensions[ THREAD_API_POSIX ]; 4c3be: 286b 0102 moveal %a3@(258),%a4 4c3c2: 240c movel %a4,%d2 4c3c4: 0682 0000 0044 addil #68,%d2 /* * Run the POSIX cancellation handlers */ _POSIX_Threads_cancel_run( deleted ); 4c3ca: 4eb9 0004 e650 jsr 4e650 <_POSIX_Threads_cancel_run> /* * Run all the key destructors */ _POSIX_Keys_Run_destructors( deleted ); 4c3d0: 2f0b movel %a3,%sp@- 4c3d2: 4eb9 0004 e6bc jsr 4e6bc <_POSIX_Keys_Run_destructors> /* * Wakeup all the tasks which joined with this one */ value_ptr = (void **) deleted->Wait.return_argument; 4c3d8: 262b 0028 movel %a3@(40),%d3 while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) ) 4c3dc: 508f addql #8,%sp 4c3de: 2f02 movel %d2,%sp@- 4c3e0: 4e92 jsr %a2@ 4c3e2: 588f addql #4,%sp 4c3e4: 4a80 tstl %d0 4c3e6: 6712 beqs 4c3fa <_POSIX_Threads_Delete_extension+0x50><== ALWAYS TAKEN *(void **)the_thread->Wait.return_argument = value_ptr; 4c3e8: 2240 moveal %d0,%a1 <== NOT EXECUTED 4c3ea: 2069 0028 moveal %a1@(40),%a0 <== NOT EXECUTED 4c3ee: 2083 movel %d3,%a0@ <== NOT EXECUTED /* * Wakeup all the tasks which joined with this one */ value_ptr = (void **) deleted->Wait.return_argument; while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) ) 4c3f0: 2f02 movel %d2,%sp@- <== NOT EXECUTED 4c3f2: 4e92 jsr %a2@ <== NOT EXECUTED 4c3f4: 588f addql #4,%sp <== NOT EXECUTED 4c3f6: 4a80 tstl %d0 <== NOT EXECUTED 4c3f8: 66ee bnes 4c3e8 <_POSIX_Threads_Delete_extension+0x3e><== NOT EXECUTED *(void **)the_thread->Wait.return_argument = value_ptr; if ( api->schedpolicy == SCHED_SPORADIC ) 4c3fa: 103c 0004 moveb #4,%d0 4c3fe: b0ac 0084 cmpl %a4@(132),%d0 4c402: 6716 beqs 4c41a <_POSIX_Threads_Delete_extension+0x70> (void) _Watchdog_Remove( &api->Sporadic_timer ); deleted->API_Extensions[ THREAD_API_POSIX ] = NULL; 4c404: 42ab 0102 clrl %a3@(258) _Workspace_Free( api ); 4c408: 2d4c 0008 movel %a4,%fp@(8) } 4c40c: 4cee 1c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a4 4c412: 4e5e unlk %fp if ( api->schedpolicy == SCHED_SPORADIC ) (void) _Watchdog_Remove( &api->Sporadic_timer ); deleted->API_Extensions[ THREAD_API_POSIX ] = NULL; _Workspace_Free( api ); 4c414: 4ef9 0004 a2fe jmp 4a2fe <_Workspace_Free> while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) ) *(void **)the_thread->Wait.return_argument = value_ptr; if ( api->schedpolicy == SCHED_SPORADIC ) (void) _Watchdog_Remove( &api->Sporadic_timer ); 4c41a: 486c 00a8 pea %a4@(168) 4c41e: 4eb9 0004 a160 jsr 4a160 <_Watchdog_Remove> 4c424: 588f addql #4,%sp deleted->API_Extensions[ THREAD_API_POSIX ] = NULL; 4c426: 42ab 0102 clrl %a3@(258) _Workspace_Free( api ); 4c42a: 2d4c 0008 movel %a4,%fp@(8) } 4c42e: 4cee 1c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a4 4c434: 4e5e unlk %fp if ( api->schedpolicy == SCHED_SPORADIC ) (void) _Watchdog_Remove( &api->Sporadic_timer ); deleted->API_Extensions[ THREAD_API_POSIX ] = NULL; _Workspace_Free( api ); 4c436: 4ef9 0004 a2fe jmp 4a2fe <_Workspace_Free> =============================================================================== 00046efc <_POSIX_Threads_Initialize_user_threads_body>: * * Output parameters: NONE */ void _POSIX_Threads_Initialize_user_threads_body(void) { 46efc: 4e56 ff98 linkw %fp,#-104 46f00: 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; 46f04: 2479 0006 07a4 moveal 607a4 ,%a2 maximum = Configuration_POSIX_API.number_of_initialization_threads; 46f0a: 2839 0006 07a0 movel 607a0 ,%d4 if ( !user_threads || maximum == 0 ) 46f10: 4a8a tstl %a2 46f12: 675a beqs 46f6e <_POSIX_Threads_Initialize_user_threads_body+0x72><== NEVER TAKEN 46f14: 4a84 tstl %d4 46f16: 6756 beqs 46f6e <_POSIX_Threads_Initialize_user_threads_body+0x72><== NEVER TAKEN 46f18: 240e movel %fp,%d2 46f1a: 2a0e movel %fp,%d5 46f1c: 4283 clrl %d3 46f1e: 0682 ffff ffbc addil #-68,%d2 46f24: 2c3c 0004 d784 movel #317316,%d6 46f2a: 4bf9 0004 d7b0 lea 4d7b0 ,%a5 46f30: 49f9 0004 d7ec lea 4d7ec ,%a4 46f36: 5985 subql #4,%d5 46f38: 47f9 0004 6af8 lea 46af8 ,%a3 for ( index=0 ; index < maximum ; index++ ) { /* * There is no way for these calls to fail in this situation. */ (void) pthread_attr_init( &attr ); 46f3e: 2f02 movel %d2,%sp@- 46f40: 2046 moveal %d6,%a0 46f42: 4e90 jsr %a0@ (void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); 46f44: 4878 0002 pea 2 46f48: 2f02 movel %d2,%sp@- 46f4a: 4e95 jsr %a5@ (void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size); 46f4c: 2f2a 0004 movel %a2@(4),%sp@- 46f50: 2f02 movel %d2,%sp@- 46f52: 4e94 jsr %a4@ status = pthread_create( 46f54: 42a7 clrl %sp@- 46f56: 2f12 movel %a2@,%sp@- 46f58: 2f02 movel %d2,%sp@- 46f5a: 2f05 movel %d5,%sp@- 46f5c: 4e93 jsr %a3@ &thread_id, &attr, user_threads[ index ].thread_entry, NULL ); if ( status ) 46f5e: 4fef 0024 lea %sp@(36),%sp 46f62: 4a80 tstl %d0 46f64: 6612 bnes 46f78 <_POSIX_Threads_Initialize_user_threads_body+0x7c> * * Setting the attributes explicitly is critical, since we don't want * to inherit the idle tasks attributes. */ for ( index=0 ; index < maximum ; index++ ) { 46f66: 5283 addql #1,%d3 46f68: 508a addql #8,%a2 46f6a: b684 cmpl %d4,%d3 46f6c: 66d0 bnes 46f3e <_POSIX_Threads_Initialize_user_threads_body+0x42><== NEVER TAKEN NULL ); if ( status ) _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status ); } } 46f6e: 4cee 3c7c ff98 moveml %fp@(-104),%d2-%d6/%a2-%a5 46f74: 4e5e unlk %fp 46f76: 4e75 rts &attr, user_threads[ index ].thread_entry, NULL ); if ( status ) _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status ); 46f78: 2f00 movel %d0,%sp@- 46f7a: 4878 0001 pea 1 46f7e: 4878 0002 pea 2 46f82: 4eb9 0004 9098 jsr 49098 <_Internal_error_Occurred> =============================================================================== 0004c5a6 <_POSIX_Threads_Sporadic_budget_TSR>: */ void _POSIX_Threads_Sporadic_budget_TSR( Objects_Id id __attribute__((unused)), void *argument ) { 4c5a6: 4e56 fff4 linkw %fp,#-12 4c5aa: 48d7 1c00 moveml %a2-%a4,%sp@ 4c5ae: 266e 000c moveal %fp@(12),%a3 the_thread = argument; 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 ); 4c5b2: 49f9 0004 d418 lea 4d418 <_Timespec_To_ticks>,%a4 Thread_Control *the_thread; POSIX_API_Control *api; the_thread = argument; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4c5b8: 246b 0102 moveal %a3@(258),%a2 /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_init_budget ); 4c5bc: 486a 0098 pea %a2@(152) 4c5c0: 4e94 jsr %a4@ */ #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 ) { 4c5c2: 588f addql #4,%sp RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( int priority ) { return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1); 4c5c4: 4281 clrl %d1 4c5c6: 1239 0005 f6aa moveb 5f6aa ,%d1 4c5cc: 92aa 0088 subl %a2@(136),%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; 4c5d0: 2740 0076 movel %d0,%a3@(118) new_priority = _POSIX_Priority_To_core( api->schedparam.sched_priority ); the_thread->real_priority = new_priority; 4c5d4: 2741 0018 movel %d1,%a3@(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 ) { 4c5d8: 4aab 001c tstl %a3@(28) 4c5dc: 6606 bnes 4c5e4 <_POSIX_Threads_Sporadic_budget_TSR+0x3e><== NEVER TAKEN /* * If this would make them less important, then do not change it. */ if ( the_thread->current_priority > new_priority ) { 4c5de: b2ab 0014 cmpl %a3@(20),%d1 4c5e2: 652c bcss 4c610 <_POSIX_Threads_Sporadic_budget_TSR+0x6a> #endif } } /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_repl_period ); 4c5e4: 486a 0090 pea %a2@(144) 4c5e8: 4e94 jsr %a4@ ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 4c5ea: 588f addql #4,%sp Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 4c5ec: 2540 00b4 movel %d0,%a2@(180) _Watchdog_Insert_ticks( &api->Sporadic_timer, ticks ); 4c5f0: 45ea 00a8 lea %a2@(168),%a2 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 4c5f4: 203c 0006 1100 movel #397568,%d0 4c5fa: 2d4a 000c movel %a2,%fp@(12) } 4c5fe: 4cee 1c00 fff4 moveml %fp@(-12),%a2-%a4 4c604: 2d40 0008 movel %d0,%fp@(8) 4c608: 4e5e unlk %fp 4c60a: 4ef9 0004 a018 jmp 4a018 <_Watchdog_Insert> if ( the_thread->resource_count == 0 ) { /* * If this would make them less important, then do not change it. */ if ( the_thread->current_priority > new_priority ) { _Thread_Change_priority( the_thread, new_priority, true ); 4c610: 4878 0001 pea 1 4c614: 2f01 movel %d1,%sp@- 4c616: 2f0b movel %a3,%sp@- 4c618: 4eb9 0004 8d38 jsr 48d38 <_Thread_Change_priority> 4c61e: 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 ); 4c622: 486a 0090 pea %a2@(144) 4c626: 4e94 jsr %a4@ 4c628: 588f addql #4,%sp Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 4c62a: 2540 00b4 movel %d0,%a2@(180) _Watchdog_Insert_ticks( &api->Sporadic_timer, ticks ); 4c62e: 45ea 00a8 lea %a2@(168),%a2 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 4c632: 203c 0006 1100 movel #397568,%d0 4c638: 2d4a 000c movel %a2,%fp@(12) } 4c63c: 4cee 1c00 fff4 moveml %fp@(-12),%a2-%a4 4c642: 2d40 0008 movel %d0,%fp@(8) 4c646: 4e5e unlk %fp 4c648: 4ef9 0004 a018 jmp 4a018 <_Watchdog_Insert> =============================================================================== 0004c64e <_POSIX_Threads_Sporadic_budget_callout>: 4c64e: 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 */ 4c650: 72ff moveq #-1,%d1 * _POSIX_Threads_Sporadic_budget_callout */ void _POSIX_Threads_Sporadic_budget_callout( Thread_Control *the_thread ) { 4c652: 4e56 0000 linkw %fp,#0 4c656: 206e 0008 moveal %fp@(8),%a0 4c65a: 1039 0005 f6aa moveb 5f6aa ,%d0 POSIX_API_Control *api; uint32_t new_priority; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4c660: 2268 0102 moveal %a0@(258),%a1 4c664: 90a9 008c subl %a1@(140),%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 */ 4c668: 2141 0076 movel %d1,%a0@(118) new_priority = _POSIX_Priority_To_core(api->schedparam.sched_ss_low_priority); the_thread->real_priority = new_priority; 4c66c: 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 ) { 4c670: 4aa8 001c tstl %a0@(28) 4c674: 6606 bnes 4c67c <_POSIX_Threads_Sporadic_budget_callout+0x2e><== 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 ) { 4c676: b0a8 0014 cmpl %a0@(20),%d0 4c67a: 6204 bhis 4c680 <_POSIX_Threads_Sporadic_budget_callout+0x32><== ALWAYS TAKEN #if 0 printk( "lower priority\n" ); #endif } } } 4c67c: 4e5e unlk %fp <== NOT EXECUTED 4c67e: 4e75 rts <== NOT EXECUTED * Make sure we are actually lowering it. If they have lowered it * to logically lower than sched_ss_low_priority, then we do not want to * change it. */ if ( the_thread->current_priority < new_priority ) { _Thread_Change_priority( the_thread, new_priority, true ); 4c680: 4878 0001 pea 1 4c684: 2f00 movel %d0,%sp@- 4c686: 2f08 movel %a0,%sp@- 4c688: 4eb9 0004 8d38 jsr 48d38 <_Thread_Change_priority> 4c68e: 4fef 000c lea %sp@(12),%sp #if 0 printk( "lower priority\n" ); #endif } } } 4c692: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004e650 <_POSIX_Threads_cancel_run>: thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; handler_stack = &thread_support->Cancellation_Handlers; thread_support->cancelability_state = PTHREAD_CANCEL_DISABLE; 4e650: 7001 moveq #1,%d0 #include void _POSIX_Threads_cancel_run( Thread_Control *the_thread ) { 4e652: 4e56 ffec linkw %fp,#-20 4e656: 206e 0008 moveal %fp@(8),%a0 4e65a: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@ POSIX_Cancel_Handler_control *handler; Chain_Control *handler_stack; POSIX_API_Control *thread_support; ISR_Level level; thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4e65e: 2668 0102 moveal %a0@(258),%a3 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 4e662: 240b movel %a3,%d2 4e664: 0682 0000 00e8 addil #232,%d2 handler_stack = &thread_support->Cancellation_Handlers; thread_support->cancelability_state = PTHREAD_CANCEL_DISABLE; 4e66a: 2740 00d8 movel %d0,%a3@(216) while ( !_Chain_Is_empty( handler_stack ) ) { 4e66e: b4ab 00e4 cmpl %a3@(228),%d2 4e672: 673c beqs 4e6b0 <_POSIX_Threads_cancel_run+0x60> 4e674: 49f9 0004 a2fe lea 4a2fe <_Workspace_Free>,%a4 _ISR_Disable( level ); 4e67a: 263c 0000 0700 movel #1792,%d3 4e680: 2003 movel %d3,%d0 4e682: 40c1 movew %sr,%d1 4e684: 8081 orl %d1,%d0 4e686: 46c0 movew %d0,%sr handler = (POSIX_Cancel_Handler_control *) 4e688: 246b 00ec moveal %a3@(236),%a2 ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 4e68c: 2252 moveal %a2@,%a1 previous = the_node->previous; 4e68e: 206a 0004 moveal %a2@(4),%a0 next->previous = previous; 4e692: 2348 0004 movel %a0,%a1@(4) previous->next = next; 4e696: 2089 movel %a1,%a0@ _Chain_Tail( handler_stack )->previous; _Chain_Extract_unprotected( &handler->Node ); _ISR_Enable( level ); 4e698: 46c1 movew %d1,%sr (*handler->routine)( handler->arg ); 4e69a: 2f2a 000c movel %a2@(12),%sp@- 4e69e: 206a 0008 moveal %a2@(8),%a0 4e6a2: 4e90 jsr %a0@ _Workspace_Free( handler ); 4e6a4: 2f0a movel %a2,%sp@- 4e6a6: 4e94 jsr %a4@ handler_stack = &thread_support->Cancellation_Handlers; thread_support->cancelability_state = PTHREAD_CANCEL_DISABLE; while ( !_Chain_Is_empty( handler_stack ) ) { 4e6a8: 508f addql #8,%sp 4e6aa: b4ab 00e4 cmpl %a3@(228),%d2 4e6ae: 66d0 bnes 4e680 <_POSIX_Threads_cancel_run+0x30> <== NEVER TAKEN (*handler->routine)( handler->arg ); _Workspace_Free( handler ); } } 4e6b0: 4cee 1c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a4 4e6b6: 4e5e unlk %fp ... =============================================================================== 000467d0 <_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) { 467d0: 4e56 0000 linkw %fp,#0 467d4: 2f0a movel %a2,%sp@- 467d6: 246e 000c moveal %fp@(12),%a2 bool activated; ptimer = (POSIX_Timer_Control *)data; /* Increment the number of expirations. */ ptimer->overrun = ptimer->overrun + 1; 467da: 52aa 0066 addql #1,%a2@(102) /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || 467de: 4aaa 0052 tstl %a2@(82) 467e2: 6606 bnes 467ea <_POSIX_Timer_TSR+0x1a> 467e4: 4aaa 0056 tstl %a2@(86) 467e8: 672a beqs 46814 <_POSIX_Timer_TSR+0x44> <== NEVER TAKEN ( ptimer->timer_data.it_interval.tv_nsec != 0 ) ) { activated = _POSIX_Timer_Insert_helper( 467ea: 2f0a movel %a2,%sp@- 467ec: 4879 0004 67d0 pea 467d0 <_POSIX_Timer_TSR> 467f2: 2f2a 0008 movel %a2@(8),%sp@- 467f6: 2f2a 0062 movel %a2@(98),%sp@- 467fa: 486a 0010 pea %a2@(16) 467fe: 4eb9 0004 ce90 jsr 4ce90 <_POSIX_Timer_Insert_helper> ptimer->ticks, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) 46804: 4fef 0014 lea %sp@(20),%sp 46808: 4a00 tstb %d0 4680a: 662a bnes 46836 <_POSIX_Timer_TSR+0x66> <== ALWAYS TAKEN /* After the signal handler returns, the count of expirations of the * timer must be set to 0. */ ptimer->overrun = 0; } 4680c: 246e fffc moveal %fp@(-4),%a2 <== NOT EXECUTED 46810: 4e5e unlk %fp <== NOT EXECUTED 46812: 4e75 rts <== NOT EXECUTED /* The state really did not change but just to be safe */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; } else { /* Indicates that the timer is stopped */ ptimer->state = POSIX_TIMER_STATE_CREATE_STOP; 46814: 7004 moveq #4,%d0 <== NOT EXECUTED 46816: 1540 003c moveb %d0,%a2@(60) <== NOT EXECUTED /* * The sending of the signal to the process running the handling function * specified for that signal is simulated */ if ( pthread_kill ( ptimer->thread_id, ptimer->inf.sigev_signo ) ) { 4681a: 2f2a 0042 movel %a2@(66),%sp@- <== NOT EXECUTED 4681e: 2f2a 0038 movel %a2@(56),%sp@- <== NOT EXECUTED 46822: 4eb9 0004 c9b4 jsr 4c9b4 <== NOT EXECUTED } /* After the signal handler returns, the count of expirations of the * timer must be set to 0. */ ptimer->overrun = 0; 46828: 508f addql #8,%sp <== NOT EXECUTED 4682a: 42aa 0066 clrl %a2@(102) <== NOT EXECUTED } 4682e: 246e fffc moveal %fp@(-4),%a2 46832: 4e5e unlk %fp 46834: 4e75 rts ); if ( !activated ) return; /* Store the time when the timer was started again */ _TOD_Get( &ptimer->time ); 46836: 486a 006a pea %a2@(106) 4683a: 4eb9 0004 800c jsr 4800c <_TOD_Get> /* The state really did not change but just to be safe */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; 46840: 588f addql #4,%sp 46842: 7003 moveq #3,%d0 46844: 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 ) ) { 46848: 2f2a 0042 movel %a2@(66),%sp@- 4684c: 2f2a 0038 movel %a2@(56),%sp@- 46850: 4eb9 0004 c9b4 jsr 4c9b4 } /* After the signal handler returns, the count of expirations of the * timer must be set to 0. */ ptimer->overrun = 0; 46856: 508f addql #8,%sp 46858: 42aa 0066 clrl %a2@(102) 4685c: 60d0 bras 4682e <_POSIX_Timer_TSR+0x5e> ... =============================================================================== 0004f004 <_POSIX_signals_Clear_process_signals>: clear_signal = true; mask = signo_to_mask( signo ); ISR_Level level; _ISR_Disable( level ); 4f004: 203c 0000 0700 movel #1792,%d0 */ void _POSIX_signals_Clear_process_signals( int signo ) { 4f00a: 4e56 0000 linkw %fp,#0 4f00e: 222e 0008 movel %fp@(8),%d1 4f012: 2f03 movel %d3,%sp@- 4f014: 2f02 movel %d2,%sp@- clear_signal = true; mask = signo_to_mask( signo ); ISR_Level level; _ISR_Disable( level ); 4f016: 40c2 movew %sr,%d2 4f018: 8082 orl %d2,%d0 4f01a: 46c0 movew %d0,%sr if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { 4f01c: 2601 movel %d1,%d3 4f01e: 2001 movel %d1,%d0 4f020: 41f9 0006 14e4 lea 614e4 <_POSIX_signals_Vectors>,%a0 4f026: e58b lsll #2,%d3 4f028: e988 lsll #4,%d0 4f02a: 9083 subl %d3,%d0 4f02c: 7602 moveq #2,%d3 4f02e: b6b0 0800 cmpl %a0@(00000000,%d0:l),%d3 4f032: 6718 beqs 4f04c <_POSIX_signals_Clear_process_signals+0x48> 4f034: 5381 subql #1,%d1 4f036: 7001 moveq #1,%d0 4f038: e3a8 lsll %d1,%d0 if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) clear_signal = false; } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; 4f03a: 4680 notl %d0 4f03c: c1b9 0006 16d8 andl %d0,616d8 <_POSIX_signals_Pending> } _ISR_Enable( level ); 4f042: 46c2 movew %d2,%sr } 4f044: 241f movel %sp@+,%d2 4f046: 261f movel %sp@+,%d3 4f048: 4e5e unlk %fp 4f04a: 4e75 rts ISR_Level level; _ISR_Disable( level ); if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) 4f04c: 0680 0006 16dc addil #399068,%d0 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 4f052: 2040 moveal %d0,%a0 4f054: 5888 addql #4,%a0 4f056: 2240 moveal %d0,%a1 4f058: b1d1 cmpal %a1@,%a0 4f05a: 67d8 beqs 4f034 <_POSIX_signals_Clear_process_signals+0x30><== ALWAYS TAKEN clear_signal = false; } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; } _ISR_Enable( level ); 4f05c: 46c2 movew %d2,%sr <== NOT EXECUTED } 4f05e: 241f movel %sp@+,%d2 <== NOT EXECUTED 4f060: 261f movel %sp@+,%d3 <== NOT EXECUTED 4f062: 4e5e unlk %fp <== NOT EXECUTED ... =============================================================================== 000475f4 <_POSIX_signals_Get_lowest>: sigset_t set ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 475f4: 701b moveq #27,%d0 #include int _POSIX_signals_Get_lowest( sigset_t set ) { 475f6: 4e56 fff4 linkw %fp,#-12 475fa: 48d7 001c moveml %d2-%d4,%sp@ 475fe: 242e 0008 movel %fp@(8),%d2 47602: 7601 moveq #1,%d3 #include #include #include #include int _POSIX_signals_Get_lowest( 47604: 2200 movel %d0,%d1 47606: 5381 subql #1,%d1 47608: 2803 movel %d3,%d4 4760a: e3ac lsll %d1,%d4 4760c: 2204 movel %d4,%d1 ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { if ( set & signo_to_mask( signo ) ) { 4760e: c282 andl %d2,%d1 47610: 6626 bnes 47638 <_POSIX_signals_Get_lowest+0x44> <== NEVER TAKEN sigset_t set ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 47612: 5280 addql #1,%d0 47614: 123c 0020 moveb #32,%d1 47618: b280 cmpl %d0,%d1 4761a: 66e8 bnes 47604 <_POSIX_signals_Get_lowest+0x10> 4761c: 7001 moveq #1,%d0 4761e: 7601 moveq #1,%d3 #include #include #include #include int _POSIX_signals_Get_lowest( 47620: 2200 movel %d0,%d1 47622: 5381 subql #1,%d1 47624: 2803 movel %d3,%d4 47626: e3ac lsll %d1,%d4 47628: 2204 movel %d4,%d1 #if (SIGHUP != 1) #error "Assumption that SIGHUP==1 violated!!" #endif for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { if ( set & signo_to_mask( signo ) ) { 4762a: c282 andl %d2,%d1 4762c: 660a bnes 47638 <_POSIX_signals_Get_lowest+0x44> */ #if (SIGHUP != 1) #error "Assumption that SIGHUP==1 violated!!" #endif for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { 4762e: 5280 addql #1,%d0 47630: 123c 001b moveb #27,%d1 47634: b280 cmpl %d0,%d1 47636: 66e8 bnes 47620 <_POSIX_signals_Get_lowest+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; } 47638: 4cd7 001c moveml %sp@,%d2-%d4 4763c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004c13a <_POSIX_signals_Post_switch_extension>: */ void _POSIX_signals_Post_switch_extension( Thread_Control *the_thread ) { 4c13a: 4e56 ffec linkw %fp,#-20 4c13e: 206e 0008 moveal %fp@(8),%a0 4c142: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ POSIX_API_Control *api; int signo; ISR_Level level; int hold_errno; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4c146: 2468 0102 moveal %a0@(258),%a2 /* * We need to ensure that if the signal handler executes a call * which overwrites the unblocking status, we restore it. */ hold_errno = _Thread_Executing->Wait.return_code; 4c14a: 2079 0006 14aa moveal 614aa <_Per_CPU_Information+0xc>,%a0 4c150: 2828 0034 movel %a0@(52),%d4 /* * api may be NULL in case of a thread close in progress */ if ( !api ) 4c154: 4a8a tstl %a2 4c156: 6700 0098 beqw 4c1f0 <_POSIX_signals_Post_switch_extension+0xb6> * * The first thing done is to check there are any signals to be * processed at all. No point in doing this loop otherwise. */ while (1) { _ISR_Disable( level ); 4c15a: 263c 0000 0700 movel #1792,%d3 4c160: 47f9 0004 e748 lea 4e748 <_POSIX_signals_Check_signal>,%a3 4c166: 2003 movel %d3,%d0 4c168: 40c1 movew %sr,%d1 4c16a: 8081 orl %d1,%d0 4c16c: 46c0 movew %d0,%sr if ( !(~api->signals_blocked & (api->signals_pending | _POSIX_signals_Pending)) ) { 4c16e: 2039 0006 16d8 movel 616d8 <_POSIX_signals_Pending>,%d0 * The first thing done is to check there are any signals to be * processed at all. No point in doing this loop otherwise. */ while (1) { _ISR_Disable( level ); if ( !(~api->signals_blocked & 4c174: 242a 00d0 movel %a2@(208),%d2 4c178: 4682 notl %d2 (api->signals_pending | _POSIX_signals_Pending)) ) { 4c17a: 80aa 00d4 orl %a2@(212),%d0 * The first thing done is to check there are any signals to be * processed at all. No point in doing this loop otherwise. */ while (1) { _ISR_Disable( level ); if ( !(~api->signals_blocked & 4c17e: c082 andl %d2,%d0 (api->signals_pending | _POSIX_signals_Pending)) ) { _ISR_Enable( level ); 4c180: 46c1 movew %d1,%sr * The first thing done is to check there are any signals to be * processed at all. No point in doing this loop otherwise. */ while (1) { _ISR_Disable( level ); if ( !(~api->signals_blocked & 4c182: 4a80 tstl %d0 4c184: 6760 beqs 4c1e6 <_POSIX_signals_Post_switch_extension+0xac> _ISR_Enable( level ); break; } _ISR_Enable( level ); for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 4c186: 741b moveq #27,%d2 _POSIX_signals_Check_signal( api, signo, false ); 4c188: 42a7 clrl %sp@- 4c18a: 2f02 movel %d2,%sp@- 4c18c: 2f0a movel %a2,%sp@- 4c18e: 4e93 jsr %a3@ _POSIX_signals_Check_signal( api, signo, true ); 4c190: 4878 0001 pea 1 4c194: 2f02 movel %d2,%sp@- _ISR_Enable( level ); break; } _ISR_Enable( level ); for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 4c196: 5282 addql #1,%d2 _POSIX_signals_Check_signal( api, signo, false ); _POSIX_signals_Check_signal( api, signo, true ); 4c198: 2f0a movel %a2,%sp@- 4c19a: 4e93 jsr %a3@ _ISR_Enable( level ); break; } _ISR_Enable( level ); for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 4c19c: 4fef 0018 lea %sp@(24),%sp 4c1a0: 7020 moveq #32,%d0 4c1a2: b082 cmpl %d2,%d0 4c1a4: 66e2 bnes 4c188 <_POSIX_signals_Post_switch_extension+0x4e> 4c1a6: 7401 moveq #1,%d2 _POSIX_signals_Check_signal( api, signo, true ); } /* Unfortunately - nothing like __SIGFIRSTNOTRT in newlib signal .h */ for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { _POSIX_signals_Check_signal( api, signo, false ); 4c1a8: 42a7 clrl %sp@- 4c1aa: 2f02 movel %d2,%sp@- 4c1ac: 2f0a movel %a2,%sp@- 4c1ae: 4e93 jsr %a3@ _POSIX_signals_Check_signal( api, signo, true ); 4c1b0: 4878 0001 pea 1 4c1b4: 2f02 movel %d2,%sp@- _POSIX_signals_Check_signal( api, signo, false ); _POSIX_signals_Check_signal( api, signo, true ); } /* Unfortunately - nothing like __SIGFIRSTNOTRT in newlib signal .h */ for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { 4c1b6: 5282 addql #1,%d2 _POSIX_signals_Check_signal( api, signo, false ); _POSIX_signals_Check_signal( api, signo, true ); 4c1b8: 2f0a movel %a2,%sp@- 4c1ba: 4e93 jsr %a3@ _POSIX_signals_Check_signal( api, signo, false ); _POSIX_signals_Check_signal( api, signo, true ); } /* Unfortunately - nothing like __SIGFIRSTNOTRT in newlib signal .h */ for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { 4c1bc: 4fef 0018 lea %sp@(24),%sp 4c1c0: 701b moveq #27,%d0 4c1c2: b082 cmpl %d2,%d0 4c1c4: 67a0 beqs 4c166 <_POSIX_signals_Post_switch_extension+0x2c><== NEVER TAKEN _POSIX_signals_Check_signal( api, signo, false ); 4c1c6: 42a7 clrl %sp@- 4c1c8: 2f02 movel %d2,%sp@- 4c1ca: 2f0a movel %a2,%sp@- 4c1cc: 4e93 jsr %a3@ _POSIX_signals_Check_signal( api, signo, true ); 4c1ce: 4878 0001 pea 1 4c1d2: 2f02 movel %d2,%sp@- _POSIX_signals_Check_signal( api, signo, false ); _POSIX_signals_Check_signal( api, signo, true ); } /* Unfortunately - nothing like __SIGFIRSTNOTRT in newlib signal .h */ for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { 4c1d4: 5282 addql #1,%d2 _POSIX_signals_Check_signal( api, signo, false ); _POSIX_signals_Check_signal( api, signo, true ); 4c1d6: 2f0a movel %a2,%sp@- 4c1d8: 4e93 jsr %a3@ _POSIX_signals_Check_signal( api, signo, false ); _POSIX_signals_Check_signal( api, signo, true ); } /* Unfortunately - nothing like __SIGFIRSTNOTRT in newlib signal .h */ for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { 4c1da: 4fef 0018 lea %sp@(24),%sp 4c1de: 701b moveq #27,%d0 4c1e0: b082 cmpl %d2,%d0 4c1e2: 66c4 bnes 4c1a8 <_POSIX_signals_Post_switch_extension+0x6e> 4c1e4: 6080 bras 4c166 <_POSIX_signals_Post_switch_extension+0x2c> _POSIX_signals_Check_signal( api, signo, false ); _POSIX_signals_Check_signal( api, signo, true ); } } _Thread_Executing->Wait.return_code = hold_errno; 4c1e6: 2079 0006 14aa moveal 614aa <_Per_CPU_Information+0xc>,%a0 4c1ec: 2144 0034 movel %d4,%a0@(52) } 4c1f0: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 4c1f6: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0005d2c0 <_POSIX_signals_Unblock_thread>: 5d2c0: 7001 moveq #1,%d0 bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, siginfo_t *info ) { 5d2c2: 4e56 ffec linkw %fp,#-20 5d2c6: 206e 000c moveal %fp@(12),%a0 5d2ca: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 5d2ce: 246e 0008 moveal %fp@(8),%a2 5d2d2: 2608 movel %a0,%d3 5d2d4: 5383 subql #1,%d3 /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 5d2d6: 222a 0010 movel %a2@(16),%d1 5d2da: 2401 movel %d1,%d2 5d2dc: 0282 1000 8000 andil #268468224,%d2 bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, siginfo_t *info ) { 5d2e2: 282e 0010 movel %fp@(16),%d4 POSIX_API_Control *api; sigset_t mask; siginfo_t *the_info = NULL; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 5d2e6: 226a 0102 moveal %a2@(258),%a1 5d2ea: e7a8 lsll %d3,%d0 /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 5d2ec: 0c82 1000 8000 cmpil #268468224,%d2 5d2f2: 6770 beqs 5d364 <_POSIX_signals_Unblock_thread+0xa4> } /* * Thread is not waiting due to a sigwait. */ if ( ~api->signals_blocked & mask ) { 5d2f4: 2429 00d0 movel %a1@(208),%d2 5d2f8: 4682 notl %d2 5d2fa: c082 andl %d2,%d0 5d2fc: 675a beqs 5d358 <_POSIX_signals_Unblock_thread+0x98> * it is not blocked, THEN * we need to dispatch at the end of this ISR. * + Any other combination, do nothing. */ if ( _States_Is_interruptible_by_signal( the_thread->current_state ) ) { 5d2fe: 0801 001c btst #28,%d1 5d302: 673e beqs 5d342 <_POSIX_signals_Unblock_thread+0x82> the_thread->Wait.return_code = EINTR; 5d304: 7004 moveq #4,%d0 5d306: 2540 0034 movel %d0,%a2@(52) */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue ( States_Control the_states ) { return (the_states & STATES_WAITING_ON_THREAD_QUEUE); 5d30a: 2001 movel %d1,%d0 5d30c: 0280 0003 bee0 andil #245472,%d0 /* * In pthread_cond_wait, a thread will be blocking on a thread * queue, but is also interruptible by a POSIX signal. */ if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) ) 5d312: 6600 00a0 bnew 5d3b4 <_POSIX_signals_Unblock_thread+0xf4> _Thread_queue_Extract_with_proxy( the_thread ); else if ( _States_Is_delaying(the_thread->current_state) ) { 5d316: 44c1 movew %d1,%ccr 5d318: 6a3e bpls 5d358 <_POSIX_signals_Unblock_thread+0x98><== NEVER TAKEN (void) _Watchdog_Remove( &the_thread->Timer ); 5d31a: 486a 0048 pea %a2@(72) 5d31e: 4eb9 0004 a160 jsr 4a160 <_Watchdog_Remove> RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 5d324: 2f3c 1003 fff8 movel #268697592,%sp@- 5d32a: 2f0a movel %a2,%sp@- 5d32c: 4eb9 0004 8e1c jsr 48e1c <_Thread_Clear_state> 5d332: 4fef 000c lea %sp@(12),%sp if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; } } return false; } 5d336: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 } else if ( the_thread->current_state == STATES_READY ) { if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; } } return false; 5d33c: 4200 clrb %d0 } 5d33e: 4e5e unlk %fp 5d340: 4e75 rts else if ( _States_Is_delaying(the_thread->current_state) ) { (void) _Watchdog_Remove( &the_thread->Timer ); _Thread_Unblock( the_thread ); } } else if ( the_thread->current_state == STATES_READY ) { 5d342: 4a81 tstl %d1 5d344: 6612 bnes 5d358 <_POSIX_signals_Unblock_thread+0x98><== NEVER TAKEN if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 5d346: 4ab9 0006 14a6 tstl 614a6 <_Per_CPU_Information+0x8> 5d34c: 670a beqs 5d358 <_POSIX_signals_Unblock_thread+0x98> 5d34e: b5f9 0006 14aa cmpal 614aa <_Per_CPU_Information+0xc>,%a2 5d354: 6700 0090 beqw 5d3e6 <_POSIX_signals_Unblock_thread+0x126> _Thread_Dispatch_necessary = true; } } return false; } 5d358: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 } else if ( the_thread->current_state == STATES_READY ) { if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; } } return false; 5d35e: 4200 clrb %d0 } 5d360: 4e5e unlk %fp 5d362: 4e75 rts * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { 5d364: 2200 movel %d0,%d1 5d366: c2aa 0030 andl %a2@(48),%d1 5d36a: 672e beqs 5d39a <_POSIX_signals_Unblock_thread+0xda> the_thread->Wait.return_code = EINTR; 5d36c: 7004 moveq #4,%d0 the_info = (siginfo_t *) the_thread->Wait.return_argument; 5d36e: 266a 0028 moveal %a2@(40),%a3 */ 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; 5d372: 2540 0034 movel %d0,%a2@(52) the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { 5d376: 4a84 tstl %d4 5d378: 6750 beqs 5d3ca <_POSIX_signals_Unblock_thread+0x10a> the_info->si_signo = signo; the_info->si_code = SI_USER; the_info->si_value.sival_int = 0; } else { *the_info = *info; 5d37a: 2244 moveal %d4,%a1 5d37c: 204b moveal %a3,%a0 5d37e: 20d9 movel %a1@+,%a0@+ 5d380: 20d9 movel %a1@+,%a0@+ 5d382: 2091 movel %a1@,%a0@ } _Thread_queue_Extract_with_proxy( the_thread ); 5d384: 2f0a movel %a2,%sp@- 5d386: 4eb9 0004 9934 jsr 49934 <_Thread_queue_Extract_with_proxy> return true; 5d38c: 588f addql #4,%sp 5d38e: 7001 moveq #1,%d0 if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; } } return false; } 5d390: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 5d396: 4e5e unlk %fp 5d398: 4e75 rts * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { 5d39a: 2229 00d0 movel %a1@(208),%d1 5d39e: 4681 notl %d1 5d3a0: c081 andl %d1,%d0 5d3a2: 67b4 beqs 5d358 <_POSIX_signals_Unblock_thread+0x98> the_thread->Wait.return_code = EINTR; 5d3a4: 7004 moveq #4,%d0 the_info = (siginfo_t *) the_thread->Wait.return_argument; 5d3a6: 266a 0028 moveal %a2@(40),%a3 */ 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; 5d3aa: 2540 0034 movel %d0,%a2@(52) the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { 5d3ae: 4a84 tstl %d4 5d3b0: 66c8 bnes 5d37a <_POSIX_signals_Unblock_thread+0xba><== ALWAYS TAKEN 5d3b2: 6016 bras 5d3ca <_POSIX_signals_Unblock_thread+0x10a><== NOT EXECUTED /* * In pthread_cond_wait, a thread will be blocking on a thread * queue, but is also interruptible by a POSIX signal. */ if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) ) _Thread_queue_Extract_with_proxy( the_thread ); 5d3b4: 2f0a movel %a2,%sp@- 5d3b6: 4eb9 0004 9934 jsr 49934 <_Thread_queue_Extract_with_proxy> 5d3bc: 588f addql #4,%sp if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; } } return false; } 5d3be: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 } else if ( the_thread->current_state == STATES_READY ) { if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; } } return false; 5d3c4: 4200 clrb %d0 } 5d3c6: 4e5e unlk %fp 5d3c8: 4e75 rts the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { the_info->si_signo = signo; the_info->si_code = SI_USER; 5d3ca: 103c 0001 moveb #1,%d0 the_thread->Wait.return_code = EINTR; the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { the_info->si_signo = signo; 5d3ce: 2688 movel %a0,%a3@ the_info->si_code = SI_USER; 5d3d0: 2740 0004 movel %d0,%a3@(4) the_info->si_value.sival_int = 0; 5d3d4: 42ab 0008 clrl %a3@(8) } else { *the_info = *info; } _Thread_queue_Extract_with_proxy( the_thread ); 5d3d8: 2f0a movel %a2,%sp@- 5d3da: 4eb9 0004 9934 jsr 49934 <_Thread_queue_Extract_with_proxy> return true; 5d3e0: 588f addql #4,%sp 5d3e2: 7001 moveq #1,%d0 5d3e4: 60aa bras 5d390 <_POSIX_signals_Unblock_thread+0xd0> _Thread_Unblock( the_thread ); } } else if ( the_thread->current_state == STATES_READY ) { if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; 5d3e6: 7001 moveq #1,%d0 } } return false; } 5d3e8: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 5d3ee: 4e5e unlk %fp _Thread_Unblock( the_thread ); } } else if ( the_thread->current_state == STATES_READY ) { if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; 5d3f0: 13c0 0006 14b6 moveb %d0,614b6 <_Per_CPU_Information+0x18> } } return false; 5d3f6: 4200 clrb %d0 } ... =============================================================================== 0004d5b0 <_Protected_heap_Walk>: bool _Protected_heap_Walk( Heap_Control *the_heap, int source, bool do_dump ) { 4d5b0: 4e56 fff0 linkw %fp,#-16 * This routine returns true if thread dispatch indicates * that we are in a critical section. */ RTEMS_INLINE_ROUTINE bool _Thread_Dispatch_in_critical_section(void) { if ( _Thread_Dispatch_disable_level == 0 ) 4d5b4: 2039 0006 7254 movel 67254 <_Thread_Dispatch_disable_level>,%d0 4d5ba: 48d7 001c moveml %d2-%d4,%sp@ 4d5be: 242e 0008 movel %fp@(8),%d2 4d5c2: 282e 000c movel %fp@(12),%d4 4d5c6: 162e 0013 moveb %fp@(19),%d3 4d5ca: 4a80 tstl %d0 4d5cc: 6640 bnes 4d60e <_Protected_heap_Walk+0x5e> * a critical section, it should be safe to walk it unlocked. * * NOTE: Dispatching is also disabled during initialization. */ if ( _Thread_Dispatch_in_critical_section() == false ) { _RTEMS_Lock_allocator(); 4d5ce: 2f39 0006 72f4 movel 672f4 <_RTEMS_Allocator_Mutex>,%sp@- status = _Heap_Walk( the_heap, source, do_dump ); 4d5d4: 0283 0000 00ff andil #255,%d3 * a critical section, it should be safe to walk it unlocked. * * NOTE: Dispatching is also disabled during initialization. */ if ( _Thread_Dispatch_in_critical_section() == false ) { _RTEMS_Lock_allocator(); 4d5da: 4eb9 0004 b7d0 jsr 4b7d0 <_API_Mutex_Lock> status = _Heap_Walk( the_heap, source, do_dump ); 4d5e0: 2f03 movel %d3,%sp@- 4d5e2: 2f04 movel %d4,%sp@- 4d5e4: 2f02 movel %d2,%sp@- 4d5e6: 4eb9 0004 c69e jsr 4c69e <_Heap_Walk> _RTEMS_Unlock_allocator(); 4d5ec: 2f39 0006 72f4 movel 672f4 <_RTEMS_Allocator_Mutex>,%sp@- 4d5f2: 2d40 fffc movel %d0,%fp@(-4) 4d5f6: 4eb9 0004 b830 jsr 4b830 <_API_Mutex_Unlock> } else { status = _Heap_Walk( the_heap, source, do_dump ); } return status; } 4d5fc: 202e fffc movel %fp@(-4),%d0 * NOTE: Dispatching is also disabled during initialization. */ if ( _Thread_Dispatch_in_critical_section() == false ) { _RTEMS_Lock_allocator(); status = _Heap_Walk( the_heap, source, do_dump ); _RTEMS_Unlock_allocator(); 4d600: 4fef 0014 lea %sp@(20),%sp } else { status = _Heap_Walk( the_heap, source, do_dump ); } return status; } 4d604: 4cee 001c fff0 moveml %fp@(-16),%d2-%d4 4d60a: 4e5e unlk %fp 4d60c: 4e75 rts if ( _Thread_Dispatch_in_critical_section() == false ) { _RTEMS_Lock_allocator(); status = _Heap_Walk( the_heap, source, do_dump ); _RTEMS_Unlock_allocator(); } else { status = _Heap_Walk( the_heap, source, do_dump ); 4d60e: 2d44 000c movel %d4,%fp@(12) 4d612: 0283 0000 00ff andil #255,%d3 4d618: 2d42 0008 movel %d2,%fp@(8) 4d61c: 2d43 0010 movel %d3,%fp@(16) } return status; } 4d620: 4cee 001c fff0 moveml %fp@(-16),%d2-%d4 4d626: 4e5e unlk %fp if ( _Thread_Dispatch_in_critical_section() == false ) { _RTEMS_Lock_allocator(); status = _Heap_Walk( the_heap, source, do_dump ); _RTEMS_Unlock_allocator(); } else { status = _Heap_Walk( the_heap, source, do_dump ); 4d628: 4ef9 0004 c69e jmp 4c69e <_Heap_Walk> ... =============================================================================== 0004dd38 <_RBTree_Extract_unprotected>: */ void _RBTree_Extract_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { 4dd38: 4e56 ffec linkw %fp,#-20 4dd3c: 48d7 3c04 moveml %d2/%a2-%a5,%sp@ 4dd40: 2a6e 0008 moveal %fp@(8),%a5 4dd44: 266e 000c moveal %fp@(12),%a3 RBTree_Node *leaf, *target; RBTree_Color victim_color; RBTree_Direction dir; if (!the_node) return; 4dd48: 4a8b tstl %a3 4dd4a: 6700 00b0 beqw 4ddfc <_RBTree_Extract_unprotected+0xc4> /* check if min needs to be updated */ if (the_node == the_rbtree->first[RBT_LEFT]) { 4dd4e: b7ed 0008 cmpal %a5@(8),%a3 4dd52: 6700 00f6 beqw 4de4a <_RBTree_Extract_unprotected+0x112> the_rbtree->first[RBT_LEFT])) the_rbtree->first[RBT_LEFT] = NULL; } } /* check if max needs to be updated: note, min can equal max (1 element) */ if (the_node == the_rbtree->first[RBT_RIGHT]) { 4dd56: b7ed 000c cmpal %a5@(12),%a3 4dd5a: 6700 00aa beqw 4de06 <_RBTree_Extract_unprotected+0xce> * either max in node->child[RBT_LEFT] or min in node->child[RBT_RIGHT], * and replace the_node with the target node. This maintains the binary * search tree property, but may violate the red-black properties. */ if (the_node->child[RBT_LEFT] && the_node->child[RBT_RIGHT]) { 4dd5e: 246b 0004 moveal %a3@(4),%a2 4dd62: 4a8a tstl %a2 4dd64: 6700 00b6 beqw 4de1c <_RBTree_Extract_unprotected+0xe4> 4dd68: 4aab 0008 tstl %a3@(8) 4dd6c: 6700 00f0 beqw 4de5e <_RBTree_Extract_unprotected+0x126> target = the_node->child[RBT_LEFT]; /* find max in node->child[RBT_LEFT] */ while (target->child[RBT_RIGHT]) target = target->child[RBT_RIGHT]; 4dd70: 202a 0008 movel %a2@(8),%d0 4dd74: 6708 beqs 4dd7e <_RBTree_Extract_unprotected+0x46> 4dd76: 2440 moveal %d0,%a2 4dd78: 202a 0008 movel %a2@(8),%d0 4dd7c: 66f8 bnes 4dd76 <_RBTree_Extract_unprotected+0x3e> * target's position (target is the right child of target->parent) * when target vacates it. if there is no child, then target->parent * should become NULL. This may cause the coloring to be violated. * For now we store the color of the node being deleted in victim_color. */ leaf = target->child[RBT_LEFT]; 4dd7e: 286a 0004 moveal %a2@(4),%a4 if(leaf) { 4dd82: 4a8c tstl %a4 4dd84: 6700 00f4 beqw 4de7a <_RBTree_Extract_unprotected+0x142> leaf->parent = target->parent; 4dd88: 2892 movel %a2@,%a4@ } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(target); } victim_color = target->color; dir = target != target->parent->child[0]; 4dd8a: 2252 moveal %a2@,%a1 4dd8c: b5e9 0004 cmpal %a1@(4),%a2 4dd90: 56c0 sne %d0 target->parent->child[dir] = leaf; 4dd92: 7201 moveq #1,%d1 /* now replace the_node with target */ dir = the_node != the_node->parent->child[0]; the_node->parent->child[dir] = target; 4dd94: 7401 moveq #1,%d2 } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(target); } victim_color = target->color; dir = target != target->parent->child[0]; 4dd96: 49c0 extbl %d0 target->parent->child[dir] = leaf; 4dd98: 9280 subl %d0,%d1 /* now replace the_node with target */ dir = the_node != the_node->parent->child[0]; 4dd9a: 2053 moveal %a3@,%a0 /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(target); } victim_color = target->color; dir = target != target->parent->child[0]; target->parent->child[dir] = leaf; 4dd9c: 238c 1c00 movel %a4,%a1@(00000000,%d1:l:4) /* now replace the_node with target */ dir = the_node != the_node->parent->child[0]; 4dda0: b7e8 0004 cmpal %a0@(4),%a3 4dda4: 56c1 sne %d1 leaf->parent = target->parent; } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(target); } victim_color = target->color; 4dda6: 202a 000c movel %a2@(12),%d0 dir = target != target->parent->child[0]; target->parent->child[dir] = leaf; /* now replace the_node with target */ dir = the_node != the_node->parent->child[0]; 4ddaa: 49c1 extbl %d1 the_node->parent->child[dir] = target; 4ddac: 9481 subl %d1,%d2 4ddae: 218a 2c00 movel %a2,%a0@(00000000,%d2:l:4) /* set target's new children to the original node's children */ target->child[RBT_RIGHT] = the_node->child[RBT_RIGHT]; 4ddb2: 256b 0008 0008 movel %a3@(8),%a2@(8) if (the_node->child[RBT_RIGHT]) 4ddb8: 206b 0008 moveal %a3@(8),%a0 4ddbc: 4a88 tstl %a0 4ddbe: 6702 beqs 4ddc2 <_RBTree_Extract_unprotected+0x8a><== NEVER TAKEN the_node->child[RBT_RIGHT]->parent = target; 4ddc0: 208a movel %a2,%a0@ target->child[RBT_LEFT] = the_node->child[RBT_LEFT]; 4ddc2: 256b 0004 0004 movel %a3@(4),%a2@(4) if (the_node->child[RBT_LEFT]) 4ddc8: 206b 0004 moveal %a3@(4),%a0 4ddcc: 4a88 tstl %a0 4ddce: 6702 beqs 4ddd2 <_RBTree_Extract_unprotected+0x9a> the_node->child[RBT_LEFT]->parent = target; 4ddd0: 208a movel %a2,%a0@ /* finally, update the parent node and recolor. target has completely * replaced the_node, and target's child has moved up the tree if needed. * the_node is no longer part of the tree, although it has valid pointers * still. */ target->parent = the_node->parent; 4ddd2: 2493 movel %a3@,%a2@ target->color = the_node->color; 4ddd4: 256b 000c 000c movel %a3@(12),%a2@(12) /* fix coloring. leaf has moved up the tree. The color of the deleted * node is in victim_color. There are two cases: * 1. Deleted a red node, its child must be black. Nothing must be done. * 2. Deleted a black node, its child must be red. Paint child black. */ if (victim_color == RBT_BLACK) { /* eliminate case 1 */ 4ddda: 4a80 tstl %d0 4dddc: 6608 bnes 4dde6 <_RBTree_Extract_unprotected+0xae> if (leaf) { 4ddde: 4a8c tstl %a4 4dde0: 6704 beqs 4dde6 <_RBTree_Extract_unprotected+0xae> leaf->color = RBT_BLACK; /* case 2 */ 4dde2: 42ac 000c clrl %a4@(12) /* Wipe the_node */ _RBTree_Set_off_rbtree(the_node); /* set root to black, if it exists */ if (the_rbtree->root) the_rbtree->root->color = RBT_BLACK; 4dde6: 206d 0004 moveal %a5@(4),%a0 */ RTEMS_INLINE_ROUTINE void _RBTree_Set_off_rbtree( RBTree_Node *node ) { node->parent = node->child[RBT_LEFT] = node->child[RBT_RIGHT] = NULL; 4ddea: 42ab 0008 clrl %a3@(8) 4ddee: 42ab 0004 clrl %a3@(4) 4ddf2: 4293 clrl %a3@ 4ddf4: 4a88 tstl %a0 4ddf6: 6704 beqs 4ddfc <_RBTree_Extract_unprotected+0xc4> 4ddf8: 42a8 000c clrl %a0@(12) } 4ddfc: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 4de02: 4e5e unlk %fp 4de04: 4e75 rts the_rbtree->first[RBT_LEFT] = NULL; } } /* check if max needs to be updated: note, min can equal max (1 element) */ if (the_node == the_rbtree->first[RBT_RIGHT]) { if (the_node->child[RBT_LEFT]) 4de06: 202b 0004 movel %a3@(4),%d0 4de0a: 6700 0098 beqw 4dea4 <_RBTree_Extract_unprotected+0x16c> * either max in node->child[RBT_LEFT] or min in node->child[RBT_RIGHT], * and replace the_node with the target node. This maintains the binary * search tree property, but may violate the red-black properties. */ if (the_node->child[RBT_LEFT] && the_node->child[RBT_RIGHT]) { 4de0e: 246b 0004 moveal %a3@(4),%a2 } } /* check if max needs to be updated: note, min can equal max (1 element) */ if (the_node == the_rbtree->first[RBT_RIGHT]) { if (the_node->child[RBT_LEFT]) the_rbtree->first[RBT_RIGHT] = the_node->child[RBT_LEFT]; 4de12: 2b40 000c movel %d0,%a5@(12) * either max in node->child[RBT_LEFT] or min in node->child[RBT_RIGHT], * and replace the_node with the target node. This maintains the binary * search tree property, but may violate the red-black properties. */ if (the_node->child[RBT_LEFT] && the_node->child[RBT_RIGHT]) { 4de16: 4a8a tstl %a2 4de18: 6600 ff4e bnew 4dd68 <_RBTree_Extract_unprotected+0x30> * the_node's location in the tree. This may cause the coloring to be * violated. We will fix it later. * For now we store the color of the node being deleted in victim_color. */ leaf = the_node->child[RBT_LEFT] ? the_node->child[RBT_LEFT] : the_node->child[RBT_RIGHT]; 4de1c: 286b 0008 moveal %a3@(8),%a4 if( leaf ) { 4de20: 4a8c tstl %a4 4de22: 663c bnes 4de60 <_RBTree_Extract_unprotected+0x128> leaf->parent = the_node->parent; } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(the_node); 4de24: 2f0b movel %a3,%sp@- } victim_color = the_node->color; /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; the_node->parent->child[dir] = leaf; 4de26: 7401 moveq #1,%d2 the_node->child[RBT_LEFT] : the_node->child[RBT_RIGHT]; if( leaf ) { leaf->parent = the_node->parent; } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(the_node); 4de28: 4eb9 0004 db3c jsr 4db3c <_RBTree_Extract_validate_unprotected> } victim_color = the_node->color; /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; 4de2e: 2053 moveal %a3@,%a0 4de30: b7e8 0004 cmpal %a0@(4),%a3 4de34: 56c1 sne %d1 leaf->parent = the_node->parent; } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(the_node); } victim_color = the_node->color; 4de36: 202b 000c movel %a3@(12),%d0 /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; 4de3a: 49c1 extbl %d1 the_node->parent->child[dir] = leaf; 4de3c: 9481 subl %d1,%d2 the_node->child[RBT_LEFT] : the_node->child[RBT_RIGHT]; if( leaf ) { leaf->parent = the_node->parent; } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(the_node); 4de3e: 588f addql #4,%sp } victim_color = the_node->color; /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; the_node->parent->child[dir] = leaf; 4de40: 218c 2c00 movel %a4,%a0@(00000000,%d2:l:4) /* fix coloring. leaf has moved up the tree. The color of the deleted * node is in victim_color. There are two cases: * 1. Deleted a red node, its child must be black. Nothing must be done. * 2. Deleted a black node, its child must be red. Paint child black. */ if (victim_color == RBT_BLACK) { /* eliminate case 1 */ 4de44: 4a80 tstl %d0 4de46: 669e bnes 4dde6 <_RBTree_Extract_unprotected+0xae> 4de48: 6094 bras 4ddde <_RBTree_Extract_unprotected+0xa6> if (!the_node) return; /* check if min needs to be updated */ if (the_node == the_rbtree->first[RBT_LEFT]) { if (the_node->child[RBT_RIGHT]) 4de4a: 202b 0008 movel %a3@(8),%d0 4de4e: 6738 beqs 4de88 <_RBTree_Extract_unprotected+0x150> the_rbtree->first[RBT_LEFT] = the_node->child[RBT_RIGHT]; 4de50: 2b40 0008 movel %d0,%a5@(8) the_rbtree->first[RBT_LEFT])) the_rbtree->first[RBT_LEFT] = NULL; } } /* check if max needs to be updated: note, min can equal max (1 element) */ if (the_node == the_rbtree->first[RBT_RIGHT]) { 4de54: b7ed 000c cmpal %a5@(12),%a3 4de58: 6600 ff04 bnew 4dd5e <_RBTree_Extract_unprotected+0x26> 4de5c: 60a8 bras 4de06 <_RBTree_Extract_unprotected+0xce><== NOT EXECUTED * either max in node->child[RBT_LEFT] or min in node->child[RBT_RIGHT], * and replace the_node with the target node. This maintains the binary * search tree property, but may violate the red-black properties. */ if (the_node->child[RBT_LEFT] && the_node->child[RBT_RIGHT]) { 4de5e: 284a moveal %a2,%a4 * For now we store the color of the node being deleted in victim_color. */ leaf = the_node->child[RBT_LEFT] ? the_node->child[RBT_LEFT] : the_node->child[RBT_RIGHT]; if( leaf ) { leaf->parent = the_node->parent; 4de60: 2893 movel %a3@,%a4@ } victim_color = the_node->color; /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; the_node->parent->child[dir] = leaf; 4de62: 7401 moveq #1,%d2 _RBTree_Extract_validate_unprotected(the_node); } victim_color = the_node->color; /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; 4de64: 2053 moveal %a3@,%a0 4de66: b7e8 0004 cmpal %a0@(4),%a3 4de6a: 56c1 sne %d1 leaf->parent = the_node->parent; } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(the_node); } victim_color = the_node->color; 4de6c: 202b 000c movel %a3@(12),%d0 /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; 4de70: 49c1 extbl %d1 the_node->parent->child[dir] = leaf; 4de72: 9481 subl %d1,%d2 4de74: 218c 2c00 movel %a4,%a0@(00000000,%d2:l:4) 4de78: 60ca bras 4de44 <_RBTree_Extract_unprotected+0x10c> leaf = target->child[RBT_LEFT]; if(leaf) { leaf->parent = target->parent; } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(target); 4de7a: 2f0a movel %a2,%sp@- 4de7c: 4eb9 0004 db3c jsr 4db3c <_RBTree_Extract_validate_unprotected> 4de82: 588f addql #4,%sp 4de84: 6000 ff04 braw 4dd8a <_RBTree_Extract_unprotected+0x52> /* check if min needs to be updated */ if (the_node == the_rbtree->first[RBT_LEFT]) { if (the_node->child[RBT_RIGHT]) the_rbtree->first[RBT_LEFT] = the_node->child[RBT_RIGHT]; else { the_rbtree->first[RBT_LEFT] = the_node->parent; 4de88: 2013 movel %a3@,%d0 4de8a: 2b40 0008 movel %d0,%a5@(8) if(_RBTree_Are_nodes_equal((RBTree_Node *)the_rbtree, 4de8e: b08d cmpl %a5,%d0 4de90: 6600 fec4 bnew 4dd56 <_RBTree_Extract_unprotected+0x1e> the_rbtree->first[RBT_LEFT])) the_rbtree->first[RBT_LEFT] = NULL; 4de94: 42ad 0008 clrl %a5@(8) } } /* check if max needs to be updated: note, min can equal max (1 element) */ if (the_node == the_rbtree->first[RBT_RIGHT]) { 4de98: b7ed 000c cmpal %a5@(12),%a3 4de9c: 6600 fec0 bnew 4dd5e <_RBTree_Extract_unprotected+0x26> 4dea0: 6000 ff64 braw 4de06 <_RBTree_Extract_unprotected+0xce> if (the_node->child[RBT_LEFT]) the_rbtree->first[RBT_RIGHT] = the_node->child[RBT_LEFT]; else { the_rbtree->first[RBT_RIGHT] = the_node->parent; 4dea4: 2013 movel %a3@,%d0 4dea6: 2b40 000c movel %d0,%a5@(12) if(_RBTree_Are_nodes_equal((RBTree_Node *)the_rbtree, 4deaa: b08d cmpl %a5,%d0 4deac: 6600 feb0 bnew 4dd5e <_RBTree_Extract_unprotected+0x26> the_rbtree->first[RBT_RIGHT])) the_rbtree->first[RBT_RIGHT] = NULL; 4deb0: 42ad 000c clrl %a5@(12) 4deb4: 6000 fea8 braw 4dd5e <_RBTree_Extract_unprotected+0x26> =============================================================================== 0004db3c <_RBTree_Extract_validate_unprotected>: * of the extract operation. */ void _RBTree_Extract_validate_unprotected( RBTree_Node *the_node ) { 4db3c: 4e56 ffec linkw %fp,#-20 4db40: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@ 4db44: 266e 0008 moveal %fp@(8),%a3 RBTree_Node *parent, *sibling; RBTree_Direction dir; parent = the_node->parent; 4db48: 2053 moveal %a3@,%a0 if(!parent->parent) return; 4db4a: 4a90 tstl %a0@ 4db4c: 677e beqs 4dbcc <_RBTree_Extract_validate_unprotected+0x90><== NEVER TAKEN { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; if(!(the_node->parent->parent)) return NULL; if(the_node == the_node->parent->child[RBT_LEFT]) 4db4e: 2268 0004 moveal %a0@(4),%a1 4db52: b3cb cmpal %a3,%a1 4db54: 6700 01da beqw 4dd30 <_RBTree_Extract_validate_unprotected+0x1f4> */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 4db58: 7401 moveq #1,%d2 4db5a: b4ab 000c cmpl %a3@(12),%d2 4db5e: 6764 beqs 4dbc4 <_RBTree_Extract_validate_unprotected+0x88> sibling = _RBTree_Sibling(the_node); /* continue to correct tree as long as the_node is black and not the root */ while (!_RBTree_Is_red(the_node) && parent->parent) { 4db60: 4a90 tstl %a0@ 4db62: 6760 beqs 4dbc4 <_RBTree_Extract_validate_unprotected+0x88> 4db64: 4a89 tstl %a1 4db66: 6708 beqs 4db70 <_RBTree_Extract_validate_unprotected+0x34><== NEVER TAKEN 4db68: 7001 moveq #1,%d0 4db6a: b0a9 000c cmpl %a1@(12),%d0 4db6e: 6764 beqs 4dbd4 <_RBTree_Extract_validate_unprotected+0x98> _RBTree_Rotate(parent, dir); sibling = parent->child[!dir]; } /* sibling is black, see if both of its children are also black. */ if (!_RBTree_Is_red(sibling->child[RBT_RIGHT]) && 4db70: 2469 0008 moveal %a1@(8),%a2 4db74: 4a8a tstl %a2 4db76: 670a beqs 4db82 <_RBTree_Extract_validate_unprotected+0x46> 4db78: 7001 moveq #1,%d0 4db7a: b0aa 000c cmpl %a2@(12),%d0 4db7e: 6700 00dc beqw 4dc5c <_RBTree_Extract_validate_unprotected+0x120> !_RBTree_Is_red(sibling->child[RBT_LEFT])) { 4db82: 2469 0004 moveal %a1@(4),%a2 4db86: 4a8a tstl %a2 4db88: 670a beqs 4db94 <_RBTree_Extract_validate_unprotected+0x58> 4db8a: 7201 moveq #1,%d1 4db8c: b2aa 000c cmpl %a2@(12),%d1 4db90: 6700 00ca beqw 4dc5c <_RBTree_Extract_validate_unprotected+0x120> sibling->color = RBT_RED; 4db94: 7601 moveq #1,%d3 4db96: 2343 000c movel %d3,%a1@(12) 4db9a: b6a8 000c cmpl %a0@(12),%d3 4db9e: 6700 00ac beqw 4dc4c <_RBTree_Extract_validate_unprotected+0x110> if (_RBTree_Is_red(parent)) { parent->color = RBT_BLACK; break; } the_node = parent; /* done if parent is red */ parent = the_node->parent; 4dba2: 2450 moveal %a0@,%a2 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( RBTree_Node *the_node ) { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; 4dba4: 4a8a tstl %a2 4dba6: 6700 009a beqw 4dc42 <_RBTree_Extract_validate_unprotected+0x106> if(!(the_node->parent->parent)) return NULL; 4dbaa: 4a92 tstl %a2@ 4dbac: 6700 0094 beqw 4dc42 <_RBTree_Extract_validate_unprotected+0x106> if(the_node == the_node->parent->child[RBT_LEFT]) 4dbb0: 226a 0004 moveal %a2@(4),%a1 4dbb4: b3c8 cmpal %a0,%a1 4dbb6: 677e beqs 4dc36 <_RBTree_Extract_validate_unprotected+0xfa> c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; c->parent = the_node->parent; the_node->parent = c; 4dbb8: 2648 moveal %a0,%a3 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( RBTree_Node *the_node ) { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; 4dbba: 204a moveal %a2,%a0 */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 4dbbc: 7401 moveq #1,%d2 4dbbe: b4ab 000c cmpl %a3@(12),%d2 4dbc2: 669c bnes 4db60 <_RBTree_Extract_validate_unprotected+0x24><== ALWAYS TAKEN sibling->child[!dir]->color = RBT_BLACK; _RBTree_Rotate(parent, dir); break; /* done */ } } /* while */ if(!the_node->parent->parent) the_node->color = RBT_BLACK; 4dbc4: 2053 moveal %a3@,%a0 4dbc6: 4a90 tstl %a0@ 4dbc8: 6700 015a beqw 4dd24 <_RBTree_Extract_validate_unprotected+0x1e8> } 4dbcc: 4cd7 1c0c moveml %sp@,%d2-%d3/%a2-%a4 4dbd0: 4e5e unlk %fp 4dbd2: 4e75 rts * update sibling pointer. */ if (_RBTree_Is_red(sibling)) { parent->color = RBT_RED; sibling->color = RBT_BLACK; dir = the_node != parent->child[0]; 4dbd4: b7e8 0004 cmpal %a0@(4),%a3 4dbd8: 56c0 sne %d0 * then rotate parent left, making the sibling be the_node's grandparent. * Now the_node has a black sibling and red parent. After rotation, * update sibling pointer. */ if (_RBTree_Is_red(sibling)) { parent->color = RBT_RED; 4dbda: 7201 moveq #1,%d1 RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[(1-dir)] == NULL) return; 4dbdc: 7402 moveq #2,%d2 sibling->color = RBT_BLACK; dir = the_node != parent->child[0]; 4dbde: 49c0 extbl %d0 4dbe0: 4480 negl %d0 4dbe2: 9480 subl %d0,%d2 * then rotate parent left, making the sibling be the_node's grandparent. * Now the_node has a black sibling and red parent. After rotation, * update sibling pointer. */ if (_RBTree_Is_red(sibling)) { parent->color = RBT_RED; 4dbe4: 2141 000c movel %d1,%a0@(12) 4dbe8: 2470 2c00 moveal %a0@(00000000,%d2:l:4),%a2 sibling->color = RBT_BLACK; 4dbec: 42a9 000c clrl %a1@(12) 4dbf0: 4a8a tstl %a2 4dbf2: 6730 beqs 4dc24 <_RBTree_Extract_validate_unprotected+0xe8><== NEVER TAKEN c = the_node->child[(1-dir)]; the_node->child[(1-dir)] = c->child[dir]; 4dbf4: 2200 movel %d0,%d1 4dbf6: 5281 addql #1,%d1 4dbf8: 43f2 1c00 lea %a2@(00000000,%d1:l:4),%a1 4dbfc: 2191 2c00 movel %a1@,%a0@(00000000,%d2:l:4) if (c->child[dir]) 4dc00: 2272 1c00 moveal %a2@(00000000,%d1:l:4),%a1 4dc04: 4a89 tstl %a1 4dc06: 6702 beqs 4dc0a <_RBTree_Extract_validate_unprotected+0xce><== NEVER TAKEN c->child[dir]->parent = the_node; 4dc08: 2288 movel %a0,%a1@ c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 4dc0a: 2250 moveal %a0@,%a1 4dc0c: 7401 moveq #1,%d2 the_node->child[(1-dir)] = c->child[dir]; if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; 4dc0e: 2588 1c00 movel %a0,%a2@(00000000,%d1:l:4) the_node->parent->child[the_node != the_node->parent->child[0]] = c; 4dc12: b1e9 0004 cmpal %a1@(4),%a0 4dc16: 56c1 sne %d1 c->parent = the_node->parent; 4dc18: 2489 movel %a1,%a2@ if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 4dc1a: 49c1 extbl %d1 4dc1c: 9481 subl %d1,%d2 4dc1e: 238a 2c00 movel %a2,%a1@(00000000,%d2:l:4) c->parent = the_node->parent; the_node->parent = c; 4dc22: 208a movel %a2,%a0@ dir = the_node != parent->child[0]; _RBTree_Rotate(parent, dir); sibling = parent->child[!dir]; 4dc24: 4a80 tstl %d0 4dc26: 57c0 seq %d0 4dc28: 7601 moveq #1,%d3 4dc2a: 49c0 extbl %d0 4dc2c: 9680 subl %d0,%d3 4dc2e: 2270 3c00 moveal %a0@(00000000,%d3:l:4),%a1 4dc32: 6000 ff3c braw 4db70 <_RBTree_Extract_validate_unprotected+0x34> 4dc36: 2648 moveal %a0,%a3 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( RBTree_Node *the_node ) { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; 4dc38: 204a moveal %a2,%a0 if(!(the_node->parent->parent)) return NULL; if(the_node == the_node->parent->child[RBT_LEFT]) return the_node->parent->child[RBT_RIGHT]; 4dc3a: 226a 0008 moveal %a2@(8),%a1 4dc3e: 6000 ff7c braw 4dbbc <_RBTree_Extract_validate_unprotected+0x80> c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; c->parent = the_node->parent; the_node->parent = c; 4dc42: 2648 moveal %a0,%a3 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( RBTree_Node *the_node ) { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; 4dc44: 93c9 subal %a1,%a1 4dc46: 204a moveal %a2,%a0 4dc48: 6000 ff72 braw 4dbbc <_RBTree_Extract_validate_unprotected+0x80> /* sibling is black, see if both of its children are also black. */ if (!_RBTree_Is_red(sibling->child[RBT_RIGHT]) && !_RBTree_Is_red(sibling->child[RBT_LEFT])) { sibling->color = RBT_RED; if (_RBTree_Is_red(parent)) { parent->color = RBT_BLACK; 4dc4c: 42a8 000c clrl %a0@(12) sibling->child[!dir]->color = RBT_BLACK; _RBTree_Rotate(parent, dir); break; /* done */ } } /* while */ if(!the_node->parent->parent) the_node->color = RBT_BLACK; 4dc50: 2053 moveal %a3@,%a0 4dc52: 4a90 tstl %a0@ 4dc54: 6600 ff76 bnew 4dbcc <_RBTree_Extract_validate_unprotected+0x90> 4dc58: 6000 00ca braw 4dd24 <_RBTree_Extract_validate_unprotected+0x1e8><== NOT EXECUTED * cases, either the_node is to the left or the right of the parent. * In both cases, first check if one of sibling's children is black, * and if so rotate in the proper direction and update sibling pointer. * Then switch the sibling and parent colors, and rotate through parent. */ dir = the_node != parent->child[0]; 4dc5c: b7e8 0004 cmpal %a0@(4),%a3 4dc60: 56c0 sne %d0 if (!_RBTree_Is_red(sibling->child[!dir])) { 4dc62: 7401 moveq #1,%d2 * cases, either the_node is to the left or the right of the parent. * In both cases, first check if one of sibling's children is black, * and if so rotate in the proper direction and update sibling pointer. * Then switch the sibling and parent colors, and rotate through parent. */ dir = the_node != parent->child[0]; 4dc64: 49c0 extbl %d0 4dc66: 4480 negl %d0 if (!_RBTree_Is_red(sibling->child[!dir])) { 4dc68: 57c1 seq %d1 4dc6a: 49c1 extbl %d1 4dc6c: 9481 subl %d1,%d2 4dc6e: 2202 movel %d2,%d1 4dc70: 2471 2c00 moveal %a1@(00000000,%d2:l:4),%a2 */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 4dc74: 4a8a tstl %a2 4dc76: 6708 beqs 4dc80 <_RBTree_Extract_validate_unprotected+0x144> 4dc78: 7601 moveq #1,%d3 4dc7a: b6aa 000c cmpl %a2@(12),%d3 4dc7e: 6756 beqs 4dcd6 <_RBTree_Extract_validate_unprotected+0x19a> sibling->color = RBT_RED; sibling->child[dir]->color = RBT_BLACK; _RBTree_Rotate(sibling, !dir); 4dc80: 7601 moveq #1,%d3 * and if so rotate in the proper direction and update sibling pointer. * Then switch the sibling and parent colors, and rotate through parent. */ dir = the_node != parent->child[0]; if (!_RBTree_Is_red(sibling->child[!dir])) { sibling->color = RBT_RED; 4dc82: 7401 moveq #1,%d2 sibling->child[dir]->color = RBT_BLACK; _RBTree_Rotate(sibling, !dir); 4dc84: b183 eorl %d0,%d3 * and if so rotate in the proper direction and update sibling pointer. * Then switch the sibling and parent colors, and rotate through parent. */ dir = the_node != parent->child[0]; if (!_RBTree_Is_red(sibling->child[!dir])) { sibling->color = RBT_RED; 4dc86: 2342 000c movel %d2,%a1@(12) RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[(1-dir)] == NULL) return; 4dc8a: 143c 0002 moveb #2,%d2 4dc8e: 9483 subl %d3,%d2 sibling->child[dir]->color = RBT_BLACK; 4dc90: 2871 0c04 moveal %a1@(00000004,%d0:l:4),%a4 4dc94: 2471 2c00 moveal %a1@(00000000,%d2:l:4),%a2 4dc98: 42ac 000c clrl %a4@(12) 4dc9c: 4a8a tstl %a2 4dc9e: 672e beqs 4dcce <_RBTree_Extract_validate_unprotected+0x192><== NEVER TAKEN c = the_node->child[(1-dir)]; the_node->child[(1-dir)] = c->child[dir]; 4dca0: 5283 addql #1,%d3 4dca2: 49f2 3c00 lea %a2@(00000000,%d3:l:4),%a4 4dca6: 2394 2c00 movel %a4@,%a1@(00000000,%d2:l:4) if (c->child[dir]) 4dcaa: 2872 3c00 moveal %a2@(00000000,%d3:l:4),%a4 4dcae: 4a8c tstl %a4 4dcb0: 6702 beqs 4dcb4 <_RBTree_Extract_validate_unprotected+0x178> c->child[dir]->parent = the_node; 4dcb2: 2889 movel %a1,%a4@ c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 4dcb4: 2851 moveal %a1@,%a4 the_node->child[(1-dir)] = c->child[dir]; if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; 4dcb6: 2589 3c00 movel %a1,%a2@(00000000,%d3:l:4) the_node->parent->child[the_node != the_node->parent->child[0]] = c; 4dcba: 7601 moveq #1,%d3 4dcbc: b3ec 0004 cmpal %a4@(4),%a1 4dcc0: 56c2 sne %d2 c->parent = the_node->parent; 4dcc2: 248c movel %a4,%a2@ if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 4dcc4: 49c2 extbl %d2 4dcc6: 9682 subl %d2,%d3 4dcc8: 298a 3c00 movel %a2,%a4@(00000000,%d3:l:4) c->parent = the_node->parent; the_node->parent = c; 4dccc: 228a movel %a2,%a1@ _RBTree_Rotate(sibling, !dir); sibling = parent->child[!dir]; 4dcce: 2270 1c00 moveal %a0@(00000000,%d1:l:4),%a1 4dcd2: 2471 1c00 moveal %a1@(00000000,%d1:l:4),%a2 RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[(1-dir)] == NULL) return; 4dcd6: 7202 moveq #2,%d1 4dcd8: 9280 subl %d0,%d1 } sibling->color = parent->color; 4dcda: 2368 000c 000c movel %a0@(12),%a1@(12) 4dce0: 2270 1c00 moveal %a0@(00000000,%d1:l:4),%a1 parent->color = RBT_BLACK; 4dce4: 42a8 000c clrl %a0@(12) sibling->child[!dir]->color = RBT_BLACK; 4dce8: 42aa 000c clrl %a2@(12) 4dcec: 4a89 tstl %a1 4dcee: 6700 fed4 beqw 4dbc4 <_RBTree_Extract_validate_unprotected+0x88> c = the_node->child[(1-dir)]; the_node->child[(1-dir)] = c->child[dir]; 4dcf2: 5280 addql #1,%d0 4dcf4: 45f1 0c00 lea %a1@(00000000,%d0:l:4),%a2 4dcf8: 2192 1c00 movel %a2@,%a0@(00000000,%d1:l:4) if (c->child[dir]) 4dcfc: 2471 0c00 moveal %a1@(00000000,%d0:l:4),%a2 4dd00: 4a8a tstl %a2 4dd02: 6702 beqs 4dd06 <_RBTree_Extract_validate_unprotected+0x1ca> c->child[dir]->parent = the_node; 4dd04: 2488 movel %a0,%a2@ c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 4dd06: 2450 moveal %a0@,%a2 4dd08: 7201 moveq #1,%d1 the_node->child[(1-dir)] = c->child[dir]; if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; 4dd0a: 2388 0c00 movel %a0,%a1@(00000000,%d0:l:4) the_node->parent->child[the_node != the_node->parent->child[0]] = c; 4dd0e: b1ea 0004 cmpal %a2@(4),%a0 4dd12: 56c0 sne %d0 c->parent = the_node->parent; 4dd14: 228a movel %a2,%a1@ if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 4dd16: 49c0 extbl %d0 4dd18: 9280 subl %d0,%d1 4dd1a: 2589 1c00 movel %a1,%a2@(00000000,%d1:l:4) c->parent = the_node->parent; the_node->parent = c; 4dd1e: 2089 movel %a1,%a0@ 4dd20: 6000 fea2 braw 4dbc4 <_RBTree_Extract_validate_unprotected+0x88> _RBTree_Rotate(parent, dir); break; /* done */ } } /* while */ if(!the_node->parent->parent) the_node->color = RBT_BLACK; 4dd24: 42ab 000c clrl %a3@(12) } 4dd28: 4cd7 1c0c moveml %sp@,%d2-%d3/%a2-%a4 4dd2c: 4e5e unlk %fp 4dd2e: 4e75 rts if(!the_node) return NULL; if(!(the_node->parent)) return NULL; if(!(the_node->parent->parent)) return NULL; if(the_node == the_node->parent->child[RBT_LEFT]) return the_node->parent->child[RBT_RIGHT]; 4dd30: 2268 0008 moveal %a0@(8),%a1 4dd34: 6000 fe22 braw 4db58 <_RBTree_Extract_validate_unprotected+0x1c> =============================================================================== 00049bc8 <_RBTree_Find>: { ISR_Level level; RBTree_Node *return_node; return_node = NULL; _ISR_Disable( level ); 49bc8: 203c 0000 0700 movel #1792,%d0 RBTree_Node *_RBTree_Find( RBTree_Control *the_rbtree, RBTree_Node *search_node ) { 49bce: 4e56 ffec linkw %fp,#-20 49bd2: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 49bd6: 266e 0008 moveal %fp@(8),%a3 49bda: 242e 000c movel %fp@(12),%d2 ISR_Level level; RBTree_Node *return_node; return_node = NULL; _ISR_Disable( level ); 49bde: 40c4 movew %sr,%d4 49be0: 8084 orl %d4,%d0 49be2: 46c0 movew %d0,%sr RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Find_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { RBTree_Node* iter_node = the_rbtree->root; 49be4: 246b 0004 moveal %a3@(4),%a2 RBTree_Node* found = NULL; int compare_result; while (iter_node) { 49be8: 4283 clrl %d3 49bea: 4a8a tstl %a2 49bec: 672a beqs 49c18 <_RBTree_Find+0x50> <== NEVER TAKEN compare_result = the_rbtree->compare_function(the_node, iter_node); 49bee: 2f0a movel %a2,%sp@- 49bf0: 206b 0010 moveal %a3@(16),%a0 49bf4: 2f02 movel %d2,%sp@- 49bf6: 4e90 jsr %a0@ if (compare_result == 0) { 49bf8: 508f addql #8,%sp 49bfa: 4a80 tstl %d0 49bfc: 6608 bnes 49c06 <_RBTree_Find+0x3e> <== NEVER TAKEN found = iter_node; if ( the_rbtree->is_unique ) 49bfe: 260a movel %a2,%d3 49c00: 4a2b 0014 tstb %a3@(20) 49c04: 6612 bnes 49c18 <_RBTree_Find+0x50> break; } RBTree_Direction dir = (compare_result == 1); 49c06: 7201 moveq #1,%d1 49c08: b280 cmpl %d0,%d1 49c0a: 57c0 seq %d0 49c0c: 49c0 extbl %d0 iter_node = iter_node->child[dir]; 49c0e: 9280 subl %d0,%d1 49c10: 2472 1c00 moveal %a2@(00000000,%d1:l:4),%a2 ) { RBTree_Node* iter_node = the_rbtree->root; RBTree_Node* found = NULL; int compare_result; while (iter_node) { 49c14: 4a8a tstl %a2 49c16: 66d6 bnes 49bee <_RBTree_Find+0x26> <== NEVER TAKEN return_node = _RBTree_Find_unprotected( the_rbtree, search_node ); _ISR_Enable( level ); 49c18: 46c4 movew %d4,%sr return return_node; } 49c1a: 2003 movel %d3,%d0 49c1c: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 49c22: 4e5e unlk %fp ... =============================================================================== 00049b88 <_RBTree_Find_header>: { ISR_Level level; RBTree_Control *return_header; return_header = NULL; _ISR_Disable( level ); 49b88: 203c 0000 0700 movel #1792,%d0 */ RBTree_Control *_RBTree_Find_header( RBTree_Node *the_node ) { 49b8e: 4e56 0000 linkw %fp,#0 49b92: 206e 0008 moveal %fp@(8),%a0 49b96: 2f02 movel %d2,%sp@- ISR_Level level; RBTree_Control *return_header; return_header = NULL; _ISR_Disable( level ); 49b98: 40c2 movew %sr,%d2 49b9a: 8082 orl %d2,%d0 49b9c: 46c0 movew %d0,%sr */ RTEMS_INLINE_ROUTINE RBTree_Control *_RBTree_Find_header_unprotected( RBTree_Node *the_node ) { if(!the_node) return NULL; 49b9e: 4a88 tstl %a0 49ba0: 671a beqs 49bbc <_RBTree_Find_header+0x34> if(!(the_node->parent)) return NULL; 49ba2: 2050 moveal %a0@,%a0 49ba4: 4a88 tstl %a0 49ba6: 670a beqs 49bb2 <_RBTree_Find_header+0x2a> 49ba8: 2210 movel %a0@,%d1 while(the_node->parent) the_node = the_node->parent; 49baa: 6706 beqs 49bb2 <_RBTree_Find_header+0x2a> <== NEVER TAKEN 49bac: 2041 moveal %d1,%a0 RTEMS_INLINE_ROUTINE RBTree_Control *_RBTree_Find_header_unprotected( RBTree_Node *the_node ) { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; 49bae: 2210 movel %a0@,%d1 while(the_node->parent) the_node = the_node->parent; 49bb0: 66fa bnes 49bac <_RBTree_Find_header+0x24> return_header = _RBTree_Find_header_unprotected( the_node ); _ISR_Enable( level ); 49bb2: 46c2 movew %d2,%sr return return_header; } 49bb4: 241f movel %sp@+,%d2 49bb6: 2008 movel %a0,%d0 49bb8: 4e5e unlk %fp 49bba: 4e75 rts */ RTEMS_INLINE_ROUTINE RBTree_Control *_RBTree_Find_header_unprotected( RBTree_Node *the_node ) { if(!the_node) return NULL; 49bbc: 91c8 subal %a0,%a0 RBTree_Control *return_header; return_header = NULL; _ISR_Disable( level ); return_header = _RBTree_Find_header_unprotected( the_node ); _ISR_Enable( level ); 49bbe: 46c2 movew %d2,%sr return return_header; } 49bc0: 241f movel %sp@+,%d2 49bc2: 2008 movel %a0,%d0 49bc4: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00049e90 <_RBTree_Initialize>: void *starting_address, size_t number_nodes, size_t node_size, bool is_unique ) { 49e90: 4e56 ffec linkw %fp,#-20 49e94: 202e 001c movel %fp@(28),%d0 49e98: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 49e9c: 246e 0008 moveal %fp@(8),%a2 49ea0: 242e 0014 movel %fp@(20),%d2 49ea4: 282e 0018 movel %fp@(24),%d4 size_t count; RBTree_Node *next; /* TODO: Error message? */ if (!the_rbtree) return; 49ea8: 4a8a tstl %a2 49eaa: 6736 beqs 49ee2 <_RBTree_Initialize+0x52> <== NEVER TAKEN RBTree_Control *the_rbtree, RBTree_Compare_function compare_function, bool is_unique ) { the_rbtree->permanent_null = NULL; 49eac: 4292 clrl %a2@ the_rbtree->root = NULL; the_rbtree->first[0] = NULL; the_rbtree->first[1] = NULL; the_rbtree->compare_function = compare_function; 49eae: 256e 000c 0010 movel %fp@(12),%a2@(16) the_rbtree->is_unique = is_unique; 49eb4: 1540 0014 moveb %d0,%a2@(20) RBTree_Compare_function compare_function, bool is_unique ) { the_rbtree->permanent_null = NULL; the_rbtree->root = NULL; 49eb8: 42aa 0004 clrl %a2@(4) the_rbtree->first[0] = NULL; 49ebc: 42aa 0008 clrl %a2@(8) the_rbtree->first[1] = NULL; 49ec0: 42aa 000c clrl %a2@(12) /* could do sanity checks here */ _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique); count = number_nodes; next = starting_address; while ( count-- ) { 49ec4: 4a82 tstl %d2 49ec6: 671a beqs 49ee2 <_RBTree_Initialize+0x52> <== NEVER TAKEN /* could do sanity checks here */ _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique); count = number_nodes; next = starting_address; 49ec8: 262e 0010 movel %fp@(16),%d3 49ecc: 47f9 0004 9e62 lea 49e62 <_RBTree_Insert>,%a3 while ( count-- ) { _RBTree_Insert(the_rbtree, next); 49ed2: 2f03 movel %d3,%sp@- * node_size - size of node in bytes * * Output parameters: NONE */ void _RBTree_Initialize( 49ed4: d684 addl %d4,%d3 49ed6: 5382 subql #1,%d2 _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique); count = number_nodes; next = starting_address; while ( count-- ) { _RBTree_Insert(the_rbtree, next); 49ed8: 2f0a movel %a2,%sp@- 49eda: 4e93 jsr %a3@ /* could do sanity checks here */ _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique); count = number_nodes; next = starting_address; while ( count-- ) { 49edc: 508f addql #8,%sp 49ede: 4a82 tstl %d2 49ee0: 66f0 bnes 49ed2 <_RBTree_Initialize+0x42> _RBTree_Insert(the_rbtree, next); next = (RBTree_Node *) _Addresses_Add_offset( (void *) next, node_size ); } } 49ee2: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 49ee8: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004e0e2 <_RBTree_Insert>: RBTree_Node *node ) { ISR_Level level; _ISR_Disable( level ); 4e0e2: 203c 0000 0700 movel #1792,%d0 RBTree_Node *_RBTree_Insert( RBTree_Control *tree, RBTree_Node *node ) { 4e0e8: 4e56 0000 linkw %fp,#0 4e0ec: 222e 0008 movel %fp@(8),%d1 4e0f0: 206e 000c moveal %fp@(12),%a0 4e0f4: 2f02 movel %d2,%sp@- ISR_Level level; _ISR_Disable( level ); 4e0f6: 40c2 movew %sr,%d2 4e0f8: 8082 orl %d2,%d0 4e0fa: 46c0 movew %d0,%sr return _RBTree_Insert_unprotected( tree, node ); _ISR_Enable( level ); } 4e0fc: 241f movel %sp@+,%d2 ) { ISR_Level level; _ISR_Disable( level ); return _RBTree_Insert_unprotected( tree, node ); 4e0fe: 2d48 000c movel %a0,%fp@(12) 4e102: 2d41 0008 movel %d1,%fp@(8) _ISR_Enable( level ); } 4e106: 4e5e unlk %fp ) { ISR_Level level; _ISR_Disable( level ); return _RBTree_Insert_unprotected( tree, node ); 4e108: 4ef9 0004 e00e jmp 4e00e <_RBTree_Insert_unprotected> ... =============================================================================== 0004dee4 <_RBTree_Validate_insert_unprotected>: * append operation. */ void _RBTree_Validate_insert_unprotected( RBTree_Node *the_node ) { 4dee4: 4e56 ffe8 linkw %fp,#-24 4dee8: 48d7 3c0c moveml %d2-%d3/%a2-%a5,%sp@ 4deec: 266e 0008 moveal %fp@(8),%a3 ISR_Level level; _ISR_Disable( level ); return _RBTree_Insert_unprotected( tree, node ); _ISR_Enable( level ); } 4def0: 2053 moveal %a3@,%a0 */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Parent( RBTree_Node *the_node ) { if (!the_node->parent->parent) return NULL; 4def2: 2250 moveal %a0@,%a1 4def4: 2449 moveal %a1,%a2 4def6: 4a89 tstl %a1 4def8: 6700 00de beqw 4dfd8 <_RBTree_Validate_insert_unprotected+0xf4> */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 4defc: 7601 moveq #1,%d3 4defe: b6a8 000c cmpl %a0@(12),%d3 4df02: 6708 beqs 4df0c <_RBTree_Validate_insert_unprotected+0x28> /* now rotate grandparent in the other branch direction (toward uncle) */ _RBTree_Rotate(g, (1-pdir)); } } if(!the_node->parent->parent) the_node->color = RBT_BLACK; } 4df04: 4cd7 3c0c moveml %sp@,%d2-%d3/%a2-%a5 4df08: 4e5e unlk %fp 4df0a: 4e75 rts ) { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; if(!(the_node->parent->parent)) return NULL; if(!(the_node->parent->parent->parent)) return NULL; 4df0c: 4a91 tstl %a1@ 4df0e: 6700 00ee beqw 4dffe <_RBTree_Validate_insert_unprotected+0x11a> { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; if(!(the_node->parent->parent)) return NULL; if(the_node == the_node->parent->child[RBT_LEFT]) 4df12: 2429 0004 movel %a1@(4),%d2 4df16: b488 cmpl %a0,%d2 4df18: 6700 00ec beqw 4e006 <_RBTree_Validate_insert_unprotected+0x122> 4df1c: 2842 moveal %d2,%a4 */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 4df1e: 4a8c tstl %a4 4df20: 670a beqs 4df2c <_RBTree_Validate_insert_unprotected+0x48> 4df22: 7001 moveq #1,%d0 4df24: b0ac 000c cmpl %a4@(12),%d0 4df28: 6700 00ba beqw 4dfe4 <_RBTree_Validate_insert_unprotected+0x100> the_node->parent->color = RBT_BLACK; u->color = RBT_BLACK; g->color = RBT_RED; the_node = g; } else { /* if uncle is black */ RBTree_Direction dir = the_node != the_node->parent->child[0]; 4df2c: b7e8 0004 cmpal %a0@(4),%a3 4df30: 56c1 sne %d1 RBTree_Direction pdir = the_node->parent != g->child[0]; 4df32: b488 cmpl %a0,%d2 4df34: 56c0 sne %d0 the_node->parent->color = RBT_BLACK; u->color = RBT_BLACK; g->color = RBT_RED; the_node = g; } else { /* if uncle is black */ RBTree_Direction dir = the_node != the_node->parent->child[0]; 4df36: 49c1 extbl %d1 4df38: 4481 negl %d1 RBTree_Direction pdir = the_node->parent != g->child[0]; 4df3a: 49c0 extbl %d0 4df3c: 4480 negl %d0 RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[(1-dir)] == NULL) return; 4df3e: 7401 moveq #1,%d2 /* ensure node is on the same branch direction as parent */ if (dir != pdir) { 4df40: b081 cmpl %d1,%d0 4df42: 6700 00b2 beqw 4dff6 <_RBTree_Validate_insert_unprotected+0x112> 4df46: 9480 subl %d0,%d2 4df48: 2202 movel %d2,%d1 4df4a: 5281 addql #1,%d1 4df4c: 5280 addql #1,%d0 4df4e: 2870 1c00 moveal %a0@(00000000,%d1:l:4),%a4 4df52: 4a8c tstl %a4 4df54: 672c beqs 4df82 <_RBTree_Validate_insert_unprotected+0x9e><== NEVER TAKEN c = the_node->child[(1-dir)]; the_node->child[(1-dir)] = c->child[dir]; 4df56: 4bf4 0c00 lea %a4@(00000000,%d0:l:4),%a5 4df5a: 2195 1c00 movel %a5@,%a0@(00000000,%d1:l:4) if (c->child[dir]) 4df5e: 2a74 0c00 moveal %a4@(00000000,%d0:l:4),%a5 4df62: 4a8d tstl %a5 4df64: 6704 beqs 4df6a <_RBTree_Validate_insert_unprotected+0x86> c->child[dir]->parent = the_node; 4df66: 2a88 movel %a0,%a5@ 4df68: 2250 moveal %a0@,%a1 c->child[dir] = the_node; 4df6a: 2988 0c00 movel %a0,%a4@(00000000,%d0:l:4) the_node->parent->child[the_node != the_node->parent->child[0]] = c; 4df6e: 7601 moveq #1,%d3 4df70: b1e9 0004 cmpal %a1@(4),%a0 4df74: 56c1 sne %d1 c->parent = the_node->parent; 4df76: 2889 movel %a1,%a4@ if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 4df78: 49c1 extbl %d1 4df7a: 9681 subl %d1,%d3 4df7c: 238c 3c00 movel %a4,%a1@(00000000,%d3:l:4) c->parent = the_node->parent; the_node->parent = c; 4df80: 208c movel %a4,%a0@ _RBTree_Rotate(the_node->parent, pdir); the_node = the_node->child[pdir]; 4df82: 2673 0c00 moveal %a3@(00000000,%d0:l:4),%a3 4df86: 2053 moveal %a3@,%a0 } the_node->parent->color = RBT_BLACK; 4df88: 42a8 000c clrl %a0@(12) g->color = RBT_RED; 4df8c: 7201 moveq #1,%d1 RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[(1-dir)] == NULL) return; 4df8e: 2072 0c00 moveal %a2@(00000000,%d0:l:4),%a0 4df92: 2541 000c movel %d1,%a2@(12) 4df96: 4a88 tstl %a0 4df98: 6700 ff56 beqw 4def0 <_RBTree_Validate_insert_unprotected+0xc> c = the_node->child[(1-dir)]; the_node->child[(1-dir)] = c->child[dir]; 4df9c: 2202 movel %d2,%d1 4df9e: 5281 addql #1,%d1 4dfa0: 43f0 1c00 lea %a0@(00000000,%d1:l:4),%a1 4dfa4: 2591 0c00 movel %a1@,%a2@(00000000,%d0:l:4) if (c->child[dir]) 4dfa8: 2270 1c00 moveal %a0@(00000000,%d1:l:4),%a1 4dfac: 4a89 tstl %a1 4dfae: 6702 beqs 4dfb2 <_RBTree_Validate_insert_unprotected+0xce> c->child[dir]->parent = the_node; 4dfb0: 228a movel %a2,%a1@ c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 4dfb2: 2252 moveal %a2@,%a1 the_node->child[(1-dir)] = c->child[dir]; if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; 4dfb4: 218a 1c00 movel %a2,%a0@(00000000,%d1:l:4) the_node->parent->child[the_node != the_node->parent->child[0]] = c; 4dfb8: 7201 moveq #1,%d1 4dfba: b5e9 0004 cmpal %a1@(4),%a2 4dfbe: 56c0 sne %d0 c->parent = the_node->parent; 4dfc0: 2089 movel %a1,%a0@ if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 4dfc2: 49c0 extbl %d0 4dfc4: 9280 subl %d0,%d1 4dfc6: 2388 1c00 movel %a0,%a1@(00000000,%d1:l:4) c->parent = the_node->parent; the_node->parent = c; 4dfca: 2488 movel %a0,%a2@ ISR_Level level; _ISR_Disable( level ); return _RBTree_Insert_unprotected( tree, node ); _ISR_Enable( level ); } 4dfcc: 2053 moveal %a3@,%a0 */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Parent( RBTree_Node *the_node ) { if (!the_node->parent->parent) return NULL; 4dfce: 2250 moveal %a0@,%a1 4dfd0: 2449 moveal %a1,%a2 4dfd2: 4a89 tstl %a1 4dfd4: 6600 ff26 bnew 4defc <_RBTree_Validate_insert_unprotected+0x18> /* now rotate grandparent in the other branch direction (toward uncle) */ _RBTree_Rotate(g, (1-pdir)); } } if(!the_node->parent->parent) the_node->color = RBT_BLACK; 4dfd8: 42ab 000c clrl %a3@(12) } 4dfdc: 4cd7 3c0c moveml %sp@,%d2-%d3/%a2-%a5 4dfe0: 4e5e unlk %fp 4dfe2: 4e75 rts u = _RBTree_Parent_sibling(the_node); g = the_node->parent->parent; /* if uncle is red, repaint uncle/parent black and grandparent red */ if(_RBTree_Is_red(u)) { the_node->parent->color = RBT_BLACK; 4dfe4: 42a8 000c clrl %a0@(12) u->color = RBT_BLACK; g->color = RBT_RED; 4dfe8: 2649 moveal %a1,%a3 g = the_node->parent->parent; /* if uncle is red, repaint uncle/parent black and grandparent red */ if(_RBTree_Is_red(u)) { the_node->parent->color = RBT_BLACK; u->color = RBT_BLACK; 4dfea: 42ac 000c clrl %a4@(12) g->color = RBT_RED; 4dfee: 2340 000c movel %d0,%a1@(12) 4dff2: 6000 fefc braw 4def0 <_RBTree_Validate_insert_unprotected+0xc> 4dff6: 2001 movel %d1,%d0 } else { /* if uncle is black */ RBTree_Direction dir = the_node != the_node->parent->child[0]; RBTree_Direction pdir = the_node->parent != g->child[0]; /* ensure node is on the same branch direction as parent */ if (dir != pdir) { 4dff8: 9481 subl %d1,%d2 4dffa: 5280 addql #1,%d0 4dffc: 608a bras 4df88 <_RBTree_Validate_insert_unprotected+0xa4> /* now rotate grandparent in the other branch direction (toward uncle) */ _RBTree_Rotate(g, (1-pdir)); } } if(!the_node->parent->parent) the_node->color = RBT_BLACK; } 4dffe: 2429 0004 movel %a1@(4),%d2 <== NOT EXECUTED 4e002: 6000 ff28 braw 4df2c <_RBTree_Validate_insert_unprotected+0x48><== NOT EXECUTED if(!the_node) return NULL; if(!(the_node->parent)) return NULL; if(!(the_node->parent->parent)) return NULL; if(the_node == the_node->parent->child[RBT_LEFT]) return the_node->parent->child[RBT_RIGHT]; 4e006: 2869 0008 moveal %a1@(8),%a4 4e00a: 6000 ff12 braw 4df1e <_RBTree_Validate_insert_unprotected+0x3a> =============================================================================== 0004ca52 <_RTEMS_tasks_Create_extension>: bool _RTEMS_tasks_Create_extension( Thread_Control *executing, Thread_Control *created ) { 4ca52: 4e56 0000 linkw %fp,#0 4ca56: 2f0a movel %a2,%sp@- 4ca58: 246e 000c moveal %fp@(12),%a2 /* * Notepads must be the last entry in the structure and they * can be left off if disabled in the configuration. */ to_allocate = sizeof( RTEMS_API_Control ); if ( !rtems_configuration_get_notepads_enabled() ) 4ca5c: 4a39 0005 f6b4 tstb 5f6b4 4ca62: 6758 beqs 4cabc <_RTEMS_tasks_Create_extension+0x6a> /* * Notepads must be the last entry in the structure and they * can be left off if disabled in the configuration. */ to_allocate = sizeof( RTEMS_API_Control ); 4ca64: 705e moveq #94,%d0 if ( !rtems_configuration_get_notepads_enabled() ) to_allocate -= (RTEMS_NUMBER_NOTEPADS * sizeof(uint32_t)); api = _Workspace_Allocate( to_allocate ); 4ca66: 2f00 movel %d0,%sp@- 4ca68: 4eb9 0004 a2e2 jsr 4a2e2 <_Workspace_Allocate> if ( !api ) 4ca6e: 588f addql #4,%sp */ to_allocate = sizeof( RTEMS_API_Control ); if ( !rtems_configuration_get_notepads_enabled() ) to_allocate -= (RTEMS_NUMBER_NOTEPADS * sizeof(uint32_t)); api = _Workspace_Allocate( to_allocate ); 4ca70: 2040 moveal %d0,%a0 if ( !api ) 4ca72: 4a80 tstl %d0 4ca74: 6758 beqs 4cace <_RTEMS_tasks_Create_extension+0x7c> return false; created->API_Extensions[ THREAD_API_RTEMS ] = api; 4ca76: 2540 00fe movel %d0,%a2@(254) */ RTEMS_INLINE_ROUTINE void _ASR_Initialize ( ASR_Information *information ) { information->is_enabled = false; 4ca7a: 4200 clrb %d0 api->pending_events = EVENT_SETS_NONE_PENDING; 4ca7c: 4290 clrl %a0@ 4ca7e: 1140 0008 moveb %d0,%a0@(8) api->event_condition = 0; 4ca82: 42a8 0004 clrl %a0@(4) information->handler = NULL; 4ca86: 42a8 000a clrl %a0@(10) information->mode_set = RTEMS_DEFAULT_MODES; 4ca8a: 42a8 000e clrl %a0@(14) information->signals_posted = 0; 4ca8e: 42a8 0012 clrl %a0@(18) information->signals_pending = 0; 4ca92: 42a8 0016 clrl %a0@(22) information->nest_level = 0; 4ca96: 42a8 001a clrl %a0@(26) _ASR_Initialize( &api->Signal ); created->task_variables = NULL; 4ca9a: 42aa 010a clrl %a2@(266) if ( rtems_configuration_get_notepads_enabled() ) { 4ca9e: 4a39 0005 f6b4 tstb 5f6b4 4caa4: 670c beqs 4cab2 <_RTEMS_tasks_Create_extension+0x60> * task is created via another API, then this routine is invoked * and this API given the opportunity to initialize its extension * area. */ bool _RTEMS_tasks_Create_extension( 4caa6: 41e8 001e lea %a0@(30),%a0 4caaa: 7010 moveq #16,%d0 _ASR_Initialize( &api->Signal ); created->task_variables = NULL; if ( rtems_configuration_get_notepads_enabled() ) { for (i=0; i < RTEMS_NUMBER_NOTEPADS; i++) api->Notepads[i] = 0; 4caac: 4298 clrl %a0@+ 4caae: 5380 subql #1,%d0 api->event_condition = 0; _ASR_Initialize( &api->Signal ); created->task_variables = NULL; if ( rtems_configuration_get_notepads_enabled() ) { for (i=0; i < RTEMS_NUMBER_NOTEPADS; i++) 4cab0: 66fa bnes 4caac <_RTEMS_tasks_Create_extension+0x5a> api->Notepads[i] = 0; } return true; } 4cab2: 246e fffc moveal %fp@(-4),%a2 4cab6: 4e5e unlk %fp if ( rtems_configuration_get_notepads_enabled() ) { for (i=0; i < RTEMS_NUMBER_NOTEPADS; i++) api->Notepads[i] = 0; } return true; 4cab8: 7001 moveq #1,%d0 } 4caba: 4e75 rts * Notepads must be the last entry in the structure and they * can be left off if disabled in the configuration. */ to_allocate = sizeof( RTEMS_API_Control ); if ( !rtems_configuration_get_notepads_enabled() ) to_allocate -= (RTEMS_NUMBER_NOTEPADS * sizeof(uint32_t)); 4cabc: 701e moveq #30,%d0 api = _Workspace_Allocate( to_allocate ); 4cabe: 2f00 movel %d0,%sp@- 4cac0: 4eb9 0004 a2e2 jsr 4a2e2 <_Workspace_Allocate> if ( !api ) 4cac6: 588f addql #4,%sp */ to_allocate = sizeof( RTEMS_API_Control ); if ( !rtems_configuration_get_notepads_enabled() ) to_allocate -= (RTEMS_NUMBER_NOTEPADS * sizeof(uint32_t)); api = _Workspace_Allocate( to_allocate ); 4cac8: 2040 moveal %d0,%a0 if ( !api ) 4caca: 4a80 tstl %d0 4cacc: 66a8 bnes 4ca76 <_RTEMS_tasks_Create_extension+0x24><== ALWAYS TAKEN for (i=0; i < RTEMS_NUMBER_NOTEPADS; i++) api->Notepads[i] = 0; } return true; } 4cace: 246e fffc moveal %fp@(-4),%a2 4cad2: 4e5e unlk %fp to_allocate -= (RTEMS_NUMBER_NOTEPADS * sizeof(uint32_t)); api = _Workspace_Allocate( to_allocate ); if ( !api ) return false; 4cad4: 4200 clrb %d0 <== NOT EXECUTED for (i=0; i < RTEMS_NUMBER_NOTEPADS; i++) api->Notepads[i] = 0; } return true; } =============================================================================== 0004c9fc <_RTEMS_tasks_Delete_extension>: void _RTEMS_tasks_Delete_extension( Thread_Control *executing, Thread_Control *deleted ) { 4c9fc: 4e56 fff4 linkw %fp,#-12 4ca00: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 4ca04: 246e 000c moveal %fp@(12),%a2 4ca08: 47f9 0004 cb24 lea 4cb24 <_RTEMS_Tasks_Invoke_task_variable_dtor>,%a3 /* * Free per task variable memory */ tvp = deleted->task_variables; 4ca0e: 206a 010a moveal %a2@(266),%a0 deleted->task_variables = NULL; 4ca12: 42aa 010a clrl %a2@(266) while (tvp) { 4ca16: 4a88 tstl %a0 4ca18: 671e beqs 4ca38 <_RTEMS_tasks_Delete_extension+0x3c> next = (rtems_task_variable_t *)tvp->next; 4ca1a: 2410 movel %a0@,%d2 _RTEMS_Tasks_Invoke_task_variable_dtor( deleted, tvp ); 4ca1c: 2f08 movel %a0,%sp@- 4ca1e: 2f0a movel %a2,%sp@- 4ca20: 4e93 jsr %a3@ * Free per task variable memory */ tvp = deleted->task_variables; deleted->task_variables = NULL; while (tvp) { 4ca22: 508f addql #8,%sp 4ca24: 4a82 tstl %d2 4ca26: 6710 beqs 4ca38 <_RTEMS_tasks_Delete_extension+0x3c><== NEVER TAKEN next = (rtems_task_variable_t *)tvp->next; _RTEMS_Tasks_Invoke_task_variable_dtor( deleted, tvp ); tvp = next; 4ca28: 2042 moveal %d2,%a0 */ tvp = deleted->task_variables; deleted->task_variables = NULL; while (tvp) { next = (rtems_task_variable_t *)tvp->next; 4ca2a: 2410 movel %a0@,%d2 _RTEMS_Tasks_Invoke_task_variable_dtor( deleted, tvp ); 4ca2c: 2f08 movel %a0,%sp@- 4ca2e: 2f0a movel %a2,%sp@- 4ca30: 4e93 jsr %a3@ * Free per task variable memory */ tvp = deleted->task_variables; deleted->task_variables = NULL; while (tvp) { 4ca32: 508f addql #8,%sp 4ca34: 4a82 tstl %d2 4ca36: 66f0 bnes 4ca28 <_RTEMS_tasks_Delete_extension+0x2c> /* * Free API specific memory */ (void) _Workspace_Free( deleted->API_Extensions[ THREAD_API_RTEMS ] ); 4ca38: 2f2a 00fe movel %a2@(254),%sp@- 4ca3c: 4eb9 0004 a2fe jsr 4a2fe <_Workspace_Free> deleted->API_Extensions[ THREAD_API_RTEMS ] = NULL; 4ca42: 588f addql #4,%sp 4ca44: 42aa 00fe clrl %a2@(254) } 4ca48: 4cee 0c04 fff4 moveml %fp@(-12),%d2/%a2-%a3 4ca4e: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00046f00 <_RTEMS_tasks_Initialize_user_tasks_body>: * * Output parameters: NONE */ void _RTEMS_tasks_Initialize_user_tasks_body( void ) { 46f00: 4e56 ffe4 linkw %fp,#-28 46f04: 48d7 1c1c moveml %d2-%d4/%a2-%a4,%sp@ rtems_initialization_tasks_table *user_tasks; /* * Move information into local variables */ user_tasks = Configuration_RTEMS_API.User_initialization_tasks_table; 46f08: 2479 0005 f6da moveal 5f6da ,%a2 maximum = Configuration_RTEMS_API.number_of_initialization_tasks; 46f0e: 2639 0005 f6d6 movel 5f6d6 ,%d3 /* * Verify that we have a set of user tasks to iterate */ if ( !user_tasks ) 46f14: 4a8a tstl %a2 46f16: 6754 beqs 46f6c <_RTEMS_tasks_Initialize_user_tasks_body+0x6c> return; /* * Now iterate over the initialization tasks and create/start them. */ for ( index=0 ; index < maximum ; index++ ) { 46f18: 4a83 tstl %d3 46f1a: 6750 beqs 46f6c <_RTEMS_tasks_Initialize_user_tasks_body+0x6c><== NEVER TAKEN 46f1c: 280e movel %fp,%d4 46f1e: 4282 clrl %d2 46f20: 5984 subql #4,%d4 46f22: 47f9 0004 6cd8 lea 46cd8 ,%a3 &id ); if ( !rtems_is_status_successful( return_value ) ) _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); return_value = rtems_task_start( 46f28: 49f9 0004 6f88 lea 46f88 ,%a4 /* * Now iterate over the initialization tasks and create/start them. */ for ( index=0 ; index < maximum ; index++ ) { return_value = rtems_task_create( 46f2e: 2f04 movel %d4,%sp@- 46f30: 2f2a 000c movel %a2@(12),%sp@- 46f34: 2f2a 0014 movel %a2@(20),%sp@- 46f38: 2f2a 0004 movel %a2@(4),%sp@- 46f3c: 2f2a 0008 movel %a2@(8),%sp@- 46f40: 2f12 movel %a2@,%sp@- 46f42: 4e93 jsr %a3@ user_tasks[ index ].stack_size, user_tasks[ index ].mode_set, user_tasks[ index ].attribute_set, &id ); if ( !rtems_is_status_successful( return_value ) ) 46f44: 4fef 0018 lea %sp@(24),%sp 46f48: 4a80 tstl %d0 46f4a: 662a bnes 46f76 <_RTEMS_tasks_Initialize_user_tasks_body+0x76> _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); return_value = rtems_task_start( 46f4c: 2f2a 0018 movel %a2@(24),%sp@- 46f50: 2f2a 0010 movel %a2@(16),%sp@- 46f54: 2f2e fffc movel %fp@(-4),%sp@- 46f58: 4e94 jsr %a4@ id, user_tasks[ index ].entry_point, user_tasks[ index ].argument ); if ( !rtems_is_status_successful( return_value ) ) 46f5a: 4fef 000c lea %sp@(12),%sp 46f5e: 4a80 tstl %d0 46f60: 6614 bnes 46f76 <_RTEMS_tasks_Initialize_user_tasks_body+0x76> return; /* * Now iterate over the initialization tasks and create/start them. */ for ( index=0 ; index < maximum ; index++ ) { 46f62: 5282 addql #1,%d2 46f64: 45ea 001c lea %a2@(28),%a2 46f68: b682 cmpl %d2,%d3 46f6a: 66c2 bnes 46f2e <_RTEMS_tasks_Initialize_user_tasks_body+0x2e><== NEVER TAKEN user_tasks[ index ].argument ); if ( !rtems_is_status_successful( return_value ) ) _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); } } 46f6c: 4cee 1c1c ffe4 moveml %fp@(-28),%d2-%d4/%a2-%a4 46f72: 4e5e unlk %fp 46f74: 4e75 rts id, user_tasks[ index ].entry_point, user_tasks[ index ].argument ); if ( !rtems_is_status_successful( return_value ) ) _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); 46f76: 2f00 movel %d0,%sp@- 46f78: 4878 0001 pea 1 46f7c: 4878 0001 pea 1 46f80: 4eb9 0004 7ec8 jsr 47ec8 <_Internal_error_Occurred> ... =============================================================================== 0004c926 <_RTEMS_tasks_Switch_extension>: void _RTEMS_tasks_Switch_extension( Thread_Control *executing, Thread_Control *heir ) { 4c926: 4e56 0000 linkw %fp,#0 4c92a: 206e 0008 moveal %fp@(8),%a0 /* * Per Task Variables */ tvp = executing->task_variables; 4c92e: 2068 010a moveal %a0@(266),%a0 while (tvp) { 4c932: 4a88 tstl %a0 4c934: 6712 beqs 4c948 <_RTEMS_tasks_Switch_extension+0x22> tvp->tval = *tvp->ptr; 4c936: 2268 0004 moveal %a0@(4),%a1 4c93a: 2151 000c movel %a1@,%a0@(12) *tvp->ptr = tvp->gval; 4c93e: 22a8 0008 movel %a0@(8),%a1@ tvp = (rtems_task_variable_t *)tvp->next; 4c942: 2050 moveal %a0@,%a0 /* * Per Task Variables */ tvp = executing->task_variables; while (tvp) { 4c944: 4a88 tstl %a0 4c946: 66ee bnes 4c936 <_RTEMS_tasks_Switch_extension+0x10><== NEVER TAKEN tvp->tval = *tvp->ptr; *tvp->ptr = tvp->gval; tvp = (rtems_task_variable_t *)tvp->next; } tvp = heir->task_variables; 4c948: 206e 000c moveal %fp@(12),%a0 4c94c: 2068 010a moveal %a0@(266),%a0 while (tvp) { 4c950: 4a88 tstl %a0 4c952: 6712 beqs 4c966 <_RTEMS_tasks_Switch_extension+0x40> tvp->gval = *tvp->ptr; 4c954: 2268 0004 moveal %a0@(4),%a1 4c958: 2151 0008 movel %a1@,%a0@(8) *tvp->ptr = tvp->tval; 4c95c: 22a8 000c movel %a0@(12),%a1@ tvp = (rtems_task_variable_t *)tvp->next; 4c960: 2050 moveal %a0@,%a0 *tvp->ptr = tvp->gval; tvp = (rtems_task_variable_t *)tvp->next; } tvp = heir->task_variables; while (tvp) { 4c962: 4a88 tstl %a0 4c964: 66ee bnes 4c954 <_RTEMS_tasks_Switch_extension+0x2e><== NEVER TAKEN tvp->gval = *tvp->ptr; *tvp->ptr = tvp->tval; tvp = (rtems_task_variable_t *)tvp->next; } } 4c966: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00047e14 <_Rate_monotonic_Timeout>: void _Rate_monotonic_Timeout( Objects_Id id, void *ignored ) { 47e14: 4e56 fffc linkw %fp,#-4 47e18: 2f0a movel %a2,%sp@- 47e1a: 486e fffc pea %fp@(-4) 47e1e: 2f2e 0008 movel %fp@(8),%sp@- 47e22: 4879 0006 2e4c pea 62e4c <_Rate_monotonic_Information> 47e28: 4eb9 0004 9dd4 jsr 49dd4 <_Objects_Get> /* * When we get here, the Timer is already off the chain so we do not * have to worry about that -- hence no _Watchdog_Remove(). */ the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 47e2e: 4fef 000c lea %sp@(12),%sp 47e32: 2440 moveal %d0,%a2 47e34: 4aae fffc tstl %fp@(-4) 47e38: 663c bnes 47e76 <_Rate_monotonic_Timeout+0x62> <== NEVER TAKEN case OBJECTS_LOCAL: the_thread = the_period->owner; 47e3a: 206a 0040 moveal %a2@(64),%a0 */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_for_period ( States_Control the_states ) { return (the_states & STATES_WAITING_FOR_PERIOD); 47e3e: 2028 0010 movel %a0@(16),%d0 47e42: 0280 0000 4000 andil #16384,%d0 if ( _States_Is_waiting_for_period( the_thread->current_state ) && 47e48: 670a beqs 47e54 <_Rate_monotonic_Timeout+0x40> 47e4a: 202a 0008 movel %a2@(8),%d0 47e4e: b0a8 0020 cmpl %a0@(32),%d0 47e52: 676a beqs 47ebe <_Rate_monotonic_Timeout+0xaa> _Thread_Unblock( the_thread ); _Rate_monotonic_Initiate_statistics( the_period ); _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else if ( the_period->state == RATE_MONOTONIC_OWNER_IS_BLOCKING ) { 47e54: 7001 moveq #1,%d0 47e56: b0aa 0038 cmpl %a2@(56),%d0 47e5a: 6722 beqs 47e7e <_Rate_monotonic_Timeout+0x6a> <== NEVER TAKEN _Rate_monotonic_Initiate_statistics( the_period ); _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else the_period->state = RATE_MONOTONIC_EXPIRED; 47e5c: 7004 moveq #4,%d0 47e5e: 2540 0038 movel %d0,%a2@(56) * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { _Thread_Dispatch_disable_level--; 47e62: 2039 0006 2f42 movel 62f42 <_Thread_Dispatch_disable_level>,%d0 47e68: 5380 subql #1,%d0 47e6a: 23c0 0006 2f42 movel %d0,62f42 <_Thread_Dispatch_disable_level> return _Thread_Dispatch_disable_level; 47e70: 2039 0006 2f42 movel 62f42 <_Thread_Dispatch_disable_level>,%d0 case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 47e76: 246e fff8 moveal %fp@(-8),%a2 47e7a: 4e5e unlk %fp 47e7c: 4e75 rts _Rate_monotonic_Initiate_statistics( the_period ); _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else if ( the_period->state == RATE_MONOTONIC_OWNER_IS_BLOCKING ) { the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING; 47e7e: 103c 0003 moveb #3,%d0 47e82: 2540 0038 movel %d0,%a2@(56) _Rate_monotonic_Initiate_statistics( the_period ); 47e86: 2f0a movel %a2,%sp@- 47e88: 4eb9 0004 77b0 jsr 477b0 <_Rate_monotonic_Initiate_statistics> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 47e8e: 256a 003c 001c movel %a2@(60),%a2@(28) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 47e94: 486a 0010 pea %a2@(16) 47e98: 4879 0006 2ffa pea 62ffa <_Watchdog_Ticks_chain> 47e9e: 4eb9 0004 ba94 jsr 4ba94 <_Watchdog_Insert> 47ea4: 4fef 000c lea %sp@(12),%sp * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { _Thread_Dispatch_disable_level--; 47ea8: 2039 0006 2f42 movel 62f42 <_Thread_Dispatch_disable_level>,%d0 47eae: 5380 subql #1,%d0 47eb0: 23c0 0006 2f42 movel %d0,62f42 <_Thread_Dispatch_disable_level> return _Thread_Dispatch_disable_level; 47eb6: 2039 0006 2f42 movel 62f42 <_Thread_Dispatch_disable_level>,%d0 47ebc: 60b8 bras 47e76 <_Rate_monotonic_Timeout+0x62> RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 47ebe: 2f3c 1003 fff8 movel #268697592,%sp@- 47ec4: 2f08 movel %a0,%sp@- 47ec6: 4eb9 0004 a7a0 jsr 4a7a0 <_Thread_Clear_state> the_thread = the_period->owner; if ( _States_Is_waiting_for_period( the_thread->current_state ) && the_thread->Wait.id == the_period->Object.id ) { _Thread_Unblock( the_thread ); _Rate_monotonic_Initiate_statistics( the_period ); 47ecc: 2f0a movel %a2,%sp@- 47ece: 4eb9 0004 77b0 jsr 477b0 <_Rate_monotonic_Initiate_statistics> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 47ed4: 256a 003c 001c movel %a2@(60),%a2@(28) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 47eda: 486a 0010 pea %a2@(16) 47ede: 4879 0006 2ffa pea 62ffa <_Watchdog_Ticks_chain> 47ee4: 4eb9 0004 ba94 jsr 4ba94 <_Watchdog_Insert> 47eea: 4fef 0014 lea %sp@(20),%sp * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { _Thread_Dispatch_disable_level--; 47eee: 2039 0006 2f42 movel 62f42 <_Thread_Dispatch_disable_level>,%d0 47ef4: 5380 subql #1,%d0 47ef6: 23c0 0006 2f42 movel %d0,62f42 <_Thread_Dispatch_disable_level> return _Thread_Dispatch_disable_level; 47efc: 2039 0006 2f42 movel 62f42 <_Thread_Dispatch_disable_level>,%d0 47f02: 6000 ff72 braw 47e76 <_Rate_monotonic_Timeout+0x62> ... =============================================================================== 0005e5fc <_Region_Process_queue>: */ void _Region_Process_queue( Region_Control *the_region ) { 5e5fc: 4e56 ffe4 linkw %fp,#-28 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 5e600: 2039 0007 dd4c movel 7dd4c <_Thread_Dispatch_disable_level>,%d0 5e606: 5280 addql #1,%d0 5e608: 48d7 3c1c moveml %d2-%d4/%a2-%a5,%sp@ 5e60c: 23c0 0007 dd4c movel %d0,7dd4c <_Thread_Dispatch_disable_level> 5e612: 266e 0008 moveal %fp@(8),%a3 return _Thread_Dispatch_disable_level; 5e616: 2039 0007 dd4c movel 7dd4c <_Thread_Dispatch_disable_level>,%d0 * 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(); 5e61c: 2f39 0007 ddec movel 7ddec <_RTEMS_Allocator_Mutex>,%sp@- 5e622: 240b movel %a3,%d2 5e624: 0682 0000 0010 addil #16,%d2 RTEMS_INLINE_ROUTINE void *_Region_Allocate_segment ( Region_Control *the_region, uintptr_t size ) { return _Heap_Allocate( &the_region->Memory, size ); 5e62a: 260b movel %a3,%d3 5e62c: 49f9 0005 ee48 lea 5ee48 <_Thread_queue_First>,%a4 5e632: 0683 0000 0068 addil #104,%d3 5e638: 4bf9 0005 8e2c lea 58e2c <_Heap_Allocate_aligned_with_boundary>,%a5 5e63e: 4eb9 0005 8224 jsr 58224 <_API_Mutex_Unlock> 5e644: 588f addql #4,%sp 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 ); 5e646: 283c 0005 ed2c movel #388396,%d4 /* * 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 ); 5e64c: 2f02 movel %d2,%sp@- 5e64e: 4e94 jsr %a4@ if ( the_thread == NULL ) 5e650: 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 ); 5e652: 2440 moveal %d0,%a2 if ( the_thread == NULL ) 5e654: 4a80 tstl %d0 5e656: 6738 beqs 5e690 <_Region_Process_queue+0x94> 5e658: 42a7 clrl %sp@- 5e65a: 42a7 clrl %sp@- 5e65c: 2f2a 0024 movel %a2@(36),%sp@- 5e660: 2f03 movel %d3,%sp@- 5e662: 4e95 jsr %a5@ the_segment = (void **) _Region_Allocate_segment( the_region, the_thread->Wait.count ); if ( the_segment == NULL ) 5e664: 4fef 0010 lea %sp@(16),%sp 5e668: 4a80 tstl %d0 5e66a: 6724 beqs 5e690 <_Region_Process_queue+0x94> break; *(void **)the_thread->Wait.return_argument = the_segment; 5e66c: 206a 0028 moveal %a2@(40),%a0 5e670: 2080 movel %d0,%a0@ the_region->number_of_used_blocks += 1; 5e672: 52ab 0064 addql #1,%a3@(100) _Thread_queue_Extract( &the_region->Wait_queue, the_thread ); 5e676: 2044 moveal %d4,%a0 5e678: 2f0a movel %a2,%sp@- 5e67a: 2f02 movel %d2,%sp@- 5e67c: 4e90 jsr %a0@ the_thread->Wait.return_code = RTEMS_SUCCESSFUL; } 5e67e: 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; 5e680: 42aa 0034 clrl %a2@(52) /* * 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 ); 5e684: 2f02 movel %d2,%sp@- 5e686: 4e94 jsr %a4@ if ( the_thread == NULL ) 5e688: 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 ); 5e68a: 2440 moveal %d0,%a2 if ( the_thread == NULL ) 5e68c: 4a80 tstl %d0 5e68e: 66c8 bnes 5e658 <_Region_Process_queue+0x5c> 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(); } 5e690: 4cee 3c1c ffe4 moveml %fp@(-28),%d2-%d4/%a2-%a5 5e696: 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(); 5e698: 4ef9 0005 ad04 jmp 5ad04 <_Thread_Enable_dispatch> ... =============================================================================== 00049174 <_Scheduler_EDF_Allocate>: #include void *_Scheduler_EDF_Allocate( Thread_Control *the_thread ) { 49174: 4e56 0000 linkw %fp,#0 49178: 2f0a movel %a2,%sp@- void *sched; Scheduler_EDF_Per_thread *schinfo; sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) ); 4917a: 4878 0018 pea 18 #include void *_Scheduler_EDF_Allocate( Thread_Control *the_thread ) { 4917e: 246e 0008 moveal %fp@(8),%a2 void *sched; Scheduler_EDF_Per_thread *schinfo; sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) ); 49182: 4eb9 0004 acfe jsr 4acfe <_Workspace_Allocate> if ( sched ) { 49188: 588f addql #4,%sp 4918a: 4a80 tstl %d0 4918c: 670e beqs 4919c <_Scheduler_EDF_Allocate+0x28> <== NEVER TAKEN the_thread->scheduler_info = sched; 4918e: 2540 008a movel %d0,%a2@(138) schinfo = (Scheduler_EDF_Per_thread *)(the_thread->scheduler_info); schinfo->thread = the_thread; 49192: 2040 moveal %d0,%a0 schinfo->queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 49194: 7202 moveq #2,%d1 sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) ); if ( sched ) { the_thread->scheduler_info = sched; schinfo = (Scheduler_EDF_Per_thread *)(the_thread->scheduler_info); schinfo->thread = the_thread; 49196: 208a movel %a2,%a0@ schinfo->queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 49198: 2141 0014 movel %d1,%a0@(20) } return sched; } 4919c: 246e fffc moveal %fp@(-4),%a2 491a0: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000491a4 <_Scheduler_EDF_Block>: #include void _Scheduler_EDF_Block( Thread_Control *the_thread ) { 491a4: 4e56 0000 linkw %fp,#0 491a8: 2f02 movel %d2,%sp@- 491aa: 242e 0008 movel %fp@(8),%d2 _Scheduler_EDF_Extract( the_thread ); 491ae: 2f02 movel %d2,%sp@- 491b0: 4eb9 0004 922c jsr 4922c <_Scheduler_EDF_Extract> /* TODO: flash critical section? */ if ( _Thread_Is_heir( the_thread ) ) 491b6: 588f addql #4,%sp 491b8: b4b9 0006 2d36 cmpl 62d36 <_Per_CPU_Information+0x10>,%d2 491be: 6720 beqs 491e0 <_Scheduler_EDF_Block+0x3c> <== ALWAYS TAKEN _Scheduler_EDF_Schedule(); if ( _Thread_Is_executing( the_thread ) ) 491c0: b4b9 0006 2d32 cmpl 62d32 <_Per_CPU_Information+0xc>,%d2 <== NOT EXECUTED 491c6: 6708 beqs 491d0 <_Scheduler_EDF_Block+0x2c> <== NOT EXECUTED _Thread_Dispatch_necessary = true; } 491c8: 242e fffc movel %fp@(-4),%d2 <== NOT EXECUTED 491cc: 4e5e unlk %fp <== NOT EXECUTED 491ce: 4e75 rts <== NOT EXECUTED 491d0: 242e fffc movel %fp@(-4),%d2 491d4: 4e5e unlk %fp if ( _Thread_Is_heir( the_thread ) ) _Scheduler_EDF_Schedule(); if ( _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; 491d6: 7001 moveq #1,%d0 491d8: 13c0 0006 2d3e moveb %d0,62d3e <_Per_CPU_Information+0x18> } 491de: 4e75 rts _Scheduler_EDF_Extract( the_thread ); /* TODO: flash critical section? */ if ( _Thread_Is_heir( the_thread ) ) _Scheduler_EDF_Schedule(); 491e0: 4eb9 0004 9364 jsr 49364 <_Scheduler_EDF_Schedule> if ( _Thread_Is_executing( the_thread ) ) 491e6: b4b9 0006 2d32 cmpl 62d32 <_Per_CPU_Information+0xc>,%d2 491ec: 66da bnes 491c8 <_Scheduler_EDF_Block+0x24> <== NEVER TAKEN 491ee: 60e0 bras 491d0 <_Scheduler_EDF_Block+0x2c> =============================================================================== 00049258 <_Scheduler_EDF_Free>: #include void _Scheduler_EDF_Free( Thread_Control *the_thread ) { 49258: 4e56 0000 linkw %fp,#0 4925c: 206e 0008 moveal %fp@(8),%a0 _Workspace_Free( the_thread->scheduler_info ); 49260: 2d68 008a 0008 movel %a0@(138),%fp@(8) } 49266: 4e5e unlk %fp void _Scheduler_EDF_Free( Thread_Control *the_thread ) { _Workspace_Free( the_thread->scheduler_info ); 49268: 4ef9 0004 ad1a jmp 4ad1a <_Workspace_Free> ... =============================================================================== 00049310 <_Scheduler_EDF_Release_job>: void _Scheduler_EDF_Release_job( Thread_Control *the_thread, uint32_t deadline ) { 49310: 4e56 0000 linkw %fp,#0 49314: 206e 0008 moveal %fp@(8),%a0 49318: 202e 000c movel %fp@(12),%d0 Priority_Control new_priority; if (deadline) { 4931c: 661e bnes 4933c <_Scheduler_EDF_Release_job+0x2c><== ALWAYS TAKEN new_priority = (_Watchdog_Ticks_since_boot + deadline) & ~SCHEDULER_EDF_PRIO_MSB; } else { /* Switch back to background priority. */ new_priority = the_thread->Start.initial_priority; 4931e: 2028 00ac movel %a0@(172),%d0 <== NOT EXECUTED } the_thread->real_priority = new_priority; _Thread_Change_priority(the_thread, new_priority, true); 49322: 4878 0001 pea 1 <== NOT EXECUTED 49326: 2f00 movel %d0,%sp@- <== NOT EXECUTED else { /* Switch back to background priority. */ new_priority = the_thread->Start.initial_priority; } the_thread->real_priority = new_priority; 49328: 2140 0018 movel %d0,%a0@(24) <== NOT EXECUTED _Thread_Change_priority(the_thread, new_priority, true); 4932c: 2f08 movel %a0,%sp@- <== NOT EXECUTED 4932e: 4eb9 0004 96c0 jsr 496c0 <_Thread_Change_priority> <== NOT EXECUTED 49334: 4fef 000c lea %sp@(12),%sp <== NOT EXECUTED } 49338: 4e5e unlk %fp <== NOT EXECUTED 4933a: 4e75 rts <== NOT EXECUTED { Priority_Control new_priority; if (deadline) { /* Initializing or shifting deadline. */ new_priority = (_Watchdog_Ticks_since_boot + deadline) 4933c: 2239 0006 29d2 movel 629d2 <_Watchdog_Ticks_since_boot>,%d1 /* Switch back to background priority. */ new_priority = the_thread->Start.initial_priority; } the_thread->real_priority = new_priority; _Thread_Change_priority(the_thread, new_priority, true); 49342: 4878 0001 pea 1 { Priority_Control new_priority; if (deadline) { /* Initializing or shifting deadline. */ new_priority = (_Watchdog_Ticks_since_boot + deadline) 49346: d081 addl %d1,%d0 49348: 0880 001f bclr #31,%d0 /* Switch back to background priority. */ new_priority = the_thread->Start.initial_priority; } the_thread->real_priority = new_priority; _Thread_Change_priority(the_thread, new_priority, true); 4934c: 2f00 movel %d0,%sp@- else { /* Switch back to background priority. */ new_priority = the_thread->Start.initial_priority; } the_thread->real_priority = new_priority; 4934e: 2140 0018 movel %d0,%a0@(24) _Thread_Change_priority(the_thread, new_priority, true); 49352: 2f08 movel %a0,%sp@- 49354: 4eb9 0004 96c0 jsr 496c0 <_Thread_Change_priority> 4935a: 4fef 000c lea %sp@(12),%sp } 4935e: 4e5e unlk %fp ... =============================================================================== 00049388 <_Scheduler_EDF_Unblock>: #include void _Scheduler_EDF_Unblock( Thread_Control *the_thread ) { 49388: 4e56 0000 linkw %fp,#0 4938c: 2f0a movel %a2,%sp@- 4938e: 246e 0008 moveal %fp@(8),%a2 _Scheduler_EDF_Enqueue(the_thread); 49392: 2f0a movel %a2,%sp@- 49394: 4eb9 0004 91fc jsr 491fc <_Scheduler_EDF_Enqueue> 4939a: 2f2a 0014 movel %a2@(20),%sp@- * 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 ( _Scheduler_Is_priority_lower_than( 4939e: 2079 0006 2d36 moveal 62d36 <_Per_CPU_Information+0x10>,%a0 493a4: 2f28 0014 movel %a0@(20),%sp@- 493a8: 2079 0006 0f8e moveal 60f8e <_Scheduler+0x30>,%a0 493ae: 4e90 jsr %a0@ 493b0: 4fef 000c lea %sp@(12),%sp 493b4: 4a80 tstl %d0 493b6: 6d08 blts 493c0 <_Scheduler_EDF_Unblock+0x38> _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; } } 493b8: 246e fffc moveal %fp@(-4),%a2 493bc: 4e5e unlk %fp 493be: 4e75 rts */ if ( _Scheduler_Is_priority_lower_than( _Thread_Heir->current_priority, the_thread->current_priority )) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 493c0: 2079 0006 2d32 moveal 62d32 <_Per_CPU_Information+0xc>,%a0 * a pseudo-ISR system task, we need to do a context switch. */ if ( _Scheduler_Is_priority_lower_than( _Thread_Heir->current_priority, the_thread->current_priority )) { _Thread_Heir = the_thread; 493c6: 23ca 0006 2d36 movel %a2,62d36 <_Per_CPU_Information+0x10> if ( _Thread_Executing->is_preemptible || 493cc: 4a28 0074 tstb %a0@(116) 493d0: 6710 beqs 493e2 <_Scheduler_EDF_Unblock+0x5a> <== NEVER TAKEN the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 493d2: 7001 moveq #1,%d0 493d4: 13c0 0006 2d3e moveb %d0,62d3e <_Per_CPU_Information+0x18> } } 493da: 246e fffc moveal %fp@(-4),%a2 493de: 4e5e unlk %fp 493e0: 4e75 rts */ if ( _Scheduler_Is_priority_lower_than( _Thread_Heir->current_priority, the_thread->current_priority )) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 493e2: 4aaa 0014 tstl %a2@(20) <== NOT EXECUTED 493e6: 66d0 bnes 493b8 <_Scheduler_EDF_Unblock+0x30> <== NOT EXECUTED the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 493e8: 7001 moveq #1,%d0 <== NOT EXECUTED 493ea: 13c0 0006 2d3e moveb %d0,62d3e <_Per_CPU_Information+0x18> <== NOT EXECUTED 493f0: 60e8 bras 493da <_Scheduler_EDF_Unblock+0x52> <== NOT EXECUTED ... =============================================================================== 000493f4 <_Scheduler_EDF_Update>: { Scheduler_EDF_Per_thread *sched_info = (Scheduler_EDF_Per_thread*)the_thread->scheduler_info; RBTree_Node *the_node = &(sched_info->Node); if (sched_info->queue_state == SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN) { 493f4: 7202 moveq #2,%d1 #include void _Scheduler_EDF_Update( Thread_Control *the_thread ) { 493f6: 4e56 0000 linkw %fp,#0 493fa: 2f0a movel %a2,%sp@- 493fc: 246e 0008 moveal %fp@(8),%a2 Scheduler_EDF_Per_thread *sched_info = 49400: 206a 008a moveal %a2@(138),%a0 (Scheduler_EDF_Per_thread*)the_thread->scheduler_info; RBTree_Node *the_node = &(sched_info->Node); if (sched_info->queue_state == SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN) { 49404: 2028 0014 movel %a0@(20),%d0 #include void _Scheduler_EDF_Update( Thread_Control *the_thread ) { 49408: 2f02 movel %d2,%sp@- Scheduler_EDF_Per_thread *sched_info = (Scheduler_EDF_Per_thread*)the_thread->scheduler_info; RBTree_Node *the_node = &(sched_info->Node); if (sched_info->queue_state == SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN) { 4940a: b280 cmpl %d0,%d1 4940c: 6712 beqs 49420 <_Scheduler_EDF_Update+0x2c> the_thread->real_priority = the_thread->Start.initial_priority; the_thread->current_priority = the_thread->Start.initial_priority; sched_info->queue_state = SCHEDULER_EDF_QUEUE_STATE_NOT_PRESENTLY; } if ( sched_info->queue_state == SCHEDULER_EDF_QUEUE_STATE_YES ) { 4940e: 7201 moveq #1,%d1 49410: b280 cmpl %d0,%d1 49412: 6730 beqs 49444 <_Scheduler_EDF_Update+0x50> <== NEVER TAKEN if ( _Thread_Executing->is_preemptible || the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; } } } 49414: 242e fff8 movel %fp@(-8),%d2 49418: 246e fffc moveal %fp@(-4),%a2 4941c: 4e5e unlk %fp 4941e: 4e75 rts (Scheduler_EDF_Per_thread*)the_thread->scheduler_info; RBTree_Node *the_node = &(sched_info->Node); if (sched_info->queue_state == SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN) { /* Shifts the priority to the region of background tasks. */ the_thread->Start.initial_priority |= (SCHEDULER_EDF_PRIO_MSB); 49420: 202a 00ac movel %a2@(172),%d0 49424: 08c0 001f bset #31,%d0 if ( _Thread_Executing->is_preemptible || the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; } } } 49428: 242e fff8 movel %fp@(-8),%d2 (Scheduler_EDF_Per_thread*)the_thread->scheduler_info; RBTree_Node *the_node = &(sched_info->Node); if (sched_info->queue_state == SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN) { /* Shifts the priority to the region of background tasks. */ the_thread->Start.initial_priority |= (SCHEDULER_EDF_PRIO_MSB); 4942c: 2540 00ac movel %d0,%a2@(172) the_thread->real_priority = the_thread->Start.initial_priority; 49430: 2540 0018 movel %d0,%a2@(24) the_thread->current_priority = the_thread->Start.initial_priority; 49434: 2540 0014 movel %d0,%a2@(20) if ( _Thread_Executing->is_preemptible || the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; } } } 49438: 246e fffc moveal %fp@(-4),%a2 4943c: 4e5e unlk %fp if (sched_info->queue_state == SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN) { /* Shifts the priority to the region of background tasks. */ the_thread->Start.initial_priority |= (SCHEDULER_EDF_PRIO_MSB); the_thread->real_priority = the_thread->Start.initial_priority; the_thread->current_priority = the_thread->Start.initial_priority; sched_info->queue_state = SCHEDULER_EDF_QUEUE_STATE_NOT_PRESENTLY; 4943e: 42a8 0014 clrl %a0@(20) if ( _Thread_Executing->is_preemptible || the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; } } } 49442: 4e75 rts Thread_Control *the_thread ) { Scheduler_EDF_Per_thread *sched_info = (Scheduler_EDF_Per_thread*)the_thread->scheduler_info; RBTree_Node *the_node = &(sched_info->Node); 49444: 2408 movel %a0,%d2 <== NOT EXECUTED 49446: 5882 addql #4,%d2 <== NOT EXECUTED the_thread->current_priority = the_thread->Start.initial_priority; sched_info->queue_state = SCHEDULER_EDF_QUEUE_STATE_NOT_PRESENTLY; } if ( sched_info->queue_state == SCHEDULER_EDF_QUEUE_STATE_YES ) { _RBTree_Extract(&_Scheduler_EDF_Ready_queue, the_node); 49448: 2f02 movel %d2,%sp@- <== NOT EXECUTED 4944a: 4879 0006 2d48 pea 62d48 <_Scheduler_EDF_Ready_queue> <== NOT EXECUTED 49450: 4eb9 0004 deb8 jsr 4deb8 <_RBTree_Extract> <== NOT EXECUTED _RBTree_Insert(&_Scheduler_EDF_Ready_queue, the_node); 49456: 2f02 movel %d2,%sp@- <== NOT EXECUTED 49458: 4879 0006 2d48 pea 62d48 <_Scheduler_EDF_Ready_queue> <== NOT EXECUTED 4945e: 4eb9 0004 e0e2 jsr 4e0e2 <_RBTree_Insert> <== NOT EXECUTED _Scheduler_EDF_Schedule(); 49464: 4eb9 0004 9364 jsr 49364 <_Scheduler_EDF_Schedule> <== NOT EXECUTED if ( _Thread_Executing != _Thread_Heir ) { 4946a: 2079 0006 2d32 moveal 62d32 <_Per_CPU_Information+0xc>,%a0 <== NOT EXECUTED 49470: 4fef 0010 lea %sp@(16),%sp <== NOT EXECUTED 49474: b1f9 0006 2d36 cmpal 62d36 <_Per_CPU_Information+0x10>,%a0 <== NOT EXECUTED 4947a: 6798 beqs 49414 <_Scheduler_EDF_Update+0x20> <== NOT EXECUTED if ( _Thread_Executing->is_preemptible || 4947c: 4a28 0074 tstb %a0@(116) <== NOT EXECUTED 49480: 6606 bnes 49488 <_Scheduler_EDF_Update+0x94> <== NOT EXECUTED 49482: 4aaa 0014 tstl %a2@(20) <== NOT EXECUTED 49486: 668c bnes 49414 <_Scheduler_EDF_Update+0x20> <== NOT EXECUTED the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; } } } 49488: 242e fff8 movel %fp@(-8),%d2 <== NOT EXECUTED _Scheduler_EDF_Schedule(); if ( _Thread_Executing != _Thread_Heir ) { if ( _Thread_Executing->is_preemptible || the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 4948c: 7001 moveq #1,%d0 <== NOT EXECUTED } } } 4948e: 246e fffc moveal %fp@(-4),%a2 <== NOT EXECUTED 49492: 4e5e unlk %fp <== NOT EXECUTED _Scheduler_EDF_Schedule(); if ( _Thread_Executing != _Thread_Heir ) { if ( _Thread_Executing->is_preemptible || the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 49494: 13c0 0006 2d3e moveb %d0,62d3e <_Per_CPU_Information+0x18> <== NOT EXECUTED } } } =============================================================================== 0004949c <_Scheduler_EDF_Yield>: Thread_Control *executing = _Thread_Executing; Scheduler_EDF_Per_thread *executing_info = (Scheduler_EDF_Per_thread *) executing->scheduler_info; RBTree_Node *executing_node = &(executing_info->Node); _ISR_Disable( level ); 4949c: 203c 0000 0700 movel #1792,%d0 <== NOT EXECUTED #include #include #include void _Scheduler_EDF_Yield(void) { 494a2: 4e56 fff4 linkw %fp,#-12 <== NOT EXECUTED 494a6: 48d7 040c moveml %d2-%d3/%a2,%sp@ <== NOT EXECUTED Scheduler_EDF_Per_thread *first_info; RBTree_Node *first_node; ISR_Level level; Thread_Control *executing = _Thread_Executing; 494aa: 2479 0006 2d32 moveal 62d32 <_Per_CPU_Information+0xc>,%a2 <== NOT EXECUTED Scheduler_EDF_Per_thread *executing_info = 494b0: 262a 008a movel %a2@(138),%d3 <== NOT EXECUTED (Scheduler_EDF_Per_thread *) executing->scheduler_info; RBTree_Node *executing_node = &(executing_info->Node); _ISR_Disable( level ); 494b4: 40c2 movew %sr,%d2 <== NOT EXECUTED 494b6: 8082 orl %d2,%d0 <== NOT EXECUTED 494b8: 46c0 movew %d0,%sr <== NOT EXECUTED RTEMS_INLINE_ROUTINE bool _RBTree_Has_only_one_node( const RBTree_Control *the_rbtree ) { if(!the_rbtree) return NULL; /* TODO: expected behavior? */ return (the_rbtree->root->child[RBT_LEFT] == NULL && the_rbtree->root->child[RBT_RIGHT] == NULL); 494ba: 2079 0006 2d4c moveal 62d4c <_Scheduler_EDF_Ready_queue+0x4>,%a0<== NOT EXECUTED 494c0: 4aa8 0004 tstl %a0@(4) <== NOT EXECUTED 494c4: 674a beqs 49510 <_Scheduler_EDF_Yield+0x74> <== NOT EXECUTED ISR_Level level; Thread_Control *executing = _Thread_Executing; Scheduler_EDF_Per_thread *executing_info = (Scheduler_EDF_Per_thread *) executing->scheduler_info; RBTree_Node *executing_node = &(executing_info->Node); 494c6: 5883 addql #4,%d3 <== NOT EXECUTED if ( !_RBTree_Has_only_one_node(&_Scheduler_EDF_Ready_queue) ) { /* * The RBTree has more than one node, enqueue behind the tasks * with the same priority in case there are such ones. */ _RBTree_Extract( &_Scheduler_EDF_Ready_queue, executing_node ); 494c8: 2f03 movel %d3,%sp@- <== NOT EXECUTED 494ca: 4879 0006 2d48 pea 62d48 <_Scheduler_EDF_Ready_queue> <== NOT EXECUTED 494d0: 4eb9 0004 deb8 jsr 4deb8 <_RBTree_Extract> <== NOT EXECUTED _RBTree_Insert( &_Scheduler_EDF_Ready_queue, executing_node ); 494d6: 2f03 movel %d3,%sp@- <== NOT EXECUTED 494d8: 4879 0006 2d48 pea 62d48 <_Scheduler_EDF_Ready_queue> <== NOT EXECUTED 494de: 4eb9 0004 e0e2 jsr 4e0e2 <_RBTree_Insert> <== NOT EXECUTED _ISR_Flash( level ); 494e4: 203c 0000 0700 movel #1792,%d0 <== NOT EXECUTED 494ea: 46c2 movew %d2,%sr <== NOT EXECUTED 494ec: 8082 orl %d2,%d0 <== NOT EXECUTED 494ee: 46c0 movew %d0,%sr <== NOT EXECUTED if ( _Thread_Is_heir( executing ) ) { 494f0: 4fef 0010 lea %sp@(16),%sp <== NOT EXECUTED 494f4: b5f9 0006 2d36 cmpal 62d36 <_Per_CPU_Information+0x10>,%a2 <== NOT EXECUTED 494fa: 672c beqs 49528 <_Scheduler_EDF_Yield+0x8c> <== NOT EXECUTED _Thread_Heir = first_info->thread; } _Thread_Dispatch_necessary = true; } else if ( !_Thread_Is_heir( executing ) ) _Thread_Dispatch_necessary = true; 494fc: 7001 moveq #1,%d0 <== NOT EXECUTED 494fe: 13c0 0006 2d3e moveb %d0,62d3e <_Per_CPU_Information+0x18> <== NOT EXECUTED _ISR_Enable( level ); 49504: 46c2 movew %d2,%sr <== NOT EXECUTED } 49506: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 <== NOT EXECUTED 4950c: 4e5e unlk %fp <== NOT EXECUTED 4950e: 4e75 rts <== NOT EXECUTED 49510: 4aa8 0008 tstl %a0@(8) <== NOT EXECUTED 49514: 66b0 bnes 494c6 <_Scheduler_EDF_Yield+0x2a> <== NOT EXECUTED _RBTree_Container_of(first_node, Scheduler_EDF_Per_thread, Node); _Thread_Heir = first_info->thread; } _Thread_Dispatch_necessary = true; } else if ( !_Thread_Is_heir( executing ) ) 49516: b5f9 0006 2d36 cmpal 62d36 <_Per_CPU_Information+0x10>,%a2 <== NOT EXECUTED 4951c: 67e6 beqs 49504 <_Scheduler_EDF_Yield+0x68> <== NOT EXECUTED _Thread_Dispatch_necessary = true; 4951e: 7001 moveq #1,%d0 <== NOT EXECUTED 49520: 13c0 0006 2d3e moveb %d0,62d3e <_Per_CPU_Information+0x18> <== NOT EXECUTED 49526: 60dc bras 49504 <_Scheduler_EDF_Yield+0x68> <== NOT EXECUTED _RBTree_Insert( &_Scheduler_EDF_Ready_queue, executing_node ); _ISR_Flash( level ); if ( _Thread_Is_heir( executing ) ) { first_node = _RBTree_Peek( &_Scheduler_EDF_Ready_queue, RBT_LEFT ); 49528: 42a7 clrl %sp@- <== NOT EXECUTED 4952a: 4879 0006 2d48 pea 62d48 <_Scheduler_EDF_Ready_queue> <== NOT EXECUTED 49530: 4eb9 0004 e110 jsr 4e110 <_RBTree_Peek> <== NOT EXECUTED first_info = _RBTree_Container_of(first_node, Scheduler_EDF_Per_thread, Node); _Thread_Heir = first_info->thread; 49536: 508f addql #8,%sp <== NOT EXECUTED 49538: 2040 moveal %d0,%a0 <== NOT EXECUTED 4953a: 5988 subql #4,%a0 <== NOT EXECUTED 4953c: 23d0 0006 2d36 movel %a0@,62d36 <_Per_CPU_Information+0x10><== NOT EXECUTED } _Thread_Dispatch_necessary = true; } else if ( !_Thread_Is_heir( executing ) ) _Thread_Dispatch_necessary = true; 49542: 7001 moveq #1,%d0 <== NOT EXECUTED 49544: 13c0 0006 2d3e moveb %d0,62d3e <_Per_CPU_Information+0x18> <== NOT EXECUTED 4954a: 60b8 bras 49504 <_Scheduler_EDF_Yield+0x68> <== NOT EXECUTED =============================================================================== 000487d4 <_Scheduler_Handler_initialization>: #include #include #include void _Scheduler_Handler_initialization(void) { 487d4: 4e56 0000 linkw %fp,#0 (*_Scheduler.Operations.initialize)(); } 487d8: 4e5e unlk %fp #include #include void _Scheduler_Handler_initialization(void) { (*_Scheduler.Operations.initialize)(); 487da: 2279 0005 f752 moveal 5f752 <_Scheduler+0x4>,%a1 487e0: 4ed1 jmp %a1@ ... =============================================================================== 00048800 <_Scheduler_priority_Block>: #include void _Scheduler_priority_Block( Thread_Control *the_thread ) { 48800: 4e56 0000 linkw %fp,#0 48804: 206e 0008 moveal %fp@(8),%a0 48808: 2f0b movel %a3,%sp@- 4880a: 2f0a movel %a2,%sp@- ) { Scheduler_priority_Per_thread *sched_info; Chain_Control *ready; sched_info = (Scheduler_priority_Per_thread *) the_thread->scheduler_info; 4880c: 2468 008a moveal %a0@(138),%a2 ready = sched_info->ready_chain; 48810: 2252 moveal %a2@,%a1 if ( _Chain_Has_only_one_node( ready ) ) { 48812: 2029 0008 movel %a1@(8),%d0 48816: b091 cmpl %a1@,%d0 48818: 6700 0088 beqw 488a2 <_Scheduler_priority_Block+0xa2> ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 4881c: 2450 moveal %a0@,%a2 previous = the_node->previous; 4881e: 2268 0004 moveal %a0@(4),%a1 next->previous = previous; 48822: 2549 0004 movel %a1,%a2@(4) previous->next = next; 48826: 228a movel %a2,%a1@ _Scheduler_priority_Ready_queue_extract( the_thread ); /* TODO: flash critical section? */ if ( _Thread_Is_heir( the_thread ) ) 48828: b1f9 0006 14ae cmpal 614ae <_Per_CPU_Information+0x10>,%a0 4882e: 6720 beqs 48850 <_Scheduler_priority_Block+0x50> _Scheduler_priority_Schedule_body(); if ( _Thread_Is_executing( the_thread ) ) 48830: b1f9 0006 14aa cmpal 614aa <_Per_CPU_Information+0xc>,%a0 48836: 6708 beqs 48840 <_Scheduler_priority_Block+0x40> _Thread_Dispatch_necessary = true; } 48838: 245f moveal %sp@+,%a2 4883a: 265f moveal %sp@+,%a3 4883c: 4e5e unlk %fp 4883e: 4e75 rts 48840: 245f moveal %sp@+,%a2 if ( _Thread_Is_heir( the_thread ) ) _Scheduler_priority_Schedule_body(); if ( _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; 48842: 7001 moveq #1,%d0 } 48844: 265f moveal %sp@+,%a3 48846: 4e5e unlk %fp if ( _Thread_Is_heir( the_thread ) ) _Scheduler_priority_Schedule_body(); if ( _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; 48848: 13c0 0006 14b6 moveb %d0,614b6 <_Per_CPU_Information+0x18> } 4884e: 4e75 rts RTEMS_INLINE_ROUTINE Priority_Control _Priority_bit_map_Get_highest( void ) { Priority_bit_map_Control minor; Priority_bit_map_Control major; _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); 48850: 3039 0006 14c0 movew 614c0 <_Priority_Major_bit_map>,%d0 48856: 4840 swap %d0 48858: 04c0 ff1 %d0 _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 4885a: 43f9 0006 14c4 lea 614c4 <_Priority_Bit_map>,%a1 48860: 0280 0000 ffff andil #65535,%d0 48866: 3231 0a00 movew %a1@(00000000,%d0:l:2),%d1 4886a: 4841 swap %d1 4886c: 04c1 ff1 %d1 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 4886e: 2279 0005 f74e moveal 5f74e <_Scheduler>,%a1 return (_Priority_Bits_index( major ) << 4) + 48874: 0281 0000 ffff andil #65535,%d1 4887a: e988 lsll #4,%d0 4887c: d081 addl %d1,%d0 Chain_Control *the_ready_queue ) { Priority_Control index = _Priority_bit_map_Get_highest(); if ( !_Chain_Is_empty( &the_ready_queue[ index ] ) ) 4887e: 2200 movel %d0,%d1 48880: e988 lsll #4,%d0 48882: e589 lsll #2,%d1 48884: 9081 subl %d1,%d0 48886: d3c0 addal %d0,%a1 48888: 2019 movel %a1@+,%d0 return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] ); return NULL; 4888a: b3c0 cmpal %d0,%a1 4888c: 56c1 sne %d1 4888e: 49c1 extbl %d1 * * @param[in] the_thread - pointer to thread */ RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void) { _Thread_Heir = _Scheduler_priority_Ready_queue_first( 48890: c081 andl %d1,%d0 48892: 23c0 0006 14ae movel %d0,614ae <_Per_CPU_Information+0x10> /* TODO: flash critical section? */ if ( _Thread_Is_heir( the_thread ) ) _Scheduler_priority_Schedule_body(); if ( _Thread_Is_executing( the_thread ) ) 48898: b1f9 0006 14aa cmpal 614aa <_Per_CPU_Information+0xc>,%a0 4889e: 6698 bnes 48838 <_Scheduler_priority_Block+0x38> 488a0: 609e bras 48840 <_Scheduler_priority_Block+0x40> RTEMS_INLINE_ROUTINE void _Priority_bit_map_Remove ( Priority_bit_map_Information *the_priority_map ) { *the_priority_map->minor &= the_priority_map->block_minor; 488a2: 266a 0004 moveal %a2@(4),%a3 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 488a6: 2009 movel %a1,%d0 488a8: 5880 addql #4,%d0 488aa: 2280 movel %d0,%a1@ 488ac: 3213 movew %a3@,%d1 488ae: 302a 000e movew %a2@(14),%d0 head->next = tail; head->previous = NULL; 488b2: 42a9 0004 clrl %a1@(4) 488b6: c081 andl %d1,%d0 tail->previous = head; 488b8: 2349 0008 movel %a1,%a1@(8) 488bc: 3680 movew %d0,%a3@ if ( *the_priority_map->minor == 0 ) 488be: 6600 ff68 bnew 48828 <_Scheduler_priority_Block+0x28> _Priority_Major_bit_map &= the_priority_map->block_major; 488c2: 3239 0006 14c0 movew 614c0 <_Priority_Major_bit_map>,%d1 488c8: 302a 000c movew %a2@(12),%d0 488cc: c081 andl %d1,%d0 488ce: 33c0 0006 14c0 movew %d0,614c0 <_Priority_Major_bit_map> { _Scheduler_priority_Ready_queue_extract( the_thread ); /* TODO: flash critical section? */ if ( _Thread_Is_heir( the_thread ) ) 488d4: b1f9 0006 14ae cmpal 614ae <_Per_CPU_Information+0x10>,%a0 488da: 6600 ff54 bnew 48830 <_Scheduler_priority_Block+0x30> 488de: 6000 ff70 braw 48850 <_Scheduler_priority_Block+0x50> ... =============================================================================== 000489d8 <_Scheduler_priority_Free>: #include void _Scheduler_priority_Free ( Thread_Control *the_thread ) { 489d8: 4e56 0000 linkw %fp,#0 489dc: 206e 0008 moveal %fp@(8),%a0 _Workspace_Free( the_thread->scheduler_info ); 489e0: 2d68 008a 0008 movel %a0@(138),%fp@(8) } 489e6: 4e5e unlk %fp void _Scheduler_priority_Free ( Thread_Control *the_thread ) { _Workspace_Free( the_thread->scheduler_info ); 489e8: 4ef9 0004 a2fe jmp 4a2fe <_Workspace_Free> ... =============================================================================== 00048ad4 <_Scheduler_priority_Tick>: #include #include void _Scheduler_priority_Tick( void ) { 48ad4: 4e56 0000 linkw %fp,#0 48ad8: 2f0a movel %a2,%sp@- Thread_Control *executing; executing = _Thread_Executing; 48ada: 2479 0006 14aa moveal 614aa <_Per_CPU_Information+0xc>,%a2 /* * If the thread is not preemptible or is not ready, then * just return. */ if ( !executing->is_preemptible ) 48ae0: 4a2a 0074 tstb %a2@(116) 48ae4: 6720 beqs 48b06 <_Scheduler_priority_Tick+0x32> return; if ( !_States_Is_ready( executing->current_state ) ) 48ae6: 4aaa 0010 tstl %a2@(16) 48aea: 661a bnes 48b06 <_Scheduler_priority_Tick+0x32> /* * The cpu budget algorithm determines what happens next. */ switch ( executing->budget_algorithm ) { 48aec: 202a 007a movel %a2@(122),%d0 48af0: 7201 moveq #1,%d1 48af2: b280 cmpl %d0,%d1 48af4: 6210 bhis 48b06 <_Scheduler_priority_Tick+0x32> 48af6: 123c 0002 moveb #2,%d1 48afa: b280 cmpl %d0,%d1 48afc: 642e bccs 48b2c <_Scheduler_priority_Tick+0x58> 48afe: 123c 0003 moveb #3,%d1 48b02: b280 cmpl %d0,%d1 48b04: 6708 beqs 48b0e <_Scheduler_priority_Tick+0x3a> <== ALWAYS TAKEN if ( --executing->cpu_time_budget == 0 ) (*executing->budget_callout)( executing ); break; #endif } } 48b06: 246e fffc moveal %fp@(-4),%a2 48b0a: 4e5e unlk %fp 48b0c: 4e75 rts } break; #if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT) case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: if ( --executing->cpu_time_budget == 0 ) 48b0e: 202a 0076 movel %a2@(118),%d0 48b12: 5380 subql #1,%d0 48b14: 2540 0076 movel %d0,%a2@(118) 48b18: 66ec bnes 48b06 <_Scheduler_priority_Tick+0x32> (*executing->budget_callout)( executing ); 48b1a: 2f0a movel %a2,%sp@- 48b1c: 206a 007e moveal %a2@(126),%a0 48b20: 4e90 jsr %a0@ break; #endif } } 48b22: 246e fffc moveal %fp@(-4),%a2 break; #if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT) case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: if ( --executing->cpu_time_budget == 0 ) (*executing->budget_callout)( executing ); 48b26: 588f addql #4,%sp break; #endif } } 48b28: 4e5e unlk %fp 48b2a: 4e75 rts 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 ) { 48b2c: 202a 0076 movel %a2@(118),%d0 48b30: 5380 subql #1,%d0 48b32: 2540 0076 movel %d0,%a2@(118) 48b36: 6ece bgts 48b06 <_Scheduler_priority_Tick+0x32> * always operates on the scheduler that 'owns' the currently executing * thread. */ RTEMS_INLINE_ROUTINE void _Scheduler_Yield( void ) { _Scheduler.Operations.yield(); 48b38: 2079 0005 f75a moveal 5f75a <_Scheduler+0xc>,%a0 48b3e: 4e90 jsr %a0@ * executing thread's timeslice is reset. Otherwise, the * currently executing thread is placed at the rear of the * FIFO for this priority and a new heir is selected. */ _Scheduler_Yield(); executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 48b40: 41f9 0006 1000 lea 61000 <_Thread_Ticks_per_timeslice>,%a0 48b46: 2550 0076 movel %a0@,%a2@(118) if ( --executing->cpu_time_budget == 0 ) (*executing->budget_callout)( executing ); break; #endif } } 48b4a: 246e fffc moveal %fp@(-4),%a2 48b4e: 4e5e unlk %fp ... =============================================================================== 000491d0 <_Scheduler_simple_Block>: #include void _Scheduler_simple_Block( Thread_Control *the_thread ) { 491d0: 4e56 0000 linkw %fp,#0 491d4: 2f02 movel %d2,%sp@- 491d6: 242e 0008 movel %fp@(8),%d2 _Scheduler_simple_Extract(the_thread); 491da: 2f02 movel %d2,%sp@- 491dc: 4eb9 0004 9234 jsr 49234 <_Scheduler_simple_Extract> if ( _Thread_Is_heir( the_thread ) ) 491e2: 588f addql #4,%sp 491e4: b4b9 0006 23f6 cmpl 623f6 <_Per_CPU_Information+0x10>,%d2 491ea: 6720 beqs 4920c <_Scheduler_simple_Block+0x3c> _Scheduler_simple_Schedule(); if ( _Thread_Is_executing( the_thread ) ) 491ec: b4b9 0006 23f2 cmpl 623f2 <_Per_CPU_Information+0xc>,%d2 491f2: 6708 beqs 491fc <_Scheduler_simple_Block+0x2c> <== NEVER TAKEN _Thread_Dispatch_necessary = true; } 491f4: 242e fffc movel %fp@(-4),%d2 491f8: 4e5e unlk %fp 491fa: 4e75 rts 491fc: 242e fffc movel %fp@(-4),%d2 49200: 4e5e unlk %fp if ( _Thread_Is_heir( the_thread ) ) _Scheduler_simple_Schedule(); if ( _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; 49202: 7001 moveq #1,%d0 49204: 13c0 0006 23fe moveb %d0,623fe <_Per_CPU_Information+0x18> } 4920a: 4e75 rts ) { _Scheduler_simple_Extract(the_thread); if ( _Thread_Is_heir( the_thread ) ) _Scheduler_simple_Schedule(); 4920c: 4eb9 0004 9348 jsr 49348 <_Scheduler_simple_Schedule> if ( _Thread_Is_executing( the_thread ) ) 49212: b4b9 0006 23f2 cmpl 623f2 <_Per_CPU_Information+0xc>,%d2 49218: 66da bnes 491f4 <_Scheduler_simple_Block+0x24> <== NEVER TAKEN 4921a: 60e0 bras 491fc <_Scheduler_simple_Block+0x2c> =============================================================================== 00047750 <_TOD_Validate>: */ bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 47750: 4e56 0000 linkw %fp,#0 47754: 206e 0008 moveal %fp@(8),%a0 uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); 47758: 2039 0006 1a98 movel 61a98 ,%d0 */ bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 4775e: 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) || 47760: 4a88 tstl %a0 47762: 6762 beqs 477c6 <_TOD_Validate+0x76> <== NEVER TAKEN ) { uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / 47764: 243c 000f 4240 movel #1000000,%d2 4776a: 4c40 2002 remul %d0,%d2,%d2 rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 4776e: b4a8 0018 cmpl %a0@(24),%d2 47772: 6352 blss 477c6 <_TOD_Validate+0x76> (the_tod->ticks >= ticks_per_second) || 47774: 703b moveq #59,%d0 47776: b0a8 0014 cmpl %a0@(20),%d0 4777a: 654a bcss 477c6 <_TOD_Validate+0x76> (the_tod->second >= TOD_SECONDS_PER_MINUTE) || 4777c: b0a8 0010 cmpl %a0@(16),%d0 47780: 6544 bcss 477c6 <_TOD_Validate+0x76> (the_tod->minute >= TOD_MINUTES_PER_HOUR) || 47782: 7217 moveq #23,%d1 47784: b2a8 000c cmpl %a0@(12),%d1 47788: 653c bcss 477c6 <_TOD_Validate+0x76> (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || 4778a: 2028 0004 movel %a0@(4),%d0 rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || (the_tod->ticks >= ticks_per_second) || (the_tod->second >= TOD_SECONDS_PER_MINUTE) || (the_tod->minute >= TOD_MINUTES_PER_HOUR) || (the_tod->hour >= TOD_HOURS_PER_DAY) || 4778e: 6736 beqs 477c6 <_TOD_Validate+0x76> <== NEVER TAKEN (the_tod->month == 0) || 47790: 740c moveq #12,%d2 47792: b480 cmpl %d0,%d2 47794: 6530 bcss 477c6 <_TOD_Validate+0x76> (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || 47796: 2210 movel %a0@,%d1 (the_tod->ticks >= ticks_per_second) || (the_tod->second >= TOD_SECONDS_PER_MINUTE) || (the_tod->minute >= TOD_MINUTES_PER_HOUR) || (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || 47798: 0c81 0000 07c3 cmpil #1987,%d1 4779e: 6326 blss 477c6 <_TOD_Validate+0x76> (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) 477a0: 2068 0008 moveal %a0@(8),%a0 (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) || 477a4: 4a88 tstl %a0 477a6: 671e beqs 477c6 <_TOD_Validate+0x76> <== NEVER TAKEN (the_tod->day == 0) ) return false; if ( (the_tod->year % 4) == 0 ) 477a8: 143c 0003 moveb #3,%d2 days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; 477ac: 43f9 0006 0b18 lea 60b18 <_TOD_Days_per_month>,%a1 (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 ) 477b2: c282 andl %d2,%d1 477b4: 6618 bnes 477ce <_TOD_Validate+0x7e> days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; 477b6: 2031 0c34 movel %a1@(00000034,%d0:l:4),%d0 * false - if the the_tod is invalid * * NOTE: This routine only works for leap-years through 2099. */ bool _TOD_Validate( 477ba: b1c0 cmpal %d0,%a0 477bc: 53c0 sls %d0 477be: 4480 negl %d0 if ( the_tod->day > days_in_month ) return false; return true; } 477c0: 241f movel %sp@+,%d2 477c2: 4e5e unlk %fp 477c4: 4e75 rts 477c6: 241f movel %sp@+,%d2 477c8: 4e5e unlk %fp (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) return false; 477ca: 4200 clrb %d0 if ( the_tod->day > days_in_month ) return false; return true; } 477cc: 4e75 rts return false; if ( (the_tod->year % 4) == 0 ) days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; 477ce: 2031 0c00 movel %a1@(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( 477d2: b1c0 cmpal %d0,%a0 477d4: 53c0 sls %d0 477d6: 4480 negl %d0 477d8: 60e6 bras 477c0 <_TOD_Validate+0x70> ... =============================================================================== 00048d38 <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 48d38: 4e56 fff0 linkw %fp,#-16 48d3c: 48d7 041c moveml %d2-%d4/%a2,%sp@ 48d40: 246e 0008 moveal %fp@(8),%a2 States_Control state, original_state; /* * Save original state */ original_state = the_thread->current_state; 48d44: 262a 0010 movel %a2@(16),%d3 void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 48d48: 242e 000c movel %fp@(12),%d2 /* * 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 ); 48d4c: 2f0a movel %a2,%sp@- void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 48d4e: 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 ); 48d52: 4eb9 0004 9b3c jsr 49b3c <_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 ) 48d58: 588f addql #4,%sp 48d5a: b4aa 0014 cmpl %a2@(20),%d2 48d5e: 670c beqs 48d6c <_Thread_Change_priority+0x34> _Thread_Set_priority( the_thread, new_priority ); 48d60: 2f02 movel %d2,%sp@- 48d62: 2f0a movel %a2,%sp@- 48d64: 4eb9 0004 9ad8 jsr 49ad8 <_Thread_Set_priority> 48d6a: 508f addql #8,%sp _ISR_Disable( level ); 48d6c: 203c 0000 0700 movel #1792,%d0 48d72: 40c2 movew %sr,%d2 48d74: 8082 orl %d2,%d0 48d76: 46c0 movew %d0,%sr /* * 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; 48d78: 202a 0010 movel %a2@(16),%d0 if ( state != STATES_TRANSIENT ) { 48d7c: 7204 moveq #4,%d1 48d7e: b280 cmpl %d0,%d1 48d80: 6738 beqs 48dba <_Thread_Change_priority+0x82> /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) 48d82: 44c3 movew %d3,%ccr 48d84: 6708 beqs 48d8e <_Thread_Change_priority+0x56> <== NEVER TAKEN RTEMS_INLINE_ROUTINE States_Control _States_Clear ( States_Control states_to_clear, States_Control current_state ) { return (current_state & ~states_to_clear); 48d86: 72fb moveq #-5,%d1 48d88: c280 andl %d0,%d1 48d8a: 2541 0010 movel %d1,%a2@(16) the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); _ISR_Enable( level ); 48d8e: 46c2 movew %d2,%sr */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue ( States_Control the_states ) { return (the_states & STATES_WAITING_ON_THREAD_QUEUE); 48d90: 0280 0003 bee0 andil #245472,%d0 if ( _States_Is_waiting_on_thread_queue( state ) ) { 48d96: 660a bnes 48da2 <_Thread_Change_priority+0x6a> if ( !_Thread_Is_executing_also_the_heir() && _Thread_Executing->is_preemptible ) _Thread_Dispatch_necessary = true; _ISR_Enable( level ); } 48d98: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 48d9e: 4e5e unlk %fp 48da0: 4e75 rts /* 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 ); 48da2: 2d4a 000c movel %a2,%fp@(12) 48da6: 2d6a 0044 0008 movel %a2@(68),%fp@(8) if ( !_Thread_Is_executing_also_the_heir() && _Thread_Executing->is_preemptible ) _Thread_Dispatch_necessary = true; _ISR_Enable( level ); } 48dac: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 48db2: 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 ); 48db4: 4ef9 0004 9a28 jmp 49a28 <_Thread_queue_Requeue> } return; } /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) { 48dba: 44c3 movew %d3,%ccr 48dbc: 6714 beqs 48dd2 <_Thread_Change_priority+0x9a> <== NEVER TAKEN * 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 ); 48dbe: 42aa 0010 clrl %a2@(16) if ( prepend_it ) 48dc2: 4a04 tstb %d4 48dc4: 6748 beqs 48e0e <_Thread_Change_priority+0xd6> */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue_first( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue_first( the_thread ); 48dc6: 2f0a movel %a2,%sp@- 48dc8: 2079 0005 f776 moveal 5f776 <_Scheduler+0x28>,%a0 48dce: 4e90 jsr %a0@ 48dd0: 588f addql #4,%sp _Scheduler_Enqueue_first( the_thread ); else _Scheduler_Enqueue( the_thread ); } _ISR_Flash( level ); 48dd2: 203c 0000 0700 movel #1792,%d0 48dd8: 46c2 movew %d2,%sr 48dda: 8082 orl %d2,%d0 48ddc: 46c0 movew %d0,%sr * This kernel routine implements the scheduling decision logic for * the scheduler. It does NOT dispatch. */ RTEMS_INLINE_ROUTINE void _Scheduler_Schedule( void ) { _Scheduler.Operations.schedule(); 48dde: 2079 0005 f756 moveal 5f756 <_Scheduler+0x8>,%a0 48de4: 4e90 jsr %a0@ * is also the heir thread, and false otherwise. */ RTEMS_INLINE_ROUTINE bool _Thread_Is_executing_also_the_heir( void ) { return ( _Thread_Executing == _Thread_Heir ); 48de6: 2079 0006 14aa moveal 614aa <_Per_CPU_Information+0xc>,%a0 * We altered the set of thread priorities. So let's figure out * who is the heir and if we need to switch to them. */ _Scheduler_Schedule(); if ( !_Thread_Is_executing_also_the_heir() && 48dec: b1f9 0006 14ae cmpal 614ae <_Per_CPU_Information+0x10>,%a0 48df2: 670e beqs 48e02 <_Thread_Change_priority+0xca> 48df4: 4a28 0074 tstb %a0@(116) 48df8: 6708 beqs 48e02 <_Thread_Change_priority+0xca> _Thread_Executing->is_preemptible ) _Thread_Dispatch_necessary = true; 48dfa: 7001 moveq #1,%d0 48dfc: 13c0 0006 14b6 moveb %d0,614b6 <_Per_CPU_Information+0x18> _ISR_Enable( level ); 48e02: 46c2 movew %d2,%sr } 48e04: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 48e0a: 4e5e unlk %fp 48e0c: 4e75 rts */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue( the_thread ); 48e0e: 2f0a movel %a2,%sp@- 48e10: 2079 0005 f772 moveal 5f772 <_Scheduler+0x24>,%a0 48e16: 4e90 jsr %a0@ 48e18: 588f addql #4,%sp 48e1a: 60b6 bras 48dd2 <_Thread_Change_priority+0x9a> =============================================================================== 00048e78 <_Thread_Close>: #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 48e78: 4280 clrl %d0 void _Thread_Close( Objects_Information *information, Thread_Control *the_thread ) { 48e7a: 4e56 0000 linkw %fp,#0 48e7e: 2f0b movel %a3,%sp@- 48e80: 266e 0008 moveal %fp@(8),%a3 48e84: 2f0a movel %a2,%sp@- 48e86: 246e 000c moveal %fp@(12),%a2 48e8a: 206b 0018 moveal %a3@(24),%a0 48e8e: 302a 000a movew %a2@(10),%d0 48e92: 42b0 0c00 clrl %a0@(00000000,%d0:l:4) * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { _Thread_Dispatch_disable_level--; 48e96: 2039 0006 1048 movel 61048 <_Thread_Dispatch_disable_level>,%d0 48e9c: 5380 subql #1,%d0 48e9e: 23c0 0006 1048 movel %d0,61048 <_Thread_Dispatch_disable_level> return _Thread_Dispatch_disable_level; 48ea4: 2039 0006 1048 movel 61048 <_Thread_Dispatch_disable_level>,%d0 * disappear and set a transient state on it. So we temporarily * unnest dispatching. */ _Thread_Unnest_dispatch(); _User_extensions_Thread_delete( the_thread ); 48eaa: 2f0a movel %a2,%sp@- 48eac: 4eb9 0004 9f4c jsr 49f4c <_User_extensions_Thread_delete> * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 48eb2: 2039 0006 1048 movel 61048 <_Thread_Dispatch_disable_level>,%d0 48eb8: 5280 addql #1,%d0 48eba: 23c0 0006 1048 movel %d0,61048 <_Thread_Dispatch_disable_level> return _Thread_Dispatch_disable_level; 48ec0: 2039 0006 1048 movel 61048 <_Thread_Dispatch_disable_level>,%d0 /* * Now we are in a dispatching critical section again and we * can take the thread OUT of the published set. It is invalid * to use this thread's Id OR name after this call. */ _Objects_Close( information, &the_thread->Object ); 48ec6: 2f0a movel %a2,%sp@- 48ec8: 2f0b movel %a3,%sp@- 48eca: 4eb9 0004 801c jsr 4801c <_Objects_Close> /* * By setting the dormant state, the thread will not be considered * for scheduling when we remove any blocking states. */ _Thread_Set_state( the_thread, STATES_DORMANT ); 48ed0: 4878 0001 pea 1 48ed4: 2f0a movel %a2,%sp@- 48ed6: 4eb9 0004 9af0 jsr 49af0 <_Thread_Set_state> if ( !_Thread_queue_Extract_with_proxy( the_thread ) ) { 48edc: 2f0a movel %a2,%sp@- 48ede: 4eb9 0004 9934 jsr 49934 <_Thread_queue_Extract_with_proxy> 48ee4: 4fef 0018 lea %sp@(24),%sp 48ee8: 4a00 tstb %d0 48eea: 660a bnes 48ef6 <_Thread_Close+0x7e> if ( _Watchdog_Is_active( &the_thread->Timer ) ) 48eec: 7002 moveq #2,%d0 48eee: b0aa 0050 cmpl %a2@(80),%d0 48ef2: 6700 0088 beqw 48f7c <_Thread_Close+0x104> */ RTEMS_INLINE_ROUTINE void _Scheduler_Free( Thread_Control *the_thread ) { return _Scheduler.Operations.free( the_thread ); 48ef6: 2f0a movel %a2,%sp@- 48ef8: 2079 0005 f76a moveal 5f76a <_Scheduler+0x1c>,%a0 48efe: 4e90 jsr %a0@ /* * The thread might have been FP. So deal with that. */ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( _Thread_Is_allocated_fp( the_thread ) ) 48f00: 588f addql #4,%sp 48f02: b5f9 0006 10ca cmpal 610ca <_Thread_Allocated_fp>,%a2 48f08: 6736 beqs 48f40 <_Thread_Close+0xc8> _Thread_Deallocate_fp(); #endif the_thread->fp_context = NULL; _Workspace_Free( the_thread->Start.fp_context ); 48f0a: 2f2a 00ba movel %a2@(186),%sp@- 48f0e: 47f9 0004 a2fe lea 4a2fe <_Workspace_Free>,%a3 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( _Thread_Is_allocated_fp( the_thread ) ) _Thread_Deallocate_fp(); #endif the_thread->fp_context = NULL; 48f14: 42aa 00f6 clrl %a2@(246) _Workspace_Free( the_thread->Start.fp_context ); 48f18: 4e93 jsr %a3@ /* * Free the rest of the memory associated with this task * and set the associated pointers to NULL for safety. */ _Thread_Stack_Free( the_thread ); 48f1a: 2f0a movel %a2,%sp@- 48f1c: 4eb9 0004 9be8 jsr 49be8 <_Thread_Stack_Free> the_thread->Start.stack = NULL; _Workspace_Free( the_thread->extensions ); 48f22: 2f2a 0106 movel %a2@(262),%sp@- /* * Free the rest of the memory associated with this task * and set the associated pointers to NULL for safety. */ _Thread_Stack_Free( the_thread ); the_thread->Start.stack = NULL; 48f26: 42aa 00be clrl %a2@(190) _Workspace_Free( the_thread->extensions ); 48f2a: 4e93 jsr %a3@ the_thread->extensions = NULL; } 48f2c: 266e fffc moveal %fp@(-4),%a3 */ _Thread_Stack_Free( the_thread ); the_thread->Start.stack = NULL; _Workspace_Free( the_thread->extensions ); the_thread->extensions = NULL; 48f30: 4fef 000c lea %sp@(12),%sp 48f34: 42aa 0106 clrl %a2@(262) } 48f38: 246e fff8 moveal %fp@(-8),%a2 48f3c: 4e5e unlk %fp 48f3e: 4e75 rts if ( _Thread_Is_allocated_fp( the_thread ) ) _Thread_Deallocate_fp(); #endif the_thread->fp_context = NULL; _Workspace_Free( the_thread->Start.fp_context ); 48f40: 2f2a 00ba movel %a2@(186),%sp@- 48f44: 47f9 0004 a2fe lea 4a2fe <_Workspace_Free>,%a3 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( _Thread_Is_allocated_fp( the_thread ) ) _Thread_Deallocate_fp(); #endif the_thread->fp_context = NULL; 48f4a: 42aa 00f6 clrl %a2@(246) */ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) RTEMS_INLINE_ROUTINE void _Thread_Deallocate_fp( void ) { _Thread_Allocated_fp = NULL; 48f4e: 42b9 0006 10ca clrl 610ca <_Thread_Allocated_fp> _Workspace_Free( the_thread->Start.fp_context ); 48f54: 4e93 jsr %a3@ /* * Free the rest of the memory associated with this task * and set the associated pointers to NULL for safety. */ _Thread_Stack_Free( the_thread ); 48f56: 2f0a movel %a2,%sp@- 48f58: 4eb9 0004 9be8 jsr 49be8 <_Thread_Stack_Free> the_thread->Start.stack = NULL; _Workspace_Free( the_thread->extensions ); 48f5e: 2f2a 0106 movel %a2@(262),%sp@- /* * Free the rest of the memory associated with this task * and set the associated pointers to NULL for safety. */ _Thread_Stack_Free( the_thread ); the_thread->Start.stack = NULL; 48f62: 42aa 00be clrl %a2@(190) _Workspace_Free( the_thread->extensions ); 48f66: 4e93 jsr %a3@ the_thread->extensions = NULL; } 48f68: 266e fffc moveal %fp@(-4),%a3 */ _Thread_Stack_Free( the_thread ); the_thread->Start.stack = NULL; _Workspace_Free( the_thread->extensions ); the_thread->extensions = NULL; 48f6c: 4fef 000c lea %sp@(12),%sp 48f70: 42aa 0106 clrl %a2@(262) } 48f74: 246e fff8 moveal %fp@(-8),%a2 48f78: 4e5e unlk %fp 48f7a: 4e75 rts */ _Thread_Set_state( the_thread, STATES_DORMANT ); if ( !_Thread_queue_Extract_with_proxy( the_thread ) ) { if ( _Watchdog_Is_active( &the_thread->Timer ) ) (void) _Watchdog_Remove( &the_thread->Timer ); 48f7c: 486a 0048 pea %a2@(72) 48f80: 4eb9 0004 a160 jsr 4a160 <_Watchdog_Remove> 48f86: 588f addql #4,%sp 48f88: 2079 0005 f76a moveal 5f76a <_Scheduler+0x1c>,%a0 48f8e: 2f0a movel %a2,%sp@- 48f90: 4e90 jsr %a0@ /* * The thread might have been FP. So deal with that. */ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( _Thread_Is_allocated_fp( the_thread ) ) 48f92: 588f addql #4,%sp 48f94: b5f9 0006 10ca cmpal 610ca <_Thread_Allocated_fp>,%a2 48f9a: 6600 ff6e bnew 48f0a <_Thread_Close+0x92> 48f9e: 60a0 bras 48f40 <_Thread_Close+0xc8> <== NOT EXECUTED =============================================================================== 00049058 <_Thread_Delay_ended>: void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { 49058: 4e56 fffc linkw %fp,#-4 Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 4905c: 486e fffc pea %fp@(-4) 49060: 2f2e 0008 movel %fp@(8),%sp@- 49064: 4eb9 0004 9240 jsr 49240 <_Thread_Get> switch ( location ) { 4906a: 508f addql #8,%sp 4906c: 4aae fffc tstl %fp@(-4) 49070: 6624 bnes 49096 <_Thread_Delay_ended+0x3e> <== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_Clear_state( 49072: 2f3c 1000 0018 movel #268435480,%sp@- 49078: 2f00 movel %d0,%sp@- 4907a: 4eb9 0004 8e1c jsr 48e1c <_Thread_Clear_state> 49080: 508f addql #8,%sp * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { _Thread_Dispatch_disable_level--; 49082: 2039 0006 1048 movel 61048 <_Thread_Dispatch_disable_level>,%d0 49088: 5380 subql #1,%d0 4908a: 23c0 0006 1048 movel %d0,61048 <_Thread_Dispatch_disable_level> return _Thread_Dispatch_disable_level; 49090: 2039 0006 1048 movel 61048 <_Thread_Dispatch_disable_level>,%d0 | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Thread_Unnest_dispatch(); break; } } 49096: 4e5e unlk %fp ... =============================================================================== 0004909c <_Thread_Dispatch>: * INTERRUPT LATENCY: * dispatch thread * no dispatch thread */ void _Thread_Dispatch( void ) { 4909c: 4e56 ffc8 linkw %fp,#-56 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 490a0: 2039 0006 1048 movel 61048 <_Thread_Dispatch_disable_level>,%d0 490a6: 5280 addql #1,%d0 490a8: 23c0 0006 1048 movel %d0,61048 <_Thread_Dispatch_disable_level> return _Thread_Dispatch_disable_level; 490ae: 2039 0006 1048 movel 61048 <_Thread_Dispatch_disable_level>,%d0 490b4: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; _ISR_Disable( level ); 490b8: 283c 0000 0700 movel #1792,%d4 490be: 2004 movel %d4,%d0 #endif /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; 490c0: 2479 0006 14aa moveal 614aa <_Per_CPU_Information+0xc>,%a2 _ISR_Disable( level ); 490c6: 40c1 movew %sr,%d1 490c8: 8081 orl %d1,%d0 490ca: 46c0 movew %d0,%sr while ( _Thread_Dispatch_necessary == true ) { 490cc: 1039 0006 14b6 moveb 614b6 <_Per_CPU_Information+0x18>,%d0 490d2: 6700 0110 beqw 491e4 <_Thread_Dispatch+0x148> heir = _Thread_Heir; 490d6: 2679 0006 14ae moveal 614ae <_Per_CPU_Information+0x10>,%a3 _Thread_Dispatch_necessary = false; 490dc: 4200 clrb %d0 _Thread_Executing = heir; 490de: 23cb 0006 14aa movel %a3,614aa <_Per_CPU_Information+0xc> executing = _Thread_Executing; _ISR_Disable( level ); while ( _Thread_Dispatch_necessary == true ) { heir = _Thread_Heir; _Thread_Dispatch_necessary = false; 490e4: 13c0 0006 14b6 moveb %d0,614b6 <_Per_CPU_Information+0x18> /* * When the heir and executing are the same, then we are being * requested to do the post switch dispatching. This is normally * done to dispatch signals. */ if ( heir == executing ) 490ea: b7ca cmpal %a2,%a3 490ec: 6700 00f6 beqw 491e4 <_Thread_Dispatch+0x148> 490f0: 260e movel %fp,%d3 490f2: 240e movel %fp,%d2 490f4: 0683 ffff fff0 addil #-16,%d3 490fa: 2e3c 0004 cd9c movel #314780,%d7 49100: 5182 subql #8,%d2 49102: 2c3c 0004 9d0c movel #302348,%d6 49108: 2a3c 0004 9cc4 movel #302276,%d5 4910e: 4bf9 0004 9fd8 lea 49fd8 <_User_extensions_Thread_switch>,%a5 49114: 49f9 0004 a34c lea 4a34c <_CPU_Context_switch>,%a4 */ #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 ) 4911a: 7001 moveq #1,%d0 4911c: b0ab 007a cmpl %a3@(122),%d0 49120: 6700 00e8 beqw 4920a <_Thread_Dispatch+0x16e> heir->cpu_time_budget = _Thread_Ticks_per_timeslice; _ISR_Enable( level ); 49124: 46c1 movew %d1,%sr #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 49126: 2f03 movel %d3,%sp@- 49128: 2047 moveal %d7,%a0 4912a: 4e90 jsr %a0@ _Timestamp_Subtract( 4912c: 2046 moveal %d6,%a0 4912e: 2f02 movel %d2,%sp@- 49130: 2f03 movel %d3,%sp@- 49132: 4879 0006 14b8 pea 614b8 <_Per_CPU_Information+0x1a> 49138: 4e90 jsr %a0@ &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); 4913a: 2045 moveal %d5,%a0 4913c: 2f02 movel %d2,%sp@- 4913e: 486a 0082 pea %a2@(130) 49142: 4e90 jsr %a0@ #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 49144: 2079 0006 10ce moveal 610ce <_Thread_libc_reent>,%a0 4914a: 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; 4914e: 202e fff0 movel %fp@(-16),%d0 49152: 222e fff4 movel %fp@(-12),%d1 49156: 23c0 0006 14b8 movel %d0,614b8 <_Per_CPU_Information+0x1a> 4915c: 23c1 0006 14bc movel %d1,614bc <_Per_CPU_Information+0x1e> #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 49162: 4a88 tstl %a0 49164: 6708 beqs 4916e <_Thread_Dispatch+0xd2> <== NEVER TAKEN executing->libc_reent = *_Thread_libc_reent; 49166: 2550 00fa movel %a0@,%a2@(250) *_Thread_libc_reent = heir->libc_reent; 4916a: 20ab 00fa movel %a3@(250),%a0@ } _User_extensions_Thread_switch( executing, heir ); 4916e: 2f0b movel %a3,%sp@- 49170: 2f0a movel %a2,%sp@- 49172: 4e95 jsr %a5@ if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 49174: 486b 00c2 pea %a3@(194) 49178: 486a 00c2 pea %a2@(194) 4917c: 4e94 jsr %a4@ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && 4917e: 4fef 0010 lea %sp@(16),%sp 49182: 4aaa 00f6 tstl %a2@(246) 49186: 672c beqs 491b4 <_Thread_Dispatch+0x118> #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 ); 49188: 2079 0006 10ca moveal 610ca <_Thread_Allocated_fp>,%a0 4918e: b1ca cmpal %a2,%a0 49190: 6722 beqs 491b4 <_Thread_Dispatch+0x118> !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) 49192: 4a88 tstl %a0 49194: 670c beqs 491a2 <_Thread_Dispatch+0x106> _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 49196: 4868 00f6 pea %a0@(246) 4919a: 4eb9 0004 a47c jsr 4a47c <_CPU_Context_save_fp> 491a0: 588f addql #4,%sp _Context_Restore_fp( &executing->fp_context ); 491a2: 486a 00f6 pea %a2@(246) 491a6: 4eb9 0004 a4b4 jsr 4a4b4 <_CPU_Context_restore_fp> _Thread_Allocated_fp = executing; 491ac: 588f addql #4,%sp 491ae: 23ca 0006 10ca movel %a2,610ca <_Thread_Allocated_fp> if ( executing->fp_context != NULL ) _Context_Restore_fp( &executing->fp_context ); #endif #endif executing = _Thread_Executing; 491b4: 2479 0006 14aa moveal 614aa <_Per_CPU_Information+0xc>,%a2 _ISR_Disable( level ); 491ba: 2004 movel %d4,%d0 491bc: 40c1 movew %sr,%d1 491be: 8081 orl %d1,%d0 491c0: 46c0 movew %d0,%sr /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; _ISR_Disable( level ); while ( _Thread_Dispatch_necessary == true ) { 491c2: 1039 0006 14b6 moveb 614b6 <_Per_CPU_Information+0x18>,%d0 491c8: 671a beqs 491e4 <_Thread_Dispatch+0x148> heir = _Thread_Heir; 491ca: 2679 0006 14ae moveal 614ae <_Per_CPU_Information+0x10>,%a3 _Thread_Dispatch_necessary = false; 491d0: 4200 clrb %d0 _Thread_Executing = heir; 491d2: 23cb 0006 14aa movel %a3,614aa <_Per_CPU_Information+0xc> executing = _Thread_Executing; _ISR_Disable( level ); while ( _Thread_Dispatch_necessary == true ) { heir = _Thread_Heir; _Thread_Dispatch_necessary = false; 491d8: 13c0 0006 14b6 moveb %d0,614b6 <_Per_CPU_Information+0x18> /* * When the heir and executing are the same, then we are being * requested to do the post switch dispatching. This is normally * done to dispatch signals. */ if ( heir == executing ) 491de: b5cb cmpal %a3,%a2 491e0: 6600 ff38 bnew 4911a <_Thread_Dispatch+0x7e> _ISR_Disable( level ); } post_switch: _ISR_Enable( level ); 491e4: 46c1 movew %d1,%sr * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { _Thread_Dispatch_disable_level--; 491e6: 2039 0006 1048 movel 61048 <_Thread_Dispatch_disable_level>,%d0 491ec: 5380 subql #1,%d0 491ee: 23c0 0006 1048 movel %d0,61048 <_Thread_Dispatch_disable_level> return _Thread_Dispatch_disable_level; 491f4: 2039 0006 1048 movel 61048 <_Thread_Dispatch_disable_level>,%d0 _Thread_Unnest_dispatch(); _API_extensions_Run_postswitch(); 491fa: 4eb9 0004 7442 jsr 47442 <_API_extensions_Run_postswitch> } 49200: 4cee 3cfc ffc8 moveml %fp@(-56),%d2-%d7/%a2-%a5 49206: 4e5e unlk %fp 49208: 4e75 rts #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 ) heir->cpu_time_budget = _Thread_Ticks_per_timeslice; 4920a: 41f9 0006 1000 lea 61000 <_Thread_Ticks_per_timeslice>,%a0 49210: 2750 0076 movel %a0@,%a3@(118) 49214: 6000 ff0e braw 49124 <_Thread_Dispatch+0x88> =============================================================================== 00049218 <_Thread_Enable_dispatch>: * dispatch thread * no dispatch thread */ #if defined (__THREAD_DO_NOT_INLINE_ENABLE_DISPATCH__ ) void _Thread_Enable_dispatch( void ) { 49218: 4e56 0000 linkw %fp,#0 * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { _Thread_Dispatch_disable_level--; 4921c: 2039 0006 1048 movel 61048 <_Thread_Dispatch_disable_level>,%d0 49222: 5380 subql #1,%d0 49224: 23c0 0006 1048 movel %d0,61048 <_Thread_Dispatch_disable_level> return _Thread_Dispatch_disable_level; 4922a: 2039 0006 1048 movel 61048 <_Thread_Dispatch_disable_level>,%d0 if ( _Thread_Dispatch_decrement_disable_level() ) 49230: 6704 beqs 49236 <_Thread_Enable_dispatch+0x1e> return; _Thread_Dispatch(); } 49232: 4e5e unlk %fp 49234: 4e75 rts 49236: 4e5e unlk %fp #if defined (__THREAD_DO_NOT_INLINE_ENABLE_DISPATCH__ ) void _Thread_Enable_dispatch( void ) { if ( _Thread_Dispatch_decrement_disable_level() ) return; _Thread_Dispatch(); 49238: 4ef9 0004 909c jmp 4909c <_Thread_Dispatch> ... =============================================================================== 0004ee40 <_Thread_Handler>: * Input parameters: NONE * * Output parameters: NONE */ void _Thread_Handler( void ) { 4ee40: 4e56 0000 linkw %fp,#0 4ee44: 2f0a movel %a2,%sp@- #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static bool doneConstructors; bool doCons; #endif executing = _Thread_Executing; 4ee46: 2479 0006 14aa moveal 614aa <_Per_CPU_Information+0xc>,%a2 * Input parameters: NONE * * Output parameters: NONE */ void _Thread_Handler( void ) { 4ee4c: 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; 4ee4e: 222a 00a8 movel %a2@(168),%d1 _ISR_Set_level(level); 4ee52: 40c0 movew %sr,%d0 4ee54: e189 lsll #8,%d1 4ee56: 0280 0000 f8ff andil #63743,%d0 4ee5c: 8081 orl %d1,%d0 4ee5e: 46c0 movew %d0,%sr && _Objects_Get_API( executing->Object.id ) != OBJECTS_INTERNAL_API; if (doCons) doneConstructors = true; #else doCons = !doneConstructors; doneConstructors = true; 4ee60: 7001 moveq #1,%d0 doCons = !doneConstructors && _Objects_Get_API( executing->Object.id ) != OBJECTS_INTERNAL_API; if (doCons) doneConstructors = true; #else doCons = !doneConstructors; 4ee62: 1439 0006 0808 moveb 60808 ,%d2 doneConstructors = true; 4ee68: 13c0 0006 0808 moveb %d0,60808 #endif #endif #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && 4ee6e: 4aaa 00f6 tstl %a2@(246) 4ee72: 6720 beqs 4ee94 <_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 ); 4ee74: 2079 0006 10ca moveal 610ca <_Thread_Allocated_fp>,%a0 4ee7a: b1ca cmpal %a2,%a0 4ee7c: 6716 beqs 4ee94 <_Thread_Handler+0x54> !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) 4ee7e: 4a88 tstl %a0 4ee80: 670c beqs 4ee8e <_Thread_Handler+0x4e> _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 4ee82: 4868 00f6 pea %a0@(246) 4ee86: 4eb9 0004 a47c jsr 4a47c <_CPU_Context_save_fp> 4ee8c: 588f addql #4,%sp _Thread_Allocated_fp = executing; 4ee8e: 23ca 0006 10ca movel %a2,610ca <_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 ); 4ee94: 2f0a movel %a2,%sp@- 4ee96: 4eb9 0004 9e24 jsr 49e24 <_User_extensions_Thread_begin> /* * At this point, the dispatch disable level BETTER be 1. */ _Thread_Enable_dispatch(); 4ee9c: 4eb9 0004 9218 jsr 49218 <_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 (doCons) /* && (volatile void *)_init) */ { 4eea2: 588f addql #4,%sp 4eea4: 4a02 tstb %d2 4eea6: 6724 beqs 4eecc <_Thread_Handler+0x8c> _Thread_Enable_dispatch(); #endif } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 4eea8: 202a 0092 movel %a2@(146),%d0 4eeac: 672a beqs 4eed8 <_Thread_Handler+0x98> (*(Thread_Entry_numeric) executing->Start.entry_point)( executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { 4eeae: 7201 moveq #1,%d1 4eeb0: b280 cmpl %d0,%d1 4eeb2: 674c beqs 4ef00 <_Thread_Handler+0xc0> <== ALWAYS TAKEN * 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 ); 4eeb4: 2f0a movel %a2,%sp@- <== NOT EXECUTED 4eeb6: 4eb9 0004 9e62 jsr 49e62 <_User_extensions_Thread_exitted> <== NOT EXECUTED _Internal_error_Occurred( 4eebc: 4878 0005 pea 5 <== NOT EXECUTED 4eec0: 4878 0001 pea 1 <== NOT EXECUTED 4eec4: 42a7 clrl %sp@- <== NOT EXECUTED 4eec6: 4eb9 0004 7ec8 jsr 47ec8 <_Internal_error_Occurred> <== NOT EXECUTED * _init could be a weak symbol and we SHOULD test it but it isn't * in any configuration I know of and it generates a warning on every * RTEMS target configuration. --joel (12 May 2007) */ if (doCons) /* && (volatile void *)_init) */ { INIT_NAME (); 4eecc: 4eb9 0005 d74c jsr 5d74c <_init> _Thread_Enable_dispatch(); #endif } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 4eed2: 202a 0092 movel %a2@(146),%d0 4eed6: 66d6 bnes 4eeae <_Thread_Handler+0x6e> executing->Wait.return_argument = (*(Thread_Entry_numeric) executing->Start.entry_point)( 4eed8: 2f2a 009a movel %a2@(154),%sp@- 4eedc: 206a 008e moveal %a2@(142),%a0 4eee0: 4e90 jsr %a0@ #endif } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { executing->Wait.return_argument = 4eee2: 588f addql #4,%sp 4eee4: 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 ); 4eee8: 2f0a movel %a2,%sp@- 4eeea: 4eb9 0004 9e62 jsr 49e62 <_User_extensions_Thread_exitted> _Internal_error_Occurred( 4eef0: 4878 0005 pea 5 4eef4: 4878 0001 pea 1 4eef8: 42a7 clrl %sp@- 4eefa: 4eb9 0004 7ec8 jsr 47ec8 <_Internal_error_Occurred> ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { executing->Wait.return_argument = (*(Thread_Entry_pointer) executing->Start.entry_point)( 4ef00: 2f2a 0096 movel %a2@(150),%sp@- 4ef04: 206a 008e moveal %a2@(142),%a0 4ef08: 4e90 jsr %a0@ executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { executing->Wait.return_argument = 4ef0a: 588f addql #4,%sp 4ef0c: 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 ); 4ef10: 2f0a movel %a2,%sp@- 4ef12: 4eb9 0004 9e62 jsr 49e62 <_User_extensions_Thread_exitted> _Internal_error_Occurred( 4ef18: 4878 0005 pea 5 <== NOT EXECUTED 4ef1c: 4878 0001 pea 1 <== NOT EXECUTED 4ef20: 42a7 clrl %sp@- <== NOT EXECUTED 4ef22: 4eb9 0004 7ec8 jsr 47ec8 <_Internal_error_Occurred> <== NOT EXECUTED =============================================================================== 00049518 <_Thread_Handler_initialization>: * * Output parameters: NONE */ void _Thread_Handler_initialization(void) { 49518: 4e56 0000 linkw %fp,#0 /* * BOTH stacks hooks must be set or both must be NULL. * Do not allow mixture. */ if ( !( (!Configuration.stack_allocate_hook) == (!Configuration.stack_free_hook) ) ) 4951c: 4ab9 0005 f690 tstl 5f690 49522: 57c1 seq %d1 #endif /* * BOTH stacks hooks must be set or both must be NULL. * Do not allow mixture. */ if ( !( (!Configuration.stack_allocate_hook) 49524: 4ab9 0005 f68c tstl 5f68c 4952a: 57c0 seq %d0 == (!Configuration.stack_free_hook) ) ) 4952c: 4481 negl %d1 #endif /* * BOTH stacks hooks must be set or both must be NULL. * Do not allow mixture. */ if ( !( (!Configuration.stack_allocate_hook) 4952e: 4480 negl %d0 49530: b380 eorl %d1,%d0 uint32_t maximum_internal_threads; #if defined(RTEMS_MULTIPROCESSING) uint32_t maximum_proxies; #endif ticks_per_timeslice = Configuration.ticks_per_timeslice; 49532: 2239 0005 f67c movel 5f67c ,%d1 maximum_extensions = Configuration.maximum_extensions; 49538: 2079 0005 f674 moveal 5f674 ,%a0 #endif /* * BOTH stacks hooks must be set or both must be NULL. * Do not allow mixture. */ if ( !( (!Configuration.stack_allocate_hook) 4953e: 4a00 tstb %d0 49540: 6650 bnes 49592 <_Thread_Handler_initialization+0x7a> #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( 49542: 4878 0008 pea 8 INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_BAD_STACK_HOOK ); _Thread_Dispatch_necessary = false; 49546: 4200 clrb %d0 #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( 49548: 42a7 clrl %sp@- 4954a: 4878 010e pea 10e 4954e: 4878 0001 pea 1 49552: 4878 0001 pea 1 49556: 4878 0001 pea 1 4955a: 4879 0006 1152 pea 61152 <_Thread_Internal_information> INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_BAD_STACK_HOOK ); _Thread_Dispatch_necessary = false; 49560: 13c0 0006 14b6 moveb %d0,614b6 <_Per_CPU_Information+0x18> _Thread_Executing = NULL; 49566: 42b9 0006 14aa clrl 614aa <_Per_CPU_Information+0xc> _Thread_Heir = NULL; 4956c: 42b9 0006 14ae clrl 614ae <_Per_CPU_Information+0x10> #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Thread_Allocated_fp = NULL; 49572: 42b9 0006 10ca clrl 610ca <_Thread_Allocated_fp> #endif _Thread_Maximum_extensions = maximum_extensions; 49578: 23c8 0006 10da movel %a0,610da <_Thread_Maximum_extensions> _Thread_Ticks_per_timeslice = ticks_per_timeslice; 4957e: 23c1 0006 1000 movel %d1,61000 <_Thread_Ticks_per_timeslice> #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( 49584: 4eb9 0004 84c4 jsr 484c4 <_Objects_Initialize_information> 4958a: 4fef 001c lea %sp@(28),%sp false, /* true if this is a global object class */ NULL /* Proxy extraction support callout */ #endif ); } 4958e: 4e5e unlk %fp 49590: 4e75 rts * BOTH stacks hooks must be set or both must be NULL. * Do not allow mixture. */ if ( !( (!Configuration.stack_allocate_hook) == (!Configuration.stack_free_hook) ) ) _Internal_error_Occurred( 49592: 4878 000e pea e 49596: 4878 0001 pea 1 4959a: 42a7 clrl %sp@- 4959c: 4eb9 0004 7ec8 jsr 47ec8 <_Internal_error_Occurred> ... =============================================================================== 000492e4 <_Thread_Initialize>: Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 492e4: 4e56 ffe4 linkw %fp,#-28 492e8: 202e 0010 movel %fp@(16),%d0 492ec: 48d7 0c7c moveml %d2-%d6/%a2-%a3,%sp@ 492f0: 246e 000c moveal %fp@(12),%a2 492f4: 242e 0014 movel %fp@(20),%d2 492f8: 262e 001c movel %fp@(28),%d3 492fc: 282e 0024 movel %fp@(36),%d4 49300: 1a2e 001b moveb %fp@(27),%d5 49304: 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; 49308: 42aa 00fe clrl %a2@(254) 4930c: 42aa 0102 clrl %a2@(258) extensions_area = NULL; the_thread->libc_reent = NULL; 49310: 42aa 00fa clrl %a2@(250) if ( !actual_stack_size || actual_stack_size < stack_size ) return false; /* stack allocation failed */ stack = the_thread->Start.stack; #else if ( !stack_area ) { 49314: 4a80 tstl %d0 49316: 6700 0198 beqw 494b0 <_Thread_Initialize+0x1cc> stack = the_thread->Start.stack; the_thread->Start.core_allocated_stack = true; } else { stack = stack_area; actual_stack_size = stack_size; the_thread->Start.core_allocated_stack = false; 4931a: 2202 movel %d2,%d1 4931c: 4202 clrb %d2 4931e: 1542 00b0 moveb %d2,%a2@(176) Stack_Control *the_stack, void *starting_address, size_t size ) { the_stack->area = starting_address; 49322: 2540 00b6 movel %d0,%a2@(182) the_stack->size = size; 49326: 2541 00b2 movel %d1,%a2@(178) /* * Allocate the floating point area for this thread */ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( is_fp ) { 4932a: 4a05 tstb %d5 4932c: 6600 0100 bnew 4942e <_Thread_Initialize+0x14a> extensions_area = NULL; the_thread->libc_reent = NULL; #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) fp_area = NULL; 49330: 4282 clrl %d2 #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { 49332: 2039 0006 10da movel 610da <_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; 49338: 2542 00f6 movel %d2,%a2@(246) the_thread->Start.fp_context = fp_area; 4933c: 2542 00ba movel %d2,%a2@(186) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 49340: 42aa 0050 clrl %a2@(80) the_watchdog->routine = routine; 49344: 42aa 0064 clrl %a2@(100) the_watchdog->id = id; 49348: 42aa 0068 clrl %a2@(104) the_watchdog->user_data = user_data; 4934c: 42aa 006c clrl %a2@(108) #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { 49350: 4a80 tstl %d0 49352: 6600 0124 bnew 49478 <_Thread_Initialize+0x194> (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) goto failed; } the_thread->extensions = (void **) extensions_area; 49356: 42aa 0106 clrl %a2@(262) * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; extensions_area = NULL; 4935a: 4285 clrl %d5 /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; 4935c: 2544 00a0 movel %d4,%a2@(160) the_thread->Start.budget_callout = budget_callout; switch ( budget_algorithm ) { 49360: 7002 moveq #2,%d0 /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; 49362: 1546 009e moveb %d6,%a2@(158) the_thread->Start.budget_algorithm = budget_algorithm; the_thread->Start.budget_callout = budget_callout; 49366: 256e 0028 00a4 movel %fp@(40),%a2@(164) switch ( budget_algorithm ) { 4936c: b084 cmpl %d4,%d0 4936e: 6700 00a4 beqw 49414 <_Thread_Initialize+0x130> #endif } the_thread->Start.isr_level = isr_level; the_thread->current_state = STATES_DORMANT; 49372: 7001 moveq #1,%d0 case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; 49374: 256e 002c 00a8 movel %fp@(44),%a2@(168) */ RTEMS_INLINE_ROUTINE void* _Scheduler_Allocate( Thread_Control *the_thread ) { return _Scheduler.Operations.allocate( the_thread ); 4937a: 2079 0005 f766 moveal 5f766 <_Scheduler+0x18>,%a0 the_thread->current_state = STATES_DORMANT; 49380: 2540 0010 movel %d0,%a2@(16) the_thread->Wait.queue = NULL; 49384: 42aa 0044 clrl %a2@(68) the_thread->resource_count = 0; 49388: 42aa 001c clrl %a2@(28) the_thread->real_priority = priority; 4938c: 2543 0018 movel %d3,%a2@(24) the_thread->Start.initial_priority = priority; 49390: 2543 00ac movel %d3,%a2@(172) 49394: 2f0a movel %a2,%sp@- 49396: 4e90 jsr %a0@ sched =_Scheduler_Allocate( the_thread ); if ( !sched ) 49398: 588f addql #4,%sp 4939a: 2800 movel %d0,%d4 4939c: 673a beqs 493d8 <_Thread_Initialize+0xf4> goto failed; _Thread_Set_priority( the_thread, priority ); 4939e: 2f03 movel %d3,%sp@- 493a0: 2f0a movel %a2,%sp@- 493a2: 4eb9 0004 9ad8 jsr 49ad8 <_Thread_Set_priority> #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 493a8: 206e 0008 moveal %fp@(8),%a0 493ac: 4280 clrl %d0 493ae: 2068 0018 moveal %a0@(24),%a0 493b2: 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 ); 493b6: 42aa 0082 clrl %a2@(130) 493ba: 42aa 0086 clrl %a2@(134) 493be: 218a 0c00 movel %a2,%a0@(00000000,%d0:l:4) information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 493c2: 256e 0030 000c movel %fp@(48),%a2@(12) * enabled when we get here. We want to be able to run the * user extensions with dispatching enabled. The Allocator * Mutex provides sufficient protection to let the user extensions * run safely. */ extension_status = _User_extensions_Thread_create( the_thread ); 493c8: 2f0a movel %a2,%sp@- 493ca: 4eb9 0004 9ef4 jsr 49ef4 <_User_extensions_Thread_create> if ( extension_status ) 493d0: 4fef 000c lea %sp@(12),%sp 493d4: 4a00 tstb %d0 493d6: 664a bnes 49422 <_Thread_Initialize+0x13e> return true; failed: _Workspace_Free( the_thread->libc_reent ); 493d8: 2f2a 00fa movel %a2@(250),%sp@- 493dc: 47f9 0004 a2fe lea 4a2fe <_Workspace_Free>,%a3 493e2: 4e93 jsr %a3@ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) _Workspace_Free( the_thread->API_Extensions[i] ); 493e4: 2f2a 00fe movel %a2@(254),%sp@- 493e8: 4e93 jsr %a3@ 493ea: 2f2a 0102 movel %a2@(258),%sp@- 493ee: 4e93 jsr %a3@ _Workspace_Free( extensions_area ); 493f0: 2f05 movel %d5,%sp@- 493f2: 4e93 jsr %a3@ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Workspace_Free( fp_area ); 493f4: 2f02 movel %d2,%sp@- 493f6: 4e93 jsr %a3@ #endif _Workspace_Free( sched ); 493f8: 2f04 movel %d4,%sp@- 493fa: 4e93 jsr %a3@ _Thread_Stack_Free( the_thread ); 493fc: 2f0a movel %a2,%sp@- 493fe: 4eb9 0004 9be8 jsr 49be8 <_Thread_Stack_Free> return false; 49404: 4fef 001c lea %sp@(28),%sp 49408: 4200 clrb %d0 } 4940a: 4cee 0c7c ffe4 moveml %fp@(-28),%d2-%d6/%a2-%a3 49410: 4e5e unlk %fp 49412: 4e75 rts case THREAD_CPU_BUDGET_ALGORITHM_NONE: case THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE: break; #if defined(RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE) case THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; 49414: 41f9 0006 1000 lea 61000 <_Thread_Ticks_per_timeslice>,%a0 4941a: 2550 0076 movel %a0@,%a2@(118) break; 4941e: 6000 ff52 braw 49372 <_Thread_Initialize+0x8e> _Workspace_Free( sched ); _Thread_Stack_Free( the_thread ); return false; } 49422: 4cee 0c7c ffe4 moveml %fp@(-28),%d2-%d6/%a2-%a3 * Mutex provides sufficient protection to let the user extensions * run safely. */ extension_status = _User_extensions_Thread_create( the_thread ); if ( extension_status ) return true; 49428: 7001 moveq #1,%d0 _Workspace_Free( sched ); _Thread_Stack_Free( the_thread ); return false; } 4942a: 4e5e unlk %fp 4942c: 4e75 rts /* * 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 ); 4942e: 4878 001c pea 1c 49432: 4eb9 0004 a2e2 jsr 4a2e2 <_Workspace_Allocate> if ( !fp_area ) 49438: 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 ); 4943a: 2400 movel %d0,%d2 if ( !fp_area ) 4943c: 6600 fef4 bnew 49332 <_Thread_Initialize+0x4e> extension_status = _User_extensions_Thread_create( the_thread ); if ( extension_status ) return true; failed: _Workspace_Free( the_thread->libc_reent ); 49440: 2f2a 00fa movel %a2@(250),%sp@- 49444: 47f9 0004 a2fe lea 4a2fe <_Workspace_Free>,%a3 * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; extensions_area = NULL; 4944a: 4285 clrl %d5 size_t actual_stack_size = 0; void *stack = NULL; #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) void *fp_area; #endif void *sched = NULL; 4944c: 4284 clrl %d4 extension_status = _User_extensions_Thread_create( the_thread ); if ( extension_status ) return true; failed: _Workspace_Free( the_thread->libc_reent ); 4944e: 4e93 jsr %a3@ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) _Workspace_Free( the_thread->API_Extensions[i] ); 49450: 2f2a 00fe movel %a2@(254),%sp@- 49454: 4e93 jsr %a3@ 49456: 2f2a 0102 movel %a2@(258),%sp@- 4945a: 4e93 jsr %a3@ _Workspace_Free( extensions_area ); 4945c: 2f05 movel %d5,%sp@- 4945e: 4e93 jsr %a3@ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Workspace_Free( fp_area ); 49460: 2f02 movel %d2,%sp@- 49462: 4e93 jsr %a3@ #endif _Workspace_Free( sched ); 49464: 2f04 movel %d4,%sp@- 49466: 4e93 jsr %a3@ _Thread_Stack_Free( the_thread ); 49468: 2f0a movel %a2,%sp@- 4946a: 4eb9 0004 9be8 jsr 49be8 <_Thread_Stack_Free> return false; 49470: 4fef 001c lea %sp@(28),%sp 49474: 4200 clrb %d0 49476: 6092 bras 4940a <_Thread_Initialize+0x126> /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { extensions_area = _Workspace_Allocate( 49478: e588 lsll #2,%d0 4947a: 2040 moveal %d0,%a0 4947c: 4868 0004 pea %a0@(4) 49480: 4eb9 0004 a2e2 jsr 4a2e2 <_Workspace_Allocate> (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) 49486: 588f addql #4,%sp /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { extensions_area = _Workspace_Allocate( 49488: 2a00 movel %d0,%d5 (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) 4948a: 6752 beqs 494de <_Thread_Initialize+0x1fa> goto failed; } the_thread->extensions = (void **) extensions_area; 4948c: 2540 0106 movel %d0,%a2@(262) 49490: 2040 moveal %d0,%a0 * create the extension long after tasks have been created * so they cannot rely on the thread create user extension * call. */ if ( the_thread->extensions ) { for ( i = 0; i <= _Thread_Maximum_extensions ; i++ ) 49492: 4281 clrl %d1 (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) goto failed; } the_thread->extensions = (void **) extensions_area; 49494: 4280 clrl %d0 49496: 2279 0006 10da moveal 610da <_Thread_Maximum_extensions>,%a1 * so they cannot rely on the thread create user extension * call. */ if ( the_thread->extensions ) { for ( i = 0; i <= _Thread_Maximum_extensions ; i++ ) the_thread->extensions[i] = NULL; 4949c: 42b0 1c00 clrl %a0@(00000000,%d1:l:4) * create the extension long after tasks have been created * so they cannot rely on the thread create user extension * call. */ if ( the_thread->extensions ) { for ( i = 0; i <= _Thread_Maximum_extensions ; i++ ) 494a0: 5280 addql #1,%d0 494a2: 2200 movel %d0,%d1 494a4: b3c0 cmpal %d0,%a1 494a6: 6500 feb4 bcsw 4935c <_Thread_Initialize+0x78> (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) goto failed; } the_thread->extensions = (void **) extensions_area; 494aa: 206a 0106 moveal %a2@(262),%a0 494ae: 60ec bras 4949c <_Thread_Initialize+0x1b8> return false; /* stack allocation failed */ stack = the_thread->Start.stack; #else if ( !stack_area ) { actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); 494b0: 2f02 movel %d2,%sp@- 494b2: 2f0a movel %a2,%sp@- 494b4: 4eb9 0004 9b84 jsr 49b84 <_Thread_Stack_Allocate> if ( !actual_stack_size || actual_stack_size < stack_size ) 494ba: 508f addql #8,%sp return false; /* stack allocation failed */ stack = the_thread->Start.stack; #else if ( !stack_area ) { actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); 494bc: 2200 movel %d0,%d1 if ( !actual_stack_size || actual_stack_size < stack_size ) 494be: 6712 beqs 494d2 <_Thread_Initialize+0x1ee> 494c0: b082 cmpl %d2,%d0 494c2: 650e bcss 494d2 <_Thread_Initialize+0x1ee> <== NEVER TAKEN return false; /* stack allocation failed */ stack = the_thread->Start.stack; 494c4: 202a 00be movel %a2@(190),%d0 the_thread->Start.core_allocated_stack = true; 494c8: 7401 moveq #1,%d2 494ca: 1542 00b0 moveb %d2,%a2@(176) 494ce: 6000 fe52 braw 49322 <_Thread_Initialize+0x3e> _Workspace_Free( sched ); _Thread_Stack_Free( the_thread ); return false; } 494d2: 4cee 0c7c ffe4 moveml %fp@(-28),%d2-%d6/%a2-%a3 stack = the_thread->Start.stack; #else if ( !stack_area ) { actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); if ( !actual_stack_size || actual_stack_size < stack_size ) return false; /* stack allocation failed */ 494d8: 4200 clrb %d0 _Workspace_Free( sched ); _Thread_Stack_Free( the_thread ); return false; } 494da: 4e5e unlk %fp 494dc: 4e75 rts extension_status = _User_extensions_Thread_create( the_thread ); if ( extension_status ) return true; failed: _Workspace_Free( the_thread->libc_reent ); 494de: 2f2a 00fa movel %a2@(250),%sp@- 494e2: 47f9 0004 a2fe lea 4a2fe <_Workspace_Free>,%a3 size_t actual_stack_size = 0; void *stack = NULL; #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) void *fp_area; #endif void *sched = NULL; 494e8: 4284 clrl %d4 extension_status = _User_extensions_Thread_create( the_thread ); if ( extension_status ) return true; failed: _Workspace_Free( the_thread->libc_reent ); 494ea: 4e93 jsr %a3@ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) _Workspace_Free( the_thread->API_Extensions[i] ); 494ec: 2f2a 00fe movel %a2@(254),%sp@- 494f0: 4e93 jsr %a3@ 494f2: 2f2a 0102 movel %a2@(258),%sp@- 494f6: 4e93 jsr %a3@ _Workspace_Free( extensions_area ); 494f8: 2f05 movel %d5,%sp@- 494fa: 4e93 jsr %a3@ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Workspace_Free( fp_area ); 494fc: 2f02 movel %d2,%sp@- 494fe: 4e93 jsr %a3@ #endif _Workspace_Free( sched ); 49500: 2f04 movel %d4,%sp@- 49502: 4e93 jsr %a3@ _Thread_Stack_Free( the_thread ); 49504: 2f0a movel %a2,%sp@- 49506: 4eb9 0004 9be8 jsr 49be8 <_Thread_Stack_Free> return false; 4950c: 4fef 001c lea %sp@(28),%sp 49510: 4200 clrb %d0 49512: 6000 fef6 braw 4940a <_Thread_Initialize+0x126> ... =============================================================================== 0004dda4 <_Thread_Reset>: void _Thread_Reset( Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { 4dda4: 4e56 0000 linkw %fp,#0 4dda8: 2f0a movel %a2,%sp@- 4ddaa: 246e 0008 moveal %fp@(8),%a2 the_thread->resource_count = 0; the_thread->is_preemptible = the_thread->Start.is_preemptible; the_thread->budget_algorithm = the_thread->Start.budget_algorithm; 4ddae: 256a 00a0 007a movel %a2@(160),%a2@(122) the_thread->budget_callout = the_thread->Start.budget_callout; 4ddb4: 256a 00a4 007e movel %a2@(164),%a2@(126) the_thread->Start.pointer_argument = pointer_argument; 4ddba: 256e 000c 0096 movel %fp@(12),%a2@(150) the_thread->Start.numeric_argument = numeric_argument; 4ddc0: 256e 0010 009a movel %fp@(16),%a2@(154) void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { the_thread->resource_count = 0; the_thread->is_preemptible = the_thread->Start.is_preemptible; 4ddc6: 156a 009e 0074 moveb %a2@(158),%a2@(116) Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { the_thread->resource_count = 0; 4ddcc: 42aa 001c clrl %a2@(28) the_thread->budget_callout = the_thread->Start.budget_callout; the_thread->Start.pointer_argument = pointer_argument; the_thread->Start.numeric_argument = numeric_argument; if ( !_Thread_queue_Extract_with_proxy( the_thread ) ) { 4ddd0: 2f0a movel %a2,%sp@- 4ddd2: 4eb9 0004 a1ec jsr 4a1ec <_Thread_queue_Extract_with_proxy> 4ddd8: 588f addql #4,%sp 4ddda: 4a00 tstb %d0 4dddc: 6608 bnes 4dde6 <_Thread_Reset+0x42> if ( _Watchdog_Is_active( &the_thread->Timer ) ) 4ddde: 7002 moveq #2,%d0 4dde0: b0aa 0050 cmpl %a2@(80),%d0 4dde4: 672a beqs 4de10 <_Thread_Reset+0x6c> (void) _Watchdog_Remove( &the_thread->Timer ); } if ( the_thread->current_priority != the_thread->Start.initial_priority ) { 4dde6: 202a 00ac movel %a2@(172),%d0 4ddea: b0aa 0014 cmpl %a2@(20),%d0 4ddee: 6718 beqs 4de08 <_Thread_Reset+0x64> the_thread->real_priority = the_thread->Start.initial_priority; 4ddf0: 2540 0018 movel %d0,%a2@(24) _Thread_Set_priority( the_thread, the_thread->Start.initial_priority ); 4ddf4: 2d4a 0008 movel %a2,%fp@(8) } } 4ddf8: 246e fffc moveal %fp@(-4),%a2 (void) _Watchdog_Remove( &the_thread->Timer ); } if ( the_thread->current_priority != the_thread->Start.initial_priority ) { the_thread->real_priority = the_thread->Start.initial_priority; _Thread_Set_priority( the_thread, the_thread->Start.initial_priority ); 4ddfc: 2d40 000c movel %d0,%fp@(12) } } 4de00: 4e5e unlk %fp (void) _Watchdog_Remove( &the_thread->Timer ); } if ( the_thread->current_priority != the_thread->Start.initial_priority ) { the_thread->real_priority = the_thread->Start.initial_priority; _Thread_Set_priority( the_thread, the_thread->Start.initial_priority ); 4de02: 4ef9 0004 a420 jmp 4a420 <_Thread_Set_priority> } } 4de08: 246e fffc moveal %fp@(-4),%a2 4de0c: 4e5e unlk %fp 4de0e: 4e75 rts the_thread->Start.numeric_argument = numeric_argument; if ( !_Thread_queue_Extract_with_proxy( the_thread ) ) { if ( _Watchdog_Is_active( &the_thread->Timer ) ) (void) _Watchdog_Remove( &the_thread->Timer ); 4de10: 486a 0048 pea %a2@(72) 4de14: 4eb9 0004 aaec jsr 4aaec <_Watchdog_Remove> 4de1a: 588f addql #4,%sp 4de1c: 60c8 bras 4dde6 <_Thread_Reset+0x42> ... =============================================================================== 0004a390 <_Thread_Restart>: */ RTEMS_INLINE_ROUTINE bool _States_Is_dormant ( States_Control the_states ) { return (the_states & STATES_DORMANT); 4a390: 7001 moveq #1,%d0 bool _Thread_Restart( Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { 4a392: 4e56 0000 linkw %fp,#0 4a396: 2f0a movel %a2,%sp@- 4a398: 246e 0008 moveal %fp@(8),%a2 4a39c: c0aa 0010 andl %a2@(16),%d0 if ( !_States_Is_dormant( the_thread->current_state ) ) { 4a3a0: 670a beqs 4a3ac <_Thread_Restart+0x1c> return true; } return false; } 4a3a2: 246e fffc moveal %fp@(-4),%a2 4a3a6: 4e5e unlk %fp _Thread_Restart_self(); return true; } return false; 4a3a8: 4200 clrb %d0 } 4a3aa: 4e75 rts Thread_Entry_numeric_type numeric_argument ) { if ( !_States_Is_dormant( the_thread->current_state ) ) { _Thread_Set_transient( the_thread ); 4a3ac: 2f0a movel %a2,%sp@- 4a3ae: 4eb9 0004 a484 jsr 4a484 <_Thread_Set_transient> _Thread_Reset( the_thread, pointer_argument, numeric_argument ); 4a3b4: 2f2e 0010 movel %fp@(16),%sp@- 4a3b8: 2f2e 000c movel %fp@(12),%sp@- 4a3bc: 2f0a movel %a2,%sp@- 4a3be: 4eb9 0004 dda4 jsr 4dda4 <_Thread_Reset> _Thread_Load_environment( the_thread ); 4a3c4: 2f0a movel %a2,%sp@- 4a3c6: 4eb9 0004 daac jsr 4daac <_Thread_Load_environment> _Thread_Ready( the_thread ); 4a3cc: 2f0a movel %a2,%sp@- 4a3ce: 4eb9 0004 dd74 jsr 4dd74 <_Thread_Ready> _User_extensions_Thread_restart( the_thread ); 4a3d4: 2f0a movel %a2,%sp@- 4a3d6: 4eb9 0004 a8dc jsr 4a8dc <_User_extensions_Thread_restart> if ( _Thread_Is_executing ( the_thread ) ) 4a3dc: 4fef 001c lea %sp@(28),%sp 4a3e0: b5f9 0006 2082 cmpal 62082 <_Per_CPU_Information+0xc>,%a2 4a3e6: 670a beqs 4a3f2 <_Thread_Restart+0x62> return true; } return false; } 4a3e8: 246e fffc moveal %fp@(-4),%a2 4a3ec: 4e5e unlk %fp _User_extensions_Thread_restart( the_thread ); if ( _Thread_Is_executing ( the_thread ) ) _Thread_Restart_self(); return true; 4a3ee: 7001 moveq #1,%d0 } return false; } 4a3f0: 4e75 rts */ RTEMS_INLINE_ROUTINE void _Thread_Restart_self( void ) { #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( _Thread_Executing->fp_context != NULL ) 4a3f2: 4aaa 00f6 tstl %a2@(246) 4a3f6: 6712 beqs 4a40a <_Thread_Restart+0x7a> _Context_Restore_fp( &_Thread_Executing->fp_context ); 4a3f8: 486a 00f6 pea %a2@(246) 4a3fc: 4eb9 0004 ae40 jsr 4ae40 <_CPU_Context_restore_fp> 4a402: 2479 0006 2082 moveal 62082 <_Per_CPU_Information+0xc>,%a2 4a408: 588f addql #4,%sp #endif _CPU_Context_Restart_self( &_Thread_Executing->Registers ); 4a40a: 486a 00c2 pea %a2@(194) 4a40e: 4eb9 0004 acee jsr 4acee <_CPU_Context_Restart_self> 4a414: 246e fffc moveal %fp@(-4),%a2 <== NOT EXECUTED 4a418: 588f addql #4,%sp <== NOT EXECUTED 4a41a: 4e5e unlk %fp <== NOT EXECUTED _User_extensions_Thread_restart( the_thread ); if ( _Thread_Is_executing ( the_thread ) ) _Thread_Restart_self(); return true; 4a41c: 7001 moveq #1,%d0 <== NOT EXECUTED } return false; } =============================================================================== 00049be8 <_Thread_Stack_Free>: */ void _Thread_Stack_Free( Thread_Control *the_thread ) { 49be8: 4e56 0000 linkw %fp,#0 49bec: 206e 0008 moveal %fp@(8),%a0 #if defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API) /* * If the API provided the stack space, then don't free it. */ if ( !the_thread->Start.core_allocated_stack ) 49bf0: 4a28 00b0 tstb %a0@(176) 49bf4: 6714 beqs 49c0a <_Thread_Stack_Free+0x22> <== NEVER TAKEN * Call ONLY the CPU table stack free hook, or the * the RTEMS workspace free. This is so the free * routine properly matches the allocation of the stack. */ if ( Configuration.stack_free_hook ) 49bf6: 2279 0005 f690 moveal 5f690 ,%a1 (*Configuration.stack_free_hook)( the_thread->Start.Initial_stack.area ); 49bfc: 2d68 00b6 0008 movel %a0@(182),%fp@(8) * Call ONLY the CPU table stack free hook, or the * the RTEMS workspace free. This is so the free * routine properly matches the allocation of the stack. */ if ( Configuration.stack_free_hook ) 49c02: 4a89 tstl %a1 49c04: 6708 beqs 49c0e <_Thread_Stack_Free+0x26> (*Configuration.stack_free_hook)( the_thread->Start.Initial_stack.area ); else _Workspace_Free( the_thread->Start.Initial_stack.area ); } 49c06: 4e5e unlk %fp * the RTEMS workspace free. This is so the free * routine properly matches the allocation of the stack. */ if ( Configuration.stack_free_hook ) (*Configuration.stack_free_hook)( the_thread->Start.Initial_stack.area ); 49c08: 4ed1 jmp %a1@ else _Workspace_Free( the_thread->Start.Initial_stack.area ); } 49c0a: 4e5e unlk %fp <== NOT EXECUTED 49c0c: 4e75 rts <== NOT EXECUTED 49c0e: 4e5e unlk %fp */ if ( Configuration.stack_free_hook ) (*Configuration.stack_free_hook)( the_thread->Start.Initial_stack.area ); else _Workspace_Free( the_thread->Start.Initial_stack.area ); 49c10: 4ef9 0004 a2fe jmp 4a2fe <_Workspace_Free> ... =============================================================================== 00048cd0 <_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 ) ) { 48cd0: 7202 moveq #2,%d1 Thread_blocking_operation_States sync_state __attribute__((unused)), #endif Thread_Control *the_thread, ISR_Level level ) { 48cd2: 4e56 0000 linkw %fp,#0 48cd6: 202e 0010 movel %fp@(16),%d0 48cda: 2f0a movel %a2,%sp@- 48cdc: 246e 000c moveal %fp@(12),%a2 #endif /* * The thread is not waiting on anything after this completes. */ the_thread->Wait.queue = NULL; 48ce0: 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 ) ) { 48ce4: b2aa 0050 cmpl %a2@(80),%d1 48ce8: 671c beqs 48d06 <_Thread_blocking_operation_Cancel+0x36> _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); (void) _Watchdog_Remove( &the_thread->Timer ); } else _ISR_Enable( level ); 48cea: 46c0 movew %d0,%sr RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 48cec: 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 } 48cf0: 246e fffc moveal %fp@(-4),%a2 48cf4: 203c 1003 fff8 movel #268697592,%d0 48cfa: 2d40 000c movel %d0,%fp@(12) 48cfe: 4e5e unlk %fp 48d00: 4ef9 0004 8e1c jmp 48e1c <_Thread_Clear_state> RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 48d06: 123c 0003 moveb #3,%d1 48d0a: 2541 0050 movel %d1,%a2@(80) * If the sync state is timed out, this is very likely not needed. * But better safe than sorry when it comes to critical sections. */ if ( _Watchdog_Is_active( &the_thread->Timer ) ) { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 48d0e: 46c0 movew %d0,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 48d10: 486a 0048 pea %a2@(72) 48d14: 4eb9 0004 a160 jsr 4a160 <_Watchdog_Remove> 48d1a: 588f addql #4,%sp 48d1c: 203c 1003 fff8 movel #268697592,%d0 48d22: 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 } 48d26: 246e fffc moveal %fp@(-4),%a2 48d2a: 2d40 000c movel %d0,%fp@(12) 48d2e: 4e5e unlk %fp 48d30: 4ef9 0004 8e1c jmp 48e1c <_Thread_Clear_state> ... =============================================================================== 00049620 <_Thread_queue_Dequeue_priority>: Chain_Node *new_second_node; Chain_Node *last_node; Chain_Node *next_node; Chain_Node *previous_node; _ISR_Disable( level ); 49620: 203c 0000 0700 movel #1792,%d0 */ Thread_Control *_Thread_queue_Dequeue_priority( Thread_queue_Control *the_thread_queue ) { 49626: 4e56 ffe8 linkw %fp,#-24 4962a: 226e 0008 moveal %fp@(8),%a1 4962e: 48d7 3c0c moveml %d2-%d3/%a2-%a5,%sp@ Chain_Node *new_second_node; Chain_Node *last_node; Chain_Node *next_node; Chain_Node *previous_node; _ISR_Disable( level ); 49632: 40c3 movew %sr,%d3 49634: 8083 orl %d3,%d0 49636: 46c0 movew %d0,%sr for( index=0 ; 49638: 4280 clrl %d0 index < TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS ; index++ ) { if ( !_Chain_Is_empty( &the_thread_queue->Queues.Priority[ index ] ) ) { 4963a: 2400 movel %d0,%d2 4963c: 2200 movel %d0,%d1 Chain_Node *previous_node; _ISR_Disable( level ); for( index=0 ; index < TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS ; index++ ) { 4963e: 5280 addql #1,%d0 if ( !_Chain_Is_empty( &the_thread_queue->Queues.Priority[ index ] ) ) { 49640: e58a lsll #2,%d2 49642: e989 lsll #4,%d1 49644: 9282 subl %d2,%d1 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 49646: 41f1 1800 lea %a1@(00000000,%d1:l),%a0 4964a: 2458 moveal %a0@+,%a2 4964c: b1ca cmpal %a2,%a0 4964e: 6616 bnes 49666 <_Thread_queue_Dequeue_priority+0x46> Chain_Node *last_node; Chain_Node *next_node; Chain_Node *previous_node; _ISR_Disable( level ); for( index=0 ; 49650: 7204 moveq #4,%d1 49652: b280 cmpl %d0,%d1 49654: 66e4 bnes 4963a <_Thread_queue_Dequeue_priority+0x1a> } /* * We did not find a thread to unblock. */ _ISR_Enable( level ); 49656: 46c3 movew %d3,%sr return NULL; 49658: 95ca subal %a2,%a2 #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); #endif return( the_thread ); } 4965a: 200a movel %a2,%d0 4965c: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 49662: 4e5e unlk %fp 49664: 4e75 rts RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 49666: 200a movel %a2,%d0 49668: 0680 0000 003c addil #60,%d0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 4966e: 206a 0038 moveal %a2@(56),%a0 dequeue: the_thread->Wait.queue = NULL; new_first_node = _Chain_First( &the_thread->Wait.Block2n ); new_first_thread = (Thread_Control *) new_first_node; next_node = the_thread->Object.Node.next; 49672: 2252 moveal %a2@,%a1 previous_node = the_thread->Object.Node.previous; 49674: 266a 0004 moveal %a2@(4),%a3 */ _ISR_Enable( level ); return NULL; dequeue: the_thread->Wait.queue = NULL; 49678: 42aa 0044 clrl %a2@(68) new_first_node = _Chain_First( &the_thread->Wait.Block2n ); new_first_thread = (Thread_Control *) new_first_node; next_node = the_thread->Object.Node.next; previous_node = the_thread->Object.Node.previous; if ( !_Chain_Is_empty( &the_thread->Wait.Block2n ) ) { 4967c: b088 cmpl %a0,%d0 4967e: 6700 008a beqw 4970a <_Thread_queue_Dequeue_priority+0xea> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Last( Chain_Control *the_chain ) { return _Chain_Tail( the_chain )->previous; 49682: 286a 0040 moveal %a2@(64),%a4 last_node = _Chain_Last( &the_thread->Wait.Block2n ); new_second_node = new_first_node->next; 49686: 2a50 moveal %a0@,%a5 previous_node->next = new_first_node; next_node->previous = new_first_node; 49688: 2348 0004 movel %a0,%a1@(4) if ( !_Chain_Is_empty( &the_thread->Wait.Block2n ) ) { last_node = _Chain_Last( &the_thread->Wait.Block2n ); new_second_node = new_first_node->next; previous_node->next = new_first_node; 4968c: 2688 movel %a0,%a3@ next_node->previous = new_first_node; new_first_node->next = next_node; new_first_node->previous = previous_node; 4968e: 214b 0004 movel %a3,%a0@(4) last_node = _Chain_Last( &the_thread->Wait.Block2n ); new_second_node = new_first_node->next; previous_node->next = new_first_node; next_node->previous = new_first_node; new_first_node->next = next_node; 49692: 2089 movel %a1,%a0@ new_first_node->previous = previous_node; if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) { 49694: 226a 0040 moveal %a2@(64),%a1 49698: b3ea 0038 cmpal %a2@(56),%a1 4969c: 6716 beqs 496b4 <_Thread_queue_Dequeue_priority+0x94> /* > two threads on 2-n */ head = _Chain_Head( &new_first_thread->Wait.Block2n ); tail = _Chain_Tail( &new_first_thread->Wait.Block2n ); new_second_node->previous = head; head->next = new_second_node; 4969e: 214d 0038 movel %a5,%a0@(56) new_first_node->previous = previous_node; if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) { /* > two threads on 2-n */ head = _Chain_Head( &new_first_thread->Wait.Block2n ); tail = _Chain_Tail( &new_first_thread->Wait.Block2n ); 496a2: 43e8 003c lea %a0@(60),%a1 496a6: 2889 movel %a1,%a4@ new_first_node->next = next_node; new_first_node->previous = previous_node; if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) { /* > two threads on 2-n */ head = _Chain_Head( &new_first_thread->Wait.Block2n ); 496a8: 43e8 0038 lea %a0@(56),%a1 496ac: 2b49 0004 movel %a1,%a5@(4) tail = _Chain_Tail( &new_first_thread->Wait.Block2n ); new_second_node->previous = head; head->next = new_second_node; tail->previous = last_node; 496b0: 214c 0040 movel %a4,%a0@(64) } else { previous_node->next = next_node; next_node->previous = previous_node; } if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 496b4: 7002 moveq #2,%d0 496b6: b0aa 0050 cmpl %a2@(80),%d0 496ba: 671e beqs 496da <_Thread_queue_Dequeue_priority+0xba> _ISR_Enable( level ); 496bc: 46c3 movew %d3,%sr RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 496be: 2f3c 1003 fff8 movel #268697592,%sp@- 496c4: 2f0a movel %a2,%sp@- 496c6: 4eb9 0004 8e1c jsr 48e1c <_Thread_Clear_state> 496cc: 508f addql #8,%sp #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); #endif return( the_thread ); } 496ce: 200a movel %a2,%d0 496d0: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 496d6: 4e5e unlk %fp 496d8: 4e75 rts RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 496da: 7203 moveq #3,%d1 496dc: 2541 0050 movel %d1,%a2@(80) if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { _ISR_Enable( level ); _Thread_Unblock( the_thread ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 496e0: 46c3 movew %d3,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 496e2: 486a 0048 pea %a2@(72) 496e6: 4eb9 0004 a160 jsr 4a160 <_Watchdog_Remove> 496ec: 2f3c 1003 fff8 movel #268697592,%sp@- 496f2: 2f0a movel %a2,%sp@- 496f4: 4eb9 0004 8e1c jsr 48e1c <_Thread_Clear_state> 496fa: 4fef 000c lea %sp@(12),%sp #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); #endif return( the_thread ); } 496fe: 200a movel %a2,%d0 49700: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 49706: 4e5e unlk %fp 49708: 4e75 rts head->next = new_second_node; tail->previous = last_node; last_node->next = tail; } } else { previous_node->next = next_node; 4970a: 2689 movel %a1,%a3@ next_node->previous = previous_node; 4970c: 234b 0004 movel %a3,%a1@(4) 49710: 60a2 bras 496b4 <_Thread_queue_Dequeue_priority+0x94> ... =============================================================================== 000497bc <_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 ) { 497bc: 4e56 ffe0 linkw %fp,#-32 497c0: 48d7 1c7c moveml %d2-%d6/%a2-%a4,%sp@ 497c4: 266e 000c moveal %fp@(12),%a3 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); 497c8: 45eb 0038 lea %a3@(56),%a2 Chain_Node *tail = _Chain_Tail( the_chain ); 497cc: 41eb 003c lea %a3@(60),%a0 return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); 497d0: 2a3c 0000 0700 movel #1792,%d5 Priority_Control priority; States_Control block_state; _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; 497d6: 222b 0014 movel %a3@(20),%d1 RTEMS_INLINE_ROUTINE uint32_t _Thread_queue_Header_number ( Priority_Control the_priority ) { return (the_priority / TASK_QUEUE_DATA_PRIORITIES_PER_HEADER); 497da: 2001 movel %d1,%d0 497dc: ec88 lsrl #6,%d0 header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; 497de: 2400 movel %d0,%d2 497e0: e988 lsll #4,%d0 497e2: 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 ) { 497e4: 286e 0008 moveal %fp@(8),%a4 _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; 497e8: 9082 subl %d2,%d0 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); 497ea: 274a 0040 movel %a2,%a3@(64) block_state = the_thread_queue->state; 497ee: 242c 0038 movel %a4@(56),%d2 _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 ]; 497f2: 45f4 0800 lea %a4@(00000000,%d0:l),%a2 Chain_Node *tail = _Chain_Tail( the_chain ); 497f6: 2748 0038 movel %a0,%a3@(56) head->next = tail; head->previous = NULL; 497fa: 42ab 003c clrl %a3@(60) block_state = the_thread_queue->state; if ( _Thread_queue_Is_reverse_search( priority ) ) 497fe: 0801 0005 btst #5,%d1 49802: 6652 bnes 49856 <_Thread_queue_Enqueue_priority+0x9a> 49804: 2c0a movel %a2,%d6 49806: 5886 addql #4,%d6 goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); 49808: 2005 movel %d5,%d0 4980a: 40c3 movew %sr,%d3 4980c: 8083 orl %d3,%d0 4980e: 46c0 movew %d0,%sr 49810: 2803 movel %d3,%d4 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 49812: 2052 moveal %a2@,%a0 search_thread = (Thread_Control *) _Chain_First( header ); while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 49814: bc88 cmpl %a0,%d6 49816: 6700 010a beqw 49922 <_Thread_queue_Enqueue_priority+0x166> search_priority = search_thread->current_priority; 4981a: 2268 0014 moveal %a0@(20),%a1 if ( priority <= search_priority ) 4981e: b3c1 cmpal %d1,%a1 49820: 6418 bccs 4983a <_Thread_queue_Enqueue_priority+0x7e> break; search_priority = search_thread->current_priority; if ( priority <= search_priority ) break; #endif _ISR_Flash( level ); 49822: 2005 movel %d5,%d0 49824: 46c3 movew %d3,%sr 49826: 8083 orl %d3,%d0 49828: 46c0 movew %d0,%sr RTEMS_INLINE_ROUTINE bool _States_Are_set ( States_Control the_states, States_Control mask ) { return ( (the_states & mask) != STATES_READY); 4982a: 2002 movel %d2,%d0 4982c: c0a8 0010 andl %a0@(16),%d0 if ( !_States_Are_set( search_thread->current_state, block_state) ) { 49830: 6700 0090 beqw 498c2 <_Thread_queue_Enqueue_priority+0x106> _ISR_Enable( level ); goto restart_forward_search; } search_thread = 49834: 2050 moveal %a0@,%a0 restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); search_thread = (Thread_Control *) _Chain_First( header ); while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 49836: bc88 cmpl %a0,%d6 49838: 66e0 bnes 4981a <_Thread_queue_Enqueue_priority+0x5e> } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 4983a: 202c 0030 movel %a4@(48),%d0 4983e: 7401 moveq #1,%d2 49840: b480 cmpl %d0,%d2 49842: 6700 0094 beqw 498d8 <_Thread_queue_Enqueue_priority+0x11c> * For example, the blocking thread could have been given * the mutex by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ *level_p = level; 49846: 206e 0010 moveal %fp@(16),%a0 4984a: 2084 movel %d4,%a0@ return the_thread_queue->sync_state; } 4984c: 4cd7 1c7c moveml %sp@,%d2-%d6/%a2-%a4 49850: 4e5e unlk %fp 49852: 4e75 rts if ( priority >= search_priority ) break; #endif _ISR_Flash( level ); if ( !_States_Are_set( search_thread->current_state, block_state) ) { _ISR_Enable( level ); 49854: 46c3 movew %d3,%sr the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 49856: 4283 clrl %d3 49858: 1639 0005 f6aa moveb 5f6aa ,%d3 _ISR_Disable( level ); 4985e: 2005 movel %d5,%d0 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 49860: 2243 moveal %d3,%a1 49862: 5289 addql #1,%a1 _ISR_Disable( level ); 49864: 40c3 movew %sr,%d3 49866: 8083 orl %d3,%d0 49868: 46c0 movew %d0,%sr 4986a: 2803 movel %d3,%d4 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Last( Chain_Control *the_chain ) { return _Chain_Tail( the_chain )->previous; 4986c: 206a 0008 moveal %a2@(8),%a0 search_thread = (Thread_Control *) _Chain_Last( header ); while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 49870: b5c8 cmpal %a0,%a2 49872: 6720 beqs 49894 <_Thread_queue_Enqueue_priority+0xd8> search_priority = search_thread->current_priority; 49874: 2268 0014 moveal %a0@(20),%a1 if ( priority >= search_priority ) 49878: b3c1 cmpal %d1,%a1 4987a: 6318 blss 49894 <_Thread_queue_Enqueue_priority+0xd8> break; search_priority = search_thread->current_priority; if ( priority >= search_priority ) break; #endif _ISR_Flash( level ); 4987c: 2005 movel %d5,%d0 4987e: 46c3 movew %d3,%sr 49880: 8083 orl %d3,%d0 49882: 46c0 movew %d0,%sr 49884: 2002 movel %d2,%d0 49886: c0a8 0010 andl %a0@(16),%d0 if ( !_States_Are_set( search_thread->current_state, block_state) ) { 4988a: 67c8 beqs 49854 <_Thread_queue_Enqueue_priority+0x98> _ISR_Enable( level ); goto restart_reverse_search; } search_thread = (Thread_Control *) 4988c: 2068 0004 moveal %a0@(4),%a0 restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); search_thread = (Thread_Control *) _Chain_Last( header ); while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 49890: b5c8 cmpal %a0,%a2 49892: 66e0 bnes 49874 <_Thread_queue_Enqueue_priority+0xb8> } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 49894: 202c 0030 movel %a4@(48),%d0 49898: 7401 moveq #1,%d2 4989a: b480 cmpl %d0,%d2 4989c: 66a8 bnes 49846 <_Thread_queue_Enqueue_priority+0x8a> THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 4989e: 42ac 0030 clrl %a4@(48) if ( priority == search_priority ) 498a2: b3c1 cmpal %d1,%a1 498a4: 6758 beqs 498fe <_Thread_queue_Enqueue_priority+0x142><== NEVER TAKEN goto equal_priority; search_node = (Chain_Node *) search_thread; next_node = search_node->next; 498a6: 2250 moveal %a0@,%a1 the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; 498a8: 2748 0004 movel %a0,%a3@(4) search_node = (Chain_Node *) search_thread; next_node = search_node->next; the_node = (Chain_Node *) the_thread; the_node->next = next_node; 498ac: 2689 movel %a1,%a3@ the_node->previous = search_node; search_node->next = the_node; next_node->previous = the_node; 498ae: 234b 0004 movel %a3,%a1@(4) 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; 498b2: 208b movel %a3,%a0@ next_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 498b4: 274c 0044 movel %a4,%a3@(68) _ISR_Enable( level ); 498b8: 46c3 movew %d3,%sr * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; } 498ba: 4cd7 1c7c moveml %sp@,%d2-%d6/%a2-%a4 498be: 4e5e unlk %fp 498c0: 4e75 rts if ( priority <= search_priority ) break; #endif _ISR_Flash( level ); if ( !_States_Are_set( search_thread->current_state, block_state) ) { _ISR_Enable( level ); 498c2: 46c3 movew %d3,%sr if ( _Thread_queue_Is_reverse_search( priority ) ) goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); 498c4: 2005 movel %d5,%d0 498c6: 40c3 movew %sr,%d3 498c8: 8083 orl %d3,%d0 498ca: 46c0 movew %d0,%sr 498cc: 2803 movel %d3,%d4 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 498ce: 2052 moveal %a2@,%a0 search_thread = (Thread_Control *) _Chain_First( header ); while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 498d0: bc88 cmpl %a0,%d6 498d2: 6600 ff46 bnew 4981a <_Thread_queue_Enqueue_priority+0x5e> 498d6: 604a bras 49922 <_Thread_queue_Enqueue_priority+0x166> if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 498d8: 42ac 0030 clrl %a4@(48) if ( priority == search_priority ) 498dc: b3c1 cmpal %d1,%a1 498de: 671e beqs 498fe <_Thread_queue_Enqueue_priority+0x142> goto equal_priority; search_node = (Chain_Node *) search_thread; previous_node = search_node->previous; 498e0: 2268 0004 moveal %a0@(4),%a1 the_node = (Chain_Node *) the_thread; the_node->next = search_node; 498e4: 2688 movel %a0,%a3@ the_node->previous = previous_node; 498e6: 2749 0004 movel %a1,%a3@(4) previous_node->next = the_node; 498ea: 228b movel %a3,%a1@ search_node->previous = the_node; 498ec: 214b 0004 movel %a3,%a0@(4) the_thread->Wait.queue = the_thread_queue; 498f0: 274c 0044 movel %a4,%a3@(68) _ISR_Enable( level ); 498f4: 46c3 movew %d3,%sr * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; } 498f6: 4cd7 1c7c moveml %sp@,%d2-%d6/%a2-%a4 498fa: 4e5e unlk %fp 498fc: 4e75 rts _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; equal_priority: /* add at end of priority group */ search_node = _Chain_Tail( &search_thread->Wait.Block2n ); previous_node = search_node->previous; 498fe: 2268 0040 moveal %a0@(64),%a1 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; equal_priority: /* add at end of priority group */ search_node = _Chain_Tail( &search_thread->Wait.Block2n ); 49902: 45e8 003c lea %a0@(60),%a2 previous_node = search_node->previous; the_node = (Chain_Node *) the_thread; the_node->next = search_node; the_node->previous = previous_node; 49906: 2749 0004 movel %a1,%a3@(4) the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; equal_priority: /* add at end of priority group */ search_node = _Chain_Tail( &search_thread->Wait.Block2n ); 4990a: 268a movel %a2,%a3@ the_node = (Chain_Node *) the_thread; the_node->next = search_node; the_node->previous = previous_node; previous_node->next = the_node; search_node->previous = the_node; 4990c: 214b 0040 movel %a3,%a0@(64) 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; 49910: 228b movel %a3,%a1@ search_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 49912: 274c 0044 movel %a4,%a3@(68) _ISR_Enable( level ); 49916: 46c4 movew %d4,%sr return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 49918: 7001 moveq #1,%d0 * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; } 4991a: 4cd7 1c7c moveml %sp@,%d2-%d6/%a2-%a4 4991e: 4e5e unlk %fp 49920: 4e75 rts } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 49922: 202c 0030 movel %a4@(48),%d0 if ( _Thread_queue_Is_reverse_search( priority ) ) goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; 49926: 327c ffff moveaw #-1,%a1 } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 4992a: 7401 moveq #1,%d2 4992c: b480 cmpl %d0,%d2 4992e: 6600 ff16 bnew 49846 <_Thread_queue_Enqueue_priority+0x8a> 49932: 60a4 bras 498d8 <_Thread_queue_Enqueue_priority+0x11c> =============================================================================== 0004ef28 <_Thread_queue_Extract_fifo>: Thread_Control *the_thread ) { ISR_Level level; _ISR_Disable( level ); 4ef28: 203c 0000 0700 movel #1792,%d0 void _Thread_queue_Extract_fifo( Thread_queue_Control *the_thread_queue __attribute__((unused)), Thread_Control *the_thread ) { 4ef2e: 4e56 0000 linkw %fp,#0 4ef32: 2f0a movel %a2,%sp@- 4ef34: 246e 000c moveal %fp@(12),%a2 ISR_Level level; _ISR_Disable( level ); 4ef38: 40c1 movew %sr,%d1 4ef3a: 8081 orl %d1,%d0 4ef3c: 46c0 movew %d0,%sr 4ef3e: 202a 0010 movel %a2@(16),%d0 4ef42: 0280 0003 bee0 andil #245472,%d0 if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 4ef48: 6734 beqs 4ef7e <_Thread_queue_Extract_fifo+0x56> ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 4ef4a: 2252 moveal %a2@,%a1 _Chain_Extract_unprotected( &the_thread->Object.Node ); the_thread->Wait.queue = NULL; if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 4ef4c: 7002 moveq #2,%d0 previous = the_node->previous; 4ef4e: 206a 0004 moveal %a2@(4),%a0 next->previous = previous; 4ef52: 2348 0004 movel %a0,%a1@(4) previous->next = next; 4ef56: 2089 movel %a1,%a0@ return; } _Chain_Extract_unprotected( &the_thread->Object.Node ); the_thread->Wait.queue = NULL; 4ef58: 42aa 0044 clrl %a2@(68) if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 4ef5c: b0aa 0050 cmpl %a2@(80),%d0 4ef60: 6726 beqs 4ef88 <_Thread_queue_Extract_fifo+0x60> _ISR_Enable( level ); 4ef62: 46c1 movew %d1,%sr RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 4ef64: 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 } 4ef68: 246e fffc moveal %fp@(-4),%a2 4ef6c: 203c 1003 fff8 movel #268697592,%d0 4ef72: 2d40 000c movel %d0,%fp@(12) 4ef76: 4e5e unlk %fp 4ef78: 4ef9 0004 8e1c jmp 48e1c <_Thread_Clear_state> ISR_Level level; _ISR_Disable( level ); if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { _ISR_Enable( level ); 4ef7e: 46c1 movew %d1,%sr #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); #endif } 4ef80: 246e fffc moveal %fp@(-4),%a2 4ef84: 4e5e unlk %fp 4ef86: 4e75 rts 4ef88: 7003 moveq #3,%d0 4ef8a: 2540 0050 movel %d0,%a2@(80) if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { _ISR_Enable( level ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 4ef8e: 46c1 movew %d1,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 4ef90: 486a 0048 pea %a2@(72) 4ef94: 4eb9 0004 a160 jsr 4a160 <_Watchdog_Remove> 4ef9a: 588f addql #4,%sp 4ef9c: 203c 1003 fff8 movel #268697592,%d0 4efa2: 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 } 4efa6: 246e fffc moveal %fp@(-4),%a2 4efaa: 2d40 000c movel %d0,%fp@(12) 4efae: 4e5e unlk %fp 4efb0: 4ef9 0004 8e1c jmp 48e1c <_Thread_Clear_state> ... =============================================================================== 0004d2bc <_Thread_queue_Extract_priority_helper>: Chain_Node *new_first_node; Chain_Node *new_second_node; Chain_Node *last_node; the_node = (Chain_Node *) the_thread; _ISR_Disable( level ); 4d2bc: 203c 0000 0700 movel #1792,%d0 void _Thread_queue_Extract_priority_helper( Thread_queue_Control *the_thread_queue __attribute__((unused)), Thread_Control *the_thread, bool requeuing ) { 4d2c2: 4e56 ffec linkw %fp,#-20 4d2c6: 48d7 3c04 moveml %d2/%a2-%a5,%sp@ 4d2ca: 246e 000c moveal %fp@(12),%a2 4d2ce: 142e 0013 moveb %fp@(19),%d2 Chain_Node *new_first_node; Chain_Node *new_second_node; Chain_Node *last_node; the_node = (Chain_Node *) the_thread; _ISR_Disable( level ); 4d2d2: 40c1 movew %sr,%d1 4d2d4: 8081 orl %d1,%d0 4d2d6: 46c0 movew %d0,%sr */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue ( States_Control the_states ) { return (the_states & STATES_WAITING_ON_THREAD_QUEUE); 4d2d8: 202a 0010 movel %a2@(16),%d0 4d2dc: 0280 0003 bee0 andil #245472,%d0 if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 4d2e2: 6772 beqs 4d356 <_Thread_queue_Extract_priority_helper+0x9a> RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 4d2e4: 200a movel %a2,%d0 4d2e6: 0680 0000 003c addil #60,%d0 /* * The thread was actually waiting on a thread queue so let's remove it. */ next_node = the_node->next; 4d2ec: 2252 moveal %a2@,%a1 previous_node = the_node->previous; 4d2ee: 266a 0004 moveal %a2@(4),%a3 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 4d2f2: 206a 0038 moveal %a2@(56),%a0 if ( !_Chain_Is_empty( &the_thread->Wait.Block2n ) ) { 4d2f6: b088 cmpl %a0,%d0 4d2f8: 6768 beqs 4d362 <_Thread_queue_Extract_priority_helper+0xa6> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Last( Chain_Control *the_chain ) { return _Chain_Tail( the_chain )->previous; 4d2fa: 286a 0040 moveal %a2@(64),%a4 new_first_node = _Chain_First( &the_thread->Wait.Block2n ); new_first_thread = (Thread_Control *) new_first_node; last_node = _Chain_Last( &the_thread->Wait.Block2n ); new_second_node = new_first_node->next; 4d2fe: 2a50 moveal %a0@,%a5 previous_node->next = new_first_node; next_node->previous = new_first_node; 4d300: 2348 0004 movel %a0,%a1@(4) new_first_node = _Chain_First( &the_thread->Wait.Block2n ); new_first_thread = (Thread_Control *) new_first_node; last_node = _Chain_Last( &the_thread->Wait.Block2n ); new_second_node = new_first_node->next; previous_node->next = new_first_node; 4d304: 2688 movel %a0,%a3@ next_node->previous = new_first_node; new_first_node->next = next_node; new_first_node->previous = previous_node; 4d306: 214b 0004 movel %a3,%a0@(4) if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) { 4d30a: 202a 0040 movel %a2@(64),%d0 last_node = _Chain_Last( &the_thread->Wait.Block2n ); new_second_node = new_first_node->next; previous_node->next = new_first_node; next_node->previous = new_first_node; new_first_node->next = next_node; 4d30e: 2089 movel %a1,%a0@ new_first_node->previous = previous_node; if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) { 4d310: b0aa 0038 cmpl %a2@(56),%d0 4d314: 6716 beqs 4d32c <_Thread_queue_Extract_priority_helper+0x70> /* > two threads on 2-n */ head = _Chain_Head( &new_first_thread->Wait.Block2n ); tail = _Chain_Tail( &new_first_thread->Wait.Block2n ); new_second_node->previous = head; head->next = new_second_node; 4d316: 214d 0038 movel %a5,%a0@(56) new_first_node->previous = previous_node; if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) { /* > two threads on 2-n */ head = _Chain_Head( &new_first_thread->Wait.Block2n ); tail = _Chain_Tail( &new_first_thread->Wait.Block2n ); 4d31a: 43e8 003c lea %a0@(60),%a1 4d31e: 2889 movel %a1,%a4@ new_first_node->next = next_node; new_first_node->previous = previous_node; if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) { /* > two threads on 2-n */ head = _Chain_Head( &new_first_thread->Wait.Block2n ); 4d320: 43e8 0038 lea %a0@(56),%a1 4d324: 2b49 0004 movel %a1,%a5@(4) tail = _Chain_Tail( &new_first_thread->Wait.Block2n ); new_second_node->previous = head; head->next = new_second_node; tail->previous = last_node; 4d328: 214c 0040 movel %a4,%a0@(64) /* * If we are not supposed to touch timers or the thread's state, return. */ if ( requeuing ) { 4d32c: 4a02 tstb %d2 4d32e: 6626 bnes 4d356 <_Thread_queue_Extract_priority_helper+0x9a> _ISR_Enable( level ); return; } if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 4d330: 7002 moveq #2,%d0 4d332: b0aa 0050 cmpl %a2@(80),%d0 4d336: 6736 beqs 4d36e <_Thread_queue_Extract_priority_helper+0xb2> _ISR_Enable( level ); 4d338: 46c1 movew %d1,%sr 4d33a: 2d4a 0008 movel %a2,%fp@(8) 4d33e: 227c 1003 fff8 moveal #268697592,%a1 #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); #endif } 4d344: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 4d34a: 2d49 000c movel %a1,%fp@(12) 4d34e: 4e5e unlk %fp 4d350: 4ef9 0004 8e1c jmp 48e1c <_Thread_Clear_state> /* * If we are not supposed to touch timers or the thread's state, return. */ if ( requeuing ) { _ISR_Enable( level ); 4d356: 46c1 movew %d1,%sr #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); #endif } 4d358: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 4d35e: 4e5e unlk %fp 4d360: 4e75 rts head->next = new_second_node; tail->previous = last_node; last_node->next = tail; } } else { previous_node->next = next_node; 4d362: 2689 movel %a1,%a3@ next_node->previous = previous_node; 4d364: 234b 0004 movel %a3,%a1@(4) /* * If we are not supposed to touch timers or the thread's state, return. */ if ( requeuing ) { 4d368: 4a02 tstb %d2 4d36a: 67c4 beqs 4d330 <_Thread_queue_Extract_priority_helper+0x74> 4d36c: 60e8 bras 4d356 <_Thread_queue_Extract_priority_helper+0x9a> 4d36e: 7003 moveq #3,%d0 4d370: 2540 0050 movel %d0,%a2@(80) if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { _ISR_Enable( level ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 4d374: 46c1 movew %d1,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 4d376: 486a 0048 pea %a2@(72) 4d37a: 4eb9 0004 a160 jsr 4a160 <_Watchdog_Remove> 4d380: 588f addql #4,%sp 4d382: 227c 1003 fff8 moveal #268697592,%a1 4d388: 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 } 4d38c: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 4d392: 2d49 000c movel %a1,%fp@(12) 4d396: 4e5e unlk %fp 4d398: 4ef9 0004 8e1c jmp 48e1c <_Thread_Clear_state> ... =============================================================================== 000499a0 <_Thread_queue_Initialize>: the_thread_queue->state = state; the_thread_queue->discipline = the_discipline; the_thread_queue->timeout_status = timeout_status; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( the_discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) { 499a0: 7201 moveq #1,%d1 Thread_queue_Control *the_thread_queue, Thread_queue_Disciplines the_discipline, States_Control state, uint32_t timeout_status ) { 499a2: 4e56 0000 linkw %fp,#0 499a6: 206e 0008 moveal %fp@(8),%a0 499aa: 2f02 movel %d2,%sp@- 499ac: 202e 000c movel %fp@(12),%d0 the_thread_queue->state = state; 499b0: 216e 0010 0038 movel %fp@(16),%a0@(56) the_thread_queue->discipline = the_discipline; the_thread_queue->timeout_status = timeout_status; 499b6: 216e 0014 003c movel %fp@(20),%a0@(60) States_Control state, uint32_t timeout_status ) { the_thread_queue->state = state; the_thread_queue->discipline = the_discipline; 499bc: 2140 0034 movel %d0,%a0@(52) the_thread_queue->timeout_status = timeout_status; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 499c0: 42a8 0030 clrl %a0@(48) if ( the_discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) { 499c4: b280 cmpl %d0,%d1 499c6: 6714 beqs 499dc <_Thread_queue_Initialize+0x3c> RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 499c8: 2008 movel %a0,%d0 499ca: 5880 addql #4,%d0 head->next = tail; head->previous = NULL; 499cc: 42a8 0004 clrl %a0@(4) RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 499d0: 2080 movel %d0,%a0@ head->next = tail; head->previous = NULL; tail->previous = head; 499d2: 2148 0008 movel %a0,%a0@(8) _Chain_Initialize_empty( &the_thread_queue->Queues.Priority[index] ); } else { /* must be THREAD_QUEUE_DISCIPLINE_FIFO */ _Chain_Initialize_empty( &the_thread_queue->Queues.Fifo ); } } 499d6: 241f movel %sp@+,%d2 499d8: 4e5e unlk %fp 499da: 4e75 rts the_thread_queue->state = state; the_thread_queue->discipline = the_discipline; the_thread_queue->timeout_status = timeout_status; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( the_discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) { 499dc: 4280 clrl %d0 uint32_t index; for( index=0 ; index < TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS ; index++) _Chain_Initialize_empty( &the_thread_queue->Queues.Priority[index] ); 499de: 2400 movel %d0,%d2 499e0: 2200 movel %d0,%d1 if ( the_discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) { uint32_t index; for( index=0 ; index < TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS ; index++) 499e2: 5280 addql #1,%d0 _Chain_Initialize_empty( &the_thread_queue->Queues.Priority[index] ); 499e4: e58a lsll #2,%d2 499e6: e989 lsll #4,%d1 499e8: 9282 subl %d2,%d1 499ea: 43f0 1800 lea %a0@(00000000,%d1:l),%a1 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 499ee: 2209 movel %a1,%d1 499f0: 5881 addql #4,%d1 499f2: 2281 movel %d1,%a1@ the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( the_discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) { uint32_t index; for( index=0 ; 499f4: 7204 moveq #4,%d1 head->next = tail; head->previous = NULL; 499f6: 42a9 0004 clrl %a1@(4) tail->previous = head; 499fa: 2349 0008 movel %a1,%a1@(8) 499fe: b280 cmpl %d0,%d1 49a00: 67d4 beqs 499d6 <_Thread_queue_Initialize+0x36> <== NEVER TAKEN index < TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS ; index++) _Chain_Initialize_empty( &the_thread_queue->Queues.Priority[index] ); 49a02: 2400 movel %d0,%d2 49a04: 2200 movel %d0,%d1 if ( the_discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) { uint32_t index; for( index=0 ; index < TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS ; index++) 49a06: 5280 addql #1,%d0 _Chain_Initialize_empty( &the_thread_queue->Queues.Priority[index] ); 49a08: e58a lsll #2,%d2 49a0a: e989 lsll #4,%d1 49a0c: 9282 subl %d2,%d1 49a0e: 43f0 1800 lea %a0@(00000000,%d1:l),%a1 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 49a12: 2209 movel %a1,%d1 49a14: 5881 addql #4,%d1 49a16: 2281 movel %d1,%a1@ the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( the_discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) { uint32_t index; for( index=0 ; 49a18: 7204 moveq #4,%d1 head->next = tail; head->previous = NULL; 49a1a: 42a9 0004 clrl %a1@(4) tail->previous = head; 49a1e: 2349 0008 movel %a1,%a1@(8) 49a22: b280 cmpl %d0,%d1 49a24: 66b8 bnes 499de <_Thread_queue_Initialize+0x3e> 49a26: 60ae bras 499d6 <_Thread_queue_Initialize+0x36> =============================================================================== 00049a28 <_Thread_queue_Requeue>: void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { 49a28: 4e56 fff0 linkw %fp,#-16 49a2c: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 49a30: 246e 0008 moveal %fp@(8),%a2 49a34: 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 ) 49a38: 4a8a tstl %a2 49a3a: 6708 beqs 49a44 <_Thread_queue_Requeue+0x1c> <== 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 ) { 49a3c: 7001 moveq #1,%d0 49a3e: b0aa 0034 cmpl %a2@(52),%d0 49a42: 670a beqs 49a4e <_Thread_queue_Requeue+0x26> <== ALWAYS TAKEN _Thread_queue_Extract_priority_helper( tq, the_thread, true ); (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); } _ISR_Enable( level ); } } 49a44: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3 <== NOT EXECUTED 49a4a: 4e5e unlk %fp <== NOT EXECUTED 49a4c: 4e75 rts <== NOT EXECUTED if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) { Thread_queue_Control *tq = the_thread_queue; ISR_Level level; ISR_Level level_ignored; _ISR_Disable( level ); 49a4e: 303c 0700 movew #1792,%d0 49a52: 40c2 movew %sr,%d2 49a54: 8082 orl %d2,%d0 49a56: 46c0 movew %d0,%sr 49a58: 202b 0010 movel %a3@(16),%d0 49a5c: 0280 0003 bee0 andil #245472,%d0 if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 49a62: 660c bnes 49a70 <_Thread_queue_Requeue+0x48> <== ALWAYS TAKEN _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); } _ISR_Enable( level ); 49a64: 46c2 movew %d2,%sr <== NOT EXECUTED } } 49a66: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3 49a6c: 4e5e unlk %fp 49a6e: 4e75 rts ISR_Level level_ignored; _ISR_Disable( level ); if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); 49a70: 4878 0001 pea 1 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; 49a74: 7001 moveq #1,%d0 49a76: 2f0b movel %a3,%sp@- 49a78: 2540 0030 movel %d0,%a2@(48) 49a7c: 2f0a movel %a2,%sp@- 49a7e: 4eb9 0004 d2bc jsr 4d2bc <_Thread_queue_Extract_priority_helper> (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); 49a84: 486e fffc pea %fp@(-4) 49a88: 2f0b movel %a3,%sp@- 49a8a: 2f0a movel %a2,%sp@- 49a8c: 4eb9 0004 97bc jsr 497bc <_Thread_queue_Enqueue_priority> 49a92: 4fef 0018 lea %sp@(24),%sp } _ISR_Enable( level ); 49a96: 46c2 movew %d2,%sr 49a98: 60cc bras 49a66 <_Thread_queue_Requeue+0x3e> ... =============================================================================== 00049a9c <_Thread_queue_Timeout>: void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { 49a9c: 4e56 fffc linkw %fp,#-4 Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 49aa0: 486e fffc pea %fp@(-4) 49aa4: 2f2e 0008 movel %fp@(8),%sp@- 49aa8: 4eb9 0004 9240 jsr 49240 <_Thread_Get> switch ( location ) { 49aae: 508f addql #8,%sp 49ab0: 4aae fffc tstl %fp@(-4) 49ab4: 661e bnes 49ad4 <_Thread_queue_Timeout+0x38> <== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 49ab6: 2f00 movel %d0,%sp@- 49ab8: 4eb9 0004 d3a0 jsr 4d3a0 <_Thread_queue_Process_timeout> * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { _Thread_Dispatch_disable_level--; return _Thread_Dispatch_disable_level; 49abe: 588f addql #4,%sp * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { _Thread_Dispatch_disable_level--; 49ac0: 2039 0006 1048 movel 61048 <_Thread_Dispatch_disable_level>,%d0 49ac6: 5380 subql #1,%d0 49ac8: 23c0 0006 1048 movel %d0,61048 <_Thread_Dispatch_disable_level> return _Thread_Dispatch_disable_level; 49ace: 2039 0006 1048 movel 61048 <_Thread_Dispatch_disable_level>,%d0 _Thread_Unnest_dispatch(); break; } } 49ad4: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00057684 <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 57684: 4e56 ffb0 linkw %fp,#-80 Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; tail->previous = head; 57688: 41ee ffe8 lea %fp@(-24),%a0 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 5768c: 200e movel %fp,%d0 5768e: 5180 subql #8,%d0 57690: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 57694: 246e 0008 moveal %fp@(8),%a2 57698: 260e movel %fp,%d3 5769a: 2c0e movel %fp,%d6 5769c: 0683 ffff fff4 addil #-12,%d3 576a2: 0686 ffff ffec addil #-20,%d6 576a8: 240a movel %a2,%d2 576aa: 2a0a movel %a2,%d5 576ac: 4bf9 0005 bcd4 lea 5bcd4 <_Watchdog_Adjust_to_chain>,%a5 576b2: 0682 0000 0030 addil #48,%d2 576b8: 0685 0000 0068 addil #104,%d5 576be: 47f9 0005 82bc lea 582bc <_Chain_Get>,%a3 576c4: 49f9 0005 bd5c lea 5bd5c <_Watchdog_Insert>,%a4 * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); 576ca: 283c 0000 0700 movel #1792,%d4 head->previous = NULL; tail->previous = head; 576d0: 2d48 fff0 movel %a0,%fp@(-16) 576d4: 41ea 0008 lea %a2@(8),%a0 576d8: 2d48 ffe4 movel %a0,%fp@(-28) 576dc: 41ea 0040 lea %a2@(64),%a0 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 576e0: 2d40 fff4 movel %d0,%fp@(-12) head->previous = NULL; 576e4: 42ae ffec clrl %fp@(-20) 576e8: 42ae fff8 clrl %fp@(-8) tail->previous = head; 576ec: 2d43 fffc movel %d3,%fp@(-4) 576f0: 2d40 ffd8 movel %d0,%fp@(-40) 576f4: 2d48 ffe0 movel %a0,%fp@(-32) ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 576f8: 2d46 ffe8 movel %d6,%fp@(-24) { /* * 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; 576fc: 41ee ffe8 lea %fp@(-24),%a0 57700: 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; 57704: 2039 0007 de4e movel 7de4e <_Watchdog_Ticks_since_boot>,%d0 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 5770a: 222a 003c movel %a2@(60),%d1 watchdogs->last_snapshot = snapshot; 5770e: 2540 003c movel %d0,%a2@(60) _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 57712: 9081 subl %d1,%d0 57714: 2f03 movel %d3,%sp@- 57716: 2f00 movel %d0,%sp@- 57718: 2f02 movel %d2,%sp@- 5771a: 4e95 jsr %a5@ static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 5771c: 2039 0007 ddd6 movel 7ddd6 <_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 ) { 57722: 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; 57726: 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 ) { 5772a: b280 cmpl %d0,%d1 5772c: 6500 0086 bcsw 577b4 <_Timer_server_Body+0x130> * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); } else if ( snapshot < last_snapshot ) { 57730: b280 cmpl %d0,%d1 57732: 6200 00a4 bhiw 577d8 <_Timer_server_Body+0x154> */ delta = last_snapshot - snapshot; _Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta ); } watchdogs->last_snapshot = snapshot; 57736: 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 ); 5773a: 202a 0078 movel %a2@(120),%d0 5773e: 2f00 movel %d0,%sp@- 57740: 4e93 jsr %a3@ if ( timer == NULL ) { 57742: 588f addql #4,%sp 57744: 4a80 tstl %d0 57746: 672e beqs 57776 <_Timer_server_Body+0xf2> <== ALWAYS TAKEN static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 57748: 2040 moveal %d0,%a0 <== NOT EXECUTED 5774a: 7e01 moveq #1,%d7 <== NOT EXECUTED 5774c: 2228 0038 movel %a0@(56),%d1 <== NOT EXECUTED 57750: be81 cmpl %d1,%d7 <== NOT EXECUTED 57752: 6700 00a8 beqw 577fc <_Timer_server_Body+0x178> <== NOT EXECUTED _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 57756: 7e03 moveq #3,%d7 <== NOT EXECUTED 57758: be81 cmpl %d1,%d7 <== NOT EXECUTED 5775a: 66de bnes 5773a <_Timer_server_Body+0xb6> <== NOT EXECUTED _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 5775c: 2040 moveal %d0,%a0 <== NOT EXECUTED 5775e: 4868 0010 pea %a0@(16) <== NOT EXECUTED 57762: 2f05 movel %d5,%sp@- <== NOT EXECUTED 57764: 4e94 jsr %a4@ <== NOT EXECUTED } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 57766: 202a 0078 movel %a2@(120),%d0 <== NOT EXECUTED ) { 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 ); 5776a: 508f addql #8,%sp <== NOT EXECUTED } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 5776c: 2f00 movel %d0,%sp@- <== NOT EXECUTED 5776e: 4e93 jsr %a3@ <== NOT EXECUTED if ( timer == NULL ) { 57770: 588f addql #4,%sp <== NOT EXECUTED 57772: 4a80 tstl %d0 <== NOT EXECUTED 57774: 66d2 bnes 57748 <_Timer_server_Body+0xc4> <== NOT EXECUTED * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); 57776: 2004 movel %d4,%d0 57778: 40c1 movew %sr,%d1 5777a: 8081 orl %d1,%d0 5777c: 46c0 movew %d0,%sr if ( _Chain_Is_empty( insert_chain ) ) { 5777e: bcae ffe8 cmpl %fp@(-24),%d6 57782: 6700 0086 beqw 5780a <_Timer_server_Body+0x186> ts->insert_chain = NULL; _ISR_Enable( level ); break; } else { _ISR_Enable( level ); 57786: 46c1 movew %d1,%sr <== NOT EXECUTED static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 57788: 2039 0007 de4e movel 7de4e <_Watchdog_Ticks_since_boot>,%d0<== NOT EXECUTED /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 5778e: 222a 003c movel %a2@(60),%d1 <== NOT EXECUTED watchdogs->last_snapshot = snapshot; 57792: 2540 003c movel %d0,%a2@(60) <== NOT EXECUTED _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 57796: 9081 subl %d1,%d0 <== NOT EXECUTED 57798: 2f03 movel %d3,%sp@- <== NOT EXECUTED 5779a: 2f00 movel %d0,%sp@- <== NOT EXECUTED 5779c: 2f02 movel %d2,%sp@- <== NOT EXECUTED 5779e: 4e95 jsr %a5@ <== NOT EXECUTED static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 577a0: 2039 0007 ddd6 movel 7ddd6 <_TOD_Now>,%d0 <== NOT EXECUTED /* * Process the seconds chain. Start by checking that the Time * of Day (TOD) has not been set backwards. If it has then * we want to adjust the watchdogs->Chain to indicate this. */ if ( snapshot > last_snapshot ) { 577a6: 4fef 000c lea %sp@(12),%sp <== NOT EXECUTED Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); Watchdog_Interval last_snapshot = watchdogs->last_snapshot; 577aa: 222a 0074 movel %a2@(116),%d1 <== NOT EXECUTED /* * Process the seconds chain. Start by checking that the Time * of Day (TOD) has not been set backwards. If it has then * we want to adjust the watchdogs->Chain to indicate this. */ if ( snapshot > last_snapshot ) { 577ae: b280 cmpl %d0,%d1 <== NOT EXECUTED 577b0: 6400 ff7e bccw 57730 <_Timer_server_Body+0xac> <== NOT EXECUTED /* * This path is for normal forward movement and cases where the * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 577b4: 2f03 movel %d3,%sp@- 577b6: 2e00 movel %d0,%d7 577b8: 9e81 subl %d1,%d7 577ba: 2f07 movel %d7,%sp@- 577bc: 2d40 ffdc movel %d0,%fp@(-36) 577c0: 2f05 movel %d5,%sp@- 577c2: 4eb9 0005 bcd4 jsr 5bcd4 <_Watchdog_Adjust_to_chain> 577c8: 202e ffdc movel %fp@(-36),%d0 577cc: 4fef 000c lea %sp@(12),%sp */ delta = last_snapshot - snapshot; _Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta ); } watchdogs->last_snapshot = snapshot; 577d0: 2540 0074 movel %d0,%a2@(116) 577d4: 6000 ff64 braw 5773a <_Timer_server_Body+0xb6> /* * The current TOD is before the last TOD which indicates that * TOD has been set backwards. */ delta = last_snapshot - snapshot; _Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta ); 577d8: 9280 subl %d0,%d1 577da: 2f01 movel %d1,%sp@- 577dc: 4878 0001 pea 1 577e0: 2d40 ffdc movel %d0,%fp@(-36) 577e4: 2f05 movel %d5,%sp@- 577e6: 4eb9 0005 bc40 jsr 5bc40 <_Watchdog_Adjust> 577ec: 202e ffdc movel %fp@(-36),%d0 577f0: 4fef 000c lea %sp@(12),%sp } watchdogs->last_snapshot = snapshot; 577f4: 2540 0074 movel %d0,%a2@(116) 577f8: 6000 ff40 braw 5773a <_Timer_server_Body+0xb6> Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 577fc: 4868 0010 pea %a0@(16) <== NOT EXECUTED 57800: 2f02 movel %d2,%sp@- <== NOT EXECUTED 57802: 4e94 jsr %a4@ <== NOT EXECUTED 57804: 508f addql #8,%sp <== NOT EXECUTED 57806: 6000 ff32 braw 5773a <_Timer_server_Body+0xb6> <== NOT EXECUTED */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); if ( _Chain_Is_empty( insert_chain ) ) { ts->insert_chain = NULL; 5780a: 42aa 0078 clrl %a2@(120) _ISR_Enable( level ); 5780e: 46c1 movew %d1,%sr _Chain_Initialize_empty( &fire_chain ); while ( true ) { _Timer_server_Get_watchdogs_that_fire_now( ts, &insert_chain, &fire_chain ); if ( !_Chain_Is_empty( &fire_chain ) ) { 57810: 2e2e ffd8 movel %fp@(-40),%d7 57814: beae fff4 cmpl %fp@(-12),%d7 57818: 6752 beqs 5786c <_Timer_server_Body+0x1e8> /* * It is essential that interrupts are disable here since an interrupt * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); 5781a: 2204 movel %d4,%d1 5781c: 40c0 movew %sr,%d0 5781e: 8280 orl %d0,%d1 57820: 46c1 movew %d1,%sr */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 57822: 206e fff4 moveal %fp@(-12),%a0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 57826: b1ee ffd8 cmpal %fp@(-40),%a0 5782a: 6732 beqs 5785e <_Timer_server_Body+0x1da> <== NEVER TAKEN Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; 5782c: 2250 moveal %a0@,%a1 head->next = new_first; new_first->previous = head; 5782e: 2343 0004 movel %d3,%a1@(4) watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; 57832: 42a8 0008 clrl %a0@(8) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; head->next = new_first; 57836: 2d49 fff4 movel %a1,%fp@(-12) _ISR_Enable( level ); 5783a: 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 ); 5783c: 2f28 0024 movel %a0@(36),%sp@- 57840: 2f28 0020 movel %a0@(32),%sp@- 57844: 2068 001c moveal %a0@(28),%a0 57848: 4e90 jsr %a0@ } 5784a: 508f addql #8,%sp /* * It is essential that interrupts are disable here since an interrupt * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); 5784c: 2204 movel %d4,%d1 5784e: 40c0 movew %sr,%d0 57850: 8280 orl %d0,%d1 57852: 46c1 movew %d1,%sr */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 57854: 206e fff4 moveal %fp@(-12),%a0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 57858: b1ee ffd8 cmpal %fp@(-40),%a0 5785c: 66ce bnes 5782c <_Timer_server_Body+0x1a8> watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; _ISR_Enable( level ); } else { _ISR_Enable( level ); 5785e: 46c0 movew %d0,%sr { /* * Afterwards all timer inserts are directed to this chain and the interval * and TOD chains will be no more modified by other parties. */ ts->insert_chain = insert_chain; 57860: 41ee ffe8 lea %fp@(-24),%a0 57864: 2548 0078 movel %a0,%a2@(120) 57868: 6000 fe9a braw 57704 <_Timer_server_Body+0x80> * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); } } else { ts->active = false; 5786c: 4200 clrb %d0 5786e: 1540 007c moveb %d0,%a2@(124) * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 57872: 2039 0007 dd4c movel 7dd4c <_Thread_Dispatch_disable_level>,%d0 57878: 5280 addql #1,%d0 5787a: 23c0 0007 dd4c movel %d0,7dd4c <_Thread_Dispatch_disable_level> return _Thread_Dispatch_disable_level; 57880: 2039 0007 dd4c movel 7dd4c <_Thread_Dispatch_disable_level>,%d0 /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); 57886: 4878 0008 pea 8 5788a: 2f12 movel %a2@,%sp@- _Timer_server_Reset_interval_system_watchdog( ts ); _Timer_server_Reset_tod_system_watchdog( ts ); _Thread_Enable_dispatch(); ts->active = true; 5788c: 7e01 moveq #1,%d7 /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); 5788e: 4eb9 0005 b66c jsr 5b66c <_Thread_Set_state> _Timer_server_Reset_interval_system_watchdog( ts ); 57894: 2f0a movel %a2,%sp@- 57896: 4eba fd14 jsr %pc@(575ac <_Timer_server_Reset_interval_system_watchdog>) _Timer_server_Reset_tod_system_watchdog( ts ); 5789a: 2f0a movel %a2,%sp@- 5789c: 4eba fd78 jsr %pc@(57616 <_Timer_server_Reset_tod_system_watchdog>) _Thread_Enable_dispatch(); 578a0: 4eb9 0005 ad04 jsr 5ad04 <_Thread_Enable_dispatch> ts->active = true; 578a6: 1547 007c moveb %d7,%a2@(124) static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 578aa: 2f2e ffe4 movel %fp@(-28),%sp@- 578ae: 4eb9 0005 bea4 jsr 5bea4 <_Watchdog_Remove> static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 578b4: 2f2e ffe0 movel %fp@(-32),%sp@- 578b8: 4eb9 0005 bea4 jsr 5bea4 <_Watchdog_Remove> 578be: 4fef 0018 lea %sp@(24),%sp 578c2: 6000 fe38 braw 576fc <_Timer_server_Body+0x78> =============================================================================== 000578c6 <_Timer_server_Schedule_operation_method>: static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 578c6: 4e56 fff0 linkw %fp,#-16 578ca: 206e 000c moveal %fp@(12),%a0 578ce: 48d7 041c moveml %d2-%d4/%a2,%sp@ 578d2: 246e 0008 moveal %fp@(8),%a2 if ( ts->insert_chain == NULL ) { 578d6: 202a 0078 movel %a2@(120),%d0 578da: 671a beqs 578f6 <_Timer_server_Schedule_operation_method+0x30><== ALWAYS TAKEN * 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 ); 578dc: 202a 0078 movel %a2@(120),%d0 <== NOT EXECUTED 578e0: 2d48 000c movel %a0,%fp@(12) <== NOT EXECUTED } } 578e4: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 <== NOT EXECUTED * server is not preemptible, so we must be in interrupt context here. No * thread dispatch will happen until the timer server finishes its * critical section. We have to use the protected chain methods because * we may be interrupted by a higher priority interrupt. */ _Chain_Append( ts->insert_chain, &timer->Object.Node ); 578ea: 2d40 0008 movel %d0,%fp@(8) <== NOT EXECUTED } } 578ee: 4e5e unlk %fp <== NOT EXECUTED * server is not preemptible, so we must be in interrupt context here. No * thread dispatch will happen until the timer server finishes its * critical section. We have to use the protected chain methods because * we may be interrupted by a higher priority interrupt. */ _Chain_Append( ts->insert_chain, &timer->Object.Node ); 578f0: 4ef9 0005 825c jmp 5825c <_Chain_Append> <== NOT EXECUTED * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 578f6: 2039 0007 dd4c movel 7dd4c <_Thread_Dispatch_disable_level>,%d0 578fc: 5280 addql #1,%d0 578fe: 23c0 0007 dd4c movel %d0,7dd4c <_Thread_Dispatch_disable_level> return _Thread_Dispatch_disable_level; 57904: 2039 0007 dd4c movel 7dd4c <_Thread_Dispatch_disable_level>,%d0 * being inserted. This could result in an integer overflow. */ _Thread_Disable_dispatch(); if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 5790a: 2028 0038 movel %a0@(56),%d0 5790e: 7201 moveq #1,%d1 57910: b280 cmpl %d0,%d1 57912: 6700 008a beqw 5799e <_Timer_server_Schedule_operation_method+0xd8> _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); if ( !ts->active ) { _Timer_server_Reset_interval_system_watchdog( ts ); } } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 57916: 7803 moveq #3,%d4 57918: b880 cmpl %d0,%d4 5791a: 670e beqs 5792a <_Timer_server_Schedule_operation_method+0x64> * 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 ); } } 5791c: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 57922: 4e5e unlk %fp if ( !ts->active ) { _Timer_server_Reset_tod_system_watchdog( ts ); } } _Thread_Enable_dispatch(); 57924: 4ef9 0005 ad04 jmp 5ad04 <_Thread_Enable_dispatch> } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { /* * We have to advance the last known seconds value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 5792a: 203c 0000 0700 movel #1792,%d0 57930: 40c2 movew %sr,%d2 57932: 8082 orl %d2,%d0 57934: 46c0 movew %d0,%sr RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 57936: 260a movel %a2,%d3 57938: 0683 0000 006c addil #108,%d3 snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 5793e: 2039 0007 ddd6 movel 7ddd6 <_TOD_Now>,%d0 last_snapshot = ts->TOD_watchdogs.last_snapshot; 57944: 222a 0074 movel %a2@(116),%d1 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 57948: 226a 0068 moveal %a2@(104),%a1 if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { 5794c: b689 cmpl %a1,%d3 5794e: 671c beqs 5796c <_Timer_server_Schedule_operation_method+0xa6> first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; 57950: 2629 0010 movel %a1@(16),%d3 if ( snapshot > last_snapshot ) { 57954: b280 cmpl %d0,%d1 57956: 6400 00ba bccw 57a12 <_Timer_server_Schedule_operation_method+0x14c> /* * We advanced in time. */ delta = snapshot - last_snapshot; 5795a: 2800 movel %d0,%d4 5795c: 9881 subl %d1,%d4 if (delta_interval > delta) { 5795e: b883 cmpl %d3,%d4 57960: 6400 00bc bccw 57a1e <_Timer_server_Schedule_operation_method+0x158> delta_interval -= delta; 57964: 9684 subl %d4,%d3 57966: 2203 movel %d3,%d1 * Someone put us in the past. */ delta = last_snapshot - snapshot; delta_interval += delta; } first_watchdog->delta_interval = delta_interval; 57968: 2341 0010 movel %d1,%a1@(16) } ts->TOD_watchdogs.last_snapshot = snapshot; 5796c: 2540 0074 movel %d0,%a2@(116) _ISR_Enable( level ); 57970: 46c2 movew %d2,%sr _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 57972: 4868 0010 pea %a0@(16) 57976: 486a 0068 pea %a2@(104) 5797a: 4eb9 0005 bd5c jsr 5bd5c <_Watchdog_Insert> if ( !ts->active ) { 57980: 508f addql #8,%sp 57982: 102a 007c moveb %a2@(124),%d0 57986: 6694 bnes 5791c <_Timer_server_Schedule_operation_method+0x56> _Timer_server_Reset_tod_system_watchdog( ts ); 57988: 2f0a movel %a2,%sp@- 5798a: 4eba fc8a jsr %pc@(57616 <_Timer_server_Reset_tod_system_watchdog>) 5798e: 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 ); } } 57990: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 57996: 4e5e unlk %fp if ( !ts->active ) { _Timer_server_Reset_tod_system_watchdog( ts ); } } _Thread_Enable_dispatch(); 57998: 4ef9 0005 ad04 jmp 5ad04 <_Thread_Enable_dispatch> if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { /* * We have to advance the last known ticks value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 5799e: 203c 0000 0700 movel #1792,%d0 579a4: 40c3 movew %sr,%d3 579a6: 8083 orl %d3,%d0 579a8: 46c0 movew %d0,%sr snapshot = _Watchdog_Ticks_since_boot; 579aa: 2039 0007 de4e movel 7de4e <_Watchdog_Ticks_since_boot>,%d0 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 579b0: 220a movel %a2,%d1 579b2: 0681 0000 0034 addil #52,%d1 last_snapshot = ts->Interval_watchdogs.last_snapshot; 579b8: 282a 003c movel %a2@(60),%d4 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 579bc: 226a 0030 moveal %a2@(48),%a1 if ( !_Chain_Is_empty( &ts->Interval_watchdogs.Chain ) ) { 579c0: b289 cmpl %a1,%d1 579c2: 6712 beqs 579d6 <_Timer_server_Schedule_operation_method+0x110> first_watchdog = _Watchdog_First( &ts->Interval_watchdogs.Chain ); /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; 579c4: 2200 movel %d0,%d1 579c6: 9284 subl %d4,%d1 delta_interval = first_watchdog->delta_interval; 579c8: 2429 0010 movel %a1@(16),%d2 if (delta_interval > delta) { 579cc: b481 cmpl %d1,%d2 579ce: 633a blss 57a0a <_Timer_server_Schedule_operation_method+0x144> delta_interval -= delta; 579d0: 9481 subl %d1,%d2 } else { delta_interval = 0; } first_watchdog->delta_interval = delta_interval; 579d2: 2342 0010 movel %d2,%a1@(16) } ts->Interval_watchdogs.last_snapshot = snapshot; 579d6: 2540 003c movel %d0,%a2@(60) _ISR_Enable( level ); 579da: 46c3 movew %d3,%sr _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 579dc: 4868 0010 pea %a0@(16) 579e0: 486a 0030 pea %a2@(48) 579e4: 4eb9 0005 bd5c jsr 5bd5c <_Watchdog_Insert> if ( !ts->active ) { 579ea: 508f addql #8,%sp 579ec: 102a 007c moveb %a2@(124),%d0 579f0: 6600 ff2a bnew 5791c <_Timer_server_Schedule_operation_method+0x56> _Timer_server_Reset_interval_system_watchdog( ts ); 579f4: 2f0a movel %a2,%sp@- 579f6: 4eba fbb4 jsr %pc@(575ac <_Timer_server_Reset_interval_system_watchdog>) 579fa: 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 ); } } 579fc: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 57a02: 4e5e unlk %fp if ( !ts->active ) { _Timer_server_Reset_tod_system_watchdog( ts ); } } _Thread_Enable_dispatch(); 57a04: 4ef9 0005 ad04 jmp 5ad04 <_Thread_Enable_dispatch> delta_interval = first_watchdog->delta_interval; if (delta_interval > delta) { delta_interval -= delta; } else { delta_interval = 0; 57a0a: 4282 clrl %d2 } first_watchdog->delta_interval = delta_interval; 57a0c: 2342 0010 movel %d2,%a1@(16) 57a10: 60c4 bras 579d6 <_Timer_server_Schedule_operation_method+0x110> } } else { /* * Someone put us in the past. */ delta = last_snapshot - snapshot; 57a12: d283 addl %d3,%d1 delta_interval += delta; 57a14: 9280 subl %d0,%d1 } first_watchdog->delta_interval = delta_interval; 57a16: 2341 0010 movel %d1,%a1@(16) 57a1a: 6000 ff50 braw 5796c <_Timer_server_Schedule_operation_method+0xa6> */ delta = snapshot - last_snapshot; if (delta_interval > delta) { delta_interval -= delta; } else { delta_interval = 0; 57a1e: 4281 clrl %d1 <== NOT EXECUTED * Someone put us in the past. */ delta = last_snapshot - snapshot; delta_interval += delta; } first_watchdog->delta_interval = delta_interval; 57a20: 2341 0010 movel %d1,%a1@(16) <== NOT EXECUTED 57a24: 6000 ff46 braw 5796c <_Timer_server_Schedule_operation_method+0xa6><== NOT EXECUTED =============================================================================== 00049ea2 <_User_extensions_Fatal>: void _User_extensions_Fatal ( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 49ea2: 4e56 fff0 linkw %fp,#-16 49ea6: 48d7 041c moveml %d2-%d4/%a2,%sp@ 49eaa: 242e 0008 movel %fp@(8),%d2 49eae: 262e 0010 movel %fp@(16),%d3 49eb2: 2479 0006 1198 moveal 61198 <_User_extensions_List+0x8>,%a2 49eb8: 182e 000f moveb %fp@(15),%d4 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _Chain_Last( &_User_extensions_List ); 49ebc: b5fc 0006 1190 cmpal #397712,%a2 49ec2: 6726 beqs 49eea <_User_extensions_Fatal+0x48> <== NEVER TAKEN the_node = the_node->previous ) { the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.fatal != NULL ) (*the_extension->Callouts.fatal)( the_source, is_internal, the_error ); 49ec4: 0284 0000 00ff andil #255,%d4 !_Chain_Is_head( &_User_extensions_List, the_node ) ; the_node = the_node->previous ) { the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.fatal != NULL ) 49eca: 206a 0030 moveal %a2@(48),%a0 49ece: 4a88 tstl %a0 49ed0: 670c beqs 49ede <_User_extensions_Fatal+0x3c> (*the_extension->Callouts.fatal)( the_source, is_internal, the_error ); 49ed2: 2f03 movel %d3,%sp@- 49ed4: 2f04 movel %d4,%sp@- 49ed6: 2f02 movel %d2,%sp@- 49ed8: 4e90 jsr %a0@ 49eda: 4fef 000c lea %sp@(12),%sp Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _Chain_Last( &_User_extensions_List ); !_Chain_Is_head( &_User_extensions_List, the_node ) ; the_node = the_node->previous ) { 49ede: 246a 0004 moveal %a2@(4),%a2 ) { Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _Chain_Last( &_User_extensions_List ); 49ee2: b5fc 0006 1190 cmpal #397712,%a2 49ee8: 66e0 bnes 49eca <_User_extensions_Fatal+0x28> the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.fatal != NULL ) (*the_extension->Callouts.fatal)( the_source, is_internal, the_error ); } } 49eea: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 49ef0: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00049d60 <_User_extensions_Handler_initialization>: #include #include #include void _User_extensions_Handler_initialization(void) { 49d60: 4e56 ffec linkw %fp,#-20 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 49d64: 203c 0006 1194 movel #397716,%d0 49d6a: 23c0 0006 1190 movel %d0,61190 <_User_extensions_List> head->previous = NULL; tail->previous = head; 49d70: 203c 0006 1190 movel #397712,%d0 49d76: 23c0 0006 1198 movel %d0,61198 <_User_extensions_List+0x8> ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 49d7c: 203c 0006 1050 movel #397392,%d0 49d82: 23c0 0006 104c movel %d0,6104c <_User_extensions_Switches_list> head->previous = NULL; tail->previous = head; 49d88: 203c 0006 104c movel #397388,%d0 { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; 49d8e: 42b9 0006 1194 clrl 61194 <_User_extensions_List+0x4> 49d94: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ User_extensions_Control *extension; uint32_t i; uint32_t number_of_extensions; User_extensions_Table *initial_extensions; number_of_extensions = Configuration.number_of_initial_extensions; 49d98: 2439 0005 f6a2 movel 5f6a2 ,%d2 initial_extensions = Configuration.User_extension_table; 49d9e: 2639 0005 f6a6 movel 5f6a6 ,%d3 49da4: 42b9 0006 1050 clrl 61050 <_User_extensions_Switches_list+0x4> tail->previous = head; 49daa: 23c0 0006 1054 movel %d0,61054 <_User_extensions_Switches_list+0x8> _Chain_Initialize_empty( &_User_extensions_List ); _Chain_Initialize_empty( &_User_extensions_Switches_list ); if ( initial_extensions ) { 49db0: 4a83 tstl %d3 49db2: 6764 beqs 49e18 <_User_extensions_Handler_initialization+0xb8><== NEVER TAKEN extension = (User_extensions_Control *) _Workspace_Allocate_or_fatal_error( 49db4: 7834 moveq #52,%d4 49db6: 4c02 4800 mulsl %d2,%d4 _Chain_Initialize_empty( &_User_extensions_List ); _Chain_Initialize_empty( &_User_extensions_Switches_list ); if ( initial_extensions ) { extension = (User_extensions_Control *) 49dba: 2f04 movel %d4,%sp@- 49dbc: 4eb9 0004 a318 jsr 4a318 <_Workspace_Allocate_or_fatal_error> 49dc2: 2440 moveal %d0,%a2 _Workspace_Allocate_or_fatal_error( number_of_extensions * sizeof( User_extensions_Control ) ); memset ( 49dc4: 2f04 movel %d4,%sp@- 49dc6: 42a7 clrl %sp@- 49dc8: 2f00 movel %d0,%sp@- 49dca: 4eb9 0004 f928 jsr 4f928 extension, 0, number_of_extensions * sizeof( User_extensions_Control ) ); for ( i = 0 ; i < number_of_extensions ; i++ ) { 49dd0: 4fef 0010 lea %sp@(16),%sp 49dd4: 4a82 tstl %d2 49dd6: 6740 beqs 49e18 <_User_extensions_Handler_initialization+0xb8><== NEVER TAKEN 49dd8: 4284 clrl %d4 49dda: 47f9 0004 d474 lea 4d474 <_User_extensions_Add_set>,%a3 RTEMS_INLINE_ROUTINE void _User_extensions_Add_set_with_table( User_extensions_Control *extension, const User_extensions_Table *extension_table ) { extension->Callouts = *extension_table; 49de0: 2043 moveal %d3,%a0 49de2: 5284 addql #1,%d4 49de4: 0683 0000 0020 addil #32,%d3 49dea: 2558 0014 movel %a0@+,%a2@(20) 49dee: 2558 0018 movel %a0@+,%a2@(24) 49df2: 2558 001c movel %a0@+,%a2@(28) 49df6: 2558 0020 movel %a0@+,%a2@(32) 49dfa: 2558 0024 movel %a0@+,%a2@(36) 49dfe: 2558 0028 movel %a0@+,%a2@(40) 49e02: 2558 002c movel %a0@+,%a2@(44) 49e06: 2550 0030 movel %a0@,%a2@(48) _User_extensions_Add_set( extension ); 49e0a: 2f0a movel %a2,%sp@- _User_extensions_Add_set_with_table (extension, &initial_extensions[i]); extension++; 49e0c: 45ea 0034 lea %a2@(52),%a2 49e10: 4e93 jsr %a3@ extension, 0, number_of_extensions * sizeof( User_extensions_Control ) ); for ( i = 0 ; i < number_of_extensions ; i++ ) { 49e12: 588f addql #4,%sp 49e14: b484 cmpl %d4,%d2 49e16: 66c8 bnes 49de0 <_User_extensions_Handler_initialization+0x80> _User_extensions_Add_set_with_table (extension, &initial_extensions[i]); extension++; } } } 49e18: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 49e1e: 4e5e unlk %fp ... =============================================================================== 00049e24 <_User_extensions_Thread_begin>: #include void _User_extensions_Thread_begin ( Thread_Control *executing ) { 49e24: 4e56 0000 linkw %fp,#0 49e28: 2f0a movel %a2,%sp@- */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 49e2a: 2479 0006 1190 moveal 61190 <_User_extensions_List>,%a2 49e30: 2f02 movel %d2,%sp@- 49e32: 242e 0008 movel %fp@(8),%d2 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _Chain_First( &_User_extensions_List ); 49e36: b5fc 0006 1194 cmpal #397716,%a2 49e3c: 6718 beqs 49e56 <_User_extensions_Thread_begin+0x32><== NEVER TAKEN !_Chain_Is_tail( &_User_extensions_List, the_node ) ; the_node = the_node->next ) { the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_begin != NULL ) 49e3e: 206a 0028 moveal %a2@(40),%a0 49e42: 4a88 tstl %a0 49e44: 6706 beqs 49e4c <_User_extensions_Thread_begin+0x28> (*the_extension->Callouts.thread_begin)( executing ); 49e46: 2f02 movel %d2,%sp@- 49e48: 4e90 jsr %a0@ 49e4a: 588f addql #4,%sp Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _Chain_First( &_User_extensions_List ); !_Chain_Is_tail( &_User_extensions_List, the_node ) ; the_node = the_node->next ) { 49e4c: 2452 moveal %a2@,%a2 ) { Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _Chain_First( &_User_extensions_List ); 49e4e: b5fc 0006 1194 cmpal #397716,%a2 49e54: 66e8 bnes 49e3e <_User_extensions_Thread_begin+0x1a> the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_begin != NULL ) (*the_extension->Callouts.thread_begin)( executing ); } } 49e56: 242e fff8 movel %fp@(-8),%d2 49e5a: 246e fffc moveal %fp@(-4),%a2 49e5e: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00049ef4 <_User_extensions_Thread_create>: #include bool _User_extensions_Thread_create ( Thread_Control *the_thread ) { 49ef4: 4e56 0000 linkw %fp,#0 49ef8: 2f0a movel %a2,%sp@- */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 49efa: 2479 0006 1190 moveal 61190 <_User_extensions_List>,%a2 49f00: 2f02 movel %d2,%sp@- 49f02: 242e 0008 movel %fp@(8),%d2 Chain_Node *the_node; User_extensions_Control *the_extension; bool status; for ( the_node = _Chain_First( &_User_extensions_List ); 49f06: b5fc 0006 1194 cmpal #397716,%a2 49f0c: 6722 beqs 49f30 <_User_extensions_Thread_create+0x3c><== NEVER TAKEN !_Chain_Is_tail( &_User_extensions_List, the_node ) ; the_node = the_node->next ) { the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_create != NULL ) { 49f0e: 206a 0014 moveal %a2@(20),%a0 49f12: 4a88 tstl %a0 49f14: 6710 beqs 49f26 <_User_extensions_Thread_create+0x32> status = (*the_extension->Callouts.thread_create)( 49f16: 2f02 movel %d2,%sp@- 49f18: 2f39 0006 14aa movel 614aa <_Per_CPU_Information+0xc>,%sp@- 49f1e: 4e90 jsr %a0@ _Thread_Executing, the_thread ); if ( !status ) 49f20: 508f addql #8,%sp 49f22: 4a00 tstb %d0 49f24: 6718 beqs 49f3e <_User_extensions_Thread_create+0x4a> User_extensions_Control *the_extension; bool status; for ( the_node = _Chain_First( &_User_extensions_List ); !_Chain_Is_tail( &_User_extensions_List, the_node ) ; the_node = the_node->next ) { 49f26: 2452 moveal %a2@,%a2 { Chain_Node *the_node; User_extensions_Control *the_extension; bool status; for ( the_node = _Chain_First( &_User_extensions_List ); 49f28: b5fc 0006 1194 cmpal #397716,%a2 49f2e: 66de bnes 49f0e <_User_extensions_Thread_create+0x1a> return false; } } return true; } 49f30: 242e fff8 movel %fp@(-8),%d2 49f34: 246e fffc moveal %fp@(-4),%a2 49f38: 4e5e unlk %fp if ( !status ) return false; } } return true; 49f3a: 7001 moveq #1,%d0 } 49f3c: 4e75 rts 49f3e: 242e fff8 movel %fp@(-8),%d2 49f42: 246e fffc moveal %fp@(-4),%a2 49f46: 4e5e unlk %fp status = (*the_extension->Callouts.thread_create)( _Thread_Executing, the_thread ); if ( !status ) return false; 49f48: 4200 clrb %d0 <== NOT EXECUTED } } return true; } =============================================================================== 00049f4c <_User_extensions_Thread_delete>: #include void _User_extensions_Thread_delete ( Thread_Control *the_thread ) { 49f4c: 4e56 0000 linkw %fp,#0 49f50: 2f0a movel %a2,%sp@- */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Last( Chain_Control *the_chain ) { return _Chain_Tail( the_chain )->previous; 49f52: 2479 0006 1198 moveal 61198 <_User_extensions_List+0x8>,%a2 49f58: 2f02 movel %d2,%sp@- 49f5a: 242e 0008 movel %fp@(8),%d2 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _Chain_Last( &_User_extensions_List ); 49f5e: b5fc 0006 1190 cmpal #397712,%a2 49f64: 6720 beqs 49f86 <_User_extensions_Thread_delete+0x3a><== NEVER TAKEN !_Chain_Is_head( &_User_extensions_List, the_node ) ; the_node = the_node->previous ) { the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_delete != NULL ) 49f66: 206a 0020 moveal %a2@(32),%a0 49f6a: 4a88 tstl %a0 49f6c: 670c beqs 49f7a <_User_extensions_Thread_delete+0x2e> (*the_extension->Callouts.thread_delete)( 49f6e: 2f02 movel %d2,%sp@- 49f70: 2f39 0006 14aa movel 614aa <_Per_CPU_Information+0xc>,%sp@- 49f76: 4e90 jsr %a0@ 49f78: 508f addql #8,%sp Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _Chain_Last( &_User_extensions_List ); !_Chain_Is_head( &_User_extensions_List, the_node ) ; the_node = the_node->previous ) { 49f7a: 246a 0004 moveal %a2@(4),%a2 ) { Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _Chain_Last( &_User_extensions_List ); 49f7e: b5fc 0006 1190 cmpal #397712,%a2 49f84: 66e0 bnes 49f66 <_User_extensions_Thread_delete+0x1a> (*the_extension->Callouts.thread_delete)( _Thread_Executing, the_thread ); } } 49f86: 242e fff8 movel %fp@(-8),%d2 49f8a: 246e fffc moveal %fp@(-4),%a2 49f8e: 4e5e unlk %fp ... =============================================================================== 00049e62 <_User_extensions_Thread_exitted>: void _User_extensions_Thread_exitted ( Thread_Control *executing ) { 49e62: 4e56 0000 linkw %fp,#0 49e66: 2f0a movel %a2,%sp@- */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Last( Chain_Control *the_chain ) { return _Chain_Tail( the_chain )->previous; 49e68: 2479 0006 1198 moveal 61198 <_User_extensions_List+0x8>,%a2 49e6e: 2f02 movel %d2,%sp@- 49e70: 242e 0008 movel %fp@(8),%d2 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _Chain_Last( &_User_extensions_List ); 49e74: b5fc 0006 1190 cmpal #397712,%a2 49e7a: 671a beqs 49e96 <_User_extensions_Thread_exitted+0x34><== NEVER TAKEN !_Chain_Is_head( &_User_extensions_List, the_node ) ; the_node = the_node->previous ) { the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_exitted != NULL ) 49e7c: 206a 002c moveal %a2@(44),%a0 49e80: 4a88 tstl %a0 49e82: 6706 beqs 49e8a <_User_extensions_Thread_exitted+0x28> (*the_extension->Callouts.thread_exitted)( executing ); 49e84: 2f02 movel %d2,%sp@- 49e86: 4e90 jsr %a0@ 49e88: 588f addql #4,%sp Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _Chain_Last( &_User_extensions_List ); !_Chain_Is_head( &_User_extensions_List, the_node ) ; the_node = the_node->previous ) { 49e8a: 246a 0004 moveal %a2@(4),%a2 ) { Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _Chain_Last( &_User_extensions_List ); 49e8e: b5fc 0006 1190 cmpal #397712,%a2 49e94: 66e6 bnes 49e7c <_User_extensions_Thread_exitted+0x1a> the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_exitted != NULL ) (*the_extension->Callouts.thread_exitted)( executing ); } } 49e96: 242e fff8 movel %fp@(-8),%d2 49e9a: 246e fffc moveal %fp@(-4),%a2 49e9e: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004a8dc <_User_extensions_Thread_restart>: #include void _User_extensions_Thread_restart ( Thread_Control *the_thread ) { 4a8dc: 4e56 0000 linkw %fp,#0 4a8e0: 2f0a movel %a2,%sp@- */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 4a8e2: 2479 0006 1d68 moveal 61d68 <_User_extensions_List>,%a2 4a8e8: 2f02 movel %d2,%sp@- 4a8ea: 242e 0008 movel %fp@(8),%d2 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _Chain_First( &_User_extensions_List ); 4a8ee: b5fc 0006 1d6c cmpal #400748,%a2 4a8f4: 671e beqs 4a914 <_User_extensions_Thread_restart+0x38><== NEVER TAKEN !_Chain_Is_tail( &_User_extensions_List, the_node ) ; the_node = the_node->next ) { the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_restart != NULL ) 4a8f6: 206a 001c moveal %a2@(28),%a0 4a8fa: 4a88 tstl %a0 4a8fc: 670c beqs 4a90a <_User_extensions_Thread_restart+0x2e> (*the_extension->Callouts.thread_restart)( 4a8fe: 2f02 movel %d2,%sp@- 4a900: 2f39 0006 2082 movel 62082 <_Per_CPU_Information+0xc>,%sp@- 4a906: 4e90 jsr %a0@ 4a908: 508f addql #8,%sp Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _Chain_First( &_User_extensions_List ); !_Chain_Is_tail( &_User_extensions_List, the_node ) ; the_node = the_node->next ) { 4a90a: 2452 moveal %a2@,%a2 ) { Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _Chain_First( &_User_extensions_List ); 4a90c: b5fc 0006 1d6c cmpal #400748,%a2 4a912: 66e2 bnes 4a8f6 <_User_extensions_Thread_restart+0x1a> (*the_extension->Callouts.thread_restart)( _Thread_Executing, the_thread ); } } 4a914: 242e fff8 movel %fp@(-8),%d2 4a918: 246e fffc moveal %fp@(-4),%a2 4a91c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00049f94 <_User_extensions_Thread_start>: #include void _User_extensions_Thread_start ( Thread_Control *the_thread ) { 49f94: 4e56 0000 linkw %fp,#0 49f98: 2f0a movel %a2,%sp@- */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 49f9a: 2479 0006 1190 moveal 61190 <_User_extensions_List>,%a2 49fa0: 2f02 movel %d2,%sp@- 49fa2: 242e 0008 movel %fp@(8),%d2 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _Chain_First( &_User_extensions_List ); 49fa6: b5fc 0006 1194 cmpal #397716,%a2 49fac: 671e beqs 49fcc <_User_extensions_Thread_start+0x38><== NEVER TAKEN !_Chain_Is_tail( &_User_extensions_List, the_node ) ; the_node = the_node->next ) { the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_start != NULL ) 49fae: 206a 0018 moveal %a2@(24),%a0 49fb2: 4a88 tstl %a0 49fb4: 670c beqs 49fc2 <_User_extensions_Thread_start+0x2e> (*the_extension->Callouts.thread_start)( 49fb6: 2f02 movel %d2,%sp@- 49fb8: 2f39 0006 14aa movel 614aa <_Per_CPU_Information+0xc>,%sp@- 49fbe: 4e90 jsr %a0@ 49fc0: 508f addql #8,%sp Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _Chain_First( &_User_extensions_List ); !_Chain_Is_tail( &_User_extensions_List, the_node ) ; the_node = the_node->next ) { 49fc2: 2452 moveal %a2@,%a2 ) { Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _Chain_First( &_User_extensions_List ); 49fc4: b5fc 0006 1194 cmpal #397716,%a2 49fca: 66e2 bnes 49fae <_User_extensions_Thread_start+0x1a> (*the_extension->Callouts.thread_start)( _Thread_Executing, the_thread ); } } 49fcc: 242e fff8 movel %fp@(-8),%d2 49fd0: 246e fffc moveal %fp@(-4),%a2 49fd4: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00049fd8 <_User_extensions_Thread_switch>: void _User_extensions_Thread_switch ( Thread_Control *executing, Thread_Control *heir ) { 49fd8: 4e56 fff4 linkw %fp,#-12 49fdc: 48d7 040c moveml %d2-%d3/%a2,%sp@ 49fe0: 262e 0008 movel %fp@(8),%d3 49fe4: 242e 000c movel %fp@(12),%d2 49fe8: 2479 0006 104c moveal 6104c <_User_extensions_Switches_list>,%a2 Chain_Node *the_node; User_extensions_Switch_control *the_extension_switch; for ( the_node = _Chain_First( &_User_extensions_Switches_list ); 49fee: b5fc 0006 1050 cmpal #397392,%a2 49ff4: 6716 beqs 4a00c <_User_extensions_Thread_switch+0x34><== NEVER TAKEN !_Chain_Is_tail( &_User_extensions_Switches_list, the_node ) ; the_node = the_node->next ) { the_extension_switch = (User_extensions_Switch_control *) the_node; (*the_extension_switch->thread_switch)( executing, heir ); 49ff6: 2f02 movel %d2,%sp@- 49ff8: 2f03 movel %d3,%sp@- 49ffa: 206a 0008 moveal %a2@(8),%a0 49ffe: 4e90 jsr %a0@ Chain_Node *the_node; User_extensions_Switch_control *the_extension_switch; for ( the_node = _Chain_First( &_User_extensions_Switches_list ); !_Chain_Is_tail( &_User_extensions_Switches_list, the_node ) ; the_node = the_node->next ) { 4a000: 2452 moveal %a2@,%a2 ) { Chain_Node *the_node; User_extensions_Switch_control *the_extension_switch; for ( the_node = _Chain_First( &_User_extensions_Switches_list ); 4a002: 508f addql #8,%sp 4a004: b5fc 0006 1050 cmpal #397392,%a2 4a00a: 66ea bnes 49ff6 <_User_extensions_Thread_switch+0x1e> the_extension_switch = (User_extensions_Switch_control *) the_node; (*the_extension_switch->thread_switch)( executing, heir ); } } 4a00c: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 4a012: 4e5e unlk %fp ... =============================================================================== 0004b938 <_Watchdog_Adjust>: void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 4b938: 4e56 ffe8 linkw %fp,#-24 4b93c: 226e 000c moveal %fp@(12),%a1 4b940: 48d7 1c1c moveml %d2-%d4/%a2-%a4,%sp@ ISR_Level level; _ISR_Disable( level ); 4b944: 283c 0000 0700 movel #1792,%d4 4b94a: 2004 movel %d4,%d0 void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 4b94c: 266e 0008 moveal %fp@(8),%a3 4b950: 242e 0010 movel %fp@(16),%d2 ISR_Level level; _ISR_Disable( level ); 4b954: 40c1 movew %sr,%d1 4b956: 8081 orl %d1,%d0 4b958: 46c0 movew %d0,%sr */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 4b95a: 244b moveal %a3,%a2 4b95c: 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 ) ) { 4b95e: b5c8 cmpal %a0,%a2 4b960: 6746 beqs 4b9a8 <_Watchdog_Adjust+0x70> switch ( direction ) { 4b962: 4a89 tstl %a1 4b964: 664e bnes 4b9b4 <_Watchdog_Adjust+0x7c> case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 4b966: 4a82 tstl %d2 4b968: 673e beqs 4b9a8 <_Watchdog_Adjust+0x70> <== NEVER TAKEN if ( units < _Watchdog_First( header )->delta_interval ) { 4b96a: 2628 0010 movel %a0@(16),%d3 4b96e: 49f9 0004 bbb4 lea 4bbb4 <_Watchdog_Tickle>,%a4 4b974: b682 cmpl %d2,%d3 4b976: 622a bhis 4b9a2 <_Watchdog_Adjust+0x6a> <== NEVER TAKEN _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; 4b978: 7001 moveq #1,%d0 4b97a: 2140 0010 movel %d0,%a0@(16) _ISR_Enable( level ); 4b97e: 46c1 movew %d1,%sr _Watchdog_Tickle( header ); 4b980: 2f0b movel %a3,%sp@- 4b982: 4e94 jsr %a4@ _ISR_Disable( level ); 4b984: 2004 movel %d4,%d0 4b986: 40c1 movew %sr,%d1 4b988: 8081 orl %d1,%d0 4b98a: 46c0 movew %d0,%sr if ( _Chain_Is_empty( header ) ) 4b98c: 588f addql #4,%sp while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; 4b98e: 9483 subl %d3,%d2 4b990: 2053 moveal %a3@,%a0 _Watchdog_Tickle( header ); _ISR_Disable( level ); if ( _Chain_Is_empty( header ) ) 4b992: b1ca cmpal %a2,%a0 4b994: 6712 beqs 4b9a8 <_Watchdog_Adjust+0x70> switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 4b996: 4a82 tstl %d2 4b998: 670e beqs 4b9a8 <_Watchdog_Adjust+0x70> <== NEVER TAKEN if ( units < _Watchdog_First( header )->delta_interval ) { 4b99a: 2628 0010 movel %a0@(16),%d3 4b99e: b483 cmpl %d3,%d2 4b9a0: 64d6 bccs 4b978 <_Watchdog_Adjust+0x40> _Watchdog_First( header )->delta_interval -= units; 4b9a2: 9682 subl %d2,%d3 4b9a4: 2143 0010 movel %d3,%a0@(16) } break; } } _ISR_Enable( level ); 4b9a8: 46c1 movew %d1,%sr } 4b9aa: 4cee 1c1c ffe8 moveml %fp@(-24),%d2-%d4/%a2-%a4 4b9b0: 4e5e unlk %fp 4b9b2: 4e75 rts * unmodified across that call. * * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { switch ( direction ) { 4b9b4: 7001 moveq #1,%d0 4b9b6: b089 cmpl %a1,%d0 4b9b8: 66ee bnes 4b9a8 <_Watchdog_Adjust+0x70> <== NEVER TAKEN case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; 4b9ba: d5a8 0010 addl %d2,%a0@(16) } break; } } _ISR_Enable( level ); 4b9be: 46c1 movew %d1,%sr } 4b9c0: 4cee 1c1c ffe8 moveml %fp@(-24),%d2-%d4/%a2-%a4 4b9c6: 4e5e unlk %fp ... =============================================================================== 0004a018 <_Watchdog_Insert>: void _Watchdog_Insert( Chain_Control *header, Watchdog_Control *the_watchdog ) { 4a018: 4e56 ffec linkw %fp,#-20 4a01c: 226e 000c moveal %fp@(12),%a1 4a020: 48d7 043c moveml %d2-%d5/%a2,%sp@ 4a024: 246e 0008 moveal %fp@(8),%a2 Watchdog_Interval delta_interval; insert_isr_nest_level = _ISR_Nest_level; _ISR_Disable( level ); 4a028: 283c 0000 0700 movel #1792,%d4 4a02e: 2004 movel %d4,%d0 Watchdog_Control *after; uint32_t insert_isr_nest_level; Watchdog_Interval delta_interval; insert_isr_nest_level = _ISR_Nest_level; 4a030: 2639 0006 14a6 movel 614a6 <_Per_CPU_Information+0x8>,%d3 _ISR_Disable( level ); 4a036: 40c2 movew %sr,%d2 4a038: 8082 orl %d2,%d0 4a03a: 46c0 movew %d0,%sr /* * Check to see if the watchdog has just been inserted by a * higher priority interrupt. If so, abandon this insert. */ if ( the_watchdog->state != WATCHDOG_INACTIVE ) { 4a03c: 4aa9 0008 tstl %a1@(8) 4a040: 6600 00bc bnew 4a0fe <_Watchdog_Insert+0xe6> _ISR_Enable( level ); return; } the_watchdog->state = WATCHDOG_BEING_INSERTED; _Watchdog_Sync_count++; 4a044: 2039 0006 1146 movel 61146 <_Watchdog_Sync_count>,%d0 if ( the_watchdog->state != WATCHDOG_INACTIVE ) { _ISR_Enable( level ); return; } the_watchdog->state = WATCHDOG_BEING_INSERTED; 4a04a: 7201 moveq #1,%d1 _Watchdog_Sync_count++; 4a04c: 5280 addql #1,%d0 if ( the_watchdog->state != WATCHDOG_INACTIVE ) { _ISR_Enable( level ); return; } the_watchdog->state = WATCHDOG_BEING_INSERTED; 4a04e: 2341 0008 movel %d1,%a1@(8) _Watchdog_Sync_count++; 4a052: 23c0 0006 1146 movel %d0,61146 <_Watchdog_Sync_count> restart: delta_interval = the_watchdog->initial; 4a058: 2029 000c movel %a1@(12),%d0 4a05c: 2052 moveal %a2@,%a0 for ( after = _Watchdog_First( header ) ; ; after = _Watchdog_Next( after ) ) { if ( delta_interval == 0 || !_Watchdog_Next( after ) ) 4a05e: 6764 beqs 4a0c4 <_Watchdog_Insert+0xac> <== NEVER TAKEN 4a060: 4a90 tstl %a0@ 4a062: 6760 beqs 4a0c4 <_Watchdog_Insert+0xac> break; if ( delta_interval < after->delta_interval ) { 4a064: 2228 0010 movel %a0@(16),%d1 4a068: b280 cmpl %d0,%d1 4a06a: 6252 bhis 4a0be <_Watchdog_Insert+0xa6> break; } delta_interval -= after->delta_interval; _ISR_Flash( level ); 4a06c: 2a04 movel %d4,%d5 4a06e: 46c2 movew %d2,%sr 4a070: 8a82 orl %d2,%d5 4a072: 46c5 movew %d5,%sr if ( the_watchdog->state != WATCHDOG_BEING_INSERTED ) { 4a074: 7a01 moveq #1,%d5 4a076: baa9 0008 cmpl %a1@(8),%d5 4a07a: 666e bnes 4a0ea <_Watchdog_Insert+0xd2> goto exit_insert; } if ( _Watchdog_Sync_level > insert_isr_nest_level ) { 4a07c: 2a39 0006 10ec movel 610ec <_Watchdog_Sync_level>,%d5 4a082: ba83 cmpl %d3,%d5 4a084: 6230 bhis 4a0b6 <_Watchdog_Insert+0x9e> if ( delta_interval < after->delta_interval ) { after->delta_interval -= delta_interval; break; } delta_interval -= after->delta_interval; 4a086: 9081 subl %d1,%d0 exit_insert: _Watchdog_Sync_level = insert_isr_nest_level; _Watchdog_Sync_count--; _ISR_Enable( level ); } 4a088: 2050 moveal %a0@,%a0 for ( after = _Watchdog_First( header ) ; ; after = _Watchdog_Next( after ) ) { if ( delta_interval == 0 || !_Watchdog_Next( after ) ) 4a08a: 4a80 tstl %d0 4a08c: 6736 beqs 4a0c4 <_Watchdog_Insert+0xac> 4a08e: 4a90 tstl %a0@ 4a090: 6732 beqs 4a0c4 <_Watchdog_Insert+0xac> break; if ( delta_interval < after->delta_interval ) { 4a092: 2228 0010 movel %a0@(16),%d1 4a096: b081 cmpl %d1,%d0 4a098: 6524 bcss 4a0be <_Watchdog_Insert+0xa6> after->delta_interval -= delta_interval; break; } delta_interval -= after->delta_interval; 4a09a: 9081 subl %d1,%d0 _ISR_Flash( level ); 4a09c: 2204 movel %d4,%d1 4a09e: 46c2 movew %d2,%sr 4a0a0: 8282 orl %d2,%d1 4a0a2: 46c1 movew %d1,%sr if ( the_watchdog->state != WATCHDOG_BEING_INSERTED ) { 4a0a4: 7201 moveq #1,%d1 4a0a6: b2a9 0008 cmpl %a1@(8),%d1 4a0aa: 663e bnes 4a0ea <_Watchdog_Insert+0xd2> <== NEVER TAKEN goto exit_insert; } if ( _Watchdog_Sync_level > insert_isr_nest_level ) { 4a0ac: 2239 0006 10ec movel 610ec <_Watchdog_Sync_level>,%d1 4a0b2: b283 cmpl %d3,%d1 4a0b4: 63d2 blss 4a088 <_Watchdog_Insert+0x70> <== ALWAYS TAKEN _Watchdog_Sync_level = insert_isr_nest_level; 4a0b6: 23c3 0006 10ec movel %d3,610ec <_Watchdog_Sync_level> goto restart; 4a0bc: 609a bras 4a058 <_Watchdog_Insert+0x40> if ( delta_interval == 0 || !_Watchdog_Next( after ) ) break; if ( delta_interval < after->delta_interval ) { after->delta_interval -= delta_interval; 4a0be: 9280 subl %d0,%d1 4a0c0: 2141 0010 movel %d1,%a0@(16) _Watchdog_Activate( the_watchdog ); the_watchdog->delta_interval = delta_interval; _Chain_Insert_unprotected( after->Node.previous, &the_watchdog->Node ); 4a0c4: 2068 0004 moveal %a0@(4),%a0 RTEMS_INLINE_ROUTINE void _Watchdog_Activate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_ACTIVE; 4a0c8: 7a02 moveq #2,%d5 ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 4a0ca: 2450 moveal %a0@,%a2 } } _Watchdog_Activate( the_watchdog ); the_watchdog->delta_interval = delta_interval; 4a0cc: 2340 0010 movel %d0,%a1@(16) _Chain_Insert_unprotected( after->Node.previous, &the_watchdog->Node ); the_watchdog->start_time = _Watchdog_Ticks_since_boot; 4a0d0: 2039 0006 114a movel 6114a <_Watchdog_Ticks_since_boot>,%d0 4a0d6: 2345 0008 movel %d5,%a1@(8) Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 4a0da: 2348 0004 movel %a0,%a1@(4) before_node = after_node->next; after_node->next = the_node; 4a0de: 2089 movel %a1,%a0@ the_node->next = before_node; before_node->previous = the_node; 4a0e0: 2549 0004 movel %a1,%a2@(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; 4a0e4: 228a movel %a2,%a1@ 4a0e6: 2340 0014 movel %d0,%a1@(20) exit_insert: _Watchdog_Sync_level = insert_isr_nest_level; 4a0ea: 23c3 0006 10ec movel %d3,610ec <_Watchdog_Sync_level> _Watchdog_Sync_count--; 4a0f0: 2039 0006 1146 movel 61146 <_Watchdog_Sync_count>,%d0 4a0f6: 5380 subql #1,%d0 4a0f8: 23c0 0006 1146 movel %d0,61146 <_Watchdog_Sync_count> _ISR_Enable( level ); 4a0fe: 46c2 movew %d2,%sr } 4a100: 4cd7 043c moveml %sp@,%d2-%d5/%a2 4a104: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004a160 <_Watchdog_Remove>: { ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 4a160: 203c 0000 0700 movel #1792,%d0 */ Watchdog_States _Watchdog_Remove( Watchdog_Control *the_watchdog ) { 4a166: 4e56 0000 linkw %fp,#0 4a16a: 206e 0008 moveal %fp@(8),%a0 4a16e: 2f0a movel %a2,%sp@- 4a170: 2f02 movel %d2,%sp@- ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 4a172: 40c1 movew %sr,%d1 4a174: 8081 orl %d1,%d0 4a176: 46c0 movew %d0,%sr previous_state = the_watchdog->state; 4a178: 2028 0008 movel %a0@(8),%d0 switch ( previous_state ) { 4a17c: 7401 moveq #1,%d2 4a17e: b480 cmpl %d0,%d2 4a180: 6764 beqs 4a1e6 <_Watchdog_Remove+0x86> <== NEVER TAKEN 4a182: 6314 blss 4a198 <_Watchdog_Remove+0x38> _Watchdog_Sync_level = _ISR_Nest_level; _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 4a184: 2279 0006 114a moveal 6114a <_Watchdog_Ticks_since_boot>,%a1 4a18a: 2149 0018 movel %a1,%a0@(24) _ISR_Enable( level ); 4a18e: 46c1 movew %d1,%sr return( previous_state ); } 4a190: 241f movel %sp@+,%d2 4a192: 245f moveal %sp@+,%a2 4a194: 4e5e unlk %fp 4a196: 4e75 rts Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); previous_state = the_watchdog->state; switch ( previous_state ) { 4a198: 143c 0003 moveb #3,%d2 4a19c: b480 cmpl %d0,%d2 4a19e: 65e4 bcss 4a184 <_Watchdog_Remove+0x24> <== NEVER TAKEN } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; _ISR_Enable( level ); return( previous_state ); } 4a1a0: 2250 moveal %a0@,%a1 break; case WATCHDOG_ACTIVE: case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; 4a1a2: 42a8 0008 clrl %a0@(8) next_watchdog = _Watchdog_Next( the_watchdog ); if ( _Watchdog_Next(next_watchdog) ) 4a1a6: 4a91 tstl %a1@ 4a1a8: 6708 beqs 4a1b2 <_Watchdog_Remove+0x52> next_watchdog->delta_interval += the_watchdog->delta_interval; 4a1aa: 2428 0010 movel %a0@(16),%d2 4a1ae: d5a9 0010 addl %d2,%a1@(16) if ( _Watchdog_Sync_count ) 4a1b2: 2479 0006 1146 moveal 61146 <_Watchdog_Sync_count>,%a2 4a1b8: 4a8a tstl %a2 4a1ba: 670c beqs 4a1c8 <_Watchdog_Remove+0x68> _Watchdog_Sync_level = _ISR_Nest_level; 4a1bc: 45f9 0006 14a6 lea 614a6 <_Per_CPU_Information+0x8>,%a2 4a1c2: 23d2 0006 10ec movel %a2@,610ec <_Watchdog_Sync_level> { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 4a1c8: 2468 0004 moveal %a0@(4),%a2 next->previous = previous; 4a1cc: 234a 0004 movel %a2,%a1@(4) previous->next = next; 4a1d0: 2489 movel %a1,%a2@ _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 4a1d2: 2279 0006 114a moveal 6114a <_Watchdog_Ticks_since_boot>,%a1 4a1d8: 2149 0018 movel %a1,%a0@(24) _ISR_Enable( level ); 4a1dc: 46c1 movew %d1,%sr return( previous_state ); } 4a1de: 241f movel %sp@+,%d2 4a1e0: 245f moveal %sp@+,%a2 4a1e2: 4e5e unlk %fp 4a1e4: 4e75 rts _Watchdog_Sync_level = _ISR_Nest_level; _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 4a1e6: 2279 0006 114a moveal 6114a <_Watchdog_Ticks_since_boot>,%a1 /* * 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; 4a1ec: 42a8 0008 clrl %a0@(8) _Watchdog_Sync_level = _ISR_Nest_level; _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 4a1f0: 2149 0018 movel %a1,%a0@(24) _ISR_Enable( level ); 4a1f4: 46c1 movew %d1,%sr return( previous_state ); } 4a1f6: 241f movel %sp@+,%d2 4a1f8: 245f moveal %sp@+,%a2 4a1fa: 4e5e unlk %fp ... =============================================================================== 0004b328 <_Watchdog_Report_chain>: ) { ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 4b328: 203c 0000 0700 movel #1792,%d0 void _Watchdog_Report_chain( const char *name, Chain_Control *header ) { 4b32e: 4e56 ffe8 linkw %fp,#-24 4b332: 48d7 3c0c moveml %d2-%d3/%a2-%a5,%sp@ 4b336: 242e 0008 movel %fp@(8),%d2 4b33a: 266e 000c moveal %fp@(12),%a3 ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 4b33e: 40c3 movew %sr,%d3 4b340: 8083 orl %d3,%d0 4b342: 46c0 movew %d0,%sr printk( "Watchdog Chain: %s %p\n", name, header ); 4b344: 2f0b movel %a3,%sp@- 4b346: 4bf9 0004 4be0 lea 44be0 ,%a5 4b34c: 2f02 movel %d2,%sp@- 4b34e: 4879 0006 051c pea 6051c <_Status_Object_name_errors_to_status+0x14> 4b354: 4e95 jsr %a5@ */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 4b356: 245b moveal %a3@+,%a2 if ( !_Chain_Is_empty( header ) ) { 4b358: 4fef 000c lea %sp@(12),%sp 4b35c: b7ca cmpal %a2,%a3 4b35e: 672c beqs 4b38c <_Watchdog_Report_chain+0x64> 4b360: 49f9 0004 b3a4 lea 4b3a4 <_Watchdog_Report>,%a4 node != _Chain_Tail(header) ; node = node->next ) { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); 4b366: 2f0a movel %a2,%sp@- 4b368: 42a7 clrl %sp@- 4b36a: 4e94 jsr %a4@ _ISR_Disable( level ); printk( "Watchdog Chain: %s %p\n", name, header ); if ( !_Chain_Is_empty( header ) ) { for ( node = _Chain_First( header ) ; node != _Chain_Tail(header) ; node = node->next ) 4b36c: 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 = _Chain_First( header ) ; 4b36e: 508f addql #8,%sp 4b370: b7ca cmpal %a2,%a3 4b372: 66f2 bnes 4b366 <_Watchdog_Report_chain+0x3e> <== NEVER TAKEN { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); 4b374: 2f02 movel %d2,%sp@- 4b376: 4879 0006 0533 pea 60533 <_Status_Object_name_errors_to_status+0x2b> 4b37c: 4e95 jsr %a5@ 4b37e: 508f addql #8,%sp } else { printk( "Chain is empty\n" ); } _ISR_Enable( level ); 4b380: 46c3 movew %d3,%sr } 4b382: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 4b388: 4e5e unlk %fp 4b38a: 4e75 rts _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); } else { printk( "Chain is empty\n" ); 4b38c: 4879 0006 0542 pea 60542 <_Status_Object_name_errors_to_status+0x3a> 4b392: 4e95 jsr %a5@ 4b394: 588f addql #4,%sp } _ISR_Enable( level ); 4b396: 46c3 movew %d3,%sr } 4b398: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 4b39e: 4e5e unlk %fp ... =============================================================================== 0004a200 <_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 ); 4a200: 203c 0000 0700 movel #1792,%d0 */ void _Watchdog_Tickle( Chain_Control *header ) { 4a206: 4e56 ffe8 linkw %fp,#-24 4a20a: 48d7 3c0c moveml %d2-%d3/%a2-%a5,%sp@ 4a20e: 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 ); 4a212: 40c2 movew %sr,%d2 4a214: 8082 orl %d2,%d0 4a216: 46c0 movew %d0,%sr */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 4a218: 264c moveal %a4,%a3 4a21a: 245b moveal %a3@+,%a2 if ( _Chain_Is_empty( header ) ) 4a21c: b7ca cmpal %a2,%a3 4a21e: 673c beqs 4a25c <_Watchdog_Tickle+0x5c> * 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) { 4a220: 202a 0010 movel %a2@(16),%d0 4a224: 4bf9 0004 a160 lea 4a160 <_Watchdog_Remove>,%a5 4a22a: 6708 beqs 4a234 <_Watchdog_Tickle+0x34> the_watchdog->delta_interval--; 4a22c: 5380 subql #1,%d0 4a22e: 2540 0010 movel %d0,%a2@(16) if ( the_watchdog->delta_interval != 0 ) 4a232: 6628 bnes 4a25c <_Watchdog_Tickle+0x5c> case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 4a234: 263c 0000 0700 movel #1792,%d3 if ( the_watchdog->delta_interval != 0 ) goto leave; } do { watchdog_state = _Watchdog_Remove( the_watchdog ); 4a23a: 2f0a movel %a2,%sp@- 4a23c: 4e95 jsr %a5@ _ISR_Enable( level ); 4a23e: 46c2 movew %d2,%sr switch( watchdog_state ) { 4a240: 7202 moveq #2,%d1 4a242: 588f addql #4,%sp 4a244: b280 cmpl %d0,%d1 4a246: 6720 beqs 4a268 <_Watchdog_Tickle+0x68> <== ALWAYS TAKEN case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 4a248: 2003 movel %d3,%d0 4a24a: 40c2 movew %sr,%d2 4a24c: 8082 orl %d2,%d0 4a24e: 46c0 movew %d0,%sr */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 4a250: 2454 moveal %a4@,%a2 the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); 4a252: b5cb cmpal %a3,%a2 4a254: 6706 beqs 4a25c <_Watchdog_Tickle+0x5c> } _ISR_Disable( level ); the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && 4a256: 4aaa 0010 tstl %a2@(16) 4a25a: 67de beqs 4a23a <_Watchdog_Tickle+0x3a> (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); 4a25c: 46c2 movew %d2,%sr } 4a25e: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 4a264: 4e5e unlk %fp 4a266: 4e75 rts _ISR_Enable( level ); switch( watchdog_state ) { case WATCHDOG_ACTIVE: (*the_watchdog->routine)( 4a268: 2f2a 0024 movel %a2@(36),%sp@- 4a26c: 2f2a 0020 movel %a2@(32),%sp@- 4a270: 206a 001c moveal %a2@(28),%a0 4a274: 4e90 jsr %a0@ the_watchdog->id, the_watchdog->user_data ); break; 4a276: 508f addql #8,%sp 4a278: 60ce bras 4a248 <_Watchdog_Tickle+0x48> ... =============================================================================== 0005ce20 <_kill_r>: int _kill_r( struct _reent *ptr, pid_t pid, int sig ) { 5ce20: 4e56 0000 linkw %fp,#0 return killinfo( pid, sig, NULL ); 5ce24: 2d6e 000c 0008 movel %fp@(12),%fp@(8) int _kill_r( struct _reent *ptr, pid_t pid, int sig ) { 5ce2a: 202e 0010 movel %fp@(16),%d0 return killinfo( pid, sig, NULL ); 5ce2e: 42ae 0010 clrl %fp@(16) 5ce32: 2d40 000c movel %d0,%fp@(12) } 5ce36: 4e5e unlk %fp struct _reent *ptr, pid_t pid, int sig ) { return killinfo( pid, sig, NULL ); 5ce38: 4ef9 0005 d028 jmp 5d028 ... =============================================================================== 000468c8 : int adjtime( struct timeval *delta, struct timeval *olddelta ) { 468c8: 4e56 ffec linkw %fp,#-20 468cc: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 468d0: 246e 0008 moveal %fp@(8),%a2 468d4: 266e 000c moveal %fp@(12),%a3 long adjustment; /* * Simple validations */ if ( !delta ) 468d8: 4a8a tstl %a2 468da: 6700 00f2 beqw 469ce rtems_set_errno_and_return_minus_one( EINVAL ); if ( delta->tv_usec >= TOD_MICROSECONDS_PER_SECOND ) 468de: 202a 0004 movel %a2@(4),%d0 468e2: 0c80 000f 423f cmpil #999999,%d0 468e8: 6200 00e4 bhiw 469ce rtems_set_errno_and_return_minus_one( EINVAL ); if ( olddelta ) { 468ec: 4a8b tstl %a3 468ee: 670a beqs 468fa olddelta->tv_sec = 0; olddelta->tv_usec = 0; 468f0: 42ab 0004 clrl %a3@(4) 468f4: 202a 0004 movel %a2@(4),%d0 if ( delta->tv_usec >= TOD_MICROSECONDS_PER_SECOND ) rtems_set_errno_and_return_minus_one( EINVAL ); if ( olddelta ) { olddelta->tv_sec = 0; 468f8: 4293 clrl %a3@ olddelta->tv_usec = 0; } /* convert delta to microseconds */ adjustment = (delta->tv_sec * TOD_MICROSECONDS_PER_SECOND); 468fa: 223c 000f 4240 movel #1000000,%d1 46900: 4c12 1800 mulsl %a2@,%d1 adjustment += delta->tv_usec; 46904: d081 addl %d1,%d0 /* too small to account for */ if ( adjustment < rtems_configuration_get_microseconds_per_tick() ) 46906: b0b9 0006 0a98 cmpl 60a98 ,%d0 4690c: 640c bccs 4691a return 0; 4690e: 4280 clrl %d0 /* set the user's output */ if ( olddelta ) *olddelta = *delta; return 0; } 46910: 4cee 0c04 ffec moveml %fp@(-20),%d2/%a2-%a3 46916: 4e5e unlk %fp 46918: 4e75 rts * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 4691a: 2039 0006 25a0 movel 625a0 <_Thread_Dispatch_disable_level>,%d0 46920: 5280 addql #1,%d0 46922: 23c0 0006 25a0 movel %d0,625a0 <_Thread_Dispatch_disable_level> return _Thread_Dispatch_disable_level; 46928: 2039 0006 25a0 movel 625a0 <_Thread_Dispatch_disable_level>,%d0 * This prevents context switches while we are adjusting the TOD */ _Thread_Disable_dispatch(); _TOD_Get( &ts ); 4692e: 240e movel %fp,%d2 46930: 5182 subql #8,%d2 46932: 2f02 movel %d2,%sp@- 46934: 4eb9 0004 82f0 jsr 482f0 <_TOD_Get> ts.tv_sec += delta->tv_sec; ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; 4693a: 202a 0004 movel %a2@(4),%d0 4693e: 223c 0000 03e8 movel #1000,%d1 46944: 4c01 0800 mulsl %d1,%d0 /* if adjustment is too much positive */ while ( ts.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 46948: 588f addql #4,%sp _Thread_Disable_dispatch(); _TOD_Get( &ts ); ts.tv_sec += delta->tv_sec; 4694a: 2212 movel %a2@,%d1 ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; 4694c: d0ae fffc addl %fp@(-4),%d0 _Thread_Disable_dispatch(); _TOD_Get( &ts ); ts.tv_sec += delta->tv_sec; 46950: d3ae fff8 addl %d1,%fp@(-8) ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; 46954: 2d40 fffc movel %d0,%fp@(-4) /* if adjustment is too much positive */ while ( ts.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 46958: 0c80 3b9a c9ff cmpil #999999999,%d0 4695e: 631c blss 4697c 46960: 222e fff8 movel %fp@(-8),%d1 ts.tv_nsec -= TOD_NANOSECONDS_PER_SECOND; ts.tv_sec++; 46964: 5281 addql #1,%d1 ts.tv_sec += delta->tv_sec; ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; /* if adjustment is too much positive */ while ( ts.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { ts.tv_nsec -= TOD_NANOSECONDS_PER_SECOND; 46966: 0680 c465 3600 addil #-1000000000,%d0 ts.tv_sec += delta->tv_sec; ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; /* if adjustment is too much positive */ while ( ts.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 4696c: 0c80 3b9a c9ff cmpil #999999999,%d0 46972: 62f0 bhis 46964 <== NEVER TAKEN 46974: 2d40 fffc movel %d0,%fp@(-4) 46978: 2d41 fff8 movel %d1,%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) ) { 4697c: 0c80 c465 3600 cmpil #-1000000000,%d0 46982: 621c bhis 469a0 <== NEVER TAKEN 46984: 222e fff8 movel %fp@(-8),%d1 ts.tv_nsec += TOD_NANOSECONDS_PER_SECOND; ts.tv_sec--; 46988: 5381 subql #1,%d1 ts.tv_sec++; } /* if adjustment is too much negative */ while ( ts.tv_nsec <= (-1 * TOD_NANOSECONDS_PER_SECOND) ) { ts.tv_nsec += TOD_NANOSECONDS_PER_SECOND; 4698a: 0680 3b9a ca00 addil #1000000000,%d0 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) ) { 46990: 0c80 c465 3600 cmpil #-1000000000,%d0 46996: 63f0 blss 46988 46998: 2d40 fffc movel %d0,%fp@(-4) 4699c: 2d41 fff8 movel %d1,%fp@(-8) ts.tv_nsec += TOD_NANOSECONDS_PER_SECOND; ts.tv_sec--; } _TOD_Set( &ts ); 469a0: 2f02 movel %d2,%sp@- 469a2: 4eb9 0004 8384 jsr 48384 <_TOD_Set> _Thread_Enable_dispatch(); 469a8: 4eb9 0004 9b28 jsr 49b28 <_Thread_Enable_dispatch> /* set the user's output */ if ( olddelta ) 469ae: 588f addql #4,%sp *olddelta = *delta; return 0; 469b0: 4280 clrl %d0 _TOD_Set( &ts ); _Thread_Enable_dispatch(); /* set the user's output */ if ( olddelta ) 469b2: 4a8b tstl %a3 469b4: 6700 ff5a beqw 46910 *olddelta = *delta; 469b8: 2212 movel %a2@,%d1 469ba: 242a 0004 movel %a2@(4),%d2 469be: 2681 movel %d1,%a3@ 469c0: 2742 0004 movel %d2,%a3@(4) return 0; } 469c4: 4cee 0c04 ffec moveml %fp@(-20),%d2/%a2-%a3 469ca: 4e5e unlk %fp 469cc: 4e75 rts */ if ( !delta ) rtems_set_errno_and_return_minus_one( EINVAL ); if ( delta->tv_usec >= TOD_MICROSECONDS_PER_SECOND ) rtems_set_errno_and_return_minus_one( EINVAL ); 469ce: 4eb9 0004 fae0 jsr 4fae0 <__errno> 469d4: 7216 moveq #22,%d1 469d6: 2040 moveal %d0,%a0 469d8: 70ff moveq #-1,%d0 /* set the user's output */ if ( olddelta ) *olddelta = *delta; return 0; } 469da: 4cee 0c04 ffec moveml %fp@(-20),%d2/%a2-%a3 */ if ( !delta ) rtems_set_errno_and_return_minus_one( EINVAL ); if ( delta->tv_usec >= TOD_MICROSECONDS_PER_SECOND ) rtems_set_errno_and_return_minus_one( EINVAL ); 469e0: 2081 movel %d1,%a0@ /* set the user's output */ if ( olddelta ) *olddelta = *delta; return 0; } 469e2: 4e5e unlk %fp ... =============================================================================== 0004714c : * operation(s) cannot be canceled */ int aio_cancel(int fildes, struct aiocb *aiocbp) { 4714c: 4e56 ffe8 linkw %fp,#-24 47150: 48d7 3c0c moveml %d2-%d3/%a2-%a5,%sp@ rtems_aio_request_chain *r_chain; int result; pthread_mutex_lock (&aio_request_queue.mutex); 47154: 4879 0006 3de8 pea 63de8 4715a: 49f9 0004 8510 lea 48510 ,%a4 * operation(s) cannot be canceled */ int aio_cancel(int fildes, struct aiocb *aiocbp) { 47160: 242e 0008 movel %fp@(8),%d2 47164: 246e 000c moveal %fp@(12),%a2 rtems_aio_request_chain *r_chain; int result; pthread_mutex_lock (&aio_request_queue.mutex); 47168: 4e94 jsr %a4@ if (fcntl (fildes, F_GETFD) < 0) { 4716a: 4878 0001 pea 1 4716e: 2f02 movel %d2,%sp@- 47170: 4eb9 0004 e65c jsr 4e65c 47176: 4fef 000c lea %sp@(12),%sp 4717a: 4a80 tstl %d0 4717c: 6d00 01c4 bltw 47342 pthread_mutex_unlock(&aio_request_queue.mutex); rtems_set_errno_and_return_minus_one (EBADF); } /* if aiocbp is NULL remove all request for given file descriptor */ if (aiocbp == NULL) { 47180: 4a8a tstl %a2 47182: 6700 00f4 beqw 47278 pthread_mutex_unlock (&aio_request_queue.mutex); return AIO_CANCELED; } else { AIO_printf ("Cancel request\n"); if (aiocbp->aio_fildes != fildes) { 47186: 2612 movel %a2@,%d3 47188: b483 cmpl %d3,%d2 4718a: 6600 00c4 bnew 47250 pthread_mutex_unlock (&aio_request_queue.mutex); rtems_set_errno_and_return_minus_one (EINVAL); } r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0); 4718e: 42a7 clrl %sp@- 47190: 4bf9 0004 75c2 lea 475c2 ,%a5 47196: 2f03 movel %d3,%sp@- 47198: 4879 0006 3e30 pea 63e30 4719e: 4e95 jsr %a5@ if (r_chain == NULL) { 471a0: 4fef 000c lea %sp@(12),%sp if (aiocbp->aio_fildes != fildes) { pthread_mutex_unlock (&aio_request_queue.mutex); rtems_set_errno_and_return_minus_one (EINVAL); } r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0); 471a4: 2640 moveal %d0,%a3 if (r_chain == NULL) { 471a6: 4a80 tstl %d0 471a8: 673c beqs 471e6 return AIO_ALLDONE; } } AIO_printf ("Request on [WQ]\n"); pthread_mutex_lock (&r_chain->mutex); 471aa: 2600 movel %d0,%d3 471ac: 0683 0000 001c addil #28,%d3 result = rtems_aio_remove_req (&r_chain->perfd, aiocbp); pthread_mutex_unlock (&r_chain->mutex); 471b2: 4bf9 0004 85ac lea 485ac ,%a5 return AIO_ALLDONE; } } AIO_printf ("Request on [WQ]\n"); pthread_mutex_lock (&r_chain->mutex); 471b8: 2f03 movel %d3,%sp@- 471ba: 4e94 jsr %a4@ result = rtems_aio_remove_req (&r_chain->perfd, aiocbp); 471bc: 2f0a movel %a2,%sp@- 471be: 486b 0008 pea %a3@(8) 471c2: 4eb9 0004 7a3a jsr 47a3a 471c8: 2400 movel %d0,%d2 pthread_mutex_unlock (&r_chain->mutex); 471ca: 2f03 movel %d3,%sp@- 471cc: 4e95 jsr %a5@ pthread_mutex_unlock (&aio_request_queue.mutex); 471ce: 4879 0006 3de8 pea 63de8 471d4: 4e95 jsr %a5@ return result; 471d6: 4fef 0014 lea %sp@(20),%sp } return AIO_ALLDONE; } 471da: 2002 movel %d2,%d0 471dc: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 471e2: 4e5e unlk %fp 471e4: 4e75 rts rtems_set_errno_and_return_minus_one (EINVAL); } r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0); if (r_chain == NULL) { if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) { 471e6: 203c 0006 3e40 movel #409152,%d0 471ec: b0b9 0006 3e3c cmpl 63e3c ,%d0 471f2: 6740 beqs 47234 <== NEVER TAKEN r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0); 471f4: 42a7 clrl %sp@- 471f6: 2f03 movel %d3,%sp@- 471f8: 4879 0006 3e3c pea 63e3c 471fe: 4e95 jsr %a5@ if (r_chain == NULL) { 47200: 4fef 000c lea %sp@(12),%sp 47204: 4a80 tstl %d0 47206: 6748 beqs 47250 rtems_set_errno_and_return_minus_one (EINVAL); } AIO_printf ("Request on [IQ]\n"); result = rtems_aio_remove_req (&r_chain->perfd, aiocbp); 47208: 2f0a movel %a2,%sp@- 4720a: 2040 moveal %d0,%a0 4720c: 4868 0008 pea %a0@(8) 47210: 4eb9 0004 7a3a jsr 47a3a pthread_mutex_unlock (&aio_request_queue.mutex); 47216: 4879 0006 3de8 pea 63de8 rtems_set_errno_and_return_minus_one (EINVAL); } AIO_printf ("Request on [IQ]\n"); result = rtems_aio_remove_req (&r_chain->perfd, aiocbp); 4721c: 2400 movel %d0,%d2 pthread_mutex_unlock (&aio_request_queue.mutex); 4721e: 4eb9 0004 85ac jsr 485ac return result; 47224: 4fef 000c lea %sp@(12),%sp pthread_mutex_unlock (&r_chain->mutex); pthread_mutex_unlock (&aio_request_queue.mutex); return result; } return AIO_ALLDONE; } 47228: 2002 movel %d2,%d0 4722a: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 47230: 4e5e unlk %fp 47232: 4e75 rts result = rtems_aio_remove_req (&r_chain->perfd, aiocbp); pthread_mutex_unlock (&aio_request_queue.mutex); return result; } else { pthread_mutex_unlock (&aio_request_queue.mutex); 47234: 4879 0006 3de8 pea 63de8 return AIO_ALLDONE; 4723a: 7402 moveq #2,%d2 result = rtems_aio_remove_req (&r_chain->perfd, aiocbp); pthread_mutex_unlock (&aio_request_queue.mutex); return result; } else { pthread_mutex_unlock (&aio_request_queue.mutex); 4723c: 4eb9 0004 85ac jsr 485ac return AIO_ALLDONE; 47242: 588f addql #4,%sp pthread_mutex_unlock (&r_chain->mutex); pthread_mutex_unlock (&aio_request_queue.mutex); return result; } return AIO_ALLDONE; } 47244: 2002 movel %d2,%d0 47246: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 4724c: 4e5e unlk %fp 4724e: 4e75 rts r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0); if (r_chain == NULL) { if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) { r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0); if (r_chain == NULL) { pthread_mutex_unlock (&aio_request_queue.mutex); 47250: 4879 0006 3de8 pea 63de8 rtems_set_errno_and_return_minus_one (EINVAL); 47256: 74ff moveq #-1,%d2 r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0); if (r_chain == NULL) { if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) { r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0); if (r_chain == NULL) { pthread_mutex_unlock (&aio_request_queue.mutex); 47258: 4eb9 0004 85ac jsr 485ac rtems_set_errno_and_return_minus_one (EINVAL); 4725e: 4eb9 0005 1b40 jsr 51b40 <__errno> 47264: 588f addql #4,%sp 47266: 2040 moveal %d0,%a0 47268: 7016 moveq #22,%d0 4726a: 2080 movel %d0,%a0@ pthread_mutex_unlock (&r_chain->mutex); pthread_mutex_unlock (&aio_request_queue.mutex); return result; } return AIO_ALLDONE; } 4726c: 2002 movel %d2,%d0 4726e: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 47274: 4e5e unlk %fp 47276: 4e75 rts /* if aiocbp is NULL remove all request for given file descriptor */ if (aiocbp == NULL) { AIO_printf ("Cancel all requests\n"); r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0); 47278: 42a7 clrl %sp@- 4727a: 45f9 0004 75c2 lea 475c2 ,%a2 47280: 2f02 movel %d2,%sp@- 47282: 4879 0006 3e30 pea 63e30 47288: 4e92 jsr %a2@ if (r_chain == NULL) { 4728a: 4fef 000c lea %sp@(12),%sp /* if aiocbp is NULL remove all request for given file descriptor */ if (aiocbp == NULL) { AIO_printf ("Cancel all requests\n"); r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0); 4728e: 2600 movel %d0,%d3 if (r_chain == NULL) { 47290: 673e beqs 472d0 <== NEVER TAKEN return AIO_ALLDONE; } AIO_printf ("Request chain on [WQ]\n"); pthread_mutex_lock (&r_chain->mutex); 47292: 2640 moveal %d0,%a3 47294: 47eb 001c lea %a3@(28),%a3 rtems_chain_extract (&r_chain->next_fd); rtems_aio_remove_fd (r_chain); pthread_mutex_unlock (&r_chain->mutex); 47298: 45f9 0004 85ac lea 485ac ,%a2 pthread_mutex_unlock (&aio_request_queue.mutex); return AIO_CANCELED; 4729e: 4282 clrl %d2 return AIO_ALLDONE; } AIO_printf ("Request chain on [WQ]\n"); pthread_mutex_lock (&r_chain->mutex); 472a0: 2f0b movel %a3,%sp@- 472a2: 4e94 jsr %a4@ */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 472a4: 2f03 movel %d3,%sp@- 472a6: 4eb9 0004 a0c0 jsr 4a0c0 <_Chain_Extract> rtems_chain_extract (&r_chain->next_fd); rtems_aio_remove_fd (r_chain); 472ac: 2f03 movel %d3,%sp@- 472ae: 4eb9 0004 79e2 jsr 479e2 pthread_mutex_unlock (&r_chain->mutex); 472b4: 2f0b movel %a3,%sp@- 472b6: 4e92 jsr %a2@ pthread_mutex_unlock (&aio_request_queue.mutex); 472b8: 4879 0006 3de8 pea 63de8 472be: 4e92 jsr %a2@ return AIO_CANCELED; 472c0: 4fef 0014 lea %sp@(20),%sp pthread_mutex_unlock (&r_chain->mutex); pthread_mutex_unlock (&aio_request_queue.mutex); return result; } return AIO_ALLDONE; } 472c4: 2002 movel %d2,%d0 472c6: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 472cc: 4e5e unlk %fp 472ce: 4e75 rts r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0); if (r_chain == NULL) { AIO_printf ("Request chain not on [WQ]\n"); if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) { 472d0: 203c 0006 3e40 movel #409152,%d0 472d6: b0b9 0006 3e3c cmpl 63e3c ,%d0 472dc: 6700 ff56 beqw 47234 r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0); 472e0: 42a7 clrl %sp@- 472e2: 2f02 movel %d2,%sp@- 472e4: 4879 0006 3e3c pea 63e3c 472ea: 4e92 jsr %a2@ if (r_chain == NULL) { 472ec: 4fef 000c lea %sp@(12),%sp r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0); if (r_chain == NULL) { AIO_printf ("Request chain not on [WQ]\n"); if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) { r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0); 472f0: 2600 movel %d0,%d3 if (r_chain == NULL) { 472f2: 6700 ff40 beqw 47234 472f6: 2f00 movel %d0,%sp@- AIO_printf ("Request chain on [IQ]\n"); rtems_chain_extract (&r_chain->next_fd); rtems_aio_remove_fd (r_chain); pthread_mutex_destroy (&r_chain->mutex); 472f8: 2440 moveal %d0,%a2 472fa: 45ea 001c lea %a2@(28),%a2 pthread_cond_destroy (&r_chain->mutex); free (r_chain); pthread_mutex_unlock (&aio_request_queue.mutex); return AIO_CANCELED; 472fe: 4282 clrl %d2 47300: 4eb9 0004 a0c0 jsr 4a0c0 <_Chain_Extract> } AIO_printf ("Request chain on [IQ]\n"); rtems_chain_extract (&r_chain->next_fd); rtems_aio_remove_fd (r_chain); 47306: 2f03 movel %d3,%sp@- 47308: 4eb9 0004 79e2 jsr 479e2 pthread_mutex_destroy (&r_chain->mutex); 4730e: 2f0a movel %a2,%sp@- 47310: 4eb9 0004 8264 jsr 48264 pthread_cond_destroy (&r_chain->mutex); 47316: 2f0a movel %a2,%sp@- 47318: 4eb9 0004 7ee4 jsr 47ee4 free (r_chain); 4731e: 2f03 movel %d3,%sp@- 47320: 4eb9 0004 3c9c jsr 43c9c pthread_mutex_unlock (&aio_request_queue.mutex); 47326: 4879 0006 3de8 pea 63de8 4732c: 4eb9 0004 85ac jsr 485ac return AIO_CANCELED; 47332: 4fef 0018 lea %sp@(24),%sp pthread_mutex_unlock (&r_chain->mutex); pthread_mutex_unlock (&aio_request_queue.mutex); return result; } return AIO_ALLDONE; } 47336: 2002 movel %d2,%d0 47338: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 4733e: 4e5e unlk %fp 47340: 4e75 rts int result; pthread_mutex_lock (&aio_request_queue.mutex); if (fcntl (fildes, F_GETFD) < 0) { pthread_mutex_unlock(&aio_request_queue.mutex); 47342: 4879 0006 3de8 pea 63de8 rtems_set_errno_and_return_minus_one (EBADF); 47348: 74ff moveq #-1,%d2 int result; pthread_mutex_lock (&aio_request_queue.mutex); if (fcntl (fildes, F_GETFD) < 0) { pthread_mutex_unlock(&aio_request_queue.mutex); 4734a: 4eb9 0004 85ac jsr 485ac rtems_set_errno_and_return_minus_one (EBADF); 47350: 4eb9 0005 1b40 jsr 51b40 <__errno> 47356: 588f addql #4,%sp 47358: 7209 moveq #9,%d1 4735a: 2040 moveal %d0,%a0 pthread_mutex_unlock (&r_chain->mutex); pthread_mutex_unlock (&aio_request_queue.mutex); return result; } return AIO_ALLDONE; } 4735c: 2002 movel %d2,%d0 4735e: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 pthread_mutex_lock (&aio_request_queue.mutex); if (fcntl (fildes, F_GETFD) < 0) { pthread_mutex_unlock(&aio_request_queue.mutex); rtems_set_errno_and_return_minus_one (EBADF); 47364: 2081 movel %d1,%a0@ pthread_mutex_unlock (&r_chain->mutex); pthread_mutex_unlock (&aio_request_queue.mutex); return result; } return AIO_ALLDONE; } 47366: 4e5e unlk %fp ... =============================================================================== 0004737c : ) { rtems_aio_request *req; int mode; if (op != O_SYNC) 4737c: 203c 0000 2000 movel #8192,%d0 int aio_fsync( int op, struct aiocb *aiocbp ) { 47382: 4e56 0000 linkw %fp,#0 47386: 2f0a movel %a2,%sp@- 47388: 246e 000c moveal %fp@(12),%a2 rtems_aio_request *req; int mode; if (op != O_SYNC) 4738c: b0ae 0008 cmpl %fp@(8),%d0 47390: 6648 bnes 473da rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); mode = fcntl (aiocbp->aio_fildes, F_GETFL); 47392: 4878 0003 pea 3 47396: 2f12 movel %a2@,%sp@- 47398: 4eb9 0004 e65c jsr 4e65c if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) 4739e: 508f addql #8,%sp 473a0: 7203 moveq #3,%d1 473a2: c081 andl %d1,%d0 473a4: 123c 0001 moveb #1,%d1 473a8: 5380 subql #1,%d0 473aa: b280 cmpl %d0,%d1 473ac: 654e bcss 473fc rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); req = malloc (sizeof (rtems_aio_request)); 473ae: 4878 0018 pea 18 473b2: 4eb9 0004 42ac jsr 442ac if (req == NULL) 473b8: 588f addql #4,%sp 473ba: 4a80 tstl %d0 473bc: 6760 beqs 4741e <== NEVER TAKEN rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; 473be: 2040 moveal %d0,%a0 req->aiocbp->aio_lio_opcode = LIO_SYNC; 473c0: 7203 moveq #3,%d1 req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; 473c2: 214a 0014 movel %a2,%a0@(20) req->aiocbp->aio_lio_opcode = LIO_SYNC; 473c6: 2541 002c movel %d1,%a2@(44) return rtems_aio_enqueue (req); } 473ca: 246e fffc moveal %fp@(-4),%a2 rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_SYNC; return rtems_aio_enqueue (req); 473ce: 2d40 0008 movel %d0,%fp@(8) } 473d2: 4e5e unlk %fp rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_SYNC; return rtems_aio_enqueue (req); 473d4: 4ef9 0004 7a9e jmp 47a9e { rtems_aio_request *req; int mode; if (op != O_SYNC) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 473da: 7216 moveq #22,%d1 473dc: 70ff moveq #-1,%d0 473de: 2541 0030 movel %d1,%a2@(48) 473e2: 2540 0034 movel %d0,%a2@(52) 473e6: 4eb9 0005 1b40 jsr 51b40 <__errno> req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_SYNC; return rtems_aio_enqueue (req); } 473ec: 246e fffc moveal %fp@(-4),%a2 { rtems_aio_request *req; int mode; if (op != O_SYNC) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 473f0: 2040 moveal %d0,%a0 473f2: 7016 moveq #22,%d0 req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_SYNC; return rtems_aio_enqueue (req); } 473f4: 4e5e unlk %fp { rtems_aio_request *req; int mode; if (op != O_SYNC) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 473f6: 2080 movel %d0,%a0@ req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_SYNC; return rtems_aio_enqueue (req); } 473f8: 70ff moveq #-1,%d0 473fa: 4e75 rts if (op != O_SYNC) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); mode = fcntl (aiocbp->aio_fildes, F_GETFL); if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); 473fc: 72ff moveq #-1,%d1 473fe: 7009 moveq #9,%d0 47400: 2541 0034 movel %d1,%a2@(52) 47404: 2540 0030 movel %d0,%a2@(48) 47408: 4eb9 0005 1b40 jsr 51b40 <__errno> req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_SYNC; return rtems_aio_enqueue (req); } 4740e: 246e fffc moveal %fp@(-4),%a2 if (op != O_SYNC) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); mode = fcntl (aiocbp->aio_fildes, F_GETFL); if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); 47412: 2040 moveal %d0,%a0 47414: 7209 moveq #9,%d1 req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_SYNC; return rtems_aio_enqueue (req); } 47416: 70ff moveq #-1,%d0 47418: 4e5e unlk %fp if (op != O_SYNC) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); mode = fcntl (aiocbp->aio_fildes, F_GETFL); if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); 4741a: 2081 movel %d1,%a0@ req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_SYNC; return rtems_aio_enqueue (req); } 4741c: 4e75 rts if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 4741e: 103c 000b moveb #11,%d0 <== NOT EXECUTED 47422: 72ff moveq #-1,%d1 <== NOT EXECUTED 47424: 2540 0030 movel %d0,%a2@(48) <== NOT EXECUTED 47428: 2541 0034 movel %d1,%a2@(52) <== NOT EXECUTED 4742c: 4eb9 0005 1b40 jsr 51b40 <__errno> <== NOT EXECUTED req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_SYNC; return rtems_aio_enqueue (req); } 47432: 246e fffc moveal %fp@(-4),%a2 <== NOT EXECUTED if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 47436: 2040 moveal %d0,%a0 <== NOT EXECUTED 47438: 700b moveq #11,%d0 <== NOT EXECUTED req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_SYNC; return rtems_aio_enqueue (req); } 4743a: 4e5e unlk %fp <== NOT EXECUTED if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 4743c: 2080 movel %d0,%a0@ <== NOT EXECUTED req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_SYNC; return rtems_aio_enqueue (req); } 4743e: 70ff moveq #-1,%d0 <== NOT EXECUTED ... =============================================================================== 00047cc4 : * 0 - otherwise */ int aio_read (struct aiocb *aiocbp) { 47cc4: 4e56 0000 linkw %fp,#0 47cc8: 2f0a movel %a2,%sp@- rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 47cca: 4878 0003 pea 3 * 0 - otherwise */ int aio_read (struct aiocb *aiocbp) { 47cce: 246e 0008 moveal %fp@(8),%a2 rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 47cd2: 2f12 movel %a2@,%sp@- 47cd4: 4eb9 0004 e65c jsr 4e65c if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR))) 47cda: 508f addql #8,%sp 47cdc: 7203 moveq #3,%d1 47cde: c081 andl %d1,%d0 47ce0: 6708 beqs 47cea <== NEVER TAKEN 47ce2: 123c 0002 moveb #2,%d1 47ce6: b280 cmpl %d0,%d1 47ce8: 6638 bnes 47d22 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) 47cea: 4aaa 0014 tstl %a2@(20) 47cee: 6654 bnes 47d44 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) 47cf0: 4aaa 0004 tstl %a2@(4) 47cf4: 6b4e bmis 47d44 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); req = malloc (sizeof (rtems_aio_request)); 47cf6: 4878 0018 pea 18 47cfa: 4eb9 0004 42ac jsr 442ac if (req == NULL) 47d00: 588f addql #4,%sp 47d02: 4a80 tstl %d0 47d04: 6760 beqs 47d66 <== NEVER TAKEN rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; 47d06: 2040 moveal %d0,%a0 req->aiocbp->aio_lio_opcode = LIO_READ; 47d08: 7201 moveq #1,%d1 req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; 47d0a: 214a 0014 movel %a2,%a0@(20) req->aiocbp->aio_lio_opcode = LIO_READ; 47d0e: 2541 002c movel %d1,%a2@(44) return rtems_aio_enqueue (req); } 47d12: 246e fffc moveal %fp@(-4),%a2 rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_READ; return rtems_aio_enqueue (req); 47d16: 2d40 0008 movel %d0,%fp@(8) } 47d1a: 4e5e unlk %fp rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_READ; return rtems_aio_enqueue (req); 47d1c: 4ef9 0004 7a9e jmp 47a9e rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR))) rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); 47d22: 7009 moveq #9,%d0 47d24: 72ff moveq #-1,%d1 47d26: 2540 0030 movel %d0,%a2@(48) 47d2a: 2541 0034 movel %d1,%a2@(52) 47d2e: 4eb9 0005 1b40 jsr 51b40 <__errno> req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_READ; return rtems_aio_enqueue (req); } 47d34: 246e fffc moveal %fp@(-4),%a2 rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR))) rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); 47d38: 2040 moveal %d0,%a0 47d3a: 7009 moveq #9,%d0 req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_READ; return rtems_aio_enqueue (req); } 47d3c: 4e5e unlk %fp rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR))) rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); 47d3e: 2080 movel %d0,%a0@ req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_READ; return rtems_aio_enqueue (req); } 47d40: 70ff moveq #-1,%d0 47d42: 4e75 rts if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 47d44: 72ff moveq #-1,%d1 47d46: 7016 moveq #22,%d0 47d48: 2541 0034 movel %d1,%a2@(52) 47d4c: 2540 0030 movel %d0,%a2@(48) 47d50: 4eb9 0005 1b40 jsr 51b40 <__errno> req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_READ; return rtems_aio_enqueue (req); } 47d56: 246e fffc moveal %fp@(-4),%a2 if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 47d5a: 2040 moveal %d0,%a0 47d5c: 7216 moveq #22,%d1 req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_READ; return rtems_aio_enqueue (req); } 47d5e: 70ff moveq #-1,%d0 47d60: 4e5e unlk %fp if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 47d62: 2081 movel %d1,%a0@ req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_READ; return rtems_aio_enqueue (req); } 47d64: 4e75 rts if (aiocbp->aio_offset < 0) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 47d66: 103c 000b moveb #11,%d0 <== NOT EXECUTED 47d6a: 72ff moveq #-1,%d1 <== NOT EXECUTED 47d6c: 2540 0030 movel %d0,%a2@(48) <== NOT EXECUTED 47d70: 2541 0034 movel %d1,%a2@(52) <== NOT EXECUTED 47d74: 4eb9 0005 1b40 jsr 51b40 <__errno> <== NOT EXECUTED req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_READ; return rtems_aio_enqueue (req); } 47d7a: 246e fffc moveal %fp@(-4),%a2 <== NOT EXECUTED if (aiocbp->aio_offset < 0) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 47d7e: 2040 moveal %d0,%a0 <== NOT EXECUTED 47d80: 700b moveq #11,%d0 <== NOT EXECUTED req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_READ; return rtems_aio_enqueue (req); } 47d82: 4e5e unlk %fp <== NOT EXECUTED if (aiocbp->aio_offset < 0) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 47d84: 2080 movel %d0,%a0@ <== NOT EXECUTED req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_READ; return rtems_aio_enqueue (req); } 47d86: 70ff moveq #-1,%d0 <== NOT EXECUTED ... =============================================================================== 00047d9c : * 0 - otherwise */ int aio_write (struct aiocb *aiocbp) { 47d9c: 4e56 0000 linkw %fp,#0 47da0: 2f0a movel %a2,%sp@- rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 47da2: 4878 0003 pea 3 * 0 - otherwise */ int aio_write (struct aiocb *aiocbp) { 47da6: 246e 0008 moveal %fp@(8),%a2 rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 47daa: 2f12 movel %a2@,%sp@- 47dac: 4eb9 0004 e65c jsr 4e65c if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) 47db2: 508f addql #8,%sp 47db4: 7203 moveq #3,%d1 47db6: c081 andl %d1,%d0 47db8: 123c 0001 moveb #1,%d1 47dbc: 5380 subql #1,%d0 47dbe: b280 cmpl %d0,%d1 47dc0: 6538 bcss 47dfa rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) 47dc2: 4aaa 0014 tstl %a2@(20) 47dc6: 6654 bnes 47e1c rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) 47dc8: 4aaa 0004 tstl %a2@(4) 47dcc: 6b4e bmis 47e1c rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); req = malloc (sizeof (rtems_aio_request)); 47dce: 4878 0018 pea 18 47dd2: 4eb9 0004 42ac jsr 442ac if (req == NULL) 47dd8: 588f addql #4,%sp 47dda: 4a80 tstl %d0 47ddc: 6760 beqs 47e3e <== NEVER TAKEN rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; 47dde: 2040 moveal %d0,%a0 req->aiocbp->aio_lio_opcode = LIO_WRITE; 47de0: 7202 moveq #2,%d1 req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; 47de2: 214a 0014 movel %a2,%a0@(20) req->aiocbp->aio_lio_opcode = LIO_WRITE; 47de6: 2541 002c movel %d1,%a2@(44) return rtems_aio_enqueue (req); } 47dea: 246e fffc moveal %fp@(-4),%a2 rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_WRITE; return rtems_aio_enqueue (req); 47dee: 2d40 0008 movel %d0,%fp@(8) } 47df2: 4e5e unlk %fp rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_WRITE; return rtems_aio_enqueue (req); 47df4: 4ef9 0004 7a9e jmp 47a9e rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); 47dfa: 7009 moveq #9,%d0 47dfc: 72ff moveq #-1,%d1 47dfe: 2540 0030 movel %d0,%a2@(48) 47e02: 2541 0034 movel %d1,%a2@(52) 47e06: 4eb9 0005 1b40 jsr 51b40 <__errno> req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_WRITE; return rtems_aio_enqueue (req); } 47e0c: 246e fffc moveal %fp@(-4),%a2 rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); 47e10: 2040 moveal %d0,%a0 47e12: 7009 moveq #9,%d0 req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_WRITE; return rtems_aio_enqueue (req); } 47e14: 4e5e unlk %fp rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); 47e16: 2080 movel %d0,%a0@ req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_WRITE; return rtems_aio_enqueue (req); } 47e18: 70ff moveq #-1,%d0 47e1a: 4e75 rts if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 47e1c: 72ff moveq #-1,%d1 47e1e: 7016 moveq #22,%d0 47e20: 2541 0034 movel %d1,%a2@(52) 47e24: 2540 0030 movel %d0,%a2@(48) 47e28: 4eb9 0005 1b40 jsr 51b40 <__errno> req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_WRITE; return rtems_aio_enqueue (req); } 47e2e: 246e fffc moveal %fp@(-4),%a2 if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 47e32: 2040 moveal %d0,%a0 47e34: 7216 moveq #22,%d1 req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_WRITE; return rtems_aio_enqueue (req); } 47e36: 70ff moveq #-1,%d0 47e38: 4e5e unlk %fp if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 47e3a: 2081 movel %d1,%a0@ req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_WRITE; return rtems_aio_enqueue (req); } 47e3c: 4e75 rts if (aiocbp->aio_offset < 0) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 47e3e: 103c 000b moveb #11,%d0 <== NOT EXECUTED 47e42: 72ff moveq #-1,%d1 <== NOT EXECUTED 47e44: 2540 0030 movel %d0,%a2@(48) <== NOT EXECUTED 47e48: 2541 0034 movel %d1,%a2@(52) <== NOT EXECUTED 47e4c: 4eb9 0005 1b40 jsr 51b40 <__errno> <== NOT EXECUTED req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_WRITE; return rtems_aio_enqueue (req); } 47e52: 246e fffc moveal %fp@(-4),%a2 <== NOT EXECUTED if (aiocbp->aio_offset < 0) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 47e56: 2040 moveal %d0,%a0 <== NOT EXECUTED 47e58: 700b moveq #11,%d0 <== NOT EXECUTED req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_WRITE; return rtems_aio_enqueue (req); } 47e5a: 4e5e unlk %fp <== NOT EXECUTED if (aiocbp->aio_offset < 0) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 47e5c: 2080 movel %d0,%a0@ <== NOT EXECUTED req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_WRITE; return rtems_aio_enqueue (req); } 47e5e: 70ff moveq #-1,%d0 <== NOT EXECUTED ... =============================================================================== 00048828 : } unsigned int alarm( unsigned int seconds ) { 48828: 4e56 fff4 linkw %fp,#-12 4882c: 48d7 001c moveml %d2-%d4,%sp@ 48830: 242e 0008 movel %fp@(8),%d2 /* * Initialize the timer used to implement alarm(). */ if ( !the_timer->routine ) { 48834: 4ab9 0006 5bcc tstl 65bcc <_POSIX_signals_Alarm_timer+0x1c> 4883a: 674e beqs 4888a _Watchdog_Initialize( the_timer, _POSIX_signals_Alarm_TSR, 0, NULL ); } else { Watchdog_States state; state = _Watchdog_Remove( the_timer ); 4883c: 4879 0006 5bb0 pea 65bb0 <_POSIX_signals_Alarm_timer> 48842: 4eb9 0004 d99c jsr 4d99c <_Watchdog_Remove> if ( (state == WATCHDOG_ACTIVE) || (state == WATCHDOG_REMOVE_IT) ) { 48848: 588f addql #4,%sp 4884a: 7201 moveq #1,%d1 4884c: 5580 subql #2,%d0 4884e: b280 cmpl %d0,%d1 48850: 645e bccs 488b0 unsigned int alarm( unsigned int seconds ) { unsigned int remaining = 0; 48852: 4283 clrl %d3 remaining = the_timer->initial - ((the_timer->stop_time - the_timer->start_time) / TOD_TICKS_PER_SECOND); } } if ( seconds ) 48854: 4a82 tstl %d2 48856: 660c bnes 48864 <== NEVER TAKEN _Watchdog_Insert_seconds( the_timer, seconds ); return remaining; } 48858: 2003 movel %d3,%d0 4885a: 4cee 001c fff4 moveml %fp@(-12),%d2-%d4 48860: 4e5e unlk %fp 48862: 4e75 rts ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Seconds_chain, the_watchdog ); 48864: 4879 0006 5bb0 pea 65bb0 <_POSIX_signals_Alarm_timer> 4886a: 4879 0006 5eec pea 65eec <_Watchdog_Seconds_chain> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 48870: 23c2 0006 5bbc movel %d2,65bbc <_POSIX_signals_Alarm_timer+0xc> _Watchdog_Insert( &_Watchdog_Seconds_chain, the_watchdog ); 48876: 4eb9 0004 d854 jsr 4d854 <_Watchdog_Insert> 4887c: 508f addql #8,%sp 4887e: 2003 movel %d3,%d0 48880: 4cee 001c fff4 moveml %fp@(-12),%d2-%d4 48886: 4e5e unlk %fp 48888: 4e75 rts Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 4888a: 42b9 0006 5bb8 clrl 65bb8 <_POSIX_signals_Alarm_timer+0x8> unsigned int alarm( unsigned int seconds ) { unsigned int remaining = 0; 48890: 4283 clrl %d3 the_watchdog->routine = routine; 48892: 203c 0004 880c movel #296972,%d0 the_watchdog->id = id; 48898: 42b9 0006 5bd0 clrl 65bd0 <_POSIX_signals_Alarm_timer+0x20> Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 4889e: 23c0 0006 5bcc movel %d0,65bcc <_POSIX_signals_Alarm_timer+0x1c> the_watchdog->id = id; the_watchdog->user_data = user_data; 488a4: 42b9 0006 5bd4 clrl 65bd4 <_POSIX_signals_Alarm_timer+0x24> remaining = the_timer->initial - ((the_timer->stop_time - the_timer->start_time) / TOD_TICKS_PER_SECOND); } } if ( seconds ) 488aa: 4a82 tstl %d2 488ac: 67aa beqs 48858 <== NEVER TAKEN 488ae: 60b4 bras 48864 * boot. Since alarm() is dealing in seconds, we must account for * this. */ remaining = the_timer->initial - ((the_timer->stop_time - the_timer->start_time) / TOD_TICKS_PER_SECOND); 488b0: 2839 0006 5bc8 movel 65bc8 <_POSIX_signals_Alarm_timer+0x18>,%d4 488b6: 98b9 0006 5bc4 subl 65bc4 <_POSIX_signals_Alarm_timer+0x14>,%d4 * The stop_time and start_time fields are snapshots of ticks since * boot. Since alarm() is dealing in seconds, we must account for * this. */ remaining = the_timer->initial - 488bc: 2639 0006 5bbc movel 65bbc <_POSIX_signals_Alarm_timer+0xc>,%d3 ((the_timer->stop_time - the_timer->start_time) / TOD_TICKS_PER_SECOND); 488c2: 4eb9 0004 b248 jsr 4b248 488c8: 4c40 4004 remul %d0,%d4,%d4 * The stop_time and start_time fields are snapshots of ticks since * boot. Since alarm() is dealing in seconds, we must account for * this. */ remaining = the_timer->initial - 488cc: 9684 subl %d4,%d3 ((the_timer->stop_time - the_timer->start_time) / TOD_TICKS_PER_SECOND); } } if ( seconds ) 488ce: 4a82 tstl %d2 488d0: 6786 beqs 48858 <== NEVER TAKEN 488d2: 6090 bras 48864 =============================================================================== 0004671c : int clock_gettime( clockid_t clock_id, struct timespec *tp ) { 4671c: 4e56 0000 linkw %fp,#0 46720: 202e 0008 movel %fp@(8),%d0 46724: 222e 000c movel %fp@(12),%d1 46728: 2f02 movel %d2,%sp@- if ( !tp ) 4672a: 4a81 tstl %d1 4672c: 6718 beqs 46746 rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { 4672e: 7401 moveq #1,%d2 46730: b480 cmpl %d0,%d2 46732: 6752 beqs 46786 _TOD_Get(tp); return 0; } #ifdef CLOCK_MONOTONIC if ( clock_id == CLOCK_MONOTONIC ) { 46734: 7404 moveq #4,%d2 46736: b480 cmpl %d0,%d2 46738: 6738 beqs 46772 <== NEVER TAKEN return 0; } #endif #ifdef _POSIX_CPUTIME if ( clock_id == CLOCK_PROCESS_CPUTIME_ID ) { 4673a: 7402 moveq #2,%d2 4673c: b480 cmpl %d0,%d2 4673e: 6732 beqs 46772 return 0; } #endif #ifdef _POSIX_THREAD_CPUTIME if ( clock_id == CLOCK_THREAD_CPUTIME_ID ) 46740: 7203 moveq #3,%d1 46742: b280 cmpl %d0,%d1 46744: 6716 beqs 4675c rtems_set_errno_and_return_minus_one( ENOSYS ); #endif rtems_set_errno_and_return_minus_one( EINVAL ); 46746: 4eb9 0004 ffa8 jsr 4ffa8 <__errno> return 0; } 4674c: 242e fffc movel %fp@(-4),%d2 #ifdef _POSIX_THREAD_CPUTIME if ( clock_id == CLOCK_THREAD_CPUTIME_ID ) rtems_set_errno_and_return_minus_one( ENOSYS ); #endif rtems_set_errno_and_return_minus_one( EINVAL ); 46750: 2040 moveal %d0,%a0 46752: 7216 moveq #22,%d1 46754: 70ff moveq #-1,%d0 return 0; } 46756: 4e5e unlk %fp #ifdef _POSIX_THREAD_CPUTIME if ( clock_id == CLOCK_THREAD_CPUTIME_ID ) rtems_set_errno_and_return_minus_one( ENOSYS ); #endif rtems_set_errno_and_return_minus_one( EINVAL ); 46758: 2081 movel %d1,%a0@ return 0; } 4675a: 4e75 rts } #endif #ifdef _POSIX_THREAD_CPUTIME if ( clock_id == CLOCK_THREAD_CPUTIME_ID ) rtems_set_errno_and_return_minus_one( ENOSYS ); 4675c: 4eb9 0004 ffa8 jsr 4ffa8 <__errno> 46762: 7458 moveq #88,%d2 46764: 2040 moveal %d0,%a0 46766: 70ff moveq #-1,%d0 46768: 2082 movel %d2,%a0@ #endif rtems_set_errno_and_return_minus_one( EINVAL ); return 0; } 4676a: 242e fffc movel %fp@(-4),%d2 4676e: 4e5e unlk %fp 46770: 4e75 rts } #endif #ifdef _POSIX_CPUTIME if ( clock_id == CLOCK_PROCESS_CPUTIME_ID ) { _TOD_Get_uptime_as_timespec( tp ); 46772: 2f01 movel %d1,%sp@- 46774: 4eb9 0004 8824 jsr 48824 <_TOD_Get_uptime_as_timespec> #endif rtems_set_errno_and_return_minus_one( EINVAL ); return 0; } 4677a: 242e fffc movel %fp@(-4),%d2 #endif #ifdef _POSIX_CPUTIME if ( clock_id == CLOCK_PROCESS_CPUTIME_ID ) { _TOD_Get_uptime_as_timespec( tp ); return 0; 4677e: 588f addql #4,%sp 46780: 4280 clrl %d0 #endif rtems_set_errno_and_return_minus_one( EINVAL ); return 0; } 46782: 4e5e unlk %fp 46784: 4e75 rts { if ( !tp ) rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { _TOD_Get(tp); 46786: 2f01 movel %d1,%sp@- 46788: 4eb9 0004 87c0 jsr 487c0 <_TOD_Get> #endif rtems_set_errno_and_return_minus_one( EINVAL ); return 0; } 4678e: 242e fffc movel %fp@(-4),%d2 if ( !tp ) rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { _TOD_Get(tp); return 0; 46792: 588f addql #4,%sp 46794: 4280 clrl %d0 #endif rtems_set_errno_and_return_minus_one( EINVAL ); return 0; } 46796: 4e5e unlk %fp ... =============================================================================== 0004679c : int clock_settime( clockid_t clock_id, const struct timespec *tp ) { 4679c: 4e56 0000 linkw %fp,#0 467a0: 202e 0008 movel %fp@(8),%d0 467a4: 206e 000c moveal %fp@(12),%a0 if ( !tp ) 467a8: 4a88 tstl %a0 467aa: 6712 beqs 467be <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { 467ac: 7201 moveq #1,%d1 467ae: b280 cmpl %d0,%d1 467b0: 6730 beqs 467e2 _Thread_Disable_dispatch(); _TOD_Set( tp ); _Thread_Enable_dispatch(); } #ifdef _POSIX_CPUTIME else if ( clock_id == CLOCK_PROCESS_CPUTIME_ID ) 467b2: 7202 moveq #2,%d1 467b4: b280 cmpl %d0,%d1 467b6: 6718 beqs 467d0 rtems_set_errno_and_return_minus_one( ENOSYS ); #endif #ifdef _POSIX_THREAD_CPUTIME else if ( clock_id == CLOCK_THREAD_CPUTIME_ID ) 467b8: 7203 moveq #3,%d1 467ba: b280 cmpl %d0,%d1 467bc: 6712 beqs 467d0 rtems_set_errno_and_return_minus_one( ENOSYS ); #endif else rtems_set_errno_and_return_minus_one( EINVAL ); 467be: 4eb9 0004 ffa8 jsr 4ffa8 <__errno> 467c4: 7216 moveq #22,%d1 467c6: 2040 moveal %d0,%a0 467c8: 70ff moveq #-1,%d0 return 0; } 467ca: 4e5e unlk %fp #ifdef _POSIX_THREAD_CPUTIME else if ( clock_id == CLOCK_THREAD_CPUTIME_ID ) rtems_set_errno_and_return_minus_one( ENOSYS ); #endif else rtems_set_errno_and_return_minus_one( EINVAL ); 467cc: 2081 movel %d1,%a0@ return 0; } 467ce: 4e75 rts else if ( clock_id == CLOCK_PROCESS_CPUTIME_ID ) rtems_set_errno_and_return_minus_one( ENOSYS ); #endif #ifdef _POSIX_THREAD_CPUTIME else if ( clock_id == CLOCK_THREAD_CPUTIME_ID ) rtems_set_errno_and_return_minus_one( ENOSYS ); 467d0: 4eb9 0004 ffa8 jsr 4ffa8 <__errno> 467d6: 7258 moveq #88,%d1 467d8: 2040 moveal %d0,%a0 467da: 70ff moveq #-1,%d0 #endif else rtems_set_errno_and_return_minus_one( EINVAL ); return 0; } 467dc: 4e5e unlk %fp else if ( clock_id == CLOCK_PROCESS_CPUTIME_ID ) rtems_set_errno_and_return_minus_one( ENOSYS ); #endif #ifdef _POSIX_THREAD_CPUTIME else if ( clock_id == CLOCK_THREAD_CPUTIME_ID ) rtems_set_errno_and_return_minus_one( ENOSYS ); 467de: 2081 movel %d1,%a0@ #endif else rtems_set_errno_and_return_minus_one( EINVAL ); return 0; } 467e0: 4e75 rts { if ( !tp ) rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { if ( tp->tv_sec < TOD_SECONDS_1970_THROUGH_1988 ) 467e2: 203c 21da e4ff movel #567993599,%d0 467e8: b090 cmpl %a0@,%d0 467ea: 64d2 bccs 467be * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 467ec: 2039 0006 2c58 movel 62c58 <_Thread_Dispatch_disable_level>,%d0 467f2: 5280 addql #1,%d0 467f4: 23c0 0006 2c58 movel %d0,62c58 <_Thread_Dispatch_disable_level> return _Thread_Dispatch_disable_level; 467fa: 2039 0006 2c58 movel 62c58 <_Thread_Dispatch_disable_level>,%d0 rtems_set_errno_and_return_minus_one( EINVAL ); _Thread_Disable_dispatch(); _TOD_Set( tp ); 46800: 2f08 movel %a0,%sp@- 46802: 4eb9 0004 887c jsr 4887c <_TOD_Set> _Thread_Enable_dispatch(); 46808: 4eb9 0004 a020 jsr 4a020 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( ENOSYS ); #endif else rtems_set_errno_and_return_minus_one( EINVAL ); return 0; 4680e: 588f addql #4,%sp 46810: 4280 clrl %d0 } 46812: 4e5e unlk %fp ... =============================================================================== 0005d028 : int killinfo( pid_t pid, int sig, const union sigval *value ) { 5d028: 4e56 ffc4 linkw %fp,#-60 5d02c: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 5d030: 262e 000c movel %fp@(12),%d3 5d034: 246e 0010 moveal %fp@(16),%a2 POSIX_signals_Siginfo_node *psiginfo; /* * Only supported for the "calling process" (i.e. this node). */ if ( pid != getpid() ) 5d038: 4eb9 0005 cb64 jsr 5cb64 5d03e: b0ae 0008 cmpl %fp@(8),%d0 5d042: 6600 020c bnew 5d250 rtems_set_errno_and_return_minus_one( ESRCH ); /* * Validate the signal passed. */ if ( !sig ) 5d046: 4a83 tstl %d3 5d048: 6700 021e beqw 5d268 static inline bool is_valid_signo( int signo ) { return ((signo) >= 1 && (signo) <= 32 ); 5d04c: 2003 movel %d3,%d0 5d04e: 5380 subql #1,%d0 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 5d050: 721f moveq #31,%d1 5d052: b280 cmpl %d0,%d1 5d054: 6500 0212 bcsw 5d268 rtems_set_errno_and_return_minus_one( EINVAL ); /* * If the signal is being ignored, then we are out of here. */ if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) 5d058: 2c03 movel %d3,%d6 5d05a: 2a03 movel %d3,%d5 5d05c: 7201 moveq #1,%d1 5d05e: e98e lsll #4,%d6 5d060: e58d lsll #2,%d5 5d062: 2806 movel %d6,%d4 5d064: 9885 subl %d5,%d4 5d066: 2044 moveal %d4,%a0 5d068: d1fc 0006 14ec addal #398572,%a0 5d06e: b290 cmpl %a0@,%d1 5d070: 6700 01ca beqw 5d23c /* * 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 ) ) 5d074: 123c 0008 moveb #8,%d1 5d078: b283 cmpl %d3,%d1 5d07a: 6700 0160 beqw 5d1dc 5d07e: 123c 0004 moveb #4,%d1 5d082: b283 cmpl %d3,%d1 5d084: 6700 0156 beqw 5d1dc 5d088: 123c 000b moveb #11,%d1 5d08c: b283 cmpl %d3,%d1 5d08e: 6700 014c beqw 5d1dc static inline sigset_t signo_to_mask( uint32_t sig ) { return 1u << (sig - 1); 5d092: 7401 moveq #1,%d2 5d094: e1aa lsll %d0,%d2 /* * Build up a siginfo structure */ siginfo = &siginfo_struct; siginfo->si_signo = sig; siginfo->si_code = SI_USER; 5d096: 7001 moveq #1,%d0 /* * Build up a siginfo structure */ siginfo = &siginfo_struct; siginfo->si_signo = sig; 5d098: 2d43 fff4 movel %d3,%fp@(-12) siginfo->si_code = SI_USER; 5d09c: 2d40 fff8 movel %d0,%fp@(-8) if ( !value ) { 5d0a0: 4a8a tstl %a2 5d0a2: 6700 01a4 beqw 5d248 siginfo->si_value.sival_int = 0; } else { siginfo->si_value = *value; 5d0a6: 2d52 fffc movel %a2@,%fp@(-4) * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 5d0aa: 2039 0006 1048 movel 61048 <_Thread_Dispatch_disable_level>,%d0 5d0b0: 5280 addql #1,%d0 5d0b2: 23c0 0006 1048 movel %d0,61048 <_Thread_Dispatch_disable_level> return _Thread_Dispatch_disable_level; 5d0b8: 2039 0006 1048 movel 61048 <_Thread_Dispatch_disable_level>,%d0 /* * 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; 5d0be: 2679 0006 14aa moveal 614aa <_Per_CPU_Information+0xc>,%a3 api = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( _POSIX_signals_Is_interested( api, mask ) ) { 5d0c4: 206b 0102 moveal %a3@(258),%a0 5d0c8: 2028 00d0 movel %a0@(208),%d0 5d0cc: 4680 notl %d0 5d0ce: c082 andl %d2,%d0 5d0d0: 6600 00ca bnew 5d19c */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 5d0d4: 2679 0006 1670 moveal 61670 <_POSIX_signals_Wait_queue>,%a3 /* XXX violation of visibility -- need to define thread queue support */ the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = _Chain_First( the_chain ); 5d0da: b7fc 0006 1674 cmpal #398964,%a3 5d0e0: 6724 beqs 5d106 #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 5d0e2: 2002 movel %d2,%d0 5d0e4: c0ab 0030 andl %a3@(48),%d0 for ( the_node = _Chain_First( the_chain ); !_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 ]; 5d0e8: 206b 0102 moveal %a3@(258),%a0 #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 5d0ec: 6600 00ae bnew 5d19c /* * Is this thread is blocked waiting for another signal but has * not blocked this one? */ if (~api->signals_blocked & mask) 5d0f0: 2028 00d0 movel %a0@(208),%d0 5d0f4: 4680 notl %d0 5d0f6: c082 andl %d2,%d0 5d0f8: 6600 00a2 bnew 5d19c the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = _Chain_First( the_chain ); !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { 5d0fc: 2653 moveal %a3@,%a3 /* XXX violation of visibility -- need to define thread queue support */ the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = _Chain_First( the_chain ); 5d0fe: b7fc 0006 1674 cmpal #398964,%a3 5d104: 66dc bnes 5d0e2 <== NEVER TAKEN * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 5d106: 4287 clrl %d7 5d108: 1e39 0005 f6aa moveb 5f6aa ,%d7 5d10e: 49f9 0006 100c lea 6100c <_Objects_Information_table+0x8>,%a4 5d114: 5287 addql #1,%d7 * * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; 5d116: 97cb subal %a3,%a3 interested_priority = PRIORITY_MAXIMUM + 1; 5d118: 2447 moveal %d7,%a2 for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) { /* * This can occur when no one is interested and an API is not configured. */ if ( !_Objects_Information_table[ the_api ] ) 5d11a: 205c moveal %a4@+,%a0 5d11c: 4a88 tstl %a0 5d11e: 6770 beqs 5d190 <== NEVER TAKEN continue; the_info = _Objects_Information_table[ the_api ][ 1 ]; 5d120: 2068 0004 moveal %a0@(4),%a0 */ if ( !the_info ) continue; #endif maximum = the_info->maximum; 5d124: 4287 clrl %d7 5d126: 3e28 000e movew %a0@(14),%d7 object_table = the_info->local_table; 5d12a: 2268 0018 moveal %a0@(24),%a1 for ( index = 1 ; index <= maximum ; index++ ) { 5d12e: 4a87 tstl %d7 5d130: 675e beqs 5d190 */ #define _POSIX_signals_Is_interested( _api, _mask ) \ ( ~(_api)->signals_blocked & (_mask) ) int killinfo( 5d132: 5889 addql #4,%a1 #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 5d134: 7001 moveq #1,%d0 5d136: 2d43 ffec movel %d3,%fp@(-20) the_thread = (Thread_Control *) object_table[ index ]; 5d13a: 2059 moveal %a1@+,%a0 if ( !the_thread ) 5d13c: 4a88 tstl %a0 5d13e: 6746 beqs 5d186 /* * If this thread is of lower priority than the interested thread, * go on to the next thread. */ if ( the_thread->current_priority > interested_priority ) 5d140: 2228 0014 movel %a0@(20),%d1 5d144: b5c1 cmpal %d1,%a2 5d146: 653e bcss 5d186 <== NEVER TAKEN #if defined(RTEMS_DEBUG) if ( !api ) continue; #endif if ( !_POSIX_signals_Is_interested( api, mask ) ) 5d148: 2a68 0102 moveal %a0@(258),%a5 5d14c: 262d 00d0 movel %a5@(208),%d3 5d150: 4683 notl %d3 5d152: c682 andl %d2,%d3 5d154: 6730 beqs 5d186 * * 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 ) { 5d156: b5c1 cmpal %d1,%a2 5d158: 6228 bhis 5d182 * and blocking interruptibutable by signal. * * If the interested thread is ready, don't think about changing. */ if ( interested && !_States_Is_ready( interested->current_state ) ) { 5d15a: 4a8b tstl %a3 5d15c: 6728 beqs 5d186 <== NEVER TAKEN 5d15e: 2a6b 0010 moveal %a3@(16),%a5 5d162: 4a8d tstl %a5 5d164: 6720 beqs 5d186 <== NEVER TAKEN /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 5d166: 2628 0010 movel %a0@(16),%d3 5d16a: 2d43 fff0 movel %d3,%fp@(-16) 5d16e: 6712 beqs 5d182 <== NEVER TAKEN continue; } DEBUG_STEP("6"); /* prefer blocked/interruptible over blocked/not interruptible */ if ( !_States_Is_interruptible_by_signal(interested->current_state) ) { 5d170: 260d movel %a5,%d3 5d172: 0803 001c btst #28,%d3 5d176: 660e bnes 5d186 DEBUG_STEP("7"); if ( _States_Is_interruptible_by_signal(the_thread->current_state) ) { 5d178: 262e fff0 movel %fp@(-16),%d3 5d17c: 0803 001c btst #28,%d3 5d180: 6704 beqs 5d186 */ if ( interested && !_States_Is_ready( interested->current_state ) ) { /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 5d182: 2441 moveal %d1,%a2 5d184: 2648 moveal %a0,%a3 #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 5d186: 5280 addql #1,%d0 5d188: b087 cmpl %d7,%d0 5d18a: 63ae blss 5d13a 5d18c: 262e ffec movel %fp@(-20),%d3 * + 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++) { 5d190: b9fc 0006 1014 cmpal #397332,%a4 5d196: 6682 bnes 5d11a } } } } if ( interested ) { 5d198: 4a8b tstl %a3 5d19a: 6716 beqs 5d1b2 /* * 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 ) ) { 5d19c: 486e fff4 pea %fp@(-12) 5d1a0: 2f03 movel %d3,%sp@- 5d1a2: 2f0b movel %a3,%sp@- 5d1a4: 4eb9 0005 d2c0 jsr 5d2c0 <_POSIX_signals_Unblock_thread> 5d1aa: 4fef 000c lea %sp@(12),%sp 5d1ae: 4a00 tstb %d0 5d1b0: 6618 bnes 5d1ca /* * 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 ); 5d1b2: 2f02 movel %d2,%sp@- 5d1b4: 4eb9 0005 d2a0 jsr 5d2a0 <_POSIX_signals_Set_process_signals> if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { 5d1ba: 588f addql #4,%sp 5d1bc: 41f9 0006 14e4 lea 614e4 <_POSIX_signals_Vectors>,%a0 5d1c2: 7002 moveq #2,%d0 5d1c4: b0b0 4800 cmpl %a0@(00000000,%d4:l),%d0 5d1c8: 672e beqs 5d1f8 _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); 5d1ca: 4eb9 0004 9218 jsr 49218 <_Thread_Enable_dispatch> return 0; 5d1d0: 4280 clrl %d0 } 5d1d2: 4cee 3cfc ffc4 moveml %fp@(-60),%d2-%d7/%a2-%a5 5d1d8: 4e5e unlk %fp 5d1da: 4e75 rts * P1003.1c/Draft 10, p. 33 says that certain signals should always * be directed to the executing thread such as those caused by hardware * faults. */ if ( (sig == SIGFPE) || (sig == SIGILL) || (sig == SIGSEGV ) ) return pthread_kill( pthread_self(), sig ); 5d1dc: 4eb9 0005 d4cc jsr 5d4cc 5d1e2: 2f03 movel %d3,%sp@- 5d1e4: 2f00 movel %d0,%sp@- 5d1e6: 4eb9 0005 d3fc jsr 5d3fc 5d1ec: 508f addql #8,%sp } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); return 0; } 5d1ee: 4cee 3cfc ffc4 moveml %fp@(-60),%d2-%d7/%a2-%a5 5d1f4: 4e5e unlk %fp 5d1f6: 4e75 rts */ _POSIX_signals_Set_process_signals( mask ); if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { psiginfo = (POSIX_signals_Siginfo_node *) 5d1f8: 4879 0006 1664 pea 61664 <_POSIX_signals_Inactive_siginfo> 5d1fe: 4eb9 0004 75d4 jsr 475d4 <_Chain_Get> _Chain_Get( &_POSIX_signals_Inactive_siginfo ); if ( !psiginfo ) { 5d204: 588f addql #4,%sp */ _POSIX_signals_Set_process_signals( mask ); if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { psiginfo = (POSIX_signals_Siginfo_node *) 5d206: 2040 moveal %d0,%a0 _Chain_Get( &_POSIX_signals_Inactive_siginfo ); if ( !psiginfo ) { 5d208: 4a80 tstl %d0 5d20a: 6774 beqs 5d280 rtems_set_errno_and_return_minus_one( EAGAIN ); } psiginfo->Info = *siginfo; _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 5d20c: 9c85 subl %d5,%d6 5d20e: 0686 0006 16dc addil #399068,%d6 if ( !psiginfo ) { _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EAGAIN ); } psiginfo->Info = *siginfo; 5d214: 216e fff4 0008 movel %fp@(-12),%a0@(8) 5d21a: 216e fff8 000c movel %fp@(-8),%a0@(12) 5d220: 216e fffc 0010 movel %fp@(-4),%a0@(16) _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 5d226: 2f00 movel %d0,%sp@- 5d228: 2f06 movel %d6,%sp@- 5d22a: 4eb9 0004 7574 jsr 47574 <_Chain_Append> 5d230: 508f addql #8,%sp } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); 5d232: 4eb9 0004 9218 jsr 49218 <_Thread_Enable_dispatch> return 0; 5d238: 4280 clrl %d0 5d23a: 6096 bras 5d1d2 /* * If the signal is being ignored, then we are out of here. */ if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) return 0; 5d23c: 4280 clrl %d0 } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); return 0; } 5d23e: 4cee 3cfc ffc4 moveml %fp@(-60),%d2-%d7/%a2-%a5 5d244: 4e5e unlk %fp 5d246: 4e75 rts */ siginfo = &siginfo_struct; siginfo->si_signo = sig; siginfo->si_code = SI_USER; if ( !value ) { siginfo->si_value.sival_int = 0; 5d248: 42ae fffc clrl %fp@(-4) 5d24c: 6000 fe5c braw 5d0aa /* * Only supported for the "calling process" (i.e. this node). */ if ( pid != getpid() ) rtems_set_errno_and_return_minus_one( ESRCH ); 5d250: 4eb9 0004 f098 jsr 4f098 <__errno> 5d256: 7603 moveq #3,%d3 5d258: 2040 moveal %d0,%a0 5d25a: 70ff moveq #-1,%d0 5d25c: 2083 movel %d3,%a0@ } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); return 0; } 5d25e: 4cee 3cfc ffc4 moveml %fp@(-60),%d2-%d7/%a2-%a5 5d264: 4e5e unlk %fp 5d266: 4e75 rts */ if ( !sig ) rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) rtems_set_errno_and_return_minus_one( EINVAL ); 5d268: 4eb9 0004 f098 jsr 4f098 <__errno> 5d26e: 7416 moveq #22,%d2 5d270: 2040 moveal %d0,%a0 5d272: 70ff moveq #-1,%d0 5d274: 2082 movel %d2,%a0@ } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); return 0; } 5d276: 4cee 3cfc ffc4 moveml %fp@(-60),%d2-%d7/%a2-%a5 5d27c: 4e5e unlk %fp 5d27e: 4e75 rts if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { psiginfo = (POSIX_signals_Siginfo_node *) _Chain_Get( &_POSIX_signals_Inactive_siginfo ); if ( !psiginfo ) { _Thread_Enable_dispatch(); 5d280: 4eb9 0004 9218 jsr 49218 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EAGAIN ); 5d286: 4eb9 0004 f098 jsr 4f098 <__errno> 5d28c: 720b moveq #11,%d1 5d28e: 2040 moveal %d0,%a0 5d290: 70ff moveq #-1,%d0 } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); return 0; } 5d292: 4cee 3cfc ffc4 moveml %fp@(-60),%d2-%d7/%a2-%a5 psiginfo = (POSIX_signals_Siginfo_node *) _Chain_Get( &_POSIX_signals_Inactive_siginfo ); if ( !psiginfo ) { _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EAGAIN ); 5d298: 2081 movel %d1,%a0@ } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); return 0; } 5d29a: 4e5e unlk %fp ... =============================================================================== 0004b80c : int pthread_attr_setschedpolicy( pthread_attr_t *attr, int policy ) { 4b80c: 4e56 0000 linkw %fp,#0 4b810: 206e 0008 moveal %fp@(8),%a0 4b814: 202e 000c movel %fp@(12),%d0 4b818: 2f02 movel %d2,%sp@- if ( !attr || !attr->is_initialized ) 4b81a: 4a88 tstl %a0 4b81c: 6704 beqs 4b822 4b81e: 4a90 tstl %a0@ 4b820: 6608 bnes 4b82a return 0; default: return ENOTSUP; } } 4b822: 241f movel %sp@+,%d2 pthread_attr_t *attr, int policy ) { if ( !attr || !attr->is_initialized ) return EINVAL; 4b824: 7016 moveq #22,%d0 return 0; default: return ENOTSUP; } } 4b826: 4e5e unlk %fp 4b828: 4e75 rts ) { if ( !attr || !attr->is_initialized ) return EINVAL; switch ( policy ) { 4b82a: 7204 moveq #4,%d1 4b82c: b280 cmpl %d0,%d1 4b82e: 6518 bcss 4b848 4b830: 123c 0001 moveb #1,%d1 4b834: 7417 moveq #23,%d2 4b836: e1a9 lsll %d0,%d1 4b838: c282 andl %d2,%d1 4b83a: 670c beqs 4b848 <== NEVER TAKEN return 0; default: return ENOTSUP; } } 4b83c: 241f movel %sp@+,%d2 4b83e: 4e5e unlk %fp switch ( policy ) { case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: case SCHED_SPORADIC: attr->schedpolicy = policy; 4b840: 2140 0014 movel %d0,%a0@(20) return 0; 4b844: 4280 clrl %d0 default: return ENOTSUP; } } 4b846: 4e75 rts 4b848: 241f movel %sp@+,%d2 case SCHED_SPORADIC: attr->schedpolicy = policy; return 0; default: return ENOTSUP; 4b84a: 203c 0000 0086 movel #134,%d0 } } 4b850: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004b854 : int pthread_attr_setscope( pthread_attr_t *attr, int contentionscope ) { 4b854: 4e56 0000 linkw %fp,#0 4b858: 206e 0008 moveal %fp@(8),%a0 4b85c: 222e 000c movel %fp@(12),%d1 4b860: 2f02 movel %d2,%sp@- if ( !attr || !attr->is_initialized ) 4b862: 4a88 tstl %a0 4b864: 6704 beqs 4b86a 4b866: 4a90 tstl %a0@ 4b868: 6608 bnes 4b872 case PTHREAD_SCOPE_SYSTEM: return ENOTSUP; default: return EINVAL; 4b86a: 7016 moveq #22,%d0 } } 4b86c: 241f movel %sp@+,%d2 4b86e: 4e5e unlk %fp 4b870: 4e75 rts ) { if ( !attr || !attr->is_initialized ) return EINVAL; switch ( contentionscope ) { 4b872: 4a81 tstl %d1 4b874: 660c bnes 4b882 return ENOTSUP; default: return EINVAL; } } 4b876: 241f movel %sp@+,%d2 return EINVAL; switch ( contentionscope ) { case PTHREAD_SCOPE_PROCESS: attr->contentionscope = contentionscope; return 0; 4b878: 4280 clrl %d0 return ENOTSUP; default: return EINVAL; } } 4b87a: 4e5e unlk %fp if ( !attr || !attr->is_initialized ) return EINVAL; switch ( contentionscope ) { case PTHREAD_SCOPE_PROCESS: attr->contentionscope = contentionscope; 4b87c: 42a8 000c clrl %a0@(12) return ENOTSUP; default: return EINVAL; } } 4b880: 4e75 rts case PTHREAD_SCOPE_PROCESS: attr->contentionscope = contentionscope; return 0; case PTHREAD_SCOPE_SYSTEM: return ENOTSUP; 4b882: 203c 0000 0086 movel #134,%d0 ) { if ( !attr || !attr->is_initialized ) return EINVAL; switch ( contentionscope ) { 4b888: 7401 moveq #1,%d2 4b88a: b481 cmpl %d1,%d2 4b88c: 67de beqs 4b86c case PTHREAD_SCOPE_SYSTEM: return ENOTSUP; default: return EINVAL; 4b88e: 7016 moveq #22,%d0 4b890: 60da bras 4b86c ... =============================================================================== 00046c34 : int pthread_barrier_init( pthread_barrier_t *barrier, const pthread_barrierattr_t *attr, unsigned int count ) { 46c34: 4e56 ffe0 linkw %fp,#-32 46c38: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ 46c3c: 246e 0008 moveal %fp@(8),%a2 46c40: 262e 000c movel %fp@(12),%d3 46c44: 242e 0010 movel %fp@(16),%d2 const pthread_barrierattr_t *the_attr; /* * Error check parameters */ if ( !barrier ) 46c48: 4a8a tstl %a2 46c4a: 6704 beqs 46c50 return EINVAL; if ( count == 0 ) 46c4c: 4a82 tstl %d2 46c4e: 660c bnes 46c5c switch ( the_attr->process_shared ) { case PTHREAD_PROCESS_PRIVATE: /* only supported values */ break; case PTHREAD_PROCESS_SHARED: default: return EINVAL; 46c50: 7016 moveq #22,%d0 * Exit the critical section and return the user an operational barrier */ *barrier = the_barrier->Object.id; _Thread_Enable_dispatch(); return 0; } 46c52: 4cee 0c0c ffe0 moveml %fp@(-32),%d2-%d3/%a2-%a3 46c58: 4e5e unlk %fp 46c5a: 4e75 rts return EINVAL; /* * If the user passed in NULL, use the default attributes */ if ( attr ) { 46c5c: 4a83 tstl %d3 46c5e: 6776 beqs 46cd6 46c60: 2043 moveal %d3,%a0 } /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) 46c62: 4a90 tstl %a0@ 46c64: 67ea beqs 46c50 return EINVAL; switch ( the_attr->process_shared ) { 46c66: 4aa8 0004 tstl %a0@(4) 46c6a: 66e4 bnes 46c50 <== NEVER TAKEN * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 46c6c: 2039 0006 255c movel 6255c <_Thread_Dispatch_disable_level>,%d0 46c72: 5280 addql #1,%d0 46c74: 23c0 0006 255c movel %d0,6255c <_Thread_Dispatch_disable_level> return _Thread_Dispatch_disable_level; 46c7a: 2039 0006 255c movel 6255c <_Thread_Dispatch_disable_level>,%d0 } /* * Convert from POSIX attributes to Core Barrier attributes */ the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE; 46c80: 42ae fff0 clrl %fp@(-16) the_attributes.maximum_count = count; 46c84: 2d42 fff4 movel %d2,%fp@(-12) * 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 *) 46c88: 4879 0006 2852 pea 62852 <_POSIX_Barrier_Information> 46c8e: 4eb9 0004 8fd8 jsr 48fd8 <_Objects_Allocate> */ _Thread_Disable_dispatch(); /* prevents deletion */ the_barrier = _POSIX_Barrier_Allocate(); if ( !the_barrier ) { 46c94: 588f addql #4,%sp 46c96: 2640 moveal %d0,%a3 46c98: 4a80 tstl %d0 46c9a: 6754 beqs 46cf0 _Thread_Enable_dispatch(); return EAGAIN; } _CORE_barrier_Initialize( &the_barrier->Barrier, &the_attributes ); 46c9c: 486e fff0 pea %fp@(-16) 46ca0: 486b 0010 pea %a3@(16) 46ca4: 4eb9 0004 858c jsr 4858c <_CORE_barrier_Initialize> uint32_t name ) { _Objects_Set_local_object( information, _Objects_Get_index( the_object->id ), 46caa: 202b 0008 movel %a3@(8),%d0 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 46cae: 4281 clrl %d1 46cb0: 2079 0006 286a moveal 6286a <_POSIX_Barrier_Information+0x18>,%a0 46cb6: 3200 movew %d0,%d1 46cb8: 218b 1c00 movel %a3,%a0@(00000000,%d1:l:4) _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 46cbc: 42ab 000c clrl %a3@(12) ); /* * Exit the critical section and return the user an operational barrier */ *barrier = the_barrier->Object.id; 46cc0: 2480 movel %d0,%a2@ _Thread_Enable_dispatch(); 46cc2: 4eb9 0004 a1e4 jsr 4a1e4 <_Thread_Enable_dispatch> return 0; 46cc8: 508f addql #8,%sp 46cca: 4280 clrl %d0 } 46ccc: 4cee 0c0c ffe0 moveml %fp@(-32),%d2-%d3/%a2-%a3 46cd2: 4e5e unlk %fp 46cd4: 4e75 rts * If the user passed in NULL, use the default attributes */ if ( attr ) { the_attr = attr; } else { (void) pthread_barrierattr_init( &my_attr ); 46cd6: 260e movel %fp,%d3 46cd8: 5183 subql #8,%d3 46cda: 2f03 movel %d3,%sp@- 46cdc: 4eb9 0004 6b70 jsr 46b70 46ce2: 588f addql #4,%sp the_attr = &my_attr; 46ce4: 2043 moveal %d3,%a0 } /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) 46ce6: 4a90 tstl %a0@ 46ce8: 6700 ff66 beqw 46c50 46cec: 6000 ff78 braw 46c66 _Thread_Disable_dispatch(); /* prevents deletion */ the_barrier = _POSIX_Barrier_Allocate(); if ( !the_barrier ) { _Thread_Enable_dispatch(); 46cf0: 4eb9 0004 a1e4 jsr 4a1e4 <_Thread_Enable_dispatch> return EAGAIN; 46cf6: 700b moveq #11,%d0 * Exit the critical section and return the user an operational barrier */ *barrier = the_barrier->Object.id; _Thread_Enable_dispatch(); return 0; } 46cf8: 4cee 0c0c ffe0 moveml %fp@(-32),%d2-%d3/%a2-%a3 46cfe: 4e5e unlk %fp ... =============================================================================== 000460e4 : */ void pthread_cleanup_pop( int execute ) { 460e4: 4e56 fff4 linkw %fp,#-12 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 460e8: 2039 0006 10c0 movel 610c0 <_Thread_Dispatch_disable_level>,%d0 460ee: 5280 addql #1,%d0 POSIX_Cancel_Handler_control tmp_handler; Chain_Control *handler_stack; POSIX_API_Control *thread_support; ISR_Level level; thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 460f0: 2079 0006 1522 moveal 61522 <_Per_CPU_Information+0xc>,%a0 */ void pthread_cleanup_pop( int execute ) { 460f6: 48d7 040c moveml %d2-%d3/%a2,%sp@ 460fa: 23c0 0006 10c0 movel %d0,610c0 <_Thread_Dispatch_disable_level> 46100: 262e 0008 movel %fp@(8),%d3 POSIX_Cancel_Handler_control tmp_handler; Chain_Control *handler_stack; POSIX_API_Control *thread_support; ISR_Level level; thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 46104: 2068 0102 moveal %a0@(258),%a0 return _Thread_Dispatch_disable_level; 46108: 2039 0006 10c0 movel 610c0 <_Thread_Dispatch_disable_level>,%d0 * ensure that we do not get prempted and deleted while we are holding * memory that needs to be freed. */ _Thread_Disable_dispatch(); _ISR_Disable( level ); 4610e: 203c 0000 0700 movel #1792,%d0 46114: 40c2 movew %sr,%d2 46116: 8082 orl %d2,%d0 46118: 46c0 movew %d0,%sr RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 4611a: 2008 movel %a0,%d0 4611c: 0680 0000 00e8 addil #232,%d0 if ( _Chain_Is_empty( handler_stack ) ) { 46122: b0a8 00e4 cmpl %a0@(228),%d0 46126: 6748 beqs 46170 <== NEVER TAKEN _Thread_Enable_dispatch(); _ISR_Enable( level ); return; } handler = (POSIX_Cancel_Handler_control *) 46128: 2068 00ec moveal %a0@(236),%a0 ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 4612c: 2450 moveal %a0@,%a2 previous = the_node->previous; 4612e: 2268 0004 moveal %a0@(4),%a1 next->previous = previous; 46132: 2549 0004 movel %a1,%a2@(4) previous->next = next; 46136: 228a movel %a2,%a1@ _Chain_Tail( handler_stack )->previous; _Chain_Extract_unprotected( &handler->Node ); _ISR_Enable( level ); 46138: 46c2 movew %d2,%sr tmp_handler = *handler; 4613a: 2468 0008 moveal %a0@(8),%a2 4613e: 2428 000c movel %a0@(12),%d2 _Workspace_Free( handler ); 46142: 2f08 movel %a0,%sp@- 46144: 4eb9 0004 a09a jsr 4a09a <_Workspace_Free> _Thread_Enable_dispatch(); 4614a: 4eb9 0004 8fb4 jsr 48fb4 <_Thread_Enable_dispatch> if ( execute ) 46150: 588f addql #4,%sp 46152: 4a83 tstl %d3 46154: 660a bnes 46160 (*tmp_handler.routine)( tmp_handler.arg ); } 46156: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 4615c: 4e5e unlk %fp 4615e: 4e75 rts _Workspace_Free( handler ); _Thread_Enable_dispatch(); if ( execute ) (*tmp_handler.routine)( tmp_handler.arg ); 46160: 224a moveal %a2,%a1 46162: 2d42 0008 movel %d2,%fp@(8) } 46166: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 4616c: 4e5e unlk %fp _Workspace_Free( handler ); _Thread_Enable_dispatch(); if ( execute ) (*tmp_handler.routine)( tmp_handler.arg ); 4616e: 4ed1 jmp %a1@ _Thread_Disable_dispatch(); _ISR_Disable( level ); if ( _Chain_Is_empty( handler_stack ) ) { _Thread_Enable_dispatch(); 46170: 4eb9 0004 8fb4 jsr 48fb4 <_Thread_Enable_dispatch> _ISR_Enable( level ); 46176: 46c2 movew %d2,%sr _Thread_Enable_dispatch(); if ( execute ) (*tmp_handler.routine)( tmp_handler.arg ); } 46178: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 4617e: 4e5e unlk %fp ... =============================================================================== 000466a4 : void pthread_cleanup_push( void (*routine)( void * ), void *arg ) { 466a4: 4e56 0000 linkw %fp,#0 466a8: 2f03 movel %d3,%sp@- 466aa: 262e 000c movel %fp@(12),%d3 466ae: 2f02 movel %d2,%sp@- 466b0: 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 ) 466b4: 675a beqs 46710 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 466b6: 2039 0006 1f72 movel 61f72 <_Thread_Dispatch_disable_level>,%d0 466bc: 5280 addql #1,%d0 466be: 23c0 0006 1f72 movel %d0,61f72 <_Thread_Dispatch_disable_level> return _Thread_Dispatch_disable_level; 466c4: 2039 0006 1f72 movel 61f72 <_Thread_Dispatch_disable_level>,%d0 return; _Thread_Disable_dispatch(); handler = _Workspace_Allocate( sizeof( POSIX_Cancel_Handler_control ) ); 466ca: 4878 0010 pea 10 466ce: 4eb9 0004 ae6a jsr 4ae6a <_Workspace_Allocate> if ( handler ) { 466d4: 588f addql #4,%sp 466d6: 4a80 tstl %d0 466d8: 6726 beqs 46700 <== NEVER TAKEN thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 466da: 2079 0006 23d4 moveal 623d4 <_Per_CPU_Information+0xc>,%a0 handler_stack = &thread_support->Cancellation_Handlers; 466e0: 2228 0102 movel %a0@(258),%d1 handler->routine = routine; 466e4: 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; 466e6: 0681 0000 00e4 addil #228,%d1 handler->routine = routine; 466ec: 2142 0008 movel %d2,%a0@(8) handler->arg = arg; 466f0: 2143 000c movel %d3,%a0@(12) _Chain_Append( handler_stack, &handler->Node ); 466f4: 2f00 movel %d0,%sp@- 466f6: 2f01 movel %d1,%sp@- 466f8: 4eb9 0004 80dc jsr 480dc <_Chain_Append> 466fe: 508f addql #8,%sp } _Thread_Enable_dispatch(); } 46700: 242e fff8 movel %fp@(-8),%d2 46704: 262e fffc movel %fp@(-4),%d3 46708: 4e5e unlk %fp handler->routine = routine; handler->arg = arg; _Chain_Append( handler_stack, &handler->Node ); } _Thread_Enable_dispatch(); 4670a: 4ef9 0004 9d00 jmp 49d00 <_Thread_Enable_dispatch> } 46710: 242e fff8 movel %fp@(-8),%d2 46714: 262e fffc movel %fp@(-4),%d3 46718: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00047538 : int pthread_cond_init( pthread_cond_t *cond, const pthread_condattr_t *attr ) { 47538: 4e56 0000 linkw %fp,#0 4753c: 2f0b movel %a3,%sp@- 4753e: 2f0a movel %a2,%sp@- 47540: 246e 000c moveal %fp@(12),%a2 POSIX_Condition_variables_Control *the_cond; const pthread_condattr_t *the_attr; if ( attr ) the_attr = attr; 47544: 4a8a tstl %a2 47546: 671a beqs 47562 else the_attr = &_POSIX_Condition_variables_Default_attributes; /* * Be careful about attributes when global!!! */ if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) 47548: 7001 moveq #1,%d0 4754a: b0aa 0004 cmpl %a2@(4),%d0 4754e: 6704 beqs 47554 <== NEVER TAKEN return EINVAL; if ( !the_attr->is_initialized ) 47550: 4a92 tstl %a2@ 47552: 6616 bnes 4756a *cond = the_cond->Object.id; _Thread_Enable_dispatch(); return 0; } 47554: 246e fff8 moveal %fp@(-8),%a2 */ if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) return EINVAL; if ( !the_attr->is_initialized ) return EINVAL; 47558: 7016 moveq #22,%d0 *cond = the_cond->Object.id; _Thread_Enable_dispatch(); return 0; } 4755a: 266e fffc moveal %fp@(-4),%a3 4755e: 4e5e unlk %fp 47560: 4e75 rts { POSIX_Condition_variables_Control *the_cond; const pthread_condattr_t *the_attr; if ( attr ) the_attr = attr; else the_attr = &_POSIX_Condition_variables_Default_attributes; 47562: 45f9 0006 0e76 lea 60e76 <_POSIX_Condition_variables_Default_attributes>,%a2 47568: 60de bras 47548 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 4756a: 2039 0006 3708 movel 63708 <_Thread_Dispatch_disable_level>,%d0 47570: 5280 addql #1,%d0 47572: 23c0 0006 3708 movel %d0,63708 <_Thread_Dispatch_disable_level> return _Thread_Dispatch_disable_level; 47578: 2039 0006 3708 movel 63708 <_Thread_Dispatch_disable_level>,%d0 */ RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *_POSIX_Condition_variables_Allocate( void ) { return (POSIX_Condition_variables_Control *) 4757e: 4879 0006 3a8a pea 63a8a <_POSIX_Condition_variables_Information> 47584: 4eb9 0004 9f84 jsr 49f84 <_Objects_Allocate> _Thread_Disable_dispatch(); the_cond = _POSIX_Condition_variables_Allocate(); if ( !the_cond ) { 4758a: 588f addql #4,%sp 4758c: 2640 moveal %d0,%a3 4758e: 4a80 tstl %d0 47590: 6754 beqs 475e6 _Thread_Enable_dispatch(); return ENOMEM; } the_cond->process_shared = the_attr->process_shared; 47592: 276a 0004 0010 movel %a2@(4),%a3@(16) the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX; 47598: 42ab 0014 clrl %a3@(20) _Thread_queue_Initialize( 4759c: 4878 0074 pea 74 475a0: 2f3c 1000 0800 movel #268437504,%sp@- 475a6: 42a7 clrl %sp@- 475a8: 486b 0018 pea %a3@(24) 475ac: 4eb9 0004 b974 jsr 4b974 <_Thread_queue_Initialize> uint32_t name ) { _Objects_Set_local_object( information, _Objects_Get_index( the_object->id ), 475b2: 202b 0008 movel %a3@(8),%d0 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 475b6: 4281 clrl %d1 475b8: 2079 0006 3aa2 moveal 63aa2 <_POSIX_Condition_variables_Information+0x18>,%a0 475be: 3200 movew %d0,%d1 475c0: 218b 1c00 movel %a3,%a0@(00000000,%d1:l:4) &_POSIX_Condition_variables_Information, &the_cond->Object, 0 ); *cond = the_cond->Object.id; 475c4: 206e 0008 moveal %fp@(8),%a0 _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 475c8: 42ab 000c clrl %a3@(12) 475cc: 2080 movel %d0,%a0@ _Thread_Enable_dispatch(); 475ce: 4eb9 0004 b190 jsr 4b190 <_Thread_Enable_dispatch> return 0; } 475d4: 246e fff8 moveal %fp@(-8),%a2 *cond = the_cond->Object.id; _Thread_Enable_dispatch(); return 0; 475d8: 4fef 0010 lea %sp@(16),%sp 475dc: 4280 clrl %d0 } 475de: 266e fffc moveal %fp@(-4),%a3 475e2: 4e5e unlk %fp 475e4: 4e75 rts _Thread_Disable_dispatch(); the_cond = _POSIX_Condition_variables_Allocate(); if ( !the_cond ) { _Thread_Enable_dispatch(); 475e6: 4eb9 0004 b190 jsr 4b190 <_Thread_Enable_dispatch> *cond = the_cond->Object.id; _Thread_Enable_dispatch(); return 0; } 475ec: 246e fff8 moveal %fp@(-8),%a2 the_cond = _POSIX_Condition_variables_Allocate(); if ( !the_cond ) { _Thread_Enable_dispatch(); return ENOMEM; 475f0: 700c moveq #12,%d0 *cond = the_cond->Object.id; _Thread_Enable_dispatch(); return 0; } 475f2: 266e fffc moveal %fp@(-4),%a3 475f6: 4e5e unlk %fp ... =============================================================================== 00047398 : */ int pthread_condattr_destroy( pthread_condattr_t *attr ) { 47398: 4e56 0000 linkw %fp,#0 4739c: 206e 0008 moveal %fp@(8),%a0 if ( !attr || attr->is_initialized == false ) 473a0: 4a88 tstl %a0 473a2: 6704 beqs 473a8 473a4: 4a90 tstl %a0@ 473a6: 6606 bnes 473ae <== ALWAYS TAKEN return EINVAL; 473a8: 7016 moveq #22,%d0 attr->is_initialized = false; return 0; } 473aa: 4e5e unlk %fp 473ac: 4e75 rts { if ( !attr || attr->is_initialized == false ) return EINVAL; attr->is_initialized = false; return 0; 473ae: 4280 clrl %d0 } 473b0: 4e5e unlk %fp ) { if ( !attr || attr->is_initialized == false ) return EINVAL; attr->is_initialized = false; 473b2: 4290 clrl %a0@ return 0; } ... =============================================================================== 000473d8 : */ int pthread_condattr_init( pthread_condattr_t *attr ) { 473d8: 4e56 0000 linkw %fp,#0 473dc: 206e 0008 moveal %fp@(8),%a0 473e0: 2f02 movel %d2,%sp@- if ( !attr ) 473e2: 4a88 tstl %a0 473e4: 671a beqs 47400 <== NEVER TAKEN return EINVAL; *attr = _POSIX_Condition_variables_Default_attributes; return 0; 473e6: 4280 clrl %d0 ) { if ( !attr ) return EINVAL; *attr = _POSIX_Condition_variables_Default_attributes; 473e8: 2239 0006 0e76 movel 60e76 <_POSIX_Condition_variables_Default_attributes>,%d1 473ee: 2439 0006 0e7a movel 60e7a <_POSIX_Condition_variables_Default_attributes+0x4>,%d2 473f4: 2081 movel %d1,%a0@ 473f6: 2142 0004 movel %d2,%a0@(4) return 0; } 473fa: 241f movel %sp@+,%d2 473fc: 4e5e unlk %fp 473fe: 4e75 rts 47400: 241f movel %sp@+,%d2 int pthread_condattr_init( pthread_condattr_t *attr ) { if ( !attr ) return EINVAL; 47402: 7016 moveq #22,%d0 *attr = _POSIX_Condition_variables_Default_attributes; return 0; } 47404: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00046af8 : pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine)( void * ), void *arg ) { 46af8: 4e56 ffb8 linkw %fp,#-72 46afc: 48d7 3c3c moveml %d2-%d5/%a2-%a5,%sp@ 46b00: 246e 000c moveal %fp@(12),%a2 46b04: 262e 0010 movel %fp@(16),%d3 int schedpolicy = SCHED_RR; struct sched_param schedparam; Objects_Name name; int rc; if ( !start_routine ) 46b08: 6700 014c beqw 46c56 return EFAULT; the_attr = (attr) ? attr : &_POSIX_Threads_Default_attributes; 46b0c: 4a8a tstl %a2 46b0e: 6700 0154 beqw 46c64 if ( !the_attr->is_initialized ) 46b12: 4a92 tstl %a2@ 46b14: 660e bnes 46b24 /* * Interpret the scheduling parameters. */ if ( !_POSIX_Priority_Is_valid( schedparam.sched_priority ) ) return EINVAL; 46b16: 7416 moveq #22,%d2 */ *thread = the_thread->Object.id; _RTEMS_Unlock_allocator(); return 0; } 46b18: 2002 movel %d2,%d0 46b1a: 4cee 3c3c ffb8 moveml %fp@(-72),%d2-%d5/%a2-%a5 46b20: 4e5e unlk %fp 46b22: 4e75 rts * stack space if it is allowed to allocate it itself. * * NOTE: If the user provides the stack we will let it drop below * twice the minimum. */ if ( the_attr->stackaddr && !_Stack_Is_enough(the_attr->stacksize) ) 46b24: 4aaa 0004 tstl %a2@(4) 46b28: 670c beqs 46b36 46b2a: 2039 0006 076c movel 6076c ,%d0 46b30: b0aa 0008 cmpl %a2@(8),%d0 46b34: 62e0 bhis 46b16 * If inheritsched is set to PTHREAD_INHERIT_SCHED, then this thread * inherits scheduling attributes from the creating thread. If it is * PTHREAD_EXPLICIT_SCHED, then scheduling parameters come from the * attributes structure. */ switch ( the_attr->inheritsched ) { 46b36: 202a 0010 movel %a2@(16),%d0 46b3a: 7201 moveq #1,%d1 46b3c: b280 cmpl %d0,%d1 46b3e: 6700 0134 beqw 46c74 46b42: 123c 0002 moveb #2,%d1 46b46: b280 cmpl %d0,%d1 46b48: 66cc bnes 46b16 schedparam = api->schedparam; break; case PTHREAD_EXPLICIT_SCHED: schedpolicy = the_attr->schedpolicy; schedparam = the_attr->schedparam; 46b4a: 47ee ffdc lea %fp@(-36),%a3 schedpolicy = api->schedpolicy; schedparam = api->schedparam; break; case PTHREAD_EXPLICIT_SCHED: schedpolicy = the_attr->schedpolicy; 46b4e: 282a 0014 movel %a2@(20),%d4 schedparam = the_attr->schedparam; 46b52: 26aa 0018 movel %a2@(24),%a3@ 46b56: 2d6a 001c ffe0 movel %a2@(28),%fp@(-32) 46b5c: 2d6a 0020 ffe4 movel %a2@(32),%fp@(-28) 46b62: 2d6a 0024 ffe8 movel %a2@(36),%fp@(-24) 46b68: 2d6a 0028 ffec movel %a2@(40),%fp@(-20) 46b6e: 2d6a 002c fff0 movel %a2@(44),%fp@(-16) 46b74: 2d6a 0030 fff4 movel %a2@(48),%fp@(-12) /* * Check the contentionscope since rtems only supports PROCESS wide * contention (i.e. no system wide contention). */ if ( the_attr->contentionscope != PTHREAD_SCOPE_PROCESS ) return ENOTSUP; 46b7a: 243c 0000 0086 movel #134,%d2 /* * Check the contentionscope since rtems only supports PROCESS wide * contention (i.e. no system wide contention). */ if ( the_attr->contentionscope != PTHREAD_SCOPE_PROCESS ) 46b80: 4aaa 000c tstl %a2@(12) 46b84: 6692 bnes 46b18 return ENOTSUP; /* * Interpret the scheduling parameters. */ if ( !_POSIX_Priority_Is_valid( schedparam.sched_priority ) ) 46b86: 2f2e ffdc movel %fp@(-36),%sp@- 46b8a: 4eb9 0004 d68c jsr 4d68c <_POSIX_Priority_Is_valid> 46b90: 588f addql #4,%sp 46b92: 4a00 tstb %d0 46b94: 6780 beqs 46b16 <== NEVER TAKEN core_priority = _POSIX_Priority_To_core( schedparam.sched_priority ); /* * Set the core scheduling policy information. */ rc = _POSIX_Thread_Translate_sched_param( 46b96: 486e fffc pea %fp@(-4) 46b9a: 486e fff8 pea %fp@(-8) * Interpret the scheduling parameters. */ if ( !_POSIX_Priority_Is_valid( schedparam.sched_priority ) ) return EINVAL; core_priority = _POSIX_Priority_To_core( schedparam.sched_priority ); 46b9e: 286e ffdc moveal %fp@(-36),%a4 /* * Set the core scheduling policy information. */ rc = _POSIX_Thread_Translate_sched_param( 46ba2: 2f0b movel %a3,%sp@- RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( int priority ) { return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1); 46ba4: 1a39 0006 076a moveb 6076a ,%d5 46baa: 2f04 movel %d4,%sp@- 46bac: 4eb9 0004 d6b0 jsr 4d6b0 <_POSIX_Thread_Translate_sched_param> schedpolicy, &schedparam, &budget_algorithm, &budget_callout ); if ( rc ) 46bb2: 4fef 0010 lea %sp@(16),%sp core_priority = _POSIX_Priority_To_core( schedparam.sched_priority ); /* * Set the core scheduling policy information. */ rc = _POSIX_Thread_Translate_sched_param( 46bb6: 2400 movel %d0,%d2 schedpolicy, &schedparam, &budget_algorithm, &budget_callout ); if ( rc ) 46bb8: 6600 ff5e bnew 46b18 #endif /* * Lock the allocator mutex for protection */ _RTEMS_Lock_allocator(); 46bbc: 2f39 0006 21a8 movel 621a8 <_RTEMS_Allocator_Mutex>,%sp@- 46bc2: 4eb9 0004 86ac jsr 486ac <_API_Mutex_Lock> * _POSIX_Threads_Allocate */ RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate( void ) { return (Thread_Control *) _Objects_Allocate( &_POSIX_Threads_Information ); 46bc8: 4879 0006 22a2 pea 622a2 <_POSIX_Threads_Information> 46bce: 4eb9 0004 915c jsr 4915c <_Objects_Allocate> * Allocate the thread control block. * * NOTE: Global threads are not currently supported. */ the_thread = _POSIX_Threads_Allocate(); if ( !the_thread ) { 46bd4: 508f addql #8,%sp 46bd6: 2a40 moveal %d0,%a5 46bd8: 4a80 tstl %d0 46bda: 6700 013e beqw 46d1a /* * Initialize the core thread for this task. */ name.name_p = NULL; /* posix threads don't have a name by default */ status = _Thread_Initialize( 46bde: 222a 0008 movel %a2@(8),%d1 46be2: 42a7 clrl %sp@- static inline size_t _POSIX_Threads_Ensure_minimum_stack ( size_t size ) { if ( size >= PTHREAD_MINIMUM_STACK_SIZE ) 46be4: 2039 0006 076c movel 6076c ,%d0 /* * Initialize the core thread for this task. */ name.name_p = NULL; /* posix threads don't have a name by default */ status = _Thread_Initialize( 46bea: 42a7 clrl %sp@- 46bec: 2f2e fffc movel %fp@(-4),%sp@- 46bf0: 2f2e fff8 movel %fp@(-8),%sp@- 46bf4: 4878 0001 pea 1 46bf8: 0285 0000 00ff andil #255,%d5 static inline size_t _POSIX_Threads_Ensure_minimum_stack ( size_t size ) { if ( size >= PTHREAD_MINIMUM_STACK_SIZE ) 46bfe: d080 addl %d0,%d0 /* * Initialize the core thread for this task. */ name.name_p = NULL; /* posix threads don't have a name by default */ status = _Thread_Initialize( 46c00: 9a8c subl %a4,%d5 46c02: 2f05 movel %d5,%sp@- 46c04: 4878 0001 pea 1 46c08: b280 cmpl %d0,%d1 46c0a: 6302 blss 46c0e 46c0c: 2001 movel %d1,%d0 46c0e: 2f00 movel %d0,%sp@- 46c10: 2f2a 0004 movel %a2@(4),%sp@- 46c14: 2f0d movel %a5,%sp@- 46c16: 4879 0006 22a2 pea 622a2 <_POSIX_Threads_Information> 46c1c: 4eb9 0004 a434 jsr 4a434 <_Thread_Initialize> budget_callout, 0, /* isr level */ name /* posix threads don't have a name */ ); if ( !status ) { 46c22: 4fef 002c lea %sp@(44),%sp 46c26: 4a00 tstb %d0 46c28: 667e bnes 46ca8 RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free ( Thread_Control *the_pthread ) { _Objects_Free( &_POSIX_Threads_Information, &the_pthread->Object ); 46c2a: 2f0d movel %a5,%sp@- 46c2c: 4879 0006 22a2 pea 622a2 <_POSIX_Threads_Information> _POSIX_Threads_Free( the_thread ); _RTEMS_Unlock_allocator(); return EAGAIN; 46c32: 740b moveq #11,%d2 46c34: 4eb9 0004 94ac jsr 494ac <_Objects_Free> name /* posix threads don't have a name */ ); if ( !status ) { _POSIX_Threads_Free( the_thread ); _RTEMS_Unlock_allocator(); 46c3a: 2f39 0006 21a8 movel 621a8 <_RTEMS_Allocator_Mutex>,%sp@- 46c40: 4eb9 0004 870c jsr 4870c <_API_Mutex_Unlock> return EAGAIN; 46c46: 4fef 000c lea %sp@(12),%sp */ *thread = the_thread->Object.id; _RTEMS_Unlock_allocator(); return 0; } 46c4a: 2002 movel %d2,%d0 46c4c: 4cee 3c3c ffb8 moveml %fp@(-72),%d2-%d5/%a2-%a5 46c52: 4e5e unlk %fp 46c54: 4e75 rts struct sched_param schedparam; Objects_Name name; int rc; if ( !start_routine ) return EFAULT; 46c56: 740e moveq #14,%d2 */ *thread = the_thread->Object.id; _RTEMS_Unlock_allocator(); return 0; } 46c58: 2002 movel %d2,%d0 46c5a: 4cee 3c3c ffb8 moveml %fp@(-72),%d2-%d5/%a2-%a5 46c60: 4e5e unlk %fp 46c62: 4e75 rts int rc; if ( !start_routine ) return EFAULT; the_attr = (attr) ? attr : &_POSIX_Threads_Default_attributes; 46c64: 45f9 0005 f8a6 lea 5f8a6 <_POSIX_Threads_Default_attributes>,%a2 if ( !the_attr->is_initialized ) 46c6a: 4a92 tstl %a2@ 46c6c: 6700 fea8 beqw 46b16 46c70: 6000 feb2 braw 46b24 * PTHREAD_EXPLICIT_SCHED, then scheduling parameters come from the * attributes structure. */ switch ( the_attr->inheritsched ) { case PTHREAD_INHERIT_SCHED: api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 46c74: 2079 0006 256a moveal 6256a <_Per_CPU_Information+0xc>,%a0 schedpolicy = api->schedpolicy; schedparam = api->schedparam; 46c7a: 47ee ffdc lea %fp@(-36),%a3 * PTHREAD_EXPLICIT_SCHED, then scheduling parameters come from the * attributes structure. */ switch ( the_attr->inheritsched ) { case PTHREAD_INHERIT_SCHED: api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 46c7e: 2268 0102 moveal %a0@(258),%a1 schedpolicy = api->schedpolicy; schedparam = api->schedparam; 46c82: 41e9 0088 lea %a1@(136),%a0 46c86: 2698 movel %a0@+,%a3@ 46c88: 2d58 ffe0 movel %a0@+,%fp@(-32) 46c8c: 2d58 ffe4 movel %a0@+,%fp@(-28) 46c90: 2d58 ffe8 movel %a0@+,%fp@(-24) 46c94: 2d58 ffec movel %a0@+,%fp@(-20) 46c98: 2d58 fff0 movel %a0@+,%fp@(-16) 46c9c: 2d50 fff4 movel %a0@,%fp@(-12) * attributes structure. */ switch ( the_attr->inheritsched ) { case PTHREAD_INHERIT_SCHED: api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; schedpolicy = api->schedpolicy; 46ca0: 2829 0084 movel %a1@(132),%d4 schedparam = api->schedparam; break; 46ca4: 6000 fed4 braw 46b7a } /* * finish initializing the per API structure */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 46ca8: 286d 0102 moveal %a5@(258),%a4 api->Attributes = *the_attr; 46cac: 4878 0040 pea 40 46cb0: 41f9 0005 0574 lea 50574 ,%a0 46cb6: 2f0a movel %a2,%sp@- 46cb8: 2d48 ffd8 movel %a0,%fp@(-40) 46cbc: 2f0c movel %a4,%sp@- 46cbe: 4e90 jsr %a0@ api->detachstate = the_attr->detachstate; 46cc0: 296a 003c 0040 movel %a2@(60),%a4@(64) api->schedpolicy = schedpolicy; 46cc6: 2944 0084 movel %d4,%a4@(132) api->schedparam = schedparam; 46cca: 4878 001c pea 1c 46cce: 206e ffd8 moveal %fp@(-40),%a0 46cd2: 2f0b movel %a3,%sp@- 46cd4: 486c 0088 pea %a4@(136) 46cd8: 4e90 jsr %a0@ /* * POSIX threads are allocated and started in one operation. */ status = _Thread_Start( 46cda: 42a7 clrl %sp@- 46cdc: 2f2e 0014 movel %fp@(20),%sp@- 46ce0: 2f03 movel %d3,%sp@- 46ce2: 4878 0001 pea 1 46ce6: 2f0d movel %a5,%sp@- 46ce8: 4eb9 0004 adb8 jsr 4adb8 <_Thread_Start> _RTEMS_Unlock_allocator(); return EINVAL; } #endif if ( schedpolicy == SCHED_SPORADIC ) { 46cee: 4fef 002c lea %sp@(44),%sp 46cf2: 7004 moveq #4,%d0 46cf4: b084 cmpl %d4,%d0 46cf6: 6740 beqs 46d38 } /* * Return the id and indicate we successfully created the thread */ *thread = the_thread->Object.id; 46cf8: 206e 0008 moveal %fp@(8),%a0 46cfc: 20ad 0008 movel %a5@(8),%a0@ _RTEMS_Unlock_allocator(); 46d00: 2f39 0006 21a8 movel 621a8 <_RTEMS_Allocator_Mutex>,%sp@- 46d06: 4eb9 0004 870c jsr 4870c <_API_Mutex_Unlock> return 0; 46d0c: 588f addql #4,%sp } 46d0e: 2002 movel %d2,%d0 46d10: 4cee 3c3c ffb8 moveml %fp@(-72),%d2-%d5/%a2-%a5 46d16: 4e5e unlk %fp 46d18: 4e75 rts * * NOTE: Global threads are not currently supported. */ the_thread = _POSIX_Threads_Allocate(); if ( !the_thread ) { _RTEMS_Unlock_allocator(); 46d1a: 2f39 0006 21a8 movel 621a8 <_RTEMS_Allocator_Mutex>,%sp@- return EAGAIN; 46d20: 143c 000b moveb #11,%d2 * * NOTE: Global threads are not currently supported. */ the_thread = _POSIX_Threads_Allocate(); if ( !the_thread ) { _RTEMS_Unlock_allocator(); 46d24: 4eb9 0004 870c jsr 4870c <_API_Mutex_Unlock> return EAGAIN; 46d2a: 588f addql #4,%sp */ *thread = the_thread->Object.id; _RTEMS_Unlock_allocator(); return 0; } 46d2c: 2002 movel %d2,%d0 46d2e: 4cee 3c3c ffb8 moveml %fp@(-72),%d2-%d5/%a2-%a5 46d34: 4e5e unlk %fp 46d36: 4e75 rts return EINVAL; } #endif if ( schedpolicy == SCHED_SPORADIC ) { _Watchdog_Insert_ticks( 46d38: 486c 0090 pea %a4@(144) 46d3c: 4eb9 0004 aeec jsr 4aeec <_Timespec_To_ticks> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 46d42: 2940 00b4 movel %d0,%a4@(180) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 46d46: 486c 00a8 pea %a4@(168) 46d4a: 4879 0006 21c0 pea 621c0 <_Watchdog_Ticks_chain> 46d50: 4eb9 0004 b244 jsr 4b244 <_Watchdog_Insert> } /* * Return the id and indicate we successfully created the thread */ *thread = the_thread->Object.id; 46d56: 206e 0008 moveal %fp@(8),%a0 46d5a: 4fef 000c lea %sp@(12),%sp 46d5e: 20ad 0008 movel %a5@(8),%a0@ _RTEMS_Unlock_allocator(); 46d62: 2f39 0006 21a8 movel 621a8 <_RTEMS_Allocator_Mutex>,%sp@- 46d68: 4eb9 0004 870c jsr 4870c <_API_Mutex_Unlock> return 0; 46d6e: 588f addql #4,%sp 46d70: 609c bras 46d0e ... =============================================================================== 0004eb26 : } void pthread_exit( void *value_ptr ) { 4eb26: 4e56 0000 linkw %fp,#0 _POSIX_Thread_Exit( _Thread_Executing, value_ptr ); 4eb2a: 2f2e 0008 movel %fp@(8),%sp@- 4eb2e: 2f39 0006 14aa movel 614aa <_Per_CPU_Information+0xc>,%sp@- 4eb34: 4eb9 0004 e9d0 jsr 4e9d0 <_POSIX_Thread_Exit> 4eb3a: 508f addql #8,%sp <== NOT EXECUTED } 4eb3c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004677c : int pthread_key_create( pthread_key_t *key, void (*destructor)( void * ) ) { 4677c: 4e56 ffe8 linkw %fp,#-24 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 46780: 2039 0006 2be8 movel 62be8 <_Thread_Dispatch_disable_level>,%d0 46786: 5280 addql #1,%d0 46788: 23c0 0006 2be8 movel %d0,62be8 <_Thread_Dispatch_disable_level> return _Thread_Dispatch_disable_level; 4678e: 2039 0006 2be8 movel 62be8 <_Thread_Dispatch_disable_level>,%d0 46794: 48d7 3c0c moveml %d2-%d3/%a2-%a5,%sp@ * the inactive chain of free keys control blocks. */ RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Allocate( void ) { return (POSIX_Keys_Control *) _Objects_Allocate( &_POSIX_Keys_Information ); 46798: 4879 0006 2f30 pea 62f30 <_POSIX_Keys_Information> 4679e: 4eb9 0004 8db0 jsr 48db0 <_Objects_Allocate> _Thread_Disable_dispatch(); the_key = _POSIX_Keys_Allocate(); if ( !the_key ) { 467a4: 588f addql #4,%sp 467a6: 2840 moveal %d0,%a4 467a8: 4a80 tstl %d0 467aa: 677e beqs 4682a <== NEVER TAKEN _Thread_Enable_dispatch(); return EAGAIN; } the_key->destructor = destructor; 467ac: 45f9 0006 2ba8 lea 62ba8 <_Objects_Information_table+0x4>,%a2 int _EXFUN(pthread_once, (pthread_once_t *__once_control, void (*__init_routine)(void))); /* Thread-Specific Data Key Create, P1003.1c/Draft 10, p. 163 */ int _EXFUN(pthread_key_create, 467b2: 47ec 0018 lea %a4@(24),%a3 467b6: 4bf9 0004 b1ba lea 4b1ba <_Workspace_Allocate>,%a5 467bc: 296e 000c 0010 movel %fp@(12),%a4@(16) _Thread_Enable_dispatch(); return ENOMEM; } the_key->Values[ the_api ] = table; memset( table, '\0', bytes_to_allocate ); 467c2: 263c 0005 0410 movel #328720,%d3 * APIs are optional. * * NOTE: Currently RTEMS Classic API tasks are always enabled. */ for ( the_api = 1; the_api <= OBJECTS_APIS_LAST; the_api++ ) { the_key->Values[ the_api ] = NULL; 467c8: 4293 clrl %a3@ INTERNAL_ERROR_IMPLEMENTATION_KEY_CREATE_INCONSISTENCY ); #endif bytes_to_allocate = sizeof( void * ) * (_Objects_Information_table[ the_api ][ 1 ]->maximum + 1); 467ca: 205a moveal %a2@+,%a0 467cc: 4282 clrl %d2 467ce: 2068 0004 moveal %a0@(4),%a0 467d2: 3428 000e movew %a0@(14),%d2 467d6: 5282 addql #1,%d2 true, INTERNAL_ERROR_IMPLEMENTATION_KEY_CREATE_INCONSISTENCY ); #endif bytes_to_allocate = sizeof( void * ) * 467d8: e58a lsll #2,%d2 (_Objects_Information_table[ the_api ][ 1 ]->maximum + 1); table = _Workspace_Allocate( bytes_to_allocate ); 467da: 2f02 movel %d2,%sp@- 467dc: 4e95 jsr %a5@ if ( !table ) { 467de: 588f addql #4,%sp 467e0: 4a80 tstl %d0 467e2: 6758 beqs 4683c _POSIX_Keys_Free( the_key ); _Thread_Enable_dispatch(); return ENOMEM; } the_key->Values[ the_api ] = table; 467e4: 26c0 movel %d0,%a3@+ memset( table, '\0', bytes_to_allocate ); 467e6: 2043 moveal %d3,%a0 467e8: 2f02 movel %d2,%sp@- 467ea: 42a7 clrl %sp@- 467ec: 2f00 movel %d0,%sp@- 467ee: 4e90 jsr %a0@ * This is a bit more complex than one might initially expect because * APIs are optional. * * NOTE: Currently RTEMS Classic API tasks are always enabled. */ for ( the_api = 1; the_api <= OBJECTS_APIS_LAST; the_api++ ) { 467f0: 4fef 000c lea %sp@(12),%sp 467f4: b5fc 0006 2bb4 cmpal #404404,%a2 467fa: 66cc bnes 467c8 uint32_t name ) { _Objects_Set_local_object( information, _Objects_Get_index( the_object->id ), 467fc: 202c 0008 movel %a4@(8),%d0 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 46800: 4281 clrl %d1 46802: 2079 0006 2f48 moveal 62f48 <_POSIX_Keys_Information+0x18>,%a0 46808: 3200 movew %d0,%d1 4680a: 218c 1c00 movel %a4,%a0@(00000000,%d1:l:4) the_key->Values[ the_api ] = table; memset( table, '\0', bytes_to_allocate ); } _Objects_Open_u32( &_POSIX_Keys_Information, &the_key->Object, 0 ); *key = the_key->Object.id; 4680e: 206e 0008 moveal %fp@(8),%a0 _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 46812: 42ac 000c clrl %a4@(12) 46816: 2080 movel %d0,%a0@ _Thread_Enable_dispatch(); 46818: 4eb9 0004 9fbc jsr 49fbc <_Thread_Enable_dispatch> return 0; } 4681e: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 } _Objects_Open_u32( &_POSIX_Keys_Information, &the_key->Object, 0 ); *key = the_key->Object.id; _Thread_Enable_dispatch(); return 0; 46824: 4280 clrl %d0 } 46826: 4e5e unlk %fp 46828: 4e75 rts _Thread_Disable_dispatch(); the_key = _POSIX_Keys_Allocate(); if ( !the_key ) { _Thread_Enable_dispatch(); 4682a: 4eb9 0004 9fbc jsr 49fbc <_Thread_Enable_dispatch> return EAGAIN; 46830: 700b moveq #11,%d0 _Objects_Open_u32( &_POSIX_Keys_Information, &the_key->Object, 0 ); *key = the_key->Object.id; _Thread_Enable_dispatch(); return 0; } 46832: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 46838: 4e5e unlk %fp 4683a: 4e75 rts bytes_to_allocate = sizeof( void * ) * (_Objects_Information_table[ the_api ][ 1 ]->maximum + 1); table = _Workspace_Allocate( bytes_to_allocate ); if ( !table ) { _POSIX_Keys_Free_memory( the_key ); 4683c: 2f0c movel %a4,%sp@- 4683e: 4eb9 0004 68d0 jsr 468d0 <_POSIX_Keys_Free_memory> */ RTEMS_INLINE_ROUTINE void _POSIX_Keys_Free ( POSIX_Keys_Control *the_key ) { _Objects_Free( &_POSIX_Keys_Information, &the_key->Object ); 46844: 2f0c movel %a4,%sp@- 46846: 4879 0006 2f30 pea 62f30 <_POSIX_Keys_Information> 4684c: 4eb9 0004 9100 jsr 49100 <_Objects_Free> _POSIX_Keys_Free( the_key ); _Thread_Enable_dispatch(); 46852: 4eb9 0004 9fbc jsr 49fbc <_Thread_Enable_dispatch> return ENOMEM; 46858: 4fef 000c lea %sp@(12),%sp 4685c: 700c moveq #12,%d0 _Objects_Open_u32( &_POSIX_Keys_Information, &the_key->Object, 0 ); *key = the_key->Object.id; _Thread_Enable_dispatch(); return 0; } 4685e: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 46864: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0005d3fc : int pthread_kill( pthread_t thread, int sig ) { 5d3fc: 4e56 fff0 linkw %fp,#-16 5d400: 48d7 040c moveml %d2-%d3/%a2,%sp@ 5d404: 242e 000c movel %fp@(12),%d2 POSIX_API_Control *api; Thread_Control *the_thread; Objects_Locations location; if ( !sig ) 5d408: 6700 0090 beqw 5d49a static inline bool is_valid_signo( int signo ) { return ((signo) >= 1 && (signo) <= 32 ); 5d40c: 2602 movel %d2,%d3 5d40e: 5383 subql #1,%d3 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 5d410: 701f moveq #31,%d0 5d412: b083 cmpl %d3,%d0 5d414: 6500 0084 bcsw 5d49a rtems_set_errno_and_return_minus_one( EINVAL ); the_thread = _Thread_Get( thread, &location ); 5d418: 486e fffc pea %fp@(-4) 5d41c: 2f2e 0008 movel %fp@(8),%sp@- 5d420: 4eb9 0004 9240 jsr 49240 <_Thread_Get> switch ( location ) { 5d426: 508f addql #8,%sp rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) rtems_set_errno_and_return_minus_one( EINVAL ); the_thread = _Thread_Get( thread, &location ); 5d428: 2440 moveal %d0,%a2 switch ( location ) { 5d42a: 4aae fffc tstl %fp@(-4) 5d42e: 6600 0082 bnew 5d4b2 api = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( sig ) { if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) { 5d432: 2202 movel %d2,%d1 5d434: 2002 movel %d2,%d0 5d436: e589 lsll #2,%d1 5d438: e988 lsll #4,%d0 case OBJECTS_LOCAL: /* * If sig == 0 then just validate arguments */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 5d43a: 206a 0102 moveal %a2@(258),%a0 if ( sig ) { if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) { 5d43e: 9081 subl %d1,%d0 5d440: 0680 0006 14ec addil #398572,%d0 5d446: 7201 moveq #1,%d1 5d448: 2240 moveal %d0,%a1 5d44a: b291 cmpl %a1@,%d1 5d44c: 6728 beqs 5d476 static inline sigset_t signo_to_mask( uint32_t sig ) { return 1u << (sig - 1); 5d44e: 7001 moveq #1,%d0 5d450: e7a8 lsll %d3,%d0 return 0; } /* XXX critical section */ api->signals_pending |= signo_to_mask( sig ); 5d452: 81a8 00d4 orl %d0,%a0@(212) (void) _POSIX_signals_Unblock_thread( the_thread, sig, NULL ); 5d456: 42a7 clrl %sp@- 5d458: 2f02 movel %d2,%sp@- 5d45a: 2f0a movel %a2,%sp@- 5d45c: 4eb9 0005 d2c0 jsr 5d2c0 <_POSIX_signals_Unblock_thread> if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 5d462: 4fef 000c lea %sp@(12),%sp 5d466: 4ab9 0006 14a6 tstl 614a6 <_Per_CPU_Information+0x8> 5d46c: 6708 beqs 5d476 5d46e: b5f9 0006 14aa cmpal 614aa <_Per_CPU_Information+0xc>,%a2 5d474: 6712 beqs 5d488 _Thread_Dispatch_necessary = true; } _Thread_Enable_dispatch(); 5d476: 4eb9 0004 9218 jsr 49218 <_Thread_Enable_dispatch> return 0; 5d47c: 4280 clrl %d0 case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( ESRCH ); } 5d47e: 4cee 040c fff0 moveml %fp@(-16),%d2-%d3/%a2 5d484: 4e5e unlk %fp 5d486: 4e75 rts api->signals_pending |= signo_to_mask( sig ); (void) _POSIX_signals_Unblock_thread( the_thread, sig, NULL ); if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; 5d488: 7001 moveq #1,%d0 5d48a: 13c0 0006 14b6 moveb %d0,614b6 <_Per_CPU_Information+0x18> } _Thread_Enable_dispatch(); 5d490: 4eb9 0004 9218 jsr 49218 <_Thread_Enable_dispatch> return 0; 5d496: 4280 clrl %d0 5d498: 60e4 bras 5d47e if ( !sig ) rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) rtems_set_errno_and_return_minus_one( EINVAL ); 5d49a: 4eb9 0004 f098 jsr 4f098 <__errno> 5d4a0: 7416 moveq #22,%d2 5d4a2: 2040 moveal %d0,%a0 5d4a4: 70ff moveq #-1,%d0 5d4a6: 2082 movel %d2,%a0@ case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( ESRCH ); } 5d4a8: 4cee 040c fff0 moveml %fp@(-16),%d2-%d3/%a2 5d4ae: 4e5e unlk %fp 5d4b0: 4e75 rts #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( ESRCH ); 5d4b2: 4eb9 0004 f098 jsr 4f098 <__errno> <== NOT EXECUTED 5d4b8: 7203 moveq #3,%d1 <== NOT EXECUTED 5d4ba: 2040 moveal %d0,%a0 <== NOT EXECUTED 5d4bc: 70ff moveq #-1,%d0 <== NOT EXECUTED } 5d4be: 4cee 040c fff0 moveml %fp@(-16),%d2-%d3/%a2 <== NOT EXECUTED #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( ESRCH ); 5d4c4: 2081 movel %d1,%a0@ <== NOT EXECUTED } 5d4c6: 4e5e unlk %fp <== NOT EXECUTED ... =============================================================================== 000487d0 : int pthread_mutex_init( pthread_mutex_t *mutex, const pthread_mutexattr_t *attr ) { 487d0: 4e56 fff0 linkw %fp,#-16 487d4: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ 487d8: 266e 0008 moveal %fp@(8),%a3 487dc: 246e 000c moveal %fp@(12),%a2 POSIX_Mutex_Control *the_mutex; CORE_mutex_Attributes *the_mutex_attr; const pthread_mutexattr_t *the_attr; CORE_mutex_Disciplines the_discipline; if ( attr ) the_attr = attr; 487e0: 4a8a tstl %a2 487e2: 6700 00f0 beqw 488d4 else the_attr = &_POSIX_Mutex_Default_attributes; /* Check for NULL mutex */ if ( !mutex ) 487e6: 4a8b tstl %a3 487e8: 6704 beqs 487ee } } } #endif if ( !the_attr->is_initialized ) 487ea: 4a92 tstl %a2@ 487ec: 660c bnes 487fa case PTHREAD_MUTEX_ERRORCHECK: case PTHREAD_MUTEX_DEFAULT: break; default: return EINVAL; 487ee: 7016 moveq #22,%d0 *mutex = the_mutex->Object.id; _Thread_Enable_dispatch(); return 0; } 487f0: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 487f6: 4e5e unlk %fp 487f8: 4e75 rts return EINVAL; /* * We only support process private mutexes. */ if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) 487fa: 202a 0004 movel %a2@(4),%d0 487fe: 7201 moveq #1,%d1 48800: b280 cmpl %d0,%d1 48802: 6700 00da beqw 488de return ENOSYS; if ( the_attr->process_shared != PTHREAD_PROCESS_PRIVATE ) 48806: 4a80 tstl %d0 48808: 66e4 bnes 487ee <== NEVER TAKEN return EINVAL; /* * Determine the discipline of the mutex */ switch ( the_attr->protocol ) { 4880a: 202a 000c movel %a2@(12),%d0 4880e: b280 cmpl %d0,%d1 48810: 6700 00de beqw 488f0 48814: 123c 0002 moveb #2,%d1 48818: b280 cmpl %d0,%d1 4881a: 6700 00ce beqw 488ea 4881e: 4a80 tstl %d0 48820: 66cc bnes 487ee <== NEVER TAKEN case PTHREAD_PRIO_NONE: the_discipline = CORE_MUTEX_DISCIPLINES_FIFO; 48822: 4282 clrl %d2 } /* * Validate the priority ceiling field -- should always be valid. */ if ( !_POSIX_Priority_Is_valid( the_attr->prio_ceiling ) ) 48824: 2f2a 0008 movel %a2@(8),%sp@- 48828: 4eb9 0004 8bc8 jsr 48bc8 <_POSIX_Priority_Is_valid> 4882e: 588f addql #4,%sp 48830: 4a00 tstb %d0 48832: 67ba beqs 487ee <== NEVER TAKEN #if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES) /* * Validate the mutex type and set appropriate SuperCore mutex * attributes. */ switch ( the_attr->type ) { 48834: 7003 moveq #3,%d0 48836: b0aa 0010 cmpl %a2@(16),%d0 4883a: 65b2 bcss 487ee <== NEVER TAKEN * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 4883c: 2039 0006 5f48 movel 65f48 <_Thread_Dispatch_disable_level>,%d0 48842: 5280 addql #1,%d0 48844: 23c0 0006 5f48 movel %d0,65f48 <_Thread_Dispatch_disable_level> return _Thread_Dispatch_disable_level; 4884a: 2039 0006 5f48 movel 65f48 <_Thread_Dispatch_disable_level>,%d0 * _POSIX_Mutex_Allocate */ RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Allocate( void ) { return (POSIX_Mutex_Control *) _Objects_Allocate( &_POSIX_Mutex_Information ); 48850: 4879 0006 6204 pea 66204 <_POSIX_Mutex_Information> 48856: 4eb9 0004 b19c jsr 4b19c <_Objects_Allocate> */ _Thread_Disable_dispatch(); the_mutex = _POSIX_Mutex_Allocate(); if ( !the_mutex ) { 4885c: 588f addql #4,%sp 4885e: 2840 moveal %d0,%a4 48860: 4a80 tstl %d0 48862: 6700 0092 beqw 488f6 the_mutex->process_shared = the_attr->process_shared; the_mutex_attr = &the_mutex->Mutex.Attributes; if ( the_attr->recursive ) the_mutex_attr->lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES; 48866: 4aaa 0014 tstl %a2@(20) 4886a: 57c0 seq %d0 RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( int priority ) { return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1); 4886c: 4281 clrl %d1 4886e: 1239 0006 454a moveb 6454a ,%d1 48874: 49c0 extbl %d0 48876: 92aa 0008 subl %a2@(8),%d1 4887a: 4480 negl %d0 if ( !the_mutex ) { _Thread_Enable_dispatch(); return EAGAIN; } the_mutex->process_shared = the_attr->process_shared; 4887c: 296a 0004 0010 movel %a2@(4),%a4@(16) 48882: 2941 005e movel %d1,%a4@(94) if ( the_attr->recursive ) the_mutex_attr->lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES; else the_mutex_attr->lock_nesting_behavior = CORE_MUTEX_NESTING_IS_ERROR; the_mutex_attr->only_owner_release = true; 48886: 7201 moveq #1,%d1 the_mutex->process_shared = the_attr->process_shared; the_mutex_attr = &the_mutex->Mutex.Attributes; if ( the_attr->recursive ) the_mutex_attr->lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES; 48888: 2940 0054 movel %d0,%a4@(84) else the_mutex_attr->lock_nesting_behavior = CORE_MUTEX_NESTING_IS_ERROR; the_mutex_attr->only_owner_release = true; 4888c: 1941 0058 moveb %d1,%a4@(88) the_mutex_attr->priority_ceiling = _POSIX_Priority_To_core( the_attr->prio_ceiling ); the_mutex_attr->discipline = the_discipline; 48890: 2942 005a movel %d2,%a4@(90) /* * Must be initialized to unlocked. */ _CORE_mutex_Initialize( 48894: 4878 0001 pea 1 48898: 486c 0054 pea %a4@(84) 4889c: 486c 0014 pea %a4@(20) 488a0: 4eb9 0004 a790 jsr 4a790 <_CORE_mutex_Initialize> uint32_t name ) { _Objects_Set_local_object( information, _Objects_Get_index( the_object->id ), 488a6: 202c 0008 movel %a4@(8),%d0 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 488aa: 4281 clrl %d1 488ac: 2079 0006 621c moveal 6621c <_POSIX_Mutex_Information+0x18>,%a0 488b2: 3200 movew %d0,%d1 488b4: 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; 488b8: 42ac 000c clrl %a4@(12) CORE_MUTEX_UNLOCKED ); _Objects_Open_u32( &_POSIX_Mutex_Information, &the_mutex->Object, 0 ); *mutex = the_mutex->Object.id; 488bc: 2680 movel %d0,%a3@ _Thread_Enable_dispatch(); 488be: 4eb9 0004 c3a8 jsr 4c3a8 <_Thread_Enable_dispatch> return 0; 488c4: 4fef 000c lea %sp@(12),%sp 488c8: 4280 clrl %d0 } 488ca: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 488d0: 4e5e unlk %fp 488d2: 4e75 rts CORE_mutex_Attributes *the_mutex_attr; const pthread_mutexattr_t *the_attr; CORE_mutex_Disciplines the_discipline; if ( attr ) the_attr = attr; else the_attr = &_POSIX_Mutex_Default_attributes; 488d4: 45f9 0006 6278 lea 66278 <_POSIX_Mutex_Default_attributes>,%a2 488da: 6000 ff0a braw 487e6 /* * We only support process private mutexes. */ if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) return ENOSYS; 488de: 7058 moveq #88,%d0 *mutex = the_mutex->Object.id; _Thread_Enable_dispatch(); return 0; } 488e0: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 488e6: 4e5e unlk %fp 488e8: 4e75 rts break; case PTHREAD_PRIO_INHERIT: the_discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT; break; case PTHREAD_PRIO_PROTECT: the_discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING; 488ea: 7403 moveq #3,%d2 break; 488ec: 6000 ff36 braw 48824 switch ( the_attr->protocol ) { case PTHREAD_PRIO_NONE: the_discipline = CORE_MUTEX_DISCIPLINES_FIFO; break; case PTHREAD_PRIO_INHERIT: the_discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT; 488f0: 7402 moveq #2,%d2 488f2: 6000 ff30 braw 48824 _Thread_Disable_dispatch(); the_mutex = _POSIX_Mutex_Allocate(); if ( !the_mutex ) { _Thread_Enable_dispatch(); 488f6: 4eb9 0004 c3a8 jsr 4c3a8 <_Thread_Enable_dispatch> return EAGAIN; 488fc: 700b moveq #11,%d0 *mutex = the_mutex->Object.id; _Thread_Enable_dispatch(); return 0; } 488fe: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 48904: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00048a24 : int pthread_mutex_timedlock( pthread_mutex_t *mutex, const struct timespec *abstime ) { 48a24: 4e56 fffc linkw %fp,#-4 48a28: 2f03 movel %d3,%sp@- 48a2a: 262e 0008 movel %fp@(8),%d3 48a2e: 2f02 movel %d2,%sp@- * * If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID, * POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW, * then we should not wait. */ status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks ); 48a30: 486e fffc pea %fp@(-4) 48a34: 2f2e 000c movel %fp@(12),%sp@- 48a38: 4eb9 0004 8b38 jsr 48b38 <_POSIX_Absolute_timeout_to_ticks> if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) 48a3e: 508f addql #8,%sp * * If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID, * POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW, * then we should not wait. */ status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks ); 48a40: 2400 movel %d0,%d2 if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) 48a42: 7003 moveq #3,%d0 48a44: b082 cmpl %d2,%d0 48a46: 6724 beqs 48a6c do_wait = false; lock_status = _POSIX_Mutex_Lock_support( mutex, do_wait, ticks ); 48a48: 2f2e fffc movel %fp@(-4),%sp@- 48a4c: 42a7 clrl %sp@- 48a4e: 2f03 movel %d3,%sp@- 48a50: 4eb9 0004 8920 jsr 48920 <_POSIX_Mutex_Lock_support> * This service only gives us the option to block. We used a polling * attempt to lock if the abstime was not in the future. If we did * not obtain the mutex, then not look at the status immediately, * make sure the right reason is returned. */ if ( !do_wait && (lock_status == EBUSY) ) { 48a56: 4fef 000c lea %sp@(12),%sp 48a5a: 7210 moveq #16,%d1 48a5c: b280 cmpl %d0,%d1 48a5e: 672c beqs 48a8c status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; } return lock_status; } 48a60: 242e fff4 movel %fp@(-12),%d2 48a64: 262e fff8 movel %fp@(-8),%d3 48a68: 4e5e unlk %fp 48a6a: 4e75 rts */ status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks ); if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; lock_status = _POSIX_Mutex_Lock_support( mutex, do_wait, ticks ); 48a6c: 2f2e fffc movel %fp@(-4),%sp@- 48a70: 4878 0001 pea 1 48a74: 2f03 movel %d3,%sp@- 48a76: 4eb9 0004 8920 jsr 48920 <_POSIX_Mutex_Lock_support> status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; } return lock_status; } 48a7c: 242e fff4 movel %fp@(-12),%d2 */ status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks ); if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; lock_status = _POSIX_Mutex_Lock_support( mutex, do_wait, ticks ); 48a80: 4fef 000c lea %sp@(12),%sp status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; } return lock_status; } 48a84: 262e fff8 movel %fp@(-8),%d3 48a88: 4e5e unlk %fp 48a8a: 4e75 rts * attempt to lock if the abstime was not in the future. If we did * not obtain the mutex, then not look at the status immediately, * make sure the right reason is returned. */ if ( !do_wait && (lock_status == EBUSY) ) { if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID ) 48a8c: 4a82 tstl %d2 48a8e: 660e bnes 48a9e <== ALWAYS TAKEN status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; } return lock_status; } 48a90: 242e fff4 movel %fp@(-12),%d2 <== NOT EXECUTED * not obtain the mutex, then not look at the status immediately, * make sure the right reason is returned. */ if ( !do_wait && (lock_status == EBUSY) ) { if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID ) return EINVAL; 48a94: 7016 moveq #22,%d0 <== NOT EXECUTED status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; } return lock_status; } 48a96: 262e fff8 movel %fp@(-8),%d3 <== NOT EXECUTED 48a9a: 4e5e unlk %fp <== NOT EXECUTED 48a9c: 4e75 rts <== NOT EXECUTED * make sure the right reason is returned. */ if ( !do_wait && (lock_status == EBUSY) ) { if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID ) return EINVAL; if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST || 48a9e: 5382 subql #1,%d2 48aa0: 7201 moveq #1,%d1 48aa2: b282 cmpl %d2,%d1 48aa4: 65ba bcss 48a60 <== NEVER TAKEN status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; } return lock_status; } 48aa6: 242e fff4 movel %fp@(-12),%d2 if ( !do_wait && (lock_status == EBUSY) ) { if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID ) return EINVAL; if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST || status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; 48aaa: 7074 moveq #116,%d0 } return lock_status; } 48aac: 262e fff8 movel %fp@(-8),%d3 48ab0: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00046428 : #if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES) int pthread_mutexattr_gettype( const pthread_mutexattr_t *attr, int *type ) { 46428: 4e56 0000 linkw %fp,#0 4642c: 206e 0008 moveal %fp@(8),%a0 46430: 226e 000c moveal %fp@(12),%a1 if ( !attr ) 46434: 4a88 tstl %a0 46436: 6704 beqs 4643c return EINVAL; if ( !attr->is_initialized ) 46438: 4a90 tstl %a0@ 4643a: 6606 bnes 46442 return EINVAL; if ( !type ) return EINVAL; 4643c: 7016 moveq #22,%d0 *type = attr->type; return 0; } 4643e: 4e5e unlk %fp 46440: 4e75 rts return EINVAL; if ( !attr->is_initialized ) return EINVAL; if ( !type ) 46442: 4a89 tstl %a1 46444: 67f6 beqs 4643c <== NEVER TAKEN return EINVAL; *type = attr->type; 46446: 22a8 0010 movel %a0@(16),%a1@ return 0; 4644a: 4280 clrl %d0 } 4644c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000485e0 : int pthread_mutexattr_setpshared( pthread_mutexattr_t *attr, int pshared ) { 485e0: 4e56 0000 linkw %fp,#0 485e4: 206e 0008 moveal %fp@(8),%a0 if ( !attr || !attr->is_initialized ) 485e8: 4a88 tstl %a0 485ea: 6704 beqs 485f0 485ec: 4a90 tstl %a0@ 485ee: 6606 bnes 485f6 case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; return 0; default: return EINVAL; 485f0: 7016 moveq #22,%d0 } } 485f2: 4e5e unlk %fp 485f4: 4e75 rts ) { if ( !attr || !attr->is_initialized ) return EINVAL; switch ( pshared ) { 485f6: 7001 moveq #1,%d0 485f8: b0ae 000c cmpl %fp@(12),%d0 485fc: 65f2 bcss 485f0 <== NEVER TAKEN case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; 485fe: 202e 000c movel %fp@(12),%d0 return 0; default: return EINVAL; } } 48602: 4e5e unlk %fp return EINVAL; switch ( pshared ) { case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; 48604: 2140 0004 movel %d0,%a0@(4) return 0; 48608: 4280 clrl %d0 <== NOT EXECUTED default: return EINVAL; } } =============================================================================== 0004648c : #if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES) int pthread_mutexattr_settype( pthread_mutexattr_t *attr, int type ) { 4648c: 4e56 0000 linkw %fp,#0 46490: 206e 0008 moveal %fp@(8),%a0 if ( !attr || !attr->is_initialized ) 46494: 4a88 tstl %a0 46496: 6704 beqs 4649c 46498: 4a90 tstl %a0@ 4649a: 6606 bnes 464a2 <== ALWAYS TAKEN case PTHREAD_MUTEX_DEFAULT: attr->type = type; return 0; default: return EINVAL; 4649c: 7016 moveq #22,%d0 } } 4649e: 4e5e unlk %fp 464a0: 4e75 rts ) { if ( !attr || !attr->is_initialized ) return EINVAL; switch ( type ) { 464a2: 7003 moveq #3,%d0 464a4: b0ae 000c cmpl %fp@(12),%d0 464a8: 65f2 bcss 4649c case PTHREAD_MUTEX_NORMAL: case PTHREAD_MUTEX_RECURSIVE: case PTHREAD_MUTEX_ERRORCHECK: case PTHREAD_MUTEX_DEFAULT: attr->type = type; 464aa: 202e 000c movel %fp@(12),%d0 return 0; default: return EINVAL; } } 464ae: 4e5e unlk %fp switch ( type ) { case PTHREAD_MUTEX_NORMAL: case PTHREAD_MUTEX_RECURSIVE: case PTHREAD_MUTEX_ERRORCHECK: case PTHREAD_MUTEX_DEFAULT: attr->type = type; 464b0: 2140 0010 movel %d0,%a0@(16) return 0; 464b4: 4280 clrl %d0 <== NOT EXECUTED default: return EINVAL; } } =============================================================================== 00047304 : int pthread_once( pthread_once_t *once_control, void (*init_routine)(void) ) { 47304: 4e56 ffec linkw %fp,#-20 47308: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ 4730c: 246e 0008 moveal %fp@(8),%a2 47310: 266e 000c moveal %fp@(12),%a3 if ( !once_control || !init_routine ) 47314: 4a8a tstl %a2 47316: 6752 beqs 4736a 47318: 4a8b tstl %a3 4731a: 674e beqs 4736a return EINVAL; if ( !once_control->init_executed ) { 4731c: 4aaa 0004 tstl %a2@(4) 47320: 670c beqs 4732e once_control->init_executed = true; (*init_routine)(); } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); } return 0; 47322: 4280 clrl %d0 } 47324: 4cee 1c04 ffec moveml %fp@(-20),%d2/%a2-%a4 4732a: 4e5e unlk %fp 4732c: 4e75 rts if ( !once_control || !init_routine ) return EINVAL; if ( !once_control->init_executed ) { rtems_mode saveMode; rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode); 4732e: 240e movel %fp,%d2 47330: 5982 subql #4,%d2 47332: 49f9 0004 7fd8 lea 47fd8 ,%a4 47338: 2f02 movel %d2,%sp@- 4733a: 4878 0100 pea 100 4733e: 4878 0100 pea 100 47342: 4e94 jsr %a4@ if ( !once_control->init_executed ) { 47344: 4fef 000c lea %sp@(12),%sp 47348: 4aaa 0004 tstl %a2@(4) 4734c: 6728 beqs 47376 <== ALWAYS TAKEN once_control->is_initialized = true; once_control->init_executed = true; (*init_routine)(); } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); 4734e: 2f02 movel %d2,%sp@- <== NOT EXECUTED 47350: 4878 0100 pea 100 <== NOT EXECUTED 47354: 2f2e fffc movel %fp@(-4),%sp@- <== NOT EXECUTED 47358: 4e94 jsr %a4@ <== NOT EXECUTED 4735a: 4fef 000c lea %sp@(12),%sp <== NOT EXECUTED } return 0; 4735e: 4280 clrl %d0 <== NOT EXECUTED } 47360: 4cee 1c04 ffec moveml %fp@(-20),%d2/%a2-%a4 47366: 4e5e unlk %fp 47368: 4e75 rts pthread_once_t *once_control, void (*init_routine)(void) ) { if ( !once_control || !init_routine ) return EINVAL; 4736a: 7016 moveq #22,%d0 (*init_routine)(); } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); } return 0; } 4736c: 4cee 1c04 ffec moveml %fp@(-20),%d2/%a2-%a4 47372: 4e5e unlk %fp 47374: 4e75 rts 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; 47376: 7001 moveq #1,%d0 47378: 2480 movel %d0,%a2@ once_control->init_executed = true; 4737a: 7001 moveq #1,%d0 4737c: 2540 0004 movel %d0,%a2@(4) (*init_routine)(); 47380: 4e93 jsr %a3@ } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); 47382: 2f02 movel %d2,%sp@- 47384: 4878 0100 pea 100 47388: 2f2e fffc movel %fp@(-4),%sp@- 4738c: 4e94 jsr %a4@ 4738e: 4fef 000c lea %sp@(12),%sp } return 0; 47392: 4280 clrl %d0 47394: 60ca bras 47360 ... =============================================================================== 00047748 : int pthread_rwlock_init( pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr ) { 47748: 4e56 ffe8 linkw %fp,#-24 4774c: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 47750: 246e 0008 moveal %fp@(8),%a2 47754: 242e 000c movel %fp@(12),%d2 const pthread_rwlockattr_t *the_attr; /* * Error check parameters */ if ( !rwlock ) 47758: 4a8a tstl %a2 4775a: 670a beqs 47766 return EINVAL; /* * If the user passed in NULL, use the default attributes */ if ( attr ) { 4775c: 4a82 tstl %d2 4775e: 677e beqs 477de 47760: 2042 moveal %d2,%a0 } /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) 47762: 4a90 tstl %a0@ 47764: 660c bnes 47772 <== ALWAYS TAKEN switch ( the_attr->process_shared ) { case PTHREAD_PROCESS_PRIVATE: /* only supported values */ break; case PTHREAD_PROCESS_SHARED: default: return EINVAL; 47766: 7016 moveq #22,%d0 *rwlock = the_rwlock->Object.id; _Thread_Enable_dispatch(); return 0; } 47768: 4cee 0c04 ffe8 moveml %fp@(-24),%d2/%a2-%a3 4776e: 4e5e unlk %fp 47770: 4e75 rts * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) return EINVAL; switch ( the_attr->process_shared ) { 47772: 4aa8 0004 tstl %a0@(4) 47776: 66ee bnes 47766 <== NEVER TAKEN * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 47778: 2039 0006 3c6c movel 63c6c <_Thread_Dispatch_disable_level>,%d0 4777e: 5280 addql #1,%d0 47780: 23c0 0006 3c6c movel %d0,63c6c <_Thread_Dispatch_disable_level> return _Thread_Dispatch_disable_level; 47786: 2039 0006 3c6c movel 63c6c <_Thread_Dispatch_disable_level>,%d0 */ RTEMS_INLINE_ROUTINE void _CORE_RWLock_Initialize_attributes( CORE_RWLock_Attributes *the_attributes ) { the_attributes->XXX = 0; 4778c: 42ae fffc clrl %fp@(-4) * 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 *) 47790: 4879 0006 3dcc pea 63dcc <_POSIX_RWLock_Information> 47796: 4eb9 0004 a0e4 jsr 4a0e4 <_Objects_Allocate> */ _Thread_Disable_dispatch(); /* prevents deletion */ the_rwlock = _POSIX_RWLock_Allocate(); if ( !the_rwlock ) { 4779c: 588f addql #4,%sp 4779e: 2640 moveal %d0,%a3 477a0: 4a80 tstl %d0 477a2: 6758 beqs 477fc _Thread_Enable_dispatch(); return EAGAIN; } _CORE_RWLock_Initialize( &the_rwlock->RWLock, &the_attributes ); 477a4: 486e fffc pea %fp@(-4) 477a8: 486b 0010 pea %a3@(16) 477ac: 4eb9 0004 97ec jsr 497ec <_CORE_RWLock_Initialize> uint32_t name ) { _Objects_Set_local_object( information, _Objects_Get_index( the_object->id ), 477b2: 202b 0008 movel %a3@(8),%d0 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 477b6: 4281 clrl %d1 477b8: 2079 0006 3de4 moveal 63de4 <_POSIX_RWLock_Information+0x18>,%a0 477be: 3200 movew %d0,%d1 477c0: 218b 1c00 movel %a3,%a0@(00000000,%d1:l:4) _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 477c4: 42ab 000c clrl %a3@(12) &_POSIX_RWLock_Information, &the_rwlock->Object, 0 ); *rwlock = the_rwlock->Object.id; 477c8: 2480 movel %d0,%a2@ _Thread_Enable_dispatch(); 477ca: 4eb9 0004 b2f0 jsr 4b2f0 <_Thread_Enable_dispatch> return 0; 477d0: 508f addql #8,%sp 477d2: 4280 clrl %d0 } 477d4: 4cee 0c04 ffe8 moveml %fp@(-24),%d2/%a2-%a3 477da: 4e5e unlk %fp 477dc: 4e75 rts * If the user passed in NULL, use the default attributes */ if ( attr ) { the_attr = attr; } else { (void) pthread_rwlockattr_init( &default_attr ); 477de: 240e movel %fp,%d2 477e0: 0682 ffff fff4 addil #-12,%d2 477e6: 2f02 movel %d2,%sp@- 477e8: 4eb9 0004 822c jsr 4822c 477ee: 588f addql #4,%sp the_attr = &default_attr; 477f0: 2042 moveal %d2,%a0 } /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) 477f2: 4a90 tstl %a0@ 477f4: 6700 ff70 beqw 47766 477f8: 6000 ff78 braw 47772 _Thread_Disable_dispatch(); /* prevents deletion */ the_rwlock = _POSIX_RWLock_Allocate(); if ( !the_rwlock ) { _Thread_Enable_dispatch(); 477fc: 4eb9 0004 b2f0 jsr 4b2f0 <_Thread_Enable_dispatch> return EAGAIN; 47802: 700b moveq #11,%d0 *rwlock = the_rwlock->Object.id; _Thread_Enable_dispatch(); return 0; } 47804: 4cee 0c04 ffe8 moveml %fp@(-24),%d2/%a2-%a3 4780a: 4e5e unlk %fp ... =============================================================================== 0004787c : int pthread_rwlock_timedrdlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { 4787c: 4e56 ffec linkw %fp,#-20 47880: 48d7 040c moveml %d2-%d3/%a2,%sp@ 47884: 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 ) 47888: 4a8a tstl %a2 4788a: 6700 0082 beqw 4790e * * 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 ); 4788e: 486e fffc pea %fp@(-4) 47892: 2f2e 000c movel %fp@(12),%sp@- 47896: 4eb9 0004 e528 jsr 4e528 <_POSIX_Absolute_timeout_to_ticks> 4789c: 486e fff8 pea %fp@(-8) 478a0: 2400 movel %d0,%d2 478a2: 2f12 movel %a2@,%sp@- 478a4: 4879 0006 3dcc pea 63dcc <_POSIX_RWLock_Information> 478aa: 4eb9 0004 a5a8 jsr 4a5a8 <_Objects_Get> if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { 478b0: 4fef 0014 lea %sp@(20),%sp 478b4: 4aae fff8 tstl %fp@(-8) 478b8: 6654 bnes 4790e 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, 478ba: 7203 moveq #3,%d1 478bc: b282 cmpl %d2,%d1 478be: 57c3 seq %d3 case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_reading( 478c0: 42a7 clrl %sp@- 478c2: 2f2e fffc movel %fp@(-4),%sp@- 478c6: 4483 negl %d3 478c8: 4281 clrl %d1 478ca: 1203 moveb %d3,%d1 478cc: 2040 moveal %d0,%a0 478ce: 2f01 movel %d1,%sp@- 478d0: 2f12 movel %a2@,%sp@- 478d2: 4868 0010 pea %a0@(16) 478d6: 4eb9 0004 9820 jsr 49820 <_CORE_RWLock_Obtain_for_reading> do_wait, ticks, NULL ); _Thread_Enable_dispatch(); 478dc: 4eb9 0004 b2f0 jsr 4b2f0 <_Thread_Enable_dispatch> if ( !do_wait ) { if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) { 478e2: 2079 0006 40ce moveal 640ce <_Per_CPU_Information+0xc>,%a0 ticks, NULL ); _Thread_Enable_dispatch(); if ( !do_wait ) { 478e8: 4fef 0014 lea %sp@(20),%sp if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) { 478ec: 2028 0034 movel %a0@(52),%d0 ticks, NULL ); _Thread_Enable_dispatch(); if ( !do_wait ) { 478f0: 4a03 tstb %d3 478f2: 6606 bnes 478fa if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) { 478f4: 7202 moveq #2,%d1 478f6: b280 cmpl %d0,%d1 478f8: 6720 beqs 4791a status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; } } return _POSIX_RWLock_Translate_core_RWLock_return_code( 478fa: 2f00 movel %d0,%sp@- 478fc: 4eb9 0004 79ec jsr 479ec <_POSIX_RWLock_Translate_core_RWLock_return_code> 47902: 588f addql #4,%sp case OBJECTS_ERROR: break; } return EINVAL; } 47904: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 4790a: 4e5e unlk %fp 4790c: 4e75 rts _Thread_Enable_dispatch(); if ( !do_wait ) { if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) { if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID ) return EINVAL; 4790e: 7016 moveq #22,%d0 case OBJECTS_ERROR: break; } return EINVAL; } 47910: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 47916: 4e5e unlk %fp 47918: 4e75 rts ); _Thread_Enable_dispatch(); if ( !do_wait ) { if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) { if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID ) 4791a: 4a82 tstl %d2 4791c: 67f0 beqs 4790e <== NEVER TAKEN return EINVAL; if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST || 4791e: 5382 subql #1,%d2 47920: 123c 0001 moveb #1,%d1 47924: b282 cmpl %d2,%d1 47926: 65d2 bcss 478fa <== NEVER TAKEN status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; 47928: 7074 moveq #116,%d0 case OBJECTS_ERROR: break; } return EINVAL; } 4792a: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 47930: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00047934 : int pthread_rwlock_timedwrlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { 47934: 4e56 ffec linkw %fp,#-20 47938: 48d7 040c moveml %d2-%d3/%a2,%sp@ 4793c: 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 ) 47940: 4a8a tstl %a2 47942: 6700 0082 beqw 479c6 * * 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 ); 47946: 486e fffc pea %fp@(-4) 4794a: 2f2e 000c movel %fp@(12),%sp@- 4794e: 4eb9 0004 e528 jsr 4e528 <_POSIX_Absolute_timeout_to_ticks> 47954: 486e fff8 pea %fp@(-8) 47958: 2400 movel %d0,%d2 4795a: 2f12 movel %a2@,%sp@- 4795c: 4879 0006 3dcc pea 63dcc <_POSIX_RWLock_Information> 47962: 4eb9 0004 a5a8 jsr 4a5a8 <_Objects_Get> if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { 47968: 4fef 0014 lea %sp@(20),%sp 4796c: 4aae fff8 tstl %fp@(-8) 47970: 6654 bnes 479c6 (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, 47972: 7203 moveq #3,%d1 47974: b282 cmpl %d2,%d1 47976: 57c3 seq %d3 case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_writing( 47978: 42a7 clrl %sp@- 4797a: 2f2e fffc movel %fp@(-4),%sp@- 4797e: 4483 negl %d3 47980: 4281 clrl %d1 47982: 1203 moveb %d3,%d1 47984: 2040 moveal %d0,%a0 47986: 2f01 movel %d1,%sp@- 47988: 2f12 movel %a2@,%sp@- 4798a: 4868 0010 pea %a0@(16) 4798e: 4eb9 0004 98e0 jsr 498e0 <_CORE_RWLock_Obtain_for_writing> do_wait, ticks, NULL ); _Thread_Enable_dispatch(); 47994: 4eb9 0004 b2f0 jsr 4b2f0 <_Thread_Enable_dispatch> if ( !do_wait && (_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) { 4799a: 2079 0006 40ce moveal 640ce <_Per_CPU_Information+0xc>,%a0 ticks, NULL ); _Thread_Enable_dispatch(); if ( !do_wait && 479a0: 4fef 0014 lea %sp@(20),%sp (_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) { 479a4: 2028 0034 movel %a0@(52),%d0 ticks, NULL ); _Thread_Enable_dispatch(); if ( !do_wait && 479a8: 4a03 tstb %d3 479aa: 6606 bnes 479b2 479ac: 7202 moveq #2,%d1 479ae: b280 cmpl %d0,%d1 479b0: 6720 beqs 479d2 if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST || status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; } return _POSIX_RWLock_Translate_core_RWLock_return_code( 479b2: 2f00 movel %d0,%sp@- 479b4: 4eb9 0004 79ec jsr 479ec <_POSIX_RWLock_Translate_core_RWLock_return_code> 479ba: 588f addql #4,%sp case OBJECTS_ERROR: break; } return EINVAL; } 479bc: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 479c2: 4e5e unlk %fp 479c4: 4e75 rts _Thread_Enable_dispatch(); if ( !do_wait && (_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) { if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID ) return EINVAL; 479c6: 7016 moveq #22,%d0 case OBJECTS_ERROR: break; } return EINVAL; } 479c8: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 479ce: 4e5e unlk %fp 479d0: 4e75 rts ); _Thread_Enable_dispatch(); if ( !do_wait && (_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) { if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID ) 479d2: 4a82 tstl %d2 479d4: 67f0 beqs 479c6 <== NEVER TAKEN return EINVAL; if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST || 479d6: 5382 subql #1,%d2 479d8: 123c 0001 moveb #1,%d1 479dc: b282 cmpl %d2,%d1 479de: 65d2 bcss 479b2 <== NEVER TAKEN status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; 479e0: 7074 moveq #116,%d0 case OBJECTS_ERROR: break; } return EINVAL; } 479e2: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 479e8: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004824c : int pthread_rwlockattr_setpshared( pthread_rwlockattr_t *attr, int pshared ) { 4824c: 4e56 0000 linkw %fp,#0 48250: 206e 0008 moveal %fp@(8),%a0 if ( !attr ) 48254: 4a88 tstl %a0 48256: 6704 beqs 4825c return EINVAL; if ( !attr->is_initialized ) 48258: 4a90 tstl %a0@ 4825a: 6606 bnes 48262 case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; return 0; default: return EINVAL; 4825c: 7016 moveq #22,%d0 } } 4825e: 4e5e unlk %fp 48260: 4e75 rts return EINVAL; if ( !attr->is_initialized ) return EINVAL; switch ( pshared ) { 48262: 7001 moveq #1,%d0 48264: b0ae 000c cmpl %fp@(12),%d0 48268: 65f2 bcss 4825c <== NEVER TAKEN case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; 4826a: 202e 000c movel %fp@(12),%d0 return 0; default: return EINVAL; } } 4826e: 4e5e unlk %fp return EINVAL; switch ( pshared ) { case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; 48270: 2140 0004 movel %d0,%a0@(4) return 0; 48274: 4280 clrl %d0 <== NOT EXECUTED default: return EINVAL; } } =============================================================================== 0004947c : int pthread_setschedparam( pthread_t thread, int policy, struct sched_param *param ) { 4947c: 4e56 ffe0 linkw %fp,#-32 49480: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 49484: 282e 000c movel %fp@(12),%d4 49488: 262e 0010 movel %fp@(16),%d3 int rc; /* * Check all the parameters */ if ( !param ) 4948c: 6700 00b6 beqw 49544 return EINVAL; rc = _POSIX_Thread_Translate_sched_param( 49490: 486e fff8 pea %fp@(-8) 49494: 486e fff4 pea %fp@(-12) 49498: 2f03 movel %d3,%sp@- 4949a: 2f04 movel %d4,%sp@- 4949c: 4eb9 0004 f784 jsr 4f784 <_POSIX_Thread_Translate_sched_param> policy, param, &budget_algorithm, &budget_callout ); if ( rc ) 494a2: 4fef 0010 lea %sp@(16),%sp * Check all the parameters */ if ( !param ) return EINVAL; rc = _POSIX_Thread_Translate_sched_param( 494a6: 2400 movel %d0,%d2 policy, param, &budget_algorithm, &budget_callout ); if ( rc ) 494a8: 670c beqs 494b6 case OBJECTS_ERROR: break; } return ESRCH; } 494aa: 2002 movel %d2,%d0 494ac: 4cee 0c1c ffe0 moveml %fp@(-32),%d2-%d4/%a2-%a3 494b2: 4e5e unlk %fp 494b4: 4e75 rts return rc; /* * Actually change the scheduling policy and parameters */ the_thread = _Thread_Get( thread, &location ); 494b6: 486e fffc pea %fp@(-4) 494ba: 2f2e 0008 movel %fp@(8),%sp@- 494be: 4eb9 0004 c3d0 jsr 4c3d0 <_Thread_Get> switch ( location ) { 494c4: 508f addql #8,%sp return rc; /* * Actually change the scheduling policy and parameters */ the_thread = _Thread_Get( thread, &location ); 494c6: 2440 moveal %d0,%a2 switch ( location ) { 494c8: 4aae fffc tstl %fp@(-4) 494cc: 6600 0084 bnew 49552 case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 494d0: 266a 0102 moveal %a2@(258),%a3 if ( api->schedpolicy == SCHED_SPORADIC ) 494d4: 7004 moveq #4,%d0 494d6: b0ab 0084 cmpl %a3@(132),%d0 494da: 6700 00b8 beqw 49594 (void) _Watchdog_Remove( &api->Sporadic_timer ); api->schedpolicy = policy; api->schedparam = *param; 494de: 41eb 0088 lea %a3@(136),%a0 494e2: 2243 moveal %d3,%a1 api = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( api->schedpolicy == SCHED_SPORADIC ) (void) _Watchdog_Remove( &api->Sporadic_timer ); api->schedpolicy = policy; 494e4: 2744 0084 movel %d4,%a3@(132) api->schedparam = *param; 494e8: 20d9 movel %a1@+,%a0@+ 494ea: 20d9 movel %a1@+,%a0@+ 494ec: 20d9 movel %a1@+,%a0@+ 494ee: 20d9 movel %a1@+,%a0@+ 494f0: 20d9 movel %a1@+,%a0@+ 494f2: 20d9 movel %a1@+,%a0@+ 494f4: 2091 movel %a1@,%a0@ the_thread->budget_algorithm = budget_algorithm; 494f6: 256e fff4 007a movel %fp@(-12),%a2@(122) the_thread->budget_callout = budget_callout; 494fc: 256e fff8 007e movel %fp@(-8),%a2@(126) switch ( api->schedpolicy ) { 49502: 4a84 tstl %d4 49504: 6d2c blts 49532 <== NEVER TAKEN 49506: 7002 moveq #2,%d0 49508: b084 cmpl %d4,%d0 4950a: 6c54 bges 49560 4950c: 103c 0004 moveb #4,%d0 49510: b084 cmpl %d4,%d0 49512: 661e bnes 49532 <== NEVER TAKEN true ); break; case SCHED_SPORADIC: api->ss_high_priority = api->schedparam.sched_priority; 49514: 276b 0088 00a4 movel %a3@(136),%a3@(164) _Watchdog_Remove( &api->Sporadic_timer ); 4951a: 486b 00a8 pea %a3@(168) 4951e: 4eb9 0004 d484 jsr 4d484 <_Watchdog_Remove> _POSIX_Threads_Sporadic_budget_TSR( 0, the_thread ); 49524: 2f0a movel %a2,%sp@- 49526: 42a7 clrl %sp@- 49528: 4eb9 0004 932a jsr 4932a <_POSIX_Threads_Sporadic_budget_TSR> break; 4952e: 4fef 000c lea %sp@(12),%sp } _Thread_Enable_dispatch(); 49532: 4eb9 0004 c3a8 jsr 4c3a8 <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return ESRCH; } 49538: 2002 movel %d2,%d0 4953a: 4cee 0c1c ffe0 moveml %fp@(-32),%d2-%d4/%a2-%a3 49540: 4e5e unlk %fp 49542: 4e75 rts /* * Check all the parameters */ if ( !param ) return EINVAL; 49544: 7416 moveq #22,%d2 case OBJECTS_ERROR: break; } return ESRCH; } 49546: 2002 movel %d2,%d0 49548: 4cee 0c1c ffe0 moveml %fp@(-32),%d2-%d4/%a2-%a3 4954e: 4e5e unlk %fp 49550: 4e75 rts #endif case OBJECTS_ERROR: break; } return ESRCH; 49552: 7403 moveq #3,%d2 } 49554: 2002 movel %d2,%d0 49556: 4cee 0c1c ffe0 moveml %fp@(-32),%d2-%d4/%a2-%a3 4955c: 4e5e unlk %fp 4955e: 4e75 rts 49560: 4280 clrl %d0 49562: 1039 0006 454a moveb 6454a ,%d0 switch ( api->schedpolicy ) { case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; 49568: 41f9 0006 5f00 lea 65f00 <_Thread_Ticks_per_timeslice>,%a0 4956e: 90ab 0088 subl %a3@(136),%d0 49572: 2550 0076 movel %a0@,%a2@(118) the_thread->real_priority = 49576: 2540 0018 movel %d0,%a2@(24) _POSIX_Priority_To_core( api->schedparam.sched_priority ); _Thread_Change_priority( 4957a: 4878 0001 pea 1 4957e: 2f00 movel %d0,%sp@- 49580: 2f0a movel %a2,%sp@- 49582: 4eb9 0004 bec8 jsr 4bec8 <_Thread_Change_priority> the_thread, the_thread->real_priority, true ); break; 49588: 4fef 000c lea %sp@(12),%sp _Watchdog_Remove( &api->Sporadic_timer ); _POSIX_Threads_Sporadic_budget_TSR( 0, the_thread ); break; } _Thread_Enable_dispatch(); 4958c: 4eb9 0004 c3a8 jsr 4c3a8 <_Thread_Enable_dispatch> 49592: 60a4 bras 49538 case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( api->schedpolicy == SCHED_SPORADIC ) (void) _Watchdog_Remove( &api->Sporadic_timer ); 49594: 486b 00a8 pea %a3@(168) 49598: 4eb9 0004 d484 jsr 4d484 <_Watchdog_Remove> 4959e: 588f addql #4,%sp 495a0: 6000 ff3c braw 494de =============================================================================== 0004d8b0 : int pthread_sigmask( int how, const sigset_t *set, sigset_t *oset ) { 4d8b0: 4e56 0000 linkw %fp,#0 4d8b4: 202e 0008 movel %fp@(8),%d0 4d8b8: 2f0a movel %a2,%sp@- 4d8ba: 226e 000c moveal %fp@(12),%a1 4d8be: 246e 0010 moveal %fp@(16),%a2 POSIX_API_Control *api; if ( !set && !oset ) 4d8c2: 4a89 tstl %a1 4d8c4: 6700 0084 beqw 4d94a rtems_set_errno_and_return_minus_one( EINVAL ); api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 4d8c8: 2079 0006 30ba moveal 630ba <_Per_CPU_Information+0xc>,%a0 4d8ce: 2068 0102 moveal %a0@(258),%a0 if ( oset ) 4d8d2: 4a8a tstl %a2 4d8d4: 6708 beqs 4d8de *oset = api->signals_blocked; 4d8d6: 24a8 00d0 movel %a0@(208),%a2@ if ( !set ) 4d8da: 4a89 tstl %a1 4d8dc: 673a beqs 4d918 <== NEVER TAKEN return 0; switch ( how ) { 4d8de: 7201 moveq #1,%d1 4d8e0: b280 cmpl %d0,%d1 4d8e2: 675e beqs 4d942 4d8e4: 123c 0002 moveb #2,%d1 4d8e8: b280 cmpl %d0,%d1 4d8ea: 6736 beqs 4d922 4d8ec: 4a80 tstl %d0 4d8ee: 663c bnes 4d92c break; case SIG_UNBLOCK: api->signals_blocked &= ~*set; break; case SIG_SETMASK: api->signals_blocked = *set; 4d8f0: 2151 00d0 movel %a1@,%a0@(208) /* XXX are there critical section problems here? */ /* XXX evaluate the new set */ if ( ~api->signals_blocked & (api->signals_pending | _POSIX_signals_Pending) ) { 4d8f4: 2039 0006 32e8 movel 632e8 <_POSIX_signals_Pending>,%d0 /* XXX are there critical section problems here? */ /* XXX evaluate the new set */ if ( ~api->signals_blocked & 4d8fa: 2228 00d0 movel %a0@(208),%d1 4d8fe: 4681 notl %d1 (api->signals_pending | _POSIX_signals_Pending) ) { 4d900: 80a8 00d4 orl %a0@(212),%d0 /* XXX are there critical section problems here? */ /* XXX evaluate the new set */ if ( ~api->signals_blocked & 4d904: c081 andl %d1,%d0 4d906: 6710 beqs 4d918 (api->signals_pending | _POSIX_signals_Pending) ) { _Thread_Dispatch(); 4d908: 4eb9 0004 9ea4 jsr 49ea4 <_Thread_Dispatch> } return 0; } 4d90e: 246e fffc moveal %fp@(-4),%a2 if ( ~api->signals_blocked & (api->signals_pending | _POSIX_signals_Pending) ) { _Thread_Dispatch(); } return 0; 4d912: 4280 clrl %d0 } 4d914: 4e5e unlk %fp 4d916: 4e75 rts 4d918: 246e fffc moveal %fp@(-4),%a2 if ( ~api->signals_blocked & (api->signals_pending | _POSIX_signals_Pending) ) { _Thread_Dispatch(); } return 0; 4d91c: 4280 clrl %d0 } 4d91e: 4e5e unlk %fp 4d920: 4e75 rts switch ( how ) { case SIG_BLOCK: api->signals_blocked |= *set; break; case SIG_UNBLOCK: api->signals_blocked &= ~*set; 4d922: 2011 movel %a1@,%d0 4d924: 4680 notl %d0 4d926: c1a8 00d0 andl %d0,%a0@(208) break; 4d92a: 60c8 bras 4d8f4 case SIG_SETMASK: api->signals_blocked = *set; break; default: rtems_set_errno_and_return_minus_one( EINVAL ); 4d92c: 4eb9 0004 ffa8 jsr 4ffa8 <__errno> (api->signals_pending | _POSIX_signals_Pending) ) { _Thread_Dispatch(); } return 0; } 4d932: 246e fffc moveal %fp@(-4),%a2 break; case SIG_SETMASK: api->signals_blocked = *set; break; default: rtems_set_errno_and_return_minus_one( EINVAL ); 4d936: 2040 moveal %d0,%a0 4d938: 7216 moveq #22,%d1 4d93a: 70ff moveq #-1,%d0 (api->signals_pending | _POSIX_signals_Pending) ) { _Thread_Dispatch(); } return 0; } 4d93c: 4e5e unlk %fp break; case SIG_SETMASK: api->signals_blocked = *set; break; default: rtems_set_errno_and_return_minus_one( EINVAL ); 4d93e: 2081 movel %d1,%a0@ (api->signals_pending | _POSIX_signals_Pending) ) { _Thread_Dispatch(); } return 0; } 4d940: 4e75 rts if ( !set ) return 0; switch ( how ) { case SIG_BLOCK: api->signals_blocked |= *set; 4d942: 2011 movel %a1@,%d0 4d944: 81a8 00d0 orl %d0,%a0@(208) break; 4d948: 60aa bras 4d8f4 sigset_t *oset ) { POSIX_API_Control *api; if ( !set && !oset ) 4d94a: 4a8a tstl %a2 4d94c: 67de beqs 4d92c rtems_set_errno_and_return_minus_one( EINVAL ); api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 4d94e: 2079 0006 30ba moveal 630ba <_Per_CPU_Information+0xc>,%a0 4d954: 2068 0102 moveal %a0@(258),%a0 if ( oset ) *oset = api->signals_blocked; 4d958: 24a8 00d0 movel %a0@(208),%a2@ if ( !set ) 4d95c: 4a89 tstl %a1 4d95e: 6600 ff7e bnew 4d8de 4d962: 60b4 bras 4d918 =============================================================================== 00046f78 : /* * 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183 */ void pthread_testcancel( void ) { 46f78: 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() ) 46f7c: 4ab9 0006 23d0 tstl 623d0 <_Per_CPU_Information+0x8> 46f82: 6642 bnes 46fc6 <== NEVER TAKEN * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 46f84: 2039 0006 1f72 movel 61f72 <_Thread_Dispatch_disable_level>,%d0 46f8a: 5280 addql #1,%d0 return; thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 46f8c: 2079 0006 23d4 moveal 623d4 <_Per_CPU_Information+0xc>,%a0 46f92: 23c0 0006 1f72 movel %d0,61f72 <_Thread_Dispatch_disable_level> 46f98: 2068 0102 moveal %a0@(258),%a0 return _Thread_Dispatch_disable_level; 46f9c: 2039 0006 1f72 movel 61f72 <_Thread_Dispatch_disable_level>,%d0 _Thread_Disable_dispatch(); if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 46fa2: 4aa8 00d8 tstl %a0@(216) 46fa6: 6622 bnes 46fca <== NEVER TAKEN 46fa8: 4aa8 00e0 tstl %a0@(224) 46fac: 671c beqs 46fca thread_support->cancelation_requested ) cancel = true; _Thread_Enable_dispatch(); 46fae: 4eb9 0004 9d00 jsr 49d00 <_Thread_Enable_dispatch> if ( cancel ) _POSIX_Thread_Exit( _Thread_Executing, PTHREAD_CANCELED ); 46fb4: 4878 ffff pea ffffffff 46fb8: 2f39 0006 23d4 movel 623d4 <_Per_CPU_Information+0xc>,%sp@- 46fbe: 4eb9 0004 d1d4 jsr 4d1d4 <_POSIX_Thread_Exit> 46fc4: 508f addql #8,%sp <== NOT EXECUTED } 46fc6: 4e5e unlk %fp <== NOT EXECUTED 46fc8: 4e75 rts <== NOT EXECUTED 46fca: 4e5e unlk %fp _Thread_Disable_dispatch(); if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && thread_support->cancelation_requested ) cancel = true; _Thread_Enable_dispatch(); 46fcc: 4ef9 0004 9d00 jmp 49d00 <_Thread_Enable_dispatch> ... =============================================================================== 00047a9e : * errno - otherwise */ int rtems_aio_enqueue (rtems_aio_request *req) { 47a9e: 4e56 ffc4 linkw %fp,#-60 47aa2: 48d7 3c0c moveml %d2-%d3/%a2-%a5,%sp@ struct sched_param param; /* The queue should be initialized */ AIO_assert (aio_request_queue.initialized == AIO_QUEUE_INITIALIZED); result = pthread_mutex_lock (&aio_request_queue.mutex); 47aa6: 4879 0006 3de8 pea 63de8 47aac: 47f9 0004 8510 lea 48510 ,%a3 * errno - otherwise */ int rtems_aio_enqueue (rtems_aio_request *req) { 47ab2: 246e 0008 moveal %fp@(8),%a2 struct sched_param param; /* The queue should be initialized */ AIO_assert (aio_request_queue.initialized == AIO_QUEUE_INITIALIZED); result = pthread_mutex_lock (&aio_request_queue.mutex); 47ab6: 4e93 jsr %a3@ if (result != 0) { 47ab8: 588f addql #4,%sp struct sched_param param; /* The queue should be initialized */ AIO_assert (aio_request_queue.initialized == AIO_QUEUE_INITIALIZED); result = pthread_mutex_lock (&aio_request_queue.mutex); 47aba: 2400 movel %d0,%d2 if (result != 0) { 47abc: 6600 00ba bnew 47b78 return result; } /* _POSIX_PRIORITIZED_IO and _POSIX_PRIORITY_SCHEDULING are defined, we can use aio_reqprio to lower the priority of the request */ pthread_getschedparam (pthread_self(), &policy, ¶m); 47ac0: 49f9 0004 8e38 lea 48e38 ,%a4 47ac6: 4e94 jsr %a4@ 47ac8: 486e ffdc pea %fp@(-36) 47acc: 486e fffc pea %fp@(-4) 47ad0: 2f00 movel %d0,%sp@- 47ad2: 4eb9 0004 89a8 jsr 489a8 req->caller_thread = pthread_self (); 47ad8: 4e94 jsr %a4@ req->priority = param.sched_priority - req->aiocbp->aio_reqprio; 47ada: 206a 0014 moveal %a2@(20),%a0 req->policy = policy; req->aiocbp->error_code = EINPROGRESS; req->aiocbp->return_value = 0; if ((aio_request_queue.idle_threads == 0) && 47ade: 4fef 000c lea %sp@(12),%sp /* _POSIX_PRIORITIZED_IO and _POSIX_PRIORITY_SCHEDULING are defined, we can use aio_reqprio to lower the priority of the request */ pthread_getschedparam (pthread_self(), &policy, ¶m); req->caller_thread = pthread_self (); req->priority = param.sched_priority - req->aiocbp->aio_reqprio; 47ae2: 222e ffdc movel %fp@(-36),%d1 47ae6: 92a8 0014 subl %a0@(20),%d1 req->policy = policy; 47aea: 256e fffc 0008 movel %fp@(-4),%a2@(8) /* _POSIX_PRIORITIZED_IO and _POSIX_PRIORITY_SCHEDULING are defined, we can use aio_reqprio to lower the priority of the request */ pthread_getschedparam (pthread_self(), &policy, ¶m); req->caller_thread = pthread_self (); 47af0: 2540 0010 movel %d0,%a2@(16) req->priority = param.sched_priority - req->aiocbp->aio_reqprio; req->policy = policy; req->aiocbp->error_code = EINPROGRESS; 47af4: 7077 moveq #119,%d0 /* _POSIX_PRIORITIZED_IO and _POSIX_PRIORITY_SCHEDULING are defined, we can use aio_reqprio to lower the priority of the request */ pthread_getschedparam (pthread_self(), &policy, ¶m); req->caller_thread = pthread_self (); req->priority = param.sched_priority - req->aiocbp->aio_reqprio; 47af6: 2541 000c movel %d1,%a2@(12) req->policy = policy; req->aiocbp->error_code = EINPROGRESS; 47afa: 2140 0030 movel %d0,%a0@(48) req->aiocbp->return_value = 0; 47afe: 42a8 0034 clrl %a0@(52) if ((aio_request_queue.idle_threads == 0) && 47b02: 4ab9 0006 3e50 tstl 63e50 47b08: 660a bnes 47b14 <== NEVER TAKEN 47b0a: 7204 moveq #4,%d1 47b0c: b2b9 0006 3e4c cmpl 63e4c ,%d1 47b12: 6c7a bges 47b8e else { /* the maximum number of threads has been already created even though some of them might be idle. The request belongs to one of the active fd chain */ r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, 47b14: 42a7 clrl %sp@- 47b16: 2f10 movel %a0@,%sp@- 47b18: 4bf9 0004 75c2 lea 475c2 ,%a5 47b1e: 4879 0006 3e30 pea 63e30 47b24: 4e95 jsr %a5@ req->aiocbp->aio_fildes, 0); if (r_chain != NULL) 47b26: 4fef 000c lea %sp@(12),%sp else { /* the maximum number of threads has been already created even though some of them might be idle. The request belongs to one of the active fd chain */ r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, 47b2a: 2840 moveal %d0,%a4 req->aiocbp->aio_fildes, 0); if (r_chain != NULL) 47b2c: 4a80 tstl %d0 47b2e: 6700 00e0 beqw 47c10 { pthread_mutex_lock (&r_chain->mutex); 47b32: 260c movel %a4,%d3 47b34: 0683 0000 001c addil #28,%d3 rtems_aio_insert_prio (&r_chain->perfd, req); pthread_cond_signal (&r_chain->cond); pthread_mutex_unlock (&r_chain->mutex); 47b3a: 4bf9 0004 85ac lea 485ac ,%a5 The request belongs to one of the active fd chain */ r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, req->aiocbp->aio_fildes, 0); if (r_chain != NULL) { pthread_mutex_lock (&r_chain->mutex); 47b40: 2f03 movel %d3,%sp@- 47b42: 4e93 jsr %a3@ rtems_aio_insert_prio (&r_chain->perfd, req); 47b44: 2f0a movel %a2,%sp@- 47b46: 486c 0008 pea %a4@(8) 47b4a: 4eb9 0004 7992 jsr 47992 pthread_cond_signal (&r_chain->cond); 47b50: 486c 0020 pea %a4@(32) 47b54: 4eb9 0004 8098 jsr 48098 pthread_mutex_unlock (&r_chain->mutex); 47b5a: 2f03 movel %d3,%sp@- 47b5c: 4e95 jsr %a5@ 47b5e: 4fef 0014 lea %sp@(20),%sp if (aio_request_queue.idle_threads > 0) pthread_cond_signal (&aio_request_queue.new_req); } } pthread_mutex_unlock (&aio_request_queue.mutex); 47b62: 4879 0006 3de8 pea 63de8 47b68: 4e95 jsr %a5@ return 0; 47b6a: 588f addql #4,%sp } 47b6c: 2002 movel %d2,%d0 47b6e: 4cee 3c0c ffc4 moveml %fp@(-60),%d2-%d3/%a2-%a5 47b74: 4e5e unlk %fp 47b76: 4e75 rts /* The queue should be initialized */ AIO_assert (aio_request_queue.initialized == AIO_QUEUE_INITIALIZED); result = pthread_mutex_lock (&aio_request_queue.mutex); if (result != 0) { free (req); 47b78: 2f0a movel %a2,%sp@- <== NOT EXECUTED 47b7a: 4eb9 0004 3c9c jsr 43c9c <== NOT EXECUTED return result; 47b80: 588f addql #4,%sp <== NOT EXECUTED } } pthread_mutex_unlock (&aio_request_queue.mutex); return 0; } 47b82: 2002 movel %d2,%d0 <== NOT EXECUTED 47b84: 4cee 3c0c ffc4 moveml %fp@(-60),%d2-%d3/%a2-%a5 <== NOT EXECUTED 47b8a: 4e5e unlk %fp <== NOT EXECUTED 47b8c: 4e75 rts <== NOT EXECUTED if ((aio_request_queue.idle_threads == 0) && aio_request_queue.active_threads < AIO_MAX_THREADS) /* we still have empty places on the active_threads chain */ { chain = &aio_request_queue.work_req; r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1); 47b8e: 4878 0001 pea 1 47b92: 2f10 movel %a0@,%sp@- 47b94: 4879 0006 3e30 pea 63e30 47b9a: 4eb9 0004 75c2 jsr 475c2 if (r_chain->new_fd == 1) { 47ba0: 4fef 000c lea %sp@(12),%sp if ((aio_request_queue.idle_threads == 0) && aio_request_queue.active_threads < AIO_MAX_THREADS) /* we still have empty places on the active_threads chain */ { chain = &aio_request_queue.work_req; r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1); 47ba4: 2840 moveal %d0,%a4 if (r_chain->new_fd == 1) { 47ba6: 7001 moveq #1,%d0 47ba8: b0ac 0018 cmpl %a4@(24),%d0 47bac: 6684 bnes 47b32 RTEMS_INLINE_ROUTINE void _Chain_Prepend( Chain_Control *the_chain, Chain_Node *the_node ) { _Chain_Insert(_Chain_Head(the_chain), the_node); 47bae: 2f0a movel %a2,%sp@- 47bb0: 486c 0008 pea %a4@(8) 47bb4: 4eb9 0004 a124 jsr 4a124 <_Chain_Insert> rtems_chain_prepend (&r_chain->perfd, &req->next_prio); r_chain->new_fd = 0; 47bba: 42ac 0018 clrl %a4@(24) pthread_mutex_init (&r_chain->mutex, NULL); 47bbe: 42a7 clrl %sp@- 47bc0: 486c 001c pea %a4@(28) 47bc4: 4eb9 0004 83d8 jsr 483d8 pthread_cond_init (&r_chain->cond, NULL); 47bca: 42a7 clrl %sp@- 47bcc: 486c 0020 pea %a4@(32) 47bd0: 4eb9 0004 7fd4 jsr 47fd4 AIO_printf ("New thread \n"); result = pthread_create (&thid, &aio_request_queue.attr, 47bd6: 2f0c movel %a4,%sp@- 47bd8: 487a fb20 pea %pc@(476fa ) 47bdc: 4879 0006 3df0 pea 63df0 47be2: 486e fff8 pea %fp@(-8) 47be6: 4eb9 0004 872c jsr 4872c rtems_aio_handle, (void *) r_chain); if (result != 0) { 47bec: 4fef 0028 lea %sp@(40),%sp 47bf0: 4a80 tstl %d0 47bf2: 6600 00b4 bnew 47ca8 if (aio_request_queue.idle_threads > 0) pthread_cond_signal (&aio_request_queue.new_req); } } pthread_mutex_unlock (&aio_request_queue.mutex); 47bf6: 4879 0006 3de8 pea 63de8 rtems_aio_handle, (void *) r_chain); if (result != 0) { pthread_mutex_unlock (&aio_request_queue.mutex); return result; } ++aio_request_queue.active_threads; 47bfc: 52b9 0006 3e4c addql #1,63e4c 47c02: 4bf9 0004 85ac lea 485ac ,%a5 if (aio_request_queue.idle_threads > 0) pthread_cond_signal (&aio_request_queue.new_req); } } pthread_mutex_unlock (&aio_request_queue.mutex); 47c08: 4e95 jsr %a5@ return 0; 47c0a: 588f addql #4,%sp 47c0c: 6000 ff5e braw 47b6c } else { /* or to the idle chain */ chain = &aio_request_queue.idle_req; r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1); 47c10: 4878 0001 pea 1 47c14: 206a 0014 moveal %a2@(20),%a0 47c18: 2f10 movel %a0@,%sp@- 47c1a: 4879 0006 3e3c pea 63e3c 47c20: 4e95 jsr %a5@ if (r_chain->new_fd == 1) { 47c22: 4fef 000c lea %sp@(12),%sp 47c26: 7201 moveq #1,%d1 } else { /* or to the idle chain */ chain = &aio_request_queue.idle_req; r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1); 47c28: 2640 moveal %d0,%a3 if (r_chain->new_fd == 1) { 47c2a: b2ab 0018 cmpl %a3@(24),%d1 47c2e: 673a beqs 47c6a r_chain->new_fd = 0; pthread_mutex_init (&r_chain->mutex, NULL); pthread_cond_init (&r_chain->cond, NULL); } else /* just insert the request in the existing fd chain */ rtems_aio_insert_prio (&r_chain->perfd, req); 47c30: 2f0a movel %a2,%sp@- 47c32: 486b 0008 pea %a3@(8) 47c36: 4bf9 0004 85ac lea 485ac ,%a5 47c3c: 4eb9 0004 7992 jsr 47992 47c42: 508f addql #8,%sp if (aio_request_queue.idle_threads > 0) 47c44: 4ab9 0006 3e50 tstl 63e50 47c4a: 6f00 ff16 blew 47b62 pthread_cond_signal (&aio_request_queue.new_req); 47c4e: 4879 0006 3dec pea 63dec <== NOT EXECUTED 47c54: 4eb9 0004 8098 jsr 48098 <== NOT EXECUTED 47c5a: 588f addql #4,%sp <== NOT EXECUTED } } pthread_mutex_unlock (&aio_request_queue.mutex); 47c5c: 4879 0006 3de8 pea 63de8 <== NOT EXECUTED 47c62: 4e95 jsr %a5@ <== NOT EXECUTED return 0; 47c64: 588f addql #4,%sp <== NOT EXECUTED 47c66: 6000 ff04 braw 47b6c <== NOT EXECUTED 47c6a: 2f0a movel %a2,%sp@- 47c6c: 486b 0008 pea %a3@(8) 47c70: 4bf9 0004 85ac lea 485ac ,%a5 47c76: 4eb9 0004 a124 jsr 4a124 <_Chain_Insert> if (r_chain->new_fd == 1) { /* If this is a new fd chain we signal the idle threads that might be waiting for requests */ AIO_printf (" New chain on waiting queue \n "); rtems_chain_prepend (&r_chain->perfd, &req->next_prio); r_chain->new_fd = 0; 47c7c: 42ab 0018 clrl %a3@(24) pthread_mutex_init (&r_chain->mutex, NULL); 47c80: 42a7 clrl %sp@- 47c82: 486b 001c pea %a3@(28) 47c86: 4eb9 0004 83d8 jsr 483d8 pthread_cond_init (&r_chain->cond, NULL); 47c8c: 42a7 clrl %sp@- 47c8e: 486b 0020 pea %a3@(32) 47c92: 4eb9 0004 7fd4 jsr 47fd4 47c98: 4fef 0018 lea %sp@(24),%sp } else /* just insert the request in the existing fd chain */ rtems_aio_insert_prio (&r_chain->perfd, req); if (aio_request_queue.idle_threads > 0) 47c9c: 4ab9 0006 3e50 tstl 63e50 47ca2: 6eaa bgts 47c4e <== NEVER TAKEN 47ca4: 6000 febc braw 47b62 AIO_printf ("New thread \n"); result = pthread_create (&thid, &aio_request_queue.attr, rtems_aio_handle, (void *) r_chain); if (result != 0) { pthread_mutex_unlock (&aio_request_queue.mutex); 47ca8: 4879 0006 3de8 pea 63de8 <== NOT EXECUTED return result; 47cae: 2400 movel %d0,%d2 <== NOT EXECUTED AIO_printf ("New thread \n"); result = pthread_create (&thid, &aio_request_queue.attr, rtems_aio_handle, (void *) r_chain); if (result != 0) { pthread_mutex_unlock (&aio_request_queue.mutex); 47cb0: 4eb9 0004 85ac jsr 485ac <== NOT EXECUTED return result; 47cb6: 588f addql #4,%sp <== NOT EXECUTED } } pthread_mutex_unlock (&aio_request_queue.mutex); return 0; } 47cb8: 2002 movel %d2,%d0 <== NOT EXECUTED 47cba: 4cee 3c0c ffc4 moveml %fp@(-60),%d2-%d3/%a2-%a5 <== NOT EXECUTED 47cc0: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000476fa : * NULL - if error */ static void * rtems_aio_handle (void *arg) { 476fa: 4e56 ffb0 linkw %fp,#-80 476fe: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ rtems_aio_request_chain *r_chain = arg; 47702: 286e 0008 moveal %fp@(8),%a4 47706: 2a3c 0004 8510 movel #296208,%d5 4770c: 240c movel %a4,%d2 node = rtems_chain_first (chain); req = (rtems_aio_request *) node; /* See _POSIX_PRIORITIZE_IO and _POSIX_PRIORITY_SCHEDULING discussion in rtems_aio_enqueue () */ pthread_getschedparam (pthread_self(), &policy, ¶m); 4770e: 260e movel %fp,%d3 47710: 2c0e movel %fp,%d6 47712: 0682 0000 001c addil #28,%d2 /* acquire the mutex of the current fd chain. we don't need to lock the queue mutex since we can add requests to idle fd chains or even active ones if the working request has been extracted from the chain */ result = pthread_mutex_lock (&r_chain->mutex); 47718: 2e05 movel %d5,%d7 struct timespec timeout; AIO_printf ("Chain is empty [WQ], wait for work\n"); pthread_mutex_unlock (&r_chain->mutex); 4771a: 4bf9 0004 85ac lea 485ac ,%a5 node = rtems_chain_first (chain); req = (rtems_aio_request *) node; /* See _POSIX_PRIORITIZE_IO and _POSIX_PRIORITY_SCHEDULING discussion in rtems_aio_enqueue () */ pthread_getschedparam (pthread_self(), &policy, ¶m); 47720: 0683 ffff ffd8 addil #-40,%d3 47726: 5986 subql #4,%d6 /* acquire the mutex of the current fd chain. we don't need to lock the queue mutex since we can add requests to idle fd chains or even active ones if the working request has been extracted from the chain */ result = pthread_mutex_lock (&r_chain->mutex); 47728: 2f02 movel %d2,%sp@- 4772a: 2045 moveal %d5,%a0 4772c: 4e90 jsr %a0@ if (result != 0) 4772e: 588f addql #4,%sp 47730: 4a80 tstl %d0 47732: 6600 008e bnew 477c2 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 47736: 200c movel %a4,%d0 47738: 0680 0000 000c addil #12,%d0 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 4773e: 246c 0008 moveal %a4@(8),%a2 /* If the locked chain is not empty, take the first request extract it, unlock the chain and process the request, in this way the user can supply more requests to this fd chain */ if (!rtems_chain_is_empty (chain)) { 47742: b08a cmpl %a2,%d0 47744: 6700 00e6 beqw 4782c node = rtems_chain_first (chain); req = (rtems_aio_request *) node; /* See _POSIX_PRIORITIZE_IO and _POSIX_PRIORITY_SCHEDULING discussion in rtems_aio_enqueue () */ pthread_getschedparam (pthread_self(), &policy, ¶m); 47748: 47f9 0004 8e38 lea 48e38 ,%a3 4774e: 4e93 jsr %a3@ 47750: 2f03 movel %d3,%sp@- 47752: 2f06 movel %d6,%sp@- 47754: 2f00 movel %d0,%sp@- 47756: 4eb9 0004 89a8 jsr 489a8 param.sched_priority = req->priority; 4775c: 2d6a 000c ffd8 movel %a2@(12),%fp@(-40) pthread_setschedparam (pthread_self(), req->policy, ¶m); 47762: 282a 0008 movel %a2@(8),%d4 47766: 4e93 jsr %a3@ 47768: 2f03 movel %d3,%sp@- 4776a: 2f04 movel %d4,%sp@- 4776c: 2f00 movel %d0,%sp@- 4776e: 4eb9 0004 8e4c jsr 48e4c */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 47774: 2f0a movel %a2,%sp@- 47776: 4eb9 0004 a0c0 jsr 4a0c0 <_Chain_Extract> rtems_chain_extract (node); pthread_mutex_unlock (&r_chain->mutex); 4777c: 2f02 movel %d2,%sp@- 4777e: 4e95 jsr %a5@ switch (req->aiocbp->aio_lio_opcode) { 47780: 266a 0014 moveal %a2@(20),%a3 47784: 4fef 0020 lea %sp@(32),%sp 47788: 7202 moveq #2,%d1 4778a: 202b 002c movel %a3@(44),%d0 4778e: b280 cmpl %d0,%d1 47790: 677c beqs 4780e 47792: 123c 0003 moveb #3,%d1 47796: b280 cmpl %d0,%d1 47798: 6768 beqs 47802 <== NEVER TAKEN 4779a: 123c 0001 moveb #1,%d1 4779e: b280 cmpl %d0,%d1 477a0: 672c beqs 477ce <== ALWAYS TAKEN default: result = -1; } if (result == -1) { req->aiocbp->return_value = -1; 477a2: 70ff moveq #-1,%d0 <== NOT EXECUTED 477a4: 2740 0034 movel %d0,%a3@(52) <== NOT EXECUTED req->aiocbp->error_code = errno; 477a8: 4eb9 0005 1b40 jsr 51b40 <__errno> <== NOT EXECUTED 477ae: 2040 moveal %d0,%a0 <== NOT EXECUTED 477b0: 2750 0030 movel %a0@,%a3@(48) <== NOT EXECUTED /* acquire the mutex of the current fd chain. we don't need to lock the queue mutex since we can add requests to idle fd chains or even active ones if the working request has been extracted from the chain */ result = pthread_mutex_lock (&r_chain->mutex); 477b4: 2f02 movel %d2,%sp@- <== NOT EXECUTED 477b6: 2045 moveal %d5,%a0 <== NOT EXECUTED 477b8: 4e90 jsr %a0@ <== NOT EXECUTED if (result != 0) 477ba: 588f addql #4,%sp <== NOT EXECUTED 477bc: 4a80 tstl %d0 <== NOT EXECUTED 477be: 6700 ff76 beqw 47736 <== NOT EXECUTED } } AIO_printf ("Thread finished\n"); return NULL; } 477c2: 4280 clrl %d0 <== NOT EXECUTED 477c4: 4cee 3cfc ffb0 moveml %fp@(-80),%d2-%d7/%a2-%a5 <== NOT EXECUTED 477ca: 4e5e unlk %fp <== NOT EXECUTED 477cc: 4e75 rts <== NOT EXECUTED pthread_mutex_unlock (&r_chain->mutex); switch (req->aiocbp->aio_lio_opcode) { case LIO_READ: AIO_printf ("read\n"); result = pread (req->aiocbp->aio_fildes, 477ce: 2f2b 0008 movel %a3@(8),%sp@- 477d2: 2f2b 0004 movel %a3@(4),%sp@- 477d6: 2f2b 0010 movel %a3@(16),%sp@- 477da: 2f2b 000c movel %a3@(12),%sp@- 477de: 2f13 movel %a3@,%sp@- 477e0: 4eb9 0005 2560 jsr 52560 (void *) req->aiocbp->aio_buf, req->aiocbp->aio_nbytes, req->aiocbp->aio_offset); break; 477e6: 4fef 0014 lea %sp@(20),%sp break; default: result = -1; } if (result == -1) { 477ea: 72ff moveq #-1,%d1 477ec: b280 cmpl %d0,%d1 477ee: 6700 0168 beqw 47958 req->aiocbp->return_value = -1; req->aiocbp->error_code = errno; } else { req->aiocbp->return_value = result; 477f2: 206a 0014 moveal %a2@(20),%a0 477f6: 2140 0034 movel %d0,%a0@(52) req->aiocbp->error_code = 0; 477fa: 42a8 0030 clrl %a0@(48) 477fe: 6000 ff28 braw 47728 req->aiocbp->aio_nbytes, req->aiocbp->aio_offset); break; case LIO_SYNC: AIO_printf ("sync\n"); result = fsync (req->aiocbp->aio_fildes); 47802: 2f13 movel %a3@,%sp@- <== NOT EXECUTED 47804: 4eb9 0004 e88c jsr 4e88c <== NOT EXECUTED break; 4780a: 588f addql #4,%sp <== NOT EXECUTED 4780c: 60dc bras 477ea <== NOT EXECUTED req->aiocbp->aio_nbytes, req->aiocbp->aio_offset); break; case LIO_WRITE: AIO_printf ("write\n"); result = pwrite (req->aiocbp->aio_fildes, 4780e: 2f2b 0008 movel %a3@(8),%sp@- 47812: 2f2b 0004 movel %a3@(4),%sp@- 47816: 2f2b 0010 movel %a3@(16),%sp@- 4781a: 2f2b 000c movel %a3@(12),%sp@- 4781e: 2f13 movel %a3@,%sp@- 47820: 4eb9 0005 2624 jsr 52624 (void *) req->aiocbp->aio_buf, req->aiocbp->aio_nbytes, req->aiocbp->aio_offset); break; 47826: 4fef 0014 lea %sp@(20),%sp 4782a: 60be bras 477ea struct timespec timeout; AIO_printf ("Chain is empty [WQ], wait for work\n"); pthread_mutex_unlock (&r_chain->mutex); 4782c: 2f02 movel %d2,%sp@- 4782e: 4e95 jsr %a5@ pthread_mutex_lock (&aio_request_queue.mutex); 47830: 4879 0006 3de8 pea 63de8 47836: 2047 moveal %d7,%a0 47838: 4e90 jsr %a0@ if (rtems_chain_is_empty (chain)) 4783a: 508f addql #8,%sp 4783c: b5ec 0008 cmpal %a4@(8),%a2 47840: 670e beqs 47850 <== ALWAYS TAKEN } } /* If there was a request added in the initial fd chain then release the mutex and process it */ pthread_mutex_unlock (&aio_request_queue.mutex); 47842: 4879 0006 3de8 pea 63de8 <== NOT EXECUTED 47848: 4e95 jsr %a5@ <== NOT EXECUTED 4784a: 588f addql #4,%sp <== NOT EXECUTED 4784c: 6000 feda braw 47728 <== NOT EXECUTED pthread_mutex_unlock (&r_chain->mutex); pthread_mutex_lock (&aio_request_queue.mutex); if (rtems_chain_is_empty (chain)) { clock_gettime (CLOCK_REALTIME, &timeout); 47850: 486e fff4 pea %fp@(-12) timeout.tv_sec += 3; timeout.tv_nsec = 0; result = pthread_cond_timedwait (&r_chain->cond, 47854: 280c movel %a4,%d4 pthread_mutex_unlock (&r_chain->mutex); pthread_mutex_lock (&aio_request_queue.mutex); if (rtems_chain_is_empty (chain)) { clock_gettime (CLOCK_REALTIME, &timeout); 47856: 4878 0001 pea 1 timeout.tv_sec += 3; timeout.tv_nsec = 0; result = pthread_cond_timedwait (&r_chain->cond, 4785a: 0684 0000 0020 addil #32,%d4 47860: 45f9 0004 8114 lea 48114 ,%a2 pthread_mutex_unlock (&r_chain->mutex); pthread_mutex_lock (&aio_request_queue.mutex); if (rtems_chain_is_empty (chain)) { clock_gettime (CLOCK_REALTIME, &timeout); 47866: 4eb9 0004 7e64 jsr 47e64 timeout.tv_sec += 3; timeout.tv_nsec = 0; result = pthread_cond_timedwait (&r_chain->cond, 4786c: 486e fff4 pea %fp@(-12) pthread_mutex_lock (&aio_request_queue.mutex); if (rtems_chain_is_empty (chain)) { clock_gettime (CLOCK_REALTIME, &timeout); timeout.tv_sec += 3; 47870: 56ae fff4 addql #3,%fp@(-12) timeout.tv_nsec = 0; result = pthread_cond_timedwait (&r_chain->cond, 47874: 4879 0006 3de8 pea 63de8 if (rtems_chain_is_empty (chain)) { clock_gettime (CLOCK_REALTIME, &timeout); timeout.tv_sec += 3; timeout.tv_nsec = 0; 4787a: 42ae fff8 clrl %fp@(-8) result = pthread_cond_timedwait (&r_chain->cond, 4787e: 2f04 movel %d4,%sp@- 47880: 4e92 jsr %a2@ &aio_request_queue.mutex, &timeout); /* If no requests were added to the chain we delete the fd chain from the queue and start working with idle fd chains */ if (result == ETIMEDOUT) { 47882: 4fef 0014 lea %sp@(20),%sp 47886: 7274 moveq #116,%d1 47888: b280 cmpl %d0,%d1 4788a: 66b6 bnes 47842 <== NEVER TAKEN 4788c: 2f0c movel %a4,%sp@- 4788e: 47f9 0004 a0c0 lea 4a0c0 <_Chain_Extract>,%a3 47894: 4e93 jsr %a3@ rtems_chain_extract (&r_chain->next_fd); pthread_mutex_destroy (&r_chain->mutex); 47896: 2f02 movel %d2,%sp@- 47898: 4eb9 0004 8264 jsr 48264 pthread_cond_destroy (&r_chain->cond); 4789e: 2f04 movel %d4,%sp@- 478a0: 4eb9 0004 7ee4 jsr 47ee4 free (r_chain); 478a6: 2f0c movel %a4,%sp@- 478a8: 4eb9 0004 3c9c jsr 43c9c 478ae: 2879 0006 3e3c moveal 63e3c ,%a4 /* If the idle chain is empty sleep for 3 seconds and wait for a signal. The thread now becomes idle. */ if (rtems_chain_is_empty (&aio_request_queue.idle_req)) { 478b4: 4fef 0010 lea %sp@(16),%sp 478b8: b9fc 0006 3e40 cmpal #409152,%a4 478be: 6730 beqs 478f0 } } /* Otherwise move this chain to the working chain and start the loop all over again */ AIO_printf ("Work on idle\n"); --aio_request_queue.idle_threads; 478c0: 53b9 0006 3e50 subql #1,63e50 478c6: 240c movel %a4,%d2 ++aio_request_queue.active_threads; 478c8: 52b9 0006 3e4c addql #1,63e4c 478ce: 0682 0000 001c addil #28,%d2 478d4: 2f0c movel %a4,%sp@- 478d6: 4e93 jsr %a3@ node = rtems_chain_first (&aio_request_queue.idle_req); rtems_chain_extract (node); r_chain = (rtems_aio_request_chain *) node; rtems_aio_move_to_work (r_chain); 478d8: 2f0c movel %a4,%sp@- 478da: 4eb9 0004 7698 jsr 47698 478e0: 508f addql #8,%sp } } /* If there was a request added in the initial fd chain then release the mutex and process it */ pthread_mutex_unlock (&aio_request_queue.mutex); 478e2: 4879 0006 3de8 pea 63de8 478e8: 4e95 jsr %a5@ 478ea: 588f addql #4,%sp 478ec: 6000 fe3a braw 47728 if (rtems_chain_is_empty (&aio_request_queue.idle_req)) { AIO_printf ("Chain is empty [IQ], wait for work\n"); ++aio_request_queue.idle_threads; --aio_request_queue.active_threads; clock_gettime (CLOCK_REALTIME, &timeout); 478f0: 486e fff4 pea %fp@(-12) /* If the idle chain is empty sleep for 3 seconds and wait for a signal. The thread now becomes idle. */ if (rtems_chain_is_empty (&aio_request_queue.idle_req)) { AIO_printf ("Chain is empty [IQ], wait for work\n"); ++aio_request_queue.idle_threads; 478f4: 52b9 0006 3e50 addql #1,63e50 --aio_request_queue.active_threads; 478fa: 53b9 0006 3e4c subql #1,63e4c clock_gettime (CLOCK_REALTIME, &timeout); 47900: 4878 0001 pea 1 47904: 4eb9 0004 7e64 jsr 47e64 timeout.tv_sec += 3; timeout.tv_nsec = 0; result = pthread_cond_timedwait (&aio_request_queue.new_req, 4790a: 486e fff4 pea %fp@(-12) AIO_printf ("Chain is empty [IQ], wait for work\n"); ++aio_request_queue.idle_threads; --aio_request_queue.active_threads; clock_gettime (CLOCK_REALTIME, &timeout); timeout.tv_sec += 3; 4790e: 56ae fff4 addql #3,%fp@(-12) timeout.tv_nsec = 0; result = pthread_cond_timedwait (&aio_request_queue.new_req, 47912: 4879 0006 3de8 pea 63de8 47918: 4879 0006 3dec pea 63dec ++aio_request_queue.idle_threads; --aio_request_queue.active_threads; clock_gettime (CLOCK_REALTIME, &timeout); timeout.tv_sec += 3; timeout.tv_nsec = 0; 4791e: 42ae fff8 clrl %fp@(-8) result = pthread_cond_timedwait (&aio_request_queue.new_req, 47922: 4e92 jsr %a2@ &aio_request_queue.mutex, &timeout); /* If no new fd chain was added in the idle requests then this thread is finished */ if (result == ETIMEDOUT) { 47924: 4fef 0014 lea %sp@(20),%sp 47928: 7274 moveq #116,%d1 4792a: b280 cmpl %d0,%d1 4792c: 6744 beqs 47972 <== ALWAYS TAKEN 4792e: 2879 0006 3e3c moveal 63e3c ,%a4 <== NOT EXECUTED } } /* Otherwise move this chain to the working chain and start the loop all over again */ AIO_printf ("Work on idle\n"); --aio_request_queue.idle_threads; 47934: 53b9 0006 3e50 subql #1,63e50 <== NOT EXECUTED 4793a: 240c movel %a4,%d2 <== NOT EXECUTED ++aio_request_queue.active_threads; 4793c: 52b9 0006 3e4c addql #1,63e4c <== NOT EXECUTED 47942: 0682 0000 001c addil #28,%d2 <== NOT EXECUTED 47948: 2f0c movel %a4,%sp@- <== NOT EXECUTED 4794a: 4e93 jsr %a3@ <== NOT EXECUTED node = rtems_chain_first (&aio_request_queue.idle_req); rtems_chain_extract (node); r_chain = (rtems_aio_request_chain *) node; rtems_aio_move_to_work (r_chain); 4794c: 2f0c movel %a4,%sp@- <== NOT EXECUTED 4794e: 4eb9 0004 7698 jsr 47698 <== NOT EXECUTED 47954: 508f addql #8,%sp <== NOT EXECUTED 47956: 608a bras 478e2 <== NOT EXECUTED break; default: result = -1; } if (result == -1) { 47958: 266a 0014 moveal %a2@(20),%a3 <== NOT EXECUTED req->aiocbp->return_value = -1; 4795c: 70ff moveq #-1,%d0 <== NOT EXECUTED 4795e: 2740 0034 movel %d0,%a3@(52) <== NOT EXECUTED req->aiocbp->error_code = errno; 47962: 4eb9 0005 1b40 jsr 51b40 <__errno> <== NOT EXECUTED 47968: 2040 moveal %d0,%a0 <== NOT EXECUTED 4796a: 2750 0030 movel %a0@,%a3@(48) <== NOT EXECUTED 4796e: 6000 fe44 braw 477b4 <== NOT EXECUTED /* If no new fd chain was added in the idle requests then this thread is finished */ if (result == ETIMEDOUT) { AIO_printf ("Etimeout\n"); --aio_request_queue.idle_threads; pthread_mutex_unlock (&aio_request_queue.mutex); 47972: 4879 0006 3de8 pea 63de8 /* If no new fd chain was added in the idle requests then this thread is finished */ if (result == ETIMEDOUT) { AIO_printf ("Etimeout\n"); --aio_request_queue.idle_threads; 47978: 53b9 0006 3e50 subql #1,63e50 pthread_mutex_unlock (&aio_request_queue.mutex); 4797e: 4eb9 0004 85ac jsr 485ac return NULL; 47984: 588f addql #4,%sp } } AIO_printf ("Thread finished\n"); return NULL; } 47986: 4280 clrl %d0 47988: 4cee 3cfc ffb0 moveml %fp@(-80),%d2-%d7/%a2-%a5 4798e: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00047444 : * 0 - if initialization succeeded */ int rtems_aio_init (void) { 47444: 4e56 0000 linkw %fp,#0 47448: 2f02 movel %d2,%sp@- int result = 0; result = pthread_attr_init (&aio_request_queue.attr); 4744a: 4879 0006 3df0 pea 63df0 47450: 4eb9 0004 86d4 jsr 486d4 if (result != 0) 47456: 588f addql #4,%sp int rtems_aio_init (void) { int result = 0; result = pthread_attr_init (&aio_request_queue.attr); 47458: 2400 movel %d0,%d2 if (result != 0) 4745a: 670a beqs 47466 <== ALWAYS TAKEN aio_request_queue.active_threads = 0; aio_request_queue.idle_threads = 0; aio_request_queue.initialized = AIO_QUEUE_INITIALIZED; return result; } 4745c: 2002 movel %d2,%d0 <== NOT EXECUTED 4745e: 242e fffc movel %fp@(-4),%d2 <== NOT EXECUTED 47462: 4e5e unlk %fp <== NOT EXECUTED 47464: 4e75 rts <== NOT EXECUTED result = pthread_attr_init (&aio_request_queue.attr); if (result != 0) return result; result = 47466: 42a7 clrl %sp@- 47468: 4879 0006 3df0 pea 63df0 4746e: 4eb9 0004 8700 jsr 48700 pthread_attr_setdetachstate (&aio_request_queue.attr, PTHREAD_CREATE_DETACHED); if (result != 0) 47474: 508f addql #8,%sp 47476: 4a80 tstl %d0 47478: 6600 0122 bnew 4759c pthread_attr_destroy (&aio_request_queue.attr); result = pthread_mutex_init (&aio_request_queue.mutex, NULL); 4747c: 42a7 clrl %sp@- 4747e: 4879 0006 3de8 pea 63de8 47484: 4eb9 0004 83d8 jsr 483d8 if (result != 0) 4748a: 508f addql #8,%sp 4748c: 4a80 tstl %d0 4748e: 6600 00e4 bnew 47574 pthread_attr_destroy (&aio_request_queue.attr); result = pthread_cond_init (&aio_request_queue.new_req, NULL); 47492: 42a7 clrl %sp@- 47494: 4879 0006 3dec pea 63dec 4749a: 4eb9 0004 7fd4 jsr 47fd4 if (result != 0) { 474a0: 508f addql #8,%sp result = pthread_mutex_init (&aio_request_queue.mutex, NULL); if (result != 0) pthread_attr_destroy (&aio_request_queue.attr); result = pthread_cond_init (&aio_request_queue.new_req, NULL); 474a2: 2400 movel %d0,%d2 if (result != 0) { 474a4: 665e bnes 47504 <== NEVER TAKEN { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; 474a6: 42b9 0006 3e34 clrl 63e34 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 474ac: 203c 0006 3e34 movel #409140,%d0 474b2: 23c0 0006 3e30 movel %d0,63e30 head->previous = NULL; tail->previous = head; 474b8: 203c 0006 3e30 movel #409136,%d0 474be: 23c0 0006 3e38 movel %d0,63e38 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 474c4: 203c 0006 3e40 movel #409152,%d0 474ca: 23c0 0006 3e3c movel %d0,63e3c head->previous = NULL; tail->previous = head; 474d0: 203c 0006 3e3c movel #409148,%d0 474d6: 23c0 0006 3e44 movel %d0,63e44 rtems_chain_initialize_empty (&aio_request_queue.work_req); rtems_chain_initialize_empty (&aio_request_queue.idle_req); aio_request_queue.active_threads = 0; aio_request_queue.idle_threads = 0; aio_request_queue.initialized = AIO_QUEUE_INITIALIZED; 474dc: 203c 0000 b00b movel #45067,%d0 { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; 474e2: 42b9 0006 3e40 clrl 63e40 } rtems_chain_initialize_empty (&aio_request_queue.work_req); rtems_chain_initialize_empty (&aio_request_queue.idle_req); aio_request_queue.active_threads = 0; 474e8: 42b9 0006 3e4c clrl 63e4c aio_request_queue.idle_threads = 0; 474ee: 42b9 0006 3e50 clrl 63e50 aio_request_queue.initialized = AIO_QUEUE_INITIALIZED; 474f4: 23c0 0006 3e48 movel %d0,63e48 return result; } 474fa: 2002 movel %d2,%d0 474fc: 242e fffc movel %fp@(-4),%d2 47500: 4e5e unlk %fp 47502: 4e75 rts pthread_attr_destroy (&aio_request_queue.attr); result = pthread_cond_init (&aio_request_queue.new_req, NULL); if (result != 0) { pthread_mutex_destroy (&aio_request_queue.mutex); 47504: 4879 0006 3de8 pea 63de8 <== NOT EXECUTED 4750a: 4eb9 0004 8264 jsr 48264 <== NOT EXECUTED pthread_attr_destroy (&aio_request_queue.attr); 47510: 4879 0006 3df0 pea 63df0 <== NOT EXECUTED 47516: 4eb9 0004 86b4 jsr 486b4 <== NOT EXECUTED 4751c: 508f addql #8,%sp <== NOT EXECUTED ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 4751e: 203c 0006 3e34 movel #409140,%d0 <== NOT EXECUTED 47524: 23c0 0006 3e30 movel %d0,63e30 <== NOT EXECUTED head->previous = NULL; tail->previous = head; 4752a: 203c 0006 3e30 movel #409136,%d0 <== NOT EXECUTED 47530: 23c0 0006 3e38 movel %d0,63e38 <== NOT EXECUTED ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 47536: 203c 0006 3e40 movel #409152,%d0 <== NOT EXECUTED 4753c: 23c0 0006 3e3c movel %d0,63e3c <== NOT EXECUTED head->previous = NULL; tail->previous = head; 47542: 203c 0006 3e3c movel #409148,%d0 <== NOT EXECUTED 47548: 23c0 0006 3e44 movel %d0,63e44 <== NOT EXECUTED rtems_chain_initialize_empty (&aio_request_queue.work_req); rtems_chain_initialize_empty (&aio_request_queue.idle_req); aio_request_queue.active_threads = 0; aio_request_queue.idle_threads = 0; aio_request_queue.initialized = AIO_QUEUE_INITIALIZED; 4754e: 203c 0000 b00b movel #45067,%d0 <== NOT EXECUTED { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; 47554: 42b9 0006 3e34 clrl 63e34 <== NOT EXECUTED 4755a: 42b9 0006 3e40 clrl 63e40 <== NOT EXECUTED } rtems_chain_initialize_empty (&aio_request_queue.work_req); rtems_chain_initialize_empty (&aio_request_queue.idle_req); aio_request_queue.active_threads = 0; 47560: 42b9 0006 3e4c clrl 63e4c <== NOT EXECUTED aio_request_queue.idle_threads = 0; 47566: 42b9 0006 3e50 clrl 63e50 <== NOT EXECUTED aio_request_queue.initialized = AIO_QUEUE_INITIALIZED; 4756c: 23c0 0006 3e48 movel %d0,63e48 <== NOT EXECUTED 47572: 6086 bras 474fa <== NOT EXECUTED pthread_attr_destroy (&aio_request_queue.attr); result = pthread_mutex_init (&aio_request_queue.mutex, NULL); if (result != 0) pthread_attr_destroy (&aio_request_queue.attr); 47574: 4879 0006 3df0 pea 63df0 <== NOT EXECUTED 4757a: 4eb9 0004 86b4 jsr 486b4 <== NOT EXECUTED 47580: 588f addql #4,%sp <== NOT EXECUTED result = pthread_cond_init (&aio_request_queue.new_req, NULL); 47582: 42a7 clrl %sp@- <== NOT EXECUTED 47584: 4879 0006 3dec pea 63dec <== NOT EXECUTED 4758a: 4eb9 0004 7fd4 jsr 47fd4 <== NOT EXECUTED if (result != 0) { 47590: 508f addql #8,%sp <== NOT EXECUTED result = pthread_mutex_init (&aio_request_queue.mutex, NULL); if (result != 0) pthread_attr_destroy (&aio_request_queue.attr); result = pthread_cond_init (&aio_request_queue.new_req, NULL); 47592: 2400 movel %d0,%d2 <== NOT EXECUTED if (result != 0) { 47594: 6700 ff10 beqw 474a6 <== NOT EXECUTED 47598: 6000 ff6a braw 47504 <== NOT EXECUTED result = pthread_attr_setdetachstate (&aio_request_queue.attr, PTHREAD_CREATE_DETACHED); if (result != 0) pthread_attr_destroy (&aio_request_queue.attr); 4759c: 4879 0006 3df0 pea 63df0 <== NOT EXECUTED 475a2: 4eb9 0004 86b4 jsr 486b4 <== NOT EXECUTED 475a8: 588f addql #4,%sp <== NOT EXECUTED result = pthread_mutex_init (&aio_request_queue.mutex, NULL); 475aa: 42a7 clrl %sp@- <== NOT EXECUTED 475ac: 4879 0006 3de8 pea 63de8 <== NOT EXECUTED 475b2: 4eb9 0004 83d8 jsr 483d8 <== NOT EXECUTED if (result != 0) 475b8: 508f addql #8,%sp <== NOT EXECUTED 475ba: 4a80 tstl %d0 <== NOT EXECUTED 475bc: 6700 fed4 beqw 47492 <== NOT EXECUTED 475c0: 60b2 bras 47574 <== NOT EXECUTED =============================================================================== 00047992 : * NONE */ void rtems_aio_insert_prio (rtems_chain_control *chain, rtems_aio_request *req) { 47992: 4e56 fff4 linkw %fp,#-12 47996: 202e 0008 movel %fp@(8),%d0 4799a: 48d7 1c00 moveml %a2-%a4,%sp@ */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 4799e: 2440 moveal %d0,%a2 479a0: 266e 000c moveal %fp@(12),%a3 479a4: 205a moveal %a2@+,%a0 rtems_chain_node *node; AIO_printf ("FD exists \n"); node = rtems_chain_first (chain); if (rtems_chain_is_empty (chain)) { 479a6: b5c8 cmpal %a0,%a2 479a8: 672c beqs 479d6 <== NEVER TAKEN rtems_chain_prepend (chain, &req->next_prio); } else { AIO_printf ("Add by priority \n"); int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio; while (req->aiocbp->aio_reqprio > prio && 479aa: 286b 0014 moveal %a3@(20),%a4 if (rtems_chain_is_empty (chain)) { AIO_printf ("First in chain \n"); rtems_chain_prepend (chain, &req->next_prio); } else { AIO_printf ("Add by priority \n"); int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio; 479ae: 2268 0014 moveal %a0@(20),%a1 while (req->aiocbp->aio_reqprio > prio && 479b2: 202c 0014 movel %a4@(20),%d0 479b6: b0a9 0014 cmpl %a1@(20),%d0 479ba: 6f10 bles 479cc <== ALWAYS TAKEN } } AIO_printf ("Thread finished\n"); return NULL; } 479bc: 2050 moveal %a0@,%a0 <== NOT EXECUTED int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio; while (req->aiocbp->aio_reqprio > prio && !rtems_chain_is_tail (chain, node)) { node = rtems_chain_next (node); prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio; 479be: 2268 0014 moveal %a0@(20),%a1 <== NOT EXECUTED rtems_chain_prepend (chain, &req->next_prio); } else { AIO_printf ("Add by priority \n"); int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio; while (req->aiocbp->aio_reqprio > prio && 479c2: b0a9 0014 cmpl %a1@(20),%d0 <== NOT EXECUTED 479c6: 6f04 bles 479cc <== NOT EXECUTED 479c8: b5c8 cmpal %a0,%a2 <== NOT EXECUTED 479ca: 66f0 bnes 479bc <== NOT EXECUTED RTEMS_INLINE_ROUTINE void rtems_chain_insert( rtems_chain_node *after_node, rtems_chain_node *the_node ) { _Chain_Insert( after_node, the_node ); 479cc: 2d4b 000c movel %a3,%fp@(12) 479d0: 2d68 0004 0008 movel %a0@(4),%fp@(8) } rtems_chain_insert (node->previous, &req->next_prio); } } 479d6: 4cd7 1c00 moveml %sp@,%a2-%a4 479da: 4e5e unlk %fp 479dc: 4ef9 0004 a124 jmp 4a124 <_Chain_Insert> =============================================================================== 00047698 : * NONE */ void rtems_aio_move_to_work (rtems_aio_request_chain *r_chain) { 47698: 4e56 0000 linkw %fp,#0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 4769c: 2279 0006 3e30 moveal 63e30 ,%a1 476a2: 2f0a movel %a2,%sp@- 476a4: 246e 0008 moveal %fp@(8),%a2 rtems_chain_node *node; node = rtems_chain_first (&aio_request_queue.work_req); temp = (rtems_aio_request_chain *) node; while (temp->fildes < r_chain->fildes && 476a8: 202a 0014 movel %a2@(20),%d0 476ac: b0a9 0014 cmpl %a1@(20),%d0 476b0: 6f30 bles 476e2 <== NEVER TAKEN 476b2: b3fc 0006 3e34 cmpal #409140,%a1 476b8: 6728 beqs 476e2 <== NEVER TAKEN } } AIO_printf ("Thread finished\n"); return NULL; } 476ba: 2051 moveal %a1@,%a0 rtems_chain_node *node; node = rtems_chain_first (&aio_request_queue.work_req); temp = (rtems_aio_request_chain *) node; while (temp->fildes < r_chain->fildes && 476bc: b0a8 0014 cmpl %a0@(20),%d0 476c0: 6f0a bles 476cc 476c2: 2248 moveal %a0,%a1 476c4: b1fc 0006 3e34 cmpal #409140,%a0 476ca: 66ee bnes 476ba <== ALWAYS TAKEN 476cc: 2f0a movel %a2,%sp@- 476ce: 2f28 0004 movel %a0@(4),%sp@- 476d2: 4eb9 0004 a124 jsr 4a124 <_Chain_Insert> node = rtems_chain_next (node); temp = (rtems_aio_request_chain *) node; } rtems_chain_insert (rtems_chain_previous (node), &r_chain->next_fd); } 476d8: 246e fffc moveal %fp@(-4),%a2 476dc: 508f addql #8,%sp 476de: 4e5e unlk %fp 476e0: 4e75 rts rtems_chain_node *node; node = rtems_chain_first (&aio_request_queue.work_req); temp = (rtems_aio_request_chain *) node; while (temp->fildes < r_chain->fildes && 476e2: 2049 moveal %a1,%a0 <== NOT EXECUTED 476e4: 2f0a movel %a2,%sp@- <== NOT EXECUTED 476e6: 2f28 0004 movel %a0@(4),%sp@- <== NOT EXECUTED 476ea: 4eb9 0004 a124 jsr 4a124 <_Chain_Insert> <== NOT EXECUTED node = rtems_chain_next (node); temp = (rtems_aio_request_chain *) node; } rtems_chain_insert (rtems_chain_previous (node), &r_chain->next_fd); } 476f0: 246e fffc moveal %fp@(-4),%a2 <== NOT EXECUTED 476f4: 508f addql #8,%sp <== NOT EXECUTED 476f6: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000479e2 : * Output parameters: * NONE */ void rtems_aio_remove_fd (rtems_aio_request_chain *r_chain) { 479e2: 4e56 ffec linkw %fp,#-20 479e6: 206e 0008 moveal %fp@(8),%a0 479ea: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@ RTEMS_INLINE_ROUTINE bool _Chain_Is_tail( Chain_Control *the_chain, const Chain_Node *the_node ) { return (the_node == _Chain_Tail(the_chain)); 479ee: 2608 movel %a0,%d3 479f0: 0683 0000 000c addil #12,%d3 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 479f6: 2468 0008 moveal %a0@(8),%a2 rtems_chain_control *chain; rtems_chain_node *node; chain = &r_chain->perfd; node = rtems_chain_first (chain); while (!rtems_chain_is_tail (chain, node)) 479fa: b68a cmpl %a2,%d3 479fc: 6732 beqs 47a30 <== NEVER TAKEN 479fe: 49f9 0004 a0c0 lea 4a0c0 <_Chain_Extract>,%a4 47a04: 47f9 0004 3c9c lea 43c9c ,%a3 */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 47a0a: 2f0a movel %a2,%sp@- 47a0c: 4e94 jsr %a4@ } } AIO_printf ("Thread finished\n"); return NULL; } 47a0e: 2412 movel %a2@,%d2 while (!rtems_chain_is_tail (chain, node)) { rtems_chain_extract (node); rtems_aio_request *req = (rtems_aio_request *) node; node = rtems_chain_next (node); req->aiocbp->error_code = ECANCELED; 47a10: 203c 0000 008c movel #140,%d0 47a16: 206a 0014 moveal %a2@(20),%a0 47a1a: 2140 0030 movel %d0,%a0@(48) req->aiocbp->return_value = -1; 47a1e: 70ff moveq #-1,%d0 47a20: 2140 0034 movel %d0,%a0@(52) free (req); 47a24: 2f0a movel %a2,%sp@- while (!rtems_chain_is_tail (chain, node)) { rtems_chain_extract (node); rtems_aio_request *req = (rtems_aio_request *) node; node = rtems_chain_next (node); 47a26: 2442 moveal %d2,%a2 req->aiocbp->error_code = ECANCELED; req->aiocbp->return_value = -1; free (req); 47a28: 4e93 jsr %a3@ rtems_chain_control *chain; rtems_chain_node *node; chain = &r_chain->perfd; node = rtems_chain_first (chain); while (!rtems_chain_is_tail (chain, node)) 47a2a: 508f addql #8,%sp 47a2c: b682 cmpl %d2,%d3 47a2e: 66da bnes 47a0a node = rtems_chain_next (node); req->aiocbp->error_code = ECANCELED; req->aiocbp->return_value = -1; free (req); } } 47a30: 4cee 1c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a4 47a36: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00047a3a : * AIO_NOTCANCELED - if request was not canceled * AIO_CANCELED - if request was canceled */ int rtems_aio_remove_req (rtems_chain_control *chain, struct aiocb *aiocbp) { 47a3a: 4e56 0000 linkw %fp,#0 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 47a3e: 206e 0008 moveal %fp@(8),%a0 47a42: 2f0a movel %a2,%sp@- 47a44: 202e 000c movel %fp@(12),%d0 47a48: 2458 moveal %a0@+,%a2 if (rtems_chain_is_empty (chain)) 47a4a: b1ca cmpal %a2,%a0 47a4c: 6716 beqs 47a64 rtems_chain_node *node = rtems_chain_first (chain); rtems_aio_request *current; current = (rtems_aio_request *) node; while (!rtems_chain_is_tail (chain, node) && current->aiocbp != aiocbp) { 47a4e: b0aa 0014 cmpl %a2@(20),%d0 47a52: 671a beqs 47a6e <== ALWAYS TAKEN } } AIO_printf ("Thread finished\n"); return NULL; } 47a54: 2452 moveal %a2@,%a2 <== NOT EXECUTED rtems_chain_node *node = rtems_chain_first (chain); rtems_aio_request *current; current = (rtems_aio_request *) node; while (!rtems_chain_is_tail (chain, node) && current->aiocbp != aiocbp) { 47a56: b1ca cmpal %a2,%a0 <== NOT EXECUTED 47a58: 66f4 bnes 47a4e <== NOT EXECUTED current->aiocbp->return_value = -1; free (current); } return AIO_CANCELED; } 47a5a: 246e fffc moveal %fp@(-4),%a2 <== NOT EXECUTED node = rtems_chain_next (node); current = (rtems_aio_request *) node; } if (rtems_chain_is_tail (chain, node)) return AIO_NOTCANCELED; 47a5e: 7001 moveq #1,%d0 <== NOT EXECUTED current->aiocbp->return_value = -1; free (current); } return AIO_CANCELED; } 47a60: 4e5e unlk %fp <== NOT EXECUTED 47a62: 4e75 rts <== NOT EXECUTED 47a64: 246e fffc moveal %fp@(-4),%a2 */ int rtems_aio_remove_req (rtems_chain_control *chain, struct aiocb *aiocbp) { if (rtems_chain_is_empty (chain)) return AIO_ALLDONE; 47a68: 7002 moveq #2,%d0 current->aiocbp->return_value = -1; free (current); } return AIO_CANCELED; } 47a6a: 4e5e unlk %fp 47a6c: 4e75 rts 47a6e: 2f0a movel %a2,%sp@- 47a70: 4eb9 0004 a0c0 jsr 4a0c0 <_Chain_Extract> if (rtems_chain_is_tail (chain, node)) return AIO_NOTCANCELED; else { rtems_chain_extract (node); current->aiocbp->error_code = ECANCELED; 47a76: 206a 0014 moveal %a2@(20),%a0 47a7a: 203c 0000 008c movel #140,%d0 47a80: 2140 0030 movel %d0,%a0@(48) current->aiocbp->return_value = -1; 47a84: 70ff moveq #-1,%d0 47a86: 2140 0034 movel %d0,%a0@(52) free (current); 47a8a: 2f0a movel %a2,%sp@- 47a8c: 4eb9 0004 3c9c jsr 43c9c } return AIO_CANCELED; } 47a92: 246e fffc moveal %fp@(-4),%a2 current->aiocbp->error_code = ECANCELED; current->aiocbp->return_value = -1; free (current); } return AIO_CANCELED; 47a96: 508f addql #8,%sp 47a98: 4280 clrl %d0 } 47a9a: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004f450 : */ rtems_status_code rtems_barrier_delete( rtems_id id ) { 4f450: 4e56 fff8 linkw %fp,#-8 RTEMS_INLINE_ROUTINE Barrier_Control *_Barrier_Get ( Objects_Id id, Objects_Locations *location ) { return (Barrier_Control *) 4f454: 486e fffc pea %fp@(-4) 4f458: 2f2e 0008 movel %fp@(8),%sp@- 4f45c: 4879 0006 3f68 pea 63f68 <_Barrier_Information> 4f462: 4eb9 0004 a68c jsr 4a68c <_Objects_Get> Barrier_Control *the_barrier; Objects_Locations location; the_barrier = _Barrier_Get( id, &location ); switch ( location ) { 4f468: 4fef 000c lea %sp@(12),%sp 4f46c: 4aae fffc tstl %fp@(-4) 4f470: 664a bnes 4f4bc <== NEVER TAKEN case OBJECTS_LOCAL: _CORE_barrier_Flush( 4f472: 4878 0002 pea 2 4f476: 2040 moveal %d0,%a0 4f478: 42a7 clrl %sp@- 4f47a: 4868 0014 pea %a0@(20) 4f47e: 2d40 fff8 movel %d0,%fp@(-8) 4f482: 4eb9 0004 bb50 jsr 4bb50 <_Thread_queue_Flush> &the_barrier->Barrier, NULL, CORE_BARRIER_WAS_DELETED ); _Objects_Close( &_Barrier_Information, &the_barrier->Object ); 4f488: 202e fff8 movel %fp@(-8),%d0 4f48c: 2f00 movel %d0,%sp@- 4f48e: 4879 0006 3f68 pea 63f68 <_Barrier_Information> 4f494: 4eb9 0004 a258 jsr 4a258 <_Objects_Close> */ RTEMS_INLINE_ROUTINE void _Barrier_Free ( Barrier_Control *the_barrier ) { _Objects_Free( &_Barrier_Information, &the_barrier->Object ); 4f49a: 202e fff8 movel %fp@(-8),%d0 4f49e: 2f00 movel %d0,%sp@- 4f4a0: 4879 0006 3f68 pea 63f68 <_Barrier_Information> 4f4a6: 4eb9 0004 a518 jsr 4a518 <_Objects_Free> _Barrier_Free( the_barrier ); _Thread_Enable_dispatch(); 4f4ac: 4eb9 0004 b404 jsr 4b404 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 4f4b2: 4fef 001c lea %sp@(28),%sp 4f4b6: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4f4b8: 4e5e unlk %fp 4f4ba: 4e75 rts #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 4f4bc: 7004 moveq #4,%d0 } 4f4be: 4e5e unlk %fp ... =============================================================================== 00047448 : rtems_chain_control *chain, rtems_chain_node *node, rtems_id task, rtems_event_set events ) { 47448: 4e56 0000 linkw %fp,#0 4744c: 2f03 movel %d3,%sp@- 4744e: 262e 0014 movel %fp@(20),%d3 47452: 2f02 movel %d2,%sp@- RTEMS_INLINE_ROUTINE bool rtems_chain_append_with_empty_check( rtems_chain_control *chain, rtems_chain_node *node ) { return _Chain_Append_with_empty_check( chain, node ); 47454: 2f2e 000c movel %fp@(12),%sp@- 47458: 2f2e 0008 movel %fp@(8),%sp@- 4745c: 242e 0010 movel %fp@(16),%d2 47460: 4eb9 0004 7a28 jsr 47a28 <_Chain_Append_with_empty_check> rtems_status_code sc = RTEMS_SUCCESSFUL; bool was_empty = rtems_chain_append_with_empty_check( chain, node ); if ( was_empty ) { 47466: 508f addql #8,%sp 47468: 4a00 tstb %d0 4746a: 660e bnes 4747a sc = rtems_event_send( task, events ); } return sc; } 4746c: 242e fff8 movel %fp@(-8),%d2 47470: 4280 clrl %d0 47472: 262e fffc movel %fp@(-4),%d3 47476: 4e5e unlk %fp 47478: 4e75 rts { rtems_status_code sc = RTEMS_SUCCESSFUL; bool was_empty = rtems_chain_append_with_empty_check( chain, node ); if ( was_empty ) { sc = rtems_event_send( task, events ); 4747a: 2d43 000c movel %d3,%fp@(12) } return sc; } 4747e: 262e fffc movel %fp@(-4),%d3 { rtems_status_code sc = RTEMS_SUCCESSFUL; bool was_empty = rtems_chain_append_with_empty_check( chain, node ); if ( was_empty ) { sc = rtems_event_send( task, events ); 47482: 2d42 0008 movel %d2,%fp@(8) } return sc; } 47486: 242e fff8 movel %fp@(-8),%d2 4748a: 4e5e unlk %fp { rtems_status_code sc = RTEMS_SUCCESSFUL; bool was_empty = rtems_chain_append_with_empty_check( chain, node ); if ( was_empty ) { sc = rtems_event_send( task, events ); 4748c: 4ef9 0004 6968 jmp 46968 ... =============================================================================== 00047494 : rtems_chain_control *chain, rtems_id task, rtems_event_set events, rtems_chain_node **node ) { 47494: 4e56 0000 linkw %fp,#0 47498: 2f03 movel %d3,%sp@- 4749a: 262e 0010 movel %fp@(16),%d3 4749e: 2f02 movel %d2,%sp@- RTEMS_INLINE_ROUTINE bool rtems_chain_get_with_empty_check( rtems_chain_control *chain, rtems_chain_node **node ) { return _Chain_Get_with_empty_check( chain, node ); 474a0: 2f2e 0014 movel %fp@(20),%sp@- 474a4: 2f2e 0008 movel %fp@(8),%sp@- 474a8: 242e 000c movel %fp@(12),%d2 474ac: 4eb9 0004 7ac8 jsr 47ac8 <_Chain_Get_with_empty_check> rtems_status_code sc = RTEMS_SUCCESSFUL; bool is_empty = rtems_chain_get_with_empty_check( chain, node ); if ( is_empty ) { 474b2: 508f addql #8,%sp 474b4: 4a00 tstb %d0 474b6: 660e bnes 474c6 sc = rtems_event_send( task, events ); } return sc; } 474b8: 242e fff8 movel %fp@(-8),%d2 474bc: 4280 clrl %d0 474be: 262e fffc movel %fp@(-4),%d3 474c2: 4e5e unlk %fp 474c4: 4e75 rts { rtems_status_code sc = RTEMS_SUCCESSFUL; bool is_empty = rtems_chain_get_with_empty_check( chain, node ); if ( is_empty ) { sc = rtems_event_send( task, events ); 474c6: 2d43 000c movel %d3,%fp@(12) } return sc; } 474ca: 262e fffc movel %fp@(-4),%d3 { rtems_status_code sc = RTEMS_SUCCESSFUL; bool is_empty = rtems_chain_get_with_empty_check( chain, node ); if ( is_empty ) { sc = rtems_event_send( task, events ); 474ce: 2d42 0008 movel %d2,%fp@(8) } return sc; } 474d2: 242e fff8 movel %fp@(-8),%d2 474d6: 4e5e unlk %fp { rtems_status_code sc = RTEMS_SUCCESSFUL; bool is_empty = rtems_chain_get_with_empty_check( chain, node ); if ( is_empty ) { sc = rtems_event_send( task, events ); 474d8: 4ef9 0004 6968 jmp 46968 ... =============================================================================== 000474e0 : rtems_chain_control *chain, rtems_event_set events, rtems_interval timeout, rtems_chain_node **node_ptr ) { 474e0: 4e56 ffe0 linkw %fp,#-32 474e4: 48d7 0c7c moveml %d2-%d6/%a2-%a3,%sp@ while ( sc == RTEMS_SUCCESSFUL && (node = rtems_chain_get( chain )) == NULL ) { rtems_event_set out; sc = rtems_event_receive( 474e8: 2c0e movel %fp,%d6 474ea: 45f9 0004 7b18 lea 47b18 <_Chain_Get>,%a2 474f0: 5986 subql #4,%d6 474f2: 47f9 0004 67bc lea 467bc ,%a3 rtems_chain_control *chain, rtems_event_set events, rtems_interval timeout, rtems_chain_node **node_ptr ) { 474f8: 262e 0008 movel %fp@(8),%d3 474fc: 2a2e 000c movel %fp@(12),%d5 47500: 282e 0010 movel %fp@(16),%d4 */ RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get( rtems_chain_control *the_chain ) { return _Chain_Get( the_chain ); 47504: 2f03 movel %d3,%sp@- 47506: 4e92 jsr %a2@ rtems_status_code sc = RTEMS_SUCCESSFUL; rtems_chain_node *node = NULL; while ( sc == RTEMS_SUCCESSFUL && (node = rtems_chain_get( chain )) == NULL 47508: 588f addql #4,%sp 4750a: 2400 movel %d0,%d2 4750c: 6622 bnes 47530 ) { rtems_event_set out; sc = rtems_event_receive( 4750e: 2f06 movel %d6,%sp@- 47510: 2f04 movel %d4,%sp@- 47512: 42a7 clrl %sp@- 47514: 2f05 movel %d5,%sp@- 47516: 4e93 jsr %a3@ ) { rtems_status_code sc = RTEMS_SUCCESSFUL; rtems_chain_node *node = NULL; while ( 47518: 4fef 0010 lea %sp@(16),%sp 4751c: 4a80 tstl %d0 4751e: 67e4 beqs 47504 <== NEVER TAKEN timeout, &out ); } *node_ptr = node; 47520: 206e 0014 moveal %fp@(20),%a0 47524: 2082 movel %d2,%a0@ return sc; } 47526: 4cee 0c7c ffe0 moveml %fp@(-32),%d2-%d6/%a2-%a3 4752c: 4e5e unlk %fp 4752e: 4e75 rts timeout, &out ); } *node_ptr = node; 47530: 206e 0014 moveal %fp@(20),%a0 rtems_status_code sc = RTEMS_SUCCESSFUL; rtems_chain_node *node = NULL; while ( sc == RTEMS_SUCCESSFUL && (node = rtems_chain_get( chain )) == NULL 47534: 4280 clrl %d0 timeout, &out ); } *node_ptr = node; 47536: 2082 movel %d2,%a0@ return sc; } 47538: 4cee 0c7c ffe0 moveml %fp@(-32),%d2-%d6/%a2-%a3 4753e: 4e5e unlk %fp ... =============================================================================== 00047544 : rtems_chain_control *chain, rtems_chain_node *node, rtems_id task, rtems_event_set events ) { 47544: 4e56 0000 linkw %fp,#0 47548: 2f03 movel %d3,%sp@- 4754a: 262e 0014 movel %fp@(20),%d3 4754e: 2f02 movel %d2,%sp@- RTEMS_INLINE_ROUTINE bool rtems_chain_prepend_with_empty_check( rtems_chain_control *chain, rtems_chain_node *node ) { return _Chain_Prepend_with_empty_check( chain, node ); 47550: 2f2e 000c movel %fp@(12),%sp@- 47554: 2f2e 0008 movel %fp@(8),%sp@- 47558: 242e 0010 movel %fp@(16),%d2 4755c: 4eb9 0004 7b84 jsr 47b84 <_Chain_Prepend_with_empty_check> rtems_status_code sc = RTEMS_SUCCESSFUL; bool was_empty = rtems_chain_prepend_with_empty_check( chain, node ); if (was_empty) { 47562: 508f addql #8,%sp 47564: 4a00 tstb %d0 47566: 660e bnes 47576 sc = rtems_event_send( task, events ); } return sc; } 47568: 242e fff8 movel %fp@(-8),%d2 4756c: 4280 clrl %d0 4756e: 262e fffc movel %fp@(-4),%d3 47572: 4e5e unlk %fp 47574: 4e75 rts { rtems_status_code sc = RTEMS_SUCCESSFUL; bool was_empty = rtems_chain_prepend_with_empty_check( chain, node ); if (was_empty) { sc = rtems_event_send( task, events ); 47576: 2d43 000c movel %d3,%fp@(12) } return sc; } 4757a: 262e fffc movel %fp@(-4),%d3 { rtems_status_code sc = RTEMS_SUCCESSFUL; bool was_empty = rtems_chain_prepend_with_empty_check( chain, node ); if (was_empty) { sc = rtems_event_send( task, events ); 4757e: 2d42 0008 movel %d2,%fp@(8) } return sc; } 47582: 242e fff8 movel %fp@(-8),%d2 47586: 4e5e unlk %fp { rtems_status_code sc = RTEMS_SUCCESSFUL; bool was_empty = rtems_chain_prepend_with_empty_check( chain, node ); if (was_empty) { sc = rtems_event_send( task, events ); 47588: 4ef9 0004 6968 jmp 46968 ... =============================================================================== 000466d0 : rtems_status_code rtems_clock_get( rtems_clock_get_options option, void *time_buffer ) { 466d0: 4e56 0000 linkw %fp,#0 466d4: 202e 0008 movel %fp@(8),%d0 466d8: 2f0a movel %a2,%sp@- 466da: 246e 000c moveal %fp@(12),%a2 if ( !time_buffer ) 466de: 4a8a tstl %a2 466e0: 6728 beqs 4670a return RTEMS_INVALID_ADDRESS; if ( option == RTEMS_CLOCK_GET_TOD ) 466e2: 4a80 tstl %d0 466e4: 6730 beqs 46716 return rtems_clock_get_tod( (rtems_time_of_day *)time_buffer ); if ( option == RTEMS_CLOCK_GET_SECONDS_SINCE_EPOCH ) 466e6: 7201 moveq #1,%d1 466e8: b280 cmpl %d0,%d1 466ea: 673a beqs 46726 return rtems_clock_get_seconds_since_epoch((rtems_interval *)time_buffer); if ( option == RTEMS_CLOCK_GET_TICKS_SINCE_BOOT ) { 466ec: 7202 moveq #2,%d1 466ee: b280 cmpl %d0,%d1 466f0: 6744 beqs 46736 *interval = rtems_clock_get_ticks_since_boot(); return RTEMS_SUCCESSFUL; } if ( option == RTEMS_CLOCK_GET_TICKS_PER_SECOND ) { 466f2: 7203 moveq #3,%d1 466f4: b280 cmpl %d0,%d1 466f6: 6752 beqs 4674a *interval = rtems_clock_get_ticks_per_second(); return RTEMS_SUCCESSFUL; } if ( option == RTEMS_CLOCK_GET_TIME_VALUE ) 466f8: 7204 moveq #4,%d1 466fa: b280 cmpl %d0,%d1 466fc: 6760 beqs 4675e return rtems_clock_get_tod_timeval( (struct timeval *)time_buffer ); return RTEMS_INVALID_NUMBER; } 466fe: 246e fffc moveal %fp@(-4),%a2 } if ( option == RTEMS_CLOCK_GET_TIME_VALUE ) return rtems_clock_get_tod_timeval( (struct timeval *)time_buffer ); return RTEMS_INVALID_NUMBER; 46702: 720a moveq #10,%d1 } 46704: 2001 movel %d1,%d0 46706: 4e5e unlk %fp 46708: 4e75 rts 4670a: 246e fffc moveal %fp@(-4),%a2 rtems_clock_get_options option, void *time_buffer ) { if ( !time_buffer ) return RTEMS_INVALID_ADDRESS; 4670e: 7209 moveq #9,%d1 if ( option == RTEMS_CLOCK_GET_TIME_VALUE ) return rtems_clock_get_tod_timeval( (struct timeval *)time_buffer ); return RTEMS_INVALID_NUMBER; } 46710: 2001 movel %d1,%d0 46712: 4e5e unlk %fp 46714: 4e75 rts { if ( !time_buffer ) return RTEMS_INVALID_ADDRESS; if ( option == RTEMS_CLOCK_GET_TOD ) return rtems_clock_get_tod( (rtems_time_of_day *)time_buffer ); 46716: 2d4a 0008 movel %a2,%fp@(8) if ( option == RTEMS_CLOCK_GET_TIME_VALUE ) return rtems_clock_get_tod_timeval( (struct timeval *)time_buffer ); return RTEMS_INVALID_NUMBER; } 4671a: 246e fffc moveal %fp@(-4),%a2 4671e: 4e5e unlk %fp { if ( !time_buffer ) return RTEMS_INVALID_ADDRESS; if ( option == RTEMS_CLOCK_GET_TOD ) return rtems_clock_get_tod( (rtems_time_of_day *)time_buffer ); 46720: 4ef9 0004 67c4 jmp 467c4 if ( option == RTEMS_CLOCK_GET_SECONDS_SINCE_EPOCH ) return rtems_clock_get_seconds_since_epoch((rtems_interval *)time_buffer); 46726: 2d4a 0008 movel %a2,%fp@(8) if ( option == RTEMS_CLOCK_GET_TIME_VALUE ) return rtems_clock_get_tod_timeval( (struct timeval *)time_buffer ); return RTEMS_INVALID_NUMBER; } 4672a: 246e fffc moveal %fp@(-4),%a2 4672e: 4e5e unlk %fp if ( option == RTEMS_CLOCK_GET_TOD ) return rtems_clock_get_tod( (rtems_time_of_day *)time_buffer ); if ( option == RTEMS_CLOCK_GET_SECONDS_SINCE_EPOCH ) return rtems_clock_get_seconds_since_epoch((rtems_interval *)time_buffer); 46730: 4ef9 0004 6770 jmp 46770 if ( option == RTEMS_CLOCK_GET_TICKS_SINCE_BOOT ) { rtems_interval *interval = (rtems_interval *)time_buffer; *interval = rtems_clock_get_ticks_since_boot(); 46736: 4eb9 0004 67b4 jsr 467b4 return RTEMS_SUCCESSFUL; 4673c: 4281 clrl %d1 return rtems_clock_get_seconds_since_epoch((rtems_interval *)time_buffer); if ( option == RTEMS_CLOCK_GET_TICKS_SINCE_BOOT ) { rtems_interval *interval = (rtems_interval *)time_buffer; *interval = rtems_clock_get_ticks_since_boot(); 4673e: 2480 movel %d0,%a2@ if ( option == RTEMS_CLOCK_GET_TIME_VALUE ) return rtems_clock_get_tod_timeval( (struct timeval *)time_buffer ); return RTEMS_INVALID_NUMBER; } 46740: 246e fffc moveal %fp@(-4),%a2 46744: 2001 movel %d1,%d0 46746: 4e5e unlk %fp 46748: 4e75 rts } if ( option == RTEMS_CLOCK_GET_TICKS_PER_SECOND ) { rtems_interval *interval = (rtems_interval *)time_buffer; *interval = rtems_clock_get_ticks_per_second(); 4674a: 4eb9 0004 679c jsr 4679c return RTEMS_SUCCESSFUL; 46750: 4281 clrl %d1 } if ( option == RTEMS_CLOCK_GET_TICKS_PER_SECOND ) { rtems_interval *interval = (rtems_interval *)time_buffer; *interval = rtems_clock_get_ticks_per_second(); 46752: 2480 movel %d0,%a2@ if ( option == RTEMS_CLOCK_GET_TIME_VALUE ) return rtems_clock_get_tod_timeval( (struct timeval *)time_buffer ); return RTEMS_INVALID_NUMBER; } 46754: 246e fffc moveal %fp@(-4),%a2 46758: 2001 movel %d1,%d0 4675a: 4e5e unlk %fp 4675c: 4e75 rts *interval = rtems_clock_get_ticks_per_second(); return RTEMS_SUCCESSFUL; } if ( option == RTEMS_CLOCK_GET_TIME_VALUE ) return rtems_clock_get_tod_timeval( (struct timeval *)time_buffer ); 4675e: 2d4a 0008 movel %a2,%fp@(8) return RTEMS_INVALID_NUMBER; } 46762: 246e fffc moveal %fp@(-4),%a2 46766: 4e5e unlk %fp *interval = rtems_clock_get_ticks_per_second(); return RTEMS_SUCCESSFUL; } if ( option == RTEMS_CLOCK_GET_TIME_VALUE ) return rtems_clock_get_tod_timeval( (struct timeval *)time_buffer ); 46768: 4ef9 0004 6888 jmp 46888 ... =============================================================================== 000484c4 : 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 ) { 484c4: 4e56 0000 linkw %fp,#0 484c8: 226e 000c moveal %fp@(12),%a1 484cc: 2f0a movel %a2,%sp@- 484ce: 206e 0010 moveal %fp@(16),%a0 484d2: 2f02 movel %d2,%sp@- 484d4: 242e 0008 movel %fp@(8),%d2 rtems_device_major_number major_limit = _IO_Number_of_drivers; 484d8: 2039 0006 575a movel 6575a <_IO_Number_of_drivers>,%d0 if ( rtems_interrupt_is_in_progress() ) 484de: 4ab9 0006 533e tstl 6533e <_Per_CPU_Information+0x8> 484e4: 670e beqs 484f4 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); } 484e6: 242e fff8 movel %fp@(-8),%d2 ) { rtems_device_major_number major_limit = _IO_Number_of_drivers; if ( rtems_interrupt_is_in_progress() ) return RTEMS_CALLED_FROM_ISR; 484ea: 7012 moveq #18,%d0 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); } 484ec: 246e fffc moveal %fp@(-4),%a2 484f0: 4e5e unlk %fp 484f2: 4e75 rts rtems_device_major_number major_limit = _IO_Number_of_drivers; if ( rtems_interrupt_is_in_progress() ) return RTEMS_CALLED_FROM_ISR; if ( registered_major == NULL ) 484f4: 4a88 tstl %a0 484f6: 6722 beqs 4851a return RTEMS_INVALID_ADDRESS; /* Set it to an invalid value */ *registered_major = major_limit; 484f8: 2080 movel %d0,%a0@ if ( driver_table == NULL ) 484fa: 4a89 tstl %a1 484fc: 671c beqs 4851a static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 484fe: 4a91 tstl %a1@ 48500: 6712 beqs 48514 return RTEMS_INVALID_ADDRESS; if ( rtems_io_is_empty_table( driver_table ) ) return RTEMS_INVALID_ADDRESS; if ( major >= major_limit ) 48502: b480 cmpl %d0,%d2 48504: 6522 bcss 48528 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); } 48506: 242e fff8 movel %fp@(-8),%d2 if ( rtems_io_is_empty_table( driver_table ) ) return RTEMS_INVALID_ADDRESS; if ( major >= major_limit ) return RTEMS_INVALID_NUMBER; 4850a: 700a moveq #10,%d0 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); } 4850c: 246e fffc moveal %fp@(-4),%a2 48510: 4e5e unlk %fp 48512: 4e75 rts static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 48514: 4aa9 0004 tstl %a1@(4) 48518: 66e8 bnes 48502 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); } 4851a: 242e fff8 movel %fp@(-8),%d2 if ( driver_table == NULL ) return RTEMS_INVALID_ADDRESS; if ( rtems_io_is_empty_table( driver_table ) ) return RTEMS_INVALID_ADDRESS; 4851e: 7009 moveq #9,%d0 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); } 48520: 246e fffc moveal %fp@(-4),%a2 48524: 4e5e unlk %fp 48526: 4e75 rts * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 48528: 2039 0006 4ee0 movel 64ee0 <_Thread_Dispatch_disable_level>,%d0 4852e: 5280 addql #1,%d0 48530: 23c0 0006 4ee0 movel %d0,64ee0 <_Thread_Dispatch_disable_level> return _Thread_Dispatch_disable_level; 48536: 2039 0006 4ee0 movel 64ee0 <_Thread_Dispatch_disable_level>,%d0 if ( major >= major_limit ) return RTEMS_INVALID_NUMBER; _Thread_Disable_dispatch(); if ( major == 0 ) { 4853c: 4a82 tstl %d2 4853e: 667a bnes 485ba static rtems_status_code rtems_io_obtain_major_number( rtems_device_major_number *major ) { rtems_device_major_number n = _IO_Number_of_drivers; 48540: 2039 0006 575a movel 6575a <_IO_Number_of_drivers>,%d0 rtems_device_major_number m = 0; /* major is error checked by caller */ for ( m = 0; m < n; ++m ) { 48546: 6700 00dc beqw 48624 4854a: 2239 0006 575e movel 6575e <_IO_Driver_address_table>,%d1 48550: 2441 moveal %d1,%a2 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 48552: 4a92 tstl %a2@ 48554: 6720 beqs 48576 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 ) { 48556: 5282 addql #1,%d2 48558: 45ea 0018 lea %a2@(24),%a2 4855c: b082 cmpl %d2,%d0 4855e: 66f2 bnes 48552 if ( rtems_io_is_empty_table( table ) ) break; } /* Assigns invalid value in case of failure */ *major = m; 48560: 2082 movel %d2,%a0@ if ( major == 0 ) { rtems_status_code sc = rtems_io_obtain_major_number( registered_major ); if ( sc != RTEMS_SUCCESSFUL ) { _Thread_Enable_dispatch(); 48562: 4eb9 0004 a580 jsr 4a580 <_Thread_Enable_dispatch> *major = m; if ( m != n ) return RTEMS_SUCCESSFUL; return RTEMS_TOO_MANY; 48568: 7005 moveq #5,%d0 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); } 4856a: 242e fff8 movel %fp@(-8),%d2 4856e: 246e fffc moveal %fp@(-4),%a2 48572: 4e5e unlk %fp 48574: 4e75 rts static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 48576: 4aaa 0004 tstl %a2@(4) 4857a: 66da bnes 48556 if ( rtems_io_is_empty_table( table ) ) break; } /* Assigns invalid value in case of failure */ *major = m; 4857c: 2082 movel %d2,%a0@ if ( m != n ) 4857e: b480 cmpl %d0,%d2 48580: 67e0 beqs 48562 <== NEVER TAKEN 48582: 7018 moveq #24,%d0 48584: 4c02 0800 mulsl %d2,%d0 } *registered_major = major; } _IO_Driver_address_table [major] = *driver_table; 48588: 2041 moveal %d1,%a0 4858a: d1c0 addal %d0,%a0 4858c: 20d9 movel %a1@+,%a0@+ 4858e: 20d9 movel %a1@+,%a0@+ 48590: 20d9 movel %a1@+,%a0@+ 48592: 20d9 movel %a1@+,%a0@+ 48594: 20d9 movel %a1@+,%a0@+ 48596: 2091 movel %a1@,%a0@ _Thread_Enable_dispatch(); 48598: 4eb9 0004 a580 jsr 4a580 <_Thread_Enable_dispatch> return rtems_io_initialize( major, 0, NULL ); } 4859e: 246e fffc moveal %fp@(-4),%a2 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 485a2: 2d42 0008 movel %d2,%fp@(8) } 485a6: 242e fff8 movel %fp@(-8),%d2 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 485aa: 42ae 0010 clrl %fp@(16) 485ae: 42ae 000c clrl %fp@(12) } 485b2: 4e5e unlk %fp _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 485b4: 4ef9 0005 0ca0 jmp 50ca0 _Thread_Enable_dispatch(); return sc; } major = *registered_major; } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major; 485ba: 2202 movel %d2,%d1 485bc: 2002 movel %d2,%d0 485be: e789 lsll #3,%d1 485c0: eb88 lsll #5,%d0 485c2: 2479 0006 575e moveal 6575e <_IO_Driver_address_table>,%a2 485c8: 9081 subl %d1,%d0 485ca: 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; 485cc: 4a92 tstl %a2@ 485ce: 6714 beqs 485e4 major = *registered_major; } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major; if ( !rtems_io_is_empty_table( table ) ) { _Thread_Enable_dispatch(); 485d0: 4eb9 0004 a580 jsr 4a580 <_Thread_Enable_dispatch> _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); } 485d6: 242e fff8 movel %fp@(-8),%d2 } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major; if ( !rtems_io_is_empty_table( table ) ) { _Thread_Enable_dispatch(); return RTEMS_RESOURCE_IN_USE; 485da: 700c moveq #12,%d0 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); } 485dc: 246e fffc moveal %fp@(-4),%a2 485e0: 4e5e unlk %fp 485e2: 4e75 rts static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 485e4: 4aaa 0004 tstl %a2@(4) 485e8: 66e6 bnes 485d0 485ea: 2239 0006 575e movel 6575e <_IO_Driver_address_table>,%d1 if ( !rtems_io_is_empty_table( table ) ) { _Thread_Enable_dispatch(); return RTEMS_RESOURCE_IN_USE; } *registered_major = major; 485f0: 2082 movel %d2,%a0@ } _IO_Driver_address_table [major] = *driver_table; 485f2: 2041 moveal %d1,%a0 485f4: d1c0 addal %d0,%a0 485f6: 20d9 movel %a1@+,%a0@+ 485f8: 20d9 movel %a1@+,%a0@+ 485fa: 20d9 movel %a1@+,%a0@+ 485fc: 20d9 movel %a1@+,%a0@+ 485fe: 20d9 movel %a1@+,%a0@+ 48600: 2091 movel %a1@,%a0@ _Thread_Enable_dispatch(); 48602: 4eb9 0004 a580 jsr 4a580 <_Thread_Enable_dispatch> return rtems_io_initialize( major, 0, NULL ); } 48608: 246e fffc moveal %fp@(-4),%a2 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 4860c: 2d42 0008 movel %d2,%fp@(8) } 48610: 242e fff8 movel %fp@(-8),%d2 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 48614: 42ae 0010 clrl %fp@(16) 48618: 42ae 000c clrl %fp@(12) } 4861c: 4e5e unlk %fp _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 4861e: 4ef9 0005 0ca0 jmp 50ca0 if ( rtems_io_is_empty_table( table ) ) break; } /* Assigns invalid value in case of failure */ *major = m; 48624: 4290 clrl %a0@ <== NOT EXECUTED if ( major == 0 ) { rtems_status_code sc = rtems_io_obtain_major_number( registered_major ); if ( sc != RTEMS_SUCCESSFUL ) { _Thread_Enable_dispatch(); 48626: 4eb9 0004 a580 jsr 4a580 <_Thread_Enable_dispatch> <== NOT EXECUTED *major = m; if ( m != n ) return RTEMS_SUCCESSFUL; return RTEMS_TOO_MANY; 4862c: 7005 moveq #5,%d0 <== NOT EXECUTED 4862e: 6000 ff3a braw 4856a <== NOT EXECUTED ... =============================================================================== 000496a4 : #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) { 496a4: 4e56 fff0 linkw %fp,#-16 496a8: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ 496ac: 266e 0008 moveal %fp@(8),%a3 uint32_t i; uint32_t api_index; Thread_Control *the_thread; Objects_Information *information; if ( !routine ) 496b0: 4a8b tstl %a3 496b2: 673e beqs 496f2 <== NEVER TAKEN 496b4: 49f9 0006 37f8 lea 637f8 <_Objects_Information_table+0x4>,%a4 #if !defined(RTEMS_POSIX_API) || defined(RTEMS_DEBUG) if ( !_Objects_Information_table[ api_index ] ) continue; #endif information = _Objects_Information_table[ api_index ][ 1 ]; 496ba: 205c moveal %a4@+,%a0 496bc: 2468 0004 moveal %a0@(4),%a2 if ( !information ) 496c0: 4a8a tstl %a2 496c2: 6726 beqs 496ea continue; for ( i=1 ; i <= information->maximum ; i++ ) { 496c4: 4a6a 000e tstw %a2@(14) 496c8: 6720 beqs 496ea 496ca: 7401 moveq #1,%d2 the_thread = (Thread_Control *)information->local_table[ i ]; 496cc: 206a 0018 moveal %a2@(24),%a0 496d0: 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++ ) { 496d4: 5282 addql #1,%d2 the_thread = (Thread_Control *)information->local_table[ i ]; if ( !the_thread ) 496d6: 4a80 tstl %d0 496d8: 6706 beqs 496e0 <== NEVER TAKEN continue; (*routine)(the_thread); 496da: 2f00 movel %d0,%sp@- 496dc: 4e93 jsr %a3@ 496de: 588f addql #4,%sp information = _Objects_Information_table[ api_index ][ 1 ]; if ( !information ) continue; for ( i=1 ; i <= information->maximum ; i++ ) { 496e0: 4280 clrl %d0 496e2: 302a 000e movew %a2@(14),%d0 496e6: b480 cmpl %d0,%d2 496e8: 63e2 blss 496cc Objects_Information *information; if ( !routine ) return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { 496ea: b9fc 0006 3804 cmpal #407556,%a4 496f0: 66c8 bnes 496ba (*routine)(the_thread); } } } 496f2: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 496f8: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000547a8 : rtems_id id, const void *buffer, size_t size, uint32_t *count ) { 547a8: 4e56 fff0 linkw %fp,#-16 547ac: 48d7 001c moveml %d2-%d4,%sp@ 547b0: 282e 0008 movel %fp@(8),%d4 547b4: 242e 000c movel %fp@(12),%d2 547b8: 262e 0014 movel %fp@(20),%d3 register Message_queue_Control *the_message_queue; Objects_Locations location; CORE_message_queue_Status core_status; if ( !buffer ) 547bc: 4a82 tstl %d2 547be: 6756 beqs 54816 <== NEVER TAKEN return RTEMS_INVALID_ADDRESS; if ( !count ) 547c0: 4a83 tstl %d3 547c2: 6752 beqs 54816 <== NEVER TAKEN RTEMS_INLINE_ROUTINE Message_queue_Control *_Message_queue_Get ( Objects_Id id, Objects_Locations *location ) { return (Message_queue_Control *) 547c4: 486e fffc pea %fp@(-4) 547c8: 2f04 movel %d4,%sp@- 547ca: 4879 0007 e594 pea 7e594 <_Message_queue_Information> 547d0: 4eb9 0005 9f3c jsr 59f3c <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_message_queue = _Message_queue_Get( id, &location ); switch ( location ) { 547d6: 4fef 000c lea %sp@(12),%sp 547da: 4aae fffc tstl %fp@(-4) 547de: 6642 bnes 54822 case OBJECTS_LOCAL: core_status = _CORE_message_queue_Broadcast( 547e0: 2f03 movel %d3,%sp@- 547e2: 2040 moveal %d0,%a0 547e4: 42a7 clrl %sp@- 547e6: 2f04 movel %d4,%sp@- 547e8: 2f2e 0010 movel %fp@(16),%sp@- 547ec: 2f02 movel %d2,%sp@- 547ee: 4868 0014 pea %a0@(20) 547f2: 4eb9 0005 836c jsr 5836c <_CORE_message_queue_Broadcast> 547f8: 2400 movel %d0,%d2 NULL, #endif count ); _Thread_Enable_dispatch(); 547fa: 4eb9 0005 ad04 jsr 5ad04 <_Thread_Enable_dispatch> return 54800: 2f02 movel %d2,%sp@- 54802: 4eb9 0005 4bc4 jsr 54bc4 <_Message_queue_Translate_core_message_queue_return_code> 54808: 4fef 001c lea %sp@(28),%sp case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 5480c: 4cee 001c fff0 moveml %fp@(-16),%d2-%d4 54812: 4e5e unlk %fp 54814: 4e75 rts if ( !buffer ) return RTEMS_INVALID_ADDRESS; if ( !count ) return RTEMS_INVALID_ADDRESS; 54816: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 54818: 4cee 001c fff0 moveml %fp@(-16),%d2-%d4 5481e: 4e5e unlk %fp 54820: 4e75 rts #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 54822: 7004 moveq #4,%d0 } 54824: 4cee 001c fff0 moveml %fp@(-16),%d2-%d4 5482a: 4e5e unlk %fp ... =============================================================================== 00054bdc : rtems_status_code rtems_message_queue_urgent( rtems_id id, const void *buffer, size_t size ) { 54bdc: 4e56 fffc linkw %fp,#-4 54be0: 2f03 movel %d3,%sp@- 54be2: 262e 0008 movel %fp@(8),%d3 54be6: 2f02 movel %d2,%sp@- 54be8: 242e 000c movel %fp@(12),%d2 register Message_queue_Control *the_message_queue; Objects_Locations location; CORE_message_queue_Status status; if ( !buffer ) 54bec: 676c beqs 54c5a <== NEVER TAKEN 54bee: 486e fffc pea %fp@(-4) 54bf2: 2f03 movel %d3,%sp@- 54bf4: 4879 0007 e594 pea 7e594 <_Message_queue_Information> 54bfa: 4eb9 0005 9f3c jsr 59f3c <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_message_queue = _Message_queue_Get( id, &location ); switch ( location ) { 54c00: 4fef 000c lea %sp@(12),%sp 54c04: 4aae fffc tstl %fp@(-4) 54c08: 6642 bnes 54c4c CORE_message_queue_API_mp_support_callout api_message_queue_mp_support, bool wait, Watchdog_Interval timeout ) { return _CORE_message_queue_Submit( 54c0a: 42a7 clrl %sp@- 54c0c: 2040 moveal %d0,%a0 54c0e: 42a7 clrl %sp@- 54c10: 2f3c 8000 0000 movel #-2147483648,%sp@- 54c16: 42a7 clrl %sp@- 54c18: 2f03 movel %d3,%sp@- 54c1a: 2f2e 0010 movel %fp@(16),%sp@- 54c1e: 2f02 movel %d2,%sp@- 54c20: 4868 0014 pea %a0@(20) 54c24: 4eb9 0005 86d4 jsr 586d4 <_CORE_message_queue_Submit> id, MESSAGE_QUEUE_MP_HANDLER, false, /* sender does not block */ 0 /* no timeout */ ); _Thread_Enable_dispatch(); 54c2a: 4fef 0020 lea %sp@(32),%sp 54c2e: 2400 movel %d0,%d2 54c30: 4eb9 0005 ad04 jsr 5ad04 <_Thread_Enable_dispatch> /* * Since this API does not allow for blocking sends, we can directly * return the returned status. */ return _Message_queue_Translate_core_message_queue_return_code(status); 54c36: 2f02 movel %d2,%sp@- 54c38: 4eb9 0005 4bc4 jsr 54bc4 <_Message_queue_Translate_core_message_queue_return_code> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 54c3e: 242e fff4 movel %fp@(-12),%d2 /* * Since this API does not allow for blocking sends, we can directly * return the returned status. */ return _Message_queue_Translate_core_message_queue_return_code(status); 54c42: 588f addql #4,%sp case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 54c44: 262e fff8 movel %fp@(-8),%d3 54c48: 4e5e unlk %fp 54c4a: 4e75 rts 54c4c: 242e fff4 movel %fp@(-12),%d2 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 54c50: 7004 moveq #4,%d0 } 54c52: 262e fff8 movel %fp@(-8),%d3 54c56: 4e5e unlk %fp 54c58: 4e75 rts 54c5a: 242e fff4 movel %fp@(-12),%d2 register Message_queue_Control *the_message_queue; Objects_Locations location; CORE_message_queue_Status status; if ( !buffer ) return RTEMS_INVALID_ADDRESS; 54c5e: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 54c60: 262e fff8 movel %fp@(-8),%d3 54c64: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004682c : ) { const rtems_assoc_t *api_assoc; const rtems_assoc_t *class_assoc; if ( the_api == OBJECTS_INTERNAL_API ) 4682c: 7001 moveq #1,%d0 const char *rtems_object_get_api_class_name( int the_api, int the_class ) { 4682e: 4e56 0000 linkw %fp,#0 46832: 222e 0008 movel %fp@(8),%d1 46836: 2f02 movel %d2,%sp@- const rtems_assoc_t *api_assoc; const rtems_assoc_t *class_assoc; if ( the_api == OBJECTS_INTERNAL_API ) 46838: b081 cmpl %d1,%d0 4683a: 674e beqs 4688a api_assoc = rtems_object_api_internal_assoc; else if ( the_api == OBJECTS_CLASSIC_API ) 4683c: 7402 moveq #2,%d2 4683e: b481 cmpl %d1,%d2 46840: 6740 beqs 46882 api_assoc = rtems_object_api_classic_assoc; #ifdef RTEMS_POSIX_API else if ( the_api == OBJECTS_POSIX_API ) 46842: 143c 0003 moveb #3,%d2 api_assoc = rtems_object_api_posix_assoc; #endif else return "BAD API"; 46846: 203c 0005 ee5a movel #388698,%d0 if ( the_api == OBJECTS_INTERNAL_API ) api_assoc = rtems_object_api_internal_assoc; else if ( the_api == OBJECTS_CLASSIC_API ) api_assoc = rtems_object_api_classic_assoc; #ifdef RTEMS_POSIX_API else if ( the_api == OBJECTS_POSIX_API ) 4684c: b481 cmpl %d1,%d2 4684e: 6708 beqs 46858 return "BAD API"; class_assoc = rtems_assoc_ptr_by_local( api_assoc, the_class ); if ( class_assoc ) return class_assoc->name; return "BAD CLASS"; } 46850: 242e fffc movel %fp@(-4),%d2 46854: 4e5e unlk %fp 46856: 4e75 rts api_assoc = rtems_object_api_internal_assoc; else if ( the_api == OBJECTS_CLASSIC_API ) api_assoc = rtems_object_api_classic_assoc; #ifdef RTEMS_POSIX_API else if ( the_api == OBJECTS_POSIX_API ) api_assoc = rtems_object_api_posix_assoc; 46858: 203c 0006 0028 movel #393256,%d0 #endif else return "BAD API"; class_assoc = rtems_assoc_ptr_by_local( api_assoc, the_class ); 4685e: 2f2e 000c movel %fp@(12),%sp@- 46862: 2f00 movel %d0,%sp@- 46864: 4eb9 0004 b8f0 jsr 4b8f0 if ( class_assoc ) 4686a: 508f addql #8,%sp else if ( the_api == OBJECTS_POSIX_API ) api_assoc = rtems_object_api_posix_assoc; #endif else return "BAD API"; class_assoc = rtems_assoc_ptr_by_local( api_assoc, the_class ); 4686c: 2040 moveal %d0,%a0 if ( class_assoc ) return class_assoc->name; return "BAD CLASS"; 4686e: 203c 0005 ee62 movel #388706,%d0 api_assoc = rtems_object_api_posix_assoc; #endif else return "BAD API"; class_assoc = rtems_assoc_ptr_by_local( api_assoc, the_class ); if ( class_assoc ) 46874: 4a88 tstl %a0 46876: 67d8 beqs 46850 return class_assoc->name; return "BAD CLASS"; } 46878: 242e fffc movel %fp@(-4),%d2 4687c: 4e5e unlk %fp #endif else return "BAD API"; class_assoc = rtems_assoc_ptr_by_local( api_assoc, the_class ); if ( class_assoc ) return class_assoc->name; 4687e: 2010 movel %a0@,%d0 return "BAD CLASS"; } 46880: 4e75 rts const rtems_assoc_t *class_assoc; if ( the_api == OBJECTS_INTERNAL_API ) api_assoc = rtems_object_api_internal_assoc; else if ( the_api == OBJECTS_CLASSIC_API ) api_assoc = rtems_object_api_classic_assoc; 46882: 203c 0006 00b8 movel #393400,%d0 46888: 60d4 bras 4685e { const rtems_assoc_t *api_assoc; const rtems_assoc_t *class_assoc; if ( the_api == OBJECTS_INTERNAL_API ) api_assoc = rtems_object_api_internal_assoc; 4688a: 203c 0006 0130 movel #393520,%d0 46890: 60cc bras 4685e ... =============================================================================== 000483d8 : rtems_status_code rtems_object_get_class_information( int the_api, int the_class, rtems_object_api_class_information *info ) { 483d8: 4e56 0000 linkw %fp,#0 483dc: 2f0a movel %a2,%sp@- 483de: 246e 0010 moveal %fp@(16),%a2 483e2: 2f02 movel %d2,%sp@- int i; /* * Validate parameters and look up information structure. */ if ( !info ) 483e4: 4a8a tstl %a2 483e6: 6768 beqs 48450 <== NEVER TAKEN return RTEMS_INVALID_ADDRESS; obj_info = _Objects_Get_information( the_api, the_class ); 483e8: 3f2e 000e movew %fp@(14),%sp@- 483ec: 4267 clrw %sp@- 483ee: 2f2e 0008 movel %fp@(8),%sp@- 483f2: 4eb9 0004 a158 jsr 4a158 <_Objects_Get_information> if ( !obj_info ) 483f8: 508f addql #8,%sp * Validate parameters and look up information structure. */ if ( !info ) return RTEMS_INVALID_ADDRESS; obj_info = _Objects_Get_information( the_api, the_class ); 483fa: 2040 moveal %d0,%a0 if ( !obj_info ) 483fc: 4a80 tstl %d0 483fe: 675e beqs 4845e return RTEMS_INVALID_NUMBER; /* * Return information about this object class to the user. */ info->minimum_id = obj_info->minimum_id; 48400: 24a8 0006 movel %a0@(6),%a2@ info->maximum_id = obj_info->maximum_id; info->auto_extend = obj_info->auto_extend; info->maximum = obj_info->maximum; 48404: 4282 clrl %d2 /* * Return information about this object class to the user. */ info->minimum_id = obj_info->minimum_id; info->maximum_id = obj_info->maximum_id; 48406: 2568 000a 0004 movel %a0@(10),%a2@(4) info->auto_extend = obj_info->auto_extend; info->maximum = obj_info->maximum; 4840c: 3428 000e movew %a0@(14),%d2 /* * Return information about this object class to the user. */ info->minimum_id = obj_info->minimum_id; info->maximum_id = obj_info->maximum_id; info->auto_extend = obj_info->auto_extend; 48410: 1568 0010 000c moveb %a0@(16),%a2@(12) info->maximum = obj_info->maximum; 48416: 2542 0008 movel %d2,%a2@(8) for ( unallocated=0, i=1 ; i <= info->maximum ; i++ ) 4841a: 6750 beqs 4846c <== NEVER TAKEN 4841c: 2068 0018 moveal %a0@(24),%a0 48420: 7201 moveq #1,%d1 48422: 7001 moveq #1,%d0 48424: 93c9 subal %a1,%a1 48426: 5280 addql #1,%d0 if ( !obj_info->local_table[i] ) 48428: 4ab0 1c00 tstl %a0@(00000000,%d1:l:4) 4842c: 6718 beqs 48446 info->minimum_id = obj_info->minimum_id; info->maximum_id = obj_info->maximum_id; info->auto_extend = obj_info->auto_extend; info->maximum = obj_info->maximum; for ( unallocated=0, i=1 ; i <= info->maximum ; i++ ) 4842e: 2200 movel %d0,%d1 48430: b082 cmpl %d2,%d0 48432: 63f2 blss 48426 <== ALWAYS TAKEN if ( !obj_info->local_table[i] ) unallocated++; info->unallocated = unallocated; 48434: 2549 000e movel %a1,%a2@(14) return RTEMS_SUCCESSFUL; 48438: 4280 clrl %d0 } 4843a: 242e fff8 movel %fp@(-8),%d2 4843e: 246e fffc moveal %fp@(-4),%a2 48442: 4e5e unlk %fp 48444: 4e75 rts info->auto_extend = obj_info->auto_extend; info->maximum = obj_info->maximum; for ( unallocated=0, i=1 ; i <= info->maximum ; i++ ) if ( !obj_info->local_table[i] ) unallocated++; 48446: 5289 addql #1,%a1 info->minimum_id = obj_info->minimum_id; info->maximum_id = obj_info->maximum_id; info->auto_extend = obj_info->auto_extend; info->maximum = obj_info->maximum; for ( unallocated=0, i=1 ; i <= info->maximum ; i++ ) 48448: 2200 movel %d0,%d1 4844a: b082 cmpl %d2,%d0 4844c: 63d8 blss 48426 <== NEVER TAKEN 4844e: 60e4 bras 48434 unallocated++; info->unallocated = unallocated; return RTEMS_SUCCESSFUL; } 48450: 242e fff8 movel %fp@(-8),%d2 /* * Validate parameters and look up information structure. */ if ( !info ) return RTEMS_INVALID_ADDRESS; 48454: 7009 moveq #9,%d0 unallocated++; info->unallocated = unallocated; return RTEMS_SUCCESSFUL; } 48456: 246e fffc moveal %fp@(-4),%a2 4845a: 4e5e unlk %fp 4845c: 4e75 rts 4845e: 242e fff8 movel %fp@(-8),%d2 if ( !info ) return RTEMS_INVALID_ADDRESS; obj_info = _Objects_Get_information( the_api, the_class ); if ( !obj_info ) return RTEMS_INVALID_NUMBER; 48462: 700a moveq #10,%d0 unallocated++; info->unallocated = unallocated; return RTEMS_SUCCESSFUL; } 48464: 246e fffc moveal %fp@(-4),%a2 48468: 4e5e unlk %fp 4846a: 4e75 rts info->minimum_id = obj_info->minimum_id; info->maximum_id = obj_info->maximum_id; info->auto_extend = obj_info->auto_extend; info->maximum = obj_info->maximum; for ( unallocated=0, i=1 ; i <= info->maximum ; i++ ) 4846c: 93c9 subal %a1,%a1 <== NOT EXECUTED if ( !obj_info->local_table[i] ) unallocated++; info->unallocated = unallocated; return RTEMS_SUCCESSFUL; 4846e: 4280 clrl %d0 <== NOT EXECUTED for ( unallocated=0, i=1 ; i <= info->maximum ; i++ ) if ( !obj_info->local_table[i] ) unallocated++; info->unallocated = unallocated; 48470: 2549 000e movel %a1,%a2@(14) <== NOT EXECUTED 48474: 60c4 bras 4843a <== NOT EXECUTED ... =============================================================================== 00054c68 : uint32_t length, uint32_t buffer_size, rtems_attribute attribute_set, rtems_id *id ) { 54c68: 4e56 fff4 linkw %fp,#-12 54c6c: 48d7 040c moveml %d2-%d3/%a2,%sp@ 54c70: 242e 0008 movel %fp@(8),%d2 register Partition_Control *the_partition; if ( !rtems_is_name_valid( name ) ) 54c74: 660c bnes 54c82 return RTEMS_INVALID_NAME; 54c76: 7003 moveq #3,%d0 ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 54c78: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 54c7e: 4e5e unlk %fp 54c80: 4e75 rts register Partition_Control *the_partition; if ( !rtems_is_name_valid( name ) ) return RTEMS_INVALID_NAME; if ( !starting_address ) 54c82: 4aae 000c tstl %fp@(12) 54c86: 6718 beqs 54ca0 return RTEMS_INVALID_ADDRESS; if ( !id ) 54c88: 4aae 001c tstl %fp@(28) 54c8c: 6712 beqs 54ca0 <== NEVER TAKEN return RTEMS_INVALID_ADDRESS; if ( length == 0 || buffer_size == 0 || length < buffer_size || 54c8e: 4aae 0010 tstl %fp@(16) 54c92: 6618 bnes 54cac !_Partition_Is_buffer_size_aligned( buffer_size ) ) return RTEMS_INVALID_SIZE; 54c94: 7008 moveq #8,%d0 ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 54c96: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 54c9c: 4e5e unlk %fp 54c9e: 4e75 rts if ( length == 0 || buffer_size == 0 || length < buffer_size || !_Partition_Is_buffer_size_aligned( buffer_size ) ) return RTEMS_INVALID_SIZE; if ( !_Addresses_Is_aligned( starting_address ) ) return RTEMS_INVALID_ADDRESS; 54ca0: 7009 moveq #9,%d0 ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 54ca2: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 54ca8: 4e5e unlk %fp 54caa: 4e75 rts return RTEMS_INVALID_ADDRESS; if ( !id ) return RTEMS_INVALID_ADDRESS; if ( length == 0 || buffer_size == 0 || length < buffer_size || 54cac: 4aae 0014 tstl %fp@(20) 54cb0: 67e2 beqs 54c94 54cb2: 202e 0014 movel %fp@(20),%d0 54cb6: b0ae 0010 cmpl %fp@(16),%d0 54cba: 62d8 bhis 54c94 */ RTEMS_INLINE_ROUTINE bool _Partition_Is_buffer_size_aligned ( uint32_t buffer_size ) { return ((buffer_size % CPU_PARTITION_ALIGNMENT) == 0); 54cbc: 7003 moveq #3,%d0 54cbe: c0ae 0014 andl %fp@(20),%d0 54cc2: 66d0 bnes 54c94 ) { #if (CPU_ALIGNMENT == 0) return true; #else return (((uintptr_t)address % CPU_ALIGNMENT) == 0); 54cc4: 103c 0003 moveb #3,%d0 54cc8: c0ae 000c andl %fp@(12),%d0 !_Partition_Is_buffer_size_aligned( buffer_size ) ) return RTEMS_INVALID_SIZE; if ( !_Addresses_Is_aligned( starting_address ) ) 54ccc: 66d2 bnes 54ca0 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 54cce: 2039 0007 dd4c movel 7dd4c <_Thread_Dispatch_disable_level>,%d0 54cd4: 5280 addql #1,%d0 54cd6: 23c0 0007 dd4c movel %d0,7dd4c <_Thread_Dispatch_disable_level> return _Thread_Dispatch_disable_level; 54cdc: 2039 0007 dd4c movel 7dd4c <_Thread_Dispatch_disable_level>,%d0 * This function allocates a partition control block from * the inactive chain of free partition control blocks. */ RTEMS_INLINE_ROUTINE Partition_Control *_Partition_Allocate ( void ) { return (Partition_Control *) _Objects_Allocate( &_Partition_Information ); 54ce2: 4879 0007 dbe2 pea 7dbe2 <_Partition_Information> 54ce8: 4eb9 0005 9a3c jsr 59a3c <_Objects_Allocate> _Thread_Disable_dispatch(); /* prevents deletion */ the_partition = _Partition_Allocate(); if ( !the_partition ) { 54cee: 588f addql #4,%sp 54cf0: 2440 moveal %d0,%a2 54cf2: 4a80 tstl %d0 54cf4: 676c beqs 54d62 return RTEMS_TOO_MANY; } #endif the_partition->starting_address = starting_address; the_partition->length = length; 54cf6: 262e 0010 movel %fp@(16),%d3 the_partition->buffer_size = buffer_size; the_partition->attribute_set = attribute_set; the_partition->number_of_used_blocks = 0; _Chain_Initialize( &the_partition->Memory, starting_address, 54cfa: 2003 movel %d3,%d0 return RTEMS_TOO_MANY; } #endif the_partition->starting_address = starting_address; the_partition->length = length; 54cfc: 2543 0014 movel %d3,%a2@(20) the_partition->buffer_size = buffer_size; the_partition->attribute_set = attribute_set; the_partition->number_of_used_blocks = 0; _Chain_Initialize( &the_partition->Memory, starting_address, 54d00: 262e 0014 movel %fp@(20),%d3 _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; } #endif the_partition->starting_address = starting_address; 54d04: 222e 000c movel %fp@(12),%d1 the_partition->length = length; the_partition->buffer_size = buffer_size; the_partition->attribute_set = attribute_set; 54d08: 256e 0018 001c movel %fp@(24),%a2@(28) _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; } #endif the_partition->starting_address = starting_address; 54d0e: 2541 0010 movel %d1,%a2@(16) the_partition->length = length; the_partition->buffer_size = buffer_size; the_partition->attribute_set = attribute_set; the_partition->number_of_used_blocks = 0; _Chain_Initialize( &the_partition->Memory, starting_address, 54d12: 4c43 0000 remul %d3,%d0,%d0 } #endif the_partition->starting_address = starting_address; the_partition->length = length; the_partition->buffer_size = buffer_size; 54d16: 2543 0018 movel %d3,%a2@(24) the_partition->attribute_set = attribute_set; the_partition->number_of_used_blocks = 0; 54d1a: 42aa 0020 clrl %a2@(32) _Chain_Initialize( &the_partition->Memory, starting_address, 54d1e: 2f03 movel %d3,%sp@- 54d20: 2f00 movel %d0,%sp@- 54d22: 2f2e 000c movel %fp@(12),%sp@- 54d26: 486a 0024 pea %a2@(36) 54d2a: 4eb9 0005 82f8 jsr 582f8 <_Chain_Initialize> Objects_Name name ) { _Objects_Set_local_object( information, _Objects_Get_index( the_object->id ), 54d30: 202a 0008 movel %a2@(8),%d0 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 54d34: 4281 clrl %d1 54d36: 2079 0007 dbfa moveal 7dbfa <_Partition_Information+0x18>,%a0 54d3c: 3200 movew %d0,%d1 54d3e: 218a 1c00 movel %a2,%a0@(00000000,%d1:l:4) &_Partition_Information, &the_partition->Object, (Objects_Name) name ); *id = the_partition->Object.id; 54d42: 206e 001c moveal %fp@(28),%a0 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 54d46: 2542 000c movel %d2,%a2@(12) 54d4a: 2080 movel %d0,%a0@ name, 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); 54d4c: 4eb9 0005 ad04 jsr 5ad04 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 54d52: 4fef 0010 lea %sp@(16),%sp 54d56: 4280 clrl %d0 } 54d58: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 54d5e: 4e5e unlk %fp 54d60: 4e75 rts _Thread_Disable_dispatch(); /* prevents deletion */ the_partition = _Partition_Allocate(); if ( !the_partition ) { _Thread_Enable_dispatch(); 54d62: 4eb9 0005 ad04 jsr 5ad04 <_Thread_Enable_dispatch> return RTEMS_TOO_MANY; 54d68: 7005 moveq #5,%d0 ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 54d6a: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 54d70: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00054e94 : rtems_status_code rtems_partition_return_buffer( rtems_id id, void *buffer ) { 54e94: 4e56 fff8 linkw %fp,#-8 54e98: 2f03 movel %d3,%sp@- 54e9a: 2f02 movel %d2,%sp@- RTEMS_INLINE_ROUTINE Partition_Control *_Partition_Get ( Objects_Id id, Objects_Locations *location ) { return (Partition_Control *) 54e9c: 486e fffc pea %fp@(-4) 54ea0: 2f2e 0008 movel %fp@(8),%sp@- 54ea4: 4879 0007 dbe2 pea 7dbe2 <_Partition_Information> 54eaa: 242e 000c movel %fp@(12),%d2 54eae: 4eb9 0005 9f3c jsr 59f3c <_Objects_Get> register Partition_Control *the_partition; Objects_Locations location; the_partition = _Partition_Get( id, &location ); switch ( location ) { 54eb4: 4fef 000c lea %sp@(12),%sp 54eb8: 4aae fffc tstl %fp@(-4) 54ebc: 665a bnes 54f18 ) { void *starting; void *ending; starting = the_partition->starting_address; 54ebe: 2040 moveal %d0,%a0 ending = _Addresses_Add_offset( starting, the_partition->length ); 54ec0: 2240 moveal %d0,%a1 ) { void *starting; void *ending; starting = the_partition->starting_address; 54ec2: 2228 0010 movel %a0@(16),%d1 ending = _Addresses_Add_offset( starting, the_partition->length ); 54ec6: 2068 0014 moveal %a0@(20),%a0 const void *address, const void *base, const void *limit ) { return (address >= base && address <= limit); 54eca: b282 cmpl %d2,%d1 54ecc: 6258 bhis 54f26 RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset ( const void *base, uintptr_t offset ) { return (void *)((uintptr_t)base + offset); 54ece: 41f0 1800 lea %a0@(00000000,%d1:l),%a0 const void *address, const void *base, const void *limit ) { return (address >= base && address <= limit); 54ed2: b1c2 cmpal %d2,%a0 54ed4: 6550 bcss 54f26 <== NEVER TAKEN RTEMS_INLINE_ROUTINE int32_t _Addresses_Subtract ( const void *left, const void *right ) { return (int32_t) ((const char *) left - (const char *) right); 54ed6: 2602 movel %d2,%d3 54ed8: 9681 subl %d1,%d3 54eda: 2203 movel %d3,%d1 offset = (uint32_t) _Addresses_Subtract( the_buffer, the_partition->starting_address ); return ((offset % the_partition->buffer_size) == 0); 54edc: 41e9 0018 lea %a1@(24),%a0 54ee0: 4c50 1003 remul %a0@,%d3,%d1 starting = the_partition->starting_address; ending = _Addresses_Add_offset( starting, the_partition->length ); return ( _Addresses_Is_in_range( the_buffer, starting, ending ) && 54ee4: 4a83 tstl %d3 54ee6: 663e bnes 54f26 RTEMS_INLINE_ROUTINE void _Partition_Free_buffer ( Partition_Control *the_partition, Chain_Node *the_buffer ) { _Chain_Append( &the_partition->Memory, the_buffer ); 54ee8: 2f02 movel %d2,%sp@- 54eea: 4869 0024 pea %a1@(36) 54eee: 2d40 fff8 movel %d0,%fp@(-8) 54ef2: 4eb9 0005 825c jsr 5825c <_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; 54ef8: 202e fff8 movel %fp@(-8),%d0 54efc: 2240 moveal %d0,%a1 54efe: 53a9 0020 subql #1,%a1@(32) _Thread_Enable_dispatch(); 54f02: 4eb9 0005 ad04 jsr 5ad04 <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 54f08: 242e fff0 movel %fp@(-16),%d2 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(); return RTEMS_SUCCESSFUL; 54f0c: 508f addql #8,%sp 54f0e: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 54f10: 262e fff4 movel %fp@(-12),%d3 54f14: 4e5e unlk %fp 54f16: 4e75 rts 54f18: 242e fff0 movel %fp@(-16),%d2 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 54f1c: 7004 moveq #4,%d0 } 54f1e: 262e fff4 movel %fp@(-12),%d3 54f22: 4e5e unlk %fp 54f24: 4e75 rts _Partition_Free_buffer( the_partition, buffer ); the_partition->number_of_used_blocks -= 1; _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } _Thread_Enable_dispatch(); 54f26: 4eb9 0005 ad04 jsr 5ad04 <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 54f2c: 242e fff0 movel %fp@(-16),%d2 the_partition->number_of_used_blocks -= 1; _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } _Thread_Enable_dispatch(); return RTEMS_INVALID_ADDRESS; 54f30: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 54f32: 262e fff4 movel %fp@(-12),%d3 54f36: 4e5e unlk %fp ... =============================================================================== 00054278 : rtems_status_code rtems_port_external_to_internal( rtems_id id, void *external, void **internal ) { 54278: 4e56 fffc linkw %fp,#-4 5427c: 2f0a movel %a2,%sp@- 5427e: 246e 0010 moveal %fp@(16),%a2 register Dual_ported_memory_Control *the_port; Objects_Locations location; uint32_t ending; if ( !internal ) 54282: 4a8a tstl %a2 54284: 674c beqs 542d2 RTEMS_INLINE_ROUTINE Dual_ported_memory_Control *_Dual_ported_memory_Get ( Objects_Id id, Objects_Locations *location ) { return (Dual_ported_memory_Control *) 54286: 486e fffc pea %fp@(-4) 5428a: 2f2e 0008 movel %fp@(8),%sp@- 5428e: 4879 0007 dba8 pea 7dba8 <_Dual_ported_memory_Information> 54294: 4eb9 0005 9f3c jsr 59f3c <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_port = _Dual_ported_memory_Get( id, &location ); switch ( location ) { 5429a: 4fef 000c lea %sp@(12),%sp 5429e: 4aae fffc tstl %fp@(-4) 542a2: 6624 bnes 542c8 RTEMS_INLINE_ROUTINE int32_t _Addresses_Subtract ( const void *left, const void *right ) { return (int32_t) ((const char *) left - (const char *) right); 542a4: 222e 000c movel %fp@(12),%d1 542a8: 2040 moveal %d0,%a0 542aa: 92a8 0014 subl %a0@(20),%d1 case OBJECTS_LOCAL: ending = _Addresses_Subtract( external, the_port->external_base ); if ( ending > the_port->length ) 542ae: b2a8 0018 cmpl %a0@(24),%d1 542b2: 6328 blss 542dc *internal = external; 542b4: 24ae 000c movel %fp@(12),%a2@ else *internal = _Addresses_Add_offset( the_port->internal_base, ending ); _Thread_Enable_dispatch(); 542b8: 4eb9 0005 ad04 jsr 5ad04 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 542be: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 542c0: 246e fff8 moveal %fp@(-8),%a2 542c4: 4e5e unlk %fp 542c6: 4e75 rts 542c8: 246e fff8 moveal %fp@(-8),%a2 #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 542cc: 7004 moveq #4,%d0 } 542ce: 4e5e unlk %fp 542d0: 4e75 rts 542d2: 246e fff8 moveal %fp@(-8),%a2 register Dual_ported_memory_Control *the_port; Objects_Locations location; uint32_t ending; if ( !internal ) return RTEMS_INVALID_ADDRESS; 542d6: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 542d8: 4e5e unlk %fp 542da: 4e75 rts RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset ( const void *base, uintptr_t offset ) { return (void *)((uintptr_t)base + offset); 542dc: 2040 moveal %d0,%a0 542de: d2a8 0010 addl %a0@(16),%d1 542e2: 2481 movel %d1,%a2@ if ( ending > the_port->length ) *internal = external; else *internal = _Addresses_Add_offset( the_port->internal_base, ending ); _Thread_Enable_dispatch(); 542e4: 4eb9 0005 ad04 jsr 5ad04 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 542ea: 4280 clrl %d0 542ec: 60d2 bras 542c0 ... =============================================================================== 00054318 : rtems_status_code rtems_port_internal_to_external( rtems_id id, void *internal, void **external ) { 54318: 4e56 fffc linkw %fp,#-4 5431c: 2f0a movel %a2,%sp@- 5431e: 246e 0010 moveal %fp@(16),%a2 register Dual_ported_memory_Control *the_port; Objects_Locations location; uint32_t ending; if ( !external ) 54322: 4a8a tstl %a2 54324: 674c beqs 54372 54326: 486e fffc pea %fp@(-4) 5432a: 2f2e 0008 movel %fp@(8),%sp@- 5432e: 4879 0007 dba8 pea 7dba8 <_Dual_ported_memory_Information> 54334: 4eb9 0005 9f3c jsr 59f3c <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_port = _Dual_ported_memory_Get( id, &location ); switch ( location ) { 5433a: 4fef 000c lea %sp@(12),%sp 5433e: 4aae fffc tstl %fp@(-4) 54342: 6624 bnes 54368 RTEMS_INLINE_ROUTINE int32_t _Addresses_Subtract ( const void *left, const void *right ) { return (int32_t) ((const char *) left - (const char *) right); 54344: 222e 000c movel %fp@(12),%d1 54348: 2040 moveal %d0,%a0 5434a: 92a8 0010 subl %a0@(16),%d1 case OBJECTS_LOCAL: ending = _Addresses_Subtract( internal, the_port->internal_base ); if ( ending > the_port->length ) 5434e: b2a8 0018 cmpl %a0@(24),%d1 54352: 6328 blss 5437c *external = internal; 54354: 24ae 000c movel %fp@(12),%a2@ else *external = _Addresses_Add_offset( the_port->external_base, ending ); _Thread_Enable_dispatch(); 54358: 4eb9 0005 ad04 jsr 5ad04 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 5435e: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 54360: 246e fff8 moveal %fp@(-8),%a2 54364: 4e5e unlk %fp 54366: 4e75 rts 54368: 246e fff8 moveal %fp@(-8),%a2 #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 5436c: 7004 moveq #4,%d0 } 5436e: 4e5e unlk %fp 54370: 4e75 rts 54372: 246e fff8 moveal %fp@(-8),%a2 register Dual_ported_memory_Control *the_port; Objects_Locations location; uint32_t ending; if ( !external ) return RTEMS_INVALID_ADDRESS; 54376: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 54378: 4e5e unlk %fp 5437a: 4e75 rts RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset ( const void *base, uintptr_t offset ) { return (void *)((uintptr_t)base + offset); 5437c: 2040 moveal %d0,%a0 5437e: d2a8 0014 addl %a0@(20),%d1 54382: 2481 movel %d1,%a2@ if ( ending > the_port->length ) *external = internal; else *external = _Addresses_Add_offset( the_port->external_base, ending ); _Thread_Enable_dispatch(); 54384: 4eb9 0005 ad04 jsr 5ad04 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 5438a: 4280 clrl %d0 5438c: 60d2 bras 54360 ... =============================================================================== 00047970 : rtems_status_code rtems_rate_monotonic_period( rtems_id id, rtems_interval length ) { 47970: 4e56 fff8 linkw %fp,#-8 47974: 2f03 movel %d3,%sp@- 47976: 2f02 movel %d2,%sp@- RTEMS_INLINE_ROUTINE Rate_monotonic_Control *_Rate_monotonic_Get ( Objects_Id id, Objects_Locations *location ) { return (Rate_monotonic_Control *) 47978: 486e fffc pea %fp@(-4) 4797c: 242e 0008 movel %fp@(8),%d2 47980: 2f02 movel %d2,%sp@- 47982: 4879 0006 2e4c pea 62e4c <_Rate_monotonic_Information> 47988: 4eb9 0004 9dd4 jsr 49dd4 <_Objects_Get> rtems_rate_monotonic_period_states local_state; ISR_Level level; the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 4798e: 4fef 000c lea %sp@(12),%sp 47992: 4aae fffc tstl %fp@(-4) 47996: 6624 bnes 479bc case OBJECTS_LOCAL: if ( !_Thread_Is_executing( the_period->owner ) ) { 47998: 2279 0006 33a4 moveal 633a4 <_Per_CPU_Information+0xc>,%a1 4799e: 2040 moveal %d0,%a0 479a0: b3e8 0040 cmpal %a0@(64),%a1 479a4: 6726 beqs 479cc _Thread_Enable_dispatch(); 479a6: 4eb9 0004 ab9c jsr 4ab9c <_Thread_Enable_dispatch> return RTEMS_NOT_OWNER_OF_RESOURCE; 479ac: 7617 moveq #23,%d3 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 479ae: 2003 movel %d3,%d0 479b0: 242e fff0 movel %fp@(-16),%d2 479b4: 262e fff4 movel %fp@(-12),%d3 479b8: 4e5e unlk %fp 479ba: 4e75 rts #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 479bc: 7604 moveq #4,%d3 } 479be: 2003 movel %d3,%d0 479c0: 242e fff0 movel %fp@(-16),%d2 479c4: 262e fff4 movel %fp@(-12),%d3 479c8: 4e5e unlk %fp 479ca: 4e75 rts if ( !_Thread_Is_executing( the_period->owner ) ) { _Thread_Enable_dispatch(); return RTEMS_NOT_OWNER_OF_RESOURCE; } if ( length == RTEMS_PERIOD_STATUS ) { 479cc: 4aae 000c tstl %fp@(12) 479d0: 6700 008c beqw 47a5e } _Thread_Enable_dispatch(); return( return_value ); } _ISR_Disable( level ); 479d4: 223c 0000 0700 movel #1792,%d1 479da: 40c3 movew %sr,%d3 479dc: 8283 orl %d3,%d1 479de: 46c1 movew %d1,%sr if ( the_period->state == RATE_MONOTONIC_INACTIVE ) { 479e0: 2040 moveal %d0,%a0 479e2: 2228 0038 movel %a0@(56),%d1 479e6: 6700 00aa beqw 47a92 _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } if ( the_period->state == RATE_MONOTONIC_ACTIVE ) { 479ea: 7402 moveq #2,%d2 479ec: b481 cmpl %d1,%d2 479ee: 6700 010c beqw 47afc _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } if ( the_period->state == RATE_MONOTONIC_EXPIRED ) { 479f2: 7404 moveq #4,%d2 479f4: b481 cmpl %d1,%d2 479f6: 66c4 bnes 479bc <== NEVER TAKEN /* * Update statistics from the concluding period */ _Rate_monotonic_Update_statistics( the_period ); 479f8: 2f00 movel %d0,%sp@- 479fa: 2d40 fff8 movel %d0,%fp@(-8) 479fe: 4eb9 0004 7856 jsr 47856 <_Rate_monotonic_Update_statistics> _ISR_Enable( level ); 47a04: 46c3 movew %d3,%sr the_period->state = RATE_MONOTONIC_ACTIVE; 47a06: 7202 moveq #2,%d1 the_period->next_length = length; _Watchdog_Insert_ticks( &the_period->Timer, length ); _Scheduler_Release_job(the_period->owner, the_period->next_length); _Thread_Enable_dispatch(); return RTEMS_TIMEOUT; 47a08: 7606 moveq #6,%d3 */ _Rate_monotonic_Update_statistics( the_period ); _ISR_Enable( level ); the_period->state = RATE_MONOTONIC_ACTIVE; 47a0a: 202e fff8 movel %fp@(-8),%d0 47a0e: 2040 moveal %d0,%a0 the_period->next_length = length; 47a10: 226e 000c moveal %fp@(12),%a1 */ _Rate_monotonic_Update_statistics( the_period ); _ISR_Enable( level ); the_period->state = RATE_MONOTONIC_ACTIVE; 47a14: 2141 0038 movel %d1,%a0@(56) the_period->next_length = length; 47a18: 2149 003c movel %a1,%a0@(60) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 47a1c: 2149 001c movel %a1,%a0@(28) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 47a20: 4868 0010 pea %a0@(16) 47a24: 4879 0006 2ffa pea 62ffa <_Watchdog_Ticks_chain> 47a2a: 4eb9 0004 ba94 jsr 4ba94 <_Watchdog_Insert> 47a30: 202e fff8 movel %fp@(-8),%d0 47a34: 2040 moveal %d0,%a0 47a36: 2f28 003c movel %a0@(60),%sp@- 47a3a: 2f28 0040 movel %a0@(64),%sp@- 47a3e: 2079 0006 1592 moveal 61592 <_Scheduler+0x34>,%a0 47a44: 4e90 jsr %a0@ _Watchdog_Insert_ticks( &the_period->Timer, length ); _Scheduler_Release_job(the_period->owner, the_period->next_length); _Thread_Enable_dispatch(); 47a46: 4eb9 0004 ab9c jsr 4ab9c <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 47a4c: 242e fff0 movel %fp@(-16),%d2 47a50: 2003 movel %d3,%d0 the_period->next_length = length; _Watchdog_Insert_ticks( &the_period->Timer, length ); _Scheduler_Release_job(the_period->owner, the_period->next_length); _Thread_Enable_dispatch(); return RTEMS_TIMEOUT; 47a52: 4fef 0014 lea %sp@(20),%sp case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 47a56: 262e fff4 movel %fp@(-12),%d3 47a5a: 4e5e unlk %fp 47a5c: 4e75 rts _Thread_Enable_dispatch(); return RTEMS_NOT_OWNER_OF_RESOURCE; } if ( length == RTEMS_PERIOD_STATUS ) { switch ( the_period->state ) { 47a5e: 2040 moveal %d0,%a0 47a60: 7204 moveq #4,%d1 47a62: 2028 0038 movel %a0@(56),%d0 47a66: b280 cmpl %d0,%d1 47a68: 651e bcss 47a88 <== NEVER TAKEN 47a6a: 41f9 0006 049a lea 6049a ,%a0 47a70: 2630 0c00 movel %a0@(00000000,%d0:l:4),%d3 case RATE_MONOTONIC_ACTIVE: default: /* unreached -- only to remove warnings */ return_value = RTEMS_SUCCESSFUL; break; } _Thread_Enable_dispatch(); 47a74: 4eb9 0004 ab9c jsr 4ab9c <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 47a7a: 2003 movel %d3,%d0 47a7c: 242e fff0 movel %fp@(-16),%d2 47a80: 262e fff4 movel %fp@(-12),%d3 47a84: 4e5e unlk %fp 47a86: 4e75 rts _Thread_Enable_dispatch(); return RTEMS_NOT_OWNER_OF_RESOURCE; } if ( length == RTEMS_PERIOD_STATUS ) { switch ( the_period->state ) { 47a88: 4283 clrl %d3 <== NOT EXECUTED case RATE_MONOTONIC_ACTIVE: default: /* unreached -- only to remove warnings */ return_value = RTEMS_SUCCESSFUL; break; } _Thread_Enable_dispatch(); 47a8a: 4eb9 0004 ab9c jsr 4ab9c <_Thread_Enable_dispatch> <== NOT EXECUTED 47a90: 60e8 bras 47a7a <== NOT EXECUTED return( return_value ); } _ISR_Disable( level ); if ( the_period->state == RATE_MONOTONIC_INACTIVE ) { _ISR_Enable( level ); 47a92: 46c3 movew %d3,%sr the_period->next_length = length; 47a94: 226e 000c moveal %fp@(12),%a1 NULL ); _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; 47a98: 4283 clrl %d3 _ISR_Disable( level ); if ( the_period->state == RATE_MONOTONIC_INACTIVE ) { _ISR_Enable( level ); the_period->next_length = length; 47a9a: 2149 003c movel %a1,%a0@(60) /* * Baseline statistics information for the beginning of a period. */ _Rate_monotonic_Initiate_statistics( the_period ); 47a9e: 2f00 movel %d0,%sp@- 47aa0: 2d40 fff8 movel %d0,%fp@(-8) 47aa4: 4eb9 0004 77b0 jsr 477b0 <_Rate_monotonic_Initiate_statistics> Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 47aaa: 202e fff8 movel %fp@(-8),%d0 47aae: 2040 moveal %d0,%a0 47ab0: 43f9 0004 7e14 lea 47e14 <_Rate_monotonic_Timeout>,%a1 the_period->state = RATE_MONOTONIC_ACTIVE; 47ab6: 7202 moveq #2,%d1 the_watchdog->id = id; 47ab8: 2142 0030 movel %d2,%a0@(48) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 47abc: 242e 000c movel %fp@(12),%d2 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 47ac0: 2149 002c movel %a1,%a0@(44) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 47ac4: 2142 001c movel %d2,%a0@(28) 47ac8: 2141 0038 movel %d1,%a0@(56) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 47acc: 42a8 0018 clrl %a0@(24) the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 47ad0: 42a8 0034 clrl %a0@(52) ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 47ad4: 4868 0010 pea %a0@(16) 47ad8: 4879 0006 2ffa pea 62ffa <_Watchdog_Ticks_chain> 47ade: 4eb9 0004 ba94 jsr 4ba94 <_Watchdog_Insert> id, NULL ); _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 47ae4: 4eb9 0004 ab9c jsr 4ab9c <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 47aea: 242e fff0 movel %fp@(-16),%d2 47aee: 2003 movel %d3,%d0 NULL ); _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; 47af0: 4fef 000c lea %sp@(12),%sp case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 47af4: 262e fff4 movel %fp@(-12),%d3 47af8: 4e5e unlk %fp 47afa: 4e75 rts if ( the_period->state == RATE_MONOTONIC_ACTIVE ) { /* * Update statistics from the concluding period. */ _Rate_monotonic_Update_statistics( the_period ); 47afc: 2f00 movel %d0,%sp@- 47afe: 2d40 fff8 movel %d0,%fp@(-8) 47b02: 4eb9 0004 7856 jsr 47856 <_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; 47b08: 202e fff8 movel %fp@(-8),%d0 47b0c: 7201 moveq #1,%d1 47b0e: 2040 moveal %d0,%a0 the_period->next_length = length; 47b10: 226e 000c moveal %fp@(12),%a1 /* * 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; 47b14: 2141 0038 movel %d1,%a0@(56) the_period->next_length = length; 47b18: 2149 003c movel %a1,%a0@(60) _ISR_Enable( level ); 47b1c: 46c3 movew %d3,%sr _Thread_Executing->Wait.id = the_period->Object.id; 47b1e: 2079 0006 33a4 moveal 633a4 <_Per_CPU_Information+0xc>,%a0 47b24: 2240 moveal %d0,%a1 47b26: 5089 addql #8,%a1 47b28: 2151 0020 movel %a1@,%a0@(32) _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 47b2c: 4878 4000 pea 4000 47b30: 2d40 fff8 movel %d0,%fp@(-8) 47b34: 2f08 movel %a0,%sp@- 47b36: 4eb9 0004 b474 jsr 4b474 <_Thread_Set_state> /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); 47b3c: 223c 0000 0700 movel #1792,%d1 47b42: 40c2 movew %sr,%d2 47b44: 8282 orl %d2,%d1 47b46: 46c1 movew %d1,%sr local_state = the_period->state; the_period->state = RATE_MONOTONIC_ACTIVE; 47b48: 7602 moveq #2,%d3 /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); local_state = the_period->state; 47b4a: 202e fff8 movel %fp@(-8),%d0 47b4e: 2040 moveal %d0,%a0 47b50: 2228 0038 movel %a0@(56),%d1 the_period->state = RATE_MONOTONIC_ACTIVE; 47b54: 2143 0038 movel %d3,%a0@(56) _ISR_Enable( level ); 47b58: 46c2 movew %d2,%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 ) 47b5a: 7003 moveq #3,%d0 47b5c: 4fef 000c lea %sp@(12),%sp 47b60: b081 cmpl %d1,%d0 47b62: 6716 beqs 47b7a _Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); _Thread_Enable_dispatch(); 47b64: 4eb9 0004 ab9c jsr 4ab9c <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 47b6a: 4283 clrl %d3 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 47b6c: 2003 movel %d3,%d0 47b6e: 242e fff0 movel %fp@(-16),%d2 47b72: 262e fff4 movel %fp@(-12),%d3 47b76: 4e5e unlk %fp 47b78: 4e75 rts /* * If it did, then we want to unblock ourself and continue as * if nothing happen. The period was reset in the timeout routine. */ if ( local_state == RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING ) _Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 47b7a: 4878 4000 pea 4000 _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; 47b7e: 4283 clrl %d3 /* * If it did, then we want to unblock ourself and continue as * if nothing happen. The period was reset in the timeout routine. */ if ( local_state == RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING ) _Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 47b80: 2f39 0006 33a4 movel 633a4 <_Per_CPU_Information+0xc>,%sp@- 47b86: 4eb9 0004 a7a0 jsr 4a7a0 <_Thread_Clear_state> 47b8c: 508f addql #8,%sp _Thread_Enable_dispatch(); 47b8e: 4eb9 0004 ab9c jsr 4ab9c <_Thread_Enable_dispatch> 47b94: 60d6 bras 47b6c ... =============================================================================== 00047b98 : */ void rtems_rate_monotonic_report_statistics_with_plugin( void *context, rtems_printk_plugin_t print ) { 47b98: 4e56 ff78 linkw %fp,#-136 47b9c: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 47ba0: 262e 0008 movel %fp@(8),%d3 47ba4: 246e 000c moveal %fp@(12),%a2 rtems_id id; rtems_rate_monotonic_period_statistics the_stats; rtems_rate_monotonic_period_status the_status; char name[5]; if ( !print ) 47ba8: 4a8a tstl %a2 47baa: 677c beqs 47c28 <== NEVER TAKEN return; (*print)( context, "Period information by period\n" ); 47bac: 4879 0006 04ae pea 604ae 47bb2: 2f03 movel %d3,%sp@- 47bb4: 4e92 jsr %a2@ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ (*print)( context, "--- CPU times are in seconds ---\n" ); 47bb6: 4879 0006 04cc pea 604cc 47bbc: 2f03 movel %d3,%sp@- 47bbe: 4e92 jsr %a2@ (*print)( context, "--- Wall times are in seconds ---\n" ); 47bc0: 4879 0006 04ee pea 604ee 47bc6: 2f03 movel %d3,%sp@- 47bc8: 4e92 jsr %a2@ Be sure to test the various cases. (*print)( context,"\ 1234567890123456789012345678901234567890123456789012345678901234567890123456789\ \n"); */ (*print)( context, " ID OWNER COUNT MISSED " 47bca: 4879 0006 0511 pea 60511 47bd0: 2f03 movel %d3,%sp@- 47bd2: 4e92 jsr %a2@ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ " " #endif " WALL TIME\n" ); (*print)( context, " " 47bd4: 4fef 001c lea %sp@(28),%sp 47bd8: 2ebc 0006 055c movel #394588,%sp@ 47bde: 2f03 movel %d3,%sp@- 47be0: 4e92 jsr %a2@ /* * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 47be2: 2439 0006 2e52 movel 62e52 <_Rate_monotonic_Information+0x6>,%d2 47be8: 508f addql #8,%sp 47bea: b4b9 0006 2e56 cmpl 62e56 <_Rate_monotonic_Information+0xa>,%d2 47bf0: 6236 bhis 47c28 <== NEVER TAKEN 47bf2: 280e movel %fp,%d4 #if defined(RTEMS_DEBUG) status = rtems_rate_monotonic_get_status( id, &the_status ); if ( status != RTEMS_SUCCESSFUL ) continue; #else (void) rtems_rate_monotonic_get_status( id, &the_status ); 47bf4: 2c0e movel %fp,%d6 #endif rtems_object_get_name( the_status.owner, sizeof(name), name ); 47bf6: 2a0e movel %fp,%d5 47bf8: 0684 ffff ffa2 addil #-94,%d4 47bfe: 47f9 0004 e2d8 lea 4e2d8 ,%a3 #if defined(RTEMS_DEBUG) status = rtems_rate_monotonic_get_status( id, &the_status ); if ( status != RTEMS_SUCCESSFUL ) continue; #else (void) rtems_rate_monotonic_get_status( id, &the_status ); 47c04: 0686 ffff ffda addil #-38,%d6 47c0a: 4bf9 0004 e3ac lea 4e3ac ,%a5 #endif rtems_object_get_name( the_status.owner, sizeof(name), name ); 47c10: 5b85 subql #5,%d5 * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; id <= _Rate_monotonic_Information.maximum_id ; id++ ) { status = rtems_rate_monotonic_get_statistics( id, &the_stats ); 47c12: 2f04 movel %d4,%sp@- 47c14: 2f02 movel %d2,%sp@- 47c16: 4e93 jsr %a3@ if ( status != RTEMS_SUCCESSFUL ) 47c18: 508f addql #8,%sp 47c1a: 4a80 tstl %d0 47c1c: 6714 beqs 47c32 * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; id <= _Rate_monotonic_Information.maximum_id ; id++ ) { 47c1e: 5282 addql #1,%d2 /* * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 47c20: b4b9 0006 2e56 cmpl 62e56 <_Rate_monotonic_Information+0xa>,%d2 47c26: 63ea blss 47c12 the_stats.min_wall_time, the_stats.max_wall_time, ival_wall, fval_wall ); #endif } } } 47c28: 4cee 3cfc ff78 moveml %fp@(-136),%d2-%d7/%a2-%a5 47c2e: 4e5e unlk %fp 47c30: 4e75 rts #if defined(RTEMS_DEBUG) status = rtems_rate_monotonic_get_status( id, &the_status ); if ( status != RTEMS_SUCCESSFUL ) continue; #else (void) rtems_rate_monotonic_get_status( id, &the_status ); 47c32: 2f06 movel %d6,%sp@- struct timespec cpu_average; struct timespec *min_cpu = &the_stats.min_cpu_time; struct timespec *max_cpu = &the_stats.max_cpu_time; struct timespec *total_cpu = &the_stats.total_cpu_time; _Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average ); 47c34: 49f9 0004 b690 lea 4b690 <_Timespec_Divide_by_integer>,%a4 #if defined(RTEMS_DEBUG) status = rtems_rate_monotonic_get_status( id, &the_status ); if ( status != RTEMS_SUCCESSFUL ) continue; #else (void) rtems_rate_monotonic_get_status( id, &the_status ); 47c3a: 2f02 movel %d2,%sp@- 47c3c: 4e95 jsr %a5@ #endif rtems_object_get_name( the_status.owner, sizeof(name), name ); 47c3e: 2f05 movel %d5,%sp@- 47c40: 4878 0005 pea 5 47c44: 2f2e ffda movel %fp@(-38),%sp@- 47c48: 4eb9 0004 7f08 jsr 47f08 /* * Print part of report line that is not dependent on granularity */ (*print)( context, 47c4e: 2f2e ffa6 movel %fp@(-90),%sp@- 47c52: 2f2e ffa2 movel %fp@(-94),%sp@- 47c56: 2f05 movel %d5,%sp@- 47c58: 2f02 movel %d2,%sp@- 47c5a: 4879 0006 05a8 pea 605a8 47c60: 2f03 movel %d3,%sp@- 47c62: 4e92 jsr %a2@ ); /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { 47c64: 202e ffa2 movel %fp@(-94),%d0 47c68: 4fef 002c lea %sp@(44),%sp 47c6c: 6618 bnes 47c86 (*print)( context, "\n" ); 47c6e: 4879 0005 fb47 pea 5fb47 * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; id <= _Rate_monotonic_Information.maximum_id ; id++ ) { 47c74: 5282 addql #1,%d2 /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { (*print)( context, "\n" ); 47c76: 2f03 movel %d3,%sp@- 47c78: 4e92 jsr %a2@ continue; 47c7a: 508f addql #8,%sp /* * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 47c7c: b4b9 0006 2e56 cmpl 62e56 <_Rate_monotonic_Information+0xa>,%d2 47c82: 638e blss 47c12 <== ALWAYS TAKEN 47c84: 60a2 bras 47c28 <== NOT EXECUTED struct timespec cpu_average; struct timespec *min_cpu = &the_stats.min_cpu_time; struct timespec *max_cpu = &the_stats.max_cpu_time; struct timespec *total_cpu = &the_stats.total_cpu_time; _Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average ); 47c86: 486e fff2 pea %fp@(-14) * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; id <= _Rate_monotonic_Information.maximum_id ; id++ ) { 47c8a: 5282 addql #1,%d2 struct timespec cpu_average; struct timespec *min_cpu = &the_stats.min_cpu_time; struct timespec *max_cpu = &the_stats.max_cpu_time; struct timespec *total_cpu = &the_stats.total_cpu_time; _Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average ); 47c8c: 2f00 movel %d0,%sp@- 47c8e: 486e ffba pea %fp@(-70) 47c92: 4e94 jsr %a4@ (*print)( context, 47c94: 202e fff6 movel %fp@(-10),%d0 47c98: 223c 0000 03e8 movel #1000,%d1 47c9e: 4c41 0800 remsl %d1,%d0,%d0 47ca2: 2e2e ffb6 movel %fp@(-74),%d7 47ca6: 2f00 movel %d0,%sp@- 47ca8: 2001 movel %d1,%d0 47caa: 2f2e fff2 movel %fp@(-14),%sp@- 47cae: 4c40 7807 remsl %d0,%d7,%d7 47cb2: 202e ffae movel %fp@(-82),%d0 47cb6: 2247 moveal %d7,%a1 47cb8: 223c 0000 03e8 movel #1000,%d1 47cbe: 2f09 movel %a1,%sp@- 47cc0: 2f2e ffb2 movel %fp@(-78),%sp@- 47cc4: 4c41 0800 remsl %d1,%d0,%d0 struct timespec *min_wall = &the_stats.min_wall_time; struct timespec *max_wall = &the_stats.max_wall_time; struct timespec *total_wall = &the_stats.total_wall_time; _Timespec_Divide_by_integer(total_wall, the_stats.count, &wall_average); (*print)( context, 47cc8: 2e3c 0000 03e8 movel #1000,%d7 struct timespec *min_cpu = &the_stats.min_cpu_time; struct timespec *max_cpu = &the_stats.max_cpu_time; struct timespec *total_cpu = &the_stats.total_cpu_time; _Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average ); (*print)( context, 47cce: 2f00 movel %d0,%sp@- 47cd0: 2f2e ffaa movel %fp@(-86),%sp@- 47cd4: 4879 0006 05bf pea 605bf 47cda: 2f03 movel %d3,%sp@- 47cdc: 4e92 jsr %a2@ struct timespec wall_average; struct timespec *min_wall = &the_stats.min_wall_time; struct timespec *max_wall = &the_stats.max_wall_time; struct timespec *total_wall = &the_stats.total_wall_time; _Timespec_Divide_by_integer(total_wall, the_stats.count, &wall_average); 47cde: 4fef 002c lea %sp@(44),%sp 47ce2: 486e fff2 pea %fp@(-14) 47ce6: 2f2e ffa2 movel %fp@(-94),%sp@- 47cea: 486e ffd2 pea %fp@(-46) 47cee: 4e94 jsr %a4@ (*print)( context, 47cf0: 202e fff6 movel %fp@(-10),%d0 47cf4: 4c47 0800 remsl %d7,%d0,%d0 47cf8: 222e ffce movel %fp@(-50),%d1 47cfc: 2f00 movel %d0,%sp@- 47cfe: 2f2e fff2 movel %fp@(-14),%sp@- 47d02: 4c47 1801 remsl %d7,%d1,%d1 47d06: 202e ffc6 movel %fp@(-58),%d0 47d0a: 2241 moveal %d1,%a1 47d0c: 2f09 movel %a1,%sp@- 47d0e: 2f2e ffca movel %fp@(-54),%sp@- 47d12: 4c47 0800 remsl %d7,%d0,%d0 47d16: 2f00 movel %d0,%sp@- 47d18: 2f2e ffc2 movel %fp@(-62),%sp@- 47d1c: 4879 0006 05de pea 605de 47d22: 2f03 movel %d3,%sp@- 47d24: 4e92 jsr %a2@ 47d26: 4fef 002c lea %sp@(44),%sp /* * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 47d2a: b4b9 0006 2e56 cmpl 62e56 <_Rate_monotonic_Information+0xa>,%d2 47d30: 6300 fee0 blsw 47c12 47d34: 6000 fef2 braw 47c28 <== NOT EXECUTED =============================================================================== 00047d50 : /* * rtems_rate_monotonic_reset_all_statistics */ void rtems_rate_monotonic_reset_all_statistics( void ) { 47d50: 4e56 0000 linkw %fp,#0 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 47d54: 2039 0006 2f42 movel 62f42 <_Thread_Dispatch_disable_level>,%d0 47d5a: 5280 addql #1,%d0 47d5c: 2f0a movel %a2,%sp@- 47d5e: 23c0 0006 2f42 movel %d0,62f42 <_Thread_Dispatch_disable_level> return _Thread_Dispatch_disable_level; 47d64: 2039 0006 2f42 movel 62f42 <_Thread_Dispatch_disable_level>,%d0 47d6a: 2f02 movel %d2,%sp@- /* * Cycle through all possible ids and try to reset each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 47d6c: 2439 0006 2e52 movel 62e52 <_Rate_monotonic_Information+0x6>,%d2 47d72: b4b9 0006 2e56 cmpl 62e56 <_Rate_monotonic_Information+0xa>,%d2 47d78: 6216 bhis 47d90 <== NEVER TAKEN 47d7a: 45f9 0004 7da0 lea 47da0 ,%a2 id <= _Rate_monotonic_Information.maximum_id ; id++ ) { (void) rtems_rate_monotonic_reset_statistics( id ); 47d80: 2f02 movel %d2,%sp@- * Cycle through all possible ids and try to reset each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; id <= _Rate_monotonic_Information.maximum_id ; id++ ) { 47d82: 5282 addql #1,%d2 (void) rtems_rate_monotonic_reset_statistics( id ); 47d84: 4e92 jsr %a2@ /* * Cycle through all possible ids and try to reset each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 47d86: 588f addql #4,%sp 47d88: b4b9 0006 2e56 cmpl 62e56 <_Rate_monotonic_Information+0xa>,%d2 47d8e: 63f0 blss 47d80 /* * Done so exit thread dispatching disabled critical section. */ _Thread_Enable_dispatch(); } 47d90: 242e fff8 movel %fp@(-8),%d2 47d94: 246e fffc moveal %fp@(-4),%a2 47d98: 4e5e unlk %fp } /* * Done so exit thread dispatching disabled critical section. */ _Thread_Enable_dispatch(); 47d9a: 4ef9 0004 ab9c jmp 4ab9c <_Thread_Enable_dispatch> =============================================================================== 00055a80 : rtems_status_code rtems_region_extend( rtems_id id, void *starting_address, uintptr_t length ) { 55a80: 4e56 fff8 linkw %fp,#-8 55a84: 2f0a movel %a2,%sp@- 55a86: 2f02 movel %d2,%sp@- 55a88: 242e 000c movel %fp@(12),%d2 bool extend_ok; Objects_Locations location; rtems_status_code return_status; Region_Control *the_region; if ( !starting_address ) 55a8c: 6700 0086 beqw 55b14 return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); /* to prevent deletion */ 55a90: 2f39 0007 ddec movel 7ddec <_RTEMS_Allocator_Mutex>,%sp@- 55a96: 4eb9 0005 81c4 jsr 581c4 <_API_Mutex_Lock> RTEMS_INLINE_ROUTINE Region_Control *_Region_Get ( Objects_Id id, Objects_Locations *location ) { return (Region_Control *) 55a9c: 486e fffc pea %fp@(-4) 55aa0: 2f2e 0008 movel %fp@(8),%sp@- 55aa4: 4879 0007 dc56 pea 7dc56 <_Region_Information> 55aaa: 4eb9 0005 9f00 jsr 59f00 <_Objects_Get_no_protection> the_region = _Region_Get( id, &location ); switch ( location ) { 55ab0: 4fef 0010 lea %sp@(16),%sp 55ab4: 2440 moveal %d0,%a2 55ab6: 4aae fffc tstl %fp@(-4) 55aba: 6646 bnes 55b02 case OBJECTS_LOCAL: extend_ok = _Heap_Extend( 55abc: 486e fff8 pea %fp@(-8) 55ac0: 2f2e 0010 movel %fp@(16),%sp@- 55ac4: 2f02 movel %d2,%sp@- 55ac6: 486a 0068 pea %a2@(104) 55aca: 4eb9 0005 8fc4 jsr 58fc4 <_Heap_Extend> starting_address, length, &amount_extended ); if ( extend_ok ) { 55ad0: 4fef 0010 lea %sp@(16),%sp 55ad4: 4a00 tstb %d0 55ad6: 674c beqs 55b24 the_region->length += amount_extended; 55ad8: 202e fff8 movel %fp@(-8),%d0 55adc: d1aa 0054 addl %d0,%a2@(84) the_region->maximum_segment_size += amount_extended; return_status = RTEMS_SUCCESSFUL; 55ae0: 4282 clrl %d2 &amount_extended ); if ( extend_ok ) { the_region->length += amount_extended; the_region->maximum_segment_size += amount_extended; 55ae2: d1aa 005c addl %d0,%a2@(92) default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 55ae6: 2f39 0007 ddec movel 7ddec <_RTEMS_Allocator_Mutex>,%sp@- 55aec: 4eb9 0005 8224 jsr 58224 <_API_Mutex_Unlock> return return_status; 55af2: 588f addql #4,%sp } 55af4: 2002 movel %d2,%d0 55af6: 242e fff0 movel %fp@(-16),%d2 55afa: 246e fff4 moveal %fp@(-12),%a2 55afe: 4e5e unlk %fp 55b00: 4e75 rts default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 55b02: 2f39 0007 ddec movel 7ddec <_RTEMS_Allocator_Mutex>,%sp@- break; #endif case OBJECTS_ERROR: default: return_status = RTEMS_INVALID_ID; 55b08: 7404 moveq #4,%d2 break; } _RTEMS_Unlock_allocator(); 55b0a: 4eb9 0005 8224 jsr 58224 <_API_Mutex_Unlock> return return_status; 55b10: 588f addql #4,%sp 55b12: 60e0 bras 55af4 Objects_Locations location; rtems_status_code return_status; Region_Control *the_region; if ( !starting_address ) return RTEMS_INVALID_ADDRESS; 55b14: 7409 moveq #9,%d2 break; } _RTEMS_Unlock_allocator(); return return_status; } 55b16: 2002 movel %d2,%d0 55b18: 242e fff0 movel %fp@(-16),%d2 55b1c: 246e fff4 moveal %fp@(-12),%a2 55b20: 4e5e unlk %fp 55b22: 4e75 rts default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 55b24: 2f39 0007 ddec movel 7ddec <_RTEMS_Allocator_Mutex>,%sp@- if ( extend_ok ) { the_region->length += amount_extended; the_region->maximum_segment_size += amount_extended; return_status = RTEMS_SUCCESSFUL; } else { return_status = RTEMS_INVALID_ADDRESS; 55b2a: 7409 moveq #9,%d2 default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 55b2c: 4eb9 0005 8224 jsr 58224 <_API_Mutex_Unlock> return return_status; 55b32: 588f addql #4,%sp 55b34: 60be bras 55af4 ... =============================================================================== 00055bd0 : rtems_status_code rtems_region_get_information( rtems_id id, Heap_Information_block *the_info ) { 55bd0: 4e56 fffc linkw %fp,#-4 55bd4: 2f02 movel %d2,%sp@- 55bd6: 242e 000c movel %fp@(12),%d2 Objects_Locations location; rtems_status_code return_status; register Region_Control *the_region; if ( !the_info ) 55bda: 6766 beqs 55c42 <== NEVER TAKEN return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); 55bdc: 2f39 0007 ddec movel 7ddec <_RTEMS_Allocator_Mutex>,%sp@- 55be2: 4eb9 0005 81c4 jsr 581c4 <_API_Mutex_Lock> 55be8: 486e fffc pea %fp@(-4) 55bec: 2f2e 0008 movel %fp@(8),%sp@- 55bf0: 4879 0007 dc56 pea 7dc56 <_Region_Information> 55bf6: 4eb9 0005 9f00 jsr 59f00 <_Objects_Get_no_protection> the_region = _Region_Get( id, &location ); switch ( location ) { 55bfc: 4fef 0010 lea %sp@(16),%sp 55c00: 4aae fffc tstl %fp@(-4) 55c04: 662a bnes 55c30 case OBJECTS_LOCAL: _Heap_Get_information( &the_region->Memory, the_info ); 55c06: 2f02 movel %d2,%sp@- 55c08: 2040 moveal %d0,%a0 55c0a: 4868 0068 pea %a0@(104) return_status = RTEMS_SUCCESSFUL; 55c0e: 4282 clrl %d2 the_region = _Region_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: _Heap_Get_information( &the_region->Memory, the_info ); 55c10: 4eb9 0005 93fc jsr 593fc <_Heap_Get_information> return_status = RTEMS_SUCCESSFUL; break; 55c16: 508f addql #8,%sp default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 55c18: 2f39 0007 ddec movel 7ddec <_RTEMS_Allocator_Mutex>,%sp@- 55c1e: 4eb9 0005 8224 jsr 58224 <_API_Mutex_Unlock> return return_status; 55c24: 588f addql #4,%sp } 55c26: 2002 movel %d2,%d0 55c28: 242e fff8 movel %fp@(-8),%d2 55c2c: 4e5e unlk %fp 55c2e: 4e75 rts default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 55c30: 2f39 0007 ddec movel 7ddec <_RTEMS_Allocator_Mutex>,%sp@- break; #endif case OBJECTS_ERROR: default: return_status = RTEMS_INVALID_ID; 55c36: 7404 moveq #4,%d2 break; } _RTEMS_Unlock_allocator(); 55c38: 4eb9 0005 8224 jsr 58224 <_API_Mutex_Unlock> return return_status; 55c3e: 588f addql #4,%sp 55c40: 60e4 bras 55c26 Objects_Locations location; rtems_status_code return_status; register Region_Control *the_region; if ( !the_info ) return RTEMS_INVALID_ADDRESS; 55c42: 7409 moveq #9,%d2 break; } _RTEMS_Unlock_allocator(); return return_status; } 55c44: 2002 movel %d2,%d0 55c46: 242e fff8 movel %fp@(-8),%d2 55c4a: 4e5e unlk %fp ... =============================================================================== 00055dc0 : rtems_status_code rtems_region_get_segment_size( rtems_id id, void *segment, uintptr_t *size ) { 55dc0: 4e56 fff8 linkw %fp,#-8 55dc4: 2f03 movel %d3,%sp@- 55dc6: 262e 0010 movel %fp@(16),%d3 55dca: 2f02 movel %d2,%sp@- 55dcc: 242e 000c movel %fp@(12),%d2 Objects_Locations location; rtems_status_code return_status = RTEMS_SUCCESSFUL; register Region_Control *the_region; if ( !segment ) 55dd0: 676a beqs 55e3c return RTEMS_INVALID_ADDRESS; if ( !size ) 55dd2: 4a83 tstl %d3 55dd4: 6766 beqs 55e3c return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); 55dd6: 2f39 0007 ddec movel 7ddec <_RTEMS_Allocator_Mutex>,%sp@- 55ddc: 4eb9 0005 81c4 jsr 581c4 <_API_Mutex_Lock> 55de2: 486e fffc pea %fp@(-4) 55de6: 2f2e 0008 movel %fp@(8),%sp@- 55dea: 4879 0007 dc56 pea 7dc56 <_Region_Information> 55df0: 4eb9 0005 9f00 jsr 59f00 <_Objects_Get_no_protection> the_region = _Region_Get( id, &location ); switch ( location ) { 55df6: 222e fffc movel %fp@(-4),%d1 55dfa: 4fef 0010 lea %sp@(16),%sp 55dfe: 664a bnes 55e4a case OBJECTS_LOCAL: if ( !_Heap_Size_of_alloc_area( &the_region->Memory, segment, size ) ) 55e00: 2f03 movel %d3,%sp@- 55e02: 2040 moveal %d0,%a0 55e04: 2f02 movel %d2,%sp@- 55e06: 4868 0068 pea %a0@(104) 55e0a: 4eb9 0005 9914 jsr 59914 <_Heap_Size_of_alloc_area> 55e10: 4fef 000c lea %sp@(12),%sp 55e14: 4a00 tstb %d0 55e16: 676c beqs 55e84 <== NEVER TAKEN void *segment, uintptr_t *size ) { Objects_Locations location; rtems_status_code return_status = RTEMS_SUCCESSFUL; 55e18: 4280 clrl %d0 case OBJECTS_ERROR: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 55e1a: 2f39 0007 ddec movel 7ddec <_RTEMS_Allocator_Mutex>,%sp@- 55e20: 2d40 fff8 movel %d0,%fp@(-8) 55e24: 4eb9 0005 8224 jsr 58224 <_API_Mutex_Unlock> return return_status; 55e2a: 202e fff8 movel %fp@(-8),%d0 55e2e: 588f addql #4,%sp } 55e30: 242e fff0 movel %fp@(-16),%d2 55e34: 262e fff4 movel %fp@(-12),%d3 55e38: 4e5e unlk %fp 55e3a: 4e75 rts 55e3c: 242e fff0 movel %fp@(-16),%d2 if ( !segment ) return RTEMS_INVALID_ADDRESS; if ( !size ) return RTEMS_INVALID_ADDRESS; 55e40: 7009 moveq #9,%d0 break; } _RTEMS_Unlock_allocator(); return return_status; } 55e42: 262e fff4 movel %fp@(-12),%d3 55e46: 4e5e unlk %fp 55e48: 4e75 rts return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); the_region = _Region_Get( id, &location ); switch ( location ) { 55e4a: 7001 moveq #1,%d0 55e4c: b081 cmpl %d1,%d0 55e4e: 671a beqs 55e6a <== ALWAYS TAKEN void *segment, uintptr_t *size ) { Objects_Locations location; rtems_status_code return_status = RTEMS_SUCCESSFUL; 55e50: 4200 clrb %d0 <== NOT EXECUTED case OBJECTS_ERROR: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 55e52: 2f39 0007 ddec movel 7ddec <_RTEMS_Allocator_Mutex>,%sp@- <== NOT EXECUTED 55e58: 2d40 fff8 movel %d0,%fp@(-8) <== NOT EXECUTED 55e5c: 4eb9 0005 8224 jsr 58224 <_API_Mutex_Unlock> <== NOT EXECUTED return return_status; 55e62: 202e fff8 movel %fp@(-8),%d0 <== NOT EXECUTED 55e66: 588f addql #4,%sp <== NOT EXECUTED 55e68: 60c6 bras 55e30 <== NOT EXECUTED case OBJECTS_REMOTE: /* this error cannot be returned */ break; #endif case OBJECTS_ERROR: return_status = RTEMS_INVALID_ID; 55e6a: 7004 moveq #4,%d0 break; } _RTEMS_Unlock_allocator(); 55e6c: 2f39 0007 ddec movel 7ddec <_RTEMS_Allocator_Mutex>,%sp@- 55e72: 2d40 fff8 movel %d0,%fp@(-8) 55e76: 4eb9 0005 8224 jsr 58224 <_API_Mutex_Unlock> return return_status; 55e7c: 202e fff8 movel %fp@(-8),%d0 55e80: 588f addql #4,%sp 55e82: 60ac bras 55e30 the_region = _Region_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: if ( !_Heap_Size_of_alloc_area( &the_region->Memory, segment, size ) ) return_status = RTEMS_INVALID_ADDRESS; 55e84: 7009 moveq #9,%d0 <== NOT EXECUTED case OBJECTS_ERROR: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 55e86: 2f39 0007 ddec movel 7ddec <_RTEMS_Allocator_Mutex>,%sp@- <== NOT EXECUTED 55e8c: 2d40 fff8 movel %d0,%fp@(-8) <== NOT EXECUTED 55e90: 4eb9 0005 8224 jsr 58224 <_API_Mutex_Unlock> <== NOT EXECUTED return return_status; 55e96: 202e fff8 movel %fp@(-8),%d0 <== NOT EXECUTED 55e9a: 588f addql #4,%sp <== NOT EXECUTED 55e9c: 6092 bras 55e30 <== NOT EXECUTED ... =============================================================================== 00055f9c : rtems_status_code rtems_region_return_segment( rtems_id id, void *segment ) { 55f9c: 4e56 fffc linkw %fp,#-4 55fa0: 2f0a movel %a2,%sp@- 55fa2: 2f02 movel %d2,%sp@- uint32_t size; #endif int status; register Region_Control *the_region; _RTEMS_Lock_allocator(); 55fa4: 2f39 0007 ddec movel 7ddec <_RTEMS_Allocator_Mutex>,%sp@- 55faa: 4eb9 0005 81c4 jsr 581c4 <_API_Mutex_Lock> 55fb0: 486e fffc pea %fp@(-4) 55fb4: 2f2e 0008 movel %fp@(8),%sp@- 55fb8: 4879 0007 dc56 pea 7dc56 <_Region_Information> 55fbe: 4eb9 0005 9f00 jsr 59f00 <_Objects_Get_no_protection> the_region = _Region_Get( id, &location ); switch ( location ) { 55fc4: 4fef 0010 lea %sp@(16),%sp 55fc8: 2440 moveal %d0,%a2 55fca: 4aae fffc tstl %fp@(-4) 55fce: 6632 bnes 56002 <== NEVER TAKEN RTEMS_INLINE_ROUTINE bool _Region_Free_segment ( Region_Control *the_region, void *the_segment ) { return _Heap_Free( &the_region->Memory, the_segment ); 55fd0: 2f2e 000c movel %fp@(12),%sp@- 55fd4: 486a 0068 pea %a2@(104) 55fd8: 4eb9 0005 9220 jsr 59220 <_Heap_Free> #endif status = _Region_Free_segment( the_region, segment ); _Region_Debug_Walk( the_region, 4 ); if ( !status ) 55fde: 508f addql #8,%sp 55fe0: 4a00 tstb %d0 55fe2: 6630 bnes 56014 default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 55fe4: 2f39 0007 ddec movel 7ddec <_RTEMS_Allocator_Mutex>,%sp@- status = _Region_Free_segment( the_region, segment ); _Region_Debug_Walk( the_region, 4 ); if ( !status ) return_status = RTEMS_INVALID_ADDRESS; 55fea: 7409 moveq #9,%d2 default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 55fec: 4eb9 0005 8224 jsr 58224 <_API_Mutex_Unlock> return return_status; 55ff2: 588f addql #4,%sp } 55ff4: 2002 movel %d2,%d0 55ff6: 242e fff4 movel %fp@(-12),%d2 55ffa: 246e fff8 moveal %fp@(-8),%a2 55ffe: 4e5e unlk %fp 56000: 4e75 rts default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 56002: 2f39 0007 ddec movel 7ddec <_RTEMS_Allocator_Mutex>,%sp@- break; #endif case OBJECTS_ERROR: default: return_status = RTEMS_INVALID_ID; 56008: 7404 moveq #4,%d2 break; } _RTEMS_Unlock_allocator(); 5600a: 4eb9 0005 8224 jsr 58224 <_API_Mutex_Unlock> return return_status; 56010: 588f addql #4,%sp 56012: 60e0 bras 55ff4 _Region_Debug_Walk( the_region, 4 ); if ( !status ) return_status = RTEMS_INVALID_ADDRESS; else { the_region->number_of_used_blocks -= 1; 56014: 53aa 0064 subql #1,%a2@(100) _Region_Process_queue(the_region); /* unlocks allocator */ return RTEMS_SUCCESSFUL; 56018: 4282 clrl %d2 if ( !status ) return_status = RTEMS_INVALID_ADDRESS; else { the_region->number_of_used_blocks -= 1; _Region_Process_queue(the_region); /* unlocks allocator */ 5601a: 2f0a movel %a2,%sp@- 5601c: 4eb9 0005 e5fc jsr 5e5fc <_Region_Process_queue> break; } _RTEMS_Unlock_allocator(); return return_status; } 56022: 246e fff8 moveal %fp@(-8),%a2 56026: 2002 movel %d2,%d0 else { the_region->number_of_used_blocks -= 1; _Region_Process_queue(the_region); /* unlocks allocator */ return RTEMS_SUCCESSFUL; 56028: 588f addql #4,%sp break; } _RTEMS_Unlock_allocator(); return return_status; } 5602a: 242e fff4 movel %fp@(-12),%d2 5602e: 4e5e unlk %fp ... =============================================================================== 000469f4 : #endif rtems_status_code rtems_semaphore_delete( rtems_id id ) { 469f4: 4e56 fffc linkw %fp,#-4 469f8: 2f0a movel %a2,%sp@- RTEMS_INLINE_ROUTINE Semaphore_Control *_Semaphore_Get ( Objects_Id id, Objects_Locations *location ) { return (Semaphore_Control *) 469fa: 486e fffc pea %fp@(-4) 469fe: 2f2e 0008 movel %fp@(8),%sp@- 46a02: 4879 0006 0f8c pea 60f8c <_Semaphore_Information> 46a08: 4eb9 0004 8450 jsr 48450 <_Objects_Get> register Semaphore_Control *the_semaphore; Objects_Locations location; the_semaphore = _Semaphore_Get( id, &location ); switch ( location ) { 46a0e: 4fef 000c lea %sp@(12),%sp 46a12: 2440 moveal %d0,%a2 46a14: 4aae fffc tstl %fp@(-4) 46a18: 6624 bnes 46a3e 46a1a: 7030 moveq #48,%d0 46a1c: c0aa 0010 andl %a2@(16),%d0 case OBJECTS_LOCAL: if ( !_Attributes_Is_counting_semaphore(the_semaphore->attribute_set) ) { 46a20: 6726 beqs 46a48 if ( _CORE_mutex_Is_locked( &the_semaphore->Core_control.mutex ) && 46a22: 4aaa 0062 tstl %a2@(98) 46a26: 6664 bnes 46a8c 46a28: 7220 moveq #32,%d1 46a2a: b280 cmpl %d0,%d1 46a2c: 675e beqs 46a8c !_Attributes_Is_simple_binary_semaphore( the_semaphore->attribute_set ) ) { _Thread_Enable_dispatch(); 46a2e: 4eb9 0004 9218 jsr 49218 <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 46a34: 246e fff8 moveal %fp@(-8),%a2 if ( !_Attributes_Is_counting_semaphore(the_semaphore->attribute_set) ) { if ( _CORE_mutex_Is_locked( &the_semaphore->Core_control.mutex ) && !_Attributes_Is_simple_binary_semaphore( the_semaphore->attribute_set ) ) { _Thread_Enable_dispatch(); return RTEMS_RESOURCE_IN_USE; 46a38: 700c moveq #12,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 46a3a: 4e5e unlk %fp 46a3c: 4e75 rts 46a3e: 246e fff8 moveal %fp@(-8),%a2 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 46a42: 7004 moveq #4,%d0 } 46a44: 4e5e unlk %fp 46a46: 4e75 rts &the_semaphore->Core_control.mutex, SEMAPHORE_MP_OBJECT_WAS_DELETED, CORE_MUTEX_WAS_DELETED ); } else { _CORE_semaphore_Flush( 46a48: 4878 0002 pea 2 46a4c: 42a7 clrl %sp@- 46a4e: 486a 0014 pea %a2@(20) 46a52: 4eb9 0004 7958 jsr 47958 <_CORE_semaphore_Flush> 46a58: 4fef 000c lea %sp@(12),%sp SEMAPHORE_MP_OBJECT_WAS_DELETED, CORE_SEMAPHORE_WAS_DELETED ); } _Objects_Close( &_Semaphore_Information, &the_semaphore->Object ); 46a5c: 2f0a movel %a2,%sp@- 46a5e: 4879 0006 0f8c pea 60f8c <_Semaphore_Information> 46a64: 4eb9 0004 801c jsr 4801c <_Objects_Close> */ RTEMS_INLINE_ROUTINE void _Semaphore_Free ( Semaphore_Control *the_semaphore ) { _Objects_Free( &_Semaphore_Information, &the_semaphore->Object ); 46a6a: 2f0a movel %a2,%sp@- 46a6c: 4879 0006 0f8c pea 60f8c <_Semaphore_Information> 46a72: 4eb9 0004 82dc jsr 482dc <_Objects_Free> 0, /* Not used */ 0 /* Not used */ ); } #endif _Thread_Enable_dispatch(); 46a78: 4eb9 0004 9218 jsr 49218 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 46a7e: 4fef 0010 lea %sp@(16),%sp 46a82: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 46a84: 246e fff8 moveal %fp@(-8),%a2 46a88: 4e5e unlk %fp 46a8a: 4e75 rts !_Attributes_Is_simple_binary_semaphore( the_semaphore->attribute_set ) ) { _Thread_Enable_dispatch(); return RTEMS_RESOURCE_IN_USE; } _CORE_mutex_Flush( 46a8c: 4878 0004 pea 4 46a90: 42a7 clrl %sp@- 46a92: 486a 0014 pea %a2@(20) 46a96: 4eb9 0004 7610 jsr 47610 <_CORE_mutex_Flush> 46a9c: 4fef 000c lea %sp@(12),%sp SEMAPHORE_MP_OBJECT_WAS_DELETED, CORE_SEMAPHORE_WAS_DELETED ); } _Objects_Close( &_Semaphore_Information, &the_semaphore->Object ); 46aa0: 2f0a movel %a2,%sp@- 46aa2: 4879 0006 0f8c pea 60f8c <_Semaphore_Information> 46aa8: 4eb9 0004 801c jsr 4801c <_Objects_Close> 46aae: 2f0a movel %a2,%sp@- 46ab0: 4879 0006 0f8c pea 60f8c <_Semaphore_Information> 46ab6: 4eb9 0004 82dc jsr 482dc <_Objects_Free> 0, /* Not used */ 0 /* Not used */ ); } #endif _Thread_Enable_dispatch(); 46abc: 4eb9 0004 9218 jsr 49218 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 46ac2: 4fef 0010 lea %sp@(16),%sp 46ac6: 4280 clrl %d0 46ac8: 60ba bras 46a84 ... =============================================================================== 000507c0 : #endif rtems_status_code rtems_semaphore_flush( rtems_id id ) { 507c0: 4e56 fffc linkw %fp,#-4 507c4: 486e fffc pea %fp@(-4) 507c8: 2f2e 0008 movel %fp@(8),%sp@- 507cc: 4879 0006 4e24 pea 64e24 <_Semaphore_Information> 507d2: 4eb9 0004 97b0 jsr 497b0 <_Objects_Get> register Semaphore_Control *the_semaphore; Objects_Locations location; the_semaphore = _Semaphore_Get( id, &location ); switch ( location ) { 507d8: 4fef 000c lea %sp@(12),%sp 507dc: 4aae fffc tstl %fp@(-4) 507e0: 662a bnes 5080c 507e2: 7230 moveq #48,%d1 507e4: 2040 moveal %d0,%a0 507e6: c2a8 0010 andl %a0@(16),%d1 case OBJECTS_LOCAL: if ( !_Attributes_Is_counting_semaphore(the_semaphore->attribute_set) ) { 507ea: 6726 beqs 50812 _CORE_mutex_Flush( 507ec: 4878 0001 pea 1 507f0: 42a7 clrl %sp@- 507f2: 4868 0014 pea %a0@(20) 507f6: 4eb9 0004 8970 jsr 48970 <_CORE_mutex_Flush> 507fc: 4fef 000c lea %sp@(12),%sp &the_semaphore->Core_control.semaphore, SEND_OBJECT_WAS_DELETED, CORE_SEMAPHORE_STATUS_UNSATISFIED_NOWAIT ); } _Thread_Enable_dispatch(); 50800: 4eb9 0004 a580 jsr 4a580 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 50806: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 50808: 4e5e unlk %fp 5080a: 4e75 rts case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 5080c: 7004 moveq #4,%d0 } 5080e: 4e5e unlk %fp 50810: 4e75 rts &the_semaphore->Core_control.mutex, SEND_OBJECT_WAS_DELETED, CORE_MUTEX_STATUS_UNSATISFIED_NOWAIT ); } else { _CORE_semaphore_Flush( 50812: 4878 0001 pea 1 50816: 2040 moveal %d0,%a0 50818: 42a7 clrl %sp@- 5081a: 4868 0014 pea %a0@(20) 5081e: 4eb9 0004 8cb8 jsr 48cb8 <_CORE_semaphore_Flush> 50824: 4fef 000c lea %sp@(12),%sp &the_semaphore->Core_control.semaphore, SEND_OBJECT_WAS_DELETED, CORE_SEMAPHORE_STATUS_UNSATISFIED_NOWAIT ); } _Thread_Enable_dispatch(); 50828: 4eb9 0004 a580 jsr 4a580 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 5082e: 4280 clrl %d0 50830: 60d6 bras 50808 ... =============================================================================== 000471c8 : void rtems_shutdown_executive( uint32_t result ) { if ( _System_state_Is_up( _System_state_Get() ) ) { 471c8: 7003 moveq #3,%d0 */ void rtems_shutdown_executive( uint32_t result ) { 471ca: 4e56 0000 linkw %fp,#0 if ( _System_state_Is_up( _System_state_Get() ) ) { 471ce: b0b9 0006 118c cmpl 6118c <_System_state_Current>,%d0 471d4: 6710 beqs 471e6 ****** AND THEN TO BOOT_CARD() ****** ******************************************************************* ******************************************************************* *******************************************************************/ } _Internal_error_Occurred( 471d6: 4878 0014 pea 14 471da: 4878 0001 pea 1 471de: 42a7 clrl %sp@- 471e0: 4eb9 0004 7ec8 jsr 47ec8 <_Internal_error_Occurred> if ( _System_state_Is_up( _System_state_Get() ) ) { #if defined(RTEMS_SMP) _SMP_Request_other_cores_to_shutdown(); #endif _Per_CPU_Information[0].idle->Wait.return_code = result; 471e6: 2079 0006 14b2 moveal 614b2 <_Per_CPU_Information+0x14>,%a0 471ec: 103c 0004 moveb #4,%d0 471f0: 216e 0008 0034 movel %fp@(8),%a0@(52) * if we were running within the same context, it would work. * * And we will not return to this thread, so there is no point of * saving the context. */ _Context_Restart_self( &_Thread_BSP_context ); 471f6: 4879 0006 1014 pea 61014 <_Thread_BSP_context> 471fc: 23c0 0006 118c movel %d0,6118c <_System_state_Current> 47202: 4eb9 0004 a362 jsr 4a362 <_CPU_Context_Restart_self> 47208: 588f addql #4,%sp <== NOT EXECUTED ****** AND THEN TO BOOT_CARD() ****** ******************************************************************* ******************************************************************* *******************************************************************/ } _Internal_error_Occurred( 4720a: 4878 0014 pea 14 <== NOT EXECUTED 4720e: 4878 0001 pea 1 <== NOT EXECUTED 47212: 42a7 clrl %sp@- <== NOT EXECUTED 47214: 4eb9 0004 7ec8 jsr 47ec8 <_Internal_error_Occurred> <== NOT EXECUTED ... =============================================================================== 00056580 : rtems_status_code rtems_signal_send( rtems_id id, rtems_signal_set signal_set ) { 56580: 4e56 fffc linkw %fp,#-4 56584: 2f03 movel %d3,%sp@- 56586: 2f02 movel %d2,%sp@- 56588: 242e 000c movel %fp@(12),%d2 register Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; ASR_Information *asr; if ( !signal_set ) 5658c: 660e bnes 5659c case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 5658e: 242e fff4 movel %fp@(-12),%d2 Objects_Locations location; RTEMS_API_Control *api; ASR_Information *asr; if ( !signal_set ) return RTEMS_INVALID_NUMBER; 56592: 700a moveq #10,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 56594: 262e fff8 movel %fp@(-8),%d3 56598: 4e5e unlk %fp 5659a: 4e75 rts ASR_Information *asr; if ( !signal_set ) return RTEMS_INVALID_NUMBER; the_thread = _Thread_Get( id, &location ); 5659c: 486e fffc pea %fp@(-4) 565a0: 2f2e 0008 movel %fp@(8),%sp@- 565a4: 4eb9 0005 ad2c jsr 5ad2c <_Thread_Get> switch ( location ) { 565aa: 508f addql #8,%sp 565ac: 4aae fffc tstl %fp@(-4) 565b0: 6648 bnes 565fa case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; 565b2: 2240 moveal %d0,%a1 565b4: 2069 00fe moveal %a1@(254),%a0 asr = &api->Signal; if ( ! _ASR_Is_null_handler( asr->handler ) ) { 565b8: 4aa8 000a tstl %a0@(10) 565bc: 674a beqs 56608 if ( asr->is_enabled ) { 565be: 4a28 0008 tstb %a0@(8) 565c2: 676a beqs 5662e rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 565c4: 223c 0000 0700 movel #1792,%d1 565ca: 40c3 movew %sr,%d3 565cc: 8283 orl %d3,%d1 565ce: 46c1 movew %d1,%sr *signal_set |= signals; 565d0: 85a8 0012 orl %d2,%a0@(18) _ISR_Enable( _level ); 565d4: 46c3 movew %d3,%sr _ASR_Post_signals( signal_set, &asr->signals_posted ); if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 565d6: 4ab9 0007 e1b2 tstl 7e1b2 <_Per_CPU_Information+0x8> 565dc: 6708 beqs 565e6 565de: b0b9 0007 e1b6 cmpl 7e1b6 <_Per_CPU_Information+0xc>,%d0 565e4: 6736 beqs 5661c <== ALWAYS TAKEN _Thread_Dispatch_necessary = true; } else { _ASR_Post_signals( signal_set, &asr->signals_pending ); } _Thread_Enable_dispatch(); 565e6: 4eb9 0005 ad04 jsr 5ad04 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 565ec: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 565ee: 242e fff4 movel %fp@(-12),%d2 565f2: 262e fff8 movel %fp@(-8),%d3 565f6: 4e5e unlk %fp 565f8: 4e75 rts 565fa: 242e fff4 movel %fp@(-12),%d2 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 565fe: 7004 moveq #4,%d0 } 56600: 262e fff8 movel %fp@(-8),%d3 56604: 4e5e unlk %fp 56606: 4e75 rts _ASR_Post_signals( signal_set, &asr->signals_pending ); } _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } _Thread_Enable_dispatch(); 56608: 4eb9 0005 ad04 jsr 5ad04 <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 5660e: 242e fff4 movel %fp@(-12),%d2 } _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } _Thread_Enable_dispatch(); return RTEMS_NOT_DEFINED; 56612: 700b moveq #11,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 56614: 262e fff8 movel %fp@(-8),%d3 56618: 4e5e unlk %fp 5661a: 4e75 rts if ( ! _ASR_Is_null_handler( asr->handler ) ) { if ( asr->is_enabled ) { _ASR_Post_signals( signal_set, &asr->signals_posted ); if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; 5661c: 7001 moveq #1,%d0 5661e: 13c0 0007 e1c2 moveb %d0,7e1c2 <_Per_CPU_Information+0x18> } else { _ASR_Post_signals( signal_set, &asr->signals_pending ); } _Thread_Enable_dispatch(); 56624: 4eb9 0005 ad04 jsr 5ad04 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 5662a: 4280 clrl %d0 5662c: 60c0 bras 565ee rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 5662e: 203c 0000 0700 movel #1792,%d0 56634: 40c1 movew %sr,%d1 56636: 8081 orl %d1,%d0 56638: 46c0 movew %d0,%sr *signal_set |= signals; 5663a: 85a8 0016 orl %d2,%a0@(22) _ISR_Enable( _level ); 5663e: 46c1 movew %d1,%sr if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; } else { _ASR_Post_signals( signal_set, &asr->signals_pending ); } _Thread_Enable_dispatch(); 56640: 4eb9 0005 ad04 jsr 5ad04 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 56646: 4280 clrl %d0 56648: 60a4 bras 565ee ... =============================================================================== 00046e1c : */ rtems_status_code rtems_task_delete( rtems_id id ) { 46e1c: 4e56 fffc linkw %fp,#-4 46e20: 2f0b movel %a3,%sp@- 46e22: 2f0a movel %a2,%sp@- register Thread_Control *the_thread; Objects_Locations location; Objects_Information *the_information; _RTEMS_Lock_allocator(); 46e24: 2f39 0006 10e8 movel 610e8 <_RTEMS_Allocator_Mutex>,%sp@- 46e2a: 4eb9 0004 74dc jsr 474dc <_API_Mutex_Lock> the_thread = _Thread_Get( id, &location ); 46e30: 486e fffc pea %fp@(-4) 46e34: 2f2e 0008 movel %fp@(8),%sp@- 46e38: 4eb9 0004 9240 jsr 49240 <_Thread_Get> switch ( location ) { 46e3e: 4fef 000c lea %sp@(12),%sp Objects_Locations location; Objects_Information *the_information; _RTEMS_Lock_allocator(); the_thread = _Thread_Get( id, &location ); 46e42: 2440 moveal %d0,%a2 switch ( location ) { 46e44: 4aae fffc tstl %fp@(-4) 46e48: 664a bnes 46e94 <== NEVER TAKEN case OBJECTS_LOCAL: the_information = _Objects_Get_information_id( the_thread->Object.id ); 46e4a: 2f2a 0008 movel %a2@(8),%sp@- 46e4e: 47f9 0004 8360 lea 48360 <_Objects_Get_information_id>,%a3 46e54: 4e93 jsr %a3@ 0 /* Not used */ ); } #endif _Thread_Close( the_information, the_thread ); 46e56: 2f0a movel %a2,%sp@- 46e58: 2f00 movel %d0,%sp@- 46e5a: 4eb9 0004 8e78 jsr 48e78 <_Thread_Close> 46e60: 2f2a 0008 movel %a2@(8),%sp@- 46e64: 4e93 jsr %a3@ 46e66: 2f0a movel %a2,%sp@- 46e68: 2f00 movel %d0,%sp@- 46e6a: 4eb9 0004 82dc jsr 482dc <_Objects_Free> _RTEMS_tasks_Free( the_thread ); _RTEMS_Unlock_allocator(); 46e70: 2f39 0006 10e8 movel 610e8 <_RTEMS_Allocator_Mutex>,%sp@- 46e76: 4eb9 0004 753c jsr 4753c <_API_Mutex_Unlock> _Thread_Enable_dispatch(); 46e7c: 4eb9 0004 9218 jsr 49218 <_Thread_Enable_dispatch> break; } _RTEMS_Unlock_allocator(); return RTEMS_INVALID_ID; } 46e82: 246e fff4 moveal %fp@(-12),%a2 _RTEMS_tasks_Free( the_thread ); _RTEMS_Unlock_allocator(); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; 46e86: 4fef 001c lea %sp@(28),%sp 46e8a: 4280 clrl %d0 break; } _RTEMS_Unlock_allocator(); return RTEMS_INVALID_ID; } 46e8c: 266e fff8 moveal %fp@(-8),%a3 46e90: 4e5e unlk %fp 46e92: 4e75 rts case OBJECTS_ERROR: break; } _RTEMS_Unlock_allocator(); 46e94: 2f39 0006 10e8 movel 610e8 <_RTEMS_Allocator_Mutex>,%sp@- 46e9a: 4eb9 0004 753c jsr 4753c <_API_Mutex_Unlock> return RTEMS_INVALID_ID; } 46ea0: 246e fff4 moveal %fp@(-12),%a2 case OBJECTS_ERROR: break; } _RTEMS_Unlock_allocator(); return RTEMS_INVALID_ID; 46ea4: 588f addql #4,%sp 46ea6: 7004 moveq #4,%d0 } 46ea8: 266e fff8 moveal %fp@(-8),%a3 46eac: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004eb40 : rtems_status_code rtems_task_mode( rtems_mode mode_set, rtems_mode mask, rtems_mode *previous_mode_set ) { 4eb40: 4e56 ffe4 linkw %fp,#-28 4eb44: 48d7 1c3c moveml %d2-%d5/%a2-%a4,%sp@ 4eb48: 2a2e 0008 movel %fp@(8),%d5 4eb4c: 242e 000c movel %fp@(12),%d2 4eb50: 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 ) 4eb54: 4a8c tstl %a4 4eb56: 6700 0148 beqw 4eca0 return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; 4eb5a: 2479 0006 14aa moveal 614aa <_Per_CPU_Information+0xc>,%a2 api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 4eb60: 4a2a 0074 tstb %a2@(116) 4eb64: 57c3 seq %d3 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 4eb66: 266a 00fe moveal %a2@(254),%a3 asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 4eb6a: 49c3 extbl %d3 4eb6c: 0283 0000 0100 andil #256,%d3 if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) 4eb72: 4aaa 007a tstl %a2@(122) 4eb76: 6600 00cc bnew 4ec44 old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; 4eb7a: 4a2b 0008 tstb %a3@(8) 4eb7e: 57c4 seq %d4 old_mode |= _ISR_Get_level(); 4eb80: 4eb9 0004 a408 jsr 4a408 <_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; 4eb86: 49c4 extbl %d4 4eb88: 0284 0000 0400 andil #1024,%d4 4eb8e: 8084 orl %d4,%d0 old_mode |= _ISR_Get_level(); 4eb90: 8083 orl %d3,%d0 4eb92: 2880 movel %d0,%a4@ *previous_mode_set = old_mode; /* * These are generic thread scheduling characteristics. */ if ( mask & RTEMS_PREEMPT_MASK ) 4eb94: 0802 0008 btst #8,%d2 4eb98: 670c beqs 4eba6 executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; 4eb9a: 0805 0008 btst #8,%d5 4eb9e: 57c0 seq %d0 4eba0: 4480 negl %d0 4eba2: 1540 0074 moveb %d0,%a2@(116) if ( mask & RTEMS_TIMESLICE_MASK ) { 4eba6: 0802 0009 btst #9,%d2 4ebaa: 6718 beqs 4ebc4 if ( _Modes_Is_timeslice(mode_set) ) { 4ebac: 0805 0009 btst #9,%d5 4ebb0: 6700 00fa beqw 4ecac executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 4ebb4: 7001 moveq #1,%d0 executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 4ebb6: 41f9 0006 1000 lea 61000 <_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; 4ebbc: 2540 007a movel %d0,%a2@(122) executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 4ebc0: 2550 0076 movel %a0@,%a2@(118) } /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) 4ebc4: 7007 moveq #7,%d0 4ebc6: c082 andl %d2,%d0 4ebc8: 6712 beqs 4ebdc */ RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level ( Modes_Control mode_set ) { _ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) ); 4ebca: 40c0 movew %sr,%d0 */ RTEMS_INLINE_ROUTINE ISR_Level _Modes_Get_interrupt_level ( Modes_Control mode_set ) { return ( mode_set & RTEMS_INTERRUPT_MASK ); 4ebcc: 7207 moveq #7,%d1 4ebce: c285 andl %d5,%d1 */ RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level ( Modes_Control mode_set ) { _ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) ); 4ebd0: 0280 0000 f8ff andil #63743,%d0 4ebd6: e189 lsll #8,%d1 4ebd8: 8081 orl %d1,%d0 4ebda: 46c0 movew %d0,%sr * This is specific to the RTEMS API */ is_asr_enabled = false; needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { 4ebdc: 0802 000a btst #10,%d2 4ebe0: 6754 beqs 4ec36 is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true; if ( is_asr_enabled != asr->is_enabled ) { 4ebe2: 4282 clrl %d2 4ebe4: 142b 0008 moveb %a3@(8),%d2 4ebe8: 4280 clrl %d0 * Output: * *previous_mode_set - previous mode set * always return RTEMS_SUCCESSFUL; */ rtems_status_code rtems_task_mode( 4ebea: 0805 000a btst #10,%d5 4ebee: 57c1 seq %d1 4ebf0: 4481 negl %d1 is_asr_enabled = false; needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true; if ( is_asr_enabled != asr->is_enabled ) { 4ebf2: 1001 moveb %d1,%d0 4ebf4: b082 cmpl %d2,%d0 4ebf6: 673e beqs 4ec36 ) { rtems_signal_set _signals; ISR_Level _level; _ISR_Disable( _level ); 4ebf8: 203c 0000 0700 movel #1792,%d0 asr->is_enabled = is_asr_enabled; 4ebfe: 1741 0008 moveb %d1,%a3@(8) 4ec02: 40c1 movew %sr,%d1 4ec04: 8081 orl %d1,%d0 4ec06: 46c0 movew %d0,%sr _signals = information->signals_pending; 4ec08: 202b 0016 movel %a3@(22),%d0 information->signals_pending = information->signals_posted; 4ec0c: 276b 0012 0016 movel %a3@(18),%a3@(22) information->signals_posted = _signals; 4ec12: 2740 0012 movel %d0,%a3@(18) _ISR_Enable( _level ); 4ec16: 46c1 movew %d1,%sr /* * This is specific to the RTEMS API */ is_asr_enabled = false; needs_asr_dispatching = false; 4ec18: 4aab 0012 tstl %a3@(18) 4ec1c: 56c0 sne %d0 needs_asr_dispatching = true; } } } if ( _System_state_Is_up( _System_state_Get() ) ) { 4ec1e: 7203 moveq #3,%d1 /* * This is specific to the RTEMS API */ is_asr_enabled = false; needs_asr_dispatching = false; 4ec20: 4480 negl %d0 needs_asr_dispatching = true; } } } if ( _System_state_Is_up( _System_state_Get() ) ) { 4ec22: b2b9 0006 118c cmpl 6118c <_System_state_Current>,%d1 4ec28: 6744 beqs 4ec6e <== ALWAYS TAKEN if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) ) _Thread_Dispatch(); } return RTEMS_SUCCESSFUL; 4ec2a: 4280 clrl %d0 } 4ec2c: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4 4ec32: 4e5e unlk %fp 4ec34: 4e75 rts needs_asr_dispatching = true; } } } if ( _System_state_Is_up( _System_state_Get() ) ) { 4ec36: 7203 moveq #3,%d1 /* * This is specific to the RTEMS API */ is_asr_enabled = false; needs_asr_dispatching = false; 4ec38: 4200 clrb %d0 needs_asr_dispatching = true; } } } if ( _System_state_Is_up( _System_state_Get() ) ) { 4ec3a: b2b9 0006 118c cmpl 6118c <_System_state_Current>,%d1 4ec40: 66e8 bnes 4ec2a 4ec42: 602a bras 4ec6e 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; 4ec44: 4a2b 0008 tstb %a3@(8) 4ec48: 57c4 seq %d4 old_mode |= _ISR_Get_level(); 4ec4a: 4eb9 0004 a408 jsr 4a408 <_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; 4ec50: 49c4 extbl %d4 4ec52: 0284 0000 0400 andil #1024,%d4 old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; 4ec58: 08c3 0009 bset #9,%d3 old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; 4ec5c: 8084 orl %d4,%d0 old_mode |= _ISR_Get_level(); 4ec5e: 8083 orl %d3,%d0 4ec60: 2880 movel %d0,%a4@ *previous_mode_set = old_mode; /* * These are generic thread scheduling characteristics. */ if ( mask & RTEMS_PREEMPT_MASK ) 4ec62: 0802 0008 btst #8,%d2 4ec66: 6700 ff3e beqw 4eba6 4ec6a: 6000 ff2e braw 4eb9a bool are_signals_pending ) { Thread_Control *executing; executing = _Thread_Executing; 4ec6e: 2079 0006 14aa moveal 614aa <_Per_CPU_Information+0xc>,%a0 if ( are_signals_pending || 4ec74: 4a00 tstb %d0 4ec76: 660e bnes 4ec86 4ec78: b1f9 0006 14ae cmpal 614ae <_Per_CPU_Information+0x10>,%a0 4ec7e: 67aa beqs 4ec2a (!_Thread_Is_heir( executing ) && executing->is_preemptible) ) { 4ec80: 4a28 0074 tstb %a0@(116) 4ec84: 67a4 beqs 4ec2a <== NEVER TAKEN _Thread_Dispatch_necessary = true; 4ec86: 7001 moveq #1,%d0 4ec88: 13c0 0006 14b6 moveb %d0,614b6 <_Per_CPU_Information+0x18> } } if ( _System_state_Is_up( _System_state_Get() ) ) { if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) ) _Thread_Dispatch(); 4ec8e: 4eb9 0004 909c jsr 4909c <_Thread_Dispatch> } return RTEMS_SUCCESSFUL; } 4ec94: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4 if ( _System_state_Is_up( _System_state_Get() ) ) { if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) ) _Thread_Dispatch(); } return RTEMS_SUCCESSFUL; 4ec9a: 4280 clrl %d0 } 4ec9c: 4e5e unlk %fp 4ec9e: 4e75 rts bool is_asr_enabled = false; bool needs_asr_dispatching = false; rtems_mode old_mode; if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; 4eca0: 7009 moveq #9,%d0 if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) ) _Thread_Dispatch(); } return RTEMS_SUCCESSFUL; } 4eca2: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4 4eca8: 4e5e unlk %fp 4ecaa: 4e75 rts } /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) 4ecac: 7007 moveq #7,%d0 4ecae: c082 andl %d2,%d0 if ( mask & RTEMS_TIMESLICE_MASK ) { if ( _Modes_Is_timeslice(mode_set) ) { executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; executing->cpu_time_budget = _Thread_Ticks_per_timeslice; } else executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 4ecb0: 42aa 007a clrl %a2@(122) } /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) 4ecb4: 4a80 tstl %d0 4ecb6: 6700 ff24 beqw 4ebdc 4ecba: 6000 ff0e braw 4ebca ... =============================================================================== 0004b07c : rtems_status_code rtems_task_set_priority( rtems_id id, rtems_task_priority new_priority, rtems_task_priority *old_priority ) { 4b07c: 4e56 fffc linkw %fp,#-4 4b080: 2f0a movel %a2,%sp@- 4b082: 246e 0010 moveal %fp@(16),%a2 4b086: 2f02 movel %d2,%sp@- 4b088: 242e 000c movel %fp@(12),%d2 register Thread_Control *the_thread; Objects_Locations location; if ( new_priority != RTEMS_CURRENT_PRIORITY && 4b08c: 670c beqs 4b09a RTEMS_INLINE_ROUTINE bool _RTEMS_tasks_Priority_is_valid ( rtems_task_priority the_priority ) { return ( ( the_priority >= RTEMS_MINIMUM_PRIORITY ) && ( the_priority <= RTEMS_MAXIMUM_PRIORITY ) ); 4b08e: 4280 clrl %d0 4b090: 1039 0006 36ba moveb 636ba ,%d0 */ RTEMS_INLINE_ROUTINE bool _RTEMS_tasks_Priority_is_valid ( rtems_task_priority the_priority ) { return ( ( the_priority >= RTEMS_MINIMUM_PRIORITY ) && 4b096: b082 cmpl %d2,%d0 4b098: 6574 bcss 4b10e !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; if ( !old_priority ) 4b09a: 4a8a tstl %a2 4b09c: 6754 beqs 4b0f2 return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); 4b09e: 486e fffc pea %fp@(-4) 4b0a2: 2f2e 0008 movel %fp@(8),%sp@- 4b0a6: 4eb9 0004 d57c jsr 4d57c <_Thread_Get> switch ( location ) { 4b0ac: 508f addql #8,%sp 4b0ae: 4aae fffc tstl %fp@(-4) 4b0b2: 664c bnes 4b100 case OBJECTS_LOCAL: /* XXX need helper to "convert" from core priority */ *old_priority = the_thread->current_priority; 4b0b4: 2040 moveal %d0,%a0 4b0b6: 24a8 0014 movel %a0@(20),%a2@ if ( new_priority != RTEMS_CURRENT_PRIORITY ) { 4b0ba: 4a82 tstl %d2 4b0bc: 6720 beqs 4b0de the_thread->real_priority = new_priority; 4b0be: 2142 0018 movel %d2,%a0@(24) if ( the_thread->resource_count == 0 || 4b0c2: 4aa8 001c tstl %a0@(28) 4b0c6: 6706 beqs 4b0ce 4b0c8: b4a8 0014 cmpl %a0@(20),%d2 4b0cc: 6410 bccs 4b0de <== ALWAYS TAKEN the_thread->current_priority > new_priority ) _Thread_Change_priority( the_thread, new_priority, false ); 4b0ce: 42a7 clrl %sp@- 4b0d0: 2f02 movel %d2,%sp@- 4b0d2: 2f00 movel %d0,%sp@- 4b0d4: 4eb9 0004 d074 jsr 4d074 <_Thread_Change_priority> 4b0da: 4fef 000c lea %sp@(12),%sp } _Thread_Enable_dispatch(); 4b0de: 4eb9 0004 d554 jsr 4d554 <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4b0e4: 242e fff4 movel %fp@(-12),%d2 if ( the_thread->resource_count == 0 || the_thread->current_priority > new_priority ) _Thread_Change_priority( the_thread, new_priority, false ); } _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; 4b0e8: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4b0ea: 246e fff8 moveal %fp@(-8),%a2 4b0ee: 4e5e unlk %fp 4b0f0: 4e75 rts 4b0f2: 242e fff4 movel %fp@(-12),%d2 if ( new_priority != RTEMS_CURRENT_PRIORITY && !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; if ( !old_priority ) return RTEMS_INVALID_ADDRESS; 4b0f6: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4b0f8: 246e fff8 moveal %fp@(-8),%a2 4b0fc: 4e5e unlk %fp 4b0fe: 4e75 rts 4b100: 242e fff4 movel %fp@(-12),%d2 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 4b104: 7004 moveq #4,%d0 } 4b106: 246e fff8 moveal %fp@(-8),%a2 4b10a: 4e5e unlk %fp 4b10c: 4e75 rts 4b10e: 242e fff4 movel %fp@(-12),%d2 register Thread_Control *the_thread; Objects_Locations location; if ( new_priority != RTEMS_CURRENT_PRIORITY && !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; 4b112: 7013 moveq #19,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4b114: 246e fff8 moveal %fp@(-8),%a2 4b118: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00047c48 : rtems_status_code rtems_task_variable_delete( rtems_id tid, void **ptr ) { 47c48: 4e56 fffc linkw %fp,#-4 47c4c: 2f02 movel %d2,%sp@- 47c4e: 242e 000c movel %fp@(12),%d2 Thread_Control *the_thread; Objects_Locations location; rtems_task_variable_t *tvp, *prev; if ( !ptr ) 47c52: 6740 beqs 47c94 return RTEMS_INVALID_ADDRESS; prev = NULL; the_thread = _Thread_Get (tid, &location); 47c54: 486e fffc pea %fp@(-4) 47c58: 2f2e 0008 movel %fp@(8),%sp@- 47c5c: 4eb9 0004 9f34 jsr 49f34 <_Thread_Get> switch (location) { 47c62: 508f addql #8,%sp 47c64: 4aae fffc tstl %fp@(-4) 47c68: 6620 bnes 47c8a case OBJECTS_LOCAL: tvp = the_thread->task_variables; 47c6a: 2040 moveal %d0,%a0 47c6c: 2268 010a moveal %a0@(266),%a1 while (tvp) { 47c70: 4a89 tstl %a1 47c72: 672a beqs 47c9e if (tvp->ptr == ptr) { 47c74: b4a9 0004 cmpl %a1@(4),%d2 47c78: 6752 beqs 47ccc _RTEMS_Tasks_Invoke_task_variable_dtor( the_thread, tvp ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } prev = tvp; tvp = (rtems_task_variable_t *)tvp->next; 47c7a: 2051 moveal %a1@,%a0 the_thread = _Thread_Get (tid, &location); switch (location) { case OBJECTS_LOCAL: tvp = the_thread->task_variables; while (tvp) { 47c7c: 4a88 tstl %a0 47c7e: 671e beqs 47c9e <== NEVER TAKEN if (tvp->ptr == ptr) { 47c80: b4a8 0004 cmpl %a0@(4),%d2 47c84: 6728 beqs 47cae 47c86: 2248 moveal %a0,%a1 47c88: 60f0 bras 47c7a case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 47c8a: 242e fff8 movel %fp@(-8),%d2 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 47c8e: 7004 moveq #4,%d0 } 47c90: 4e5e unlk %fp 47c92: 4e75 rts 47c94: 242e fff8 movel %fp@(-8),%d2 Thread_Control *the_thread; Objects_Locations location; rtems_task_variable_t *tvp, *prev; if ( !ptr ) return RTEMS_INVALID_ADDRESS; 47c98: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 47c9a: 4e5e unlk %fp 47c9c: 4e75 rts return RTEMS_SUCCESSFUL; } prev = tvp; tvp = (rtems_task_variable_t *)tvp->next; } _Thread_Enable_dispatch(); 47c9e: 4eb9 0004 9f0c jsr 49f0c <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 47ca4: 242e fff8 movel %fp@(-8),%d2 } prev = tvp; tvp = (rtems_task_variable_t *)tvp->next; } _Thread_Enable_dispatch(); return RTEMS_INVALID_ADDRESS; 47ca8: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 47caa: 4e5e unlk %fp 47cac: 4e75 rts case OBJECTS_LOCAL: tvp = the_thread->task_variables; while (tvp) { if (tvp->ptr == ptr) { if (prev) prev->next = tvp->next; 47cae: 2290 movel %a0@,%a1@ else the_thread->task_variables = (rtems_task_variable_t *)tvp->next; _RTEMS_Tasks_Invoke_task_variable_dtor( the_thread, tvp ); 47cb0: 2f08 movel %a0,%sp@- 47cb2: 2f00 movel %d0,%sp@- 47cb4: 4eb9 0004 7d78 jsr 47d78 <_RTEMS_Tasks_Invoke_task_variable_dtor> _Thread_Enable_dispatch(); 47cba: 4eb9 0004 9f0c jsr 49f0c <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 47cc0: 508f addql #8,%sp 47cc2: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 47cc4: 242e fff8 movel %fp@(-8),%d2 47cc8: 4e5e unlk %fp 47cca: 4e75 rts while (tvp) { if (tvp->ptr == ptr) { if (prev) prev->next = tvp->next; else the_thread->task_variables = (rtems_task_variable_t *)tvp->next; 47ccc: 2040 moveal %d0,%a0 47cce: 2151 010a movel %a1@,%a0@(266) 47cd2: 2049 moveal %a1,%a0 _RTEMS_Tasks_Invoke_task_variable_dtor( the_thread, tvp ); 47cd4: 2f08 movel %a0,%sp@- 47cd6: 2f00 movel %d0,%sp@- 47cd8: 4eb9 0004 7d78 jsr 47d78 <_RTEMS_Tasks_Invoke_task_variable_dtor> _Thread_Enable_dispatch(); 47cde: 4eb9 0004 9f0c jsr 49f0c <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 47ce4: 508f addql #8,%sp 47ce6: 4280 clrl %d0 47ce8: 60da bras 47cc4 ... =============================================================================== 00047cec : rtems_status_code rtems_task_variable_get( rtems_id tid, void **ptr, void **result ) { 47cec: 4e56 fffc linkw %fp,#-4 47cf0: 2f0a movel %a2,%sp@- 47cf2: 246e 0010 moveal %fp@(16),%a2 47cf6: 2f02 movel %d2,%sp@- 47cf8: 242e 000c movel %fp@(12),%d2 Thread_Control *the_thread; Objects_Locations location; rtems_task_variable_t *tvp; if ( !ptr ) 47cfc: 6744 beqs 47d42 return RTEMS_INVALID_ADDRESS; if ( !result ) 47cfe: 4a8a tstl %a2 47d00: 6740 beqs 47d42 return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get (tid, &location); 47d02: 486e fffc pea %fp@(-4) 47d06: 2f2e 0008 movel %fp@(8),%sp@- 47d0a: 4eb9 0004 9f34 jsr 49f34 <_Thread_Get> switch (location) { 47d10: 508f addql #8,%sp 47d12: 4aae fffc tstl %fp@(-4) 47d16: 6638 bnes 47d50 case OBJECTS_LOCAL: /* * Figure out if the variable is in this task's list. */ tvp = the_thread->task_variables; 47d18: 2240 moveal %d0,%a1 47d1a: 2069 010a moveal %a1@(266),%a0 while (tvp) { 47d1e: 4a88 tstl %a0 47d20: 670c beqs 47d2e if (tvp->ptr == ptr) { 47d22: b4a8 0004 cmpl %a0@(4),%d2 47d26: 6736 beqs 47d5e */ *result = tvp->tval; _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } tvp = (rtems_task_variable_t *)tvp->next; 47d28: 2050 moveal %a0@,%a0 case OBJECTS_LOCAL: /* * Figure out if the variable is in this task's list. */ tvp = the_thread->task_variables; while (tvp) { 47d2a: 4a88 tstl %a0 47d2c: 66f4 bnes 47d22 <== ALWAYS TAKEN _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } tvp = (rtems_task_variable_t *)tvp->next; } _Thread_Enable_dispatch(); 47d2e: 4eb9 0004 9f0c jsr 49f0c <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 47d34: 242e fff4 movel %fp@(-12),%d2 return RTEMS_SUCCESSFUL; } tvp = (rtems_task_variable_t *)tvp->next; } _Thread_Enable_dispatch(); return RTEMS_INVALID_ADDRESS; 47d38: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 47d3a: 246e fff8 moveal %fp@(-8),%a2 47d3e: 4e5e unlk %fp 47d40: 4e75 rts 47d42: 242e fff4 movel %fp@(-12),%d2 if ( !ptr ) return RTEMS_INVALID_ADDRESS; if ( !result ) return RTEMS_INVALID_ADDRESS; 47d46: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 47d48: 246e fff8 moveal %fp@(-8),%a2 47d4c: 4e5e unlk %fp 47d4e: 4e75 rts 47d50: 242e fff4 movel %fp@(-12),%d2 #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 47d54: 7004 moveq #4,%d0 } 47d56: 246e fff8 moveal %fp@(-8),%a2 47d5a: 4e5e unlk %fp 47d5c: 4e75 rts if (tvp->ptr == ptr) { /* * Should this return the current (i.e not the * saved) value if `tid' is the current task? */ *result = tvp->tval; 47d5e: 24a8 000c movel %a0@(12),%a2@ _Thread_Enable_dispatch(); 47d62: 4eb9 0004 9f0c jsr 49f0c <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 47d68: 242e fff4 movel %fp@(-12),%d2 * Should this return the current (i.e not the * saved) value if `tid' is the current task? */ *result = tvp->tval; _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; 47d6c: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 47d6e: 246e fff8 moveal %fp@(-8),%a2 47d72: 4e5e unlk %fp ... =============================================================================== 00056f68 : */ rtems_status_code rtems_timer_cancel( rtems_id id ) { 56f68: 4e56 fffc linkw %fp,#-4 RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Get ( Objects_Id id, Objects_Locations *location ) { return (Timer_Control *) 56f6c: 486e fffc pea %fp@(-4) 56f70: 2f2e 0008 movel %fp@(8),%sp@- 56f74: 4879 0007 e5ce pea 7e5ce <_Timer_Information> 56f7a: 4eb9 0005 9f3c jsr 59f3c <_Objects_Get> Timer_Control *the_timer; Objects_Locations location; the_timer = _Timer_Get( id, &location ); switch ( location ) { 56f80: 4fef 000c lea %sp@(12),%sp 56f84: 4aae fffc tstl %fp@(-4) 56f88: 6622 bnes 56fac case OBJECTS_LOCAL: if ( !_Timer_Is_dormant_class( the_timer->the_class ) ) 56f8a: 7204 moveq #4,%d1 56f8c: 2040 moveal %d0,%a0 56f8e: b2a8 0038 cmpl %a0@(56),%d1 56f92: 670c beqs 56fa0 <== NEVER TAKEN (void) _Watchdog_Remove( &the_timer->Ticker ); 56f94: 4868 0010 pea %a0@(16) 56f98: 4eb9 0005 bea4 jsr 5bea4 <_Watchdog_Remove> 56f9e: 588f addql #4,%sp _Thread_Enable_dispatch(); 56fa0: 4eb9 0005 ad04 jsr 5ad04 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 56fa6: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 56fa8: 4e5e unlk %fp 56faa: 4e75 rts #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 56fac: 7004 moveq #4,%d0 } 56fae: 4e5e unlk %fp ... =============================================================================== 00047090 : rtems_status_code rtems_timer_create( rtems_name name, rtems_id *id ) { 47090: 4e56 fff4 linkw %fp,#-12 47094: 48d7 040c moveml %d2-%d3/%a2,%sp@ 47098: 242e 0008 movel %fp@(8),%d2 4709c: 246e 000c moveal %fp@(12),%a2 Timer_Control *the_timer; if ( !rtems_is_name_valid( name ) ) 470a0: 660c bnes 470ae return RTEMS_INVALID_NAME; 470a2: 7003 moveq #3,%d0 ); *id = the_timer->Object.id; _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 470a4: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 470aa: 4e5e unlk %fp 470ac: 4e75 rts Timer_Control *the_timer; if ( !rtems_is_name_valid( name ) ) return RTEMS_INVALID_NAME; if ( !id ) 470ae: 4a8a tstl %a2 470b0: 6768 beqs 4711a <== NEVER TAKEN * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 470b2: 2039 0006 110a movel 6110a <_Thread_Dispatch_disable_level>,%d0 470b8: 5280 addql #1,%d0 470ba: 23c0 0006 110a movel %d0,6110a <_Thread_Dispatch_disable_level> return _Thread_Dispatch_disable_level; 470c0: 2039 0006 110a movel 6110a <_Thread_Dispatch_disable_level>,%d0 * This function allocates a timer control block from * the inactive chain of free timer control blocks. */ RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Allocate( void ) { return (Timer_Control *) _Objects_Allocate( &_Timer_Information ); 470c6: 4879 0006 194c pea 6194c <_Timer_Information> 470cc: 4eb9 0004 80c0 jsr 480c0 <_Objects_Allocate> _Thread_Disable_dispatch(); /* to prevent deletion */ the_timer = _Timer_Allocate(); if ( !the_timer ) { 470d2: 588f addql #4,%sp 470d4: 2040 moveal %d0,%a0 470d6: 4a80 tstl %d0 470d8: 674c beqs 47126 <== NEVER TAKEN Objects_Name name ) { _Objects_Set_local_object( information, _Objects_Get_index( the_object->id ), 470da: 2028 0008 movel %a0@(8),%d0 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 470de: 4281 clrl %d1 _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; } the_timer->the_class = TIMER_DORMANT; 470e0: 7604 moveq #4,%d3 470e2: 2279 0006 1964 moveal 61964 <_Timer_Information+0x18>,%a1 470e8: 3200 movew %d0,%d1 470ea: 2143 0038 movel %d3,%a0@(56) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 470ee: 42a8 0018 clrl %a0@(24) the_watchdog->routine = routine; 470f2: 42a8 002c clrl %a0@(44) the_watchdog->id = id; 470f6: 42a8 0030 clrl %a0@(48) the_watchdog->user_data = user_data; 470fa: 42a8 0034 clrl %a0@(52) 470fe: 2388 1c00 movel %a0,%a1@(00000000,%d1:l:4) information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 47102: 2142 000c movel %d2,%a0@(12) &_Timer_Information, &the_timer->Object, (Objects_Name) name ); *id = the_timer->Object.id; 47106: 2480 movel %d0,%a2@ _Thread_Enable_dispatch(); 47108: 4eb9 0004 92cc jsr 492cc <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; } 4710e: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 (Objects_Name) name ); *id = the_timer->Object.id; _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; 47114: 4280 clrl %d0 } 47116: 4e5e unlk %fp 47118: 4e75 rts if ( !rtems_is_name_valid( name ) ) return RTEMS_INVALID_NAME; if ( !id ) return RTEMS_INVALID_ADDRESS; 4711a: 7009 moveq #9,%d0 ); *id = the_timer->Object.id; _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 4711c: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 47122: 4e5e unlk %fp 47124: 4e75 rts _Thread_Disable_dispatch(); /* to prevent deletion */ the_timer = _Timer_Allocate(); if ( !the_timer ) { _Thread_Enable_dispatch(); 47126: 4eb9 0004 92cc jsr 492cc <_Thread_Enable_dispatch> return RTEMS_TOO_MANY; 4712c: 7005 moveq #5,%d0 ); *id = the_timer->Object.id; _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 4712e: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 47134: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00057324 : */ rtems_status_code rtems_timer_reset( rtems_id id ) { 57324: 4e56 fff0 linkw %fp,#-16 57328: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 5732c: 486e fffc pea %fp@(-4) 57330: 2f2e 0008 movel %fp@(8),%sp@- 57334: 4879 0007 e5ce pea 7e5ce <_Timer_Information> 5733a: 4eb9 0005 9f3c jsr 59f3c <_Objects_Get> Timer_Control *the_timer; Objects_Locations location; rtems_status_code status = RTEMS_SUCCESSFUL; the_timer = _Timer_Get( id, &location ); switch ( location ) { 57340: 4fef 000c lea %sp@(12),%sp 57344: 2440 moveal %d0,%a2 57346: 4aae fffc tstl %fp@(-4) 5734a: 6620 bnes 5736c case OBJECTS_LOCAL: if ( the_timer->the_class == TIMER_INTERVAL ) { 5734c: 202a 0038 movel %a2@(56),%d0 57350: 6728 beqs 5737a _Watchdog_Remove( &the_timer->Ticker ); _Watchdog_Insert( &_Watchdog_Ticks_chain, &the_timer->Ticker ); } else if ( the_timer->the_class == TIMER_INTERVAL_ON_TASK ) { 57352: 7201 moveq #1,%d1 57354: b280 cmpl %d0,%d1 57356: 674a beqs 573a2 /* * Must be dormant or time of day timer (e.g. TIMER_DORMANT, * TIMER_TIME_OF_DAY, or TIMER_TIME_OF_DAY_ON_TASK). We * can only reset active interval timers. */ status = RTEMS_NOT_DEFINED; 57358: 740b moveq #11,%d2 } _Thread_Enable_dispatch(); 5735a: 4eb9 0005 ad04 jsr 5ad04 <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 57360: 2002 movel %d2,%d0 57362: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3 57368: 4e5e unlk %fp 5736a: 4e75 rts #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 5736c: 7404 moveq #4,%d2 } 5736e: 2002 movel %d2,%d0 57370: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3 57376: 4e5e unlk %fp 57378: 4e75 rts the_timer = _Timer_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: if ( the_timer->the_class == TIMER_INTERVAL ) { _Watchdog_Remove( &the_timer->Ticker ); 5737a: 45ea 0010 lea %a2@(16),%a2 rtems_id id ) { Timer_Control *the_timer; Objects_Locations location; rtems_status_code status = RTEMS_SUCCESSFUL; 5737e: 4282 clrl %d2 the_timer = _Timer_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: if ( the_timer->the_class == TIMER_INTERVAL ) { _Watchdog_Remove( &the_timer->Ticker ); 57380: 2f0a movel %a2,%sp@- 57382: 4eb9 0005 bea4 jsr 5bea4 <_Watchdog_Remove> _Watchdog_Insert( &_Watchdog_Ticks_chain, &the_timer->Ticker ); 57388: 2f0a movel %a2,%sp@- 5738a: 4879 0007 de04 pea 7de04 <_Watchdog_Ticks_chain> 57390: 4eb9 0005 bd5c jsr 5bd5c <_Watchdog_Insert> 57396: 4fef 000c lea %sp@(12),%sp * TIMER_TIME_OF_DAY, or TIMER_TIME_OF_DAY_ON_TASK). We * can only reset active interval timers. */ status = RTEMS_NOT_DEFINED; } _Thread_Enable_dispatch(); 5739a: 4eb9 0005 ad04 jsr 5ad04 <_Thread_Enable_dispatch> 573a0: 60be bras 57360 if ( !timer_server ) { _Thread_Enable_dispatch(); return RTEMS_INCORRECT_STATE; } #endif _Watchdog_Remove( &the_timer->Ticker ); 573a2: 486a 0010 pea %a2@(16) rtems_id id ) { Timer_Control *the_timer; Objects_Locations location; rtems_status_code status = RTEMS_SUCCESSFUL; 573a6: 4282 clrl %d2 case OBJECTS_LOCAL: if ( the_timer->the_class == TIMER_INTERVAL ) { _Watchdog_Remove( &the_timer->Ticker ); _Watchdog_Insert( &_Watchdog_Ticks_chain, &the_timer->Ticker ); } else if ( the_timer->the_class == TIMER_INTERVAL_ON_TASK ) { Timer_server_Control *timer_server = _Timer_server; 573a8: 2679 0007 e608 moveal 7e608 <_Timer_server>,%a3 if ( !timer_server ) { _Thread_Enable_dispatch(); return RTEMS_INCORRECT_STATE; } #endif _Watchdog_Remove( &the_timer->Ticker ); 573ae: 4eb9 0005 bea4 jsr 5bea4 <_Watchdog_Remove> (*timer_server->schedule_operation)( timer_server, the_timer ); 573b4: 2f0a movel %a2,%sp@- 573b6: 2f0b movel %a3,%sp@- 573b8: 206b 0004 moveal %a3@(4),%a0 573bc: 4e90 jsr %a0@ 573be: 4fef 000c lea %sp@(12),%sp * TIMER_TIME_OF_DAY, or TIMER_TIME_OF_DAY_ON_TASK). We * can only reset active interval timers. */ status = RTEMS_NOT_DEFINED; } _Thread_Enable_dispatch(); 573c2: 4eb9 0005 ad04 jsr 5ad04 <_Thread_Enable_dispatch> 573c8: 6096 bras 57360 ... =============================================================================== 000574b4 : rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ) { 574b4: 4e56 fff0 linkw %fp,#-16 574b8: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ Timer_Control *the_timer; Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; 574bc: 2479 0007 e608 moveal 7e608 <_Timer_server>,%a2 if ( !timer_server ) 574c2: 4a8a tstl %a2 574c4: 6736 beqs 574fc return RTEMS_INCORRECT_STATE; if ( !_TOD_Is_set ) 574c6: 4a39 0007 dd5c tstb 7dd5c <_TOD_Is_set> 574cc: 660c bnes 574da <== ALWAYS TAKEN return RTEMS_NOT_DEFINED; 574ce: 700b moveq #11,%d0 <== NOT EXECUTED case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 574d0: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3 <== NOT EXECUTED 574d6: 4e5e unlk %fp <== NOT EXECUTED 574d8: 4e75 rts <== NOT EXECUTED return RTEMS_INCORRECT_STATE; if ( !_TOD_Is_set ) return RTEMS_NOT_DEFINED; if ( !routine ) 574da: 4aae 0010 tstl %fp@(16) 574de: 6728 beqs 57508 return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) 574e0: 2f2e 000c movel %fp@(12),%sp@- 574e4: 4eb9 0005 40cc jsr 540cc <_TOD_Validate> 574ea: 588f addql #4,%sp 574ec: 4a00 tstb %d0 574ee: 6624 bnes 57514 return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); if ( seconds <= _TOD_Seconds_since_epoch() ) return RTEMS_INVALID_CLOCK; 574f0: 7014 moveq #20,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 574f2: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3 574f8: 4e5e unlk %fp 574fa: 4e75 rts Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; if ( !timer_server ) return RTEMS_INCORRECT_STATE; 574fc: 700e moveq #14,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 574fe: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3 57504: 4e5e unlk %fp 57506: 4e75 rts if ( !_TOD_Is_set ) return RTEMS_NOT_DEFINED; if ( !routine ) return RTEMS_INVALID_ADDRESS; 57508: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 5750a: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3 57510: 4e5e unlk %fp 57512: 4e75 rts return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 57514: 2f2e 000c movel %fp@(12),%sp@- 57518: 4eb9 0005 3fc4 jsr 53fc4 <_TOD_To_seconds> if ( seconds <= _TOD_Seconds_since_epoch() ) 5751e: 588f addql #4,%sp return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 57520: 2400 movel %d0,%d2 if ( seconds <= _TOD_Seconds_since_epoch() ) 57522: b0b9 0007 ddd6 cmpl 7ddd6 <_TOD_Now>,%d0 57528: 63c6 blss 574f0 5752a: 486e fffc pea %fp@(-4) 5752e: 2f2e 0008 movel %fp@(8),%sp@- 57532: 4879 0007 e5ce pea 7e5ce <_Timer_Information> 57538: 4eb9 0005 9f3c jsr 59f3c <_Objects_Get> return RTEMS_INVALID_CLOCK; the_timer = _Timer_Get( id, &location ); switch ( location ) { 5753e: 4fef 000c lea %sp@(12),%sp 57542: 2640 moveal %d0,%a3 57544: 4aae fffc tstl %fp@(-4) 57548: 6654 bnes 5759e case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); 5754a: 486b 0010 pea %a3@(16) 5754e: 4eb9 0005 bea4 jsr 5bea4 <_Watchdog_Remove> the_watchdog->user_data = user_data; 57554: 276e 0014 0034 movel %fp@(20),%a3@(52) the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK; 5755a: 7003 moveq #3,%d0 _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); 5755c: 94b9 0007 ddd6 subl 7ddd6 <_TOD_Now>,%d2 the_timer = _Timer_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK; 57562: 2740 0038 movel %d0,%a3@(56) Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 57566: 202e 0010 movel %fp@(16),%d0 5756a: 2740 002c movel %d0,%a3@(44) the_watchdog->id = id; 5756e: 202e 0008 movel %fp@(8),%d0 _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); 57572: 2742 001c movel %d2,%a3@(28) 57576: 2740 0030 movel %d0,%a3@(48) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 5757a: 42ab 0018 clrl %a3@(24) (*timer_server->schedule_operation)( timer_server, the_timer ); 5757e: 2f0b movel %a3,%sp@- 57580: 2f0a movel %a2,%sp@- 57582: 206a 0004 moveal %a2@(4),%a0 57586: 4e90 jsr %a0@ _Thread_Enable_dispatch(); 57588: 4eb9 0005 ad04 jsr 5ad04 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 5758e: 4fef 000c lea %sp@(12),%sp 57592: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 57594: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3 5759a: 4e5e unlk %fp 5759c: 4e75 rts #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 5759e: 7004 moveq #4,%d0 } 575a0: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3 575a6: 4e5e unlk %fp ... =============================================================================== 000473ac : int sched_get_priority_max( int policy ) { switch ( policy ) { 473ac: 7004 moveq #4,%d0 #include int sched_get_priority_max( int policy ) { 473ae: 4e56 0000 linkw %fp,#0 473b2: 222e 0008 movel %fp@(8),%d1 switch ( policy ) { 473b6: b081 cmpl %d1,%d0 473b8: 6412 bccs 473cc case SCHED_RR: case SCHED_SPORADIC: break; default: rtems_set_errno_and_return_minus_one( EINVAL ); 473ba: 4eb9 0004 fd54 jsr 4fd54 <__errno> 473c0: 7216 moveq #22,%d1 473c2: 2040 moveal %d0,%a0 473c4: 70ff moveq #-1,%d0 } return POSIX_SCHEDULER_MAXIMUM_PRIORITY; } 473c6: 4e5e unlk %fp case SCHED_RR: case SCHED_SPORADIC: break; default: rtems_set_errno_and_return_minus_one( EINVAL ); 473c8: 2081 movel %d1,%a0@ } return POSIX_SCHEDULER_MAXIMUM_PRIORITY; } 473ca: 4e75 rts int sched_get_priority_max( int policy ) { switch ( policy ) { 473cc: 103c 0001 moveb #1,%d0 473d0: e3a8 lsll %d1,%d0 473d2: 7217 moveq #23,%d1 473d4: c081 andl %d1,%d0 473d6: 67e2 beqs 473ba <== NEVER TAKEN default: rtems_set_errno_and_return_minus_one( EINVAL ); } return POSIX_SCHEDULER_MAXIMUM_PRIORITY; 473d8: 4280 clrl %d0 473da: 1039 0006 076a moveb 6076a ,%d0 } 473e0: 4e5e unlk %fp default: rtems_set_errno_and_return_minus_one( EINVAL ); } return POSIX_SCHEDULER_MAXIMUM_PRIORITY; 473e2: 5380 subql #1,%d0 } ... =============================================================================== 000473e8 : int sched_get_priority_min( int policy ) { switch ( policy ) { 473e8: 7004 moveq #4,%d0 #include int sched_get_priority_min( int policy ) { 473ea: 4e56 0000 linkw %fp,#0 473ee: 222e 0008 movel %fp@(8),%d1 switch ( policy ) { 473f2: b081 cmpl %d1,%d0 473f4: 6412 bccs 47408 <== NEVER TAKEN case SCHED_RR: case SCHED_SPORADIC: break; default: rtems_set_errno_and_return_minus_one( EINVAL ); 473f6: 4eb9 0004 fd54 jsr 4fd54 <__errno> 473fc: 7216 moveq #22,%d1 473fe: 2040 moveal %d0,%a0 47400: 70ff moveq #-1,%d0 } return POSIX_SCHEDULER_MINIMUM_PRIORITY; } 47402: 4e5e unlk %fp case SCHED_RR: case SCHED_SPORADIC: break; default: rtems_set_errno_and_return_minus_one( EINVAL ); 47404: 2081 movel %d1,%a0@ } return POSIX_SCHEDULER_MINIMUM_PRIORITY; } 47406: 4e75 rts int sched_get_priority_min( int policy ) { switch ( policy ) { 47408: 103c 0001 moveb #1,%d0 4740c: e3a8 lsll %d1,%d0 4740e: 7217 moveq #23,%d1 47410: c081 andl %d1,%d0 47412: 67e2 beqs 473f6 <== NEVER TAKEN default: rtems_set_errno_and_return_minus_one( EINVAL ); } return POSIX_SCHEDULER_MINIMUM_PRIORITY; 47414: 7001 moveq #1,%d0 } 47416: 4e5e unlk %fp ... =============================================================================== 0004741c : int sched_rr_get_interval( pid_t pid, struct timespec *interval ) { 4741c: 4e56 0000 linkw %fp,#0 47420: 2f03 movel %d3,%sp@- 47422: 262e 0008 movel %fp@(8),%d3 47426: 2f02 movel %d2,%sp@- 47428: 242e 000c movel %fp@(12),%d2 /* * Only supported for the "calling process" (i.e. this node). */ if ( pid && pid != getpid() ) 4742c: 4a83 tstl %d3 4742e: 6622 bnes 47452 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( ESRCH ); if ( !interval ) 47430: 4a82 tstl %d2 47432: 6742 beqs 47476 rtems_set_errno_and_return_minus_one( EINVAL ); _Timespec_From_ticks( _Thread_Ticks_per_timeslice, interval ); 47434: 2f02 movel %d2,%sp@- 47436: 2f39 0006 20c0 movel 620c0 <_Thread_Ticks_per_timeslice>,%sp@- 4743c: 4eb9 0004 ae5c jsr 4ae5c <_Timespec_From_ticks> return 0; } 47442: 242e fff8 movel %fp@(-8),%d2 if ( !interval ) rtems_set_errno_and_return_minus_one( EINVAL ); _Timespec_From_ticks( _Thread_Ticks_per_timeslice, interval ); return 0; 47446: 508f addql #8,%sp 47448: 4280 clrl %d0 } 4744a: 262e fffc movel %fp@(-4),%d3 4744e: 4e5e unlk %fp 47450: 4e75 rts { /* * Only supported for the "calling process" (i.e. this node). */ if ( pid && pid != getpid() ) 47452: 4eb9 0004 39dc jsr 439dc 47458: b680 cmpl %d0,%d3 4745a: 67d4 beqs 47430 rtems_set_errno_and_return_minus_one( ESRCH ); 4745c: 4eb9 0004 fd54 jsr 4fd54 <__errno> 47462: 7403 moveq #3,%d2 47464: 2040 moveal %d0,%a0 47466: 70ff moveq #-1,%d0 47468: 2082 movel %d2,%a0@ if ( !interval ) rtems_set_errno_and_return_minus_one( EINVAL ); _Timespec_From_ticks( _Thread_Ticks_per_timeslice, interval ); return 0; } 4746a: 242e fff8 movel %fp@(-8),%d2 4746e: 262e fffc movel %fp@(-4),%d3 47472: 4e5e unlk %fp 47474: 4e75 rts if ( pid && pid != getpid() ) rtems_set_errno_and_return_minus_one( ESRCH ); if ( !interval ) rtems_set_errno_and_return_minus_one( EINVAL ); 47476: 4eb9 0004 fd54 jsr 4fd54 <__errno> _Timespec_From_ticks( _Thread_Ticks_per_timeslice, interval ); return 0; } 4747c: 242e fff8 movel %fp@(-8),%d2 if ( pid && pid != getpid() ) rtems_set_errno_and_return_minus_one( ESRCH ); if ( !interval ) rtems_set_errno_and_return_minus_one( EINVAL ); 47480: 2040 moveal %d0,%a0 47482: 7216 moveq #22,%d1 47484: 70ff moveq #-1,%d0 _Timespec_From_ticks( _Thread_Ticks_per_timeslice, interval ); return 0; } 47486: 262e fffc movel %fp@(-4),%d3 4748a: 4e5e unlk %fp if ( pid && pid != getpid() ) rtems_set_errno_and_return_minus_one( ESRCH ); if ( !interval ) rtems_set_errno_and_return_minus_one( EINVAL ); 4748c: 2081 movel %d1,%a0@ <== NOT EXECUTED _Timespec_From_ticks( _Thread_Ticks_per_timeslice, interval ); return 0; } =============================================================================== 00049868 : int oflag, ... /* mode_t mode, */ /* unsigned int value */ ) { 49868: 4e56 ffdc linkw %fp,#-36 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { _Thread_Dispatch_disable_level++; 4986c: 2039 0006 61a4 movel 661a4 <_Thread_Dispatch_disable_level>,%d0 49872: 5280 addql #1,%d0 49874: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@ 49878: 23c0 0006 61a4 movel %d0,661a4 <_Thread_Dispatch_disable_level> 4987e: 2a2e 0008 movel %fp@(8),%d5 49882: 262e 000c movel %fp@(12),%d3 return _Thread_Dispatch_disable_level; 49886: 2039 0006 61a4 movel 661a4 <_Thread_Dispatch_disable_level>,%d0 POSIX_Semaphore_Control *the_semaphore; Objects_Locations location; _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { 4988c: 2803 movel %d3,%d4 4988e: 0284 0000 0200 andil #512,%d4 49894: 6600 0086 bnew 4991c /* unsigned int value */ ) { va_list arg; mode_t mode; unsigned int value = 0; 49898: 97cb subal %a3,%a3 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 ); 4989a: 45ee fff4 lea %fp@(-12),%a2 4989e: 2f0a movel %a2,%sp@- 498a0: 2f05 movel %d5,%sp@- 498a2: 4eb9 0005 0388 jsr 50388 <_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 ) { 498a8: 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 ); 498aa: 2400 movel %d0,%d2 * 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 ) { 498ac: 6726 beqs 498d4 /* * 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) ) ) { 498ae: 7002 moveq #2,%d0 498b0: b082 cmpl %d2,%d0 498b2: 6604 bnes 498b8 <== NEVER TAKEN 498b4: 4a84 tstl %d4 498b6: 666c bnes 49924 _Thread_Enable_dispatch(); 498b8: 4eb9 0004 c91c jsr 4c91c <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one_cast( status, sem_t * ); 498be: 4eb9 0005 3140 jsr 53140 <__errno> 498c4: 2040 moveal %d0,%a0 498c6: 70ff moveq #-1,%d0 498c8: 2082 movel %d2,%a0@ id = &the_semaphore->Semaphore_id; #else id = (sem_t *)&the_semaphore->Object.id; #endif return id; } 498ca: 4cee 0c3c ffdc moveml %fp@(-36),%d2-%d5/%a2-%a3 498d0: 4e5e unlk %fp 498d2: 4e75 rts /* * Check for existence with creation. */ if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { 498d4: 0283 0000 0a00 andil #2560,%d3 498da: 0c83 0000 0a00 cmpil #2560,%d3 498e0: 6770 beqs 49952 498e2: 486e fffc pea %fp@(-4) rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * ); } the_semaphore = _POSIX_Semaphore_Get( &the_semaphore_id, &location ); the_semaphore->open_count += 1; _Thread_Enable_dispatch(); 498e6: 47f9 0004 c91c lea 4c91c <_Thread_Enable_dispatch>,%a3 498ec: 2f12 movel %a2@,%sp@- 498ee: 4879 0006 63b2 pea 663b2 <_POSIX_Semaphore_Information> 498f4: 4eb9 0004 bb4c jsr 4bb4c <_Objects_Get> _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * ); } the_semaphore = _POSIX_Semaphore_Get( &the_semaphore_id, &location ); the_semaphore->open_count += 1; 498fa: 2040 moveal %d0,%a0 498fc: 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 ); 49900: 2d40 fff8 movel %d0,%fp@(-8) the_semaphore->open_count += 1; _Thread_Enable_dispatch(); 49904: 4e93 jsr %a3@ _Thread_Enable_dispatch(); 49906: 4e93 jsr %a3@ goto return_id; 49908: 4fef 000c lea %sp@(12),%sp the_semaphore->Semaphore_id = the_semaphore->Object.id; id = &the_semaphore->Semaphore_id; #else id = (sem_t *)&the_semaphore->Object.id; #endif return id; 4990c: 202e fff8 movel %fp@(-8),%d0 49910: 5080 addql #8,%d0 } 49912: 4cee 0c3c ffdc moveml %fp@(-36),%d2-%d5/%a2-%a3 49918: 4e5e unlk %fp 4991a: 4e75 rts _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { va_start(arg, oflag); mode = (mode_t) va_arg( arg, unsigned int ); value = va_arg( arg, unsigned int ); 4991c: 266e 0014 moveal %fp@(20),%a3 49920: 6000 ff78 braw 4989a /* * 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( 49924: 486e fff8 pea %fp@(-8) 49928: 2f0b movel %a3,%sp@- 4992a: 42a7 clrl %sp@- 4992c: 2f05 movel %d5,%sp@- 4992e: 4eb9 0005 01cc jsr 501cc <_POSIX_Semaphore_Create_support> 49934: 2400 movel %d0,%d2 /* * errno was set by Create_support, so don't set it again. */ _Thread_Enable_dispatch(); 49936: 4eb9 0004 c91c jsr 4c91c <_Thread_Enable_dispatch> if ( status == -1 ) 4993c: 4fef 0010 lea %sp@(16),%sp 49940: 70ff moveq #-1,%d0 49942: b082 cmpl %d2,%d0 49944: 66c6 bnes 4990c return SEM_FAILED; 49946: 70ff moveq #-1,%d0 id = &the_semaphore->Semaphore_id; #else id = (sem_t *)&the_semaphore->Object.id; #endif return id; } 49948: 4cee 0c3c ffdc moveml %fp@(-36),%d2-%d5/%a2-%a3 4994e: 4e5e unlk %fp 49950: 4e75 rts /* * Check for existence with creation. */ if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { _Thread_Enable_dispatch(); 49952: 4eb9 0004 c91c jsr 4c91c <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * ); 49958: 4eb9 0005 3140 jsr 53140 <__errno> 4995e: 7211 moveq #17,%d1 49960: 2040 moveal %d0,%a0 49962: 70ff moveq #-1,%d0 id = &the_semaphore->Semaphore_id; #else id = (sem_t *)&the_semaphore->Object.id; #endif return id; } 49964: 4cee 0c3c ffdc moveml %fp@(-36),%d2-%d5/%a2-%a3 * Check for existence with creation. */ if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * ); 4996a: 2081 movel %d1,%a0@ id = &the_semaphore->Semaphore_id; #else id = (sem_t *)&the_semaphore->Object.id; #endif return id; } 4996c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000499c8 : int sem_timedwait( sem_t *sem, const struct timespec *abstime ) { 499c8: 4e56 fffc linkw %fp,#-4 499cc: 2f02 movel %d2,%sp@- * * If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID, * POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW, * then we should not wait. */ status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks ); 499ce: 486e fffc pea %fp@(-4) 499d2: 2f2e 000c movel %fp@(12),%sp@- int sem_timedwait( sem_t *sem, const struct timespec *abstime ) { 499d6: 242e 0008 movel %fp@(8),%d2 * * If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID, * POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW, * then we should not wait. */ status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks ); 499da: 4eb9 0004 f7fc jsr 4f7fc <_POSIX_Absolute_timeout_to_ticks> if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) 499e0: 508f addql #8,%sp 499e2: 7203 moveq #3,%d1 499e4: b280 cmpl %d0,%d1 499e6: 671a beqs 49a02 <== ALWAYS TAKEN do_wait = false; lock_status = _POSIX_Semaphore_Wait_support( sem, do_wait, ticks ); 499e8: 2f2e fffc movel %fp@(-4),%sp@- <== NOT EXECUTED 499ec: 42a7 clrl %sp@- <== NOT EXECUTED 499ee: 2f02 movel %d2,%sp@- <== NOT EXECUTED 499f0: 4eb9 0005 03fc jsr 503fc <_POSIX_Semaphore_Wait_support> <== NOT EXECUTED lock_status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) rtems_set_errno_and_return_minus_one( ETIMEDOUT ); } return lock_status; } 499f6: 242e fff8 movel %fp@(-8),%d2 <== NOT EXECUTED */ status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks ); if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; lock_status = _POSIX_Semaphore_Wait_support( sem, do_wait, ticks ); 499fa: 4fef 000c lea %sp@(12),%sp <== NOT EXECUTED lock_status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) rtems_set_errno_and_return_minus_one( ETIMEDOUT ); } return lock_status; } 499fe: 4e5e unlk %fp <== NOT EXECUTED 49a00: 4e75 rts <== NOT EXECUTED */ status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks ); if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; lock_status = _POSIX_Semaphore_Wait_support( sem, do_wait, ticks ); 49a02: 2f2e fffc movel %fp@(-4),%sp@- 49a06: 4878 0001 pea 1 49a0a: 2f02 movel %d2,%sp@- 49a0c: 4eb9 0005 03fc jsr 503fc <_POSIX_Semaphore_Wait_support> lock_status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) rtems_set_errno_and_return_minus_one( ETIMEDOUT ); } return lock_status; } 49a12: 242e fff8 movel %fp@(-8),%d2 */ status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks ); if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; lock_status = _POSIX_Semaphore_Wait_support( sem, do_wait, ticks ); 49a16: 4fef 000c lea %sp@(12),%sp lock_status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) rtems_set_errno_and_return_minus_one( ETIMEDOUT ); } return lock_status; } 49a1a: 4e5e unlk %fp ... =============================================================================== 000470a4 : int sigaction( int sig, const struct sigaction *act, struct sigaction *oact ) { 470a4: 4e56 fff4 linkw %fp,#-12 470a8: 226e 0010 moveal %fp@(16),%a1 470ac: 48d7 040c moveml %d2-%d3/%a2,%sp@ 470b0: 242e 0008 movel %fp@(8),%d2 470b4: 246e 000c moveal %fp@(12),%a2 ISR_Level level; if ( oact ) 470b8: 4a89 tstl %a1 470ba: 6718 beqs 470d4 *oact = _POSIX_signals_Vectors[ sig ]; 470bc: 2202 movel %d2,%d1 470be: 2002 movel %d2,%d0 470c0: e989 lsll #4,%d1 470c2: e588 lsll #2,%d0 470c4: 2041 moveal %d1,%a0 470c6: 91c0 subal %d0,%a0 470c8: d1fc 0006 30f4 addal #405748,%a0 470ce: 22d8 movel %a0@+,%a1@+ 470d0: 22d8 movel %a0@+,%a1@+ 470d2: 2290 movel %a0@,%a1@ if ( !sig ) 470d4: 4a82 tstl %d2 470d6: 6700 0088 beqw 47160 static inline bool is_valid_signo( int signo ) { return ((signo) >= 1 && (signo) <= 32 ); 470da: 2002 movel %d2,%d0 470dc: 5380 subql #1,%d0 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 470de: 721f moveq #31,%d1 470e0: b280 cmpl %d0,%d1 470e2: 657c bcss 47160 * * NOTE: Solaris documentation claims to "silently enforce" this which * contradicts the POSIX specification. */ if ( sig == SIGKILL ) 470e4: 7009 moveq #9,%d0 470e6: b082 cmpl %d2,%d0 470e8: 6776 beqs 47160 /* * Evaluate the new action structure and set the global signal vector * appropriately. */ if ( act ) { 470ea: 4a8a tstl %a2 470ec: 6766 beqs 47154 <== 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 ); 470ee: 203c 0000 0700 movel #1792,%d0 470f4: 40c3 movew %sr,%d3 470f6: 8083 orl %d3,%d0 470f8: 46c0 movew %d0,%sr if ( act->sa_handler == SIG_DFL ) { 470fa: 4aaa 0008 tstl %a2@(8) 470fe: 6730 beqs 47130 _POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ]; } else { _POSIX_signals_Clear_process_signals( sig ); 47100: 2f02 movel %d2,%sp@- 47102: 4eb9 0004 d1c8 jsr 4d1c8 <_POSIX_signals_Clear_process_signals> _POSIX_signals_Vectors[ sig ] = *act; 47108: 588f addql #4,%sp 4710a: 2002 movel %d2,%d0 4710c: 224a moveal %a2,%a1 4710e: e98a lsll #4,%d2 47110: e588 lsll #2,%d0 47112: 2042 moveal %d2,%a0 47114: 91c0 subal %d0,%a0 47116: d1fc 0006 30f4 addal #405748,%a0 4711c: 20d9 movel %a1@+,%a0@+ 4711e: 20d9 movel %a1@+,%a0@+ 47120: 2091 movel %a1@,%a0@ } _ISR_Enable( level ); 47122: 46c3 movew %d3,%sr * now (signals not posted when SIG_IGN). * + If we are now ignoring a signal that was previously pending, * we clear the pending signal indicator. */ return 0; 47124: 4280 clrl %d0 } 47126: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 4712c: 4e5e unlk %fp 4712e: 4e75 rts * we can just copy the provided sigaction structure into the vectors. */ _ISR_Disable( level ); if ( act->sa_handler == SIG_DFL ) { _POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ]; 47130: 2002 movel %d2,%d0 47132: e98a lsll #4,%d2 47134: e588 lsll #2,%d0 47136: 9480 subl %d0,%d2 47138: 2242 moveal %d2,%a1 4713a: 2042 moveal %d2,%a0 4713c: d3fc 0006 063a addal #394810,%a1 47142: d1fc 0006 30f4 addal #405748,%a0 47148: 20d9 movel %a1@+,%a0@+ 4714a: 20d9 movel %a1@+,%a0@+ 4714c: 2091 movel %a1@,%a0@ } else { _POSIX_signals_Clear_process_signals( sig ); _POSIX_signals_Vectors[ sig ] = *act; } _ISR_Enable( level ); 4714e: 46c3 movew %d3,%sr * now (signals not posted when SIG_IGN). * + If we are now ignoring a signal that was previously pending, * we clear the pending signal indicator. */ return 0; 47150: 4280 clrl %d0 47152: 60d2 bras 47126 47154: 4280 clrl %d0 <== NOT EXECUTED } 47156: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 <== NOT EXECUTED 4715c: 4e5e unlk %fp <== NOT EXECUTED 4715e: 4e75 rts <== NOT EXECUTED * NOTE: Solaris documentation claims to "silently enforce" this which * contradicts the POSIX specification. */ if ( sig == SIGKILL ) rtems_set_errno_and_return_minus_one( EINVAL ); 47160: 4eb9 0004 ffa8 jsr 4ffa8 <__errno> 47166: 7216 moveq #22,%d1 47168: 2040 moveal %d0,%a0 4716a: 70ff moveq #-1,%d0 * + If we are now ignoring a signal that was previously pending, * we clear the pending signal indicator. */ return 0; } 4716c: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 * NOTE: Solaris documentation claims to "silently enforce" this which * contradicts the POSIX specification. */ if ( sig == SIGKILL ) rtems_set_errno_and_return_minus_one( EINVAL ); 47172: 2081 movel %d1,%a0@ * + If we are now ignoring a signal that was previously pending, * we clear the pending signal indicator. */ return 0; } 47174: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00049a50 : int sigwait( const sigset_t *set, int *sig ) { 49a50: 4e56 0000 linkw %fp,#0 49a54: 2f0a movel %a2,%sp@- 49a56: 246e 000c moveal %fp@(12),%a2 int status; status = sigtimedwait( set, NULL, NULL ); 49a5a: 42a7 clrl %sp@- 49a5c: 42a7 clrl %sp@- 49a5e: 2f2e 0008 movel %fp@(8),%sp@- 49a62: 4eb9 0004 9834 jsr 49834 if ( status != -1 ) { 49a68: 4fef 000c lea %sp@(12),%sp 49a6c: 72ff moveq #-1,%d1 49a6e: b280 cmpl %d0,%d1 49a70: 6710 beqs 49a82 if ( sig ) 49a72: 4a8a tstl %a2 49a74: 671e beqs 49a94 <== NEVER TAKEN *sig = status; 49a76: 2480 movel %d0,%a2@ return 0; } return errno; } 49a78: 246e fffc moveal %fp@(-4),%a2 status = sigtimedwait( set, NULL, NULL ); if ( status != -1 ) { if ( sig ) *sig = status; return 0; 49a7c: 4280 clrl %d0 } return errno; } 49a7e: 4e5e unlk %fp 49a80: 4e75 rts if ( sig ) *sig = status; return 0; } return errno; 49a82: 4eb9 0005 25fc jsr 525fc <__errno> } 49a88: 246e fffc moveal %fp@(-4),%a2 if ( sig ) *sig = status; return 0; } return errno; 49a8c: 2040 moveal %d0,%a0 } 49a8e: 4e5e unlk %fp if ( sig ) *sig = status; return 0; } return errno; 49a90: 2010 movel %a0@,%d0 } 49a92: 4e75 rts 49a94: 246e fffc moveal %fp@(-4),%a2 <== NOT EXECUTED status = sigtimedwait( set, NULL, NULL ); if ( status != -1 ) { if ( sig ) *sig = status; return 0; 49a98: 4280 clrl %d0 <== NOT EXECUTED } return errno; } 49a9a: 4e5e unlk %fp <== NOT EXECUTED ... =============================================================================== 0004666a : useconds_t ualarm( useconds_t useconds, useconds_t interval ) { 4666a: 4e56 ffe8 linkw %fp,#-24 4666e: 48d7 041c moveml %d2-%d4/%a2,%sp@ 46672: 242e 0008 movel %fp@(8),%d2 /* * Initialize the timer used to implement alarm(). */ if ( !the_timer->routine ) { 46676: 4ab9 0006 2f18 tstl 62f18 <_POSIX_signals_Ualarm_timer+0x1c> 4667c: 6700 0086 beqw 46704 _Watchdog_Initialize( the_timer, _POSIX_signals_Ualarm_TSR, 0, NULL ); } else { Watchdog_States state; state = _Watchdog_Remove( the_timer ); 46680: 4879 0006 2efc pea 62efc <_POSIX_signals_Ualarm_timer> 46686: 4eb9 0004 a5b4 jsr 4a5b4 <_Watchdog_Remove> if ( (state == WATCHDOG_ACTIVE) || (state == WATCHDOG_REMOVE_IT) ) { 4668c: 588f addql #4,%sp 4668e: 7201 moveq #1,%d1 46690: 5580 subql #2,%d0 46692: b280 cmpl %d0,%d1 46694: 6400 0098 bccw 4672e useconds_t ualarm( useconds_t useconds, useconds_t interval ) { useconds_t remaining = 0; 46698: 4283 clrl %d3 <== NOT EXECUTED /* * If useconds is non-zero, then the caller wants to schedule * the alarm repeatedly at that interval. If the interval is * less than a single clock tick, then fudge it to a clock tick. */ if ( useconds ) { 4669a: 4a82 tstl %d2 <== NOT EXECUTED 4669c: 660c bnes 466aa <== NOT EXECUTED _Watchdog_Insert_ticks( the_timer, _Timespec_To_ticks( &tp ) ); } return remaining; } 4669e: 2003 movel %d3,%d0 466a0: 4cee 041c ffe8 moveml %fp@(-24),%d2-%d4/%a2 466a6: 4e5e unlk %fp 466a8: 4e75 rts if ( useconds ) { Watchdog_Interval ticks; tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND; tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; ticks = _Timespec_To_ticks( &tp ); 466aa: 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; 466ac: 223c 000f 4240 movel #1000000,%d1 tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; ticks = _Timespec_To_ticks( &tp ); 466b2: 5184 subql #8,%d4 466b4: 45f9 0004 a0c4 lea 4a0c4 <_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; 466ba: 4c41 2000 remul %d1,%d0,%d2 466be: 4c41 2002 remul %d1,%d2,%d2 tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; 466c2: 223c 0000 03e8 movel #1000,%d1 466c8: 4c00 1800 mulsl %d0,%d1 ticks = _Timespec_To_ticks( &tp ); 466cc: 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; 466ce: 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; 466d2: 2d42 fff8 movel %d2,%fp@(-8) tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; ticks = _Timespec_To_ticks( &tp ); 466d6: 4e92 jsr %a2@ if ( ticks == 0 ) ticks = 1; _Watchdog_Insert_ticks( the_timer, _Timespec_To_ticks( &tp ) ); 466d8: 2f04 movel %d4,%sp@- 466da: 4e92 jsr %a2@ ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 466dc: 4879 0006 2efc pea 62efc <_POSIX_signals_Ualarm_timer> 466e2: 4879 0006 27a0 pea 627a0 <_Watchdog_Ticks_chain> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 466e8: 23c0 0006 2f08 movel %d0,62f08 <_POSIX_signals_Ualarm_timer+0xc> _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 466ee: 4eb9 0004 a46c jsr 4a46c <_Watchdog_Insert> 466f4: 4fef 0010 lea %sp@(16),%sp } return remaining; } 466f8: 2003 movel %d3,%d0 466fa: 4cee 041c ffe8 moveml %fp@(-24),%d2-%d4/%a2 46700: 4e5e unlk %fp 46702: 4e75 rts Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 46704: 42b9 0006 2f04 clrl 62f04 <_POSIX_signals_Ualarm_timer+0x8> useconds_t ualarm( useconds_t useconds, useconds_t interval ) { useconds_t remaining = 0; 4670a: 4283 clrl %d3 the_watchdog->routine = routine; 4670c: 203c 0004 6628 movel #288296,%d0 the_watchdog->id = id; 46712: 42b9 0006 2f1c clrl 62f1c <_POSIX_signals_Ualarm_timer+0x20> Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 46718: 23c0 0006 2f18 movel %d0,62f18 <_POSIX_signals_Ualarm_timer+0x1c> the_watchdog->id = id; the_watchdog->user_data = user_data; 4671e: 42b9 0006 2f20 clrl 62f20 <_POSIX_signals_Ualarm_timer+0x24> /* * If useconds is non-zero, then the caller wants to schedule * the alarm repeatedly at that interval. If the interval is * less than a single clock tick, then fudge it to a clock tick. */ if ( useconds ) { 46724: 4a82 tstl %d2 46726: 6700 ff76 beqw 4669e 4672a: 6000 ff7e braw 466aa * 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); 4672e: 2039 0006 2f10 movel 62f10 <_POSIX_signals_Ualarm_timer+0x14>,%d0 46734: d0b9 0006 2f08 addl 62f08 <_POSIX_signals_Ualarm_timer+0xc>,%d0 /* remaining is now in ticks */ _Timespec_From_ticks( ticks, &tp ); 4673a: 486e fff8 pea %fp@(-8) 4673e: 90b9 0006 2f14 subl 62f14 <_POSIX_signals_Ualarm_timer+0x18>,%d0 remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND; 46744: 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 ); 4674a: 2f00 movel %d0,%sp@- 4674c: 4eb9 0004 a034 jsr 4a034 <_Timespec_From_ticks> remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND; 46752: 202e fff8 movel %fp@(-8),%d0 46756: 4c04 0800 mulsl %d4,%d0 remaining += tp.tv_nsec / 1000; 4675a: 283c 0000 03e8 movel #1000,%d4 46760: 508f addql #8,%sp 46762: 262e fffc movel %fp@(-4),%d3 46766: 4c44 3803 remsl %d4,%d3,%d3 4676a: d680 addl %d0,%d3 /* * If useconds is non-zero, then the caller wants to schedule * the alarm repeatedly at that interval. If the interval is * less than a single clock tick, then fudge it to a clock tick. */ if ( useconds ) { 4676c: 4a82 tstl %d2 4676e: 6700 ff2e beqw 4669e 46772: 6000 ff36 braw 466aa <== NOT EXECUTED ...