00046630 <_API_extensions_Run_postdriver>: * * _API_extensions_Run_postdriver */ void _API_extensions_Run_postdriver( void ) { 46630: 4e56 0000 linkw %fp,#0 46634: 2f0a movel %a2,%sp@- Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _API_extensions_List.first ; 46636: 2479 0005 f2f4 moveal 5f2f4 <_API_extensions_List>,%a2 4663c: b5fc 0005 f2f8 cmpal #389880,%a2 46642: 6710 beqs 46654 <_API_extensions_Run_postdriver+0x24> <== ALWAYS 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)(); 46644: 206a 0008 moveal %a2@(8),%a0 46648: 4e90 jsr %a0@ Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _API_extensions_List.first ; !_Chain_Is_tail( &_API_extensions_List, the_node ) ; the_node = the_node->next ) { 4664a: 2452 moveal %a2@,%a2 void _API_extensions_Run_postdriver( void ) { Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _API_extensions_List.first ; 4664c: b5fc 0005 f2f8 cmpal #389880,%a2 46652: 66f0 bnes 46644 <_API_extensions_Run_postdriver+0x14> #if defined(FUNCTIONALITY_NOT_CURRENTLY_USED_BY_ANY_API) if ( the_extension->postdriver_hook ) #endif (*the_extension->postdriver_hook)(); } } 46654: 246e fffc moveal %fp@(-4),%a2 46658: 4e5e unlk %fp 4665a: 4e75 rts 0004665c <_API_extensions_Run_postswitch>: * * _API_extensions_Run_postswitch */ void _API_extensions_Run_postswitch( void ) { 4665c: 4e56 0000 linkw %fp,#0 46660: 2f0a movel %a2,%sp@- Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _API_extensions_List.first ; 46662: 2479 0005 f2f4 moveal 5f2f4 <_API_extensions_List>,%a2 46668: b5fc 0005 f2f8 cmpal #389880,%a2 4666e: 6718 beqs 46688 <_API_extensions_Run_postswitch+0x2c> <== ALWAYS TAKEN * provide this hook. */ #if defined(RTEMS_ITRON_API) if ( the_extension->postswitch_hook ) #endif (*the_extension->postswitch_hook)( _Thread_Executing ); 46670: 2f39 0005 f20e movel 5f20e <_Thread_Executing>,%sp@- 46676: 206a 000c moveal %a2@(12),%a0 4667a: 4e90 jsr %a0@ Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _API_extensions_List.first ; !_Chain_Is_tail( &_API_extensions_List, the_node ) ; the_node = the_node->next ) { 4667c: 2452 moveal %a2@,%a2 void _API_extensions_Run_postswitch( void ) { Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _API_extensions_List.first ; 4667e: 588f addql #4,%sp 46680: b5fc 0005 f2f8 cmpal #389880,%a2 46686: 66e8 bnes 46670 <_API_extensions_Run_postswitch+0x14> #if defined(RTEMS_ITRON_API) if ( the_extension->postswitch_hook ) #endif (*the_extension->postswitch_hook)( _Thread_Executing ); } } 46688: 246e fffc moveal %fp@(-4),%a2 4668c: 4e5e unlk %fp 4668e: 4e75 rts 00048b10 <_CORE_RWLock_Obtain_for_reading>: * If unlocked, then OK to read. * If locked for reading and no waiters, then OK to read. * If any thread is waiting, then we wait. */ _ISR_Disable( level ); 48b10: 203c 0000 0700 movel #1792,%d0 Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_RWLock_API_mp_support_callout api_rwlock_mp_support ) { 48b16: 4e56 ffe8 linkw %fp,#-24 48b1a: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@ 48b1e: 246e 0008 moveal %fp@(8),%a2 48b22: 2a2e 000c movel %fp@(12),%d5 48b26: 282e 0014 movel %fp@(20),%d4 48b2a: 162e 0013 moveb %fp@(19),%d3 ISR_Level level; Thread_Control *executing = _Thread_Executing; 48b2e: 2679 0006 1f12 moveal 61f12 <_Thread_Executing>,%a3 * If unlocked, then OK to read. * If locked for reading and no waiters, then OK to read. * If any thread is waiting, then we wait. */ _ISR_Disable( level ); 48b34: 40c2 movew %sr,%d2 48b36: 8082 orl %d2,%d0 48b38: 46c0 movew %d0,%sr switch ( the_rwlock->current_state ) { 48b3a: 202a 0044 movel %a2@(68),%d0 48b3e: 661a bnes 48b5a <_CORE_RWLock_Obtain_for_reading+0x4a> case CORE_RWLOCK_UNLOCKED: the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING; the_rwlock->number_of_readers += 1; 48b40: 52aa 0048 addql #1,%a2@(72) */ _ISR_Disable( level ); switch ( the_rwlock->current_state ) { case CORE_RWLOCK_UNLOCKED: the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING; 48b44: 7001 moveq #1,%d0 48b46: 2540 0044 movel %d0,%a2@(68) the_rwlock->number_of_readers += 1; _ISR_Enable( level ); 48b4a: 46c2 movew %d2,%sr executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 48b4c: 42ab 0034 clrl %a3@(52) timeout, _CORE_RWLock_Timeout ); /* return to API level so it can dispatch and we block */ } 48b50: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 48b56: 4e5e unlk %fp 48b58: 4e75 rts * If locked for reading and no waiters, then OK to read. * If any thread is waiting, then we wait. */ _ISR_Disable( level ); switch ( the_rwlock->current_state ) { 48b5a: 7201 moveq #1,%d1 48b5c: b280 cmpl %d0,%d1 48b5e: 674e beqs 48bae <_CORE_RWLock_Obtain_for_reading+0x9e> /* * If the thread is not willing to wait, then return immediately. */ if ( !wait ) { 48b60: 4a03 tstb %d3 48b62: 6612 bnes 48b76 <_CORE_RWLock_Obtain_for_reading+0x66> _ISR_Enable( level ); 48b64: 46c2 movew %d2,%sr executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; 48b66: 7202 moveq #2,%d1 48b68: 2741 0034 movel %d1,%a3@(52) timeout, _CORE_RWLock_Timeout ); /* return to API level so it can dispatch and we block */ } 48b6c: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 48b72: 4e5e unlk %fp 48b74: 4e75 rts 48b76: 7001 moveq #1,%d0 * We need to wait to enter this critical section */ _Thread_queue_Enter_critical_section( &the_rwlock->Wait_queue ); executing->Wait.queue = &the_rwlock->Wait_queue; executing->Wait.id = id; 48b78: 2745 0020 movel %d5,%a3@(32) executing->Wait.option = CORE_RWLOCK_THREAD_WAITING_FOR_READ; executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 48b7c: 42ab 0034 clrl %a3@(52) /* * We need to wait to enter this critical section */ _Thread_queue_Enter_critical_section( &the_rwlock->Wait_queue ); executing->Wait.queue = &the_rwlock->Wait_queue; 48b80: 274a 0044 movel %a2,%a3@(68) executing->Wait.id = id; executing->Wait.option = CORE_RWLOCK_THREAD_WAITING_FOR_READ; 48b84: 42ab 0030 clrl %a3@(48) 48b88: 2540 0030 movel %d0,%a2@(48) executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; _ISR_Enable( level ); 48b8c: 46c2 movew %d2,%sr _Thread_queue_Enqueue_with_handler( 48b8e: 2d44 000c movel %d4,%fp@(12) 48b92: 223c 0004 8d3c movel #298300,%d1 48b98: 2d4a 0008 movel %a2,%fp@(8) timeout, _CORE_RWLock_Timeout ); /* return to API level so it can dispatch and we block */ } 48b9c: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 executing->Wait.id = id; executing->Wait.option = CORE_RWLOCK_THREAD_WAITING_FOR_READ; executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; _ISR_Enable( level ); _Thread_queue_Enqueue_with_handler( 48ba2: 2d41 0010 movel %d1,%fp@(16) timeout, _CORE_RWLock_Timeout ); /* return to API level so it can dispatch and we block */ } 48ba6: 4e5e unlk %fp executing->Wait.id = id; executing->Wait.option = CORE_RWLOCK_THREAD_WAITING_FOR_READ; executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; _ISR_Enable( level ); _Thread_queue_Enqueue_with_handler( 48ba8: 4ef9 0004 a5a8 jmp 4a5a8 <_Thread_queue_Enqueue_with_handler> executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; return; case CORE_RWLOCK_LOCKED_FOR_READING: { Thread_Control *waiter; waiter = _Thread_queue_First( &the_rwlock->Wait_queue ); 48bae: 2f0a movel %a2,%sp@- 48bb0: 4eb9 0004 a910 jsr 4a910 <_Thread_queue_First> if ( !waiter ) { 48bb6: 588f addql #4,%sp 48bb8: 4a80 tstl %d0 48bba: 66a4 bnes 48b60 <_CORE_RWLock_Obtain_for_reading+0x50> <== ALWAYS TAKEN the_rwlock->number_of_readers += 1; 48bbc: 52aa 0048 addql #1,%a2@(72) _ISR_Enable( level ); 48bc0: 46c2 movew %d2,%sr executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 48bc2: 42ab 0034 clrl %a3@(52) timeout, _CORE_RWLock_Timeout ); /* return to API level so it can dispatch and we block */ } 48bc6: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 48bcc: 4e5e unlk %fp 48bce: 4e75 rts 00048c60 <_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 ); 48c60: 203c 0000 0700 movel #1792,%d0 */ CORE_RWLock_Status _CORE_RWLock_Release( CORE_RWLock_Control *the_rwlock ) { 48c66: 4e56 fff0 linkw %fp,#-16 ISR_Level level; Thread_Control *executing = _Thread_Executing; 48c6a: 2079 0006 1f12 moveal 61f12 <_Thread_Executing>,%a0 */ CORE_RWLock_Status _CORE_RWLock_Release( CORE_RWLock_Control *the_rwlock ) { 48c70: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ 48c74: 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 ); 48c78: 40c1 movew %sr,%d1 48c7a: 8081 orl %d1,%d0 48c7c: 46c0 movew %d0,%sr if ( the_rwlock->current_state == CORE_RWLOCK_UNLOCKED){ 48c7e: 202a 0044 movel %a2@(68),%d0 48c82: 6700 0090 beqw 48d14 <_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 ) { 48c86: 7401 moveq #1,%d2 48c88: b480 cmpl %d0,%d2 48c8a: 676e beqs 48cfa <_CORE_RWLock_Release+0x9a> return CORE_RWLOCK_SUCCESSFUL; } } /* CORE_RWLOCK_LOCKED_FOR_WRITING or READING with readers */ executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 48c8c: 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; 48c90: 42aa 0044 clrl %a2@(68) _ISR_Enable( level ); 48c94: 46c1 movew %d1,%sr next = _Thread_queue_Dequeue( &the_rwlock->Wait_queue ); 48c96: 2f0a movel %a2,%sp@- 48c98: 4eb9 0004 a448 jsr 4a448 <_Thread_queue_Dequeue> if ( next ) { 48c9e: 588f addql #4,%sp 48ca0: 4a80 tstl %d0 48ca2: 674a beqs 48cee <_CORE_RWLock_Release+0x8e> if ( next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) { 48ca4: 7201 moveq #1,%d1 48ca6: 2040 moveal %d0,%a0 48ca8: b2a8 0030 cmpl %a0@(48),%d1 48cac: 677c beqs 48d2a <_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; 48cae: 7201 moveq #1,%d1 } /* * Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING */ the_rwlock->number_of_readers += 1; 48cb0: 52aa 0048 addql #1,%a2@(72) 48cb4: 47f9 0004 a910 lea 4a910 <_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 ); 48cba: 49f9 0004 a7bc lea 4a7bc <_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; 48cc0: 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 ); 48cc4: 2f0a movel %a2,%sp@- 48cc6: 4e93 jsr %a3@ if ( !next || 48cc8: 588f addql #4,%sp 48cca: 4a80 tstl %d0 48ccc: 6720 beqs 48cee <_CORE_RWLock_Release+0x8e> <== ALWAYS TAKEN next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) 48cce: 7401 moveq #1,%d2 48cd0: 2040 moveal %d0,%a0 48cd2: b4a8 0030 cmpl %a0@(48),%d2 48cd6: 6716 beqs 48cee <_CORE_RWLock_Release+0x8e> <== ALWAYS TAKEN return CORE_RWLOCK_SUCCESSFUL; the_rwlock->number_of_readers += 1; 48cd8: 52aa 0048 addql #1,%a2@(72) _Thread_queue_Extract( &the_rwlock->Wait_queue, next ); 48cdc: 2f00 movel %d0,%sp@- 48cde: 2f0a movel %a2,%sp@- 48ce0: 4e94 jsr %a4@ } 48ce2: 508f addql #8,%sp /* * Now see if more readers can be let go. */ while ( 1 ) { next = _Thread_queue_First( &the_rwlock->Wait_queue ); 48ce4: 2f0a movel %a2,%sp@- 48ce6: 4e93 jsr %a3@ if ( !next || 48ce8: 588f addql #4,%sp 48cea: 4a80 tstl %d0 48cec: 66e0 bnes 48cce <_CORE_RWLock_Release+0x6e> <== ALWAYS TAKEN } /* indentation is to match _ISR_Disable at top */ return CORE_RWLOCK_SUCCESSFUL; } 48cee: 4280 clrl %d0 48cf0: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 48cf6: 4e5e unlk %fp 48cf8: 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; 48cfa: 202a 0048 movel %a2@(72),%d0 48cfe: 5380 subql #1,%d0 48d00: 2540 0048 movel %d0,%a2@(72) if ( the_rwlock->number_of_readers != 0 ) { 48d04: 6786 beqs 48c8c <_CORE_RWLock_Release+0x2c> /* must be unlocked again */ _ISR_Enable( level ); 48d06: 46c1 movew %d1,%sr } /* indentation is to match _ISR_Disable at top */ return CORE_RWLOCK_SUCCESSFUL; } 48d08: 4280 clrl %d0 48d0a: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 48d10: 4e5e unlk %fp 48d12: 4e75 rts * If any thread is waiting, then we wait. */ _ISR_Disable( level ); if ( the_rwlock->current_state == CORE_RWLOCK_UNLOCKED){ _ISR_Enable( level ); 48d14: 46c1 movew %d1,%sr executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; 48d16: 103c 0002 moveb #2,%d0 } /* indentation is to match _ISR_Disable at top */ return CORE_RWLOCK_SUCCESSFUL; } 48d1a: 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; 48d20: 2140 0034 movel %d0,%a0@(52) } /* indentation is to match _ISR_Disable at top */ return CORE_RWLOCK_SUCCESSFUL; } 48d24: 4280 clrl %d0 48d26: 4e5e unlk %fp 48d28: 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; 48d2a: 7002 moveq #2,%d0 48d2c: 2540 0044 movel %d0,%a2@(68) } /* indentation is to match _ISR_Disable at top */ return CORE_RWLOCK_SUCCESSFUL; } 48d30: 4280 clrl %d0 48d32: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 48d38: 4e5e unlk %fp 48d3a: 4e75 rts 00048d3c <_CORE_RWLock_Timeout>: void _CORE_RWLock_Timeout( Objects_Id id, void *ignored ) { 48d3c: 4e56 fffc linkw %fp,#-4 Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 48d40: 486e fffc pea %fp@(-4) 48d44: 2f2e 0008 movel %fp@(8),%sp@- 48d48: 4eb9 0004 a084 jsr 4a084 <_Thread_Get> switch ( location ) { 48d4e: 508f addql #8,%sp 48d50: 4aae fffc tstl %fp@(-4) 48d54: 6618 bnes 48d6e <_CORE_RWLock_Timeout+0x32> <== ALWAYS TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 48d56: 2f00 movel %d0,%sp@- 48d58: 4eb9 0004 aa18 jsr 4aa18 <_Thread_queue_Process_timeout> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 48d5e: 588f addql #4,%sp 48d60: 2039 0006 1e58 movel 61e58 <_Thread_Dispatch_disable_level>,%d0 48d66: 5380 subql #1,%d0 48d68: 23c0 0006 1e58 movel %d0,61e58 <_Thread_Dispatch_disable_level> _Thread_Unnest_dispatch(); break; } } 48d6e: 4e5e unlk %fp 48d70: 4e75 rts ... 00059834 <_CORE_message_queue_Broadcast>: Objects_Id id __attribute__((unused)), CORE_message_queue_API_mp_support_callout api_message_queue_mp_support __attribute__((unused)), #endif uint32_t *count ) { 59834: 4e56 ffe0 linkw %fp,#-32 59838: 48d7 3c3c moveml %d2-%d5/%a2-%a5,%sp@ 5983c: 266e 0008 moveal %fp@(8),%a3 59840: 282e 000c movel %fp@(12),%d4 59844: 242e 0010 movel %fp@(16),%d2 59848: 2a2e 001c movel %fp@(28),%d5 Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; if ( size > the_message_queue->maximum_message_size ) { 5984c: b4ab 004c cmpl %a3@(76),%d2 59850: 6262 bhis 598b4 <_CORE_message_queue_Broadcast+0x80> <== ALWAYS TAKEN * NOTE: This check is critical because threads can block on * send and receive and this ensures that we are broadcasting * the message to threads waiting to receive -- not to send. */ if ( the_message_queue->number_of_pending_messages != 0 ) { 59852: 4aab 0048 tstl %a3@(72) 59856: 664c bnes 598a4 <_CORE_message_queue_Broadcast+0x70> * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { 59858: 2f0b movel %a3,%sp@- 5985a: 49f9 0005 bf80 lea 5bf80 <_Thread_queue_Dequeue>,%a4 59860: 4283 clrl %d3 const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 59862: 4bf9 0006 30ec lea 630ec ,%a5 59868: 4e94 jsr %a4@ /* * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = 5986a: 588f addql #4,%sp _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { 5986c: 2440 moveal %d0,%a2 /* * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = 5986e: 4a80 tstl %d0 59870: 6722 beqs 59894 <_CORE_message_queue_Broadcast+0x60> 59872: 2f02 movel %d2,%sp@- _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { waitp = &the_thread->Wait; number_broadcasted += 1; 59874: 5283 addql #1,%d3 59876: 2f04 movel %d4,%sp@- 59878: 2f2a 002c movel %a2@(44),%sp@- 5987c: 4e95 jsr %a5@ buffer, waitp->return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; 5987e: 206a 0028 moveal %a2@(40),%a0 59882: 4fef 000c lea %sp@(12),%sp 59886: 2082 movel %d2,%a0@ * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { 59888: 2f0b movel %a3,%sp@- 5988a: 4e94 jsr %a4@ /* * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = 5988c: 588f addql #4,%sp _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { 5988e: 2440 moveal %d0,%a2 /* * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = 59890: 4a80 tstl %d0 59892: 66de bnes 59872 <_CORE_message_queue_Broadcast+0x3e> if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_message_queue_mp_support) ( the_thread, id ); #endif } *count = number_broadcasted; 59894: 2045 moveal %d5,%a0 59896: 4280 clrl %d0 59898: 2083 movel %d3,%a0@ return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; } 5989a: 4cee 3c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a5 598a0: 4e5e unlk %fp 598a2: 4e75 rts * send and receive and this ensures that we are broadcasting * the message to threads waiting to receive -- not to send. */ if ( the_message_queue->number_of_pending_messages != 0 ) { *count = 0; 598a4: 2045 moveal %d5,%a0 598a6: 4280 clrl %d0 #endif } *count = number_broadcasted; return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; } 598a8: 4cee 3c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a5 * send and receive and this ensures that we are broadcasting * the message to threads waiting to receive -- not to send. */ if ( the_message_queue->number_of_pending_messages != 0 ) { *count = 0; 598ae: 4290 clrl %a0@ #endif } *count = number_broadcasted; return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; } 598b0: 4e5e unlk %fp 598b2: 4e75 rts { Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; if ( size > the_message_queue->maximum_message_size ) { 598b4: 7001 moveq #1,%d0 <== NOT EXECUTED #endif } *count = number_broadcasted; return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; } 598b6: 4cee 3c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a5 <== NOT EXECUTED 598bc: 4e5e unlk %fp <== NOT EXECUTED 598be: 4e75 rts 0004ff98 <_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)) { 4ff98: 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 ) { 4ff9a: 4e56 fff4 linkw %fp,#-12 4ff9e: 202e 0014 movel %fp@(20),%d0 4ffa2: 48d7 040c moveml %d2-%d3/%a2,%sp@ 4ffa6: 246e 0008 moveal %fp@(8),%a2 4ffaa: 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)) { 4ffae: c280 andl %d0,%d1 ) { size_t message_buffering_required; size_t allocated_message_size; the_message_queue->maximum_pending_messages = maximum_pending_messages; 4ffb0: 2542 0044 movel %d2,%a2@(68) the_message_queue->number_of_pending_messages = 0; 4ffb4: 42aa 0048 clrl %a2@(72) the_message_queue->maximum_message_size = maximum_message_size; 4ffb8: 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; 4ffbc: 42aa 0060 clrl %a2@(96) the_message_queue->notify_argument = the_argument; 4ffc0: 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)) { 4ffc4: 4a81 tstl %d1 4ffc6: 6620 bnes 4ffe8 <_CORE_message_queue_Initialize+0x50> 4ffc8: 2200 movel %d0,%d1 /* * Calculate how much total memory is required for message buffering and * check for overflow on the multiplication. */ message_buffering_required = (size_t) maximum_pending_messages * (allocated_message_size + sizeof(CORE_message_queue_Buffer_control)); 4ffca: 2601 movel %d1,%d3 4ffcc: 0683 0000 0014 addil #20,%d3 /* * Calculate how much total memory is required for message buffering and * check for overflow on the multiplication. */ message_buffering_required = (size_t) maximum_pending_messages * 4ffd2: 2003 movel %d3,%d0 4ffd4: 4c02 0800 mulsl %d2,%d0 (allocated_message_size + sizeof(CORE_message_queue_Buffer_control)); if (message_buffering_required < allocated_message_size) 4ffd8: b280 cmpl %d0,%d1 4ffda: 631c blss 4fff8 <_CORE_message_queue_Initialize+0x60> <== NEVER TAKEN THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; 4ffdc: 4200 clrb %d0 } 4ffde: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 4ffe4: 4e5e unlk %fp 4ffe6: 4e75 rts * Round size up to multiple of a pointer for chain init and * check for overflow on adding overhead to each message. */ allocated_message_size = maximum_message_size; if (allocated_message_size & (sizeof(uint32_t) - 1)) { allocated_message_size += sizeof(uint32_t); 4ffe8: 2200 movel %d0,%d1 4ffea: 5881 addql #4,%d1 allocated_message_size &= ~(sizeof(uint32_t) - 1); 4ffec: 76fc moveq #-4,%d3 4ffee: c283 andl %d3,%d1 } if (allocated_message_size < maximum_message_size) 4fff0: b280 cmpl %d0,%d1 4fff2: 64d6 bccs 4ffca <_CORE_message_queue_Initialize+0x32> <== NEVER TAKEN THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; 4fff4: 4200 clrb %d0 <== NOT EXECUTED 4fff6: 60e6 bras 4ffde <_CORE_message_queue_Initialize+0x46> <== NOT EXECUTED return false; /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) 4fff8: 2f00 movel %d0,%sp@- 4fffa: 4eb9 0005 2e18 jsr 52e18 <_Workspace_Allocate> _Workspace_Allocate( message_buffering_required ); if (the_message_queue->message_buffers == 0) 50000: 588f addql #4,%sp return false; /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) 50002: 2540 005c movel %d0,%a2@(92) _Workspace_Allocate( message_buffering_required ); if (the_message_queue->message_buffers == 0) 50006: 67d4 beqs 4ffdc <_CORE_message_queue_Initialize+0x44> /* * Initialize the pool of inactive messages, pending messages, * and set of waiting threads. */ _Chain_Initialize ( 50008: 2f03 movel %d3,%sp@- 5000a: 2f02 movel %d2,%sp@- 5000c: 2f00 movel %d0,%sp@- 5000e: 486a 0068 pea %a2@(104) 50012: 4eb9 0005 5474 jsr 55474 <_Chain_Initialize> allocated_message_size + sizeof( CORE_message_queue_Buffer_control ) ); _Chain_Initialize_empty( &the_message_queue->Pending_messages ); _Thread_queue_Initialize( 50018: 4878 0006 pea 6 5001c: 7001 moveq #1,%d0 5001e: 206e 000c moveal %fp@(12),%a0 50022: b090 cmpl %a0@,%d0 50024: 57c0 seq %d0 50026: 4878 0080 pea 80 5002a: 49c0 extbl %d0 5002c: 4480 negl %d0 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 5002e: 41ea 0054 lea %a2@(84),%a0 50032: 2f00 movel %d0,%sp@- 50034: 2548 0050 movel %a0,%a2@(80) the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 50038: 41ea 0050 lea %a2@(80),%a0 5003c: 2548 0058 movel %a0,%a2@(88) 50040: 2f0a movel %a2,%sp@- RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 50042: 42aa 0054 clrl %a2@(84) 50046: 4eb9 0005 21b8 jsr 521b8 <_Thread_queue_Initialize> THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; 5004c: 4fef 0020 lea %sp@(32),%sp } 50050: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 allocated_message_size + sizeof( CORE_message_queue_Buffer_control ) ); _Chain_Initialize_empty( &the_message_queue->Pending_messages ); _Thread_queue_Initialize( 50056: 7001 moveq #1,%d0 STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; } 50058: 4e5e unlk %fp 5005a: 4e75 rts 000554bc <_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 ) { 554bc: 4e56 0000 linkw %fp,#0 554c0: 226e 000c moveal %fp@(12),%a1 554c4: 2f0b movel %a3,%sp@- 554c6: 202e 0010 movel %fp@(16),%d0 554ca: 206e 0008 moveal %fp@(8),%a0 554ce: 2f0a movel %a2,%sp@- 554d0: 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 ) { 554d4: 0c80 7fff ffff cmpil #2147483647,%d0 554da: 6760 beqs 5553c <_CORE_message_queue_Insert_message+0x80> _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 ) { 554dc: 0c80 8000 0000 cmpil #-2147483648,%d0 554e2: 6700 008e beqw 55572 <_CORE_message_queue_Insert_message+0xb6> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 554e6: 2208 movel %a0,%d1 554e8: 0681 0000 0054 addil #84,%d1 Chain_Control *the_header; int the_priority; the_priority = _CORE_message_queue_Get_message_priority(the_message); the_header = &the_message_queue->Pending_messages; the_node = the_header->first; 554ee: 2468 0050 moveal %a0@(80),%a2 while ( !_Chain_Is_tail( the_header, the_node ) ) { 554f2: b28a cmpl %a2,%d1 554f4: 670c beqs 55502 <_CORE_message_queue_Insert_message+0x46> this_message = (CORE_message_queue_Buffer_control *) the_node; this_priority = _CORE_message_queue_Get_message_priority(this_message); if ( this_priority <= the_priority ) { 554f6: b0aa 0008 cmpl %a2@(8),%d0 554fa: 6d06 blts 55502 <_CORE_message_queue_Insert_message+0x46> the_node = the_node->next; 554fc: 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 = the_header->first; while ( !_Chain_Is_tail( the_header, the_node ) ) { 554fe: b28a cmpl %a2,%d1 55500: 66f4 bnes 554f6 <_CORE_message_queue_Insert_message+0x3a> the_node = the_node->next; continue; } break; } _ISR_Disable( level ); 55502: 203c 0000 0700 movel #1792,%d0 55508: 40c1 movew %sr,%d1 5550a: 8081 orl %d1,%d0 5550c: 46c0 movew %d0,%sr SET_NOTIFY(); the_message_queue->number_of_pending_messages++; _Chain_Insert_unprotected( the_node->previous, &the_message->Node ); 5550e: 246a 0004 moveal %a2@(4),%a2 } break; } _ISR_Disable( level ); SET_NOTIFY(); the_message_queue->number_of_pending_messages++; 55512: 52a8 0048 addql #1,%a0@(72) ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 55516: 2652 moveal %a2@,%a3 Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 55518: 234a 0004 movel %a2,%a1@(4) before_node = after_node->next; after_node->next = the_node; 5551c: 2489 movel %a1,%a2@ the_node->next = before_node; before_node->previous = the_node; 5551e: 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; 55522: 228b movel %a3,%a1@ _Chain_Insert_unprotected( the_node->previous, &the_message->Node ); _ISR_Enable( level ); 55524: 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 ) 55526: 2268 0060 moveal %a0@(96),%a1 5552a: 4a89 tstl %a1 5552c: 673c beqs 5556a <_CORE_message_queue_Insert_message+0xae> (*the_message_queue->notify_handler)(the_message_queue->notify_argument); 5552e: 2d68 0064 0008 movel %a0@(100),%fp@(8) #endif } 55534: 245f moveal %sp@+,%a2 55536: 265f moveal %sp@+,%a3 55538: 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); 5553a: 4ed1 jmp %a1@ 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 ); 5553c: 203c 0000 0700 movel #1792,%d0 55542: 40c1 movew %sr,%d1 55544: 8081 orl %d1,%d0 55546: 46c0 movew %d0,%sr Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 55548: 45e8 0054 lea %a0@(84),%a2 SET_NOTIFY(); the_message_queue->number_of_pending_messages++; 5554c: 52a8 0048 addql #1,%a0@(72) 55550: 228a movel %a2,%a1@ old_last_node = the_chain->last; 55552: 2468 0058 moveal %a0@(88),%a2 the_chain->last = the_node; 55556: 2149 0058 movel %a1,%a0@(88) old_last_node->next = the_node; the_node->previous = old_last_node; 5555a: 234a 0004 movel %a2,%a1@(4) Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; the_chain->last = the_node; old_last_node->next = the_node; 5555e: 2489 movel %a1,%a2@ _CORE_message_queue_Append_unprotected(the_message_queue, the_message); _ISR_Enable( level ); 55560: 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 ) 55562: 2268 0060 moveal %a0@(96),%a1 55566: 4a89 tstl %a1 55568: 66c4 bnes 5552e <_CORE_message_queue_Insert_message+0x72> <== ALWAYS TAKEN (*the_message_queue->notify_handler)(the_message_queue->notify_argument); #endif } 5556a: 245f moveal %sp@+,%a2 5556c: 265f moveal %sp@+,%a3 5556e: 4e5e unlk %fp 55570: 4e75 rts 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 ) { _ISR_Disable( level ); 55572: 203c 0000 0700 movel #1792,%d0 55578: 40c1 movew %sr,%d1 5557a: 8081 orl %d1,%d0 5557c: 46c0 movew %d0,%sr */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Head( Chain_Control *the_chain ) { return (Chain_Node *) the_chain; 5557e: 45e8 0050 lea %a0@(80),%a2 SET_NOTIFY(); the_message_queue->number_of_pending_messages++; 55582: 52a8 0048 addql #1,%a0@(72) ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 55586: 2652 moveal %a2@,%a3 Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 55588: 234a 0004 movel %a2,%a1@(4) before_node = after_node->next; after_node->next = the_node; 5558c: 2489 movel %a1,%a2@ the_node->next = before_node; before_node->previous = the_node; 5558e: 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; 55592: 228b movel %a3,%a1@ _CORE_message_queue_Prepend_unprotected(the_message_queue, the_message); _ISR_Enable( level ); 55594: 46c1 movew %d1,%sr 55596: 608e bras 55526 <_CORE_message_queue_Insert_message+0x6a> <== ALWAYS TAKEN 00050194 <_CORE_message_queue_Submit>: #endif CORE_message_queue_Submit_types submit_type, bool wait, Watchdog_Interval timeout ) { 50194: 4e56 ffec linkw %fp,#-20 50198: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 5019c: 246e 0008 moveal %fp@(8),%a2 501a0: 242e 0010 movel %fp@(16),%d2 501a4: 282e 001c movel %fp@(28),%d4 501a8: 162e 0023 moveb %fp@(35),%d3 CORE_message_queue_Buffer_control *the_message; Thread_Control *the_thread; if ( size > the_message_queue->maximum_message_size ) { 501ac: b4aa 004c cmpl %a2@(76),%d2 501b0: 6228 bhis 501da <_CORE_message_queue_Submit+0x46> } /* * Is there a thread currently waiting on this message queue? */ if ( the_message_queue->number_of_pending_messages == 0 ) { 501b2: 202a 0048 movel %a2@(72),%d0 501b6: 672e beqs 501e6 <_CORE_message_queue_Submit+0x52> /* * No one waiting on the message queue at this time, so attempt to * queue the message up for a future receive. */ if ( the_message_queue->number_of_pending_messages < the_message_queue->maximum_pending_messages ) { 501b8: b0aa 0044 cmpl %a2@(68),%d0 501bc: 6500 00ba bcsw 50278 <_CORE_message_queue_Submit+0xe4> /* * No message buffers were available so we may need to return an * overflow error or block the sender until the message is placed * on the queue. */ if ( !wait ) { 501c0: 4a03 tstb %d3 501c2: 6700 00f4 beqw 502b8 <_CORE_message_queue_Submit+0x124> /* * Do NOT block on a send if the caller is in an ISR. It is * deadly to block in an ISR. */ if ( _ISR_Is_in_progress() ) { 501c6: 2039 0006 9b22 movel 69b22 <_ISR_Nest_level>,%d0 501cc: 6754 beqs 50222 <_CORE_message_queue_Submit+0x8e> 501ce: 7003 moveq #3,%d0 _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); } return CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_WAIT; #endif } 501d0: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 501d6: 4e5e unlk %fp 501d8: 4e75 rts ) { CORE_message_queue_Buffer_control *the_message; Thread_Control *the_thread; if ( size > the_message_queue->maximum_message_size ) { 501da: 7001 moveq #1,%d0 _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); } return CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_WAIT; #endif } 501dc: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 501e2: 4e5e unlk %fp 501e4: 4e75 rts /* * Is there a thread currently waiting on this message queue? */ if ( the_message_queue->number_of_pending_messages == 0 ) { the_thread = _Thread_queue_Dequeue( &the_message_queue->Wait_queue ); 501e6: 2f0a movel %a2,%sp@- 501e8: 4eb9 0005 1ddc jsr 51ddc <_Thread_queue_Dequeue> if ( the_thread ) { 501ee: 588f addql #4,%sp /* * Is there a thread currently waiting on this message queue? */ if ( the_message_queue->number_of_pending_messages == 0 ) { the_thread = _Thread_queue_Dequeue( &the_message_queue->Wait_queue ); 501f0: 2640 moveal %d0,%a3 if ( the_thread ) { 501f2: 4a80 tstl %d0 501f4: 6700 00ce beqw 502c4 <_CORE_message_queue_Submit+0x130> const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 501f8: 2f02 movel %d2,%sp@- 501fa: 2f2e 000c movel %fp@(12),%sp@- 501fe: 2f2b 002c movel %a3@(44),%sp@- 50202: 4eb9 0005 8ce0 jsr 58ce0 _CORE_message_queue_Copy_buffer( buffer, the_thread->Wait.return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; 50208: 206b 0028 moveal %a3@(40),%a0 #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_message_queue_mp_support) ( the_thread, id ); #endif return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; 5020c: 4fef 000c lea %sp@(12),%sp buffer, the_thread->Wait.return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; the_thread->Wait.count = (uint32_t) submit_type; 50210: 4280 clrl %d0 _CORE_message_queue_Copy_buffer( buffer, the_thread->Wait.return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; 50212: 2082 movel %d2,%a0@ the_thread->Wait.count = (uint32_t) submit_type; 50214: 2744 0024 movel %d4,%a3@(36) _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); } return CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_WAIT; #endif } 50218: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 5021e: 4e5e unlk %fp 50220: 4e75 rts * Thus the unusual choice to open a new scope and declare * it as a variable. Doing this emphasizes how dangerous it * would be to use this variable prior to here. */ { Thread_Control *executing = _Thread_Executing; 50222: 2079 0006 9b42 moveal 69b42 <_Thread_Executing>,%a0 ISR_Level level; _ISR_Disable( level ); 50228: 203c 0000 0700 movel #1792,%d0 5022e: 40c1 movew %sr,%d1 50230: 8081 orl %d1,%d0 50232: 46c0 movew %d0,%sr 50234: 7001 moveq #1,%d0 _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue ); executing->Wait.queue = &the_message_queue->Wait_queue; executing->Wait.id = id; 50236: 216e 0014 0020 movel %fp@(20),%a0@(32) 5023c: 2540 0030 movel %d0,%a2@(48) executing->Wait.return_argument_second.immutable_object = buffer; 50240: 202e 000c movel %fp@(12),%d0 executing->Wait.option = (uint32_t) size; executing->Wait.count = submit_type; 50244: 2144 0024 movel %d4,%a0@(36) _ISR_Disable( level ); _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue ); executing->Wait.queue = &the_message_queue->Wait_queue; executing->Wait.id = id; executing->Wait.return_argument_second.immutable_object = buffer; 50248: 2140 002c movel %d0,%a0@(44) executing->Wait.option = (uint32_t) size; 5024c: 2142 0030 movel %d2,%a0@(48) Thread_Control *executing = _Thread_Executing; ISR_Level level; _ISR_Disable( level ); _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue ); executing->Wait.queue = &the_message_queue->Wait_queue; 50250: 214a 0044 movel %a2,%a0@(68) executing->Wait.id = id; executing->Wait.return_argument_second.immutable_object = buffer; executing->Wait.option = (uint32_t) size; executing->Wait.count = submit_type; _ISR_Enable( level ); 50254: 46c1 movew %d1,%sr _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); 50256: 4879 0005 229c pea 5229c <_Thread_queue_Timeout> 5025c: 2f2e 0024 movel %fp@(36),%sp@- 50260: 2f0a movel %a2,%sp@- 50262: 4eb9 0005 1f3c jsr 51f3c <_Thread_queue_Enqueue_with_handler> } return CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_WAIT; 50268: 4fef 000c lea %sp@(12),%sp executing->Wait.return_argument_second.immutable_object = buffer; executing->Wait.option = (uint32_t) size; executing->Wait.count = submit_type; _ISR_Enable( level ); _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); 5026c: 7007 moveq #7,%d0 } return CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_WAIT; #endif } 5026e: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 50274: 4e5e unlk %fp 50276: 4e75 rts RTEMS_INLINE_ROUTINE CORE_message_queue_Buffer_control * _CORE_message_queue_Allocate_message_buffer ( CORE_message_queue_Control *the_message_queue ) { return (CORE_message_queue_Buffer_control *) 50278: 486a 0068 pea %a2@(104) 5027c: 4eb9 0004 ff2c jsr 4ff2c <_Chain_Get> 50282: 2640 moveal %d0,%a3 const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 50284: 2f02 movel %d2,%sp@- 50286: 2f2e 000c movel %fp@(12),%sp@- 5028a: 486b 0010 pea %a3@(16) 5028e: 4eb9 0005 8ce0 jsr 58ce0 _CORE_message_queue_Copy_buffer( buffer, the_message->Contents.buffer, size ); the_message->Contents.size = size; 50294: 2742 000c movel %d2,%a3@(12) CORE_message_queue_Buffer_control *the_message, int priority ) { #if defined(RTEMS_SCORE_COREMSG_ENABLE_MESSAGE_PRIORITY) the_message->priority = priority; 50298: 2744 0008 movel %d4,%a3@(8) _CORE_message_queue_Set_message_priority( the_message, submit_type ); _CORE_message_queue_Insert_message( 5029c: 2f04 movel %d4,%sp@- 5029e: 2f0b movel %a3,%sp@- 502a0: 2f0a movel %a2,%sp@- 502a2: 4eb9 0005 54bc jsr 554bc <_CORE_message_queue_Insert_message> the_message_queue, the_message, submit_type ); return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; 502a8: 4fef 001c lea %sp@(28),%sp size ); the_message->Contents.size = size; _CORE_message_queue_Set_message_priority( the_message, submit_type ); _CORE_message_queue_Insert_message( 502ac: 4280 clrl %d0 _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); } return CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_WAIT; #endif } 502ae: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 502b4: 4e5e unlk %fp 502b6: 4e75 rts /* * No message buffers were available so we may need to return an * overflow error or block the sender until the message is placed * on the queue. */ if ( !wait ) { 502b8: 7002 moveq #2,%d0 _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); } return CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_WAIT; #endif } 502ba: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 502c0: 4e5e unlk %fp 502c2: 4e75 rts /* * Is there a thread currently waiting on this message queue? */ if ( the_message_queue->number_of_pending_messages == 0 ) { the_thread = _Thread_queue_Dequeue( &the_message_queue->Wait_queue ); if ( the_thread ) { 502c4: 202a 0048 movel %a2@(72),%d0 /* * No one waiting on the message queue at this time, so attempt to * queue the message up for a future receive. */ if ( the_message_queue->number_of_pending_messages < the_message_queue->maximum_pending_messages ) { 502c8: b0aa 0044 cmpl %a2@(68),%d0 502cc: 6400 fef2 bccw 501c0 <_CORE_message_queue_Submit+0x2c> <== ALWAYS TAKEN 502d0: 60a6 bras 50278 <_CORE_message_queue_Submit+0xe4> <== ALWAYS TAKEN ... 000467e8 <_CORE_mutex_Initialize>: CORE_mutex_Status _CORE_mutex_Initialize( CORE_mutex_Control *the_mutex, CORE_mutex_Attributes *the_mutex_attributes, uint32_t initial_lock ) { 467e8: 4e56 0000 linkw %fp,#0 467ec: 206e 0008 moveal %fp@(8),%a0 467f0: 2f0a movel %a2,%sp@- 467f2: 246e 000c moveal %fp@(12),%a2 /* Add this to the RTEMS environment later ????????? rtems_assert( initial_lock == CORE_MUTEX_LOCKED || initial_lock == CORE_MUTEX_UNLOCKED ); */ the_mutex->Attributes = *the_mutex_attributes; 467f6: 224a moveal %a2,%a1 467f8: 2159 0040 movel %a1@+,%a0@(64) 467fc: 2159 0044 movel %a1@+,%a0@(68) 46800: 2159 0048 movel %a1@+,%a0@(72) CORE_mutex_Status _CORE_mutex_Initialize( CORE_mutex_Control *the_mutex, CORE_mutex_Attributes *the_mutex_attributes, uint32_t initial_lock ) { 46804: 202e 0010 movel %fp@(16),%d0 /* Add this to the RTEMS environment later ????????? rtems_assert( initial_lock == CORE_MUTEX_LOCKED || initial_lock == CORE_MUTEX_UNLOCKED ); */ the_mutex->Attributes = *the_mutex_attributes; 46808: 3151 004c movew %a1@,%a0@(76) the_mutex->lock = initial_lock; 4680c: 2140 004e movel %d0,%a0@(78) the_mutex->blocked_count = 0; 46810: 42a8 0056 clrl %a0@(86) if ( initial_lock == CORE_MUTEX_LOCKED ) { 46814: 4a80 tstl %d0 46816: 6654 bnes 4686c <_CORE_mutex_Initialize+0x84> the_mutex->nest_count = 1; the_mutex->holder = _Thread_Executing; 46818: 2279 0005 f20e moveal 5f20e <_Thread_Executing>,%a1 the_mutex->Attributes = *the_mutex_attributes; the_mutex->lock = initial_lock; the_mutex->blocked_count = 0; if ( initial_lock == CORE_MUTEX_LOCKED ) { the_mutex->nest_count = 1; 4681e: 103c 0001 moveb #1,%d0 the_mutex->holder = _Thread_Executing; the_mutex->holder_id = _Thread_Executing->Object.id; if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || 46822: 7202 moveq #2,%d1 the_mutex->Attributes = *the_mutex_attributes; the_mutex->lock = initial_lock; the_mutex->blocked_count = 0; if ( initial_lock == CORE_MUTEX_LOCKED ) { the_mutex->nest_count = 1; 46824: 2140 0052 movel %d0,%a0@(82) the_mutex->holder = _Thread_Executing; the_mutex->holder_id = _Thread_Executing->Object.id; 46828: 2169 0008 005e movel %a1@(8),%a0@(94) */ RTEMS_INLINE_ROUTINE bool _CORE_mutex_Is_inherit_priority( CORE_mutex_Attributes *the_attribute ) { return the_attribute->discipline == CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT; 4682e: 2028 0046 movel %a0@(70),%d0 the_mutex->lock = initial_lock; the_mutex->blocked_count = 0; if ( initial_lock == CORE_MUTEX_LOCKED ) { the_mutex->nest_count = 1; the_mutex->holder = _Thread_Executing; 46832: 2149 005a movel %a1,%a0@(90) the_mutex->holder_id = _Thread_Executing->Object.id; if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || 46836: b280 cmpl %d0,%d1 46838: 6762 beqs 4689c <_CORE_mutex_Initialize+0xb4> 4683a: 123c 0003 moveb #3,%d1 4683e: b280 cmpl %d0,%d1 46840: 675a beqs 4689c <_CORE_mutex_Initialize+0xb4> the_mutex->nest_count = 0; the_mutex->holder = NULL; the_mutex->holder_id = 0; } _Thread_queue_Initialize( 46842: 4aaa 0006 tstl %a2@(6) 46846: 56c0 sne %d0 46848: 4878 0005 pea 5 4684c: 49c0 extbl %d0 4684e: 4878 0400 pea 400 46852: 4480 negl %d0 46854: 2f00 movel %d0,%sp@- 46856: 2f08 movel %a0,%sp@- 46858: 4eb9 0004 8590 jsr 48590 <_Thread_queue_Initialize> THREAD_QUEUE_DISCIPLINE_FIFO : THREAD_QUEUE_DISCIPLINE_PRIORITY, STATES_WAITING_FOR_MUTEX, CORE_MUTEX_TIMEOUT ); return CORE_MUTEX_STATUS_SUCCESSFUL; 4685e: 4fef 0010 lea %sp@(16),%sp the_mutex->nest_count = 0; the_mutex->holder = NULL; the_mutex->holder_id = 0; } _Thread_queue_Initialize( 46862: 4280 clrl %d0 STATES_WAITING_FOR_MUTEX, CORE_MUTEX_TIMEOUT ); return CORE_MUTEX_STATUS_SUCCESSFUL; } 46864: 246e fffc moveal %fp@(-4),%a2 46868: 4e5e unlk %fp 4686a: 4e75 rts the_mutex->nest_count = 0; the_mutex->holder = NULL; the_mutex->holder_id = 0; } _Thread_queue_Initialize( 4686c: 4aaa 0006 tstl %a2@(6) 46870: 56c0 sne %d0 #endif _Thread_Executing->resource_count++; } } else { the_mutex->nest_count = 0; 46872: 42a8 0052 clrl %a0@(82) the_mutex->holder = NULL; the_mutex->holder_id = 0; } _Thread_queue_Initialize( 46876: 49c0 extbl %d0 46878: 4480 negl %d0 _Thread_Executing->resource_count++; } } else { the_mutex->nest_count = 0; the_mutex->holder = NULL; 4687a: 42a8 005a clrl %a0@(90) the_mutex->holder_id = 0; 4687e: 42a8 005e clrl %a0@(94) } _Thread_queue_Initialize( 46882: 4878 0005 pea 5 46886: 4878 0400 pea 400 4688a: 2f00 movel %d0,%sp@- 4688c: 2f08 movel %a0,%sp@- 4688e: 4eb9 0004 8590 jsr 48590 <_Thread_queue_Initialize> THREAD_QUEUE_DISCIPLINE_FIFO : THREAD_QUEUE_DISCIPLINE_PRIORITY, STATES_WAITING_FOR_MUTEX, CORE_MUTEX_TIMEOUT ); return CORE_MUTEX_STATUS_SUCCESSFUL; 46894: 4fef 0010 lea %sp@(16),%sp the_mutex->nest_count = 0; the_mutex->holder = NULL; the_mutex->holder_id = 0; } _Thread_queue_Initialize( 46898: 4280 clrl %d0 4689a: 60c8 bras 46864 <_CORE_mutex_Initialize+0x7c> <== ALWAYS TAKEN the_mutex->holder_id = _Thread_Executing->Object.id; if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || _CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) { if ( _Thread_Executing->current_priority < the_mutex->Attributes.priority_ceiling ) 4689c: 2028 004a movel %a0@(74),%d0 468a0: b0a9 0014 cmpl %a1@(20),%d0 468a4: 6228 bhis 468ce <_CORE_mutex_Initialize+0xe6> _Chain_Prepend_unprotected( &_Thread_Executing->lock_mutex, &the_mutex->queue.lock_queue ); the_mutex->queue.priority_before = _Thread_Executing->current_priority; #endif _Thread_Executing->resource_count++; 468a6: 52a9 001c addql #1,%a1@(28) the_mutex->nest_count = 0; the_mutex->holder = NULL; the_mutex->holder_id = 0; } _Thread_queue_Initialize( 468aa: 4aaa 0006 tstl %a2@(6) 468ae: 56c0 sne %d0 468b0: 4878 0005 pea 5 468b4: 49c0 extbl %d0 468b6: 4878 0400 pea 400 468ba: 4480 negl %d0 468bc: 2f00 movel %d0,%sp@- 468be: 2f08 movel %a0,%sp@- 468c0: 4eb9 0004 8590 jsr 48590 <_Thread_queue_Initialize> THREAD_QUEUE_DISCIPLINE_FIFO : THREAD_QUEUE_DISCIPLINE_PRIORITY, STATES_WAITING_FOR_MUTEX, CORE_MUTEX_TIMEOUT ); return CORE_MUTEX_STATUS_SUCCESSFUL; 468c6: 4fef 0010 lea %sp@(16),%sp the_mutex->nest_count = 0; the_mutex->holder = NULL; the_mutex->holder_id = 0; } _Thread_queue_Initialize( 468ca: 4280 clrl %d0 468cc: 6096 bras 46864 <_CORE_mutex_Initialize+0x7c> <== ALWAYS TAKEN STATES_WAITING_FOR_MUTEX, CORE_MUTEX_TIMEOUT ); return CORE_MUTEX_STATUS_SUCCESSFUL; } 468ce: 246e fffc moveal %fp@(-4),%a2 the_mutex->holder_id = _Thread_Executing->Object.id; if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || _CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) { if ( _Thread_Executing->current_priority < the_mutex->Attributes.priority_ceiling ) 468d2: 7006 moveq #6,%d0 STATES_WAITING_FOR_MUTEX, CORE_MUTEX_TIMEOUT ); return CORE_MUTEX_STATUS_SUCCESSFUL; } 468d4: 4e5e unlk %fp 468d6: 4e75 rts 00046964 <_CORE_mutex_Seize>: Objects_Id _id, bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { 46964: 4e56 0000 linkw %fp,#0 46968: 202e 0010 movel %fp@(16),%d0 4696c: 2f0a movel %a2,%sp@- 4696e: 246e 0008 moveal %fp@(8),%a2 46972: 2f02 movel %d2,%sp@- _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); 46974: 2239 0005 f154 movel 5f154 <_Thread_Dispatch_disable_level>,%d1 Objects_Id _id, bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { 4697a: 1400 moveb %d0,%d2 _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); 4697c: 4a81 tstl %d1 4697e: 6704 beqs 46984 <_CORE_mutex_Seize+0x20> 46980: 4a00 tstb %d0 46982: 6634 bnes 469b8 <_CORE_mutex_Seize+0x54> <== NEVER TAKEN 46984: 486e 0018 pea %fp@(24) 46988: 2f0a movel %a2,%sp@- 4698a: 4eb9 0004 bb2c jsr 4bb2c <_CORE_mutex_Seize_interrupt_trylock> 46990: 508f addql #8,%sp 46992: 4a80 tstl %d0 46994: 6716 beqs 469ac <_CORE_mutex_Seize+0x48> 46996: 4a02 tstb %d2 46998: 6636 bnes 469d0 <_CORE_mutex_Seize+0x6c> 4699a: 202e 0018 movel %fp@(24),%d0 4699e: 46c0 movew %d0,%sr 469a0: 2079 0005 f20e moveal 5f20e <_Thread_Executing>,%a0 469a6: 7001 moveq #1,%d0 469a8: 2140 0034 movel %d0,%a0@(52) } 469ac: 242e fff8 movel %fp@(-8),%d2 469b0: 246e fffc moveal %fp@(-4),%a2 469b4: 4e5e unlk %fp 469b6: 4e75 rts bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); 469b8: 7001 moveq #1,%d0 469ba: b0b9 0005 f2dc cmpl 5f2dc <_System_state_Current>,%d0 469c0: 64c2 bccs 46984 <_CORE_mutex_Seize+0x20> 469c2: 4878 0013 pea 13 469c6: 42a7 clrl %sp@- 469c8: 42a7 clrl %sp@- 469ca: 4eb9 0004 6fd8 jsr 46fd8 <_Internal_error_Occurred> 469d0: 2039 0005 f154 movel 5f154 <_Thread_Dispatch_disable_level>,%d0 469d6: 5280 addql #1,%d0 469d8: 2079 0005 f20e moveal 5f20e <_Thread_Executing>,%a0 469de: 216e 000c 0020 movel %fp@(12),%a0@(32) 469e4: 23c0 0005 f154 movel %d0,5f154 <_Thread_Dispatch_disable_level> RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section ( Thread_queue_Control *the_thread_queue ) { the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 469ea: 7001 moveq #1,%d0 469ec: 214a 0044 movel %a2,%a0@(68) 469f0: 2540 0030 movel %d0,%a2@(48) 469f4: 202e 0018 movel %fp@(24),%d0 469f8: 46c0 movew %d0,%sr 469fa: 2f2e 0014 movel %fp@(20),%sp@- 469fe: 2f0a movel %a2,%sp@- 46a00: 4eb9 0004 68d8 jsr 468d8 <_CORE_mutex_Seize_interrupt_blocking> } 46a06: 242e fff8 movel %fp@(-8),%d2 bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); 46a0a: 508f addql #8,%sp } 46a0c: 246e fffc moveal %fp@(-4),%a2 46a10: 4e5e unlk %fp 46a12: 4e75 rts 0004bb2c <_CORE_mutex_Seize_interrupt_trylock>: #if defined(__RTEMS_DO_NOT_INLINE_CORE_MUTEX_SEIZE__) int _CORE_mutex_Seize_interrupt_trylock( CORE_mutex_Control *the_mutex, ISR_Level *level_p ) { 4bb2c: 4e56 0000 linkw %fp,#0 { Thread_Control *executing; /* disabled when you get here */ executing = _Thread_Executing; 4bb30: 2279 0005 f20e moveal 5f20e <_Thread_Executing>,%a1 4bb36: 2f0a movel %a2,%sp@- 4bb38: 206e 0008 moveal %fp@(8),%a0 4bb3c: 246e 000c moveal %fp@(12),%a2 4bb40: 2f02 movel %d2,%sp@- executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; 4bb42: 42a9 0034 clrl %a1@(52) if ( !_CORE_mutex_Is_locked( the_mutex ) ) { 4bb46: 4aa8 004e tstl %a0@(78) 4bb4a: 673a beqs 4bb86 <_CORE_mutex_Seize_interrupt_trylock+0x5a> the_mutex->lock = CORE_MUTEX_LOCKED; 4bb4c: 42a8 004e clrl %a0@(78) the_mutex->holder = executing; the_mutex->holder_id = executing->Object.id; the_mutex->nest_count = 1; 4bb50: 7201 moveq #1,%d1 executing = _Thread_Executing; executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; if ( !_CORE_mutex_Is_locked( the_mutex ) ) { the_mutex->lock = CORE_MUTEX_LOCKED; the_mutex->holder = executing; the_mutex->holder_id = executing->Object.id; 4bb52: 2169 0008 005e movel %a1@(8),%a0@(94) */ RTEMS_INLINE_ROUTINE bool _CORE_mutex_Is_inherit_priority( CORE_mutex_Attributes *the_attribute ) { return the_attribute->discipline == CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT; 4bb58: 2028 0046 movel %a0@(70),%d0 executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; if ( !_CORE_mutex_Is_locked( the_mutex ) ) { the_mutex->lock = CORE_MUTEX_LOCKED; the_mutex->holder = executing; the_mutex->holder_id = executing->Object.id; the_mutex->nest_count = 1; 4bb5c: 2141 0052 movel %d1,%a0@(82) if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || 4bb60: 123c 0002 moveb #2,%d1 executing = _Thread_Executing; executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; if ( !_CORE_mutex_Is_locked( the_mutex ) ) { the_mutex->lock = CORE_MUTEX_LOCKED; the_mutex->holder = executing; 4bb64: 2149 005a movel %a1,%a0@(90) the_mutex->holder_id = executing->Object.id; the_mutex->nest_count = 1; if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || 4bb68: b280 cmpl %d0,%d1 4bb6a: 672e beqs 4bb9a <_CORE_mutex_Seize_interrupt_trylock+0x6e> 4bb6c: 123c 0003 moveb #3,%d1 4bb70: b280 cmpl %d0,%d1 4bb72: 674e beqs 4bbc2 <_CORE_mutex_Seize_interrupt_trylock+0x96> executing->resource_count++; } if ( !_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) { _ISR_Enable( *level_p ); 4bb74: 2012 movel %a2@,%d0 4bb76: 46c0 movew %d0,%sr 4bb78: 4280 clrl %d0 return _CORE_mutex_Seize_interrupt_trylock_body( the_mutex, level_p ); } 4bb7a: 242e fff8 movel %fp@(-8),%d2 4bb7e: 246e fffc moveal %fp@(-4),%a2 4bb82: 4e5e unlk %fp 4bb84: 4e75 rts /* * At this point, we know the mutex was not available. If this thread * is the thread that has locked the mutex, let's see if we are allowed * to nest access. */ if ( _Thread_Is_executing( the_mutex->holder ) ) { 4bb86: b3e8 005a cmpal %a0@(90),%a1 4bb8a: 671a beqs 4bba6 <_CORE_mutex_Seize_interrupt_trylock+0x7a> 4bb8c: 242e fff8 movel %fp@(-8),%d2 the_mutex->nest_count++; _ISR_Enable( *level_p ); return 0; case CORE_MUTEX_NESTING_IS_ERROR: executing->Wait.return_code = CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED; _ISR_Enable( *level_p ); 4bb90: 7001 moveq #1,%d0 4bb92: 246e fffc moveal %fp@(-4),%a2 4bb96: 4e5e unlk %fp 4bb98: 4e75 rts _Chain_Prepend_unprotected( &executing->lock_mutex, &the_mutex->queue.lock_queue ); the_mutex->queue.priority_before = executing->current_priority; #endif executing->resource_count++; 4bb9a: 52a9 001c addql #1,%a1@(28) } if ( !_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) { _ISR_Enable( *level_p ); 4bb9e: 2012 movel %a2@,%d0 4bba0: 46c0 movew %d0,%sr 4bba2: 4280 clrl %d0 4bba4: 60d4 bras 4bb7a <_CORE_mutex_Seize_interrupt_trylock+0x4e> <== ALWAYS TAKEN * At this point, we know the mutex was not available. If this thread * is the thread that has locked the mutex, let's see if we are allowed * to nest access. */ if ( _Thread_Is_executing( the_mutex->holder ) ) { switch ( the_mutex->Attributes.lock_nesting_behavior ) { 4bba6: 2028 0040 movel %a0@(64),%d0 4bbaa: 6658 bnes 4bc04 <_CORE_mutex_Seize_interrupt_trylock+0xd8> case CORE_MUTEX_NESTING_ACQUIRES: the_mutex->nest_count++; 4bbac: 52a8 0052 addql #1,%a0@(82) _ISR_Enable( *level_p ); 4bbb0: 2012 movel %a2@,%d0 4bbb2: 46c0 movew %d0,%sr 4bbb4: 242e fff8 movel %fp@(-8),%d2 4bbb8: 4280 clrl %d0 4bbba: 246e fffc moveal %fp@(-4),%a2 4bbbe: 4e5e unlk %fp 4bbc0: 4e75 rts _Chain_Prepend_unprotected( &executing->lock_mutex, &the_mutex->queue.lock_queue ); the_mutex->queue.priority_before = executing->current_priority; #endif executing->resource_count++; 4bbc2: 2429 001c movel %a1@(28),%d2 4bbc6: 2002 movel %d2,%d0 4bbc8: 5280 addql #1,%d0 4bbca: 2340 001c movel %d0,%a1@(28) { Priority_Control ceiling; Priority_Control current; ceiling = the_mutex->Attributes.priority_ceiling; current = executing->current_priority; 4bbce: 2029 0014 movel %a1@(20),%d0 */ { Priority_Control ceiling; Priority_Control current; ceiling = the_mutex->Attributes.priority_ceiling; 4bbd2: 2228 004a movel %a0@(74),%d1 current = executing->current_priority; if ( current == ceiling ) { 4bbd6: b081 cmpl %d1,%d0 4bbd8: 6700 0082 beqw 4bc5c <_CORE_mutex_Seize_interrupt_trylock+0x130> _ISR_Enable( *level_p ); return 0; } if ( current > ceiling ) { 4bbdc: 6244 bhis 4bc22 <_CORE_mutex_Seize_interrupt_trylock+0xf6> ); _Thread_Enable_dispatch(); return 0; } /* if ( current < ceiling ) */ { executing->Wait.return_code = CORE_MUTEX_STATUS_CEILING_VIOLATED; 4bbde: 7206 moveq #6,%d1 the_mutex->lock = CORE_MUTEX_UNLOCKED; 4bbe0: 7001 moveq #1,%d0 ); _Thread_Enable_dispatch(); return 0; } /* if ( current < ceiling ) */ { executing->Wait.return_code = CORE_MUTEX_STATUS_CEILING_VIOLATED; 4bbe2: 2341 0034 movel %d1,%a1@(52) the_mutex->lock = CORE_MUTEX_UNLOCKED; the_mutex->nest_count = 0; /* undo locking above */ 4bbe6: 42a8 0052 clrl %a0@(82) _Thread_Enable_dispatch(); return 0; } /* if ( current < ceiling ) */ { executing->Wait.return_code = CORE_MUTEX_STATUS_CEILING_VIOLATED; the_mutex->lock = CORE_MUTEX_UNLOCKED; 4bbea: 2140 004e movel %d0,%a0@(78) the_mutex->nest_count = 0; /* undo locking above */ executing->resource_count--; /* undo locking above */ 4bbee: 2342 001c movel %d2,%a1@(28) _ISR_Enable( *level_p ); 4bbf2: 2012 movel %a2@,%d0 4bbf4: 46c0 movew %d0,%sr 4bbf6: 242e fff8 movel %fp@(-8),%d2 4bbfa: 4280 clrl %d0 4bbfc: 246e fffc moveal %fp@(-4),%a2 4bc00: 4e5e unlk %fp 4bc02: 4e75 rts * At this point, we know the mutex was not available. If this thread * is the thread that has locked the mutex, let's see if we are allowed * to nest access. */ if ( _Thread_Is_executing( the_mutex->holder ) ) { switch ( the_mutex->Attributes.lock_nesting_behavior ) { 4bc04: 7201 moveq #1,%d1 4bc06: b280 cmpl %d0,%d1 4bc08: 6682 bnes 4bb8c <_CORE_mutex_Seize_interrupt_trylock+0x60> case CORE_MUTEX_NESTING_ACQUIRES: the_mutex->nest_count++; _ISR_Enable( *level_p ); return 0; case CORE_MUTEX_NESTING_IS_ERROR: executing->Wait.return_code = CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED; 4bc0a: 7002 moveq #2,%d0 4bc0c: 2340 0034 movel %d0,%a1@(52) _ISR_Enable( *level_p ); 4bc10: 2012 movel %a2@,%d0 4bc12: 46c0 movew %d0,%sr 4bc14: 242e fff8 movel %fp@(-8),%d2 4bc18: 4280 clrl %d0 4bc1a: 246e fffc moveal %fp@(-4),%a2 4bc1e: 4e5e unlk %fp 4bc20: 4e75 rts rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 4bc22: 2039 0005 f154 movel 5f154 <_Thread_Dispatch_disable_level>,%d0 4bc28: 5280 addql #1,%d0 4bc2a: 23c0 0005 f154 movel %d0,5f154 <_Thread_Dispatch_disable_level> return 0; } if ( current > ceiling ) { _Thread_Disable_dispatch(); _ISR_Enable( *level_p ); 4bc30: 2012 movel %a2@,%d0 4bc32: 46c0 movew %d0,%sr _Thread_Change_priority( 4bc34: 42a7 clrl %sp@- 4bc36: 2f28 004a movel %a0@(74),%sp@- 4bc3a: 2f28 005a movel %a0@(90),%sp@- 4bc3e: 4eb9 0004 78a8 jsr 478a8 <_Thread_Change_priority> the_mutex->holder, the_mutex->Attributes.priority_ceiling, false ); _Thread_Enable_dispatch(); 4bc44: 4eb9 0004 7dc8 jsr 47dc8 <_Thread_Enable_dispatch> 4bc4a: 242e fff8 movel %fp@(-8),%d2 4bc4e: 4fef 000c lea %sp@(12),%sp 4bc52: 4280 clrl %d0 4bc54: 246e fffc moveal %fp@(-4),%a2 4bc58: 4e5e unlk %fp 4bc5a: 4e75 rts Priority_Control current; ceiling = the_mutex->Attributes.priority_ceiling; current = executing->current_priority; if ( current == ceiling ) { _ISR_Enable( *level_p ); 4bc5c: 2012 movel %a2@,%d0 4bc5e: 46c0 movew %d0,%sr 4bc60: 242e fff8 movel %fp@(-8),%d2 4bc64: 4280 clrl %d0 4bc66: 246e fffc moveal %fp@(-4),%a2 4bc6a: 4e5e unlk %fp 4bc6c: 4e75 rts ... 00046a14 <_CORE_mutex_Surrender>: #else Objects_Id id __attribute__((unused)), CORE_mutex_API_mp_support_callout api_mutex_mp_support __attribute__((unused)) #endif ) { 46a14: 4e56 0000 linkw %fp,#0 46a18: 2f0a movel %a2,%sp@- 46a1a: 246e 0008 moveal %fp@(8),%a2 Thread_Control *the_thread; Thread_Control *holder; #ifdef __RTEMS_STRICT_ORDER_MUTEX__ Chain_Node *first_node; #endif holder = the_mutex->holder; 46a1e: 206a 005a moveal %a2@(90),%a0 * allowed when the mutex in quetion is FIFO or simple Priority * discipline. But Priority Ceiling or Priority Inheritance mutexes * must be released by the thread which acquired them. */ if ( the_mutex->Attributes.only_owner_release ) { 46a22: 4a2a 0044 tstb %a2@(68) 46a26: 6712 beqs 46a3a <_CORE_mutex_Surrender+0x26> if ( !_Thread_Is_executing( holder ) ) 46a28: b1f9 0005 f20e cmpal 5f20e <_Thread_Executing>,%a0 46a2e: 670a beqs 46a3a <_CORE_mutex_Surrender+0x26> } } else the_mutex->lock = CORE_MUTEX_UNLOCKED; return CORE_MUTEX_STATUS_SUCCESSFUL; } 46a30: 246e fffc moveal %fp@(-4),%a2 * discipline. But Priority Ceiling or Priority Inheritance mutexes * must be released by the thread which acquired them. */ if ( the_mutex->Attributes.only_owner_release ) { if ( !_Thread_Is_executing( holder ) ) 46a34: 7003 moveq #3,%d0 } } else the_mutex->lock = CORE_MUTEX_UNLOCKED; return CORE_MUTEX_STATUS_SUCCESSFUL; } 46a36: 4e5e unlk %fp 46a38: 4e75 rts return CORE_MUTEX_STATUS_NOT_OWNER_OF_RESOURCE; } /* XXX already unlocked -- not right status */ if ( !the_mutex->nest_count ) 46a3a: 202a 0052 movel %a2@(82),%d0 46a3e: 6768 beqs 46aa8 <_CORE_mutex_Surrender+0x94> return CORE_MUTEX_STATUS_SUCCESSFUL; the_mutex->nest_count--; 46a40: 5380 subql #1,%d0 46a42: 2540 0052 movel %d0,%a2@(82) if ( the_mutex->nest_count != 0 ) { 46a46: 6660 bnes 46aa8 <_CORE_mutex_Surrender+0x94> 46a48: 202a 0046 movel %a2@(70),%d0 /* * Formally release the mutex before possibly transferring it to a * blocked thread. */ if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || 46a4c: 7202 moveq #2,%d1 46a4e: b280 cmpl %d0,%d1 46a50: 6700 0084 beqw 46ad6 <_CORE_mutex_Surrender+0xc2> 46a54: 123c 0003 moveb #3,%d1 46a58: b280 cmpl %d0,%d1 46a5a: 677a beqs 46ad6 <_CORE_mutex_Surrender+0xc2> } first_node = _Chain_Get_first_unprotected(&holder->lock_mutex); #endif holder->resource_count--; } the_mutex->holder = NULL; 46a5c: 42aa 005a clrl %a2@(90) /* * Whether or not someone is waiting for the mutex, an * inherited priority must be lowered if this is the last * mutex (i.e. resource) this task has. */ if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || 46a60: 7202 moveq #2,%d1 first_node = _Chain_Get_first_unprotected(&holder->lock_mutex); #endif holder->resource_count--; } the_mutex->holder = NULL; the_mutex->holder_id = 0; 46a62: 42aa 005e clrl %a2@(94) /* * Whether or not someone is waiting for the mutex, an * inherited priority must be lowered if this is the last * mutex (i.e. resource) this task has. */ if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || 46a66: b280 cmpl %d0,%d1 46a68: 6748 beqs 46ab2 <_CORE_mutex_Surrender+0x9e> 46a6a: 123c 0003 moveb #3,%d1 46a6e: b280 cmpl %d0,%d1 46a70: 6740 beqs 46ab2 <_CORE_mutex_Surrender+0x9e> /* * Now we check if another thread was waiting for this mutex. If so, * transfer the mutex to that thread. */ if ( ( the_thread = _Thread_queue_Dequeue( &the_mutex->Wait_queue ) ) ) { 46a72: 2f0a movel %a2,%sp@- 46a74: 4eb9 0004 81b4 jsr 481b4 <_Thread_queue_Dequeue> 46a7a: 588f addql #4,%sp 46a7c: 2040 moveal %d0,%a0 46a7e: 4a80 tstl %d0 46a80: 6700 0090 beqw 46b12 <_CORE_mutex_Surrender+0xfe> #endif { the_mutex->holder = the_thread; the_mutex->holder_id = the_thread->Object.id; the_mutex->nest_count = 1; 46a84: 7201 moveq #1,%d1 } else #endif { the_mutex->holder = the_thread; the_mutex->holder_id = the_thread->Object.id; 46a86: 2568 0008 005e movel %a0@(8),%a2@(94) the_mutex->nest_count = 1; switch ( the_mutex->Attributes.discipline ) { 46a8c: 202a 0046 movel %a2@(70),%d0 #endif { the_mutex->holder = the_thread; the_mutex->holder_id = the_thread->Object.id; the_mutex->nest_count = 1; 46a90: 2541 0052 movel %d1,%a2@(82) switch ( the_mutex->Attributes.discipline ) { 46a94: 123c 0002 moveb #2,%d1 } else #endif { the_mutex->holder = the_thread; 46a98: 2548 005a movel %a0,%a2@(90) the_mutex->holder_id = the_thread->Object.id; the_mutex->nest_count = 1; switch ( the_mutex->Attributes.discipline ) { 46a9c: b280 cmpl %d0,%d1 46a9e: 6764 beqs 46b04 <_CORE_mutex_Surrender+0xf0> 46aa0: 123c 0003 moveb #3,%d1 46aa4: b280 cmpl %d0,%d1 46aa6: 6734 beqs 46adc <_CORE_mutex_Surrender+0xc8> } } else the_mutex->lock = CORE_MUTEX_UNLOCKED; return CORE_MUTEX_STATUS_SUCCESSFUL; } 46aa8: 246e fffc moveal %fp@(-4),%a2 } break; } } } else the_mutex->lock = CORE_MUTEX_UNLOCKED; 46aac: 4280 clrl %d0 return CORE_MUTEX_STATUS_SUCCESSFUL; } 46aae: 4e5e unlk %fp 46ab0: 4e75 rts _CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) { #ifdef __RTEMS_STRICT_ORDER_MUTEX__ if(the_mutex->queue.priority_before != holder->current_priority) _Thread_Change_priority(holder,the_mutex->queue.priority_before,true); #endif if ( holder->resource_count == 0 && 46ab2: 4aa8 001c tstl %a0@(28) 46ab6: 66ba bnes 46a72 <_CORE_mutex_Surrender+0x5e> holder->real_priority != holder->current_priority ) { 46ab8: 2028 0018 movel %a0@(24),%d0 46abc: b0a8 0014 cmpl %a0@(20),%d0 46ac0: 67b0 beqs 46a72 <_CORE_mutex_Surrender+0x5e> _Thread_Change_priority( holder, holder->real_priority, true ); 46ac2: 4878 0001 pea 1 46ac6: 2f00 movel %d0,%sp@- 46ac8: 2f08 movel %a0,%sp@- 46aca: 4eb9 0004 78a8 jsr 478a8 <_Thread_Change_priority> 46ad0: 4fef 000c lea %sp@(12),%sp 46ad4: 609c bras 46a72 <_CORE_mutex_Surrender+0x5e> <== ALWAYS TAKEN the_mutex->nest_count++; return CORE_MUTEX_RELEASE_NOT_ORDER; } first_node = _Chain_Get_first_unprotected(&holder->lock_mutex); #endif holder->resource_count--; 46ad6: 53a8 001c subql #1,%a0@(28) 46ada: 6080 bras 46a5c <_CORE_mutex_Surrender+0x48> <== ALWAYS TAKEN case CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING: #ifdef __RTEMS_STRICT_ORDER_MUTEX__ _Chain_Prepend_unprotected(&the_thread->lock_mutex,&the_mutex->queue.lock_queue); the_mutex->queue.priority_before = the_thread->current_priority; #endif the_thread->resource_count++; 46adc: 52a8 001c addql #1,%a0@(28) if (the_mutex->Attributes.priority_ceiling < 46ae0: 202a 004a movel %a2@(74),%d0 the_thread->current_priority){ 46ae4: b0a8 0014 cmpl %a0@(20),%d0 46ae8: 64be bccs 46aa8 <_CORE_mutex_Surrender+0x94> _Thread_Change_priority( 46aea: 42a7 clrl %sp@- 46aec: 2f00 movel %d0,%sp@- 46aee: 2f08 movel %a0,%sp@- 46af0: 4eb9 0004 78a8 jsr 478a8 <_Thread_Change_priority> } } else the_mutex->lock = CORE_MUTEX_UNLOCKED; return CORE_MUTEX_STATUS_SUCCESSFUL; } 46af6: 246e fffc moveal %fp@(-4),%a2 the_mutex->queue.priority_before = the_thread->current_priority; #endif the_thread->resource_count++; if (the_mutex->Attributes.priority_ceiling < the_thread->current_priority){ _Thread_Change_priority( 46afa: 4fef 000c lea %sp@(12),%sp 46afe: 4280 clrl %d0 } } else the_mutex->lock = CORE_MUTEX_UNLOCKED; return CORE_MUTEX_STATUS_SUCCESSFUL; } 46b00: 4e5e unlk %fp 46b02: 4e75 rts 46b04: 246e fffc moveal %fp@(-4),%a2 case CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT: #ifdef __RTEMS_STRICT_ORDER_MUTEX__ _Chain_Prepend_unprotected(&the_thread->lock_mutex,&the_mutex->queue.lock_queue); the_mutex->queue.priority_before = the_thread->current_priority; #endif the_thread->resource_count++; 46b08: 4280 clrl %d0 46b0a: 52a8 001c addql #1,%a0@(28) } } else the_mutex->lock = CORE_MUTEX_UNLOCKED; return CORE_MUTEX_STATUS_SUCCESSFUL; } 46b0e: 4e5e unlk %fp 46b10: 4e75 rts } break; } } } else the_mutex->lock = CORE_MUTEX_UNLOCKED; 46b12: 7001 moveq #1,%d0 46b14: 2540 004e movel %d0,%a2@(78) return CORE_MUTEX_STATUS_SUCCESSFUL; } 46b18: 246e fffc moveal %fp@(-4),%a2 } break; } } } else the_mutex->lock = CORE_MUTEX_UNLOCKED; 46b1c: 4200 clrb %d0 return CORE_MUTEX_STATUS_SUCCESSFUL; } 46b1e: 4e5e unlk %fp 46b20: 4e75 rts ... 00046b78 <_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 ) { 46b78: 4e56 0000 linkw %fp,#0 46b7c: 2f0a movel %a2,%sp@- 46b7e: 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)) ) { 46b82: 2f0a movel %a2,%sp@- 46b84: 4eb9 0004 81b4 jsr 481b4 <_Thread_queue_Dequeue> 46b8a: 588f addql #4,%sp 46b8c: 4a80 tstl %d0 46b8e: 670a beqs 46b9a <_CORE_semaphore_Surrender+0x22> status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); } return status; } 46b90: 246e fffc moveal %fp@(-4),%a2 ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; if ( (the_thread = _Thread_queue_Dequeue(&the_semaphore->Wait_queue)) ) { 46b94: 4280 clrl %d0 status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); } return status; } 46b96: 4e5e unlk %fp 46b98: 4e75 rts if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_semaphore_mp_support) ( the_thread, id ); #endif } else { _ISR_Disable( level ); 46b9a: 203c 0000 0700 movel #1792,%d0 46ba0: 40c1 movew %sr,%d1 46ba2: 8081 orl %d1,%d0 46ba4: 46c0 movew %d0,%sr if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 46ba6: 202a 0048 movel %a2@(72),%d0 46baa: b0aa 0040 cmpl %a2@(64),%d0 46bae: 6412 bccs 46bc2 <_CORE_semaphore_Surrender+0x4a> <== ALWAYS TAKEN the_semaphore->count += 1; 46bb0: 5280 addql #1,%d0 46bb2: 2540 0048 movel %d0,%a2@(72) 46bb6: 4280 clrl %d0 else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); 46bb8: 46c1 movew %d1,%sr } return status; } 46bba: 246e fffc moveal %fp@(-4),%a2 46bbe: 4e5e unlk %fp 46bc0: 4e75 rts (*api_semaphore_mp_support) ( the_thread, id ); #endif } else { _ISR_Disable( level ); if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 46bc2: 7004 moveq #4,%d0 <== NOT EXECUTED the_semaphore->count += 1; else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); 46bc4: 46c1 movew %d1,%sr <== NOT EXECUTED 46bc6: 60f2 bras 46bba <_CORE_semaphore_Surrender+0x42> <== NOT EXECUTED 0004bae4 <_Chain_Initialize>: Chain_Control *the_chain, void *starting_address, size_t number_nodes, size_t node_size ) { 4bae4: 4e56 0000 linkw %fp,#0 4bae8: 202e 0010 movel %fp@(16),%d0 4baec: 2f0a movel %a2,%sp@- 4baee: 246e 0008 moveal %fp@(8),%a2 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Head( Chain_Control *the_chain ) { return (Chain_Node *) the_chain; 4baf2: 224a moveal %a2,%a1 4baf4: 2f02 movel %d2,%sp@- 4baf6: 242e 0014 movel %fp@(20),%d2 Chain_Node *current; Chain_Node *next; count = number_nodes; current = _Chain_Head( the_chain ); the_chain->permanent_null = NULL; 4bafa: 42aa 0004 clrl %a2@(4) next = starting_address; while ( count-- ) { 4bafe: 4a80 tstl %d0 4bb00: 6718 beqs 4bb1a <_Chain_Initialize+0x36> <== ALWAYS TAKEN Chain_Node *next; count = number_nodes; current = _Chain_Head( the_chain ); the_chain->permanent_null = NULL; next = starting_address; 4bb02: 206e 000c moveal %fp@(12),%a0 while ( count-- ) { current->next = next; next->previous = current; 4bb06: 2149 0004 movel %a1,%a0@(4) 4bb0a: 2208 movel %a0,%d1 4bb0c: d282 addl %d2,%d1 current = next; next = (Chain_Node *) 4bb0e: 5380 subql #1,%d0 count = number_nodes; current = _Chain_Head( the_chain ); the_chain->permanent_null = NULL; next = starting_address; while ( count-- ) { current->next = next; 4bb10: 2288 movel %a0,%a1@ next->previous = current; current = next; next = (Chain_Node *) 4bb12: 2248 moveal %a0,%a1 count = number_nodes; current = _Chain_Head( the_chain ); the_chain->permanent_null = NULL; next = starting_address; while ( count-- ) { 4bb14: 2041 moveal %d1,%a0 4bb16: 4a80 tstl %d0 4bb18: 66ec bnes 4bb06 <_Chain_Initialize+0x22> next->previous = current; current = next; next = (Chain_Node *) _Addresses_Add_offset( (void *) next, node_size ); } current->next = _Chain_Tail( the_chain ); 4bb1a: 200a movel %a2,%d0 4bb1c: 5880 addql #4,%d0 4bb1e: 2280 movel %d0,%a1@ the_chain->last = current; } 4bb20: 241f movel %sp@+,%d2 current = next; next = (Chain_Node *) _Addresses_Add_offset( (void *) next, node_size ); } current->next = _Chain_Tail( the_chain ); the_chain->last = current; 4bb22: 2549 0008 movel %a1,%a2@(8) } 4bb26: 245f moveal %sp@+,%a2 4bb28: 4e5e unlk %fp 4bb2a: 4e75 rts 000456d0 <_Event_Seize>: executing = _Thread_Executing; executing->Wait.return_code = RTEMS_SUCCESSFUL; api = executing->API_Extensions[ THREAD_API_RTEMS ]; _ISR_Disable( level ); 456d0: 203c 0000 0700 movel #1792,%d0 rtems_event_set event_in, rtems_option option_set, rtems_interval ticks, rtems_event_set *event_out ) { 456d6: 4e56 ffec linkw %fp,#-20 456da: 222e 0008 movel %fp@(8),%d1 456de: 48d7 043c moveml %d2-%d5/%a2,%sp@ rtems_event_set pending_events; ISR_Level level; RTEMS_API_Control *api; Thread_blocking_operation_States sync_state; executing = _Thread_Executing; 456e2: 2479 0005 f20e moveal 5f20e <_Thread_Executing>,%a2 rtems_event_set event_in, rtems_option option_set, rtems_interval ticks, rtems_event_set *event_out ) { 456e8: 242e 000c movel %fp@(12),%d2 456ec: 2a2e 0010 movel %fp@(16),%d5 ISR_Level level; RTEMS_API_Control *api; Thread_blocking_operation_States sync_state; executing = _Thread_Executing; executing->Wait.return_code = RTEMS_SUCCESSFUL; 456f0: 42aa 0034 clrl %a2@(52) rtems_event_set event_in, rtems_option option_set, rtems_interval ticks, rtems_event_set *event_out ) { 456f4: 226e 0014 moveal %fp@(20),%a1 Thread_blocking_operation_States sync_state; executing = _Thread_Executing; executing->Wait.return_code = RTEMS_SUCCESSFUL; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 456f8: 206a 010a moveal %a2@(266),%a0 _ISR_Disable( level ); 456fc: 40c4 movew %sr,%d4 456fe: 8084 orl %d4,%d0 45700: 46c0 movew %d0,%sr pending_events = api->pending_events; 45702: 2610 movel %a0@,%d3 RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Get( rtems_event_set the_event_set, rtems_event_set the_event_condition ) { return ( the_event_set & the_event_condition ); 45704: 2001 movel %d1,%d0 45706: c083 andl %d3,%d0 seized_events = _Event_sets_Get( pending_events, event_in ); if ( !_Event_sets_Is_empty( seized_events ) && 45708: 670c beqs 45716 <_Event_Seize+0x46> 4570a: b081 cmpl %d1,%d0 4570c: 6700 0084 beqw 45792 <_Event_Seize+0xc2> 45710: 0802 0001 btst #1,%d2 45714: 667c bnes 45792 <_Event_Seize+0xc2> <== NEVER TAKEN _ISR_Enable( level ); *event_out = seized_events; return; } if ( _Options_Is_no_wait( option_set ) ) { 45716: 0802 0000 btst #0,%d2 4571a: 6662 bnes 4577e <_Event_Seize+0xae> * set properly when we are marked as in the event critical section. * * NOTE: Since interrupts are disabled, this isn't that much of an * issue but better safe than sorry. */ executing->Wait.option = (uint32_t) option_set; 4571c: 2542 0030 movel %d2,%a2@(48) executing->Wait.count = (uint32_t) event_in; executing->Wait.return_argument = event_out; _Event_Sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 45720: 7401 moveq #1,%d2 * * NOTE: Since interrupts are disabled, this isn't that much of an * issue but better safe than sorry. */ executing->Wait.option = (uint32_t) option_set; executing->Wait.count = (uint32_t) event_in; 45722: 2541 0024 movel %d1,%a2@(36) executing->Wait.return_argument = event_out; 45726: 2549 0028 movel %a1,%a2@(40) _Event_Sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 4572a: 23c2 0005 f97a movel %d2,5f97a <_Event_Sync_state> _ISR_Enable( level ); 45730: 46c4 movew %d4,%sr if ( ticks ) { 45732: 4a85 tstl %d5 45734: 6672 bnes 457a8 <_Event_Seize+0xd8> NULL ); _Watchdog_Insert_ticks( &executing->Timer, ticks ); } _Thread_Set_state( executing, STATES_WAITING_FOR_EVENT ); 45736: 4878 0100 pea 100 4573a: 2f0a movel %a2,%sp@- 4573c: 4eb9 0004 871c jsr 4871c <_Thread_Set_state> _ISR_Disable( level ); 45742: 203c 0000 0700 movel #1792,%d0 45748: 40c1 movew %sr,%d1 4574a: 8081 orl %d1,%d0 4574c: 46c0 movew %d0,%sr sync_state = _Event_Sync_state; _Event_Sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) { 4574e: 7401 moveq #1,%d2 45750: 508f addql #8,%sp _Thread_Set_state( executing, STATES_WAITING_FOR_EVENT ); _ISR_Disable( level ); sync_state = _Event_Sync_state; 45752: 2039 0005 f97a movel 5f97a <_Event_Sync_state>,%d0 _Event_Sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 45758: 42b9 0005 f97a clrl 5f97a <_Event_Sync_state> if ( sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) { 4575e: b480 cmpl %d0,%d2 45760: 6700 00a4 beqw 45806 <_Event_Seize+0x136> * An interrupt completed the thread's blocking request. * The blocking thread was satisfied by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ _Thread_blocking_operation_Cancel( sync_state, executing, level ); 45764: 2d4a 000c movel %a2,%fp@(12) 45768: 2d41 0010 movel %d1,%fp@(16) } 4576c: 4cee 043c ffec moveml %fp@(-20),%d2-%d5/%a2 * An interrupt completed the thread's blocking request. * The blocking thread was satisfied by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ _Thread_blocking_operation_Cancel( sync_state, executing, level ); 45772: 2d40 0008 movel %d0,%fp@(8) } 45776: 4e5e unlk %fp * An interrupt completed the thread's blocking request. * The blocking thread was satisfied by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ _Thread_blocking_operation_Cancel( sync_state, executing, level ); 45778: 4ef9 0004 7840 jmp 47840 <_Thread_blocking_operation_Cancel> *event_out = seized_events; return; } if ( _Options_Is_no_wait( option_set ) ) { _ISR_Enable( level ); 4577e: 46c4 movew %d4,%sr executing->Wait.return_code = RTEMS_UNSATISFIED; 45780: 720d moveq #13,%d1 45782: 2541 0034 movel %d1,%a2@(52) * The blocking thread was satisfied by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ _Thread_blocking_operation_Cancel( sync_state, executing, level ); } 45786: 4cee 043c ffec moveml %fp@(-20),%d2-%d5/%a2 } if ( _Options_Is_no_wait( option_set ) ) { _ISR_Enable( level ); executing->Wait.return_code = RTEMS_UNSATISFIED; *event_out = seized_events; 4578c: 2280 movel %d0,%a1@ * The blocking thread was satisfied by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ _Thread_blocking_operation_Cancel( sync_state, executing, level ); } 4578e: 4e5e unlk %fp 45790: 4e75 rts pending_events = api->pending_events; seized_events = _Event_sets_Get( pending_events, event_in ); if ( !_Event_sets_Is_empty( seized_events ) && (seized_events == event_in || _Options_Is_any( option_set )) ) { api->pending_events = 45792: 2200 movel %d0,%d1 45794: 4681 notl %d1 45796: c283 andl %d3,%d1 45798: 2081 movel %d1,%a0@ _Event_sets_Clear( pending_events, seized_events ); _ISR_Enable( level ); 4579a: 46c4 movew %d4,%sr *event_out = seized_events; 4579c: 2280 movel %d0,%a1@ * The blocking thread was satisfied by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ _Thread_blocking_operation_Cancel( sync_state, executing, level ); } 4579e: 4cee 043c ffec moveml %fp@(-20),%d2-%d5/%a2 457a4: 4e5e unlk %fp 457a6: 4e75 rts _Event_Sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; _ISR_Enable( level ); if ( ticks ) { _Watchdog_Initialize( 457a8: 202a 0008 movel %a2@(8),%d0 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 457ac: 223c 0004 599c movel #285084,%d1 the_watchdog->id = id; 457b2: 2540 0068 movel %d0,%a2@(104) Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 457b6: 2541 0064 movel %d1,%a2@(100) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 457ba: 2545 0054 movel %d5,%a2@(84) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 457be: 42aa 0050 clrl %a2@(80) the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 457c2: 42aa 006c clrl %a2@(108) ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 457c6: 486a 0048 pea %a2@(72) 457ca: 4879 0005 f22c pea 5f22c <_Watchdog_Ticks_chain> 457d0: 4eb9 0004 8f58 jsr 48f58 <_Watchdog_Insert> 457d6: 508f addql #8,%sp NULL ); _Watchdog_Insert_ticks( &executing->Timer, ticks ); } _Thread_Set_state( executing, STATES_WAITING_FOR_EVENT ); 457d8: 4878 0100 pea 100 457dc: 2f0a movel %a2,%sp@- 457de: 4eb9 0004 871c jsr 4871c <_Thread_Set_state> _ISR_Disable( level ); 457e4: 203c 0000 0700 movel #1792,%d0 457ea: 40c1 movew %sr,%d1 457ec: 8081 orl %d1,%d0 457ee: 46c0 movew %d0,%sr sync_state = _Event_Sync_state; _Event_Sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) { 457f0: 7401 moveq #1,%d2 457f2: 508f addql #8,%sp _Thread_Set_state( executing, STATES_WAITING_FOR_EVENT ); _ISR_Disable( level ); sync_state = _Event_Sync_state; 457f4: 2039 0005 f97a movel 5f97a <_Event_Sync_state>,%d0 _Event_Sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 457fa: 42b9 0005 f97a clrl 5f97a <_Event_Sync_state> if ( sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) { 45800: b480 cmpl %d0,%d2 45802: 6600 ff60 bnew 45764 <_Event_Seize+0x94> _ISR_Enable( level ); 45806: 46c1 movew %d1,%sr * The blocking thread was satisfied by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ _Thread_blocking_operation_Cancel( sync_state, executing, level ); } 45808: 4cee 043c ffec moveml %fp@(-20),%d2-%d5/%a2 4580e: 4e5e unlk %fp 45810: 4e75 rts ... 00045870 <_Event_Surrender>: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; option_set = (rtems_option) the_thread->Wait.option; _ISR_Disable( level ); 45870: 203c 0000 0700 movel #1792,%d0 */ void _Event_Surrender( Thread_Control *the_thread ) { 45876: 4e56 ffec linkw %fp,#-20 4587a: 48d7 043c moveml %d2-%d5/%a2,%sp@ 4587e: 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 ]; 45882: 206a 010a moveal %a2@(266),%a0 option_set = (rtems_option) the_thread->Wait.option; 45886: 282a 0030 movel %a2@(48),%d4 _ISR_Disable( level ); 4588a: 40c3 movew %sr,%d3 4588c: 8083 orl %d3,%d0 4588e: 46c0 movew %d0,%sr pending_events = api->pending_events; event_condition = (rtems_event_set) the_thread->Wait.count; 45890: 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 ); 45894: 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; 45896: 2410 movel %a0@,%d2 45898: 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 ) ) { 4589a: 6778 beqs 45914 <_Event_Surrender+0xa4> /* * 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() && 4589c: 2279 0005 f1ee moveal 5f1ee <_ISR_Nest_level>,%a1 458a2: 4a89 tstl %a1 458a4: 670a beqs 458b0 <_Event_Surrender+0x40> 458a6: b5f9 0005 f20e cmpal 5f20e <_Thread_Executing>,%a2 458ac: 6700 00a0 beqw 4594e <_Event_Surrender+0xde> } /* * Otherwise, this is a normal send to another thread */ if ( _States_Is_waiting_for_event( the_thread->current_state ) ) { 458b0: 2a2a 0010 movel %a2@(16),%d5 458b4: 0285 0000 0100 andil #256,%d5 458ba: 674c beqs 45908 <_Event_Surrender+0x98> if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { 458bc: b081 cmpl %d1,%d0 458be: 6706 beqs 458c6 <_Event_Surrender+0x56> 458c0: 0804 0001 btst #1,%d4 458c4: 6742 beqs 45908 <_Event_Surrender+0x98> <== ALWAYS TAKEN api->pending_events = _Event_sets_Clear( pending_events, seized_events ); 458c6: 2200 movel %d0,%d1 458c8: 4681 notl %d1 458ca: c282 andl %d2,%d1 458cc: 2081 movel %d1,%a0@ the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 458ce: 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; 458d2: 42aa 0024 clrl %a2@(36) *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 458d6: 2080 movel %d0,%a0@ _ISR_Flash( level ); 458d8: 203c 0000 0700 movel #1792,%d0 458de: 46c3 movew %d3,%sr 458e0: 8083 orl %d3,%d0 458e2: 46c0 movew %d0,%sr if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 458e4: 7a02 moveq #2,%d5 458e6: baaa 0050 cmpl %a2@(80),%d5 458ea: 6734 beqs 45920 <_Event_Surrender+0xb0> _ISR_Enable( level ); 458ec: 46c3 movew %d3,%sr RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 458ee: 2f3c 1003 fff8 movel #268697592,%sp@- 458f4: 2f0a movel %a2,%sp@- 458f6: 4eb9 0004 79f4 jsr 479f4 <_Thread_Clear_state> 458fc: 508f addql #8,%sp } return; } } _ISR_Enable( level ); } 458fe: 4cee 043c ffec moveml %fp@(-20),%d2-%d5/%a2 45904: 4e5e unlk %fp 45906: 4e75 rts _Thread_Unblock( the_thread ); } return; } } _ISR_Enable( level ); 45908: 46c3 movew %d3,%sr } 4590a: 4cee 043c ffec moveml %fp@(-20),%d2-%d5/%a2 45910: 4e5e unlk %fp 45912: 4e75 rts /* * No events were seized in this operation */ if ( _Event_sets_Is_empty( seized_events ) ) { _ISR_Enable( level ); 45914: 46c3 movew %d3,%sr } return; } } _ISR_Enable( level ); } 45916: 4cee 043c ffec moveml %fp@(-20),%d2-%d5/%a2 4591c: 4e5e unlk %fp 4591e: 4e75 rts RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 45920: 7003 moveq #3,%d0 45922: 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 ); 45926: 46c3 movew %d3,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 45928: 486a 0048 pea %a2@(72) 4592c: 4eb9 0004 90a0 jsr 490a0 <_Watchdog_Remove> 45932: 2f3c 1003 fff8 movel #268697592,%sp@- 45938: 2f0a movel %a2,%sp@- 4593a: 4eb9 0004 79f4 jsr 479f4 <_Thread_Clear_state> 45940: 4fef 000c lea %sp@(12),%sp } return; } } _ISR_Enable( level ); } 45944: 4cee 043c ffec moveml %fp@(-20),%d2-%d5/%a2 4594a: 4e5e unlk %fp 4594c: 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) || 4594e: 2279 0005 f97a moveal 5f97a <_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() && 45954: 7a02 moveq #2,%d5 45956: ba89 cmpl %a1,%d5 45958: 6710 beqs 4596a <_Event_Surrender+0xfa> <== ALWAYS TAKEN _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { 4595a: 2279 0005 f97a moveal 5f97a <_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() && 45960: 1a3c 0001 moveb #1,%d5 45964: ba89 cmpl %a1,%d5 45966: 6600 ff48 bnew 458b0 <_Event_Surrender+0x40> _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) ) { 4596a: b081 cmpl %d1,%d0 4596c: 6706 beqs 45974 <_Event_Surrender+0x104> 4596e: 0804 0001 btst #1,%d4 45972: 671a beqs 4598e <_Event_Surrender+0x11e> <== ALWAYS TAKEN api->pending_events = _Event_sets_Clear( pending_events,seized_events ); 45974: 2200 movel %d0,%d1 45976: 4681 notl %d1 45978: c282 andl %d2,%d1 4597a: 2081 movel %d1,%a0@ the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 4597c: 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; 45980: 42aa 0024 clrl %a2@(36) *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 45984: 2080 movel %d0,%a0@ _Event_Sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 45986: 7003 moveq #3,%d0 45988: 23c0 0005 f97a movel %d0,5f97a <_Event_Sync_state> } _ISR_Enable( level ); 4598e: 46c3 movew %d3,%sr } return; } } _ISR_Enable( level ); } 45990: 4cee 043c ffec moveml %fp@(-20),%d2-%d5/%a2 45996: 4e5e unlk %fp 45998: 4e75 rts ... 0004599c <_Event_Timeout>: void _Event_Timeout( Objects_Id id, void *ignored ) { 4599c: 4e56 fffc linkw %fp,#-4 459a0: 2f03 movel %d3,%sp@- 459a2: 2f02 movel %d2,%sp@- Thread_Control *the_thread; Objects_Locations location; ISR_Level level; the_thread = _Thread_Get( id, &location ); 459a4: 486e fffc pea %fp@(-4) 459a8: 2f2e 0008 movel %fp@(8),%sp@- 459ac: 4eb9 0004 7df0 jsr 47df0 <_Thread_Get> switch ( location ) { 459b2: 508f addql #8,%sp 459b4: 4aae fffc tstl %fp@(-4) 459b8: 6642 bnes 459fc <_Event_Timeout+0x60> <== ALWAYS 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 ); 459ba: 223c 0000 0700 movel #1792,%d1 459c0: 40c2 movew %sr,%d2 459c2: 8282 orl %d2,%d1 459c4: 46c1 movew %d1,%sr _ISR_Enable( level ); return; } #endif the_thread->Wait.count = 0; 459c6: 2040 moveal %d0,%a0 459c8: 42a8 0024 clrl %a0@(36) if ( _Thread_Is_executing( the_thread ) ) { 459cc: b0b9 0005 f20e cmpl 5f20e <_Thread_Executing>,%d0 459d2: 6734 beqs 45a08 <_Event_Timeout+0x6c> if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) _Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; } the_thread->Wait.return_code = RTEMS_TIMEOUT; 459d4: 7606 moveq #6,%d3 459d6: 2040 moveal %d0,%a0 459d8: 2143 0034 movel %d3,%a0@(52) _ISR_Enable( level ); 459dc: 46c2 movew %d2,%sr 459de: 2f3c 1003 fff8 movel #268697592,%sp@- 459e4: 2f00 movel %d0,%sp@- 459e6: 4eb9 0004 79f4 jsr 479f4 <_Thread_Clear_state> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 459ec: 508f addql #8,%sp 459ee: 2039 0005 f154 movel 5f154 <_Thread_Dispatch_disable_level>,%d0 459f4: 5380 subql #1,%d0 459f6: 23c0 0005 f154 movel %d0,5f154 <_Thread_Dispatch_disable_level> case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 459fc: 242e fff4 movel %fp@(-12),%d2 45a00: 262e fff8 movel %fp@(-8),%d3 45a04: 4e5e unlk %fp 45a06: 4e75 rts } #endif the_thread->Wait.count = 0; if ( _Thread_Is_executing( the_thread ) ) { if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 45a08: 2239 0005 f97a movel 5f97a <_Event_Sync_state>,%d1 45a0e: 7601 moveq #1,%d3 45a10: b681 cmpl %d1,%d3 45a12: 66c0 bnes 459d4 <_Event_Timeout+0x38> _Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; } the_thread->Wait.return_code = RTEMS_TIMEOUT; 45a14: 7606 moveq #6,%d3 45a16: 2040 moveal %d0,%a0 #endif the_thread->Wait.count = 0; if ( _Thread_Is_executing( the_thread ) ) { if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) _Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 45a18: 7202 moveq #2,%d1 } the_thread->Wait.return_code = RTEMS_TIMEOUT; 45a1a: 2143 0034 movel %d3,%a0@(52) #endif the_thread->Wait.count = 0; if ( _Thread_Is_executing( the_thread ) ) { if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) _Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 45a1e: 23c1 0005 f97a movel %d1,5f97a <_Event_Sync_state> } the_thread->Wait.return_code = RTEMS_TIMEOUT; _ISR_Enable( level ); 45a24: 46c2 movew %d2,%sr RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 45a26: 2f3c 1003 fff8 movel #268697592,%sp@- 45a2c: 2f00 movel %d0,%sp@- 45a2e: 4eb9 0004 79f4 jsr 479f4 <_Thread_Clear_state> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 45a34: 508f addql #8,%sp 45a36: 2039 0005 f154 movel 5f154 <_Thread_Dispatch_disable_level>,%d0 45a3c: 5380 subql #1,%d0 45a3e: 23c0 0005 f154 movel %d0,5f154 <_Thread_Dispatch_disable_level> 45a44: 60b6 bras 459fc <_Event_Timeout+0x60> <== ALWAYS TAKEN ... 0004bda8 <_Heap_Allocate_aligned_with_boundary>: Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 4bda8: 4e56 ffcc linkw %fp,#-52 4bdac: 226e 000c moveal %fp@(12),%a1 4bdb0: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 4bdb4: 246e 0008 moveal %fp@(8),%a2 Heap_Statistics *const stats = &heap->stats; Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); Heap_Block *block = _Heap_Free_list_first( heap ); uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE - HEAP_BLOCK_SIZE_OFFSET; 4bdb8: 2c09 movel %a1,%d6 4bdba: 5886 addql #4,%d6 uintptr_t const page_size = heap->page_size; 4bdbc: 202a 0010 movel %a2@(16),%d0 Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 4bdc0: 222e 0010 movel %fp@(16),%d1 4bdc4: 282e 0014 movel %fp@(20),%d4 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 4bdc8: 206a 0008 moveal %a2@(8),%a0 Heap_Statistics *const stats = &heap->stats; Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); Heap_Block *block = _Heap_Free_list_first( heap ); uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE - HEAP_BLOCK_SIZE_OFFSET; uintptr_t const page_size = heap->page_size; 4bdcc: 2d40 fffc movel %d0,%fp@(-4) uintptr_t alloc_begin = 0; uint32_t search_count = 0; if ( block_size_floor < alloc_size ) { 4bdd0: bc89 cmpl %a1,%d6 4bdd2: 6500 0146 bcsw 4bf1a <_Heap_Allocate_aligned_with_boundary+0x172> /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { 4bdd6: 4a84 tstl %d4 4bdd8: 6600 013c bnew 4bf16 <_Heap_Allocate_aligned_with_boundary+0x16e> if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { 4bddc: b1ca cmpal %a2,%a0 4bdde: 6700 0152 beqw 4bf32 <_Heap_Allocate_aligned_with_boundary+0x18a> uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; 4bde2: 242e fffc movel %fp@(-4),%d2 uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; 4bde6: 7a04 moveq #4,%d5 uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; 4bde8: 5e82 addql #7,%d2 uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; 4bdea: 9a89 subl %a1,%d5 if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { 4bdec: 4283 clrl %d3 uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; 4bdee: 2d42 fff8 movel %d2,%fp@(-8) uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; 4bdf2: 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 ) { 4bdf6: 2028 0004 movel %a0@(4),%d0 while ( block != free_list_tail ) { _HAssert( _Heap_Is_prev_used( block ) ); /* Statistics */ ++search_count; 4bdfa: 5283 addql #1,%d3 /* * The HEAP_PREV_BLOCK_USED flag is always set in the block size_and_flag * field. Thus the value is about one unit larger than the real block * size. The greater than operator takes this into account. */ if ( block->size_and_flag > block_size_floor ) { 4bdfc: b086 cmpl %d6,%d0 4bdfe: 630e blss 4be0e <_Heap_Allocate_aligned_with_boundary+0x66> if ( alignment == 0 ) { 4be00: 4a81 tstl %d1 4be02: 6628 bnes 4be2c <_Heap_Allocate_aligned_with_boundary+0x84> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 4be04: 2408 movel %a0,%d2 4be06: 5082 addql #8,%d2 boundary ); } } if ( alloc_begin != 0 ) { 4be08: 4a82 tstl %d2 4be0a: 6600 00ee bnew 4befa <_Heap_Allocate_aligned_with_boundary+0x152> <== NEVER TAKEN break; } block = block->next; 4be0e: 2068 0008 moveal %a0@(8),%a0 if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { 4be12: b1ca cmpal %a2,%a0 4be14: 66e0 bnes 4bdf6 <_Heap_Allocate_aligned_with_boundary+0x4e> 4be16: 4280 clrl %d0 uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { Heap_Statistics *const stats = &heap->stats; 4be18: b6aa 0044 cmpl %a2@(68),%d3 4be1c: 6304 blss 4be22 <_Heap_Allocate_aligned_with_boundary+0x7a> ); } /* Statistics */ if ( stats->max_search < search_count ) { stats->max_search = search_count; 4be1e: 2543 0044 movel %d3,%a2@(68) } return (void *) alloc_begin; } 4be22: 4cee 3cfc ffcc moveml %fp@(-52),%d2-%d7/%a2-%a5 4be28: 4e5e unlk %fp 4be2a: 4e75 rts uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; 4be2c: 7efe moveq #-2,%d7 4be2e: 4be8 0008 lea %a0@(8),%a5 4be32: c087 andl %d7,%d0 uintptr_t alignment, uintptr_t boundary ) { uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; 4be34: 286a 0014 moveal %a2@(20),%a4 uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; 4be38: 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; 4be3a: 2a2e fff8 movel %fp@(-8),%d5 4be3e: 9a8c subl %a4,%d5 uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; 4be40: 242e fff4 movel %fp@(-12),%d2 4be44: d480 addl %d0,%d2 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4be46: 2e02 movel %d2,%d7 uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; 4be48: d085 addl %d5,%d0 4be4a: 4c41 7005 remul %d1,%d5,%d7 4be4e: 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 ) { 4be50: b480 cmpl %d0,%d2 4be52: 630a blss 4be5e <_Heap_Allocate_aligned_with_boundary+0xb6> 4be54: 2a00 movel %d0,%d5 4be56: 4c41 5002 remul %d1,%d2,%d5 4be5a: 9082 subl %d2,%d0 4be5c: 2400 movel %d0,%d2 } alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { 4be5e: 4a84 tstl %d4 4be60: 676c beqs 4bece <_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; 4be62: 2002 movel %d2,%d0 4be64: d089 addl %a1,%d0 4be66: 2e00 movel %d0,%d7 4be68: 4c44 7005 remul %d4,%d5,%d7 4be6c: 2e00 movel %d0,%d7 4be6e: 9e85 subl %d5,%d7 4be70: 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 ) { 4be72: be82 cmpl %d2,%d7 4be74: 6358 blss 4bece <_Heap_Allocate_aligned_with_boundary+0x126> 4be76: be80 cmpl %d0,%d7 4be78: 6454 bccs 4bece <_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; 4be7a: 2e0d movel %a5,%d7 4be7c: 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 ) { 4be7e: ba87 cmpl %d7,%d5 4be80: 658c bcss 4be0e <_Heap_Allocate_aligned_with_boundary+0x66> return 0; } alloc_begin = boundary_line - alloc_size; 4be82: 9a89 subl %a1,%d5 4be84: 2005 movel %d5,%d0 4be86: 2647 moveal %d7,%a3 4be88: 4c41 0002 remul %d1,%d2,%d0 4be8c: 9a82 subl %d2,%d5 alloc_begin = _Heap_Align_down( alloc_begin, alignment ); alloc_end = alloc_begin + alloc_size; 4be8e: 2005 movel %d5,%d0 4be90: d089 addl %a1,%d0 4be92: 2405 movel %d5,%d2 4be94: 2e00 movel %d0,%d7 4be96: 4c44 7005 remul %d4,%d5,%d7 4be9a: 2e00 movel %d0,%d7 4be9c: 9e85 subl %d5,%d7 4be9e: 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 ) { 4bea0: be82 cmpl %d2,%d7 4bea2: 632a blss 4bece <_Heap_Allocate_aligned_with_boundary+0x126> 4bea4: be80 cmpl %d0,%d7 4bea6: 6426 bccs 4bece <_Heap_Allocate_aligned_with_boundary+0x126> if ( boundary_line < boundary_floor ) { 4bea8: ba8b cmpl %a3,%d5 4beaa: 6500 ff62 bcsw 4be0e <_Heap_Allocate_aligned_with_boundary+0x66> <== ALWAYS TAKEN return 0; } alloc_begin = boundary_line - alloc_size; 4beae: 9a89 subl %a1,%d5 4beb0: 2005 movel %d5,%d0 4beb2: 4c41 0002 remul %d1,%d2,%d0 4beb6: 9a82 subl %d2,%d5 alloc_begin = _Heap_Align_down( alloc_begin, alignment ); alloc_end = alloc_begin + alloc_size; 4beb8: 2005 movel %d5,%d0 4beba: d089 addl %a1,%d0 4bebc: 2405 movel %d5,%d2 4bebe: 2e00 movel %d0,%d7 4bec0: 4c44 7005 remul %d4,%d5,%d7 4bec4: 2e00 movel %d0,%d7 4bec6: 9e85 subl %d5,%d7 4bec8: 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 ) { 4beca: be82 cmpl %d2,%d7 4becc: 62d6 bhis 4bea4 <_Heap_Allocate_aligned_with_boundary+0xfc> <== NEVER TAKEN 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 ) { 4bece: b48d cmpl %a5,%d2 4bed0: 6500 ff3c bcsw 4be0e <_Heap_Allocate_aligned_with_boundary+0x66> uintptr_t const alloc_block_begin = (uintptr_t) _Heap_Block_of_alloc_area( alloc_begin, page_size ); uintptr_t const free_size = alloc_block_begin - block_begin; 4bed4: 70f8 moveq #-8,%d0 4bed6: 9088 subl %a0,%d0 4bed8: 2a40 moveal %d0,%a5 4beda: 2e02 movel %d2,%d7 4bedc: dbc2 addal %d2,%a5 4bede: 202e fffc movel %fp@(-4),%d0 4bee2: 4c40 7005 remul %d0,%d5,%d7 4bee6: 9bc5 subal %d5,%a5 if ( free_size >= min_block_size || free_size == 0 ) { 4bee8: bbcc cmpal %a4,%a5 4beea: 6400 ff1c bccw 4be08 <_Heap_Allocate_aligned_with_boundary+0x60> 4beee: 4a8d tstl %a5 4bef0: 6600 ff1c bnew 4be0e <_Heap_Allocate_aligned_with_boundary+0x66> boundary ); } } if ( alloc_begin != 0 ) { 4bef4: 4a82 tstl %d2 4bef6: 6700 ff16 beqw 4be0e <_Heap_Allocate_aligned_with_boundary+0x66> <== ALWAYS TAKEN if ( alloc_begin != 0 ) { /* Statistics */ stats->searches += search_count; block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 4befa: 2f09 movel %a1,%sp@- block = block->next; } if ( alloc_begin != 0 ) { /* Statistics */ stats->searches += search_count; 4befc: d7aa 004c addl %d3,%a2@(76) block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 4bf00: 2f02 movel %d2,%sp@- 4bf02: 2f08 movel %a0,%sp@- 4bf04: 2f0a movel %a2,%sp@- 4bf06: 4eb9 0004 6ea0 jsr 46ea0 <_Heap_Block_allocate> 4bf0c: 4fef 0010 lea %sp@(16),%sp 4bf10: 2002 movel %d2,%d0 4bf12: 6000 ff04 braw 4be18 <_Heap_Allocate_aligned_with_boundary+0x70> <== ALWAYS TAKEN /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { if ( boundary < alloc_size ) { 4bf16: b889 cmpl %a1,%d4 4bf18: 640c bccs 4bf26 <_Heap_Allocate_aligned_with_boundary+0x17e> ); } /* Statistics */ if ( stats->max_search < search_count ) { stats->max_search = search_count; 4bf1a: 4280 clrl %d0 } return (void *) alloc_begin; } 4bf1c: 4cee 3cfc ffcc moveml %fp@(-52),%d2-%d7/%a2-%a5 4bf22: 4e5e unlk %fp 4bf24: 4e75 rts if ( boundary != 0 ) { if ( boundary < alloc_size ) { return NULL; } if ( alignment == 0 ) { 4bf26: 4a81 tstl %d1 4bf28: 6600 feb2 bnew 4bddc <_Heap_Allocate_aligned_with_boundary+0x34> 4bf2c: 2200 movel %d0,%d1 4bf2e: 6000 feac braw 4bddc <_Heap_Allocate_aligned_with_boundary+0x34> <== ALWAYS TAKEN alignment = page_size; } } while ( block != free_list_tail ) { 4bf32: 4283 clrl %d3 4bf34: 4280 clrl %d0 4bf36: 6000 fee0 braw 4be18 <_Heap_Allocate_aligned_with_boundary+0x70> <== ALWAYS TAKEN ... 00046ea0 <_Heap_Block_allocate>: Heap_Block *free_list_anchor = NULL; _HAssert( alloc_area_begin <= alloc_begin ); if ( _Heap_Is_free( block ) ) { 46ea0: 70fe moveq #-2,%d0 Heap_Control *heap, Heap_Block *block, uintptr_t alloc_begin, uintptr_t alloc_size ) { 46ea2: 4e56 ffe0 linkw %fp,#-32 46ea6: 222e 0010 movel %fp@(16),%d1 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 46eaa: 2041 moveal %d1,%a0 46eac: 5188 subql #8,%a0 46eae: 48d7 3c3c moveml %d2-%d5/%a2-%a5,%sp@ 46eb2: 246e 000c moveal %fp@(12),%a2 Heap_Block *free_list_anchor = NULL; _HAssert( alloc_area_begin <= alloc_begin ); if ( _Heap_Is_free( block ) ) { 46eb6: 7601 moveq #1,%d3 ) { Heap_Statistics *const stats = &heap->stats; uintptr_t const alloc_area_begin = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_area_offset = alloc_begin - alloc_area_begin; 46eb8: 2848 moveal %a0,%a4 46eba: 240a movel %a2,%d2 46ebc: 99ca subal %a2,%a4 Heap_Block *free_list_anchor = NULL; _HAssert( alloc_area_begin <= alloc_begin ); if ( _Heap_Is_free( block ) ) { 46ebe: c0aa 0004 andl %a2@(4),%d0 Heap_Control *heap, Heap_Block *block, uintptr_t alloc_begin, uintptr_t alloc_size ) { 46ec2: 266e 0008 moveal %fp@(8),%a3 Heap_Block *free_list_anchor = NULL; _HAssert( alloc_area_begin <= alloc_begin ); if ( _Heap_Is_free( block ) ) { 46ec6: c6b2 0804 andl %a2@(00000004,%d0:l),%d3 Heap_Control *heap, Heap_Block *block, uintptr_t alloc_begin, uintptr_t alloc_size ) { 46eca: 2a2e 0014 movel %fp@(20),%d5 Heap_Block *free_list_anchor = NULL; _HAssert( alloc_area_begin <= alloc_begin ); if ( _Heap_Is_free( block ) ) { 46ece: 4a03 tstb %d3 46ed0: 6600 00aa bnew 46f7c <_Heap_Block_allocate+0xdc> free_list_anchor = block->prev; _Heap_Free_list_remove( block ); /* Statistics */ --stats->free_blocks; 46ed4: 53ab 0038 subql #1,%a3@(56) ++stats->used_blocks; stats->free_size -= _Heap_Block_size( block ); 46ed8: 76fe moveq #-2,%d3 _Heap_Free_list_remove( block ); /* Statistics */ --stats->free_blocks; ++stats->used_blocks; 46eda: 52ab 0040 addql #1,%a3@(64) return _Heap_Free_list_tail(heap)->prev; } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; 46ede: 202a 0008 movel %a2@(8),%d0 Heap_Block *prev = block->prev; prev->next = next; next->prev = prev; 46ee2: 2a40 moveal %d0,%a5 Heap_Block *free_list_anchor = NULL; _HAssert( alloc_area_begin <= alloc_begin ); if ( _Heap_Is_free( block ) ) { free_list_anchor = block->prev; 46ee4: 226a 000c moveal %a2@(12),%a1 _Heap_Free_list_remove( block ); /* Statistics */ --stats->free_blocks; ++stats->used_blocks; stats->free_size -= _Heap_Block_size( block ); 46ee8: c6aa 0004 andl %a2@(4),%d3 RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; Heap_Block *prev = block->prev; prev->next = next; 46eec: 2340 0008 movel %d0,%a1@(8) } else { free_list_anchor = _Heap_Free_list_head( heap ); } if ( alloc_area_offset < heap->page_size ) { 46ef0: 202b 0010 movel %a3@(16),%d0 _Heap_Free_list_remove( block ); /* Statistics */ --stats->free_blocks; ++stats->used_blocks; stats->free_size -= _Heap_Block_size( block ); 46ef4: 97ab 0030 subl %d3,%a3@(48) next->prev = prev; 46ef8: 2b49 000c movel %a1,%a5@(12) } else { free_list_anchor = _Heap_Free_list_head( heap ); } if ( alloc_area_offset < heap->page_size ) { 46efc: b08c cmpl %a4,%d0 46efe: 6200 0088 bhiw 46f88 <_Heap_Block_allocate+0xe8> - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 46f02: 262a 0004 movel %a2@(4),%d3 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_of_alloc_area( uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) 46f06: 4c40 1004 remul %d0,%d4,%d1 _HAssert( new_block_size >= heap->min_block_size ); /* Statistics */ stats->free_size += block_size; if ( _Heap_Is_prev_used( block ) ) { 46f0a: 7201 moveq #1,%d1 46f0c: 91c4 subal %d4,%a0 _Heap_Block_of_alloc_area( alloc_begin, heap->page_size ); uintptr_t const new_block_begin = (uintptr_t) new_block; uintptr_t const new_block_size = block_end - new_block_begin; block_end = new_block_begin; block_size = block_end - block_begin; 46f0e: 2008 movel %a0,%d0 46f10: 908a subl %a2,%d0 _HAssert( block_size >= heap->min_block_size ); _HAssert( new_block_size >= heap->min_block_size ); /* Statistics */ stats->free_size += block_size; 46f12: d1ab 0030 addl %d0,%a3@(48) if ( _Heap_Is_prev_used( block ) ) { 46f16: c2aa 0004 andl %a2@(4),%d1 46f1a: 6700 0082 beqw 46f9e <_Heap_Block_allocate+0xfe> } block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; new_block->prev_size = block_size; new_block->size_and_flag = new_block_size; 46f1e: 78fe moveq #-2,%d4 _Heap_Free_list_insert_after( free_list_anchor, block ); free_list_anchor = block; /* Statistics */ ++stats->free_blocks; 46f20: 52ab 0038 addql #1,%a3@(56) 46f24: 220a movel %a2,%d1 RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after( Heap_Block *block_before, Heap_Block *new_block ) { Heap_Block *next = block_before->next; 46f26: 2869 0008 moveal %a1@(8),%a4 } block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; new_block->prev_size = block_size; new_block->size_and_flag = new_block_size; 46f2a: c684 andl %d4,%d3 block = prev_block; block_begin = (uintptr_t) block; block_size += prev_block_size; } block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; 46f2c: 7801 moveq #1,%d4 46f2e: 8880 orl %d0,%d4 new_block->next = next; 46f30: 254c 0008 movel %a4,%a2@(8) new_block->prev_size = block_size; new_block->size_and_flag = new_block_size; 46f34: d483 addl %d3,%d2 46f36: 9488 subl %a0,%d2 new_block->prev = block_before; 46f38: 2549 000c movel %a1,%a2@(12) block = prev_block; block_begin = (uintptr_t) block; block_size += prev_block_size; } block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; 46f3c: 2544 0004 movel %d4,%a2@(4) block_before->next = new_block; 46f40: 234a 0008 movel %a2,%a1@(8) next->prev = new_block; 46f44: 294a 000c movel %a2,%a4@(12) new_block->prev_size = block_size; new_block->size_and_flag = new_block_size; _Heap_Block_split( heap, new_block, free_list_anchor, alloc_size ); 46f48: 2448 moveal %a0,%a2 block_size += prev_block_size; } block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; new_block->prev_size = block_size; 46f4a: 2080 movel %d0,%a0@ new_block->size_and_flag = new_block_size; 46f4c: 2142 0004 movel %d2,%a0@(4) _Heap_Block_split( heap, new_block, free_list_anchor, alloc_size ); 46f50: 2f05 movel %d5,%sp@- 46f52: 2f01 movel %d1,%sp@- 46f54: 2f08 movel %a0,%sp@- 46f56: 2f0b movel %a3,%sp@- 46f58: 4eb9 0004 6dac jsr 46dac <_Heap_Block_split> 46f5e: 4fef 0010 lea %sp@(16),%sp alloc_size ); } /* Statistics */ if ( stats->min_free_size > stats->free_size ) { 46f62: 202b 0030 movel %a3@(48),%d0 Heap_Block *block, uintptr_t alloc_begin, uintptr_t alloc_size ) { Heap_Statistics *const stats = &heap->stats; 46f66: b0ab 0034 cmpl %a3@(52),%d0 46f6a: 6404 bccs 46f70 <_Heap_Block_allocate+0xd0> ); } /* Statistics */ if ( stats->min_free_size > stats->free_size ) { stats->min_free_size = stats->free_size; 46f6c: 2740 0034 movel %d0,%a3@(52) } return block; } 46f70: 200a movel %a2,%d0 46f72: 4cee 3c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a5 46f78: 4e5e unlk %fp 46f7a: 4e75 rts stats->free_size -= _Heap_Block_size( block ); } else { free_list_anchor = _Heap_Free_list_head( heap ); } if ( alloc_area_offset < heap->page_size ) { 46f7c: 202b 0010 movel %a3@(16),%d0 /* Statistics */ --stats->free_blocks; ++stats->used_blocks; stats->free_size -= _Heap_Block_size( block ); } else { free_list_anchor = _Heap_Free_list_head( heap ); 46f80: 224b moveal %a3,%a1 } if ( alloc_area_offset < heap->page_size ) { 46f82: b08c cmpl %a4,%d0 46f84: 6300 ff7c blsw 46f02 <_Heap_Block_allocate+0x62> Heap_Block *block, Heap_Block *free_list_anchor, uintptr_t alloc_size ) { _Heap_Block_split( heap, block, free_list_anchor, alloc_size ); 46f88: 4874 5800 pea %a4@(00000000,%d5:l) 46f8c: 2f09 movel %a1,%sp@- 46f8e: 2f0a movel %a2,%sp@- 46f90: 2f0b movel %a3,%sp@- 46f92: 4eb9 0004 6dac jsr 46dac <_Heap_Block_split> 46f98: 4fef 0010 lea %sp@(16),%sp 46f9c: 60c4 bras 46f62 <_Heap_Block_allocate+0xc2> <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Prev_block( const Heap_Block *block ) { return (Heap_Block *) ((uintptr_t) block - block->prev_size); 46f9e: 95d2 subal %a2@,%a2 Heap_Block *const prev_block = _Heap_Prev_block( block ); uintptr_t const prev_block_size = _Heap_Block_size( prev_block ); block = prev_block; block_begin = (uintptr_t) block; block_size += prev_block_size; 46fa0: 78fe moveq #-2,%d4 46fa2: 2209 movel %a1,%d1 46fa4: c8aa 0004 andl %a2@(4),%d4 46fa8: d084 addl %d4,%d0 } block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; new_block->prev_size = block_size; new_block->size_and_flag = new_block_size; 46faa: 78fe moveq #-2,%d4 46fac: c684 andl %d4,%d3 block = prev_block; block_begin = (uintptr_t) block; block_size += prev_block_size; } block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; 46fae: 7801 moveq #1,%d4 46fb0: 8880 orl %d0,%d4 new_block->prev_size = block_size; new_block->size_and_flag = new_block_size; 46fb2: d483 addl %d3,%d2 46fb4: 9488 subl %a0,%d2 block = prev_block; block_begin = (uintptr_t) block; block_size += prev_block_size; } block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; 46fb6: 2544 0004 movel %d4,%a2@(4) new_block->prev_size = block_size; new_block->size_and_flag = new_block_size; _Heap_Block_split( heap, new_block, free_list_anchor, alloc_size ); 46fba: 2448 moveal %a0,%a2 block_size += prev_block_size; } block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; new_block->prev_size = block_size; 46fbc: 2080 movel %d0,%a0@ new_block->size_and_flag = new_block_size; 46fbe: 2142 0004 movel %d2,%a0@(4) _Heap_Block_split( heap, new_block, free_list_anchor, alloc_size ); 46fc2: 2f05 movel %d5,%sp@- 46fc4: 2f01 movel %d1,%sp@- 46fc6: 2f08 movel %a0,%sp@- 46fc8: 2f0b movel %a3,%sp@- 46fca: 4eb9 0004 6dac jsr 46dac <_Heap_Block_split> 46fd0: 4fef 0010 lea %sp@(16),%sp 46fd4: 608c bras 46f62 <_Heap_Block_allocate+0xc2> <== ALWAYS TAKEN ... 00046dac <_Heap_Block_split>: Heap_Control *heap, Heap_Block *block, Heap_Block *free_list_anchor, uintptr_t alloc_size ) { 46dac: 4e56 ffe4 linkw %fp,#-28 46db0: 226e 0008 moveal %fp@(8),%a1 46db4: 48d7 1c3c moveml %d2-%d5/%a2-%a4,%sp@ 46db8: 246e 000c moveal %fp@(12),%a2 - 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; 46dbc: 76fe moveq #-2,%d3 46dbe: 282a 0004 movel %a2@(4),%d4 Heap_Statistics *const stats = &heap->stats; uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; 46dc2: 2669 0014 moveal %a1@(20),%a3 uintptr_t const min_alloc_size = min_block_size - HEAP_BLOCK_HEADER_SIZE; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const used_size = _Heap_Max( alloc_size, min_alloc_size ) + HEAP_BLOCK_HEADER_SIZE; 46dc6: 220b movel %a3,%d1 46dc8: 5181 subql #8,%d1 Heap_Control *heap, Heap_Block *block, Heap_Block *free_list_anchor, uintptr_t alloc_size ) { 46dca: 286e 0010 moveal %fp@(16),%a4 Heap_Statistics *const stats = &heap->stats; uintptr_t const page_size = heap->page_size; 46dce: 2429 0010 movel %a1@(16),%d2 uintptr_t const min_alloc_size = min_block_size - HEAP_BLOCK_HEADER_SIZE; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const used_size = _Heap_Max( alloc_size, min_alloc_size ) + HEAP_BLOCK_HEADER_SIZE; 46dd2: 202e 0014 movel %fp@(20),%d0 46dd6: c684 andl %d4,%d3 46dd8: b280 cmpl %d0,%d1 46dda: 6302 blss 46dde <_Heap_Block_split+0x32> 46ddc: 2001 movel %d1,%d0 46dde: 5080 addql #8,%d0 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up( uintptr_t value, uintptr_t alignment ) { uintptr_t remainder = value % alignment; 46de0: 2a00 movel %d0,%d5 46de2: 4c42 5001 remul %d2,%d1,%d5 if ( remainder != 0 ) { 46de6: 4a81 tstl %d1 46de8: 6664 bnes 46e4e <_Heap_Block_split+0xa2> Heap_Block *next_block = _Heap_Block_at( block, block_size ); _HAssert( used_size <= block_size + HEAP_BLOCK_SIZE_OFFSET ); _HAssert( used_size + free_size == block_size + HEAP_BLOCK_SIZE_OFFSET ); if ( free_size >= free_size_limit ) { 46dea: 2203 movel %d3,%d1 46dec: 5881 addql #4,%d1 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 46dee: 41f2 3800 lea %a2@(00000000,%d3:l),%a0 uintptr_t alignment ) { uintptr_t remainder = value % alignment; if ( remainder != 0 ) { 46df2: 2400 movel %d0,%d2 46df4: 9280 subl %d0,%d1 46df6: 588b addql #4,%a3 46df8: b7c1 cmpal %d1,%a3 46dfa: 6266 bhis 46e62 <_Heap_Block_split+0xb6> uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; block->size_and_flag = size | flag; 46dfc: 7001 moveq #1,%d0 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 46dfe: 47f2 2800 lea %a2@(00000000,%d2:l),%a3 Heap_Block *const free_block = _Heap_Block_at( block, used_block_size ); uintptr_t free_block_size = block_size - used_block_size; 46e02: 9682 subl %d2,%d3 _Heap_Block_set_size( block, used_block_size ); /* Statistics */ stats->free_size += free_block_size; if ( _Heap_Is_used( next_block ) ) { 46e04: 7201 moveq #1,%d1 uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; block->size_and_flag = size | flag; 46e06: c880 andl %d0,%d4 - 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; 46e08: 70fe moveq #-2,%d0 uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; block->size_and_flag = size | flag; 46e0a: 8484 orl %d4,%d2 46e0c: 2542 0004 movel %d2,%a2@(4) _HAssert( used_block_size + free_block_size == block_size ); _Heap_Block_set_size( block, used_block_size ); /* Statistics */ stats->free_size += free_block_size; 46e10: d7a9 0030 addl %d3,%a1@(48) - 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; 46e14: c0a8 0004 andl %a0@(4),%d0 if ( _Heap_Is_used( next_block ) ) { 46e18: c2b0 0804 andl %a0@(00000004,%d0:l),%d1 46e1c: 6752 beqs 46e70 <_Heap_Block_split+0xc4> free_block_size += next_block_size; next_block = _Heap_Block_at( free_block, free_block_size ); } free_block->size_and_flag = free_block_size | HEAP_PREV_BLOCK_USED; 46e1e: 7001 moveq #1,%d0 if ( _Heap_Is_used( next_block ) ) { _Heap_Free_list_insert_after( free_list_anchor, free_block ); /* Statistics */ ++stats->free_blocks; 46e20: 52a9 0038 addql #1,%a1@(56) RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after( Heap_Block *block_before, Heap_Block *new_block ) { Heap_Block *next = block_before->next; 46e24: 246c 0008 moveal %a4@(8),%a2 free_block_size += next_block_size; next_block = _Heap_Block_at( free_block, free_block_size ); } free_block->size_and_flag = free_block_size | HEAP_PREV_BLOCK_USED; 46e28: 8083 orl %d3,%d0 new_block->next = next; 46e2a: 274a 0008 movel %a2,%a3@(8) 46e2e: 2740 0004 movel %d0,%a3@(4) next_block->prev_size = free_block_size; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 46e32: 70fe moveq #-2,%d0 new_block->prev = block_before; 46e34: 274c 000c movel %a4,%a3@(12) 46e38: c1a8 0004 andl %d0,%a0@(4) block_before->next = new_block; 46e3c: 294b 0008 movel %a3,%a4@(8) next->prev = new_block; 46e40: 254b 000c movel %a3,%a2@(12) next_block = _Heap_Block_at( free_block, free_block_size ); } free_block->size_and_flag = free_block_size | HEAP_PREV_BLOCK_USED; next_block->prev_size = free_block_size; 46e44: 2083 movel %d3,%a0@ next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; } else { next_block->size_and_flag |= HEAP_PREV_BLOCK_USED; } } 46e46: 4cd7 1c3c moveml %sp@,%d2-%d5/%a2-%a4 46e4a: 4e5e unlk %fp 46e4c: 4e75 rts ) { uintptr_t remainder = value % alignment; if ( remainder != 0 ) { return value - remainder + alignment; 46e4e: d480 addl %d0,%d2 46e50: 9481 subl %d1,%d2 Heap_Block *next_block = _Heap_Block_at( block, block_size ); _HAssert( used_size <= block_size + HEAP_BLOCK_SIZE_OFFSET ); _HAssert( used_size + free_size == block_size + HEAP_BLOCK_SIZE_OFFSET ); if ( free_size >= free_size_limit ) { 46e52: 2203 movel %d3,%d1 46e54: 5881 addql #4,%d1 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 46e56: 41f2 3800 lea %a2@(00000000,%d3:l),%a0 46e5a: 9280 subl %d0,%d1 46e5c: 588b addql #4,%a3 46e5e: b7c1 cmpal %d1,%a3 46e60: 639a blss 46dfc <_Heap_Block_split+0x50> free_block->size_and_flag = free_block_size | HEAP_PREV_BLOCK_USED; next_block->prev_size = free_block_size; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; } else { next_block->size_and_flag |= HEAP_PREV_BLOCK_USED; 46e62: 7001 moveq #1,%d0 } } 46e64: 4cd7 1c3c moveml %sp@,%d2-%d5/%a2-%a4 free_block->size_and_flag = free_block_size | HEAP_PREV_BLOCK_USED; next_block->prev_size = free_block_size; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; } else { next_block->size_and_flag |= HEAP_PREV_BLOCK_USED; 46e68: 81a8 0004 orl %d0,%a0@(4) } } 46e6c: 4e5e unlk %fp 46e6e: 4e75 rts } else { uintptr_t const next_block_size = _Heap_Block_size( next_block ); _Heap_Free_list_replace( next_block, free_block ); free_block_size += next_block_size; 46e70: d680 addl %d0,%d3 next_block = _Heap_Block_at( free_block, free_block_size ); } free_block->size_and_flag = free_block_size | HEAP_PREV_BLOCK_USED; 46e72: 7001 moveq #1,%d0 Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; Heap_Block *prev = old_block->prev; 46e74: 2468 000c moveal %a0@(12),%a2 RTEMS_INLINE_ROUTINE void _Heap_Free_list_replace( Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; 46e78: 2268 0008 moveal %a0@(8),%a1 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 46e7c: 41f3 3800 lea %a3@(00000000,%d3:l),%a0 46e80: 8083 orl %d3,%d0 ) { Heap_Block *next = old_block->next; Heap_Block *prev = old_block->prev; new_block->next = next; 46e82: 2749 0008 movel %a1,%a3@(8) new_block->prev = prev; 46e86: 274a 000c movel %a2,%a3@(12) 46e8a: 2740 0004 movel %d0,%a3@(4) next_block->prev_size = free_block_size; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 46e8e: 70fe moveq #-2,%d0 next->prev = new_block; prev->next = new_block; 46e90: 254b 0008 movel %a3,%a2@(8) 46e94: c1a8 0004 andl %d0,%a0@(4) Heap_Block *prev = old_block->prev; new_block->next = next; new_block->prev = prev; next->prev = new_block; 46e98: 234b 000c movel %a3,%a1@(12) next_block = _Heap_Block_at( free_block, free_block_size ); } free_block->size_and_flag = free_block_size | HEAP_PREV_BLOCK_USED; next_block->prev_size = free_block_size; 46e9c: 2083 movel %d3,%a0@ 46e9e: 60a6 bras 46e46 <_Heap_Block_split+0x9a> <== ALWAYS TAKEN 00050e3c <_Heap_Extend>: Heap_Control *heap, void *area_begin_ptr, uintptr_t area_size, uintptr_t *amount_extended ) { 50e3c: 4e56 fff4 linkw %fp,#-12 50e40: 206e 0008 moveal %fp@(8),%a0 50e44: 202e 000c movel %fp@(12),%d0 Heap_Statistics *const stats = &heap->stats; uintptr_t const area_begin = (uintptr_t) area_begin_ptr; uintptr_t const heap_area_begin = heap->area_begin; uintptr_t const heap_area_end = heap->area_end; 50e48: 2228 001c movel %a0@(28),%d1 uintptr_t const new_heap_area_end = heap_area_end + area_size; uintptr_t extend_size = 0; Heap_Block *const last_block = heap->last_block; 50e4c: 2268 0024 moveal %a0@(36),%a1 Heap_Control *heap, void *area_begin_ptr, uintptr_t area_size, uintptr_t *amount_extended ) { 50e50: 48d7 040c moveml %d2-%d3/%a2,%sp@ Heap_Statistics *const stats = &heap->stats; uintptr_t const area_begin = (uintptr_t) area_begin_ptr; uintptr_t const heap_area_begin = heap->area_begin; 50e54: b0a8 0018 cmpl %a0@(24),%d0 50e58: 6410 bccs 50e6a <_Heap_Extend+0x2e> * As noted, this code only supports (4). */ if ( area_begin >= heap_area_begin && area_begin < heap_area_end ) { return HEAP_EXTEND_ERROR; /* case 3 */ } else if ( area_begin != heap_area_end ) { 50e5a: b280 cmpl %d0,%d1 50e5c: 671c beqs 50e7a <_Heap_Extend+0x3e> 50e5e: 7002 moveq #2,%d0 _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( last_block )); } return HEAP_EXTEND_SUCCESSFUL; } 50e60: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 50e66: 4e5e unlk %fp 50e68: 4e75 rts * 5. non-contiguous higher address (NOT SUPPORTED) * * As noted, this code only supports (4). */ if ( area_begin >= heap_area_begin && area_begin < heap_area_end ) { 50e6a: b280 cmpl %d0,%d1 50e6c: 63ec blss 50e5a <_Heap_Extend+0x1e> 50e6e: 7001 moveq #1,%d0 _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( last_block )); } return HEAP_EXTEND_SUCCESSFUL; } 50e70: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 50e76: 4e5e unlk %fp 50e78: 4e75 rts { Heap_Statistics *const stats = &heap->stats; uintptr_t const area_begin = (uintptr_t) area_begin_ptr; uintptr_t const heap_area_begin = heap->area_begin; uintptr_t const heap_area_end = heap->area_end; uintptr_t const new_heap_area_end = heap_area_end + area_size; 50e7a: 2200 movel %d0,%d1 50e7c: d2ae 0010 addl %fp@(16),%d1 * block and free it. */ heap->area_end = new_heap_area_end; extend_size = new_heap_area_end 50e80: 70f8 moveq #-8,%d0 50e82: 9089 subl %a1,%d0 50e84: d081 addl %d1,%d0 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 50e86: 2600 movel %d0,%d3 50e88: 4c68 3002 0010 remul %a0@(16),%d2,%d3 * Currently only case 4 should make it to this point. * The basic trick is to make the extend area look like a used * block and free it. */ heap->area_end = new_heap_area_end; 50e8e: 2141 001c movel %d1,%a0@(28) extend_size = new_heap_area_end - (uintptr_t) last_block - HEAP_BLOCK_HEADER_SIZE; extend_size = _Heap_Align_down( extend_size, heap->page_size ); *amount_extended = extend_size; 50e92: 246e 0014 moveal %fp@(20),%a2 50e96: 9082 subl %d2,%d0 50e98: 2480 movel %d0,%a2@ if( extend_size >= heap->min_block_size ) { 50e9a: b0a8 0014 cmpl %a0@(20),%d0 50e9e: 640c bccs 50eac <_Heap_Extend+0x70> <== NEVER TAKEN /* Statistics */ stats->size += extend_size; ++stats->used_blocks; --stats->frees; /* Do not count subsequent call as actual free() */ _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( last_block )); 50ea0: 4280 clrl %d0 <== NOT EXECUTED } return HEAP_EXTEND_SUCCESSFUL; } 50ea2: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 50ea8: 4e5e unlk %fp 50eaa: 4e75 rts uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; block->size_and_flag = size | flag; 50eac: 7401 moveq #1,%d2 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 50eae: 45f1 0800 lea %a1@(00000000,%d0:l),%a2 uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; block->size_and_flag = size | flag; 50eb2: c4a9 0004 andl %a1@(4),%d2 if( extend_size >= heap->min_block_size ) { Heap_Block *const new_last_block = _Heap_Block_at( last_block, extend_size ); _Heap_Block_set_size( last_block, extend_size ); new_last_block->size_and_flag = 50eb6: 2228 0020 movel %a0@(32),%d1 50eba: 928a subl %a2,%d1 50ebc: 8480 orl %d0,%d2 ((uintptr_t) heap->first_block - (uintptr_t) new_last_block) | HEAP_PREV_BLOCK_USED; heap->last_block = new_last_block; 50ebe: 214a 0024 movel %a2,%a0@(36) 50ec2: 2342 0004 movel %d2,%a1@(4) if( extend_size >= heap->min_block_size ) { Heap_Block *const new_last_block = _Heap_Block_at( last_block, extend_size ); _Heap_Block_set_size( last_block, extend_size ); new_last_block->size_and_flag = 50ec6: 7401 moveq #1,%d2 50ec8: 8481 orl %d1,%d2 50eca: 2542 0004 movel %d2,%a2@(4) /* Statistics */ stats->size += extend_size; ++stats->used_blocks; --stats->frees; /* Do not count subsequent call as actual free() */ _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( last_block )); 50ece: 4869 0008 pea %a1@(8) | HEAP_PREV_BLOCK_USED; heap->last_block = new_last_block; /* Statistics */ stats->size += extend_size; 50ed2: d1a8 002c addl %d0,%a0@(44) ++stats->used_blocks; 50ed6: 52a8 0040 addql #1,%a0@(64) --stats->frees; /* Do not count subsequent call as actual free() */ 50eda: 53a8 0050 subql #1,%a0@(80) _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( last_block )); 50ede: 2f08 movel %a0,%sp@- 50ee0: 4eb9 0004 b584 jsr 4b584 <_Heap_Free> 50ee6: 508f addql #8,%sp 50ee8: 4280 clrl %d0 50eea: 60b6 bras 50ea2 <_Heap_Extend+0x66> <== ALWAYS TAKEN 0004bf3c <_Heap_Free>: #include #include #include bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { 4bf3c: 4e56 ffe4 linkw %fp,#-28 4bf40: 202e 000c movel %fp@(12),%d0 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_of_alloc_area( uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) 4bf44: 2040 moveal %d0,%a0 4bf46: 5188 subql #8,%a0 4bf48: 226e 0008 moveal %fp@(8),%a1 4bf4c: 4c69 0001 0010 remul %a1@(16),%d1,%d0 4bf52: 48d7 0c7c moveml %d2-%d6/%a2-%a3,%sp@ const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 4bf56: 2029 0020 movel %a1@(32),%d0 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_of_alloc_area( uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) 4bf5a: 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 4bf5c: b088 cmpl %a0,%d0 4bf5e: 6200 00a0 bhiw 4c000 <_Heap_Free+0xc4> && (uintptr_t) block <= (uintptr_t) heap->last_block; 4bf62: 2229 0024 movel %a1@(36),%d1 RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap( const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block 4bf66: b288 cmpl %a0,%d1 4bf68: 6500 0096 bcsw 4c000 <_Heap_Free+0xc4> - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 4bf6c: 2628 0004 movel %a0@(4),%d3 4bf70: 74fe moveq #-2,%d2 4bf72: 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); 4bf74: 45f0 2800 lea %a0@(00000000,%d2:l),%a2 RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap( const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block 4bf78: b5c0 cmpal %d0,%a2 4bf7a: 6500 0084 bcsw 4c000 <_Heap_Free+0xc4> <== ALWAYS TAKEN 4bf7e: b5c1 cmpal %d1,%a2 4bf80: 627e bhis 4c000 <_Heap_Free+0xc4> <== ALWAYS 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; 4bf82: 282a 0004 movel %a2@(4),%d4 if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { _HAssert( false ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 4bf86: 7a01 moveq #1,%d5 4bf88: ca84 andl %d4,%d5 4bf8a: 4a05 tstb %d5 4bf8c: 6772 beqs 4c000 <_Heap_Free+0xc4> <== ALWAYS 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; 4bf8e: 7afe moveq #-2,%d5 4bf90: c885 andl %d5,%d4 _HAssert( false ); return false; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block 4bf92: b5c1 cmpal %d1,%a2 4bf94: 6700 00fa beqw 4c090 <_Heap_Free+0x154> #include #include #include bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) 4bf98: 7a01 moveq #1,%d5 4bf9a: 7c01 moveq #1,%d6 4bf9c: cab2 4804 andl %a2@(00000004,%d4:l),%d5 4bfa0: bd85 eorl %d6,%d5 next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); if ( !_Heap_Is_prev_used( block ) ) { 4bfa2: 7c01 moveq #1,%d6 4bfa4: c686 andl %d6,%d3 4bfa6: 4a03 tstb %d3 4bfa8: 6660 bnes 4c00a <_Heap_Free+0xce> uintptr_t const prev_size = block->prev_size; 4bfaa: 2610 movel %a0@,%d3 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4bfac: 91c3 subal %d3,%a0 RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap( const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block 4bfae: b1c0 cmpal %d0,%a0 4bfb0: 654e bcss 4c000 <_Heap_Free+0xc4> <== ALWAYS TAKEN 4bfb2: b1c1 cmpal %d1,%a0 4bfb4: 624a bhis 4c000 <_Heap_Free+0xc4> <== ALWAYS TAKEN 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) ) { 4bfb6: 7001 moveq #1,%d0 4bfb8: c0a8 0004 andl %a0@(4),%d0 4bfbc: 4a00 tstb %d0 4bfbe: 6740 beqs 4c000 <_Heap_Free+0xc4> <== ALWAYS TAKEN _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ 4bfc0: 4a05 tstb %d5 4bfc2: 6700 00d2 beqw 4c096 <_Heap_Free+0x15a> } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; Heap_Block *prev = block->prev; 4bfc6: 266a 000c moveal %a2@(12),%a3 uintptr_t const size = block_size + prev_size + next_block_size; _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 4bfca: 53a9 0038 subql #1,%a1@(56) _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ uintptr_t const size = block_size + prev_size + next_block_size; 4bfce: d882 addl %d2,%d4 4bfd0: d684 addl %d4,%d3 _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4bfd2: 7001 moveq #1,%d0 return _Heap_Free_list_tail(heap)->prev; } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; 4bfd4: 246a 0008 moveal %a2@(8),%a2 4bfd8: 8083 orl %d3,%d0 next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; 4bfda: 2183 3800 movel %d3,%a0@(00000000,%d3:l) if ( next_is_free ) { /* coalesce both */ uintptr_t const size = block_size + prev_size + next_block_size; _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4bfde: 2140 0004 movel %d0,%a0@(4) Heap_Block *prev = block->prev; prev->next = next; next->prev = prev; 4bfe2: 254b 000c movel %a3,%a2@(12) RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; Heap_Block *prev = block->prev; prev->next = next; 4bfe6: 274a 0008 movel %a2,%a3@(8) } /* Statistics */ --stats->used_blocks; ++stats->frees; stats->free_size += block_size; 4bfea: d5a9 0030 addl %d2,%a1@(48) stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 4bfee: 53a9 0040 subql #1,%a1@(64) ++stats->frees; 4bff2: 52a9 0050 addql #1,%a1@(80) stats->free_size += block_size; 4bff6: 7001 moveq #1,%d0 return( true ); } 4bff8: 4cd7 0c7c moveml %sp@,%d2-%d6/%a2-%a3 4bffc: 4e5e unlk %fp 4bffe: 4e75 rts 4c000: 4cd7 0c7c moveml %sp@,%d2-%d6/%a2-%a3 /* Statistics */ --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); 4c004: 4200 clrb %d0 } 4c006: 4e5e unlk %fp 4c008: 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 */ 4c00a: 4a05 tstb %d5 4c00c: 6736 beqs 4c044 <_Heap_Free+0x108> Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; Heap_Block *prev = old_block->prev; 4c00e: 266a 000c moveal %a2@(12),%a3 uintptr_t const size = block_size + next_block_size; 4c012: d882 addl %d2,%d4 _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4c014: 7001 moveq #1,%d0 RTEMS_INLINE_ROUTINE void _Heap_Free_list_replace( Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; 4c016: 246a 0008 moveal %a2@(8),%a2 4c01a: 8084 orl %d4,%d0 next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; 4c01c: 2184 4800 movel %d4,%a0@(00000000,%d4:l) Heap_Block *prev = old_block->prev; new_block->next = next; new_block->prev = prev; 4c020: 214b 000c movel %a3,%a0@(12) ) { Heap_Block *next = old_block->next; Heap_Block *prev = old_block->prev; new_block->next = next; 4c024: 214a 0008 movel %a2,%a0@(8) next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ uintptr_t const size = block_size + next_block_size; _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4c028: 2140 0004 movel %d0,%a0@(4) } /* Statistics */ --stats->used_blocks; ++stats->frees; stats->free_size += block_size; 4c02c: d5a9 0030 addl %d2,%a1@(48) stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 4c030: 53a9 0040 subql #1,%a1@(64) ++stats->frees; 4c034: 52a9 0050 addql #1,%a1@(80) stats->free_size += block_size; 4c038: 7001 moveq #1,%d0 new_block->prev = prev; next->prev = new_block; 4c03a: 2548 000c movel %a0,%a2@(12) prev->next = new_block; 4c03e: 2748 0008 movel %a0,%a3@(8) 4c042: 60b4 bras 4bff8 <_Heap_Free+0xbc> <== ALWAYS TAKEN 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; 4c044: 7a01 moveq #1,%d5 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4c046: 7cfe moveq #-2,%d6 next_block->prev_size = size; } else { /* no coalesce */ /* Add 'block' to the head of the free blocks list as it tends to produce less fragmentation than adding to the tail. */ _Heap_Free_list_insert_after( _Heap_Free_list_head( heap), block ); block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; 4c048: 8a82 orl %d2,%d5 RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after( Heap_Block *block_before, Heap_Block *new_block ) { Heap_Block *next = block_before->next; 4c04a: 2669 0008 moveal %a1@(8),%a3 4c04e: 2145 0004 movel %d5,%a0@(4) next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4c052: cdaa 0004 andl %d6,%a2@(4) next_block->prev_size = block_size; 4c056: 2482 movel %d2,%a2@ /* Statistics */ ++stats->free_blocks; 4c058: 2029 0038 movel %a1@(56),%d0 4c05c: 5280 addql #1,%d0 new_block->next = next; 4c05e: 214b 0008 movel %a3,%a0@(8) new_block->prev = block_before; 4c062: 2149 000c movel %a1,%a0@(12) block_before->next = new_block; 4c066: 2348 0008 movel %a0,%a1@(8) next->prev = new_block; 4c06a: 2748 000c movel %a0,%a3@(12) 4c06e: 2340 0038 movel %d0,%a1@(56) #include #include bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { Heap_Statistics *const stats = &heap->stats; 4c072: b0a9 003c cmpl %a1@(60),%d0 4c076: 6300 ff72 blsw 4bfea <_Heap_Free+0xae> } /* Statistics */ --stats->used_blocks; ++stats->frees; stats->free_size += block_size; 4c07a: d5a9 0030 addl %d2,%a1@(48) stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 4c07e: 53a9 0040 subql #1,%a1@(64) ++stats->frees; 4c082: 52a9 0050 addql #1,%a1@(80) next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; if ( stats->max_free_blocks < stats->free_blocks ) { stats->max_free_blocks = stats->free_blocks; 4c086: 2340 003c movel %d0,%a1@(60) } /* Statistics */ --stats->used_blocks; ++stats->frees; stats->free_size += block_size; 4c08a: 7001 moveq #1,%d0 4c08c: 6000 ff6a braw 4bff8 <_Heap_Free+0xbc> <== ALWAYS TAKEN _HAssert( false ); return false; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block 4c090: 4205 clrb %d5 4c092: 6000 ff0e braw 4bfa2 <_Heap_Free+0x66> <== ALWAYS TAKEN 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; 4c096: d682 addl %d2,%d3 prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4c098: 7a01 moveq #1,%d5 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4c09a: 7cfe moveq #-2,%d6 next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; } else { /* coalesce prev */ uintptr_t const size = block_size + prev_size; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4c09c: 8a83 orl %d3,%d5 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = size; 4c09e: 2483 movel %d3,%a2@ } /* Statistics */ --stats->used_blocks; ++stats->frees; stats->free_size += block_size; 4c0a0: 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; 4c0a2: 2145 0004 movel %d5,%a0@(4) next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4c0a6: cdaa 0004 andl %d6,%a2@(4) } /* Statistics */ --stats->used_blocks; ++stats->frees; stats->free_size += block_size; 4c0aa: d5a9 0030 addl %d2,%a1@(48) stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 4c0ae: 53a9 0040 subql #1,%a1@(64) ++stats->frees; 4c0b2: 52a9 0050 addql #1,%a1@(80) 4c0b6: 6000 ff40 braw 4bff8 <_Heap_Free+0xbc> <== ALWAYS TAKEN ... 0006b1e8 <_Heap_Get_free_information>: void _Heap_Get_free_information( Heap_Control *the_heap, Heap_Information *info ) { 6b1e8: 4e56 fff0 linkw %fp,#-16 6b1ec: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ 6b1f0: 246e 0008 moveal %fp@(8),%a2 6b1f4: 266e 000c moveal %fp@(12),%a3 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 6b1f8: 206a 0008 moveal %a2@(8),%a0 Heap_Block *the_block; Heap_Block *const tail = _Heap_Free_list_tail(the_heap); info->number = 0; 6b1fc: 4293 clrl %a3@ info->largest = 0; 6b1fe: 42ab 0004 clrl %a3@(4) info->total = 0; 6b202: 42ab 0008 clrl %a3@(8) for(the_block = _Heap_Free_list_first(the_heap); 6b206: b1ca cmpal %a2,%a0 6b208: 672a beqs 6b234 <_Heap_Get_free_information+0x4c> <== ALWAYS TAKEN 6b20a: 4282 clrl %d2 6b20c: 7201 moveq #1,%d1 6b20e: 93c9 subal %a1,%a1 - 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; 6b210: 70fe moveq #-2,%d0 the_block != tail; the_block = the_block->next) 6b212: 2601 movel %d1,%d3 6b214: 5281 addql #1,%d1 6b216: c0a8 0004 andl %a0@(4),%d0 /* As we always coalesce free blocks, prev block must have been used. */ _HAssert(_Heap_Is_prev_used(the_block)); info->number++; info->total += the_size; 6b21a: d3c0 addal %d0,%a1 6b21c: b082 cmpl %d2,%d0 6b21e: 6302 blss 6b222 <_Heap_Get_free_information+0x3a> 6b220: 2400 movel %d0,%d2 info->largest = 0; info->total = 0; for(the_block = _Heap_Free_list_first(the_heap); the_block != tail; the_block = the_block->next) 6b222: 2068 0008 moveal %a0@(8),%a0 info->number = 0; info->largest = 0; info->total = 0; for(the_block = _Heap_Free_list_first(the_heap); 6b226: b1ca cmpal %a2,%a0 6b228: 66e6 bnes 6b210 <_Heap_Get_free_information+0x28> 6b22a: 2742 0004 movel %d2,%a3@(4) 6b22e: 2683 movel %d3,%a3@ 6b230: 2749 0008 movel %a1,%a3@(8) info->number++; info->total += the_size; if ( info->largest < the_size ) info->largest = the_size; } } 6b234: 4cd7 0c0c moveml %sp@,%d2-%d3/%a2-%a3 6b238: 4e5e unlk %fp 6b23a: 4e75 rts 0007c1b4 <_Heap_Get_information>: void _Heap_Get_information( Heap_Control *the_heap, Heap_Information_block *the_info ) { 7c1b4: 4e56 fff4 linkw %fp,#-12 7c1b8: 206e 0008 moveal %fp@(8),%a0 7c1bc: 48d7 040c moveml %d2-%d3/%a2,%sp@ 7c1c0: 246e 000c moveal %fp@(12),%a2 Heap_Block *the_block = the_heap->first_block; Heap_Block *const end = the_heap->last_block; 7c1c4: 2428 0024 movel %a0@(36),%d2 void _Heap_Get_information( Heap_Control *the_heap, Heap_Information_block *the_info ) { Heap_Block *the_block = the_heap->first_block; 7c1c8: 2268 0020 moveal %a0@(32),%a1 Heap_Block *const end = the_heap->last_block; _HAssert(the_block->prev_size == the_heap->page_size); _HAssert(_Heap_Is_prev_used(the_block)); the_info->Free.number = 0; 7c1cc: 4292 clrl %a2@ the_info->Free.total = 0; 7c1ce: 42aa 0008 clrl %a2@(8) the_info->Free.largest = 0; 7c1d2: 42aa 0004 clrl %a2@(4) the_info->Used.number = 0; 7c1d6: 42aa 000c clrl %a2@(12) the_info->Used.total = 0; 7c1da: 42aa 0014 clrl %a2@(20) the_info->Used.largest = 0; 7c1de: 42aa 0010 clrl %a2@(16) while ( the_block != end ) { 7c1e2: b489 cmpl %a1,%d2 7c1e4: 6746 beqs 7c22c <_Heap_Get_information+0x78> <== ALWAYS 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; 7c1e6: 260a movel %a2,%d3 7c1e8: 0683 0000 000c addil #12,%d3 the_info->Free.largest = 0; the_info->Used.number = 0; the_info->Used.total = 0; the_info->Used.largest = 0; while ( the_block != end ) { 7c1ee: 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; 7c1f2: 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) ) 7c1f4: 204a moveal %a2,%a0 7c1f6: 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); 7c1f8: d3c0 addal %d0,%a1 block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 7c1fa: 2229 0004 movel %a1@(4),%d1 7c1fe: 0801 0000 btst #0,%d1 7c202: 6702 beqs 7c206 <_Heap_Get_information+0x52> 7c204: 2043 moveal %d3,%a0 info = &the_info->Used; else info = &the_info->Free; info->number++; 7c206: 5290 addql #1,%a0@ info->total += the_size; 7c208: d1a8 0008 addl %d0,%a0@(8) if ( info->largest < the_size ) 7c20c: b0a8 0004 cmpl %a0@(4),%d0 7c210: 6304 blss 7c216 <_Heap_Get_information+0x62> info->largest = the_size; 7c212: 2140 0004 movel %d0,%a0@(4) the_info->Free.largest = 0; the_info->Used.number = 0; the_info->Used.total = 0; the_info->Used.largest = 0; while ( the_block != end ) { 7c216: b3c2 cmpal %d2,%a1 7c218: 66d8 bnes 7c1f2 <_Heap_Get_information+0x3e> 7c21a: 202a 0014 movel %a2@(20),%d0 7c21e: 5080 addql #8,%d0 /* * Handle the last dummy block. Don't consider this block to be * "used" as client never allocated it. Make 'Used.total' contain this * blocks' overhead though. */ the_info->Used.total += HEAP_BLOCK_HEADER_SIZE; 7c220: 2540 0014 movel %d0,%a2@(20) } 7c224: 4cd7 040c moveml %sp@,%d2-%d3/%a2 7c228: 4e5e unlk %fp 7c22a: 4e75 rts the_info->Free.largest = 0; the_info->Used.number = 0; the_info->Used.total = 0; the_info->Used.largest = 0; while ( the_block != end ) { 7c22c: 7008 moveq #8,%d0 <== NOT EXECUTED /* * Handle the last dummy block. Don't consider this block to be * "used" as client never allocated it. Make 'Used.total' contain this * blocks' overhead though. */ the_info->Used.total += HEAP_BLOCK_HEADER_SIZE; 7c22e: 2540 0014 movel %d0,%a2@(20) <== NOT EXECUTED } 7c232: 4cd7 040c moveml %sp@,%d2-%d3/%a2 <== NOT EXECUTED 7c236: 4e5e unlk %fp <== NOT EXECUTED 7c238: 4e75 rts <== NOT EXECUTED ... 00046c6c <_Heap_Initialize>: Heap_Control *heap, void *heap_area_begin_ptr, uintptr_t heap_area_size, uintptr_t page_size ) { 46c6c: 4e56 ffe8 linkw %fp,#-24 46c70: 206e 0008 moveal %fp@(8),%a0 46c74: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@ 46c78: 226e 000c moveal %fp@(12),%a1 46c7c: 242e 0010 movel %fp@(16),%d2 46c80: 222e 0014 movel %fp@(20),%d1 uintptr_t min_block_size = 0; uintptr_t overhead = 0; Heap_Block *first_block = NULL; Heap_Block *last_block = NULL; if ( page_size == 0 ) { 46c84: 6600 00ce bnew 46d54 <_Heap_Initialize+0xe8> ) { Heap_Statistics *const stats = &heap->stats; uintptr_t const heap_area_begin = (uintptr_t) heap_area_begin_ptr; uintptr_t const heap_area_end = heap_area_begin + heap_area_size; uintptr_t alloc_area_begin = heap_area_begin + HEAP_BLOCK_HEADER_SIZE; 46c88: 2009 movel %a1,%d0 46c8a: 5080 addql #8,%d0 uintptr_t min_block_size = 0; uintptr_t overhead = 0; Heap_Block *first_block = NULL; Heap_Block *last_block = NULL; if ( page_size == 0 ) { 46c8c: 123c 0004 moveb #4,%d1 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up( uintptr_t value, uintptr_t alignment ) { uintptr_t remainder = value % alignment; 46c90: 2a00 movel %d0,%d5 46c92: 7610 moveq #16,%d3 46c94: 4c41 5004 remul %d1,%d4,%d5 if ( remainder != 0 ) { 46c98: 4a84 tstl %d4 46c9a: 6704 beqs 46ca0 <_Heap_Initialize+0x34> <== NEVER TAKEN return value - remainder + alignment; 46c9c: d081 addl %d1,%d0 46c9e: 9084 subl %d4,%d0 uintptr_t page_size ) { Heap_Statistics *const stats = &heap->stats; uintptr_t const heap_area_begin = (uintptr_t) heap_area_begin_ptr; uintptr_t const heap_area_end = heap_area_begin + heap_area_size; 46ca0: 2809 movel %a1,%d4 46ca2: d882 addl %d2,%d4 overhead = HEAP_BLOCK_HEADER_SIZE + (first_block_begin - heap_area_begin); first_block_size = heap_area_size - overhead; first_block_size = _Heap_Align_down ( first_block_size, page_size ); alloc_area_size = first_block_size - HEAP_BLOCK_HEADER_SIZE; if ( 46ca4: b889 cmpl %a1,%d4 46ca6: 6500 00bc bcsw 46d64 <_Heap_Initialize+0xf8> } min_block_size = _Heap_Align_up( sizeof( Heap_Block ), page_size ); alloc_area_begin = _Heap_Align_up( alloc_area_begin, page_size ); first_block_begin = alloc_area_begin - HEAP_BLOCK_HEADER_SIZE; overhead = HEAP_BLOCK_HEADER_SIZE + (first_block_begin - heap_area_begin); 46caa: 2a00 movel %d0,%d5 46cac: 2440 moveal %d0,%a2 46cae: 9a89 subl %a1,%d5 46cb0: 518a subql #8,%a2 first_block_size = heap_area_size - overhead; first_block_size = _Heap_Align_down ( first_block_size, page_size ); alloc_area_size = first_block_size - HEAP_BLOCK_HEADER_SIZE; if ( 46cb2: ba82 cmpl %d2,%d5 46cb4: 6400 00ae bccw 46d64 <_Heap_Initialize+0xf8> min_block_size = _Heap_Align_up( sizeof( Heap_Block ), page_size ); alloc_area_begin = _Heap_Align_up( alloc_area_begin, page_size ); first_block_begin = alloc_area_begin - HEAP_BLOCK_HEADER_SIZE; overhead = HEAP_BLOCK_HEADER_SIZE + (first_block_begin - heap_area_begin); first_block_size = heap_area_size - overhead; 46cb8: 9485 subl %d5,%d2 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 46cba: 2a02 movel %d2,%d5 46cbc: 4c41 5000 remul %d1,%d0,%d5 46cc0: 9480 subl %d0,%d2 first_block_size = _Heap_Align_down ( first_block_size, page_size ); alloc_area_size = first_block_size - HEAP_BLOCK_HEADER_SIZE; if ( 46cc2: b483 cmpl %d3,%d2 46cc4: 6500 009e bcsw 46d64 <_Heap_Initialize+0xf8> } /* First block */ first_block = (Heap_Block *) first_block_begin; first_block->prev_size = page_size; first_block->size_and_flag = first_block_size | HEAP_PREV_BLOCK_USED; 46cc8: 7a01 moveq #1,%d5 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 46cca: 47f2 2800 lea %a2@(00000000,%d2:l),%a3 alloc_area_begin = _Heap_Align_up( alloc_area_begin, page_size ); first_block_begin = alloc_area_begin - HEAP_BLOCK_HEADER_SIZE; overhead = HEAP_BLOCK_HEADER_SIZE + (first_block_begin - heap_area_begin); first_block_size = heap_area_size - overhead; first_block_size = _Heap_Align_down ( first_block_size, page_size ); alloc_area_size = first_block_size - HEAP_BLOCK_HEADER_SIZE; 46cce: 2002 movel %d2,%d0 46cd0: 5180 subql #8,%d0 } /* First block */ first_block = (Heap_Block *) first_block_begin; first_block->prev_size = page_size; first_block->size_and_flag = first_block_size | HEAP_PREV_BLOCK_USED; 46cd2: 8a82 orl %d2,%d5 return 0; } /* First block */ first_block = (Heap_Block *) first_block_begin; first_block->prev_size = page_size; 46cd4: 2481 movel %d1,%a2@ first_block->size_and_flag = first_block_size | HEAP_PREV_BLOCK_USED; 46cd6: 2545 0004 movel %d5,%a2@(4) * last block appears as used for the _Heap_Is_used() and _Heap_Is_free() * functions. */ last_block = _Heap_Block_at( first_block, first_block_size ); last_block->prev_size = first_block_size; last_block->size_and_flag = first_block_begin - (uintptr_t) last_block; 46cda: 2a0a movel %a2,%d5 46cdc: 9a8b subl %a3,%d5 46cde: 2745 0004 movel %d5,%a3@(4) stats->max_search = 0; stats->allocs = 0; stats->searches = 0; stats->frees = 0; stats->resizes = 0; stats->instance = instance++; 46ce2: 2a39 0005 e8f4 movel 5e8f4 ,%d5 * block indicates that the previous block is used, this ensures that the * last block appears as used for the _Heap_Is_used() and _Heap_Is_free() * functions. */ last_block = _Heap_Block_at( first_block, first_block_size ); last_block->prev_size = first_block_size; 46ce8: 2682 movel %d2,%a3@ last_block->size_and_flag = first_block_begin - (uintptr_t) last_block; /* Heap control */ heap->page_size = page_size; 46cea: 2141 0010 movel %d1,%a0@(16) /* Statistics */ stats->size = first_block_size; stats->free_size = first_block_size; stats->min_free_size = first_block_size; stats->free_blocks = 1; 46cee: 7201 moveq #1,%d1 /* First block */ first_block = (Heap_Block *) first_block_begin; first_block->prev_size = page_size; first_block->size_and_flag = first_block_size | HEAP_PREV_BLOCK_USED; first_block->next = _Heap_Free_list_tail( heap ); 46cf0: 2548 0008 movel %a0,%a2@(8) first_block->prev = _Heap_Free_list_head( heap ); 46cf4: 2548 000c movel %a0,%a2@(12) last_block->prev_size = first_block_size; last_block->size_and_flag = first_block_begin - (uintptr_t) last_block; /* Heap control */ heap->page_size = page_size; heap->min_block_size = min_block_size; 46cf8: 2143 0014 movel %d3,%a0@(20) heap->area_begin = heap_area_begin; heap->area_end = heap_area_end; 46cfc: 2144 001c movel %d4,%a0@(28) _Heap_Free_list_tail( heap )->prev = first_block; /* Statistics */ stats->size = first_block_size; stats->free_size = first_block_size; stats->min_free_size = first_block_size; 46d00: 2142 0034 movel %d2,%a0@(52) stats->max_search = 0; stats->allocs = 0; stats->searches = 0; stats->frees = 0; stats->resizes = 0; stats->instance = instance++; 46d04: 2145 0028 movel %d5,%a0@(40) 46d08: 5285 addql #1,%d5 heap->last_block = last_block; _Heap_Free_list_head( heap )->next = first_block; _Heap_Free_list_tail( heap )->prev = first_block; /* Statistics */ stats->size = first_block_size; 46d0a: 2142 002c movel %d2,%a0@(44) stats->free_size = first_block_size; 46d0e: 2142 0030 movel %d2,%a0@(48) last_block->size_and_flag = first_block_begin - (uintptr_t) last_block; /* Heap control */ heap->page_size = page_size; heap->min_block_size = min_block_size; heap->area_begin = heap_area_begin; 46d12: 2149 0018 movel %a1,%a0@(24) /* Statistics */ stats->size = first_block_size; stats->free_size = first_block_size; stats->min_free_size = first_block_size; stats->free_blocks = 1; 46d16: 2141 0038 movel %d1,%a0@(56) stats->max_free_blocks = 1; 46d1a: 2141 003c movel %d1,%a0@(60) stats->used_blocks = 0; 46d1e: 42a8 0040 clrl %a0@(64) stats->max_search = 0; 46d22: 42a8 0044 clrl %a0@(68) stats->allocs = 0; 46d26: 42a8 0048 clrl %a0@(72) stats->searches = 0; 46d2a: 42a8 004c clrl %a0@(76) stats->frees = 0; 46d2e: 42a8 0050 clrl %a0@(80) stats->resizes = 0; 46d32: 42a8 0054 clrl %a0@(84) heap->page_size = page_size; heap->min_block_size = min_block_size; heap->area_begin = heap_area_begin; heap->area_end = heap_area_end; heap->first_block = first_block; heap->last_block = last_block; 46d36: 214b 0024 movel %a3,%a0@(36) stats->max_search = 0; stats->allocs = 0; stats->searches = 0; stats->frees = 0; stats->resizes = 0; stats->instance = instance++; 46d3a: 23c5 0005 e8f4 movel %d5,5e8f4 heap->area_begin = heap_area_begin; heap->area_end = heap_area_end; heap->first_block = first_block; heap->last_block = last_block; _Heap_Free_list_head( heap )->next = first_block; _Heap_Free_list_tail( heap )->prev = first_block; 46d40: 214a 000c movel %a2,%a0@(12) /* Heap control */ heap->page_size = page_size; heap->min_block_size = min_block_size; heap->area_begin = heap_area_begin; heap->area_end = heap_area_end; heap->first_block = first_block; 46d44: 214a 0020 movel %a2,%a0@(32) heap->last_block = last_block; _Heap_Free_list_head( heap )->next = first_block; 46d48: 214a 0008 movel %a2,%a0@(8) _HAssert( _Heap_Is_aligned( _Heap_Alloc_area_of_block( last_block ), page_size ) ); return alloc_area_size; } 46d4c: 4cd7 0c3c moveml %sp@,%d2-%d5/%a2-%a3 46d50: 4e5e unlk %fp 46d52: 4e75 rts RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up( uintptr_t value, uintptr_t alignment ) { uintptr_t remainder = value % alignment; 46d54: 7003 moveq #3,%d0 46d56: c081 andl %d1,%d0 if ( remainder != 0 ) { 46d58: 6704 beqs 46d5e <_Heap_Initialize+0xf2> return value - remainder + alignment; 46d5a: 5881 addql #4,%d1 46d5c: 9280 subl %d0,%d1 if ( page_size == 0 ) { page_size = CPU_ALIGNMENT; } else { page_size = _Heap_Align_up( page_size, CPU_ALIGNMENT ); if ( page_size < CPU_ALIGNMENT ) { 46d5e: 7003 moveq #3,%d0 46d60: b081 cmpl %d1,%d0 46d62: 650a bcss 46d6e <_Heap_Initialize+0x102> ); _HAssert( _Heap_Is_aligned( _Heap_Alloc_area_of_block( last_block ), page_size ) ); return alloc_area_size; 46d64: 4280 clrl %d0 } 46d66: 4cd7 0c3c moveml %sp@,%d2-%d5/%a2-%a3 46d6a: 4e5e unlk %fp 46d6c: 4e75 rts RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up( uintptr_t value, uintptr_t alignment ) { uintptr_t remainder = value % alignment; 46d6e: 7610 moveq #16,%d3 46d70: 4c41 3000 remul %d1,%d0,%d3 if ( remainder != 0 ) { 46d74: 4a80 tstl %d0 46d76: 671e beqs 46d96 <_Heap_Initialize+0x12a> return value - remainder + alignment; 46d78: 2601 movel %d1,%d3 46d7a: 0683 0000 0010 addil #16,%d3 46d80: 9680 subl %d0,%d3 ) { Heap_Statistics *const stats = &heap->stats; uintptr_t const heap_area_begin = (uintptr_t) heap_area_begin_ptr; uintptr_t const heap_area_end = heap_area_begin + heap_area_size; uintptr_t alloc_area_begin = heap_area_begin + HEAP_BLOCK_HEADER_SIZE; 46d82: 2009 movel %a1,%d0 46d84: 5080 addql #8,%d0 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up( uintptr_t value, uintptr_t alignment ) { uintptr_t remainder = value % alignment; 46d86: 2a00 movel %d0,%d5 46d88: 4c41 5004 remul %d1,%d4,%d5 if ( remainder != 0 ) { 46d8c: 4a84 tstl %d4 46d8e: 6700 ff10 beqw 46ca0 <_Heap_Initialize+0x34> 46d92: 6000 ff08 braw 46c9c <_Heap_Initialize+0x30> <== ALWAYS TAKEN 46d96: 2009 movel %a1,%d0 46d98: 5080 addql #8,%d0 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up( uintptr_t value, uintptr_t alignment ) { uintptr_t remainder = value % alignment; 46d9a: 2a00 movel %d0,%d5 if ( remainder != 0 ) { 46d9c: 7610 moveq #16,%d3 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up( uintptr_t value, uintptr_t alignment ) { uintptr_t remainder = value % alignment; 46d9e: 4c41 5004 remul %d1,%d4,%d5 if ( remainder != 0 ) { 46da2: 4a84 tstl %d4 46da4: 6700 fefa beqw 46ca0 <_Heap_Initialize+0x34> 46da8: 6000 fef2 braw 46c9c <_Heap_Initialize+0x30> <== ALWAYS TAKEN 0005bd20 <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { 5bd20: 4e56 0000 linkw %fp,#0 5bd24: 202e 000c movel %fp@(12),%d0 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_of_alloc_area( uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) 5bd28: 2040 moveal %d0,%a0 5bd2a: 5188 subql #8,%a0 5bd2c: 226e 0008 moveal %fp@(8),%a1 5bd30: 2f02 movel %d2,%sp@- 5bd32: 2400 movel %d0,%d2 5bd34: 4c69 2001 0010 remul %a1@(16),%d1,%d2 5bd3a: 91c1 subal %d1,%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; 5bd3c: 2229 0020 movel %a1@(32),%d1 RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap( const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block 5bd40: b288 cmpl %a0,%d1 5bd42: 6238 bhis 5bd7c <_Heap_Size_of_alloc_area+0x5c> <== ALWAYS TAKEN && (uintptr_t) block <= (uintptr_t) heap->last_block; 5bd44: 2269 0024 moveal %a1@(36),%a1 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 5bd48: b3c8 cmpal %a0,%a1 5bd4a: 6530 bcss 5bd7c <_Heap_Size_of_alloc_area+0x5c> <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 5bd4c: 74fe moveq #-2,%d2 5bd4e: c4a8 0004 andl %a0@(4),%d2 5bd52: d1c2 addal %d2,%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 5bd54: b1c1 cmpal %d1,%a0 5bd56: 6524 bcss 5bd7c <_Heap_Size_of_alloc_area+0x5c> <== ALWAYS TAKEN 5bd58: b1c9 cmpal %a1,%a0 5bd5a: 6220 bhis 5bd7c <_Heap_Size_of_alloc_area+0x5c> <== ALWAYS TAKEN } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( 5bd5c: 7201 moveq #1,%d1 5bd5e: c2a8 0004 andl %a0@(4),%d1 5bd62: 4a01 tstb %d1 5bd64: 6716 beqs 5bd7c <_Heap_Size_of_alloc_area+0x5c> <== ALWAYS TAKEN || !_Heap_Is_prev_used( next_block ) ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_BLOCK_SIZE_OFFSET - alloc_begin; 5bd66: 7204 moveq #4,%d1 5bd68: 9280 subl %d0,%d1 5bd6a: 2001 movel %d1,%d0 5bd6c: d088 addl %a0,%d0 5bd6e: 226e 0010 moveal %fp@(16),%a1 return true; } 5bd72: 241f movel %sp@+,%d2 5bd74: 4e5e unlk %fp || !_Heap_Is_prev_used( next_block ) ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_BLOCK_SIZE_OFFSET - alloc_begin; 5bd76: 2280 movel %d0,%a1@ 5bd78: 7001 moveq #1,%d0 return true; } 5bd7a: 4e75 rts 5bd7c: 241f movel %sp@+,%d2 5bd7e: 4e5e unlk %fp return false; } *alloc_size = (uintptr_t) next_block + HEAP_BLOCK_SIZE_OFFSET - alloc_begin; return true; 5bd80: 4200 clrb %d0 } 5bd82: 4e75 rts 000479c8 <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 479c8: 4e56 ffc8 linkw %fp,#-56 479cc: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 479d0: 246e 0008 moveal %fp@(8),%a2 uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; Heap_Block *const last_block = heap->last_block; Heap_Block *block = heap->first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 479d4: 4bfa 0496 lea %pc@(47e6c <_Heap_Walk_print>),%a5 bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 479d8: 242e 000c movel %fp@(12),%d2 uintptr_t const page_size = heap->page_size; 479dc: 262a 0010 movel %a2@(16),%d3 uintptr_t const min_block_size = heap->min_block_size; 479e0: 282a 0014 movel %a2@(20),%d4 Heap_Block *const last_block = heap->last_block; 479e4: 2a2a 0024 movel %a2@(36),%d5 Heap_Block *block = heap->first_block; 479e8: 266a 0020 moveal %a2@(32),%a3 Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 479ec: 4a2e 0013 tstb %fp@(19) 479f0: 6604 bnes 479f6 <_Heap_Walk+0x2e> 479f2: 4bfa ffcc lea %pc@(479c0 <_Heap_Walk_print_nothing>),%a5 if ( !_System_state_Is_up( _System_state_Get() ) ) { 479f6: 7003 moveq #3,%d0 479f8: b0b9 0006 17d4 cmpl 617d4 <_System_state_Current>,%d0 479fe: 670c beqs 47a0c <_Heap_Walk+0x44> block = next_block; } return true; } 47a00: 4cee 3cfc ffc8 moveml %fp@(-56),%d2-%d7/%a2-%a5 if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; } while ( block != last_block ) { 47a06: 7001 moveq #1,%d0 block = next_block; } return true; } 47a08: 4e5e unlk %fp 47a0a: 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)( 47a0c: 2f2a 000c movel %a2@(12),%sp@- 47a10: 2f2a 0008 movel %a2@(8),%sp@- 47a14: 2f05 movel %d5,%sp@- 47a16: 2f0b movel %a3,%sp@- 47a18: 2f2a 001c movel %a2@(28),%sp@- 47a1c: 2f2a 0018 movel %a2@(24),%sp@- 47a20: 2f04 movel %d4,%sp@- 47a22: 2f03 movel %d3,%sp@- 47a24: 4879 0005 d964 pea 5d964 <_Status_Object_name_errors_to_status+0x14> 47a2a: 42a7 clrl %sp@- 47a2c: 2f02 movel %d2,%sp@- 47a2e: 4e95 jsr %a5@ heap->area_begin, heap->area_end, first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { 47a30: 4fef 002c lea %sp@(44),%sp 47a34: 4a83 tstl %d3 47a36: 6700 0154 beqw 47b8c <_Heap_Walk+0x1c4> (*printer)( source, true, "page size is zero\n" ); return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 47a3a: 7003 moveq #3,%d0 47a3c: c083 andl %d3,%d0 47a3e: 6600 016a bnew 47baa <_Heap_Walk+0x1e2> ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 47a42: 2204 movel %d4,%d1 47a44: 4c43 1000 remul %d3,%d0,%d1 47a48: 4a80 tstl %d0 47a4a: 6600 0176 bnew 47bc2 <_Heap_Walk+0x1fa> ); return false; } if ( 47a4e: 200b movel %a3,%d0 47a50: 5080 addql #8,%d0 47a52: 4c43 0001 remul %d3,%d1,%d0 47a56: 4a81 tstl %d1 47a58: 6600 0180 bnew 47bda <_Heap_Walk+0x212> 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; 47a5c: 2c2b 0004 movel %a3@(4),%d6 ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 47a60: 7201 moveq #1,%d1 47a62: c286 andl %d6,%d1 47a64: 2d46 fff0 movel %d6,%fp@(-16) 47a68: 4a01 tstb %d1 47a6a: 6700 0186 beqw 47bf2 <_Heap_Walk+0x22a> ); return false; } if ( first_block->prev_size != page_size ) { 47a6e: 2053 moveal %a3@,%a0 47a70: b1c3 cmpal %d3,%a0 47a72: 6600 00de bnew 47b52 <_Heap_Walk+0x18a> ); return false; } if ( _Heap_Is_free( last_block ) ) { 47a76: 2045 moveal %d5,%a0 47a78: 7cfe moveq #-2,%d6 47a7a: 7001 moveq #1,%d0 47a7c: cca8 0004 andl %a0@(4),%d6 47a80: c0b0 6804 andl %a0@(00000004,%d6:l),%d0 47a84: 4a00 tstb %d0 47a86: 6700 0180 beqw 47c08 <_Heap_Walk+0x240> <== ALWAYS TAKEN int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 47a8a: 2c2a 0010 movel %a2@(16),%d6 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 47a8e: 206a 0008 moveal %a2@(8),%a0 47a92: 2d46 fffc movel %d6,%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 ) { 47a96: b1ca cmpal %a2,%a0 47a98: 6700 0192 beqw 47c2c <_Heap_Walk+0x264> <== ALWAYS TAKEN 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; 47a9c: 2e2a 0020 movel %a2@(32),%d7 47aa0: 2d47 fff4 movel %d7,%fp@(-12) 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 47aa4: b1c7 cmpal %d7,%a0 47aa6: 6500 00c4 bcsw 47b6c <_Heap_Walk+0x1a4> <== ALWAYS TAKEN && (uintptr_t) block <= (uintptr_t) heap->last_block; 47aaa: 286a 0024 moveal %a2@(36),%a4 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 47aae: b1cc cmpal %a4,%a0 47ab0: 6200 00ba bhiw 47b6c <_Heap_Walk+0x1a4> <== ALWAYS TAKEN ); return false; } if ( 47ab4: 2248 moveal %a0,%a1 47ab6: 5089 addql #8,%a1 47ab8: 2009 movel %a1,%d0 47aba: 4c46 0007 remul %d6,%d7,%d0 47abe: 2d49 fff8 movel %a1,%fp@(-8) 47ac2: 4a87 tstl %d7 47ac4: 6600 0372 bnew 47e38 <_Heap_Walk+0x470> <== ALWAYS TAKEN ); return false; } if ( _Heap_Is_used( free_block ) ) { 47ac8: 7efe moveq #-2,%d7 47aca: 7001 moveq #1,%d0 47acc: cea8 0004 andl %a0@(4),%d7 47ad0: c0b0 7804 andl %a0@(00000004,%d7:l),%d0 47ad4: 6600 037c bnew 47e52 <_Heap_Walk+0x48a> <== ALWAYS TAKEN ); return false; } if ( free_block->prev != prev_block ) { 47ad8: 2e28 000c movel %a0@(12),%d7 47adc: be8a cmpl %a2,%d7 47ade: 6650 bnes 47b30 <_Heap_Walk+0x168> <== ALWAYS TAKEN 47ae0: 202e fff0 movel %fp@(-16),%d0 47ae4: 2241 moveal %d1,%a1 47ae6: 2c2e fff4 movel %fp@(-12),%d6 47aea: 2d40 fff8 movel %d0,%fp@(-8) 47aee: 2d43 fff4 movel %d3,%fp@(-12) (*printer)( 47af2: 2008 movel %a0,%d0 return false; } prev_block = free_block; free_block = free_block->next; 47af4: 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 ) { 47af8: b1ca cmpal %a2,%a0 47afa: 6700 0122 beqw 47c1e <_Heap_Walk+0x256> 47afe: bc88 cmpl %a0,%d6 47b00: 626a bhis 47b6c <_Heap_Walk+0x1a4> ); return false; } if ( 47b02: 2e08 movel %a0,%d7 47b04: 5087 addql #8,%d7 47b06: b1cc cmpal %a4,%a0 47b08: 6262 bhis 47b6c <_Heap_Walk+0x1a4> <== ALWAYS TAKEN 47b0a: 262e fffc movel %fp@(-4),%d3 47b0e: 4c43 7001 remul %d3,%d1,%d7 47b12: 4a81 tstl %d1 47b14: 6600 0322 bnew 47e38 <_Heap_Walk+0x470> <== ALWAYS TAKEN ); return false; } if ( _Heap_Is_used( free_block ) ) { 47b18: 72fe moveq #-2,%d1 47b1a: 7e01 moveq #1,%d7 47b1c: c2a8 0004 andl %a0@(4),%d1 47b20: ceb0 1804 andl %a0@(00000004,%d1:l),%d7 47b24: 6600 032c bnew 47e52 <_Heap_Walk+0x48a> <== ALWAYS TAKEN ); return false; } if ( free_block->prev != prev_block ) { 47b28: 2e28 000c movel %a0@(12),%d7 47b2c: b087 cmpl %d7,%d0 47b2e: 67c2 beqs 47af2 <_Heap_Walk+0x12a> (*printer)( 47b30: 2f07 movel %d7,%sp@- 47b32: 2f08 movel %a0,%sp@- 47b34: 4879 0005 db55 pea 5db55 <_Status_Object_name_errors_to_status+0x205> return false; } if ( next_block_begin <= block_begin ) { (*printer)( 47b3a: 4878 0001 pea 1 47b3e: 2f02 movel %d2,%sp@- 47b40: 4e95 jsr %a5@ "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 47b42: 4fef 0014 lea %sp@(20),%sp return false; } if ( next_block_begin <= block_begin ) { (*printer)( 47b46: 4200 clrb %d0 block = next_block; } return true; } 47b48: 4cee 3cfc ffc8 moveml %fp@(-56),%d2-%d7/%a2-%a5 47b4e: 4e5e unlk %fp 47b50: 4e75 rts return false; } if ( first_block->prev_size != page_size ) { (*printer)( 47b52: 2f03 movel %d3,%sp@- 47b54: 2f08 movel %a0,%sp@- 47b56: 4879 0005 daa9 pea 5daa9 <_Status_Object_name_errors_to_status+0x159> return false; } if ( next_block_begin <= block_begin ) { (*printer)( 47b5c: 4878 0001 pea 1 47b60: 2f02 movel %d2,%sp@- 47b62: 4e95 jsr %a5@ "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 47b64: 4fef 0014 lea %sp@(20),%sp return false; } if ( next_block_begin <= block_begin ) { (*printer)( 47b68: 4200 clrb %d0 47b6a: 60dc bras 47b48 <_Heap_Walk+0x180> <== ALWAYS TAKEN 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)( 47b6c: 2f08 movel %a0,%sp@- 47b6e: 4879 0005 dae9 pea 5dae9 <_Status_Object_name_errors_to_status+0x199> return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 47b74: 4878 0001 pea 1 47b78: 2f02 movel %d2,%sp@- 47b7a: 4e95 jsr %a5@ 47b7c: 4fef 0010 lea %sp@(16),%sp 47b80: 4200 clrb %d0 block = next_block; } return true; } 47b82: 4cee 3cfc ffc8 moveml %fp@(-56),%d2-%d7/%a2-%a5 47b88: 4e5e unlk %fp 47b8a: 4e75 rts first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { (*printer)( source, true, "page size is zero\n" ); 47b8c: 4879 0005 d9f5 pea 5d9f5 <_Status_Object_name_errors_to_status+0xa5> return false; } if ( !_Heap_Is_prev_used( first_block ) ) { (*printer)( 47b92: 4878 0001 pea 1 47b96: 2f02 movel %d2,%sp@- 47b98: 4e95 jsr %a5@ 47b9a: 4fef 000c lea %sp@(12),%sp 47b9e: 4200 clrb %d0 block = next_block; } return true; } 47ba0: 4cee 3cfc ffc8 moveml %fp@(-56),%d2-%d7/%a2-%a5 47ba6: 4e5e unlk %fp 47ba8: 4e75 rts return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { (*printer)( 47baa: 2f03 movel %d3,%sp@- 47bac: 4879 0005 da08 pea 5da08 <_Status_Object_name_errors_to_status+0xb8> return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 47bb2: 4878 0001 pea 1 47bb6: 2f02 movel %d2,%sp@- 47bb8: 4e95 jsr %a5@ 47bba: 4fef 0010 lea %sp@(16),%sp 47bbe: 4200 clrb %d0 47bc0: 60c0 bras 47b82 <_Heap_Walk+0x1ba> <== ALWAYS TAKEN return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { (*printer)( 47bc2: 2f04 movel %d4,%sp@- 47bc4: 4879 0005 da26 pea 5da26 <_Status_Object_name_errors_to_status+0xd6> return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 47bca: 4878 0001 pea 1 47bce: 2f02 movel %d2,%sp@- 47bd0: 4e95 jsr %a5@ 47bd2: 4fef 0010 lea %sp@(16),%sp 47bd6: 4200 clrb %d0 47bd8: 60a8 bras 47b82 <_Heap_Walk+0x1ba> <== ALWAYS TAKEN } if ( !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 47bda: 2f0b movel %a3,%sp@- 47bdc: 4879 0005 da4a pea 5da4a <_Status_Object_name_errors_to_status+0xfa> return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 47be2: 4878 0001 pea 1 47be6: 2f02 movel %d2,%sp@- 47be8: 4e95 jsr %a5@ 47bea: 4fef 0010 lea %sp@(16),%sp 47bee: 4200 clrb %d0 47bf0: 6090 bras 47b82 <_Heap_Walk+0x1ba> <== ALWAYS TAKEN return false; } if ( !_Heap_Is_prev_used( first_block ) ) { (*printer)( 47bf2: 4879 0005 da7b pea 5da7b <_Status_Object_name_errors_to_status+0x12b> 47bf8: 4878 0001 pea 1 47bfc: 2f02 movel %d2,%sp@- 47bfe: 4e95 jsr %a5@ 47c00: 4fef 000c lea %sp@(12),%sp 47c04: 4200 clrb %d0 47c06: 6098 bras 47ba0 <_Heap_Walk+0x1d8> return false; } if ( _Heap_Is_free( last_block ) ) { (*printer)( 47c08: 4879 0005 dad4 pea 5dad4 <_Status_Object_name_errors_to_status+0x184> return false; } if ( !_Heap_Is_prev_used( first_block ) ) { (*printer)( 47c0e: 4878 0001 pea 1 47c12: 2f02 movel %d2,%sp@- 47c14: 4e95 jsr %a5@ 47c16: 4fef 000c lea %sp@(12),%sp 47c1a: 4200 clrb %d0 47c1c: 6082 bras 47ba0 <_Heap_Walk+0x1d8> 47c1e: 262e fff8 movel %fp@(-8),%d3 47c22: 2209 movel %a1,%d1 47c24: 2d43 fff0 movel %d3,%fp@(-16) 47c28: 262e fff4 movel %fp@(-12),%d3 if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; } while ( block != last_block ) { 47c2c: b7c5 cmpal %d5,%a3 47c2e: 6700 fdd0 beqw 47a00 <_Heap_Walk+0x38> <== ALWAYS TAKEN 47c32: 2c2e fff0 movel %fp@(-16),%d6 - 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; 47c36: 7efe moveq #-2,%d7 47c38: cc87 andl %d7,%d6 47c3a: 2d43 fff8 movel %d3,%fp@(-8) RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 47c3e: 49f3 6800 lea %a3@(00000000,%d6:l),%a4 uintptr_t const block_size = _Heap_Block_size( block ); bool const prev_used = _Heap_Is_prev_used( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); uintptr_t const next_block_begin = (uintptr_t) next_block; if ( prev_used ) { 47c42: 4a01 tstb %d1 47c44: 6700 0126 beqw 47d6c <_Heap_Walk+0x3a4> <== ALWAYS TAKEN (*printer)( 47c48: 2f06 movel %d6,%sp@- 47c4a: 2f0b movel %a3,%sp@- 47c4c: 4879 0005 db87 pea 5db87 <_Status_Object_name_errors_to_status+0x237> 47c52: 42a7 clrl %sp@- 47c54: 2f02 movel %d2,%sp@- 47c56: 4e95 jsr %a5@ 47c58: 4fef 0014 lea %sp@(20),%sp RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap( const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block 47c5c: b9ea 0020 cmpal %a2@(32),%a4 47c60: 6500 00d0 bcsw 47d32 <_Heap_Walk+0x36a> <== ALWAYS TAKEN 47c64: b9ea 0024 cmpal %a2@(36),%a4 47c68: 6200 00c8 bhiw 47d32 <_Heap_Walk+0x36a> ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) ) { 47c6c: 262e fff8 movel %fp@(-8),%d3 47c70: 2206 movel %d6,%d1 47c72: 4c43 1000 remul %d3,%d0,%d1 47c76: 4a80 tstl %d0 47c78: 6600 0162 bnew 47ddc <_Heap_Walk+0x414> ); return false; } if ( block_size < min_block_size ) { 47c7c: bc84 cmpl %d4,%d6 47c7e: 6500 0178 bcsw 47df8 <_Heap_Walk+0x430> ); return false; } if ( next_block_begin <= block_begin ) { 47c82: b9cb cmpal %a3,%a4 47c84: 6300 0196 blsw 47e1c <_Heap_Walk+0x454> ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 47c88: 7001 moveq #1,%d0 47c8a: c0ac 0004 andl %a4@(4),%d0 47c8e: 4a00 tstb %d0 47c90: 6600 00bc bnew 47d4e <_Heap_Walk+0x386> 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; 47c94: 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; 47c98: 7cfe moveq #-2,%d6 return _Heap_Free_list_head(heap)->next; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_last( Heap_Control *heap ) { return _Heap_Free_list_tail(heap)->prev; 47c9a: 43f9 0005 dc7d lea 5dc7d <_Status_Object_name_errors_to_status+0x32d>,%a1 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 47ca0: 2e2a 0008 movel %a2@(8),%d7 - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 47ca4: cc83 andl %d3,%d6 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 47ca6: 2d47 fffc movel %d7,%fp@(-4) RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 47caa: 2e0b movel %a3,%d7 47cac: de86 addl %d6,%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)( 47cae: 222b 0008 movel %a3@(8),%d1 return _Heap_Free_list_head(heap)->next; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_last( Heap_Control *heap ) { return _Heap_Free_list_tail(heap)->prev; 47cb2: b2aa 000c cmpl %a2@(12),%d1 47cb6: 6710 beqs 47cc8 <_Heap_Walk+0x300> " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") 47cb8: 43f9 0005 dc87 lea 5dc87 <_Status_Object_name_errors_to_status+0x337>,%a1 47cbe: b5c1 cmpal %d1,%a2 47cc0: 6706 beqs 47cc8 <_Heap_Walk+0x300> 47cc2: 43f9 0005 d8c2 lea 5d8c2 ,%a1 Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 47cc8: 202b 000c movel %a3@(12),%d0 47ccc: 41f9 0005 dc91 lea 5dc91 <_Status_Object_name_errors_to_status+0x341>,%a0 47cd2: b0ae fffc cmpl %fp@(-4),%d0 47cd6: 6710 beqs 47ce8 <_Heap_Walk+0x320> "block 0x%08x: prev 0x%08x%s, next 0x%08x%s\n", block, block->prev, block->prev == first_free_block ? " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), 47cd8: 41f9 0005 dc9c lea 5dc9c <_Status_Object_name_errors_to_status+0x34c>,%a0 47cde: b5c0 cmpal %d0,%a2 47ce0: 6706 beqs 47ce8 <_Heap_Walk+0x320> 47ce2: 41f9 0005 d8c2 lea 5d8c2 ,%a0 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)( 47ce8: 2f09 movel %a1,%sp@- 47cea: 2f01 movel %d1,%sp@- 47cec: 2f08 movel %a0,%sp@- 47cee: 2f00 movel %d0,%sp@- 47cf0: 2f0b movel %a3,%sp@- 47cf2: 4879 0005 dca6 pea 5dca6 <_Status_Object_name_errors_to_status+0x356> 47cf8: 42a7 clrl %sp@- 47cfa: 2f02 movel %d2,%sp@- 47cfc: 4e95 jsr %a5@ block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { 47cfe: 4fef 0020 lea %sp@(32),%sp 47d02: 2047 moveal %d7,%a0 47d04: 2010 movel %a0@,%d0 47d06: b086 cmpl %d6,%d0 47d08: 6700 0082 beqw 47d8c <_Heap_Walk+0x3c4> (*printer)( 47d0c: 2f07 movel %d7,%sp@- 47d0e: 2f00 movel %d0,%sp@- 47d10: 2f06 movel %d6,%sp@- 47d12: 2f0b movel %a3,%sp@- 47d14: 4879 0005 dcd2 pea 5dcd2 <_Status_Object_name_errors_to_status+0x382> 47d1a: 4878 0001 pea 1 47d1e: 2f02 movel %d2,%sp@- 47d20: 4e95 jsr %a5@ 47d22: 4fef 001c lea %sp@(28),%sp block = next_block; } return true; } 47d26: 4cee 3cfc ffc8 moveml %fp@(-56),%d2-%d7/%a2-%a5 " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { (*printer)( 47d2c: 4200 clrb %d0 block = next_block; } return true; } 47d2e: 4e5e unlk %fp 47d30: 4e75 rts block->prev_size ); } if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { (*printer)( 47d32: 2f0c movel %a4,%sp@- 47d34: 2f0b movel %a3,%sp@- 47d36: 4879 0005 dbc3 pea 5dbc3 <_Status_Object_name_errors_to_status+0x273> return false; } if ( next_block_begin <= block_begin ) { (*printer)( 47d3c: 4878 0001 pea 1 47d40: 2f02 movel %d2,%sp@- 47d42: 4e95 jsr %a5@ "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 47d44: 4fef 0014 lea %sp@(20),%sp return false; } if ( next_block_begin <= block_begin ) { (*printer)( 47d48: 4200 clrb %d0 47d4a: 6000 fdfc braw 47b48 <_Heap_Walk+0x180> if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; } while ( block != last_block ) { 47d4e: b9c5 cmpal %d5,%a4 47d50: 6700 fcae beqw 47a00 <_Heap_Walk+0x38> <== ALWAYS TAKEN 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 ) { 47d54: 2c2c 0004 movel %a4@(4),%d6 47d58: 7201 moveq #1,%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; 47d5a: 7efe moveq #-2,%d7 47d5c: 264c moveal %a4,%a3 47d5e: c286 andl %d6,%d1 47d60: cc87 andl %d7,%d6 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 47d62: 49f3 6800 lea %a3@(00000000,%d6:l),%a4 uintptr_t const block_size = _Heap_Block_size( block ); bool const prev_used = _Heap_Is_prev_used( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); uintptr_t const next_block_begin = (uintptr_t) next_block; if ( prev_used ) { 47d66: 4a01 tstb %d1 47d68: 6600 fede bnew 47c48 <_Heap_Walk+0x280> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 47d6c: 2f13 movel %a3@,%sp@- 47d6e: 2f06 movel %d6,%sp@- 47d70: 2f0b movel %a3,%sp@- 47d72: 4879 0005 db9e pea 5db9e <_Status_Object_name_errors_to_status+0x24e> 47d78: 42a7 clrl %sp@- 47d7a: 2f02 movel %d2,%sp@- 47d7c: 4e95 jsr %a5@ 47d7e: 4fef 0018 lea %sp@(24),%sp RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap( const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block 47d82: b9ea 0020 cmpal %a2@(32),%a4 47d86: 65aa bcss 47d32 <_Heap_Walk+0x36a> <== ALWAYS TAKEN 47d88: 6000 feda braw 47c64 <_Heap_Walk+0x29c> <== ALWAYS TAKEN ); return false; } if ( !prev_used ) { 47d8c: 7001 moveq #1,%d0 47d8e: c680 andl %d0,%d3 47d90: 4a03 tstb %d3 47d92: 672e beqs 47dc2 <_Heap_Walk+0x3fa> return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 47d94: 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 ) { 47d98: b5c8 cmpal %a0,%a2 47d9a: 670c beqs 47da8 <_Heap_Walk+0x3e0> <== ALWAYS TAKEN if ( free_block == block ) { 47d9c: b7c8 cmpal %a0,%a3 47d9e: 67ae beqs 47d4e <_Heap_Walk+0x386> return true; } free_block = free_block->next; 47da0: 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 ) { 47da4: b5c8 cmpal %a0,%a2 47da6: 66f4 bnes 47d9c <_Heap_Walk+0x3d4> return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 47da8: 2f0b movel %a3,%sp@- 47daa: 4879 0005 dd3a pea 5dd3a <_Status_Object_name_errors_to_status+0x3ea> 47db0: 4878 0001 pea 1 47db4: 2f02 movel %d2,%sp@- 47db6: 4e95 jsr %a5@ 47db8: 4fef 0010 lea %sp@(16),%sp 47dbc: 4200 clrb %d0 47dbe: 6000 fdc2 braw 47b82 <_Heap_Walk+0x1ba> return false; } if ( !prev_used ) { (*printer)( 47dc2: 2f0b movel %a3,%sp@- 47dc4: 4879 0005 dd0b pea 5dd0b <_Status_Object_name_errors_to_status+0x3bb> return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 47dca: 4878 0001 pea 1 47dce: 2f02 movel %d2,%sp@- 47dd0: 4e95 jsr %a5@ 47dd2: 4fef 0010 lea %sp@(16),%sp 47dd6: 4200 clrb %d0 47dd8: 6000 fda8 braw 47b82 <_Heap_Walk+0x1ba> return false; } if ( !_Heap_Is_aligned( block_size, page_size ) ) { (*printer)( 47ddc: 2f06 movel %d6,%sp@- 47dde: 2f0b movel %a3,%sp@- 47de0: 4879 0005 dbf0 pea 5dbf0 <_Status_Object_name_errors_to_status+0x2a0> return false; } if ( next_block_begin <= block_begin ) { (*printer)( 47de6: 4878 0001 pea 1 47dea: 2f02 movel %d2,%sp@- 47dec: 4e95 jsr %a5@ "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 47dee: 4fef 0014 lea %sp@(20),%sp return false; } if ( next_block_begin <= block_begin ) { (*printer)( 47df2: 4200 clrb %d0 47df4: 6000 fd52 braw 47b48 <_Heap_Walk+0x180> return false; } if ( block_size < min_block_size ) { (*printer)( 47df8: 2f04 movel %d4,%sp@- 47dfa: 2f06 movel %d6,%sp@- 47dfc: 2f0b movel %a3,%sp@- 47dfe: 4879 0005 dc1e pea 5dc1e <_Status_Object_name_errors_to_status+0x2ce> 47e04: 4878 0001 pea 1 47e08: 2f02 movel %d2,%sp@- 47e0a: 4e95 jsr %a5@ block, block_size, min_block_size ); return false; 47e0c: 4fef 0018 lea %sp@(24),%sp block = next_block; } return true; } 47e10: 4cee 3cfc ffc8 moveml %fp@(-56),%d2-%d7/%a2-%a5 return false; } if ( block_size < min_block_size ) { (*printer)( 47e16: 4200 clrb %d0 block = next_block; } return true; } 47e18: 4e5e unlk %fp 47e1a: 4e75 rts return false; } if ( next_block_begin <= block_begin ) { (*printer)( 47e1c: 2f0c movel %a4,%sp@- 47e1e: 2f0b movel %a3,%sp@- 47e20: 4879 0005 dc49 pea 5dc49 <_Status_Object_name_errors_to_status+0x2f9> 47e26: 4878 0001 pea 1 47e2a: 2f02 movel %d2,%sp@- 47e2c: 4e95 jsr %a5@ "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 47e2e: 4fef 0014 lea %sp@(20),%sp return false; } if ( next_block_begin <= block_begin ) { (*printer)( 47e32: 4200 clrb %d0 47e34: 6000 fd12 braw 47b48 <_Heap_Walk+0x180> } if ( !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 47e38: 2f08 movel %a0,%sp@- 47e3a: 4879 0005 db09 pea 5db09 <_Status_Object_name_errors_to_status+0x1b9> return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 47e40: 4878 0001 pea 1 47e44: 2f02 movel %d2,%sp@- 47e46: 4e95 jsr %a5@ 47e48: 4fef 0010 lea %sp@(16),%sp 47e4c: 4200 clrb %d0 47e4e: 6000 fd32 braw 47b82 <_Heap_Walk+0x1ba> return false; } if ( _Heap_Is_used( free_block ) ) { (*printer)( 47e52: 2f08 movel %a0,%sp@- 47e54: 4879 0005 db39 pea 5db39 <_Status_Object_name_errors_to_status+0x1e9> return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 47e5a: 4878 0001 pea 1 47e5e: 2f02 movel %d2,%sp@- 47e60: 4e95 jsr %a5@ 47e62: 4fef 0010 lea %sp@(16),%sp 47e66: 4200 clrb %d0 47e68: 6000 fd18 braw 47b82 <_Heap_Walk+0x1ba> 00046478 <_IO_Initialize_all_drivers>: * * Output Parameters: NONE */ void _IO_Initialize_all_drivers( void ) { 46478: 4e56 0000 linkw %fp,#0 4647c: 2f0a movel %a2,%sp@- 4647e: 2f02 movel %d2,%sp@- rtems_device_major_number major; for ( major=0 ; major < _IO_Number_of_drivers ; major ++ ) 46480: 4ab9 0005 f9b8 tstl 5f9b8 <_IO_Number_of_drivers> 46486: 671e beqs 464a6 <_IO_Initialize_all_drivers+0x2e> <== ALWAYS TAKEN 46488: 4282 clrl %d2 4648a: 45f9 0004 ba24 lea 4ba24 ,%a2 (void) rtems_io_initialize( major, 0, NULL ); 46490: 42a7 clrl %sp@- 46492: 42a7 clrl %sp@- 46494: 2f02 movel %d2,%sp@- void _IO_Initialize_all_drivers( void ) { rtems_device_major_number major; for ( major=0 ; major < _IO_Number_of_drivers ; major ++ ) 46496: 5282 addql #1,%d2 (void) rtems_io_initialize( major, 0, NULL ); 46498: 4e92 jsr %a2@ void _IO_Initialize_all_drivers( void ) { rtems_device_major_number major; for ( major=0 ; major < _IO_Number_of_drivers ; major ++ ) 4649a: 4fef 000c lea %sp@(12),%sp 4649e: b4b9 0005 f9b8 cmpl 5f9b8 <_IO_Number_of_drivers>,%d2 464a4: 65ea bcss 46490 <_IO_Initialize_all_drivers+0x18> (void) rtems_io_initialize( major, 0, NULL ); } 464a6: 242e fff8 movel %fp@(-8),%d2 464aa: 246e fffc moveal %fp@(-4),%a2 464ae: 4e5e unlk %fp 464b0: 4e75 rts 000464b2 <_IO_Manager_initialization>: * workspace. * */ void _IO_Manager_initialization(void) { 464b2: 4e56 fff0 linkw %fp,#-16 464b6: 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; 464ba: 2639 0005 d9d6 movel 5d9d6 ,%d3 drivers_in_table = Configuration.number_of_device_drivers; 464c0: 2439 0005 d9d2 movel 5d9d2 ,%d2 number_of_drivers = Configuration.maximum_drivers; 464c6: 2839 0005 d9ce movel 5d9ce ,%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 ) 464cc: b882 cmpl %d2,%d4 464ce: 6216 bhis 464e6 <_IO_Manager_initialization+0x34> * If the maximum number of driver is the same as the number in the * table, then we do not have to copy the driver table. They can't * register any dynamically. */ if ( number_of_drivers == drivers_in_table ) { _IO_Driver_address_table = driver_table; 464d0: 23c3 0005 f9bc movel %d3,5f9bc <_IO_Driver_address_table> _IO_Number_of_drivers = number_of_drivers; 464d6: 23c2 0005 f9b8 movel %d2,5f9b8 <_IO_Number_of_drivers> ); for ( index = 0 ; index < drivers_in_table ; index++ ) _IO_Driver_address_table[index] = driver_table[index]; number_of_drivers = drivers_in_table; } 464dc: 4cee 003c fff0 moveml %fp@(-16),%d2-%d5 464e2: 4e5e unlk %fp 464e4: 4e75 rts /* * The application requested extra slots in the driver table, so we * have to allocate a new driver table and copy theirs to it. */ _IO_Driver_address_table = (rtems_driver_address_table *) 464e6: 2004 movel %d4,%d0 464e8: 2a04 movel %d4,%d5 464ea: e788 lsll #3,%d0 464ec: eb8d lsll #5,%d5 464ee: 9a80 subl %d0,%d5 464f0: 2f05 movel %d5,%sp@- 464f2: 4eb9 0004 91bc jsr 491bc <_Workspace_Allocate_or_fatal_error> _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; memset( 464f8: 2f05 movel %d5,%sp@- 464fa: 42a7 clrl %sp@- _IO_Driver_address_table = (rtems_driver_address_table *) _Workspace_Allocate_or_fatal_error( sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); _IO_Number_of_drivers = number_of_drivers; 464fc: 23c4 0005 f9b8 movel %d4,5f9b8 <_IO_Number_of_drivers> memset( 46502: 2f00 movel %d0,%sp@- /* * The application requested extra slots in the driver table, so we * have to allocate a new driver table and copy theirs to it. */ _IO_Driver_address_table = (rtems_driver_address_table *) 46504: 23c0 0005 f9bc movel %d0,5f9bc <_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( 4650a: 4eb9 0004 f674 jsr 4f674 _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 46510: 4fef 0010 lea %sp@(16),%sp 46514: 4a82 tstl %d2 46516: 67c4 beqs 464dc <_IO_Manager_initialization+0x2a> <== ALWAYS TAKEN 46518: 2839 0005 f9bc movel 5f9bc <_IO_Driver_address_table>,%d4 4651e: 4280 clrl %d0 46520: 4281 clrl %d1 _IO_Driver_address_table[index] = driver_table[index]; 46522: 2243 moveal %d3,%a1 46524: 2044 moveal %d4,%a0 46526: d3c0 addal %d0,%a1 46528: 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++ ) 4652a: 5281 addql #1,%d1 4652c: 0680 0000 0018 addil #24,%d0 _IO_Driver_address_table[index] = driver_table[index]; 46532: 20d9 movel %a1@+,%a0@+ 46534: 20d9 movel %a1@+,%a0@+ 46536: 20d9 movel %a1@+,%a0@+ 46538: 20d9 movel %a1@+,%a0@+ 4653a: 20d9 movel %a1@+,%a0@+ 4653c: 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++ ) 4653e: b282 cmpl %d2,%d1 46540: 649a bccs 464dc <_IO_Manager_initialization+0x2a> _IO_Driver_address_table[index] = driver_table[index]; 46542: 2243 moveal %d3,%a1 46544: 2044 moveal %d4,%a0 46546: d3c0 addal %d0,%a1 46548: 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++ ) 4654a: 5281 addql #1,%d1 4654c: 0680 0000 0018 addil #24,%d0 _IO_Driver_address_table[index] = driver_table[index]; 46552: 20d9 movel %a1@+,%a0@+ 46554: 20d9 movel %a1@+,%a0@+ 46556: 20d9 movel %a1@+,%a0@+ 46558: 20d9 movel %a1@+,%a0@+ 4655a: 20d9 movel %a1@+,%a0@+ 4655c: 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++ ) 4655e: b282 cmpl %d2,%d1 46560: 65c0 bcss 46522 <_IO_Manager_initialization+0x70> <== ALWAYS TAKEN 46562: 6000 ff78 braw 464dc <_IO_Manager_initialization+0x2a> <== ALWAYS TAKEN ... 00046fd8 <_Internal_error_Occurred>: _Internal_errors_What_happened.the_source = the_source; _Internal_errors_What_happened.is_internal = is_internal; _Internal_errors_What_happened.the_error = the_error; _User_extensions_Fatal( the_source, is_internal, the_error ); 46fd8: 4280 clrl %d0 void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 46fda: 4e56 0000 linkw %fp,#0 46fde: 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 ); 46fe2: 1001 moveb %d1,%d0 46fe4: 2040 moveal %d0,%a0 void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 46fe6: 2f03 movel %d3,%sp@- 46fe8: 202e 0008 movel %fp@(8),%d0 46fec: 2f02 movel %d2,%sp@- 46fee: 242e 0010 movel %fp@(16),%d2 _Internal_errors_What_happened.the_source = the_source; _Internal_errors_What_happened.is_internal = is_internal; _Internal_errors_What_happened.the_error = the_error; _User_extensions_Fatal( the_source, is_internal, the_error ); 46ff2: 2f02 movel %d2,%sp@- Internal_errors_t the_error ) { _Internal_errors_What_happened.the_source = the_source; _Internal_errors_What_happened.is_internal = is_internal; 46ff4: 13c1 0005 f1fe moveb %d1,5f1fe <_Internal_errors_What_happened+0x4> _Internal_errors_What_happened.the_error = the_error; _User_extensions_Fatal( the_source, is_internal, the_error ); 46ffa: 2f08 movel %a0,%sp@- bool is_internal, Internal_errors_t the_error ) { _Internal_errors_What_happened.the_source = the_source; 46ffc: 23c0 0005 f1fa movel %d0,5f1fa <_Internal_errors_What_happened> _Internal_errors_What_happened.is_internal = is_internal; _Internal_errors_What_happened.the_error = the_error; _User_extensions_Fatal( the_source, is_internal, the_error ); 47002: 2f00 movel %d0,%sp@- ) { _Internal_errors_What_happened.the_source = the_source; _Internal_errors_What_happened.is_internal = is_internal; _Internal_errors_What_happened.the_error = the_error; 47004: 23c2 0005 f200 movel %d2,5f200 <_Internal_errors_What_happened+0x6> _User_extensions_Fatal( the_source, is_internal, the_error ); 4700a: 4eb9 0004 8dee jsr 48dee <_User_extensions_Fatal> _System_state_Set( SYSTEM_STATE_FAILED ); _CPU_Fatal_halt( the_error ); 47010: 307c 0700 moveaw #1792,%a0 47014: 2608 movel %a0,%d3 47016: 40c0 movew %sr,%d0 47018: 8083 orl %d3,%d0 4701a: 46c0 movew %d0,%sr 4701c: 2002 movel %d2,%d0 <== NOT EXECUTED 4701e: 223c dead beef movel #-559038737,%d1 <== NOT EXECUTED 47024: 4ac8 halt <== NOT EXECUTED RTEMS_INLINE_ROUTINE void _System_state_Set ( System_state_Codes state ) { _System_state_Current = state; 47026: 7005 moveq #5,%d0 47028: 4fef 000c lea %sp@(12),%sp 4702c: 23c0 0005 f2dc movel %d0,5f2dc <_System_state_Current> 47032: 60fe bras 47032 <_Internal_error_Occurred+0x5a> <== ALWAYS TAKEN 0004709c <_Objects_Allocate>: */ Objects_Control *_Objects_Allocate( Objects_Information *information ) { 4709c: 4e56 fff0 linkw %fp,#-16 470a0: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ 470a4: 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 ) 470a8: 4aaa 0014 tstl %a2@(20) 470ac: 660c bnes 470ba <_Objects_Allocate+0x1e> <== NEVER TAKEN 470ae: 4280 clrl %d0 <== NOT EXECUTED information->inactive--; } } return the_object; } 470b0: 4cee 0c0c fff0 moveml %fp@(-16),%d2-%d3/%a2-%a3 470b6: 4e5e unlk %fp 470b8: 4e75 rts /* * OK. The manager should be initialized and configured to have objects. * With any luck, it is safe to attempt to allocate an object. */ the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 470ba: 240a movel %a2,%d2 470bc: 0682 0000 001c addil #28,%d2 470c2: 47f9 0004 baa8 lea 4baa8 <_Chain_Get>,%a3 470c8: 2f02 movel %d2,%sp@- 470ca: 4e93 jsr %a3@ if ( information->auto_extend ) { 470cc: 588f addql #4,%sp 470ce: 4a2a 0010 tstb %a2@(16) 470d2: 67dc beqs 470b0 <_Objects_Allocate+0x14> /* * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { 470d4: 4a80 tstl %d0 470d6: 6738 beqs 47110 <_Objects_Allocate+0x74> } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 470d8: 2040 moveal %d0,%a0 470da: 4281 clrl %d1 470dc: 4283 clrl %d3 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 470de: 4282 clrl %d2 } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 470e0: 362a 0008 movew %a2@(8),%d3 470e4: 3228 000a movew %a0@(10),%d1 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; information->inactive--; 470e8: 306a 0028 moveaw %a2@(40),%a0 block = (uint32_t) _Objects_Get_index( the_object->id ) - _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 470ec: 342a 0012 movew %a2@(18),%d2 } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 470f0: 9283 subl %d3,%d1 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; information->inactive--; 470f2: 5388 subql #1,%a0 block = (uint32_t) _Objects_Get_index( the_object->id ) - _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 470f4: 4c42 1001 remul %d2,%d1,%d1 information->inactive--; 470f8: 3548 0028 movew %a0,%a2@(40) block = (uint32_t) _Objects_Get_index( the_object->id ) - _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 470fc: 206a 002a moveal %a2@(42),%a0 47100: e589 lsll #2,%d1 information->inactive--; } } return the_object; } 47102: 4cee 0c0c fff0 moveml %fp@(-16),%d2-%d3/%a2-%a3 47108: 4e5e unlk %fp block = (uint32_t) _Objects_Get_index( the_object->id ) - _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 4710a: d1c1 addal %d1,%a0 4710c: 5390 subql #1,%a0@ information->inactive--; } } return the_object; } 4710e: 4e75 rts * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { _Objects_Extend_information( information ); 47110: 2f0a movel %a2,%sp@- 47112: 4eb9 0004 7158 jsr 47158 <_Objects_Extend_information> the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 47118: 2f02 movel %d2,%sp@- 4711a: 4e93 jsr %a3@ } if ( the_object ) { 4711c: 508f addql #8,%sp 4711e: 4a80 tstl %d0 47120: 66b6 bnes 470d8 <_Objects_Allocate+0x3c> information->inactive--; } } return the_object; } 47122: 4cee 0c0c fff0 moveml %fp@(-16),%d2-%d3/%a2-%a3 47128: 4e5e unlk %fp 4712a: 4e75 rts 00047158 <_Objects_Extend_information>: */ void _Objects_Extend_information( Objects_Information *information ) { 47158: 4e56 ffcc linkw %fp,#-52 4715c: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 47160: 246e 0008 moveal %fp@(8),%a2 /* * Search for a free block of indexes. The block variable ends up set * to block_count + 1 if the table needs to be extended. */ minimum_index = _Objects_Get_index( information->minimum_id ); 47164: 4285 clrl %d5 index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 47166: 206a 002e moveal %a2@(46),%a0 /* * Search for a free block of indexes. The block variable ends up set * to block_count + 1 if the table needs to be extended. */ minimum_index = _Objects_Get_index( information->minimum_id ); 4716a: 3a2a 0008 movew %a2@(8),%d5 index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 4716e: 4a88 tstl %a0 47170: 6700 022c beqw 4739e <_Objects_Extend_information+0x246> block_count = 0; else { block_count = information->maximum / information->allocation_size; 47174: 322a 000e movew %a2@(14),%d1 47178: 302a 0012 movew %a2@(18),%d0 4717c: 3801 movew %d1,%d4 4717e: 0284 0000 ffff andil #65535,%d4 47184: 88c0 divuw %d0,%d4 47186: 0284 0000 ffff andil #65535,%d4 for ( ; block < block_count; block++ ) { 4718c: 6700 0224 beqw 473b2 <_Objects_Extend_information+0x25a> <== ALWAYS TAKEN if ( information->object_blocks[ block ] == NULL ) 47190: 4a90 tstl %a0@ 47192: 6700 021e beqw 473b2 <_Objects_Extend_information+0x25a> <== ALWAYS TAKEN 47196: 5888 addql #4,%a0 47198: 2605 movel %d5,%d3 4719a: 4282 clrl %d2 4719c: 0280 0000 ffff andil #65535,%d0 break; else index_base += information->allocation_size; 471a2: 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++ ) { 471a4: 5282 addql #1,%d2 471a6: b484 cmpl %d4,%d2 471a8: 6404 bccs 471ae <_Objects_Extend_information+0x56> if ( information->object_blocks[ block ] == NULL ) 471aa: 4a98 tstl %a0@+ 471ac: 66f4 bnes 471a2 <_Objects_Extend_information+0x4a> else index_base += information->allocation_size; } } maximum = (uint32_t) information->maximum + information->allocation_size; 471ae: 0281 0000 ffff andil #65535,%d1 471b4: 2641 moveal %d1,%a3 471b6: 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 ) { 471b8: b7fc 0000 ffff cmpal #65535,%a3 471be: 6200 0186 bhiw 47346 <_Objects_Extend_information+0x1ee> <== ALWAYS TAKEN /* * 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; 471c2: 41ea 0014 lea %a2@(20),%a0 471c6: 4c10 0800 mulsl %a0@,%d0 if ( information->auto_extend ) { 471ca: 4a2a 0010 tstb %a2@(16) 471ce: 6700 0180 beqw 47350 <_Objects_Extend_information+0x1f8> new_object_block = _Workspace_Allocate( block_size ); 471d2: 2f00 movel %d0,%sp@- 471d4: 4eb9 0004 91f0 jsr 491f0 <_Workspace_Allocate> if ( !new_object_block ) 471da: 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 ); 471dc: 2c00 movel %d0,%d6 if ( !new_object_block ) 471de: 6700 0166 beqw 47346 <_Objects_Extend_information+0x1ee> <== ALWAYS TAKEN } /* * If the index_base is the maximum we need to grow the tables. */ if (index_base >= information->maximum ) { 471e2: 4280 clrl %d0 471e4: 302a 000e movew %a2@(14),%d0 471e8: b083 cmpl %d3,%d0 471ea: 6200 00c4 bhiw 472b0 <_Objects_Extend_information+0x158> <== ALWAYS TAKEN */ /* * Up the block count and maximum */ block_count++; 471ee: 2a44 moveal %d4,%a5 471f0: 528d addql #1,%a5 * Allocate the tables and break it up. */ block_size = block_count * (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); object_blocks = (void**) _Workspace_Allocate( block_size ); 471f2: 200b movel %a3,%d0 471f4: 41f5 da00 lea %a5@(00000000,%a5:l:2),%a0 471f8: d088 addl %a0,%d0 471fa: d085 addl %d5,%d0 471fc: e588 lsll #2,%d0 471fe: 2f00 movel %d0,%sp@- 47200: 4eb9 0004 91f0 jsr 491f0 <_Workspace_Allocate> if ( !object_blocks ) { 47206: 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 ); 47208: 2840 moveal %d0,%a4 if ( !object_blocks ) { 4720a: 4a80 tstl %d0 4720c: 6700 01b2 beqw 473c0 <_Objects_Extend_information+0x268> <== ALWAYS TAKEN } /* * Break the block into the various sections. */ inactive_per_block = (uint32_t *) _Addresses_Add_offset( 47210: 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 ) { 47212: 4280 clrl %d0 } /* * Break the block into the various sections. */ inactive_per_block = (uint32_t *) _Addresses_Add_offset( 47214: 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 ) { 47216: 302a 000e movew %a2@(14),%d0 RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset ( const void *base, uintptr_t offset ) { return (void *)((uintptr_t)base + offset); 4721a: 4bf4 7800 lea %a4@(00000000,%d7:l),%a5 4721e: de8d addl %a5,%d7 47220: b085 cmpl %d5,%d0 47222: 6200 013c bhiw 47360 <_Objects_Extend_information+0x208> } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 47226: 4a85 tstl %d5 47228: 670c beqs 47236 <_Objects_Extend_information+0xde> <== ALWAYS TAKEN information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, 4722a: 2047 moveal %d7,%a0 4722c: 4280 clrl %d0 /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { local_table[ index ] = NULL; 4722e: 4298 clrl %a0@+ } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 47230: 5280 addql #1,%d0 47232: b085 cmpl %d5,%d0 47234: 65f8 bcss 4722e <_Objects_Extend_information+0xd6> <== ALWAYS TAKEN 47236: 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 ); 47238: 4281 clrl %d1 4723a: 322a 0012 movew %a2@(18),%d1 /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; 4723e: 42b5 4800 clrl %a5@(00000000,%d4:l) for ( index=index_base ; index < ( information->allocation_size + index_base ); 47242: d283 addl %d3,%d1 } /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; 47244: 42b4 4800 clrl %a4@(00000000,%d4:l) inactive_per_block[block_count] = 0; for ( index=index_base ; 47248: b283 cmpl %d3,%d1 4724a: 6310 blss 4725c <_Objects_Extend_information+0x104> <== ALWAYS TAKEN 4724c: 2247 moveal %d7,%a1 4724e: 2003 movel %d3,%d0 47250: 41f1 3c00 lea %a1@(00000000,%d3:l:4),%a0 index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; 47254: 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++ ) { 47256: 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 ; 47258: b280 cmpl %d0,%d1 4725a: 62f8 bhis 47254 <_Objects_Extend_information+0xfc> index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; } _ISR_Disable( level ); 4725c: 203c 0000 0700 movel #1792,%d0 47262: 40c4 movew %sr,%d4 47264: 8084 orl %d4,%d0 47266: 46c0 movew %d0,%sr information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; information->local_table = local_table; information->maximum = (Objects_Maximum) maximum; information->maximum_id = _Objects_Build_id( 47268: 2012 movel %a2@,%d0 4726a: 7218 moveq #24,%d1 4726c: 4285 clrl %d5 4726e: e3a8 lsll %d1,%d0 47270: 3a0b movew %a3,%d5 47272: 4281 clrl %d1 47274: 2245 moveal %d5,%a1 47276: 7a1b moveq #27,%d5 47278: 322a 0004 movew %a2@(4),%d1 4727c: 08c0 0010 bset #16,%d0 local_table[ index ] = NULL; } _ISR_Disable( level ); old_tables = information->object_blocks; 47280: 206a 002e moveal %a2@(46),%a0 information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; information->local_table = local_table; information->maximum = (Objects_Maximum) maximum; information->maximum_id = _Objects_Build_id( 47284: eba9 lsll %d5,%d1 old_tables = information->object_blocks; information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; information->local_table = local_table; information->maximum = (Objects_Maximum) maximum; 47286: 354b 000e movew %a3,%a2@(14) _ISR_Disable( level ); old_tables = information->object_blocks; information->object_blocks = object_blocks; 4728a: 254c 002e movel %a4,%a2@(46) information->inactive_per_block = inactive_per_block; information->local_table = local_table; information->maximum = (Objects_Maximum) maximum; information->maximum_id = _Objects_Build_id( 4728e: 8081 orl %d1,%d0 47290: 2209 movel %a1,%d1 47292: 8280 orl %d0,%d1 _ISR_Disable( level ); old_tables = information->object_blocks; information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; 47294: 254d 002a movel %a5,%a2@(42) information->local_table = local_table; information->maximum = (Objects_Maximum) maximum; information->maximum_id = _Objects_Build_id( 47298: 2541 000a movel %d1,%a2@(10) old_tables = information->object_blocks; information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; information->local_table = local_table; 4729c: 2547 0018 movel %d7,%a2@(24) information->the_class, _Objects_Local_node, information->maximum ); _ISR_Enable( level ); 472a0: 46c4 movew %d4,%sr if ( old_tables ) 472a2: 4a88 tstl %a0 472a4: 670a beqs 472b0 <_Objects_Extend_information+0x158> _Workspace_Free( old_tables ); 472a6: 2f08 movel %a0,%sp@- 472a8: 4eb9 0004 920c jsr 4920c <_Workspace_Free> 472ae: 588f addql #4,%sp } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 472b0: 206a 002e moveal %a2@(46),%a0 /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 472b4: 4280 clrl %d0 472b6: 280e movel %fp,%d4 472b8: 0684 ffff fff4 addil #-12,%d4 472be: 47f9 0004 baa8 lea 4baa8 <_Chain_Get>,%a3 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 472c4: 2a0a movel %a2,%d5 472c6: 0685 0000 001c addil #28,%d5 472cc: 49f9 0004 67a4 lea 467a4 <_Chain_Append>,%a4 } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 472d2: e58a lsll #2,%d2 /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 472d4: 302a 0012 movew %a2@(18),%d0 } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 472d8: 2186 2800 movel %d6,%a0@(00000000,%d2:l) /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 472dc: 2f2a 0014 movel %a2@(20),%sp@- 472e0: 2f00 movel %d0,%sp@- 472e2: 2f06 movel %d6,%sp@- 472e4: 2f04 movel %d4,%sp@- 472e6: 4eb9 0004 bae4 jsr 4bae4 <_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 ) { 472ec: 4fef 0010 lea %sp@(16),%sp 472f0: 2f04 movel %d4,%sp@- 472f2: 4e93 jsr %a3@ 472f4: 588f addql #4,%sp 472f6: 4a80 tstl %d0 472f8: 6732 beqs 4732c <_Objects_Extend_information+0x1d4> <== ALWAYS TAKEN the_object->id = _Objects_Build_id( 472fa: 2212 movel %a2@,%d1 472fc: 7c18 moveq #24,%d6 472fe: 7e1b moveq #27,%d7 47300: 2040 moveal %d0,%a0 47302: eda9 lsll %d6,%d1 47304: 4286 clrl %d6 47306: 3c2a 0004 movew %a2@(4),%d6 4730a: 08c1 0010 bset #16,%d1 4730e: efae lsll %d7,%d6 47310: 8286 orl %d6,%d1 47312: 8283 orl %d3,%d1 index ); _Chain_Append( &information->Inactive, &the_object->Node ); index++; 47314: 5283 addql #1,%d3 */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { the_object->id = _Objects_Build_id( 47316: 2141 0008 movel %d1,%a0@(8) information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 4731a: 2f00 movel %d0,%sp@- 4731c: 2f05 movel %d5,%sp@- 4731e: 4e94 jsr %a4@ index++; 47320: 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 ) { 47322: 2f04 movel %d4,%sp@- 47324: 4e93 jsr %a3@ 47326: 588f addql #4,%sp 47328: 4a80 tstl %d0 4732a: 66ce bnes 472fa <_Objects_Extend_information+0x1a2> _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 4732c: 4280 clrl %d0 information->inactive = 4732e: 322a 0028 movew %a2@(40),%d1 47332: 326a 0012 moveaw %a2@(18),%a1 _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 47336: 206a 002a moveal %a2@(42),%a0 information->inactive = 4733a: d289 addl %a1,%d1 _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 4733c: 3009 movew %a1,%d0 information->inactive = 4733e: 3541 0028 movew %d1,%a2@(40) _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 47342: 2180 2800 movel %d0,%a0@(00000000,%d2:l) information->inactive = (Objects_Maximum)(information->inactive + information->allocation_size); } 47346: 4cee 3cfc ffcc moveml %fp@(-52),%d2-%d7/%a2-%a5 4734c: 4e5e unlk %fp 4734e: 4e75 rts if ( information->auto_extend ) { new_object_block = _Workspace_Allocate( block_size ); if ( !new_object_block ) return; } else { new_object_block = _Workspace_Allocate_or_fatal_error( block_size ); 47350: 2f00 movel %d0,%sp@- 47352: 4eb9 0004 91bc jsr 491bc <_Workspace_Allocate_or_fatal_error> 47358: 588f addql #4,%sp 4735a: 2c00 movel %d0,%d6 4735c: 6000 fe84 braw 471e2 <_Objects_Extend_information+0x8a> <== ALWAYS TAKEN /* * 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, 47360: e58c lsll #2,%d4 47362: 2f04 movel %d4,%sp@- 47364: 2f2a 002e movel %a2@(46),%sp@- 47368: 2f0c movel %a4,%sp@- 4736a: 4eb9 0004 f604 jsr 4f604 information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, 47370: 2f04 movel %d4,%sp@- 47372: 2f2a 002a movel %a2@(42),%sp@- 47376: 2f0d movel %a5,%sp@- 47378: 4eb9 0004 f604 jsr 4f604 information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, 4737e: 4280 clrl %d0 47380: 302a 000e movew %a2@(14),%d0 47384: da80 addl %d0,%d5 47386: e58d lsll #2,%d5 47388: 2f05 movel %d5,%sp@- 4738a: 2f2a 0018 movel %a2@(24),%sp@- 4738e: 2f07 movel %d7,%sp@- 47390: 4eb9 0004 f604 jsr 4f604 47396: 4fef 0024 lea %sp@(36),%sp 4739a: 6000 fe9c braw 47238 <_Objects_Extend_information+0xe0> <== ALWAYS TAKEN minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 4739e: 4280 clrl %d0 473a0: 2605 movel %d5,%d3 473a2: 4282 clrl %d2 473a4: 4284 clrl %d4 473a6: 322a 000e movew %a2@(14),%d1 473aa: 302a 0012 movew %a2@(18),%d0 473ae: 6000 fdfe braw 471ae <_Objects_Extend_information+0x56> <== ALWAYS TAKEN block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { if ( information->object_blocks[ block ] == NULL ) 473b2: 2605 movel %d5,%d3 <== NOT EXECUTED 473b4: 4282 clrl %d2 <== NOT EXECUTED 473b6: 0280 0000 ffff andil #65535,%d0 <== NOT EXECUTED 473bc: 6000 fdf0 braw 471ae <_Objects_Extend_information+0x56> <== NOT EXECUTED (sizeof(void *) + sizeof(uint32_t) + sizeof(Objects_Name *)) + ((maximum + minimum_index) * sizeof(Objects_Control *)); object_blocks = (void**) _Workspace_Allocate( block_size ); if ( !object_blocks ) { _Workspace_Free( new_object_block ); 473c0: 2f06 movel %d6,%sp@- 473c2: 4eb9 0004 920c jsr 4920c <_Workspace_Free> return; 473c8: 588f addql #4,%sp } information->inactive_per_block[ block ] = information->allocation_size; information->inactive = (Objects_Maximum)(information->inactive + information->allocation_size); } 473ca: 4cee 3cfc ffcc moveml %fp@(-52),%d2-%d7/%a2-%a5 473d0: 4e5e unlk %fp 473d2: 4e75 rts 00047484 <_Objects_Get_information>: Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint32_t the_class ) { 47484: 4e56 0000 linkw %fp,#0 47488: 2f02 movel %d2,%sp@- 4748a: 242e 000c movel %fp@(12),%d2 Objects_Information *info; int the_class_api_maximum; if ( !the_class ) 4748e: 660a bnes 4749a <_Objects_Get_information+0x16> * In a multprocessing configuration, we may access remote objects. * Thus we may have 0 local instances and still have a valid object * pointer. */ #if !defined(RTEMS_MULTIPROCESSING) if ( info->maximum == 0 ) 47490: 4280 clrl %d0 return NULL; #endif return info; } 47492: 242e fffc movel %fp@(-4),%d2 47496: 4e5e unlk %fp 47498: 4e75 rts /* * 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 ); 4749a: 2f2e 0008 movel %fp@(8),%sp@- 4749e: 4eb9 0004 c0bc jsr 4c0bc <_Objects_API_maximum_class> if ( the_class_api_maximum == 0 ) 474a4: 588f addql #4,%sp 474a6: 4a80 tstl %d0 474a8: 67e6 beqs 47490 <_Objects_Get_information+0xc> return NULL; if ( the_class > (uint32_t) the_class_api_maximum ) 474aa: b082 cmpl %d2,%d0 474ac: 65e2 bcss 47490 <_Objects_Get_information+0xc> return NULL; if ( !_Objects_Information_table[ the_api ] ) 474ae: 202e 0008 movel %fp@(8),%d0 474b2: 41f9 0005 f10c lea 5f10c <_Objects_Information_table>,%a0 474b8: 2070 0c00 moveal %a0@(00000000,%d0:l:4),%a0 474bc: 4a88 tstl %a0 474be: 67d0 beqs 47490 <_Objects_Get_information+0xc> <== ALWAYS TAKEN return NULL; info = _Objects_Information_table[ the_api ][ the_class ]; 474c0: 2030 2c00 movel %a0@(00000000,%d2:l:4),%d0 if ( !info ) 474c4: 67cc beqs 47492 <_Objects_Get_information+0xe> <== ALWAYS TAKEN * In a multprocessing configuration, we may access remote objects. * Thus we may have 0 local instances and still have a valid object * pointer. */ #if !defined(RTEMS_MULTIPROCESSING) if ( info->maximum == 0 ) 474c6: 2040 moveal %d0,%a0 474c8: 4a68 000e tstw %a0@(14) 474cc: 67c2 beqs 47490 <_Objects_Get_information+0xc> return NULL; #endif return info; } 474ce: 242e fffc movel %fp@(-4),%d2 474d2: 4e5e unlk %fp 474d4: 4e75 rts ... 000546c0 <_Objects_Get_name_as_string>: char *_Objects_Get_name_as_string( Objects_Id id, size_t length, char *name ) { 546c0: 4e56 ffe0 linkw %fp,#-32 546c4: 48d7 043c moveml %d2-%d5/%a2,%sp@ 546c8: 262e 000c movel %fp@(12),%d3 546cc: 242e 0010 movel %fp@(16),%d2 char lname[5]; Objects_Control *the_object; Objects_Locations location; Objects_Id tmpId; if ( length == 0 ) 546d0: 4a83 tstl %d3 546d2: 660e bnes 546e2 <_Objects_Get_name_as_string+0x22> } } *d = '\0'; _Thread_Enable_dispatch(); return name; 546d4: 4282 clrl %d2 } return NULL; /* unreachable path */ } 546d6: 2002 movel %d2,%d0 546d8: 4cee 043c ffe0 moveml %fp@(-32),%d2-%d5/%a2 546de: 4e5e unlk %fp 546e0: 4e75 rts Objects_Id tmpId; if ( length == 0 ) return NULL; if ( name == NULL ) 546e2: 4a82 tstl %d2 546e4: 67f0 beqs 546d6 <_Objects_Get_name_as_string+0x16> return NULL; tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 546e6: 4aae 0008 tstl %fp@(8) 546ea: 6700 0092 beqw 5477e <_Objects_Get_name_as_string+0xbe> <== ALWAYS TAKEN 546ee: 282e 0008 movel %fp@(8),%d4 information = _Objects_Get_information_id( tmpId ); 546f2: 2f04 movel %d4,%sp@- 546f4: 4eb9 0004 c938 jsr 4c938 <_Objects_Get_information_id> if ( !information ) 546fa: 588f addql #4,%sp if ( name == NULL ) return NULL; tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; information = _Objects_Get_information_id( tmpId ); 546fc: 2440 moveal %d0,%a2 if ( !information ) 546fe: 4a80 tstl %d0 54700: 67d2 beqs 546d4 <_Objects_Get_name_as_string+0x14> return NULL; the_object = _Objects_Get( information, tmpId, &location ); 54702: 486e fffc pea %fp@(-4) 54706: 2f04 movel %d4,%sp@- 54708: 2f00 movel %d0,%sp@- 5470a: 4eb9 0004 ca18 jsr 4ca18 <_Objects_Get> switch ( location ) { 54710: 4fef 000c lea %sp@(12),%sp 54714: 4aae fffc tstl %fp@(-4) 54718: 66ba bnes 546d4 <_Objects_Get_name_as_string+0x14> <== ALWAYS TAKEN return NULL; case OBJECTS_LOCAL: #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) { 5471a: 4a2a 0032 tstb %a2@(50) 5471e: 676c beqs 5478c <_Objects_Get_name_as_string+0xcc> s = the_object->name.name_p; 54720: 2040 moveal %d0,%a0 54722: 2468 000c moveal %a0@(12),%a2 lname[ 4 ] = '\0'; s = lname; } d = name; if ( s ) { 54726: 4a8a tstl %a2 54728: 6748 beqs 54772 <_Objects_Get_name_as_string+0xb2> for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 5472a: 5383 subql #1,%d3 5472c: 6744 beqs 54772 <_Objects_Get_name_as_string+0xb2> <== ALWAYS TAKEN 5472e: 1012 moveb %a2@,%d0 54730: 6740 beqs 54772 <_Objects_Get_name_as_string+0xb2> 54732: 2042 moveal %d2,%a0 54734: 4281 clrl %d1 *d = (isprint((unsigned char)*s)) ? *s : '*'; 54736: 4284 clrl %d4 54738: 1800 moveb %d0,%d4 s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 5473a: 5281 addql #1,%d1 *d = (isprint((unsigned char)*s)) ? *s : '*'; 5473c: 2279 0006 b174 moveal 6b174 <__ctype_ptr__>,%a1 54742: 1831 4801 moveb %a1@(00000001,%d4:l),%d4 54746: 49c4 extbl %d4 54748: 0284 0000 0097 andil #151,%d4 5474e: 6602 bnes 54752 <_Objects_Get_name_as_string+0x92> 54750: 702a moveq #42,%d0 54752: 10c0 moveb %d0,%a0@+ s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 54754: b681 cmpl %d1,%d3 54756: 6306 blss 5475e <_Objects_Get_name_as_string+0x9e> 54758: 1032 1800 moveb %a2@(00000000,%d1:l),%d0 5475c: 66d8 bnes 54736 <_Objects_Get_name_as_string+0x76> *d = (isprint((unsigned char)*s)) ? *s : '*'; } } *d = '\0'; 5475e: 4210 clrb %a0@ _Thread_Enable_dispatch(); 54760: 4eb9 0004 d3ac jsr 4d3ac <_Thread_Enable_dispatch> return name; } return NULL; /* unreachable path */ } 54766: 2002 movel %d2,%d0 54768: 4cee 043c ffe0 moveml %fp@(-32),%d2-%d5/%a2 5476e: 4e5e unlk %fp 54770: 4e75 rts s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 54772: 2042 moveal %d2,%a0 *d = (isprint((unsigned char)*s)) ? *s : '*'; } } *d = '\0'; 54774: 4210 clrb %a0@ _Thread_Enable_dispatch(); 54776: 4eb9 0004 d3ac jsr 4d3ac <_Thread_Enable_dispatch> 5477c: 60e8 bras 54766 <_Objects_Get_name_as_string+0xa6> <== ALWAYS TAKEN return NULL; if ( name == NULL ) return NULL; tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 5477e: 2079 0006 cfc6 moveal 6cfc6 <_Thread_Executing>,%a0 54784: 2828 0008 movel %a0@(8),%d4 54788: 6000 ff68 braw 546f2 <_Objects_Get_name_as_string+0x32> if ( information->is_string ) { s = the_object->name.name_p; } else #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; 5478c: 2040 moveal %d0,%a0 lname[ 0 ] = (u32_name >> 24) & 0xff; 5478e: 7218 moveq #24,%d1 lname[ 1 ] = (u32_name >> 16) & 0xff; lname[ 2 ] = (u32_name >> 8) & 0xff; lname[ 3 ] = (u32_name >> 0) & 0xff; lname[ 4 ] = '\0'; 54790: 45ee fff7 lea %fp@(-9),%a2 if ( information->is_string ) { s = the_object->name.name_p; } else #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; 54794: 2028 000c movel %a0@(12),%d0 lname[ 0 ] = (u32_name >> 24) & 0xff; 54798: 2a00 movel %d0,%d5 5479a: e2ad lsrl %d1,%d5 lname[ 1 ] = (u32_name >> 16) & 0xff; lname[ 2 ] = (u32_name >> 8) & 0xff; 5479c: 2200 movel %d0,%d1 #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; lname[ 0 ] = (u32_name >> 24) & 0xff; lname[ 1 ] = (u32_name >> 16) & 0xff; 5479e: 2800 movel %d0,%d4 lname[ 2 ] = (u32_name >> 8) & 0xff; 547a0: e089 lsrl #8,%d1 lname[ 3 ] = (u32_name >> 0) & 0xff; 547a2: 1d40 fffa moveb %d0,%fp@(-6) #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; lname[ 0 ] = (u32_name >> 24) & 0xff; lname[ 1 ] = (u32_name >> 16) & 0xff; 547a6: 4244 clrw %d4 547a8: 4844 swap %d4 lname[ 2 ] = (u32_name >> 8) & 0xff; lname[ 3 ] = (u32_name >> 0) & 0xff; lname[ 4 ] = '\0'; 547aa: 4200 clrb %d0 } else #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; lname[ 0 ] = (u32_name >> 24) & 0xff; 547ac: 1d45 fff7 moveb %d5,%fp@(-9) lname[ 1 ] = (u32_name >> 16) & 0xff; 547b0: 1d44 fff8 moveb %d4,%fp@(-8) lname[ 2 ] = (u32_name >> 8) & 0xff; 547b4: 1d41 fff9 moveb %d1,%fp@(-7) lname[ 3 ] = (u32_name >> 0) & 0xff; lname[ 4 ] = '\0'; 547b8: 1d40 fffb moveb %d0,%fp@(-5) 547bc: 6000 ff6c braw 5472a <_Objects_Get_name_as_string+0x6a> <== ALWAYS TAKEN 000576f4 <_Objects_Get_next>: Objects_Information *information, Objects_Id id, Objects_Locations *location_p, Objects_Id *next_id_p ) { 576f4: 4e56 fff0 linkw %fp,#-16 576f8: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ 576fc: 246e 0008 moveal %fp@(8),%a2 57700: 266e 0010 moveal %fp@(16),%a3 Objects_Control *object; Objects_Id next_id; if ( !information ) 57704: 4a8a tstl %a2 57706: 660c bnes 57714 <_Objects_Get_next+0x20> *next_id_p = next_id; return object; final: *next_id_p = OBJECTS_ID_FINAL; return 0; 57708: 4280 clrl %d0 } 5770a: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 57710: 4e5e unlk %fp 57712: 4e75 rts Objects_Id next_id; if ( !information ) return NULL; if ( !location_p ) 57714: 4a8b tstl %a3 57716: 67f0 beqs 57708 <_Objects_Get_next+0x14> return NULL; if ( !next_id_p ) 57718: 4aae 0014 tstl %fp@(20) 5771c: 67ea beqs 57708 <_Objects_Get_next+0x14> return NULL; if (_Objects_Get_index(id) == OBJECTS_ID_INITIAL_INDEX) 5771e: 302e 000e movew %fp@(14),%d0 57722: 673a beqs 5775e <_Objects_Get_next+0x6a> 57724: 242e 000c movel %fp@(12),%d2 *location_p = OBJECTS_ERROR; goto final; } /* try to grab one */ object = _Objects_Get(information, next_id, location_p); 57728: 49f9 0004 ca18 lea 4ca18 <_Objects_Get>,%a4 else next_id = id; do { /* walked off end of list? */ if (_Objects_Get_index(next_id) > information->maximum) 5772e: 4281 clrl %d1 57730: 4280 clrl %d0 57732: 322a 000e movew %a2@(14),%d1 57736: 3002 movew %d2,%d0 57738: b081 cmpl %d1,%d0 5773a: 622e bhis 5776a <_Objects_Get_next+0x76> *location_p = OBJECTS_ERROR; goto final; } /* try to grab one */ object = _Objects_Get(information, next_id, location_p); 5773c: 2f0b movel %a3,%sp@- 5773e: 2f02 movel %d2,%sp@- next_id++; 57740: 5282 addql #1,%d2 *location_p = OBJECTS_ERROR; goto final; } /* try to grab one */ object = _Objects_Get(information, next_id, location_p); 57742: 2f0a movel %a2,%sp@- 57744: 4e94 jsr %a4@ next_id++; } while (*location_p != OBJECTS_LOCAL); 57746: 4fef 000c lea %sp@(12),%sp 5774a: 4a93 tstl %a3@ 5774c: 66e0 bnes 5772e <_Objects_Get_next+0x3a> *next_id_p = next_id; 5774e: 206e 0014 moveal %fp@(20),%a0 57752: 2082 movel %d2,%a0@ return object; final: *next_id_p = OBJECTS_ID_FINAL; return 0; } 57754: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 5775a: 4e5e unlk %fp 5775c: 4e75 rts if ( !next_id_p ) return NULL; if (_Objects_Get_index(id) == OBJECTS_ID_INITIAL_INDEX) next_id = information->minimum_id; 5775e: 242a 0006 movel %a2@(6),%d2 *location_p = OBJECTS_ERROR; goto final; } /* try to grab one */ object = _Objects_Get(information, next_id, location_p); 57762: 49f9 0004 ca18 lea 4ca18 <_Objects_Get>,%a4 57768: 60c4 bras 5772e <_Objects_Get_next+0x3a> <== ALWAYS TAKEN do { /* walked off end of list? */ if (_Objects_Get_index(next_id) > information->maximum) { *location_p = OBJECTS_ERROR; 5776a: 7401 moveq #1,%d2 *next_id_p = next_id; return object; final: *next_id_p = OBJECTS_ID_FINAL; 5776c: 72ff moveq #-1,%d1 5776e: 4280 clrl %d0 57770: 206e 0014 moveal %fp@(20),%a0 do { /* walked off end of list? */ if (_Objects_Get_index(next_id) > information->maximum) { *location_p = OBJECTS_ERROR; 57774: 2682 movel %d2,%a3@ return object; final: *next_id_p = OBJECTS_ID_FINAL; return 0; } 57776: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 *next_id_p = next_id; return object; final: *next_id_p = OBJECTS_ID_FINAL; 5777c: 2081 movel %d1,%a0@ return 0; } 5777e: 4e5e unlk %fp 57780: 4e75 rts ... 0005b20c <_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; 5b20c: 7001 moveq #1,%d0 if ( information->maximum >= index ) { 5b20e: 4281 clrl %d1 Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 5b210: 4e56 0000 linkw %fp,#0 5b214: 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; 5b218: 90a8 0006 subl %a0@(6),%d0 5b21c: d0ae 000c addl %fp@(12),%d0 if ( information->maximum >= index ) { 5b220: 3228 000e movew %a0@(14),%d1 Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 5b224: 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 ) { 5b228: b280 cmpl %d0,%d1 5b22a: 6510 bcss 5b23c <_Objects_Get_no_protection+0x30> if ( (the_object = information->local_table[ index ]) != NULL ) { 5b22c: 2068 0018 moveal %a0@(24),%a0 5b230: 2030 0c00 movel %a0@(00000000,%d0:l:4),%d0 5b234: 6706 beqs 5b23c <_Objects_Get_no_protection+0x30> <== ALWAYS TAKEN *location = OBJECTS_LOCAL; 5b236: 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; } 5b238: 4e5e unlk %fp 5b23a: 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; 5b23c: 7001 moveq #1,%d0 return NULL; } 5b23e: 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; 5b240: 2280 movel %d0,%a1@ 5b242: 4280 clrl %d0 return NULL; } 5b244: 4e75 rts ... 0004ca84 <_Objects_Id_to_name>: */ Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { 4ca84: 4e56 fffc linkw %fp,#-4 4ca88: 222e 0008 movel %fp@(8),%d1 4ca8c: 2f02 movel %d2,%sp@- /* * Caller is trusted for name != NULL. */ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 4ca8e: 4a81 tstl %d1 4ca90: 660a bnes 4ca9c <_Objects_Id_to_name+0x18> 4ca92: 2079 0006 cfc6 moveal 6cfc6 <_Thread_Executing>,%a0 4ca98: 2228 0008 movel %a0@(8),%d1 */ RTEMS_INLINE_ROUTINE Objects_APIs _Objects_Get_API( Objects_Id id ) { return (Objects_APIs) ((id >> OBJECTS_API_START_BIT) & OBJECTS_API_VALID_BITS); 4ca9c: 7418 moveq #24,%d2 4ca9e: 2001 movel %d1,%d0 4caa0: e4a8 lsrl %d2,%d0 4caa2: 143c 0007 moveb #7,%d2 4caa6: c082 andl %d2,%d0 */ RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid( uint32_t the_api ) { if ( !the_api || the_api > OBJECTS_APIS_LAST ) 4caa8: 143c 0003 moveb #3,%d2 4caac: 2040 moveal %d0,%a0 4caae: 5388 subql #1,%a0 4cab0: b488 cmpl %a0,%d2 4cab2: 6522 bcss 4cad6 <_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 ] ) 4cab4: 41f9 0006 cec4 lea 6cec4 <_Objects_Information_table>,%a0 4caba: 2070 0c00 moveal %a0@(00000000,%d0:l:4),%a0 4cabe: 4a88 tstl %a0 4cac0: 6714 beqs 4cad6 <_Objects_Id_to_name+0x52> return OBJECTS_INVALID_ID; the_class = _Objects_Get_class( tmpId ); information = _Objects_Information_table[ the_api ][ the_class ]; 4cac2: 2001 movel %d1,%d0 4cac4: 741b moveq #27,%d2 4cac6: e4a8 lsrl %d2,%d0 4cac8: 2070 0c00 moveal %a0@(00000000,%d0:l:4),%a0 if ( !information ) 4cacc: 4a88 tstl %a0 4cace: 6706 beqs 4cad6 <_Objects_Id_to_name+0x52> <== ALWAYS TAKEN return OBJECTS_INVALID_ID; #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) 4cad0: 4a28 0032 tstb %a0@(50) 4cad4: 670a beqs 4cae0 <_Objects_Id_to_name+0x5c> <== NEVER TAKEN return OBJECTS_INVALID_ID; *name = the_object->name; _Thread_Enable_dispatch(); return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; } 4cad6: 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; 4cada: 7003 moveq #3,%d0 } 4cadc: 4e5e unlk %fp 4cade: 4e75 rts #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 ); 4cae0: 486e fffc pea %fp@(-4) 4cae4: 2f01 movel %d1,%sp@- 4cae6: 2f08 movel %a0,%sp@- 4cae8: 4eb9 0004 ca18 jsr 4ca18 <_Objects_Get> if ( !the_object ) 4caee: 4fef 000c lea %sp@(12),%sp 4caf2: 4a80 tstl %d0 4caf4: 67e0 beqs 4cad6 <_Objects_Id_to_name+0x52> return OBJECTS_INVALID_ID; *name = the_object->name; 4caf6: 206e 000c moveal %fp@(12),%a0 4cafa: 2240 moveal %d0,%a1 4cafc: 20a9 000c movel %a1@(12),%a0@ _Thread_Enable_dispatch(); 4cb00: 4eb9 0004 d3ac jsr 4d3ac <_Thread_Enable_dispatch> return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; } 4cb06: 242e fff8 movel %fp@(-8),%d2 the_object = _Objects_Get( information, tmpId, &ignored_location ); if ( !the_object ) return OBJECTS_INVALID_ID; *name = the_object->name; _Thread_Enable_dispatch(); 4cb0a: 4280 clrl %d0 return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; } 4cb0c: 4e5e unlk %fp 4cb0e: 4e75 rts 000476e4 <_Objects_Name_to_id_u32>: Objects_Information *information, uint32_t name, uint32_t node, Objects_Id *id ) { 476e4: 4e56 fff4 linkw %fp,#-12 476e8: 206e 0008 moveal %fp@(8),%a0 476ec: 48d7 040c moveml %d2-%d3/%a2,%sp@ 476f0: 222e 000c movel %fp@(12),%d1 476f4: 202e 0010 movel %fp@(16),%d0 476f8: 246e 0014 moveal %fp@(20),%a2 Objects_Name name_for_mp; #endif /* ASSERT: information->is_string == false */ if ( !id ) 476fc: 4a8a tstl %a2 476fe: 675a beqs 4775a <_Objects_Name_to_id_u32+0x76> return OBJECTS_INVALID_ADDRESS; if ( name == 0 ) 47700: 4a81 tstl %d1 47702: 6718 beqs 4771c <_Objects_Name_to_id_u32+0x38> return OBJECTS_INVALID_NAME; search_local_node = false; if ( information->maximum != 0 && 47704: 3428 000e movew %a0@(14),%d2 47708: 6712 beqs 4771c <_Objects_Name_to_id_u32+0x38> 4770a: 4a80 tstl %d0 4770c: 6718 beqs 47726 <_Objects_Name_to_id_u32+0x42> 4770e: 0c80 7fff ffff cmpil #2147483647,%d0 47714: 6710 beqs 47726 <_Objects_Name_to_id_u32+0x42> 47716: 7601 moveq #1,%d3 47718: b680 cmpl %d0,%d3 4771a: 670a beqs 47726 <_Objects_Name_to_id_u32+0x42> search_local_node = true; if ( search_local_node ) { name_length = information->name_length; for ( index = 1; index <= information->maximum; index++ ) { 4771c: 7001 moveq #1,%d0 name_for_mp.name_u32 = name; return _Objects_MP_Global_name_search( information, name_for_mp, node, id ); #else return OBJECTS_INVALID_NAME; #endif } 4771e: 4cd7 040c moveml %sp@,%d2-%d3/%a2 47722: 4e5e unlk %fp 47724: 4e75 rts search_local_node = true; if ( search_local_node ) { name_length = information->name_length; for ( index = 1; index <= information->maximum; index++ ) { 47726: 2068 0018 moveal %a0@(24),%a0 4772a: 7001 moveq #1,%d0 4772c: 5888 addql #4,%a0 4772e: 0282 0000 ffff andil #65535,%d2 the_object = information->local_table[ index ]; 47734: 2250 moveal %a0@,%a1 search_local_node = true; if ( search_local_node ) { name_length = information->name_length; for ( index = 1; index <= information->maximum; index++ ) { 47736: 5280 addql #1,%d0 47738: 5888 addql #4,%a0 the_object = information->local_table[ index ]; if ( !the_object ) 4773a: 4a89 tstl %a1 4773c: 6706 beqs 47744 <_Objects_Name_to_id_u32+0x60> continue; if ( name == the_object->name.name_u32 ) { 4773e: b2a9 000c cmpl %a1@(12),%d1 47742: 6708 beqs 4774c <_Objects_Name_to_id_u32+0x68> search_local_node = true; if ( search_local_node ) { name_length = information->name_length; for ( index = 1; index <= information->maximum; index++ ) { 47744: b082 cmpl %d2,%d0 47746: 63ec blss 47734 <_Objects_Name_to_id_u32+0x50> 47748: 7001 moveq #1,%d0 4774a: 60d2 bras 4771e <_Objects_Name_to_id_u32+0x3a> <== ALWAYS TAKEN the_object = information->local_table[ index ]; if ( !the_object ) continue; if ( name == the_object->name.name_u32 ) { *id = the_object->id; 4774c: 24a9 0008 movel %a1@(8),%a2@ 47750: 4280 clrl %d0 name_for_mp.name_u32 = name; return _Objects_MP_Global_name_search( information, name_for_mp, node, id ); #else return OBJECTS_INVALID_NAME; #endif } 47752: 4cd7 040c moveml %sp@,%d2-%d3/%a2 47756: 4e5e unlk %fp 47758: 4e75 rts Objects_Name name_for_mp; #endif /* ASSERT: information->is_string == false */ if ( !id ) 4775a: 7002 moveq #2,%d0 name_for_mp.name_u32 = name; return _Objects_MP_Global_name_search( information, name_for_mp, node, id ); #else return OBJECTS_INVALID_NAME; #endif } 4775c: 4cd7 040c moveml %sp@,%d2-%d3/%a2 47760: 4e5e unlk %fp 47762: 4e75 rts 00047ad8 <_Objects_Set_name>: { size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 47ad8: 4280 clrl %d0 bool _Objects_Set_name( Objects_Information *information, Objects_Control *the_object, const char *name ) { 47ada: 4e56 fff0 linkw %fp,#-16 47ade: 48d7 3c00 moveml %a2-%a5,%sp@ 47ae2: 286e 0008 moveal %fp@(8),%a4 47ae6: 246e 0010 moveal %fp@(16),%a2 size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 47aea: 302c 0034 movew %a4@(52),%d0 47aee: 2f00 movel %d0,%sp@- bool _Objects_Set_name( Objects_Information *information, Objects_Control *the_object, const char *name ) { 47af0: 2a6e 000c moveal %fp@(12),%a5 size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 47af4: 2f0a movel %a2,%sp@- 47af6: 4eb9 0005 0aa8 jsr 50aa8 #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) { 47afc: 508f addql #8,%sp { size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 47afe: 2640 moveal %d0,%a3 #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) { 47b00: 4a2c 0032 tstb %a4@(50) 47b04: 6662 bnes 47b68 <_Objects_Set_name+0x90> d[length] = '\0'; the_object->name.name_p = d; } else #endif { the_object->name.name_u32 = _Objects_Build_name( 47b06: 7018 moveq #24,%d0 47b08: 1212 moveb %a2@,%d1 47b0a: 49c1 extbl %d1 47b0c: e1a9 lsll %d0,%d1 47b0e: 103c 0001 moveb #1,%d0 47b12: b08b cmpl %a3,%d0 47b14: 643c bccs 47b52 <_Objects_Set_name+0x7a> 47b16: 102a 0001 moveb %a2@(1),%d0 47b1a: 49c0 extbl %d0 47b1c: 4840 swap %d0 47b1e: 4240 clrw %d0 47b20: 8081 orl %d1,%d0 47b22: 7202 moveq #2,%d1 47b24: b28b cmpl %a3,%d1 47b26: 6730 beqs 47b58 <_Objects_Set_name+0x80> 47b28: 122a 0002 moveb %a2@(2),%d1 47b2c: 49c1 extbl %d1 47b2e: e189 lsll #8,%d1 47b30: 8081 orl %d1,%d0 47b32: 7203 moveq #3,%d1 47b34: b28b cmpl %a3,%d1 47b36: 6700 0088 beqw 47bc0 <_Objects_Set_name+0xe8> 47b3a: 122a 0003 moveb %a2@(3),%d1 47b3e: 49c1 extbl %d1 47b40: 8081 orl %d1,%d0 47b42: 2b40 000c movel %d0,%a5@(12) 47b46: 7001 moveq #1,%d0 ); } return true; } 47b48: 4cee 3c00 fff0 moveml %fp@(-16),%a2-%a5 47b4e: 4e5e unlk %fp 47b50: 4e75 rts d[length] = '\0'; the_object->name.name_p = d; } else #endif { the_object->name.name_u32 = _Objects_Build_name( 47b52: 2001 movel %d1,%d0 47b54: 08c0 0015 bset #21,%d0 47b58: 7220 moveq #32,%d1 47b5a: 08c0 000d bset #13,%d0 47b5e: 8081 orl %d1,%d0 47b60: 2b40 000c movel %d0,%a5@(12) 47b64: 7001 moveq #1,%d0 47b66: 60e0 bras 47b48 <_Objects_Set_name+0x70> <== ALWAYS TAKEN #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) { char *d; d = _Workspace_Allocate( length + 1 ); 47b68: 486b 0001 pea %a3@(1) 47b6c: 4eb9 0004 965c jsr 4965c <_Workspace_Allocate> if ( !d ) 47b72: 588f addql #4,%sp #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) { char *d; d = _Workspace_Allocate( length + 1 ); 47b74: 2840 moveal %d0,%a4 if ( !d ) 47b76: 4a80 tstl %d0 47b78: 673a beqs 47bb4 <_Objects_Set_name+0xdc> <== ALWAYS TAKEN return false; if ( the_object->name.name_p ) { 47b7a: 202d 000c movel %a5@(12),%d0 47b7e: 670e beqs 47b8e <_Objects_Set_name+0xb6> _Workspace_Free( (void *)the_object->name.name_p ); 47b80: 2f00 movel %d0,%sp@- 47b82: 4eb9 0004 9678 jsr 49678 <_Workspace_Free> the_object->name.name_p = NULL; 47b88: 588f addql #4,%sp 47b8a: 42ad 000c clrl %a5@(12) } strncpy( d, name, length ); 47b8e: 2f0b movel %a3,%sp@- 47b90: 2f0a movel %a2,%sp@- 47b92: 2f0c movel %a4,%sp@- 47b94: 4eb9 0005 0a20 jsr 50a20 d[length] = '\0'; the_object->name.name_p = d; 47b9a: 4fef 000c lea %sp@(12),%sp _Workspace_Free( (void *)the_object->name.name_p ); the_object->name.name_p = NULL; } strncpy( d, name, length ); d[length] = '\0'; 47b9e: 4200 clrb %d0 47ba0: 1980 b800 moveb %d0,%a4@(00000000,%a3:l) the_object->name.name_p = d; 47ba4: 7001 moveq #1,%d0 47ba6: 2b4c 000c movel %a4,%a5@(12) ); } return true; } 47baa: 4cee 3c00 fff0 moveml %fp@(-16),%a2-%a5 47bb0: 4e5e unlk %fp 47bb2: 4e75 rts 47bb4: 4cee 3c00 fff0 moveml %fp@(-16),%a2-%a5 <== NOT EXECUTED #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) { char *d; d = _Workspace_Allocate( length + 1 ); if ( !d ) 47bba: 4200 clrb %d0 <== NOT EXECUTED ); } return true; } 47bbc: 4e5e unlk %fp <== NOT EXECUTED 47bbe: 4e75 rts <== NOT EXECUTED d[length] = '\0'; the_object->name.name_p = d; } else #endif { the_object->name.name_u32 = _Objects_Build_name( 47bc0: 123c 0020 moveb #32,%d1 47bc4: 8081 orl %d1,%d0 47bc6: 2b40 000c movel %d0,%a5@(12) 47bca: 7001 moveq #1,%d0 47bcc: 6000 ff7a braw 47b48 <_Objects_Set_name+0x70> <== ALWAYS TAKEN 00047764 <_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) / 47764: 4281 clrl %d1 */ void _Objects_Shrink_information( Objects_Information *information ) { 47766: 4e56 ffec linkw %fp,#-20 4776a: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 4776e: 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 ); 47772: 4283 clrl %d3 block_count = (information->maximum - index_base) / 47774: 4284 clrl %d4 /* * Search the list to find block or chunk with all objects inactive. */ index_base = _Objects_Get_index( information->minimum_id ); 47776: 362a 0008 movew %a2@(8),%d3 block_count = (information->maximum - index_base) / 4777a: 382a 000e movew %a2@(14),%d4 4777e: 322a 0012 movew %a2@(18),%d1 47782: 9883 subl %d3,%d4 47784: 4c41 4004 remul %d1,%d4,%d4 information->allocation_size; for ( block = 0; block < block_count; block++ ) { 47788: 672c beqs 477b6 <_Objects_Shrink_information+0x52> <== ALWAYS TAKEN if ( information->inactive_per_block[ block ] == 4778a: 226a 002a moveal %a2@(42),%a1 4778e: b291 cmpl %a1@,%d1 47790: 672e beqs 477c0 <_Objects_Shrink_information+0x5c> <== ALWAYS TAKEN information->object_blocks[ block ] = NULL; information->inactive_per_block[ block ] = 0; information->inactive -= information->allocation_size; return; 47792: 7404 moveq #4,%d2 47794: 4280 clrl %d0 } index_base += information->allocation_size; 47796: 2042 moveal %d2,%a0 47798: d681 addl %d1,%d3 4779a: 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++ ) { 4779c: 5280 addql #1,%d0 4779e: b084 cmpl %d4,%d0 477a0: 6414 bccs 477b6 <_Objects_Shrink_information+0x52> <== ALWAYS TAKEN if ( information->inactive_per_block[ block ] == 477a2: b2b1 2800 cmpl %a1@(00000000,%d2:l),%d1 477a6: 671a beqs 477c2 <_Objects_Shrink_information+0x5e> 477a8: 2408 movel %a0,%d2 information->inactive -= information->allocation_size; return; } index_base += information->allocation_size; 477aa: 2042 moveal %d2,%a0 477ac: d681 addl %d1,%d3 477ae: 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++ ) { 477b0: 5280 addql #1,%d0 477b2: b084 cmpl %d4,%d0 477b4: 65ec bcss 477a2 <_Objects_Shrink_information+0x3e> return; } index_base += information->allocation_size; } } 477b6: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 477bc: 4e5e unlk %fp 477be: 4e75 rts index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / information->allocation_size; for ( block = 0; block < block_count; block++ ) { if ( information->inactive_per_block[ block ] == 477c0: 4282 clrl %d2 <== NOT EXECUTED information->allocation_size ) { /* * Assume the Inactive chain is never empty at this point */ the_object = (Objects_Control *) information->Inactive.first; 477c2: 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 ); 477c6: 47f9 0004 ba80 lea 4ba80 <_Chain_Extract>,%a3 * Assume the Inactive chain is never empty at this point */ the_object = (Objects_Control *) information->Inactive.first; do { index = _Objects_Get_index( the_object->id ); 477cc: 4280 clrl %d0 477ce: 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; 477d2: 2810 movel %a0@,%d4 if ((index >= index_base) && 477d4: b680 cmpl %d0,%d3 477d6: 620c bhis 477e4 <_Objects_Shrink_information+0x80> (index < (index_base + information->allocation_size))) { 477d8: 4281 clrl %d1 477da: 322a 0012 movew %a2@(18),%d1 477de: d283 addl %d3,%d1 477e0: b280 cmpl %d0,%d1 477e2: 623e bhis 47822 <_Objects_Shrink_information+0xbe> _Chain_Extract( &extract_me->Node ); } } while ( the_object ); 477e4: 2044 moveal %d4,%a0 477e6: 4a84 tstl %d4 477e8: 66e2 bnes 477cc <_Objects_Shrink_information+0x68> /* * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); 477ea: 206a 002e moveal %a2@(46),%a0 477ee: 2f30 2800 movel %a0@(00000000,%d2:l),%sp@- 477f2: 4eb9 0004 920c jsr 4920c <_Workspace_Free> information->object_blocks[ block ] = NULL; 477f8: 206a 002e moveal %a2@(46),%a0 information->inactive_per_block[ block ] = 0; information->inactive -= information->allocation_size; return; 477fc: 588f addql #4,%sp _Workspace_Free( information->object_blocks[ block ] ); information->object_blocks[ block ] = NULL; information->inactive_per_block[ block ] = 0; information->inactive -= information->allocation_size; 477fe: 302a 0028 movew %a2@(40),%d0 47802: 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; 47806: 226a 002a moveal %a2@(42),%a1 information->inactive -= information->allocation_size; 4780a: 9081 subl %d1,%d0 * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); information->object_blocks[ block ] = NULL; information->inactive_per_block[ block ] = 0; 4780c: 42b1 2800 clrl %a1@(00000000,%d2:l) /* * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); information->object_blocks[ block ] = NULL; 47810: 42b0 2800 clrl %a0@(00000000,%d2:l) information->inactive_per_block[ block ] = 0; information->inactive -= information->allocation_size; 47814: 3540 0028 movew %d0,%a2@(40) return; } index_base += information->allocation_size; } } 47818: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 4781e: 4e5e unlk %fp 47820: 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 ); 47822: 2f08 movel %a0,%sp@- 47824: 4e93 jsr %a3@ 47826: 588f addql #4,%sp } } while ( the_object ); 47828: 2044 moveal %d4,%a0 4782a: 4a84 tstl %d4 4782c: 669e bnes 477cc <_Objects_Shrink_information+0x68> 4782e: 60ba bras 477ea <_Objects_Shrink_information+0x86> <== ALWAYS TAKEN 000469b4 <_POSIX_Condition_variables_Get>: POSIX_Condition_variables_Control *_POSIX_Condition_variables_Get ( pthread_cond_t *cond, Objects_Locations *location ) { 469b4: 4e56 0000 linkw %fp,#0 469b8: 2f0b movel %a3,%sp@- 469ba: 266e 000c moveal %fp@(12),%a3 469be: 2f0a movel %a2,%sp@- 469c0: 246e 0008 moveal %fp@(8),%a2 int status; if ( !cond ) { 469c4: 4a8a tstl %a2 469c6: 6750 beqs 46a18 <_POSIX_Condition_variables_Get+0x64> *location = OBJECTS_ERROR; return (POSIX_Condition_variables_Control *) 0; } if ( *cond == PTHREAD_COND_INITIALIZER ) { 469c8: 2012 movel %a2@,%d0 469ca: 72ff moveq #-1,%d1 469cc: b280 cmpl %d0,%d1 469ce: 6720 beqs 469f0 <_POSIX_Condition_variables_Get+0x3c> } /* * Now call Objects_Get() */ return (POSIX_Condition_variables_Control *)_Objects_Get( 469d0: 2f0b movel %a3,%sp@- 469d2: 2f00 movel %d0,%sp@- 469d4: 4879 0006 1f62 pea 61f62 <_POSIX_Condition_variables_Information> 469da: 4eb9 0004 97ec jsr 497ec <_Objects_Get> 469e0: 4fef 000c lea %sp@(12),%sp &_POSIX_Condition_variables_Information, (Objects_Id) *cond, location ); } 469e4: 246e fff8 moveal %fp@(-8),%a2 469e8: 266e fffc moveal %fp@(-4),%a3 469ec: 4e5e unlk %fp 469ee: 4e75 rts if ( *cond == PTHREAD_COND_INITIALIZER ) { /* * Do an "auto-create" here. */ status = pthread_cond_init( cond, 0 ); 469f0: 42a7 clrl %sp@- 469f2: 2f0a movel %a2,%sp@- 469f4: 4eb9 0004 6a2c jsr 46a2c if ( status ) { 469fa: 508f addql #8,%sp 469fc: 4a80 tstl %d0 469fe: 6618 bnes 46a18 <_POSIX_Condition_variables_Get+0x64> 46a00: 2012 movel %a2@,%d0 } /* * Now call Objects_Get() */ return (POSIX_Condition_variables_Control *)_Objects_Get( 46a02: 2f0b movel %a3,%sp@- 46a04: 2f00 movel %d0,%sp@- 46a06: 4879 0006 1f62 pea 61f62 <_POSIX_Condition_variables_Information> 46a0c: 4eb9 0004 97ec jsr 497ec <_Objects_Get> 46a12: 4fef 000c lea %sp@(12),%sp 46a16: 60cc bras 469e4 <_POSIX_Condition_variables_Get+0x30> <== ALWAYS TAKEN * Do an "auto-create" here. */ status = pthread_cond_init( cond, 0 ); if ( status ) { *location = OBJECTS_ERROR; 46a18: 7001 moveq #1,%d0 46a1a: 2680 movel %d0,%a3@ return (POSIX_Condition_variables_Control *)_Objects_Get( &_POSIX_Condition_variables_Information, (Objects_Id) *cond, location ); } 46a1c: 246e fff8 moveal %fp@(-8),%a2 * Do an "auto-create" here. */ status = pthread_cond_init( cond, 0 ); if ( status ) { *location = OBJECTS_ERROR; 46a20: 4280 clrl %d0 return (POSIX_Condition_variables_Control *)_Objects_Get( &_POSIX_Condition_variables_Information, (Objects_Id) *cond, location ); } 46a22: 266e fffc moveal %fp@(-4),%a3 46a26: 4e5e unlk %fp 46a28: 4e75 rts ... 00046afc <_POSIX_Condition_variables_Signal_support>: int _POSIX_Condition_variables_Signal_support( pthread_cond_t *cond, bool is_broadcast ) { 46afc: 4e56 ffec linkw %fp,#-20 46b00: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ register POSIX_Condition_variables_Control *the_cond; Objects_Locations location; Thread_Control *the_thread; the_cond = _POSIX_Condition_variables_Get( cond, &location ); 46b04: 486e fffc pea %fp@(-4) 46b08: 2f2e 0008 movel %fp@(8),%sp@- int _POSIX_Condition_variables_Signal_support( pthread_cond_t *cond, bool is_broadcast ) { 46b0c: 142e 000f moveb %fp@(15),%d2 register POSIX_Condition_variables_Control *the_cond; Objects_Locations location; Thread_Control *the_thread; the_cond = _POSIX_Condition_variables_Get( cond, &location ); 46b10: 4eb9 0004 69b4 jsr 469b4 <_POSIX_Condition_variables_Get> switch ( location ) { 46b16: 508f addql #8,%sp { register POSIX_Condition_variables_Control *the_cond; Objects_Locations location; Thread_Control *the_thread; the_cond = _POSIX_Condition_variables_Get( cond, &location ); 46b18: 2640 moveal %d0,%a3 switch ( location ) { 46b1a: 4aae fffc tstl %fp@(-4) 46b1e: 670c beqs 46b2c <_POSIX_Condition_variables_Signal_support+0x30> 46b20: 7016 moveq #22,%d0 case OBJECTS_ERROR: break; } return EINVAL; } 46b22: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3 46b28: 4e5e unlk %fp 46b2a: 4e75 rts the_cond = _POSIX_Condition_variables_Get( cond, &location ); switch ( location ) { case OBJECTS_LOCAL: do { the_thread = _Thread_queue_Dequeue( &the_cond->Wait_queue ); 46b2c: 2600 movel %d0,%d3 46b2e: 0683 0000 0018 addil #24,%d3 46b34: 45f9 0004 a3e8 lea 4a3e8 <_Thread_queue_Dequeue>,%a2 46b3a: 2f03 movel %d3,%sp@- 46b3c: 4e92 jsr %a2@ if ( !the_thread ) 46b3e: 588f addql #4,%sp 46b40: 4a80 tstl %d0 46b42: 671a beqs 46b5e <_POSIX_Condition_variables_Signal_support+0x62> the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX; } while ( is_broadcast && the_thread ); 46b44: 4a02 tstb %d2 46b46: 6704 beqs 46b4c <_POSIX_Condition_variables_Signal_support+0x50> 46b48: 4a80 tstl %d0 46b4a: 66ee bnes 46b3a <_POSIX_Condition_variables_Signal_support+0x3e> _Thread_Enable_dispatch(); 46b4c: 4eb9 0004 9ffc jsr 49ffc <_Thread_Enable_dispatch> 46b52: 4280 clrl %d0 case OBJECTS_ERROR: break; } return EINVAL; } 46b54: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3 46b5a: 4e5e unlk %fp 46b5c: 4e75 rts case OBJECTS_LOCAL: do { the_thread = _Thread_queue_Dequeue( &the_cond->Wait_queue ); if ( !the_thread ) the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX; 46b5e: 42ab 0014 clrl %a3@(20) 46b62: 60e0 bras 46b44 <_POSIX_Condition_variables_Signal_support+0x48> <== ALWAYS TAKEN 00046bc8 <_POSIX_Condition_variables_Wait_support>: pthread_cond_t *cond, pthread_mutex_t *mutex, Watchdog_Interval timeout, bool already_timedout ) { 46bc8: 4e56 ffe8 linkw %fp,#-24 46bcc: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@ register POSIX_Condition_variables_Control *the_cond; Objects_Locations location; int status; int mutex_status; if ( !_POSIX_Mutex_Get( mutex, &location ) ) { 46bd0: 240e movel %fp,%d2 46bd2: 5982 subql #4,%d2 46bd4: 2f02 movel %d2,%sp@- pthread_cond_t *cond, pthread_mutex_t *mutex, Watchdog_Interval timeout, bool already_timedout ) { 46bd6: 246e 000c moveal %fp@(12),%a2 register POSIX_Condition_variables_Control *the_cond; Objects_Locations location; int status; int mutex_status; if ( !_POSIX_Mutex_Get( mutex, &location ) ) { 46bda: 2f0a movel %a2,%sp@- pthread_cond_t *cond, pthread_mutex_t *mutex, Watchdog_Interval timeout, bool already_timedout ) { 46bdc: 266e 0008 moveal %fp@(8),%a3 46be0: 162e 0017 moveb %fp@(23),%d3 register POSIX_Condition_variables_Control *the_cond; Objects_Locations location; int status; int mutex_status; if ( !_POSIX_Mutex_Get( mutex, &location ) ) { 46be4: 4eb9 0004 6dbe jsr 46dbe <_POSIX_Mutex_Get> 46bea: 508f addql #8,%sp 46bec: 4a80 tstl %d0 46bee: 6764 beqs 46c54 <_POSIX_Condition_variables_Wait_support+0x8c> <== ALWAYS TAKEN */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 46bf0: 2039 0006 1b94 movel 61b94 <_Thread_Dispatch_disable_level>,%d0 46bf6: 5380 subql #1,%d0 return EINVAL; } _Thread_Unnest_dispatch(); the_cond = _POSIX_Condition_variables_Get( cond, &location ); 46bf8: 2f02 movel %d2,%sp@- 46bfa: 23c0 0006 1b94 movel %d0,61b94 <_Thread_Dispatch_disable_level> 46c00: 2f0b movel %a3,%sp@- 46c02: 4eb9 0004 69b4 jsr 469b4 <_POSIX_Condition_variables_Get> switch ( location ) { 46c08: 508f addql #8,%sp return EINVAL; } _Thread_Unnest_dispatch(); the_cond = _POSIX_Condition_variables_Get( cond, &location ); 46c0a: 2840 moveal %d0,%a4 switch ( location ) { 46c0c: 4aae fffc tstl %fp@(-4) 46c10: 6642 bnes 46c54 <_POSIX_Condition_variables_Wait_support+0x8c> case OBJECTS_LOCAL: if ( the_cond->Mutex && ( the_cond->Mutex != *mutex ) ) { 46c12: 202c 0014 movel %a4@(20),%d0 46c16: 6718 beqs 46c30 <_POSIX_Condition_variables_Wait_support+0x68> 46c18: b092 cmpl %a2@,%d0 46c1a: 6714 beqs 46c30 <_POSIX_Condition_variables_Wait_support+0x68> _Thread_Enable_dispatch(); 46c1c: 4eb9 0004 9ffc jsr 49ffc <_Thread_Enable_dispatch> 46c22: 7416 moveq #22,%d2 case OBJECTS_ERROR: break; } return EINVAL; } 46c24: 2002 movel %d2,%d0 46c26: 4cee 1c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a4 46c2c: 4e5e unlk %fp 46c2e: 4e75 rts if ( the_cond->Mutex && ( the_cond->Mutex != *mutex ) ) { _Thread_Enable_dispatch(); return EINVAL; } (void) pthread_mutex_unlock( mutex ); 46c30: 2f0a movel %a2,%sp@- 46c32: 4eb9 0004 700c jsr 4700c _Thread_Enable_dispatch(); return EINVAL; } */ if ( !already_timedout ) { 46c38: 588f addql #4,%sp 46c3a: 4a03 tstb %d3 46c3c: 6724 beqs 46c62 <_POSIX_Condition_variables_Wait_support+0x9a> status = _Thread_Executing->Wait.return_code; if ( status && status != ETIMEDOUT ) return status; } else { _Thread_Enable_dispatch(); 46c3e: 4eb9 0004 9ffc jsr 49ffc <_Thread_Enable_dispatch> 46c44: 7474 moveq #116,%d2 /* * When we get here the dispatch disable level is 0. */ mutex_status = pthread_mutex_lock( mutex ); 46c46: 2f0a movel %a2,%sp@- 46c48: 4eb9 0004 6f70 jsr 46f70 if ( mutex_status ) 46c4e: 588f addql #4,%sp 46c50: 4a80 tstl %d0 46c52: 67d0 beqs 46c24 <_POSIX_Condition_variables_Wait_support+0x5c> 46c54: 7416 moveq #22,%d2 case OBJECTS_ERROR: break; } return EINVAL; } 46c56: 2002 movel %d2,%d0 46c58: 4cee 1c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a4 46c5e: 4e5e unlk %fp 46c60: 4e75 rts return EINVAL; } */ if ( !already_timedout ) { the_cond->Mutex = *mutex; 46c62: 2952 0014 movel %a2@,%a4@(20) _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); _Thread_Executing->Wait.return_code = 0; _Thread_Executing->Wait.queue = &the_cond->Wait_queue; 46c66: 200c movel %a4,%d0 46c68: 0680 0000 0018 addil #24,%d0 RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section ( Thread_queue_Control *the_thread_queue ) { the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 46c6e: 7201 moveq #1,%d1 if ( !already_timedout ) { the_cond->Mutex = *mutex; _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); _Thread_Executing->Wait.return_code = 0; 46c70: 2079 0006 1c4e moveal 61c4e <_Thread_Executing>,%a0 46c76: 42a8 0034 clrl %a0@(52) _Thread_Executing->Wait.queue = &the_cond->Wait_queue; _Thread_Executing->Wait.id = *cond; 46c7a: 2153 0020 movel %a3@,%a0@(32) if ( !already_timedout ) { the_cond->Mutex = *mutex; _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); _Thread_Executing->Wait.return_code = 0; _Thread_Executing->Wait.queue = &the_cond->Wait_queue; 46c7e: 2140 0044 movel %d0,%a0@(68) 46c82: 2941 0048 movel %d1,%a4@(72) _Thread_Executing->Wait.id = *cond; _Thread_queue_Enqueue( &the_cond->Wait_queue, timeout ); 46c86: 4879 0004 a904 pea 4a904 <_Thread_queue_Timeout> 46c8c: 2f2e 0010 movel %fp@(16),%sp@- 46c90: 2f00 movel %d0,%sp@- 46c92: 4eb9 0004 a548 jsr 4a548 <_Thread_queue_Enqueue_with_handler> _Thread_Enable_dispatch(); 46c98: 4eb9 0004 9ffc jsr 49ffc <_Thread_Enable_dispatch> /* * Switch ourself out because we blocked as a result of the * _Thread_queue_Enqueue. */ status = _Thread_Executing->Wait.return_code; 46c9e: 2079 0006 1c4e moveal 61c4e <_Thread_Executing>,%a0 if ( status && status != ETIMEDOUT ) 46ca4: 4fef 000c lea %sp@(12),%sp /* * Switch ourself out because we blocked as a result of the * _Thread_queue_Enqueue. */ status = _Thread_Executing->Wait.return_code; 46ca8: 2428 0034 movel %a0@(52),%d2 if ( status && status != ETIMEDOUT ) 46cac: 6798 beqs 46c46 <_POSIX_Condition_variables_Wait_support+0x7e> 46cae: 7074 moveq #116,%d0 46cb0: b082 cmpl %d2,%d0 46cb2: 6792 beqs 46c46 <_POSIX_Condition_variables_Wait_support+0x7e> <== NEVER TAKEN case OBJECTS_ERROR: break; } return EINVAL; } 46cb4: 2002 movel %d2,%d0 <== NOT EXECUTED 46cb6: 4cee 1c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a4 <== NOT EXECUTED 46cbc: 4e5e unlk %fp <== NOT EXECUTED 46cbe: 4e75 rts 000526b4 <_POSIX_Message_queue_Create_support>: const char *name_arg, int pshared, struct mq_attr *attr_ptr, POSIX_Message_queue_Control **message_queue ) { 526b4: 4e56 ffe8 linkw %fp,#-24 526b8: 48d7 047c moveml %d2-%d6/%a2,%sp@ CORE_message_queue_Attributes *the_mq_attr; struct mq_attr attr; char *name; size_t n; n = strnlen( name_arg, NAME_MAX ); 526bc: 4878 00ff pea ff const char *name_arg, int pshared, struct mq_attr *attr_ptr, POSIX_Message_queue_Control **message_queue ) { 526c0: 262e 0008 movel %fp@(8),%d3 CORE_message_queue_Attributes *the_mq_attr; struct mq_attr attr; char *name; size_t n; n = strnlen( name_arg, NAME_MAX ); 526c4: 2f03 movel %d3,%sp@- const char *name_arg, int pshared, struct mq_attr *attr_ptr, POSIX_Message_queue_Control **message_queue ) { 526c6: 246e 0010 moveal %fp@(16),%a2 CORE_message_queue_Attributes *the_mq_attr; struct mq_attr attr; char *name; size_t n; n = strnlen( name_arg, NAME_MAX ); 526ca: 4eb9 0005 8248 jsr 58248 526d0: 2800 movel %d0,%d4 526d2: 2039 0006 8b20 movel 68b20 <_Thread_Dispatch_disable_level>,%d0 526d8: 5280 addql #1,%d0 526da: 23c0 0006 8b20 movel %d0,68b20 <_Thread_Dispatch_disable_level> * There is no real basis for the default values. They will work * but were not compared against any existing implementation for * compatibility. See README.mqueue for an example program we * think will print out the defaults. Report anything you find with it. */ if ( attr_ptr == NULL ) { 526e0: 508f addql #8,%sp 526e2: 4a8a tstl %a2 526e4: 6700 00a4 beqw 5278a <_POSIX_Message_queue_Create_support+0xd6> attr.mq_maxmsg = 10; attr.mq_msgsize = 16; } else { if ( attr_ptr->mq_maxmsg <= 0 ){ 526e8: 2a2a 0004 movel %a2@(4),%d5 526ec: 6f00 00a4 blew 52792 <_POSIX_Message_queue_Create_support+0xde> _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EINVAL ); } if ( attr_ptr->mq_msgsize <= 0 ){ 526f0: 2c2a 0008 movel %a2@(8),%d6 526f4: 6f00 009c blew 52792 <_POSIX_Message_queue_Create_support+0xde> */ RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Allocate( void ) { return (POSIX_Message_queue_Control *) 526f8: 4879 0006 8dee pea 68dee <_POSIX_Message_queue_Information> 526fe: 4eb9 0004 e80c jsr 4e80c <_Objects_Allocate> attr = *attr_ptr; } the_mq = _POSIX_Message_queue_Allocate(); if ( !the_mq ) { 52704: 588f addql #4,%sp 52706: 2440 moveal %d0,%a2 52708: 4a80 tstl %d0 5270a: 6700 010a beqw 52816 <_POSIX_Message_queue_Create_support+0x162> rtems_set_errno_and_return_minus_one( ENFILE ); } the_mq->process_shared = pshared; the_mq->named = true; the_mq->open_count = 1; 5270e: 7001 moveq #1,%d0 /* * Make a copy of the user's string for name just in case it was * dynamically constructed. */ name = _Workspace_Allocate(n+1); 52710: 5284 addql #1,%d4 if ( !the_mq ) { _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( ENFILE ); } the_mq->process_shared = pshared; 52712: 256e 000c 0010 movel %fp@(12),%a2@(16) the_mq->named = true; 52718: 1540 0014 moveb %d0,%a2@(20) the_mq->open_count = 1; 5271c: 2540 0016 movel %d0,%a2@(22) the_mq->linked = true; 52720: 1540 0015 moveb %d0,%a2@(21) /* * Make a copy of the user's string for name just in case it was * dynamically constructed. */ name = _Workspace_Allocate(n+1); 52724: 2f04 movel %d4,%sp@- 52726: 4eb9 0005 0ab4 jsr 50ab4 <_Workspace_Allocate> if (!name) { 5272c: 588f addql #4,%sp /* * Make a copy of the user's string for name just in case it was * dynamically constructed. */ name = _Workspace_Allocate(n+1); 5272e: 2400 movel %d0,%d2 if (!name) { 52730: 6700 00b6 beqw 527e8 <_POSIX_Message_queue_Create_support+0x134> _POSIX_Message_queue_Free( the_mq ); _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( ENOMEM ); } strncpy( name, name_arg, n+1 ); 52734: 2f04 movel %d4,%sp@- 52736: 2f03 movel %d3,%sp@- 52738: 2f00 movel %d0,%sp@- 5273a: 4eb9 0005 81c0 jsr 581c0 * * Joel: Cite POSIX or OpenGroup on above statement so we can determine * if it is a real requirement. */ the_mq_attr = &the_mq->Message_queue.Attributes; the_mq_attr->discipline = CORE_MESSAGE_QUEUE_DISCIPLINES_FIFO; 52740: 42aa 005a clrl %a2@(90) if ( !_CORE_message_queue_Initialize( 52744: 2f06 movel %d6,%sp@- 52746: 2f05 movel %d5,%sp@- 52748: 486a 005a pea %a2@(90) 5274c: 486a 001a pea %a2@(26) 52750: 4eb9 0005 36ac jsr 536ac <_CORE_message_queue_Initialize> 52756: 4fef 001c lea %sp@(28),%sp 5275a: 4a00 tstb %d0 5275c: 6752 beqs 527b0 <_POSIX_Message_queue_Create_support+0xfc> #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 5275e: 4280 clrl %d0 52760: 2079 0006 8e06 moveal 68e06 <_POSIX_Message_queue_Information+0x18>,%a0 52766: 302a 000a movew %a2@(10),%d0 5276a: 218a 0c00 movel %a2,%a0@(00000000,%d0:l:4) the_object ); #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) /* ASSERT: information->is_string */ the_object->name.name_p = name; 5276e: 2542 000c movel %d2,%a2@(12) &_POSIX_Message_queue_Information, &the_mq->Object, name ); *message_queue = the_mq; 52772: 206e 0014 moveal %fp@(20),%a0 52776: 208a movel %a2,%a0@ _Thread_Enable_dispatch(); 52778: 4eb9 0004 f588 jsr 4f588 <_Thread_Enable_dispatch> return 0; } 5277e: 4cee 047c ffe8 moveml %fp@(-24),%d2-%d6/%a2 name ); *message_queue = the_mq; _Thread_Enable_dispatch(); 52784: 4280 clrl %d0 return 0; } 52786: 4e5e unlk %fp 52788: 4e75 rts rtems_set_errno_and_return_minus_one( EINVAL ); } if ( attr_ptr->mq_msgsize <= 0 ){ _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EINVAL ); 5278a: 7a0a moveq #10,%d5 5278c: 7c10 moveq #16,%d6 5278e: 6000 ff68 braw 526f8 <_POSIX_Message_queue_Create_support+0x44> <== ALWAYS TAKEN _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EINVAL ); } if ( attr_ptr->mq_msgsize <= 0 ){ _Thread_Enable_dispatch(); 52792: 4eb9 0004 f588 jsr 4f588 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EINVAL ); 52798: 7816 moveq #22,%d4 5279a: 4eb9 0005 66dc jsr 566dc <__errno> 527a0: 2040 moveal %d0,%a0 527a2: 70ff moveq #-1,%d0 527a4: 2084 movel %d4,%a0@ *message_queue = the_mq; _Thread_Enable_dispatch(); return 0; } 527a6: 4cee 047c ffe8 moveml %fp@(-24),%d2-%d6/%a2 527ac: 4e5e unlk %fp 527ae: 4e75 rts RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free ( POSIX_Message_queue_Control *the_mq ) { _Objects_Free( &_POSIX_Message_queue_Information, &the_mq->Object ); 527b0: 2f0a movel %a2,%sp@- 527b2: 4879 0006 8dee pea 68dee <_POSIX_Message_queue_Information> 527b8: 4eb9 0004 eb44 jsr 4eb44 <_Objects_Free> attr.mq_maxmsg, attr.mq_msgsize ) ) { _POSIX_Message_queue_Free( the_mq ); _Workspace_Free(name); 527be: 2f02 movel %d2,%sp@- 527c0: 4eb9 0005 0ad0 jsr 50ad0 <_Workspace_Free> _Thread_Enable_dispatch(); 527c6: 4eb9 0004 f588 jsr 4f588 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( ENOSPC ); 527cc: 4eb9 0005 66dc jsr 566dc <__errno> 527d2: 4fef 000c lea %sp@(12),%sp 527d6: 721c moveq #28,%d1 527d8: 2040 moveal %d0,%a0 527da: 70ff moveq #-1,%d0 *message_queue = the_mq; _Thread_Enable_dispatch(); return 0; } 527dc: 4cee 047c ffe8 moveml %fp@(-24),%d2-%d6/%a2 ) ) { _POSIX_Message_queue_Free( the_mq ); _Workspace_Free(name); _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( ENOSPC ); 527e2: 2081 movel %d1,%a0@ *message_queue = the_mq; _Thread_Enable_dispatch(); return 0; } 527e4: 4e5e unlk %fp 527e6: 4e75 rts 527e8: 2f0a movel %a2,%sp@- 527ea: 4879 0006 8dee pea 68dee <_POSIX_Message_queue_Information> */ name = _Workspace_Allocate(n+1); if (!name) { _POSIX_Message_queue_Free( the_mq ); _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( ENOMEM ); 527f0: 740c moveq #12,%d2 527f2: 4eb9 0004 eb44 jsr 4eb44 <_Objects_Free> * dynamically constructed. */ name = _Workspace_Allocate(n+1); if (!name) { _POSIX_Message_queue_Free( the_mq ); _Thread_Enable_dispatch(); 527f8: 4eb9 0004 f588 jsr 4f588 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( ENOMEM ); 527fe: 4eb9 0005 66dc jsr 566dc <__errno> 52804: 508f addql #8,%sp 52806: 2040 moveal %d0,%a0 52808: 70ff moveq #-1,%d0 5280a: 2082 movel %d2,%a0@ *message_queue = the_mq; _Thread_Enable_dispatch(); return 0; } 5280c: 4cee 047c ffe8 moveml %fp@(-24),%d2-%d6/%a2 52812: 4e5e unlk %fp 52814: 4e75 rts attr = *attr_ptr; } the_mq = _POSIX_Message_queue_Allocate(); if ( !the_mq ) { _Thread_Enable_dispatch(); 52816: 4eb9 0004 f588 jsr 4f588 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( ENFILE ); 5281c: 7617 moveq #23,%d3 5281e: 4eb9 0005 66dc jsr 566dc <__errno> 52824: 2040 moveal %d0,%a0 52826: 70ff moveq #-1,%d0 52828: 2083 movel %d3,%a0@ *message_queue = the_mq; _Thread_Enable_dispatch(); return 0; } 5282a: 4cee 047c ffe8 moveml %fp@(-24),%d2-%d6/%a2 52830: 4e5e unlk %fp 52832: 4e75 rts 0004b8a0 <_POSIX_Message_queue_Receive_support>: size_t msg_len, unsigned int *msg_prio, bool wait, Watchdog_Interval timeout ) { 4b8a0: 4e56 ffe8 linkw %fp,#-24 4b8a4: 48d7 041c moveml %d2-%d4/%a2,%sp@ RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control_fd *_POSIX_Message_queue_Get_fd ( mqd_t id, Objects_Locations *location ) { return (POSIX_Message_queue_Control_fd *) _Objects_Get( 4b8a8: 486e fffc pea %fp@(-4) 4b8ac: 242e 0008 movel %fp@(8),%d2 4b8b0: 2f02 movel %d2,%sp@- 4b8b2: 4879 0006 8f5c pea 68f5c <_POSIX_Message_queue_Information_fds> 4b8b8: 246e 0014 moveal %fp@(20),%a2 4b8bc: 262e 0018 movel %fp@(24),%d3 4b8c0: 4eb9 0004 eca8 jsr 4eca8 <_Objects_Get> Objects_Locations location; size_t length_out; bool do_wait; the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); switch ( location ) { 4b8c6: 4fef 000c lea %sp@(12),%sp 4b8ca: 2040 moveal %d0,%a0 4b8cc: 4aae fffc tstl %fp@(-4) 4b8d0: 671a beqs 4b8ec <_POSIX_Message_queue_Receive_support+0x4c> #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); 4b8d2: 4eb9 0005 66dc jsr 566dc <__errno> 4b8d8: 72ff moveq #-1,%d1 4b8da: 2040 moveal %d0,%a0 4b8dc: 7009 moveq #9,%d0 } 4b8de: 4cee 041c ffe8 moveml %fp@(-24),%d2-%d4/%a2 #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); 4b8e4: 2080 movel %d0,%a0@ } 4b8e6: 2001 movel %d1,%d0 4b8e8: 4e5e unlk %fp 4b8ea: 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 ) { 4b8ec: 2028 0014 movel %a0@(20),%d0 4b8f0: 7203 moveq #3,%d1 4b8f2: 7801 moveq #1,%d4 4b8f4: c280 andl %d0,%d1 4b8f6: b881 cmpl %d1,%d4 4b8f8: 6700 00f2 beqw 4b9ec <_POSIX_Message_queue_Receive_support+0x14c> _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EBADF ); } the_mq = the_mq_fd->Queue; 4b8fc: 2068 0010 moveal %a0@(16),%a0 if ( msg_len < the_mq->Message_queue.maximum_message_size ) { 4b900: 222e 0010 movel %fp@(16),%d1 4b904: b2a8 0066 cmpl %a0@(102),%d1 4b908: 6500 0098 bcsw 4b9a2 <_POSIX_Message_queue_Receive_support+0x102> length_out = -1; /* * A timed receive with a bad time will do a poll regardless. */ if ( wait ) 4b90c: 4a03 tstb %d3 4b90e: 6756 beqs 4b966 <_POSIX_Message_queue_Receive_support+0xc6> <== ALWAYS TAKEN 4b910: 720e moveq #14,%d1 4b912: e2a8 lsrl %d1,%d0 4b914: 7801 moveq #1,%d4 4b916: b980 eorl %d4,%d0 do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 4b918: 2f2e 001c movel %fp@(28),%sp@- length_out = -1; /* * A timed receive with a bad time will do a poll regardless. */ if ( wait ) 4b91c: c084 andl %d4,%d0 do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 4b91e: 2f00 movel %d0,%sp@- 4b920: 486e fff8 pea %fp@(-8) /* * Now if something goes wrong, we return a "length" of -1 * to indicate an error. */ length_out = -1; 4b924: 70ff moveq #-1,%d0 do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 4b926: 2f2e 000c movel %fp@(12),%sp@- 4b92a: 2f02 movel %d2,%sp@- 4b92c: 4868 001a pea %a0@(26) /* * Now if something goes wrong, we return a "length" of -1 * to indicate an error. */ length_out = -1; 4b930: 2d40 fff8 movel %d0,%fp@(-8) do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 4b934: 4eb9 0004 dc10 jsr 4dc10 <_CORE_message_queue_Seize> &length_out, do_wait, timeout ); _Thread_Enable_dispatch(); 4b93a: 4eb9 0004 f588 jsr 4f588 <_Thread_Enable_dispatch> *msg_prio = _POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count); 4b940: 2079 0006 8bda moveal 68bda <_Thread_Executing>,%a0 do_wait, timeout ); _Thread_Enable_dispatch(); *msg_prio = 4b946: 24a8 0024 movel %a0@(36),%a2@ 4b94a: 6d4e blts 4b99a <_POSIX_Message_queue_Receive_support+0xfa> _POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count); if ( !_Thread_Executing->Wait.return_code ) 4b94c: 4fef 0018 lea %sp@(24),%sp 4b950: 4aa8 0034 tstl %a0@(52) 4b954: 666c bnes 4b9c2 <_POSIX_Message_queue_Receive_support+0x122> return length_out; 4b956: 222e fff8 movel %fp@(-8),%d1 case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); } 4b95a: 2001 movel %d1,%d0 4b95c: 4cee 041c ffe8 moveml %fp@(-24),%d2-%d4/%a2 4b962: 4e5e unlk %fp 4b964: 4e75 rts do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 4b966: 2f2e 001c movel %fp@(28),%sp@- <== NOT EXECUTED length_out = -1; /* * A timed receive with a bad time will do a poll regardless. */ if ( wait ) 4b96a: 4280 clrl %d0 <== NOT EXECUTED do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 4b96c: 2f00 movel %d0,%sp@- <== NOT EXECUTED 4b96e: 486e fff8 pea %fp@(-8) <== NOT EXECUTED /* * Now if something goes wrong, we return a "length" of -1 * to indicate an error. */ length_out = -1; 4b972: 70ff moveq #-1,%d0 <== NOT EXECUTED do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 4b974: 2f2e 000c movel %fp@(12),%sp@- <== NOT EXECUTED 4b978: 2f02 movel %d2,%sp@- <== NOT EXECUTED 4b97a: 4868 001a pea %a0@(26) <== NOT EXECUTED /* * Now if something goes wrong, we return a "length" of -1 * to indicate an error. */ length_out = -1; 4b97e: 2d40 fff8 movel %d0,%fp@(-8) <== NOT EXECUTED do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 4b982: 4eb9 0004 dc10 jsr 4dc10 <_CORE_message_queue_Seize> <== NOT EXECUTED &length_out, do_wait, timeout ); _Thread_Enable_dispatch(); 4b988: 4eb9 0004 f588 jsr 4f588 <_Thread_Enable_dispatch> <== NOT EXECUTED *msg_prio = _POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count); 4b98e: 2079 0006 8bda moveal 68bda <_Thread_Executing>,%a0 <== NOT EXECUTED do_wait, timeout ); _Thread_Enable_dispatch(); *msg_prio = 4b994: 24a8 0024 movel %a0@(36),%a2@ <== NOT EXECUTED 4b998: 6cb2 bges 4b94c <_POSIX_Message_queue_Receive_support+0xac> <== NOT EXECUTED 4b99a: 2212 movel %a2@,%d1 4b99c: 4481 negl %d1 4b99e: 2481 movel %d1,%a2@ 4b9a0: 60aa bras 4b94c <_POSIX_Message_queue_Receive_support+0xac> <== ALWAYS TAKEN } the_mq = the_mq_fd->Queue; if ( msg_len < the_mq->Message_queue.maximum_message_size ) { _Thread_Enable_dispatch(); 4b9a2: 4eb9 0004 f588 jsr 4f588 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EMSGSIZE ); 4b9a8: 747a moveq #122,%d2 4b9aa: 4eb9 0005 66dc jsr 566dc <__errno> 4b9b0: 72ff moveq #-1,%d1 4b9b2: 2040 moveal %d0,%a0 case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); } 4b9b4: 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 ); 4b9b6: 2082 movel %d2,%a0@ case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); } 4b9b8: 4cee 041c ffe8 moveml %fp@(-24),%d2-%d4/%a2 4b9be: 4e5e unlk %fp 4b9c0: 4e75 rts _POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count); if ( !_Thread_Executing->Wait.return_code ) return length_out; rtems_set_errno_and_return_minus_one( 4b9c2: 4eb9 0005 66dc jsr 566dc <__errno> 4b9c8: 2079 0006 8bda moveal 68bda <_Thread_Executing>,%a0 4b9ce: 2440 moveal %d0,%a2 4b9d0: 2f28 0034 movel %a0@(52),%sp@- 4b9d4: 4eb9 0004 bca0 jsr 4bca0 <_POSIX_Message_queue_Translate_core_message_queue_return_code> 4b9da: 588f addql #4,%sp 4b9dc: 72ff moveq #-1,%d1 4b9de: 2480 movel %d0,%a2@ case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); } 4b9e0: 2001 movel %d1,%d0 4b9e2: 4cee 041c ffe8 moveml %fp@(-24),%d2-%d4/%a2 4b9e8: 4e5e unlk %fp 4b9ea: 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(); 4b9ec: 4eb9 0004 f588 jsr 4f588 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EBADF ); 4b9f2: 7609 moveq #9,%d3 4b9f4: 4eb9 0005 66dc jsr 566dc <__errno> 4b9fa: 72ff moveq #-1,%d1 4b9fc: 2040 moveal %d0,%a0 case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); } 4b9fe: 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 ); 4ba00: 2083 movel %d3,%a0@ case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); } 4ba02: 4cee 041c ffe8 moveml %fp@(-24),%d2-%d4/%a2 4ba08: 4e5e unlk %fp 4ba0a: 4e75 rts 0004ba30 <_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 ) 4ba30: 7020 moveq #32,%d0 size_t msg_len, uint32_t msg_prio, bool wait, Watchdog_Interval timeout ) { 4ba32: 4e56 ffec linkw %fp,#-20 4ba36: 48d7 041c moveml %d2-%d4/%a2,%sp@ 4ba3a: 262e 0008 movel %fp@(8),%d3 4ba3e: 242e 0014 movel %fp@(20),%d2 4ba42: 282e 0018 movel %fp@(24),%d4 /* * Validate the priority. * XXX - Do not validate msg_prio is not less than 0. */ if ( msg_prio > MQ_PRIO_MAX ) 4ba46: b082 cmpl %d2,%d0 4ba48: 6500 00e2 bcsw 4bb2c <_POSIX_Message_queue_Send_support+0xfc> 4ba4c: 486e fffc pea %fp@(-4) 4ba50: 2f03 movel %d3,%sp@- 4ba52: 4879 0006 8f5c pea 68f5c <_POSIX_Message_queue_Information_fds> 4ba58: 4eb9 0004 eca8 jsr 4eca8 <_Objects_Get> rtems_set_errno_and_return_minus_one( EINVAL ); the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); switch ( location ) { 4ba5e: 4fef 000c lea %sp@(12),%sp 4ba62: 2040 moveal %d0,%a0 4ba64: 4aae fffc tstl %fp@(-4) 4ba68: 6600 00a8 bnew 4bb12 <_POSIX_Message_queue_Send_support+0xe2> case OBJECTS_LOCAL: if ( (the_mq_fd->oflag & O_ACCMODE) == O_RDONLY ) { 4ba6c: 2028 0014 movel %a0@(20),%d0 4ba70: 7203 moveq #3,%d1 4ba72: c280 andl %d0,%d1 4ba74: 6700 00d0 beqw 4bb46 <_POSIX_Message_queue_Send_support+0x116> _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EBADF ); } the_mq = the_mq_fd->Queue; 4ba78: 2068 0010 moveal %a0@(16),%a0 /* * A timed receive with a bad time will do a poll regardless. */ if ( wait ) 4ba7c: 4a04 tstb %d4 4ba7e: 6752 beqs 4bad2 <_POSIX_Message_queue_Send_support+0xa2> 4ba80: 720e moveq #14,%d1 4ba82: e2a8 lsrl %d1,%d0 4ba84: 123c 0001 moveb #1,%d1 do_wait = wait; /* * Now perform the actual message receive */ msg_status = _CORE_message_queue_Submit( 4ba88: 4482 negl %d2 the_mq = the_mq_fd->Queue; /* * A timed receive with a bad time will do a poll regardless. */ if ( wait ) 4ba8a: b380 eorl %d1,%d0 do_wait = wait; /* * Now perform the actual message receive */ msg_status = _CORE_message_queue_Submit( 4ba8c: 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 ) 4ba90: c081 andl %d1,%d0 do_wait = wait; /* * Now perform the actual message receive */ msg_status = _CORE_message_queue_Submit( 4ba92: 2f00 movel %d0,%sp@- 4ba94: 2f02 movel %d2,%sp@- 4ba96: 42a7 clrl %sp@- 4ba98: 2f03 movel %d3,%sp@- 4ba9a: 2f2e 0010 movel %fp@(16),%sp@- 4ba9e: 2f2e 000c movel %fp@(12),%sp@- 4baa2: 4868 001a pea %a0@(26) 4baa6: 4eb9 0004 dd48 jsr 4dd48 <_CORE_message_queue_Submit> _POSIX_Message_queue_Priority_to_core( msg_prio ), do_wait, timeout /* no timeout */ ); _Thread_Enable_dispatch(); 4baac: 4fef 0020 lea %sp@(32),%sp do_wait = wait; /* * Now perform the actual message receive */ msg_status = _CORE_message_queue_Submit( 4bab0: 2400 movel %d0,%d2 _POSIX_Message_queue_Priority_to_core( msg_prio ), do_wait, timeout /* no timeout */ ); _Thread_Enable_dispatch(); 4bab2: 4eb9 0004 f588 jsr 4f588 <_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 ) 4bab8: 7007 moveq #7,%d0 4baba: b082 cmpl %d2,%d0 4babc: 6748 beqs 4bb06 <_POSIX_Message_queue_Send_support+0xd6> msg_status = _Thread_Executing->Wait.return_code; if ( !msg_status ) 4babe: 4a82 tstl %d2 4bac0: 6600 00a4 bnew 4bb66 <_POSIX_Message_queue_Send_support+0x136> 4bac4: 4281 clrl %d1 case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); } 4bac6: 2001 movel %d1,%d0 4bac8: 4cee 041c ffec moveml %fp@(-20),%d2-%d4/%a2 4bace: 4e5e unlk %fp 4bad0: 4e75 rts do_wait = wait; /* * Now perform the actual message receive */ msg_status = _CORE_message_queue_Submit( 4bad2: 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 ) 4bad6: 4280 clrl %d0 do_wait = wait; /* * Now perform the actual message receive */ msg_status = _CORE_message_queue_Submit( 4bad8: 4482 negl %d2 4bada: 2f00 movel %d0,%sp@- 4badc: 2f02 movel %d2,%sp@- 4bade: 42a7 clrl %sp@- 4bae0: 2f03 movel %d3,%sp@- 4bae2: 2f2e 0010 movel %fp@(16),%sp@- 4bae6: 2f2e 000c movel %fp@(12),%sp@- 4baea: 4868 001a pea %a0@(26) 4baee: 4eb9 0004 dd48 jsr 4dd48 <_CORE_message_queue_Submit> _POSIX_Message_queue_Priority_to_core( msg_prio ), do_wait, timeout /* no timeout */ ); _Thread_Enable_dispatch(); 4baf4: 4fef 0020 lea %sp@(32),%sp do_wait = wait; /* * Now perform the actual message receive */ msg_status = _CORE_message_queue_Submit( 4baf8: 2400 movel %d0,%d2 _POSIX_Message_queue_Priority_to_core( msg_prio ), do_wait, timeout /* no timeout */ ); _Thread_Enable_dispatch(); 4bafa: 4eb9 0004 f588 jsr 4f588 <_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 ) 4bb00: 7007 moveq #7,%d0 4bb02: b082 cmpl %d2,%d0 4bb04: 66b8 bnes 4babe <_POSIX_Message_queue_Send_support+0x8e> <== NEVER TAKEN msg_status = _Thread_Executing->Wait.return_code; 4bb06: 2079 0006 8bda moveal 68bda <_Thread_Executing>,%a0 4bb0c: 2428 0034 movel %a0@(52),%d2 4bb10: 60ac bras 4babe <_POSIX_Message_queue_Send_support+0x8e> <== ALWAYS TAKEN #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); 4bb12: 4eb9 0005 66dc jsr 566dc <__errno> 4bb18: 72ff moveq #-1,%d1 4bb1a: 2040 moveal %d0,%a0 4bb1c: 7009 moveq #9,%d0 } 4bb1e: 4cee 041c ffec moveml %fp@(-20),%d2-%d4/%a2 #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); 4bb24: 2080 movel %d0,%a0@ } 4bb26: 2001 movel %d1,%d0 4bb28: 4e5e unlk %fp 4bb2a: 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 ); 4bb2c: 4eb9 0005 66dc jsr 566dc <__errno> 4bb32: 7616 moveq #22,%d3 4bb34: 72ff moveq #-1,%d1 4bb36: 2040 moveal %d0,%a0 case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); } 4bb38: 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 ); 4bb3a: 2083 movel %d3,%a0@ case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); } 4bb3c: 4cee 041c ffec moveml %fp@(-20),%d2-%d4/%a2 4bb42: 4e5e unlk %fp 4bb44: 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(); 4bb46: 4eb9 0004 f588 jsr 4f588 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EBADF ); 4bb4c: 7409 moveq #9,%d2 4bb4e: 4eb9 0005 66dc jsr 566dc <__errno> 4bb54: 72ff moveq #-1,%d1 4bb56: 2040 moveal %d0,%a0 case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); } 4bb58: 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 ); 4bb5a: 2082 movel %d2,%a0@ case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); } 4bb5c: 4cee 041c ffec moveml %fp@(-20),%d2-%d4/%a2 4bb62: 4e5e unlk %fp 4bb64: 4e75 rts msg_status = _Thread_Executing->Wait.return_code; if ( !msg_status ) return msg_status; rtems_set_errno_and_return_minus_one( 4bb66: 4eb9 0005 66dc jsr 566dc <__errno> 4bb6c: 2440 moveal %d0,%a2 4bb6e: 2f02 movel %d2,%sp@- 4bb70: 4eb9 0004 bca0 jsr 4bca0 <_POSIX_Message_queue_Translate_core_message_queue_return_code> 4bb76: 588f addql #4,%sp 4bb78: 72ff moveq #-1,%d1 4bb7a: 2480 movel %d0,%a2@ case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); } 4bb7c: 2001 movel %d1,%d0 4bb7e: 4cee 041c ffec moveml %fp@(-20),%d2-%d4/%a2 4bb84: 4e5e unlk %fp 4bb86: 4e75 rts 00047c8e <_POSIX_Mutex_Get>: POSIX_Mutex_Control *_POSIX_Mutex_Get ( pthread_mutex_t *mutex, Objects_Locations *location ) { 47c8e: 4e56 0000 linkw %fp,#0 47c92: 2f0b movel %a3,%sp@- 47c94: 266e 000c moveal %fp@(12),%a3 47c98: 2f0a movel %a2,%sp@- 47c9a: 246e 0008 moveal %fp@(8),%a2 ___POSIX_Mutex_Get_support_error_check( mutex, location ); 47c9e: 4a8a tstl %a2 47ca0: 6750 beqs 47cf2 <_POSIX_Mutex_Get+0x64> ___POSIX_Mutex_Get_support_auto_initialization( mutex, location ); 47ca2: 2012 movel %a2@,%d0 47ca4: 72ff moveq #-1,%d1 47ca6: b280 cmpl %d0,%d1 47ca8: 6720 beqs 47cca <_POSIX_Mutex_Get+0x3c> return (POSIX_Mutex_Control *) 47caa: 2f0b movel %a3,%sp@- 47cac: 2f00 movel %d0,%sp@- 47cae: 4879 0006 46fc pea 646fc <_POSIX_Mutex_Information> 47cb4: 4eb9 0004 aa94 jsr 4aa94 <_Objects_Get> 47cba: 4fef 000c lea %sp@(12),%sp _Objects_Get( &_POSIX_Mutex_Information, (Objects_Id) *mutex, location ); } 47cbe: 246e fff8 moveal %fp@(-8),%a2 47cc2: 266e fffc moveal %fp@(-4),%a3 47cc6: 4e5e unlk %fp 47cc8: 4e75 rts Objects_Locations *location ) { ___POSIX_Mutex_Get_support_error_check( mutex, location ); ___POSIX_Mutex_Get_support_auto_initialization( mutex, location ); 47cca: 42a7 clrl %sp@- 47ccc: 2f0a movel %a2,%sp@- 47cce: 4eb9 0004 7d54 jsr 47d54 47cd4: 508f addql #8,%sp 47cd6: 4a80 tstl %d0 47cd8: 6618 bnes 47cf2 <_POSIX_Mutex_Get+0x64> 47cda: 2012 movel %a2@,%d0 return (POSIX_Mutex_Control *) 47cdc: 2f0b movel %a3,%sp@- 47cde: 2f00 movel %d0,%sp@- 47ce0: 4879 0006 46fc pea 646fc <_POSIX_Mutex_Information> 47ce6: 4eb9 0004 aa94 jsr 4aa94 <_Objects_Get> 47cec: 4fef 000c lea %sp@(12),%sp 47cf0: 60cc bras 47cbe <_POSIX_Mutex_Get+0x30> <== ALWAYS TAKEN Objects_Locations *location ) { ___POSIX_Mutex_Get_support_error_check( mutex, location ); ___POSIX_Mutex_Get_support_auto_initialization( mutex, location ); 47cf2: 7201 moveq #1,%d1 47cf4: 4280 clrl %d0 47cf6: 2681 movel %d1,%a3@ return (POSIX_Mutex_Control *) _Objects_Get( &_POSIX_Mutex_Information, (Objects_Id) *mutex, location ); } 47cf8: 246e fff8 moveal %fp@(-8),%a2 47cfc: 266e fffc moveal %fp@(-4),%a3 47d00: 4e5e unlk %fp 47d02: 4e75 rts 00047c10 <_POSIX_Mutex_Get_interrupt_disable>: POSIX_Mutex_Control *_POSIX_Mutex_Get_interrupt_disable ( pthread_mutex_t *mutex, Objects_Locations *location, ISR_Level *level ) { 47c10: 4e56 0000 linkw %fp,#0 47c14: 2f0b movel %a3,%sp@- 47c16: 266e 000c moveal %fp@(12),%a3 47c1a: 2f0a movel %a2,%sp@- 47c1c: 246e 0008 moveal %fp@(8),%a2 ___POSIX_Mutex_Get_support_error_check( mutex, location ); 47c20: 4a8a tstl %a2 47c22: 6758 beqs 47c7c <_POSIX_Mutex_Get_interrupt_disable+0x6c> ___POSIX_Mutex_Get_support_auto_initialization( mutex, location ); 47c24: 2012 movel %a2@,%d0 47c26: 72ff moveq #-1,%d1 47c28: b280 cmpl %d0,%d1 47c2a: 6724 beqs 47c50 <_POSIX_Mutex_Get_interrupt_disable+0x40> return (POSIX_Mutex_Control *) _Objects_Get_isr_disable( 47c2c: 2f2e 0010 movel %fp@(16),%sp@- 47c30: 2f0b movel %a3,%sp@- 47c32: 2f00 movel %d0,%sp@- 47c34: 4879 0006 46fc pea 646fc <_POSIX_Mutex_Information> 47c3a: 4eb9 0004 aa34 jsr 4aa34 <_Objects_Get_isr_disable> 47c40: 4fef 0010 lea %sp@(16),%sp &_POSIX_Mutex_Information, (Objects_Id) *mutex, location, level ); } 47c44: 246e fff8 moveal %fp@(-8),%a2 47c48: 266e fffc moveal %fp@(-4),%a3 47c4c: 4e5e unlk %fp 47c4e: 4e75 rts ISR_Level *level ) { ___POSIX_Mutex_Get_support_error_check( mutex, location ); ___POSIX_Mutex_Get_support_auto_initialization( mutex, location ); 47c50: 42a7 clrl %sp@- 47c52: 2f0a movel %a2,%sp@- 47c54: 4eb9 0004 7d54 jsr 47d54 47c5a: 508f addql #8,%sp 47c5c: 4a80 tstl %d0 47c5e: 661c bnes 47c7c <_POSIX_Mutex_Get_interrupt_disable+0x6c> 47c60: 2012 movel %a2@,%d0 return (POSIX_Mutex_Control *) _Objects_Get_isr_disable( 47c62: 2f2e 0010 movel %fp@(16),%sp@- 47c66: 2f0b movel %a3,%sp@- 47c68: 2f00 movel %d0,%sp@- 47c6a: 4879 0006 46fc pea 646fc <_POSIX_Mutex_Information> 47c70: 4eb9 0004 aa34 jsr 4aa34 <_Objects_Get_isr_disable> 47c76: 4fef 0010 lea %sp@(16),%sp 47c7a: 60c8 bras 47c44 <_POSIX_Mutex_Get_interrupt_disable+0x34> <== ALWAYS TAKEN ISR_Level *level ) { ___POSIX_Mutex_Get_support_error_check( mutex, location ); ___POSIX_Mutex_Get_support_auto_initialization( mutex, location ); 47c7c: 7001 moveq #1,%d0 47c7e: 2680 movel %d0,%a3@ &_POSIX_Mutex_Information, (Objects_Id) *mutex, location, level ); } 47c80: 246e fff8 moveal %fp@(-8),%a2 ISR_Level *level ) { ___POSIX_Mutex_Get_support_error_check( mutex, location ); ___POSIX_Mutex_Get_support_auto_initialization( mutex, location ); 47c84: 4280 clrl %d0 &_POSIX_Mutex_Information, (Objects_Id) *mutex, location, level ); } 47c86: 266e fffc moveal %fp@(-4),%a3 47c8a: 4e5e unlk %fp 47c8c: 4e75 rts 0004ee0c <_POSIX_Semaphore_Create_support>: const char *name, int pshared, unsigned int value, POSIX_Semaphore_Control **the_sem ) { 4ee0c: 4e56 0000 linkw %fp,#0 4ee10: 2f0a movel %a2,%sp@- 4ee12: 2f02 movel %d2,%sp@- 4ee14: 242e 0008 movel %fp@(8),%d2 POSIX_Semaphore_Control *the_semaphore; CORE_semaphore_Attributes *the_sem_attr; char *name_p = (char *)name; /* Sharing semaphores among processes is not currently supported */ if (pshared != 0) 4ee18: 4aae 000c tstl %fp@(12) 4ee1c: 6600 0112 bnew 4ef30 <_POSIX_Semaphore_Create_support+0x124> rtems_set_errno_and_return_minus_one( ENOSYS ); if ( name ) { 4ee20: 4a82 tstl %d2 4ee22: 6718 beqs 4ee3c <_POSIX_Semaphore_Create_support+0x30> if ( strnlen( name, NAME_MAX ) >= NAME_MAX ) 4ee24: 4878 00ff pea ff 4ee28: 2f02 movel %d2,%sp@- 4ee2a: 4eb9 0005 4204 jsr 54204 4ee30: 508f addql #8,%sp 4ee32: 0c80 0000 00fe cmpil #254,%d0 4ee38: 6200 00dc bhiw 4ef16 <_POSIX_Semaphore_Create_support+0x10a> 4ee3c: 2039 0006 40e0 movel 640e0 <_Thread_Dispatch_disable_level>,%d0 4ee42: 5280 addql #1,%d0 4ee44: 23c0 0006 40e0 movel %d0,640e0 <_Thread_Dispatch_disable_level> * _POSIX_Semaphore_Allocate */ RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void ) { return (POSIX_Semaphore_Control *) 4ee4a: 4879 0006 433a pea 6433a <_POSIX_Semaphore_Information> 4ee50: 4eb9 0004 a5b0 jsr 4a5b0 <_Objects_Allocate> _Thread_Disable_dispatch(); the_semaphore = _POSIX_Semaphore_Allocate(); if ( !the_semaphore ) { 4ee56: 588f addql #4,%sp 4ee58: 2440 moveal %d0,%a2 4ee5a: 4a80 tstl %d0 4ee5c: 6700 00ec beqw 4ef4a <_POSIX_Semaphore_Create_support+0x13e> _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( ENOSPC ); } the_semaphore->process_shared = pshared; 4ee60: 42aa 0010 clrl %a2@(16) if ( name ) { 4ee64: 4a82 tstl %d2 4ee66: 675c beqs 4eec4 <_POSIX_Semaphore_Create_support+0xb8> the_semaphore->named = true; the_semaphore->open_count = 1; 4ee68: 7001 moveq #1,%d0 4ee6a: 2540 0016 movel %d0,%a2@(22) } the_semaphore->process_shared = pshared; if ( name ) { the_semaphore->named = true; 4ee6e: 1540 0014 moveb %d0,%a2@(20) the_semaphore->open_count = 1; the_semaphore->linked = true; 4ee72: 1540 0015 moveb %d0,%a2@(21) the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO; /* * This effectively disables limit checking. */ the_sem_attr->maximum_count = 0xFFFFFFFF; 4ee76: 70ff moveq #-1,%d0 * blocking tasks on this semaphore should be. It could somehow * be derived from the current scheduling policy. One * thing is certain, no matter what we decide, it won't be * the same as all other POSIX implementations. :) */ the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO; 4ee78: 42aa 005e clrl %a2@(94) /* * This effectively disables limit checking. */ the_sem_attr->maximum_count = 0xFFFFFFFF; 4ee7c: 2540 005a movel %d0,%a2@(90) _CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value ); 4ee80: 2f2e 0010 movel %fp@(16),%sp@- 4ee84: 486a 005a pea %a2@(90) 4ee88: 486a 001a pea %a2@(26) 4ee8c: 4eb9 0004 a044 jsr 4a044 <_CORE_semaphore_Initialize> #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4ee92: 2079 0006 4352 moveal 64352 <_POSIX_Semaphore_Information+0x18>,%a0 4ee98: 4280 clrl %d0 4ee9a: 302a 000a movew %a2@(10),%d0 4ee9e: 218a 0c00 movel %a2,%a0@(00000000,%d0:l:4) the_object ); #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) /* ASSERT: information->is_string */ the_object->name.name_p = name; 4eea2: 2542 000c movel %d2,%a2@(12) &_POSIX_Semaphore_Information, &the_semaphore->Object, name_p ); *the_sem = the_semaphore; 4eea6: 206e 0014 moveal %fp@(20),%a0 4eeaa: 208a movel %a2,%a0@ _Thread_Enable_dispatch(); 4eeac: 4eb9 0004 b32c jsr 4b32c <_Thread_Enable_dispatch> return 0; 4eeb2: 4fef 000c lea %sp@(12),%sp name_p ); *the_sem = the_semaphore; _Thread_Enable_dispatch(); 4eeb6: 4280 clrl %d0 return 0; } 4eeb8: 242e fff8 movel %fp@(-8),%d2 4eebc: 246e fffc moveal %fp@(-4),%a2 4eec0: 4e5e unlk %fp 4eec2: 4e75 rts the_semaphore->named = true; the_semaphore->open_count = 1; the_semaphore->linked = true; } else { the_semaphore->named = false; the_semaphore->open_count = 0; 4eec4: 42aa 0016 clrl %a2@(22) if ( name ) { the_semaphore->named = true; the_semaphore->open_count = 1; the_semaphore->linked = true; } else { the_semaphore->named = false; 4eec8: 4200 clrb %d0 * blocking tasks on this semaphore should be. It could somehow * be derived from the current scheduling policy. One * thing is certain, no matter what we decide, it won't be * the same as all other POSIX implementations. :) */ the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO; 4eeca: 42aa 005e clrl %a2@(94) if ( name ) { the_semaphore->named = true; the_semaphore->open_count = 1; the_semaphore->linked = true; } else { the_semaphore->named = false; 4eece: 1540 0014 moveb %d0,%a2@(20) the_semaphore->open_count = 0; the_semaphore->linked = false; 4eed2: 1540 0015 moveb %d0,%a2@(21) the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO; /* * This effectively disables limit checking. */ the_sem_attr->maximum_count = 0xFFFFFFFF; 4eed6: 70ff moveq #-1,%d0 4eed8: 2540 005a movel %d0,%a2@(90) _CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value ); 4eedc: 2f2e 0010 movel %fp@(16),%sp@- 4eee0: 486a 005a pea %a2@(90) 4eee4: 486a 001a pea %a2@(26) 4eee8: 4eb9 0004 a044 jsr 4a044 <_CORE_semaphore_Initialize> #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4eeee: 2079 0006 4352 moveal 64352 <_POSIX_Semaphore_Information+0x18>,%a0 4eef4: 4280 clrl %d0 4eef6: 302a 000a movew %a2@(10),%d0 4eefa: 218a 0c00 movel %a2,%a0@(00000000,%d0:l:4) the_object ); #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) /* ASSERT: information->is_string */ the_object->name.name_p = name; 4eefe: 2542 000c movel %d2,%a2@(12) &_POSIX_Semaphore_Information, &the_semaphore->Object, name_p ); *the_sem = the_semaphore; 4ef02: 206e 0014 moveal %fp@(20),%a0 4ef06: 208a movel %a2,%a0@ _Thread_Enable_dispatch(); 4ef08: 4eb9 0004 b32c jsr 4b32c <_Thread_Enable_dispatch> return 0; 4ef0e: 4fef 000c lea %sp@(12),%sp name_p ); *the_sem = the_semaphore; _Thread_Enable_dispatch(); 4ef12: 4280 clrl %d0 4ef14: 60a2 bras 4eeb8 <_POSIX_Semaphore_Create_support+0xac> <== ALWAYS TAKEN if (pshared != 0) rtems_set_errno_and_return_minus_one( ENOSYS ); if ( name ) { if ( strnlen( name, NAME_MAX ) >= NAME_MAX ) rtems_set_errno_and_return_minus_one( ENAMETOOLONG ); 4ef16: 4eb9 0005 2cf4 jsr 52cf4 <__errno> 4ef1c: 745b moveq #91,%d2 4ef1e: 2040 moveal %d0,%a0 4ef20: 70ff moveq #-1,%d0 4ef22: 2082 movel %d2,%a0@ *the_sem = the_semaphore; _Thread_Enable_dispatch(); return 0; } 4ef24: 242e fff8 movel %fp@(-8),%d2 4ef28: 246e fffc moveal %fp@(-4),%a2 4ef2c: 4e5e unlk %fp 4ef2e: 4e75 rts CORE_semaphore_Attributes *the_sem_attr; char *name_p = (char *)name; /* Sharing semaphores among processes is not currently supported */ if (pshared != 0) rtems_set_errno_and_return_minus_one( ENOSYS ); 4ef30: 4eb9 0005 2cf4 jsr 52cf4 <__errno> *the_sem = the_semaphore; _Thread_Enable_dispatch(); return 0; } 4ef36: 242e fff8 movel %fp@(-8),%d2 CORE_semaphore_Attributes *the_sem_attr; char *name_p = (char *)name; /* Sharing semaphores among processes is not currently supported */ if (pshared != 0) rtems_set_errno_and_return_minus_one( ENOSYS ); 4ef3a: 2040 moveal %d0,%a0 4ef3c: 7258 moveq #88,%d1 4ef3e: 70ff moveq #-1,%d0 *the_sem = the_semaphore; _Thread_Enable_dispatch(); return 0; } 4ef40: 246e fffc moveal %fp@(-4),%a2 4ef44: 4e5e unlk %fp CORE_semaphore_Attributes *the_sem_attr; char *name_p = (char *)name; /* Sharing semaphores among processes is not currently supported */ if (pshared != 0) rtems_set_errno_and_return_minus_one( ENOSYS ); 4ef46: 2081 movel %d1,%a0@ *the_sem = the_semaphore; _Thread_Enable_dispatch(); return 0; } 4ef48: 4e75 rts _Thread_Disable_dispatch(); the_semaphore = _POSIX_Semaphore_Allocate(); if ( !the_semaphore ) { _Thread_Enable_dispatch(); 4ef4a: 4eb9 0004 b32c jsr 4b32c <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( ENOSPC ); 4ef50: 4eb9 0005 2cf4 jsr 52cf4 <__errno> *the_sem = the_semaphore; _Thread_Enable_dispatch(); return 0; } 4ef56: 242e fff8 movel %fp@(-8),%d2 the_semaphore = _POSIX_Semaphore_Allocate(); if ( !the_semaphore ) { _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( ENOSPC ); 4ef5a: 2040 moveal %d0,%a0 4ef5c: 721c moveq #28,%d1 4ef5e: 70ff moveq #-1,%d0 *the_sem = the_semaphore; _Thread_Enable_dispatch(); return 0; } 4ef60: 246e fffc moveal %fp@(-4),%a2 4ef64: 4e5e unlk %fp the_semaphore = _POSIX_Semaphore_Allocate(); if ( !the_semaphore ) { _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( ENOSPC ); 4ef66: 2081 movel %d1,%a0@ *the_sem = the_semaphore; _Thread_Enable_dispatch(); return 0; } 4ef68: 4e75 rts ... 0004efc4 <_POSIX_Semaphore_Name_to_id>: int _POSIX_Semaphore_Name_to_id( const char *name, sem_t *id ) { 4efc4: 4e56 fffc linkw %fp,#-4 4efc8: 206e 0008 moveal %fp@(8),%a0 Objects_Name_or_id_lookup_errors status; Objects_Id the_id; if ( !name ) 4efcc: 4a88 tstl %a0 4efce: 6704 beqs 4efd4 <_POSIX_Semaphore_Name_to_id+0x10> return EINVAL; if ( !name[0] ) 4efd0: 4a10 tstb %a0@ 4efd2: 6606 bnes 4efda <_POSIX_Semaphore_Name_to_id+0x16> name, &the_id ); *id = the_id; if ( status == OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL ) 4efd4: 7016 moveq #22,%d0 return 0; return ENOENT; } 4efd6: 4e5e unlk %fp 4efd8: 4e75 rts return EINVAL; if ( !name[0] ) return EINVAL; status = _Objects_Name_to_id_string( 4efda: 486e fffc pea %fp@(-4) 4efde: 2f08 movel %a0,%sp@- 4efe0: 4879 0006 433a pea 6433a <_POSIX_Semaphore_Information> 4efe6: 4eb9 0004 fe6c jsr 4fe6c <_Objects_Name_to_id_string> &_POSIX_Semaphore_Information, name, &the_id ); *id = the_id; 4efec: 206e 000c moveal %fp@(12),%a0 if ( status == OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL ) 4eff0: 4fef 000c lea %sp@(12),%sp status = _Objects_Name_to_id_string( &_POSIX_Semaphore_Information, name, &the_id ); *id = the_id; 4eff4: 20ae fffc movel %fp@(-4),%a0@ if ( status == OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL ) 4eff8: 4a80 tstl %d0 4effa: 6706 beqs 4f002 <_POSIX_Semaphore_Name_to_id+0x3e> <== ALWAYS TAKEN 4effc: 7002 moveq #2,%d0 return 0; return ENOENT; } 4effe: 4e5e unlk %fp 4f000: 4e75 rts name, &the_id ); *id = the_id; if ( status == OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL ) 4f002: 4280 clrl %d0 return 0; return ENOENT; } 4f004: 4e5e unlk %fp 4f006: 4e75 rts 0004b060 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch>: #include void _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch( Thread_Control *the_thread ) { 4b060: 4e56 0000 linkw %fp,#0 4b064: 226e 0008 moveal %fp@(8),%a1 POSIX_API_Control *thread_support; thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4b068: 2069 010e moveal %a1@(270),%a0 if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 4b06c: 4aa8 00cc tstl %a0@(204) 4b070: 6608 bnes 4b07a <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x1a> <== ALWAYS TAKEN thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS && 4b072: 7001 moveq #1,%d0 4b074: b0a8 00d0 cmpl %a0@(208),%d0 4b078: 6708 beqs 4b082 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x22> _Thread_Unnest_dispatch(); _POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED ); } else _Thread_Enable_dispatch(); } 4b07a: 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(); 4b07c: 4ef9 0004 8134 jmp 48134 <_Thread_Enable_dispatch> thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS && thread_support->cancelation_requested ) { 4b082: 4aa8 00d4 tstl %a0@(212) 4b086: 67f2 beqs 4b07a <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x1a> _Thread_Unnest_dispatch(); _POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED ); 4b088: 4878 ffff pea ffffffff */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 4b08c: 2039 0005 f998 movel 5f998 <_Thread_Dispatch_disable_level>,%d0 4b092: 5380 subql #1,%d0 4b094: 2f09 movel %a1,%sp@- 4b096: 23c0 0005 f998 movel %d0,5f998 <_Thread_Dispatch_disable_level> 4b09c: 4eb9 0004 b81c jsr 4b81c <_POSIX_Thread_Exit> { POSIX_API_Control *thread_support; thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 4b0a2: 508f addql #8,%sp _Thread_Unnest_dispatch(); _POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED ); } else _Thread_Enable_dispatch(); } 4b0a4: 4e5e unlk %fp 4b0a6: 4e75 rts 0004c5cc <_POSIX_Thread_Translate_sched_param>: int policy, struct sched_param *param, Thread_CPU_budget_algorithms *budget_algorithm, Thread_CPU_budget_algorithm_callout *budget_callout ) { 4c5cc: 4e56 ffe8 linkw %fp,#-24 4c5d0: 48d7 3c0c moveml %d2-%d3/%a2-%a5,%sp@ 4c5d4: 246e 000c moveal %fp@(12),%a2 if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) 4c5d8: 47f9 0004 c5a8 lea 4c5a8 <_POSIX_Priority_Is_valid>,%a3 4c5de: 2f12 movel %a2@,%sp@- int policy, struct sched_param *param, Thread_CPU_budget_algorithms *budget_algorithm, Thread_CPU_budget_algorithm_callout *budget_callout ) { 4c5e0: 242e 0008 movel %fp@(8),%d2 4c5e4: 286e 0010 moveal %fp@(16),%a4 4c5e8: 2a6e 0014 moveal %fp@(20),%a5 if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) 4c5ec: 4e93 jsr %a3@ 4c5ee: 588f addql #4,%sp 4c5f0: 4a00 tstb %d0 4c5f2: 671e beqs 4c612 <_POSIX_Thread_Translate_sched_param+0x46> <== ALWAYS TAKEN return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 4c5f4: 4294 clrl %a4@ *budget_callout = NULL; 4c5f6: 4295 clrl %a5@ if ( policy == SCHED_OTHER ) { 4c5f8: 4a82 tstl %d2 4c5fa: 6722 beqs 4c61e <_POSIX_Thread_Translate_sched_param+0x52> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; return 0; } if ( policy == SCHED_FIFO ) { 4c5fc: 7001 moveq #1,%d0 4c5fe: b082 cmpl %d2,%d0 4c600: 6700 0084 beqw 4c686 <_POSIX_Thread_Translate_sched_param+0xba> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; return 0; } if ( policy == SCHED_RR ) { 4c604: 7002 moveq #2,%d0 4c606: b082 cmpl %d2,%d0 4c608: 6700 008a beqw 4c694 <_POSIX_Thread_Translate_sched_param+0xc8> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; return 0; } if ( policy == SCHED_SPORADIC ) { 4c60c: 7003 moveq #3,%d0 4c60e: b082 cmpl %d2,%d0 4c610: 671c beqs 4c62e <_POSIX_Thread_Translate_sched_param+0x62> if ( !_POSIX_Priority_Is_valid( param->ss_low_priority ) ) return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; *budget_callout = _POSIX_Threads_Sporadic_budget_callout; return 0; 4c612: 7016 moveq #22,%d0 } return EINVAL; } 4c614: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 4c61a: 4e5e unlk %fp 4c61c: 4e75 rts *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; *budget_callout = NULL; if ( policy == SCHED_OTHER ) { *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 4c61e: 7201 moveq #1,%d1 4c620: 4280 clrl %d0 4c622: 2881 movel %d1,%a4@ *budget_callout = _POSIX_Threads_Sporadic_budget_callout; return 0; } return EINVAL; } 4c624: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 4c62a: 4e5e unlk %fp 4c62c: 4e75 rts *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; return 0; } if ( policy == SCHED_SPORADIC ) { if ( (param->ss_replenish_period.tv_sec == 0) && 4c62e: 4aaa 0008 tstl %a2@(8) 4c632: 6606 bnes 4c63a <_POSIX_Thread_Translate_sched_param+0x6e> (param->ss_replenish_period.tv_nsec == 0) ) 4c634: 4aaa 000c tstl %a2@(12) 4c638: 67d8 beqs 4c612 <_POSIX_Thread_Translate_sched_param+0x46> return EINVAL; if ( (param->ss_initial_budget.tv_sec == 0) && 4c63a: 4aaa 0010 tstl %a2@(16) 4c63e: 6606 bnes 4c646 <_POSIX_Thread_Translate_sched_param+0x7a> (param->ss_initial_budget.tv_nsec == 0) ) 4c640: 4aaa 0014 tstl %a2@(20) 4c644: 67cc beqs 4c612 <_POSIX_Thread_Translate_sched_param+0x46> return EINVAL; if ( _Timespec_To_ticks( ¶m->ss_replenish_period ) < 4c646: 486a 0008 pea %a2@(8) 4c64a: 243c 0004 a02c movel #303148,%d2 4c650: 2042 moveal %d2,%a0 4c652: 4e90 jsr %a0@ 4c654: 486a 0010 pea %a2@(16) 4c658: 2600 movel %d0,%d3 4c65a: 2042 moveal %d2,%a0 4c65c: 4e90 jsr %a0@ 4c65e: 508f addql #8,%sp 4c660: b083 cmpl %d3,%d0 4c662: 62ae bhis 4c612 <_POSIX_Thread_Translate_sched_param+0x46> _Timespec_To_ticks( ¶m->ss_initial_budget ) ) return EINVAL; if ( !_POSIX_Priority_Is_valid( param->ss_low_priority ) ) 4c664: 2f2a 0004 movel %a2@(4),%sp@- 4c668: 4e93 jsr %a3@ 4c66a: 588f addql #4,%sp 4c66c: 4a00 tstb %d0 4c66e: 67a2 beqs 4c612 <_POSIX_Thread_Translate_sched_param+0x46> return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; 4c670: 7003 moveq #3,%d0 *budget_callout = _POSIX_Threads_Sporadic_budget_callout; 4c672: 2abc 0004 665e movel #288350,%a5@ return EINVAL; if ( !_POSIX_Priority_Is_valid( param->ss_low_priority ) ) return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; 4c678: 2880 movel %d0,%a4@ *budget_callout = _POSIX_Threads_Sporadic_budget_callout; 4c67a: 4280 clrl %d0 return 0; } return EINVAL; } 4c67c: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 4c682: 4e5e unlk %fp 4c684: 4e75 rts *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; return 0; } if ( policy == SCHED_FIFO ) { *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 4c686: 4294 clrl %a4@ 4c688: 4200 clrb %d0 *budget_callout = _POSIX_Threads_Sporadic_budget_callout; return 0; } return EINVAL; } 4c68a: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 4c690: 4e5e unlk %fp 4c692: 4e75 rts *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; return 0; } if ( policy == SCHED_RR ) { *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; 4c694: 2880 movel %d0,%a4@ 4c696: 4200 clrb %d0 *budget_callout = _POSIX_Threads_Sporadic_budget_callout; return 0; } return EINVAL; } 4c698: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 4c69e: 4e5e unlk %fp 4c6a0: 4e75 rts ... 0004b1b0 <_POSIX_Threads_Create_extension>: bool _POSIX_Threads_Create_extension( Thread_Control *executing __attribute__((unused)), Thread_Control *created ) { 4b1b0: 4e56 0000 linkw %fp,#0 4b1b4: 2f0b movel %a3,%sp@- 4b1b6: 2f0a movel %a2,%sp@- POSIX_API_Control *api; POSIX_API_Control *executing_api; api = _Workspace_Allocate( sizeof( POSIX_API_Control ) ); 4b1b8: 4878 00e4 pea e4 bool _POSIX_Threads_Create_extension( Thread_Control *executing __attribute__((unused)), Thread_Control *created ) { 4b1bc: 246e 000c moveal %fp@(12),%a2 POSIX_API_Control *api; POSIX_API_Control *executing_api; api = _Workspace_Allocate( sizeof( POSIX_API_Control ) ); 4b1c0: 4eb9 0004 91f0 jsr 491f0 <_Workspace_Allocate> if ( !api ) 4b1c6: 588f addql #4,%sp ) { POSIX_API_Control *api; POSIX_API_Control *executing_api; api = _Workspace_Allocate( sizeof( POSIX_API_Control ) ); 4b1c8: 2640 moveal %d0,%a3 if ( !api ) 4b1ca: 4a80 tstl %d0 4b1cc: 6700 0142 beqw 4b310 <_POSIX_Threads_Create_extension+0x160> /* XXX check all fields are touched */ api->Attributes = _POSIX_Threads_Default_attributes; api->detachstate = _POSIX_Threads_Default_attributes.detachstate; api->schedpolicy = _POSIX_Threads_Default_attributes.schedpolicy; api->schedparam = _POSIX_Threads_Default_attributes.schedparam; 4b1d0: 41eb 0080 lea %a3@(128),%a0 api->schedparam.sched_priority = 4b1d4: 4280 clrl %d0 4b1d6: 1039 0005 d9a2 moveb 5d9a2 ,%d0 return false; created->API_Extensions[ THREAD_API_POSIX ] = api; /* XXX check all fields are touched */ api->Attributes = _POSIX_Threads_Default_attributes; 4b1dc: 7202 moveq #2,%d1 api->detachstate = _POSIX_Threads_Default_attributes.detachstate; api->schedpolicy = _POSIX_Threads_Default_attributes.schedpolicy; api->schedparam = _POSIX_Threads_Default_attributes.schedparam; 4b1de: 20f9 0005 ce32 movel 5ce32 <_POSIX_Threads_Default_attributes+0x18>,%a0@+ 4b1e4: 20f9 0005 ce36 movel 5ce36 <_POSIX_Threads_Default_attributes+0x1c>,%a0@+ 4b1ea: 20f9 0005 ce3a movel 5ce3a <_POSIX_Threads_Default_attributes+0x20>,%a0@+ 4b1f0: 20f9 0005 ce3e movel 5ce3e <_POSIX_Threads_Default_attributes+0x24>,%a0@+ 4b1f6: 20f9 0005 ce42 movel 5ce42 <_POSIX_Threads_Default_attributes+0x28>,%a0@+ 4b1fc: 20b9 0005 ce46 movel 5ce46 <_POSIX_Threads_Default_attributes+0x2c>,%a0@ */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 4b202: 41eb 00dc lea %a3@(220),%a0 return false; created->API_Extensions[ THREAD_API_POSIX ] = api; /* XXX check all fields are touched */ api->Attributes = _POSIX_Threads_Default_attributes; 4b206: 42ab 0020 clrl %a3@(32) 4b20a: 42ab 0024 clrl %a3@(36) 4b20e: 42ab 0028 clrl %a3@(40) 4b212: 42ab 002c clrl %a3@(44) api->detachstate = _POSIX_Threads_Default_attributes.detachstate; api->schedpolicy = _POSIX_Threads_Default_attributes.schedpolicy; api->schedparam = _POSIX_Threads_Default_attributes.schedparam; api->schedparam.sched_priority = 4b216: 90aa 0014 subl %a2@(20),%d0 4b21a: 2740 0080 movel %d0,%a3@(128) return false; created->API_Extensions[ THREAD_API_POSIX ] = api; /* XXX check all fields are touched */ api->Attributes = _POSIX_Threads_Default_attributes; 4b21e: 7001 moveq #1,%d0 api = _Workspace_Allocate( sizeof( POSIX_API_Control ) ); if ( !api ) return false; created->API_Extensions[ THREAD_API_POSIX ] = api; 4b220: 254b 010e movel %a3,%a2@(270) /* XXX check all fields are touched */ api->Attributes = _POSIX_Threads_Default_attributes; 4b224: 2680 movel %d0,%a3@ 4b226: 7001 moveq #1,%d0 4b228: 2741 0018 movel %d1,%a3@(24) * The check for class == 1 is debug. Should never really happen. */ /* XXX use signal constants */ api->signals_pending = 0; if ( _Objects_Get_API( created->Object.id ) == OBJECTS_POSIX_API 4b22c: 123c 0007 moveb #7,%d1 return false; created->API_Extensions[ THREAD_API_POSIX ] = api; /* XXX check all fields are touched */ api->Attributes = _POSIX_Threads_Default_attributes; 4b230: 2740 0010 movel %d0,%a3@(16) 4b234: 2740 0014 movel %d0,%a3@(20) 4b238: 2740 0030 movel %d0,%a3@(48) 4b23c: 2740 0034 movel %d0,%a3@(52) api->detachstate = _POSIX_Threads_Default_attributes.detachstate; 4b240: 2740 0038 movel %d0,%a3@(56) api->schedpolicy = _POSIX_Threads_Default_attributes.schedpolicy; 4b244: 2740 007c movel %d0,%a3@(124) * The check for class == 1 is debug. Should never really happen. */ /* XXX use signal constants */ api->signals_pending = 0; if ( _Objects_Get_API( created->Object.id ) == OBJECTS_POSIX_API 4b248: 4280 clrl %d0 return false; created->API_Extensions[ THREAD_API_POSIX ] = api; /* XXX check all fields are touched */ api->Attributes = _POSIX_Threads_Default_attributes; 4b24a: 42ab 0004 clrl %a3@(4) 4b24e: 42ab 0008 clrl %a3@(8) 4b252: 42ab 000c clrl %a3@(12) 4b256: 42ab 001c clrl %a3@(28) _POSIX_Priority_From_core( created->current_priority ); /* * POSIX 1003.1 1996, 18.2.2.2 */ api->cancelation_requested = 0; 4b25a: 42ab 00d4 clrl %a3@(212) api->cancelability_state = PTHREAD_CANCEL_ENABLE; 4b25e: 42ab 00cc clrl %a3@(204) * * The check for class == 1 is debug. Should never really happen. */ /* XXX use signal constants */ api->signals_pending = 0; 4b262: 42ab 00c8 clrl %a3@(200) if ( _Objects_Get_API( created->Object.id ) == OBJECTS_POSIX_API 4b266: 102a 0008 moveb %a2@(8),%d0 4b26a: 2748 00d8 movel %a0,%a3@(216) the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 4b26e: 41eb 00d8 lea %a3@(216),%a0 4b272: c081 andl %d1,%d0 4b274: 2748 00e0 movel %a0,%a3@(224) 4b278: 123c 0003 moveb #3,%d1 /* * POSIX 1003.1 1996, 18.2.2.2 */ api->cancelation_requested = 0; api->cancelability_state = PTHREAD_CANCEL_ENABLE; api->cancelability_type = PTHREAD_CANCEL_DEFERRED; 4b27c: 42ab 00d0 clrl %a3@(208) RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 4b280: 42ab 00dc clrl %a3@(220) * The check for class == 1 is debug. Should never really happen. */ /* XXX use signal constants */ api->signals_pending = 0; if ( _Objects_Get_API( created->Object.id ) == OBJECTS_POSIX_API 4b284: b280 cmpl %d0,%d1 4b286: 6744 beqs 4b2cc <_POSIX_Threads_Create_extension+0x11c> #endif ) { executing_api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; api->signals_blocked = executing_api->signals_blocked; } else { api->signals_blocked = 0xffffffff; 4b288: 70ff moveq #-1,%d0 4b28a: 2740 00c4 movel %d0,%a3@(196) } _Thread_queue_Initialize( 4b28e: 42a7 clrl %sp@- 4b290: 4878 1000 pea 1000 4b294: 42a7 clrl %sp@- 4b296: 486b 003c pea %a3@(60) 4b29a: 4eb9 0004 8590 jsr 48590 <_Thread_queue_Initialize> THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_JOIN_AT_EXIT, 0 ); _Watchdog_Initialize( 4b2a0: 222a 0008 movel %a2@(8),%d1 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 4b2a4: 41f9 0004 b366 lea 4b366 <_POSIX_Threads_Sporadic_budget_TSR>,%a0 _POSIX_Threads_Sporadic_budget_TSR, created->Object.id, created ); return true; 4b2aa: 4fef 0010 lea %sp@(16),%sp the_watchdog->id = id; the_watchdog->user_data = user_data; 4b2ae: 7001 moveq #1,%d0 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 4b2b0: 2748 00b8 movel %a0,%a3@(184) the_watchdog->id = id; the_watchdog->user_data = user_data; 4b2b4: 274a 00c0 movel %a2,%a3@(192) void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; 4b2b8: 2741 00bc movel %d1,%a3@(188) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 4b2bc: 42ab 00a4 clrl %a3@(164) } 4b2c0: 246e fff8 moveal %fp@(-8),%a2 4b2c4: 266e fffc moveal %fp@(-4),%a3 4b2c8: 4e5e unlk %fp 4b2ca: 4e75 rts #if defined(RTEMS_DEBUG) && _Objects_Get_class( created->Object.id ) == 1 #endif ) { executing_api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; api->signals_blocked = executing_api->signals_blocked; 4b2cc: 2079 0005 f20e moveal 5f20e <_Thread_Executing>,%a0 4b2d2: 2068 010e moveal %a0@(270),%a0 4b2d6: 2768 00c4 00c4 movel %a0@(196),%a3@(196) } else { api->signals_blocked = 0xffffffff; } _Thread_queue_Initialize( 4b2dc: 42a7 clrl %sp@- 4b2de: 4878 1000 pea 1000 4b2e2: 42a7 clrl %sp@- 4b2e4: 486b 003c pea %a3@(60) 4b2e8: 4eb9 0004 8590 jsr 48590 <_Thread_queue_Initialize> THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_JOIN_AT_EXIT, 0 ); _Watchdog_Initialize( 4b2ee: 222a 0008 movel %a2@(8),%d1 the_watchdog->routine = routine; 4b2f2: 41f9 0004 b366 lea 4b366 <_POSIX_Threads_Sporadic_budget_TSR>,%a0 _POSIX_Threads_Sporadic_budget_TSR, created->Object.id, created ); return true; 4b2f8: 4fef 0010 lea %sp@(16),%sp 4b2fc: 2748 00b8 movel %a0,%a3@(184) the_watchdog->id = id; the_watchdog->user_data = user_data; 4b300: 7001 moveq #1,%d0 4b302: 274a 00c0 movel %a2,%a3@(192) void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; 4b306: 2741 00bc movel %d1,%a3@(188) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 4b30a: 42ab 00a4 clrl %a3@(164) 4b30e: 60b0 bras 4b2c0 <_POSIX_Threads_Create_extension+0x110> <== ALWAYS TAKEN } 4b310: 246e fff8 moveal %fp@(-8),%a2 4b314: 266e fffc moveal %fp@(-4),%a3 4b318: 4e5e unlk %fp POSIX_API_Control *api; POSIX_API_Control *executing_api; api = _Workspace_Allocate( sizeof( POSIX_API_Control ) ); if ( !api ) 4b31a: 4200 clrb %d0 created->Object.id, created ); return true; } 4b31c: 4e75 rts 00046344 <_POSIX_Threads_Initialize_user_threads_body>: * * Output parameters: NONE */ void _POSIX_Threads_Initialize_user_threads_body(void) { 46344: 4e56 ffa0 linkw %fp,#-96 46348: 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; 4634c: 2479 0005 ed8e moveal 5ed8e ,%a2 maximum = Configuration_POSIX_API.number_of_initialization_threads; 46352: 2839 0005 ed8a movel 5ed8a ,%d4 if ( !user_threads || maximum == 0 ) 46358: 4a8a tstl %a2 4635a: 675a beqs 463b6 <_POSIX_Threads_Initialize_user_threads_body+0x72> <== ALWAYS TAKEN 4635c: 4a84 tstl %d4 4635e: 6756 beqs 463b6 <_POSIX_Threads_Initialize_user_threads_body+0x72> <== ALWAYS TAKEN 46360: 240e movel %fp,%d2 46362: 2a0e movel %fp,%d5 46364: 4283 clrl %d3 46366: 0682 ffff ffc4 addil #-60,%d2 4636c: 2c3c 0004 c6a4 movel #312996,%d6 46372: 4bf9 0004 c710 lea 4c710 ,%a5 46378: 49f9 0004 c750 lea 4c750 ,%a4 4637e: 5985 subql #4,%d5 46380: 47f9 0004 5fb0 lea 45fb0 ,%a3 for ( index=0 ; index < maximum ; index++ ) { /* * There is no way for these calls to fail in this situation. */ (void) pthread_attr_init( &attr ); 46386: 2f02 movel %d2,%sp@- 46388: 2046 moveal %d6,%a0 4638a: 4e90 jsr %a0@ (void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); 4638c: 4878 0002 pea 2 46390: 2f02 movel %d2,%sp@- 46392: 4e95 jsr %a5@ (void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size); 46394: 2f2a 0004 movel %a2@(4),%sp@- 46398: 2f02 movel %d2,%sp@- 4639a: 4e94 jsr %a4@ status = pthread_create( 4639c: 42a7 clrl %sp@- 4639e: 2f12 movel %a2@,%sp@- 463a0: 2f02 movel %d2,%sp@- 463a2: 2f05 movel %d5,%sp@- 463a4: 4e93 jsr %a3@ &thread_id, &attr, user_threads[ index ].thread_entry, NULL ); if ( status ) 463a6: 4fef 0024 lea %sp@(36),%sp 463aa: 4a80 tstl %d0 463ac: 6612 bnes 463c0 <_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++ ) { 463ae: 5283 addql #1,%d3 463b0: 508a addql #8,%a2 463b2: b684 cmpl %d4,%d3 463b4: 65d0 bcss 46386 <_POSIX_Threads_Initialize_user_threads_body+0x42> <== ALWAYS TAKEN NULL ); if ( status ) _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status ); } } 463b6: 4cee 3c7c ffa0 moveml %fp@(-96),%d2-%d6/%a2-%a5 463bc: 4e5e unlk %fp 463be: 4e75 rts &attr, user_threads[ index ].thread_entry, NULL ); if ( status ) _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status ); 463c0: 2f00 movel %d0,%sp@- 463c2: 4878 0001 pea 1 463c6: 4878 0002 pea 2 463ca: 4eb9 0004 836c jsr 4836c <_Internal_error_Occurred> 0004b366 <_POSIX_Threads_Sporadic_budget_TSR>: */ void _POSIX_Threads_Sporadic_budget_TSR( Objects_Id id __attribute__((unused)), void *argument ) { 4b366: 4e56 fff4 linkw %fp,#-12 4b36a: 48d7 1c00 moveml %a2-%a4,%sp@ 4b36e: 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.ss_initial_budget ); 4b372: 49f9 0004 c5c4 lea 4c5c4 <_Timespec_To_ticks>,%a4 Thread_Control *the_thread; POSIX_API_Control *api; the_thread = argument; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4b378: 246b 010e moveal %a3@(270),%a2 /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.ss_initial_budget ); 4b37c: 486a 0090 pea %a2@(144) 4b380: 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 ) { 4b382: 588f addql #4,%sp 4b384: 4281 clrl %d1 4b386: 1239 0005 d9a2 moveb 5d9a2 ,%d1 4b38c: 92aa 0098 subl %a2@(152),%d1 api = the_thread->API_Extensions[ THREAD_API_POSIX ]; /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.ss_initial_budget ); the_thread->cpu_time_budget = ticks; 4b390: 2740 0076 movel %d0,%a3@(118) new_priority = _POSIX_Priority_To_core( api->ss_high_priority ); the_thread->real_priority = new_priority; 4b394: 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 ) { 4b398: 4aab 001c tstl %a3@(28) 4b39c: 6606 bnes 4b3a4 <_POSIX_Threads_Sporadic_budget_TSR+0x3e> <== ALWAYS TAKEN /* * If this would make them less important, then do not change it. */ if ( the_thread->current_priority > new_priority ) { 4b39e: b2ab 0014 cmpl %a3@(20),%d1 4b3a2: 652c bcss 4b3d0 <_POSIX_Threads_Sporadic_budget_TSR+0x6a> #endif } } /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.ss_replenish_period ); 4b3a4: 486a 0088 pea %a2@(136) 4b3a8: 4e94 jsr %a4@ ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 4b3aa: 588f addql #4,%sp Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 4b3ac: 2540 00a8 movel %d0,%a2@(168) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 4b3b0: 45ea 009c lea %a2@(156),%a2 4b3b4: 203c 0005 f22c movel #389676,%d0 4b3ba: 2d4a 000c movel %a2,%fp@(12) _Watchdog_Insert_ticks( &api->Sporadic_timer, ticks ); } 4b3be: 4cee 1c00 fff4 moveml %fp@(-12),%a2-%a4 4b3c4: 2d40 0008 movel %d0,%fp@(8) 4b3c8: 4e5e unlk %fp 4b3ca: 4ef9 0004 8f58 jmp 48f58 <_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 ); 4b3d0: 4878 0001 pea 1 4b3d4: 2f01 movel %d1,%sp@- 4b3d6: 2f0b movel %a3,%sp@- 4b3d8: 4eb9 0004 78a8 jsr 478a8 <_Thread_Change_priority> 4b3de: 4fef 000c lea %sp@(12),%sp #endif } } /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.ss_replenish_period ); 4b3e2: 486a 0088 pea %a2@(136) 4b3e6: 4e94 jsr %a4@ 4b3e8: 588f addql #4,%sp Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 4b3ea: 2540 00a8 movel %d0,%a2@(168) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 4b3ee: 45ea 009c lea %a2@(156),%a2 4b3f2: 203c 0005 f22c movel #389676,%d0 4b3f8: 2d4a 000c movel %a2,%fp@(12) _Watchdog_Insert_ticks( &api->Sporadic_timer, ticks ); } 4b3fc: 4cee 1c00 fff4 moveml %fp@(-12),%a2-%a4 4b402: 2d40 0008 movel %d0,%fp@(8) 4b406: 4e5e unlk %fp 4b408: 4ef9 0004 8f58 jmp 48f58 <_Watchdog_Insert> ... 0004b31e <_POSIX_Threads_Sporadic_budget_callout>: RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( int priority ) { return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1); 4b31e: 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 */ 4b320: 72ff moveq #-1,%d1 * _POSIX_Threads_Sporadic_budget_callout */ void _POSIX_Threads_Sporadic_budget_callout( Thread_Control *the_thread ) { 4b322: 4e56 0000 linkw %fp,#0 4b326: 206e 0008 moveal %fp@(8),%a0 4b32a: 1039 0005 d9a2 moveb 5d9a2 ,%d0 POSIX_API_Control *api; uint32_t new_priority; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4b330: 2268 010e moveal %a0@(270),%a1 4b334: 90a9 0084 subl %a1@(132),%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 */ 4b338: 2141 0076 movel %d1,%a0@(118) new_priority = _POSIX_Priority_To_core( api->schedparam.ss_low_priority ); the_thread->real_priority = new_priority; 4b33c: 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 ) { 4b340: 4aa8 001c tstl %a0@(28) 4b344: 6606 bnes 4b34c <_POSIX_Threads_Sporadic_budget_callout+0x2e> <== ALWAYS TAKEN /* * Make sure we are actually lowering it. If they have lowered it * to logically lower than ss_low_priority, then we do not want to * change it. */ if ( the_thread->current_priority < new_priority ) { 4b346: b0a8 0014 cmpl %a0@(20),%d0 4b34a: 6204 bhis 4b350 <_POSIX_Threads_Sporadic_budget_callout+0x32> #if 0 printk( "lower priority\n" ); #endif } } } 4b34c: 4e5e unlk %fp 4b34e: 4e75 rts * Make sure we are actually lowering it. If they have lowered it * to logically lower than 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 ); 4b350: 4878 0001 pea 1 4b354: 2f00 movel %d0,%sp@- 4b356: 2f08 movel %a0,%sp@- 4b358: 4eb9 0004 78a8 jsr 478a8 <_Thread_Change_priority> 4b35e: 4fef 000c lea %sp@(12),%sp #if 0 printk( "lower priority\n" ); #endif } } } 4b362: 4e5e unlk %fp 4b364: 4e75 rts 0004d7a8 <_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; 4d7a8: 7001 moveq #1,%d0 #include void _POSIX_Threads_cancel_run( Thread_Control *the_thread ) { 4d7aa: 4e56 ffec linkw %fp,#-20 4d7ae: 206e 0008 moveal %fp@(8),%a0 4d7b2: 48d7 3c04 moveml %d2/%a2-%a5,%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 ]; 4d7b6: 2668 010e moveal %a0@(270),%a3 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4d7ba: 45eb 00dc lea %a3@(220),%a2 handler_stack = &thread_support->Cancellation_Handlers; thread_support->cancelability_state = PTHREAD_CANCEL_DISABLE; 4d7be: 2740 00cc movel %d0,%a3@(204) POSIX_API_Control *thread_support; ISR_Level level; thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; handler_stack = &thread_support->Cancellation_Handlers; 4d7c2: b5eb 00d8 cmpal %a3@(216),%a2 4d7c6: 673c beqs 4d804 <_POSIX_Threads_cancel_run+0x5c> 4d7c8: 49f9 0004 920c lea 4920c <_Workspace_Free>,%a4 thread_support->cancelability_state = PTHREAD_CANCEL_DISABLE; while ( !_Chain_Is_empty( handler_stack ) ) { _ISR_Disable( level ); 4d7ce: 243c 0000 0700 movel #1792,%d2 4d7d4: 2002 movel %d2,%d0 4d7d6: 40c1 movew %sr,%d1 4d7d8: 8081 orl %d1,%d0 4d7da: 46c0 movew %d0,%sr handler = (POSIX_Cancel_Handler_control *) 4d7dc: 2a6a 0004 moveal %a2@(4),%a5 ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 4d7e0: 2055 moveal %a5@,%a0 previous = the_node->previous; 4d7e2: 226d 0004 moveal %a5@(4),%a1 next->previous = previous; previous->next = next; 4d7e6: 2288 movel %a0,%a1@ Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 4d7e8: 2149 0004 movel %a1,%a0@(4) _Chain_Tail( handler_stack )->previous; _Chain_Extract_unprotected( &handler->Node ); _ISR_Enable( level ); 4d7ec: 46c1 movew %d1,%sr (*handler->routine)( handler->arg ); 4d7ee: 2f2d 000c movel %a5@(12),%sp@- 4d7f2: 206d 0008 moveal %a5@(8),%a0 4d7f6: 4e90 jsr %a0@ _Workspace_Free( handler ); 4d7f8: 2f0d movel %a5,%sp@- 4d7fa: 4e94 jsr %a4@ POSIX_API_Control *thread_support; ISR_Level level; thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; handler_stack = &thread_support->Cancellation_Handlers; 4d7fc: 508f addql #8,%sp 4d7fe: b5eb 00d8 cmpal %a3@(216),%a2 4d802: 66d0 bnes 4d7d4 <_POSIX_Threads_cancel_run+0x2c> <== ALWAYS TAKEN (*handler->routine)( handler->arg ); _Workspace_Free( handler ); } } 4d804: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 4d80a: 4e5e unlk %fp 4d80c: 4e75 rts ... 00045cb4 <_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) { 45cb4: 4e56 0000 linkw %fp,#0 45cb8: 2f0a movel %a2,%sp@- 45cba: 246e 000c moveal %fp@(12),%a2 bool activated; ptimer = (POSIX_Timer_Control *)data; /* Increment the number of expirations. */ ptimer->overrun = ptimer->overrun + 1; 45cbe: 52aa 0066 addql #1,%a2@(102) /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || 45cc2: 4aaa 0052 tstl %a2@(82) 45cc6: 6606 bnes 45cce <_POSIX_Timer_TSR+0x1a> ( ptimer->timer_data.it_interval.tv_nsec != 0 ) ) { 45cc8: 4aaa 0056 tstl %a2@(86) 45ccc: 672a beqs 45cf8 <_POSIX_Timer_TSR+0x44> <== ALWAYS TAKEN activated = _POSIX_Timer_Insert_helper( 45cce: 2f0a movel %a2,%sp@- 45cd0: 4879 0004 5cb4 pea 45cb4 <_POSIX_Timer_TSR> 45cd6: 2f2a 0008 movel %a2@(8),%sp@- 45cda: 2f2a 0062 movel %a2@(98),%sp@- 45cde: 486a 0010 pea %a2@(16) 45ce2: 4eb9 0004 bed4 jsr 4bed4 <_POSIX_Timer_Insert_helper> ptimer->ticks, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) 45ce8: 4fef 0014 lea %sp@(20),%sp 45cec: 4a00 tstb %d0 45cee: 662a bnes 45d1a <_POSIX_Timer_TSR+0x66> <== NEVER TAKEN /* After the signal handler returns, the count of expirations of the * timer must be set to 0. */ ptimer->overrun = 0; } 45cf0: 246e fffc moveal %fp@(-4),%a2 <== NOT EXECUTED 45cf4: 4e5e unlk %fp <== NOT EXECUTED 45cf6: 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; 45cf8: 7004 moveq #4,%d0 <== NOT EXECUTED 45cfa: 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 ) ) { 45cfe: 2f2a 0042 movel %a2@(66),%sp@- <== NOT EXECUTED 45d02: 2f2a 0038 movel %a2@(56),%sp@- <== NOT EXECUTED 45d06: 4eb9 0004 b9e8 jsr 4b9e8 <== NOT EXECUTED } /* After the signal handler returns, the count of expirations of the * timer must be set to 0. */ ptimer->overrun = 0; 45d0c: 508f addql #8,%sp <== NOT EXECUTED 45d0e: 42aa 0066 clrl %a2@(102) <== NOT EXECUTED } 45d12: 246e fffc moveal %fp@(-4),%a2 45d16: 4e5e unlk %fp 45d18: 4e75 rts ); if ( !activated ) return; /* Store the time when the timer was started again */ _TOD_Get( &ptimer->time ); 45d1a: 486a 006a pea %a2@(106) 45d1e: 4eb9 0004 7470 jsr 47470 <_TOD_Get> /* Increment the number of expirations. */ ptimer->overrun = ptimer->overrun + 1; /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || 45d24: 588f addql #4,%sp /* Store the time when the timer was started again */ _TOD_Get( &ptimer->time ); /* The state really did not change but just to be safe */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; 45d26: 7003 moveq #3,%d0 45d28: 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 ) ) { 45d2c: 2f2a 0042 movel %a2@(66),%sp@- 45d30: 2f2a 0038 movel %a2@(56),%sp@- 45d34: 4eb9 0004 b9e8 jsr 4b9e8 } /* After the signal handler returns, the count of expirations of the * timer must be set to 0. */ ptimer->overrun = 0; 45d3a: 508f addql #8,%sp 45d3c: 42aa 0066 clrl %a2@(102) 45d40: 60d0 bras 45d12 <_POSIX_Timer_TSR+0x5e> <== ALWAYS TAKEN ... 0004d8b4 <_POSIX_signals_Check_signal>: ) { siginfo_t siginfo_struct; sigset_t saved_signals_blocked; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 4d8b4: 4280 clrl %d0 bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 4d8b6: 4e56 ffdc linkw %fp,#-36 4d8ba: 48d7 1c1c moveml %d2-%d4/%a2-%a4,%sp@ siginfo_t siginfo_struct; sigset_t saved_signals_blocked; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 4d8be: 4878 0001 pea 1 4d8c2: 102e 0013 moveb %fp@(19),%d0 4d8c6: 260e movel %fp,%d3 4d8c8: 0683 ffff fff4 addil #-12,%d3 bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 4d8ce: 242e 000c movel %fp@(12),%d2 siginfo_t siginfo_struct; sigset_t saved_signals_blocked; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 4d8d2: 2f00 movel %d0,%sp@- bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 4d8d4: 246e 0008 moveal %fp@(8),%a2 siginfo_t siginfo_struct; sigset_t saved_signals_blocked; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 4d8d8: 2f03 movel %d3,%sp@- 4d8da: 2f02 movel %d2,%sp@- 4d8dc: 2f0a movel %a2,%sp@- 4d8de: 4eb9 0004 d960 jsr 4d960 <_POSIX_signals_Clear_signals> 4d8e4: 4fef 0014 lea %sp@(20),%sp 4d8e8: 4a00 tstb %d0 4d8ea: 6766 beqs 4d952 <_POSIX_signals_Check_signal+0x9e> #endif /* * Just to prevent sending a signal which is currently being ignored. */ if ( _POSIX_signals_Vectors[ signo ].sa_handler == SIG_IGN ) 4d8ec: 2202 movel %d2,%d1 4d8ee: 2002 movel %d2,%d0 4d8f0: 43f9 0005 f602 lea 5f602 <_POSIX_signals_Vectors>,%a1 4d8f6: e589 lsll #2,%d1 4d8f8: e988 lsll #4,%d0 4d8fa: 9081 subl %d1,%d0 4d8fc: 2040 moveal %d0,%a0 4d8fe: d1fc 0005 f60a addal #390666,%a0 4d904: 7201 moveq #1,%d1 4d906: 2050 moveal %a0@,%a0 4d908: b288 cmpl %a0,%d1 4d90a: 6746 beqs 4d952 <_POSIX_signals_Check_signal+0x9e> <== ALWAYS TAKEN /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; 4d90c: 2842 moveal %d2,%a4 4d90e: 47f4 2a01 lea %a4@(00000001,%d2:l:2),%a3 return false; /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; 4d912: 282a 00c4 movel %a2@(196),%d4 api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; 4d916: 2231 bc00 movel %a1@(00000000,%a3:l:4),%d1 4d91a: 8284 orl %d4,%d1 4d91c: 2541 00c4 movel %d1,%a2@(196) /* * Here, the signal handler function executes */ switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) { 4d920: 7202 moveq #2,%d1 4d922: b2b1 0800 cmpl %a1@(00000000,%d0:l),%d1 4d926: 6716 beqs 4d93e <_POSIX_signals_Check_signal+0x8a> &siginfo_struct, NULL /* context is undefined per 1003.1b-1993, p. 66 */ ); break; default: (*_POSIX_signals_Vectors[ signo ].sa_handler)( signo ); 4d928: 2f02 movel %d2,%sp@- 4d92a: 4e90 jsr %a0@ 4d92c: 588f addql #4,%sp } /* * Restore the previous set of blocked signals */ api->signals_blocked = saved_signals_blocked; 4d92e: 7001 moveq #1,%d0 4d930: 2544 00c4 movel %d4,%a2@(196) return true; } 4d934: 4cee 1c1c ffdc moveml %fp@(-36),%d2-%d4/%a2-%a4 4d93a: 4e5e unlk %fp 4d93c: 4e75 rts /* * Here, the signal handler function executes */ switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) { case SA_SIGINFO: (*_POSIX_signals_Vectors[ signo ].sa_sigaction)( 4d93e: 42a7 clrl %sp@- 4d940: 2f03 movel %d3,%sp@- 4d942: 2f02 movel %d2,%sp@- 4d944: 4e90 jsr %a0@ signo, &siginfo_struct, NULL /* context is undefined per 1003.1b-1993, p. 66 */ ); break; 4d946: 4fef 000c lea %sp@(12),%sp } /* * Restore the previous set of blocked signals */ api->signals_blocked = saved_signals_blocked; 4d94a: 2544 00c4 movel %d4,%a2@(196) 4d94e: 7001 moveq #1,%d0 4d950: 60e2 bras 4d934 <_POSIX_signals_Check_signal+0x80> <== ALWAYS TAKEN return true; } 4d952: 4cee 1c1c ffdc moveml %fp@(-36),%d2-%d4/%a2-%a4 /* * Restore the previous set of blocked signals */ api->signals_blocked = saved_signals_blocked; return true; 4d958: 4200 clrb %d0 } 4d95a: 4e5e unlk %fp 4d95c: 4e75 rts ... 0004eacc <_POSIX_signals_Clear_process_signals>: clear_signal = true; mask = signo_to_mask( signo ); ISR_Level level; _ISR_Disable( level ); 4eacc: 203c 0000 0700 movel #1792,%d0 */ void _POSIX_signals_Clear_process_signals( int signo ) { 4ead2: 4e56 0000 linkw %fp,#0 4ead6: 222e 0008 movel %fp@(8),%d1 4eada: 2f03 movel %d3,%sp@- 4eadc: 2f02 movel %d2,%sp@- clear_signal = true; mask = signo_to_mask( signo ); ISR_Level level; _ISR_Disable( level ); 4eade: 40c2 movew %sr,%d2 4eae0: 8082 orl %d2,%d0 4eae2: 46c0 movew %d0,%sr if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { 4eae4: 2601 movel %d1,%d3 4eae6: 2001 movel %d1,%d0 4eae8: 41f9 0005 f602 lea 5f602 <_POSIX_signals_Vectors>,%a0 4eaee: e58b lsll #2,%d3 4eaf0: e988 lsll #4,%d0 4eaf2: 9083 subl %d3,%d0 4eaf4: 7602 moveq #2,%d3 4eaf6: b6b0 0800 cmpl %a0@(00000000,%d0:l),%d3 4eafa: 6726 beqs 4eb22 <_POSIX_signals_Clear_process_signals+0x56> if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) clear_signal = false; } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; 4eafc: 5381 subql #1,%d1 4eafe: 7001 moveq #1,%d0 4eb00: e3a8 lsll %d1,%d0 4eb02: 4680 notl %d0 4eb04: c0b9 0005 f7ce andl 5f7ce <_POSIX_signals_Pending>,%d0 4eb0a: 23c0 0005 f7ce movel %d0,5f7ce <_POSIX_signals_Pending> if ( !_POSIX_signals_Pending ) 4eb10: 6606 bnes 4eb18 <_POSIX_signals_Clear_process_signals+0x4c> <== ALWAYS TAKEN _Thread_Do_post_task_switch_extension--; 4eb12: 53b9 0005 f1f6 subql #1,5f1f6 <_Thread_Do_post_task_switch_extension> } _ISR_Enable( level ); 4eb18: 46c2 movew %d2,%sr } 4eb1a: 241f movel %sp@+,%d2 4eb1c: 261f movel %sp@+,%d3 4eb1e: 4e5e unlk %fp 4eb20: 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 ] ) ) 4eb22: 0680 0005 f7d2 addil #391122,%d0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4eb28: 2040 moveal %d0,%a0 4eb2a: 5888 addql #4,%a0 4eb2c: 2240 moveal %d0,%a1 4eb2e: b1d1 cmpal %a1@,%a0 4eb30: 67ca beqs 4eafc <_POSIX_signals_Clear_process_signals+0x30> <== NEVER TAKEN if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; if ( !_POSIX_signals_Pending ) _Thread_Do_post_task_switch_extension--; } _ISR_Enable( level ); 4eb32: 46c2 movew %d2,%sr <== NOT EXECUTED } 4eb34: 241f movel %sp@+,%d2 <== NOT EXECUTED 4eb36: 261f movel %sp@+,%d3 <== NOT EXECUTED 4eb38: 4e5e unlk %fp <== NOT EXECUTED 4eb3a: 4e75 rts 0004d960 <_POSIX_signals_Clear_signals>: static inline sigset_t signo_to_mask( uint32_t sig ) { return 1u << (sig - 1); 4d960: 7001 moveq #1,%d0 int signo, siginfo_t *info, bool is_global, bool check_blocked ) { 4d962: 4e56 ffe8 linkw %fp,#-24 4d966: 206e 0008 moveal %fp@(8),%a0 4d96a: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@ 4d96e: 242e 000c movel %fp@(12),%d2 4d972: 2202 movel %d2,%d1 4d974: 5381 subql #1,%d1 4d976: 1a2e 0017 moveb %fp@(23),%d5 4d97a: e3a8 lsll %d1,%d0 /* set blocked signals based on if checking for them, SIGNAL_ALL_MASK * insures that no signals are blocked and all are checked. */ if ( check_blocked ) 4d97c: 4a2e 001b tstb %fp@(27) 4d980: 664e bnes 4d9d0 <_POSIX_signals_Clear_signals+0x70> 4d982: 78ff moveq #-1,%d4 signals_blocked = SIGNAL_ALL_MASK; /* XXX is this right for siginfo type signals? */ /* XXX are we sure they can be cleared the same way? */ _ISR_Disable( level ); 4d984: 223c 0000 0700 movel #1792,%d1 4d98a: 40c3 movew %sr,%d3 4d98c: 8283 orl %d3,%d1 4d98e: 46c1 movew %d1,%sr if ( is_global ) { 4d990: 4a05 tstb %d5 4d992: 6752 beqs 4d9e6 <_POSIX_signals_Clear_signals+0x86> if ( mask & (_POSIX_signals_Pending & signals_blocked) ) { 4d994: c0b9 0005 f7ce andl 5f7ce <_POSIX_signals_Pending>,%d0 4d99a: c084 andl %d4,%d0 4d99c: 676a beqs 4da08 <_POSIX_signals_Clear_signals+0xa8> if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { 4d99e: 2202 movel %d2,%d1 4d9a0: 2002 movel %d2,%d0 4d9a2: 47f9 0004 eacc lea 4eacc <_POSIX_signals_Clear_process_signals>,%a3 4d9a8: 41f9 0005 f602 lea 5f602 <_POSIX_signals_Vectors>,%a0 4d9ae: e589 lsll #2,%d1 4d9b0: e988 lsll #4,%d0 4d9b2: 9081 subl %d1,%d0 4d9b4: 7202 moveq #2,%d1 4d9b6: b2b0 0800 cmpl %a0@(00000000,%d0:l),%d1 4d9ba: 675a beqs 4da16 <_POSIX_signals_Clear_signals+0xb6> &psiginfo->Node ); } else do_callout = false; } _POSIX_signals_Clear_process_signals( signo ); 4d9bc: 2f02 movel %d2,%sp@- 4d9be: 4e93 jsr %a3@ 4d9c0: 588f addql #4,%sp 4d9c2: 7001 moveq #1,%d0 if ( mask & (api->signals_pending & signals_blocked) ) { api->signals_pending &= ~mask; do_callout = true; } } _ISR_Enable( level ); 4d9c4: 46c3 movew %d3,%sr return do_callout; } 4d9c6: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 4d9cc: 4e5e unlk %fp 4d9ce: 4e75 rts /* set blocked signals based on if checking for them, SIGNAL_ALL_MASK * insures that no signals are blocked and all are checked. */ if ( check_blocked ) signals_blocked = ~api->signals_blocked; 4d9d0: 2828 00c4 movel %a0@(196),%d4 signals_blocked = SIGNAL_ALL_MASK; /* XXX is this right for siginfo type signals? */ /* XXX are we sure they can be cleared the same way? */ _ISR_Disable( level ); 4d9d4: 223c 0000 0700 movel #1792,%d1 /* set blocked signals based on if checking for them, SIGNAL_ALL_MASK * insures that no signals are blocked and all are checked. */ if ( check_blocked ) signals_blocked = ~api->signals_blocked; 4d9da: 4684 notl %d4 signals_blocked = SIGNAL_ALL_MASK; /* XXX is this right for siginfo type signals? */ /* XXX are we sure they can be cleared the same way? */ _ISR_Disable( level ); 4d9dc: 40c3 movew %sr,%d3 4d9de: 8283 orl %d3,%d1 4d9e0: 46c1 movew %d1,%sr if ( is_global ) { 4d9e2: 4a05 tstb %d5 4d9e4: 66ae bnes 4d994 <_POSIX_signals_Clear_signals+0x34> } _POSIX_signals_Clear_process_signals( signo ); do_callout = true; } } else { if ( mask & (api->signals_pending & signals_blocked) ) { 4d9e6: 2428 00c8 movel %a0@(200),%d2 4d9ea: 2200 movel %d0,%d1 4d9ec: c282 andl %d2,%d1 4d9ee: c284 andl %d4,%d1 4d9f0: 6716 beqs 4da08 <_POSIX_signals_Clear_signals+0xa8> api->signals_pending &= ~mask; 4d9f2: 4680 notl %d0 4d9f4: c082 andl %d2,%d0 4d9f6: 2140 00c8 movel %d0,%a0@(200) 4d9fa: 7001 moveq #1,%d0 do_callout = true; } } _ISR_Enable( level ); 4d9fc: 46c3 movew %d3,%sr return do_callout; } 4d9fe: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 4da04: 4e5e unlk %fp 4da06: 4e75 rts _POSIX_signals_Clear_process_signals( signo ); do_callout = true; } } else { if ( mask & (api->signals_pending & signals_blocked) ) { api->signals_pending &= ~mask; 4da08: 4200 clrb %d0 do_callout = true; } } _ISR_Enable( level ); 4da0a: 46c3 movew %d3,%sr return do_callout; } 4da0c: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 4da12: 4e5e unlk %fp 4da14: 4e75 rts _ISR_Disable( level ); if ( is_global ) { if ( mask & (_POSIX_signals_Pending & signals_blocked) ) { if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { psiginfo = (POSIX_signals_Siginfo_node *) 4da16: 0680 0005 f7d2 addil #391122,%d0 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 4da1c: 2040 moveal %d0,%a0 4da1e: 2458 moveal %a0@+,%a2 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4da20: b1ca cmpal %a2,%a0 4da22: 6744 beqs 4da68 <_POSIX_signals_Clear_signals+0x108> { Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; 4da24: 2052 moveal %a2@,%a0 the_chain->first = new_first; 4da26: 2240 moveal %d0,%a1 4da28: 2288 movel %a0,%a1@ new_first->previous = _Chain_Head(the_chain); 4da2a: 2140 0004 movel %d0,%a0@(4) _Chain_Get_unprotected( &_POSIX_signals_Siginfo[ signo ] ); _POSIX_signals_Clear_process_signals( signo ); 4da2e: 2f02 movel %d2,%sp@- 4da30: 4e93 jsr %a3@ * It may be impossible to get here with an empty chain * BUT until that is proven we need to be defensive and * protect against it. */ if ( psiginfo ) { *info = psiginfo->Info; 4da32: 206e 0010 moveal %fp@(16),%a0 the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; the_chain->last = the_node; old_last_node->next = the_node; the_node->previous = old_last_node; 4da36: 588f addql #4,%sp 4da38: 20ea 0008 movel %a2@(8),%a0@+ 4da3c: 20ea 000c movel %a2@(12),%a0@+ 4da40: 20aa 0010 movel %a2@(16),%a0@ Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 4da44: 24bc 0005 f786 movel #391046,%a2@ old_last_node = the_chain->last; 4da4a: 2279 0005 f78a moveal 5f78a <_POSIX_signals_Inactive_siginfo+0x8>,%a1 the_chain->last = the_node; 4da50: 23ca 0005 f78a movel %a2,5f78a <_POSIX_signals_Inactive_siginfo+0x8> old_last_node->next = the_node; the_node->previous = old_last_node; 4da56: 2549 0004 movel %a1,%a2@(4) Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; the_chain->last = the_node; old_last_node->next = the_node; 4da5a: 228a movel %a2,%a1@ &psiginfo->Node ); } else do_callout = false; } _POSIX_signals_Clear_process_signals( signo ); 4da5c: 2f02 movel %d2,%sp@- 4da5e: 4e93 jsr %a3@ 4da60: 588f addql #4,%sp 4da62: 7001 moveq #1,%d0 4da64: 6000 ff5e braw 4d9c4 <_POSIX_signals_Clear_signals+0x64> <== ALWAYS TAKEN if ( is_global ) { if ( mask & (_POSIX_signals_Pending & signals_blocked) ) { if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { psiginfo = (POSIX_signals_Siginfo_node *) _Chain_Get_unprotected( &_POSIX_signals_Siginfo[ signo ] ); _POSIX_signals_Clear_process_signals( signo ); 4da68: 2f02 movel %d2,%sp@- 4da6a: 4e93 jsr %a3@ 4da6c: 588f addql #4,%sp &psiginfo->Node ); } else do_callout = false; } _POSIX_signals_Clear_process_signals( signo ); 4da6e: 2f02 movel %d2,%sp@- 4da70: 4e93 jsr %a3@ 4da72: 588f addql #4,%sp 4da74: 7001 moveq #1,%d0 4da76: 6000 ff4c braw 4d9c4 <_POSIX_signals_Clear_signals+0x64> <== ALWAYS TAKEN ... 00046a7c <_POSIX_signals_Get_highest>: #include int _POSIX_signals_Get_highest( sigset_t set ) { 46a7c: 701b moveq #27,%d0 46a7e: 4e56 fff4 linkw %fp,#-12 46a82: 48d7 001c moveml %d2-%d4,%sp@ 46a86: 242e 0008 movel %fp@(8),%d2 int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { if ( set & signo_to_mask( signo ) ) { 46a8a: 7601 moveq #1,%d3 46a8c: 2200 movel %d0,%d1 46a8e: 5381 subql #1,%d1 46a90: 2803 movel %d3,%d4 46a92: e3ac lsll %d1,%d4 46a94: 2204 movel %d4,%d1 46a96: c282 andl %d2,%d1 46a98: 6626 bnes 46ac0 <_POSIX_signals_Get_highest+0x44> <== ALWAYS TAKEN sigset_t set ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 46a9a: 5280 addql #1,%d0 46a9c: 123c 0020 moveb #32,%d1 46aa0: b280 cmpl %d0,%d1 46aa2: 66e8 bnes 46a8c <_POSIX_signals_Get_highest+0x10> 46aa4: 7001 moveq #1,%d0 #if (SIGHUP != 1) #error "Assumption that SIGHUP==1 violated!!" #endif for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { if ( set & signo_to_mask( signo ) ) { 46aa6: 7601 moveq #1,%d3 46aa8: 2200 movel %d0,%d1 46aaa: 5381 subql #1,%d1 46aac: 2803 movel %d3,%d4 46aae: e3ac lsll %d1,%d4 46ab0: 2204 movel %d4,%d1 46ab2: c282 andl %d2,%d1 46ab4: 660a bnes 46ac0 <_POSIX_signals_Get_highest+0x44> */ #if (SIGHUP != 1) #error "Assumption that SIGHUP==1 violated!!" #endif for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { 46ab6: 5280 addql #1,%d0 46ab8: 123c 001b moveb #27,%d1 46abc: b280 cmpl %d0,%d1 46abe: 66e8 bnes 46aa8 <_POSIX_signals_Get_highest+0x2c> <== NEVER TAKEN * a return 0. This routine will NOT be called unless a signal * is pending in the set passed in. */ found_it: return signo; } 46ac0: 4cd7 001c moveml %sp@,%d2-%d4 46ac4: 4e5e unlk %fp 46ac6: 4e75 rts 0004afa8 <_POSIX_signals_Post_switch_extension>: */ void _POSIX_signals_Post_switch_extension( Thread_Control *the_thread ) { 4afa8: 4e56 fff0 linkw %fp,#-16 POSIX_API_Control *api; int signo; ISR_Level level; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4afac: 206e 0008 moveal %fp@(8),%a0 */ void _POSIX_signals_Post_switch_extension( Thread_Control *the_thread ) { 4afb0: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ POSIX_API_Control *api; int signo; ISR_Level level; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4afb4: 2468 010e moveal %a0@(270),%a2 * * 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 ); 4afb8: 263c 0000 0700 movel #1792,%d3 4afbe: 47f9 0004 d8b4 lea 4d8b4 <_POSIX_signals_Check_signal>,%a3 4afc4: 2003 movel %d3,%d0 4afc6: 40c1 movew %sr,%d1 4afc8: 8081 orl %d1,%d0 4afca: 46c0 movew %d0,%sr if ( !(~api->signals_blocked & (api->signals_pending | _POSIX_signals_Pending)) ) { 4afcc: 2039 0005 f7ce movel 5f7ce <_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 & 4afd2: 242a 00c4 movel %a2@(196),%d2 4afd6: 4682 notl %d2 (api->signals_pending | _POSIX_signals_Pending)) ) { 4afd8: 80aa 00c8 orl %a2@(200),%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 & 4afdc: c082 andl %d2,%d0 4afde: 6762 beqs 4b042 <_POSIX_signals_Post_switch_extension+0x9a> (api->signals_pending | _POSIX_signals_Pending)) ) { _ISR_Enable( level ); break; } _ISR_Enable( level ); 4afe0: 46c1 movew %d1,%sr 4afe2: 741b moveq #27,%d2 for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { _POSIX_signals_Check_signal( api, signo, false ); 4afe4: 42a7 clrl %sp@- 4afe6: 2f02 movel %d2,%sp@- 4afe8: 2f0a movel %a2,%sp@- 4afea: 4e93 jsr %a3@ _POSIX_signals_Check_signal( api, signo, true ); 4afec: 4878 0001 pea 1 4aff0: 2f02 movel %d2,%sp@- _ISR_Enable( level ); break; } _ISR_Enable( level ); for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 4aff2: 5282 addql #1,%d2 _POSIX_signals_Check_signal( api, signo, false ); _POSIX_signals_Check_signal( api, signo, true ); 4aff4: 2f0a movel %a2,%sp@- 4aff6: 4e93 jsr %a3@ _ISR_Enable( level ); break; } _ISR_Enable( level ); for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 4aff8: 4fef 0018 lea %sp@(24),%sp 4affc: 7020 moveq #32,%d0 4affe: b082 cmpl %d2,%d0 4b000: 66e2 bnes 4afe4 <_POSIX_signals_Post_switch_extension+0x3c> 4b002: 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 ); 4b004: 42a7 clrl %sp@- 4b006: 2f02 movel %d2,%sp@- 4b008: 2f0a movel %a2,%sp@- 4b00a: 4e93 jsr %a3@ _POSIX_signals_Check_signal( api, signo, true ); 4b00c: 4878 0001 pea 1 4b010: 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++ ) { 4b012: 5282 addql #1,%d2 _POSIX_signals_Check_signal( api, signo, false ); _POSIX_signals_Check_signal( api, signo, true ); 4b014: 2f0a movel %a2,%sp@- 4b016: 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++ ) { 4b018: 4fef 0018 lea %sp@(24),%sp 4b01c: 701b moveq #27,%d0 4b01e: b082 cmpl %d2,%d0 4b020: 67a2 beqs 4afc4 <_POSIX_signals_Post_switch_extension+0x1c> <== ALWAYS TAKEN _POSIX_signals_Check_signal( api, signo, false ); 4b022: 42a7 clrl %sp@- 4b024: 2f02 movel %d2,%sp@- 4b026: 2f0a movel %a2,%sp@- 4b028: 4e93 jsr %a3@ _POSIX_signals_Check_signal( api, signo, true ); 4b02a: 4878 0001 pea 1 4b02e: 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++ ) { 4b030: 5282 addql #1,%d2 _POSIX_signals_Check_signal( api, signo, false ); _POSIX_signals_Check_signal( api, signo, true ); 4b032: 2f0a movel %a2,%sp@- 4b034: 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++ ) { 4b036: 4fef 0018 lea %sp@(24),%sp 4b03a: 701b moveq #27,%d0 4b03c: b082 cmpl %d2,%d0 4b03e: 66c4 bnes 4b004 <_POSIX_signals_Post_switch_extension+0x5c> 4b040: 6082 bras 4afc4 <_POSIX_signals_Post_switch_extension+0x1c> <== ALWAYS TAKEN */ while (1) { _ISR_Disable( level ); if ( !(~api->signals_blocked & (api->signals_pending | _POSIX_signals_Pending)) ) { _ISR_Enable( level ); 4b042: 46c1 movew %d1,%sr for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { _POSIX_signals_Check_signal( api, signo, false ); _POSIX_signals_Check_signal( api, signo, true ); } } } 4b044: 4cee 0c0c fff0 moveml %fp@(-16),%d2-%d3/%a2-%a3 4b04a: 4e5e unlk %fp 4b04c: 4e75 rts 0004eb6c <_POSIX_signals_Unblock_thread>: 4eb6c: 7001 moveq #1,%d0 bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, siginfo_t *info ) { 4eb6e: 4e56 fff4 linkw %fp,#-12 4eb72: 222e 000c movel %fp@(12),%d1 4eb76: 48d7 040c moveml %d2-%d3/%a2,%sp@ 4eb7a: 246e 0008 moveal %fp@(8),%a2 4eb7e: 2601 movel %d1,%d3 4eb80: 5383 subql #1,%d3 /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 4eb82: 242a 0010 movel %a2@(16),%d2 4eb86: 0282 1000 8000 andil #268468224,%d2 bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, siginfo_t *info ) { 4eb8c: 226e 0010 moveal %fp@(16),%a1 POSIX_API_Control *api; sigset_t mask; siginfo_t *the_info = NULL; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4eb90: 206a 010e moveal %a2@(270),%a0 4eb94: e7a8 lsll %d3,%d0 /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 4eb96: 0c82 1000 8000 cmpil #268468224,%d2 4eb9c: 6772 beqs 4ec10 <_POSIX_signals_Unblock_thread+0xa4> } /* * Thread is not waiting due to a sigwait. */ if ( ~api->signals_blocked & mask ) { 4eb9e: 2228 00c4 movel %a0@(196),%d1 4eba2: 4681 notl %d1 4eba4: c081 andl %d1,%d0 4eba6: 675c beqs 4ec04 <_POSIX_signals_Unblock_thread+0x98> * + Any other combination, do nothing. */ the_thread->do_post_task_switch_extension = true; if ( the_thread->current_state & STATES_INTERRUPTIBLE_BY_SIGNAL ) { 4eba8: 202a 0010 movel %a2@(16),%d0 * it is not blocked, THEN * we need to dispatch at the end of this ISR. * + Any other combination, do nothing. */ the_thread->do_post_task_switch_extension = true; 4ebac: 7201 moveq #1,%d1 4ebae: 1541 0074 moveb %d1,%a2@(116) if ( the_thread->current_state & STATES_INTERRUPTIBLE_BY_SIGNAL ) { 4ebb2: 0800 001c btst #28,%d0 4ebb6: 6736 beqs 4ebee <_POSIX_signals_Unblock_thread+0x82> the_thread->Wait.return_code = EINTR; 4ebb8: 7004 moveq #4,%d0 4ebba: 2540 0034 movel %d0,%a2@(52) #if 0 if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) ) _Thread_queue_Extract_with_proxy( the_thread ); else #endif if ( _States_Is_delaying(the_thread->current_state) ){ 4ebbe: 103c 0008 moveb #8,%d0 4ebc2: c0aa 0010 andl %a2@(16),%d0 4ebc6: 673c beqs 4ec04 <_POSIX_signals_Unblock_thread+0x98> <== ALWAYS TAKEN if ( _Watchdog_Is_active( &the_thread->Timer ) ) 4ebc8: 7202 moveq #2,%d1 4ebca: b2aa 0050 cmpl %a2@(80),%d1 4ebce: 6700 00a4 beqw 4ec74 <_POSIX_signals_Unblock_thread+0x108> <== NEVER TAKEN RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 4ebd2: 2f3c 1003 fff8 movel #268697592,%sp@- <== NOT EXECUTED 4ebd8: 2f0a movel %a2,%sp@- <== NOT EXECUTED 4ebda: 4eb9 0004 79f4 jsr 479f4 <_Thread_Clear_state> <== NOT EXECUTED 4ebe0: 508f addql #8,%sp <== NOT EXECUTED 4ebe2: 4200 clrb %d0 <== NOT EXECUTED if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _ISR_Signals_to_thread_executing = true; } } return false; } 4ebe4: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 4ebea: 4e5e unlk %fp 4ebec: 4e75 rts if ( _States_Is_delaying(the_thread->current_state) ){ if ( _Watchdog_Is_active( &the_thread->Timer ) ) (void) _Watchdog_Remove( &the_thread->Timer ); _Thread_Unblock( the_thread ); } } else if ( the_thread->current_state == STATES_READY ) { 4ebee: 4a80 tstl %d0 4ebf0: 6612 bnes 4ec04 <_POSIX_signals_Unblock_thread+0x98> <== ALWAYS TAKEN if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 4ebf2: 2039 0005 f1ee movel 5f1ee <_ISR_Nest_level>,%d0 4ebf8: 670a beqs 4ec04 <_POSIX_signals_Unblock_thread+0x98> 4ebfa: b5f9 0005 f20e cmpal 5f20e <_Thread_Executing>,%a2 4ec00: 6700 0094 beqw 4ec96 <_POSIX_signals_Unblock_thread+0x12a> <== NEVER TAKEN _ISR_Signals_to_thread_executing = true; } } return false; } 4ec04: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 (void) _Watchdog_Remove( &the_thread->Timer ); _Thread_Unblock( the_thread ); } } else if ( the_thread->current_state == STATES_READY ) { if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _ISR_Signals_to_thread_executing = true; 4ec0a: 4200 clrb %d0 } } return false; } 4ec0c: 4e5e unlk %fp 4ec0e: 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) ) { 4ec10: 2400 movel %d0,%d2 4ec12: c4aa 0030 andl %a2@(48),%d2 4ec16: 672a beqs 4ec42 <_POSIX_signals_Unblock_thread+0xd6> the_thread->Wait.return_code = EINTR; 4ec18: 7004 moveq #4,%d0 the_info = (siginfo_t *) the_thread->Wait.return_argument; 4ec1a: 206a 0028 moveal %a2@(40),%a0 */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { the_thread->Wait.return_code = EINTR; 4ec1e: 2540 0034 movel %d0,%a2@(52) the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { 4ec22: 4a89 tstl %a1 4ec24: 6734 beqs 4ec5a <_POSIX_signals_Unblock_thread+0xee> the_info->si_signo = signo; the_info->si_code = SI_USER; the_info->si_value.sival_int = 0; } else { *the_info = *info; 4ec26: 20d9 movel %a1@+,%a0@+ 4ec28: 20d9 movel %a1@+,%a0@+ 4ec2a: 2091 movel %a1@,%a0@ } _Thread_queue_Extract_with_proxy( the_thread ); 4ec2c: 2f0a movel %a2,%sp@- 4ec2e: 4eb9 0004 8528 jsr 48528 <_Thread_queue_Extract_with_proxy> return true; 4ec34: 588f addql #4,%sp the_info->si_value.sival_int = 0; } else { *the_info = *info; } _Thread_queue_Extract_with_proxy( the_thread ); 4ec36: 7001 moveq #1,%d0 if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _ISR_Signals_to_thread_executing = true; } } return false; } 4ec38: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 4ec3e: 4e5e unlk %fp 4ec40: 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) ) { 4ec42: 2428 00c4 movel %a0@(196),%d2 4ec46: 4682 notl %d2 4ec48: c082 andl %d2,%d0 4ec4a: 67b8 beqs 4ec04 <_POSIX_signals_Unblock_thread+0x98> the_thread->Wait.return_code = EINTR; 4ec4c: 7004 moveq #4,%d0 the_info = (siginfo_t *) the_thread->Wait.return_argument; 4ec4e: 206a 0028 moveal %a2@(40),%a0 */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { the_thread->Wait.return_code = EINTR; 4ec52: 2540 0034 movel %d0,%a2@(52) the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { 4ec56: 4a89 tstl %a1 4ec58: 66cc bnes 4ec26 <_POSIX_signals_Unblock_thread+0xba> <== NEVER TAKEN the_info->si_signo = signo; 4ec5a: 2081 movel %d1,%a0@ the_info->si_code = SI_USER; 4ec5c: 7201 moveq #1,%d1 the_info->si_value.sival_int = 0; 4ec5e: 42a8 0008 clrl %a0@(8) the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { the_info->si_signo = signo; the_info->si_code = SI_USER; 4ec62: 2141 0004 movel %d1,%a0@(4) the_info->si_value.sival_int = 0; } else { *the_info = *info; } _Thread_queue_Extract_with_proxy( the_thread ); 4ec66: 2f0a movel %a2,%sp@- 4ec68: 4eb9 0004 8528 jsr 48528 <_Thread_queue_Extract_with_proxy> return true; 4ec6e: 588f addql #4,%sp the_info->si_value.sival_int = 0; } else { *the_info = *info; } _Thread_queue_Extract_with_proxy( the_thread ); 4ec70: 7001 moveq #1,%d0 4ec72: 60c4 bras 4ec38 <_POSIX_signals_Unblock_thread+0xcc> <== ALWAYS TAKEN _Thread_queue_Extract_with_proxy( the_thread ); else #endif if ( _States_Is_delaying(the_thread->current_state) ){ if ( _Watchdog_Is_active( &the_thread->Timer ) ) (void) _Watchdog_Remove( &the_thread->Timer ); 4ec74: 486a 0048 pea %a2@(72) 4ec78: 4eb9 0004 90a0 jsr 490a0 <_Watchdog_Remove> 4ec7e: 588f addql #4,%sp 4ec80: 2f3c 1003 fff8 movel #268697592,%sp@- 4ec86: 2f0a movel %a2,%sp@- 4ec88: 4eb9 0004 79f4 jsr 479f4 <_Thread_Clear_state> 4ec8e: 508f addql #8,%sp 4ec90: 4200 clrb %d0 4ec92: 6000 ff50 braw 4ebe4 <_POSIX_signals_Unblock_thread+0x78> <== ALWAYS TAKEN _Thread_Unblock( the_thread ); } } else if ( the_thread->current_state == STATES_READY ) { if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _ISR_Signals_to_thread_executing = true; 4ec96: 7001 moveq #1,%d0 } } return false; } 4ec98: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 4ec9e: 4e5e unlk %fp (void) _Watchdog_Remove( &the_thread->Timer ); _Thread_Unblock( the_thread ); } } else if ( the_thread->current_state == STATES_READY ) { if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _ISR_Signals_to_thread_executing = true; 4eca0: 13c0 0005 f29c moveb %d0,5f29c <_ISR_Signals_to_thread_executing> 4eca6: 4200 clrb %d0 } } return false; } 4eca8: 4e75 rts ... 0004b994 <_RTEMS_Tasks_Invoke_task_variable_dtor>: void _RTEMS_Tasks_Invoke_task_variable_dtor( Thread_Control *the_thread, rtems_task_variable_t *tvp ) { 4b994: 4e56 0000 linkw %fp,#0 void (*dtor)(void *); void *value; dtor = tvp->dtor; if (_Thread_Is_executing(the_thread)) { 4b998: 2039 0005 f20e movel 5f20e <_Thread_Executing>,%d0 void _RTEMS_Tasks_Invoke_task_variable_dtor( Thread_Control *the_thread, rtems_task_variable_t *tvp ) { 4b99e: 2f0a movel %a2,%sp@- 4b9a0: 246e 000c moveal %fp@(12),%a2 void (*dtor)(void *); void *value; dtor = tvp->dtor; 4b9a4: 206a 0010 moveal %a2@(16),%a0 if (_Thread_Is_executing(the_thread)) { 4b9a8: b0ae 0008 cmpl %fp@(8),%d0 4b9ac: 671e beqs 4b9cc <_RTEMS_Tasks_Invoke_task_variable_dtor+0x38> value = *tvp->ptr; *tvp->ptr = tvp->gval; } else { value = tvp->tval; 4b9ae: 202a 000c movel %a2@(12),%d0 } if ( dtor ) 4b9b2: 4a88 tstl %a0 4b9b4: 6706 beqs 4b9bc <_RTEMS_Tasks_Invoke_task_variable_dtor+0x28> (*dtor)(value); 4b9b6: 2f00 movel %d0,%sp@- 4b9b8: 4e90 jsr %a0@ 4b9ba: 588f addql #4,%sp _Workspace_Free(tvp); 4b9bc: 2d4a 0008 movel %a2,%fp@(8) } 4b9c0: 246e fffc moveal %fp@(-4),%a2 4b9c4: 4e5e unlk %fp } if ( dtor ) (*dtor)(value); _Workspace_Free(tvp); 4b9c6: 4ef9 0004 920c jmp 4920c <_Workspace_Free> void (*dtor)(void *); void *value; dtor = tvp->dtor; if (_Thread_Is_executing(the_thread)) { value = *tvp->ptr; 4b9cc: 226a 0004 moveal %a2@(4),%a1 4b9d0: 2011 movel %a1@,%d0 *tvp->ptr = tvp->gval; 4b9d2: 22aa 0008 movel %a2@(8),%a1@ 4b9d6: 60da bras 4b9b2 <_RTEMS_Tasks_Invoke_task_variable_dtor+0x1e> <== ALWAYS TAKEN 0004b90a <_RTEMS_tasks_Create_extension>: bool _RTEMS_tasks_Create_extension( Thread_Control *executing, Thread_Control *created ) { 4b90a: 4e56 0000 linkw %fp,#0 4b90e: 2f0a movel %a2,%sp@- 4b910: 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() ) 4b914: 4a39 0005 d974 tstb 5d974 4b91a: 665c bnes 4b978 <_RTEMS_tasks_Create_extension+0x6e> 4b91c: 701e moveq #30,%d0 to_allocate -= (RTEMS_NUMBER_NOTEPADS * sizeof(uint32_t)); api = _Workspace_Allocate( to_allocate ); 4b91e: 2f00 movel %d0,%sp@- 4b920: 4eb9 0004 91f0 jsr 491f0 <_Workspace_Allocate> if ( !api ) 4b926: 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 ); 4b928: 2040 moveal %d0,%a0 if ( !api ) 4b92a: 4a80 tstl %d0 4b92c: 675c beqs 4b98a <_RTEMS_tasks_Create_extension+0x80> <== ALWAYS TAKEN created->API_Extensions[ THREAD_API_RTEMS ] = api; api->pending_events = EVENT_SETS_NONE_PENDING; api->event_condition = 0; _ASR_Initialize( &api->Signal ); created->task_variables = NULL; 4b92e: 42aa 011a clrl %a2@(282) */ RTEMS_INLINE_ROUTINE void _ASR_Initialize ( ASR_Information *information ) { information->is_enabled = false; 4b932: 4200 clrb %d0 api = _Workspace_Allocate( to_allocate ); if ( !api ) return false; created->API_Extensions[ THREAD_API_RTEMS ] = api; 4b934: 2548 010a movel %a0,%a2@(266) 4b938: 1140 0008 moveb %d0,%a0@(8) api->pending_events = EVENT_SETS_NONE_PENDING; 4b93c: 4290 clrl %a0@ api->event_condition = 0; 4b93e: 42a8 0004 clrl %a0@(4) information->handler = NULL; 4b942: 42a8 000a clrl %a0@(10) information->mode_set = RTEMS_DEFAULT_MODES; 4b946: 42a8 000e clrl %a0@(14) information->signals_posted = 0; 4b94a: 42a8 0012 clrl %a0@(18) information->signals_pending = 0; 4b94e: 42a8 0016 clrl %a0@(22) information->nest_level = 0; 4b952: 42a8 001a clrl %a0@(26) _ASR_Initialize( &api->Signal ); created->task_variables = NULL; if ( rtems_configuration_get_notepads_enabled() ) { 4b956: 4a39 0005 d974 tstb 5d974 4b95c: 6710 beqs 4b96e <_RTEMS_tasks_Create_extension+0x64> 4b95e: 41e8 001e lea %a0@(30),%a0 4b962: 4280 clrl %d0 for (i=0; i < RTEMS_NUMBER_NOTEPADS; i++) api->Notepads[i] = 0; 4b964: 4298 clrl %a0@+ 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++) 4b966: 5280 addql #1,%d0 4b968: 7210 moveq #16,%d1 4b96a: b280 cmpl %d0,%d1 4b96c: 66f6 bnes 4b964 <_RTEMS_tasks_Create_extension+0x5a> api->Notepads[i] = 0; } return true; } 4b96e: 246e fffc moveal %fp@(-4),%a2 4b972: 4e5e unlk %fp 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++) 4b974: 7001 moveq #1,%d0 api->Notepads[i] = 0; } return true; } 4b976: 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() ) 4b978: 705e moveq #94,%d0 to_allocate -= (RTEMS_NUMBER_NOTEPADS * sizeof(uint32_t)); api = _Workspace_Allocate( to_allocate ); 4b97a: 2f00 movel %d0,%sp@- 4b97c: 4eb9 0004 91f0 jsr 491f0 <_Workspace_Allocate> if ( !api ) 4b982: 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 ); 4b984: 2040 moveal %d0,%a0 if ( !api ) 4b986: 4a80 tstl %d0 4b988: 66a4 bnes 4b92e <_RTEMS_tasks_Create_extension+0x24> for (i=0; i < RTEMS_NUMBER_NOTEPADS; i++) api->Notepads[i] = 0; } return true; } 4b98a: 246e fffc moveal %fp@(-4),%a2 4b98e: 4e5e unlk %fp if ( !rtems_configuration_get_notepads_enabled() ) to_allocate -= (RTEMS_NUMBER_NOTEPADS * sizeof(uint32_t)); api = _Workspace_Allocate( to_allocate ); if ( !api ) 4b990: 4200 clrb %d0 for (i=0; i < RTEMS_NUMBER_NOTEPADS; i++) api->Notepads[i] = 0; } return true; } 4b992: 4e75 rts 00046150 <_RTEMS_tasks_Initialize_user_tasks_body>: * * Output parameters: NONE */ void _RTEMS_tasks_Initialize_user_tasks_body( void ) { 46150: 4e56 ffe4 linkw %fp,#-28 46154: 48d7 1c1c moveml %d2-%d4/%a2-%a4,%sp@ rtems_initialization_tasks_table *user_tasks; /* * Move information into local variables */ user_tasks = Configuration_RTEMS_API.User_initialization_tasks_table; 46158: 2479 0005 d99a moveal 5d99a ,%a2 maximum = Configuration_RTEMS_API.number_of_initialization_tasks; 4615e: 2639 0005 d996 movel 5d996 ,%d3 /* * Verify that we have a set of user tasks to iterate */ if ( !user_tasks ) 46164: 4a8a tstl %a2 46166: 6754 beqs 461bc <_RTEMS_tasks_Initialize_user_tasks_body+0x6c> return; /* * Now iterate over the initialization tasks and create/start them. */ for ( index=0 ; index < maximum ; index++ ) { 46168: 4a83 tstl %d3 4616a: 6750 beqs 461bc <_RTEMS_tasks_Initialize_user_tasks_body+0x6c> <== ALWAYS TAKEN 4616c: 280e movel %fp,%d4 4616e: 4282 clrl %d2 46170: 5984 subql #4,%d4 46172: 47f9 0004 5f24 lea 45f24 ,%a3 &id ); if ( !rtems_is_status_successful( return_value ) ) _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); return_value = rtems_task_start( 46178: 49f9 0004 61d8 lea 461d8 ,%a4 /* * Now iterate over the initialization tasks and create/start them. */ for ( index=0 ; index < maximum ; index++ ) { return_value = rtems_task_create( 4617e: 2f04 movel %d4,%sp@- 46180: 2f2a 000c movel %a2@(12),%sp@- 46184: 2f2a 0014 movel %a2@(20),%sp@- 46188: 2f2a 0004 movel %a2@(4),%sp@- 4618c: 2f2a 0008 movel %a2@(8),%sp@- 46190: 2f12 movel %a2@,%sp@- 46192: 4e93 jsr %a3@ user_tasks[ index ].stack_size, user_tasks[ index ].mode_set, user_tasks[ index ].attribute_set, &id ); if ( !rtems_is_status_successful( return_value ) ) 46194: 4fef 0018 lea %sp@(24),%sp 46198: 4a80 tstl %d0 4619a: 662a bnes 461c6 <_RTEMS_tasks_Initialize_user_tasks_body+0x76> _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); return_value = rtems_task_start( 4619c: 2f2a 0018 movel %a2@(24),%sp@- 461a0: 2f2a 0010 movel %a2@(16),%sp@- 461a4: 2f2e fffc movel %fp@(-4),%sp@- 461a8: 4e94 jsr %a4@ id, user_tasks[ index ].entry_point, user_tasks[ index ].argument ); if ( !rtems_is_status_successful( return_value ) ) 461aa: 4fef 000c lea %sp@(12),%sp 461ae: 4a80 tstl %d0 461b0: 6614 bnes 461c6 <_RTEMS_tasks_Initialize_user_tasks_body+0x76> return; /* * Now iterate over the initialization tasks and create/start them. */ for ( index=0 ; index < maximum ; index++ ) { 461b2: 5282 addql #1,%d2 461b4: 45ea 001c lea %a2@(28),%a2 461b8: b483 cmpl %d3,%d2 461ba: 65c2 bcss 4617e <_RTEMS_tasks_Initialize_user_tasks_body+0x2e> <== ALWAYS TAKEN user_tasks[ index ].argument ); if ( !rtems_is_status_successful( return_value ) ) _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); } } 461bc: 4cee 1c1c ffe4 moveml %fp@(-28),%d2-%d4/%a2-%a4 461c2: 4e5e unlk %fp 461c4: 4e75 rts id, user_tasks[ index ].entry_point, user_tasks[ index ].argument ); if ( !rtems_is_status_successful( return_value ) ) _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); 461c6: 2f00 movel %d0,%sp@- 461c8: 4878 0001 pea 1 461cc: 4878 0001 pea 1 461d0: 4eb9 0004 6fd8 jsr 46fd8 <_Internal_error_Occurred> ... 0004b846 <_RTEMS_tasks_Post_switch_extension>: */ void _RTEMS_tasks_Post_switch_extension( Thread_Control *executing ) { 4b846: 4e56 ffec linkw %fp,#-20 4b84a: 206e 0008 moveal %fp@(8),%a0 4b84e: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ RTEMS_API_Control *api; ASR_Information *asr; rtems_signal_set signal_set; Modes_Control prev_mode; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 4b852: 2468 010a moveal %a0@(266),%a2 if ( !api ) 4b856: 4a8a tstl %a2 4b858: 671a beqs 4b874 <_RTEMS_tasks_Post_switch_extension+0x2e> <== ALWAYS TAKEN * Signal Processing */ asr = &api->Signal; _ISR_Disable( level ); 4b85a: 203c 0000 0700 movel #1792,%d0 4b860: 40c1 movew %sr,%d1 4b862: 8081 orl %d1,%d0 4b864: 46c0 movew %d0,%sr signal_set = asr->signals_posted; 4b866: 242a 0012 movel %a2@(18),%d2 asr->signals_posted = 0; 4b86a: 42aa 0012 clrl %a2@(18) _ISR_Enable( level ); 4b86e: 46c1 movew %d1,%sr if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ 4b870: 4a82 tstl %d2 4b872: 660a bnes 4b87e <_RTEMS_tasks_Post_switch_extension+0x38> (*asr->handler)( signal_set ); asr->nest_level -= 1; rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); } 4b874: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3 4b87a: 4e5e unlk %fp 4b87c: 4e75 rts if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ return; asr->nest_level += 1; 4b87e: 52aa 001a addql #1,%a2@(26) rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 4b882: 260e movel %fp,%d3 4b884: 5983 subql #4,%d3 4b886: 47f9 0004 dd58 lea 4dd58 ,%a3 4b88c: 2f03 movel %d3,%sp@- 4b88e: 2f3c 0000 ffff movel #65535,%sp@- 4b894: 2f2a 000e movel %a2@(14),%sp@- 4b898: 4e93 jsr %a3@ (*asr->handler)( signal_set ); 4b89a: 2f02 movel %d2,%sp@- 4b89c: 206a 000a moveal %a2@(10),%a0 4b8a0: 4e90 jsr %a0@ asr->nest_level -= 1; 4b8a2: 53aa 001a subql #1,%a2@(26) rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 4b8a6: 2f03 movel %d3,%sp@- 4b8a8: 2f3c 0000 ffff movel #65535,%sp@- 4b8ae: 2f2e fffc movel %fp@(-4),%sp@- 4b8b2: 4e93 jsr %a3@ 4b8b4: 4fef 001c lea %sp@(28),%sp } 4b8b8: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3 4b8be: 4e5e unlk %fp 4b8c0: 4e75 rts 0004b7a2 <_RTEMS_tasks_Switch_extension>: void _RTEMS_tasks_Switch_extension( Thread_Control *executing, Thread_Control *heir ) { 4b7a2: 4e56 0000 linkw %fp,#0 4b7a6: 206e 0008 moveal %fp@(8),%a0 /* * Per Task Variables */ tvp = executing->task_variables; 4b7aa: 2068 011a moveal %a0@(282),%a0 while (tvp) { 4b7ae: 4a88 tstl %a0 4b7b0: 6712 beqs 4b7c4 <_RTEMS_tasks_Switch_extension+0x22> tvp->tval = *tvp->ptr; 4b7b2: 2268 0004 moveal %a0@(4),%a1 4b7b6: 2151 000c movel %a1@,%a0@(12) *tvp->ptr = tvp->gval; 4b7ba: 22a8 0008 movel %a0@(8),%a1@ tvp = (rtems_task_variable_t *)tvp->next; 4b7be: 2050 moveal %a0@,%a0 /* * Per Task Variables */ tvp = executing->task_variables; while (tvp) { 4b7c0: 4a88 tstl %a0 4b7c2: 66ee bnes 4b7b2 <_RTEMS_tasks_Switch_extension+0x10> <== ALWAYS TAKEN tvp->tval = *tvp->ptr; *tvp->ptr = tvp->gval; tvp = (rtems_task_variable_t *)tvp->next; } tvp = heir->task_variables; 4b7c4: 206e 000c moveal %fp@(12),%a0 4b7c8: 2068 011a moveal %a0@(282),%a0 while (tvp) { 4b7cc: 4a88 tstl %a0 4b7ce: 6712 beqs 4b7e2 <_RTEMS_tasks_Switch_extension+0x40> tvp->gval = *tvp->ptr; 4b7d0: 2268 0004 moveal %a0@(4),%a1 4b7d4: 2151 0008 movel %a1@,%a0@(8) *tvp->ptr = tvp->tval; 4b7d8: 22a8 000c movel %a0@(12),%a1@ tvp = (rtems_task_variable_t *)tvp->next; 4b7dc: 2050 moveal %a0@,%a0 *tvp->ptr = tvp->gval; tvp = (rtems_task_variable_t *)tvp->next; } tvp = heir->task_variables; while (tvp) { 4b7de: 4a88 tstl %a0 4b7e0: 66ee bnes 4b7d0 <_RTEMS_tasks_Switch_extension+0x2e> <== ALWAYS TAKEN tvp->gval = *tvp->ptr; *tvp->ptr = tvp->tval; tvp = (rtems_task_variable_t *)tvp->next; } } 4b7e2: 4e5e unlk %fp 4b7e4: 4e75 rts 0007b812 <_Rate_monotonic_Get_status>: bool _Rate_monotonic_Get_status( Rate_monotonic_Control *the_period, Rate_monotonic_Period_time_t *wall_since_last_period, Thread_CPU_usage_t *cpu_since_last_period ) { 7b812: 4e56 ffd0 linkw %fp,#-48 7b816: 48d7 1c1c moveml %d2-%d4/%a2-%a4,%sp@ 7b81a: 266e 0008 moveal %fp@(8),%a3 /* * Determine elapsed wall time since period initiated. */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _TOD_Get_uptime( &uptime ); 7b81e: 280e movel %fp,%d4 7b820: 5184 subql #8,%d4 _Timestamp_Subtract( 7b822: 45f9 0004 f2e0 lea 4f2e0 <_Timespec_Subtract>,%a2 /* * Determine elapsed wall time since period initiated. */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _TOD_Get_uptime( &uptime ); 7b828: 2f04 movel %d4,%sp@- ) { #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ Timestamp_Control uptime; #endif Thread_Control *owning_thread = the_period->owner; 7b82a: 286b 0040 moveal %a3@(64),%a4 /* * Determine elapsed wall time since period initiated. */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _TOD_Get_uptime( &uptime ); 7b82e: 4eb9 0006 ad78 jsr 6ad78 <_TOD_Get_uptime> _Timestamp_Subtract( 7b834: 2f2e 000c movel %fp@(12),%sp@- 7b838: 2f04 movel %d4,%sp@- 7b83a: 486b 004c pea %a3@(76) 7b83e: 4e92 jsr %a2@ * Determine cpu usage since period initiated. */ used = owning_thread->cpu_time_used; #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ if (owning_thread == _Thread_Executing) { 7b840: 4fef 0010 lea %sp@(16),%sp #endif /* * Determine cpu usage since period initiated. */ used = owning_thread->cpu_time_used; 7b844: 202c 0082 movel %a4@(130),%d0 7b848: 222c 0086 movel %a4@(134),%d1 7b84c: 2d40 fff0 movel %d0,%fp@(-16) 7b850: 2d41 fff4 movel %d1,%fp@(-12) #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ if (owning_thread == _Thread_Executing) { 7b854: b9f9 000a 6ce2 cmpal a6ce2 <_Thread_Executing>,%a4 7b85a: 670c beqs 7b868 <_Rate_monotonic_Get_status+0x56> */ if (_Timestamp_Less_than(&used, &the_period->cpu_usage_period_initiated)) return false; /* used = current cpu usage - cpu usage at start of period */ _Timestamp_Subtract( 7b85c: 7001 moveq #1,%d0 return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; } 7b85e: 4cee 1c1c ffd0 moveml %fp@(-48),%d2-%d4/%a2-%a4 7b864: 4e5e unlk %fp 7b866: 4e75 rts if (owning_thread == _Thread_Executing) { Thread_CPU_usage_t ran; /* How much time time since last context switch */ _Timestamp_Subtract( 7b868: 49ee ffe8 lea %fp@(-24),%a4 &_Thread_Time_of_last_context_switch, &uptime, &ran ); /* cpu usage += ran */ _Timestamp_Add_to( &used, &ran ); 7b86c: 240e movel %fp,%d2 7b86e: 0682 ffff fff0 addil #-16,%d2 /* * The cpu usage info was reset while executing. Can't * determine a status. */ if (_Timestamp_Less_than(&used, &the_period->cpu_usage_period_initiated)) 7b874: 260b movel %a3,%d3 7b876: 0683 0000 0044 addil #68,%d3 if (owning_thread == _Thread_Executing) { Thread_CPU_usage_t ran; /* How much time time since last context switch */ _Timestamp_Subtract( 7b87c: 2f0c movel %a4,%sp@- 7b87e: 2f04 movel %d4,%sp@- 7b880: 4879 000a 6cea pea a6cea <_Thread_Time_of_last_context_switch> 7b886: 4e92 jsr %a2@ &_Thread_Time_of_last_context_switch, &uptime, &ran ); /* cpu usage += ran */ _Timestamp_Add_to( &used, &ran ); 7b888: 2f0c movel %a4,%sp@- 7b88a: 2f02 movel %d2,%sp@- 7b88c: 4eb9 0004 f298 jsr 4f298 <_Timespec_Add_to> /* * The cpu usage info was reset while executing. Can't * determine a status. */ if (_Timestamp_Less_than(&used, &the_period->cpu_usage_period_initiated)) 7b892: 2f03 movel %d3,%sp@- 7b894: 2f02 movel %d2,%sp@- 7b896: 4eb9 0007 c3e8 jsr 7c3e8 <_Timespec_Less_than> 7b89c: 4fef 001c lea %sp@(28),%sp 7b8a0: 4a00 tstb %d0 7b8a2: 670c beqs 7b8b0 <_Rate_monotonic_Get_status+0x9e> return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; } 7b8a4: 4cee 1c1c ffd0 moveml %fp@(-48),%d2-%d4/%a2-%a4 /* * The cpu usage info was reset while executing. Can't * determine a status. */ if (_Timestamp_Less_than(&used, &the_period->cpu_usage_period_initiated)) 7b8aa: 4200 clrb %d0 return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; } 7b8ac: 4e5e unlk %fp 7b8ae: 4e75 rts */ if (_Timestamp_Less_than(&used, &the_period->cpu_usage_period_initiated)) return false; /* used = current cpu usage - cpu usage at start of period */ _Timestamp_Subtract( 7b8b0: 2f2e 0010 movel %fp@(16),%sp@- 7b8b4: 2f02 movel %d2,%sp@- 7b8b6: 2f03 movel %d3,%sp@- 7b8b8: 4e92 jsr %a2@ 7b8ba: 4fef 000c lea %sp@(12),%sp 7b8be: 7001 moveq #1,%d0 7b8c0: 609c bras 7b85e <_Rate_monotonic_Get_status+0x4c> <== ALWAYS TAKEN 0007bbc8 <_Rate_monotonic_Timeout>: void _Rate_monotonic_Timeout( Objects_Id id, void *ignored ) { 7bbc8: 4e56 fffc linkw %fp,#-4 7bbcc: 2f0a movel %a2,%sp@- 7bbce: 486e fffc pea %fp@(-4) 7bbd2: 2f2e 0008 movel %fp@(8),%sp@- 7bbd6: 4879 000a 76cc pea a76cc <_Rate_monotonic_Information> 7bbdc: 4eb9 0004 db10 jsr 4db10 <_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 ) { 7bbe2: 4fef 000c lea %sp@(12),%sp 7bbe6: 2440 moveal %d0,%a2 7bbe8: 4aae fffc tstl %fp@(-4) 7bbec: 6636 bnes 7bc24 <_Rate_monotonic_Timeout+0x5c> <== ALWAYS TAKEN case OBJECTS_LOCAL: the_thread = the_period->owner; 7bbee: 206a 0040 moveal %a2@(64),%a0 if ( _States_Is_waiting_for_period( the_thread->current_state ) && 7bbf2: 2028 0010 movel %a0@(16),%d0 7bbf6: 0280 0000 4000 andil #16384,%d0 7bbfc: 670a beqs 7bc08 <_Rate_monotonic_Timeout+0x40> the_thread->Wait.id == the_period->Object.id ) { 7bbfe: 202a 0008 movel %a2@(8),%d0 7bc02: b0a8 0020 cmpl %a0@(32),%d0 7bc06: 675e beqs 7bc66 <_Rate_monotonic_Timeout+0x9e> _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 ) { 7bc08: 7001 moveq #1,%d0 7bc0a: b0aa 0038 cmpl %a2@(56),%d0 7bc0e: 671c beqs 7bc2c <_Rate_monotonic_Timeout+0x64> _Rate_monotonic_Initiate_statistics( the_period ); _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else the_period->state = RATE_MONOTONIC_EXPIRED; 7bc10: 7004 moveq #4,%d0 7bc12: 2540 0038 movel %d0,%a2@(56) */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 7bc16: 2039 000a 6c28 movel a6c28 <_Thread_Dispatch_disable_level>,%d0 7bc1c: 5380 subql #1,%d0 7bc1e: 23c0 000a 6c28 movel %d0,a6c28 <_Thread_Dispatch_disable_level> case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 7bc24: 246e fff8 moveal %fp@(-8),%a2 7bc28: 4e5e unlk %fp 7bc2a: 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; 7bc2c: 103c 0003 moveb #3,%d0 7bc30: 2540 0038 movel %d0,%a2@(56) _Rate_monotonic_Initiate_statistics( the_period ); 7bc34: 2f0a movel %a2,%sp@- 7bc36: 4eb9 0007 b794 jsr 7b794 <_Rate_monotonic_Initiate_statistics> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 7bc3c: 256a 003c 001c movel %a2@(60),%a2@(28) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 7bc42: 486a 0010 pea %a2@(16) 7bc46: 4879 000a 6d00 pea a6d00 <_Watchdog_Ticks_chain> 7bc4c: 4eb9 0004 f5e0 jsr 4f5e0 <_Watchdog_Insert> 7bc52: 4fef 000c lea %sp@(12),%sp 7bc56: 2039 000a 6c28 movel a6c28 <_Thread_Dispatch_disable_level>,%d0 7bc5c: 5380 subql #1,%d0 7bc5e: 23c0 000a 6c28 movel %d0,a6c28 <_Thread_Dispatch_disable_level> 7bc64: 60be bras 7bc24 <_Rate_monotonic_Timeout+0x5c> <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 7bc66: 2f3c 1003 fff8 movel #268697592,%sp@- 7bc6c: 2f08 movel %a0,%sp@- 7bc6e: 4eb9 0004 e07c jsr 4e07c <_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 ); 7bc74: 2f0a movel %a2,%sp@- 7bc76: 4eb9 0007 b794 jsr 7b794 <_Rate_monotonic_Initiate_statistics> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 7bc7c: 256a 003c 001c movel %a2@(60),%a2@(28) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 7bc82: 486a 0010 pea %a2@(16) 7bc86: 4879 000a 6d00 pea a6d00 <_Watchdog_Ticks_chain> 7bc8c: 4eb9 0004 f5e0 jsr 4f5e0 <_Watchdog_Insert> the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: the_thread = the_period->owner; if ( _States_Is_waiting_for_period( the_thread->current_state ) && 7bc92: 4fef 0014 lea %sp@(20),%sp */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 7bc96: 2039 000a 6c28 movel a6c28 <_Thread_Dispatch_disable_level>,%d0 7bc9c: 5380 subql #1,%d0 7bc9e: 23c0 000a 6c28 movel %d0,a6c28 <_Thread_Dispatch_disable_level> 7bca4: 6000 ff7e braw 7bc24 <_Rate_monotonic_Timeout+0x5c> <== ALWAYS TAKEN 0007b8c2 <_Rate_monotonic_Update_statistics>: * Update the counts. */ stats = &the_period->Statistics; stats->count++; if ( the_period->state == RATE_MONOTONIC_EXPIRED ) 7b8c2: 7004 moveq #4,%d0 } void _Rate_monotonic_Update_statistics( Rate_monotonic_Control *the_period ) { 7b8c4: 4e56 ffd8 linkw %fp,#-40 7b8c8: 48d7 3c0c moveml %d2-%d3/%a2-%a5,%sp@ 7b8cc: 246e 0008 moveal %fp@(8),%a2 /* * Update the counts. */ stats = &the_period->Statistics; stats->count++; 7b8d0: 52aa 0054 addql #1,%a2@(84) if ( the_period->state == RATE_MONOTONIC_EXPIRED ) 7b8d4: b0aa 0038 cmpl %a2@(56),%d0 7b8d8: 6700 00c6 beqw 7b9a0 <_Rate_monotonic_Update_statistics+0xde> /* * Grab status for time statistics. */ valid_status = _Rate_monotonic_Get_status( the_period, &since_last_period, &executed ); 7b8dc: 260e movel %fp,%d3 7b8de: 5183 subql #8,%d3 7b8e0: 240e movel %fp,%d2 7b8e2: 0682 ffff fff0 addil #-16,%d2 7b8e8: 2f03 movel %d3,%sp@- 7b8ea: 2f02 movel %d2,%sp@- 7b8ec: 2f0a movel %a2,%sp@- 7b8ee: 4eb9 0007 b812 jsr 7b812 <_Rate_monotonic_Get_status> if (!valid_status) 7b8f4: 4fef 000c lea %sp@(12),%sp 7b8f8: 4a00 tstb %d0 7b8fa: 660a bnes 7b906 <_Rate_monotonic_Update_statistics+0x44> stats->min_wall_time = since_last_period; if ( since_last_period > stats->max_wall_time ) stats->max_wall_time = since_last_period; #endif } 7b8fc: 4cee 3c0c ffd8 moveml %fp@(-40),%d2-%d3/%a2-%a5 7b902: 4e5e unlk %fp 7b904: 4e75 rts /* * Update CPU time */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_cpu_time, &executed ); 7b906: 2f03 movel %d3,%sp@- 7b908: 486a 006c pea %a2@(108) 7b90c: 4bf9 0004 f298 lea 4f298 <_Timespec_Add_to>,%a5 if ( _Timestamp_Less_than( &executed, &stats->min_cpu_time ) ) 7b912: 49f9 0007 c3e8 lea 7c3e8 <_Timespec_Less_than>,%a4 /* * Update CPU time */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_cpu_time, &executed ); 7b918: 4e95 jsr %a5@ if ( _Timestamp_Less_than( &executed, &stats->min_cpu_time ) ) 7b91a: 486a 005c pea %a2@(92) 7b91e: 2f03 movel %d3,%sp@- 7b920: 4e94 jsr %a4@ 7b922: 4fef 0010 lea %sp@(16),%sp 7b926: 4a00 tstb %d0 7b928: 6710 beqs 7b93a <_Rate_monotonic_Update_statistics+0x78> stats->min_cpu_time = executed; 7b92a: 202e fff8 movel %fp@(-8),%d0 7b92e: 222e fffc movel %fp@(-4),%d1 7b932: 2540 005c movel %d0,%a2@(92) 7b936: 2541 0060 movel %d1,%a2@(96) if ( _Timestamp_Greater_than( &executed, &stats->max_cpu_time ) ) 7b93a: 486a 0064 pea %a2@(100) 7b93e: 47f9 0007 c3b4 lea 7c3b4 <_Timespec_Greater_than>,%a3 7b944: 2f03 movel %d3,%sp@- 7b946: 4e93 jsr %a3@ 7b948: 508f addql #8,%sp 7b94a: 4a00 tstb %d0 7b94c: 6710 beqs 7b95e <_Rate_monotonic_Update_statistics+0x9c> stats->max_cpu_time = executed; 7b94e: 202e fff8 movel %fp@(-8),%d0 7b952: 222e fffc movel %fp@(-4),%d1 7b956: 2540 0064 movel %d0,%a2@(100) 7b95a: 2541 0068 movel %d1,%a2@(104) /* * Update Wall time */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_wall_time, &since_last_period ); 7b95e: 2f02 movel %d2,%sp@- 7b960: 486a 0084 pea %a2@(132) 7b964: 4e95 jsr %a5@ if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) ) 7b966: 486a 0074 pea %a2@(116) 7b96a: 2f02 movel %d2,%sp@- 7b96c: 4e94 jsr %a4@ 7b96e: 4fef 0010 lea %sp@(16),%sp 7b972: 4a00 tstb %d0 7b974: 6654 bnes 7b9ca <_Rate_monotonic_Update_statistics+0x108> stats->min_wall_time = since_last_period; if ( _Timestamp_Greater_than( &since_last_period, &stats->max_wall_time ) ) 7b976: 486a 007c pea %a2@(124) 7b97a: 2f02 movel %d2,%sp@- 7b97c: 4e93 jsr %a3@ 7b97e: 508f addql #8,%sp 7b980: 4a00 tstb %d0 7b982: 6700 ff78 beqw 7b8fc <_Rate_monotonic_Update_statistics+0x3a> stats->max_wall_time = since_last_period; 7b986: 202e fff0 movel %fp@(-16),%d0 7b98a: 222e fff4 movel %fp@(-12),%d1 7b98e: 2540 007c movel %d0,%a2@(124) 7b992: 2541 0080 movel %d1,%a2@(128) stats->min_wall_time = since_last_period; if ( since_last_period > stats->max_wall_time ) stats->max_wall_time = since_last_period; #endif } 7b996: 4cee 3c0c ffd8 moveml %fp@(-40),%d2-%d3/%a2-%a5 7b99c: 4e5e unlk %fp 7b99e: 4e75 rts */ stats = &the_period->Statistics; stats->count++; if ( the_period->state == RATE_MONOTONIC_EXPIRED ) stats->missed_count++; 7b9a0: 52aa 0058 addql #1,%a2@(88) /* * Grab status for time statistics. */ valid_status = _Rate_monotonic_Get_status( the_period, &since_last_period, &executed ); 7b9a4: 260e movel %fp,%d3 7b9a6: 5183 subql #8,%d3 7b9a8: 240e movel %fp,%d2 7b9aa: 0682 ffff fff0 addil #-16,%d2 7b9b0: 2f03 movel %d3,%sp@- 7b9b2: 2f02 movel %d2,%sp@- 7b9b4: 2f0a movel %a2,%sp@- 7b9b6: 4eb9 0007 b812 jsr 7b812 <_Rate_monotonic_Get_status> if (!valid_status) 7b9bc: 4fef 000c lea %sp@(12),%sp 7b9c0: 4a00 tstb %d0 7b9c2: 6700 ff38 beqw 7b8fc <_Rate_monotonic_Update_statistics+0x3a> <== ALWAYS TAKEN 7b9c6: 6000 ff3e braw 7b906 <_Rate_monotonic_Update_statistics+0x44> <== ALWAYS TAKEN */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_wall_time, &since_last_period ); if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) ) stats->min_wall_time = since_last_period; 7b9ca: 202e fff0 movel %fp@(-16),%d0 7b9ce: 222e fff4 movel %fp@(-12),%d1 7b9d2: 2540 0074 movel %d0,%a2@(116) 7b9d6: 2541 0078 movel %d1,%a2@(120) 7b9da: 609a bras 7b976 <_Rate_monotonic_Update_statistics+0xb4> <== ALWAYS TAKEN 00046bc8 <_TOD_Validate>: */ bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 46bc8: 4e56 0000 linkw %fp,#0 46bcc: 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(); 46bd0: 2039 0006 0190 movel 60190 ,%d0 */ bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 46bd6: 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) || 46bd8: 4a88 tstl %a0 46bda: 6762 beqs 46c3e <_TOD_Validate+0x76> <== ALWAYS TAKEN 46bdc: 243c 000f 4240 movel #1000000,%d2 46be2: 4c40 2002 remul %d0,%d2,%d2 (the_tod->ticks >= ticks_per_second) || 46be6: b4a8 0018 cmpl %a0@(24),%d2 46bea: 6352 blss 46c3e <_TOD_Validate+0x76> (the_tod->second >= TOD_SECONDS_PER_MINUTE) || 46bec: 703b moveq #59,%d0 46bee: b0a8 0014 cmpl %a0@(20),%d0 46bf2: 654a bcss 46c3e <_TOD_Validate+0x76> (the_tod->minute >= TOD_MINUTES_PER_HOUR) || 46bf4: b0a8 0010 cmpl %a0@(16),%d0 46bf8: 6544 bcss 46c3e <_TOD_Validate+0x76> (the_tod->hour >= TOD_HOURS_PER_DAY) || 46bfa: 7217 moveq #23,%d1 46bfc: b2a8 000c cmpl %a0@(12),%d1 46c00: 653c bcss 46c3e <_TOD_Validate+0x76> (the_tod->month == 0) || 46c02: 2028 0004 movel %a0@(4),%d0 uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 46c06: 6736 beqs 46c3e <_TOD_Validate+0x76> <== ALWAYS TAKEN 46c08: 740c moveq #12,%d2 46c0a: b480 cmpl %d0,%d2 46c0c: 6530 bcss 46c3e <_TOD_Validate+0x76> (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) || 46c0e: 2210 movel %a0@,%d1 uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 46c10: 0c81 0000 07c3 cmpil #1987,%d1 46c16: 6326 blss 46c3e <_TOD_Validate+0x76> (the_tod->minute >= TOD_MINUTES_PER_HOUR) || (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) 46c18: 2068 0008 moveal %a0@(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(); if ((!the_tod) || 46c1c: 4a88 tstl %a0 46c1e: 671e beqs 46c3e <_TOD_Validate+0x76> <== ALWAYS TAKEN (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) return false; if ( (the_tod->year % 4) == 0 ) 46c20: 143c 0003 moveb #3,%d2 46c24: c282 andl %d2,%d1 46c26: 661e bnes 46c46 <_TOD_Validate+0x7e> days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; 46c28: 43f9 0005 ef7e lea 5ef7e <_TOD_Days_per_month>,%a1 46c2e: 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( 46c32: b1c0 cmpal %d0,%a0 46c34: 53c0 sls %d0 46c36: 4480 negl %d0 if ( the_tod->day > days_in_month ) return false; return true; } 46c38: 241f movel %sp@+,%d2 46c3a: 4e5e unlk %fp 46c3c: 4e75 rts 46c3e: 241f movel %sp@+,%d2 46c40: 4e5e unlk %fp * false - if the the_tod is invalid * * NOTE: This routine only works for leap-years through 2099. */ bool _TOD_Validate( 46c42: 4200 clrb %d0 if ( the_tod->day > days_in_month ) return false; return true; } 46c44: 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 ]; 46c46: 43f9 0005 ef7e lea 5ef7e <_TOD_Days_per_month>,%a1 46c4c: 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( 46c50: b1c0 cmpal %d0,%a0 46c52: 53c0 sls %d0 46c54: 4480 negl %d0 46c56: 60e0 bras 46c38 <_TOD_Validate+0x70> <== ALWAYS TAKEN 000478a8 <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 478a8: 4e56 fff0 linkw %fp,#-16 478ac: 48d7 041c moveml %d2-%d4/%a2,%sp@ 478b0: 246e 0008 moveal %fp@(8),%a2 /* * Set a transient state for the thread so it is pulled off the Ready chains. * This will prevent it from being scheduled no matter what happens in an * ISR. */ _Thread_Set_transient( the_thread ); 478b4: 2f0a movel %a2,%sp@- void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 478b6: 242e 000c movel %fp@(12),%d2 */ /* * Save original state */ original_state = the_thread->current_state; 478ba: 262a 0010 movel %a2@(16),%d3 void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 478be: 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 ); 478c2: 4eb9 0004 8830 jsr 48830 <_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 ) 478c8: 588f addql #4,%sp 478ca: b4aa 0014 cmpl %a2@(20),%d2 478ce: 670c beqs 478dc <_Thread_Change_priority+0x34> _Thread_Set_priority( the_thread, new_priority ); 478d0: 2f02 movel %d2,%sp@- 478d2: 2f0a movel %a2,%sp@- 478d4: 4eb9 0004 86ac jsr 486ac <_Thread_Set_priority> 478da: 508f addql #8,%sp _ISR_Disable( level ); 478dc: 203c 0000 0700 movel #1792,%d0 478e2: 40c1 movew %sr,%d1 478e4: 8081 orl %d1,%d0 478e6: 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; 478e8: 202a 0010 movel %a2@(16),%d0 if ( state != STATES_TRANSIENT ) { 478ec: 7404 moveq #4,%d2 478ee: b480 cmpl %d0,%d2 478f0: 6738 beqs 4792a <_Thread_Change_priority+0x82> /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) 478f2: 44c3 movew %d3,%ccr 478f4: 6708 beqs 478fe <_Thread_Change_priority+0x56> <== ALWAYS TAKEN the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); 478f6: 74fb moveq #-5,%d2 478f8: c480 andl %d0,%d2 478fa: 2542 0010 movel %d2,%a2@(16) _ISR_Enable( level ); 478fe: 46c1 movew %d1,%sr if ( _States_Is_waiting_on_thread_queue( state ) ) { 47900: 0280 0003 bee0 andil #245472,%d0 47906: 660a bnes 47912 <_Thread_Change_priority+0x6a> if ( !_Thread_Is_executing_also_the_heir() && _Thread_Executing->is_preemptible ) _Context_Switch_necessary = true; _ISR_Enable( level ); } 47908: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 4790e: 4e5e unlk %fp 47910: 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 ); 47912: 2d4a 000c movel %a2,%fp@(12) 47916: 2d6a 0044 0008 movel %a2@(68),%fp@(8) if ( !_Thread_Is_executing_also_the_heir() && _Thread_Executing->is_preemptible ) _Context_Switch_necessary = true; _ISR_Enable( level ); } 4791c: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 47922: 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 ); 47924: 4ef9 0004 8600 jmp 48600 <_Thread_queue_Requeue> } return; } /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) { 4792a: 44c3 movew %d3,%ccr 4792c: 673c beqs 4796a <_Thread_Change_priority+0xc2> <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 4792e: 206a 008e moveal %a2@(142),%a0 47932: 302a 0094 movew %a2@(148),%d0 47936: 3410 movew %a0@,%d2 * 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 ); 47938: 42aa 0010 clrl %a2@(16) 4793c: 8082 orl %d2,%d0 4793e: 3080 movew %d0,%a0@ _Priority_Major_bit_map |= the_priority_map->ready_major; 47940: 3439 0005 f204 movew 5f204 <_Priority_Major_bit_map>,%d2 47946: 302a 0092 movew %a2@(146),%d0 4794a: 8082 orl %d2,%d0 4794c: 33c0 0005 f204 movew %d0,5f204 <_Priority_Major_bit_map> _Priority_Add_to_bit_map( &the_thread->Priority_map ); if ( prepend_it ) 47952: 4a04 tstb %d4 47954: 6700 0082 beqw 479d8 <_Thread_Change_priority+0x130> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Head( Chain_Control *the_chain ) { return (Chain_Node *) the_chain; 47958: 206a 008a moveal %a2@(138),%a0 ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 4795c: 2250 moveal %a0@,%a1 Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 4795e: 2548 0004 movel %a0,%a2@(4) before_node = after_node->next; after_node->next = the_node; 47962: 208a movel %a2,%a0@ the_node->next = before_node; before_node->previous = the_node; 47964: 234a 0004 movel %a2,%a1@(4) Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; after_node->next = the_node; the_node->next = before_node; 47968: 2489 movel %a1,%a2@ _Chain_Prepend_unprotected( the_thread->ready, &the_thread->Object.Node ); else _Chain_Append_unprotected( the_thread->ready, &the_thread->Object.Node ); } _ISR_Flash( level ); 4796a: 203c 0000 0700 movel #1792,%d0 47970: 46c1 movew %d1,%sr 47972: 8081 orl %d1,%d0 47974: 46c0 movew %d0,%sr RTEMS_INLINE_ROUTINE Priority_Control _Priority_Get_highest( void ) { Priority_Bit_map_control minor; Priority_Bit_map_control major; _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); 47976: 3039 0005 f204 movew 5f204 <_Priority_Major_bit_map>,%d0 4797c: 4840 swap %d0 4797e: 04c0 ff1 %d0 _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 47980: 4282 clrl %d2 47982: 41f9 0005 f274 lea 5f274 <_Priority_Bit_map>,%a0 47988: 3400 movew %d0,%d2 4798a: 3030 2a00 movew %a0@(00000000,%d2:l:2),%d0 4798e: 4840 swap %d0 47990: 04c0 ff1 %d0 * ready thread. */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) 47992: 4283 clrl %d3 47994: e98a lsll #4,%d2 47996: 3600 movew %d0,%d3 47998: 2279 0005 f100 moveal 5f100 <_Thread_Ready_chain>,%a1 4799e: 2002 movel %d2,%d0 479a0: d083 addl %d3,%d0 479a2: 2400 movel %d0,%d2 479a4: e58a lsll #2,%d2 479a6: e988 lsll #4,%d0 * is also the heir thread, and false otherwise. */ RTEMS_INLINE_ROUTINE bool _Thread_Is_executing_also_the_heir( void ) { return ( _Thread_Executing == _Thread_Heir ); 479a8: 2079 0005 f20e moveal 5f20e <_Thread_Executing>,%a0 * ready thread. */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) 479ae: 93c2 subal %d2,%a1 479b0: 2031 0800 movel %a1@(00000000,%d0:l),%d0 479b4: 23c0 0005 f1e2 movel %d0,5f1e2 <_Thread_Heir> * We altered the set of thread priorities. So let's figure out * who is the heir and if we need to switch to them. */ _Thread_Calculate_heir(); if ( !_Thread_Is_executing_also_the_heir() && 479ba: b1c0 cmpal %d0,%a0 479bc: 670e beqs 479cc <_Thread_Change_priority+0x124> _Thread_Executing->is_preemptible ) 479be: 4a28 0075 tstb %a0@(117) 479c2: 6708 beqs 479cc <_Thread_Change_priority+0x124> _Context_Switch_necessary = true; 479c4: 7401 moveq #1,%d2 479c6: 13c2 0005 f21e moveb %d2,5f21e <_Context_Switch_necessary> _ISR_Enable( level ); 479cc: 46c1 movew %d1,%sr } 479ce: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 479d4: 4e5e unlk %fp 479d6: 4e75 rts _Priority_Add_to_bit_map( &the_thread->Priority_map ); if ( prepend_it ) _Chain_Prepend_unprotected( the_thread->ready, &the_thread->Object.Node ); else _Chain_Append_unprotected( the_thread->ready, &the_thread->Object.Node ); 479d8: 206a 008a moveal %a2@(138),%a0 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 479dc: 2008 movel %a0,%d0 479de: 5880 addql #4,%d0 479e0: 2480 movel %d0,%a2@ old_last_node = the_chain->last; 479e2: 2268 0008 moveal %a0@(8),%a1 the_chain->last = the_node; 479e6: 214a 0008 movel %a2,%a0@(8) old_last_node->next = the_node; the_node->previous = old_last_node; 479ea: 2549 0004 movel %a1,%a2@(4) Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; the_chain->last = the_node; old_last_node->next = the_node; 479ee: 228a movel %a2,%a1@ 479f0: 6000 ff78 braw 4796a <_Thread_Change_priority+0xc2> <== ALWAYS TAKEN 000479f4 <_Thread_Clear_state>: ) { ISR_Level level; States_Control current_state; _ISR_Disable( level ); 479f4: 327c 0700 moveaw #1792,%a1 479f8: 2009 movel %a1,%d0 void _Thread_Clear_state( Thread_Control *the_thread, States_Control state ) { 479fa: 4e56 ffec linkw %fp,#-20 479fe: 206e 0008 moveal %fp@(8),%a0 47a02: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@ 47a06: 242e 000c movel %fp@(12),%d2 ISR_Level level; States_Control current_state; _ISR_Disable( level ); 47a0a: 40c3 movew %sr,%d3 47a0c: 8083 orl %d3,%d0 47a0e: 46c0 movew %d0,%sr current_state = the_thread->current_state; 47a10: 2228 0010 movel %a0@(16),%d1 if ( current_state & state ) { 47a14: 2002 movel %d2,%d0 47a16: c081 andl %d1,%d0 47a18: 6776 beqs 47a90 <_Thread_Clear_state+0x9c> RTEMS_INLINE_ROUTINE States_Control _States_Clear ( States_Control states_to_clear, States_Control current_state ) { return (current_state & ~states_to_clear); 47a1a: 2002 movel %d2,%d0 47a1c: 4680 notl %d0 47a1e: c081 andl %d1,%d0 current_state = 47a20: 2140 0010 movel %d0,%a0@(16) the_thread->current_state = _States_Clear( state, current_state ); if ( _States_Is_ready( current_state ) ) { 47a24: 666a bnes 47a90 <_Thread_Clear_state+0x9c> RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 47a26: 2868 008e moveal %a0@(142),%a4 47a2a: 3028 0094 movew %a0@(148),%d0 47a2e: 3214 movew %a4@,%d1 _Priority_Add_to_bit_map( &the_thread->Priority_map ); _Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node); 47a30: 2468 008a moveal %a0@(138),%a2 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 47a34: 240a movel %a2,%d2 47a36: 5882 addql #4,%d2 47a38: 8081 orl %d1,%d0 47a3a: 2082 movel %d2,%a0@ old_last_node = the_chain->last; 47a3c: 266a 0008 moveal %a2@(8),%a3 47a40: 3880 movew %d0,%a4@ the_chain->last = the_node; 47a42: 2548 0008 movel %a0,%a2@(8) _Priority_Major_bit_map |= the_priority_map->ready_major; 47a46: 3239 0005 f204 movew 5f204 <_Priority_Major_bit_map>,%d1 47a4c: 3028 0092 movew %a0@(146),%d0 old_last_node->next = the_node; the_node->previous = old_last_node; 47a50: 214b 0004 movel %a3,%a0@(4) 47a54: 8081 orl %d1,%d0 Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; the_chain->last = the_node; old_last_node->next = the_node; 47a56: 2688 movel %a0,%a3@ 47a58: 33c0 0005 f204 movew %d0,5f204 <_Priority_Major_bit_map> _ISR_Flash( level ); 47a5e: 2009 movel %a1,%d0 47a60: 46c3 movew %d3,%sr 47a62: 8083 orl %d3,%d0 47a64: 46c0 movew %d0,%sr * a context switch. * Pseudo-ISR case: * Even if the thread isn't preemptible, if the new heir is * a pseudo-ISR system task, we need to do a context switch. */ if ( the_thread->current_priority < _Thread_Heir->current_priority ) { 47a66: 2028 0014 movel %a0@(20),%d0 47a6a: 2279 0005 f1e2 moveal 5f1e2 <_Thread_Heir>,%a1 47a70: b0a9 0014 cmpl %a1@(20),%d0 47a74: 641a bccs 47a90 <_Thread_Clear_state+0x9c> _Thread_Heir = the_thread; 47a76: 23c8 0005 f1e2 movel %a0,5f1e2 <_Thread_Heir> if ( _Thread_Executing->is_preemptible || 47a7c: 2079 0005 f20e moveal 5f20e <_Thread_Executing>,%a0 47a82: 4a28 0075 tstb %a0@(117) 47a86: 6712 beqs 47a9a <_Thread_Clear_state+0xa6> the_thread->current_priority == 0 ) _Context_Switch_necessary = true; 47a88: 7001 moveq #1,%d0 47a8a: 13c0 0005 f21e moveb %d0,5f21e <_Context_Switch_necessary> } } } _ISR_Enable( level ); 47a90: 46c3 movew %d3,%sr } 47a92: 4cd7 1c0c moveml %sp@,%d2-%d3/%a2-%a4 47a96: 4e5e unlk %fp 47a98: 4e75 rts * Even if the thread isn't preemptible, if the new heir is * a pseudo-ISR system task, we need to do a context switch. */ if ( the_thread->current_priority < _Thread_Heir->current_priority ) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 47a9a: 4a80 tstl %d0 47a9c: 66f2 bnes 47a90 <_Thread_Clear_state+0x9c> <== NEVER TAKEN the_thread->current_priority == 0 ) _Context_Switch_necessary = true; 47a9e: 7001 moveq #1,%d0 <== NOT EXECUTED 47aa0: 13c0 0005 f21e moveb %d0,5f21e <_Context_Switch_necessary> <== NOT EXECUTED 47aa6: 60e8 bras 47a90 <_Thread_Clear_state+0x9c> <== NOT EXECUTED 00047aa8 <_Thread_Close>: 47aa8: 4280 clrl %d0 void _Thread_Close( Objects_Information *information, Thread_Control *the_thread ) { 47aaa: 4e56 0000 linkw %fp,#0 47aae: 2f0b movel %a3,%sp@- 47ab0: 266e 0008 moveal %fp@(8),%a3 47ab4: 2f0a movel %a2,%sp@- 47ab6: 246e 000c moveal %fp@(12),%a2 47aba: 206b 0018 moveal %a3@(24),%a0 47abe: 302a 000a movew %a2@(10),%d0 47ac2: 42b0 0c00 clrl %a0@(00000000,%d0:l:4) */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 47ac6: 2039 0005 f154 movel 5f154 <_Thread_Dispatch_disable_level>,%d0 47acc: 5380 subql #1,%d0 * disappear and set a transient state on it. So we temporarily * unnest dispatching. */ _Thread_Unnest_dispatch(); _User_extensions_Thread_delete( the_thread ); 47ace: 2f0a movel %a2,%sp@- 47ad0: 23c0 0005 f154 movel %d0,5f154 <_Thread_Dispatch_disable_level> 47ad6: 4eb9 0004 8e8c jsr 48e8c <_User_extensions_Thread_delete> rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 47adc: 2039 0005 f154 movel 5f154 <_Thread_Dispatch_disable_level>,%d0 47ae2: 5280 addql #1,%d0 47ae4: 23c0 0005 f154 movel %d0,5f154 <_Thread_Dispatch_disable_level> /* * Now we are in a dispatching critical section again and we * can take the thread OUT of the published set. It is invalid * to use this thread's Id OR name after this call. */ _Objects_Close( information, &the_thread->Object ); 47aea: 2f0a movel %a2,%sp@- 47aec: 2f0b movel %a3,%sp@- 47aee: 4eb9 0004 712c jsr 4712c <_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 ); 47af4: 4878 0001 pea 1 47af8: 2f0a movel %a2,%sp@- 47afa: 4eb9 0004 871c jsr 4871c <_Thread_Set_state> if ( !_Thread_queue_Extract_with_proxy( the_thread ) ) { 47b00: 2f0a movel %a2,%sp@- 47b02: 4eb9 0004 8528 jsr 48528 <_Thread_queue_Extract_with_proxy> 47b08: 4fef 0018 lea %sp@(24),%sp 47b0c: 4a00 tstb %d0 47b0e: 6608 bnes 47b18 <_Thread_Close+0x70> if ( _Watchdog_Is_active( &the_thread->Timer ) ) 47b10: 7002 moveq #2,%d0 47b12: b0aa 0050 cmpl %a2@(80),%d0 47b16: 6756 beqs 47b6e <_Thread_Close+0xc6> /* * The thread might have been FP. So deal with that. */ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( _Thread_Is_allocated_fp( the_thread ) ) 47b18: b5f9 0005 f1da cmpal 5f1da <_Thread_Allocated_fp>,%a2 47b1e: 6746 beqs 47b66 <_Thread_Close+0xbe> _Thread_Deallocate_fp(); #endif the_thread->fp_context = NULL; if ( the_thread->Start.fp_context ) 47b20: 202a 00c6 movel %a2@(198),%d0 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( _Thread_Is_allocated_fp( the_thread ) ) _Thread_Deallocate_fp(); #endif the_thread->fp_context = NULL; 47b24: 42aa 0102 clrl %a2@(258) if ( the_thread->Start.fp_context ) 47b28: 4a80 tstl %d0 47b2a: 670a beqs 47b36 <_Thread_Close+0x8e> (void) _Workspace_Free( the_thread->Start.fp_context ); 47b2c: 2f00 movel %d0,%sp@- 47b2e: 4eb9 0004 920c jsr 4920c <_Workspace_Free> 47b34: 588f addql #4,%sp /* * Free the rest of the memory associated with this task * and set the associated pointers to NULL for safety. */ _Thread_Stack_Free( the_thread ); 47b36: 2f0a movel %a2,%sp@- 47b38: 4eb9 0004 8918 jsr 48918 <_Thread_Stack_Free> the_thread->Start.stack = NULL; if ( the_thread->extensions ) 47b3e: 202a 0116 movel %a2@(278),%d0 47b42: 588f addql #4,%sp /* * Free the rest of the memory associated with this task * and set the associated pointers to NULL for safety. */ _Thread_Stack_Free( the_thread ); the_thread->Start.stack = NULL; 47b44: 42aa 00ca clrl %a2@(202) if ( the_thread->extensions ) 47b48: 4a80 tstl %d0 47b4a: 670a beqs 47b56 <_Thread_Close+0xae> (void) _Workspace_Free( the_thread->extensions ); 47b4c: 2f00 movel %d0,%sp@- 47b4e: 4eb9 0004 920c jsr 4920c <_Workspace_Free> 47b54: 588f addql #4,%sp the_thread->extensions = NULL; 47b56: 42aa 0116 clrl %a2@(278) } 47b5a: 246e fff8 moveal %fp@(-8),%a2 47b5e: 266e fffc moveal %fp@(-4),%a3 47b62: 4e5e unlk %fp 47b64: 4e75 rts */ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) RTEMS_INLINE_ROUTINE void _Thread_Deallocate_fp( void ) { _Thread_Allocated_fp = NULL; 47b66: 42b9 0005 f1da clrl 5f1da <_Thread_Allocated_fp> 47b6c: 60b2 bras 47b20 <_Thread_Close+0x78> <== ALWAYS TAKEN */ _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 ); 47b6e: 486a 0048 pea %a2@(72) 47b72: 4eb9 0004 90a0 jsr 490a0 <_Watchdog_Remove> 47b78: 588f addql #4,%sp /* * The thread might have been FP. So deal with that. */ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( _Thread_Is_allocated_fp( the_thread ) ) 47b7a: b5f9 0005 f1da cmpal 5f1da <_Thread_Allocated_fp>,%a2 47b80: 669e bnes 47b20 <_Thread_Close+0x78> <== NEVER TAKEN 47b82: 60e2 bras 47b66 <_Thread_Close+0xbe> <== NOT EXECUTED 00047c34 <_Thread_Delay_ended>: void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { 47c34: 4e56 fffc linkw %fp,#-4 Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 47c38: 486e fffc pea %fp@(-4) 47c3c: 2f2e 0008 movel %fp@(8),%sp@- 47c40: 4eb9 0004 7df0 jsr 47df0 <_Thread_Get> switch ( location ) { 47c46: 508f addql #8,%sp 47c48: 4aae fffc tstl %fp@(-4) 47c4c: 661e bnes 47c6c <_Thread_Delay_ended+0x38> <== ALWAYS TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_Clear_state( 47c4e: 2f3c 1000 0018 movel #268435480,%sp@- 47c54: 2f00 movel %d0,%sp@- 47c56: 4eb9 0004 79f4 jsr 479f4 <_Thread_Clear_state> 47c5c: 508f addql #8,%sp 47c5e: 2039 0005 f154 movel 5f154 <_Thread_Dispatch_disable_level>,%d0 47c64: 5380 subql #1,%d0 47c66: 23c0 0005 f154 movel %d0,5f154 <_Thread_Dispatch_disable_level> | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Thread_Unnest_dispatch(); break; } } 47c6c: 4e5e unlk %fp 47c6e: 4e75 rts 00047c70 <_Thread_Dispatch>: * dispatch thread * no dispatch thread */ void _Thread_Dispatch( void ) { 47c70: 4e56 ffc8 linkw %fp,#-56 47c74: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ Thread_Control *executing; Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); 47c78: 2e3c 0000 0700 movel #1792,%d7 47c7e: 2007 movel %d7,%d0 { Thread_Control *executing; Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; 47c80: 2479 0005 f20e moveal 5f20e <_Thread_Executing>,%a2 _ISR_Disable( level ); 47c86: 40c1 movew %sr,%d1 47c88: 8081 orl %d1,%d0 47c8a: 46c0 movew %d0,%sr while ( _Context_Switch_necessary == true ) { 47c8c: 1039 0005 f21e moveb 5f21e <_Context_Switch_necessary>,%d0 47c92: 6700 00fa beqw 47d8e <_Thread_Dispatch+0x11e> 47c96: 260e movel %fp,%d3 47c98: 240e movel %fp,%d2 47c9a: 5183 subql #8,%d3 47c9c: 2c3c 0004 bd0c movel #310540,%d6 47ca2: 0682 ffff fff0 addil #-16,%d2 47ca8: 2a3c 0004 8c58 movel #298072,%d5 47cae: 283c 0004 8c10 movel #298000,%d4 47cb4: 4bf9 0004 8f18 lea 48f18 <_User_extensions_Thread_switch>,%a5 47cba: 49f9 0004 928c lea 4928c <_CPU_Context_switch>,%a4 heir = _Thread_Heir; _Thread_Dispatch_disable_level = 1; 47cc0: 7001 moveq #1,%d0 47cc2: 23c0 0005 f154 movel %d0,5f154 <_Thread_Dispatch_disable_level> ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { heir = _Thread_Heir; 47cc8: 2679 0005 f1e2 moveal 5f1e2 <_Thread_Heir>,%a3 _Thread_Dispatch_disable_level = 1; _Context_Switch_necessary = false; 47cce: 4200 clrb %d0 _Thread_Executing = heir; 47cd0: 23cb 0005 f20e movel %a3,5f20e <_Thread_Executing> executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { heir = _Thread_Heir; _Thread_Dispatch_disable_level = 1; _Context_Switch_necessary = false; 47cd6: 13c0 0005 f21e moveb %d0,5f21e <_Context_Switch_necessary> _Thread_Executing = heir; #if __RTEMS_ADA__ executing->rtems_ada_self = rtems_ada_self; rtems_ada_self = heir->rtems_ada_self; #endif if ( heir->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE ) 47cdc: 7001 moveq #1,%d0 47cde: b0ab 007a cmpl %a3@(122),%d0 47ce2: 6700 00d6 beqw 47dba <_Thread_Dispatch+0x14a> heir->cpu_time_budget = _Thread_Ticks_per_timeslice; _ISR_Enable( level ); 47ce6: 46c1 movew %d1,%sr #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 47ce8: 2f03 movel %d3,%sp@- 47cea: 2046 moveal %d6,%a0 47cec: 4e90 jsr %a0@ _Timestamp_Subtract( 47cee: 2045 moveal %d5,%a0 47cf0: 2f02 movel %d2,%sp@- 47cf2: 2f03 movel %d3,%sp@- 47cf4: 4879 0005 f216 pea 5f216 <_Thread_Time_of_last_context_switch> 47cfa: 4e90 jsr %a0@ &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); 47cfc: 2044 moveal %d4,%a0 47cfe: 2f02 movel %d2,%sp@- 47d00: 486a 0082 pea %a2@(130) 47d04: 4e90 jsr %a0@ #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 47d06: 2079 0005 f1de moveal 5f1de <_Thread_libc_reent>,%a0 47d0c: 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; 47d10: 202e fff8 movel %fp@(-8),%d0 47d14: 222e fffc movel %fp@(-4),%d1 47d18: 23c0 0005 f216 movel %d0,5f216 <_Thread_Time_of_last_context_switch> 47d1e: 23c1 0005 f21a movel %d1,5f21a <_Thread_Time_of_last_context_switch+0x4> #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 47d24: 4a88 tstl %a0 47d26: 6708 beqs 47d30 <_Thread_Dispatch+0xc0> <== ALWAYS TAKEN executing->libc_reent = *_Thread_libc_reent; 47d28: 2550 0106 movel %a0@,%a2@(262) *_Thread_libc_reent = heir->libc_reent; 47d2c: 20ab 0106 movel %a3@(262),%a0@ } _User_extensions_Thread_switch( executing, heir ); 47d30: 2f0b movel %a3,%sp@- 47d32: 2f0a movel %a2,%sp@- 47d34: 4e95 jsr %a5@ if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 47d36: 486b 00ce pea %a3@(206) 47d3a: 486a 00ce pea %a2@(206) 47d3e: 4e94 jsr %a4@ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && 47d40: 4fef 0010 lea %sp@(16),%sp 47d44: 4aaa 0102 tstl %a2@(258) 47d48: 672c beqs 47d76 <_Thread_Dispatch+0x106> #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 ); 47d4a: 2079 0005 f1da moveal 5f1da <_Thread_Allocated_fp>,%a0 47d50: b1ca cmpal %a2,%a0 47d52: 6722 beqs 47d76 <_Thread_Dispatch+0x106> !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) 47d54: 4a88 tstl %a0 47d56: 670c beqs 47d64 <_Thread_Dispatch+0xf4> _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 47d58: 4868 0102 pea %a0@(258) 47d5c: 4eb9 0004 93ba jsr 493ba <_CPU_Context_save_fp> 47d62: 588f addql #4,%sp _Context_Restore_fp( &executing->fp_context ); 47d64: 486a 0102 pea %a2@(258) 47d68: 4eb9 0004 93f2 jsr 493f2 <_CPU_Context_restore_fp> _Thread_Allocated_fp = executing; 47d6e: 588f addql #4,%sp 47d70: 23ca 0005 f1da movel %a2,5f1da <_Thread_Allocated_fp> if ( executing->fp_context != NULL ) _Context_Restore_fp( &executing->fp_context ); #endif #endif executing = _Thread_Executing; 47d76: 2479 0005 f20e moveal 5f20e <_Thread_Executing>,%a2 _ISR_Disable( level ); 47d7c: 2007 movel %d7,%d0 47d7e: 40c1 movew %sr,%d1 47d80: 8081 orl %d1,%d0 47d82: 46c0 movew %d0,%sr Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { 47d84: 1039 0005 f21e moveb 5f21e <_Context_Switch_necessary>,%d0 47d8a: 6600 ff34 bnew 47cc0 <_Thread_Dispatch+0x50> executing = _Thread_Executing; _ISR_Disable( level ); } _Thread_Dispatch_disable_level = 0; 47d8e: 42b9 0005 f154 clrl 5f154 <_Thread_Dispatch_disable_level> _ISR_Enable( level ); 47d94: 46c1 movew %d1,%sr if ( _Thread_Do_post_task_switch_extension || 47d96: 4ab9 0005 f1f6 tstl 5f1f6 <_Thread_Do_post_task_switch_extension> 47d9c: 6606 bnes 47da4 <_Thread_Dispatch+0x134> executing->do_post_task_switch_extension ) { 47d9e: 4a2a 0074 tstb %a2@(116) 47da2: 670c beqs 47db0 <_Thread_Dispatch+0x140> executing->do_post_task_switch_extension = false; 47da4: 4201 clrb %d1 47da6: 1541 0074 moveb %d1,%a2@(116) _API_extensions_Run_postswitch(); 47daa: 4eb9 0004 665c jsr 4665c <_API_extensions_Run_postswitch> } } 47db0: 4cee 3cfc ffc8 moveml %fp@(-56),%d2-%d7/%a2-%a5 47db6: 4e5e unlk %fp 47db8: 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; 47dba: 41f9 0005 f104 lea 5f104 <_Thread_Ticks_per_timeslice>,%a0 47dc0: 2750 0076 movel %a0@,%a3@(118) 47dc4: 6000 ff20 braw 47ce6 <_Thread_Dispatch+0x76> <== ALWAYS TAKEN 0004e1c0 <_Thread_Evaluate_mode>: * * XXX */ bool _Thread_Evaluate_mode( void ) { 4e1c0: 4e56 0000 linkw %fp,#0 Thread_Control *executing; executing = _Thread_Executing; 4e1c4: 2079 0005 f20e moveal 5f20e <_Thread_Executing>,%a0 if ( !_States_Is_ready( executing->current_state ) || 4e1ca: 4aa8 0010 tstl %a0@(16) 4e1ce: 660e bnes 4e1de <_Thread_Evaluate_mode+0x1e> <== ALWAYS TAKEN 4e1d0: b1f9 0005 f1e2 cmpal 5f1e2 <_Thread_Heir>,%a0 4e1d6: 6712 beqs 4e1ea <_Thread_Evaluate_mode+0x2a> ( !_Thread_Is_heir( executing ) && executing->is_preemptible ) ) { 4e1d8: 4a28 0075 tstb %a0@(117) 4e1dc: 670c beqs 4e1ea <_Thread_Evaluate_mode+0x2a> <== ALWAYS TAKEN _Context_Switch_necessary = true; return true; } return false; } 4e1de: 4e5e unlk %fp executing = _Thread_Executing; if ( !_States_Is_ready( executing->current_state ) || ( !_Thread_Is_heir( executing ) && executing->is_preemptible ) ) { _Context_Switch_necessary = true; 4e1e0: 7001 moveq #1,%d0 4e1e2: 13c0 0005 f21e moveb %d0,5f21e <_Context_Switch_necessary> return true; } return false; } 4e1e8: 4e75 rts 4e1ea: 4e5e unlk %fp executing = _Thread_Executing; if ( !_States_Is_ready( executing->current_state ) || ( !_Thread_Is_heir( executing ) && executing->is_preemptible ) ) { _Context_Switch_necessary = true; return true; 4e1ec: 4200 clrb %d0 } return false; } 4e1ee: 4e75 rts 00047df0 <_Thread_Get>: Thread_Control *_Thread_Get ( Objects_Id id, Objects_Locations *location ) { 47df0: 4e56 0000 linkw %fp,#0 47df4: 202e 0008 movel %fp@(8),%d0 47df8: 2f03 movel %d3,%sp@- 47dfa: 206e 000c moveal %fp@(12),%a0 47dfe: 2f02 movel %d2,%sp@- uint32_t the_class; Objects_Information **api_information; Objects_Information *information; Thread_Control *tp = (Thread_Control *) 0; if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) ) { 47e00: 4a80 tstl %d0 47e02: 6766 beqs 47e6a <_Thread_Get+0x7a> */ RTEMS_INLINE_ROUTINE Objects_APIs _Objects_Get_API( Objects_Id id ) { return (Objects_APIs) ((id >> OBJECTS_API_START_BIT) & OBJECTS_API_VALID_BITS); 47e04: 7418 moveq #24,%d2 47e06: 2200 movel %d0,%d1 47e08: e4a9 lsrl %d2,%d1 47e0a: 7607 moveq #7,%d3 */ RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid( uint32_t the_api ) { if ( !the_api || the_api > OBJECTS_APIS_LAST ) 47e0c: 143c 0003 moveb #3,%d2 */ RTEMS_INLINE_ROUTINE Objects_APIs _Objects_Get_API( Objects_Id id ) { return (Objects_APIs) ((id >> OBJECTS_API_START_BIT) & OBJECTS_API_VALID_BITS); 47e10: c283 andl %d3,%d1 */ RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid( uint32_t the_api ) { if ( !the_api || the_api > OBJECTS_APIS_LAST ) 47e12: 2241 moveal %d1,%a1 47e14: 5389 subql #1,%a1 47e16: b489 cmpl %a1,%d2 47e18: 653e bcss 47e58 <_Thread_Get+0x68> *location = OBJECTS_ERROR; goto done; } the_class = _Objects_Get_class( id ); if ( the_class != 1 ) { /* threads are always first class :) */ 47e1a: 761b moveq #27,%d3 47e1c: 2400 movel %d0,%d2 47e1e: e6aa lsrl %d3,%d2 47e20: 163c 0001 moveb #1,%d3 47e24: b682 cmpl %d2,%d3 47e26: 6630 bnes 47e58 <_Thread_Get+0x68> <== ALWAYS TAKEN *location = OBJECTS_ERROR; goto done; } api_information = _Objects_Information_table[ the_api ]; 47e28: 43f9 0005 f10c lea 5f10c <_Objects_Information_table>,%a1 47e2e: 2271 1c00 moveal %a1@(00000000,%d1:l:4),%a1 if ( !api_information ) { 47e32: 4a89 tstl %a1 47e34: 6722 beqs 47e58 <_Thread_Get+0x68> *location = OBJECTS_ERROR; goto done; } information = api_information[ the_class ]; 47e36: 2229 0004 movel %a1@(4),%d1 if ( !information ) { 47e3a: 671c beqs 47e58 <_Thread_Get+0x68> *location = OBJECTS_ERROR; goto done; } tp = (Thread_Control *) _Objects_Get( information, id, location ); 47e3c: 2f08 movel %a0,%sp@- 47e3e: 2f00 movel %d0,%sp@- 47e40: 2f01 movel %d1,%sp@- 47e42: 4eb9 0004 7538 jsr 47538 <_Objects_Get> done: return tp; } 47e48: 242e fff8 movel %fp@(-8),%d2 if ( !information ) { *location = OBJECTS_ERROR; goto done; } tp = (Thread_Control *) _Objects_Get( information, id, location ); 47e4c: 4fef 000c lea %sp@(12),%sp done: return tp; } 47e50: 262e fffc movel %fp@(-4),%d3 47e54: 4e5e unlk %fp 47e56: 4e75 rts goto done; } information = api_information[ the_class ]; if ( !information ) { *location = OBJECTS_ERROR; 47e58: 7001 moveq #1,%d0 tp = (Thread_Control *) _Objects_Get( information, id, location ); done: return tp; } 47e5a: 242e fff8 movel %fp@(-8),%d2 47e5e: 262e fffc movel %fp@(-4),%d3 47e62: 4e5e unlk %fp goto done; } information = api_information[ the_class ]; if ( !information ) { *location = OBJECTS_ERROR; 47e64: 2080 movel %d0,%a0@ 47e66: 4280 clrl %d0 tp = (Thread_Control *) _Objects_Get( information, id, location ); done: return tp; } 47e68: 4e75 rts rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 47e6a: 2039 0005 f154 movel 5f154 <_Thread_Dispatch_disable_level>,%d0 47e70: 5280 addql #1,%d0 47e72: 23c0 0005 f154 movel %d0,5f154 <_Thread_Dispatch_disable_level> 47e78: 242e fff8 movel %fp@(-8),%d2 47e7c: 262e fffc movel %fp@(-4),%d3 47e80: 4e5e unlk %fp Thread_Control *tp = (Thread_Control *) 0; if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) ) { _Thread_Disable_dispatch(); *location = OBJECTS_LOCAL; tp = _Thread_Executing; 47e82: 2039 0005 f20e movel 5f20e <_Thread_Executing>,%d0 Objects_Information *information; Thread_Control *tp = (Thread_Control *) 0; if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) ) { _Thread_Disable_dispatch(); *location = OBJECTS_LOCAL; 47e88: 4290 clrl %a0@ tp = (Thread_Control *) _Objects_Get( information, id, location ); done: return tp; } 47e8a: 4e75 rts 0004e1f0 <_Thread_Handler>: * * Output parameters: NONE */ void _Thread_Handler( void ) { 4e1f0: 4e56 0000 linkw %fp,#0 4e1f4: 2f0a movel %a2,%sp@- #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static char doneConstructors; char doneCons; #endif executing = _Thread_Executing; 4e1f6: 2479 0005 f20e moveal 5f20e <_Thread_Executing>,%a2 * * Output parameters: NONE */ void _Thread_Handler( void ) { 4e1fc: 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; 4e1fe: 222a 00b4 movel %a2@(180),%d1 _ISR_Set_level(level); 4e202: 40c0 movew %sr,%d0 4e204: e189 lsll #8,%d1 4e206: 0280 0000 f8ff andil #63743,%d0 4e20c: 8081 orl %d1,%d0 4e20e: 46c0 movew %d0,%sr #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) doneCons = doneConstructors; doneConstructors = 1; 4e210: 7001 moveq #1,%d0 level = executing->Start.isr_level; _ISR_Set_level(level); #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) doneCons = doneConstructors; 4e212: 1439 0005 e904 moveb 5e904 ,%d2 doneConstructors = 1; 4e218: 13c0 0005 e904 moveb %d0,5e904 #endif #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && 4e21e: 4aaa 0102 tstl %a2@(258) 4e222: 6720 beqs 4e244 <_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 ); 4e224: 2079 0005 f1da moveal 5f1da <_Thread_Allocated_fp>,%a0 4e22a: b1ca cmpal %a2,%a0 4e22c: 6716 beqs 4e244 <_Thread_Handler+0x54> !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) 4e22e: 4a88 tstl %a0 4e230: 670c beqs 4e23e <_Thread_Handler+0x4e> _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 4e232: 4868 0102 pea %a0@(258) 4e236: 4eb9 0004 93ba jsr 493ba <_CPU_Context_save_fp> 4e23c: 588f addql #4,%sp _Thread_Allocated_fp = executing; 4e23e: 23ca 0005 f1da movel %a2,5f1da <_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 ); 4e244: 2f0a movel %a2,%sp@- 4e246: 4eb9 0004 8d70 jsr 48d70 <_User_extensions_Thread_begin> /* * At this point, the dispatch disable level BETTER be 1. */ _Thread_Enable_dispatch(); 4e24c: 4eb9 0004 7dc8 jsr 47dc8 <_Thread_Enable_dispatch> /* * _init could be a weak symbol and we SHOULD test it but it isn't * in any configuration I know of and it generates a warning on every * RTEMS target configuration. --joel (12 May 2007) */ if (!doneCons) /* && (volatile void *)_init) */ { 4e252: 588f addql #4,%sp 4e254: 4a02 tstb %d2 4e256: 6724 beqs 4e27c <_Thread_Handler+0x8c> INIT_NAME (); } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 4e258: 202a 009e movel %a2@(158),%d0 4e25c: 672a beqs 4e288 <_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 ) { 4e25e: 7201 moveq #1,%d1 4e260: b280 cmpl %d0,%d1 4e262: 674c beqs 4e2b0 <_Thread_Handler+0xc0> <== NEVER 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 ); 4e264: 2f0a movel %a2,%sp@- <== NOT EXECUTED 4e266: 4eb9 0004 8dae jsr 48dae <_User_extensions_Thread_exitted> <== NOT EXECUTED _Internal_error_Occurred( 4e26c: 4878 0006 pea 6 <== NOT EXECUTED 4e270: 4878 0001 pea 1 <== NOT EXECUTED 4e274: 42a7 clrl %sp@- <== NOT EXECUTED 4e276: 4eb9 0004 6fd8 jsr 46fd8 <_Internal_error_Occurred> <== NOT EXECUTED * _init could be a weak symbol and we SHOULD test it but it isn't * in any configuration I know of and it generates a warning on every * RTEMS target configuration. --joel (12 May 2007) */ if (!doneCons) /* && (volatile void *)_init) */ { INIT_NAME (); 4e27c: 4eb9 0005 be1c jsr 5be1c <_init> } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 4e282: 202a 009e movel %a2@(158),%d0 4e286: 66d6 bnes 4e25e <_Thread_Handler+0x6e> executing->Wait.return_argument = (*(Thread_Entry_numeric) executing->Start.entry_point)( 4e288: 2f2a 00a6 movel %a2@(166),%sp@- 4e28c: 206a 009a moveal %a2@(154),%a0 4e290: 4e90 jsr %a0@ INIT_NAME (); } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { executing->Wait.return_argument = 4e292: 588f addql #4,%sp 4e294: 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 ); 4e298: 2f0a movel %a2,%sp@- 4e29a: 4eb9 0004 8dae jsr 48dae <_User_extensions_Thread_exitted> _Internal_error_Occurred( 4e2a0: 4878 0006 pea 6 4e2a4: 4878 0001 pea 1 4e2a8: 42a7 clrl %sp@- 4e2aa: 4eb9 0004 6fd8 jsr 46fd8 <_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)( 4e2b0: 2f2a 00a2 movel %a2@(162),%sp@- 4e2b4: 206a 009a moveal %a2@(154),%a0 4e2b8: 4e90 jsr %a0@ executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { executing->Wait.return_argument = 4e2ba: 588f addql #4,%sp 4e2bc: 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 ); 4e2c0: 2f0a movel %a2,%sp@- 4e2c2: 4eb9 0004 8dae jsr 48dae <_User_extensions_Thread_exitted> _Internal_error_Occurred( 4e2c8: 4878 0006 pea 6 <== NOT EXECUTED 4e2cc: 4878 0001 pea 1 <== NOT EXECUTED 4e2d0: 42a7 clrl %sp@- <== NOT EXECUTED 4e2d2: 4eb9 0004 6fd8 jsr 46fd8 <_Internal_error_Occurred> <== NOT EXECUTED 00047e8c <_Thread_Initialize>: Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 47e8c: 4e56 ffe4 linkw %fp,#-28 47e90: 202e 0010 movel %fp@(16),%d0 47e94: 48d7 1c3c moveml %d2-%d5/%a2-%a4,%sp@ 47e98: 246e 000c moveal %fp@(12),%a2 47e9c: 262e 0014 movel %fp@(20),%d3 47ea0: 242e 001c movel %fp@(28),%d2 47ea4: 266e 0024 moveal %fp@(36),%a3 /* * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; 47ea8: 42aa 010a clrl %a2@(266) Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 47eac: 182e 001b moveb %fp@(27),%d4 /* * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; 47eb0: 42aa 010e clrl %a2@(270) Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 47eb4: 1a2e 0023 moveb %fp@(35),%d5 /* * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; 47eb8: 42aa 0112 clrl %a2@(274) extensions_area = NULL; the_thread->libc_reent = NULL; 47ebc: 42aa 0106 clrl %a2@(262) if ( !actual_stack_size || actual_stack_size < stack_size ) return false; /* stack allocation failed */ stack = the_thread->Start.stack; #else if ( !stack_area ) { 47ec0: 4a80 tstl %d0 47ec2: 6700 01e2 beqw 480a6 <_Thread_Initialize+0x21a> 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; 47ec6: 2203 movel %d3,%d1 47ec8: 4203 clrb %d3 47eca: 1543 00bc moveb %d3,%a2@(188) Stack_Control *the_stack, void *starting_address, size_t size ) { the_stack->area = starting_address; 47ece: 2540 00c2 movel %d0,%a2@(194) the_stack->size = size; 47ed2: 2541 00be movel %d1,%a2@(190) /* * Allocate the floating point area for this thread */ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( is_fp ) { 47ed6: 4a04 tstb %d4 47ed8: 6600 0170 bnew 4804a <_Thread_Initialize+0x1be> 47edc: 4280 clrl %d0 47ede: 4284 clrl %d4 #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { 47ee0: 2239 0005 f1f2 movel 5f1f2 <_Thread_Maximum_extensions>,%d1 if ( !fp_area ) goto failed; fp_area = _Context_Fp_start( fp_area, 0 ); } the_thread->fp_context = fp_area; the_thread->Start.fp_context = fp_area; 47ee6: 2540 00c6 movel %d0,%a2@(198) fp_area = _Workspace_Allocate( CONTEXT_FP_SIZE ); if ( !fp_area ) goto failed; fp_area = _Context_Fp_start( fp_area, 0 ); } the_thread->fp_context = fp_area; 47eea: 2540 0102 movel %d0,%a2@(258) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 47eee: 42aa 0050 clrl %a2@(80) the_watchdog->routine = routine; 47ef2: 42aa 0064 clrl %a2@(100) the_watchdog->id = id; 47ef6: 42aa 0068 clrl %a2@(104) the_watchdog->user_data = user_data; 47efa: 42aa 006c clrl %a2@(108) #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { 47efe: 4a81 tstl %d1 47f00: 6600 016a bnew 4806c <_Thread_Initialize+0x1e0> (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) goto failed; } the_thread->extensions = (void **) extensions_area; 47f04: 42aa 0116 clrl %a2@(278) 47f08: 4283 clrl %d3 /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; 47f0a: 254b 00ac movel %a3,%a2@(172) the_thread->Start.budget_callout = budget_callout; switch ( budget_algorithm ) { 47f0e: 7002 moveq #2,%d0 * General initialization */ the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; the_thread->Start.budget_callout = budget_callout; 47f10: 256e 0028 00b0 movel %fp@(40),%a2@(176) /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; 47f16: 1545 00aa moveb %d5,%a2@(170) the_thread->Start.budget_algorithm = budget_algorithm; the_thread->Start.budget_callout = budget_callout; switch ( budget_algorithm ) { 47f1a: b08b cmpl %a3,%d0 47f1c: 6700 00c8 beqw 47fe6 <_Thread_Initialize+0x15a> #if defined(RTEMS_ITRON_API) the_thread->suspend_count = 0; #endif the_thread->real_priority = priority; the_thread->Start.initial_priority = priority; _Thread_Set_priority( the_thread, priority ); 47f20: 2f02 movel %d2,%sp@- case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; 47f22: 256e 002c 00b4 movel %fp@(44),%a2@(180) the_thread->current_state = STATES_DORMANT; 47f28: 7001 moveq #1,%d0 #if defined(RTEMS_ITRON_API) the_thread->suspend_count = 0; #endif the_thread->real_priority = priority; the_thread->Start.initial_priority = priority; _Thread_Set_priority( the_thread, priority ); 47f2a: 2f0a movel %a2,%sp@- #endif } the_thread->Start.isr_level = isr_level; the_thread->current_state = STATES_DORMANT; 47f2c: 2540 0010 movel %d0,%a2@(16) the_thread->Wait.queue = NULL; 47f30: 42aa 0044 clrl %a2@(68) the_thread->resource_count = 0; 47f34: 42aa 001c clrl %a2@(28) #if defined(RTEMS_ITRON_API) the_thread->suspend_count = 0; #endif the_thread->real_priority = priority; 47f38: 2542 0018 movel %d2,%a2@(24) the_thread->Start.initial_priority = priority; 47f3c: 2542 00b8 movel %d2,%a2@(184) _Thread_Set_priority( the_thread, priority ); 47f40: 4eb9 0004 86ac jsr 486ac <_Thread_Set_priority> #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 47f46: 206e 0008 moveal %fp@(8),%a0 47f4a: 4280 clrl %d0 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 47f4c: 256e 0030 000c movel %fp@(48),%a2@(12) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 47f52: 2068 0018 moveal %a0@(24),%a0 47f56: 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 ); 47f5a: 42aa 0082 clrl %a2@(130) 47f5e: 218a 0c00 movel %a2,%a0@(00000000,%d0:l:4) 47f62: 42aa 0086 clrl %a2@(134) * enabled when we get here. We want to be able to run the * user extensions with dispatching enabled. The Allocator * Mutex provides sufficient protection to let the user extensions * run safely. */ extension_status = _User_extensions_Thread_create( the_thread ); 47f66: 2f0a movel %a2,%sp@- 47f68: 4eb9 0004 8e40 jsr 48e40 <_User_extensions_Thread_create> if ( extension_status ) 47f6e: 4fef 000c lea %sp@(12),%sp 47f72: 4a00 tstb %d0 47f74: 6664 bnes 47fda <_Thread_Initialize+0x14e> return true; failed: if ( the_thread->libc_reent ) 47f76: 202a 0106 movel %a2@(262),%d0 47f7a: 670a beqs 47f86 <_Thread_Initialize+0xfa> _Workspace_Free( the_thread->libc_reent ); 47f7c: 2f00 movel %d0,%sp@- 47f7e: 4eb9 0004 920c jsr 4920c <_Workspace_Free> 47f84: 588f addql #4,%sp 47f86: 47ea 010a lea %a2@(266),%a3 47f8a: 4282 clrl %d2 for ( i=0 ; i <= THREAD_API_LAST ; i++ ) if ( the_thread->API_Extensions[i] ) _Workspace_Free( the_thread->API_Extensions[i] ); 47f8c: 49f9 0004 920c lea 4920c <_Workspace_Free>,%a4 failed: if ( the_thread->libc_reent ) _Workspace_Free( the_thread->libc_reent ); for ( i=0 ; i <= THREAD_API_LAST ; i++ ) if ( the_thread->API_Extensions[i] ) 47f92: 2013 movel %a3@,%d0 failed: if ( the_thread->libc_reent ) _Workspace_Free( the_thread->libc_reent ); for ( i=0 ; i <= THREAD_API_LAST ; i++ ) 47f94: 5282 addql #1,%d2 47f96: 588b addql #4,%a3 if ( the_thread->API_Extensions[i] ) 47f98: 4a80 tstl %d0 47f9a: 6706 beqs 47fa2 <_Thread_Initialize+0x116> _Workspace_Free( the_thread->API_Extensions[i] ); 47f9c: 2f00 movel %d0,%sp@- 47f9e: 4e94 jsr %a4@ 47fa0: 588f addql #4,%sp failed: if ( the_thread->libc_reent ) _Workspace_Free( the_thread->libc_reent ); for ( i=0 ; i <= THREAD_API_LAST ; i++ ) 47fa2: 7003 moveq #3,%d0 47fa4: b082 cmpl %d2,%d0 47fa6: 66ea bnes 47f92 <_Thread_Initialize+0x106> if ( the_thread->API_Extensions[i] ) _Workspace_Free( the_thread->API_Extensions[i] ); if ( extensions_area ) 47fa8: 4a83 tstl %d3 47faa: 670a beqs 47fb6 <_Thread_Initialize+0x12a> (void) _Workspace_Free( extensions_area ); 47fac: 2f03 movel %d3,%sp@- 47fae: 4eb9 0004 920c jsr 4920c <_Workspace_Free> 47fb4: 588f addql #4,%sp #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( fp_area ) 47fb6: 4a84 tstl %d4 47fb8: 670a beqs 47fc4 <_Thread_Initialize+0x138> (void) _Workspace_Free( fp_area ); 47fba: 2f04 movel %d4,%sp@- 47fbc: 4eb9 0004 920c jsr 4920c <_Workspace_Free> 47fc2: 588f addql #4,%sp #endif _Thread_Stack_Free( the_thread ); 47fc4: 2f0a movel %a2,%sp@- 47fc6: 4eb9 0004 8918 jsr 48918 <_Thread_Stack_Free> return false; 47fcc: 588f addql #4,%sp } 47fce: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( fp_area ) (void) _Workspace_Free( fp_area ); #endif _Thread_Stack_Free( the_thread ); 47fd4: 4200 clrb %d0 return false; } 47fd6: 4e5e unlk %fp 47fd8: 4e75 rts 47fda: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4 * user extensions with dispatching enabled. The Allocator * Mutex provides sufficient protection to let the user extensions * run safely. */ extension_status = _User_extensions_Thread_create( the_thread ); if ( extension_status ) 47fe0: 7001 moveq #1,%d0 _Thread_Stack_Free( the_thread ); return false; } 47fe2: 4e5e unlk %fp 47fe4: 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; 47fe6: 41f9 0005 f104 lea 5f104 <_Thread_Ticks_per_timeslice>,%a0 #endif } the_thread->Start.isr_level = isr_level; the_thread->current_state = STATES_DORMANT; 47fec: 7001 moveq #1,%d0 case THREAD_CPU_BUDGET_ALGORITHM_NONE: case THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE: break; #if defined(RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE) case THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; 47fee: 2550 0076 movel %a0@,%a2@(118) #if defined(RTEMS_ITRON_API) the_thread->suspend_count = 0; #endif the_thread->real_priority = priority; the_thread->Start.initial_priority = priority; _Thread_Set_priority( the_thread, priority ); 47ff2: 2f02 movel %d2,%sp@- case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; 47ff4: 256e 002c 00b4 movel %fp@(44),%a2@(180) #if defined(RTEMS_ITRON_API) the_thread->suspend_count = 0; #endif the_thread->real_priority = priority; the_thread->Start.initial_priority = priority; _Thread_Set_priority( the_thread, priority ); 47ffa: 2f0a movel %a2,%sp@- #endif } the_thread->Start.isr_level = isr_level; the_thread->current_state = STATES_DORMANT; 47ffc: 2540 0010 movel %d0,%a2@(16) the_thread->Wait.queue = NULL; 48000: 42aa 0044 clrl %a2@(68) the_thread->resource_count = 0; 48004: 42aa 001c clrl %a2@(28) #if defined(RTEMS_ITRON_API) the_thread->suspend_count = 0; #endif the_thread->real_priority = priority; 48008: 2542 0018 movel %d2,%a2@(24) the_thread->Start.initial_priority = priority; 4800c: 2542 00b8 movel %d2,%a2@(184) _Thread_Set_priority( the_thread, priority ); 48010: 4eb9 0004 86ac jsr 486ac <_Thread_Set_priority> 48016: 206e 0008 moveal %fp@(8),%a0 4801a: 4280 clrl %d0 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 4801c: 256e 0030 000c movel %fp@(48),%a2@(12) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 48022: 2068 0018 moveal %a0@(24),%a0 48026: 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 ); 4802a: 42aa 0082 clrl %a2@(130) 4802e: 218a 0c00 movel %a2,%a0@(00000000,%d0:l:4) 48032: 42aa 0086 clrl %a2@(134) * enabled when we get here. We want to be able to run the * user extensions with dispatching enabled. The Allocator * Mutex provides sufficient protection to let the user extensions * run safely. */ extension_status = _User_extensions_Thread_create( the_thread ); 48036: 2f0a movel %a2,%sp@- 48038: 4eb9 0004 8e40 jsr 48e40 <_User_extensions_Thread_create> if ( extension_status ) 4803e: 4fef 000c lea %sp@(12),%sp 48042: 4a00 tstb %d0 48044: 6700 ff30 beqw 47f76 <_Thread_Initialize+0xea> <== ALWAYS TAKEN 48048: 6090 bras 47fda <_Thread_Initialize+0x14e> <== ALWAYS TAKEN /* * 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 ); 4804a: 4878 001c pea 1c 4804e: 4eb9 0004 91f0 jsr 491f0 <_Workspace_Allocate> if ( !fp_area ) 48054: 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 ); 48056: 2800 movel %d0,%d4 if ( !fp_area ) 48058: 6600 fe86 bnew 47ee0 <_Thread_Initialize+0x54> extension_status = _User_extensions_Thread_create( the_thread ); if ( extension_status ) return true; failed: if ( the_thread->libc_reent ) 4805c: 202a 0106 movel %a2@(262),%d0 * Allocate the floating point area for this thread */ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( is_fp ) { fp_area = _Workspace_Allocate( CONTEXT_FP_SIZE ); if ( !fp_area ) 48060: 4283 clrl %d3 extension_status = _User_extensions_Thread_create( the_thread ); if ( extension_status ) return true; failed: if ( the_thread->libc_reent ) 48062: 4a80 tstl %d0 48064: 6600 ff16 bnew 47f7c <_Thread_Initialize+0xf0> <== ALWAYS TAKEN 48068: 6000 ff1c braw 47f86 <_Thread_Initialize+0xfa> <== ALWAYS TAKEN /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { extensions_area = _Workspace_Allocate( 4806c: e589 lsll #2,%d1 4806e: 2041 moveal %d1,%a0 48070: 4868 0004 pea %a0@(4) 48074: 4eb9 0004 91f0 jsr 491f0 <_Workspace_Allocate> (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) 4807a: 588f addql #4,%sp /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { extensions_area = _Workspace_Allocate( 4807c: 2600 movel %d0,%d3 (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) 4807e: 6700 fef6 beqw 47f76 <_Thread_Initialize+0xea> <== ALWAYS TAKEN goto failed; } the_thread->extensions = (void **) extensions_area; 48082: 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++ ) 48084: 4281 clrl %d1 48086: 4280 clrl %d0 48088: 2279 0005 f1f2 moveal 5f1f2 <_Thread_Maximum_extensions>,%a1 (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) goto failed; } the_thread->extensions = (void **) extensions_area; 4808e: 2543 0116 movel %d3,%a2@(278) * so they cannot rely on the thread create user extension * call. */ if ( the_thread->extensions ) { for ( i = 0; i <= _Thread_Maximum_extensions ; i++ ) the_thread->extensions[i] = NULL; 48092: 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++ ) 48096: 5280 addql #1,%d0 48098: 2200 movel %d0,%d1 4809a: b3c0 cmpal %d0,%a1 4809c: 6500 fe6c bcsw 47f0a <_Thread_Initialize+0x7e> 480a0: 206a 0116 moveal %a2@(278),%a0 480a4: 60ec bras 48092 <_Thread_Initialize+0x206> <== ALWAYS TAKEN return false; /* stack allocation failed */ stack = the_thread->Start.stack; #else if ( !stack_area ) { actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); 480a6: 2f03 movel %d3,%sp@- 480a8: 2f0a movel %a2,%sp@- 480aa: 4eb9 0004 88b4 jsr 488b4 <_Thread_Stack_Allocate> if ( !actual_stack_size || actual_stack_size < stack_size ) 480b0: 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 ); 480b2: 2200 movel %d0,%d1 if ( !actual_stack_size || actual_stack_size < stack_size ) 480b4: 6712 beqs 480c8 <_Thread_Initialize+0x23c> 480b6: b083 cmpl %d3,%d0 480b8: 650e bcss 480c8 <_Thread_Initialize+0x23c> <== ALWAYS TAKEN return false; /* stack allocation failed */ stack = the_thread->Start.stack; 480ba: 202a 00ca movel %a2@(202),%d0 the_thread->Start.core_allocated_stack = true; 480be: 7601 moveq #1,%d3 480c0: 1543 00bc moveb %d3,%a2@(188) 480c4: 6000 fe08 braw 47ece <_Thread_Initialize+0x42> <== ALWAYS TAKEN _Thread_Stack_Free( the_thread ); return false; } 480c8: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4 if ( fp_area ) (void) _Workspace_Free( fp_area ); #endif _Thread_Stack_Free( the_thread ); return false; 480ce: 4200 clrb %d0 } 480d0: 4e5e unlk %fp 480d2: 4e75 rts 0004d19c <_Thread_Reset>: void _Thread_Reset( Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { 4d19c: 4e56 0000 linkw %fp,#0 4d1a0: 2f0a movel %a2,%sp@- 4d1a2: 246e 0008 moveal %fp@(8),%a2 the_thread->is_preemptible = the_thread->Start.is_preemptible; the_thread->budget_algorithm = the_thread->Start.budget_algorithm; the_thread->budget_callout = the_thread->Start.budget_callout; the_thread->Start.pointer_argument = pointer_argument; the_thread->Start.numeric_argument = numeric_argument; 4d1a6: 256e 0010 00a6 movel %fp@(16),%a2@(166) the_thread->resource_count = 0; #if defined(RTEMS_ITRON_API) the_thread->suspend_count = 0; #endif the_thread->is_preemptible = the_thread->Start.is_preemptible; the_thread->budget_algorithm = the_thread->Start.budget_algorithm; 4d1ac: 256a 00ac 007a movel %a2@(172),%a2@(122) the_thread->budget_callout = the_thread->Start.budget_callout; 4d1b2: 256a 00b0 007e movel %a2@(176),%a2@(126) the_thread->Start.pointer_argument = pointer_argument; 4d1b8: 256e 000c 00a2 movel %fp@(12),%a2@(162) { the_thread->resource_count = 0; #if defined(RTEMS_ITRON_API) the_thread->suspend_count = 0; #endif the_thread->is_preemptible = the_thread->Start.is_preemptible; 4d1be: 156a 00aa 0075 moveb %a2@(170),%a2@(117) Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { the_thread->resource_count = 0; 4d1c4: 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 ) ) { 4d1c8: 2f0a movel %a2,%sp@- 4d1ca: 4eb9 0004 90e0 jsr 490e0 <_Thread_queue_Extract_with_proxy> 4d1d0: 588f addql #4,%sp 4d1d2: 4a00 tstb %d0 4d1d4: 6608 bnes 4d1de <_Thread_Reset+0x42> if ( _Watchdog_Is_active( &the_thread->Timer ) ) 4d1d6: 7002 moveq #2,%d0 4d1d8: b0aa 0050 cmpl %a2@(80),%d0 4d1dc: 672a beqs 4d208 <_Thread_Reset+0x6c> (void) _Watchdog_Remove( &the_thread->Timer ); } if ( the_thread->current_priority != the_thread->Start.initial_priority ) { 4d1de: 202a 00b8 movel %a2@(184),%d0 4d1e2: b0aa 0014 cmpl %a2@(20),%d0 4d1e6: 6718 beqs 4d200 <_Thread_Reset+0x64> the_thread->real_priority = the_thread->Start.initial_priority; _Thread_Set_priority( the_thread, the_thread->Start.initial_priority ); 4d1e8: 2d4a 0008 movel %a2,%fp@(8) 4d1ec: 2d40 000c movel %d0,%fp@(12) if ( _Watchdog_Is_active( &the_thread->Timer ) ) (void) _Watchdog_Remove( &the_thread->Timer ); } if ( the_thread->current_priority != the_thread->Start.initial_priority ) { the_thread->real_priority = the_thread->Start.initial_priority; 4d1f0: 2540 0018 movel %d0,%a2@(24) _Thread_Set_priority( the_thread, the_thread->Start.initial_priority ); } } 4d1f4: 246e fffc moveal %fp@(-4),%a2 4d1f8: 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 ); 4d1fa: 4ef9 0004 9300 jmp 49300 <_Thread_Set_priority> } } 4d200: 246e fffc moveal %fp@(-4),%a2 4d204: 4e5e unlk %fp 4d206: 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 ); 4d208: 486a 0048 pea %a2@(72) 4d20c: 4eb9 0004 9d38 jsr 49d38 <_Watchdog_Remove> 4d212: 588f addql #4,%sp 4d214: 60c8 bras 4d1de <_Thread_Reset+0x42> <== ALWAYS TAKEN ... 0004c504 <_Thread_Reset_timeslice>: Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; ready = executing->ready; _ISR_Disable( level ); 4c504: 223c 0000 0700 movel #1792,%d1 4c50a: 2001 movel %d1,%d0 * ready chain * select heir */ void _Thread_Reset_timeslice( void ) { 4c50c: 4e56 fff4 linkw %fp,#-12 ISR_Level level; Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; 4c510: 2079 0005 f20e moveal 5f20e <_Thread_Executing>,%a0 * ready chain * select heir */ void _Thread_Reset_timeslice( void ) { 4c516: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ ISR_Level level; Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; ready = executing->ready; 4c51a: 2268 008a moveal %a0@(138),%a1 _ISR_Disable( level ); 4c51e: 40c2 movew %sr,%d2 4c520: 8082 orl %d2,%d0 4c522: 46c0 movew %d0,%sr if ( _Chain_Has_only_one_node( ready ) ) { 4c524: 2029 0008 movel %a1@(8),%d0 4c528: b091 cmpl %a1@,%d0 4c52a: 6752 beqs 4c57e <_Thread_Reset_timeslice+0x7a> ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 4c52c: 2450 moveal %a0@,%a2 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 4c52e: 2009 movel %a1,%d0 4c530: 5880 addql #4,%d0 { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 4c532: 2668 0004 moveal %a0@(4),%a3 next->previous = previous; previous->next = next; 4c536: 268a movel %a2,%a3@ Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 4c538: 254b 0004 movel %a3,%a2@(4) Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 4c53c: 2080 movel %d0,%a0@ old_last_node = the_chain->last; 4c53e: 2469 0008 moveal %a1@(8),%a2 the_chain->last = the_node; 4c542: 2348 0008 movel %a0,%a1@(8) old_last_node->next = the_node; the_node->previous = old_last_node; 4c546: 214a 0004 movel %a2,%a0@(4) Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; the_chain->last = the_node; old_last_node->next = the_node; 4c54a: 2488 movel %a0,%a2@ return; } _Chain_Extract_unprotected( &executing->Object.Node ); _Chain_Append_unprotected( ready, &executing->Object.Node ); _ISR_Flash( level ); 4c54c: 46c2 movew %d2,%sr 4c54e: 8282 orl %d2,%d1 4c550: 46c1 movew %d1,%sr if ( _Thread_Is_heir( executing ) ) 4c552: b1f9 0005 f1e2 cmpal 5f1e2 <_Thread_Heir>,%a0 4c558: 6712 beqs 4c56c <_Thread_Reset_timeslice+0x68> _Thread_Heir = (Thread_Control *) ready->first; _Context_Switch_necessary = true; 4c55a: 7001 moveq #1,%d0 4c55c: 13c0 0005 f21e moveb %d0,5f21e <_Context_Switch_necessary> _ISR_Enable( level ); 4c562: 46c2 movew %d2,%sr } 4c564: 4cd7 0c04 moveml %sp@,%d2/%a2-%a3 4c568: 4e5e unlk %fp 4c56a: 4e75 rts _Chain_Append_unprotected( ready, &executing->Object.Node ); _ISR_Flash( level ); if ( _Thread_Is_heir( executing ) ) _Thread_Heir = (Thread_Control *) ready->first; 4c56c: 23d1 0005 f1e2 movel %a1@,5f1e2 <_Thread_Heir> _Context_Switch_necessary = true; 4c572: 7001 moveq #1,%d0 4c574: 13c0 0005 f21e moveb %d0,5f21e <_Context_Switch_necessary> _ISR_Enable( level ); 4c57a: 46c2 movew %d2,%sr 4c57c: 60e6 bras 4c564 <_Thread_Reset_timeslice+0x60> <== ALWAYS TAKEN executing = _Thread_Executing; ready = executing->ready; _ISR_Disable( level ); if ( _Chain_Has_only_one_node( ready ) ) { _ISR_Enable( level ); 4c57e: 46c2 movew %d2,%sr _Thread_Heir = (Thread_Control *) ready->first; _Context_Switch_necessary = true; _ISR_Enable( level ); } 4c580: 4cd7 0c04 moveml %sp@,%d2/%a2-%a3 4c584: 4e5e unlk %fp 4c586: 4e75 rts 00049264 <_Thread_Restart>: Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { if ( !_States_Is_dormant( the_thread->current_state ) ) { 49264: 7001 moveq #1,%d0 bool _Thread_Restart( Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { 49266: 4e56 0000 linkw %fp,#0 4926a: 2f0a movel %a2,%sp@- 4926c: 246e 0008 moveal %fp@(8),%a2 if ( !_States_Is_dormant( the_thread->current_state ) ) { 49270: c0aa 0010 andl %a2@(16),%d0 49274: 4a00 tstb %d0 49276: 670a beqs 49282 <_Thread_Restart+0x1e> return true; } return false; } 49278: 246e fffc moveal %fp@(-4),%a2 4927c: 4e5e unlk %fp Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { if ( !_States_Is_dormant( the_thread->current_state ) ) { 4927e: 4200 clrb %d0 return true; } return false; } 49280: 4e75 rts Thread_Entry_numeric_type numeric_argument ) { if ( !_States_Is_dormant( the_thread->current_state ) ) { _Thread_Set_transient( the_thread ); 49282: 2f0a movel %a2,%sp@- 49284: 4eb9 0004 9484 jsr 49484 <_Thread_Set_transient> _Thread_Reset( the_thread, pointer_argument, numeric_argument ); 4928a: 2f2e 0010 movel %fp@(16),%sp@- 4928e: 2f2e 000c movel %fp@(12),%sp@- 49292: 2f0a movel %a2,%sp@- 49294: 4eb9 0004 d19c jsr 4d19c <_Thread_Reset> _Thread_Load_environment( the_thread ); 4929a: 2f0a movel %a2,%sp@- 4929c: 4eb9 0004 cdf0 jsr 4cdf0 <_Thread_Load_environment> _Thread_Ready( the_thread ); 492a2: 2f0a movel %a2,%sp@- 492a4: 4eb9 0004 d0dc jsr 4d0dc <_Thread_Ready> _User_extensions_Thread_restart( the_thread ); 492aa: 2f0a movel %a2,%sp@- 492ac: 4eb9 0004 9b28 jsr 49b28 <_User_extensions_Thread_restart> if ( _Thread_Is_executing ( the_thread ) ) 492b2: 4fef 001c lea %sp@(28),%sp 492b6: b5f9 0006 0166 cmpal 60166 <_Thread_Executing>,%a2 492bc: 670a beqs 492c8 <_Thread_Restart+0x64> return true; } return false; } 492be: 246e fffc moveal %fp@(-4),%a2 492c2: 4e5e unlk %fp _Thread_Ready( the_thread ); _User_extensions_Thread_restart( the_thread ); if ( _Thread_Is_executing ( the_thread ) ) 492c4: 7001 moveq #1,%d0 return true; } return false; } 492c6: 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 ) 492c8: 4aaa 0102 tstl %a2@(258) 492cc: 6712 beqs 492e0 <_Thread_Restart+0x7c> _Context_Restore_fp( &_Thread_Executing->fp_context ); 492ce: 486a 0102 pea %a2@(258) 492d2: 4eb9 0004 a08a jsr 4a08a <_CPU_Context_restore_fp> 492d8: 2479 0006 0166 moveal 60166 <_Thread_Executing>,%a2 492de: 588f addql #4,%sp #endif _CPU_Context_Restart_self( &_Thread_Executing->Registers ); 492e0: 222a 00ce movel %a2@(206),%d1 492e4: 202a 00fe movel %a2@(254),%d0 492e8: 46c1 movew %d1,%sr 492ea: 2e40 moveal %d0,%sp 492ec: 4e75 rts 492ee: 2540 00fe movel %d0,%a2@(254) <== NOT EXECUTED 492f2: 2541 00ce movel %d1,%a2@(206) <== NOT EXECUTED 492f6: 246e fffc moveal %fp@(-4),%a2 <== NOT EXECUTED 492fa: 4e5e unlk %fp <== NOT EXECUTED 492fc: 7001 moveq #1,%d0 <== NOT EXECUTED 492fe: 4e75 rts 0004c7d8 <_Thread_Resume>: { ISR_Level level; States_Control current_state; _ISR_Disable( level ); 4c7d8: 327c 0700 moveaw #1792,%a1 4c7dc: 2009 movel %a1,%d0 void _Thread_Resume( Thread_Control *the_thread, bool force ) { 4c7de: 4e56 ffec linkw %fp,#-20 4c7e2: 206e 0008 moveal %fp@(8),%a0 4c7e6: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@ ISR_Level level; States_Control current_state; _ISR_Disable( level ); 4c7ea: 40c1 movew %sr,%d1 4c7ec: 8081 orl %d1,%d0 4c7ee: 46c0 movew %d0,%sr _ISR_Enable( level ); return; } #endif current_state = the_thread->current_state; 4c7f0: 2028 0010 movel %a0@(16),%d0 if ( current_state & STATES_SUSPENDED ) { 4c7f4: 0800 0001 btst #1,%d0 4c7f8: 6774 beqs 4c86e <_Thread_Resume+0x96> <== ALWAYS TAKEN 4c7fa: 74fd moveq #-3,%d2 4c7fc: c082 andl %d2,%d0 current_state = 4c7fe: 2140 0010 movel %d0,%a0@(16) the_thread->current_state = _States_Clear(STATES_SUSPENDED, current_state); if ( _States_Is_ready( current_state ) ) { 4c802: 666a bnes 4c86e <_Thread_Resume+0x96> RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 4c804: 2868 008e moveal %a0@(142),%a4 4c808: 3028 0094 movew %a0@(148),%d0 4c80c: 3414 movew %a4@,%d2 _Priority_Add_to_bit_map( &the_thread->Priority_map ); _Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node); 4c80e: 2468 008a moveal %a0@(138),%a2 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 4c812: 260a movel %a2,%d3 4c814: 5883 addql #4,%d3 4c816: 8082 orl %d2,%d0 4c818: 2083 movel %d3,%a0@ old_last_node = the_chain->last; 4c81a: 266a 0008 moveal %a2@(8),%a3 4c81e: 3880 movew %d0,%a4@ the_chain->last = the_node; 4c820: 2548 0008 movel %a0,%a2@(8) _Priority_Major_bit_map |= the_priority_map->ready_major; 4c824: 3439 0006 4fbc movew 64fbc <_Priority_Major_bit_map>,%d2 4c82a: 3028 0092 movew %a0@(146),%d0 old_last_node->next = the_node; the_node->previous = old_last_node; 4c82e: 214b 0004 movel %a3,%a0@(4) 4c832: 8082 orl %d2,%d0 Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; the_chain->last = the_node; old_last_node->next = the_node; 4c834: 2688 movel %a0,%a3@ 4c836: 33c0 0006 4fbc movew %d0,64fbc <_Priority_Major_bit_map> _ISR_Flash( level ); 4c83c: 2009 movel %a1,%d0 4c83e: 46c1 movew %d1,%sr 4c840: 8081 orl %d1,%d0 4c842: 46c0 movew %d0,%sr if ( the_thread->current_priority < _Thread_Heir->current_priority ) { 4c844: 2028 0014 movel %a0@(20),%d0 4c848: 2279 0006 4f9a moveal 64f9a <_Thread_Heir>,%a1 4c84e: b0a9 0014 cmpl %a1@(20),%d0 4c852: 641a bccs 4c86e <_Thread_Resume+0x96> _Thread_Heir = the_thread; 4c854: 23c8 0006 4f9a movel %a0,64f9a <_Thread_Heir> if ( _Thread_Executing->is_preemptible || 4c85a: 2079 0006 4fc6 moveal 64fc6 <_Thread_Executing>,%a0 4c860: 4a28 0075 tstb %a0@(117) 4c864: 6712 beqs 4c878 <_Thread_Resume+0xa0> the_thread->current_priority == 0 ) _Context_Switch_necessary = true; 4c866: 7001 moveq #1,%d0 4c868: 13c0 0006 4fd6 moveb %d0,64fd6 <_Context_Switch_necessary> } } } _ISR_Enable( level ); 4c86e: 46c1 movew %d1,%sr } 4c870: 4cd7 1c0c moveml %sp@,%d2-%d3/%a2-%a4 4c874: 4e5e unlk %fp 4c876: 4e75 rts _ISR_Flash( level ); if ( the_thread->current_priority < _Thread_Heir->current_priority ) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 4c878: 4a80 tstl %d0 4c87a: 66f2 bnes 4c86e <_Thread_Resume+0x96> <== NEVER TAKEN the_thread->current_priority == 0 ) _Context_Switch_necessary = true; 4c87c: 7001 moveq #1,%d0 <== NOT EXECUTED 4c87e: 13c0 0006 4fd6 moveb %d0,64fd6 <_Context_Switch_necessary> <== NOT EXECUTED 4c884: 60e8 bras 4c86e <_Thread_Resume+0x96> <== NOT EXECUTED ... 0004871c <_Thread_Set_state>: { ISR_Level level; Chain_Control *ready; ready = the_thread->ready; _ISR_Disable( level ); 4871c: 203c 0000 0700 movel #1792,%d0 void _Thread_Set_state( Thread_Control *the_thread, States_Control state ) { 48722: 4e56 fff4 linkw %fp,#-12 48726: 206e 0008 moveal %fp@(8),%a0 4872a: 48d7 040c moveml %d2-%d3/%a2,%sp@ 4872e: 242e 000c movel %fp@(12),%d2 ISR_Level level; Chain_Control *ready; ready = the_thread->ready; 48732: 2268 008a moveal %a0@(138),%a1 _ISR_Disable( level ); 48736: 40c1 movew %sr,%d1 48738: 8081 orl %d1,%d0 4873a: 46c0 movew %d0,%sr if ( !_States_Is_ready( the_thread->current_state ) ) { 4873c: 2028 0010 movel %a0@(16),%d0 48740: 6640 bnes 48782 <_Thread_Set_state+0x66> return; } the_thread->current_state = state; if ( _Chain_Has_only_one_node( ready ) ) { 48742: 2029 0008 movel %a1@(8),%d0 _States_Set( state, the_thread->current_state ); _ISR_Enable( level ); return; } the_thread->current_state = state; 48746: 2142 0010 movel %d2,%a0@(16) if ( _Chain_Has_only_one_node( ready ) ) { 4874a: b091 cmpl %a1@,%d0 4874c: 6700 0096 beqw 487e4 <_Thread_Set_state+0xc8> ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 48750: 2250 moveal %a0@,%a1 previous = the_node->previous; 48752: 2468 0004 moveal %a0@(4),%a2 next->previous = previous; previous->next = next; 48756: 2489 movel %a1,%a2@ Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 48758: 234a 0004 movel %a2,%a1@(4) _Priority_Remove_from_bit_map( &the_thread->Priority_map ); } else _Chain_Extract_unprotected( &the_thread->Object.Node ); _ISR_Flash( level ); 4875c: 203c 0000 0700 movel #1792,%d0 48762: 46c1 movew %d1,%sr 48764: 8081 orl %d1,%d0 48766: 46c0 movew %d0,%sr if ( _Thread_Is_heir( the_thread ) ) 48768: b1f9 0005 f1e2 cmpal 5f1e2 <_Thread_Heir>,%a0 4876e: 672e beqs 4879e <_Thread_Set_state+0x82> _Thread_Calculate_heir(); if ( _Thread_Is_executing( the_thread ) ) 48770: b1f9 0005 f20e cmpal 5f20e <_Thread_Executing>,%a0 48776: 671a beqs 48792 <_Thread_Set_state+0x76> _Context_Switch_necessary = true; _ISR_Enable( level ); 48778: 46c1 movew %d1,%sr } 4877a: 4cd7 040c moveml %sp@,%d2-%d3/%a2 4877e: 4e5e unlk %fp 48780: 4e75 rts Chain_Control *ready; ready = the_thread->ready; _ISR_Disable( level ); if ( !_States_Is_ready( the_thread->current_state ) ) { the_thread->current_state = 48782: 8480 orl %d0,%d2 48784: 2142 0010 movel %d2,%a0@(16) _States_Set( state, the_thread->current_state ); _ISR_Enable( level ); 48788: 46c1 movew %d1,%sr if ( _Thread_Is_executing( the_thread ) ) _Context_Switch_necessary = true; _ISR_Enable( level ); } 4878a: 4cd7 040c moveml %sp@,%d2-%d3/%a2 4878e: 4e5e unlk %fp 48790: 4e75 rts if ( _Thread_Is_heir( the_thread ) ) _Thread_Calculate_heir(); if ( _Thread_Is_executing( the_thread ) ) _Context_Switch_necessary = true; 48792: 7001 moveq #1,%d0 48794: 13c0 0005 f21e moveb %d0,5f21e <_Context_Switch_necessary> _ISR_Enable( level ); 4879a: 46c1 movew %d1,%sr 4879c: 60dc bras 4877a <_Thread_Set_state+0x5e> <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE Priority_Control _Priority_Get_highest( void ) { Priority_Bit_map_control minor; Priority_Bit_map_control major; _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); 4879e: 3039 0005 f204 movew 5f204 <_Priority_Major_bit_map>,%d0 487a4: 4840 swap %d0 487a6: 04c0 ff1 %d0 _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 487a8: 4282 clrl %d2 487aa: 43f9 0005 f274 lea 5f274 <_Priority_Bit_map>,%a1 487b0: 3400 movew %d0,%d2 487b2: 3031 2a00 movew %a1@(00000000,%d2:l:2),%d0 487b6: 4840 swap %d0 487b8: 04c0 ff1 %d0 * ready thread. */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) 487ba: 4283 clrl %d3 487bc: e98a lsll #4,%d2 487be: 3600 movew %d0,%d3 487c0: 2279 0005 f100 moveal 5f100 <_Thread_Ready_chain>,%a1 487c6: 2002 movel %d2,%d0 487c8: d083 addl %d3,%d0 487ca: 2400 movel %d0,%d2 487cc: e58a lsll #2,%d2 487ce: e988 lsll #4,%d0 487d0: 93c2 subal %d2,%a1 487d2: d3c0 addal %d0,%a1 487d4: 23d1 0005 f1e2 movel %a1@,5f1e2 <_Thread_Heir> _ISR_Flash( level ); if ( _Thread_Is_heir( the_thread ) ) _Thread_Calculate_heir(); if ( _Thread_Is_executing( the_thread ) ) 487da: b1f9 0005 f20e cmpal 5f20e <_Thread_Executing>,%a0 487e0: 6696 bnes 48778 <_Thread_Set_state+0x5c> 487e2: 60ae bras 48792 <_Thread_Set_state+0x76> <== ALWAYS TAKEN */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 487e4: 2009 movel %a1,%d0 487e6: 5880 addql #4,%d0 RTEMS_INLINE_ROUTINE void _Priority_Remove_from_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor &= the_priority_map->block_minor; 487e8: 2468 008e moveal %a0@(142),%a2 487ec: 2280 movel %d0,%a1@ 487ee: 3412 movew %a2@,%d2 487f0: 3028 0098 movew %a0@(152),%d0 the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 487f4: 2349 0008 movel %a1,%a1@(8) 487f8: c082 andl %d2,%d0 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 487fa: 42a9 0004 clrl %a1@(4) 487fe: 3480 movew %d0,%a2@ the_thread->current_state = state; if ( _Chain_Has_only_one_node( ready ) ) { _Chain_Initialize_empty( ready ); _Priority_Remove_from_bit_map( &the_thread->Priority_map ); 48800: 6600 ff5a bnew 4875c <_Thread_Set_state+0x40> if ( *the_priority_map->minor == 0 ) _Priority_Major_bit_map &= the_priority_map->block_major; 48804: 3439 0005 f204 movew 5f204 <_Priority_Major_bit_map>,%d2 4880a: 3028 0096 movew %a0@(150),%d0 4880e: c082 andl %d2,%d0 48810: 33c0 0005 f204 movew %d0,5f204 <_Priority_Major_bit_map> } else _Chain_Extract_unprotected( &the_thread->Object.Node ); _ISR_Flash( level ); 48816: 203c 0000 0700 movel #1792,%d0 4881c: 46c1 movew %d1,%sr 4881e: 8081 orl %d1,%d0 48820: 46c0 movew %d0,%sr if ( _Thread_Is_heir( the_thread ) ) 48822: b1f9 0005 f1e2 cmpal 5f1e2 <_Thread_Heir>,%a0 48828: 6600 ff46 bnew 48770 <_Thread_Set_state+0x54> <== ALWAYS TAKEN 4882c: 6000 ff70 braw 4879e <_Thread_Set_state+0x82> <== ALWAYS TAKEN 000489f4 <_Thread_Suspend>: { ISR_Level level; Chain_Control *ready; ready = the_thread->ready; _ISR_Disable( level ); 489f4: 203c 0000 0700 movel #1792,%d0 */ void _Thread_Suspend( Thread_Control *the_thread ) { 489fa: 4e56 fff4 linkw %fp,#-12 489fe: 206e 0008 moveal %fp@(8),%a0 48a02: 48d7 040c moveml %d2-%d3/%a2,%sp@ ISR_Level level; Chain_Control *ready; ready = the_thread->ready; 48a06: 2268 008a moveal %a0@(138),%a1 _ISR_Disable( level ); 48a0a: 40c1 movew %sr,%d1 48a0c: 8081 orl %d1,%d0 48a0e: 46c0 movew %d0,%sr #if defined(RTEMS_ITRON_API) the_thread->suspend_count++; #endif if ( !_States_Is_ready( the_thread->current_state ) ) { 48a10: 2028 0010 movel %a0@(16),%d0 48a14: 6642 bnes 48a58 <_Thread_Suspend+0x64> _States_Set( STATES_SUSPENDED, the_thread->current_state ); _ISR_Enable( level ); return; } the_thread->current_state = STATES_SUSPENDED; 48a16: 7002 moveq #2,%d0 if ( _Chain_Has_only_one_node( ready ) ) { 48a18: 2429 0008 movel %a1@(8),%d2 _States_Set( STATES_SUSPENDED, the_thread->current_state ); _ISR_Enable( level ); return; } the_thread->current_state = STATES_SUSPENDED; 48a1c: 2140 0010 movel %d0,%a0@(16) if ( _Chain_Has_only_one_node( ready ) ) { 48a20: b491 cmpl %a1@,%d2 48a22: 6700 0098 beqw 48abc <_Thread_Suspend+0xc8> ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 48a26: 2250 moveal %a0@,%a1 previous = the_node->previous; 48a28: 2468 0004 moveal %a0@(4),%a2 next->previous = previous; previous->next = next; 48a2c: 2489 movel %a1,%a2@ Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 48a2e: 234a 0004 movel %a2,%a1@(4) _Priority_Remove_from_bit_map( &the_thread->Priority_map ); } else _Chain_Extract_unprotected( &the_thread->Object.Node ); _ISR_Flash( level ); 48a32: 203c 0000 0700 movel #1792,%d0 48a38: 46c1 movew %d1,%sr 48a3a: 8081 orl %d1,%d0 48a3c: 46c0 movew %d0,%sr if ( _Thread_Is_heir( the_thread ) ) 48a3e: b1f9 0005 f1e2 cmpal 5f1e2 <_Thread_Heir>,%a0 48a44: 6730 beqs 48a76 <_Thread_Suspend+0x82> _Thread_Calculate_heir(); if ( _Thread_Is_executing( the_thread ) ) 48a46: b1f9 0005 f20e cmpal 5f20e <_Thread_Executing>,%a0 48a4c: 671c beqs 48a6a <_Thread_Suspend+0x76> <== ALWAYS TAKEN _Context_Switch_necessary = true; _ISR_Enable( level ); 48a4e: 46c1 movew %d1,%sr } 48a50: 4cd7 040c moveml %sp@,%d2-%d3/%a2 48a54: 4e5e unlk %fp 48a56: 4e75 rts _ISR_Disable( level ); #if defined(RTEMS_ITRON_API) the_thread->suspend_count++; #endif if ( !_States_Is_ready( the_thread->current_state ) ) { the_thread->current_state = 48a58: 7402 moveq #2,%d2 48a5a: 8480 orl %d0,%d2 48a5c: 2142 0010 movel %d2,%a0@(16) _States_Set( STATES_SUSPENDED, the_thread->current_state ); _ISR_Enable( level ); 48a60: 46c1 movew %d1,%sr if ( _Thread_Is_executing( the_thread ) ) _Context_Switch_necessary = true; _ISR_Enable( level ); } 48a62: 4cd7 040c moveml %sp@,%d2-%d3/%a2 48a66: 4e5e unlk %fp 48a68: 4e75 rts if ( _Thread_Is_heir( the_thread ) ) _Thread_Calculate_heir(); if ( _Thread_Is_executing( the_thread ) ) _Context_Switch_necessary = true; 48a6a: 7401 moveq #1,%d2 48a6c: 13c2 0005 f21e moveb %d2,5f21e <_Context_Switch_necessary> _ISR_Enable( level ); 48a72: 46c1 movew %d1,%sr 48a74: 60da bras 48a50 <_Thread_Suspend+0x5c> <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE Priority_Control _Priority_Get_highest( void ) { Priority_Bit_map_control minor; Priority_Bit_map_control major; _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); 48a76: 3039 0005 f204 movew 5f204 <_Priority_Major_bit_map>,%d0 48a7c: 4840 swap %d0 48a7e: 04c0 ff1 %d0 _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 48a80: 4282 clrl %d2 48a82: 43f9 0005 f274 lea 5f274 <_Priority_Bit_map>,%a1 48a88: 3400 movew %d0,%d2 48a8a: 3031 2a00 movew %a1@(00000000,%d2:l:2),%d0 48a8e: 4840 swap %d0 48a90: 04c0 ff1 %d0 48a92: 4283 clrl %d3 48a94: e98a lsll #4,%d2 48a96: 3600 movew %d0,%d3 48a98: 2279 0005 f100 moveal 5f100 <_Thread_Ready_chain>,%a1 48a9e: 2002 movel %d2,%d0 48aa0: d083 addl %d3,%d0 48aa2: 2400 movel %d0,%d2 48aa4: e58a lsll #2,%d2 48aa6: e988 lsll #4,%d0 48aa8: 93c2 subal %d2,%a1 48aaa: d3c0 addal %d0,%a1 48aac: 23d1 0005 f1e2 movel %a1@,5f1e2 <_Thread_Heir> _ISR_Flash( level ); if ( _Thread_Is_heir( the_thread ) ) _Thread_Calculate_heir(); if ( _Thread_Is_executing( the_thread ) ) 48ab2: b1f9 0005 f20e cmpal 5f20e <_Thread_Executing>,%a0 48ab8: 6694 bnes 48a4e <_Thread_Suspend+0x5a> <== ALWAYS TAKEN 48aba: 60ae bras 48a6a <_Thread_Suspend+0x76> <== ALWAYS TAKEN */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 48abc: 2009 movel %a1,%d0 48abe: 5880 addql #4,%d0 RTEMS_INLINE_ROUTINE void _Priority_Remove_from_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor &= the_priority_map->block_minor; 48ac0: 2468 008e moveal %a0@(142),%a2 48ac4: 2280 movel %d0,%a1@ 48ac6: 3412 movew %a2@,%d2 48ac8: 3028 0098 movew %a0@(152),%d0 the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 48acc: 2349 0008 movel %a1,%a1@(8) 48ad0: c082 andl %d2,%d0 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 48ad2: 42a9 0004 clrl %a1@(4) 48ad6: 3480 movew %d0,%a2@ the_thread->current_state = STATES_SUSPENDED; if ( _Chain_Has_only_one_node( ready ) ) { _Chain_Initialize_empty( ready ); _Priority_Remove_from_bit_map( &the_thread->Priority_map ); 48ad8: 6600 ff58 bnew 48a32 <_Thread_Suspend+0x3e> if ( *the_priority_map->minor == 0 ) _Priority_Major_bit_map &= the_priority_map->block_major; 48adc: 3439 0005 f204 movew 5f204 <_Priority_Major_bit_map>,%d2 48ae2: 3028 0096 movew %a0@(150),%d0 48ae6: c082 andl %d2,%d0 48ae8: 33c0 0005 f204 movew %d0,5f204 <_Priority_Major_bit_map> } else _Chain_Extract_unprotected( &the_thread->Object.Node ); _ISR_Flash( level ); 48aee: 203c 0000 0700 movel #1792,%d0 48af4: 46c1 movew %d1,%sr 48af6: 8081 orl %d1,%d0 48af8: 46c0 movew %d0,%sr if ( _Thread_Is_heir( the_thread ) ) 48afa: b1f9 0005 f1e2 cmpal 5f1e2 <_Thread_Heir>,%a0 48b00: 6600 ff44 bnew 48a46 <_Thread_Suspend+0x52> <== ALWAYS TAKEN 48b04: 6000 ff70 braw 48a76 <_Thread_Suspend+0x82> <== ALWAYS TAKEN 00048b08 <_Thread_Tickle_timeslice>: * * Output parameters: NONE */ void _Thread_Tickle_timeslice( void ) { 48b08: 4e56 0000 linkw %fp,#0 48b0c: 2f0a movel %a2,%sp@- Thread_Control *executing; executing = _Thread_Executing; 48b0e: 2479 0005 f20e moveal 5f20e <_Thread_Executing>,%a2 /* * If the thread is not preemptible or is not ready, then * just return. */ if ( !executing->is_preemptible ) 48b14: 4a2a 0075 tstb %a2@(117) 48b18: 6720 beqs 48b3a <_Thread_Tickle_timeslice+0x32> return; if ( !_States_Is_ready( executing->current_state ) ) 48b1a: 4aaa 0010 tstl %a2@(16) 48b1e: 661a bnes 48b3a <_Thread_Tickle_timeslice+0x32> /* * The cpu budget algorithm determines what happens next. */ switch ( executing->budget_algorithm ) { 48b20: 202a 007a movel %a2@(122),%d0 48b24: 7201 moveq #1,%d1 48b26: b280 cmpl %d0,%d1 48b28: 6210 bhis 48b3a <_Thread_Tickle_timeslice+0x32> 48b2a: 123c 0002 moveb #2,%d1 48b2e: b280 cmpl %d0,%d1 48b30: 642e bccs 48b60 <_Thread_Tickle_timeslice+0x58> 48b32: 123c 0003 moveb #3,%d1 48b36: b280 cmpl %d0,%d1 48b38: 6708 beqs 48b42 <_Thread_Tickle_timeslice+0x3a> <== NEVER TAKEN if ( --executing->cpu_time_budget == 0 ) (*executing->budget_callout)( executing ); break; #endif } } 48b3a: 246e fffc moveal %fp@(-4),%a2 48b3e: 4e5e unlk %fp 48b40: 4e75 rts } break; #if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT) case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: if ( --executing->cpu_time_budget == 0 ) 48b42: 202a 0076 movel %a2@(118),%d0 48b46: 5380 subql #1,%d0 48b48: 2540 0076 movel %d0,%a2@(118) 48b4c: 66ec bnes 48b3a <_Thread_Tickle_timeslice+0x32> (*executing->budget_callout)( executing ); 48b4e: 2f0a movel %a2,%sp@- 48b50: 206a 007e moveal %a2@(126),%a0 48b54: 4e90 jsr %a0@ break; #endif } } 48b56: 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 ); 48b5a: 588f addql #4,%sp break; #endif } } 48b5c: 4e5e unlk %fp 48b5e: 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 ) { 48b60: 202a 0076 movel %a2@(118),%d0 48b64: 5380 subql #1,%d0 48b66: 2540 0076 movel %d0,%a2@(118) 48b6a: 6ece bgts 48b3a <_Thread_Tickle_timeslice+0x32> _Thread_Reset_timeslice(); 48b6c: 4eb9 0004 c504 jsr 4c504 <_Thread_Reset_timeslice> executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 48b72: 41f9 0005 f104 lea 5f104 <_Thread_Ticks_per_timeslice>,%a0 48b78: 2550 0076 movel %a0@,%a2@(118) if ( --executing->cpu_time_budget == 0 ) (*executing->budget_callout)( executing ); break; #endif } } 48b7c: 246e fffc moveal %fp@(-4),%a2 48b80: 4e5e unlk %fp 48b82: 4e75 rts 00048b84 <_Thread_Yield_processor>: * ready chain * select heir */ void _Thread_Yield_processor( void ) { 48b84: 4e56 fff4 linkw %fp,#-12 ISR_Level level; Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; 48b88: 2079 0005 f20e moveal 5f20e <_Thread_Executing>,%a0 * ready chain * select heir */ void _Thread_Yield_processor( void ) { 48b8e: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; ready = executing->ready; _ISR_Disable( level ); 48b92: 243c 0000 0700 movel #1792,%d2 48b98: 2002 movel %d2,%d0 ISR_Level level; Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; ready = executing->ready; 48b9a: 2268 008a moveal %a0@(138),%a1 _ISR_Disable( level ); 48b9e: 40c1 movew %sr,%d1 48ba0: 8081 orl %d1,%d0 48ba2: 46c0 movew %d0,%sr if ( !_Chain_Has_only_one_node( ready ) ) { 48ba4: 2029 0008 movel %a1@(8),%d0 48ba8: b091 cmpl %a1@,%d0 48baa: 6750 beqs 48bfc <_Thread_Yield_processor+0x78> ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 48bac: 2450 moveal %a0@,%a2 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 48bae: 2009 movel %a1,%d0 48bb0: 5880 addql #4,%d0 { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 48bb2: 2668 0004 moveal %a0@(4),%a3 next->previous = previous; previous->next = next; 48bb6: 268a movel %a2,%a3@ Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 48bb8: 254b 0004 movel %a3,%a2@(4) Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 48bbc: 2080 movel %d0,%a0@ old_last_node = the_chain->last; 48bbe: 2469 0008 moveal %a1@(8),%a2 the_chain->last = the_node; 48bc2: 2348 0008 movel %a0,%a1@(8) old_last_node->next = the_node; the_node->previous = old_last_node; 48bc6: 214a 0004 movel %a2,%a0@(4) Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; the_chain->last = the_node; old_last_node->next = the_node; 48bca: 2488 movel %a0,%a2@ _Chain_Extract_unprotected( &executing->Object.Node ); _Chain_Append_unprotected( ready, &executing->Object.Node ); _ISR_Flash( level ); 48bcc: 46c1 movew %d1,%sr 48bce: 8481 orl %d1,%d2 48bd0: 46c2 movew %d2,%sr if ( _Thread_Is_heir( executing ) ) 48bd2: b1f9 0005 f1e2 cmpal 5f1e2 <_Thread_Heir>,%a0 48bd8: 6712 beqs 48bec <_Thread_Yield_processor+0x68> <== NEVER TAKEN _Thread_Heir = (Thread_Control *) ready->first; _Context_Switch_necessary = true; } else if ( !_Thread_Is_heir( executing ) ) _Context_Switch_necessary = true; 48bda: 7001 moveq #1,%d0 <== NOT EXECUTED 48bdc: 13c0 0005 f21e moveb %d0,5f21e <_Context_Switch_necessary> <== NOT EXECUTED _ISR_Enable( level ); 48be2: 46c1 movew %d1,%sr } 48be4: 4cd7 0c04 moveml %sp@,%d2/%a2-%a3 48be8: 4e5e unlk %fp 48bea: 4e75 rts _Chain_Append_unprotected( ready, &executing->Object.Node ); _ISR_Flash( level ); if ( _Thread_Is_heir( executing ) ) _Thread_Heir = (Thread_Control *) ready->first; 48bec: 23d1 0005 f1e2 movel %a1@,5f1e2 <_Thread_Heir> _Context_Switch_necessary = true; } else if ( !_Thread_Is_heir( executing ) ) _Context_Switch_necessary = true; 48bf2: 7001 moveq #1,%d0 48bf4: 13c0 0005 f21e moveb %d0,5f21e <_Context_Switch_necessary> 48bfa: 60e6 bras 48be2 <_Thread_Yield_processor+0x5e> <== ALWAYS TAKEN if ( _Thread_Is_heir( executing ) ) _Thread_Heir = (Thread_Control *) ready->first; _Context_Switch_necessary = true; } else if ( !_Thread_Is_heir( executing ) ) 48bfc: b1f9 0005 f1e2 cmpal 5f1e2 <_Thread_Heir>,%a0 48c02: 67de beqs 48be2 <_Thread_Yield_processor+0x5e> <== NEVER TAKEN _Context_Switch_necessary = true; 48c04: 7001 moveq #1,%d0 <== NOT EXECUTED 48c06: 13c0 0005 f21e moveb %d0,5f21e <_Context_Switch_necessary> <== NOT EXECUTED 48c0c: 60d4 bras 48be2 <_Thread_Yield_processor+0x5e> <== NOT EXECUTED ... 0004821c <_Thread_queue_Dequeue_priority>: Chain_Node *new_second_node; Chain_Node *last_node; Chain_Node *next_node; Chain_Node *previous_node; _ISR_Disable( level ); 4821c: 203c 0000 0700 movel #1792,%d0 */ Thread_Control *_Thread_queue_Dequeue_priority( Thread_queue_Control *the_thread_queue ) { 48222: 4e56 ffec linkw %fp,#-20 48226: 226e 0008 moveal %fp@(8),%a1 4822a: 48d7 3c04 moveml %d2/%a2-%a5,%sp@ Chain_Node *new_second_node; Chain_Node *last_node; Chain_Node *next_node; Chain_Node *previous_node; _ISR_Disable( level ); 4822e: 40c2 movew %sr,%d2 48230: 8082 orl %d2,%d0 48232: 46c0 movew %d0,%sr 48234: 4280 clrl %d0 48236: 2049 moveal %a1,%a0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 48238: 2208 movel %a0,%d1 4823a: 5881 addql #4,%d1 4823c: b290 cmpl %a0@,%d1 4823e: 661c bnes 4825c <_Thread_queue_Dequeue_priority+0x40> for( index=0 ; index < TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS ; index++ ) { 48240: 5280 addql #1,%d0 48242: 41e8 000c lea %a0@(12),%a0 Chain_Node *last_node; Chain_Node *next_node; Chain_Node *previous_node; _ISR_Disable( level ); for( index=0 ; 48246: 7204 moveq #4,%d1 48248: b280 cmpl %d0,%d1 4824a: 66ec bnes 48238 <_Thread_queue_Dequeue_priority+0x1c> } /* * We did not find a thread to unblock. */ _ISR_Enable( level ); 4824c: 46c2 movew %d2,%sr 4824e: 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 ); } 48250: 200a movel %a2,%d0 48252: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 48258: 4e5e unlk %fp 4825a: 4e75 rts _ISR_Disable( level ); for( index=0 ; index < TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS ; index++ ) { if ( !_Chain_Is_empty( &the_thread_queue->Queues.Priority[ index ] ) ) { the_thread = (Thread_Control *) 4825c: 2200 movel %d0,%d1 4825e: e588 lsll #2,%d0 48260: e989 lsll #4,%d1 48262: 9280 subl %d0,%d1 48264: 2471 1800 moveal %a1@(00000000,%d1:l),%a2 48268: 200a movel %a2,%d0 4826a: 0680 0000 003c addil #60,%d0 _ISR_Enable( level ); return NULL; dequeue: the_thread->Wait.queue = NULL; new_first_node = the_thread->Wait.Block2n.first; 48270: 206a 0038 moveal %a2@(56),%a0 new_first_thread = (Thread_Control *) new_first_node; next_node = the_thread->Object.Node.next; 48274: 2652 moveal %a2@,%a3 previous_node = the_thread->Object.Node.previous; 48276: 226a 0004 moveal %a2@(4),%a1 */ _ISR_Enable( level ); return NULL; dequeue: the_thread->Wait.queue = NULL; 4827a: 42aa 0044 clrl %a2@(68) 4827e: b088 cmpl %a0,%d0 48280: 6700 008a beqw 4830c <_Thread_queue_Dequeue_priority+0xf0> 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 ) ) { last_node = the_thread->Wait.Block2n.last; 48284: 286a 0040 moveal %a2@(64),%a4 new_second_node = new_first_node->next; 48288: 2a50 moveal %a0@,%a5 previous_node->next = new_first_node; next_node->previous = new_first_node; 4828a: 2748 0004 movel %a0,%a3@(4) if ( !_Chain_Is_empty( &the_thread->Wait.Block2n ) ) { last_node = the_thread->Wait.Block2n.last; new_second_node = new_first_node->next; previous_node->next = new_first_node; 4828e: 2288 movel %a0,%a1@ next_node->previous = new_first_node; new_first_node->next = next_node; new_first_node->previous = previous_node; 48290: 2149 0004 movel %a1,%a0@(4) last_node = the_thread->Wait.Block2n.last; new_second_node = new_first_node->next; previous_node->next = new_first_node; next_node->previous = new_first_node; new_first_node->next = next_node; 48294: 208b movel %a3,%a0@ new_first_node->previous = previous_node; if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) { 48296: 226a 0040 moveal %a2@(64),%a1 4829a: b3ea 0038 cmpal %a2@(56),%a1 4829e: 6716 beqs 482b6 <_Thread_queue_Dequeue_priority+0x9a> /* > two threads on 2-n */ new_second_node->previous = 482a0: 43e8 0038 lea %a0@(56),%a1 482a4: 2b49 0004 movel %a1,%a5@(4) _Chain_Head( &new_first_thread->Wait.Block2n ); new_first_thread->Wait.Block2n.first = new_second_node; 482a8: 214d 0038 movel %a5,%a0@(56) new_first_thread->Wait.Block2n.last = last_node; 482ac: 214c 0040 movel %a4,%a0@(64) last_node->next = _Chain_Tail( &new_first_thread->Wait.Block2n ); 482b0: 41e8 003c lea %a0@(60),%a0 482b4: 2888 movel %a0,%a4@ } else { previous_node->next = next_node; next_node->previous = previous_node; } if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 482b6: 7002 moveq #2,%d0 482b8: b0aa 0050 cmpl %a2@(80),%d0 482bc: 671e beqs 482dc <_Thread_queue_Dequeue_priority+0xc0> _ISR_Enable( level ); 482be: 46c2 movew %d2,%sr RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 482c0: 2f3c 1003 fff8 movel #268697592,%sp@- 482c6: 2f0a movel %a2,%sp@- 482c8: 4eb9 0004 79f4 jsr 479f4 <_Thread_Clear_state> 482ce: 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 ); } 482d0: 200a movel %a2,%d0 482d2: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 482d8: 4e5e unlk %fp 482da: 4e75 rts RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 482dc: 7203 moveq #3,%d1 482de: 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 ); 482e2: 46c2 movew %d2,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 482e4: 486a 0048 pea %a2@(72) 482e8: 4eb9 0004 90a0 jsr 490a0 <_Watchdog_Remove> 482ee: 2f3c 1003 fff8 movel #268697592,%sp@- 482f4: 2f0a movel %a2,%sp@- 482f6: 4eb9 0004 79f4 jsr 479f4 <_Thread_Clear_state> 482fc: 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 ); } 48300: 200a movel %a2,%d0 48302: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 48308: 4e5e unlk %fp 4830a: 4e75 rts last_node->next = _Chain_Tail( &new_first_thread->Wait.Block2n ); } } else { previous_node->next = next_node; next_node->previous = previous_node; 4830c: 2749 0004 movel %a1,%a3@(4) new_first_thread->Wait.Block2n.last = last_node; last_node->next = _Chain_Tail( &new_first_thread->Wait.Block2n ); } } else { previous_node->next = next_node; 48310: 228b movel %a3,%a1@ 48312: 60a2 bras 482b6 <_Thread_queue_Dequeue_priority+0x9a> <== ALWAYS TAKEN 000483b0 <_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 ) { 483b0: 4e56 ffe4 linkw %fp,#-28 483b4: 48d7 1c3c moveml %d2-%d5/%a2-%a4,%sp@ 483b8: 266e 000c moveal %fp@(12),%a3 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 483bc: 41eb 003c lea %a3@(60),%a0 return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); 483c0: 263c 0000 0700 movel #1792,%d3 Priority_Control priority; States_Control block_state; _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; 483c6: 222b 0014 movel %a3@(20),%d1 header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; 483ca: 2401 movel %d1,%d2 483cc: ec8a lsrl #6,%d2 483ce: 2002 movel %d2,%d0 483d0: e58a lsll #2,%d2 483d2: e988 lsll #4,%d0 Thread_blocking_operation_States _Thread_queue_Enqueue_priority ( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, ISR_Level *level_p ) { 483d4: 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 ]; 483d8: 9082 subl %d2,%d0 483da: 45f4 0800 lea %a4@(00000000,%d0:l),%a2 483de: 2748 0038 movel %a0,%a3@(56) the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 483e2: 41eb 0038 lea %a3@(56),%a0 block_state = the_thread_queue->state; 483e6: 242c 0038 movel %a4@(56),%d2 483ea: 2748 0040 movel %a0,%a3@(64) RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 483ee: 42ab 003c clrl %a3@(60) if ( _Thread_queue_Is_reverse_search( priority ) ) 483f2: 0801 0005 btst #5,%d1 483f6: 6656 bnes 4844e <_Thread_queue_Enqueue_priority+0x9e> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 483f8: 2a0a movel %a2,%d5 goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); 483fa: 2803 movel %d3,%d4 483fc: 5885 addql #4,%d5 483fe: 2004 movel %d4,%d0 48400: 40c3 movew %sr,%d3 48402: 8083 orl %d3,%d0 48404: 46c0 movew %d0,%sr search_thread = (Thread_Control *) header->first; 48406: 2052 moveal %a2@,%a0 while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 48408: ba88 cmpl %a0,%d5 4840a: 6700 010a beqw 48516 <_Thread_queue_Enqueue_priority+0x166> search_priority = search_thread->current_priority; 4840e: 2268 0014 moveal %a0@(20),%a1 if ( priority <= search_priority ) 48412: b3c1 cmpal %d1,%a1 48414: 6418 bccs 4842e <_Thread_queue_Enqueue_priority+0x7e> break; search_priority = search_thread->current_priority; if ( priority <= search_priority ) break; #endif _ISR_Flash( level ); 48416: 2004 movel %d4,%d0 48418: 46c3 movew %d3,%sr 4841a: 8083 orl %d3,%d0 4841c: 46c0 movew %d0,%sr if ( !_States_Are_set( search_thread->current_state, block_state) ) { 4841e: 2002 movel %d2,%d0 48420: c0a8 0010 andl %a0@(16),%d0 48424: 6700 0092 beqw 484b8 <_Thread_queue_Enqueue_priority+0x108> <== ALWAYS TAKEN _ISR_Enable( level ); goto restart_forward_search; } search_thread = (Thread_Control *)search_thread->Object.Node.next; 48428: 2050 moveal %a0@,%a0 restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); search_thread = (Thread_Control *) header->first; while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 4842a: ba88 cmpl %a0,%d5 4842c: 66e0 bnes 4840e <_Thread_queue_Enqueue_priority+0x5e> 4842e: 2403 movel %d3,%d2 } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 48430: 7001 moveq #1,%d0 48432: b0ac 0030 cmpl %a4@(48),%d0 48436: 6700 0094 beqw 484cc <_Thread_queue_Enqueue_priority+0x11c> <== NEVER TAKEN * 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; 4843a: 206e 0010 moveal %fp@(16),%a0 return the_thread_queue->sync_state; 4843e: 202c 0030 movel %a4@(48),%d0 * For example, the blocking thread could have been given * the mutex by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ *level_p = level; 48442: 2082 movel %d2,%a0@ return the_thread_queue->sync_state; } 48444: 4cd7 1c3c moveml %sp@,%d2-%d5/%a2-%a4 48448: 4e5e unlk %fp 4844a: 4e75 rts if ( priority >= search_priority ) break; #endif _ISR_Flash( level ); if ( !_States_Are_set( search_thread->current_state, block_state) ) { _ISR_Enable( level ); 4844c: 46c4 movew %d4,%sr the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 4844e: 4284 clrl %d4 48450: 1839 0005 d9a2 moveb 5d9a2 ,%d4 _ISR_Disable( level ); 48456: 2003 movel %d3,%d0 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 48458: 2244 moveal %d4,%a1 4845a: 5289 addql #1,%a1 _ISR_Disable( level ); 4845c: 40c4 movew %sr,%d4 4845e: 8084 orl %d4,%d0 48460: 46c0 movew %d0,%sr search_thread = (Thread_Control *) header->last; 48462: 206a 0008 moveal %a2@(8),%a0 while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 48466: b5c8 cmpal %a0,%a2 48468: 6720 beqs 4848a <_Thread_queue_Enqueue_priority+0xda> search_priority = search_thread->current_priority; 4846a: 2268 0014 moveal %a0@(20),%a1 if ( priority >= search_priority ) 4846e: b3c1 cmpal %d1,%a1 48470: 6318 blss 4848a <_Thread_queue_Enqueue_priority+0xda> break; search_priority = search_thread->current_priority; if ( priority >= search_priority ) break; #endif _ISR_Flash( level ); 48472: 2003 movel %d3,%d0 48474: 46c4 movew %d4,%sr 48476: 8084 orl %d4,%d0 48478: 46c0 movew %d0,%sr if ( !_States_Are_set( search_thread->current_state, block_state) ) { 4847a: 2002 movel %d2,%d0 4847c: c0a8 0010 andl %a0@(16),%d0 48480: 67ca beqs 4844c <_Thread_queue_Enqueue_priority+0x9c> _ISR_Enable( level ); goto restart_reverse_search; } search_thread = (Thread_Control *) 48482: 2068 0004 moveal %a0@(4),%a0 restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); search_thread = (Thread_Control *) header->last; while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 48486: b5c8 cmpal %a0,%a2 48488: 66e0 bnes 4846a <_Thread_queue_Enqueue_priority+0xba> 4848a: 2404 movel %d4,%d2 } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 4848c: 7001 moveq #1,%d0 4848e: b0ac 0030 cmpl %a4@(48),%d0 48492: 66a6 bnes 4843a <_Thread_queue_Enqueue_priority+0x8a> THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 48494: 42ac 0030 clrl %a4@(48) if ( priority == search_priority ) 48498: b3c1 cmpal %d1,%a1 4849a: 6756 beqs 484f2 <_Thread_queue_Enqueue_priority+0x142> goto equal_priority; search_node = (Chain_Node *) search_thread; next_node = search_node->next; 4849c: 2250 moveal %a0@,%a1 the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; 4849e: 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; 484a2: 2689 movel %a1,%a3@ the_node->previous = search_node; search_node->next = the_node; next_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 484a4: 274c 0044 movel %a4,%a3@(68) next_node = search_node->next; the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; search_node->next = the_node; 484a8: 208b movel %a3,%a0@ next_node->previous = the_node; 484aa: 234b 0004 movel %a3,%a1@(4) the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 484ae: 46c4 movew %d4,%sr * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; } 484b0: 4cd7 1c3c moveml %sp@,%d2-%d5/%a2-%a4 484b4: 4e5e unlk %fp 484b6: 4e75 rts if ( priority <= search_priority ) break; #endif _ISR_Flash( level ); if ( !_States_Are_set( search_thread->current_state, block_state) ) { _ISR_Enable( level ); 484b8: 46c3 movew %d3,%sr <== NOT EXECUTED if ( _Thread_queue_Is_reverse_search( priority ) ) goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); 484ba: 2004 movel %d4,%d0 <== NOT EXECUTED 484bc: 40c3 movew %sr,%d3 <== NOT EXECUTED 484be: 8083 orl %d3,%d0 <== NOT EXECUTED 484c0: 46c0 movew %d0,%sr <== NOT EXECUTED search_thread = (Thread_Control *) header->first; 484c2: 2052 moveal %a2@,%a0 <== NOT EXECUTED while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 484c4: ba88 cmpl %a0,%d5 <== NOT EXECUTED 484c6: 6600 ff46 bnew 4840e <_Thread_queue_Enqueue_priority+0x5e> <== NOT EXECUTED 484ca: 604a bras 48516 <_Thread_queue_Enqueue_priority+0x166> <== NOT EXECUTED if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 484cc: 42ac 0030 clrl %a4@(48) if ( priority == search_priority ) 484d0: b3c1 cmpal %d1,%a1 484d2: 671e beqs 484f2 <_Thread_queue_Enqueue_priority+0x142> goto equal_priority; search_node = (Chain_Node *) search_thread; previous_node = search_node->previous; 484d4: 2268 0004 moveal %a0@(4),%a1 the_node = (Chain_Node *) the_thread; the_node->next = search_node; 484d8: 2688 movel %a0,%a3@ the_node->previous = previous_node; 484da: 2749 0004 movel %a1,%a3@(4) previous_node->next = the_node; search_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 484de: 274c 0044 movel %a4,%a3@(68) previous_node = search_node->previous; the_node = (Chain_Node *) the_thread; the_node->next = search_node; the_node->previous = previous_node; previous_node->next = the_node; 484e2: 228b movel %a3,%a1@ search_node->previous = the_node; 484e4: 214b 0004 movel %a3,%a0@(4) the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 484e8: 46c3 movew %d3,%sr * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; } 484ea: 4cd7 1c3c moveml %sp@,%d2-%d5/%a2-%a4 484ee: 4e5e unlk %fp 484f0: 4e75 rts 484f2: 41e8 003c lea %a0@(60),%a0 _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; equal_priority: /* add at end of priority group */ search_node = _Chain_Tail( &search_thread->Wait.Block2n ); previous_node = search_node->previous; 484f6: 2268 0004 moveal %a0@(4),%a1 the_node = (Chain_Node *) the_thread; the_node->next = search_node; 484fa: 2688 movel %a0,%a3@ the_node->previous = previous_node; 484fc: 2749 0004 movel %a1,%a3@(4) previous_node->next = the_node; search_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 48500: 274c 0044 movel %a4,%a3@(68) previous_node = search_node->previous; the_node = (Chain_Node *) the_thread; the_node->next = search_node; the_node->previous = previous_node; previous_node->next = the_node; 48504: 228b movel %a3,%a1@ search_node->previous = the_node; 48506: 214b 0004 movel %a3,%a0@(4) the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 4850a: 46c2 movew %d2,%sr 4850c: 7001 moveq #1,%d0 * * WARNING! Returning with interrupts disabled! */ *level_p = level; return the_thread_queue->sync_state; } 4850e: 4cd7 1c3c moveml %sp@,%d2-%d5/%a2-%a4 48512: 4e5e unlk %fp 48514: 4e75 rts restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); search_thread = (Thread_Control *) header->first; while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 48516: 2403 movel %d3,%d2 48518: 327c ffff moveaw #-1,%a1 } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 4851c: 7001 moveq #1,%d0 4851e: b0ac 0030 cmpl %a4@(48),%d0 48522: 6600 ff16 bnew 4843a <_Thread_queue_Enqueue_priority+0x8a> 48526: 60a4 bras 484cc <_Thread_queue_Enqueue_priority+0x11c> <== ALWAYS TAKEN 00048314 <_Thread_queue_Enqueue_with_handler>: void _Thread_queue_Enqueue_with_handler( Thread_queue_Control *the_thread_queue, Watchdog_Interval timeout, Thread_queue_Timeout_callout handler ) { 48314: 4e56 fff0 linkw %fp,#-16 48318: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 4831c: 266e 0008 moveal %fp@(8),%a3 else #endif /* * Set the blocking state for this thread queue in the thread. */ _Thread_Set_state( the_thread, the_thread_queue->state ); 48320: 2f2b 0038 movel %a3@(56),%sp@- Thread_queue_Control *, Thread_Control *, ISR_Level * ); the_thread = _Thread_Executing; 48324: 2479 0005 f20e moveal 5f20e <_Thread_Executing>,%a2 void _Thread_queue_Enqueue_with_handler( Thread_queue_Control *the_thread_queue, Watchdog_Interval timeout, Thread_queue_Timeout_callout handler ) { 4832a: 242e 000c movel %fp@(12),%d2 else #endif /* * Set the blocking state for this thread queue in the thread. */ _Thread_Set_state( the_thread, the_thread_queue->state ); 4832e: 2f0a movel %a2,%sp@- 48330: 4eb9 0004 871c jsr 4871c <_Thread_Set_state> /* * If the thread wants to timeout, then schedule its timer. */ if ( timeout ) { 48336: 508f addql #8,%sp 48338: 4a82 tstl %d2 4833a: 6644 bnes 48380 <_Thread_queue_Enqueue_with_handler+0x6c> } /* * Now enqueue the thread per the discipline for this thread queue. */ if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) 4833c: 41f9 0004 83b0 lea 483b0 <_Thread_queue_Enqueue_priority>,%a0 48342: 7001 moveq #1,%d0 48344: b0ab 0034 cmpl %a3@(52),%d0 48348: 6706 beqs 48350 <_Thread_queue_Enqueue_with_handler+0x3c> 4834a: 41f9 0004 c278 lea 4c278 <_Thread_queue_Enqueue_fifo>,%a0 enqueue_p = _Thread_queue_Enqueue_priority; else /* must be THREAD_QUEUE_DISCIPLINE_FIFO */ enqueue_p = _Thread_queue_Enqueue_fifo; sync_state = (*enqueue_p)( the_thread_queue, the_thread, &level ); 48350: 486e fffc pea %fp@(-4) 48354: 2f0a movel %a2,%sp@- 48356: 2f0b movel %a3,%sp@- 48358: 4e90 jsr %a0@ if ( sync_state != THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 4835a: 4fef 000c lea %sp@(12),%sp 4835e: 7201 moveq #1,%d1 48360: b280 cmpl %d0,%d1 48362: 6712 beqs 48376 <_Thread_queue_Enqueue_with_handler+0x62> _Thread_blocking_operation_Cancel( sync_state, the_thread, level ); 48364: 2f2e fffc movel %fp@(-4),%sp@- 48368: 2f0a movel %a2,%sp@- 4836a: 2f00 movel %d0,%sp@- 4836c: 4eb9 0004 7840 jsr 47840 <_Thread_blocking_operation_Cancel> 48372: 4fef 000c lea %sp@(12),%sp } 48376: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3 4837c: 4e5e unlk %fp 4837e: 4e75 rts /* * If the thread wants to timeout, then schedule its timer. */ if ( timeout ) { _Watchdog_Initialize( 48380: 202a 0008 movel %a2@(8),%d0 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 48384: 256e 0010 0064 movel %fp@(16),%a2@(100) the_watchdog->id = id; 4838a: 2540 0068 movel %d0,%a2@(104) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 4838e: 2542 0054 movel %d2,%a2@(84) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 48392: 42aa 0050 clrl %a2@(80) the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 48396: 42aa 006c clrl %a2@(108) ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 4839a: 486a 0048 pea %a2@(72) 4839e: 4879 0005 f22c pea 5f22c <_Watchdog_Ticks_chain> 483a4: 4eb9 0004 8f58 jsr 48f58 <_Watchdog_Insert> 483aa: 508f addql #8,%sp 483ac: 608e bras 4833c <_Thread_queue_Enqueue_with_handler+0x28> <== ALWAYS TAKEN ... 0004c30c <_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 ); 4c30c: 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 ) { 4c312: 4e56 ffec linkw %fp,#-20 4c316: 48d7 3c04 moveml %d2/%a2-%a5,%sp@ 4c31a: 246e 000c moveal %fp@(12),%a2 4c31e: 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 ); 4c322: 40c1 movew %sr,%d1 4c324: 8081 orl %d1,%d0 4c326: 46c0 movew %d0,%sr if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 4c328: 202a 0010 movel %a2@(16),%d0 4c32c: 0280 0003 bee0 andil #245472,%d0 4c332: 677e beqs 4c3b2 <_Thread_queue_Extract_priority_helper+0xa6> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4c334: 200a movel %a2,%d0 4c336: 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; 4c33c: 2652 moveal %a2@,%a3 previous_node = the_node->previous; 4c33e: 226a 0004 moveal %a2@(4),%a1 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 4c342: 206a 0038 moveal %a2@(56),%a0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4c346: b088 cmpl %a0,%d0 4c348: 6774 beqs 4c3be <_Thread_queue_Extract_priority_helper+0xb2> if ( !_Chain_Is_empty( &the_thread->Wait.Block2n ) ) { new_first_node = the_thread->Wait.Block2n.first; new_first_thread = (Thread_Control *) new_first_node; last_node = the_thread->Wait.Block2n.last; 4c34a: 286a 0040 moveal %a2@(64),%a4 new_second_node = new_first_node->next; 4c34e: 2a50 moveal %a0@,%a5 previous_node->next = new_first_node; next_node->previous = new_first_node; 4c350: 2748 0004 movel %a0,%a3@(4) new_first_node = the_thread->Wait.Block2n.first; new_first_thread = (Thread_Control *) new_first_node; last_node = the_thread->Wait.Block2n.last; new_second_node = new_first_node->next; previous_node->next = new_first_node; 4c354: 2288 movel %a0,%a1@ next_node->previous = new_first_node; new_first_node->next = next_node; new_first_node->previous = previous_node; 4c356: 2149 0004 movel %a1,%a0@(4) last_node = the_thread->Wait.Block2n.last; new_second_node = new_first_node->next; previous_node->next = new_first_node; next_node->previous = new_first_node; new_first_node->next = next_node; 4c35a: 208b movel %a3,%a0@ new_first_node->previous = previous_node; if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) { 4c35c: 202a 0040 movel %a2@(64),%d0 4c360: b0aa 0038 cmpl %a2@(56),%d0 4c364: 6716 beqs 4c37c <_Thread_queue_Extract_priority_helper+0x70> /* > two threads on 2-n */ new_second_node->previous = 4c366: 43e8 0038 lea %a0@(56),%a1 4c36a: 2b49 0004 movel %a1,%a5@(4) _Chain_Head( &new_first_thread->Wait.Block2n ); new_first_thread->Wait.Block2n.first = new_second_node; 4c36e: 214d 0038 movel %a5,%a0@(56) new_first_thread->Wait.Block2n.last = last_node; 4c372: 214c 0040 movel %a4,%a0@(64) last_node->next = _Chain_Tail( &new_first_thread->Wait.Block2n ); 4c376: 41e8 003c lea %a0@(60),%a0 4c37a: 2888 movel %a0,%a4@ /* * If we are not supposed to touch timers or the thread's state, return. */ if ( requeuing ) { 4c37c: 4a02 tstb %d2 4c37e: 6626 bnes 4c3a6 <_Thread_queue_Extract_priority_helper+0x9a> _ISR_Enable( level ); return; } if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 4c380: 7002 moveq #2,%d0 4c382: b0aa 0050 cmpl %a2@(80),%d0 4c386: 6742 beqs 4c3ca <_Thread_queue_Extract_priority_helper+0xbe> _ISR_Enable( level ); 4c388: 46c1 movew %d1,%sr 4c38a: 2d4a 0008 movel %a2,%fp@(8) 4c38e: 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 } 4c394: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 4c39a: 2d49 000c movel %a1,%fp@(12) 4c39e: 4e5e unlk %fp 4c3a0: 4ef9 0004 79f4 jmp 479f4 <_Thread_Clear_state> /* * If we are not supposed to touch timers or the thread's state, return. */ if ( requeuing ) { _ISR_Enable( level ); 4c3a6: 46c1 movew %d1,%sr #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); #endif } 4c3a8: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 4c3ae: 4e5e unlk %fp 4c3b0: 4e75 rts Chain_Node *last_node; the_node = (Chain_Node *) the_thread; _ISR_Disable( level ); if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { _ISR_Enable( level ); 4c3b2: 46c1 movew %d1,%sr #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); #endif } 4c3b4: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 4c3ba: 4e5e unlk %fp 4c3bc: 4e75 rts new_first_thread->Wait.Block2n.last = last_node; last_node->next = _Chain_Tail( &new_first_thread->Wait.Block2n ); } } else { previous_node->next = next_node; next_node->previous = previous_node; 4c3be: 2749 0004 movel %a1,%a3@(4) new_first_thread->Wait.Block2n.last = last_node; last_node->next = _Chain_Tail( &new_first_thread->Wait.Block2n ); } } else { previous_node->next = next_node; 4c3c2: 228b movel %a3,%a1@ /* * If we are not supposed to touch timers or the thread's state, return. */ if ( requeuing ) { 4c3c4: 4a02 tstb %d2 4c3c6: 67b8 beqs 4c380 <_Thread_queue_Extract_priority_helper+0x74> 4c3c8: 60dc bras 4c3a6 <_Thread_queue_Extract_priority_helper+0x9a> <== ALWAYS TAKEN 4c3ca: 7003 moveq #3,%d0 4c3cc: 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 ); 4c3d0: 46c1 movew %d1,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 4c3d2: 486a 0048 pea %a2@(72) 4c3d6: 4eb9 0004 90a0 jsr 490a0 <_Watchdog_Remove> 4c3dc: 588f addql #4,%sp 4c3de: 227c 1003 fff8 moveal #268697592,%a1 4c3e4: 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 } 4c3e8: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 4c3ee: 2d49 000c movel %a1,%fp@(12) 4c3f2: 4e5e unlk %fp 4c3f4: 4ef9 0004 79f4 jmp 479f4 <_Thread_Clear_state> ... 00048590 <_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 ) { 48590: 7201 moveq #1,%d1 Thread_queue_Control *the_thread_queue, Thread_queue_Disciplines the_discipline, States_Control state, uint32_t timeout_status ) { 48592: 4e56 0000 linkw %fp,#0 48596: 206e 0008 moveal %fp@(8),%a0 the_thread_queue->state = state; 4859a: 216e 0010 0038 movel %fp@(16),%a0@(56) Thread_queue_Control *the_thread_queue, Thread_queue_Disciplines the_discipline, States_Control state, uint32_t timeout_status ) { 485a0: 202e 000c movel %fp@(12),%d0 the_thread_queue->state = state; the_thread_queue->discipline = the_discipline; the_thread_queue->timeout_status = timeout_status; 485a4: 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; 485aa: 2140 0034 movel %d0,%a0@(52) the_thread_queue->timeout_status = timeout_status; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 485ae: 42a8 0030 clrl %a0@(48) if ( the_discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) { 485b2: b280 cmpl %d0,%d1 485b4: 6712 beqs 485c8 <_Thread_queue_Initialize+0x38> */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 485b6: 2008 movel %a0,%d0 485b8: 5880 addql #4,%d0 the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 485ba: 2148 0008 movel %a0,%a0@(8) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 485be: 2080 movel %d0,%a0@ the_chain->permanent_null = NULL; 485c0: 42a8 0004 clrl %a0@(4) _Chain_Initialize_empty( &the_thread_queue->Queues.Priority[index] ); } else { /* must be THREAD_QUEUE_DISCIPLINE_FIFO */ _Chain_Initialize_empty( &the_thread_queue->Queues.Fifo ); } } 485c4: 4e5e unlk %fp 485c6: 4e75 rts * timeout_status - return on a timeout * * Output parameters: NONE */ void _Thread_queue_Initialize( 485c8: 2008 movel %a0,%d0 485ca: 0680 0000 0030 addil #48,%d0 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 485d0: 2208 movel %a0,%d1 485d2: 5881 addql #4,%d1 the_chain->permanent_null = NULL; 485d4: 42a8 0004 clrl %a0@(4) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 485d8: 2081 movel %d1,%a0@ the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 485da: 2148 0008 movel %a0,%a0@(8) 485de: 41e8 000c lea %a0@(12),%a0 the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( the_discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) { uint32_t index; for( index=0 ; 485e2: b088 cmpl %a0,%d0 485e4: 67de beqs 485c4 <_Thread_queue_Initialize+0x34> <== ALWAYS TAKEN */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 485e6: 2208 movel %a0,%d1 485e8: 5881 addql #4,%d1 the_chain->permanent_null = NULL; 485ea: 42a8 0004 clrl %a0@(4) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 485ee: 2081 movel %d1,%a0@ the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 485f0: 2148 0008 movel %a0,%a0@(8) 485f4: 41e8 000c lea %a0@(12),%a0 485f8: b088 cmpl %a0,%d0 485fa: 66d4 bnes 485d0 <_Thread_queue_Initialize+0x40> 485fc: 60c6 bras 485c4 <_Thread_queue_Initialize+0x34> <== ALWAYS TAKEN ... 00048600 <_Thread_queue_Requeue>: void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { 48600: 4e56 fff0 linkw %fp,#-16 48604: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 48608: 246e 0008 moveal %fp@(8),%a2 4860c: 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 ) 48610: 4a8a tstl %a2 48612: 6708 beqs 4861c <_Thread_queue_Requeue+0x1c> <== ALWAYS 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 ) { 48614: 7001 moveq #1,%d0 48616: b0aa 0034 cmpl %a2@(52),%d0 4861a: 670a beqs 48626 <_Thread_queue_Requeue+0x26> <== NEVER TAKEN _Thread_queue_Extract_priority_helper( tq, the_thread, true ); (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); } _ISR_Enable( level ); } } 4861c: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3 <== NOT EXECUTED 48622: 4e5e unlk %fp <== NOT EXECUTED 48624: 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 ); 48626: 303c 0700 movew #1792,%d0 4862a: 40c2 movew %sr,%d2 4862c: 8082 orl %d2,%d0 4862e: 46c0 movew %d0,%sr if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 48630: 202b 0010 movel %a3@(16),%d0 48634: 0280 0003 bee0 andil #245472,%d0 4863a: 660c bnes 48648 <_Thread_queue_Requeue+0x48> <== NEVER 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 ); 4863c: 46c2 movew %d2,%sr <== NOT EXECUTED } } 4863e: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3 48644: 4e5e unlk %fp 48646: 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 ); 48648: 4878 0001 pea 1 4864c: 7001 moveq #1,%d0 4864e: 2f0b movel %a3,%sp@- 48650: 2540 0030 movel %d0,%a2@(48) 48654: 2f0a movel %a2,%sp@- 48656: 4eb9 0004 c30c jsr 4c30c <_Thread_queue_Extract_priority_helper> (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); 4865c: 486e fffc pea %fp@(-4) 48660: 2f0b movel %a3,%sp@- 48662: 2f0a movel %a2,%sp@- 48664: 4eb9 0004 83b0 jsr 483b0 <_Thread_queue_Enqueue_priority> 4866a: 4fef 0018 lea %sp@(24),%sp } _ISR_Enable( level ); 4866e: 46c2 movew %d2,%sr 48670: 60cc bras 4863e <_Thread_queue_Requeue+0x3e> <== ALWAYS TAKEN ... 00048674 <_Thread_queue_Timeout>: void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { 48674: 4e56 fffc linkw %fp,#-4 Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 48678: 486e fffc pea %fp@(-4) 4867c: 2f2e 0008 movel %fp@(8),%sp@- 48680: 4eb9 0004 7df0 jsr 47df0 <_Thread_Get> switch ( location ) { 48686: 508f addql #8,%sp 48688: 4aae fffc tstl %fp@(-4) 4868c: 6618 bnes 486a6 <_Thread_queue_Timeout+0x32> <== ALWAYS TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 4868e: 2f00 movel %d0,%sp@- 48690: 4eb9 0004 c3fc jsr 4c3fc <_Thread_queue_Process_timeout> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 48696: 588f addql #4,%sp 48698: 2039 0005 f154 movel 5f154 <_Thread_Dispatch_disable_level>,%d0 4869e: 5380 subql #1,%d0 486a0: 23c0 0005 f154 movel %d0,5f154 <_Thread_Dispatch_disable_level> _Thread_Unnest_dispatch(); break; } } 486a6: 4e5e unlk %fp 486a8: 4e75 rts ... 00058ce8 <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 58ce8: 4e56 ffb0 linkw %fp,#-80 58cec: 41ee ffec lea %fp@(-20),%a0 58cf0: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 58cf4: 246e 0008 moveal %fp@(8),%a2 58cf8: 2c0e movel %fp,%d6 58cfa: 260e movel %fp,%d3 58cfc: 5186 subql #8,%d6 58cfe: 0683 ffff ffe8 addil #-24,%d3 */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 58d04: 240a movel %a2,%d2 /* * This path is for normal forward movement and cases where the * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 58d06: 2a0a movel %a2,%d5 58d08: 4bf9 0005 cfb0 lea 5cfb0 <_Watchdog_Adjust_to_chain>,%a5 */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 58d0e: 0682 0000 0030 addil #48,%d2 /* * This path is for normal forward movement and cases where the * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 58d14: 0685 0000 0068 addil #104,%d5 58d1a: 47f9 0005 97b0 lea 597b0 <_Chain_Get>,%a3 58d20: 49f9 0005 d040 lea 5d040 <_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 ); 58d26: 283c 0000 0700 movel #1792,%d4 58d2c: 2d48 ffd8 movel %a0,%fp@(-40) static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 58d30: 41ea 0008 lea %a2@(8),%a0 58d34: 2d48 ffe0 movel %a0,%fp@(-32) static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 58d38: 41ea 0040 lea %a2@(64),%a0 58d3c: 2d48 ffe4 movel %a0,%fp@(-28) Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 58d40: 41ee fff4 lea %fp@(-12),%a0 58d44: 2d48 fffc movel %a0,%fp@(-4) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 58d48: 41ee ffec lea %fp@(-20),%a0 58d4c: 2d46 fff4 movel %d6,%fp@(-12) the_chain->permanent_null = NULL; 58d50: 42ae fff8 clrl %fp@(-8) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 58d54: 2d48 ffe8 movel %a0,%fp@(-24) the_chain->permanent_null = NULL; 58d58: 42ae ffec clrl %fp@(-20) the_chain->last = _Chain_Head(the_chain); 58d5c: 2d43 fff0 movel %d3,%fp@(-16) { /* * Afterwards all timer inserts are directed to this chain and the interval * and TOD chains will be no more modified by other parties. */ ts->insert_chain = insert_chain; 58d60: 41ee fff4 lea %fp@(-12),%a0 58d64: 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; 58d68: 2039 0007 e38c movel 7e38c <_Watchdog_Ticks_since_boot>,%d0 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 58d6e: 222a 003c movel %a2@(60),%d1 watchdogs->last_snapshot = snapshot; 58d72: 2540 003c movel %d0,%a2@(60) _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 58d76: 9081 subl %d1,%d0 58d78: 2f03 movel %d3,%sp@- 58d7a: 2f00 movel %d0,%sp@- 58d7c: 2f02 movel %d2,%sp@- 58d7e: 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(); 58d80: 2039 0007 e2da movel 7e2da <_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 ) { 58d86: 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; 58d8a: 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 ) { 58d8e: b280 cmpl %d0,%d1 58d90: 6500 0086 bcsw 58e18 <_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 ) { 58d94: b280 cmpl %d0,%d1 58d96: 6200 00a4 bhiw 58e3c <_Timer_server_Body+0x154> */ delta = last_snapshot - snapshot; _Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta ); } watchdogs->last_snapshot = snapshot; 58d9a: 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 ); 58d9e: 202a 0078 movel %a2@(120),%d0 58da2: 2f00 movel %d0,%sp@- 58da4: 4e93 jsr %a3@ if ( timer == NULL ) { 58da6: 588f addql #4,%sp 58da8: 4a80 tstl %d0 58daa: 672e beqs 58dda <_Timer_server_Body+0xf2> static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 58dac: 2040 moveal %d0,%a0 58dae: 7e01 moveq #1,%d7 58db0: 2228 0038 movel %a0@(56),%d1 58db4: be81 cmpl %d1,%d7 58db6: 6700 00a8 beqw 58e60 <_Timer_server_Body+0x178> _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 58dba: 7e03 moveq #3,%d7 58dbc: be81 cmpl %d1,%d7 58dbe: 66de bnes 58d9e <_Timer_server_Body+0xb6> <== ALWAYS TAKEN _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 58dc0: 2040 moveal %d0,%a0 58dc2: 4868 0010 pea %a0@(16) 58dc6: 2f05 movel %d5,%sp@- 58dc8: 4e94 jsr %a4@ } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 58dca: 202a 0078 movel %a2@(120),%d0 ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 58dce: 508f addql #8,%sp } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 58dd0: 2f00 movel %d0,%sp@- 58dd2: 4e93 jsr %a3@ if ( timer == NULL ) { 58dd4: 588f addql #4,%sp 58dd6: 4a80 tstl %d0 58dd8: 66d2 bnes 58dac <_Timer_server_Body+0xc4> <== ALWAYS TAKEN * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); 58dda: 2004 movel %d4,%d0 58ddc: 40c1 movew %sr,%d1 58dde: 8081 orl %d1,%d0 58de0: 46c0 movew %d0,%sr if ( _Chain_Is_empty( insert_chain ) ) { 58de2: bcae fff4 cmpl %fp@(-12),%d6 58de6: 6700 0086 beqw 58e6e <_Timer_server_Body+0x186> <== NEVER TAKEN ts->insert_chain = NULL; _ISR_Enable( level ); break; } else { _ISR_Enable( level ); 58dea: 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; 58dec: 2039 0007 e38c movel 7e38c <_Watchdog_Ticks_since_boot>,%d0 <== NOT EXECUTED /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 58df2: 222a 003c movel %a2@(60),%d1 <== NOT EXECUTED watchdogs->last_snapshot = snapshot; 58df6: 2540 003c movel %d0,%a2@(60) <== NOT EXECUTED _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 58dfa: 9081 subl %d1,%d0 <== NOT EXECUTED 58dfc: 2f03 movel %d3,%sp@- <== NOT EXECUTED 58dfe: 2f00 movel %d0,%sp@- <== NOT EXECUTED 58e00: 2f02 movel %d2,%sp@- <== NOT EXECUTED 58e02: 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(); 58e04: 2039 0007 e2da movel 7e2da <_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 ) { 58e0a: 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; 58e0e: 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 ) { 58e12: b280 cmpl %d0,%d1 <== NOT EXECUTED 58e14: 6400 ff7e bccw 58d94 <_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 ); 58e18: 2f03 movel %d3,%sp@- 58e1a: 2e00 movel %d0,%d7 58e1c: 9e81 subl %d1,%d7 58e1e: 2f07 movel %d7,%sp@- 58e20: 2d40 ffdc movel %d0,%fp@(-36) 58e24: 2f05 movel %d5,%sp@- 58e26: 4eb9 0005 cfb0 jsr 5cfb0 <_Watchdog_Adjust_to_chain> 58e2c: 202e ffdc movel %fp@(-36),%d0 58e30: 4fef 000c lea %sp@(12),%sp */ delta = last_snapshot - snapshot; _Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta ); } watchdogs->last_snapshot = snapshot; 58e34: 2540 0074 movel %d0,%a2@(116) 58e38: 6000 ff64 braw 58d9e <_Timer_server_Body+0xb6> <== ALWAYS TAKEN /* * 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 ); 58e3c: 9280 subl %d0,%d1 58e3e: 2f01 movel %d1,%sp@- 58e40: 4878 0001 pea 1 58e44: 2d40 ffdc movel %d0,%fp@(-36) 58e48: 2f05 movel %d5,%sp@- 58e4a: 4eb9 0005 cf1c jsr 5cf1c <_Watchdog_Adjust> 58e50: 202e ffdc movel %fp@(-36),%d0 58e54: 4fef 000c lea %sp@(12),%sp } watchdogs->last_snapshot = snapshot; 58e58: 2540 0074 movel %d0,%a2@(116) 58e5c: 6000 ff40 braw 58d9e <_Timer_server_Body+0xb6> <== ALWAYS TAKEN Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 58e60: 4868 0010 pea %a0@(16) 58e64: 2f02 movel %d2,%sp@- 58e66: 4e94 jsr %a4@ 58e68: 508f addql #8,%sp 58e6a: 6000 ff32 braw 58d9e <_Timer_server_Body+0xb6> <== ALWAYS TAKEN */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); if ( _Chain_Is_empty( insert_chain ) ) { ts->insert_chain = NULL; 58e6e: 42aa 0078 clrl %a2@(120) _ISR_Enable( level ); 58e72: 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 ) ) { 58e74: 202e ffd8 movel %fp@(-40),%d0 58e78: b0ae ffe8 cmpl %fp@(-24),%d0 58e7c: 6752 beqs 58ed0 <_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 ); 58e7e: 2204 movel %d4,%d1 58e80: 40c0 movew %sr,%d0 58e82: 8280 orl %d0,%d1 58e84: 46c1 movew %d1,%sr */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 58e86: 206e ffe8 moveal %fp@(-24),%a0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 58e8a: b1ee ffd8 cmpal %fp@(-40),%a0 58e8e: 6732 beqs 58ec2 <_Timer_server_Body+0x1da> <== ALWAYS TAKEN { Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; 58e90: 2250 moveal %a0@,%a1 the_chain->first = new_first; 58e92: 2d49 ffe8 movel %a1,%fp@(-24) watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; 58e96: 42a8 0008 clrl %a0@(8) new_first->previous = _Chain_Head(the_chain); 58e9a: 2343 0004 movel %d3,%a1@(4) _ISR_Enable( level ); 58e9e: 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 ); 58ea0: 2f28 0024 movel %a0@(36),%sp@- 58ea4: 2f28 0020 movel %a0@(32),%sp@- 58ea8: 2068 001c moveal %a0@(28),%a0 58eac: 4e90 jsr %a0@ } 58eae: 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 ); 58eb0: 2204 movel %d4,%d1 58eb2: 40c0 movew %sr,%d0 58eb4: 8280 orl %d0,%d1 58eb6: 46c1 movew %d1,%sr */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 58eb8: 206e ffe8 moveal %fp@(-24),%a0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 58ebc: b1ee ffd8 cmpal %fp@(-40),%a0 58ec0: 66ce bnes 58e90 <_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 ); 58ec2: 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; 58ec4: 41ee fff4 lea %fp@(-12),%a0 58ec8: 2548 0078 movel %a0,%a2@(120) 58ecc: 6000 fe9a braw 58d68 <_Timer_server_Body+0x80> <== ALWAYS TAKEN * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); } } else { ts->active = false; 58ed0: 4207 clrb %d7 58ed2: 1547 007c moveb %d7,%a2@(124) 58ed6: 2039 0007 e248 movel 7e248 <_Thread_Dispatch_disable_level>,%d0 58edc: 5280 addql #1,%d0 58ede: 23c0 0007 e248 movel %d0,7e248 <_Thread_Dispatch_disable_level> /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); 58ee4: 4878 0008 pea 8 58ee8: 2f12 movel %a2@,%sp@- 58eea: 4eb9 0005 c634 jsr 5c634 <_Thread_Set_state> _Timer_server_Reset_interval_system_watchdog( ts ); 58ef0: 2f0a movel %a2,%sp@- 58ef2: 4eba fd1c jsr %pc@(58c10 <_Timer_server_Reset_interval_system_watchdog>) _Timer_server_Reset_tod_system_watchdog( ts ); 58ef6: 2f0a movel %a2,%sp@- 58ef8: 4eba fd80 jsr %pc@(58c7a <_Timer_server_Reset_tod_system_watchdog>) _Thread_Enable_dispatch(); 58efc: 4eb9 0005 bb64 jsr 5bb64 <_Thread_Enable_dispatch> ts->active = true; 58f02: 7001 moveq #1,%d0 58f04: 1540 007c moveb %d0,%a2@(124) static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 58f08: 2f2e ffe0 movel %fp@(-32),%sp@- 58f0c: 4eb9 0005 d188 jsr 5d188 <_Watchdog_Remove> static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 58f12: 2f2e ffe4 movel %fp@(-28),%sp@- 58f16: 4eb9 0005 d188 jsr 5d188 <_Watchdog_Remove> 58f1c: 4fef 0018 lea %sp@(24),%sp 58f20: 6000 fe3e braw 58d60 <_Timer_server_Body+0x78> <== ALWAYS TAKEN 00058f24 <_Timer_server_Schedule_operation_method>: static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 58f24: 4e56 fff0 linkw %fp,#-16 58f28: 206e 000c moveal %fp@(12),%a0 58f2c: 48d7 041c moveml %d2-%d4/%a2,%sp@ 58f30: 246e 0008 moveal %fp@(8),%a2 if ( ts->insert_chain == NULL ) { 58f34: 202a 0078 movel %a2@(120),%d0 58f38: 671a beqs 58f54 <_Timer_server_Schedule_operation_method+0x30> * server is not preemptible, so we must be in interrupt context here. No * thread dispatch will happen until the timer server finishes its * critical section. We have to use the protected chain methods because * we may be interrupted by a higher priority interrupt. */ _Chain_Append( ts->insert_chain, &timer->Object.Node ); 58f3a: 202a 0078 movel %a2@(120),%d0 58f3e: 2d48 000c movel %a0,%fp@(12) } } 58f42: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 * server is not preemptible, so we must be in interrupt context here. No * thread dispatch will happen until the timer server finishes its * critical section. We have to use the protected chain methods because * we may be interrupted by a higher priority interrupt. */ _Chain_Append( ts->insert_chain, &timer->Object.Node ); 58f48: 2d40 0008 movel %d0,%fp@(8) } } 58f4c: 4e5e unlk %fp * server is not preemptible, so we must be in interrupt context here. No * thread dispatch will happen until the timer server finishes its * critical section. We have to use the protected chain methods because * we may be interrupted by a higher priority interrupt. */ _Chain_Append( ts->insert_chain, &timer->Object.Node ); 58f4e: 4ef9 0005 9778 jmp 59778 <_Chain_Append> 58f54: 2039 0007 e248 movel 7e248 <_Thread_Dispatch_disable_level>,%d0 58f5a: 5280 addql #1,%d0 58f5c: 23c0 0007 e248 movel %d0,7e248 <_Thread_Dispatch_disable_level> * being inserted. This could result in an integer overflow. */ _Thread_Disable_dispatch(); if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 58f62: 2028 0038 movel %a0@(56),%d0 58f66: 7201 moveq #1,%d1 58f68: b280 cmpl %d0,%d1 58f6a: 6700 0088 beqw 58ff4 <_Timer_server_Schedule_operation_method+0xd0> _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); if ( !ts->active ) { _Timer_server_Reset_interval_system_watchdog( ts ); } } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 58f6e: 7203 moveq #3,%d1 58f70: b280 cmpl %d0,%d1 58f72: 670e beqs 58f82 <_Timer_server_Schedule_operation_method+0x5e> * critical section. We have to use the protected chain methods because * we may be interrupted by a higher priority interrupt. */ _Chain_Append( ts->insert_chain, &timer->Object.Node ); } } 58f74: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 58f7a: 4e5e unlk %fp if ( !ts->active ) { _Timer_server_Reset_tod_system_watchdog( ts ); } } _Thread_Enable_dispatch(); 58f7c: 4ef9 0005 bb64 jmp 5bb64 <_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 ); 58f82: 203c 0000 0700 movel #1792,%d0 58f88: 40c2 movew %sr,%d2 58f8a: 8082 orl %d2,%d0 58f8c: 46c0 movew %d0,%sr */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 58f8e: 260a movel %a2,%d3 58f90: 0683 0000 006c addil #108,%d3 snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 58f96: 2039 0007 e2da movel 7e2da <_TOD_Now>,%d0 last_snapshot = ts->TOD_watchdogs.last_snapshot; 58f9c: 222a 0074 movel %a2@(116),%d1 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 58fa0: 226a 0068 moveal %a2@(104),%a1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 58fa4: b689 cmpl %a1,%d3 58fa6: 671a beqs 58fc2 <_Timer_server_Schedule_operation_method+0x9e> if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; 58fa8: 2629 0010 movel %a1@(16),%d3 if ( snapshot > last_snapshot ) { 58fac: b280 cmpl %d0,%d1 58fae: 6400 00b8 bccw 59068 <_Timer_server_Schedule_operation_method+0x144> /* * We advanced in time. */ delta = snapshot - last_snapshot; 58fb2: 2800 movel %d0,%d4 58fb4: 9881 subl %d1,%d4 if (delta_interval > delta) { 58fb6: b883 cmpl %d3,%d4 58fb8: 6500 00ba bcsw 59074 <_Timer_server_Schedule_operation_method+0x150> <== NEVER TAKEN 58fbc: 4281 clrl %d1 <== NOT EXECUTED * Someone put us in the past. */ delta = last_snapshot - snapshot; delta_interval += delta; } first_watchdog->delta_interval = delta_interval; 58fbe: 2341 0010 movel %d1,%a1@(16) <== NOT EXECUTED } ts->TOD_watchdogs.last_snapshot = snapshot; 58fc2: 2540 0074 movel %d0,%a2@(116) _ISR_Enable( level ); 58fc6: 46c2 movew %d2,%sr _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 58fc8: 4868 0010 pea %a0@(16) 58fcc: 486a 0068 pea %a2@(104) 58fd0: 4eb9 0005 d040 jsr 5d040 <_Watchdog_Insert> if ( !ts->active ) { 58fd6: 508f addql #8,%sp 58fd8: 102a 007c moveb %a2@(124),%d0 58fdc: 6696 bnes 58f74 <_Timer_server_Schedule_operation_method+0x50> _Timer_server_Reset_tod_system_watchdog( ts ); 58fde: 2f0a movel %a2,%sp@- 58fe0: 4eba fc98 jsr %pc@(58c7a <_Timer_server_Reset_tod_system_watchdog>) 58fe4: 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 ); } } 58fe6: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 58fec: 4e5e unlk %fp if ( !ts->active ) { _Timer_server_Reset_tod_system_watchdog( ts ); } } _Thread_Enable_dispatch(); 58fee: 4ef9 0005 bb64 jmp 5bb64 <_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 ); 58ff4: 203c 0000 0700 movel #1792,%d0 58ffa: 40c3 movew %sr,%d3 58ffc: 8083 orl %d3,%d0 58ffe: 46c0 movew %d0,%sr snapshot = _Watchdog_Ticks_since_boot; 59000: 2039 0007 e38c movel 7e38c <_Watchdog_Ticks_since_boot>,%d0 59006: 240a movel %a2,%d2 59008: 0682 0000 0034 addil #52,%d2 last_snapshot = ts->Interval_watchdogs.last_snapshot; 5900e: 222a 003c movel %a2@(60),%d1 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 59012: 226a 0030 moveal %a2@(48),%a1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 59016: b489 cmpl %a1,%d2 59018: 6712 beqs 5902c <_Timer_server_Schedule_operation_method+0x108> first_watchdog = _Watchdog_First( &ts->Interval_watchdogs.Chain ); /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; 5901a: 2800 movel %d0,%d4 5901c: 9881 subl %d1,%d4 delta_interval = first_watchdog->delta_interval; 5901e: 2429 0010 movel %a1@(16),%d2 if (delta_interval > delta) { 59022: b484 cmpl %d4,%d2 59024: 623a bhis 59060 <_Timer_server_Schedule_operation_method+0x13c> 59026: 4282 clrl %d2 delta_interval -= delta; } else { delta_interval = 0; } first_watchdog->delta_interval = delta_interval; 59028: 2342 0010 movel %d2,%a1@(16) } ts->Interval_watchdogs.last_snapshot = snapshot; 5902c: 2540 003c movel %d0,%a2@(60) _ISR_Enable( level ); 59030: 46c3 movew %d3,%sr _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 59032: 4868 0010 pea %a0@(16) 59036: 486a 0030 pea %a2@(48) 5903a: 4eb9 0005 d040 jsr 5d040 <_Watchdog_Insert> if ( !ts->active ) { 59040: 508f addql #8,%sp 59042: 102a 007c moveb %a2@(124),%d0 59046: 6600 ff2c bnew 58f74 <_Timer_server_Schedule_operation_method+0x50> _Timer_server_Reset_interval_system_watchdog( ts ); 5904a: 2f0a movel %a2,%sp@- 5904c: 4eba fbc2 jsr %pc@(58c10 <_Timer_server_Reset_interval_system_watchdog>) 59050: 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 ); } } 59052: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 59058: 4e5e unlk %fp if ( !ts->active ) { _Timer_server_Reset_tod_system_watchdog( ts ); } } _Thread_Enable_dispatch(); 5905a: 4ef9 0005 bb64 jmp 5bb64 <_Thread_Enable_dispatch> */ delta = snapshot - last_snapshot; delta_interval = first_watchdog->delta_interval; if (delta_interval > delta) { delta_interval -= delta; 59060: 9484 subl %d4,%d2 } else { delta_interval = 0; } first_watchdog->delta_interval = delta_interval; 59062: 2342 0010 movel %d2,%a1@(16) 59066: 60c4 bras 5902c <_Timer_server_Schedule_operation_method+0x108> <== ALWAYS TAKEN } } else { /* * Someone put us in the past. */ delta = last_snapshot - snapshot; 59068: d283 addl %d3,%d1 delta_interval += delta; 5906a: 9280 subl %d0,%d1 } first_watchdog->delta_interval = delta_interval; 5906c: 2341 0010 movel %d1,%a1@(16) 59070: 6000 ff50 braw 58fc2 <_Timer_server_Schedule_operation_method+0x9e> <== ALWAYS TAKEN /* * We advanced in time. */ delta = snapshot - last_snapshot; if (delta_interval > delta) { delta_interval -= delta; 59074: 9684 subl %d4,%d3 59076: 2203 movel %d3,%d1 * Someone put us in the past. */ delta = last_snapshot - snapshot; delta_interval += delta; } first_watchdog->delta_interval = delta_interval; 59078: 2341 0010 movel %d1,%a1@(16) 5907c: 6000 ff44 braw 58fc2 <_Timer_server_Schedule_operation_method+0x9e> <== ALWAYS TAKEN 00048dee <_User_extensions_Fatal>: void _User_extensions_Fatal ( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 48dee: 4e56 fff0 linkw %fp,#-16 48df2: 48d7 041c moveml %d2-%d4/%a2,%sp@ 48df6: 242e 0008 movel %fp@(8),%d2 48dfa: 262e 0010 movel %fp@(16),%d3 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 48dfe: 2479 0005 f2f0 moveal 5f2f0 <_User_extensions_List+0x8>,%a2 void _User_extensions_Fatal ( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 48e04: 182e 000f moveb %fp@(15),%d4 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 48e08: b5fc 0005 f2e8 cmpal #389864,%a2 48e0e: 6726 beqs 48e36 <_User_extensions_Fatal+0x48> <== ALWAYS 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 ); 48e10: 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 ) 48e16: 206a 0030 moveal %a2@(48),%a0 48e1a: 4a88 tstl %a0 48e1c: 670c beqs 48e2a <_User_extensions_Fatal+0x3c> (*the_extension->Callouts.fatal)( the_source, is_internal, the_error ); 48e1e: 2f03 movel %d3,%sp@- 48e20: 2f04 movel %d4,%sp@- 48e22: 2f02 movel %d2,%sp@- 48e24: 4e90 jsr %a0@ 48e26: 4fef 000c lea %sp@(12),%sp Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; !_Chain_Is_head( &_User_extensions_List, the_node ) ; the_node = the_node->previous ) { 48e2a: 246a 0004 moveal %a2@(4),%a2 ) { Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 48e2e: b5fc 0005 f2e8 cmpal #389864,%a2 48e34: 66e0 bnes 48e16 <_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 ); } } 48e36: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 48e3c: 4e5e unlk %fp 48e3e: 4e75 rts 00048cac <_User_extensions_Handler_initialization>: #include #include #include void _User_extensions_Handler_initialization(void) { 48cac: 4e56 ffec linkw %fp,#-20 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 48cb0: 203c 0005 f2ec movel #389868,%d0 48cb6: 23c0 0005 f2e8 movel %d0,5f2e8 <_User_extensions_List> the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 48cbc: 203c 0005 f2e8 movel #389864,%d0 48cc2: 23c0 0005 f2f0 movel %d0,5f2f0 <_User_extensions_List+0x8> */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 48cc8: 203c 0005 f15c movel #389468,%d0 48cce: 23c0 0005 f158 movel %d0,5f158 <_User_extensions_Switches_list> the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 48cd4: 203c 0005 f158 movel #389464,%d0 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 48cda: 42b9 0005 f2ec clrl 5f2ec <_User_extensions_List+0x4> 48ce0: 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; 48ce4: 2439 0005 d9da movel 5d9da ,%d2 initial_extensions = Configuration.User_extension_table; 48cea: 2639 0005 d9de movel 5d9de ,%d3 48cf0: 42b9 0005 f15c clrl 5f15c <_User_extensions_Switches_list+0x4> the_chain->last = _Chain_Head(the_chain); 48cf6: 23c0 0005 f160 movel %d0,5f160 <_User_extensions_Switches_list+0x8> _Chain_Initialize_empty( &_User_extensions_List ); _Chain_Initialize_empty( &_User_extensions_Switches_list ); if ( initial_extensions ) { 48cfc: 4a83 tstl %d3 48cfe: 6764 beqs 48d64 <_User_extensions_Handler_initialization+0xb8> extension = (User_extensions_Control *) 48d00: 7834 moveq #52,%d4 48d02: 4c02 4800 mulsl %d2,%d4 48d06: 2f04 movel %d4,%sp@- 48d08: 4eb9 0004 91bc jsr 491bc <_Workspace_Allocate_or_fatal_error> 48d0e: 2440 moveal %d0,%a2 _Workspace_Allocate_or_fatal_error( number_of_extensions * sizeof( User_extensions_Control ) ); memset ( 48d10: 2f04 movel %d4,%sp@- 48d12: 42a7 clrl %sp@- 48d14: 2f00 movel %d0,%sp@- 48d16: 4eb9 0004 f674 jsr 4f674 extension, 0, number_of_extensions * sizeof( User_extensions_Control ) ); for ( i = 0 ; i < number_of_extensions ; i++ ) { 48d1c: 4fef 0010 lea %sp@(16),%sp 48d20: 4a82 tstl %d2 48d22: 6740 beqs 48d64 <_User_extensions_Handler_initialization+0xb8> <== ALWAYS TAKEN 48d24: 4284 clrl %d4 48d26: 47f9 0004 c624 lea 4c624 <_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; 48d2c: 2043 moveal %d3,%a0 48d2e: 5284 addql #1,%d4 48d30: 0683 0000 0020 addil #32,%d3 48d36: 2558 0014 movel %a0@+,%a2@(20) 48d3a: 2558 0018 movel %a0@+,%a2@(24) 48d3e: 2558 001c movel %a0@+,%a2@(28) 48d42: 2558 0020 movel %a0@+,%a2@(32) 48d46: 2558 0024 movel %a0@+,%a2@(36) 48d4a: 2558 0028 movel %a0@+,%a2@(40) 48d4e: 2558 002c movel %a0@+,%a2@(44) 48d52: 2550 0030 movel %a0@,%a2@(48) _User_extensions_Add_set( extension ); 48d56: 2f0a movel %a2,%sp@- _User_extensions_Add_set_with_table (extension, &initial_extensions[i]); extension++; 48d58: 45ea 0034 lea %a2@(52),%a2 48d5c: 4e93 jsr %a3@ extension, 0, number_of_extensions * sizeof( User_extensions_Control ) ); for ( i = 0 ; i < number_of_extensions ; i++ ) { 48d5e: 588f addql #4,%sp 48d60: b882 cmpl %d2,%d4 48d62: 65c8 bcss 48d2c <_User_extensions_Handler_initialization+0x80> _User_extensions_Add_set_with_table (extension, &initial_extensions[i]); extension++; } } } 48d64: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 48d6a: 4e5e unlk %fp 48d6c: 4e75 rts ... 00048d70 <_User_extensions_Thread_begin>: #include void _User_extensions_Thread_begin ( Thread_Control *executing ) { 48d70: 4e56 0000 linkw %fp,#0 48d74: 2f0a movel %a2,%sp@- Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.first ; 48d76: 2479 0005 f2e8 moveal 5f2e8 <_User_extensions_List>,%a2 #include void _User_extensions_Thread_begin ( Thread_Control *executing ) { 48d7c: 2f02 movel %d2,%sp@- 48d7e: 242e 0008 movel %fp@(8),%d2 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.first ; 48d82: b5fc 0005 f2ec cmpal #389868,%a2 48d88: 6718 beqs 48da2 <_User_extensions_Thread_begin+0x32> <== ALWAYS 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 ) 48d8a: 206a 0028 moveal %a2@(40),%a0 48d8e: 4a88 tstl %a0 48d90: 6706 beqs 48d98 <_User_extensions_Thread_begin+0x28> (*the_extension->Callouts.thread_begin)( executing ); 48d92: 2f02 movel %d2,%sp@- 48d94: 4e90 jsr %a0@ 48d96: 588f addql #4,%sp Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.first ; !_Chain_Is_tail( &_User_extensions_List, the_node ) ; the_node = the_node->next ) { 48d98: 2452 moveal %a2@,%a2 ) { Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.first ; 48d9a: b5fc 0005 f2ec cmpal #389868,%a2 48da0: 66e8 bnes 48d8a <_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 ); } } 48da2: 242e fff8 movel %fp@(-8),%d2 48da6: 246e fffc moveal %fp@(-4),%a2 48daa: 4e5e unlk %fp 48dac: 4e75 rts 00048e40 <_User_extensions_Thread_create>: #include bool _User_extensions_Thread_create ( Thread_Control *the_thread ) { 48e40: 4e56 0000 linkw %fp,#0 48e44: 2f0a movel %a2,%sp@- Chain_Node *the_node; User_extensions_Control *the_extension; bool status; for ( the_node = _User_extensions_List.first ; 48e46: 2479 0005 f2e8 moveal 5f2e8 <_User_extensions_List>,%a2 #include bool _User_extensions_Thread_create ( Thread_Control *the_thread ) { 48e4c: 2f02 movel %d2,%sp@- 48e4e: 242e 0008 movel %fp@(8),%d2 Chain_Node *the_node; User_extensions_Control *the_extension; bool status; for ( the_node = _User_extensions_List.first ; 48e52: b5fc 0005 f2ec cmpal #389868,%a2 48e58: 6722 beqs 48e7c <_User_extensions_Thread_create+0x3c> <== ALWAYS 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 ) { 48e5a: 206a 0014 moveal %a2@(20),%a0 48e5e: 4a88 tstl %a0 48e60: 6710 beqs 48e72 <_User_extensions_Thread_create+0x32> status = (*the_extension->Callouts.thread_create)( 48e62: 2f02 movel %d2,%sp@- 48e64: 2f39 0005 f20e movel 5f20e <_Thread_Executing>,%sp@- 48e6a: 4e90 jsr %a0@ _Thread_Executing, the_thread ); if ( !status ) 48e6c: 508f addql #8,%sp 48e6e: 4a00 tstb %d0 48e70: 670c beqs 48e7e <_User_extensions_Thread_create+0x3e> User_extensions_Control *the_extension; bool status; for ( the_node = _User_extensions_List.first ; !_Chain_Is_tail( &_User_extensions_List, the_node ) ; the_node = the_node->next ) { 48e72: 2452 moveal %a2@,%a2 { Chain_Node *the_node; User_extensions_Control *the_extension; bool status; for ( the_node = _User_extensions_List.first ; 48e74: b5fc 0005 f2ec cmpal #389868,%a2 48e7a: 66de bnes 48e5a <_User_extensions_Thread_create+0x1a> 48e7c: 7001 moveq #1,%d0 return false; } } return true; } 48e7e: 242e fff8 movel %fp@(-8),%d2 48e82: 246e fffc moveal %fp@(-4),%a2 48e86: 4e5e unlk %fp 48e88: 4e75 rts ... 00048e8c <_User_extensions_Thread_delete>: #include void _User_extensions_Thread_delete ( Thread_Control *the_thread ) { 48e8c: 4e56 0000 linkw %fp,#0 48e90: 2f0a movel %a2,%sp@- Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 48e92: 2479 0005 f2f0 moveal 5f2f0 <_User_extensions_List+0x8>,%a2 #include void _User_extensions_Thread_delete ( Thread_Control *the_thread ) { 48e98: 2f02 movel %d2,%sp@- 48e9a: 242e 0008 movel %fp@(8),%d2 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 48e9e: b5fc 0005 f2e8 cmpal #389864,%a2 48ea4: 6720 beqs 48ec6 <_User_extensions_Thread_delete+0x3a> <== ALWAYS 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 ) 48ea6: 206a 0020 moveal %a2@(32),%a0 48eaa: 4a88 tstl %a0 48eac: 670c beqs 48eba <_User_extensions_Thread_delete+0x2e> (*the_extension->Callouts.thread_delete)( 48eae: 2f02 movel %d2,%sp@- 48eb0: 2f39 0005 f20e movel 5f20e <_Thread_Executing>,%sp@- 48eb6: 4e90 jsr %a0@ 48eb8: 508f addql #8,%sp Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; !_Chain_Is_head( &_User_extensions_List, the_node ) ; the_node = the_node->previous ) { 48eba: 246a 0004 moveal %a2@(4),%a2 ) { Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 48ebe: b5fc 0005 f2e8 cmpal #389864,%a2 48ec4: 66e0 bnes 48ea6 <_User_extensions_Thread_delete+0x1a> (*the_extension->Callouts.thread_delete)( _Thread_Executing, the_thread ); } } 48ec6: 242e fff8 movel %fp@(-8),%d2 48eca: 246e fffc moveal %fp@(-4),%a2 48ece: 4e5e unlk %fp 48ed0: 4e75 rts ... 00048dae <_User_extensions_Thread_exitted>: void _User_extensions_Thread_exitted ( Thread_Control *executing ) { 48dae: 4e56 0000 linkw %fp,#0 48db2: 2f0a movel %a2,%sp@- Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 48db4: 2479 0005 f2f0 moveal 5f2f0 <_User_extensions_List+0x8>,%a2 } void _User_extensions_Thread_exitted ( Thread_Control *executing ) { 48dba: 2f02 movel %d2,%sp@- 48dbc: 242e 0008 movel %fp@(8),%d2 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 48dc0: b5fc 0005 f2e8 cmpal #389864,%a2 48dc6: 671a beqs 48de2 <_User_extensions_Thread_exitted+0x34> <== ALWAYS 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 ) 48dc8: 206a 002c moveal %a2@(44),%a0 48dcc: 4a88 tstl %a0 48dce: 6706 beqs 48dd6 <_User_extensions_Thread_exitted+0x28> (*the_extension->Callouts.thread_exitted)( executing ); 48dd0: 2f02 movel %d2,%sp@- 48dd2: 4e90 jsr %a0@ 48dd4: 588f addql #4,%sp Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; !_Chain_Is_head( &_User_extensions_List, the_node ) ; the_node = the_node->previous ) { 48dd6: 246a 0004 moveal %a2@(4),%a2 ) { Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 48dda: b5fc 0005 f2e8 cmpal #389864,%a2 48de0: 66e6 bnes 48dc8 <_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 ); } } 48de2: 242e fff8 movel %fp@(-8),%d2 48de6: 246e fffc moveal %fp@(-4),%a2 48dea: 4e5e unlk %fp 48dec: 4e75 rts 00049b28 <_User_extensions_Thread_restart>: #include void _User_extensions_Thread_restart ( Thread_Control *the_thread ) { 49b28: 4e56 0000 linkw %fp,#0 49b2c: 2f0a movel %a2,%sp@- Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.first ; 49b2e: 2479 0006 0240 moveal 60240 <_User_extensions_List>,%a2 #include void _User_extensions_Thread_restart ( Thread_Control *the_thread ) { 49b34: 2f02 movel %d2,%sp@- 49b36: 242e 0008 movel %fp@(8),%d2 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.first ; 49b3a: b5fc 0006 0244 cmpal #393796,%a2 49b40: 671e beqs 49b60 <_User_extensions_Thread_restart+0x38> <== ALWAYS 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 ) 49b42: 206a 001c moveal %a2@(28),%a0 49b46: 4a88 tstl %a0 49b48: 670c beqs 49b56 <_User_extensions_Thread_restart+0x2e> (*the_extension->Callouts.thread_restart)( 49b4a: 2f02 movel %d2,%sp@- 49b4c: 2f39 0006 0166 movel 60166 <_Thread_Executing>,%sp@- 49b52: 4e90 jsr %a0@ 49b54: 508f addql #8,%sp Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.first ; !_Chain_Is_tail( &_User_extensions_List, the_node ) ; the_node = the_node->next ) { 49b56: 2452 moveal %a2@,%a2 ) { Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.first ; 49b58: b5fc 0006 0244 cmpal #393796,%a2 49b5e: 66e2 bnes 49b42 <_User_extensions_Thread_restart+0x1a> (*the_extension->Callouts.thread_restart)( _Thread_Executing, the_thread ); } } 49b60: 242e fff8 movel %fp@(-8),%d2 49b64: 246e fffc moveal %fp@(-4),%a2 49b68: 4e5e unlk %fp 49b6a: 4e75 rts 00048ed4 <_User_extensions_Thread_start>: #include void _User_extensions_Thread_start ( Thread_Control *the_thread ) { 48ed4: 4e56 0000 linkw %fp,#0 48ed8: 2f0a movel %a2,%sp@- Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.first ; 48eda: 2479 0005 f2e8 moveal 5f2e8 <_User_extensions_List>,%a2 #include void _User_extensions_Thread_start ( Thread_Control *the_thread ) { 48ee0: 2f02 movel %d2,%sp@- 48ee2: 242e 0008 movel %fp@(8),%d2 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.first ; 48ee6: b5fc 0005 f2ec cmpal #389868,%a2 48eec: 671e beqs 48f0c <_User_extensions_Thread_start+0x38> <== ALWAYS 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 ) 48eee: 206a 0018 moveal %a2@(24),%a0 48ef2: 4a88 tstl %a0 48ef4: 670c beqs 48f02 <_User_extensions_Thread_start+0x2e> (*the_extension->Callouts.thread_start)( 48ef6: 2f02 movel %d2,%sp@- 48ef8: 2f39 0005 f20e movel 5f20e <_Thread_Executing>,%sp@- 48efe: 4e90 jsr %a0@ 48f00: 508f addql #8,%sp Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.first ; !_Chain_Is_tail( &_User_extensions_List, the_node ) ; the_node = the_node->next ) { 48f02: 2452 moveal %a2@,%a2 ) { Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.first ; 48f04: b5fc 0005 f2ec cmpal #389868,%a2 48f0a: 66e2 bnes 48eee <_User_extensions_Thread_start+0x1a> (*the_extension->Callouts.thread_start)( _Thread_Executing, the_thread ); } } 48f0c: 242e fff8 movel %fp@(-8),%d2 48f10: 246e fffc moveal %fp@(-4),%a2 48f14: 4e5e unlk %fp 48f16: 4e75 rts 00048f18 <_User_extensions_Thread_switch>: void _User_extensions_Thread_switch ( Thread_Control *executing, Thread_Control *heir ) { 48f18: 4e56 fff4 linkw %fp,#-12 48f1c: 48d7 040c moveml %d2-%d3/%a2,%sp@ 48f20: 262e 0008 movel %fp@(8),%d3 48f24: 242e 000c movel %fp@(12),%d2 Chain_Node *the_node; User_extensions_Switch_control *the_extension_switch; for ( the_node = _User_extensions_Switches_list.first ; 48f28: 2479 0005 f158 moveal 5f158 <_User_extensions_Switches_list>,%a2 48f2e: b5fc 0005 f15c cmpal #389468,%a2 48f34: 6716 beqs 48f4c <_User_extensions_Thread_switch+0x34> <== ALWAYS 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 ); 48f36: 2f02 movel %d2,%sp@- 48f38: 2f03 movel %d3,%sp@- 48f3a: 206a 0008 moveal %a2@(8),%a0 48f3e: 4e90 jsr %a0@ Chain_Node *the_node; User_extensions_Switch_control *the_extension_switch; for ( the_node = _User_extensions_Switches_list.first ; !_Chain_Is_tail( &_User_extensions_Switches_list, the_node ) ; the_node = the_node->next ) { 48f40: 2452 moveal %a2@,%a2 ) { Chain_Node *the_node; User_extensions_Switch_control *the_extension_switch; for ( the_node = _User_extensions_Switches_list.first ; 48f42: 508f addql #8,%sp 48f44: b5fc 0005 f15c cmpal #389468,%a2 48f4a: 66ea bnes 48f36 <_User_extensions_Thread_switch+0x1e> the_extension_switch = (User_extensions_Switch_control *) the_node; (*the_extension_switch->thread_switch)( executing, heir ); } } 48f4c: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 48f52: 4e5e unlk %fp 48f54: 4e75 rts ... 0004ac44 <_Watchdog_Adjust>: void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 4ac44: 4e56 ffe8 linkw %fp,#-24 4ac48: 226e 000c moveal %fp@(12),%a1 4ac4c: 48d7 1c1c moveml %d2-%d4/%a2-%a4,%sp@ ISR_Level level; _ISR_Disable( level ); 4ac50: 283c 0000 0700 movel #1792,%d4 4ac56: 2004 movel %d4,%d0 void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 4ac58: 266e 0008 moveal %fp@(8),%a3 4ac5c: 242e 0010 movel %fp@(16),%d2 ISR_Level level; _ISR_Disable( level ); 4ac60: 40c1 movew %sr,%d1 4ac62: 8081 orl %d1,%d0 4ac64: 46c0 movew %d0,%sr */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 4ac66: 244b moveal %a3,%a2 4ac68: 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 ) ) { 4ac6a: b5c8 cmpal %a0,%a2 4ac6c: 6748 beqs 4acb6 <_Watchdog_Adjust+0x72> switch ( direction ) { 4ac6e: 4a89 tstl %a1 4ac70: 6650 bnes 4acc2 <_Watchdog_Adjust+0x7e> case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 4ac72: 4a82 tstl %d2 4ac74: 6740 beqs 4acb6 <_Watchdog_Adjust+0x72> <== ALWAYS TAKEN if ( units < _Watchdog_First( header )->delta_interval ) { 4ac76: 2628 0010 movel %a0@(16),%d3 4ac7a: 49f9 0004 aec0 lea 4aec0 <_Watchdog_Tickle>,%a4 4ac80: b682 cmpl %d2,%d3 4ac82: 622c bhis 4acb0 <_Watchdog_Adjust+0x6c> <== ALWAYS TAKEN _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; 4ac84: 7001 moveq #1,%d0 4ac86: 2140 0010 movel %d0,%a0@(16) _ISR_Enable( level ); 4ac8a: 46c1 movew %d1,%sr _Watchdog_Tickle( header ); 4ac8c: 2f0b movel %a3,%sp@- 4ac8e: 4e94 jsr %a4@ _ISR_Disable( level ); 4ac90: 2004 movel %d4,%d0 4ac92: 40c1 movew %sr,%d1 4ac94: 8081 orl %d1,%d0 4ac96: 46c0 movew %d0,%sr while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; 4ac98: 9483 subl %d3,%d2 _Watchdog_Tickle( header ); _ISR_Disable( level ); if ( _Chain_Is_empty( header ) ) 4ac9a: 588f addql #4,%sp 4ac9c: 2013 movel %a3@,%d0 RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First( Chain_Control *header ) { return ( (Watchdog_Control *) header->first ); 4ac9e: 2040 moveal %d0,%a0 4aca0: b08a cmpl %a2,%d0 4aca2: 6712 beqs 4acb6 <_Watchdog_Adjust+0x72> switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 4aca4: 4a82 tstl %d2 4aca6: 670e beqs 4acb6 <_Watchdog_Adjust+0x72> <== ALWAYS TAKEN if ( units < _Watchdog_First( header )->delta_interval ) { 4aca8: 2628 0010 movel %a0@(16),%d3 4acac: b483 cmpl %d3,%d2 4acae: 64d4 bccs 4ac84 <_Watchdog_Adjust+0x40> _Watchdog_First( header )->delta_interval -= units; 4acb0: 9682 subl %d2,%d3 4acb2: 2143 0010 movel %d3,%a0@(16) } break; } } _ISR_Enable( level ); 4acb6: 46c1 movew %d1,%sr } 4acb8: 4cee 1c1c ffe8 moveml %fp@(-24),%d2-%d4/%a2-%a4 4acbe: 4e5e unlk %fp 4acc0: 4e75 rts * unmodified across that call. * * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { switch ( direction ) { 4acc2: 7001 moveq #1,%d0 4acc4: b089 cmpl %a1,%d0 4acc6: 66ee bnes 4acb6 <_Watchdog_Adjust+0x72> <== ALWAYS TAKEN case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; 4acc8: d5a8 0010 addl %d2,%a0@(16) } break; } } _ISR_Enable( level ); 4accc: 46c1 movew %d1,%sr } 4acce: 4cee 1c1c ffe8 moveml %fp@(-24),%d2-%d4/%a2-%a4 4acd4: 4e5e unlk %fp 4acd6: 4e75 rts 0005cfb0 <_Watchdog_Adjust_to_chain>: Chain_Control *header, Watchdog_Interval units_arg, Chain_Control *to_fire ) { 5cfb0: 4e56 ffe4 linkw %fp,#-28 5cfb4: 48d7 3c1c moveml %d2-%d4/%a2-%a5,%sp@ 5cfb8: 2a6e 0008 moveal %fp@(8),%a5 5cfbc: 282e 000c movel %fp@(12),%d4 5cfc0: 266e 0010 moveal %fp@(16),%a3 Watchdog_Interval units = units_arg; ISR_Level level; Watchdog_Control *first; if ( units <= 0 ) { 5cfc4: 675e beqs 5d024 <_Watchdog_Adjust_to_chain+0x74> return; } _ISR_Disable( level ); 5cfc6: 263c 0000 0700 movel #1792,%d3 5cfcc: 2003 movel %d3,%d0 5cfce: 40c1 movew %sr,%d1 5cfd0: 8081 orl %d1,%d0 5cfd2: 46c0 movew %d0,%sr 5cfd4: 284d moveal %a5,%a4 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 5cfd6: 240b movel %a3,%d2 5cfd8: 5882 addql #4,%d2 5cfda: 205c moveal %a4@+,%a0 while ( 1 ) { if ( units <= 0 ) { break; } if ( _Chain_Is_empty( header ) ) { 5cfdc: b1cc cmpal %a4,%a0 5cfde: 6742 beqs 5d022 <_Watchdog_Adjust_to_chain+0x72> /* * If it is longer than "units" until the first element on the chain * fires, then bump it and quit. */ if ( units < first->delta_interval ) { 5cfe0: 2028 0010 movel %a0@(16),%d0 5cfe4: b880 cmpl %d0,%d4 5cfe6: 654c bcss 5d034 <_Watchdog_Adjust_to_chain+0x84> /* * The first set happens in less than units, so take all of them * off the chain and adjust units to reflect this. */ units -= first->delta_interval; 5cfe8: 9880 subl %d0,%d4 first->delta_interval = 0; 5cfea: 42a8 0010 clrl %a0@(16) ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 5cfee: 2250 moveal %a0@,%a1 previous = the_node->previous; 5cff0: 2468 0004 moveal %a0@(4),%a2 next->previous = previous; previous->next = next; 5cff4: 2489 movel %a1,%a2@ Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 5cff6: 234a 0004 movel %a2,%a1@(4) Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 5cffa: 2082 movel %d2,%a0@ old_last_node = the_chain->last; 5cffc: 226b 0008 moveal %a3@(8),%a1 the_chain->last = the_node; 5d000: 2748 0008 movel %a0,%a3@(8) old_last_node->next = the_node; the_node->previous = old_last_node; 5d004: 2149 0004 movel %a1,%a0@(4) Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; the_chain->last = the_node; old_last_node->next = the_node; 5d008: 2288 movel %a0,%a1@ while ( 1 ) { _Chain_Extract_unprotected( &first->Node ); _Chain_Append_unprotected( to_fire, &first->Node ); _ISR_Flash( level ); 5d00a: 2003 movel %d3,%d0 5d00c: 46c1 movew %d1,%sr 5d00e: 8081 orl %d1,%d0 5d010: 46c0 movew %d0,%sr */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 5d012: 2055 moveal %a5@,%a0 if ( _Chain_Is_empty( header ) ) 5d014: b1cc cmpal %a4,%a0 5d016: 6714 beqs 5d02c <_Watchdog_Adjust_to_chain+0x7c> break; first = _Watchdog_First( header ); if ( first->delta_interval != 0 ) 5d018: 4aa8 0010 tstl %a0@(16) 5d01c: 67d0 beqs 5cfee <_Watchdog_Adjust_to_chain+0x3e> } _ISR_Disable( level ); while ( 1 ) { if ( units <= 0 ) { 5d01e: 4a84 tstl %d4 5d020: 66ba bnes 5cfdc <_Watchdog_Adjust_to_chain+0x2c> if ( first->delta_interval != 0 ) break; } } _ISR_Enable( level ); 5d022: 46c1 movew %d1,%sr } 5d024: 4cd7 3c1c moveml %sp@,%d2-%d4/%a2-%a5 5d028: 4e5e unlk %fp 5d02a: 4e75 rts */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 5d02c: 204c moveal %a4,%a0 } _ISR_Disable( level ); while ( 1 ) { if ( units <= 0 ) { 5d02e: 4a84 tstl %d4 5d030: 66aa bnes 5cfdc <_Watchdog_Adjust_to_chain+0x2c> 5d032: 60ee bras 5d022 <_Watchdog_Adjust_to_chain+0x72> <== ALWAYS TAKEN /* * If it is longer than "units" until the first element on the chain * fires, then bump it and quit. */ if ( units < first->delta_interval ) { first->delta_interval -= units; 5d034: 9084 subl %d4,%d0 5d036: 2140 0010 movel %d0,%a0@(16) if ( first->delta_interval != 0 ) break; } } _ISR_Enable( level ); 5d03a: 46c1 movew %d1,%sr 5d03c: 60e6 bras 5d024 <_Watchdog_Adjust_to_chain+0x74> <== ALWAYS TAKEN ... 00048f58 <_Watchdog_Insert>: void _Watchdog_Insert( Chain_Control *header, Watchdog_Control *the_watchdog ) { 48f58: 4e56 ffec linkw %fp,#-20 48f5c: 226e 000c moveal %fp@(12),%a1 48f60: 48d7 043c moveml %d2-%d5/%a2,%sp@ 48f64: 246e 0008 moveal %fp@(8),%a2 Watchdog_Interval delta_interval; insert_isr_nest_level = _ISR_Nest_level; _ISR_Disable( level ); 48f68: 2a3c 0000 0700 movel #1792,%d5 48f6e: 2005 movel %d5,%d0 Watchdog_Control *after; uint32_t insert_isr_nest_level; Watchdog_Interval delta_interval; insert_isr_nest_level = _ISR_Nest_level; 48f70: 2839 0005 f1ee movel 5f1ee <_ISR_Nest_level>,%d4 _ISR_Disable( level ); 48f76: 40c3 movew %sr,%d3 48f78: 8083 orl %d3,%d0 48f7a: 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 ) { 48f7c: 4aa9 0008 tstl %a1@(8) 48f80: 6600 00c6 bnew 49048 <_Watchdog_Insert+0xf0> _ISR_Enable( level ); return; } the_watchdog->state = WATCHDOG_BEING_INSERTED; _Watchdog_Sync_count++; 48f84: 2039 0005 f294 movel 5f294 <_Watchdog_Sync_count>,%d0 48f8a: 5280 addql #1,%d0 48f8c: 23c0 0005 f294 movel %d0,5f294 <_Watchdog_Sync_count> if ( the_watchdog->state != WATCHDOG_INACTIVE ) { _ISR_Enable( level ); return; } the_watchdog->state = WATCHDOG_BEING_INSERTED; 48f92: 7001 moveq #1,%d0 48f94: 2340 0008 movel %d0,%a1@(8) _Watchdog_Sync_count++; restart: delta_interval = the_watchdog->initial; 48f98: 2029 000c movel %a1@(12),%d0 * cache *header!! * * Till Straumann, 7/2003 (gcc-3.2.2 -O4 on powerpc) * */ for ( after = (Watchdog_Control *) ((volatile Chain_Control *)header)->first ; 48f9c: 2052 moveal %a2@,%a0 ; after = _Watchdog_Next( after ) ) { if ( delta_interval == 0 || !_Watchdog_Next( after ) ) 48f9e: 6764 beqs 49004 <_Watchdog_Insert+0xac> 48fa0: 4a90 tstl %a0@ 48fa2: 6760 beqs 49004 <_Watchdog_Insert+0xac> break; if ( delta_interval < after->delta_interval ) { 48fa4: 2228 0010 movel %a0@(16),%d1 48fa8: b280 cmpl %d0,%d1 48faa: 6252 bhis 48ffe <_Watchdog_Insert+0xa6> * used around this flash point allowed interrupts to execute * which violated the design assumptions. The critical section * mechanism used here WAS redesigned to address this. */ _ISR_Flash( level ); 48fac: 2405 movel %d5,%d2 48fae: 46c3 movew %d3,%sr 48fb0: 8483 orl %d3,%d2 48fb2: 46c2 movew %d2,%sr if ( the_watchdog->state != WATCHDOG_BEING_INSERTED ) { 48fb4: 7401 moveq #1,%d2 48fb6: b4a9 0008 cmpl %a1@(8),%d2 48fba: 666e bnes 4902a <_Watchdog_Insert+0xd2> goto exit_insert; } if ( _Watchdog_Sync_level > insert_isr_nest_level ) { 48fbc: 2439 0005 f20a movel 5f20a <_Watchdog_Sync_level>,%d2 48fc2: b484 cmpl %d4,%d2 48fc4: 6230 bhis 48ff6 <_Watchdog_Insert+0x9e> if ( delta_interval < after->delta_interval ) { after->delta_interval -= delta_interval; break; } delta_interval -= after->delta_interval; 48fc6: 9081 subl %d1,%d0 RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_Next( Watchdog_Control *the_watchdog ) { return ( (Watchdog_Control *) the_watchdog->Node.next ); 48fc8: 2050 moveal %a0@,%a0 */ for ( after = (Watchdog_Control *) ((volatile Chain_Control *)header)->first ; ; after = _Watchdog_Next( after ) ) { if ( delta_interval == 0 || !_Watchdog_Next( after ) ) 48fca: 4a80 tstl %d0 48fcc: 6736 beqs 49004 <_Watchdog_Insert+0xac> 48fce: 4a90 tstl %a0@ 48fd0: 6732 beqs 49004 <_Watchdog_Insert+0xac> break; if ( delta_interval < after->delta_interval ) { 48fd2: 2228 0010 movel %a0@(16),%d1 48fd6: b081 cmpl %d1,%d0 48fd8: 6524 bcss 48ffe <_Watchdog_Insert+0xa6> * used around this flash point allowed interrupts to execute * which violated the design assumptions. The critical section * mechanism used here WAS redesigned to address this. */ _ISR_Flash( level ); 48fda: 2405 movel %d5,%d2 48fdc: 46c3 movew %d3,%sr 48fde: 8483 orl %d3,%d2 48fe0: 46c2 movew %d2,%sr if ( delta_interval < after->delta_interval ) { after->delta_interval -= delta_interval; break; } delta_interval -= after->delta_interval; 48fe2: 9081 subl %d1,%d0 * mechanism used here WAS redesigned to address this. */ _ISR_Flash( level ); if ( the_watchdog->state != WATCHDOG_BEING_INSERTED ) { 48fe4: 7201 moveq #1,%d1 48fe6: b2a9 0008 cmpl %a1@(8),%d1 48fea: 663e bnes 4902a <_Watchdog_Insert+0xd2> <== ALWAYS TAKEN goto exit_insert; } if ( _Watchdog_Sync_level > insert_isr_nest_level ) { 48fec: 2239 0005 f20a movel 5f20a <_Watchdog_Sync_level>,%d1 48ff2: b284 cmpl %d4,%d1 48ff4: 63d2 blss 48fc8 <_Watchdog_Insert+0x70> _Watchdog_Sync_level = insert_isr_nest_level; 48ff6: 23c4 0005 f20a movel %d4,5f20a <_Watchdog_Sync_level> goto restart; 48ffc: 609a bras 48f98 <_Watchdog_Insert+0x40> <== ALWAYS TAKEN if ( delta_interval == 0 || !_Watchdog_Next( after ) ) break; if ( delta_interval < after->delta_interval ) { after->delta_interval -= delta_interval; 48ffe: 9280 subl %d0,%d1 49000: 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 ); 49004: 2068 0004 moveal %a0@(4),%a0 RTEMS_INLINE_ROUTINE void _Watchdog_Activate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_ACTIVE; 49008: 7402 moveq #2,%d2 ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 4900a: 2450 moveal %a0@,%a2 the_watchdog->start_time = _Watchdog_Ticks_since_boot; 4900c: 2239 0005 f298 movel 5f298 <_Watchdog_Ticks_since_boot>,%d1 after_node->next = the_node; 49012: 2089 movel %a1,%a0@ Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 49014: 2348 0004 movel %a0,%a1@(4) 49018: 2341 0014 movel %d1,%a1@(20) } } _Watchdog_Activate( the_watchdog ); the_watchdog->delta_interval = delta_interval; 4901c: 2340 0010 movel %d0,%a1@(16) before_node = after_node->next; after_node->next = the_node; the_node->next = before_node; before_node->previous = the_node; 49020: 2549 0004 movel %a1,%a2@(4) 49024: 2342 0008 movel %d2,%a1@(8) Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; after_node->next = the_node; the_node->next = before_node; 49028: 228a movel %a2,%a1@ _Chain_Insert_unprotected( after->Node.previous, &the_watchdog->Node ); the_watchdog->start_time = _Watchdog_Ticks_since_boot; exit_insert: _Watchdog_Sync_level = insert_isr_nest_level; 4902a: 23c4 0005 f20a movel %d4,5f20a <_Watchdog_Sync_level> _Watchdog_Sync_count--; 49030: 2039 0005 f294 movel 5f294 <_Watchdog_Sync_count>,%d0 49036: 5380 subql #1,%d0 49038: 23c0 0005 f294 movel %d0,5f294 <_Watchdog_Sync_count> _ISR_Enable( level ); 4903e: 46c3 movew %d3,%sr } 49040: 4cd7 043c moveml %sp@,%d2-%d5/%a2 49044: 4e5e unlk %fp 49046: 4e75 rts * 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 ) { _ISR_Enable( level ); 49048: 46c3 movew %d3,%sr exit_insert: _Watchdog_Sync_level = insert_isr_nest_level; _Watchdog_Sync_count--; _ISR_Enable( level ); } 4904a: 4cd7 043c moveml %sp@,%d2-%d5/%a2 4904e: 4e5e unlk %fp 49050: 4e75 rts ... 000490a0 <_Watchdog_Remove>: { ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 490a0: 203c 0000 0700 movel #1792,%d0 */ Watchdog_States _Watchdog_Remove( Watchdog_Control *the_watchdog ) { 490a6: 4e56 0000 linkw %fp,#0 490aa: 206e 0008 moveal %fp@(8),%a0 490ae: 2f0a movel %a2,%sp@- 490b0: 2f02 movel %d2,%sp@- ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 490b2: 40c1 movew %sr,%d1 490b4: 8081 orl %d1,%d0 490b6: 46c0 movew %d0,%sr previous_state = the_watchdog->state; 490b8: 2028 0008 movel %a0@(8),%d0 switch ( previous_state ) { 490bc: 7401 moveq #1,%d2 490be: b480 cmpl %d0,%d2 490c0: 6764 beqs 49126 <_Watchdog_Remove+0x86> 490c2: 6314 blss 490d8 <_Watchdog_Remove+0x38> _Watchdog_Sync_level = _ISR_Nest_level; _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 490c4: 2279 0005 f298 moveal 5f298 <_Watchdog_Ticks_since_boot>,%a1 490ca: 2149 0018 movel %a1,%a0@(24) _ISR_Enable( level ); 490ce: 46c1 movew %d1,%sr return( previous_state ); } 490d0: 241f movel %sp@+,%d2 490d2: 245f moveal %sp@+,%a2 490d4: 4e5e unlk %fp 490d6: 4e75 rts Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); previous_state = the_watchdog->state; switch ( previous_state ) { 490d8: 143c 0003 moveb #3,%d2 490dc: b480 cmpl %d0,%d2 490de: 65e4 bcss 490c4 <_Watchdog_Remove+0x24> <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_Next( Watchdog_Control *the_watchdog ) { return ( (Watchdog_Control *) the_watchdog->Node.next ); 490e0: 2250 moveal %a0@,%a1 break; case WATCHDOG_ACTIVE: case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; 490e2: 42a8 0008 clrl %a0@(8) next_watchdog = _Watchdog_Next( the_watchdog ); if ( _Watchdog_Next(next_watchdog) ) 490e6: 4a91 tstl %a1@ 490e8: 6708 beqs 490f2 <_Watchdog_Remove+0x52> next_watchdog->delta_interval += the_watchdog->delta_interval; 490ea: 2428 0010 movel %a0@(16),%d2 490ee: d5a9 0010 addl %d2,%a1@(16) if ( _Watchdog_Sync_count ) 490f2: 2479 0005 f294 moveal 5f294 <_Watchdog_Sync_count>,%a2 490f8: 4a8a tstl %a2 490fa: 670c beqs 49108 <_Watchdog_Remove+0x68> _Watchdog_Sync_level = _ISR_Nest_level; 490fc: 2479 0005 f1ee moveal 5f1ee <_ISR_Nest_level>,%a2 49102: 23ca 0005 f20a movel %a2,5f20a <_Watchdog_Sync_level> { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 49108: 2468 0004 moveal %a0@(4),%a2 next->previous = previous; previous->next = next; 4910c: 2489 movel %a1,%a2@ Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 4910e: 234a 0004 movel %a2,%a1@(4) _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 49112: 2279 0005 f298 moveal 5f298 <_Watchdog_Ticks_since_boot>,%a1 49118: 2149 0018 movel %a1,%a0@(24) _ISR_Enable( level ); 4911c: 46c1 movew %d1,%sr return( previous_state ); } 4911e: 241f movel %sp@+,%d2 49120: 245f moveal %sp@+,%a2 49122: 4e5e unlk %fp 49124: 4e75 rts _Watchdog_Sync_level = _ISR_Nest_level; _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 49126: 2279 0005 f298 moveal 5f298 <_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; 4912c: 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; 49130: 2149 0018 movel %a1,%a0@(24) _ISR_Enable( level ); 49134: 46c1 movew %d1,%sr return( previous_state ); } 49136: 241f movel %sp@+,%d2 49138: 245f moveal %sp@+,%a2 4913a: 4e5e unlk %fp 4913c: 4e75 rts ... 0004a5f0 <_Watchdog_Report_chain>: ) { ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 4a5f0: 203c 0000 0700 movel #1792,%d0 void _Watchdog_Report_chain( const char *name, Chain_Control *header ) { 4a5f6: 4e56 ffe8 linkw %fp,#-24 4a5fa: 48d7 3c0c moveml %d2-%d3/%a2-%a5,%sp@ 4a5fe: 242e 0008 movel %fp@(8),%d2 4a602: 266e 000c moveal %fp@(12),%a3 ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 4a606: 40c3 movew %sr,%d3 4a608: 8083 orl %d3,%d0 4a60a: 46c0 movew %d0,%sr printk( "Watchdog Chain: %s %p\n", name, header ); 4a60c: 2f0b movel %a3,%sp@- 4a60e: 4bf9 0004 402c lea 4402c ,%a5 4a614: 2f02 movel %d2,%sp@- 4a616: 4879 0005 e932 pea 5e932 <_Status_Object_name_errors_to_status+0x14> 4a61c: 4e95 jsr %a5@ */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 4a61e: 245b moveal %a3@+,%a2 if ( !_Chain_Is_empty( header ) ) { 4a620: 4fef 000c lea %sp@(12),%sp 4a624: b7ca cmpal %a2,%a3 4a626: 672c beqs 4a654 <_Watchdog_Report_chain+0x64> 4a628: 49f9 0004 a66c lea 4a66c <_Watchdog_Report>,%a4 node != _Chain_Tail(header) ; node = node->next ) { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); 4a62e: 2f0a movel %a2,%sp@- 4a630: 42a7 clrl %sp@- 4a632: 4e94 jsr %a4@ _ISR_Disable( level ); printk( "Watchdog Chain: %s %p\n", name, header ); if ( !_Chain_Is_empty( header ) ) { for ( node = header->first ; node != _Chain_Tail(header) ; node = node->next ) 4a634: 2452 moveal %a2@,%a2 Chain_Node *node; _ISR_Disable( level ); printk( "Watchdog Chain: %s %p\n", name, header ); if ( !_Chain_Is_empty( header ) ) { for ( node = header->first ; 4a636: 508f addql #8,%sp 4a638: b7ca cmpal %a2,%a3 4a63a: 66f2 bnes 4a62e <_Watchdog_Report_chain+0x3e> <== ALWAYS TAKEN { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); 4a63c: 2f02 movel %d2,%sp@- 4a63e: 4879 0005 e949 pea 5e949 <_Status_Object_name_errors_to_status+0x2b> 4a644: 4e95 jsr %a5@ 4a646: 508f addql #8,%sp } else { printk( "Chain is empty\n" ); } _ISR_Enable( level ); 4a648: 46c3 movew %d3,%sr } 4a64a: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 4a650: 4e5e unlk %fp 4a652: 4e75 rts _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); } else { printk( "Chain is empty\n" ); 4a654: 4879 0005 e958 pea 5e958 <_Status_Object_name_errors_to_status+0x3a> 4a65a: 4e95 jsr %a5@ 4a65c: 588f addql #4,%sp } _ISR_Enable( level ); 4a65e: 46c3 movew %d3,%sr } 4a660: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 4a666: 4e5e unlk %fp 4a668: 4e75 rts ... 00049140 <_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 ); 49140: 203c 0000 0700 movel #1792,%d0 */ void _Watchdog_Tickle( Chain_Control *header ) { 49146: 4e56 ffe8 linkw %fp,#-24 4914a: 48d7 3c0c moveml %d2-%d3/%a2-%a5,%sp@ 4914e: 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 ); 49152: 40c2 movew %sr,%d2 49154: 8082 orl %d2,%d0 49156: 46c0 movew %d0,%sr */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 49158: 264c moveal %a4,%a3 4915a: 245b moveal %a3@+,%a2 if ( _Chain_Is_empty( header ) ) 4915c: b7ca cmpal %a2,%a3 4915e: 673e beqs 4919e <_Watchdog_Tickle+0x5e> * 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) { 49160: 202a 0010 movel %a2@(16),%d0 49164: 4bf9 0004 90a0 lea 490a0 <_Watchdog_Remove>,%a5 4916a: 6708 beqs 49174 <_Watchdog_Tickle+0x34> the_watchdog->delta_interval--; 4916c: 5380 subql #1,%d0 4916e: 2540 0010 movel %d0,%a2@(16) if ( the_watchdog->delta_interval != 0 ) 49172: 662a bnes 4919e <_Watchdog_Tickle+0x5e> case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 49174: 263c 0000 0700 movel #1792,%d3 if ( the_watchdog->delta_interval != 0 ) goto leave; } do { watchdog_state = _Watchdog_Remove( the_watchdog ); 4917a: 2f0a movel %a2,%sp@- 4917c: 4e95 jsr %a5@ _ISR_Enable( level ); 4917e: 46c2 movew %d2,%sr switch( watchdog_state ) { 49180: 7202 moveq #2,%d1 49182: 588f addql #4,%sp 49184: b280 cmpl %d0,%d1 49186: 6722 beqs 491aa <_Watchdog_Tickle+0x6a> case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 49188: 2003 movel %d3,%d0 4918a: 40c2 movew %sr,%d2 4918c: 8082 orl %d2,%d0 4918e: 46c0 movew %d0,%sr RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First( Chain_Control *header ) { return ( (Watchdog_Control *) header->first ); 49190: 2014 movel %a4@,%d0 49192: 2440 moveal %d0,%a2 the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); 49194: b08b cmpl %a3,%d0 49196: 6706 beqs 4919e <_Watchdog_Tickle+0x5e> 49198: 4aaa 0010 tstl %a2@(16) 4919c: 67dc beqs 4917a <_Watchdog_Tickle+0x3a> leave: _ISR_Enable(level); 4919e: 46c2 movew %d2,%sr } 491a0: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 491a6: 4e5e unlk %fp 491a8: 4e75 rts _ISR_Enable( level ); switch( watchdog_state ) { case WATCHDOG_ACTIVE: (*the_watchdog->routine)( 491aa: 2f2a 0024 movel %a2@(36),%sp@- 491ae: 2f2a 0020 movel %a2@(32),%sp@- 491b2: 206a 001c moveal %a2@(28),%a0 491b6: 4e90 jsr %a0@ 491b8: 508f addql #8,%sp 491ba: 60cc bras 49188 <_Watchdog_Tickle+0x48> <== ALWAYS TAKEN 00049224 <_Workspace_Handler_initialization>: /* * _Workspace_Handler_initialization */ void _Workspace_Handler_initialization(void) { 49224: 4e56 0000 linkw %fp,#0 49228: 2f03 movel %d3,%sp@- uintptr_t memory_available = 0; void *starting_address = Configuration.work_space_start; uintptr_t size = Configuration.work_space_size; 4922a: 2639 0005 d9a8 movel 5d9a8 ,%d3 /* * _Workspace_Handler_initialization */ void _Workspace_Handler_initialization(void) { 49230: 2f02 movel %d2,%sp@- uintptr_t memory_available = 0; void *starting_address = Configuration.work_space_start; 49232: 2439 0005 d9a4 movel 5d9a4 ,%d2 uintptr_t size = Configuration.work_space_size; if ( Configuration.do_zero_of_workspace ) 49238: 4a39 0005 d9cc tstb 5d9cc 4923e: 6628 bnes 49268 <_Workspace_Handler_initialization+0x44> memset( starting_address, 0, size ); memory_available = _Heap_Initialize( 49240: 4878 0004 pea 4 49244: 2f03 movel %d3,%sp@- 49246: 2f02 movel %d2,%sp@- 49248: 4879 0005 f176 pea 5f176 <_Workspace_Area> 4924e: 4eb9 0004 6c6c jsr 46c6c <_Heap_Initialize> starting_address, size, CPU_HEAP_ALIGNMENT ); if ( memory_available == 0 ) 49254: 4fef 0010 lea %sp@(16),%sp 49258: 4a80 tstl %d0 4925a: 671e beqs 4927a <_Workspace_Handler_initialization+0x56> _Internal_error_Occurred( INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_TOO_LITTLE_WORKSPACE ); } 4925c: 242e fff8 movel %fp@(-8),%d2 49260: 262e fffc movel %fp@(-4),%d3 49264: 4e5e unlk %fp 49266: 4e75 rts uintptr_t memory_available = 0; void *starting_address = Configuration.work_space_start; uintptr_t size = Configuration.work_space_size; if ( Configuration.do_zero_of_workspace ) memset( starting_address, 0, size ); 49268: 2f03 movel %d3,%sp@- 4926a: 42a7 clrl %sp@- 4926c: 2f02 movel %d2,%sp@- 4926e: 4eb9 0004 f674 jsr 4f674 49274: 4fef 000c lea %sp@(12),%sp 49278: 60c6 bras 49240 <_Workspace_Handler_initialization+0x1c> <== ALWAYS TAKEN size, CPU_HEAP_ALIGNMENT ); if ( memory_available == 0 ) _Internal_error_Occurred( 4927a: 4878 0003 pea 3 4927e: 4878 0001 pea 1 49282: 42a7 clrl %sp@- 49284: 4eb9 0004 6fd8 jsr 46fd8 <_Internal_error_Occurred> ... 00045cfc : int adjtime( struct timeval *delta, struct timeval *olddelta ) { 45cfc: 4e56 ffec linkw %fp,#-20 45d00: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 45d04: 246e 0008 moveal %fp@(8),%a2 45d08: 266e 000c moveal %fp@(12),%a3 long adjustment; /* * Simple validations */ if ( !delta ) 45d0c: 4a8a tstl %a2 45d0e: 6700 00ec beqw 45dfc rtems_set_errno_and_return_minus_one( EINVAL ); if ( delta->tv_usec >= TOD_MICROSECONDS_PER_SECOND ) 45d12: 202a 0004 movel %a2@(4),%d0 45d16: 0c80 000f 423f cmpil #999999,%d0 45d1c: 6200 00de bhiw 45dfc rtems_set_errno_and_return_minus_one( EINVAL ); if ( olddelta ) { 45d20: 4a8b tstl %a3 45d22: 670a beqs 45d2e olddelta->tv_sec = 0; olddelta->tv_usec = 0; 45d24: 42ab 0004 clrl %a3@(4) 45d28: 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; 45d2c: 4293 clrl %a3@ olddelta->tv_usec = 0; } /* convert delta to microseconds */ adjustment = (delta->tv_sec * TOD_MICROSECONDS_PER_SECOND); 45d2e: 223c 000f 4240 movel #1000000,%d1 45d34: 4c12 1800 mulsl %a2@,%d1 adjustment += delta->tv_usec; /* too small to account for */ if ( adjustment < rtems_configuration_get_microseconds_per_tick() ) 45d38: d081 addl %d1,%d0 45d3a: b0b9 0005 ef00 cmpl 5ef00 ,%d0 45d40: 640c bccs 45d4e _Thread_Enable_dispatch(); /* set the user's output */ if ( olddelta ) *olddelta = *delta; 45d42: 4280 clrl %d0 return 0; } 45d44: 4cee 0c04 ffec moveml %fp@(-20),%d2/%a2-%a3 45d4a: 4e5e unlk %fp 45d4c: 4e75 rts rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 45d4e: 2039 0006 07dc movel 607dc <_Thread_Dispatch_disable_level>,%d0 45d54: 5280 addql #1,%d0 45d56: 23c0 0006 07dc movel %d0,607dc <_Thread_Dispatch_disable_level> * This prevents context switches while we are adjusting the TOD */ _Thread_Disable_dispatch(); _TOD_Get( &ts ); 45d5c: 240e movel %fp,%d2 45d5e: 5182 subql #8,%d2 45d60: 2f02 movel %d2,%sp@- 45d62: 4eb9 0004 769c jsr 4769c <_TOD_Get> ts.tv_sec += delta->tv_sec; ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; 45d68: 202a 0004 movel %a2@(4),%d0 45d6c: 223c 0000 03e8 movel #1000,%d1 45d72: 4c01 0800 mulsl %d1,%d0 /* if adjustment is too much positive */ while ( ts.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 45d76: 588f addql #4,%sp _Thread_Disable_dispatch(); _TOD_Get( &ts ); ts.tv_sec += delta->tv_sec; 45d78: 2212 movel %a2@,%d1 ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; 45d7a: d0ae fffc addl %fp@(-4),%d0 _Thread_Disable_dispatch(); _TOD_Get( &ts ); ts.tv_sec += delta->tv_sec; 45d7e: d3ae fff8 addl %d1,%fp@(-8) ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; 45d82: 2d40 fffc movel %d0,%fp@(-4) /* if adjustment is too much positive */ while ( ts.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 45d86: 0c80 3b9a c9ff cmpil #999999999,%d0 45d8c: 631c blss 45daa 45d8e: 222e fff8 movel %fp@(-8),%d1 * At one point there was a static variable named adjustment * used by this implementation. I don't see any reason for it * to be here based upon the GNU/Linux documentation. */ int adjtime( 45d92: 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; 45d94: 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 ) { 45d9a: 0c80 3b9a c9ff cmpil #999999999,%d0 45da0: 62f0 bhis 45d92 <== ALWAYS TAKEN 45da2: 2d41 fff8 movel %d1,%fp@(-8) 45da6: 2d40 fffc movel %d0,%fp@(-4) 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) ) { 45daa: 0c80 c465 3600 cmpil #-1000000000,%d0 45db0: 621c bhis 45dce <== ALWAYS TAKEN 45db2: 222e fff8 movel %fp@(-8),%d1 * At one point there was a static variable named adjustment * used by this implementation. I don't see any reason for it * to be here based upon the GNU/Linux documentation. */ int adjtime( 45db6: 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; 45db8: 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) ) { 45dbe: 0c80 c465 3600 cmpil #-1000000000,%d0 45dc4: 63f0 blss 45db6 45dc6: 2d40 fffc movel %d0,%fp@(-4) 45dca: 2d41 fff8 movel %d1,%fp@(-8) ts.tv_nsec += TOD_NANOSECONDS_PER_SECOND; ts.tv_sec--; } _TOD_Set( &ts ); 45dce: 2f02 movel %d2,%sp@- 45dd0: 4eb9 0004 7768 jsr 47768 <_TOD_Set> _Thread_Enable_dispatch(); 45dd6: 4eb9 0004 8950 jsr 48950 <_Thread_Enable_dispatch> /* set the user's output */ if ( olddelta ) 45ddc: 588f addql #4,%sp 45dde: 4a8b tstl %a3 45de0: 6700 ff60 beqw 45d42 <== ALWAYS TAKEN *olddelta = *delta; 45de4: 4280 clrl %d0 45de6: 2212 movel %a2@,%d1 45de8: 242a 0004 movel %a2@(4),%d2 45dec: 2681 movel %d1,%a3@ 45dee: 2742 0004 movel %d2,%a3@(4) return 0; } 45df2: 4cee 0c04 ffec moveml %fp@(-20),%d2/%a2-%a3 45df8: 4e5e unlk %fp 45dfa: 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 ); 45dfc: 4eb9 0004 f97c jsr 4f97c <__errno> 45e02: 7216 moveq #22,%d1 45e04: 2040 moveal %d0,%a0 45e06: 70ff moveq #-1,%d0 /* set the user's output */ if ( olddelta ) *olddelta = *delta; return 0; } 45e08: 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 ); 45e0e: 2081 movel %d1,%a0@ /* set the user's output */ if ( olddelta ) *olddelta = *delta; return 0; } 45e10: 4e5e unlk %fp 45e12: 4e75 rts 0004d6e0 : } unsigned int alarm( unsigned int seconds ) { 4d6e0: 4e56 fff4 linkw %fp,#-12 4d6e4: 48d7 001c moveml %d2-%d4,%sp@ 4d6e8: 242e 0008 movel %fp@(8),%d2 /* * Initialize the timer used to implement alarm(). */ if ( !the_timer->routine ) { 4d6ec: 4ab9 0005 f9dc tstl 5f9dc <_POSIX_signals_Alarm_timer+0x1c> 4d6f2: 674e beqs 4d742 _Watchdog_Initialize( the_timer, _POSIX_signals_Alarm_TSR, 0, NULL ); } else { Watchdog_States state; state = _Watchdog_Remove( the_timer ); 4d6f4: 4879 0005 f9c0 pea 5f9c0 <_POSIX_signals_Alarm_timer> 4d6fa: 4eb9 0004 90a0 jsr 490a0 <_Watchdog_Remove> if ( (state == WATCHDOG_ACTIVE) || (state == WATCHDOG_REMOVE_IT) ) { 4d700: 588f addql #4,%sp 4d702: 7201 moveq #1,%d1 4d704: 5580 subql #2,%d0 4d706: b280 cmpl %d0,%d1 4d708: 645e bccs 4d768 4d70a: 4283 clrl %d3 remaining = the_timer->initial - ((the_timer->stop_time - the_timer->start_time) / TOD_TICKS_PER_SECOND); } } if ( seconds ) 4d70c: 4a82 tstl %d2 4d70e: 660c bnes 4d71c <== ALWAYS TAKEN _Watchdog_Insert_seconds( the_timer, seconds ); return remaining; } 4d710: 2003 movel %d3,%d0 4d712: 4cee 001c fff4 moveml %fp@(-12),%d2-%d4 4d718: 4e5e unlk %fp 4d71a: 4e75 rts ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Seconds_chain, the_watchdog ); 4d71c: 4879 0005 f9c0 pea 5f9c0 <_POSIX_signals_Alarm_timer> 4d722: 4879 0005 f220 pea 5f220 <_Watchdog_Seconds_chain> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 4d728: 23c2 0005 f9cc movel %d2,5f9cc <_POSIX_signals_Alarm_timer+0xc> _Watchdog_Insert( &_Watchdog_Seconds_chain, the_watchdog ); 4d72e: 4eb9 0004 8f58 jsr 48f58 <_Watchdog_Insert> 4d734: 508f addql #8,%sp 4d736: 2003 movel %d3,%d0 4d738: 4cee 001c fff4 moveml %fp@(-12),%d2-%d4 4d73e: 4e5e unlk %fp 4d740: 4e75 rts Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 4d742: 42b9 0005 f9c8 clrl 5f9c8 <_POSIX_signals_Alarm_timer+0x8> the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 4d748: 4283 clrl %d3 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 4d74a: 203c 0004 d78c movel #317324,%d0 the_watchdog->id = id; 4d750: 42b9 0005 f9e0 clrl 5f9e0 <_POSIX_signals_Alarm_timer+0x20> Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 4d756: 23c0 0005 f9dc movel %d0,5f9dc <_POSIX_signals_Alarm_timer+0x1c> the_watchdog->id = id; the_watchdog->user_data = user_data; 4d75c: 42b9 0005 f9e4 clrl 5f9e4 <_POSIX_signals_Alarm_timer+0x24> remaining = the_timer->initial - ((the_timer->stop_time - the_timer->start_time) / TOD_TICKS_PER_SECOND); } } if ( seconds ) 4d762: 4a82 tstl %d2 4d764: 67aa beqs 4d710 <== ALWAYS TAKEN 4d766: 60b4 bras 4d71c <== ALWAYS TAKEN * 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); 4d768: 2839 0005 f9d8 movel 5f9d8 <_POSIX_signals_Alarm_timer+0x18>,%d4 4d76e: 98b9 0005 f9d4 subl 5f9d4 <_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 - 4d774: 2639 0005 f9cc movel 5f9cc <_POSIX_signals_Alarm_timer+0xc>,%d3 ((the_timer->stop_time - the_timer->start_time) / TOD_TICKS_PER_SECOND); 4d77a: 4eb9 0004 e1a8 jsr 4e1a8 * 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 - 4d780: 4c40 4004 remul %d0,%d4,%d4 4d784: 9684 subl %d4,%d3 ((the_timer->stop_time - the_timer->start_time) / TOD_TICKS_PER_SECOND); } } if ( seconds ) 4d786: 4a82 tstl %d2 4d788: 6786 beqs 4d710 <== ALWAYS TAKEN 4d78a: 6090 bras 4d71c <== ALWAYS TAKEN 00045c38 : int clock_gettime( clockid_t clock_id, struct timespec *tp ) { 45c38: 4e56 0000 linkw %fp,#0 45c3c: 202e 0008 movel %fp@(8),%d0 45c40: 222e 000c movel %fp@(12),%d1 45c44: 2f02 movel %d2,%sp@- if ( !tp ) 45c46: 4a81 tstl %d1 45c48: 6718 beqs 45c62 rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { 45c4a: 7401 moveq #1,%d2 45c4c: b480 cmpl %d0,%d2 45c4e: 6752 beqs 45ca2 _TOD_Get(tp); return 0; } #ifdef CLOCK_MONOTONIC if ( clock_id == CLOCK_MONOTONIC ) { 45c50: 7404 moveq #4,%d2 45c52: b480 cmpl %d0,%d2 45c54: 6738 beqs 45c8e <== ALWAYS TAKEN return 0; } #endif #ifdef _POSIX_CPUTIME if ( clock_id == CLOCK_PROCESS_CPUTIME ) { 45c56: 7402 moveq #2,%d2 45c58: b480 cmpl %d0,%d2 45c5a: 6732 beqs 45c8e return 0; } #endif #ifdef _POSIX_THREAD_CPUTIME if ( clock_id == CLOCK_THREAD_CPUTIME ) 45c5c: 7203 moveq #3,%d1 45c5e: b280 cmpl %d0,%d1 45c60: 6716 beqs 45c78 rtems_set_errno_and_return_minus_one( ENOSYS ); #endif rtems_set_errno_and_return_minus_one( EINVAL ); 45c62: 4eb9 0004 fe2c jsr 4fe2c <__errno> return 0; } 45c68: 242e fffc movel %fp@(-4),%d2 #ifdef _POSIX_THREAD_CPUTIME if ( clock_id == CLOCK_THREAD_CPUTIME ) rtems_set_errno_and_return_minus_one( ENOSYS ); #endif rtems_set_errno_and_return_minus_one( EINVAL ); 45c6c: 2040 moveal %d0,%a0 45c6e: 7216 moveq #22,%d1 45c70: 70ff moveq #-1,%d0 return 0; } 45c72: 4e5e unlk %fp #ifdef _POSIX_THREAD_CPUTIME if ( clock_id == CLOCK_THREAD_CPUTIME ) rtems_set_errno_and_return_minus_one( ENOSYS ); #endif rtems_set_errno_and_return_minus_one( EINVAL ); 45c74: 2081 movel %d1,%a0@ return 0; } 45c76: 4e75 rts } #endif #ifdef _POSIX_THREAD_CPUTIME if ( clock_id == CLOCK_THREAD_CPUTIME ) rtems_set_errno_and_return_minus_one( ENOSYS ); 45c78: 4eb9 0004 fe2c jsr 4fe2c <__errno> 45c7e: 7458 moveq #88,%d2 45c80: 2040 moveal %d0,%a0 45c82: 70ff moveq #-1,%d0 45c84: 2082 movel %d2,%a0@ #endif rtems_set_errno_and_return_minus_one( EINVAL ); return 0; } 45c86: 242e fffc movel %fp@(-4),%d2 45c8a: 4e5e unlk %fp 45c8c: 4e75 rts } #endif #ifdef _POSIX_CPUTIME if ( clock_id == CLOCK_PROCESS_CPUTIME ) { _TOD_Get_uptime_as_timespec( tp ); 45c8e: 2f01 movel %d1,%sp@- 45c90: 4eb9 0004 7d74 jsr 47d74 <_TOD_Get_uptime_as_timespec> #endif rtems_set_errno_and_return_minus_one( EINVAL ); return 0; } 45c96: 242e fffc movel %fp@(-4),%d2 #endif #ifdef _POSIX_CPUTIME if ( clock_id == CLOCK_PROCESS_CPUTIME ) { _TOD_Get_uptime_as_timespec( tp ); return 0; 45c9a: 588f addql #4,%sp } #endif #ifdef _POSIX_CPUTIME if ( clock_id == CLOCK_PROCESS_CPUTIME ) { _TOD_Get_uptime_as_timespec( tp ); 45c9c: 4280 clrl %d0 #endif rtems_set_errno_and_return_minus_one( EINVAL ); return 0; } 45c9e: 4e5e unlk %fp 45ca0: 4e75 rts { if ( !tp ) rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { _TOD_Get(tp); 45ca2: 2f01 movel %d1,%sp@- 45ca4: 4eb9 0004 7cd8 jsr 47cd8 <_TOD_Get> #endif rtems_set_errno_and_return_minus_one( EINVAL ); return 0; } 45caa: 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; 45cae: 588f addql #4,%sp { if ( !tp ) rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { _TOD_Get(tp); 45cb0: 4280 clrl %d0 #endif rtems_set_errno_and_return_minus_one( EINVAL ); return 0; } 45cb2: 4e5e unlk %fp 45cb4: 4e75 rts ... 00069030 : int clock_settime( clockid_t clock_id, const struct timespec *tp ) { 69030: 4e56 0000 linkw %fp,#0 69034: 202e 0008 movel %fp@(8),%d0 69038: 206e 000c moveal %fp@(12),%a0 if ( !tp ) 6903c: 4a88 tstl %a0 6903e: 6712 beqs 69052 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { 69040: 7201 moveq #1,%d1 69042: b280 cmpl %d0,%d1 69044: 6730 beqs 69076 _Thread_Disable_dispatch(); _TOD_Set( tp ); _Thread_Enable_dispatch(); } #ifdef _POSIX_CPUTIME else if ( clock_id == CLOCK_PROCESS_CPUTIME ) 69046: 7202 moveq #2,%d1 69048: b280 cmpl %d0,%d1 6904a: 6718 beqs 69064 rtems_set_errno_and_return_minus_one( ENOSYS ); #endif #ifdef _POSIX_THREAD_CPUTIME else if ( clock_id == CLOCK_THREAD_CPUTIME ) 6904c: 7203 moveq #3,%d1 6904e: b280 cmpl %d0,%d1 69050: 6712 beqs 69064 rtems_set_errno_and_return_minus_one( ENOSYS ); #endif else rtems_set_errno_and_return_minus_one( EINVAL ); 69052: 4eb9 0008 1038 jsr 81038 <__errno> 69058: 7216 moveq #22,%d1 6905a: 2040 moveal %d0,%a0 6905c: 70ff moveq #-1,%d0 return 0; } 6905e: 4e5e unlk %fp #ifdef _POSIX_THREAD_CPUTIME else if ( clock_id == CLOCK_THREAD_CPUTIME ) rtems_set_errno_and_return_minus_one( ENOSYS ); #endif else rtems_set_errno_and_return_minus_one( EINVAL ); 69060: 2081 movel %d1,%a0@ return 0; } 69062: 4e75 rts else if ( clock_id == CLOCK_PROCESS_CPUTIME ) rtems_set_errno_and_return_minus_one( ENOSYS ); #endif #ifdef _POSIX_THREAD_CPUTIME else if ( clock_id == CLOCK_THREAD_CPUTIME ) rtems_set_errno_and_return_minus_one( ENOSYS ); 69064: 4eb9 0008 1038 jsr 81038 <__errno> 6906a: 7258 moveq #88,%d1 6906c: 2040 moveal %d0,%a0 6906e: 70ff moveq #-1,%d0 #endif else rtems_set_errno_and_return_minus_one( EINVAL ); return 0; } 69070: 4e5e unlk %fp else if ( clock_id == CLOCK_PROCESS_CPUTIME ) rtems_set_errno_and_return_minus_one( ENOSYS ); #endif #ifdef _POSIX_THREAD_CPUTIME else if ( clock_id == CLOCK_THREAD_CPUTIME ) rtems_set_errno_and_return_minus_one( ENOSYS ); 69072: 2081 movel %d1,%a0@ #endif else rtems_set_errno_and_return_minus_one( EINVAL ); return 0; } 69074: 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 ) 69076: 203c 21da e4ff movel #567993599,%d0 6907c: b090 cmpl %a0@,%d0 6907e: 64d2 bccs 69052 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 69080: 2039 000a 6c28 movel a6c28 <_Thread_Dispatch_disable_level>,%d0 69086: 5280 addql #1,%d0 69088: 23c0 000a 6c28 movel %d0,a6c28 <_Thread_Dispatch_disable_level> rtems_set_errno_and_return_minus_one( EINVAL ); _Thread_Disable_dispatch(); _TOD_Set( tp ); 6908e: 2f08 movel %a0,%sp@- 69090: 4eb9 0006 ae3c jsr 6ae3c <_TOD_Set> _Thread_Enable_dispatch(); 69096: 4eb9 0004 e450 jsr 4e450 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( ENOSYS ); #endif else rtems_set_errno_and_return_minus_one( EINVAL ); return 0; 6909c: 588f addql #4,%sp if ( tp->tv_sec < TOD_SECONDS_1970_THROUGH_1988 ) rtems_set_errno_and_return_minus_one( EINVAL ); _Thread_Disable_dispatch(); _TOD_Set( tp ); _Thread_Enable_dispatch(); 6909e: 4280 clrl %d0 #endif else rtems_set_errno_and_return_minus_one( EINVAL ); return 0; } 690a0: 4e5e unlk %fp 690a2: 4e75 rts 0004e834 : int killinfo( pid_t pid, int sig, const union sigval *value ) { 4e834: 4e56 ffd0 linkw %fp,#-48 4e838: 48d7 1cfc moveml %d2-%d7/%a2-%a4,%sp@ 4e83c: 262e 000c movel %fp@(12),%d3 4e840: 246e 0010 moveal %fp@(16),%a2 POSIX_signals_Siginfo_node *psiginfo; /* * Only supported for the "calling process" (i.e. this node). */ if ( pid != getpid() ) 4e844: 4eb9 0004 d6cc jsr 4d6cc 4e84a: b0ae 0008 cmpl %fp@(8),%d0 4e84e: 6600 022c bnew 4ea7c rtems_set_errno_and_return_minus_one( ESRCH ); /* * Validate the signal passed. */ if ( !sig ) 4e852: 4a83 tstl %d3 4e854: 6700 023e beqw 4ea94 static inline bool is_valid_signo( int signo ) { return ((signo) >= 1 && (signo) <= 32 ); 4e858: 2003 movel %d3,%d0 4e85a: 5380 subql #1,%d0 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 4e85c: 721f moveq #31,%d1 4e85e: b280 cmpl %d0,%d1 4e860: 6500 0232 bcsw 4ea94 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 ) 4e864: 2203 movel %d3,%d1 4e866: 2803 movel %d3,%d4 4e868: 7e01 moveq #1,%d7 4e86a: e589 lsll #2,%d1 4e86c: e98c lsll #4,%d4 4e86e: 9881 subl %d1,%d4 4e870: 2044 moveal %d4,%a0 4e872: d1fc 0005 f60a addal #390666,%a0 4e878: be90 cmpl %a0@,%d7 4e87a: 6700 00d4 beqw 4e950 /* * 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 ) ) 4e87e: 7208 moveq #8,%d1 4e880: b283 cmpl %d3,%d1 4e882: 6700 00d8 beqw 4e95c 4e886: 7e04 moveq #4,%d7 4e888: be83 cmpl %d3,%d7 4e88a: 6700 00d0 beqw 4e95c 4e88e: 123c 000b moveb #11,%d1 4e892: b283 cmpl %d3,%d1 4e894: 6700 00c6 beqw 4e95c static inline sigset_t signo_to_mask( uint32_t sig ) { return 1u << (sig - 1); 4e898: 7401 moveq #1,%d2 /* * Build up a siginfo structure */ siginfo = &siginfo_struct; siginfo->si_signo = sig; siginfo->si_code = SI_USER; 4e89a: 7e01 moveq #1,%d7 4e89c: e1aa lsll %d0,%d2 /* * Build up a siginfo structure */ siginfo = &siginfo_struct; siginfo->si_signo = sig; 4e89e: 2d43 fff4 movel %d3,%fp@(-12) siginfo->si_code = SI_USER; 4e8a2: 2d47 fff8 movel %d7,%fp@(-8) if ( !value ) { 4e8a6: 4a8a tstl %a2 4e8a8: 6700 01ca beqw 4ea74 siginfo->si_value.sival_int = 0; } else { siginfo->si_value = *value; 4e8ac: 2d52 fffc movel %a2@,%fp@(-4) 4e8b0: 2039 0005 f154 movel 5f154 <_Thread_Dispatch_disable_level>,%d0 4e8b6: 5280 addql #1,%d0 4e8b8: 23c0 0005 f154 movel %d0,5f154 <_Thread_Dispatch_disable_level> /* * Is the currently executing thread interested? If so then it will * get it an execute it as soon as the dispatcher executes. */ the_thread = _Thread_Executing; 4e8be: 2479 0005 f20e moveal 5f20e <_Thread_Executing>,%a2 api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4e8c4: 206a 010e moveal %a2@(270),%a0 4e8c8: 2028 00c4 movel %a0@(196),%d0 4e8cc: 4680 notl %d0 4e8ce: c082 andl %d2,%d0 4e8d0: 6642 bnes 4e914 /* XXX violation of visibility -- need to define thread queue support */ the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = the_chain->first ; 4e8d2: 2079 0005 f78e moveal 5f78e <_POSIX_signals_Wait_queue>,%a0 4e8d8: b1fc 0005 f792 cmpal #391058,%a0 4e8de: 6700 00ec beqw 4e9cc #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 4e8e2: 2002 movel %d2,%d0 for ( the_node = the_chain->first ; !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { the_thread = (Thread_Control *)the_node; 4e8e4: 2448 moveal %a0,%a2 #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 4e8e6: c0a8 0030 andl %a0@(48),%d0 for ( the_node = the_chain->first ; !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { the_thread = (Thread_Control *)the_node; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4e8ea: 2268 010e moveal %a0@(270),%a1 #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 4e8ee: 6624 bnes 4e914 /* * Is this thread is blocked waiting for another signal but has * not blocked this one? */ if (~api->signals_blocked & mask) 4e8f0: 2029 00c4 movel %a1@(196),%d0 4e8f4: 4680 notl %d0 4e8f6: c082 andl %d2,%d0 4e8f8: 661a bnes 4e914 the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = the_chain->first ; !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { 4e8fa: 2050 moveal %a0@,%a0 the_thread = (Thread_Control *)the_node; 4e8fc: 2448 moveal %a0,%a2 /* XXX violation of visibility -- need to define thread queue support */ the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = the_chain->first ; 4e8fe: b1fc 0005 f792 cmpal #391058,%a0 4e904: 6700 00c6 beqw 4e9cc #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 4e908: 2002 movel %d2,%d0 <== NOT EXECUTED 4e90a: c0a8 0030 andl %a0@(48),%d0 <== NOT EXECUTED for ( the_node = the_chain->first ; !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { the_thread = (Thread_Control *)the_node; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4e90e: 2268 010e moveal %a0@(270),%a1 <== NOT EXECUTED #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 4e912: 67dc beqs 4e8f0 <== NOT EXECUTED * thread needs to do the post context switch extension so it can * evaluate the signals pending. */ process_it: the_thread->do_post_task_switch_extension = true; 4e914: 7001 moveq #1,%d0 4e916: 1540 0074 moveb %d0,%a2@(116) /* * Returns true if the signal was synchronously given to a thread * blocked waiting for the signal. */ if ( _POSIX_signals_Unblock_thread( the_thread, sig, siginfo ) ) { 4e91a: 486e fff4 pea %fp@(-12) 4e91e: 2f03 movel %d3,%sp@- 4e920: 2f0a movel %a2,%sp@- 4e922: 4eb9 0004 eb6c jsr 4eb6c <_POSIX_signals_Unblock_thread> 4e928: 4fef 000c lea %sp@(12),%sp 4e92c: 4a00 tstb %d0 4e92e: 6600 008a bnew 4e9ba /* * 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 ); 4e932: 2f02 movel %d2,%sp@- 4e934: 4eb9 0004 eb3c jsr 4eb3c <_POSIX_signals_Set_process_signals> if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { 4e93a: 588f addql #4,%sp 4e93c: 41f9 0005 f602 lea 5f602 <_POSIX_signals_Vectors>,%a0 4e942: 7202 moveq #2,%d1 4e944: b2b0 4800 cmpl %a0@(00000000,%d4:l),%d1 4e948: 672e beqs 4e978 _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); 4e94a: 4eb9 0004 7dc8 jsr 47dc8 <_Thread_Enable_dispatch> 4e950: 4280 clrl %d0 return 0; } 4e952: 4cee 1cfc ffd0 moveml %fp@(-48),%d2-%d7/%a2-%a4 4e958: 4e5e unlk %fp 4e95a: 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 ); 4e95c: 4eb9 0004 ed88 jsr 4ed88 4e962: 2f03 movel %d3,%sp@- 4e964: 2f00 movel %d0,%sp@- 4e966: 4eb9 0004 ecac jsr 4ecac 4e96c: 508f addql #8,%sp } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); return 0; } 4e96e: 4cee 1cfc ffd0 moveml %fp@(-48),%d2-%d7/%a2-%a4 4e974: 4e5e unlk %fp 4e976: 4e75 rts */ _POSIX_signals_Set_process_signals( mask ); if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { psiginfo = (POSIX_signals_Siginfo_node *) 4e978: 4879 0005 f782 pea 5f782 <_POSIX_signals_Inactive_siginfo> 4e97e: 4eb9 0004 baa8 jsr 4baa8 <_Chain_Get> _Chain_Get( &_POSIX_signals_Inactive_siginfo ); if ( !psiginfo ) { 4e984: 588f addql #4,%sp */ _POSIX_signals_Set_process_signals( mask ); if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { psiginfo = (POSIX_signals_Siginfo_node *) 4e986: 2040 moveal %d0,%a0 _Chain_Get( &_POSIX_signals_Inactive_siginfo ); if ( !psiginfo ) { 4e988: 4a80 tstl %d0 4e98a: 6700 0120 beqw 4eaac _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EAGAIN ); } psiginfo->Info = *siginfo; 4e98e: 216e fff4 0008 movel %fp@(-12),%a0@(8) _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 4e994: 0684 0005 f7d2 addil #391122,%d4 if ( !psiginfo ) { _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EAGAIN ); } psiginfo->Info = *siginfo; 4e99a: 216e fff8 000c movel %fp@(-8),%a0@(12) 4e9a0: 216e fffc 0010 movel %fp@(-4),%a0@(16) _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 4e9a6: 2f00 movel %d0,%sp@- 4e9a8: 2f04 movel %d4,%sp@- 4e9aa: 4eb9 0004 67a4 jsr 467a4 <_Chain_Append> 4e9b0: 508f addql #8,%sp } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); 4e9b2: 4eb9 0004 7dc8 jsr 47dc8 <_Thread_Enable_dispatch> 4e9b8: 6096 bras 4e950 <== ALWAYS TAKEN /* * Returns true if the signal was synchronously given to a thread * blocked waiting for the signal. */ if ( _POSIX_signals_Unblock_thread( the_thread, sig, siginfo ) ) { _Thread_Enable_dispatch(); 4e9ba: 4eb9 0004 7dc8 jsr 47dc8 <_Thread_Enable_dispatch> 4e9c0: 4280 clrl %d0 } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); return 0; } 4e9c2: 4cee 1cfc ffd0 moveml %fp@(-48),%d2-%d7/%a2-%a4 4e9c8: 4e5e unlk %fp 4e9ca: 4e75 rts * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 4e9cc: 4285 clrl %d5 4e9ce: 1a39 0005 d9a2 moveb 5d9a2 ,%d5 4e9d4: 49f9 0005 f114 lea 5f114 <_Objects_Information_table+0x8>,%a4 */ #define _POSIX_signals_Is_interested( _api, _mask ) \ ( ~(_api)->signals_blocked & (_mask) ) int killinfo( 4e9da: 95ca subal %a2,%a2 * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 4e9dc: 5285 addql #1,%d5 for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) { /* * This can occur when no one is interested and ITRON is not configured. */ if ( !_Objects_Information_table[ the_api ] ) 4e9de: 2054 moveal %a4@,%a0 4e9e0: 4a88 tstl %a0 4e9e2: 675e beqs 4ea42 continue; the_info = _Objects_Information_table[ the_api ][ 1 ]; 4e9e4: 2068 0004 moveal %a0@(4),%a0 */ if ( !the_info ) continue; #endif maximum = the_info->maximum; 4e9e8: 4286 clrl %d6 4e9ea: 3c28 000e movew %a0@(14),%d6 object_table = the_info->local_table; 4e9ee: 2268 0018 moveal %a0@(24),%a1 for ( index = 1 ; index <= maximum ; index++ ) { 4e9f2: 4a86 tstl %d6 4e9f4: 674c beqs 4ea42 4e9f6: 5889 addql #4,%a1 4e9f8: 7001 moveq #1,%d0 the_thread = (Thread_Control *) object_table[ index ]; 4e9fa: 2051 moveal %a1@,%a0 #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 4e9fc: 5280 addql #1,%d0 4e9fe: 5889 addql #4,%a1 the_thread = (Thread_Control *) object_table[ index ]; if ( !the_thread ) 4ea00: 4a88 tstl %a0 4ea02: 673a beqs 4ea3e /* * If this thread is of lower priority than the interested thread, * go on to the next thread. */ if ( the_thread->current_priority > interested_priority ) 4ea04: 2228 0014 movel %a0@(20),%d1 4ea08: ba81 cmpl %d1,%d5 4ea0a: 6532 bcss 4ea3e DEBUG_STEP("2"); /* * If this thread is not interested, then go on to the next thread. */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4ea0c: 2668 010e moveal %a0@(270),%a3 4ea10: 2e2b 00c4 movel %a3@(196),%d7 4ea14: 4687 notl %d7 4ea16: ce82 andl %d2,%d7 4ea18: 6724 beqs 4ea3e * * 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 ) { 4ea1a: ba81 cmpl %d1,%d5 4ea1c: 621c bhis 4ea3a * and blocking interruptibutable by signal. * * If the interested thread is ready, don't think about changing. */ if ( !_States_Is_ready( interested->current_state ) ) { 4ea1e: 2e2a 0010 movel %a2@(16),%d7 4ea22: 671a beqs 4ea3e <== ALWAYS TAKEN /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 4ea24: 2668 0010 moveal %a0@(16),%a3 4ea28: 4a8b tstl %a3 4ea2a: 670e beqs 4ea3a continue; } DEBUG_STEP("6"); /* prefer blocked/interruptible over blocked/not interruptible */ if ( !_States_Is_interruptible_by_signal(interested->current_state) ) { 4ea2c: 0807 001c btst #28,%d7 4ea30: 660c bnes 4ea3e DEBUG_STEP("7"); if ( _States_Is_interruptible_by_signal(the_thread->current_state) ) { 4ea32: 2e0b movel %a3,%d7 4ea34: 0807 001c btst #28,%d7 4ea38: 6704 beqs 4ea3e 4ea3a: 2a01 movel %d1,%d5 4ea3c: 2448 moveal %a0,%a2 #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 4ea3e: b086 cmpl %d6,%d0 4ea40: 63b8 blss 4e9fa 4ea42: 588c addql #4,%a4 * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) { 4ea44: b9fc 0005 f120 cmpal #389408,%a4 4ea4a: 6692 bnes 4e9de } } } } if ( interested ) { 4ea4c: 4a8a tstl %a2 4ea4e: 6700 fee2 beqw 4e932 * thread needs to do the post context switch extension so it can * evaluate the signals pending. */ process_it: the_thread->do_post_task_switch_extension = true; 4ea52: 7001 moveq #1,%d0 4ea54: 1540 0074 moveb %d0,%a2@(116) /* * Returns true if the signal was synchronously given to a thread * blocked waiting for the signal. */ if ( _POSIX_signals_Unblock_thread( the_thread, sig, siginfo ) ) { 4ea58: 486e fff4 pea %fp@(-12) 4ea5c: 2f03 movel %d3,%sp@- 4ea5e: 2f0a movel %a2,%sp@- 4ea60: 4eb9 0004 eb6c jsr 4eb6c <_POSIX_signals_Unblock_thread> 4ea66: 4fef 000c lea %sp@(12),%sp 4ea6a: 4a00 tstb %d0 4ea6c: 6700 fec4 beqw 4e932 <== NEVER TAKEN 4ea70: 6000 ff48 braw 4e9ba <== NOT EXECUTED */ siginfo = &siginfo_struct; siginfo->si_signo = sig; siginfo->si_code = SI_USER; if ( !value ) { siginfo->si_value.sival_int = 0; 4ea74: 42ae fffc clrl %fp@(-4) 4ea78: 6000 fe36 braw 4e8b0 <== ALWAYS TAKEN /* * Only supported for the "calling process" (i.e. this node). */ if ( pid != getpid() ) rtems_set_errno_and_return_minus_one( ESRCH ); 4ea7c: 4eb9 0004 ede4 jsr 4ede4 <__errno> 4ea82: 7603 moveq #3,%d3 4ea84: 2040 moveal %d0,%a0 4ea86: 70ff moveq #-1,%d0 4ea88: 2083 movel %d3,%a0@ } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); return 0; } 4ea8a: 4cee 1cfc ffd0 moveml %fp@(-48),%d2-%d7/%a2-%a4 4ea90: 4e5e unlk %fp 4ea92: 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 ); 4ea94: 4eb9 0004 ede4 jsr 4ede4 <__errno> 4ea9a: 7416 moveq #22,%d2 4ea9c: 2040 moveal %d0,%a0 4ea9e: 70ff moveq #-1,%d0 4eaa0: 2082 movel %d2,%a0@ } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); return 0; } 4eaa2: 4cee 1cfc ffd0 moveml %fp@(-48),%d2-%d7/%a2-%a4 4eaa8: 4e5e unlk %fp 4eaaa: 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(); 4eaac: 4eb9 0004 7dc8 jsr 47dc8 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EAGAIN ); 4eab2: 4eb9 0004 ede4 jsr 4ede4 <__errno> 4eab8: 720b moveq #11,%d1 4eaba: 2040 moveal %d0,%a0 4eabc: 70ff moveq #-1,%d0 } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); return 0; } 4eabe: 4cee 1cfc ffd0 moveml %fp@(-48),%d2-%d7/%a2-%a4 psiginfo = (POSIX_signals_Siginfo_node *) _Chain_Get( &_POSIX_signals_Inactive_siginfo ); if ( !psiginfo ) { _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EAGAIN ); 4eac4: 2081 movel %d1,%a0@ } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); return 0; } 4eac6: 4e5e unlk %fp 4eac8: 4e75 rts ... 0004b5c4 : int mq_notify( mqd_t mqdes, const struct sigevent *notification ) { 4b5c4: 4e56 fffc linkw %fp,#-4 4b5c8: 2f0a movel %a2,%sp@- 4b5ca: 2f02 movel %d2,%sp@- 4b5cc: 486e fffc pea %fp@(-4) 4b5d0: 2f2e 0008 movel %fp@(8),%sp@- 4b5d4: 4879 0006 8f5c pea 68f5c <_POSIX_Message_queue_Information_fds> 4b5da: 242e 000c movel %fp@(12),%d2 4b5de: 4eb9 0004 eca8 jsr 4eca8 <_Objects_Get> POSIX_Message_queue_Control *the_mq; POSIX_Message_queue_Control_fd *the_mq_fd; Objects_Locations location; the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); switch ( location ) { 4b5e4: 4fef 000c lea %sp@(12),%sp 4b5e8: 4aae fffc tstl %fp@(-4) 4b5ec: 671a beqs 4b608 #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); 4b5ee: 4eb9 0005 66dc jsr 566dc <__errno> } 4b5f4: 242e fff4 movel %fp@(-12),%d2 #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); 4b5f8: 2040 moveal %d0,%a0 4b5fa: 7209 moveq #9,%d1 4b5fc: 70ff moveq #-1,%d0 } 4b5fe: 246e fff8 moveal %fp@(-8),%a2 4b602: 4e5e unlk %fp #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); 4b604: 2081 movel %d1,%a0@ } 4b606: 4e75 rts the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); switch ( location ) { case OBJECTS_LOCAL: the_mq = the_mq_fd->Queue; 4b608: 2040 moveal %d0,%a0 4b60a: 2468 0010 moveal %a0@(16),%a2 if ( notification ) { 4b60e: 4a82 tstl %d2 4b610: 673c beqs 4b64e if ( _CORE_message_queue_Is_notify_enabled( &the_mq->Message_queue ) ) { 4b612: 4aaa 007a tstl %a2@(122) 4b616: 6648 bnes 4b660 rtems_set_errno_and_return_minus_one( EBUSY ); } _CORE_message_queue_Set_notify( &the_mq->Message_queue, NULL, NULL ); the_mq->notification = *notification; 4b618: 2242 moveal %d2,%a1 4b61a: 41ea 008e lea %a2@(142),%a0 CORE_message_queue_Control *the_message_queue, CORE_message_queue_Notify_Handler the_handler, void *the_argument ) { the_message_queue->notify_handler = the_handler; 4b61e: 203c 0004 b680 movel #308864,%d0 the_message_queue->notify_argument = the_argument; 4b624: 42aa 007e clrl %a2@(126) 4b628: 20d9 movel %a1@+,%a0@+ 4b62a: 20d9 movel %a1@+,%a0@+ 4b62c: 20d9 movel %a1@+,%a0@+ 4b62e: 20d9 movel %a1@+,%a0@+ 4b630: 2091 movel %a1@,%a0@ CORE_message_queue_Control *the_message_queue, CORE_message_queue_Notify_Handler the_handler, void *the_argument ) { the_message_queue->notify_handler = the_handler; 4b632: 2540 007a movel %d0,%a2@(122) the_message_queue->notify_argument = the_argument; 4b636: 254a 007e movel %a2,%a2@(126) _CORE_message_queue_Set_notify( &the_mq->Message_queue, NULL, NULL ); } _Thread_Enable_dispatch(); 4b63a: 4eb9 0004 f588 jsr 4f588 <_Thread_Enable_dispatch> 4b640: 4280 clrl %d0 case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); } 4b642: 242e fff4 movel %fp@(-12),%d2 4b646: 246e fff8 moveal %fp@(-8),%a2 4b64a: 4e5e unlk %fp 4b64c: 4e75 rts 4b64e: 42aa 007e clrl %a2@(126) CORE_message_queue_Control *the_message_queue, CORE_message_queue_Notify_Handler the_handler, void *the_argument ) { the_message_queue->notify_handler = the_handler; 4b652: 42aa 007a clrl %a2@(122) _CORE_message_queue_Set_notify( &the_mq->Message_queue, NULL, NULL ); } _Thread_Enable_dispatch(); 4b656: 4eb9 0004 f588 jsr 4f588 <_Thread_Enable_dispatch> 4b65c: 4280 clrl %d0 4b65e: 60e2 bras 4b642 <== ALWAYS TAKEN case OBJECTS_LOCAL: the_mq = the_mq_fd->Queue; if ( notification ) { if ( _CORE_message_queue_Is_notify_enabled( &the_mq->Message_queue ) ) { _Thread_Enable_dispatch(); 4b660: 4eb9 0004 f588 jsr 4f588 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EBUSY ); 4b666: 7410 moveq #16,%d2 4b668: 4eb9 0005 66dc jsr 566dc <__errno> case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); } 4b66e: 246e fff8 moveal %fp@(-8),%a2 the_mq = the_mq_fd->Queue; if ( notification ) { if ( _CORE_message_queue_Is_notify_enabled( &the_mq->Message_queue ) ) { _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EBUSY ); 4b672: 2040 moveal %d0,%a0 4b674: 70ff moveq #-1,%d0 4b676: 2082 movel %d2,%a0@ case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); } 4b678: 242e fff4 movel %fp@(-12),%d2 4b67c: 4e5e unlk %fp 4b67e: 4e75 rts 0004b6b8 : int oflag, ... /* mode_t mode, */ /* struct mq_attr attr */ ) { 4b6b8: 4e56 ffd8 linkw %fp,#-40 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 4b6bc: 2039 0006 8b20 movel 68b20 <_Thread_Dispatch_disable_level>,%d0 4b6c2: 5280 addql #1,%d0 4b6c4: 48d7 0c7c moveml %d2-%d6/%a2-%a3,%sp@ 4b6c8: 23c0 0006 8b20 movel %d0,68b20 <_Thread_Dispatch_disable_level> 4b6ce: 2a2e 0008 movel %fp@(8),%d5 4b6d2: 242e 000c movel %fp@(12),%d2 POSIX_Message_queue_Control_fd *the_mq_fd; Objects_Locations location; _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { 4b6d6: 2802 movel %d2,%d4 4b6d8: 0284 0000 0200 andil #512,%d4 4b6de: 6600 00c4 bnew 4b7a4 */ RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control_fd * _POSIX_Message_queue_Allocate_fd( void ) { return (POSIX_Message_queue_Control_fd *) 4b6e2: 4879 0006 8f5c pea 68f5c <_POSIX_Message_queue_Information_fds> 4b6e8: 4286 clrl %d6 4b6ea: 4eb9 0004 e80c jsr 4e80c <_Objects_Allocate> attr = (struct mq_attr *) va_arg( arg, struct mq_attr * ); va_end(arg); } the_mq_fd = _POSIX_Message_queue_Allocate_fd(); if ( !the_mq_fd ) { 4b6f0: 588f addql #4,%sp 4b6f2: 2440 moveal %d0,%a2 4b6f4: 4a80 tstl %d0 4b6f6: 6700 00c6 beqw 4b7be <== ALWAYS TAKEN _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( ENFILE ); } the_mq_fd->oflag = oflag; 4b6fa: 2542 0014 movel %d2,%a2@(20) status = _POSIX_Message_queue_Name_to_id( name, &the_mq_id ); 4b6fe: 486e fffc pea %fp@(-4) 4b702: 2f05 movel %d5,%sp@- 4b704: 4eb9 0005 2834 jsr 52834 <_POSIX_Message_queue_Name_to_id> * If the name to id translation worked, then the message queue exists * and we can just return a pointer to the id. Otherwise we may * need to check to see if this is a "message queue does not exist" * or some other miscellaneous error on the name. */ if ( status ) { 4b70a: 508f addql #8,%sp _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( ENFILE ); } the_mq_fd->oflag = oflag; status = _POSIX_Message_queue_Name_to_id( name, &the_mq_id ); 4b70c: 2600 movel %d0,%d3 * If the name to id translation worked, then the message queue exists * and we can just return a pointer to the id. Otherwise we may * need to check to see if this is a "message queue does not exist" * or some other miscellaneous error on the name. */ if ( status ) { 4b70e: 6662 bnes 4b772 } else { /* name -> ID translation succeeded */ /* * Check for existence with creation. */ if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { 4b710: 0282 0000 0a00 andil #2560,%d2 4b716: 0c82 0000 0a00 cmpil #2560,%d2 4b71c: 6700 010c beqw 4b82a <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Get ( Objects_Id id, Objects_Locations *location ) { return (POSIX_Message_queue_Control *) 4b720: 486e fff4 pea %fp@(-12) _Objects_Open_string( &_POSIX_Message_queue_Information_fds, &the_mq_fd->Object, NULL ); _Thread_Enable_dispatch(); 4b724: 47f9 0004 f588 lea 4f588 <_Thread_Enable_dispatch>,%a3 4b72a: 2f2e fffc movel %fp@(-4),%sp@- 4b72e: 4879 0006 8dee pea 68dee <_POSIX_Message_queue_Information> 4b734: 4eb9 0004 eca8 jsr 4eca8 <_Objects_Get> #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4b73a: 4281 clrl %d1 /* * In this case we need to do an ID->pointer conversion to * check the mode. */ the_mq = _POSIX_Message_queue_Get( the_mq_id, &location ); the_mq->open_count += 1; 4b73c: 2040 moveal %d0,%a0 4b73e: 52a8 0016 addql #1,%a0@(22) 4b742: 2079 0006 8f74 moveal 68f74 <_POSIX_Message_queue_Information_fds+0x18>,%a0 4b748: 322a 000a movew %a2@(10),%d1 /* * In this case we need to do an ID->pointer conversion to * check the mode. */ the_mq = _POSIX_Message_queue_Get( the_mq_id, &location ); 4b74c: 2d40 fff8 movel %d0,%fp@(-8) 4b750: 218a 1c00 movel %a2,%a0@(00000000,%d1:l:4) the_mq->open_count += 1; the_mq_fd->Queue = the_mq; 4b754: 2540 0010 movel %d0,%a2@(16) the_object ); #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) /* ASSERT: information->is_string */ the_object->name.name_p = name; 4b758: 42aa 000c clrl %a2@(12) _Objects_Open_string( &_POSIX_Message_queue_Information_fds, &the_mq_fd->Object, NULL ); _Thread_Enable_dispatch(); 4b75c: 4e93 jsr %a3@ _Thread_Enable_dispatch(); 4b75e: 4e93 jsr %a3@ return (mqd_t)the_mq_fd->Object.id; 4b760: 202a 0008 movel %a2@(8),%d0 4b764: 4fef 000c lea %sp@(12),%sp ); _Thread_Enable_dispatch(); return (mqd_t) the_mq_fd->Object.id; } 4b768: 4cee 0c7c ffd8 moveml %fp@(-40),%d2-%d6/%a2-%a3 4b76e: 4e5e unlk %fp 4b770: 4e75 rts if ( status ) { /* * 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) ) ) { 4b772: 7002 moveq #2,%d0 4b774: b083 cmpl %d3,%d0 4b776: 6764 beqs 4b7dc RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free_fd ( POSIX_Message_queue_Control_fd *the_mq_fd ) { _Objects_Free( &_POSIX_Message_queue_Information_fds, &the_mq_fd->Object ); 4b778: 2f0a movel %a2,%sp@- 4b77a: 4879 0006 8f5c pea 68f5c <_POSIX_Message_queue_Information_fds> 4b780: 4eb9 0004 eb44 jsr 4eb44 <_Objects_Free> _POSIX_Message_queue_Free_fd( the_mq_fd ); _Thread_Enable_dispatch(); 4b786: 4eb9 0004 f588 jsr 4f588 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one_cast( status, mqd_t ); 4b78c: 4eb9 0005 66dc jsr 566dc <__errno> 4b792: 508f addql #8,%sp 4b794: 2040 moveal %d0,%a0 4b796: 70ff moveq #-1,%d0 4b798: 2083 movel %d3,%a0@ ); _Thread_Enable_dispatch(); return (mqd_t) the_mq_fd->Object.id; } 4b79a: 4cee 0c7c ffd8 moveml %fp@(-40),%d2-%d6/%a2-%a3 4b7a0: 4e5e unlk %fp 4b7a2: 4e75 rts _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { va_start(arg, oflag); mode = (mode_t) va_arg( arg, unsigned int ); attr = (struct mq_attr *) va_arg( arg, struct mq_attr * ); 4b7a4: 2c2e 0014 movel %fp@(20),%d6 */ RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control_fd * _POSIX_Message_queue_Allocate_fd( void ) { return (POSIX_Message_queue_Control_fd *) 4b7a8: 4879 0006 8f5c pea 68f5c <_POSIX_Message_queue_Information_fds> 4b7ae: 4eb9 0004 e80c jsr 4e80c <_Objects_Allocate> va_end(arg); } the_mq_fd = _POSIX_Message_queue_Allocate_fd(); if ( !the_mq_fd ) { 4b7b4: 588f addql #4,%sp 4b7b6: 2440 moveal %d0,%a2 4b7b8: 4a80 tstl %d0 4b7ba: 6600 ff3e bnew 4b6fa _Thread_Enable_dispatch(); 4b7be: 4eb9 0004 f588 jsr 4f588 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( ENFILE ); 4b7c4: 7417 moveq #23,%d2 4b7c6: 4eb9 0005 66dc jsr 566dc <__errno> 4b7cc: 2040 moveal %d0,%a0 4b7ce: 70ff moveq #-1,%d0 4b7d0: 2082 movel %d2,%a0@ ); _Thread_Enable_dispatch(); return (mqd_t) the_mq_fd->Object.id; } 4b7d2: 4cee 0c7c ffd8 moveml %fp@(-40),%d2-%d6/%a2-%a3 4b7d8: 4e5e unlk %fp 4b7da: 4e75 rts if ( status ) { /* * 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) ) ) { 4b7dc: 4a84 tstl %d4 4b7de: 6798 beqs 4b778 /* * At this point, the message queue does not exist and everything has been * checked. We should go ahead and create a message queue. */ status = _POSIX_Message_queue_Create_support( 4b7e0: 486e fff8 pea %fp@(-8) 4b7e4: 2f06 movel %d6,%sp@- 4b7e6: 4878 0001 pea 1 4b7ea: 2f05 movel %d5,%sp@- 4b7ec: 4eb9 0005 26b4 jsr 526b4 <_POSIX_Message_queue_Create_support> ); /* * errno was set by Create_support, so don't set it again. */ if ( status == -1 ) { 4b7f2: 4fef 0010 lea %sp@(16),%sp 4b7f6: 72ff moveq #-1,%d1 4b7f8: b280 cmpl %d0,%d1 4b7fa: 675c beqs 4b858 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4b7fc: 4280 clrl %d0 4b7fe: 2079 0006 8f74 moveal 68f74 <_POSIX_Message_queue_Information_fds+0x18>,%a0 4b804: 302a 000a movew %a2@(10),%d0 _POSIX_Message_queue_Free_fd( the_mq_fd ); _Thread_Enable_dispatch(); return (mqd_t) -1; } the_mq_fd->Queue = the_mq; 4b808: 256e fff8 0010 movel %fp@(-8),%a2@(16) 4b80e: 218a 0c00 movel %a2,%a0@(00000000,%d0:l:4) the_object ); #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) /* ASSERT: information->is_string */ the_object->name.name_p = name; 4b812: 42aa 000c clrl %a2@(12) &_POSIX_Message_queue_Information_fds, &the_mq_fd->Object, NULL ); _Thread_Enable_dispatch(); 4b816: 4eb9 0004 f588 jsr 4f588 <_Thread_Enable_dispatch> return (mqd_t) the_mq_fd->Object.id; 4b81c: 202a 0008 movel %a2@(8),%d0 } 4b820: 4cee 0c7c ffd8 moveml %fp@(-40),%d2-%d6/%a2-%a3 4b826: 4e5e unlk %fp 4b828: 4e75 rts RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free_fd ( POSIX_Message_queue_Control_fd *the_mq_fd ) { _Objects_Free( &_POSIX_Message_queue_Information_fds, &the_mq_fd->Object ); 4b82a: 2f0a movel %a2,%sp@- 4b82c: 4879 0006 8f5c pea 68f5c <_POSIX_Message_queue_Information_fds> 4b832: 4eb9 0004 eb44 jsr 4eb44 <_Objects_Free> /* * Check for existence with creation. */ if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { _POSIX_Message_queue_Free_fd( the_mq_fd ); _Thread_Enable_dispatch(); 4b838: 4eb9 0004 f588 jsr 4f588 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one_cast( EEXIST, mqd_t ); 4b83e: 4eb9 0005 66dc jsr 566dc <__errno> 4b844: 508f addql #8,%sp 4b846: 7211 moveq #17,%d1 4b848: 2040 moveal %d0,%a0 4b84a: 70ff moveq #-1,%d0 ); _Thread_Enable_dispatch(); return (mqd_t) the_mq_fd->Object.id; } 4b84c: 4cee 0c7c ffd8 moveml %fp@(-40),%d2-%d6/%a2-%a3 * Check for existence with creation. */ if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { _POSIX_Message_queue_Free_fd( the_mq_fd ); _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one_cast( EEXIST, mqd_t ); 4b852: 2081 movel %d1,%a0@ ); _Thread_Enable_dispatch(); return (mqd_t) the_mq_fd->Object.id; } 4b854: 4e5e unlk %fp 4b856: 4e75 rts 4b858: 2f0a movel %a2,%sp@- 4b85a: 4879 0006 8f5c pea 68f5c <_POSIX_Message_queue_Information_fds> 4b860: 4eb9 0004 eb44 jsr 4eb44 <_Objects_Free> /* * errno was set by Create_support, so don't set it again. */ if ( status == -1 ) { _POSIX_Message_queue_Free_fd( the_mq_fd ); _Thread_Enable_dispatch(); 4b866: 4eb9 0004 f588 jsr 4f588 <_Thread_Enable_dispatch> return (mqd_t) -1; 4b86c: 508f addql #8,%sp /* * errno was set by Create_support, so don't set it again. */ if ( status == -1 ) { _POSIX_Message_queue_Free_fd( the_mq_fd ); _Thread_Enable_dispatch(); 4b86e: 70ff moveq #-1,%d0 ); _Thread_Enable_dispatch(); return (mqd_t) the_mq_fd->Object.id; } 4b870: 4cee 0c7c ffd8 moveml %fp@(-40),%d2-%d6/%a2-%a3 4b876: 4e5e unlk %fp 4b878: 4e75 rts ... 0004bb88 : int mq_setattr( mqd_t mqdes, const struct mq_attr *mqstat, struct mq_attr *omqstat ) { 4bb88: 4e56 fffc linkw %fp,#-4 4bb8c: 2f0b movel %a3,%sp@- 4bb8e: 266e 000c moveal %fp@(12),%a3 4bb92: 2f0a movel %a2,%sp@- 4bb94: 246e 0010 moveal %fp@(16),%a2 POSIX_Message_queue_Control_fd *the_mq_fd; CORE_message_queue_Control *the_core_mq; Objects_Locations location; if ( !mqstat ) 4bb98: 4a8b tstl %a3 4bb9a: 6770 beqs 4bc0c <== ALWAYS TAKEN 4bb9c: 486e fffc pea %fp@(-4) 4bba0: 2f2e 0008 movel %fp@(8),%sp@- 4bba4: 4879 0006 8f5c pea 68f5c <_POSIX_Message_queue_Information_fds> 4bbaa: 4eb9 0004 eca8 jsr 4eca8 <_Objects_Get> rtems_set_errno_and_return_minus_one( EINVAL ); the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); switch ( location ) { 4bbb0: 4fef 000c lea %sp@(12),%sp 4bbb4: 2040 moveal %d0,%a0 4bbb6: 4aae fffc tstl %fp@(-4) 4bbba: 6636 bnes 4bbf2 case OBJECTS_LOCAL: the_core_mq = &the_mq_fd->Queue->Message_queue; 4bbbc: 2268 0010 moveal %a0@(16),%a1 /* * Return the old values. */ if ( omqstat ) { 4bbc0: 4a8a tstl %a2 4bbc2: 6716 beqs 4bbda omqstat->mq_flags = the_mq_fd->oflag; 4bbc4: 24a8 0014 movel %a0@(20),%a2@ omqstat->mq_msgsize = the_core_mq->maximum_message_size; 4bbc8: 2569 0066 0008 movel %a1@(102),%a2@(8) omqstat->mq_maxmsg = the_core_mq->maximum_pending_messages; 4bbce: 2569 005e 0004 movel %a1@(94),%a2@(4) omqstat->mq_curmsgs = the_core_mq->number_of_pending_messages; 4bbd4: 2569 0062 000c movel %a1@(98),%a2@(12) } the_mq_fd->oflag = mqstat->mq_flags; 4bbda: 2153 0014 movel %a3@,%a0@(20) _Thread_Enable_dispatch(); 4bbde: 4eb9 0004 f588 jsr 4f588 <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); } 4bbe4: 246e fff4 moveal %fp@(-12),%a2 omqstat->mq_maxmsg = the_core_mq->maximum_pending_messages; omqstat->mq_curmsgs = the_core_mq->number_of_pending_messages; } the_mq_fd->oflag = mqstat->mq_flags; _Thread_Enable_dispatch(); 4bbe8: 4280 clrl %d0 case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); } 4bbea: 266e fff8 moveal %fp@(-8),%a3 4bbee: 4e5e unlk %fp 4bbf0: 4e75 rts #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); 4bbf2: 4eb9 0005 66dc jsr 566dc <__errno> } 4bbf8: 246e fff4 moveal %fp@(-12),%a2 #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); 4bbfc: 2040 moveal %d0,%a0 4bbfe: 7209 moveq #9,%d1 4bc00: 70ff moveq #-1,%d0 } 4bc02: 266e fff8 moveal %fp@(-8),%a3 4bc06: 4e5e unlk %fp #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); 4bc08: 2081 movel %d1,%a0@ } 4bc0a: 4e75 rts POSIX_Message_queue_Control_fd *the_mq_fd; CORE_message_queue_Control *the_core_mq; Objects_Locations location; if ( !mqstat ) rtems_set_errno_and_return_minus_one( EINVAL ); 4bc0c: 4eb9 0005 66dc jsr 566dc <__errno> case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); } 4bc12: 246e fff4 moveal %fp@(-12),%a2 POSIX_Message_queue_Control_fd *the_mq_fd; CORE_message_queue_Control *the_core_mq; Objects_Locations location; if ( !mqstat ) rtems_set_errno_and_return_minus_one( EINVAL ); 4bc16: 2040 moveal %d0,%a0 4bc18: 7216 moveq #22,%d1 4bc1a: 70ff moveq #-1,%d0 case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); } 4bc1c: 266e fff8 moveal %fp@(-8),%a3 4bc20: 4e5e unlk %fp POSIX_Message_queue_Control_fd *the_mq_fd; CORE_message_queue_Control *the_core_mq; Objects_Locations location; if ( !mqstat ) rtems_set_errno_and_return_minus_one( EINVAL ); 4bc22: 2081 movel %d1,%a0@ case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); } 4bc24: 4e75 rts ... 00066c70 : int nanosleep( const struct timespec *rqtp, struct timespec *rmtp ) { 66c70: 4e56 0000 linkw %fp,#0 66c74: 2f0b movel %a3,%sp@- 66c76: 2f0a movel %a2,%sp@- 66c78: 246e 0008 moveal %fp@(8),%a2 Watchdog_Interval ticks; if ( !_Timespec_Is_valid( rqtp ) ) 66c7c: 2f0a movel %a2,%sp@- int nanosleep( const struct timespec *rqtp, struct timespec *rmtp ) { 66c7e: 266e 000c moveal %fp@(12),%a3 Watchdog_Interval ticks; if ( !_Timespec_Is_valid( rqtp ) ) 66c82: 4eb9 0006 6da8 jsr 66da8 <_Timespec_Is_valid> 66c88: 588f addql #4,%sp 66c8a: 4a00 tstb %d0 66c8c: 6700 00e6 beqw 66d74 * Return EINVAL if the delay interval is negative. * * NOTE: This behavior is beyond the POSIX specification. * FSU and GNU/Linux pthreads shares this behavior. */ if ( rqtp->tv_sec < 0 || rqtp->tv_nsec < 0 ) 66c90: 4a92 tstl %a2@ 66c92: 6d00 00e0 bltw 66d74 <== ALWAYS TAKEN 66c96: 4aaa 0004 tstl %a2@(4) 66c9a: 6d00 00d8 bltw 66d74 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); ticks = _Timespec_To_ticks( rqtp ); 66c9e: 2f0a movel %a2,%sp@- 66ca0: 4eb9 0005 4cb4 jsr 54cb4 <_Timespec_To_ticks> * A nanosleep for zero time is implemented as a yield. * This behavior is also beyond the POSIX specification but is * consistent with the RTEMS API and yields desirable behavior. */ if ( !ticks ) { 66ca6: 588f addql #4,%sp * FSU and GNU/Linux pthreads shares this behavior. */ if ( rqtp->tv_sec < 0 || rqtp->tv_nsec < 0 ) rtems_set_errno_and_return_minus_one( EINVAL ); ticks = _Timespec_To_ticks( rqtp ); 66ca8: 2440 moveal %d0,%a2 * A nanosleep for zero time is implemented as a yield. * This behavior is also beyond the POSIX specification but is * consistent with the RTEMS API and yields desirable behavior. */ if ( !ticks ) { 66caa: 4a80 tstl %d0 66cac: 6634 bnes 66ce2 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 66cae: 2039 0006 cf0c movel 6cf0c <_Thread_Dispatch_disable_level>,%d0 66cb4: 5280 addql #1,%d0 66cb6: 23c0 0006 cf0c movel %d0,6cf0c <_Thread_Dispatch_disable_level> _Thread_Disable_dispatch(); _Thread_Yield_processor(); 66cbc: 4eb9 0004 e198 jsr 4e198 <_Thread_Yield_processor> _Thread_Enable_dispatch(); 66cc2: 4eb9 0004 d3ac jsr 4d3ac <_Thread_Enable_dispatch> if ( rmtp ) { 66cc8: 4a8b tstl %a3 66cca: 6700 009a beqw 66d66 rmtp->tv_sec = 0; rmtp->tv_nsec = 0; 66cce: 42ab 0004 clrl %a3@(4) rtems_set_errno_and_return_minus_one( EINTR ); #endif } return 0; } 66cd2: 246e fff8 moveal %fp@(-8),%a2 if ( !ticks ) { _Thread_Disable_dispatch(); _Thread_Yield_processor(); _Thread_Enable_dispatch(); if ( rmtp ) { rmtp->tv_sec = 0; 66cd6: 4293 clrl %a3@ rtems_set_errno_and_return_minus_one( EINTR ); #endif } return 0; } 66cd8: 266e fffc moveal %fp@(-4),%a3 _Thread_Disable_dispatch(); _Thread_Yield_processor(); _Thread_Enable_dispatch(); if ( rmtp ) { rmtp->tv_sec = 0; rmtp->tv_nsec = 0; 66cdc: 4280 clrl %d0 rtems_set_errno_and_return_minus_one( EINTR ); #endif } return 0; } 66cde: 4e5e unlk %fp 66ce0: 4e75 rts 66ce2: 2039 0006 cf0c movel 6cf0c <_Thread_Dispatch_disable_level>,%d0 66ce8: 5280 addql #1,%d0 66cea: 23c0 0006 cf0c movel %d0,6cf0c <_Thread_Dispatch_disable_level> /* * Block for the desired amount of time */ _Thread_Disable_dispatch(); _Thread_Set_state( 66cf0: 2f3c 1000 0008 movel #268435464,%sp@- 66cf6: 2f39 0006 cfc6 movel 6cfc6 <_Thread_Executing>,%sp@- 66cfc: 4eb9 0004 dd30 jsr 4dd30 <_Thread_Set_state> STATES_DELAYING | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Watchdog_Initialize( &_Thread_Executing->Timer, _Thread_Delay_ended, _Thread_Executing->Object.id, 66d02: 2079 0006 cfc6 moveal 6cfc6 <_Thread_Executing>,%a0 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 66d08: 203c 0004 d218 movel #315928,%d0 66d0e: 2140 0064 movel %d0,%a0@(100) _Thread_Disable_dispatch(); _Thread_Set_state( _Thread_Executing, STATES_DELAYING | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Watchdog_Initialize( 66d12: 2028 0008 movel %a0@(8),%d0 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 66d16: 42a8 0050 clrl %a0@(80) the_watchdog->routine = routine; the_watchdog->id = id; 66d1a: 2140 0068 movel %d0,%a0@(104) the_watchdog->user_data = user_data; 66d1e: 42a8 006c clrl %a0@(108) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 66d22: 214a 0054 movel %a2,%a0@(84) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 66d26: 4868 0048 pea %a0@(72) 66d2a: 4879 0006 cfe4 pea 6cfe4 <_Watchdog_Ticks_chain> 66d30: 4eb9 0004 e5e4 jsr 4e5e4 <_Watchdog_Insert> _Thread_Delay_ended, _Thread_Executing->Object.id, NULL ); _Watchdog_Insert_ticks( &_Thread_Executing->Timer, ticks ); _Thread_Enable_dispatch(); 66d36: 4eb9 0004 d3ac jsr 4d3ac <_Thread_Enable_dispatch> /* calculate time remaining */ if ( rmtp ) { 66d3c: 4fef 0010 lea %sp@(16),%sp 66d40: 4a8b tstl %a3 66d42: 6722 beqs 66d66 ticks -= _Thread_Executing->Timer.stop_time - _Thread_Executing->Timer.start_time; 66d44: 2079 0006 cfc6 moveal 6cfc6 <_Thread_Executing>,%a0 _Thread_Enable_dispatch(); /* calculate time remaining */ if ( rmtp ) { ticks -= 66d4a: 2028 005c movel %a0@(92),%d0 66d4e: 90a8 0060 subl %a0@(96),%d0 66d52: 45f2 0800 lea %a2@(00000000,%d0:l),%a2 _Thread_Executing->Timer.stop_time - _Thread_Executing->Timer.start_time; _Timespec_From_ticks( ticks, rmtp ); 66d56: 2f0b movel %a3,%sp@- 66d58: 2f0a movel %a2,%sp@- 66d5a: 4eb9 0005 4c78 jsr 54c78 <_Timespec_From_ticks> */ #if defined(RTEMS_POSIX_API) /* * If there is time remaining, then we were interrupted by a signal. */ if ( ticks ) 66d60: 508f addql #8,%sp 66d62: 4a8a tstl %a2 66d64: 6628 bnes 66d8e rtems_set_errno_and_return_minus_one( EINTR ); #endif } return 0; } 66d66: 246e fff8 moveal %fp@(-8),%a2 #if defined(RTEMS_POSIX_API) /* * If there is time remaining, then we were interrupted by a signal. */ if ( ticks ) rtems_set_errno_and_return_minus_one( EINTR ); 66d6a: 4280 clrl %d0 #endif } return 0; } 66d6c: 266e fffc moveal %fp@(-4),%a3 66d70: 4e5e unlk %fp 66d72: 4e75 rts * * NOTE: This behavior is beyond the POSIX specification. * FSU and GNU/Linux pthreads shares this behavior. */ if ( rqtp->tv_sec < 0 || rqtp->tv_nsec < 0 ) rtems_set_errno_and_return_minus_one( EINVAL ); 66d74: 4eb9 0005 8378 jsr 58378 <__errno> rtems_set_errno_and_return_minus_one( EINTR ); #endif } return 0; } 66d7a: 246e fff8 moveal %fp@(-8),%a2 * * NOTE: This behavior is beyond the POSIX specification. * FSU and GNU/Linux pthreads shares this behavior. */ if ( rqtp->tv_sec < 0 || rqtp->tv_nsec < 0 ) rtems_set_errno_and_return_minus_one( EINVAL ); 66d7e: 2040 moveal %d0,%a0 66d80: 7216 moveq #22,%d1 66d82: 70ff moveq #-1,%d0 rtems_set_errno_and_return_minus_one( EINTR ); #endif } return 0; } 66d84: 266e fffc moveal %fp@(-4),%a3 66d88: 4e5e unlk %fp * * NOTE: This behavior is beyond the POSIX specification. * FSU and GNU/Linux pthreads shares this behavior. */ if ( rqtp->tv_sec < 0 || rqtp->tv_nsec < 0 ) rtems_set_errno_and_return_minus_one( EINVAL ); 66d8a: 2081 movel %d1,%a0@ rtems_set_errno_and_return_minus_one( EINTR ); #endif } return 0; } 66d8c: 4e75 rts #if defined(RTEMS_POSIX_API) /* * If there is time remaining, then we were interrupted by a signal. */ if ( ticks ) rtems_set_errno_and_return_minus_one( EINTR ); 66d8e: 4eb9 0005 8378 jsr 58378 <__errno> #endif } return 0; } 66d94: 246e fff8 moveal %fp@(-8),%a2 #if defined(RTEMS_POSIX_API) /* * If there is time remaining, then we were interrupted by a signal. */ if ( ticks ) rtems_set_errno_and_return_minus_one( EINTR ); 66d98: 2040 moveal %d0,%a0 66d9a: 7204 moveq #4,%d1 66d9c: 70ff moveq #-1,%d0 #endif } return 0; } 66d9e: 266e fffc moveal %fp@(-4),%a3 66da2: 4e5e unlk %fp #if defined(RTEMS_POSIX_API) /* * If there is time remaining, then we were interrupted by a signal. */ if ( ticks ) rtems_set_errno_and_return_minus_one( EINTR ); 66da4: 2081 movel %d1,%a0@ #endif } return 0; } 66da6: 4e75 rts 000460fc : int pthread_barrier_init( pthread_barrier_t *barrier, const pthread_barrierattr_t *attr, unsigned int count ) { 460fc: 4e56 ffe0 linkw %fp,#-32 46100: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ 46104: 246e 0008 moveal %fp@(8),%a2 46108: 262e 000c movel %fp@(12),%d3 4610c: 242e 0010 movel %fp@(16),%d2 const pthread_barrierattr_t *the_attr; /* * Error check parameters */ if ( !barrier ) 46110: 4a8a tstl %a2 46112: 677a beqs 4618e return EINVAL; if ( count == 0 ) 46114: 4a82 tstl %d2 46116: 6776 beqs 4618e return EINVAL; /* * If the user passed in NULL, use the default attributes */ if ( attr ) { 46118: 4a83 tstl %d3 4611a: 6700 0090 beqw 461ac 4611e: 2043 moveal %d3,%a0 } /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) 46120: 4a90 tstl %a0@ 46122: 676a beqs 4618e return EINVAL; switch ( the_attr->process_shared ) { 46124: 4aa8 0004 tstl %a0@(4) 46128: 6664 bnes 4618e <== ALWAYS TAKEN rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 4612a: 2039 0006 0888 movel 60888 <_Thread_Dispatch_disable_level>,%d0 46130: 5280 addql #1,%d0 /* * Convert from POSIX attributes to Core Barrier attributes */ the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE; the_attributes.maximum_count = count; 46132: 2d42 fffc movel %d2,%fp@(-4) 46136: 23c0 0006 0888 movel %d0,60888 <_Thread_Dispatch_disable_level> } /* * Convert from POSIX attributes to Core Barrier attributes */ the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE; 4613c: 42ae fff8 clrl %fp@(-8) * This function allocates a barrier control block from * the inactive chain of free barrier control blocks. */ RTEMS_INLINE_ROUTINE POSIX_Barrier_Control *_POSIX_Barrier_Allocate( void ) { return (POSIX_Barrier_Control *) 46140: 4879 0006 0bca pea 60bca <_POSIX_Barrier_Information> 46146: 4eb9 0004 83d4 jsr 483d4 <_Objects_Allocate> */ _Thread_Disable_dispatch(); /* prevents deletion */ the_barrier = _POSIX_Barrier_Allocate(); if ( !the_barrier ) { 4614c: 588f addql #4,%sp 4614e: 2640 moveal %d0,%a3 46150: 4a80 tstl %d0 46152: 6746 beqs 4619a _Thread_Enable_dispatch(); return EAGAIN; } _CORE_barrier_Initialize( &the_barrier->Barrier, &the_attributes ); 46154: 486e fff8 pea %fp@(-8) 46158: 486b 0010 pea %a3@(16) 4615c: 4eb9 0004 7a44 jsr 47a44 <_CORE_barrier_Initialize> #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 46162: 202b 0008 movel %a3@(8),%d0 46166: 4281 clrl %d1 46168: 2079 0006 0be2 moveal 60be2 <_POSIX_Barrier_Information+0x18>,%a0 4616e: 3200 movew %d0,%d1 46170: 218b 1c00 movel %a3,%a0@(00000000,%d1:l:4) _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 46174: 42ab 000c clrl %a3@(12) ); /* * Exit the critical section and return the user an operational barrier */ *barrier = the_barrier->Object.id; 46178: 2480 movel %d0,%a2@ _Thread_Enable_dispatch(); 4617a: 4eb9 0004 9080 jsr 49080 <_Thread_Enable_dispatch> return 0; 46180: 508f addql #8,%sp /* * Exit the critical section and return the user an operational barrier */ *barrier = the_barrier->Object.id; _Thread_Enable_dispatch(); 46182: 4280 clrl %d0 return 0; } 46184: 4cee 0c0c ffe0 moveml %fp@(-32),%d2-%d3/%a2-%a3 4618a: 4e5e unlk %fp 4618c: 4e75 rts /* * Exit the critical section and return the user an operational barrier */ *barrier = the_barrier->Object.id; _Thread_Enable_dispatch(); return 0; 4618e: 7016 moveq #22,%d0 } 46190: 4cee 0c0c ffe0 moveml %fp@(-32),%d2-%d3/%a2-%a3 46196: 4e5e unlk %fp 46198: 4e75 rts _Thread_Disable_dispatch(); /* prevents deletion */ the_barrier = _POSIX_Barrier_Allocate(); if ( !the_barrier ) { _Thread_Enable_dispatch(); 4619a: 4eb9 0004 9080 jsr 49080 <_Thread_Enable_dispatch> 461a0: 700b moveq #11,%d0 * Exit the critical section and return the user an operational barrier */ *barrier = the_barrier->Object.id; _Thread_Enable_dispatch(); return 0; } 461a2: 4cee 0c0c ffe0 moveml %fp@(-32),%d2-%d3/%a2-%a3 461a8: 4e5e unlk %fp 461aa: 4e75 rts * If the user passed in NULL, use the default attributes */ if ( attr ) { the_attr = attr; } else { (void) pthread_barrierattr_init( &my_attr ); 461ac: 260e movel %fp,%d3 461ae: 0683 ffff fff0 addil #-16,%d3 461b4: 2f03 movel %d3,%sp@- 461b6: 4eb9 0004 6038 jsr 46038 461bc: 588f addql #4,%sp 461be: 2043 moveal %d3,%a0 } /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) 461c0: 4a90 tstl %a0@ 461c2: 6600 ff60 bnew 46124 <== NEVER TAKEN 461c6: 60c6 bras 4618e <== NOT EXECUTED 00045b48 : void pthread_cleanup_push( void (*routine)( void * ), void *arg ) { 45b48: 4e56 0000 linkw %fp,#0 45b4c: 2f03 movel %d3,%sp@- 45b4e: 262e 000c movel %fp@(12),%d3 45b52: 2f02 movel %d2,%sp@- 45b54: 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 ) 45b58: 6754 beqs 45bae rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 45b5a: 2039 0006 0340 movel 60340 <_Thread_Dispatch_disable_level>,%d0 45b60: 5280 addql #1,%d0 45b62: 23c0 0006 0340 movel %d0,60340 <_Thread_Dispatch_disable_level> return; _Thread_Disable_dispatch(); handler = _Workspace_Allocate( sizeof( POSIX_Cancel_Handler_control ) ); 45b68: 4878 0010 pea 10 45b6c: 4eb9 0004 9fc8 jsr 49fc8 <_Workspace_Allocate> if ( handler ) { 45b72: 588f addql #4,%sp 45b74: 4a80 tstl %d0 45b76: 6726 beqs 45b9e <== ALWAYS TAKEN thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; handler_stack = &thread_support->Cancellation_Handlers; 45b78: 2079 0006 03fa moveal 603fa <_Thread_Executing>,%a0 45b7e: 2228 010e movel %a0@(270),%d1 handler->routine = routine; 45b82: 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; 45b84: 0681 0000 00d8 addil #216,%d1 handler->routine = routine; 45b8a: 2142 0008 movel %d2,%a0@(8) handler->arg = arg; 45b8e: 2143 000c movel %d3,%a0@(12) _Chain_Append( handler_stack, &handler->Node ); 45b92: 2f00 movel %d0,%sp@- 45b94: 2f01 movel %d1,%sp@- 45b96: 4eb9 0004 7558 jsr 47558 <_Chain_Append> 45b9c: 508f addql #8,%sp } _Thread_Enable_dispatch(); } 45b9e: 242e fff8 movel %fp@(-8),%d2 45ba2: 262e fffc movel %fp@(-4),%d3 45ba6: 4e5e unlk %fp handler->routine = routine; handler->arg = arg; _Chain_Append( handler_stack, &handler->Node ); } _Thread_Enable_dispatch(); 45ba8: 4ef9 0004 8afc jmp 48afc <_Thread_Enable_dispatch> } 45bae: 242e fff8 movel %fp@(-8),%d2 45bb2: 262e fffc movel %fp@(-4),%d3 45bb6: 4e5e unlk %fp 45bb8: 4e75 rts ... 00046a2c : int pthread_cond_init( pthread_cond_t *cond, const pthread_condattr_t *attr ) { 46a2c: 4e56 0000 linkw %fp,#0 46a30: 202e 000c movel %fp@(12),%d0 46a34: 2f0b movel %a3,%sp@- 46a36: 2f0a movel %a2,%sp@- POSIX_Condition_variables_Control *the_cond; const pthread_condattr_t *the_attr; if ( attr ) the_attr = attr; 46a38: 45f9 0005 f28c lea 5f28c <_POSIX_Condition_variables_Default_attributes>,%a2 46a3e: 4a80 tstl %d0 46a40: 6702 beqs 46a44 46a42: 2440 moveal %d0,%a2 /* * Be careful about attributes when global!!! */ if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) 46a44: 7001 moveq #1,%d0 46a46: b0aa 0004 cmpl %a2@(4),%d0 46a4a: 6704 beqs 46a50 <== ALWAYS TAKEN return EINVAL; if ( !the_attr->is_initialized ) 46a4c: 4a92 tstl %a2@ 46a4e: 660e bnes 46a5e *cond = the_cond->Object.id; _Thread_Enable_dispatch(); return 0; } 46a50: 246e fff8 moveal %fp@(-8),%a2 *cond = the_cond->Object.id; _Thread_Enable_dispatch(); return 0; 46a54: 7016 moveq #22,%d0 } 46a56: 266e fffc moveal %fp@(-4),%a3 46a5a: 4e5e unlk %fp 46a5c: 4e75 rts rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 46a5e: 2039 0006 1b94 movel 61b94 <_Thread_Dispatch_disable_level>,%d0 46a64: 5280 addql #1,%d0 46a66: 23c0 0006 1b94 movel %d0,61b94 <_Thread_Dispatch_disable_level> */ RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *_POSIX_Condition_variables_Allocate( void ) { return (POSIX_Condition_variables_Control *) 46a6c: 4879 0006 1f62 pea 61f62 <_POSIX_Condition_variables_Information> 46a72: 4eb9 0004 9350 jsr 49350 <_Objects_Allocate> _Thread_Disable_dispatch(); the_cond = _POSIX_Condition_variables_Allocate(); if ( !the_cond ) { 46a78: 588f addql #4,%sp 46a7a: 2640 moveal %d0,%a3 46a7c: 4a80 tstl %d0 46a7e: 6752 beqs 46ad2 return ENOMEM; } the_cond->process_shared = the_attr->process_shared; the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX; 46a80: 42ab 0014 clrl %a3@(20) if ( !the_cond ) { _Thread_Enable_dispatch(); return ENOMEM; } the_cond->process_shared = the_attr->process_shared; 46a84: 276a 0004 0010 movel %a2@(4),%a3@(16) the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX; /* XXX some more initialization might need to go here */ _Thread_queue_Initialize( 46a8a: 4878 0074 pea 74 46a8e: 4878 0800 pea 800 46a92: 42a7 clrl %sp@- 46a94: 486b 0018 pea %a3@(24) 46a98: 4eb9 0004 a820 jsr 4a820 <_Thread_queue_Initialize> #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 46a9e: 202b 0008 movel %a3@(8),%d0 46aa2: 4281 clrl %d1 46aa4: 2079 0006 1f7a moveal 61f7a <_POSIX_Condition_variables_Information+0x18>,%a0 46aaa: 3200 movew %d0,%d1 46aac: 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; 46ab0: 42ab 000c clrl %a3@(12) &_POSIX_Condition_variables_Information, &the_cond->Object, 0 ); *cond = the_cond->Object.id; 46ab4: 206e 0008 moveal %fp@(8),%a0 46ab8: 2080 movel %d0,%a0@ _Thread_Enable_dispatch(); 46aba: 4eb9 0004 9ffc jsr 49ffc <_Thread_Enable_dispatch> return 0; } 46ac0: 246e fff8 moveal %fp@(-8),%a2 *cond = the_cond->Object.id; _Thread_Enable_dispatch(); return 0; 46ac4: 4fef 0010 lea %sp@(16),%sp 0 ); *cond = the_cond->Object.id; _Thread_Enable_dispatch(); 46ac8: 4280 clrl %d0 return 0; } 46aca: 266e fffc moveal %fp@(-4),%a3 46ace: 4e5e unlk %fp 46ad0: 4e75 rts _Thread_Disable_dispatch(); the_cond = _POSIX_Condition_variables_Allocate(); if ( !the_cond ) { _Thread_Enable_dispatch(); 46ad2: 4eb9 0004 9ffc jsr 49ffc <_Thread_Enable_dispatch> *cond = the_cond->Object.id; _Thread_Enable_dispatch(); return 0; } 46ad8: 246e fff8 moveal %fp@(-8),%a2 _Thread_Disable_dispatch(); the_cond = _POSIX_Condition_variables_Allocate(); if ( !the_cond ) { _Thread_Enable_dispatch(); 46adc: 700c moveq #12,%d0 *cond = the_cond->Object.id; _Thread_Enable_dispatch(); return 0; } 46ade: 266e fffc moveal %fp@(-4),%a3 46ae2: 4e5e unlk %fp 46ae4: 4e75 rts ... 0004688c : */ int pthread_condattr_destroy( pthread_condattr_t *attr ) { 4688c: 4e56 0000 linkw %fp,#0 46890: 206e 0008 moveal %fp@(8),%a0 if ( !attr || attr->is_initialized == false ) 46894: 4a88 tstl %a0 46896: 670c beqs 468a4 46898: 4a90 tstl %a0@ 4689a: 6708 beqs 468a4 <== ALWAYS TAKEN return EINVAL; attr->is_initialized = false; 4689c: 4280 clrl %d0 return 0; } 4689e: 4e5e unlk %fp ) { if ( !attr || attr->is_initialized == false ) return EINVAL; attr->is_initialized = false; 468a0: 4290 clrl %a0@ return 0; } 468a2: 4e75 rts { if ( !attr || attr->is_initialized == false ) return EINVAL; attr->is_initialized = false; return 0; 468a4: 7016 moveq #22,%d0 } 468a6: 4e5e unlk %fp 468a8: 4e75 rts ... 00045fb0 : pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine)( void * ), void *arg ) { 45fb0: 4e56 ffa8 linkw %fp,#-88 45fb4: 202e 000c movel %fp@(12),%d0 45fb8: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 45fbc: 262e 0010 movel %fp@(16),%d3 int schedpolicy = SCHED_RR; struct sched_param schedparam; Objects_Name name; int rc; if ( !start_routine ) 45fc0: 6700 01c4 beqw 46186 return EFAULT; the_attr = (attr) ? attr : &_POSIX_Threads_Default_attributes; 45fc4: 45f9 0005 dc4c lea 5dc4c <_POSIX_Threads_Default_attributes>,%a2 45fca: 4a80 tstl %d0 45fcc: 6702 beqs 45fd0 45fce: 2440 moveal %d0,%a2 if ( !the_attr->is_initialized ) 45fd0: 4a92 tstl %a2@ 45fd2: 6726 beqs 45ffa * 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) ) 45fd4: 4aaa 0004 tstl %a2@(4) 45fd8: 670c beqs 45fe6 45fda: 2039 0005 ed92 movel 5ed92 ,%d0 45fe0: b0aa 0008 cmpl %a2@(8),%d0 45fe4: 6214 bhis 45ffa * 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 ) { 45fe6: 202a 0010 movel %a2@(16),%d0 45fea: 7201 moveq #1,%d1 45fec: b280 cmpl %d0,%d1 45fee: 6700 014a beqw 4613a 45ff2: 123c 0002 moveb #2,%d1 45ff6: b280 cmpl %d0,%d1 45ff8: 670e beqs 46008 * Return the id and indicate we successfully created the thread */ *thread = the_thread->Object.id; _RTEMS_Unlock_allocator(); return 0; 45ffa: 7416 moveq #22,%d2 } 45ffc: 2002 movel %d2,%d0 45ffe: 4cee 3cfc ffa8 moveml %fp@(-88),%d2-%d7/%a2-%a5 46004: 4e5e unlk %fp 46006: 4e75 rts schedpolicy = api->schedpolicy; schedparam = api->schedparam; break; case PTHREAD_EXPLICIT_SCHED: schedpolicy = the_attr->schedpolicy; 46008: 2e2a 0014 movel %a2@(20),%d7 schedparam = the_attr->schedparam; 4600c: 47ee ffe0 lea %fp@(-32),%a3 46010: 2c0e movel %fp,%d6 46012: 0686 ffff ffe4 addil #-28,%d6 46018: 2046 moveal %d6,%a0 4601a: 2a0e movel %fp,%d5 4601c: 0685 ffff ffe8 addil #-24,%d5 46022: 2245 moveal %d5,%a1 46024: 280e movel %fp,%d4 46026: 0684 ffff ffec addil #-20,%d4 4602c: 4bee fff0 lea %fp@(-16),%a5 46030: 49ee fff4 lea %fp@(-12),%a4 46034: 26aa 0018 movel %a2@(24),%a3@ 46038: 20aa 001c movel %a2@(28),%a0@ 4603c: 2044 moveal %d4,%a0 4603e: 22aa 0020 movel %a2@(32),%a1@ 46042: 20aa 0024 movel %a2@(36),%a0@ 46046: 2aaa 0028 movel %a2@(40),%a5@ 4604a: 28aa 002c movel %a2@(44),%a4@ /* * Check the contentionscope since rtems only supports PROCESS wide * contention (i.e. no system wide contention). */ if ( the_attr->contentionscope != PTHREAD_SCOPE_PROCESS ) 4604e: 243c 0000 0086 movel #134,%d2 46054: 4aaa 000c tstl %a2@(12) 46058: 66a2 bnes 45ffc return ENOTSUP; /* * Interpret the scheduling parameters. */ if ( !_POSIX_Priority_Is_valid( schedparam.sched_priority ) ) 4605a: 2f2e ffe0 movel %fp@(-32),%sp@- 4605e: 4eb9 0004 c5a8 jsr 4c5a8 <_POSIX_Priority_Is_valid> 46064: 588f addql #4,%sp 46066: 4a00 tstb %d0 46068: 6790 beqs 45ffa <== ALWAYS TAKEN core_priority = _POSIX_Priority_To_core( schedparam.sched_priority ); /* * Set the core scheduling policy information. */ rc = _POSIX_Thread_Translate_sched_param( 4606a: 486e fff8 pea %fp@(-8) 4606e: 486e fffc pea %fp@(-4) * Interpret the scheduling parameters. */ if ( !_POSIX_Priority_Is_valid( schedparam.sched_priority ) ) return EINVAL; core_priority = _POSIX_Priority_To_core( schedparam.sched_priority ); 46072: 226e ffe0 moveal %fp@(-32),%a1 46076: 2d49 ffdc movel %a1,%fp@(-36) /* * Set the core scheduling policy information. */ rc = _POSIX_Thread_Translate_sched_param( 4607a: 2f0b movel %a3,%sp@- RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( int priority ) { return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1); 4607c: 1039 0005 ed96 moveb 5ed96 ,%d0 46082: 1d40 ffdb moveb %d0,%fp@(-37) 46086: 2f07 movel %d7,%sp@- 46088: 4eb9 0004 c5cc jsr 4c5cc <_POSIX_Thread_Translate_sched_param> schedpolicy, &schedparam, &budget_algorithm, &budget_callout ); if ( rc ) 4608e: 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( 46092: 2400 movel %d0,%d2 schedpolicy, &schedparam, &budget_algorithm, &budget_callout ); if ( rc ) 46094: 6600 ff66 bnew 45ffc #endif /* * Lock the allocator mutex for protection */ _RTEMS_Lock_allocator(); 46098: 2f39 0006 05d6 movel 605d6 <_RTEMS_Allocator_Mutex>,%sp@- 4609e: 4eb9 0004 7aa4 jsr 47aa4 <_API_Mutex_Lock> * _POSIX_Threads_Allocate */ RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate( void ) { return (Thread_Control *) _Objects_Allocate( &_POSIX_Threads_Information ); 460a4: 4879 0006 070a pea 6070a <_POSIX_Threads_Information> 460aa: 4eb9 0004 8430 jsr 48430 <_Objects_Allocate> * Allocate the thread control block. * * NOTE: Global threads are not currently supported. */ the_thread = _POSIX_Threads_Allocate(); if ( !the_thread ) { 460b0: 508f addql #8,%sp 460b2: 2d40 ffd0 movel %d0,%fp@(-48) 460b6: 6700 01c8 beqw 46280 /* * Initialize the core thread for this task. */ name.name_p = NULL; /* posix threads don't have a name by default */ status = _Thread_Initialize( 460ba: 226a 0008 moveal %a2@(8),%a1 460be: 4281 clrl %d1 460c0: 42a7 clrl %sp@- 460c2: 2039 0005 ed92 movel 5ed92 ,%d0 460c8: 42a7 clrl %sp@- 460ca: 2f2e fff8 movel %fp@(-8),%sp@- 460ce: 2f2e fffc movel %fp@(-4),%sp@- 460d2: 4878 0001 pea 1 460d6: 122e ffdb moveb %fp@(-37),%d1 460da: 92ae ffdc subl %fp@(-36),%d1 460de: d080 addl %d0,%d0 460e0: 2f01 movel %d1,%sp@- 460e2: 4878 0001 pea 1 460e6: b3c0 cmpal %d0,%a1 460e8: 6302 blss 460ec 460ea: 2009 movel %a1,%d0 460ec: 2f00 movel %d0,%sp@- 460ee: 2f2a 0004 movel %a2@(4),%sp@- 460f2: 2f2e ffd0 movel %fp@(-48),%sp@- 460f6: 4879 0006 070a pea 6070a <_POSIX_Threads_Information> 460fc: 4eb9 0004 91d0 jsr 491d0 <_Thread_Initialize> budget_callout, 0, /* isr level */ name /* posix threads don't have a name */ ); if ( !status ) { 46102: 4fef 002c lea %sp@(44),%sp 46106: 4a00 tstb %d0 46108: 6600 008a bnew 46194 RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free ( Thread_Control *the_pthread ) { _Objects_Free( &_POSIX_Threads_Information, &the_pthread->Object ); 4610c: 2f2e ffd0 movel %fp@(-48),%sp@- _POSIX_Threads_Free( the_thread ); _RTEMS_Unlock_allocator(); 46110: 740b moveq #11,%d2 46112: 4879 0006 070a pea 6070a <_POSIX_Threads_Information> 46118: 4eb9 0004 8768 jsr 48768 <_Objects_Free> 4611e: 2f39 0006 05d6 movel 605d6 <_RTEMS_Allocator_Mutex>,%sp@- 46124: 4eb9 0004 7b04 jsr 47b04 <_API_Mutex_Unlock> return EAGAIN; 4612a: 4fef 000c lea %sp@(12),%sp */ *thread = the_thread->Object.id; _RTEMS_Unlock_allocator(); return 0; } 4612e: 2002 movel %d2,%d0 46130: 4cee 3cfc ffa8 moveml %fp@(-88),%d2-%d7/%a2-%a5 46136: 4e5e unlk %fp 46138: 4e75 rts * 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 ]; 4613a: 2079 0006 05de moveal 605de <_Thread_Executing>,%a0 schedpolicy = api->schedpolicy; schedparam = api->schedparam; 46140: 47ee ffe0 lea %fp@(-32),%a3 46144: 2c0e movel %fp,%d6 46146: 0686 ffff ffe4 addil #-28,%d6 4614c: 2a0e movel %fp,%d5 4614e: 0685 ffff ffe8 addil #-24,%d5 46154: 280e movel %fp,%d4 46156: 0684 ffff ffec addil #-20,%d4 4615c: 4bee fff0 lea %fp@(-16),%a5 46160: 49ee fff4 lea %fp@(-12),%a4 * 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 ]; 46164: 2268 010e moveal %a0@(270),%a1 schedpolicy = api->schedpolicy; schedparam = api->schedparam; 46168: 41e9 0080 lea %a1@(128),%a0 * attributes structure. */ switch ( the_attr->inheritsched ) { case PTHREAD_INHERIT_SCHED: api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; schedpolicy = api->schedpolicy; 4616c: 2e29 007c movel %a1@(124),%d7 schedparam = api->schedparam; 46170: 2246 moveal %d6,%a1 46172: 2698 movel %a0@+,%a3@ 46174: 2298 movel %a0@+,%a1@ 46176: 2245 moveal %d5,%a1 46178: 2298 movel %a0@+,%a1@ 4617a: 2244 moveal %d4,%a1 4617c: 2298 movel %a0@+,%a1@ 4617e: 2a98 movel %a0@+,%a5@ 46180: 2890 movel %a0@,%a4@ break; 46182: 6000 feca braw 4604e <== ALWAYS TAKEN int schedpolicy = SCHED_RR; struct sched_param schedparam; Objects_Name name; int rc; if ( !start_routine ) 46186: 740e moveq #14,%d2 */ *thread = the_thread->Object.id; _RTEMS_Unlock_allocator(); return 0; } 46188: 2002 movel %d2,%d0 4618a: 4cee 3cfc ffa8 moveml %fp@(-88),%d2-%d7/%a2-%a5 46190: 4e5e unlk %fp 46192: 4e75 rts } /* * finish initializing the per API structure */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 46194: 206e ffd0 moveal %fp@(-48),%a0 46198: 2068 010e moveal %a0@(270),%a0 api->Attributes = *the_attr; 4619c: 2248 moveal %a0,%a1 api->detachstate = the_attr->detachstate; api->schedpolicy = schedpolicy; api->schedparam = schedparam; 4619e: 2208 movel %a0,%d1 461a0: 0681 0000 0080 addil #128,%d1 } /* * finish initializing the per API structure */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 461a6: 2d48 ffdc movel %a0,%fp@(-36) api->Attributes = *the_attr; 461aa: 204a moveal %a2,%a0 api->detachstate = the_attr->detachstate; 461ac: 45ea 0034 lea %a2@(52),%a2 /* * finish initializing the per API structure */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; api->Attributes = *the_attr; 461b0: 22d8 movel %a0@+,%a1@+ 461b2: 22d8 movel %a0@+,%a1@+ 461b4: 22d8 movel %a0@+,%a1@+ 461b6: 22d8 movel %a0@+,%a1@+ 461b8: 22d8 movel %a0@+,%a1@+ 461ba: 22d8 movel %a0@+,%a1@+ 461bc: 22d8 movel %a0@+,%a1@+ 461be: 22d8 movel %a0@+,%a1@+ 461c0: 22d8 movel %a0@+,%a1@+ 461c2: 22d8 movel %a0@+,%a1@+ 461c4: 22d8 movel %a0@+,%a1@+ 461c6: 22d8 movel %a0@+,%a1@+ 461c8: 22d8 movel %a0@+,%a1@+ 461ca: 2290 movel %a0@,%a1@ api->detachstate = the_attr->detachstate; api->schedpolicy = schedpolicy; api->schedparam = schedparam; 461cc: 2041 moveal %d1,%a0 * finish initializing the per API structure */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; api->Attributes = *the_attr; api->detachstate = the_attr->detachstate; 461ce: 226e ffdc moveal %fp@(-36),%a1 461d2: 2352 0038 movel %a2@,%a1@(56) * This insures we evaluate the process-wide signals pending when we * first run. * * NOTE: Since the thread starts with all unblocked, this is necessary. */ the_thread->do_post_task_switch_extension = true; 461d6: 7001 moveq #1,%d0 */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; api->Attributes = *the_attr; api->detachstate = the_attr->detachstate; api->schedpolicy = schedpolicy; 461d8: 2347 007c movel %d7,%a1@(124) api->schedparam = schedparam; 461dc: 20d3 movel %a3@,%a0@+ 461de: 2246 moveal %d6,%a1 461e0: 20d1 movel %a1@,%a0@+ 461e2: 2245 moveal %d5,%a1 461e4: 20d1 movel %a1@,%a0@+ 461e6: 2244 moveal %d4,%a1 461e8: 20d1 movel %a1@,%a0@+ 461ea: 20d5 movel %a5@,%a0@+ 461ec: 2094 movel %a4@,%a0@ * This insures we evaluate the process-wide signals pending when we * first run. * * NOTE: Since the thread starts with all unblocked, this is necessary. */ the_thread->do_post_task_switch_extension = true; 461ee: 206e ffd0 moveal %fp@(-48),%a0 461f2: 1140 0074 moveb %d0,%a0@(116) /* * POSIX threads are allocated and started in one operation. */ status = _Thread_Start( 461f6: 42a7 clrl %sp@- 461f8: 2f2e 0014 movel %fp@(20),%sp@- 461fc: 2f03 movel %d3,%sp@- 461fe: 4878 0001 pea 1 46202: 2f08 movel %a0,%sp@- 46204: 4eb9 0004 9ce0 jsr 49ce0 <_Thread_Start> _RTEMS_Unlock_allocator(); return EINVAL; } #endif if ( schedpolicy == SCHED_SPORADIC ) { 4620a: 4fef 0014 lea %sp@(20),%sp 4620e: 7003 moveq #3,%d0 46210: b087 cmpl %d7,%d0 46212: 6726 beqs 4623a } /* * Return the id and indicate we successfully created the thread */ *thread = the_thread->Object.id; 46214: 226e 0008 moveal %fp@(8),%a1 46218: 206e ffd0 moveal %fp@(-48),%a0 4621c: 22a8 0008 movel %a0@(8),%a1@ _RTEMS_Unlock_allocator(); 46220: 2f39 0006 05d6 movel 605d6 <_RTEMS_Allocator_Mutex>,%sp@- 46226: 4eb9 0004 7b04 jsr 47b04 <_API_Mutex_Unlock> return 0; 4622c: 588f addql #4,%sp } 4622e: 2002 movel %d2,%d0 46230: 4cee 3cfc ffa8 moveml %fp@(-88),%d2-%d7/%a2-%a5 46236: 4e5e unlk %fp 46238: 4e75 rts return EINVAL; } #endif if ( schedpolicy == SCHED_SPORADIC ) { _Watchdog_Insert_ticks( 4623a: 206e ffdc moveal %fp@(-36),%a0 4623e: 4868 0088 pea %a0@(136) 46242: 4eb9 0004 a02c jsr 4a02c <_Timespec_To_ticks> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 46248: 226e ffdc moveal %fp@(-36),%a1 4624c: 2340 00a8 movel %d0,%a1@(168) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 46250: 4869 009c pea %a1@(156) 46254: 4879 0006 05fc pea 605fc <_Watchdog_Ticks_chain> 4625a: 4eb9 0004 a37c jsr 4a37c <_Watchdog_Insert> } /* * Return the id and indicate we successfully created the thread */ *thread = the_thread->Object.id; 46260: 226e 0008 moveal %fp@(8),%a1 46264: 4fef 000c lea %sp@(12),%sp 46268: 206e ffd0 moveal %fp@(-48),%a0 4626c: 22a8 0008 movel %a0@(8),%a1@ _RTEMS_Unlock_allocator(); 46270: 2f39 0006 05d6 movel 605d6 <_RTEMS_Allocator_Mutex>,%sp@- 46276: 4eb9 0004 7b04 jsr 47b04 <_API_Mutex_Unlock> return 0; 4627c: 588f addql #4,%sp 4627e: 60ae bras 4622e <== ALWAYS TAKEN * * NOTE: Global threads are not currently supported. */ the_thread = _POSIX_Threads_Allocate(); if ( !the_thread ) { _RTEMS_Unlock_allocator(); 46280: 2f39 0006 05d6 movel 605d6 <_RTEMS_Allocator_Mutex>,%sp@- 46286: 143c 000b moveb #11,%d2 4628a: 4eb9 0004 7b04 jsr 47b04 <_API_Mutex_Unlock> return EAGAIN; 46290: 588f addql #4,%sp */ *thread = the_thread->Object.id; _RTEMS_Unlock_allocator(); return 0; } 46292: 2002 movel %d2,%d0 46294: 4cee 3cfc ffa8 moveml %fp@(-88),%d2-%d7/%a2-%a5 4629a: 4e5e unlk %fp 4629c: 4e75 rts ... 0004daec : } void pthread_exit( void *value_ptr ) { 4daec: 4e56 0000 linkw %fp,#0 _POSIX_Thread_Exit( _Thread_Executing, value_ptr ); 4daf0: 2f2e 0008 movel %fp@(8),%sp@- 4daf4: 2f39 0005 f20e movel 5f20e <_Thread_Executing>,%sp@- 4dafa: 4eb9 0004 da7c jsr 4da7c <_POSIX_Thread_Exit> 4db00: 508f addql #8,%sp <== NOT EXECUTED } 4db02: 4e5e unlk %fp <== NOT EXECUTED 4db04: 4e75 rts <== NOT EXECUTED ... 00045c74 : int pthread_key_create( pthread_key_t *key, void (*destructor)( void * ) ) { 45c74: 4e56 ffe4 linkw %fp,#-28 45c78: 2039 0006 10d4 movel 610d4 <_Thread_Dispatch_disable_level>,%d0 45c7e: 5280 addql #1,%d0 45c80: 23c0 0006 10d4 movel %d0,610d4 <_Thread_Dispatch_disable_level> 45c86: 48d7 3c1c moveml %d2-%d4/%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 ); 45c8a: 4879 0006 1468 pea 61468 <_POSIX_Keys_Information> 45c90: 4eb9 0004 8110 jsr 48110 <_Objects_Allocate> _Thread_Disable_dispatch(); the_key = _POSIX_Keys_Allocate(); if ( !the_key ) { 45c96: 588f addql #4,%sp 45c98: 2840 moveal %d0,%a4 45c9a: 4a80 tstl %d0 45c9c: 6700 0098 beqw 45d36 _Thread_Enable_dispatch(); return EAGAIN; } the_key->destructor = destructor; 45ca0: 45f9 0006 1090 lea 61090 <_Objects_Information_table+0x4>,%a2 45ca6: 47ec 0018 lea %a4@(24),%a3 45caa: 7601 moveq #1,%d3 INTERNAL_ERROR_IMPLEMENTATION_KEY_CREATE_INCONSISTENCY ); #endif bytes_to_allocate = sizeof( void * ) * (_Objects_Information_table[ the_api ][ 1 ]->maximum + 1); table = _Workspace_Allocate( bytes_to_allocate ); 45cac: 4bf9 0004 a31c lea 4a31c <_Workspace_Allocate>,%a5 _Thread_Enable_dispatch(); return ENOMEM; } the_key->Values[ the_api ] = table; memset( table, '\0', bytes_to_allocate ); 45cb2: 283c 0005 04c0 movel #328896,%d4 if ( !the_key ) { _Thread_Enable_dispatch(); return EAGAIN; } the_key->destructor = destructor; 45cb8: 296e 000c 0010 movel %fp@(12),%a4@(16) for ( the_api = 1; the_api <= OBJECTS_APIS_LAST; the_api++ ) { if ( _Objects_Information_table[ the_api ] ) { 45cbe: 2052 moveal %a2@,%a0 45cc0: 4a88 tstl %a0 45cc2: 6762 beqs 45d26 INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_IMPLEMENTATION_KEY_CREATE_INCONSISTENCY ); #endif bytes_to_allocate = sizeof( void * ) * 45cc4: 2068 0004 moveal %a0@(4),%a0 45cc8: 4282 clrl %d2 45cca: 3428 000e movew %a0@(14),%d2 45cce: 5282 addql #1,%d2 45cd0: e58a lsll #2,%d2 (_Objects_Information_table[ the_api ][ 1 ]->maximum + 1); table = _Workspace_Allocate( bytes_to_allocate ); 45cd2: 2f02 movel %d2,%sp@- 45cd4: 4e95 jsr %a5@ if ( !table ) { 45cd6: 588f addql #4,%sp 45cd8: 4a80 tstl %d0 45cda: 676c beqs 45d48 _POSIX_Keys_Free( the_key ); _Thread_Enable_dispatch(); return ENOMEM; } the_key->Values[ the_api ] = table; 45cdc: 2680 movel %d0,%a3@ memset( table, '\0', bytes_to_allocate ); 45cde: 2044 moveal %d4,%a0 * for. [NOTE: Currently RTEMS Classic API tasks are always enabled.] */ for ( the_api = 1; the_api <= OBJECTS_APIS_LAST; the_api++ ) { 45ce0: 5283 addql #1,%d3 45ce2: 588a addql #4,%a2 45ce4: 588b addql #4,%a3 _Thread_Enable_dispatch(); return ENOMEM; } the_key->Values[ the_api ] = table; memset( table, '\0', bytes_to_allocate ); 45ce6: 2f02 movel %d2,%sp@- 45ce8: 42a7 clrl %sp@- 45cea: 2f00 movel %d0,%sp@- 45cec: 4e90 jsr %a0@ 45cee: 4fef 000c lea %sp@(12),%sp * This is a bit more complex than one might initially expect because * APIs are optional. Thus there may be no ITRON tasks to have keys * for. [NOTE: Currently RTEMS Classic API tasks are always enabled.] */ for ( the_api = 1; 45cf2: 7005 moveq #5,%d0 45cf4: b083 cmpl %d3,%d0 45cf6: 66c6 bnes 45cbe <== NEVER TAKEN #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 45cf8: 202c 0008 movel %a4@(8),%d0 45cfc: 4281 clrl %d1 45cfe: 2079 0006 1480 moveal 61480 <_POSIX_Keys_Information+0x18>,%a0 45d04: 3200 movew %d0,%d1 45d06: 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; 45d0a: 42ac 000c clrl %a4@(12) } _Objects_Open_u32( &_POSIX_Keys_Information, &the_key->Object, 0 ); *key = the_key->Object.id; 45d0e: 206e 0008 moveal %fp@(8),%a0 45d12: 2080 movel %d0,%a0@ _Thread_Enable_dispatch(); 45d14: 4eb9 0004 8dbc jsr 48dbc <_Thread_Enable_dispatch> return 0; } 45d1a: 4cee 3c1c ffe4 moveml %fp@(-28),%d2-%d4/%a2-%a5 _Objects_Open_u32( &_POSIX_Keys_Information, &the_key->Object, 0 ); *key = the_key->Object.id; _Thread_Enable_dispatch(); 45d20: 4280 clrl %d0 return 0; } 45d22: 4e5e unlk %fp 45d24: 4e75 rts } the_key->Values[ the_api ] = table; memset( table, '\0', bytes_to_allocate ); } else { the_key->Values[ the_api ] = NULL; 45d26: 4293 clrl %a3@ * for. [NOTE: Currently RTEMS Classic API tasks are always enabled.] */ for ( the_api = 1; the_api <= OBJECTS_APIS_LAST; the_api++ ) { 45d28: 5283 addql #1,%d3 45d2a: 588a addql #4,%a2 45d2c: 588b addql #4,%a3 * This is a bit more complex than one might initially expect because * APIs are optional. Thus there may be no ITRON tasks to have keys * for. [NOTE: Currently RTEMS Classic API tasks are always enabled.] */ for ( the_api = 1; 45d2e: 7005 moveq #5,%d0 45d30: b083 cmpl %d3,%d0 45d32: 668a bnes 45cbe <== ALWAYS TAKEN 45d34: 60c2 bras 45cf8 <== ALWAYS TAKEN _Thread_Disable_dispatch(); the_key = _POSIX_Keys_Allocate(); if ( !the_key ) { _Thread_Enable_dispatch(); 45d36: 4eb9 0004 8dbc jsr 48dbc <_Thread_Enable_dispatch> 45d3c: 700b moveq #11,%d0 *key = the_key->Object.id; _Thread_Enable_dispatch(); return 0; } 45d3e: 4cee 3c1c ffe4 moveml %fp@(-28),%d2-%d4/%a2-%a5 45d44: 4e5e unlk %fp 45d46: 4e75 rts #endif bytes_to_allocate = sizeof( void * ) * (_Objects_Information_table[ the_api ][ 1 ]->maximum + 1); table = _Workspace_Allocate( bytes_to_allocate ); if ( !table ) { for ( --the_api; 45d48: 2403 movel %d3,%d2 45d4a: 5382 subql #1,%d2 45d4c: 6718 beqs 45d66 45d4e: 47f9 0004 a338 lea 4a338 <_Workspace_Free>,%a3 45d54: 45f4 3c10 lea %a4@(00000010,%d3:l:4),%a2 the_api >= 1; the_api-- ) _Workspace_Free( the_key->Values[ the_api ] ); 45d58: 2f12 movel %a2@,%sp@- (_Objects_Information_table[ the_api ][ 1 ]->maximum + 1); table = _Workspace_Allocate( bytes_to_allocate ); if ( !table ) { for ( --the_api; the_api >= 1; the_api-- ) 45d5a: 5382 subql #1,%d2 45d5c: 598a subql #4,%a2 _Workspace_Free( the_key->Values[ the_api ] ); 45d5e: 4e93 jsr %a3@ #endif bytes_to_allocate = sizeof( void * ) * (_Objects_Information_table[ the_api ][ 1 ]->maximum + 1); table = _Workspace_Allocate( bytes_to_allocate ); if ( !table ) { for ( --the_api; 45d60: 588f addql #4,%sp 45d62: 4a82 tstl %d2 45d64: 66f2 bnes 45d58 */ RTEMS_INLINE_ROUTINE void _POSIX_Keys_Free ( POSIX_Keys_Control *the_key ) { _Objects_Free( &_POSIX_Keys_Information, &the_key->Object ); 45d66: 2f0c movel %a4,%sp@- 45d68: 4879 0006 1468 pea 61468 <_POSIX_Keys_Information> 45d6e: 4eb9 0004 8448 jsr 48448 <_Objects_Free> the_api >= 1; the_api-- ) _Workspace_Free( the_key->Values[ the_api ] ); _POSIX_Keys_Free( the_key ); _Thread_Enable_dispatch(); 45d74: 4eb9 0004 8dbc jsr 48dbc <_Thread_Enable_dispatch> return ENOMEM; 45d7a: 508f addql #8,%sp the_api >= 1; the_api-- ) _Workspace_Free( the_key->Values[ the_api ] ); _POSIX_Keys_Free( the_key ); _Thread_Enable_dispatch(); 45d7c: 700c moveq #12,%d0 *key = the_key->Object.id; _Thread_Enable_dispatch(); return 0; } 45d7e: 4cee 3c1c ffe4 moveml %fp@(-28),%d2-%d4/%a2-%a5 45d84: 4e5e unlk %fp 45d86: 4e75 rts 0004ecac : int pthread_kill( pthread_t thread, int sig ) { 4ecac: 4e56 fff0 linkw %fp,#-16 4ecb0: 48d7 040c moveml %d2-%d3/%a2,%sp@ 4ecb4: 242e 000c movel %fp@(12),%d2 POSIX_API_Control *api; Thread_Control *the_thread; Objects_Locations location; if ( !sig ) 4ecb8: 6700 009e beqw 4ed58 static inline bool is_valid_signo( int signo ) { return ((signo) >= 1 && (signo) <= 32 ); 4ecbc: 2602 movel %d2,%d3 4ecbe: 5383 subql #1,%d3 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 4ecc0: 701f moveq #31,%d0 4ecc2: b083 cmpl %d3,%d0 4ecc4: 6500 0092 bcsw 4ed58 RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Get ( pthread_t id, Objects_Locations *location ) { return (Thread_Control *) 4ecc8: 486e fffc pea %fp@(-4) 4eccc: 2f2e 0008 movel %fp@(8),%sp@- 4ecd0: 4879 0005 f33a pea 5f33a <_POSIX_Threads_Information> 4ecd6: 4eb9 0004 7538 jsr 47538 <_Objects_Get> rtems_set_errno_and_return_minus_one( EINVAL ); the_thread = _POSIX_Threads_Get( thread, &location ); switch ( location ) { 4ecdc: 4fef 000c lea %sp@(12),%sp 4ece0: 2440 moveal %d0,%a2 4ece2: 4aae fffc tstl %fp@(-4) 4ece6: 6600 0088 bnew 4ed70 api = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( sig ) { if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) { 4ecea: 2202 movel %d2,%d1 4ecec: 2002 movel %d2,%d0 4ecee: e589 lsll #2,%d1 4ecf0: e988 lsll #4,%d0 case OBJECTS_LOCAL: /* * If sig == 0 then just validate arguments */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4ecf2: 206a 010e moveal %a2@(270),%a0 if ( sig ) { if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) { 4ecf6: 9081 subl %d1,%d0 4ecf8: 0680 0005 f60a addil #390666,%d0 4ecfe: 7201 moveq #1,%d1 4ed00: 2240 moveal %d0,%a1 4ed02: b291 cmpl %a1@,%d1 4ed04: 6730 beqs 4ed36 return 0; } /* XXX critical section */ api->signals_pending |= signo_to_mask( sig ); 4ed06: 7001 moveq #1,%d0 4ed08: e7a8 lsll %d3,%d0 4ed0a: 81a8 00c8 orl %d0,%a0@(200) (void) _POSIX_signals_Unblock_thread( the_thread, sig, NULL ); 4ed0e: 42a7 clrl %sp@- 4ed10: 2f02 movel %d2,%sp@- 4ed12: 2f0a movel %a2,%sp@- 4ed14: 4eb9 0004 eb6c jsr 4eb6c <_POSIX_signals_Unblock_thread> the_thread->do_post_task_switch_extension = true; if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 4ed1a: 2039 0005 f1ee movel 5f1ee <_ISR_Nest_level>,%d0 4ed20: 4fef 000c lea %sp@(12),%sp api->signals_pending |= signo_to_mask( sig ); (void) _POSIX_signals_Unblock_thread( the_thread, sig, NULL ); the_thread->do_post_task_switch_extension = true; 4ed24: 7201 moveq #1,%d1 4ed26: 1541 0074 moveb %d1,%a2@(116) if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 4ed2a: 4a80 tstl %d0 4ed2c: 6708 beqs 4ed36 4ed2e: b5f9 0005 f20e cmpal 5f20e <_Thread_Executing>,%a2 4ed34: 6712 beqs 4ed48 _ISR_Signals_to_thread_executing = true; } _Thread_Enable_dispatch(); 4ed36: 4eb9 0004 7dc8 jsr 47dc8 <_Thread_Enable_dispatch> 4ed3c: 4280 clrl %d0 case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( ESRCH ); } 4ed3e: 4cee 040c fff0 moveml %fp@(-16),%d2-%d3/%a2 4ed44: 4e5e unlk %fp 4ed46: 4e75 rts (void) _POSIX_signals_Unblock_thread( the_thread, sig, NULL ); the_thread->do_post_task_switch_extension = true; if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _ISR_Signals_to_thread_executing = true; 4ed48: 13c1 0005 f29c moveb %d1,5f29c <_ISR_Signals_to_thread_executing> } _Thread_Enable_dispatch(); 4ed4e: 4eb9 0004 7dc8 jsr 47dc8 <_Thread_Enable_dispatch> 4ed54: 4280 clrl %d0 4ed56: 60e6 bras 4ed3e <== ALWAYS TAKEN if ( !sig ) rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) rtems_set_errno_and_return_minus_one( EINVAL ); 4ed58: 4eb9 0004 ede4 jsr 4ede4 <__errno> 4ed5e: 7416 moveq #22,%d2 4ed60: 2040 moveal %d0,%a0 4ed62: 70ff moveq #-1,%d0 4ed64: 2082 movel %d2,%a0@ case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( ESRCH ); } 4ed66: 4cee 040c fff0 moveml %fp@(-16),%d2-%d3/%a2 4ed6c: 4e5e unlk %fp 4ed6e: 4e75 rts #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( ESRCH ); 4ed70: 4eb9 0004 ede4 jsr 4ede4 <__errno> 4ed76: 7203 moveq #3,%d1 4ed78: 2040 moveal %d0,%a0 4ed7a: 70ff moveq #-1,%d0 } 4ed7c: 4cee 040c fff0 moveml %fp@(-16),%d2-%d3/%a2 #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( ESRCH ); 4ed82: 2081 movel %d1,%a0@ } 4ed84: 4e5e unlk %fp 4ed86: 4e75 rts 00047d54 : int pthread_mutex_init( pthread_mutex_t *mutex, const pthread_mutexattr_t *attr ) { 47d54: 4e56 fff0 linkw %fp,#-16 47d58: 202e 000c movel %fp@(12),%d0 47d5c: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ 47d60: 266e 0008 moveal %fp@(8),%a3 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; 47d64: 45f9 0006 4770 lea 64770 <_POSIX_Mutex_Default_attributes>,%a2 47d6a: 4a80 tstl %d0 47d6c: 6702 beqs 47d70 47d6e: 2440 moveal %d0,%a2 else the_attr = &_POSIX_Mutex_Default_attributes; /* Check for NULL mutex */ if ( !mutex ) 47d70: 4a8b tstl %a3 47d72: 6700 00e6 beqw 47e5a } } } #endif if ( !the_attr->is_initialized ) 47d76: 4a92 tstl %a2@ 47d78: 6700 00e0 beqw 47e5a return EINVAL; /* * We only support process private mutexes. */ if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) 47d7c: 202a 0004 movel %a2@(4),%d0 47d80: 7201 moveq #1,%d1 47d82: b280 cmpl %d0,%d1 47d84: 6700 00e6 beqw 47e6c return ENOSYS; if ( the_attr->process_shared != PTHREAD_PROCESS_PRIVATE ) 47d88: 4a80 tstl %d0 47d8a: 6600 00ce bnew 47e5a return EINVAL; /* * Determine the discipline of the mutex */ switch ( the_attr->protocol ) { 47d8e: 202a 000c movel %a2@(12),%d0 47d92: 7201 moveq #1,%d1 47d94: b280 cmpl %d0,%d1 47d96: 6700 00e0 beqw 47e78 47d9a: 123c 0002 moveb #2,%d1 47d9e: b280 cmpl %d0,%d1 47da0: 6700 00c4 beqw 47e66 47da4: 4a80 tstl %d0 47da6: 6600 00b2 bnew 47e5a 47daa: 4282 clrl %d2 } /* * Validate the priority ceiling field -- should always be valid. */ if ( !_POSIX_Priority_Is_valid( the_attr->prio_ceiling ) ) 47dac: 2f2a 0008 movel %a2@(8),%sp@- 47db0: 4eb9 0004 8114 jsr 48114 <_POSIX_Priority_Is_valid> 47db6: 588f addql #4,%sp 47db8: 4a00 tstb %d0 47dba: 6700 009e beqw 47e5a #if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES) /* * Validate the mutex type and set appropriate SuperCore mutex * attributes. */ switch ( the_attr->type ) { 47dbe: 7003 moveq #3,%d0 47dc0: b0aa 0010 cmpl %a2@(16),%d0 47dc4: 6500 0094 bcsw 47e5a 47dc8: 2039 0006 43f4 movel 643f4 <_Thread_Dispatch_disable_level>,%d0 47dce: 5280 addql #1,%d0 47dd0: 23c0 0006 43f4 movel %d0,643f4 <_Thread_Dispatch_disable_level> * _POSIX_Mutex_Allocate */ RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Allocate( void ) { return (POSIX_Mutex_Control *) _Objects_Allocate( &_POSIX_Mutex_Information ); 47dd6: 4879 0006 46fc pea 646fc <_POSIX_Mutex_Information> 47ddc: 4eb9 0004 a5f8 jsr 4a5f8 <_Objects_Allocate> */ _Thread_Disable_dispatch(); the_mutex = _POSIX_Mutex_Allocate(); if ( !the_mutex ) { 47de2: 588f addql #4,%sp 47de4: 2840 moveal %d0,%a4 47de6: 4a80 tstl %d0 47de8: 6700 0094 beqw 47e7e _Thread_Enable_dispatch(); return EAGAIN; } the_mutex->process_shared = the_attr->process_shared; 47dec: 296a 0004 0010 movel %a2@(4),%a4@(16) the_mutex_attr = &the_mutex->Mutex.Attributes; if ( the_attr->recursive ) the_mutex_attr->lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES; 47df2: 4aaa 0014 tstl %a2@(20) 47df6: 57c0 seq %d0 else the_mutex_attr->lock_nesting_behavior = CORE_MUTEX_NESTING_IS_ERROR; the_mutex_attr->only_owner_release = true; 47df8: 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; 47dfa: 49c0 extbl %d0 47dfc: 4480 negl %d0 else the_mutex_attr->lock_nesting_behavior = CORE_MUTEX_NESTING_IS_ERROR; the_mutex_attr->only_owner_release = true; 47dfe: 1941 0058 moveb %d1,%a4@(88) 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; 47e02: 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; the_mutex_attr->priority_ceiling = 47e06: 4280 clrl %d0 47e08: 1039 0006 2c06 moveb 62c06 ,%d0 47e0e: 90aa 0008 subl %a2@(8),%d0 _POSIX_Priority_To_core( the_attr->prio_ceiling ); the_mutex_attr->discipline = the_discipline; 47e12: 2942 005a movel %d2,%a4@(90) 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; the_mutex_attr->priority_ceiling = 47e16: 2940 005e movel %d0,%a4@(94) the_mutex_attr->discipline = the_discipline; /* * Must be initialized to unlocked. */ _CORE_mutex_Initialize( 47e1a: 4878 0001 pea 1 47e1e: 486c 0054 pea %a4@(84) 47e22: 486c 0014 pea %a4@(20) 47e26: 4eb9 0004 9c10 jsr 49c10 <_CORE_mutex_Initialize> #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 47e2c: 202c 0008 movel %a4@(8),%d0 47e30: 4281 clrl %d1 47e32: 2079 0006 4714 moveal 64714 <_POSIX_Mutex_Information+0x18>,%a0 47e38: 3200 movew %d0,%d1 47e3a: 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; 47e3e: 42ac 000c clrl %a4@(12) CORE_MUTEX_UNLOCKED ); _Objects_Open_u32( &_POSIX_Mutex_Information, &the_mutex->Object, 0 ); *mutex = the_mutex->Object.id; 47e42: 2680 movel %d0,%a3@ _Thread_Enable_dispatch(); 47e44: 4eb9 0004 b2a4 jsr 4b2a4 <_Thread_Enable_dispatch> return 0; 47e4a: 4fef 000c lea %sp@(12),%sp _Objects_Open_u32( &_POSIX_Mutex_Information, &the_mutex->Object, 0 ); *mutex = the_mutex->Object.id; _Thread_Enable_dispatch(); 47e4e: 4280 clrl %d0 return 0; } 47e50: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 47e56: 4e5e unlk %fp 47e58: 4e75 rts _Objects_Open_u32( &_POSIX_Mutex_Information, &the_mutex->Object, 0 ); *mutex = the_mutex->Object.id; _Thread_Enable_dispatch(); return 0; 47e5a: 7016 moveq #22,%d0 } 47e5c: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 47e62: 4e5e unlk %fp 47e64: 4e75 rts return EINVAL; /* * Determine the discipline of the mutex */ switch ( the_attr->protocol ) { 47e66: 7403 moveq #3,%d2 case PTHREAD_PRIO_INHERIT: the_discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT; break; case PTHREAD_PRIO_PROTECT: the_discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING; break; 47e68: 6000 ff42 braw 47dac <== ALWAYS TAKEN return EINVAL; /* * We only support process private mutexes. */ if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) 47e6c: 7058 moveq #88,%d0 *mutex = the_mutex->Object.id; _Thread_Enable_dispatch(); return 0; } 47e6e: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 47e74: 4e5e unlk %fp 47e76: 4e75 rts return EINVAL; /* * Determine the discipline of the mutex */ switch ( the_attr->protocol ) { 47e78: 7402 moveq #2,%d2 47e7a: 6000 ff30 braw 47dac <== ALWAYS TAKEN _Thread_Disable_dispatch(); the_mutex = _POSIX_Mutex_Allocate(); if ( !the_mutex ) { _Thread_Enable_dispatch(); 47e7e: 4eb9 0004 b2a4 jsr 4b2a4 <_Thread_Enable_dispatch> 47e84: 700b moveq #11,%d0 *mutex = the_mutex->Object.id; _Thread_Enable_dispatch(); return 0; } 47e86: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 47e8c: 4e5e unlk %fp 47e8e: 4e75 rts 00045960 : #if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES) int pthread_mutexattr_gettype( const pthread_mutexattr_t *attr, int *type ) { 45960: 4e56 0000 linkw %fp,#0 45964: 206e 0008 moveal %fp@(8),%a0 45968: 226e 000c moveal %fp@(12),%a1 if ( !attr ) 4596c: 4a88 tstl %a0 4596e: 6712 beqs 45982 return EINVAL; if ( !attr->is_initialized ) 45970: 4a90 tstl %a0@ 45972: 670e beqs 45982 return EINVAL; if ( !type ) 45974: 4a89 tstl %a1 45976: 670a beqs 45982 <== ALWAYS TAKEN return EINVAL; *type = attr->type; 45978: 22a8 0010 movel %a0@(16),%a1@ 4597c: 4280 clrl %d0 return 0; } 4597e: 4e5e unlk %fp 45980: 4e75 rts if ( !type ) return EINVAL; *type = attr->type; return 0; 45982: 7016 moveq #22,%d0 } 45984: 4e5e unlk %fp 45986: 4e75 rts 00047b64 : int pthread_mutexattr_setpshared( pthread_mutexattr_t *attr, int pshared ) { 47b64: 4e56 0000 linkw %fp,#0 47b68: 206e 0008 moveal %fp@(8),%a0 47b6c: 202e 000c movel %fp@(12),%d0 if ( !attr || !attr->is_initialized ) 47b70: 4a88 tstl %a0 47b72: 670a beqs 47b7e 47b74: 4a90 tstl %a0@ 47b76: 6706 beqs 47b7e return EINVAL; switch ( pshared ) { 47b78: 7201 moveq #1,%d1 47b7a: b280 cmpl %d0,%d1 47b7c: 6406 bccs 47b84 <== NEVER TAKEN case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; return 0; 47b7e: 7016 moveq #22,%d0 default: return EINVAL; } } 47b80: 4e5e unlk %fp 47b82: 4e75 rts return EINVAL; switch ( pshared ) { case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; 47b84: 2140 0004 movel %d0,%a0@(4) 47b88: 4280 clrl %d0 return 0; default: return EINVAL; } } 47b8a: 4e5e unlk %fp 47b8c: 4e75 rts ... 000459c4 : #if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES) int pthread_mutexattr_settype( pthread_mutexattr_t *attr, int type ) { 459c4: 4e56 0000 linkw %fp,#0 459c8: 206e 0008 moveal %fp@(8),%a0 459cc: 202e 000c movel %fp@(12),%d0 if ( !attr || !attr->is_initialized ) 459d0: 4a88 tstl %a0 459d2: 670a beqs 459de 459d4: 4a90 tstl %a0@ 459d6: 6706 beqs 459de <== ALWAYS TAKEN return EINVAL; switch ( type ) { 459d8: 7203 moveq #3,%d1 459da: b280 cmpl %d0,%d1 459dc: 6406 bccs 459e4 case PTHREAD_MUTEX_NORMAL: case PTHREAD_MUTEX_RECURSIVE: case PTHREAD_MUTEX_ERRORCHECK: case PTHREAD_MUTEX_DEFAULT: attr->type = type; return 0; 459de: 7016 moveq #22,%d0 default: return EINVAL; } } 459e0: 4e5e unlk %fp 459e2: 4e75 rts switch ( type ) { case PTHREAD_MUTEX_NORMAL: case PTHREAD_MUTEX_RECURSIVE: case PTHREAD_MUTEX_ERRORCHECK: case PTHREAD_MUTEX_DEFAULT: attr->type = type; 459e4: 2140 0010 movel %d0,%a0@(16) 459e8: 4280 clrl %d0 return 0; default: return EINVAL; } } 459ea: 4e5e unlk %fp 459ec: 4e75 rts ... 00046750 : int pthread_once( pthread_once_t *once_control, void (*init_routine)(void) ) { 46750: 4e56 ffec linkw %fp,#-20 46754: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ 46758: 246e 0008 moveal %fp@(8),%a2 4675c: 266e 000c moveal %fp@(12),%a3 if ( !once_control || !init_routine ) 46760: 4a8a tstl %a2 46762: 6766 beqs 467ca 46764: 4a8b tstl %a3 46766: 6762 beqs 467ca return EINVAL; if ( !once_control->init_executed ) { 46768: 4aaa 0004 tstl %a2@(4) 4676c: 670c beqs 4677a if ( !once_control->init_executed ) { once_control->is_initialized = true; once_control->init_executed = true; (*init_routine)(); } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); 4676e: 4280 clrl %d0 } return 0; } 46770: 4cee 1c04 ffec moveml %fp@(-20),%d2/%a2-%a4 46776: 4e5e unlk %fp 46778: 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); 4677a: 240e movel %fp,%d2 4677c: 5982 subql #4,%d2 4677e: 49f9 0004 73f4 lea 473f4 ,%a4 46784: 2f02 movel %d2,%sp@- 46786: 4878 0100 pea 100 4678a: 4878 0100 pea 100 4678e: 4e94 jsr %a4@ if ( !once_control->init_executed ) { 46790: 4fef 000c lea %sp@(12),%sp 46794: 4aaa 0004 tstl %a2@(4) 46798: 6714 beqs 467ae <== NEVER TAKEN once_control->is_initialized = true; once_control->init_executed = true; (*init_routine)(); } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); 4679a: 2f02 movel %d2,%sp@- <== NOT EXECUTED 4679c: 4878 0100 pea 100 <== NOT EXECUTED 467a0: 2f2e fffc movel %fp@(-4),%sp@- <== NOT EXECUTED 467a4: 4e94 jsr %a4@ <== NOT EXECUTED 467a6: 4fef 000c lea %sp@(12),%sp <== NOT EXECUTED 467aa: 4280 clrl %d0 467ac: 60c2 bras 46770 <== ALWAYS TAKEN if ( !once_control->init_executed ) { rtems_mode saveMode; rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode); if ( !once_control->init_executed ) { once_control->is_initialized = true; once_control->init_executed = true; 467ae: 7001 moveq #1,%d0 467b0: 2540 0004 movel %d0,%a2@(4) if ( !once_control->init_executed ) { rtems_mode saveMode; rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode); if ( !once_control->init_executed ) { once_control->is_initialized = true; 467b4: 2480 movel %d0,%a2@ once_control->init_executed = true; (*init_routine)(); 467b6: 4e93 jsr %a3@ } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); 467b8: 2f02 movel %d2,%sp@- 467ba: 4878 0100 pea 100 467be: 2f2e fffc movel %fp@(-4),%sp@- 467c2: 4e94 jsr %a4@ 467c4: 4fef 000c lea %sp@(12),%sp 467c8: 60e0 bras 467aa <== ALWAYS TAKEN 467ca: 7016 moveq #22,%d0 } return 0; } 467cc: 4cee 1c04 ffec moveml %fp@(-20),%d2/%a2-%a4 467d2: 4e5e unlk %fp 467d4: 4e75 rts ... 00046a80 : int pthread_rwlock_init( pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr ) { 46a80: 4e56 ffe8 linkw %fp,#-24 46a84: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 46a88: 246e 0008 moveal %fp@(8),%a2 46a8c: 242e 000c movel %fp@(12),%d2 const pthread_rwlockattr_t *the_attr; /* * Error check parameters */ if ( !rwlock ) 46a90: 4a8a tstl %a2 46a92: 676e beqs 46b02 return EINVAL; /* * If the user passed in NULL, use the default attributes */ if ( attr ) { 46a94: 4a82 tstl %d2 46a96: 6700 0088 beqw 46b20 46a9a: 2042 moveal %d2,%a0 } /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) 46a9c: 4a90 tstl %a0@ 46a9e: 6762 beqs 46b02 <== ALWAYS TAKEN return EINVAL; switch ( the_attr->process_shared ) { 46aa0: 4aa8 0004 tstl %a0@(4) 46aa4: 665c bnes 46b02 <== ALWAYS TAKEN rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 46aa6: 2039 0006 1e58 movel 61e58 <_Thread_Dispatch_disable_level>,%d0 46aac: 5280 addql #1,%d0 46aae: 23c0 0006 1e58 movel %d0,61e58 <_Thread_Dispatch_disable_level> * This function allocates a RWLock control block from * the inactive chain of free RWLock control blocks. */ RTEMS_INLINE_ROUTINE POSIX_RWLock_Control *_POSIX_RWLock_Allocate( void ) { return (POSIX_RWLock_Control *) 46ab4: 4879 0006 2004 pea 62004 <_POSIX_RWLock_Information> 46aba: 4eb9 0004 93b0 jsr 493b0 <_Objects_Allocate> */ _Thread_Disable_dispatch(); /* prevents deletion */ the_rwlock = _POSIX_RWLock_Allocate(); if ( !the_rwlock ) { 46ac0: 588f addql #4,%sp 46ac2: 2640 moveal %d0,%a3 46ac4: 4a80 tstl %d0 46ac6: 6746 beqs 46b0e _Thread_Enable_dispatch(); return EAGAIN; } _CORE_RWLock_Initialize( &the_rwlock->RWLock, &the_attributes ); 46ac8: 486e fffc pea %fp@(-4) 46acc: 486b 0010 pea %a3@(16) 46ad0: 4eb9 0004 8adc jsr 48adc <_CORE_RWLock_Initialize> #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 46ad6: 202b 0008 movel %a3@(8),%d0 46ada: 4281 clrl %d1 46adc: 2079 0006 201c moveal 6201c <_POSIX_RWLock_Information+0x18>,%a0 46ae2: 3200 movew %d0,%d1 46ae4: 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; 46ae8: 42ab 000c clrl %a3@(12) &_POSIX_RWLock_Information, &the_rwlock->Object, 0 ); *rwlock = the_rwlock->Object.id; 46aec: 2480 movel %d0,%a2@ _Thread_Enable_dispatch(); 46aee: 4eb9 0004 a05c jsr 4a05c <_Thread_Enable_dispatch> return 0; 46af4: 508f addql #8,%sp 0 ); *rwlock = the_rwlock->Object.id; _Thread_Enable_dispatch(); 46af6: 4280 clrl %d0 return 0; } 46af8: 4cee 0c04 ffe8 moveml %fp@(-24),%d2/%a2-%a3 46afe: 4e5e unlk %fp 46b00: 4e75 rts ); *rwlock = the_rwlock->Object.id; _Thread_Enable_dispatch(); return 0; 46b02: 7016 moveq #22,%d0 } 46b04: 4cee 0c04 ffe8 moveml %fp@(-24),%d2/%a2-%a3 46b0a: 4e5e unlk %fp 46b0c: 4e75 rts _Thread_Disable_dispatch(); /* prevents deletion */ the_rwlock = _POSIX_RWLock_Allocate(); if ( !the_rwlock ) { _Thread_Enable_dispatch(); 46b0e: 4eb9 0004 a05c jsr 4a05c <_Thread_Enable_dispatch> 46b14: 700b moveq #11,%d0 *rwlock = the_rwlock->Object.id; _Thread_Enable_dispatch(); return 0; } 46b16: 4cee 0c04 ffe8 moveml %fp@(-24),%d2/%a2-%a3 46b1c: 4e5e unlk %fp 46b1e: 4e75 rts * If the user passed in NULL, use the default attributes */ if ( attr ) { the_attr = attr; } else { (void) pthread_rwlockattr_init( &default_attr ); 46b20: 240e movel %fp,%d2 46b22: 0682 ffff fff4 addil #-12,%d2 46b28: 2f02 movel %d2,%sp@- 46b2a: 4eb9 0004 75a0 jsr 475a0 46b30: 588f addql #4,%sp 46b32: 2042 moveal %d2,%a0 46b34: 6000 ff66 braw 46a9c <== ALWAYS TAKEN 00046ba4 : int pthread_rwlock_timedrdlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { 46ba4: 4e56 ffec linkw %fp,#-20 46ba8: 48d7 040c moveml %d2-%d3/%a2,%sp@ 46bac: 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 ) 46bb0: 4a8a tstl %a2 46bb2: 6700 0082 beqw 46c36 <== ALWAYS TAKEN * * 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 ); 46bb6: 486e fff8 pea %fp@(-8) 46bba: 2f2e 000c movel %fp@(12),%sp@- 46bbe: 4eb9 0004 d448 jsr 4d448 <_POSIX_Absolute_timeout_to_ticks> 46bc4: 486e fffc pea %fp@(-4) 46bc8: 2400 movel %d0,%d2 46bca: 2f12 movel %a2@,%sp@- 46bcc: 4879 0006 2004 pea 62004 <_POSIX_RWLock_Information> 46bd2: 4eb9 0004 984c jsr 4984c <_Objects_Get> if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { 46bd8: 4fef 0014 lea %sp@(20),%sp 46bdc: 4aae fffc tstl %fp@(-4) 46be0: 6654 bnes 46c36 <== ALWAYS TAKEN 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, 46be2: 7203 moveq #3,%d1 46be4: b282 cmpl %d2,%d1 46be6: 57c3 seq %d3 case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_reading( 46be8: 42a7 clrl %sp@- 46bea: 2f2e fff8 movel %fp@(-8),%sp@- 46bee: 4483 negl %d3 46bf0: 4281 clrl %d1 46bf2: 1203 moveb %d3,%d1 46bf4: 2040 moveal %d0,%a0 46bf6: 2f01 movel %d1,%sp@- 46bf8: 2f12 movel %a2@,%sp@- 46bfa: 4868 0010 pea %a0@(16) 46bfe: 4eb9 0004 8b10 jsr 48b10 <_CORE_RWLock_Obtain_for_reading> do_wait, ticks, NULL ); _Thread_Enable_dispatch(); 46c04: 4eb9 0004 a05c jsr 4a05c <_Thread_Enable_dispatch> if ( !do_wait ) { 46c0a: 4fef 0014 lea %sp@(20),%sp 46c0e: 4a03 tstb %d3 46c10: 6644 bnes 46c56 if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) { 46c12: 2079 0006 1f12 moveal 61f12 <_Thread_Executing>,%a0 46c18: 7202 moveq #2,%d1 46c1a: 2028 0034 movel %a0@(52),%d0 46c1e: b280 cmpl %d0,%d1 46c20: 6720 beqs 46c42 break; } } } return _POSIX_RWLock_Translate_core_RWLock_return_code( 46c22: 2f00 movel %d0,%sp@- 46c24: 4eb9 0004 6d34 jsr 46d34 <_POSIX_RWLock_Translate_core_RWLock_return_code> 46c2a: 588f addql #4,%sp case OBJECTS_ERROR: break; } return EINVAL; } 46c2c: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 46c32: 4e5e unlk %fp 46c34: 4e75 rts break; } } } return _POSIX_RWLock_Translate_core_RWLock_return_code( 46c36: 7016 moveq #22,%d0 case OBJECTS_ERROR: break; } return EINVAL; } 46c38: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 46c3e: 4e5e unlk %fp 46c40: 4e75 rts ); _Thread_Enable_dispatch(); if ( !do_wait ) { if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) { switch (status) { 46c42: 4a82 tstl %d2 46c44: 67f0 beqs 46c36 <== ALWAYS TAKEN 46c46: b282 cmpl %d2,%d1 46c48: 65d8 bcss 46c22 <== ALWAYS TAKEN 46c4a: 7074 moveq #116,%d0 case OBJECTS_ERROR: break; } return EINVAL; } 46c4c: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 46c52: 4e5e unlk %fp 46c54: 4e75 rts ); _Thread_Enable_dispatch(); if ( !do_wait ) { if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) { switch (status) { 46c56: 2079 0006 1f12 moveal 61f12 <_Thread_Executing>,%a0 46c5c: 2028 0034 movel %a0@(52),%d0 break; } } } return _POSIX_RWLock_Translate_core_RWLock_return_code( 46c60: 2f00 movel %d0,%sp@- 46c62: 4eb9 0004 6d34 jsr 46d34 <_POSIX_RWLock_Translate_core_RWLock_return_code> 46c68: 588f addql #4,%sp 46c6a: 60c0 bras 46c2c <== ALWAYS TAKEN 00046c6c : int pthread_rwlock_timedwrlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { 46c6c: 4e56 ffec linkw %fp,#-20 46c70: 48d7 040c moveml %d2-%d3/%a2,%sp@ 46c74: 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 ) 46c78: 4a8a tstl %a2 46c7a: 6700 0082 beqw 46cfe * * 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 ); 46c7e: 486e fff8 pea %fp@(-8) 46c82: 2f2e 000c movel %fp@(12),%sp@- 46c86: 4eb9 0004 d448 jsr 4d448 <_POSIX_Absolute_timeout_to_ticks> 46c8c: 486e fffc pea %fp@(-4) 46c90: 2400 movel %d0,%d2 46c92: 2f12 movel %a2@,%sp@- 46c94: 4879 0006 2004 pea 62004 <_POSIX_RWLock_Information> 46c9a: 4eb9 0004 984c jsr 4984c <_Objects_Get> if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { 46ca0: 4fef 0014 lea %sp@(20),%sp 46ca4: 4aae fffc tstl %fp@(-4) 46ca8: 6654 bnes 46cfe (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, 46caa: 7203 moveq #3,%d1 46cac: b282 cmpl %d2,%d1 46cae: 57c3 seq %d3 case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_writing( 46cb0: 42a7 clrl %sp@- 46cb2: 2f2e fff8 movel %fp@(-8),%sp@- 46cb6: 4483 negl %d3 46cb8: 4281 clrl %d1 46cba: 1203 moveb %d3,%d1 46cbc: 2040 moveal %d0,%a0 46cbe: 2f01 movel %d1,%sp@- 46cc0: 2f12 movel %a2@,%sp@- 46cc2: 4868 0010 pea %a0@(16) 46cc6: 4eb9 0004 8bd0 jsr 48bd0 <_CORE_RWLock_Obtain_for_writing> do_wait, ticks, NULL ); _Thread_Enable_dispatch(); 46ccc: 4eb9 0004 a05c jsr 4a05c <_Thread_Enable_dispatch> if ( !do_wait && 46cd2: 4fef 0014 lea %sp@(20),%sp 46cd6: 4a03 tstb %d3 46cd8: 6644 bnes 46d1e (_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) { 46cda: 2079 0006 1f12 moveal 61f12 <_Thread_Executing>,%a0 ticks, NULL ); _Thread_Enable_dispatch(); if ( !do_wait && 46ce0: 7202 moveq #2,%d1 (_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) { 46ce2: 2028 0034 movel %a0@(52),%d0 ticks, NULL ); _Thread_Enable_dispatch(); if ( !do_wait && 46ce6: b280 cmpl %d0,%d1 46ce8: 6720 beqs 46d0a case POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE: break; } } return _POSIX_RWLock_Translate_core_RWLock_return_code( 46cea: 2f00 movel %d0,%sp@- 46cec: 4eb9 0004 6d34 jsr 46d34 <_POSIX_RWLock_Translate_core_RWLock_return_code> 46cf2: 588f addql #4,%sp case OBJECTS_ERROR: break; } return EINVAL; } 46cf4: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 46cfa: 4e5e unlk %fp 46cfc: 4e75 rts case POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE: break; } } return _POSIX_RWLock_Translate_core_RWLock_return_code( 46cfe: 7016 moveq #22,%d0 case OBJECTS_ERROR: break; } return EINVAL; } 46d00: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 46d06: 4e5e unlk %fp 46d08: 4e75 rts ); _Thread_Enable_dispatch(); if ( !do_wait && (_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) { switch (status) { 46d0a: 4a82 tstl %d2 46d0c: 67f0 beqs 46cfe <== ALWAYS TAKEN 46d0e: b282 cmpl %d2,%d1 46d10: 65d8 bcss 46cea <== ALWAYS TAKEN 46d12: 7074 moveq #116,%d0 case OBJECTS_ERROR: break; } return EINVAL; } 46d14: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 46d1a: 4e5e unlk %fp 46d1c: 4e75 rts ); _Thread_Enable_dispatch(); if ( !do_wait && (_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) { switch (status) { 46d1e: 2079 0006 1f12 moveal 61f12 <_Thread_Executing>,%a0 46d24: 2028 0034 movel %a0@(52),%d0 case POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE: break; } } return _POSIX_RWLock_Translate_core_RWLock_return_code( 46d28: 2f00 movel %d0,%sp@- 46d2a: 4eb9 0004 6d34 jsr 46d34 <_POSIX_RWLock_Translate_core_RWLock_return_code> 46d30: 588f addql #4,%sp 46d32: 60c0 bras 46cf4 <== ALWAYS TAKEN 000475c0 : int pthread_rwlockattr_setpshared( pthread_rwlockattr_t *attr, int pshared ) { 475c0: 4e56 0000 linkw %fp,#0 475c4: 206e 0008 moveal %fp@(8),%a0 475c8: 202e 000c movel %fp@(12),%d0 if ( !attr ) 475cc: 4a88 tstl %a0 475ce: 670a beqs 475da return EINVAL; if ( !attr->is_initialized ) 475d0: 4a90 tstl %a0@ 475d2: 6706 beqs 475da return EINVAL; switch ( pshared ) { 475d4: 7201 moveq #1,%d1 475d6: b280 cmpl %d0,%d1 475d8: 6406 bccs 475e0 <== NEVER TAKEN case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; return 0; 475da: 7016 moveq #22,%d0 default: return EINVAL; } } 475dc: 4e5e unlk %fp 475de: 4e75 rts return EINVAL; switch ( pshared ) { case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; 475e0: 2140 0004 movel %d0,%a0@(4) 475e4: 4280 clrl %d0 return 0; default: return EINVAL; } } 475e6: 4e5e unlk %fp 475e8: 4e75 rts ... 00048960 : int pthread_setschedparam( pthread_t thread, int policy, struct sched_param *param ) { 48960: 4e56 ffe0 linkw %fp,#-32 48964: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 48968: 282e 000c movel %fp@(12),%d4 4896c: 242e 0010 movel %fp@(16),%d2 int rc; /* * Check all the parameters */ if ( !param ) 48970: 6700 00c2 beqw 48a34 return EINVAL; rc = _POSIX_Thread_Translate_sched_param( 48974: 486e fff8 pea %fp@(-8) 48978: 486e fffc pea %fp@(-4) 4897c: 2f02 movel %d2,%sp@- 4897e: 2f04 movel %d4,%sp@- 48980: 4eb9 0004 e76c jsr 4e76c <_POSIX_Thread_Translate_sched_param> policy, param, &budget_algorithm, &budget_callout ); if ( rc ) 48986: 4fef 0010 lea %sp@(16),%sp * Check all the parameters */ if ( !param ) return EINVAL; rc = _POSIX_Thread_Translate_sched_param( 4898a: 2600 movel %d0,%d3 policy, param, &budget_algorithm, &budget_callout ); if ( rc ) 4898c: 670c beqs 4899a case OBJECTS_ERROR: break; } return ESRCH; } 4898e: 2003 movel %d3,%d0 48990: 4cee 0c1c ffe0 moveml %fp@(-32),%d2-%d4/%a2-%a3 48996: 4e5e unlk %fp 48998: 4e75 rts 4899a: 486e fff4 pea %fp@(-12) 4899e: 2f2e 0008 movel %fp@(8),%sp@- 489a2: 4879 0006 45da pea 645da <_POSIX_Threads_Information> 489a8: 4eb9 0004 aa94 jsr 4aa94 <_Objects_Get> /* * Actually change the scheduling policy and parameters */ the_thread = _POSIX_Threads_Get( thread, &location ); switch ( location ) { 489ae: 4fef 000c lea %sp@(12),%sp 489b2: 2440 moveal %d0,%a2 489b4: 4aae fff4 tstl %fp@(-12) 489b8: 6600 0088 bnew 48a42 case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 489bc: 266a 010e moveal %a2@(270),%a3 if ( api->schedpolicy == SCHED_SPORADIC ) 489c0: 7003 moveq #3,%d0 489c2: b0ab 007c cmpl %a3@(124),%d0 489c6: 6700 00b8 beqw 48a80 <== ALWAYS TAKEN (void) _Watchdog_Remove( &api->Sporadic_timer ); api->schedpolicy = policy; api->schedparam = *param; 489ca: 2242 moveal %d2,%a1 489cc: 41eb 0080 lea %a3@(128),%a0 api = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( api->schedpolicy == SCHED_SPORADIC ) (void) _Watchdog_Remove( &api->Sporadic_timer ); api->schedpolicy = policy; 489d0: 2744 007c movel %d4,%a3@(124) api->schedparam = *param; 489d4: 20d9 movel %a1@+,%a0@+ 489d6: 20d9 movel %a1@+,%a0@+ 489d8: 20d9 movel %a1@+,%a0@+ 489da: 20d9 movel %a1@+,%a0@+ 489dc: 20d9 movel %a1@+,%a0@+ the_thread->budget_algorithm = budget_algorithm; 489de: 256e fffc 007a movel %fp@(-4),%a2@(122) if ( api->schedpolicy == SCHED_SPORADIC ) (void) _Watchdog_Remove( &api->Sporadic_timer ); api->schedpolicy = policy; api->schedparam = *param; 489e4: 2091 movel %a1@,%a0@ the_thread->budget_algorithm = budget_algorithm; the_thread->budget_callout = budget_callout; 489e6: 256e fff8 007e movel %fp@(-8),%a2@(126) switch ( api->schedpolicy ) { 489ec: 4a84 tstl %d4 489ee: 6d32 blts 48a22 <== ALWAYS TAKEN 489f0: 7002 moveq #2,%d0 489f2: b084 cmpl %d4,%d0 489f4: 6d5c blts 48a52 <== ALWAYS TAKEN 489f6: 4280 clrl %d0 489f8: 1039 0006 2c06 moveb 62c06 ,%d0 case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; 489fe: 41f9 0006 43a4 lea 643a4 <_Thread_Ticks_per_timeslice>,%a0 48a04: 90ab 0080 subl %a3@(128),%d0 48a08: 2550 0076 movel %a0@,%a2@(118) the_thread->real_priority = 48a0c: 2540 0018 movel %d0,%a2@(24) _POSIX_Priority_To_core( api->schedparam.sched_priority ); _Thread_Change_priority( 48a10: 4878 0001 pea 1 48a14: 2f00 movel %d0,%sp@- 48a16: 2f0a movel %a2,%sp@- 48a18: 4eb9 0004 ad84 jsr 4ad84 <_Thread_Change_priority> the_thread, the_thread->real_priority, true ); break; 48a1e: 4fef 000c lea %sp@(12),%sp _Watchdog_Remove( &api->Sporadic_timer ); _POSIX_Threads_Sporadic_budget_TSR( 0, the_thread ); break; } _Thread_Enable_dispatch(); 48a22: 4eb9 0004 b2a4 jsr 4b2a4 <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return ESRCH; } 48a28: 2003 movel %d3,%d0 48a2a: 4cee 0c1c ffe0 moveml %fp@(-32),%d2-%d4/%a2-%a3 48a30: 4e5e unlk %fp 48a32: 4e75 rts int rc; /* * Check all the parameters */ if ( !param ) 48a34: 7616 moveq #22,%d3 case OBJECTS_ERROR: break; } return ESRCH; } 48a36: 2003 movel %d3,%d0 48a38: 4cee 0c1c ffe0 moveml %fp@(-32),%d2-%d4/%a2-%a3 48a3e: 4e5e unlk %fp 48a40: 4e75 rts /* * Actually change the scheduling policy and parameters */ the_thread = _POSIX_Threads_Get( thread, &location ); switch ( location ) { 48a42: 163c 0003 moveb #3,%d3 case OBJECTS_ERROR: break; } return ESRCH; } 48a46: 2003 movel %d3,%d0 48a48: 4cee 0c1c ffe0 moveml %fp@(-32),%d2-%d4/%a2-%a3 48a4e: 4e5e unlk %fp 48a50: 4e75 rts api->schedpolicy = policy; api->schedparam = *param; the_thread->budget_algorithm = budget_algorithm; the_thread->budget_callout = budget_callout; switch ( api->schedpolicy ) { 48a52: 103c 0003 moveb #3,%d0 48a56: b084 cmpl %d4,%d0 48a58: 66c8 bnes 48a22 <== ALWAYS TAKEN true ); break; case SCHED_SPORADIC: api->ss_high_priority = api->schedparam.sched_priority; 48a5a: 276b 0080 0098 movel %a3@(128),%a3@(152) _Watchdog_Remove( &api->Sporadic_timer ); 48a60: 486b 009c pea %a3@(156) 48a64: 4eb9 0004 c714 jsr 4c714 <_Watchdog_Remove> _POSIX_Threads_Sporadic_budget_TSR( 0, the_thread ); 48a6a: 2f0a movel %a2,%sp@- 48a6c: 42a7 clrl %sp@- 48a6e: 4eb9 0004 88a2 jsr 488a2 <_POSIX_Threads_Sporadic_budget_TSR> 48a74: 4fef 000c lea %sp@(12),%sp break; } _Thread_Enable_dispatch(); 48a78: 4eb9 0004 b2a4 jsr 4b2a4 <_Thread_Enable_dispatch> 48a7e: 60a8 bras 48a28 <== ALWAYS TAKEN case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( api->schedpolicy == SCHED_SPORADIC ) (void) _Watchdog_Remove( &api->Sporadic_timer ); 48a80: 486b 009c pea %a3@(156) 48a84: 4eb9 0004 c714 jsr 4c714 <_Watchdog_Remove> api->schedpolicy = policy; api->schedparam = *param; the_thread->budget_algorithm = budget_algorithm; 48a8a: 256e fffc 007a movel %fp@(-4),%a2@(122) if ( api->schedpolicy == SCHED_SPORADIC ) (void) _Watchdog_Remove( &api->Sporadic_timer ); api->schedpolicy = policy; api->schedparam = *param; 48a90: 2242 moveal %d2,%a1 48a92: 41eb 0080 lea %a3@(128),%a0 case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( api->schedpolicy == SCHED_SPORADIC ) (void) _Watchdog_Remove( &api->Sporadic_timer ); 48a96: 588f addql #4,%sp api->schedpolicy = policy; 48a98: 2744 007c movel %d4,%a3@(124) api->schedparam = *param; 48a9c: 20d9 movel %a1@+,%a0@+ 48a9e: 20d9 movel %a1@+,%a0@+ 48aa0: 20d9 movel %a1@+,%a0@+ 48aa2: 20d9 movel %a1@+,%a0@+ 48aa4: 20d9 movel %a1@+,%a0@+ the_thread->budget_algorithm = budget_algorithm; the_thread->budget_callout = budget_callout; 48aa6: 256e fff8 007e movel %fp@(-8),%a2@(126) if ( api->schedpolicy == SCHED_SPORADIC ) (void) _Watchdog_Remove( &api->Sporadic_timer ); api->schedpolicy = policy; api->schedparam = *param; 48aac: 2091 movel %a1@,%a0@ the_thread->budget_algorithm = budget_algorithm; the_thread->budget_callout = budget_callout; switch ( api->schedpolicy ) { 48aae: 4a84 tstl %d4 48ab0: 6c00 ff3e bgew 489f0 48ab4: 6000 ff6c braw 48a22 <== NOT EXECUTED 0004c930 : int pthread_sigmask( int how, const sigset_t *set, sigset_t *oset ) { 4c930: 4e56 0000 linkw %fp,#0 4c934: 202e 0008 movel %fp@(8),%d0 4c938: 2f0b movel %a3,%sp@- 4c93a: 226e 000c moveal %fp@(12),%a1 4c93e: 2f0a movel %a2,%sp@- 4c940: 246e 0010 moveal %fp@(16),%a2 POSIX_API_Control *api; if ( !set && !oset ) 4c944: 4a89 tstl %a1 4c946: 6700 0096 beqw 4c9de rtems_set_errno_and_return_minus_one( EINVAL ); api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 4c94a: 2679 0006 115e moveal 6115e <_Thread_Executing>,%a3 4c950: 206b 010e moveal %a3@(270),%a0 if ( oset ) 4c954: 4a8a tstl %a2 4c956: 6708 beqs 4c960 *oset = api->signals_blocked; 4c958: 24a8 00c4 movel %a0@(196),%a2@ if ( !set ) 4c95c: 4a89 tstl %a1 4c95e: 6744 beqs 4c9a4 <== ALWAYS TAKEN return 0; switch ( how ) { 4c960: 7201 moveq #1,%d1 4c962: b280 cmpl %d0,%d1 4c964: 6770 beqs 4c9d6 4c966: 123c 0002 moveb #2,%d1 4c96a: b280 cmpl %d0,%d1 4c96c: 6744 beqs 4c9b2 4c96e: 4a80 tstl %d0 4c970: 664a bnes 4c9bc break; case SIG_UNBLOCK: api->signals_blocked &= ~*set; break; case SIG_SETMASK: api->signals_blocked = *set; 4c972: 2151 00c4 movel %a1@,%a0@(196) /* XXX are there critical section problems here? */ /* XXX evaluate the new set */ if ( ~api->signals_blocked & (api->signals_pending | _POSIX_signals_Pending) ) { 4c976: 2039 0006 171e movel 6171e <_POSIX_signals_Pending>,%d0 /* XXX are there critical section problems here? */ /* XXX evaluate the new set */ if ( ~api->signals_blocked & 4c97c: 2228 00c4 movel %a0@(196),%d1 4c980: 4681 notl %d1 (api->signals_pending | _POSIX_signals_Pending) ) { 4c982: 80a8 00c8 orl %a0@(200),%d0 /* XXX are there critical section problems here? */ /* XXX evaluate the new set */ if ( ~api->signals_blocked & 4c986: c081 andl %d1,%d0 4c988: 671a beqs 4c9a4 (api->signals_pending | _POSIX_signals_Pending) ) { _Thread_Executing->do_post_task_switch_extension = true; 4c98a: 7201 moveq #1,%d1 4c98c: 1741 0074 moveb %d1,%a3@(116) _Thread_Dispatch(); 4c990: 4eb9 0004 8e5c jsr 48e5c <_Thread_Dispatch> } return 0; } 4c996: 246e fff8 moveal %fp@(-8),%a2 /* XXX evaluate the new set */ if ( ~api->signals_blocked & (api->signals_pending | _POSIX_signals_Pending) ) { _Thread_Executing->do_post_task_switch_extension = true; _Thread_Dispatch(); 4c99a: 4280 clrl %d0 } return 0; } 4c99c: 266e fffc moveal %fp@(-4),%a3 4c9a0: 4e5e unlk %fp 4c9a2: 4e75 rts 4c9a4: 246e fff8 moveal %fp@(-8),%a2 /* XXX evaluate the new set */ if ( ~api->signals_blocked & (api->signals_pending | _POSIX_signals_Pending) ) { _Thread_Executing->do_post_task_switch_extension = true; _Thread_Dispatch(); 4c9a8: 4280 clrl %d0 } return 0; } 4c9aa: 266e fffc moveal %fp@(-4),%a3 4c9ae: 4e5e unlk %fp 4c9b0: 4e75 rts switch ( how ) { case SIG_BLOCK: api->signals_blocked |= *set; break; case SIG_UNBLOCK: api->signals_blocked &= ~*set; 4c9b2: 2011 movel %a1@,%d0 4c9b4: 4680 notl %d0 4c9b6: c1a8 00c4 andl %d0,%a0@(196) break; 4c9ba: 60ba bras 4c976 <== ALWAYS TAKEN case SIG_SETMASK: api->signals_blocked = *set; break; default: rtems_set_errno_and_return_minus_one( EINVAL ); 4c9bc: 4eb9 0004 fe2c jsr 4fe2c <__errno> _Thread_Executing->do_post_task_switch_extension = true; _Thread_Dispatch(); } return 0; } 4c9c2: 246e fff8 moveal %fp@(-8),%a2 break; case SIG_SETMASK: api->signals_blocked = *set; break; default: rtems_set_errno_and_return_minus_one( EINVAL ); 4c9c6: 2040 moveal %d0,%a0 4c9c8: 7216 moveq #22,%d1 4c9ca: 70ff moveq #-1,%d0 _Thread_Executing->do_post_task_switch_extension = true; _Thread_Dispatch(); } return 0; } 4c9cc: 266e fffc moveal %fp@(-4),%a3 4c9d0: 4e5e unlk %fp break; case SIG_SETMASK: api->signals_blocked = *set; break; default: rtems_set_errno_and_return_minus_one( EINVAL ); 4c9d2: 2081 movel %d1,%a0@ _Thread_Executing->do_post_task_switch_extension = true; _Thread_Dispatch(); } return 0; } 4c9d4: 4e75 rts if ( !set ) return 0; switch ( how ) { case SIG_BLOCK: api->signals_blocked |= *set; 4c9d6: 2011 movel %a1@,%d0 4c9d8: 81a8 00c4 orl %d0,%a0@(196) break; 4c9dc: 6098 bras 4c976 <== ALWAYS TAKEN sigset_t *oset ) { POSIX_API_Control *api; if ( !set && !oset ) 4c9de: 4a8a tstl %a2 4c9e0: 67da beqs 4c9bc rtems_set_errno_and_return_minus_one( EINVAL ); api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 4c9e2: 2679 0006 115e moveal 6115e <_Thread_Executing>,%a3 4c9e8: 206b 010e moveal %a3@(270),%a0 if ( oset ) *oset = api->signals_blocked; 4c9ec: 24a8 00c4 movel %a0@(196),%a2@ if ( !set ) 4c9f0: 4a89 tstl %a1 4c9f2: 6600 ff6c bnew 4c960 <== ALWAYS TAKEN 4c9f6: 60ac bras 4c9a4 <== ALWAYS TAKEN 00045fe8 : */ int pthread_spin_trylock( pthread_spinlock_t *spinlock ) { 45fe8: 4e56 fffc linkw %fp,#-4 45fec: 206e 0008 moveal %fp@(8),%a0 45ff0: 2f02 movel %d2,%sp@- POSIX_Spinlock_Control *the_spinlock = NULL; Objects_Locations location; CORE_spinlock_Status status; if ( !spinlock ) 45ff2: 4a88 tstl %a0 45ff4: 6748 beqs 4603e <== ALWAYS TAKEN 45ff6: 486e fffc pea %fp@(-4) 45ffa: 2f10 movel %a0@,%sp@- 45ffc: 4879 0006 04c4 pea 604c4 <_POSIX_Spinlock_Information> 46002: 4eb9 0004 80e0 jsr 480e0 <_Objects_Get> return EINVAL; the_spinlock = _POSIX_Spinlock_Get( spinlock, &location ); switch ( location ) { 46008: 4fef 000c lea %sp@(12),%sp 4600c: 4aae fffc tstl %fp@(-4) 46010: 662c bnes 4603e case OBJECTS_LOCAL: status = _CORE_spinlock_Wait( &the_spinlock->Spinlock, false, 0 ); 46012: 42a7 clrl %sp@- 46014: 2040 moveal %d0,%a0 46016: 42a7 clrl %sp@- 46018: 4868 0010 pea %a0@(16) 4601c: 4eb9 0004 76b0 jsr 476b0 <_CORE_spinlock_Wait> 46022: 2400 movel %d0,%d2 _Thread_Enable_dispatch(); 46024: 4eb9 0004 88f0 jsr 488f0 <_Thread_Enable_dispatch> return _POSIX_Spinlock_Translate_core_spinlock_return_code( status ); 4602a: 2f02 movel %d2,%sp@- 4602c: 4eb9 0004 5fd0 jsr 45fd0 <_POSIX_Spinlock_Translate_core_spinlock_return_code> case OBJECTS_ERROR: break; } return EINVAL; } 46032: 242e fff8 movel %fp@(-8),%d2 switch ( location ) { case OBJECTS_LOCAL: status = _CORE_spinlock_Wait( &the_spinlock->Spinlock, false, 0 ); _Thread_Enable_dispatch(); return _POSIX_Spinlock_Translate_core_spinlock_return_code( status ); 46036: 4fef 0010 lea %sp@(16),%sp case OBJECTS_ERROR: break; } return EINVAL; } 4603a: 4e5e unlk %fp 4603c: 4e75 rts 4603e: 242e fff8 movel %fp@(-8),%d2 switch ( location ) { case OBJECTS_LOCAL: status = _CORE_spinlock_Wait( &the_spinlock->Spinlock, false, 0 ); _Thread_Enable_dispatch(); return _POSIX_Spinlock_Translate_core_spinlock_return_code( status ); 46042: 7016 moveq #22,%d0 case OBJECTS_ERROR: break; } return EINVAL; } 46044: 4e5e unlk %fp 46046: 4e75 rts 0004641c : * * 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183 */ void pthread_testcancel( void ) { 4641c: 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() ) 46420: 2039 0006 03da movel 603da <_ISR_Nest_level>,%d0 46426: 663c bnes 46464 <== ALWAYS TAKEN return; thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 46428: 2079 0006 03fa moveal 603fa <_Thread_Executing>,%a0 4642e: 2039 0006 0340 movel 60340 <_Thread_Dispatch_disable_level>,%d0 46434: 5280 addql #1,%d0 46436: 2068 010e moveal %a0@(270),%a0 4643a: 23c0 0006 0340 movel %d0,60340 <_Thread_Dispatch_disable_level> _Thread_Disable_dispatch(); if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 46440: 4aa8 00cc tstl %a0@(204) 46444: 6622 bnes 46468 <== ALWAYS TAKEN thread_support->cancelation_requested ) 46446: 4aa8 00d4 tstl %a0@(212) 4644a: 671c beqs 46468 cancel = true; _Thread_Enable_dispatch(); 4644c: 4eb9 0004 8afc jsr 48afc <_Thread_Enable_dispatch> if ( cancel ) _POSIX_Thread_Exit( _Thread_Executing, PTHREAD_CANCELED ); 46452: 4878 ffff pea ffffffff 46456: 2f39 0006 03fa movel 603fa <_Thread_Executing>,%sp@- 4645c: 4eb9 0004 c188 jsr 4c188 <_POSIX_Thread_Exit> 46462: 508f addql #8,%sp <== NOT EXECUTED } 46464: 4e5e unlk %fp <== NOT EXECUTED 46466: 4e75 rts <== NOT EXECUTED 46468: 4e5e unlk %fp _Thread_Disable_dispatch(); if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && thread_support->cancelation_requested ) cancel = true; _Thread_Enable_dispatch(); 4646a: 4ef9 0004 8afc jmp 48afc <_Thread_Enable_dispatch> 0004db08 : rtems_name name, rtems_attribute attribute_set, uint32_t maximum_waiters, rtems_id *id ) { 4db08: 4e56 ffe8 linkw %fp,#-24 4db0c: 202e 0010 movel %fp@(16),%d0 4db10: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ 4db14: 242e 0008 movel %fp@(8),%d2 4db18: 262e 000c movel %fp@(12),%d3 4db1c: 246e 0014 moveal %fp@(20),%a2 Barrier_Control *the_barrier; CORE_barrier_Attributes the_attributes; if ( !rtems_is_name_valid( name ) ) 4db20: 4a82 tstl %d2 4db22: 677a beqs 4db9e return RTEMS_INVALID_NAME; if ( !id ) 4db24: 4a8a tstl %a2 4db26: 6700 00ce beqw 4dbf6 return RTEMS_INVALID_ADDRESS; /* Initialize core barrier attributes */ if ( _Attributes_Is_barrier_automatic( attribute_set ) ) { 4db2a: 0803 0004 btst #4,%d3 4db2e: 677a beqs 4dbaa the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE; if ( maximum_waiters == 0 ) 4db30: 4a80 tstl %d0 4db32: 6700 00b4 beqw 4dbe8 4db36: 2239 0005 f154 movel 5f154 <_Thread_Dispatch_disable_level>,%d1 4db3c: 5281 addql #1,%d1 if ( !id ) return RTEMS_INVALID_ADDRESS; /* Initialize core barrier attributes */ if ( _Attributes_Is_barrier_automatic( attribute_set ) ) { the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE; 4db3e: 42ae fff8 clrl %fp@(-8) if ( maximum_waiters == 0 ) return RTEMS_INVALID_NUMBER; } else the_attributes.discipline = CORE_BARRIER_MANUAL_RELEASE; the_attributes.maximum_count = maximum_waiters; 4db42: 2d40 fffc movel %d0,%fp@(-4) 4db46: 23c1 0005 f154 movel %d1,5f154 <_Thread_Dispatch_disable_level> * This function allocates a barrier control block from * the inactive chain of free barrier control blocks. */ RTEMS_INLINE_ROUTINE Barrier_Control *_Barrier_Allocate( void ) { return (Barrier_Control *) _Objects_Allocate( &_Barrier_Information ); 4db4c: 4879 0005 f9e8 pea 5f9e8 <_Barrier_Information> 4db52: 4eb9 0004 709c jsr 4709c <_Objects_Allocate> _Thread_Disable_dispatch(); /* prevents deletion */ the_barrier = _Barrier_Allocate(); if ( !the_barrier ) { 4db58: 588f addql #4,%sp 4db5a: 2640 moveal %d0,%a3 4db5c: 4a80 tstl %d0 4db5e: 6776 beqs 4dbd6 <== ALWAYS TAKEN _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; } the_barrier->attribute_set = attribute_set; 4db60: 2743 0010 movel %d3,%a3@(16) _CORE_barrier_Initialize( &the_barrier->Barrier, &the_attributes ); 4db64: 486e fff8 pea %fp@(-8) 4db68: 486b 0014 pea %a3@(20) 4db6c: 4eb9 0004 e09c jsr 4e09c <_CORE_barrier_Initialize> 4db72: 202b 0008 movel %a3@(8),%d0 4db76: 4281 clrl %d1 4db78: 2079 0005 fa00 moveal 5fa00 <_Barrier_Information+0x18>,%a0 4db7e: 3200 movew %d0,%d1 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 4db80: 2742 000c movel %d2,%a3@(12) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4db84: 218b 1c00 movel %a3,%a0@(00000000,%d1:l:4) &_Barrier_Information, &the_barrier->Object, (Objects_Name) name ); *id = the_barrier->Object.id; 4db88: 2480 movel %d0,%a2@ _Thread_Enable_dispatch(); 4db8a: 4eb9 0004 7dc8 jsr 47dc8 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 4db90: 508f addql #8,%sp (Objects_Name) name ); *id = the_barrier->Object.id; _Thread_Enable_dispatch(); 4db92: 4280 clrl %d0 return RTEMS_SUCCESSFUL; } 4db94: 4cee 0c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a3 4db9a: 4e5e unlk %fp 4db9c: 4e75 rts ) { Barrier_Control *the_barrier; CORE_barrier_Attributes the_attributes; if ( !rtems_is_name_valid( name ) ) 4db9e: 7003 moveq #3,%d0 *id = the_barrier->Object.id; _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 4dba0: 4cee 0c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a3 4dba6: 4e5e unlk %fp 4dba8: 4e75 rts if ( _Attributes_Is_barrier_automatic( attribute_set ) ) { the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE; if ( maximum_waiters == 0 ) return RTEMS_INVALID_NUMBER; } else the_attributes.discipline = CORE_BARRIER_MANUAL_RELEASE; 4dbaa: 7201 moveq #1,%d1 4dbac: 2d41 fff8 movel %d1,%fp@(-8) 4dbb0: 2239 0005 f154 movel 5f154 <_Thread_Dispatch_disable_level>,%d1 4dbb6: 5281 addql #1,%d1 the_attributes.maximum_count = maximum_waiters; 4dbb8: 2d40 fffc movel %d0,%fp@(-4) 4dbbc: 23c1 0005 f154 movel %d1,5f154 <_Thread_Dispatch_disable_level> 4dbc2: 4879 0005 f9e8 pea 5f9e8 <_Barrier_Information> 4dbc8: 4eb9 0004 709c jsr 4709c <_Objects_Allocate> _Thread_Disable_dispatch(); /* prevents deletion */ the_barrier = _Barrier_Allocate(); if ( !the_barrier ) { 4dbce: 588f addql #4,%sp 4dbd0: 2640 moveal %d0,%a3 4dbd2: 4a80 tstl %d0 4dbd4: 668a bnes 4db60 _Thread_Enable_dispatch(); 4dbd6: 4eb9 0004 7dc8 jsr 47dc8 <_Thread_Enable_dispatch> 4dbdc: 7005 moveq #5,%d0 *id = the_barrier->Object.id; _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 4dbde: 4cee 0c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a3 4dbe4: 4e5e unlk %fp 4dbe6: 4e75 rts return RTEMS_INVALID_ADDRESS; /* Initialize core barrier attributes */ if ( _Attributes_Is_barrier_automatic( attribute_set ) ) { the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE; if ( maximum_waiters == 0 ) 4dbe8: 103c 000a moveb #10,%d0 *id = the_barrier->Object.id; _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 4dbec: 4cee 0c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a3 4dbf2: 4e5e unlk %fp 4dbf4: 4e75 rts CORE_barrier_Attributes the_attributes; if ( !rtems_is_name_valid( name ) ) return RTEMS_INVALID_NAME; if ( !id ) 4dbf6: 7009 moveq #9,%d0 *id = the_barrier->Object.id; _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 4dbf8: 4cee 0c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a3 4dbfe: 4e5e unlk %fp 4dc00: 4e75 rts ... 0004dc04 : */ rtems_status_code rtems_barrier_delete( rtems_id id ) { 4dc04: 4e56 fffc linkw %fp,#-4 4dc08: 2f0a movel %a2,%sp@- RTEMS_INLINE_ROUTINE Barrier_Control *_Barrier_Get ( Objects_Id id, Objects_Locations *location ) { return (Barrier_Control *) 4dc0a: 486e fffc pea %fp@(-4) 4dc0e: 2f2e 0008 movel %fp@(8),%sp@- 4dc12: 4879 0005 f9e8 pea 5f9e8 <_Barrier_Information> 4dc18: 4eb9 0004 7538 jsr 47538 <_Objects_Get> Barrier_Control *the_barrier; Objects_Locations location; the_barrier = _Barrier_Get( id, &location ); switch ( location ) { 4dc1e: 4fef 000c lea %sp@(12),%sp 4dc22: 2440 moveal %d0,%a2 4dc24: 4aae fffc tstl %fp@(-4) 4dc28: 6640 bnes 4dc6a <== ALWAYS TAKEN case OBJECTS_LOCAL: _CORE_barrier_Flush( 4dc2a: 4878 0002 pea 2 4dc2e: 42a7 clrl %sp@- 4dc30: 486a 0014 pea %a2@(20) 4dc34: 4eb9 0004 8554 jsr 48554 <_Thread_queue_Flush> &the_barrier->Barrier, NULL, CORE_BARRIER_WAS_DELETED ); _Objects_Close( &_Barrier_Information, &the_barrier->Object ); 4dc3a: 2f0a movel %a2,%sp@- 4dc3c: 4879 0005 f9e8 pea 5f9e8 <_Barrier_Information> 4dc42: 4eb9 0004 712c jsr 4712c <_Objects_Close> */ RTEMS_INLINE_ROUTINE void _Barrier_Free ( Barrier_Control *the_barrier ) { _Objects_Free( &_Barrier_Information, &the_barrier->Object ); 4dc48: 2f0a movel %a2,%sp@- 4dc4a: 4879 0005 f9e8 pea 5f9e8 <_Barrier_Information> 4dc50: 4eb9 0004 73d4 jsr 473d4 <_Objects_Free> _Barrier_Free( the_barrier ); _Thread_Enable_dispatch(); 4dc56: 4eb9 0004 7dc8 jsr 47dc8 <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4dc5c: 246e fff8 moveal %fp@(-8),%a2 _Objects_Close( &_Barrier_Information, &the_barrier->Object ); _Barrier_Free( the_barrier ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; 4dc60: 4fef 001c lea %sp@(28),%sp _Objects_Close( &_Barrier_Information, &the_barrier->Object ); _Barrier_Free( the_barrier ); _Thread_Enable_dispatch(); 4dc64: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4dc66: 4e5e unlk %fp 4dc68: 4e75 rts 4dc6a: 246e fff8 moveal %fp@(-8),%a2 { Barrier_Control *the_barrier; Objects_Locations location; the_barrier = _Barrier_Get( id, &location ); switch ( location ) { 4dc6e: 7004 moveq #4,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4dc70: 4e5e unlk %fp 4dc72: 4e75 rts 0004b95c : #include rtems_status_code rtems_clock_get_tod_timeval( struct timeval *time ) { 4b95c: 4e56 ffec linkw %fp,#-20 4b960: 48d7 040c moveml %d2-%d3/%a2,%sp@ 4b964: 246e 0008 moveal %fp@(8),%a2 if ( !time ) 4b968: 4a8a tstl %a2 4b96a: 6750 beqs 4b9bc <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; if ( !_TOD_Is_set ) 4b96c: 4a39 000a 6c3c tstb a6c3c <_TOD_Is_set> 4b972: 660c bnes 4b980 4b974: 700b moveq #11,%d0 return RTEMS_NOT_DEFINED; _TOD_Get_timeval( time ); return RTEMS_SUCCESSFUL; } 4b976: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 4b97c: 4e5e unlk %fp 4b97e: 4e75 rts { ISR_Level level; struct timespec now; suseconds_t useconds; _ISR_Disable(level); 4b980: 203c 0000 0700 movel #1792,%d0 4b986: 40c2 movew %sr,%d2 4b988: 8082 orl %d2,%d0 4b98a: 46c0 movew %d0,%sr _TOD_Get( &now ); 4b98c: 486e fff8 pea %fp@(-8) 4b990: 4eb9 0004 cfa4 jsr 4cfa4 <_TOD_Get> _ISR_Enable(level); 4b996: 46c2 movew %d2,%sr useconds = (suseconds_t)now.tv_nsec; useconds /= (suseconds_t)TOD_NANOSECONDS_PER_MICROSECOND; time->tv_sec = now.tv_sec; time->tv_usec = useconds; 4b998: 263c 0000 03e8 movel #1000,%d3 if ( !_TOD_Is_set ) return RTEMS_NOT_DEFINED; _TOD_Get_timeval( time ); return RTEMS_SUCCESSFUL; 4b99e: 588f addql #4,%sp 4b9a0: 4280 clrl %d0 _ISR_Disable(level); _TOD_Get( &now ); _ISR_Enable(level); useconds = (suseconds_t)now.tv_nsec; 4b9a2: 222e fffc movel %fp@(-4),%d1 useconds /= (suseconds_t)TOD_NANOSECONDS_PER_MICROSECOND; time->tv_sec = now.tv_sec; time->tv_usec = useconds; 4b9a6: 4c43 1801 remsl %d3,%d1,%d1 4b9aa: 2541 0004 movel %d1,%a2@(4) _ISR_Enable(level); useconds = (suseconds_t)now.tv_nsec; useconds /= (suseconds_t)TOD_NANOSECONDS_PER_MICROSECOND; time->tv_sec = now.tv_sec; 4b9ae: 24ae fff8 movel %fp@(-8),%a2@ } 4b9b2: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 4b9b8: 4e5e unlk %fp 4b9ba: 4e75 rts rtems_status_code rtems_clock_get_tod_timeval( struct timeval *time ) { if ( !time ) 4b9bc: 7009 moveq #9,%d0 return RTEMS_NOT_DEFINED; _TOD_Get_timeval( time ); return RTEMS_SUCCESSFUL; } 4b9be: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 4b9c4: 4e5e unlk %fp 4b9c6: 4e75 rts 000482ec : 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 ) { 482ec: 4e56 fff4 linkw %fp,#-12 482f0: 226e 000c moveal %fp@(12),%a1 482f4: 48d7 040c moveml %d2-%d3/%a2,%sp@ 482f8: 242e 0008 movel %fp@(8),%d2 482fc: 246e 0010 moveal %fp@(16),%a2 rtems_device_major_number major_limit = _IO_Number_of_drivers; 48300: 2039 0006 5c6e movel 65c6e <_IO_Number_of_drivers>,%d0 if ( rtems_interrupt_is_in_progress() ) 48306: 2239 0006 5476 movel 65476 <_ISR_Nest_level>,%d1 4830c: 6600 009c bnew 483aa return RTEMS_CALLED_FROM_ISR; if ( registered_major == NULL ) 48310: 4a8a tstl %a2 48312: 6700 00ea beqw 483fe return RTEMS_INVALID_ADDRESS; /* Set it to an invalid value */ *registered_major = major_limit; 48316: 2480 movel %d0,%a2@ if ( driver_table == NULL ) 48318: 4a89 tstl %a1 4831a: 6700 00e2 beqw 483fe static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 4831e: 4a91 tstl %a1@ 48320: 6700 00d4 beqw 483f6 return RTEMS_INVALID_ADDRESS; if ( rtems_io_is_empty_table( driver_table ) ) return RTEMS_INVALID_ADDRESS; if ( major >= major_limit ) 48324: b480 cmpl %d0,%d2 48326: 6476 bccs 4839e rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 48328: 2039 0006 53dc movel 653dc <_Thread_Dispatch_disable_level>,%d0 4832e: 5280 addql #1,%d0 48330: 23c0 0006 53dc movel %d0,653dc <_Thread_Dispatch_disable_level> return RTEMS_INVALID_NUMBER; _Thread_Disable_dispatch(); if ( major == 0 ) { 48336: 4a82 tstl %d2 48338: 667c bnes 483b6 static rtems_status_code rtems_io_obtain_major_number( rtems_device_major_number *major ) { rtems_device_major_number n = _IO_Number_of_drivers; 4833a: 2039 0006 5c6e movel 65c6e <_IO_Number_of_drivers>,%d0 rtems_device_major_number m = 0; /* major is error checked by caller */ for ( m = 0; m < n; ++m ) { 48340: 6700 00fc beqw 4843e <== ALWAYS TAKEN 48344: 2239 0006 5c72 movel 65c72 <_IO_Driver_address_table>,%d1 4834a: 2041 moveal %d1,%a0 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 4834c: 4a90 tstl %a0@ 4834e: 6700 008e beqw 483de 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 ) { 48352: 5282 addql #1,%d2 48354: 41e8 0018 lea %a0@(24),%a0 48358: b480 cmpl %d0,%d2 4835a: 65f0 bcss 4834c if ( rtems_io_is_empty_table( table ) ) break; } /* Assigns invalid value in case of failure */ *major = m; 4835c: 2482 movel %d2,%a2@ if ( m != n ) 4835e: b480 cmpl %d0,%d2 48360: 6700 00de beqw 48440 48364: 2602 movel %d2,%d3 48366: 2002 movel %d2,%d0 48368: 2041 moveal %d1,%a0 4836a: e78b lsll #3,%d3 4836c: eb88 lsll #5,%d0 4836e: 9083 subl %d3,%d0 48370: d1c0 addal %d0,%a0 } *registered_major = major; } _IO_Driver_address_table [major] = *driver_table; 48372: 20d9 movel %a1@+,%a0@+ 48374: 20d9 movel %a1@+,%a0@+ 48376: 20d9 movel %a1@+,%a0@+ 48378: 20d9 movel %a1@+,%a0@+ 4837a: 20d9 movel %a1@+,%a0@+ 4837c: 2091 movel %a1@,%a0@ _Thread_Enable_dispatch(); 4837e: 4eb9 0004 9e90 jsr 49e90 <_Thread_Enable_dispatch> return rtems_io_initialize( major, 0, NULL ); 48384: 2d42 0008 movel %d2,%fp@(8) } 48388: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 4838e: 42ae 0010 clrl %fp@(16) 48392: 42ae 000c clrl %fp@(12) } 48396: 4e5e unlk %fp _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 48398: 4ef9 0005 1524 jmp 51524 return RTEMS_INVALID_ADDRESS; if ( rtems_io_is_empty_table( driver_table ) ) return RTEMS_INVALID_ADDRESS; if ( major >= major_limit ) 4839e: 700a moveq #10,%d0 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); } 483a0: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 483a6: 4e5e unlk %fp 483a8: 4e75 rts rtems_device_major_number *registered_major ) { rtems_device_major_number major_limit = _IO_Number_of_drivers; if ( rtems_interrupt_is_in_progress() ) 483aa: 7012 moveq #18,%d0 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); } 483ac: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 483b2: 4e5e unlk %fp 483b4: 4e75 rts _Thread_Enable_dispatch(); return sc; } major = *registered_major; } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major; 483b6: 2202 movel %d2,%d1 483b8: 2002 movel %d2,%d0 483ba: e789 lsll #3,%d1 483bc: eb88 lsll #5,%d0 483be: 2079 0006 5c72 moveal 65c72 <_IO_Driver_address_table>,%a0 483c4: 9081 subl %d1,%d0 483c6: d1c0 addal %d0,%a0 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 483c8: 4a90 tstl %a0@ 483ca: 673e beqs 4840a 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(); 483cc: 4eb9 0004 9e90 jsr 49e90 <_Thread_Enable_dispatch> 483d2: 700c moveq #12,%d0 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); } 483d4: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 483da: 4e5e unlk %fp 483dc: 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; 483de: 4aa8 0004 tstl %a0@(4) 483e2: 6700 ff78 beqw 4835c 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 ) { 483e6: 5282 addql #1,%d2 483e8: 41e8 0018 lea %a0@(24),%a0 483ec: b480 cmpl %d0,%d2 483ee: 6500 ff5c bcsw 4834c <== ALWAYS TAKEN 483f2: 6000 ff68 braw 4835c <== ALWAYS TAKEN static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 483f6: 4aa9 0004 tstl %a1@(4) 483fa: 6600 ff28 bnew 48324 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 483fe: 7009 moveq #9,%d0 } 48400: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 48406: 4e5e unlk %fp 48408: 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; 4840a: 4aa8 0004 tstl %a0@(4) 4840e: 66bc bnes 483cc } *registered_major = major; } _IO_Driver_address_table [major] = *driver_table; 48410: 20d9 movel %a1@+,%a0@+ 48412: 20d9 movel %a1@+,%a0@+ 48414: 20d9 movel %a1@+,%a0@+ 48416: 20d9 movel %a1@+,%a0@+ 48418: 20d9 movel %a1@+,%a0@+ 4841a: 2091 movel %a1@,%a0@ if ( !rtems_io_is_empty_table( table ) ) { _Thread_Enable_dispatch(); return RTEMS_RESOURCE_IN_USE; } *registered_major = major; 4841c: 2482 movel %d2,%a2@ } _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); 4841e: 4eb9 0004 9e90 jsr 49e90 <_Thread_Enable_dispatch> return rtems_io_initialize( major, 0, NULL ); 48424: 2d42 0008 movel %d2,%fp@(8) } 48428: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 4842e: 42ae 0010 clrl %fp@(16) 48432: 42ae 000c clrl %fp@(12) } 48436: 4e5e unlk %fp _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 48438: 4ef9 0005 1524 jmp 51524 if ( rtems_io_is_empty_table( table ) ) break; } /* Assigns invalid value in case of failure */ *major = m; 4843e: 4292 clrl %a2@ <== NOT EXECUTED if ( major == 0 ) { rtems_status_code sc = rtems_io_obtain_major_number( registered_major ); if ( sc != RTEMS_SUCCESSFUL ) { _Thread_Enable_dispatch(); 48440: 4eb9 0004 9e90 jsr 49e90 <_Thread_Enable_dispatch> 48446: 7005 moveq #5,%d0 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); } 48448: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 4844e: 4e5e unlk %fp 48450: 4e75 rts ... 00048a9c : #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) { 48a9c: 4e56 fff0 linkw %fp,#-16 48aa0: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ 48aa4: 266e 0008 moveal %fp@(8),%a3 uint32_t i; uint32_t api_index; Thread_Control *the_thread; Objects_Information *information; if ( !routine ) 48aa8: 4a8b tstl %a3 48aaa: 6744 beqs 48af0 <== ALWAYS TAKEN 48aac: 49f9 0006 96c0 lea 696c0 <_Objects_Information_table+0x4>,%a4 return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { if ( !_Objects_Information_table[ api_index ] ) 48ab2: 2054 moveal %a4@,%a0 48ab4: 4a88 tstl %a0 48ab6: 672e beqs 48ae6 continue; information = _Objects_Information_table[ api_index ][ 1 ]; 48ab8: 2468 0004 moveal %a0@(4),%a2 if ( !information ) 48abc: 4a8a tstl %a2 48abe: 6726 beqs 48ae6 continue; for ( i=1 ; i <= information->maximum ; i++ ) { 48ac0: 4a6a 000e tstw %a2@(14) 48ac4: 6720 beqs 48ae6 48ac6: 7401 moveq #1,%d2 the_thread = (Thread_Control *)information->local_table[ i ]; 48ac8: 206a 0018 moveal %a2@(24),%a0 48acc: 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++ ) { 48ad0: 5282 addql #1,%d2 the_thread = (Thread_Control *)information->local_table[ i ]; if ( !the_thread ) 48ad2: 4a80 tstl %d0 48ad4: 6706 beqs 48adc <== ALWAYS TAKEN continue; (*routine)(the_thread); 48ad6: 2f00 movel %d0,%sp@- 48ad8: 4e93 jsr %a3@ 48ada: 588f addql #4,%sp information = _Objects_Information_table[ api_index ][ 1 ]; if ( !information ) continue; for ( i=1 ; i <= information->maximum ; i++ ) { 48adc: 4280 clrl %d0 48ade: 302a 000e movew %a2@(14),%d0 48ae2: b480 cmpl %d0,%d2 48ae4: 63e2 blss 48ac8 48ae6: 588c addql #4,%a4 Objects_Information *information; if ( !routine ) return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { 48ae8: b9fc 0006 96d0 cmpal #431824,%a4 48aee: 66c2 bnes 48ab2 (*routine)(the_thread); } } } 48af0: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 48af6: 4e5e unlk %fp 48af8: 4e75 rts ... 000476f4 : rtems_status_code rtems_object_get_class_information( int the_api, int the_class, rtems_object_api_class_information *info ) { 476f4: 4e56 0000 linkw %fp,#0 476f8: 2f0a movel %a2,%sp@- 476fa: 246e 0010 moveal %fp@(16),%a2 476fe: 2f02 movel %d2,%sp@- int i; /* * Validate parameters and look up information structure. */ if ( !info ) 47700: 4a8a tstl %a2 47702: 6766 beqs 4776a return RTEMS_INVALID_ADDRESS; obj_info = _Objects_Get_information( the_api, the_class ); 47704: 2f2e 000c movel %fp@(12),%sp@- 47708: 2f2e 0008 movel %fp@(8),%sp@- 4770c: 4eb9 0004 930c jsr 4930c <_Objects_Get_information> if ( !obj_info ) 47712: 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 ); 47714: 2040 moveal %d0,%a0 if ( !obj_info ) 47716: 4a80 tstl %d0 47718: 675e beqs 47778 return RTEMS_INVALID_NUMBER; /* * Return information about this object class to the user. */ info->minimum_id = obj_info->minimum_id; 4771a: 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; 4771e: 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; 47720: 2568 000a 0004 movel %a0@(10),%a2@(4) info->auto_extend = obj_info->auto_extend; info->maximum = obj_info->maximum; 47726: 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; 4772a: 1568 0010 000c moveb %a0@(16),%a2@(12) info->maximum = obj_info->maximum; 47730: 2542 0008 movel %d2,%a2@(8) for ( unallocated=0, i=1 ; i <= info->maximum ; i++ ) 47734: 6750 beqs 47786 <== ALWAYS TAKEN 47736: 2068 0018 moveal %a0@(24),%a0 4773a: 7201 moveq #1,%d1 4773c: 7001 moveq #1,%d0 4773e: 93c9 subal %a1,%a1 47740: 5280 addql #1,%d0 if ( !obj_info->local_table[i] ) 47742: 4ab0 1c00 tstl %a0@(00000000,%d1:l:4) 47746: 6718 beqs 47760 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++ ) 47748: 2200 movel %d0,%d1 4774a: b082 cmpl %d2,%d0 4774c: 63f2 blss 47740 <== NEVER TAKEN if ( !obj_info->local_table[i] ) unallocated++; info->unallocated = unallocated; 4774e: 2549 000e movel %a1,%a2@(14) 47752: 4280 clrl %d0 return RTEMS_SUCCESSFUL; } 47754: 242e fff8 movel %fp@(-8),%d2 47758: 246e fffc moveal %fp@(-4),%a2 4775c: 4e5e unlk %fp 4775e: 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++; 47760: 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++ ) 47762: 2200 movel %d0,%d1 47764: b082 cmpl %d2,%d0 47766: 63d8 blss 47740 <== ALWAYS TAKEN 47768: 60e4 bras 4774e <== ALWAYS TAKEN unallocated++; info->unallocated = unallocated; return RTEMS_SUCCESSFUL; } 4776a: 242e fff8 movel %fp@(-8),%d2 int i; /* * Validate parameters and look up information structure. */ if ( !info ) 4776e: 7009 moveq #9,%d0 unallocated++; info->unallocated = unallocated; return RTEMS_SUCCESSFUL; } 47770: 246e fffc moveal %fp@(-4),%a2 47774: 4e5e unlk %fp 47776: 4e75 rts 47778: 242e fff8 movel %fp@(-8),%d2 */ if ( !info ) return RTEMS_INVALID_ADDRESS; obj_info = _Objects_Get_information( the_api, the_class ); if ( !obj_info ) 4777c: 700a moveq #10,%d0 unallocated++; info->unallocated = unallocated; return RTEMS_SUCCESSFUL; } 4777e: 246e fffc moveal %fp@(-4),%a2 47782: 4e5e unlk %fp 47784: 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++ ) 47786: 93c9 subal %a1,%a1 <== NOT EXECUTED if ( !obj_info->local_table[i] ) unallocated++; info->unallocated = unallocated; 47788: 4280 clrl %d0 <== NOT EXECUTED 4778a: 2549 000e movel %a1,%a2@(14) <== NOT EXECUTED 4778e: 60c4 bras 47754 <== NOT EXECUTED 00045db0 : */ rtems_status_code rtems_object_set_name( rtems_id id, const char *name ) { 45db0: 4e56 fff0 linkw %fp,#-16 45db4: 48d7 001c moveml %d2-%d4,%sp@ 45db8: 262e 0008 movel %fp@(8),%d3 45dbc: 282e 000c movel %fp@(12),%d4 Objects_Information *information; Objects_Locations location; Objects_Control *the_object; Objects_Id tmpId; if ( !name ) 45dc0: 6764 beqs 45e26 return RTEMS_INVALID_ADDRESS; tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 45dc2: 4a83 tstl %d3 45dc4: 6754 beqs 45e1a information = _Objects_Get_information_id( tmpId ); 45dc6: 2f03 movel %d3,%sp@- 45dc8: 4eb9 0004 774c jsr 4774c <_Objects_Get_information_id> if ( !information ) 45dce: 588f addql #4,%sp if ( !name ) return RTEMS_INVALID_ADDRESS; tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; information = _Objects_Get_information_id( tmpId ); 45dd0: 2400 movel %d0,%d2 if ( !information ) 45dd2: 673a beqs 45e0e return RTEMS_INVALID_ID; the_object = _Objects_Get( information, tmpId, &location ); 45dd4: 486e fffc pea %fp@(-4) 45dd8: 2f03 movel %d3,%sp@- 45dda: 2f00 movel %d0,%sp@- 45ddc: 4eb9 0004 792c jsr 4792c <_Objects_Get> switch ( location ) { 45de2: 4fef 000c lea %sp@(12),%sp 45de6: 4aae fffc tstl %fp@(-4) 45dea: 6622 bnes 45e0e case OBJECTS_LOCAL: _Objects_Set_name( information, the_object, name ); 45dec: 2f04 movel %d4,%sp@- 45dee: 2f00 movel %d0,%sp@- 45df0: 2f02 movel %d2,%sp@- 45df2: 4eb9 0004 7ad8 jsr 47ad8 <_Objects_Set_name> _Thread_Enable_dispatch(); 45df8: 4eb9 0004 8234 jsr 48234 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 45dfe: 4fef 000c lea %sp@(12),%sp the_object = _Objects_Get( information, tmpId, &location ); switch ( location ) { case OBJECTS_LOCAL: _Objects_Set_name( information, the_object, name ); _Thread_Enable_dispatch(); 45e02: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 45e04: 4cee 001c fff0 moveml %fp@(-16),%d2-%d4 45e0a: 4e5e unlk %fp 45e0c: 4e75 rts switch ( location ) { case OBJECTS_LOCAL: _Objects_Set_name( information, the_object, name ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; 45e0e: 7004 moveq #4,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 45e10: 4cee 001c fff0 moveml %fp@(-16),%d2-%d4 45e16: 4e5e unlk %fp 45e18: 4e75 rts Objects_Id tmpId; if ( !name ) return RTEMS_INVALID_ADDRESS; tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 45e1a: 2079 0005 fe36 moveal 5fe36 <_Thread_Executing>,%a0 45e20: 2628 0008 movel %a0@(8),%d3 45e24: 60a0 bras 45dc6 <== ALWAYS TAKEN Objects_Information *information; Objects_Locations location; Objects_Control *the_object; Objects_Id tmpId; if ( !name ) 45e26: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 45e28: 4cee 001c fff0 moveml %fp@(-16),%d2-%d4 45e2e: 4e5e unlk %fp 45e30: 4e75 rts ... 000561c8 : uint32_t length, uint32_t buffer_size, rtems_attribute attribute_set, rtems_id *id ) { 561c8: 4e56 ffe8 linkw %fp,#-24 561cc: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@ 561d0: 242e 0008 movel %fp@(8),%d2 561d4: 2a2e 000c movel %fp@(12),%d5 561d8: 282e 0010 movel %fp@(16),%d4 561dc: 262e 0014 movel %fp@(20),%d3 561e0: 246e 001c moveal %fp@(28),%a2 register Partition_Control *the_partition; if ( !rtems_is_name_valid( name ) ) 561e4: 4a82 tstl %d2 561e6: 673a beqs 56222 return RTEMS_INVALID_NAME; if ( !starting_address ) 561e8: 4a85 tstl %d5 561ea: 671e beqs 5620a return RTEMS_INVALID_ADDRESS; if ( !id ) 561ec: 4a8a tstl %a2 561ee: 671a beqs 5620a <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; if ( length == 0 || buffer_size == 0 || length < buffer_size || 561f0: 4a84 tstl %d4 561f2: 6722 beqs 56216 561f4: 4a83 tstl %d3 561f6: 671e beqs 56216 561f8: b684 cmpl %d4,%d3 561fa: 621a bhis 56216 561fc: 7003 moveq #3,%d0 561fe: c083 andl %d3,%d0 56200: 6614 bnes 56216 !_Partition_Is_buffer_size_aligned( buffer_size ) ) return RTEMS_INVALID_SIZE; if ( !_Addresses_Is_aligned( starting_address ) ) 56202: 103c 0003 moveb #3,%d0 56206: c085 andl %d5,%d0 56208: 6724 beqs 5622e 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; 5620a: 7009 moveq #9,%d0 } 5620c: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 56212: 4e5e unlk %fp 56214: 4e75 rts 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; 56216: 7008 moveq #8,%d0 } 56218: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 5621e: 4e5e unlk %fp 56220: 4e75 rts rtems_id *id ) { register Partition_Control *the_partition; if ( !rtems_is_name_valid( name ) ) 56222: 7003 moveq #3,%d0 ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 56224: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 5622a: 4e5e unlk %fp 5622c: 4e75 rts 5622e: 2039 0007 e248 movel 7e248 <_Thread_Dispatch_disable_level>,%d0 56234: 5280 addql #1,%d0 56236: 23c0 0007 e248 movel %d0,7e248 <_Thread_Dispatch_disable_level> * 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 ); 5623c: 4879 0007 e0d2 pea 7e0d2 <_Partition_Information> 56242: 4eb9 0005 ad70 jsr 5ad70 <_Objects_Allocate> _Thread_Disable_dispatch(); /* prevents deletion */ the_partition = _Partition_Allocate(); if ( !the_partition ) { 56248: 588f addql #4,%sp 5624a: 2640 moveal %d0,%a3 5624c: 4a80 tstl %d0 5624e: 675a beqs 562aa _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; } #endif the_partition->starting_address = starting_address; 56250: 2745 0010 movel %d5,%a3@(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, 56254: 2004 movel %d4,%d0 #endif the_partition->starting_address = starting_address; the_partition->length = length; the_partition->buffer_size = buffer_size; the_partition->attribute_set = attribute_set; 56256: 276e 0018 001c movel %fp@(24),%a3@(28) the_partition->number_of_used_blocks = 0; _Chain_Initialize( &the_partition->Memory, starting_address, 5625c: 4c43 0000 remul %d3,%d0,%d0 return RTEMS_TOO_MANY; } #endif the_partition->starting_address = starting_address; the_partition->length = length; 56260: 2744 0014 movel %d4,%a3@(20) the_partition->buffer_size = buffer_size; 56264: 2743 0018 movel %d3,%a3@(24) the_partition->attribute_set = attribute_set; the_partition->number_of_used_blocks = 0; 56268: 42ab 0020 clrl %a3@(32) _Chain_Initialize( &the_partition->Memory, starting_address, 5626c: 2f03 movel %d3,%sp@- 5626e: 2f00 movel %d0,%sp@- 56270: 2f05 movel %d5,%sp@- 56272: 486b 0024 pea %a3@(36) 56276: 4eb9 0005 97ec jsr 597ec <_Chain_Initialize> 5627c: 202b 0008 movel %a3@(8),%d0 56280: 4281 clrl %d1 56282: 2079 0007 e0ea moveal 7e0ea <_Partition_Information+0x18>,%a0 56288: 3200 movew %d0,%d1 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 5628a: 2742 000c movel %d2,%a3@(12) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 5628e: 218b 1c00 movel %a3,%a0@(00000000,%d1:l:4) &_Partition_Information, &the_partition->Object, (Objects_Name) name ); *id = the_partition->Object.id; 56292: 2480 movel %d0,%a2@ name, 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); 56294: 4eb9 0005 bb64 jsr 5bb64 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 5629a: 4fef 0010 lea %sp@(16),%sp name, 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); 5629e: 4280 clrl %d0 return RTEMS_SUCCESSFUL; } 562a0: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 562a6: 4e5e unlk %fp 562a8: 4e75 rts _Thread_Disable_dispatch(); /* prevents deletion */ the_partition = _Partition_Allocate(); if ( !the_partition ) { _Thread_Enable_dispatch(); 562aa: 4eb9 0005 bb64 jsr 5bb64 <_Thread_Enable_dispatch> 562b0: 7005 moveq #5,%d0 ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 562b2: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 562b8: 4e5e unlk %fp 562ba: 4e75 rts 000563dc : rtems_status_code rtems_partition_return_buffer( rtems_id id, void *buffer ) { 563dc: 4e56 fffc linkw %fp,#-4 563e0: 2f0a movel %a2,%sp@- 563e2: 2f02 movel %d2,%sp@- RTEMS_INLINE_ROUTINE Partition_Control *_Partition_Get ( Objects_Id id, Objects_Locations *location ) { return (Partition_Control *) 563e4: 486e fffc pea %fp@(-4) 563e8: 2f2e 0008 movel %fp@(8),%sp@- 563ec: 4879 0007 e0d2 pea 7e0d2 <_Partition_Information> 563f2: 242e 000c movel %fp@(12),%d2 563f6: 4eb9 0005 b248 jsr 5b248 <_Objects_Get> register Partition_Control *the_partition; Objects_Locations location; the_partition = _Partition_Get( id, &location ); switch ( location ) { 563fc: 4fef 000c lea %sp@(12),%sp 56400: 2440 moveal %d0,%a2 56402: 4aae fffc tstl %fp@(-4) 56406: 670e beqs 56416 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 56408: 242e fff4 movel %fp@(-12),%d2 { register Partition_Control *the_partition; Objects_Locations location; the_partition = _Partition_Get( id, &location ); switch ( location ) { 5640c: 7004 moveq #4,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 5640e: 246e fff8 moveal %fp@(-8),%a2 56412: 4e5e unlk %fp 56414: 4e75 rts ) { void *starting; void *ending; starting = the_partition->starting_address; 56416: 202a 0010 movel %a2@(16),%d0 ending = _Addresses_Add_offset( starting, the_partition->length ); 5641a: 222a 0014 movel %a2@(20),%d1 const void *address, const void *base, const void *limit ) { return (address >= base && address <= limit); 5641e: b082 cmpl %d2,%d0 56420: 623c bhis 5645e 56422: d280 addl %d0,%d1 56424: b282 cmpl %d2,%d1 56426: 6536 bcss 5645e <== ALWAYS TAKEN return ( 56428: 2202 movel %d2,%d1 5642a: 9280 subl %d0,%d1 5642c: 2001 movel %d1,%d0 5642e: 4c6a 0001 0018 remul %a2@(24),%d1,%d0 56434: 4a81 tstl %d1 56436: 6626 bnes 5645e RTEMS_INLINE_ROUTINE void _Partition_Free_buffer ( Partition_Control *the_partition, Chain_Node *the_buffer ) { _Chain_Append( &the_partition->Memory, the_buffer ); 56438: 2f02 movel %d2,%sp@- 5643a: 486a 0024 pea %a2@(36) 5643e: 4eb9 0005 9778 jsr 59778 <_Chain_Append> switch ( location ) { case OBJECTS_LOCAL: if ( _Partition_Is_buffer_valid( buffer, the_partition ) ) { _Partition_Free_buffer( the_partition, buffer ); the_partition->number_of_used_blocks -= 1; 56444: 53aa 0020 subql #1,%a2@(32) _Thread_Enable_dispatch(); 56448: 4eb9 0005 bb64 jsr 5bb64 <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 5644e: 242e fff4 movel %fp@(-12),%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; 56452: 508f addql #8,%sp case OBJECTS_LOCAL: if ( _Partition_Is_buffer_valid( buffer, the_partition ) ) { _Partition_Free_buffer( the_partition, buffer ); the_partition->number_of_used_blocks -= 1; _Thread_Enable_dispatch(); 56454: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 56456: 246e fff8 moveal %fp@(-8),%a2 5645a: 4e5e unlk %fp 5645c: 4e75 rts _Partition_Free_buffer( the_partition, buffer ); the_partition->number_of_used_blocks -= 1; _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } _Thread_Enable_dispatch(); 5645e: 4eb9 0005 bb64 jsr 5bb64 <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 56464: 242e fff4 movel %fp@(-12),%d2 _Partition_Free_buffer( the_partition, buffer ); the_partition->number_of_used_blocks -= 1; _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } _Thread_Enable_dispatch(); 56468: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 5646a: 246e fff8 moveal %fp@(-8),%a2 5646e: 4e5e unlk %fp 56470: 4e75 rts ... 000557d0 : rtems_status_code rtems_port_external_to_internal( rtems_id id, void *external, void **internal ) { 557d0: 4e56 fffc linkw %fp,#-4 557d4: 2f0a movel %a2,%sp@- 557d6: 246e 0010 moveal %fp@(16),%a2 557da: 2f02 movel %d2,%sp@- 557dc: 242e 000c movel %fp@(12),%d2 register Dual_ported_memory_Control *the_port; Objects_Locations location; uint32_t ending; if ( !internal ) 557e0: 4a8a tstl %a2 557e2: 6762 beqs 55846 <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE Dual_ported_memory_Control *_Dual_ported_memory_Get ( Objects_Id id, Objects_Locations *location ) { return (Dual_ported_memory_Control *) 557e4: 486e fffc pea %fp@(-4) 557e8: 2f2e 0008 movel %fp@(8),%sp@- 557ec: 4879 0007 e098 pea 7e098 <_Dual_ported_memory_Information> 557f2: 4eb9 0005 b248 jsr 5b248 <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_port = _Dual_ported_memory_Get( id, &location ); switch ( location ) { 557f8: 4fef 000c lea %sp@(12),%sp 557fc: 4aae fffc tstl %fp@(-4) 55800: 6624 bnes 55826 case OBJECTS_LOCAL: ending = _Addresses_Subtract( external, the_port->external_base ); 55802: 2202 movel %d2,%d1 55804: 2040 moveal %d0,%a0 55806: 92a8 0014 subl %a0@(20),%d1 if ( ending > the_port->length ) 5580a: b2a8 0018 cmpl %a0@(24),%d1 5580e: 6324 blss 55834 *internal = external; 55810: 2482 movel %d2,%a2@ else *internal = _Addresses_Add_offset( the_port->internal_base, ending ); _Thread_Enable_dispatch(); 55812: 4eb9 0005 bb64 jsr 5bb64 <_Thread_Enable_dispatch> 55818: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 5581a: 242e fff4 movel %fp@(-12),%d2 5581e: 246e fff8 moveal %fp@(-8),%a2 55822: 4e5e unlk %fp 55824: 4e75 rts 55826: 242e fff4 movel %fp@(-12),%d2 if ( !internal ) return RTEMS_INVALID_ADDRESS; the_port = _Dual_ported_memory_Get( id, &location ); switch ( location ) { 5582a: 7004 moveq #4,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 5582c: 246e fff8 moveal %fp@(-8),%a2 55830: 4e5e unlk %fp 55832: 4e75 rts case OBJECTS_LOCAL: ending = _Addresses_Subtract( external, the_port->external_base ); if ( ending > the_port->length ) *internal = external; else *internal = _Addresses_Add_offset( the_port->internal_base, 55834: 2040 moveal %d0,%a0 55836: d2a8 0010 addl %a0@(16),%d1 5583a: 2481 movel %d1,%a2@ ending ); _Thread_Enable_dispatch(); 5583c: 4eb9 0005 bb64 jsr 5bb64 <_Thread_Enable_dispatch> 55842: 4280 clrl %d0 55844: 60d4 bras 5581a <== ALWAYS TAKEN case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 55846: 242e fff4 movel %fp@(-12),%d2 { register Dual_ported_memory_Control *the_port; Objects_Locations location; uint32_t ending; if ( !internal ) 5584a: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 5584c: 246e fff8 moveal %fp@(-8),%a2 55850: 4e5e unlk %fp 55852: 4e75 rts 0005587c : rtems_status_code rtems_port_internal_to_external( rtems_id id, void *internal, void **external ) { 5587c: 4e56 fffc linkw %fp,#-4 55880: 2f0a movel %a2,%sp@- 55882: 246e 0010 moveal %fp@(16),%a2 55886: 2f02 movel %d2,%sp@- 55888: 242e 000c movel %fp@(12),%d2 register Dual_ported_memory_Control *the_port; Objects_Locations location; uint32_t ending; if ( !external ) 5588c: 4a8a tstl %a2 5588e: 6762 beqs 558f2 55890: 486e fffc pea %fp@(-4) 55894: 2f2e 0008 movel %fp@(8),%sp@- 55898: 4879 0007 e098 pea 7e098 <_Dual_ported_memory_Information> 5589e: 4eb9 0005 b248 jsr 5b248 <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_port = _Dual_ported_memory_Get( id, &location ); switch ( location ) { 558a4: 4fef 000c lea %sp@(12),%sp 558a8: 4aae fffc tstl %fp@(-4) 558ac: 6624 bnes 558d2 case OBJECTS_LOCAL: ending = _Addresses_Subtract( internal, the_port->internal_base ); 558ae: 2202 movel %d2,%d1 558b0: 2040 moveal %d0,%a0 558b2: 92a8 0010 subl %a0@(16),%d1 if ( ending > the_port->length ) 558b6: b2a8 0018 cmpl %a0@(24),%d1 558ba: 6324 blss 558e0 *external = internal; 558bc: 2482 movel %d2,%a2@ else *external = _Addresses_Add_offset( the_port->external_base, ending ); _Thread_Enable_dispatch(); 558be: 4eb9 0005 bb64 jsr 5bb64 <_Thread_Enable_dispatch> 558c4: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 558c6: 242e fff4 movel %fp@(-12),%d2 558ca: 246e fff8 moveal %fp@(-8),%a2 558ce: 4e5e unlk %fp 558d0: 4e75 rts 558d2: 242e fff4 movel %fp@(-12),%d2 if ( !external ) return RTEMS_INVALID_ADDRESS; the_port = _Dual_ported_memory_Get( id, &location ); switch ( location ) { 558d6: 7004 moveq #4,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 558d8: 246e fff8 moveal %fp@(-8),%a2 558dc: 4e5e unlk %fp 558de: 4e75 rts case OBJECTS_LOCAL: ending = _Addresses_Subtract( internal, the_port->internal_base ); if ( ending > the_port->length ) *external = internal; else *external = _Addresses_Add_offset( the_port->external_base, 558e0: 2040 moveal %d0,%a0 558e2: d2a8 0014 addl %a0@(20),%d1 558e6: 2481 movel %d1,%a2@ ending ); _Thread_Enable_dispatch(); 558e8: 4eb9 0005 bb64 jsr 5bb64 <_Thread_Enable_dispatch> 558ee: 4280 clrl %d0 558f0: 60d4 bras 558c6 <== ALWAYS TAKEN case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 558f2: 242e fff4 movel %fp@(-12),%d2 { register Dual_ported_memory_Control *the_port; Objects_Locations location; uint32_t ending; if ( !external ) 558f6: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 558f8: 246e fff8 moveal %fp@(-8),%a2 558fc: 4e5e unlk %fp 558fe: 4e75 rts 0007b6cc : rtems_status_code rtems_rate_monotonic_get_status( rtems_id id, rtems_rate_monotonic_period_status *status ) { 7b6cc: 4e56 ffec linkw %fp,#-20 7b6d0: 2f0a movel %a2,%sp@- 7b6d2: 246e 000c moveal %fp@(12),%a2 Objects_Locations location; Rate_monotonic_Period_time_t since_last_period; Rate_monotonic_Control *the_period; bool valid_status; if ( !status ) 7b6d6: 4a8a tstl %a2 7b6d8: 6700 00a0 beqw 7b77a 7b6dc: 486e fffc pea %fp@(-4) 7b6e0: 2f2e 0008 movel %fp@(8),%sp@- 7b6e4: 4879 000a 76cc pea a76cc <_Rate_monotonic_Information> 7b6ea: 4eb9 0004 db10 jsr 4db10 <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 7b6f0: 4fef 000c lea %sp@(12),%sp 7b6f4: 4aae fffc tstl %fp@(-4) 7b6f8: 6634 bnes 7b72e case OBJECTS_LOCAL: status->owner = the_period->owner->Object.id; 7b6fa: 2240 moveal %d0,%a1 7b6fc: 2069 0040 moveal %a1@(64),%a0 status->state = the_period->state; 7b700: 2229 0038 movel %a1@(56),%d1 the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: status->owner = the_period->owner->Object.id; 7b704: 24a8 0008 movel %a0@(8),%a2@ status->state = the_period->state; 7b708: 2541 0004 movel %d1,%a2@(4) /* * If the period is inactive, there is no information. */ if ( status->state == RATE_MONOTONIC_INACTIVE ) { 7b70c: 662a bnes 7b738 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timespec_Set_to_zero( &status->since_last_period ); _Timespec_Set_to_zero( &status->executed_since_last_period ); 7b70e: 42aa 0014 clrl %a2@(20) /* * If the period is inactive, there is no information. */ if ( status->state == RATE_MONOTONIC_INACTIVE ) { #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timespec_Set_to_zero( &status->since_last_period ); 7b712: 42aa 0008 clrl %a2@(8) 7b716: 42aa 000c clrl %a2@(12) _Timespec_Set_to_zero( &status->executed_since_last_period ); 7b71a: 42aa 0010 clrl %a2@(16) status->since_last_period = since_last_period; status->executed_since_last_period = executed; #endif } _Thread_Enable_dispatch(); 7b71e: 4eb9 0004 e450 jsr 4e450 <_Thread_Enable_dispatch> 7b724: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 7b726: 246e ffe8 moveal %fp@(-24),%a2 7b72a: 4e5e unlk %fp 7b72c: 4e75 rts 7b72e: 246e ffe8 moveal %fp@(-24),%a2 if ( !status ) return RTEMS_INVALID_ADDRESS; the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 7b732: 7004 moveq #4,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 7b734: 4e5e unlk %fp 7b736: 4e75 rts /* * Grab the current status. */ valid_status = _Rate_monotonic_Get_status( 7b738: 486e fff4 pea %fp@(-12) 7b73c: 486e ffec pea %fp@(-20) 7b740: 2f00 movel %d0,%sp@- 7b742: 4eb9 0007 b812 jsr 7b812 <_Rate_monotonic_Get_status> the_period, &since_last_period, &executed ); if (!valid_status) { 7b748: 4fef 000c lea %sp@(12),%sp 7b74c: 4a00 tstb %d0 7b74e: 6734 beqs 7b784 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_To_timespec( &since_last_period, &status->since_last_period ); _Timestamp_To_timespec( 7b750: 202e fff4 movel %fp@(-12),%d0 7b754: 222e fff8 movel %fp@(-8),%d1 7b758: 2540 0010 movel %d0,%a2@(16) 7b75c: 2541 0014 movel %d1,%a2@(20) _Thread_Enable_dispatch(); return RTEMS_NOT_DEFINED; } #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_To_timespec( 7b760: 202e ffec movel %fp@(-20),%d0 7b764: 222e fff0 movel %fp@(-16),%d1 7b768: 2540 0008 movel %d0,%a2@(8) 7b76c: 2541 000c movel %d1,%a2@(12) status->since_last_period = since_last_period; status->executed_since_last_period = executed; #endif } _Thread_Enable_dispatch(); 7b770: 4eb9 0004 e450 jsr 4e450 <_Thread_Enable_dispatch> 7b776: 4280 clrl %d0 7b778: 60ac bras 7b726 <== ALWAYS TAKEN case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 7b77a: 246e ffe8 moveal %fp@(-24),%a2 Objects_Locations location; Rate_monotonic_Period_time_t since_last_period; Rate_monotonic_Control *the_period; bool valid_status; if ( !status ) 7b77e: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 7b780: 4e5e unlk %fp 7b782: 4e75 rts valid_status = _Rate_monotonic_Get_status( the_period, &since_last_period, &executed ); if (!valid_status) { _Thread_Enable_dispatch(); 7b784: 4eb9 0004 e450 jsr 4e450 <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 7b78a: 246e ffe8 moveal %fp@(-24),%a2 valid_status = _Rate_monotonic_Get_status( the_period, &since_last_period, &executed ); if (!valid_status) { _Thread_Enable_dispatch(); 7b78e: 700b moveq #11,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 7b790: 4e5e unlk %fp 7b792: 4e75 rts 0007b9dc : rtems_status_code rtems_rate_monotonic_period( rtems_id id, rtems_interval length ) { 7b9dc: 4e56 ffec linkw %fp,#-20 7b9e0: 48d7 040c moveml %d2-%d3/%a2,%sp@ 7b9e4: 486e fffc pea %fp@(-4) 7b9e8: 242e 0008 movel %fp@(8),%d2 7b9ec: 2f02 movel %d2,%sp@- 7b9ee: 4879 000a 76cc pea a76cc <_Rate_monotonic_Information> 7b9f4: 4eb9 0004 db10 jsr 4db10 <_Objects_Get> rtems_rate_monotonic_period_states local_state; ISR_Level level; the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 7b9fa: 4fef 000c lea %sp@(12),%sp 7b9fe: 2440 moveal %d0,%a2 7ba00: 4aae fffc tstl %fp@(-4) 7ba04: 661e bnes 7ba24 case OBJECTS_LOCAL: if ( !_Thread_Is_executing( the_period->owner ) ) { 7ba06: 2039 000a 6ce2 movel a6ce2 <_Thread_Executing>,%d0 7ba0c: b0aa 0040 cmpl %a2@(64),%d0 7ba10: 671e beqs 7ba30 _Thread_Enable_dispatch(); 7ba12: 4eb9 0004 e450 jsr 4e450 <_Thread_Enable_dispatch> 7ba18: 7017 moveq #23,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 7ba1a: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 7ba20: 4e5e unlk %fp 7ba22: 4e75 rts the_period->state = RATE_MONOTONIC_ACTIVE; the_period->next_length = length; _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); return RTEMS_TIMEOUT; 7ba24: 7004 moveq #4,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 7ba26: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 7ba2c: 4e5e unlk %fp 7ba2e: 4e75 rts if ( !_Thread_Is_executing( the_period->owner ) ) { _Thread_Enable_dispatch(); return RTEMS_NOT_OWNER_OF_RESOURCE; } if ( length == RTEMS_PERIOD_STATUS ) { 7ba30: 4aae 000c tstl %fp@(12) 7ba34: 6700 00ce beqw 7bb04 } _Thread_Enable_dispatch(); return( return_value ); } _ISR_Disable( level ); 7ba38: 203c 0000 0700 movel #1792,%d0 7ba3e: 40c3 movew %sr,%d3 7ba40: 8083 orl %d3,%d0 7ba42: 46c0 movew %d0,%sr switch ( the_period->state ) { 7ba44: 202a 0038 movel %a2@(56),%d0 7ba48: 7202 moveq #2,%d1 7ba4a: b280 cmpl %d0,%d1 7ba4c: 6700 00dc beqw 7bb2a 7ba50: 123c 0004 moveb #4,%d1 7ba54: b280 cmpl %d0,%d1 7ba56: 6762 beqs 7baba 7ba58: 4a80 tstl %d0 7ba5a: 66c8 bnes 7ba24 <== ALWAYS TAKEN case RATE_MONOTONIC_INACTIVE: { _ISR_Enable( level ); 7ba5c: 46c3 movew %d3,%sr /* * Baseline statistics information for the beginning of a period. */ _Rate_monotonic_Initiate_statistics( the_period ); 7ba5e: 2f0a movel %a2,%sp@- 7ba60: 2d40 fff8 movel %d0,%fp@(-8) 7ba64: 4eb9 0007 b794 jsr 7b794 <_Rate_monotonic_Initiate_statistics> Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 7ba6a: 223c 0007 bbc8 movel #506824,%d1 the_watchdog->id = id; 7ba70: 2542 0030 movel %d2,%a2@(48) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 7ba74: 242e 000c movel %fp@(12),%d2 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 7ba78: 2541 002c movel %d1,%a2@(44) the_period->state = RATE_MONOTONIC_ACTIVE; 7ba7c: 7202 moveq #2,%d1 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 7ba7e: 2542 001c movel %d2,%a2@(28) 7ba82: 2541 0038 movel %d1,%a2@(56) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 7ba86: 42aa 0018 clrl %a2@(24) the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 7ba8a: 42aa 0034 clrl %a2@(52) _Rate_monotonic_Timeout, id, NULL ); the_period->next_length = length; 7ba8e: 2542 003c movel %d2,%a2@(60) ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 7ba92: 486a 0010 pea %a2@(16) 7ba96: 4879 000a 6d00 pea a6d00 <_Watchdog_Ticks_chain> 7ba9c: 4eb9 0004 f5e0 jsr 4f5e0 <_Watchdog_Insert> _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 7baa2: 4eb9 0004 e450 jsr 4e450 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 7baa8: 202e fff8 movel %fp@(-8),%d0 7baac: 4fef 000c lea %sp@(12),%sp case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 7bab0: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 7bab6: 4e5e unlk %fp 7bab8: 4e75 rts case RATE_MONOTONIC_EXPIRED: /* * Update statistics from the concluding period */ _Rate_monotonic_Update_statistics( the_period ); 7baba: 2f0a movel %a2,%sp@- 7babc: 4eb9 0007 b8c2 jsr 7b8c2 <_Rate_monotonic_Update_statistics> _ISR_Enable( level ); 7bac2: 46c3 movew %d3,%sr the_period->state = RATE_MONOTONIC_ACTIVE; 7bac4: 7202 moveq #2,%d1 the_period->next_length = length; _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 7bac6: 7006 moveq #6,%d0 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 7bac8: 242e 000c movel %fp@(12),%d2 */ _Rate_monotonic_Update_statistics( the_period ); _ISR_Enable( level ); the_period->state = RATE_MONOTONIC_ACTIVE; 7bacc: 2541 0038 movel %d1,%a2@(56) 7bad0: 2542 001c movel %d2,%a2@(28) the_period->next_length = length; 7bad4: 2542 003c movel %d2,%a2@(60) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 7bad8: 486a 0010 pea %a2@(16) 7badc: 4879 000a 6d00 pea a6d00 <_Watchdog_Ticks_chain> 7bae2: 2d40 fff8 movel %d0,%fp@(-8) 7bae6: 4eb9 0004 f5e0 jsr 4f5e0 <_Watchdog_Insert> _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 7baec: 4eb9 0004 e450 jsr 4e450 <_Thread_Enable_dispatch> return RTEMS_TIMEOUT; 7baf2: 202e fff8 movel %fp@(-8),%d0 7baf6: 4fef 000c lea %sp@(12),%sp case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 7bafa: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 7bb00: 4e5e unlk %fp 7bb02: 4e75 rts _Thread_Enable_dispatch(); return RTEMS_NOT_OWNER_OF_RESOURCE; } if ( length == RTEMS_PERIOD_STATUS ) { switch ( the_period->state ) { 7bb04: 202a 0038 movel %a2@(56),%d0 7bb08: 7204 moveq #4,%d1 7bb0a: b280 cmpl %d0,%d1 7bb0c: 6400 009c bccw 7bbaa <== NEVER TAKEN 7bb10: 4280 clrl %d0 <== NOT EXECUTED case RATE_MONOTONIC_ACTIVE: default: /* unreached -- only to remove warnings */ return_value = RTEMS_SUCCESSFUL; break; } _Thread_Enable_dispatch(); 7bb12: 2d40 fff8 movel %d0,%fp@(-8) <== NOT EXECUTED 7bb16: 4eb9 0004 e450 jsr 4e450 <_Thread_Enable_dispatch> <== NOT EXECUTED return( return_value ); 7bb1c: 202e fff8 movel %fp@(-8),%d0 <== NOT EXECUTED case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 7bb20: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 7bb26: 4e5e unlk %fp 7bb28: 4e75 rts case RATE_MONOTONIC_ACTIVE: /* * Update statistics from the concluding period. */ _Rate_monotonic_Update_statistics( the_period ); 7bb2a: 2f0a movel %a2,%sp@- 7bb2c: 4eb9 0007 b8c2 jsr 7b8c2 <_Rate_monotonic_Update_statistics> * This tells the _Rate_monotonic_Timeout that this task is * in the process of blocking on the period and that we * may be changing the length of the next period. */ the_period->state = RATE_MONOTONIC_OWNER_IS_BLOCKING; the_period->next_length = length; 7bb32: 242e 000c movel %fp@(12),%d2 /* * This tells the _Rate_monotonic_Timeout that this task is * in the process of blocking on the period and that we * may be changing the length of the next period. */ the_period->state = RATE_MONOTONIC_OWNER_IS_BLOCKING; 7bb36: 7001 moveq #1,%d0 the_period->next_length = length; 7bb38: 2542 003c movel %d2,%a2@(60) /* * This tells the _Rate_monotonic_Timeout that this task is * in the process of blocking on the period and that we * may be changing the length of the next period. */ the_period->state = RATE_MONOTONIC_OWNER_IS_BLOCKING; 7bb3c: 2540 0038 movel %d0,%a2@(56) the_period->next_length = length; _ISR_Enable( level ); 7bb40: 46c3 movew %d3,%sr _Thread_Executing->Wait.id = the_period->Object.id; 7bb42: 2079 000a 6ce2 moveal a6ce2 <_Thread_Executing>,%a0 7bb48: 216a 0008 0020 movel %a2@(8),%a0@(32) _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 7bb4e: 4878 4000 pea 4000 7bb52: 2f08 movel %a0,%sp@- 7bb54: 4eb9 0004 eda4 jsr 4eda4 <_Thread_Set_state> /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); 7bb5a: 203c 0000 0700 movel #1792,%d0 7bb60: 40c1 movew %sr,%d1 7bb62: 8081 orl %d1,%d0 7bb64: 46c0 movew %d0,%sr local_state = the_period->state; the_period->state = RATE_MONOTONIC_ACTIVE; 7bb66: 7402 moveq #2,%d2 /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); local_state = the_period->state; 7bb68: 202a 0038 movel %a2@(56),%d0 the_period->state = RATE_MONOTONIC_ACTIVE; 7bb6c: 2542 0038 movel %d2,%a2@(56) _ISR_Enable( level ); 7bb70: 46c1 movew %d1,%sr /* * If it did, then we want to unblock ourself and continue as * if nothing happen. The period was reset in the timeout routine. */ if ( local_state == RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING ) 7bb72: 7203 moveq #3,%d1 7bb74: 4fef 000c lea %sp@(12),%sp 7bb78: b280 cmpl %d0,%d1 7bb7a: 6712 beqs 7bb8e _Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); _Thread_Enable_dispatch(); 7bb7c: 4eb9 0004 e450 jsr 4e450 <_Thread_Enable_dispatch> 7bb82: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 7bb84: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 7bb8a: 4e5e unlk %fp 7bb8c: 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 ); 7bb8e: 4878 4000 pea 4000 7bb92: 2f39 000a 6ce2 movel a6ce2 <_Thread_Executing>,%sp@- 7bb98: 4eb9 0004 e07c jsr 4e07c <_Thread_Clear_state> 7bb9e: 508f addql #8,%sp _Thread_Enable_dispatch(); 7bba0: 4eb9 0004 e450 jsr 4e450 <_Thread_Enable_dispatch> 7bba6: 4280 clrl %d0 7bba8: 60da bras 7bb84 <== ALWAYS TAKEN _Thread_Enable_dispatch(); return RTEMS_NOT_OWNER_OF_RESOURCE; } if ( length == RTEMS_PERIOD_STATUS ) { switch ( the_period->state ) { 7bbaa: 41f9 000a 0c52 lea a0c52 ,%a0 7bbb0: 2030 0c00 movel %a0@(00000000,%d0:l:4),%d0 case RATE_MONOTONIC_ACTIVE: default: /* unreached -- only to remove warnings */ return_value = RTEMS_SUCCESSFUL; break; } _Thread_Enable_dispatch(); 7bbb4: 2d40 fff8 movel %d0,%fp@(-8) 7bbb8: 4eb9 0004 e450 jsr 4e450 <_Thread_Enable_dispatch> return( return_value ); 7bbbe: 202e fff8 movel %fp@(-8),%d0 7bbc2: 6000 ff5c braw 7bb20 <== ALWAYS TAKEN ... 0006a094 : */ void rtems_rate_monotonic_report_statistics_with_plugin( void *context, rtems_printk_plugin_t print ) { 6a094: 4e56 ff78 linkw %fp,#-136 6a098: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 6a09c: 262e 0008 movel %fp@(8),%d3 6a0a0: 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 ) 6a0a4: 4a8a tstl %a2 6a0a6: 6700 0082 beqw 6a12a <== ALWAYS TAKEN return; (*print)( context, "Period information by period\n" ); 6a0aa: 4879 0009 d88a pea 9d88a <_TOD_Days_per_month+0x68> 6a0b0: 2f03 movel %d3,%sp@- 6a0b2: 4e92 jsr %a2@ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ (*print)( context, "--- CPU times are in seconds ---\n" ); 6a0b4: 4879 0009 d8a8 pea 9d8a8 <_TOD_Days_per_month+0x86> 6a0ba: 2f03 movel %d3,%sp@- 6a0bc: 4e92 jsr %a2@ (*print)( context, "--- Wall times are in seconds ---\n" ); 6a0be: 4879 0009 d8ca pea 9d8ca <_TOD_Days_per_month+0xa8> 6a0c4: 2f03 movel %d3,%sp@- 6a0c6: 4e92 jsr %a2@ Be sure to test the various cases. (*print)( context,"\ 1234567890123456789012345678901234567890123456789012345678901234567890123456789\ \n"); */ (*print)( context, " ID OWNER COUNT MISSED " 6a0c8: 4879 0009 d8ed pea 9d8ed <_TOD_Days_per_month+0xcb> 6a0ce: 2f03 movel %d3,%sp@- 6a0d0: 4e92 jsr %a2@ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ " " #endif " WALL TIME\n" ); (*print)( context, " " 6a0d2: 4fef 001c lea %sp@(28),%sp 6a0d6: 2ebc 0009 d938 movel #645432,%sp@ 6a0dc: 2f03 movel %d3,%sp@- 6a0de: 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 ; 6a0e0: 2439 000a 76d2 movel a76d2 <_Rate_monotonic_Information+0x6>,%d2 6a0e6: 508f addql #8,%sp 6a0e8: b4b9 000a 76d6 cmpl a76d6 <_Rate_monotonic_Information+0xa>,%d2 6a0ee: 623a bhis 6a12a <== ALWAYS TAKEN 6a0f0: 280e movel %fp,%d4 #if defined(RTEMS_DEBUG) if ( status != RTEMS_SUCCESSFUL ) continue; #endif rtems_object_get_name( the_status.owner, sizeof(name), name ); 6a0f2: 2a0e movel %fp,%d5 6a0f4: 0684 ffff ffa2 addil #-94,%d4 6a0fa: 47f9 0007 b60c lea 7b60c ,%a3 status = rtems_rate_monotonic_get_statistics( id, &the_stats ); if ( status != RTEMS_SUCCESSFUL ) continue; /* If the above passed, so should this but check it anyway */ status = rtems_rate_monotonic_get_status( id, &the_status ); 6a100: 4bf9 0007 b6cc lea 7b6cc ,%a5 #if defined(RTEMS_DEBUG) if ( status != RTEMS_SUCCESSFUL ) continue; #endif rtems_object_get_name( the_status.owner, sizeof(name), name ); 6a106: 5b85 subql #5,%d5 6a108: 49f9 0004 be48 lea 4be48 ,%a4 struct timespec cpu_average; struct timespec *min_cpu = &the_stats.min_cpu_time; struct timespec *max_cpu = &the_stats.max_cpu_time; struct timespec *total_cpu = &the_stats.total_cpu_time; _Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average ); 6a10e: 2e3c 0006 b8e4 movel #440548,%d7 * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; id <= _Rate_monotonic_Information.maximum_id ; id++ ) { status = rtems_rate_monotonic_get_statistics( id, &the_stats ); 6a114: 2f04 movel %d4,%sp@- 6a116: 2f02 movel %d2,%sp@- 6a118: 4e93 jsr %a3@ if ( status != RTEMS_SUCCESSFUL ) 6a11a: 508f addql #8,%sp 6a11c: 4a80 tstl %d0 6a11e: 6714 beqs 6a134 <== ALWAYS TAKEN * 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++ ) { 6a120: 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 ; 6a122: b4b9 000a 76d6 cmpl a76d6 <_Rate_monotonic_Information+0xa>,%d2 6a128: 63ea blss 6a114 the_stats.min_wall_time, the_stats.max_wall_time, ival_wall, fval_wall ); #endif } } } 6a12a: 4cee 3cfc ff78 moveml %fp@(-136),%d2-%d7/%a2-%a5 6a130: 4e5e unlk %fp 6a132: 4e75 rts status = rtems_rate_monotonic_get_statistics( id, &the_stats ); if ( status != RTEMS_SUCCESSFUL ) continue; /* If the above passed, so should this but check it anyway */ status = rtems_rate_monotonic_get_status( id, &the_status ); 6a134: 486e ffda pea %fp@(-38) 6a138: 2f02 movel %d2,%sp@- 6a13a: 4e95 jsr %a5@ #if defined(RTEMS_DEBUG) if ( status != RTEMS_SUCCESSFUL ) continue; #endif rtems_object_get_name( the_status.owner, sizeof(name), name ); 6a13c: 2f05 movel %d5,%sp@- 6a13e: 4878 0005 pea 5 6a142: 2f2e ffda movel %fp@(-38),%sp@- 6a146: 4e94 jsr %a4@ /* * Print part of report line that is not dependent on granularity */ (*print)( context, 6a148: 2f2e ffa6 movel %fp@(-90),%sp@- 6a14c: 2f2e ffa2 movel %fp@(-94),%sp@- 6a150: 2f05 movel %d5,%sp@- 6a152: 2f02 movel %d2,%sp@- 6a154: 4879 0009 d984 pea 9d984 <_TOD_Days_per_month+0x162> 6a15a: 2f03 movel %d3,%sp@- 6a15c: 4e92 jsr %a2@ ); /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { 6a15e: 202e ffa2 movel %fp@(-94),%d0 6a162: 4fef 002c lea %sp@(44),%sp 6a166: 6618 bnes 6a180 (*print)( context, "\n" ); 6a168: 4879 0009 f17b pea 9f17b <__FUNCTION__.5979+0x5d> * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; id <= _Rate_monotonic_Information.maximum_id ; id++ ) { 6a16e: 5282 addql #1,%d2 /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { (*print)( context, "\n" ); 6a170: 2f03 movel %d3,%sp@- 6a172: 4e92 jsr %a2@ continue; 6a174: 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 ; 6a176: b4b9 000a 76d6 cmpl a76d6 <_Rate_monotonic_Information+0xa>,%d2 6a17c: 6396 blss 6a114 6a17e: 60aa bras 6a12a <== 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 ); 6a180: 486e fff2 pea %fp@(-14) 6a184: 2047 moveal %d7,%a0 * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; id <= _Rate_monotonic_Information.maximum_id ; id++ ) { 6a186: 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 ); 6a188: 2f00 movel %d0,%sp@- 6a18a: 486e ffba pea %fp@(-70) 6a18e: 4e90 jsr %a0@ (*print)( context, 6a190: 202e fff6 movel %fp@(-10),%d0 6a194: 223c 0000 03e8 movel #1000,%d1 6a19a: 4c41 0800 remsl %d1,%d0,%d0 6a19e: 2c2e ffb6 movel %fp@(-74),%d6 6a1a2: 2f00 movel %d0,%sp@- 6a1a4: 2001 movel %d1,%d0 6a1a6: 2f2e fff2 movel %fp@(-14),%sp@- 6a1aa: 4c40 6806 remsl %d0,%d6,%d6 6a1ae: 202e ffae movel %fp@(-82),%d0 6a1b2: 2246 moveal %d6,%a1 6a1b4: 223c 0000 03e8 movel #1000,%d1 6a1ba: 2f09 movel %a1,%sp@- 6a1bc: 2f2e ffb2 movel %fp@(-78),%sp@- 6a1c0: 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, 6a1c4: 2c3c 0000 03e8 movel #1000,%d6 struct timespec *min_cpu = &the_stats.min_cpu_time; struct timespec *max_cpu = &the_stats.max_cpu_time; struct timespec *total_cpu = &the_stats.total_cpu_time; _Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average ); (*print)( context, 6a1ca: 2f00 movel %d0,%sp@- 6a1cc: 2f2e ffaa movel %fp@(-86),%sp@- 6a1d0: 4879 0009 d99b pea 9d99b <_TOD_Days_per_month+0x179> 6a1d6: 2f03 movel %d3,%sp@- 6a1d8: 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); 6a1da: 4fef 002c lea %sp@(44),%sp 6a1de: 2047 moveal %d7,%a0 6a1e0: 486e fff2 pea %fp@(-14) 6a1e4: 2f2e ffa2 movel %fp@(-94),%sp@- 6a1e8: 486e ffd2 pea %fp@(-46) 6a1ec: 4e90 jsr %a0@ (*print)( context, 6a1ee: 202e fff6 movel %fp@(-10),%d0 6a1f2: 4c46 0800 remsl %d6,%d0,%d0 6a1f6: 222e ffce movel %fp@(-50),%d1 6a1fa: 2f00 movel %d0,%sp@- 6a1fc: 2f2e fff2 movel %fp@(-14),%sp@- 6a200: 4c46 1801 remsl %d6,%d1,%d1 6a204: 202e ffc6 movel %fp@(-58),%d0 6a208: 2241 moveal %d1,%a1 6a20a: 2f09 movel %a1,%sp@- 6a20c: 2f2e ffca movel %fp@(-54),%sp@- 6a210: 4c46 0800 remsl %d6,%d0,%d0 6a214: 2f00 movel %d0,%sp@- 6a216: 2f2e ffc2 movel %fp@(-62),%sp@- 6a21a: 4879 0009 d9ba pea 9d9ba <_TOD_Days_per_month+0x198> 6a220: 2f03 movel %d3,%sp@- 6a222: 4e92 jsr %a2@ 6a224: 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 ; 6a228: b4b9 000a 76d6 cmpl a76d6 <_Rate_monotonic_Information+0xa>,%d2 6a22e: 6300 fee4 blsw 6a114 6a232: 6000 fef6 braw 6a12a <== NOT EXECUTED 0006a250 : /* * rtems_rate_monotonic_reset_all_statistics */ void rtems_rate_monotonic_reset_all_statistics( void ) { 6a250: 4e56 0000 linkw %fp,#0 6a254: 2039 000a 6c28 movel a6c28 <_Thread_Dispatch_disable_level>,%d0 6a25a: 5280 addql #1,%d0 6a25c: 2f0a movel %a2,%sp@- 6a25e: 23c0 000a 6c28 movel %d0,a6c28 <_Thread_Dispatch_disable_level> 6a264: 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 ; 6a266: 2439 000a 76d2 movel a76d2 <_Rate_monotonic_Information+0x6>,%d2 6a26c: b4b9 000a 76d6 cmpl a76d6 <_Rate_monotonic_Information+0xa>,%d2 6a272: 6216 bhis 6a28a <== ALWAYS TAKEN 6a274: 45f9 0006 a29c lea 6a29c ,%a2 id <= _Rate_monotonic_Information.maximum_id ; id++ ) { status = rtems_rate_monotonic_reset_statistics( id ); 6a27a: 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++ ) { 6a27c: 5282 addql #1,%d2 status = rtems_rate_monotonic_reset_statistics( id ); 6a27e: 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 ; 6a280: 588f addql #4,%sp 6a282: b4b9 000a 76d6 cmpl a76d6 <_Rate_monotonic_Information+0xa>,%d2 6a288: 63f0 blss 6a27a /* * Done so exit thread dispatching disabled critical section. */ _Thread_Enable_dispatch(); } 6a28a: 242e fff8 movel %fp@(-8),%d2 6a28e: 246e fffc moveal %fp@(-4),%a2 6a292: 4e5e unlk %fp } /* * Done so exit thread dispatching disabled critical section. */ _Thread_Enable_dispatch(); 6a294: 4ef9 0004 e450 jmp 4e450 <_Thread_Enable_dispatch> ... 00056d04 : uintptr_t length, uintptr_t page_size, rtems_attribute attribute_set, rtems_id *id ) { 56d04: 4e56 ffec linkw %fp,#-20 56d08: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ 56d0c: 262e 0008 movel %fp@(8),%d3 56d10: 242e 000c movel %fp@(12),%d2 56d14: 246e 001c moveal %fp@(28),%a2 rtems_status_code return_status; Region_Control *the_region; if ( !rtems_is_name_valid( name ) ) 56d18: 4a83 tstl %d3 56d1a: 6700 0096 beqw 56db2 return RTEMS_INVALID_NAME; if ( !starting_address ) 56d1e: 4a82 tstl %d2 56d20: 670a beqs 56d2c return RTEMS_INVALID_ADDRESS; if ( !id ) 56d22: 4a8a tstl %a2 56d24: 6706 beqs 56d2c return RTEMS_INVALID_ADDRESS; if ( !_Addresses_Is_aligned( starting_address ) ) 56d26: 7003 moveq #3,%d0 56d28: c082 andl %d2,%d0 56d2a: 670c beqs 56d38 return_status = RTEMS_SUCCESSFUL; } } _RTEMS_Unlock_allocator(); return return_status; 56d2c: 7009 moveq #9,%d0 } 56d2e: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3 56d34: 4e5e unlk %fp 56d36: 4e75 rts return RTEMS_INVALID_ADDRESS; if ( !_Addresses_Is_aligned( starting_address ) ) return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); /* to prevent deletion */ 56d38: 2f39 0007 e2fa movel 7e2fa <_RTEMS_Allocator_Mutex>,%sp@- 56d3e: 4eb9 0005 96e4 jsr 596e4 <_API_Mutex_Lock> * This function allocates a region control block from * the inactive chain of free region control blocks. */ RTEMS_INLINE_ROUTINE Region_Control *_Region_Allocate( void ) { return (Region_Control *) _Objects_Allocate( &_Region_Information ); 56d44: 4879 0007 e146 pea 7e146 <_Region_Information> 56d4a: 4eb9 0005 ad70 jsr 5ad70 <_Objects_Allocate> the_region = _Region_Allocate(); if ( !the_region ) 56d50: 508f addql #8,%sp 56d52: 2640 moveal %d0,%a3 56d54: 4a80 tstl %d0 56d56: 6766 beqs 56dbe return_status = RTEMS_TOO_MANY; else { the_region->maximum_segment_size = _Heap_Initialize( 56d58: 2f2e 0014 movel %fp@(20),%sp@- 56d5c: 2f2e 0010 movel %fp@(16),%sp@- 56d60: 2f02 movel %d2,%sp@- 56d62: 486b 0068 pea %a3@(104) 56d66: 4eb9 0005 a7f4 jsr 5a7f4 <_Heap_Initialize> &the_region->Memory, starting_address, length, page_size ); if ( !the_region->maximum_segment_size ) { 56d6c: 4fef 0010 lea %sp@(16),%sp if ( !the_region ) return_status = RTEMS_TOO_MANY; else { the_region->maximum_segment_size = _Heap_Initialize( 56d70: 2740 005c movel %d0,%a3@(92) &the_region->Memory, starting_address, length, page_size ); if ( !the_region->maximum_segment_size ) { 56d74: 6662 bnes 56dd8 */ RTEMS_INLINE_ROUTINE void _Region_Free ( Region_Control *the_region ) { _Objects_Free( &_Region_Information, &the_region->Object ); 56d76: 2f0b movel %a3,%sp@- 56d78: 4879 0007 e146 pea 7e146 <_Region_Information> 56d7e: 103c 0008 moveb #8,%d0 56d82: 2d40 fffc movel %d0,%fp@(-4) 56d86: 4eb9 0005 b0a8 jsr 5b0a8 <_Objects_Free> 56d8c: 202e fffc movel %fp@(-4),%d0 56d90: 508f addql #8,%sp *id = the_region->Object.id; return_status = RTEMS_SUCCESSFUL; } } _RTEMS_Unlock_allocator(); 56d92: 2f39 0007 e2fa movel 7e2fa <_RTEMS_Allocator_Mutex>,%sp@- 56d98: 2d40 fffc movel %d0,%fp@(-4) 56d9c: 4eb9 0005 9744 jsr 59744 <_API_Mutex_Unlock> return return_status; 56da2: 202e fffc movel %fp@(-4),%d0 56da6: 588f addql #4,%sp } 56da8: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3 56dae: 4e5e unlk %fp 56db0: 4e75 rts ) { rtems_status_code return_status; Region_Control *the_region; if ( !rtems_is_name_valid( name ) ) 56db2: 7003 moveq #3,%d0 } } _RTEMS_Unlock_allocator(); return return_status; } 56db4: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3 56dba: 4e5e unlk %fp 56dbc: 4e75 rts *id = the_region->Object.id; return_status = RTEMS_SUCCESSFUL; } } _RTEMS_Unlock_allocator(); 56dbe: 2f39 0007 e2fa movel 7e2fa <_RTEMS_Allocator_Mutex>,%sp@- _RTEMS_Lock_allocator(); /* to prevent deletion */ the_region = _Region_Allocate(); if ( !the_region ) 56dc4: 7005 moveq #5,%d0 *id = the_region->Object.id; return_status = RTEMS_SUCCESSFUL; } } _RTEMS_Unlock_allocator(); 56dc6: 2d40 fffc movel %d0,%fp@(-4) 56dca: 4eb9 0005 9744 jsr 59744 <_API_Mutex_Unlock> return return_status; 56dd0: 202e fffc movel %fp@(-4),%d0 56dd4: 588f addql #4,%sp 56dd6: 60d0 bras 56da8 <== ALWAYS TAKEN return_status = RTEMS_INVALID_SIZE; } else { the_region->starting_address = starting_address; 56dd8: 2742 0050 movel %d2,%a3@(80) the_region->length = length; the_region->page_size = page_size; the_region->attribute_set = attribute_set; the_region->number_of_used_blocks = 0; _Thread_queue_Initialize( 56ddc: 222e 0018 movel %fp@(24),%d1 } else { the_region->starting_address = starting_address; the_region->length = length; 56de0: 202e 0010 movel %fp@(16),%d0 the_region->page_size = page_size; the_region->attribute_set = attribute_set; the_region->number_of_used_blocks = 0; _Thread_queue_Initialize( 56de4: e489 lsrl #2,%d1 else { the_region->starting_address = starting_address; the_region->length = length; the_region->page_size = page_size; 56de6: 242e 0014 movel %fp@(20),%d2 the_region->attribute_set = attribute_set; 56dea: 206e 0018 moveal %fp@(24),%a0 } else { the_region->starting_address = starting_address; the_region->length = length; 56dee: 2740 0054 movel %d0,%a3@(84) &_Region_Information, &the_region->Object, (Objects_Name) name ); *id = the_region->Object.id; 56df2: 4280 clrl %d0 else { the_region->starting_address = starting_address; the_region->length = length; the_region->page_size = page_size; 56df4: 2742 0058 movel %d2,%a3@(88) the_region->attribute_set = attribute_set; the_region->number_of_used_blocks = 0; _Thread_queue_Initialize( 56df8: 7401 moveq #1,%d2 else { the_region->starting_address = starting_address; the_region->length = length; the_region->page_size = page_size; the_region->attribute_set = attribute_set; 56dfa: 2748 0060 movel %a0,%a3@(96) the_region->number_of_used_blocks = 0; _Thread_queue_Initialize( 56dfe: c481 andl %d1,%d2 the_region->starting_address = starting_address; the_region->length = length; the_region->page_size = page_size; the_region->attribute_set = attribute_set; the_region->number_of_used_blocks = 0; 56e00: 42ab 0064 clrl %a3@(100) _Thread_queue_Initialize( 56e04: 4878 0006 pea 6 56e08: 4878 0040 pea 40 56e0c: 2f02 movel %d2,%sp@- 56e0e: 486b 0010 pea %a3@(16) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 56e12: 4282 clrl %d2 56e14: 2d40 fffc movel %d0,%fp@(-4) 56e18: 4eb9 0005 c35c jsr 5c35c <_Thread_queue_Initialize> 56e1e: 222b 0008 movel %a3@(8),%d1 &_Region_Information, &the_region->Object, (Objects_Name) name ); *id = the_region->Object.id; 56e22: 4fef 0010 lea %sp@(16),%sp 56e26: 2079 0007 e15e moveal 7e15e <_Region_Information+0x18>,%a0 56e2c: 3401 movew %d1,%d2 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 56e2e: 2743 000c movel %d3,%a3@(12) 56e32: 202e fffc movel %fp@(-4),%d0 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 56e36: 218b 2c00 movel %a3,%a0@(00000000,%d2:l:4) 56e3a: 2481 movel %d1,%a2@ return_status = RTEMS_SUCCESSFUL; } } _RTEMS_Unlock_allocator(); 56e3c: 2f39 0007 e2fa movel 7e2fa <_RTEMS_Allocator_Mutex>,%sp@- 56e42: 2d40 fffc movel %d0,%fp@(-4) 56e46: 4eb9 0005 9744 jsr 59744 <_API_Mutex_Unlock> return return_status; 56e4c: 202e fffc movel %fp@(-4),%d0 56e50: 588f addql #4,%sp 56e52: 6000 ff54 braw 56da8 <== ALWAYS TAKEN ... 00056f08 : rtems_status_code rtems_region_extend( rtems_id id, void *starting_address, uintptr_t length ) { 56f08: 4e56 fff8 linkw %fp,#-8 56f0c: 2f0a movel %a2,%sp@- 56f0e: 2f02 movel %d2,%sp@- 56f10: 242e 000c movel %fp@(12),%d2 Heap_Extend_status heap_status; Objects_Locations location; rtems_status_code return_status; Region_Control *the_region; if ( !starting_address ) 56f14: 677e beqs 56f94 return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); /* to prevent deletion */ 56f16: 2f39 0007 e2fa movel 7e2fa <_RTEMS_Allocator_Mutex>,%sp@- 56f1c: 4eb9 0005 96e4 jsr 596e4 <_API_Mutex_Lock> RTEMS_INLINE_ROUTINE Region_Control *_Region_Get ( Objects_Id id, Objects_Locations *location ) { return (Region_Control *) 56f22: 486e fff8 pea %fp@(-8) 56f26: 2f2e 0008 movel %fp@(8),%sp@- 56f2a: 4879 0007 e146 pea 7e146 <_Region_Information> 56f30: 4eb9 0005 b20c jsr 5b20c <_Objects_Get_no_protection> the_region = _Region_Get( id, &location ); switch ( location ) { 56f36: 4fef 0010 lea %sp@(16),%sp 56f3a: 2440 moveal %d0,%a2 56f3c: 4aae fff8 tstl %fp@(-8) 56f40: 6640 bnes 56f82 case OBJECTS_LOCAL: heap_status = _Heap_Extend( 56f42: 486e fffc pea %fp@(-4) 56f46: 2f2e 0010 movel %fp@(16),%sp@- 56f4a: 2f02 movel %d2,%sp@- 56f4c: 486a 0068 pea %a2@(104) 56f50: 4eb9 0005 a4e8 jsr 5a4e8 <_Heap_Extend> starting_address, length, &amount_extended ); if ( heap_status == HEAP_EXTEND_SUCCESSFUL ) { 56f56: 4fef 0010 lea %sp@(16),%sp 56f5a: 4a80 tstl %d0 56f5c: 6748 beqs 56fa6 the_region->length += amount_extended; the_region->maximum_segment_size += amount_extended; return_status = RTEMS_SUCCESSFUL; } else if ( heap_status == HEAP_EXTEND_ERROR ) { 56f5e: 7201 moveq #1,%d1 56f60: b280 cmpl %d0,%d1 56f62: 6760 beqs 56fc4 default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 56f64: 2f39 0007 e2fa movel 7e2fa <_RTEMS_Allocator_Mutex>,%sp@- if ( heap_status == HEAP_EXTEND_SUCCESSFUL ) { the_region->length += amount_extended; the_region->maximum_segment_size += amount_extended; return_status = RTEMS_SUCCESSFUL; } else if ( heap_status == HEAP_EXTEND_ERROR ) { 56f6a: 7418 moveq #24,%d2 default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 56f6c: 4eb9 0005 9744 jsr 59744 <_API_Mutex_Unlock> return return_status; 56f72: 588f addql #4,%sp } 56f74: 2002 movel %d2,%d0 56f76: 242e fff0 movel %fp@(-16),%d2 56f7a: 246e fff4 moveal %fp@(-12),%a2 56f7e: 4e5e unlk %fp 56f80: 4e75 rts default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 56f82: 2f39 0007 e2fa movel 7e2fa <_RTEMS_Allocator_Mutex>,%sp@- return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); /* to prevent deletion */ the_region = _Region_Get( id, &location ); switch ( location ) { 56f88: 7404 moveq #4,%d2 default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 56f8a: 4eb9 0005 9744 jsr 59744 <_API_Mutex_Unlock> return return_status; 56f90: 588f addql #4,%sp 56f92: 60e0 bras 56f74 <== ALWAYS TAKEN Heap_Extend_status heap_status; Objects_Locations location; rtems_status_code return_status; Region_Control *the_region; if ( !starting_address ) 56f94: 143c 0009 moveb #9,%d2 break; } _RTEMS_Unlock_allocator(); return return_status; } 56f98: 2002 movel %d2,%d0 56f9a: 242e fff0 movel %fp@(-16),%d2 56f9e: 246e fff4 moveal %fp@(-12),%a2 56fa2: 4e5e unlk %fp 56fa4: 4e75 rts length, &amount_extended ); if ( heap_status == HEAP_EXTEND_SUCCESSFUL ) { the_region->length += amount_extended; 56fa6: 202e fffc movel %fp@(-4),%d0 the_region->maximum_segment_size += amount_extended; 56faa: d1aa 005c addl %d0,%a2@(92) 56fae: 4282 clrl %d2 length, &amount_extended ); if ( heap_status == HEAP_EXTEND_SUCCESSFUL ) { the_region->length += amount_extended; 56fb0: d1aa 0054 addl %d0,%a2@(84) default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 56fb4: 2f39 0007 e2fa movel 7e2fa <_RTEMS_Allocator_Mutex>,%sp@- 56fba: 4eb9 0005 9744 jsr 59744 <_API_Mutex_Unlock> return return_status; 56fc0: 588f addql #4,%sp 56fc2: 60b0 bras 56f74 <== ALWAYS TAKEN default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 56fc4: 2f39 0007 e2fa movel 7e2fa <_RTEMS_Allocator_Mutex>,%sp@- if ( heap_status == HEAP_EXTEND_SUCCESSFUL ) { the_region->length += amount_extended; the_region->maximum_segment_size += amount_extended; return_status = RTEMS_SUCCESSFUL; } else if ( heap_status == HEAP_EXTEND_ERROR ) { 56fca: 7409 moveq #9,%d2 default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 56fcc: 4eb9 0005 9744 jsr 59744 <_API_Mutex_Unlock> return return_status; 56fd2: 588f addql #4,%sp 56fd4: 609e bras 56f74 <== ALWAYS TAKEN ... 00056fd8 : rtems_status_code rtems_region_get_free_information( rtems_id id, Heap_Information_block *the_info ) { 56fd8: 4e56 fffc linkw %fp,#-4 56fdc: 2f0a movel %a2,%sp@- 56fde: 246e 000c moveal %fp@(12),%a2 56fe2: 2f02 movel %d2,%sp@- Objects_Locations location; rtems_status_code return_status; register Region_Control *the_region; if ( !the_info ) 56fe4: 4a8a tstl %a2 56fe6: 6776 beqs 5705e <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); 56fe8: 2f39 0007 e2fa movel 7e2fa <_RTEMS_Allocator_Mutex>,%sp@- 56fee: 4eb9 0005 96e4 jsr 596e4 <_API_Mutex_Lock> 56ff4: 486e fffc pea %fp@(-4) 56ff8: 2f2e 0008 movel %fp@(8),%sp@- 56ffc: 4879 0007 e146 pea 7e146 <_Region_Information> 57002: 4eb9 0005 b20c jsr 5b20c <_Objects_Get_no_protection> the_region = _Region_Get( id, &location ); switch ( location ) { 57008: 4fef 0010 lea %sp@(16),%sp 5700c: 4aae fffc tstl %fp@(-4) 57010: 663a bnes 5704c the_info->Used.number = 0; the_info->Used.total = 0; the_info->Used.largest = 0; _Heap_Get_free_information( &the_region->Memory, &the_info->Free ); 57012: 2f0a movel %a2,%sp@- 57014: 2040 moveal %d0,%a0 57016: 4868 0068 pea %a0@(104) 5701a: 4282 clrl %d2 the_region = _Region_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: the_info->Used.number = 0; 5701c: 42aa 000c clrl %a2@(12) the_info->Used.total = 0; 57020: 42aa 0014 clrl %a2@(20) the_info->Used.largest = 0; 57024: 42aa 0010 clrl %a2@(16) _Heap_Get_free_information( &the_region->Memory, &the_info->Free ); 57028: 4eb9 0005 a718 jsr 5a718 <_Heap_Get_free_information> return_status = RTEMS_SUCCESSFUL; break; 5702e: 508f addql #8,%sp default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 57030: 2f39 0007 e2fa movel 7e2fa <_RTEMS_Allocator_Mutex>,%sp@- 57036: 4eb9 0005 9744 jsr 59744 <_API_Mutex_Unlock> return return_status; 5703c: 588f addql #4,%sp } 5703e: 2002 movel %d2,%d0 57040: 242e fff4 movel %fp@(-12),%d2 57044: 246e fff8 moveal %fp@(-8),%a2 57048: 4e5e unlk %fp 5704a: 4e75 rts default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 5704c: 2f39 0007 e2fa movel 7e2fa <_RTEMS_Allocator_Mutex>,%sp@- return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); the_region = _Region_Get( id, &location ); switch ( location ) { 57052: 7404 moveq #4,%d2 default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 57054: 4eb9 0005 9744 jsr 59744 <_API_Mutex_Unlock> return return_status; 5705a: 588f addql #4,%sp 5705c: 60e0 bras 5703e <== ALWAYS TAKEN { Objects_Locations location; rtems_status_code return_status; register Region_Control *the_region; if ( !the_info ) 5705e: 7409 moveq #9,%d2 break; } _RTEMS_Unlock_allocator(); return return_status; } 57060: 2002 movel %d2,%d0 57062: 242e fff4 movel %fp@(-12),%d2 57066: 246e fff8 moveal %fp@(-8),%a2 5706a: 4e5e unlk %fp 5706c: 4e75 rts ... 00057070 : rtems_status_code rtems_region_get_information( rtems_id id, Heap_Information_block *the_info ) { 57070: 4e56 fffc linkw %fp,#-4 57074: 2f02 movel %d2,%sp@- 57076: 242e 000c movel %fp@(12),%d2 Objects_Locations location; rtems_status_code return_status; register Region_Control *the_region; if ( !the_info ) 5707a: 6766 beqs 570e2 return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); 5707c: 2f39 0007 e2fa movel 7e2fa <_RTEMS_Allocator_Mutex>,%sp@- 57082: 4eb9 0005 96e4 jsr 596e4 <_API_Mutex_Lock> 57088: 486e fffc pea %fp@(-4) 5708c: 2f2e 0008 movel %fp@(8),%sp@- 57090: 4879 0007 e146 pea 7e146 <_Region_Information> 57096: 4eb9 0005 b20c jsr 5b20c <_Objects_Get_no_protection> the_region = _Region_Get( id, &location ); switch ( location ) { 5709c: 4fef 0010 lea %sp@(16),%sp 570a0: 4aae fffc tstl %fp@(-4) 570a4: 662a bnes 570d0 case OBJECTS_LOCAL: _Heap_Get_information( &the_region->Memory, the_info ); 570a6: 2f02 movel %d2,%sp@- 570a8: 2040 moveal %d0,%a0 570aa: 4868 0068 pea %a0@(104) 570ae: 4282 clrl %d2 570b0: 4eb9 0005 a76c jsr 5a76c <_Heap_Get_information> return_status = RTEMS_SUCCESSFUL; break; 570b6: 508f addql #8,%sp default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 570b8: 2f39 0007 e2fa movel 7e2fa <_RTEMS_Allocator_Mutex>,%sp@- 570be: 4eb9 0005 9744 jsr 59744 <_API_Mutex_Unlock> return return_status; 570c4: 588f addql #4,%sp } 570c6: 2002 movel %d2,%d0 570c8: 242e fff8 movel %fp@(-8),%d2 570cc: 4e5e unlk %fp 570ce: 4e75 rts default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 570d0: 2f39 0007 e2fa movel 7e2fa <_RTEMS_Allocator_Mutex>,%sp@- return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); the_region = _Region_Get( id, &location ); switch ( location ) { 570d6: 7404 moveq #4,%d2 default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 570d8: 4eb9 0005 9744 jsr 59744 <_API_Mutex_Unlock> return return_status; 570de: 588f addql #4,%sp 570e0: 60e4 bras 570c6 <== ALWAYS TAKEN { Objects_Locations location; rtems_status_code return_status; register Region_Control *the_region; if ( !the_info ) 570e2: 143c 0009 moveb #9,%d2 break; } _RTEMS_Unlock_allocator(); return return_status; } 570e6: 2002 movel %d2,%d0 570e8: 242e fff8 movel %fp@(-8),%d2 570ec: 4e5e unlk %fp 570ee: 4e75 rts 000570f0 : uintptr_t size, rtems_option option_set, rtems_interval timeout, void **segment ) { 570f0: 4e56 ffe4 linkw %fp,#-28 570f4: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@ 570f8: 262e 0008 movel %fp@(8),%d3 570fc: 242e 000c movel %fp@(12),%d2 57100: 246e 0018 moveal %fp@(24),%a2 Objects_Locations location; rtems_status_code return_status; Region_Control *the_region; void *the_segment; if ( !segment ) 57104: 4a8a tstl %a2 57106: 6700 00be beqw 571c6 return RTEMS_INVALID_ADDRESS; *segment = NULL; 5710a: 4292 clrl %a2@ if ( size == 0 ) 5710c: 4a82 tstl %d2 5710e: 660c bnes 5711c 57110: 7008 moveq #8,%d0 break; } _RTEMS_Unlock_allocator(); return return_status; } 57112: 4cee 1c0c ffe4 moveml %fp@(-28),%d2-%d3/%a2-%a4 57118: 4e5e unlk %fp 5711a: 4e75 rts *segment = NULL; if ( size == 0 ) return RTEMS_INVALID_SIZE; _RTEMS_Lock_allocator(); 5711c: 2f39 0007 e2fa movel 7e2fa <_RTEMS_Allocator_Mutex>,%sp@- 57122: 4eb9 0005 96e4 jsr 596e4 <_API_Mutex_Lock> 57128: 486e fffc pea %fp@(-4) 5712c: 2f03 movel %d3,%sp@- 5712e: 4879 0007 e146 pea 7e146 <_Region_Information> executing = _Thread_Executing; 57134: 2879 0007 e302 moveal 7e302 <_Thread_Executing>,%a4 5713a: 4eb9 0005 b20c jsr 5b20c <_Objects_Get_no_protection> the_region = _Region_Get( id, &location ); switch ( location ) { 57140: 4fef 0010 lea %sp@(16),%sp 57144: 2640 moveal %d0,%a3 57146: 4aae fffc tstl %fp@(-4) 5714a: 6628 bnes 57174 case OBJECTS_LOCAL: if ( size > the_region->maximum_segment_size ) 5714c: b4ab 005c cmpl %a3@(92),%d2 57150: 633c blss 5718e default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 57152: 2f39 0007 e2fa movel 7e2fa <_RTEMS_Allocator_Mutex>,%sp@- executing = _Thread_Executing; the_region = _Region_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: if ( size > the_region->maximum_segment_size ) 57158: 7008 moveq #8,%d0 default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 5715a: 2d40 fff8 movel %d0,%fp@(-8) 5715e: 4eb9 0005 9744 jsr 59744 <_API_Mutex_Unlock> return return_status; 57164: 202e fff8 movel %fp@(-8),%d0 57168: 588f addql #4,%sp } 5716a: 4cee 1c0c ffe4 moveml %fp@(-28),%d2-%d3/%a2-%a4 57170: 4e5e unlk %fp 57172: 4e75 rts default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 57174: 2f39 0007 e2fa movel 7e2fa <_RTEMS_Allocator_Mutex>,%sp@- _Thread_queue_Enqueue( &the_region->Wait_queue, timeout ); _Thread_Enable_dispatch(); return (rtems_status_code) executing->Wait.return_code; 5717a: 7004 moveq #4,%d0 default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 5717c: 2d40 fff8 movel %d0,%fp@(-8) 57180: 4eb9 0005 9744 jsr 59744 <_API_Mutex_Unlock> return return_status; 57186: 202e fff8 movel %fp@(-8),%d0 5718a: 588f addql #4,%sp 5718c: 60dc bras 5716a <== ALWAYS TAKEN * @brief See _Heap_Allocate_aligned_with_boundary() with alignment and * boundary equals zero. */ RTEMS_INLINE_ROUTINE void *_Heap_Allocate( Heap_Control *heap, uintptr_t size ) { return _Heap_Allocate_aligned_with_boundary( heap, size, 0, 0 ); 5718e: 42a7 clrl %sp@- 57190: 42a7 clrl %sp@- 57192: 2f02 movel %d2,%sp@- 57194: 486b 0068 pea %a3@(104) 57198: 4eb9 0005 a354 jsr 5a354 <_Heap_Allocate_aligned_with_boundary> the_segment = _Region_Allocate_segment( the_region, size ); _Region_Debug_Walk( the_region, 2 ); if ( the_segment ) { 5719e: 4fef 0010 lea %sp@(16),%sp 571a2: 2200 movel %d0,%d1 571a4: 672c beqs 571d2 the_region->number_of_used_blocks += 1; 571a6: 52ab 0064 addql #1,%a3@(100) *segment = the_segment; 571aa: 4280 clrl %d0 571ac: 2481 movel %d1,%a2@ default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 571ae: 2f39 0007 e2fa movel 7e2fa <_RTEMS_Allocator_Mutex>,%sp@- 571b4: 2d40 fff8 movel %d0,%fp@(-8) 571b8: 4eb9 0005 9744 jsr 59744 <_API_Mutex_Unlock> return return_status; 571be: 202e fff8 movel %fp@(-8),%d0 571c2: 588f addql #4,%sp 571c4: 60a4 bras 5716a <== ALWAYS TAKEN Objects_Locations location; rtems_status_code return_status; Region_Control *the_region; void *the_segment; if ( !segment ) 571c6: 7009 moveq #9,%d0 break; } _RTEMS_Unlock_allocator(); return return_status; } 571c8: 4cee 1c0c ffe4 moveml %fp@(-28),%d2-%d3/%a2-%a4 571ce: 4e5e unlk %fp 571d0: 4e75 rts if ( the_segment ) { the_region->number_of_used_blocks += 1; *segment = the_segment; return_status = RTEMS_SUCCESSFUL; } else if ( _Options_Is_no_wait( option_set ) ) { 571d2: 202e 0010 movel %fp@(16),%d0 571d6: 0800 0000 btst #0,%d0 571da: 671c beqs 571f8 default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 571dc: 2f39 0007 e2fa movel 7e2fa <_RTEMS_Allocator_Mutex>,%sp@- if ( the_segment ) { the_region->number_of_used_blocks += 1; *segment = the_segment; return_status = RTEMS_SUCCESSFUL; } else if ( _Options_Is_no_wait( option_set ) ) { 571e2: 700d moveq #13,%d0 default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 571e4: 2d40 fff8 movel %d0,%fp@(-8) 571e8: 4eb9 0005 9744 jsr 59744 <_API_Mutex_Unlock> return return_status; 571ee: 202e fff8 movel %fp@(-8),%d0 571f2: 588f addql #4,%sp 571f4: 6000 ff74 braw 5716a <== ALWAYS TAKEN rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 571f8: 2039 0007 e248 movel 7e248 <_Thread_Dispatch_disable_level>,%d0 571fe: 5280 addql #1,%d0 57200: 23c0 0007 e248 movel %d0,7e248 <_Thread_Dispatch_disable_level> * Switch from using the memory allocation mutex to using a * dispatching disabled critical section. We have to do this * because this thread is going to block. */ _Thread_Disable_dispatch(); _RTEMS_Unlock_allocator(); 57206: 2f39 0007 e2fa movel 7e2fa <_RTEMS_Allocator_Mutex>,%sp@- 5720c: 4eb9 0005 9744 jsr 59744 <_API_Mutex_Unlock> executing->Wait.queue = &the_region->Wait_queue; 57212: 200b movel %a3,%d0 57214: 0680 0000 0010 addil #16,%d0 RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section ( Thread_queue_Control *the_thread_queue ) { the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 5721a: 7201 moveq #1,%d1 5721c: 2940 0044 movel %d0,%a4@(68) 57220: 2741 0040 movel %d1,%a3@(64) executing->Wait.id = id; 57224: 2943 0020 movel %d3,%a4@(32) executing->Wait.count = size; 57228: 2942 0024 movel %d2,%a4@(36) executing->Wait.return_argument = segment; 5722c: 294a 0028 movel %a2,%a4@(40) _Thread_queue_Enter_critical_section( &the_region->Wait_queue ); _Thread_queue_Enqueue( &the_region->Wait_queue, timeout ); 57230: 4879 0005 c440 pea 5c440 <_Thread_queue_Timeout> 57236: 2f2e 0014 movel %fp@(20),%sp@- 5723a: 2f00 movel %d0,%sp@- 5723c: 4eb9 0005 c0e0 jsr 5c0e0 <_Thread_queue_Enqueue_with_handler> _Thread_Enable_dispatch(); 57242: 4eb9 0005 bb64 jsr 5bb64 <_Thread_Enable_dispatch> return (rtems_status_code) executing->Wait.return_code; 57248: 202c 0034 movel %a4@(52),%d0 5724c: 4fef 0010 lea %sp@(16),%sp break; } _RTEMS_Unlock_allocator(); return return_status; } 57250: 4cee 1c0c ffe4 moveml %fp@(-28),%d2-%d3/%a2-%a4 57256: 4e5e unlk %fp 57258: 4e75 rts ... 0005725c : rtems_status_code rtems_region_get_segment_size( rtems_id id, void *segment, uintptr_t *size ) { 5725c: 4e56 fffc linkw %fp,#-4 57260: 2f03 movel %d3,%sp@- 57262: 262e 0010 movel %fp@(16),%d3 57266: 2f02 movel %d2,%sp@- 57268: 242e 000c movel %fp@(12),%d2 Objects_Locations location; rtems_status_code return_status = RTEMS_SUCCESSFUL; register Region_Control *the_region; if ( !segment ) 5726c: 6700 0092 beqw 57300 return RTEMS_INVALID_ADDRESS; if ( !size ) 57270: 4a83 tstl %d3 57272: 6700 008c beqw 57300 return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); 57276: 2f39 0007 e2fa movel 7e2fa <_RTEMS_Allocator_Mutex>,%sp@- 5727c: 4eb9 0005 96e4 jsr 596e4 <_API_Mutex_Lock> 57282: 486e fffc pea %fp@(-4) 57286: 2f2e 0008 movel %fp@(8),%sp@- 5728a: 4879 0007 e146 pea 7e146 <_Region_Information> 57290: 4eb9 0005 b20c jsr 5b20c <_Objects_Get_no_protection> the_region = _Region_Get( id, &location ); switch ( location ) { 57296: 222e fffc movel %fp@(-4),%d1 5729a: 4fef 0010 lea %sp@(16),%sp 5729e: 6636 bnes 572d6 case OBJECTS_LOCAL: if ( !_Heap_Size_of_alloc_area( &the_region->Memory, segment, size ) ) 572a0: 2f03 movel %d3,%sp@- 572a2: 2040 moveal %d0,%a0 572a4: 2f02 movel %d2,%sp@- 572a6: 4868 0068 pea %a0@(104) 572aa: 4eb9 0005 ac48 jsr 5ac48 <_Heap_Size_of_alloc_area> 572b0: 4fef 000c lea %sp@(12),%sp 572b4: 4a00 tstb %d0 572b6: 6624 bnes 572dc <== NEVER TAKEN case OBJECTS_ERROR: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 572b8: 2f39 0007 e2fa movel 7e2fa <_RTEMS_Allocator_Mutex>,%sp@- <== NOT EXECUTED the_region = _Region_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: if ( !_Heap_Size_of_alloc_area( &the_region->Memory, segment, size ) ) 572be: 7409 moveq #9,%d2 <== NOT EXECUTED case OBJECTS_ERROR: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 572c0: 4eb9 0005 9744 jsr 59744 <_API_Mutex_Unlock> <== NOT EXECUTED return return_status; 572c6: 588f addql #4,%sp <== NOT EXECUTED } 572c8: 2002 movel %d2,%d0 572ca: 242e fff4 movel %fp@(-12),%d2 572ce: 262e fff8 movel %fp@(-8),%d3 572d2: 4e5e unlk %fp 572d4: 4e75 rts return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); the_region = _Region_Get( id, &location ); switch ( location ) { 572d6: 7001 moveq #1,%d0 572d8: b081 cmpl %d1,%d0 572da: 6712 beqs 572ee <== NEVER TAKEN case OBJECTS_ERROR: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 572dc: 2f39 0007 e2fa movel 7e2fa <_RTEMS_Allocator_Mutex>,%sp@- the_region = _Region_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: if ( !_Heap_Size_of_alloc_area( &the_region->Memory, segment, size ) ) 572e2: 4282 clrl %d2 case OBJECTS_ERROR: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 572e4: 4eb9 0005 9744 jsr 59744 <_API_Mutex_Unlock> return return_status; 572ea: 588f addql #4,%sp 572ec: 60da bras 572c8 <== ALWAYS TAKEN case OBJECTS_ERROR: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 572ee: 2f39 0007 e2fa movel 7e2fa <_RTEMS_Allocator_Mutex>,%sp@- return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); the_region = _Region_Get( id, &location ); switch ( location ) { 572f4: 7404 moveq #4,%d2 case OBJECTS_ERROR: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 572f6: 4eb9 0005 9744 jsr 59744 <_API_Mutex_Unlock> return return_status; 572fc: 588f addql #4,%sp 572fe: 60c8 bras 572c8 <== ALWAYS TAKEN 57300: 7409 moveq #9,%d2 } 57302: 2002 movel %d2,%d0 57304: 242e fff4 movel %fp@(-12),%d2 57308: 262e fff8 movel %fp@(-8),%d3 5730c: 4e5e unlk %fp 5730e: 4e75 rts 0005740c : rtems_status_code rtems_region_return_segment( rtems_id id, void *segment ) { 5740c: 4e56 fffc linkw %fp,#-4 57410: 2f0a movel %a2,%sp@- 57412: 2f02 movel %d2,%sp@- uint32_t size; #endif int status; register Region_Control *the_region; _RTEMS_Lock_allocator(); 57414: 2f39 0007 e2fa movel 7e2fa <_RTEMS_Allocator_Mutex>,%sp@- 5741a: 4eb9 0005 96e4 jsr 596e4 <_API_Mutex_Lock> 57420: 486e fffc pea %fp@(-4) 57424: 2f2e 0008 movel %fp@(8),%sp@- 57428: 4879 0007 e146 pea 7e146 <_Region_Information> 5742e: 4eb9 0005 b20c jsr 5b20c <_Objects_Get_no_protection> the_region = _Region_Get( id, &location ); switch ( location ) { 57434: 4fef 0010 lea %sp@(16),%sp 57438: 2440 moveal %d0,%a2 5743a: 4aae fffc tstl %fp@(-4) 5743e: 671e beqs 5745e default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 57440: 2f39 0007 e2fa movel 7e2fa <_RTEMS_Allocator_Mutex>,%sp@- register Region_Control *the_region; _RTEMS_Lock_allocator(); the_region = _Region_Get( id, &location ); switch ( location ) { 57446: 7404 moveq #4,%d2 default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 57448: 4eb9 0005 9744 jsr 59744 <_API_Mutex_Unlock> return return_status; 5744e: 588f addql #4,%sp } 57450: 2002 movel %d2,%d0 57452: 242e fff4 movel %fp@(-12),%d2 57456: 246e fff8 moveal %fp@(-8),%a2 5745a: 4e5e unlk %fp 5745c: 4e75 rts RTEMS_INLINE_ROUTINE bool _Region_Free_segment ( Region_Control *the_region, void *the_segment ) { return _Heap_Free( &the_region->Memory, the_segment ); 5745e: 2f2e 000c movel %fp@(12),%sp@- 57462: 486a 0068 pea %a2@(104) 57466: 4eb9 0005 a598 jsr 5a598 <_Heap_Free> #endif status = _Region_Free_segment( the_region, segment ); _Region_Debug_Walk( the_region, 4 ); if ( !status ) 5746c: 508f addql #8,%sp 5746e: 4a00 tstb %d0 57470: 6612 bnes 57484 default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 57472: 2f39 0007 e2fa movel 7e2fa <_RTEMS_Allocator_Mutex>,%sp@- else { the_region->number_of_used_blocks -= 1; _Region_Process_queue(the_region); /* unlocks allocator */ return RTEMS_SUCCESSFUL; 57478: 7409 moveq #9,%d2 default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 5747a: 4eb9 0005 9744 jsr 59744 <_API_Mutex_Unlock> return return_status; 57480: 588f addql #4,%sp 57482: 60cc bras 57450 <== ALWAYS TAKEN _Region_Debug_Walk( the_region, 4 ); if ( !status ) return_status = RTEMS_INVALID_ADDRESS; else { the_region->number_of_used_blocks -= 1; 57484: 53aa 0064 subql #1,%a2@(100) _Region_Process_queue(the_region); /* unlocks allocator */ 57488: 4282 clrl %d2 5748a: 2f0a movel %a2,%sp@- 5748c: 4eb9 0005 f81c jsr 5f81c <_Region_Process_queue> break; } _RTEMS_Unlock_allocator(); return return_status; } 57492: 246e fff8 moveal %fp@(-8),%a2 57496: 2002 movel %d2,%d0 else { the_region->number_of_used_blocks -= 1; _Region_Process_queue(the_region); /* unlocks allocator */ return RTEMS_SUCCESSFUL; 57498: 588f addql #4,%sp break; } _RTEMS_Unlock_allocator(); return return_status; } 5749a: 242e fff4 movel %fp@(-12),%d2 5749e: 4e5e unlk %fp 574a0: 4e75 rts ... 00045a8c : uint32_t count, rtems_attribute attribute_set, rtems_task_priority priority_ceiling, rtems_id *id ) { 45a8c: 4e56 ffd4 linkw %fp,#-44 45a90: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 45a94: 262e 0008 movel %fp@(8),%d3 45a98: 242e 0010 movel %fp@(16),%d2 45a9c: 246e 0018 moveal %fp@(24),%a2 register Semaphore_Control *the_semaphore; CORE_mutex_Attributes the_mutex_attr; CORE_semaphore_Attributes the_semaphore_attr; CORE_mutex_Status mutex_status; if ( !rtems_is_name_valid( name ) ) 45aa0: 4a83 tstl %d3 45aa2: 6748 beqs 45aec return RTEMS_INVALID_NAME; if ( !id ) 45aa4: 4a8a tstl %a2 45aa6: 6700 00ea beqw 45b92 * id - semaphore id * RTEMS_SUCCESSFUL - if successful * error code - if unsuccessful */ rtems_status_code rtems_semaphore_create( 45aaa: 2002 movel %d2,%d0 45aac: 0280 0000 00c0 andil #192,%d0 return RTEMS_NOT_DEFINED; } else #endif if ( _Attributes_Is_inherit_priority( attribute_set ) || 45ab2: 6744 beqs 45af8 _Attributes_Is_priority_ceiling( attribute_set ) ) { if ( ! (_Attributes_Is_binary_semaphore( attribute_set ) && 45ab4: 7230 moveq #48,%d1 45ab6: 7810 moveq #16,%d4 45ab8: c282 andl %d2,%d1 45aba: b881 cmpl %d1,%d4 45abc: 670c beqs 45aca name, 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; 45abe: 700b moveq #11,%d0 } 45ac0: 4cee 0c1c ffd4 moveml %fp@(-44),%d2-%d4/%a2-%a3 45ac6: 4e5e unlk %fp 45ac8: 4e75 rts #endif if ( _Attributes_Is_inherit_priority( attribute_set ) || _Attributes_Is_priority_ceiling( attribute_set ) ) { if ( ! (_Attributes_Is_binary_semaphore( attribute_set ) && 45aca: 44c2 movew %d2,%ccr 45acc: 66f0 bnes 45abe _Attributes_Is_priority( attribute_set ) ) ) return RTEMS_NOT_DEFINED; } if ( _Attributes_Is_inherit_priority( attribute_set ) && 45ace: 0c80 0000 00c0 cmpil #192,%d0 45ad4: 67e8 beqs 45abe _Attributes_Is_priority_ceiling( attribute_set ) ) return RTEMS_NOT_DEFINED; if ( !_Attributes_Is_counting_semaphore( attribute_set ) && ( count > 1 ) ) 45ad6: 7001 moveq #1,%d0 45ad8: b0ae 000c cmpl %fp@(12),%d0 45adc: 6420 bccs 45afe 45ade: 103c 000a moveb #10,%d0 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 45ae2: 4cee 0c1c ffd4 moveml %fp@(-44),%d2-%d4/%a2-%a3 45ae8: 4e5e unlk %fp 45aea: 4e75 rts register Semaphore_Control *the_semaphore; CORE_mutex_Attributes the_mutex_attr; CORE_semaphore_Attributes the_semaphore_attr; CORE_mutex_Status mutex_status; if ( !rtems_is_name_valid( name ) ) 45aec: 7003 moveq #3,%d0 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 45aee: 4cee 0c1c ffd4 moveml %fp@(-44),%d2-%d4/%a2-%a3 45af4: 4e5e unlk %fp 45af6: 4e75 rts */ RTEMS_INLINE_ROUTINE bool _Attributes_Is_counting_semaphore( rtems_attribute attribute_set ) { return ((attribute_set & RTEMS_SEMAPHORE_CLASS) == RTEMS_COUNTING_SEMAPHORE); 45af8: 7830 moveq #48,%d4 45afa: c882 andl %d2,%d4 if ( _Attributes_Is_inherit_priority( attribute_set ) && _Attributes_Is_priority_ceiling( attribute_set ) ) return RTEMS_NOT_DEFINED; if ( !_Attributes_Is_counting_semaphore( attribute_set ) && ( count > 1 ) ) 45afc: 66d8 bnes 45ad6 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 45afe: 2039 0005 f154 movel 5f154 <_Thread_Dispatch_disable_level>,%d0 45b04: 5280 addql #1,%d0 45b06: 23c0 0005 f154 movel %d0,5f154 <_Thread_Dispatch_disable_level> * This function allocates a semaphore control block from * the inactive chain of free semaphore control blocks. */ RTEMS_INLINE_ROUTINE Semaphore_Control *_Semaphore_Allocate( void ) { return (Semaphore_Control *) _Objects_Allocate( &_Semaphore_Information ); 45b0c: 4879 0005 f08c pea 5f08c <_Semaphore_Information> 45b12: 4eb9 0004 709c jsr 4709c <_Objects_Allocate> _Thread_Disable_dispatch(); /* prevents deletion */ the_semaphore = _Semaphore_Allocate(); if ( !the_semaphore ) { 45b18: 588f addql #4,%sp 45b1a: 2640 moveal %d0,%a3 45b1c: 4a80 tstl %d0 45b1e: 6700 00d8 beqw 45bf8 _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; } #endif the_semaphore->attribute_set = attribute_set; 45b22: 2742 0010 movel %d2,%a3@(16) /* * Initialize it as a counting semaphore. */ if ( _Attributes_Is_counting_semaphore( attribute_set ) ) { 45b26: 4a84 tstl %d4 45b28: 6774 beqs 45b9e /* * It is either simple binary semaphore or a more powerful mutex * style binary semaphore. This is the mutex style. */ if ( _Attributes_Is_priority( attribute_set ) ) the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY; 45b2a: 44c2 movew %d2,%ccr 45b2c: 56c0 sne %d0 45b2e: 49c0 extbl %d0 45b30: 5280 addql #1,%d0 45b32: 2d40 fff0 movel %d0,%fp@(-16) else the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_FIFO; if ( _Attributes_Is_binary_semaphore( attribute_set ) ) { 45b36: 7010 moveq #16,%d0 45b38: b084 cmpl %d4,%d0 45b3a: 6700 00ce beqw 45c0a the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING; the_mutex_attr.only_owner_release = true; } } } else /* must be simple binary semaphore */ { the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_BLOCKS; 45b3e: 7202 moveq #2,%d1 the_mutex_attr.only_owner_release = false; 45b40: 4204 clrb %d4 the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING; the_mutex_attr.only_owner_release = true; } } } else /* must be simple binary semaphore */ { the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_BLOCKS; 45b42: 2d41 ffea movel %d1,%fp@(-22) the_mutex_attr.only_owner_release = false; 45b46: 1d44 ffee moveb %d4,%fp@(-18) } mutex_status = _CORE_mutex_Initialize( 45b4a: 7001 moveq #1,%d0 45b4c: b0ae 000c cmpl %fp@(12),%d0 45b50: 57c0 seq %d0 45b52: 49c0 extbl %d0 45b54: 4480 negl %d0 45b56: 2f00 movel %d0,%sp@- 45b58: 486e ffea pea %fp@(-22) 45b5c: 486b 0014 pea %a3@(20) 45b60: 4eb9 0004 67e8 jsr 467e8 <_CORE_mutex_Initialize> &the_semaphore->Core_control.mutex, &the_mutex_attr, (count == 1) ? CORE_MUTEX_UNLOCKED : CORE_MUTEX_LOCKED ); if ( mutex_status == CORE_MUTEX_STATUS_CEILING_VIOLATED ) { 45b66: 4fef 000c lea %sp@(12),%sp 45b6a: 7206 moveq #6,%d1 45b6c: b280 cmpl %d0,%d1 45b6e: 665e bnes 45bce */ RTEMS_INLINE_ROUTINE void _Semaphore_Free ( Semaphore_Control *the_semaphore ) { _Objects_Free( &_Semaphore_Information, &the_semaphore->Object ); 45b70: 2f0b movel %a3,%sp@- 45b72: 4879 0005 f08c pea 5f08c <_Semaphore_Information> 45b78: 4eb9 0004 73d4 jsr 473d4 <_Objects_Free> _Semaphore_Free( the_semaphore ); _Thread_Enable_dispatch(); 45b7e: 4eb9 0004 7dc8 jsr 47dc8 <_Thread_Enable_dispatch> return RTEMS_INVALID_PRIORITY; 45b84: 508f addql #8,%sp (count == 1) ? CORE_MUTEX_UNLOCKED : CORE_MUTEX_LOCKED ); if ( mutex_status == CORE_MUTEX_STATUS_CEILING_VIOLATED ) { _Semaphore_Free( the_semaphore ); _Thread_Enable_dispatch(); 45b86: 7013 moveq #19,%d0 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 45b88: 4cee 0c1c ffd4 moveml %fp@(-44),%d2-%d4/%a2-%a3 45b8e: 4e5e unlk %fp 45b90: 4e75 rts CORE_mutex_Status mutex_status; if ( !rtems_is_name_valid( name ) ) return RTEMS_INVALID_NAME; if ( !id ) 45b92: 7009 moveq #9,%d0 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 45b94: 4cee 0c1c ffd4 moveml %fp@(-44),%d2-%d4/%a2-%a3 45b9a: 4e5e unlk %fp 45b9c: 4e75 rts * The following are just to make Purify happy. */ the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES; the_mutex_attr.priority_ceiling = PRIORITY_MINIMUM; _CORE_semaphore_Initialize( 45b9e: 2f2e 000c movel %fp@(12),%sp@- */ if ( _Attributes_Is_counting_semaphore( attribute_set ) ) { /* * This effectively disables limit checking. */ the_semaphore_attr.maximum_count = 0xFFFFFFFF; 45ba2: 72ff moveq #-1,%d1 * The following are just to make Purify happy. */ the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES; the_mutex_attr.priority_ceiling = PRIORITY_MINIMUM; _CORE_semaphore_Initialize( 45ba4: 486e fff8 pea %fp@(-8) 45ba8: 486b 0014 pea %a3@(20) * This effectively disables limit checking. */ the_semaphore_attr.maximum_count = 0xFFFFFFFF; if ( _Attributes_Is_priority( attribute_set ) ) the_semaphore_attr.discipline = CORE_SEMAPHORE_DISCIPLINES_PRIORITY; 45bac: 44c2 movew %d2,%ccr 45bae: 56c0 sne %d0 */ if ( _Attributes_Is_counting_semaphore( attribute_set ) ) { /* * This effectively disables limit checking. */ the_semaphore_attr.maximum_count = 0xFFFFFFFF; 45bb0: 2d41 fff8 movel %d1,%fp@(-8) if ( _Attributes_Is_priority( attribute_set ) ) the_semaphore_attr.discipline = CORE_SEMAPHORE_DISCIPLINES_PRIORITY; 45bb4: 49c0 extbl %d0 45bb6: 5280 addql #1,%d0 the_semaphore_attr.discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO; /* * The following are just to make Purify happy. */ the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES; 45bb8: 42ae ffea clrl %fp@(-22) * This effectively disables limit checking. */ the_semaphore_attr.maximum_count = 0xFFFFFFFF; if ( _Attributes_Is_priority( attribute_set ) ) the_semaphore_attr.discipline = CORE_SEMAPHORE_DISCIPLINES_PRIORITY; 45bbc: 2d40 fffc movel %d0,%fp@(-4) /* * The following are just to make Purify happy. */ the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES; the_mutex_attr.priority_ceiling = PRIORITY_MINIMUM; 45bc0: 42ae fff4 clrl %fp@(-12) _CORE_semaphore_Initialize( 45bc4: 4eb9 0004 6b30 jsr 46b30 <_CORE_semaphore_Initialize> 45bca: 4fef 000c lea %sp@(12),%sp #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 45bce: 202b 0008 movel %a3@(8),%d0 45bd2: 4281 clrl %d1 45bd4: 2079 0005 f0a4 moveal 5f0a4 <_Semaphore_Information+0x18>,%a0 45bda: 3200 movew %d0,%d1 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 45bdc: 2743 000c movel %d3,%a3@(12) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 45be0: 218b 1c00 movel %a3,%a0@(00000000,%d1:l:4) &_Semaphore_Information, &the_semaphore->Object, (Objects_Name) name ); *id = the_semaphore->Object.id; 45be4: 2480 movel %d0,%a2@ the_semaphore->Object.id, name, 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); 45be6: 4eb9 0004 7dc8 jsr 47dc8 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; } 45bec: 4cee 0c1c ffd4 moveml %fp@(-44),%d2-%d4/%a2-%a3 the_semaphore->Object.id, name, 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); 45bf2: 4280 clrl %d0 return RTEMS_SUCCESSFUL; } 45bf4: 4e5e unlk %fp 45bf6: 4e75 rts _Thread_Disable_dispatch(); /* prevents deletion */ the_semaphore = _Semaphore_Allocate(); if ( !the_semaphore ) { _Thread_Enable_dispatch(); 45bf8: 4eb9 0004 7dc8 jsr 47dc8 <_Thread_Enable_dispatch> 45bfe: 7005 moveq #5,%d0 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 45c00: 4cee 0c1c ffd4 moveml %fp@(-44),%d2-%d4/%a2-%a3 45c06: 4e5e unlk %fp 45c08: 4e75 rts else the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_FIFO; if ( _Attributes_Is_binary_semaphore( attribute_set ) ) { the_mutex_attr.priority_ceiling = priority_ceiling; the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES; 45c0a: 42ae ffea clrl %fp@(-22) the_mutex_attr.only_owner_release = false; if ( the_mutex_attr.discipline == CORE_MUTEX_DISCIPLINES_PRIORITY ) { 45c0e: 7801 moveq #1,%d4 the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_FIFO; if ( _Attributes_Is_binary_semaphore( attribute_set ) ) { the_mutex_attr.priority_ceiling = priority_ceiling; the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES; the_mutex_attr.only_owner_release = false; 45c10: 4201 clrb %d1 the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY; else the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_FIFO; if ( _Attributes_Is_binary_semaphore( attribute_set ) ) { the_mutex_attr.priority_ceiling = priority_ceiling; 45c12: 2d6e 0014 fff4 movel %fp@(20),%fp@(-12) the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES; the_mutex_attr.only_owner_release = false; 45c18: 1d41 ffee moveb %d1,%fp@(-18) if ( the_mutex_attr.discipline == CORE_MUTEX_DISCIPLINES_PRIORITY ) { 45c1c: b8ae fff0 cmpl %fp@(-16),%d4 45c20: 6600 ff28 bnew 45b4a if ( _Attributes_Is_inherit_priority( attribute_set ) ) { 45c24: 0802 0006 btst #6,%d2 45c28: 6712 beqs 45c3c the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT; 45c2a: 103c 0002 moveb #2,%d0 the_mutex_attr.only_owner_release = true; 45c2e: 7201 moveq #1,%d1 the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES; the_mutex_attr.only_owner_release = false; if ( the_mutex_attr.discipline == CORE_MUTEX_DISCIPLINES_PRIORITY ) { if ( _Attributes_Is_inherit_priority( attribute_set ) ) { the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT; 45c30: 2d40 fff0 movel %d0,%fp@(-16) the_mutex_attr.only_owner_release = true; 45c34: 1d41 ffee moveb %d1,%fp@(-18) 45c38: 6000 ff10 braw 45b4a <== ALWAYS TAKEN } else if ( _Attributes_Is_priority_ceiling( attribute_set ) ) { 45c3c: 4a02 tstb %d2 45c3e: 6c00 ff0a bgew 45b4a the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING; 45c42: 7803 moveq #3,%d4 the_mutex_attr.only_owner_release = true; 45c44: 7001 moveq #1,%d0 if ( the_mutex_attr.discipline == CORE_MUTEX_DISCIPLINES_PRIORITY ) { if ( _Attributes_Is_inherit_priority( attribute_set ) ) { the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT; the_mutex_attr.only_owner_release = true; } else if ( _Attributes_Is_priority_ceiling( attribute_set ) ) { the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING; 45c46: 2d44 fff0 movel %d4,%fp@(-16) the_mutex_attr.only_owner_release = true; 45c4a: 1d40 ffee moveb %d0,%fp@(-18) 45c4e: 6000 fefa braw 45b4a <== ALWAYS TAKEN ... 00045c54 : #endif rtems_status_code rtems_semaphore_delete( rtems_id id ) { 45c54: 4e56 fffc linkw %fp,#-4 45c58: 2f0a movel %a2,%sp@- RTEMS_INLINE_ROUTINE Semaphore_Control *_Semaphore_Get ( Objects_Id id, Objects_Locations *location ) { return (Semaphore_Control *) 45c5a: 486e fffc pea %fp@(-4) 45c5e: 2f2e 0008 movel %fp@(8),%sp@- 45c62: 4879 0005 f08c pea 5f08c <_Semaphore_Information> 45c68: 4eb9 0004 7538 jsr 47538 <_Objects_Get> register Semaphore_Control *the_semaphore; Objects_Locations location; the_semaphore = _Semaphore_Get( id, &location ); switch ( location ) { 45c6e: 4fef 000c lea %sp@(12),%sp 45c72: 2440 moveal %d0,%a2 45c74: 4aae fffc tstl %fp@(-4) 45c78: 670a beqs 45c84 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 45c7a: 246e fff8 moveal %fp@(-8),%a2 { register Semaphore_Control *the_semaphore; Objects_Locations location; the_semaphore = _Semaphore_Get( id, &location ); switch ( location ) { 45c7e: 7004 moveq #4,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 45c80: 4e5e unlk %fp 45c82: 4e75 rts 45c84: 7030 moveq #48,%d0 45c86: c0aa 0010 andl %a2@(16),%d0 the_semaphore = _Semaphore_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: if ( !_Attributes_Is_counting_semaphore(the_semaphore->attribute_set) ) { 45c8a: 6760 beqs 45cec if ( _CORE_mutex_Is_locked( &the_semaphore->Core_control.mutex ) && 45c8c: 4aaa 0062 tstl %a2@(98) 45c90: 6616 bnes 45ca8 45c92: 7220 moveq #32,%d1 45c94: b280 cmpl %d0,%d1 45c96: 6710 beqs 45ca8 !_Attributes_Is_simple_binary_semaphore( the_semaphore->attribute_set ) ) { _Thread_Enable_dispatch(); 45c98: 4eb9 0004 7dc8 jsr 47dc8 <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 45c9e: 246e fff8 moveal %fp@(-8),%a2 case OBJECTS_LOCAL: if ( !_Attributes_Is_counting_semaphore(the_semaphore->attribute_set) ) { if ( _CORE_mutex_Is_locked( &the_semaphore->Core_control.mutex ) && !_Attributes_Is_simple_binary_semaphore( the_semaphore->attribute_set ) ) { _Thread_Enable_dispatch(); 45ca2: 700c moveq #12,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 45ca4: 4e5e unlk %fp 45ca6: 4e75 rts !_Attributes_Is_simple_binary_semaphore( the_semaphore->attribute_set ) ) { _Thread_Enable_dispatch(); return RTEMS_RESOURCE_IN_USE; } _CORE_mutex_Flush( 45ca8: 4878 0004 pea 4 45cac: 42a7 clrl %sp@- 45cae: 486a 0014 pea %a2@(20) 45cb2: 4eb9 0004 67dc jsr 467dc <_CORE_mutex_Flush> 45cb8: 4fef 000c lea %sp@(12),%sp SEMAPHORE_MP_OBJECT_WAS_DELETED, CORE_SEMAPHORE_WAS_DELETED ); } _Objects_Close( &_Semaphore_Information, &the_semaphore->Object ); 45cbc: 2f0a movel %a2,%sp@- 45cbe: 4879 0005 f08c pea 5f08c <_Semaphore_Information> 45cc4: 4eb9 0004 712c jsr 4712c <_Objects_Close> */ RTEMS_INLINE_ROUTINE void _Semaphore_Free ( Semaphore_Control *the_semaphore ) { _Objects_Free( &_Semaphore_Information, &the_semaphore->Object ); 45cca: 2f0a movel %a2,%sp@- 45ccc: 4879 0005 f08c pea 5f08c <_Semaphore_Information> 45cd2: 4eb9 0004 73d4 jsr 473d4 <_Objects_Free> 0, /* Not used */ 0 /* Not used */ ); } #endif _Thread_Enable_dispatch(); 45cd8: 4eb9 0004 7dc8 jsr 47dc8 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 45cde: 4fef 0010 lea %sp@(16),%sp 0, /* Not used */ 0 /* Not used */ ); } #endif _Thread_Enable_dispatch(); 45ce2: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 45ce4: 246e fff8 moveal %fp@(-8),%a2 45ce8: 4e5e unlk %fp 45cea: 4e75 rts &the_semaphore->Core_control.mutex, SEMAPHORE_MP_OBJECT_WAS_DELETED, CORE_MUTEX_WAS_DELETED ); } else { _CORE_semaphore_Flush( 45cec: 4878 0002 pea 2 45cf0: 42a7 clrl %sp@- 45cf2: 486a 0014 pea %a2@(20) 45cf6: 4eb9 0004 6b24 jsr 46b24 <_CORE_semaphore_Flush> 45cfc: 4fef 000c lea %sp@(12),%sp SEMAPHORE_MP_OBJECT_WAS_DELETED, CORE_SEMAPHORE_WAS_DELETED ); } _Objects_Close( &_Semaphore_Information, &the_semaphore->Object ); 45d00: 2f0a movel %a2,%sp@- 45d02: 4879 0005 f08c pea 5f08c <_Semaphore_Information> 45d08: 4eb9 0004 712c jsr 4712c <_Objects_Close> 45d0e: 2f0a movel %a2,%sp@- 45d10: 4879 0005 f08c pea 5f08c <_Semaphore_Information> 45d16: 4eb9 0004 73d4 jsr 473d4 <_Objects_Free> 0, /* Not used */ 0 /* Not used */ ); } #endif _Thread_Enable_dispatch(); 45d1c: 4eb9 0004 7dc8 jsr 47dc8 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 45d22: 4fef 0010 lea %sp@(16),%sp 0, /* Not used */ 0 /* Not used */ ); } #endif _Thread_Enable_dispatch(); 45d26: 4280 clrl %d0 45d28: 60ba bras 45ce4 <== ALWAYS TAKEN ... 00051058 : #endif rtems_status_code rtems_semaphore_flush( rtems_id id ) { 51058: 4e56 fffc linkw %fp,#-4 5105c: 486e fffc pea %fp@(-4) 51060: 2f2e 0008 movel %fp@(8),%sp@- 51064: 4879 0006 5314 pea 65314 <_Semaphore_Information> 5106a: 4eb9 0004 9580 jsr 49580 <_Objects_Get> register Semaphore_Control *the_semaphore; Objects_Locations location; the_semaphore = _Semaphore_Get( id, &location ); switch ( location ) { 51070: 4fef 000c lea %sp@(12),%sp 51074: 4aae fffc tstl %fp@(-4) 51078: 6706 beqs 51080 5107a: 7004 moveq #4,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 5107c: 4e5e unlk %fp 5107e: 4e75 rts the_semaphore = _Semaphore_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: if ( !_Attributes_Is_counting_semaphore(the_semaphore->attribute_set) ) { 51080: 7230 moveq #48,%d1 51082: 2040 moveal %d0,%a0 51084: c2a8 0010 andl %a0@(16),%d1 51088: 6720 beqs 510aa _CORE_mutex_Flush( 5108a: 4878 0001 pea 1 5108e: 42a7 clrl %sp@- 51090: 4868 0014 pea %a0@(20) 51094: 4eb9 0004 8788 jsr 48788 <_CORE_mutex_Flush> 5109a: 4fef 000c lea %sp@(12),%sp &the_semaphore->Core_control.semaphore, SEND_OBJECT_WAS_DELETED, CORE_SEMAPHORE_STATUS_UNSATISFIED_NOWAIT ); } _Thread_Enable_dispatch(); 5109e: 4eb9 0004 9e90 jsr 49e90 <_Thread_Enable_dispatch> 510a4: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 510a6: 4e5e unlk %fp 510a8: 4e75 rts &the_semaphore->Core_control.mutex, SEND_OBJECT_WAS_DELETED, CORE_MUTEX_STATUS_UNSATISFIED_NOWAIT ); } else { _CORE_semaphore_Flush( 510aa: 4878 0001 pea 1 510ae: 2040 moveal %d0,%a0 510b0: 42a7 clrl %sp@- 510b2: 4868 0014 pea %a0@(20) 510b6: 4eb9 0004 8ad0 jsr 48ad0 <_CORE_semaphore_Flush> 510bc: 4fef 000c lea %sp@(12),%sp &the_semaphore->Core_control.semaphore, SEND_OBJECT_WAS_DELETED, CORE_SEMAPHORE_STATUS_UNSATISFIED_NOWAIT ); } _Thread_Enable_dispatch(); 510c0: 4eb9 0004 9e90 jsr 49e90 <_Thread_Enable_dispatch> 510c6: 4280 clrl %d0 510c8: 60dc bras 510a6 <== ALWAYS TAKEN ... 00045d2c : rtems_status_code rtems_semaphore_obtain( rtems_id id, rtems_option option_set, rtems_interval timeout ) { 45d2c: 4e56 ffec linkw %fp,#-20 45d30: 48d7 001c moveml %d2-%d4,%sp@ Objects_Id id, Objects_Locations *location, ISR_Level *level ) { return (Semaphore_Control *) 45d34: 486e fff8 pea %fp@(-8) 45d38: 486e fffc pea %fp@(-4) 45d3c: 242e 0008 movel %fp@(8),%d2 45d40: 2f02 movel %d2,%sp@- 45d42: 4879 0005 f08c pea 5f08c <_Semaphore_Information> 45d48: 262e 000c movel %fp@(12),%d3 45d4c: 282e 0010 movel %fp@(16),%d4 45d50: 4eb9 0004 74d8 jsr 474d8 <_Objects_Get_isr_disable> register Semaphore_Control *the_semaphore; Objects_Locations location; ISR_Level level; the_semaphore = _Semaphore_Get_interrupt_disable( id, &location, &level ); switch ( location ) { 45d56: 4fef 0010 lea %sp@(16),%sp 45d5a: 4aae fffc tstl %fp@(-4) 45d5e: 670c beqs 45d6c 45d60: 7004 moveq #4,%d0 break; } return RTEMS_INVALID_ID; } 45d62: 4cee 001c ffec moveml %fp@(-20),%d2-%d4 45d68: 4e5e unlk %fp 45d6a: 4e75 rts the_semaphore = _Semaphore_Get_interrupt_disable( id, &location, &level ); switch ( location ) { case OBJECTS_LOCAL: if ( !_Attributes_Is_counting_semaphore(the_semaphore->attribute_set) ) { 45d6c: 7230 moveq #48,%d1 45d6e: 2040 moveal %d0,%a0 45d70: c2a8 0010 andl %a0@(16),%d1 45d74: 6738 beqs 45dae _CORE_mutex_Seize( 45d76: 2f2e fff8 movel %fp@(-8),%sp@- 45d7a: 7201 moveq #1,%d1 45d7c: c681 andl %d1,%d3 45d7e: 2f04 movel %d4,%sp@- 45d80: b781 eorl %d3,%d1 45d82: 2f01 movel %d1,%sp@- 45d84: 2f02 movel %d2,%sp@- 45d86: 4868 0014 pea %a0@(20) 45d8a: 4eb9 0004 6964 jsr 46964 <_CORE_mutex_Seize> id, ((_Options_Is_no_wait( option_set )) ? false : true), timeout, level ); return _Semaphore_Translate_core_mutex_return_code( 45d90: 2079 0005 f20e moveal 5f20e <_Thread_Executing>,%a0 45d96: 2f28 0034 movel %a0@(52),%sp@- 45d9a: 4eb9 0004 5ef8 jsr 45ef8 <_Semaphore_Translate_core_mutex_return_code> 45da0: 4fef 0018 lea %sp@(24),%sp break; } return RTEMS_INVALID_ID; } 45da4: 4cee 001c ffec moveml %fp@(-20),%d2-%d4 45daa: 4e5e unlk %fp 45dac: 4e75 rts { Thread_Control *executing; /* disabled when you get here */ executing = _Thread_Executing; 45dae: 2079 0005 f20e moveal 5f20e <_Thread_Executing>,%a0 executing->Wait.return_code = CORE_SEMAPHORE_STATUS_SUCCESSFUL; if ( the_semaphore->count != 0 ) { 45db4: 2240 moveal %d0,%a1 Thread_Control *executing; /* disabled when you get here */ executing = _Thread_Executing; executing->Wait.return_code = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 45db6: 42a8 0034 clrl %a0@(52) if ( the_semaphore->count != 0 ) { 45dba: 2229 005c movel %a1@(92),%d1 45dbe: 662e bnes 45dee the_semaphore->count -= 1; _ISR_Enable( *level_p ); return; } if ( !wait ) { 45dc0: 0803 0000 btst #0,%d3 45dc4: 6748 beqs 45e0e _ISR_Enable( *level_p ); 45dc6: 202e fff8 movel %fp@(-8),%d0 45dca: 46c0 movew %d0,%sr executing->Wait.return_code = CORE_SEMAPHORE_STATUS_UNSATISFIED_NOWAIT; 45dcc: 7001 moveq #1,%d0 45dce: 2140 0034 movel %d0,%a0@(52) id, ((_Options_Is_no_wait( option_set )) ? false : true), timeout, &level ); return _Semaphore_Translate_core_semaphore_return_code( 45dd2: 2079 0005 f20e moveal 5f20e <_Thread_Executing>,%a0 45dd8: 2f28 0034 movel %a0@(52),%sp@- 45ddc: 4eb9 0004 5f0e jsr 45f0e <_Semaphore_Translate_core_semaphore_return_code> 45de2: 588f addql #4,%sp break; } return RTEMS_INVALID_ID; } 45de4: 4cee 001c ffec moveml %fp@(-20),%d2-%d4 45dea: 4e5e unlk %fp 45dec: 4e75 rts /* disabled when you get here */ executing = _Thread_Executing; executing->Wait.return_code = CORE_SEMAPHORE_STATUS_SUCCESSFUL; if ( the_semaphore->count != 0 ) { the_semaphore->count -= 1; 45dee: 5381 subql #1,%d1 45df0: 2341 005c movel %d1,%a1@(92) _ISR_Enable( *level_p ); 45df4: 202e fff8 movel %fp@(-8),%d0 45df8: 46c0 movew %d0,%sr id, ((_Options_Is_no_wait( option_set )) ? false : true), timeout, &level ); return _Semaphore_Translate_core_semaphore_return_code( 45dfa: 2079 0005 f20e moveal 5f20e <_Thread_Executing>,%a0 45e00: 2f28 0034 movel %a0@(52),%sp@- 45e04: 4eb9 0004 5f0e jsr 45f0e <_Semaphore_Translate_core_semaphore_return_code> 45e0a: 588f addql #4,%sp 45e0c: 60d6 bras 45de4 <== ALWAYS TAKEN 45e0e: 2239 0005 f154 movel 5f154 <_Thread_Dispatch_disable_level>,%d1 45e14: 5281 addql #1,%d1 45e16: 23c1 0005 f154 movel %d1,5f154 <_Thread_Dispatch_disable_level> RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section ( Thread_queue_Control *the_thread_queue ) { the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 45e1c: 7201 moveq #1,%d1 45e1e: 2240 moveal %d0,%a1 return; } _Thread_Disable_dispatch(); _Thread_queue_Enter_critical_section( &the_semaphore->Wait_queue ); executing->Wait.queue = &the_semaphore->Wait_queue; 45e20: 0680 0000 0014 addil #20,%d0 45e26: 2341 0044 movel %d1,%a1@(68) executing->Wait.id = id; 45e2a: 2142 0020 movel %d2,%a0@(32) return; } _Thread_Disable_dispatch(); _Thread_queue_Enter_critical_section( &the_semaphore->Wait_queue ); executing->Wait.queue = &the_semaphore->Wait_queue; 45e2e: 2140 0044 movel %d0,%a0@(68) executing->Wait.id = id; _ISR_Enable( *level_p ); 45e32: 222e fff8 movel %fp@(-8),%d1 45e36: 46c1 movew %d1,%sr _Thread_queue_Enqueue( &the_semaphore->Wait_queue, timeout ); 45e38: 4879 0004 8674 pea 48674 <_Thread_queue_Timeout> 45e3e: 2f04 movel %d4,%sp@- 45e40: 2f00 movel %d0,%sp@- 45e42: 4eb9 0004 8314 jsr 48314 <_Thread_queue_Enqueue_with_handler> _Thread_Enable_dispatch(); 45e48: 4eb9 0004 7dc8 jsr 47dc8 <_Thread_Enable_dispatch> 45e4e: 2079 0005 f20e moveal 5f20e <_Thread_Executing>,%a0 45e54: 4fef 000c lea %sp@(12),%sp 45e58: 2f28 0034 movel %a0@(52),%sp@- 45e5c: 4eb9 0004 5f0e jsr 45f0e <_Semaphore_Translate_core_semaphore_return_code> 45e62: 588f addql #4,%sp 45e64: 6000 ff7e braw 45de4 <== ALWAYS TAKEN 000463fc : void rtems_shutdown_executive( uint32_t result ) { if ( !_System_state_Is_shutdown( _System_state_Get() ) ) { 463fc: 7004 moveq #4,%d0 */ void rtems_shutdown_executive( uint32_t result ) { 463fe: 4e56 0000 linkw %fp,#0 if ( !_System_state_Is_shutdown( _System_state_Get() ) ) { 46402: b0b9 0005 f2dc cmpl 5f2dc <_System_state_Current>,%d0 46408: 6726 beqs 46430 * 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 ); 4640a: 2039 0005 f150 movel 5f150 <_Thread_BSP_context+0x30>,%d0 46410: 2239 0005 f120 movel 5f120 <_Thread_BSP_context>,%d1 46416: 46c1 movew %d1,%sr 46418: 2e40 moveal %d0,%sp 4641a: 4e75 rts 4641c: 23c0 0005 f150 movel %d0,5f150 <_Thread_BSP_context+0x30> <== NOT EXECUTED 46422: 7004 moveq #4,%d0 <== NOT EXECUTED 46424: 23c1 0005 f120 movel %d1,5f120 <_Thread_BSP_context> <== NOT EXECUTED 4642a: 23c0 0005 f2dc movel %d0,5f2dc <_System_state_Current> <== NOT EXECUTED _System_state_Set( SYSTEM_STATE_SHUTDOWN ); _Thread_Stop_multitasking(); } } 46430: 4e5e unlk %fp 46432: 4e75 rts 00057a1c : rtems_status_code rtems_signal_send( rtems_id id, rtems_signal_set signal_set ) { 57a1c: 4e56 fffc linkw %fp,#-4 57a20: 2f03 movel %d3,%sp@- 57a22: 2f02 movel %d2,%sp@- 57a24: 242e 000c movel %fp@(12),%d2 register Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; ASR_Information *asr; if ( !signal_set ) 57a28: 660e bnes 57a38 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 57a2a: 242e fff4 movel %fp@(-12),%d2 register Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; ASR_Information *asr; if ( !signal_set ) 57a2e: 700a moveq #10,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 57a30: 262e fff8 movel %fp@(-8),%d3 57a34: 4e5e unlk %fp 57a36: 4e75 rts ASR_Information *asr; if ( !signal_set ) return RTEMS_INVALID_NUMBER; the_thread = _Thread_Get( id, &location ); 57a38: 486e fffc pea %fp@(-4) 57a3c: 2f2e 0008 movel %fp@(8),%sp@- 57a40: 4eb9 0005 bbbc jsr 5bbbc <_Thread_Get> switch ( location ) { 57a46: 508f addql #8,%sp 57a48: 4aae fffc tstl %fp@(-4) 57a4c: 670e beqs 57a5c case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 57a4e: 242e fff4 movel %fp@(-12),%d2 if ( !signal_set ) return RTEMS_INVALID_NUMBER; the_thread = _Thread_Get( id, &location ); switch ( location ) { 57a52: 7004 moveq #4,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 57a54: 262e fff8 movel %fp@(-8),%d3 57a58: 4e5e unlk %fp 57a5a: 4e75 rts the_thread = _Thread_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; 57a5c: 2240 moveal %d0,%a1 57a5e: 2069 010a moveal %a1@(266),%a0 asr = &api->Signal; 57a62: 4aa8 000a tstl %a0@(10) 57a66: 6770 beqs 57ad8 if ( ! _ASR_Is_null_handler( asr->handler ) ) { if ( asr->is_enabled ) { 57a68: 4a28 0008 tstb %a0@(8) 57a6c: 673e beqs 57aac rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 57a6e: 223c 0000 0700 movel #1792,%d1 57a74: 40c3 movew %sr,%d3 57a76: 8283 orl %d3,%d1 57a78: 46c1 movew %d1,%sr *signal_set |= signals; 57a7a: 85a8 0012 orl %d2,%a0@(18) _ISR_Enable( _level ); 57a7e: 46c3 movew %d3,%sr _ASR_Post_signals( signal_set, &asr->signals_posted ); the_thread->do_post_task_switch_extension = true; if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 57a80: 2239 0007 e2e2 movel 7e2e2 <_ISR_Nest_level>,%d1 if ( ! _ASR_Is_null_handler( asr->handler ) ) { if ( asr->is_enabled ) { _ASR_Post_signals( signal_set, &asr->signals_posted ); the_thread->do_post_task_switch_extension = true; 57a86: 7401 moveq #1,%d2 57a88: 1342 0074 moveb %d2,%a1@(116) if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 57a8c: 4a81 tstl %d1 57a8e: 6708 beqs 57a98 57a90: b0b9 0007 e302 cmpl 7e302 <_Thread_Executing>,%d0 57a96: 6730 beqs 57ac8 <== NEVER TAKEN _ISR_Signals_to_thread_executing = true; } else { _ASR_Post_signals( signal_set, &asr->signals_pending ); } _Thread_Enable_dispatch(); 57a98: 4eb9 0005 bb64 jsr 5bb64 <_Thread_Enable_dispatch> 57a9e: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 57aa0: 242e fff4 movel %fp@(-12),%d2 57aa4: 262e fff8 movel %fp@(-8),%d3 57aa8: 4e5e unlk %fp 57aaa: 4e75 rts rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 57aac: 203c 0000 0700 movel #1792,%d0 57ab2: 40c1 movew %sr,%d1 57ab4: 8081 orl %d1,%d0 57ab6: 46c0 movew %d0,%sr *signal_set |= signals; 57ab8: 85a8 0016 orl %d2,%a0@(22) _ISR_Enable( _level ); 57abc: 46c1 movew %d1,%sr if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _ISR_Signals_to_thread_executing = true; } else { _ASR_Post_signals( signal_set, &asr->signals_pending ); } _Thread_Enable_dispatch(); 57abe: 4eb9 0005 bb64 jsr 5bb64 <_Thread_Enable_dispatch> 57ac4: 4280 clrl %d0 57ac6: 60d8 bras 57aa0 <== ALWAYS TAKEN _ASR_Post_signals( signal_set, &asr->signals_posted ); the_thread->do_post_task_switch_extension = true; if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _ISR_Signals_to_thread_executing = true; 57ac8: 13c2 0007 e390 moveb %d2,7e390 <_ISR_Signals_to_thread_executing> } else { _ASR_Post_signals( signal_set, &asr->signals_pending ); } _Thread_Enable_dispatch(); 57ace: 4eb9 0005 bb64 jsr 5bb64 <_Thread_Enable_dispatch> 57ad4: 4280 clrl %d0 57ad6: 60c8 bras 57aa0 <== ALWAYS TAKEN return RTEMS_SUCCESSFUL; } _Thread_Enable_dispatch(); 57ad8: 4eb9 0005 bb64 jsr 5bb64 <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 57ade: 242e fff4 movel %fp@(-12),%d2 _ASR_Post_signals( signal_set, &asr->signals_pending ); } _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } _Thread_Enable_dispatch(); 57ae2: 700b moveq #11,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 57ae4: 262e fff8 movel %fp@(-8),%d3 57ae8: 4e5e unlk %fp 57aea: 4e75 rts 00045f24 : size_t stack_size, rtems_mode initial_modes, rtems_attribute attribute_set, rtems_id *id ) { 45f24: 4e56 ffe8 linkw %fp,#-24 45f28: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@ 45f2c: 242e 0008 movel %fp@(8),%d2 45f30: 282e 000c movel %fp@(12),%d4 45f34: 262e 0014 movel %fp@(20),%d3 45f38: 2a2e 0018 movel %fp@(24),%d5 45f3c: 246e 001c moveal %fp@(28),%a2 Priority_Control core_priority; RTEMS_API_Control *api; ASR_Information *asr; if ( !id ) 45f40: 4a8a tstl %a2 45f42: 6700 011c beqw 46060 <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; if ( !rtems_is_name_valid( name ) ) 45f46: 4a82 tstl %d2 45f48: 6700 00b4 beqw 45ffe /* * Validate the RTEMS API priority and convert it to the core priority range. */ if ( !_Attributes_Is_system_task( the_attribute_set ) ) { 45f4c: 4a45 tstw %d5 45f4e: 6d14 blts 45f64 */ RTEMS_INLINE_ROUTINE bool _RTEMS_tasks_Priority_is_valid ( rtems_task_priority the_priority ) { return ( ( the_priority >= RTEMS_MINIMUM_PRIORITY ) && 45f50: 4a84 tstl %d4 45f52: 6700 00b6 beqw 4600a 45f56: 4280 clrl %d0 45f58: 1039 0005 d9a2 moveb 5d9a2 ,%d0 45f5e: b084 cmpl %d4,%d0 45f60: 6500 00a8 bcsw 4600a */ /* * Lock the allocator mutex for protection */ _RTEMS_Lock_allocator(); 45f64: 2f39 0005 f206 movel 5f206 <_RTEMS_Allocator_Mutex>,%sp@- 45f6a: 4eb9 0004 6710 jsr 46710 <_API_Mutex_Lock> * This function allocates a task control block from * the inactive chain of free task control blocks. */ RTEMS_INLINE_ROUTINE Thread_Control *_RTEMS_tasks_Allocate( void ) { return (Thread_Control *) _Objects_Allocate( &_RTEMS_tasks_Information ); 45f70: 4879 0005 f0c6 pea 5f0c6 <_RTEMS_tasks_Information> 45f76: 4eb9 0004 709c jsr 4709c <_Objects_Allocate> * the event of an error. */ the_thread = _RTEMS_tasks_Allocate(); if ( !the_thread ) { 45f7c: 508f addql #8,%sp 45f7e: 2640 moveal %d0,%a3 45f80: 4a80 tstl %d0 45f82: 6700 00c2 beqw 46046 /* * Initialize the core thread for this task. */ status = _Thread_Initialize( 45f86: 2f02 movel %d2,%sp@- 45f88: 7407 moveq #7,%d2 45f8a: 7009 moveq #9,%d0 45f8c: 2203 movel %d3,%d1 45f8e: e0a9 lsrl %d0,%d1 45f90: 2003 movel %d3,%d0 45f92: e088 lsrl #8,%d0 45f94: c483 andl %d3,%d2 45f96: 2f02 movel %d2,%sp@- 45f98: 7401 moveq #1,%d2 45f9a: 42a7 clrl %sp@- 45f9c: c481 andl %d1,%d2 45f9e: 7201 moveq #1,%d1 45fa0: 2f02 movel %d2,%sp@- 45fa2: 7401 moveq #1,%d2 45fa4: b380 eorl %d1,%d0 45fa6: c480 andl %d0,%d2 45fa8: 7001 moveq #1,%d0 45faa: 2f02 movel %d2,%sp@- 45fac: c085 andl %d5,%d0 45fae: 2f04 movel %d4,%sp@- 45fb0: 2f00 movel %d0,%sp@- 45fb2: 2f2e 0010 movel %fp@(16),%sp@- 45fb6: 42a7 clrl %sp@- 45fb8: 2f0b movel %a3,%sp@- 45fba: 4879 0005 f0c6 pea 5f0c6 <_RTEMS_tasks_Information> 45fc0: 4eb9 0004 7e8c jsr 47e8c <_Thread_Initialize> NULL, /* no budget algorithm callout */ _Modes_Get_interrupt_level(initial_modes), (Objects_Name) name ); if ( !status ) { 45fc6: 4fef 002c lea %sp@(44),%sp 45fca: 4a00 tstb %d0 45fcc: 6748 beqs 46016 } api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; asr->is_enabled = _Modes_Is_asr_disabled(initial_modes) ? false : true; 45fce: 720a moveq #10,%d1 45fd0: 7401 moveq #1,%d2 45fd2: e2ab lsrl %d1,%d3 45fd4: b583 eorl %d2,%d3 45fd6: 206b 010a moveal %a3@(266),%a0 45fda: c682 andl %d2,%d3 *id = the_thread->Object.id; 45fdc: 24ab 0008 movel %a3@(8),%a2@ } api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; asr->is_enabled = _Modes_Is_asr_disabled(initial_modes) ? false : true; 45fe0: 1143 0008 moveb %d3,%a0@(8) ); } #endif _RTEMS_Unlock_allocator(); 45fe4: 2f39 0005 f206 movel 5f206 <_RTEMS_Allocator_Mutex>,%sp@- 45fea: 4eb9 0004 6770 jsr 46770 <_API_Mutex_Unlock> return RTEMS_SUCCESSFUL; 45ff0: 588f addql #4,%sp ); } #endif _RTEMS_Unlock_allocator(); 45ff2: 4280 clrl %d0 return RTEMS_SUCCESSFUL; } 45ff4: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 45ffa: 4e5e unlk %fp 45ffc: 4e75 rts if ( !id ) return RTEMS_INVALID_ADDRESS; if ( !rtems_is_name_valid( name ) ) 45ffe: 7003 moveq #3,%d0 } #endif _RTEMS_Unlock_allocator(); return RTEMS_SUCCESSFUL; } 46000: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 46006: 4e5e unlk %fp 46008: 4e75 rts } #endif _RTEMS_Unlock_allocator(); return RTEMS_SUCCESSFUL; 4600a: 7013 moveq #19,%d0 } 4600c: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 46012: 4e5e unlk %fp 46014: 4e75 rts */ RTEMS_INLINE_ROUTINE void _RTEMS_tasks_Free ( Thread_Control *the_task ) { _Objects_Free( 46016: 2f2b 0008 movel %a3@(8),%sp@- 4601a: 4eb9 0004 7458 jsr 47458 <_Objects_Get_information_id> 46020: 2f0b movel %a3,%sp@- 46022: 2f00 movel %d0,%sp@- 46024: 4eb9 0004 73d4 jsr 473d4 <_Objects_Free> #if defined(RTEMS_MULTIPROCESSING) if ( is_global ) _Objects_MP_Free_global_object( the_global_object ); #endif _RTEMS_tasks_Free( the_thread ); _RTEMS_Unlock_allocator(); 4602a: 2f39 0005 f206 movel 5f206 <_RTEMS_Allocator_Mutex>,%sp@- 46030: 4eb9 0004 6770 jsr 46770 <_API_Mutex_Unlock> return RTEMS_UNSATISFIED; 46036: 4fef 0010 lea %sp@(16),%sp #if defined(RTEMS_MULTIPROCESSING) if ( is_global ) _Objects_MP_Free_global_object( the_global_object ); #endif _RTEMS_tasks_Free( the_thread ); _RTEMS_Unlock_allocator(); 4603a: 700d moveq #13,%d0 } #endif _RTEMS_Unlock_allocator(); return RTEMS_SUCCESSFUL; } 4603c: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 46042: 4e5e unlk %fp 46044: 4e75 rts */ the_thread = _RTEMS_tasks_Allocate(); if ( !the_thread ) { _RTEMS_Unlock_allocator(); 46046: 2f39 0005 f206 movel 5f206 <_RTEMS_Allocator_Mutex>,%sp@- 4604c: 4eb9 0004 6770 jsr 46770 <_API_Mutex_Unlock> return RTEMS_TOO_MANY; 46052: 588f addql #4,%sp */ the_thread = _RTEMS_tasks_Allocate(); if ( !the_thread ) { _RTEMS_Unlock_allocator(); 46054: 7005 moveq #5,%d0 } #endif _RTEMS_Unlock_allocator(); return RTEMS_SUCCESSFUL; } 46056: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 4605c: 4e5e unlk %fp 4605e: 4e75 rts Priority_Control core_priority; RTEMS_API_Control *api; ASR_Information *asr; if ( !id ) 46060: 7009 moveq #9,%d0 } #endif _RTEMS_Unlock_allocator(); return RTEMS_SUCCESSFUL; } 46062: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 46068: 4e5e unlk %fp 4606a: 4e75 rts 0004dd58 : rtems_status_code rtems_task_mode( rtems_mode mode_set, rtems_mode mask, rtems_mode *previous_mode_set ) { 4dd58: 4e56 ffe4 linkw %fp,#-28 4dd5c: 48d7 1c3c moveml %d2-%d5/%a2-%a4,%sp@ 4dd60: 2a2e 0008 movel %fp@(8),%d5 4dd64: 242e 000c movel %fp@(12),%d2 4dd68: 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 ) 4dd6c: 4a8c tstl %a4 4dd6e: 6700 0154 beqw 4dec4 <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; 4dd72: 2479 0005 f20e moveal 5f20e <_Thread_Executing>,%a2 api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 4dd78: 4a2a 0075 tstb %a2@(117) 4dd7c: 57c0 seq %d0 4dd7e: 263c 0000 0100 movel #256,%d3 4dd84: 49c0 extbl %d0 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 4dd86: 266a 010a moveal %a2@(266),%a3 asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 4dd8a: c680 andl %d0,%d3 if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) 4dd8c: 4aaa 007a tstl %a2@(122) 4dd90: 6600 00d4 bnew 4de66 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; 4dd94: 4a2b 0008 tstb %a3@(8) 4dd98: 57c0 seq %d0 4dd9a: 283c 0000 0400 movel #1024,%d4 4dda0: 49c0 extbl %d0 4dda2: c880 andl %d0,%d4 old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; old_mode |= _ISR_Get_level(); 4dda4: 4eb9 0004 9350 jsr 49350 <_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; 4ddaa: 8084 orl %d4,%d0 old_mode |= _ISR_Get_level(); *previous_mode_set = old_mode; 4ddac: 8083 orl %d3,%d0 4ddae: 2880 movel %d0,%a4@ /* * These are generic thread scheduling characteristics. */ if ( mask & RTEMS_PREEMPT_MASK ) 4ddb0: 0802 0008 btst #8,%d2 4ddb4: 670e beqs 4ddc4 executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; 4ddb6: 2005 movel %d5,%d0 4ddb8: 7201 moveq #1,%d1 4ddba: e088 lsrl #8,%d0 4ddbc: b380 eorl %d1,%d0 4ddbe: c081 andl %d1,%d0 4ddc0: 1540 0075 moveb %d0,%a2@(117) if ( mask & RTEMS_TIMESLICE_MASK ) { 4ddc4: 0802 0009 btst #9,%d2 4ddc8: 6718 beqs 4dde2 if ( _Modes_Is_timeslice(mode_set) ) { 4ddca: 0805 0009 btst #9,%d5 4ddce: 6700 00c2 beqw 4de92 executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 4ddd2: 7001 moveq #1,%d0 executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 4ddd4: 41f9 0005 f104 lea 5f104 <_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; 4ddda: 2540 007a movel %d0,%a2@(122) executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 4ddde: 2550 0076 movel %a0@,%a2@(118) /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) 4dde2: 7007 moveq #7,%d0 4dde4: c082 andl %d2,%d0 4dde6: 6712 beqs 4ddfa */ RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level ( Modes_Control mode_set ) { _ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) ); 4dde8: 40c0 movew %sr,%d0 4ddea: 7207 moveq #7,%d1 4ddec: c285 andl %d5,%d1 4ddee: 0280 0000 f8ff andil #63743,%d0 4ddf4: e189 lsll #8,%d1 4ddf6: 8081 orl %d1,%d0 4ddf8: 46c0 movew %d0,%sr */ is_asr_enabled = false; needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { 4ddfa: 0802 000a btst #10,%d2 4ddfe: 6758 beqs 4de58 * Output: * *previous_mode_set - previous mode set * always return RTEMS_SUCCESSFUL; */ rtems_status_code rtems_task_mode( 4de00: 700a moveq #10,%d0 4de02: e0ad lsrl %d0,%d5 4de04: 7201 moveq #1,%d1 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; 4de06: 4280 clrl %d0 4de08: 102b 0008 moveb %a3@(8),%d0 * Output: * *previous_mode_set - previous mode set * always return RTEMS_SUCCESSFUL; */ rtems_status_code rtems_task_mode( 4de0c: b385 eorl %d1,%d5 4de0e: ca81 andl %d1,%d5 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; 4de10: ba80 cmpl %d0,%d5 4de12: 6744 beqs 4de58 ) { rtems_signal_set _signals; ISR_Level _level; _ISR_Disable( _level ); 4de14: 203c 0000 0700 movel #1792,%d0 needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true; if ( is_asr_enabled != asr->is_enabled ) { asr->is_enabled = is_asr_enabled; 4de1a: 1745 0008 moveb %d5,%a3@(8) 4de1e: 40c1 movew %sr,%d1 4de20: 8081 orl %d1,%d0 4de22: 46c0 movew %d0,%sr _signals = information->signals_pending; 4de24: 202b 0016 movel %a3@(22),%d0 information->signals_pending = information->signals_posted; 4de28: 276b 0012 0016 movel %a3@(18),%a3@(22) information->signals_posted = _signals; 4de2e: 2740 0012 movel %d0,%a3@(18) _ISR_Enable( _level ); 4de32: 46c1 movew %d1,%sr if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; 4de34: 4aab 0012 tstl %a3@(18) 4de38: 671e beqs 4de58 executing->do_post_task_switch_extension = true; } } } if ( _System_state_Is_up( _System_state_Get() ) ) 4de3a: 7203 moveq #3,%d1 if ( is_asr_enabled != asr->is_enabled ) { asr->is_enabled = is_asr_enabled; _ASR_Swap_signals( asr ); if ( _ASR_Are_signals_pending( asr ) ) { needs_asr_dispatching = true; executing->do_post_task_switch_extension = true; 4de3c: 7001 moveq #1,%d0 4de3e: 7401 moveq #1,%d2 4de40: 1540 0074 moveb %d0,%a2@(116) } } } if ( _System_state_Is_up( _System_state_Get() ) ) 4de44: b2b9 0005 f2dc cmpl 5f2dc <_System_state_Current>,%d1 4de4a: 6758 beqs 4dea4 <== NEVER TAKEN if ( _Thread_Evaluate_mode() || needs_asr_dispatching ) _Thread_Dispatch(); 4de4c: 4280 clrl %d0 return RTEMS_SUCCESSFUL; } 4de4e: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4 4de54: 4e5e unlk %fp 4de56: 4e75 rts executing->do_post_task_switch_extension = true; } } } if ( _System_state_Is_up( _System_state_Get() ) ) 4de58: 7203 moveq #3,%d1 if ( is_asr_enabled != asr->is_enabled ) { asr->is_enabled = is_asr_enabled; _ASR_Swap_signals( asr ); if ( _ASR_Are_signals_pending( asr ) ) { needs_asr_dispatching = true; executing->do_post_task_switch_extension = true; 4de5a: 4202 clrb %d2 } } } if ( _System_state_Is_up( _System_state_Get() ) ) 4de5c: b2b9 0005 f2dc cmpl 5f2dc <_System_state_Current>,%d1 4de62: 66e8 bnes 4de4c <== ALWAYS TAKEN 4de64: 603e bras 4dea4 <== ALWAYS TAKEN if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; 4de66: 4a2b 0008 tstb %a3@(8) 4de6a: 57c0 seq %d0 4de6c: 283c 0000 0400 movel #1024,%d4 4de72: 49c0 extbl %d0 4de74: c880 andl %d0,%d4 old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; old_mode |= _ISR_Get_level(); 4de76: 4eb9 0004 9350 jsr 49350 <_CPU_ISR_Get_level> 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; 4de7c: 08c3 0009 bset #9,%d3 old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; 4de80: 8084 orl %d4,%d0 old_mode |= _ISR_Get_level(); *previous_mode_set = old_mode; 4de82: 8083 orl %d3,%d0 4de84: 2880 movel %d0,%a4@ /* * These are generic thread scheduling characteristics. */ if ( mask & RTEMS_PREEMPT_MASK ) 4de86: 0802 0008 btst #8,%d2 4de8a: 6700 ff38 beqw 4ddc4 4de8e: 6000 ff26 braw 4ddb6 <== ALWAYS TAKEN /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) 4de92: 7007 moveq #7,%d0 4de94: 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; 4de96: 42aa 007a clrl %a2@(122) /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) 4de9a: 4a80 tstl %d0 4de9c: 6700 ff5c beqw 4ddfa 4dea0: 6000 ff46 braw 4dde8 <== ALWAYS TAKEN } } } if ( _System_state_Is_up( _System_state_Get() ) ) if ( _Thread_Evaluate_mode() || needs_asr_dispatching ) 4dea4: 4eb9 0004 e1c0 jsr 4e1c0 <_Thread_Evaluate_mode> 4deaa: 4a00 tstb %d0 4deac: 6604 bnes 4deb2 4deae: 4a02 tstb %d2 4deb0: 679a beqs 4de4c _Thread_Dispatch(); 4deb2: 4eb9 0004 7c70 jsr 47c70 <_Thread_Dispatch> 4deb8: 4280 clrl %d0 return RTEMS_SUCCESSFUL; } 4deba: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4 4dec0: 4e5e unlk %fp 4dec2: 4e75 rts ASR_Information *asr; bool is_asr_enabled = false; bool needs_asr_dispatching = false; rtems_mode old_mode; if ( !previous_mode_set ) 4dec4: 7009 moveq #9,%d0 if ( _System_state_Is_up( _System_state_Get() ) ) if ( _Thread_Evaluate_mode() || needs_asr_dispatching ) _Thread_Dispatch(); return RTEMS_SUCCESSFUL; } 4dec6: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4 4decc: 4e5e unlk %fp 4dece: 4e75 rts 0004afc0 : rtems_status_code rtems_task_set_priority( rtems_id id, rtems_task_priority new_priority, rtems_task_priority *old_priority ) { 4afc0: 4e56 fffc linkw %fp,#-4 4afc4: 2f0a movel %a2,%sp@- 4afc6: 246e 0010 moveal %fp@(16),%a2 4afca: 2f02 movel %d2,%sp@- 4afcc: 242e 000c movel %fp@(12),%d2 register Thread_Control *the_thread; Objects_Locations location; if ( new_priority != RTEMS_CURRENT_PRIORITY && 4afd0: 670c beqs 4afde */ RTEMS_INLINE_ROUTINE bool _RTEMS_tasks_Priority_is_valid ( rtems_task_priority the_priority ) { return ( ( the_priority >= RTEMS_MINIMUM_PRIORITY ) && 4afd2: 4280 clrl %d0 4afd4: 1039 0006 3e42 moveb 63e42 ,%d0 4afda: b082 cmpl %d2,%d0 4afdc: 6566 bcss 4b044 !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; if ( !old_priority ) 4afde: 4a8a tstl %a2 4afe0: 6770 beqs 4b052 return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); 4afe2: 486e fffc pea %fp@(-4) 4afe6: 2f2e 0008 movel %fp@(8),%sp@- 4afea: 4eb9 0004 cfc0 jsr 4cfc0 <_Thread_Get> switch ( location ) { 4aff0: 508f addql #8,%sp 4aff2: 4aae fffc tstl %fp@(-4) 4aff6: 663e bnes 4b036 case OBJECTS_LOCAL: /* XXX need helper to "convert" from core priority */ *old_priority = the_thread->current_priority; 4aff8: 2040 moveal %d0,%a0 4affa: 24a8 0014 movel %a0@(20),%a2@ if ( new_priority != RTEMS_CURRENT_PRIORITY ) { 4affe: 4a82 tstl %d2 4b000: 6720 beqs 4b022 the_thread->real_priority = new_priority; 4b002: 2142 0018 movel %d2,%a0@(24) if ( the_thread->resource_count == 0 || 4b006: 4aa8 001c tstl %a0@(28) 4b00a: 6706 beqs 4b012 the_thread->current_priority > new_priority ) 4b00c: b4a8 0014 cmpl %a0@(20),%d2 4b010: 6410 bccs 4b022 <== NEVER TAKEN _Thread_Change_priority( the_thread, new_priority, false ); 4b012: 42a7 clrl %sp@- 4b014: 2f02 movel %d2,%sp@- 4b016: 2f00 movel %d0,%sp@- 4b018: 4eb9 0004 ca48 jsr 4ca48 <_Thread_Change_priority> 4b01e: 4fef 000c lea %sp@(12),%sp } _Thread_Enable_dispatch(); 4b022: 4eb9 0004 cf68 jsr 4cf68 <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4b028: 242e fff4 movel %fp@(-12),%d2 the_thread->real_priority = new_priority; if ( the_thread->resource_count == 0 || the_thread->current_priority > new_priority ) _Thread_Change_priority( the_thread, new_priority, false ); } _Thread_Enable_dispatch(); 4b02c: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4b02e: 246e fff8 moveal %fp@(-8),%a2 4b032: 4e5e unlk %fp 4b034: 4e75 rts 4b036: 242e fff4 movel %fp@(-12),%d2 if ( !old_priority ) return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); switch ( location ) { 4b03a: 7004 moveq #4,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4b03c: 246e fff8 moveal %fp@(-8),%a2 4b040: 4e5e unlk %fp 4b042: 4e75 rts 4b044: 242e fff4 movel %fp@(-12),%d2 4b048: 7013 moveq #19,%d0 4b04a: 246e fff8 moveal %fp@(-8),%a2 4b04e: 4e5e unlk %fp 4b050: 4e75 rts 4b052: 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 ) 4b056: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4b058: 246e fff8 moveal %fp@(-8),%a2 4b05c: 4e5e unlk %fp 4b05e: 4e75 rts 0006a8a4 : rtems_status_code rtems_task_variable_delete( rtems_id tid, void **ptr ) { 6a8a4: 4e56 fffc linkw %fp,#-4 6a8a8: 2f02 movel %d2,%sp@- 6a8aa: 242e 000c movel %fp@(12),%d2 Thread_Control *the_thread; Objects_Locations location; rtems_task_variable_t *tvp, *prev; if ( !ptr ) 6a8ae: 6762 beqs 6a912 return RTEMS_INVALID_ADDRESS; prev = NULL; the_thread = _Thread_Get (tid, &location); 6a8b0: 486e fffc pea %fp@(-4) 6a8b4: 2f2e 0008 movel %fp@(8),%sp@- 6a8b8: 4eb9 0004 e478 jsr 4e478 <_Thread_Get> switch (location) { 6a8be: 508f addql #8,%sp 6a8c0: 4aae fffc tstl %fp@(-4) 6a8c4: 663c bnes 6a902 case OBJECTS_LOCAL: tvp = the_thread->task_variables; 6a8c6: 2240 moveal %d0,%a1 6a8c8: 2069 011a moveal %a1@(282),%a0 while (tvp) { 6a8cc: 4a88 tstl %a0 6a8ce: 673c beqs 6a90c if (tvp->ptr == ptr) { 6a8d0: b4a8 0004 cmpl %a0@(4),%d2 6a8d4: 6746 beqs 6a91c else the_thread->task_variables = (rtems_task_variable_t *)tvp->next; _RTEMS_Tasks_Invoke_task_variable_dtor( the_thread, tvp ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; 6a8d6: 2248 moveal %a0,%a1 } prev = tvp; tvp = (rtems_task_variable_t *)tvp->next; 6a8d8: 2050 moveal %a0@,%a0 the_thread = _Thread_Get (tid, &location); switch (location) { case OBJECTS_LOCAL: tvp = the_thread->task_variables; while (tvp) { 6a8da: 4a88 tstl %a0 6a8dc: 672e beqs 6a90c <== ALWAYS TAKEN if (tvp->ptr == ptr) { 6a8de: b4a8 0004 cmpl %a0@(4),%d2 6a8e2: 66f2 bnes 6a8d6 if (prev) prev->next = tvp->next; 6a8e4: 2290 movel %a0@,%a1@ else the_thread->task_variables = (rtems_task_variable_t *)tvp->next; _RTEMS_Tasks_Invoke_task_variable_dtor( the_thread, tvp ); 6a8e6: 2f08 movel %a0,%sp@- 6a8e8: 2f00 movel %d0,%sp@- 6a8ea: 4eb9 0006 a9c4 jsr 6a9c4 <_RTEMS_Tasks_Invoke_task_variable_dtor> _Thread_Enable_dispatch(); 6a8f0: 4eb9 0004 e450 jsr 4e450 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 6a8f6: 508f addql #8,%sp prev->next = tvp->next; else the_thread->task_variables = (rtems_task_variable_t *)tvp->next; _RTEMS_Tasks_Invoke_task_variable_dtor( the_thread, tvp ); _Thread_Enable_dispatch(); 6a8f8: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 6a8fa: 242e fff8 movel %fp@(-8),%d2 6a8fe: 4e5e unlk %fp 6a900: 4e75 rts 6a902: 242e fff8 movel %fp@(-8),%d2 return RTEMS_INVALID_ADDRESS; prev = NULL; the_thread = _Thread_Get (tid, &location); switch (location) { 6a906: 7004 moveq #4,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 6a908: 4e5e unlk %fp 6a90a: 4e75 rts return RTEMS_SUCCESSFUL; } prev = tvp; tvp = (rtems_task_variable_t *)tvp->next; } _Thread_Enable_dispatch(); 6a90c: 4eb9 0004 e450 jsr 4e450 <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 6a912: 242e fff8 movel %fp@(-8),%d2 return RTEMS_SUCCESSFUL; } prev = tvp; tvp = (rtems_task_variable_t *)tvp->next; } _Thread_Enable_dispatch(); 6a916: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 6a918: 4e5e unlk %fp 6a91a: 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; 6a91c: 2240 moveal %d0,%a1 6a91e: 2350 011a movel %a0@,%a1@(282) _RTEMS_Tasks_Invoke_task_variable_dtor( the_thread, tvp ); 6a922: 2f08 movel %a0,%sp@- 6a924: 2f00 movel %d0,%sp@- 6a926: 4eb9 0006 a9c4 jsr 6a9c4 <_RTEMS_Tasks_Invoke_task_variable_dtor> _Thread_Enable_dispatch(); 6a92c: 4eb9 0004 e450 jsr 4e450 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 6a932: 508f addql #8,%sp prev->next = tvp->next; else the_thread->task_variables = (rtems_task_variable_t *)tvp->next; _RTEMS_Tasks_Invoke_task_variable_dtor( the_thread, tvp ); _Thread_Enable_dispatch(); 6a934: 4280 clrl %d0 6a936: 60c2 bras 6a8fa <== ALWAYS TAKEN 0006a938 : rtems_status_code rtems_task_variable_get( rtems_id tid, void **ptr, void **result ) { 6a938: 4e56 fffc linkw %fp,#-4 6a93c: 2f0a movel %a2,%sp@- 6a93e: 246e 0010 moveal %fp@(16),%a2 6a942: 2f02 movel %d2,%sp@- 6a944: 242e 000c movel %fp@(12),%d2 Thread_Control *the_thread; Objects_Locations location; rtems_task_variable_t *tvp; if ( !ptr ) 6a948: 6752 beqs 6a99c return RTEMS_INVALID_ADDRESS; if ( !result ) 6a94a: 4a8a tstl %a2 6a94c: 674e beqs 6a99c return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get (tid, &location); 6a94e: 486e fffc pea %fp@(-4) 6a952: 2f2e 0008 movel %fp@(8),%sp@- 6a956: 4eb9 0004 e478 jsr 4e478 <_Thread_Get> switch (location) { 6a95c: 508f addql #8,%sp 6a95e: 4aae fffc tstl %fp@(-4) 6a962: 662a bnes 6a98e case OBJECTS_LOCAL: /* * Figure out if the variable is in this task's list. */ tvp = the_thread->task_variables; 6a964: 2240 moveal %d0,%a1 6a966: 2069 011a moveal %a1@(282),%a0 while (tvp) { 6a96a: 4a88 tstl %a0 6a96c: 670c beqs 6a97a if (tvp->ptr == ptr) { 6a96e: b4a8 0004 cmpl %a0@(4),%d2 6a972: 6736 beqs 6a9aa */ *result = tvp->tval; _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } tvp = (rtems_task_variable_t *)tvp->next; 6a974: 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) { 6a976: 4a88 tstl %a0 6a978: 66f4 bnes 6a96e <== NEVER TAKEN _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } tvp = (rtems_task_variable_t *)tvp->next; } _Thread_Enable_dispatch(); 6a97a: 4eb9 0004 e450 jsr 4e450 <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 6a980: 242e fff4 movel %fp@(-12),%d2 _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } tvp = (rtems_task_variable_t *)tvp->next; } _Thread_Enable_dispatch(); 6a984: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 6a986: 246e fff8 moveal %fp@(-8),%a2 6a98a: 4e5e unlk %fp 6a98c: 4e75 rts 6a98e: 242e fff4 movel %fp@(-12),%d2 if ( !result ) return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get (tid, &location); switch (location) { 6a992: 7004 moveq #4,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 6a994: 246e fff8 moveal %fp@(-8),%a2 6a998: 4e5e unlk %fp 6a99a: 4e75 rts 6a99c: 242e fff4 movel %fp@(-12),%d2 return RTEMS_SUCCESSFUL; } tvp = (rtems_task_variable_t *)tvp->next; } _Thread_Enable_dispatch(); return RTEMS_INVALID_ADDRESS; 6a9a0: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 6a9a2: 246e fff8 moveal %fp@(-8),%a2 6a9a6: 4e5e unlk %fp 6a9a8: 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; 6a9aa: 24a8 000c movel %a0@(12),%a2@ _Thread_Enable_dispatch(); 6a9ae: 4eb9 0004 e450 jsr 4e450 <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 6a9b4: 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(); 6a9b8: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 6a9ba: 246e fff8 moveal %fp@(-8),%a2 6a9be: 4e5e unlk %fp 6a9c0: 4e75 rts ... 000471e4 : */ rtems_status_code rtems_task_wake_when( rtems_time_of_day *time_buffer ) { 471e4: 4e56 fffc linkw %fp,#-4 471e8: 2f0a movel %a2,%sp@- 471ea: 246e 0008 moveal %fp@(8),%a2 Watchdog_Interval seconds; if ( !_TOD_Is_set ) 471ee: 4a39 0006 0ac0 tstb 60ac0 <_TOD_Is_set> 471f4: 6700 00aa beqw 472a0 return RTEMS_NOT_DEFINED; if ( !time_buffer ) 471f8: 4a8a tstl %a2 471fa: 6700 00ae beqw 472aa <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; time_buffer->ticks = 0; 471fe: 42aa 0018 clrl %a2@(24) if ( !_TOD_Validate( time_buffer ) ) 47202: 2f0a movel %a2,%sp@- 47204: 4eb9 0004 64f0 jsr 464f0 <_TOD_Validate> 4720a: 588f addql #4,%sp 4720c: 4a00 tstb %d0 4720e: 660a bnes 4721a &_Thread_Executing->Timer, seconds - _TOD_Seconds_since_epoch() ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 47210: 246e fff8 moveal %fp@(-8),%a2 _Watchdog_Insert_seconds( &_Thread_Executing->Timer, seconds - _TOD_Seconds_since_epoch() ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; 47214: 7014 moveq #20,%d0 } 47216: 4e5e unlk %fp 47218: 4e75 rts time_buffer->ticks = 0; if ( !_TOD_Validate( time_buffer ) ) return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( time_buffer ); 4721a: 2f0a movel %a2,%sp@- 4721c: 4eb9 0004 63e0 jsr 463e0 <_TOD_To_seconds> if ( seconds <= _TOD_Seconds_since_epoch() ) 47222: 588f addql #4,%sp 47224: b0b9 0006 0b3e cmpl 60b3e <_TOD_Now>,%d0 4722a: 63e4 blss 47210 4722c: 2239 0006 0aac movel 60aac <_Thread_Dispatch_disable_level>,%d1 47232: 5281 addql #1,%d1 47234: 23c1 0006 0aac movel %d1,60aac <_Thread_Dispatch_disable_level> return RTEMS_INVALID_CLOCK; _Thread_Disable_dispatch(); _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_TIME ); 4723a: 4878 0010 pea 10 4723e: 2f39 0006 0b66 movel 60b66 <_Thread_Executing>,%sp@- 47244: 2d40 fffc movel %d0,%fp@(-4) 47248: 4eb9 0004 9764 jsr 49764 <_Thread_Set_state> _Watchdog_Initialize( &_Thread_Executing->Timer, _Thread_Delay_ended, _Thread_Executing->Object.id, 4724e: 2079 0006 0b66 moveal 60b66 <_Thread_Executing>,%a0 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 47254: 223c 0004 8c7c movel #298108,%d1 4725a: 2141 0064 movel %d1,%a0@(100) if ( seconds <= _TOD_Seconds_since_epoch() ) return RTEMS_INVALID_CLOCK; _Thread_Disable_dispatch(); _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_TIME ); _Watchdog_Initialize( 4725e: 2228 0008 movel %a0@(8),%d1 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 47262: 202e fffc movel %fp@(-4),%d0 void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; 47266: 2141 0068 movel %d1,%a0@(104) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 4726a: 90b9 0006 0b3e subl 60b3e <_TOD_Now>,%d0 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 47270: 42a8 0050 clrl %a0@(80) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 47274: 2140 0054 movel %d0,%a0@(84) ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 47278: 42a8 006c clrl %a0@(108) ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Seconds_chain, the_watchdog ); 4727c: 4868 0048 pea %a0@(72) 47280: 4879 0006 0b78 pea 60b78 <_Watchdog_Seconds_chain> 47286: 4eb9 0004 a034 jsr 4a034 <_Watchdog_Insert> ); _Watchdog_Insert_seconds( &_Thread_Executing->Timer, seconds - _TOD_Seconds_since_epoch() ); _Thread_Enable_dispatch(); 4728c: 4eb9 0004 8e10 jsr 48e10 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; } 47292: 246e fff8 moveal %fp@(-8),%a2 _Watchdog_Insert_seconds( &_Thread_Executing->Timer, seconds - _TOD_Seconds_since_epoch() ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; 47296: 4fef 0010 lea %sp@(16),%sp ); _Watchdog_Insert_seconds( &_Thread_Executing->Timer, seconds - _TOD_Seconds_since_epoch() ); _Thread_Enable_dispatch(); 4729a: 4280 clrl %d0 return RTEMS_SUCCESSFUL; } 4729c: 4e5e unlk %fp 4729e: 4e75 rts 472a0: 246e fff8 moveal %fp@(-8),%a2 rtems_time_of_day *time_buffer ) { Watchdog_Interval seconds; if ( !_TOD_Is_set ) 472a4: 700b moveq #11,%d0 &_Thread_Executing->Timer, seconds - _TOD_Seconds_since_epoch() ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 472a6: 4e5e unlk %fp 472a8: 4e75 rts 472aa: 246e fff8 moveal %fp@(-8),%a2 Watchdog_Interval seconds; if ( !_TOD_Is_set ) return RTEMS_NOT_DEFINED; if ( !time_buffer ) 472ae: 7009 moveq #9,%d0 &_Thread_Executing->Timer, seconds - _TOD_Seconds_since_epoch() ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 472b0: 4e5e unlk %fp 472b2: 4e75 rts 0005840c : */ rtems_status_code rtems_timer_cancel( rtems_id id ) { 5840c: 4e56 fffc linkw %fp,#-4 RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Get ( Objects_Id id, Objects_Locations *location ) { return (Timer_Control *) 58410: 486e fffc pea %fp@(-4) 58414: 2f2e 0008 movel %fp@(8),%sp@- 58418: 4879 0007 eab4 pea 7eab4 <_Timer_Information> 5841e: 4eb9 0005 b248 jsr 5b248 <_Objects_Get> Timer_Control *the_timer; Objects_Locations location; the_timer = _Timer_Get( id, &location ); switch ( location ) { 58424: 4fef 000c lea %sp@(12),%sp 58428: 4aae fffc tstl %fp@(-4) 5842c: 6706 beqs 58434 5842e: 7004 moveq #4,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 58430: 4e5e unlk %fp 58432: 4e75 rts the_timer = _Timer_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: if ( !_Timer_Is_dormant_class( the_timer->the_class ) ) 58434: 7204 moveq #4,%d1 58436: 2040 moveal %d0,%a0 58438: b2a8 0038 cmpl %a0@(56),%d1 5843c: 670c beqs 5844a <== ALWAYS TAKEN (void) _Watchdog_Remove( &the_timer->Ticker ); 5843e: 4868 0010 pea %a0@(16) 58442: 4eb9 0005 d188 jsr 5d188 <_Watchdog_Remove> 58448: 588f addql #4,%sp _Thread_Enable_dispatch(); 5844a: 4eb9 0005 bb64 jsr 5bb64 <_Thread_Enable_dispatch> 58450: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 58452: 4e5e unlk %fp 58454: 4e75 rts ... 00046634 : rtems_id id, rtems_interval ticks, rtems_timer_service_routine_entry routine, void *user_data ) { 46634: 4e56 ffe8 linkw %fp,#-24 46638: 48d7 043c moveml %d2-%d5/%a2,%sp@ 4663c: 282e 0008 movel %fp@(8),%d4 46640: 242e 000c movel %fp@(12),%d2 46644: 262e 0010 movel %fp@(16),%d3 Timer_Control *the_timer; Objects_Locations location; ISR_Level level; if ( ticks == 0 ) 46648: 4a82 tstl %d2 4664a: 6700 0094 beqw 466e0 return RTEMS_INVALID_NUMBER; if ( !routine ) 4664e: 4a83 tstl %d3 46650: 6700 00ae beqw 46700 RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Get ( Objects_Id id, Objects_Locations *location ) { return (Timer_Control *) 46654: 486e fffc pea %fp@(-4) 46658: 2f04 movel %d4,%sp@- 4665a: 4879 0006 01c2 pea 601c2 <_Timer_Information> 46660: 4eb9 0004 7924 jsr 47924 <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_timer = _Timer_Get( id, &location ); switch ( location ) { 46666: 4fef 000c lea %sp@(12),%sp 4666a: 2440 moveal %d0,%a2 4666c: 4aae fffc tstl %fp@(-4) 46670: 6662 bnes 466d4 case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); 46672: 2a00 movel %d0,%d5 46674: 0685 0000 0010 addil #16,%d5 4667a: 2f05 movel %d5,%sp@- 4667c: 4eb9 0004 940c jsr 4940c <_Watchdog_Remove> _ISR_Disable( level ); 46682: 203c 0000 0700 movel #1792,%d0 46688: 40c1 movew %sr,%d1 4668a: 8081 orl %d1,%d0 4668c: 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_timer->Ticker.state != WATCHDOG_INACTIVE ) { 4668e: 588f addql #4,%sp 46690: 4aaa 0018 tstl %a2@(24) 46694: 6656 bnes 466ec <== ALWAYS TAKEN Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 46696: 2543 002c movel %d3,%a2@(44) the_watchdog->id = id; the_watchdog->user_data = user_data; 4669a: 256e 0014 0034 movel %fp@(20),%a2@(52) void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; 466a0: 2544 0030 movel %d4,%a2@(48) /* * OK. Now we now the timer was not rescheduled by an interrupt * so we can atomically initialize it as in use. */ the_timer->the_class = TIMER_INTERVAL; 466a4: 42aa 0038 clrl %a2@(56) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 466a8: 42aa 0018 clrl %a2@(24) _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); _ISR_Enable( level ); 466ac: 46c1 movew %d1,%sr Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 466ae: 2542 001c movel %d2,%a2@(28) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 466b2: 2f05 movel %d5,%sp@- 466b4: 4879 0005 fa70 pea 5fa70 <_Watchdog_Ticks_chain> 466ba: 4eb9 0004 92c4 jsr 492c4 <_Watchdog_Insert> _Watchdog_Insert_ticks( &the_timer->Ticker, ticks ); _Thread_Enable_dispatch(); 466c0: 4eb9 0004 8134 jsr 48134 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 466c6: 508f addql #8,%sp _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); _ISR_Enable( level ); _Watchdog_Insert_ticks( &the_timer->Ticker, ticks ); _Thread_Enable_dispatch(); 466c8: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 466ca: 4cee 043c ffe8 moveml %fp@(-24),%d2-%d5/%a2 466d0: 4e5e unlk %fp 466d2: 4e75 rts if ( !routine ) return RTEMS_INVALID_ADDRESS; the_timer = _Timer_Get( id, &location ); switch ( location ) { 466d4: 7004 moveq #4,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 466d6: 4cee 043c ffe8 moveml %fp@(-24),%d2-%d5/%a2 466dc: 4e5e unlk %fp 466de: 4e75 rts { Timer_Control *the_timer; Objects_Locations location; ISR_Level level; if ( ticks == 0 ) 466e0: 700a moveq #10,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 466e2: 4cee 043c ffe8 moveml %fp@(-24),%d2-%d5/%a2 466e8: 4e5e unlk %fp 466ea: 4e75 rts * Check to see if the watchdog has just been inserted by a * higher priority interrupt. If so, abandon this insert. */ if ( the_timer->Ticker.state != WATCHDOG_INACTIVE ) { _ISR_Enable( level ); 466ec: 46c1 movew %d1,%sr _Thread_Enable_dispatch(); 466ee: 4eb9 0004 8134 jsr 48134 <_Thread_Enable_dispatch> 466f4: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 466f6: 4cee 043c ffe8 moveml %fp@(-24),%d2-%d5/%a2 466fc: 4e5e unlk %fp 466fe: 4e75 rts ISR_Level level; if ( ticks == 0 ) return RTEMS_INVALID_NUMBER; if ( !routine ) 46700: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 46702: 4cee 043c ffe8 moveml %fp@(-24),%d2-%d5/%a2 46708: 4e5e unlk %fp 4670a: 4e75 rts 00058a58 : rtems_status_code rtems_timer_initiate_server( uint32_t priority, uint32_t stack_size, rtems_attribute attribute_set ) { 58a58: 4e56 fffc linkw %fp,#-4 58a5c: 202e 0008 movel %fp@(8),%d0 58a60: 2f03 movel %d3,%sp@- 58a62: 2f02 movel %d2,%sp@- 58a64: 4a80 tstl %d0 58a66: 6748 beqs 58ab0 58a68: 4281 clrl %d1 58a6a: 1239 0007 86e2 moveb 786e2 ,%d1 58a70: b280 cmpl %d0,%d1 58a72: 644a bccs 58abe * structured so we check it is invalid before looking for * a specific invalid value as the default. */ _priority = priority; if ( !_RTEMS_tasks_Priority_is_valid( priority ) ) { if ( priority != RTEMS_TIMER_SERVER_DEFAULT_PRIORITY ) 58a74: 72ff moveq #-1,%d1 58a76: b280 cmpl %d0,%d1 58a78: 6636 bnes 58ab0 58a7a: 2239 0007 e248 movel 7e248 <_Thread_Dispatch_disable_level>,%d1 58a80: 5281 addql #1,%d1 58a82: 4283 clrl %d3 58a84: 23c1 0007 e248 movel %d1,7e248 <_Thread_Dispatch_disable_level> /* * Just to make sure this is only called once. */ _Thread_Disable_dispatch(); tmpInitialized = initialized; initialized = true; 58a8a: 7001 moveq #1,%d0 /* * Just to make sure this is only called once. */ _Thread_Disable_dispatch(); tmpInitialized = initialized; 58a8c: 1439 0007 9694 moveb 79694 ,%d2 initialized = true; 58a92: 13c0 0007 9694 moveb %d0,79694 _Thread_Enable_dispatch(); 58a98: 4eb9 0005 bb64 jsr 5bb64 <_Thread_Enable_dispatch> if ( tmpInitialized ) 58a9e: 4a02 tstb %d2 58aa0: 6744 beqs 58ae6 initialized = false; } #endif return status; } 58aa2: 242e fff4 movel %fp@(-12),%d2 _Thread_Disable_dispatch(); tmpInitialized = initialized; initialized = true; _Thread_Enable_dispatch(); if ( tmpInitialized ) 58aa6: 700e moveq #14,%d0 initialized = false; } #endif return status; } 58aa8: 262e fff8 movel %fp@(-8),%d3 58aac: 4e5e unlk %fp 58aae: 4e75 rts 58ab0: 242e fff4 movel %fp@(-12),%d2 if (status) { initialized = false; } #endif return status; 58ab4: 7013 moveq #19,%d0 } 58ab6: 262e fff8 movel %fp@(-8),%d3 58aba: 4e5e unlk %fp 58abc: 4e75 rts 58abe: 2239 0007 e248 movel 7e248 <_Thread_Dispatch_disable_level>,%d1 58ac4: 5281 addql #1,%d1 58ac6: 2600 movel %d0,%d3 58ac8: 23c1 0007 e248 movel %d1,7e248 <_Thread_Dispatch_disable_level> /* * Just to make sure this is only called once. */ _Thread_Disable_dispatch(); tmpInitialized = initialized; initialized = true; 58ace: 7001 moveq #1,%d0 /* * Just to make sure this is only called once. */ _Thread_Disable_dispatch(); tmpInitialized = initialized; 58ad0: 1439 0007 9694 moveb 79694 ,%d2 initialized = true; 58ad6: 13c0 0007 9694 moveb %d0,79694 _Thread_Enable_dispatch(); 58adc: 4eb9 0005 bb64 jsr 5bb64 <_Thread_Enable_dispatch> if ( tmpInitialized ) 58ae2: 4a02 tstb %d2 58ae4: 66bc bnes 58aa2 <== ALWAYS TAKEN * other library rules. For example, if using a TSR written in Ada the * Server should run at the same priority as the priority Ada task. * Otherwise, the priority ceiling for the mutex used to protect the * GNAT run-time is violated. */ status = rtems_task_create( 58ae6: 486e fffc pea %fp@(-4) 58aea: 222e 0010 movel %fp@(16),%d1 58aee: 08c1 000f bset #15,%d1 58af2: 2f01 movel %d1,%sp@- 58af4: 4878 0100 pea 100 58af8: 2f2e 000c movel %fp@(12),%sp@- 58afc: 2f03 movel %d3,%sp@- 58afe: 2f3c 5449 4d45 movel #1414090053,%sp@- 58b04: 4eb9 0005 7aec jsr 57aec /* user may want floating point but we need */ /* system task specified for 0 priority */ attribute_set | RTEMS_SYSTEM_TASK, &id /* get the id back */ ); if (status) { 58b0a: 4fef 0018 lea %sp@(24),%sp 58b0e: 4a80 tstl %d0 58b10: 6714 beqs 58b26 initialized = false; } #endif return status; } 58b12: 242e fff4 movel %fp@(-12),%d2 /* system task specified for 0 priority */ attribute_set | RTEMS_SYSTEM_TASK, &id /* get the id back */ ); if (status) { initialized = false; 58b16: 4201 clrb %d1 initialized = false; } #endif return status; } 58b18: 262e fff8 movel %fp@(-8),%d3 58b1c: 4e5e unlk %fp /* system task specified for 0 priority */ attribute_set | RTEMS_SYSTEM_TASK, &id /* get the id back */ ); if (status) { initialized = false; 58b1e: 13c1 0007 9694 moveb %d1,79694 initialized = false; } #endif return status; } 58b24: 4e75 rts */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 58b26: 41f9 0007 96ca lea 796ca <_Timer_server_Default+0x34>,%a0 /* * We work with the TCB pointer, not the ID, so we need to convert * to a TCB pointer from here out. */ ts->thread = (Thread_Control *)_Objects_Get_local_object( 58b2c: 4282 clrl %d2 the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 58b2e: 223c 0007 96c6 movel #497350,%d1 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 58b34: 23c8 0007 96c6 movel %a0,796c6 <_Timer_server_Default+0x30> &_RTEMS_tasks_Information, _Objects_Get_index(id) 58b3a: 202e fffc movel %fp@(-4),%d0 58b3e: 41f9 0007 9702 lea 79702 <_Timer_server_Default+0x6c>,%a0 58b44: 23c8 0007 96fe movel %a0,796fe <_Timer_server_Default+0x68> /* * We work with the TCB pointer, not the ID, so we need to convert * to a TCB pointer from here out. */ ts->thread = (Thread_Control *)_Objects_Get_local_object( 58b4a: 2079 0007 e1d2 moveal 7e1d2 <_RTEMS_tasks_Information+0x18>,%a0 58b50: 3400 movew %d0,%d2 the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 58b52: 23c1 0007 96ce movel %d1,796ce <_Timer_server_Default+0x38> * Initialize the pointer to the timer schedule method so applications that * do not use the Timer Server do not have to pull it in. */ ts->schedule_operation = _Timer_server_Schedule_operation_method; ts->Interval_watchdogs.last_snapshot = _Watchdog_Ticks_since_boot; 58b58: 2239 0007 e38c movel 7e38c <_Watchdog_Ticks_since_boot>,%d1 /* * We work with the TCB pointer, not the ID, so we need to convert * to a TCB pointer from here out. */ ts->thread = (Thread_Control *)_Objects_Get_local_object( 58b5e: 41f0 2c00 lea %a0@(00000000,%d2:l:4),%a0 58b62: 23d0 0007 9696 movel %a0@,79696 <_Timer_server_Default> 58b68: 41f9 0007 96fe lea 796fe <_Timer_server_Default+0x68>,%a0 58b6e: 23c8 0007 9706 movel %a0,79706 <_Timer_server_Default+0x70> _Timer_server = ts; /* * Start the timer server */ status = rtems_task_start( 58b74: 4879 0007 9696 pea 79696 <_Timer_server_Default> the_watchdog->routine = routine; 58b7a: 41f9 0005 b9d0 lea 5b9d0 <_Thread_Delay_ended>,%a0 58b80: 23c8 0007 96ba movel %a0,796ba <_Timer_server_Default+0x24> 58b86: 487a 0160 pea %pc@(58ce8 <_Timer_server_Body>) 58b8a: 23c8 0007 96f2 movel %a0,796f2 <_Timer_server_Default+0x5c> * do not use the Timer Server do not have to pull it in. */ ts->schedule_operation = _Timer_server_Schedule_operation_method; ts->Interval_watchdogs.last_snapshot = _Watchdog_Ticks_since_boot; ts->TOD_watchdogs.last_snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 58b90: 41f9 0007 e2da lea 7e2da <_TOD_Now>,%a0 * Initialize the pointer to the timer schedule method so applications that * do not use the Timer Server do not have to pull it in. */ ts->schedule_operation = _Timer_server_Schedule_operation_method; ts->Interval_watchdogs.last_snapshot = _Watchdog_Ticks_since_boot; 58b96: 23c1 0007 96d2 movel %d1,796d2 <_Timer_server_Default+0x3c> ts->TOD_watchdogs.last_snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 58b9c: 23d0 0007 970a movel %a0@,7970a <_Timer_server_Default+0x74> /* * Initialize the pointer to the timer schedule method so applications that * do not use the Timer Server do not have to pull it in. */ ts->schedule_operation = _Timer_server_Schedule_operation_method; 58ba2: 223c 0005 8f24 movel #364324,%d1 ts->active = false; /* * The default timer server is now available. */ _Timer_server = ts; 58ba8: 41f9 0007 9696 lea 79696 <_Timer_server_Default>,%a0 /* * Initialize the pointer to the timer schedule method so applications that * do not use the Timer Server do not have to pull it in. */ ts->schedule_operation = _Timer_server_Schedule_operation_method; 58bae: 23c1 0007 969a movel %d1,7969a <_Timer_server_Default+0x4> ts->Interval_watchdogs.last_snapshot = _Watchdog_Ticks_since_boot; ts->TOD_watchdogs.last_snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); ts->insert_chain = NULL; ts->active = false; 58bb4: 4201 clrb %d1 ts->schedule_operation = _Timer_server_Schedule_operation_method; ts->Interval_watchdogs.last_snapshot = _Watchdog_Ticks_since_boot; ts->TOD_watchdogs.last_snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); ts->insert_chain = NULL; 58bb6: 42b9 0007 970e clrl 7970e <_Timer_server_Default+0x78> ts->active = false; 58bbc: 13c1 0007 9712 moveb %d1,79712 <_Timer_server_Default+0x7c> _Timer_server = ts; /* * Start the timer server */ status = rtems_task_start( 58bc2: 2f00 movel %d0,%sp@- ts->active = false; /* * The default timer server is now available. */ _Timer_server = ts; 58bc4: 23c8 0007 eaee movel %a0,7eaee <_Timer_server> RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 58bca: 42b9 0007 96ca clrl 796ca <_Timer_server_Default+0x34> 58bd0: 42b9 0007 9702 clrl 79702 <_Timer_server_Default+0x6c> Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 58bd6: 42b9 0007 96a6 clrl 796a6 <_Timer_server_Default+0x10> the_watchdog->routine = routine; the_watchdog->id = id; 58bdc: 23c0 0007 96be movel %d0,796be <_Timer_server_Default+0x28> the_watchdog->user_data = user_data; 58be2: 42b9 0007 96c2 clrl 796c2 <_Timer_server_Default+0x2c> Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 58be8: 42b9 0007 96de clrl 796de <_Timer_server_Default+0x48> the_watchdog->routine = routine; the_watchdog->id = id; 58bee: 23c0 0007 96f6 movel %d0,796f6 <_Timer_server_Default+0x60> the_watchdog->user_data = user_data; 58bf4: 42b9 0007 96fa clrl 796fa <_Timer_server_Default+0x64> /* * Start the timer server */ status = rtems_task_start( 58bfa: 4eb9 0005 81f4 jsr 581f4 initialized = false; } #endif return status; } 58c00: 242e fff4 movel %fp@(-12),%d2 if (status) { initialized = false; } #endif return status; 58c04: 4fef 000c lea %sp@(12),%sp } 58c08: 262e fff8 movel %fp@(-8),%d3 58c0c: 4e5e unlk %fp 58c0e: 4e75 rts 000587cc : */ rtems_status_code rtems_timer_reset( rtems_id id ) { 587cc: 4e56 fff0 linkw %fp,#-16 587d0: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 587d4: 486e fffc pea %fp@(-4) 587d8: 2f2e 0008 movel %fp@(8),%sp@- 587dc: 4879 0007 eab4 pea 7eab4 <_Timer_Information> 587e2: 4eb9 0005 b248 jsr 5b248 <_Objects_Get> Timer_Control *the_timer; Objects_Locations location; rtems_status_code status = RTEMS_SUCCESSFUL; the_timer = _Timer_Get( id, &location ); switch ( location ) { 587e8: 4fef 000c lea %sp@(12),%sp 587ec: 2440 moveal %d0,%a2 587ee: 4aae fffc tstl %fp@(-4) 587f2: 670e beqs 58802 587f4: 7404 moveq #4,%d2 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 587f6: 2002 movel %d2,%d0 587f8: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3 587fe: 4e5e unlk %fp 58800: 4e75 rts the_timer = _Timer_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: if ( the_timer->the_class == TIMER_INTERVAL ) { 58802: 202a 0038 movel %a2@(56),%d0 58806: 671a beqs 58822 _Watchdog_Remove( &the_timer->Ticker ); _Watchdog_Insert( &_Watchdog_Ticks_chain, &the_timer->Ticker ); } else if ( the_timer->the_class == TIMER_INTERVAL_ON_TASK ) { 58808: 7201 moveq #1,%d1 5880a: b280 cmpl %d0,%d1 5880c: 673c beqs 5884a 5880e: 740b moveq #11,%d2 * TIMER_TIME_OF_DAY, or TIMER_TIME_OF_DAY_ON_TASK). We * can only reset active interval timers. */ status = RTEMS_NOT_DEFINED; } _Thread_Enable_dispatch(); 58810: 4eb9 0005 bb64 jsr 5bb64 <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 58816: 2002 movel %d2,%d0 58818: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3 5881e: 4e5e unlk %fp 58820: 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 ); 58822: 45ea 0010 lea %a2@(16),%a2 _Watchdog_Insert( &_Watchdog_Ticks_chain, &the_timer->Ticker ); 58826: 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 ); 58828: 2f0a movel %a2,%sp@- 5882a: 4eb9 0005 d188 jsr 5d188 <_Watchdog_Remove> _Watchdog_Insert( &_Watchdog_Ticks_chain, &the_timer->Ticker ); 58830: 2f0a movel %a2,%sp@- 58832: 4879 0007 e320 pea 7e320 <_Watchdog_Ticks_chain> 58838: 4eb9 0005 d040 jsr 5d040 <_Watchdog_Insert> 5883e: 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(); 58842: 4eb9 0005 bb64 jsr 5bb64 <_Thread_Enable_dispatch> 58848: 60cc bras 58816 <== ALWAYS TAKEN if ( !timer_server ) { _Thread_Enable_dispatch(); return RTEMS_INCORRECT_STATE; } #endif _Watchdog_Remove( &the_timer->Ticker ); 5884a: 486a 0010 pea %a2@(16) (*timer_server->schedule_operation)( timer_server, the_timer ); 5884e: 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; 58850: 2679 0007 eaee moveal 7eaee <_Timer_server>,%a3 if ( !timer_server ) { _Thread_Enable_dispatch(); return RTEMS_INCORRECT_STATE; } #endif _Watchdog_Remove( &the_timer->Ticker ); 58856: 4eb9 0005 d188 jsr 5d188 <_Watchdog_Remove> (*timer_server->schedule_operation)( timer_server, the_timer ); 5885c: 2f0a movel %a2,%sp@- 5885e: 2f0b movel %a3,%sp@- 58860: 206b 0004 moveal %a3@(4),%a0 58864: 4e90 jsr %a0@ 58866: 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(); 5886a: 4eb9 0005 bb64 jsr 5bb64 <_Thread_Enable_dispatch> 58870: 60a4 bras 58816 <== ALWAYS TAKEN ... 0005895c : rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ) { 5895c: 4e56 ffec linkw %fp,#-20 58960: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ 58964: 242e 000c movel %fp@(12),%d2 58968: 262e 0010 movel %fp@(16),%d3 Timer_Control *the_timer; Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; 5896c: 2479 0007 eaee moveal 7eaee <_Timer_server>,%a2 if ( !timer_server ) 58972: 4a8a tstl %a2 58974: 6700 00c8 beqw 58a3e return RTEMS_INCORRECT_STATE; if ( !_TOD_Is_set ) 58978: 4a39 0007 e25c tstb 7e25c <_TOD_Is_set> 5897e: 6700 00a6 beqw 58a26 <== ALWAYS TAKEN return RTEMS_NOT_DEFINED; if ( !routine ) 58982: 4a83 tstl %d3 58984: 6700 00ac beqw 58a32 return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) 58988: 2f02 movel %d2,%sp@- 5898a: 4eb9 0005 5630 jsr 55630 <_TOD_Validate> 58990: 588f addql #4,%sp 58992: 4a00 tstb %d0 58994: 660c bnes 589a2 the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); (*timer_server->schedule_operation)( timer_server, the_timer ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; 58996: 7014 moveq #20,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 58998: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3 5899e: 4e5e unlk %fp 589a0: 4e75 rts return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 589a2: 2f02 movel %d2,%sp@- 589a4: 4eb9 0005 5520 jsr 55520 <_TOD_To_seconds> if ( seconds <= _TOD_Seconds_since_epoch() ) 589aa: 588f addql #4,%sp return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 589ac: 2400 movel %d0,%d2 if ( seconds <= _TOD_Seconds_since_epoch() ) 589ae: b0b9 0007 e2da cmpl 7e2da <_TOD_Now>,%d0 589b4: 63e0 blss 58996 589b6: 486e fffc pea %fp@(-4) 589ba: 2f2e 0008 movel %fp@(8),%sp@- 589be: 4879 0007 eab4 pea 7eab4 <_Timer_Information> 589c4: 4eb9 0005 b248 jsr 5b248 <_Objects_Get> return RTEMS_INVALID_CLOCK; the_timer = _Timer_Get( id, &location ); switch ( location ) { 589ca: 4fef 000c lea %sp@(12),%sp 589ce: 2640 moveal %d0,%a3 589d0: 4aae fffc tstl %fp@(-4) 589d4: 6674 bnes 58a4a case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); 589d6: 486b 0010 pea %a3@(16) 589da: 4eb9 0005 d188 jsr 5d188 <_Watchdog_Remove> the_watchdog->routine = routine; the_watchdog->id = id; 589e0: 202e 0008 movel %fp@(8),%d0 589e4: 2740 0030 movel %d0,%a3@(48) the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK; _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); 589e8: 94b9 0007 e2da subl 7e2da <_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; 589ee: 7003 moveq #3,%d0 the_watchdog->user_data = user_data; 589f0: 276e 0014 0034 movel %fp@(20),%a3@(52) 589f6: 2740 0038 movel %d0,%a3@(56) _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); 589fa: 2742 001c movel %d2,%a3@(28) Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 589fe: 2743 002c movel %d3,%a3@(44) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 58a02: 42ab 0018 clrl %a3@(24) (*timer_server->schedule_operation)( timer_server, the_timer ); 58a06: 2f0b movel %a3,%sp@- 58a08: 2f0a movel %a2,%sp@- 58a0a: 206a 0004 moveal %a2@(4),%a0 58a0e: 4e90 jsr %a0@ _Thread_Enable_dispatch(); 58a10: 4eb9 0005 bb64 jsr 5bb64 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 58a16: 4fef 000c lea %sp@(12),%sp _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); (*timer_server->schedule_operation)( timer_server, the_timer ); _Thread_Enable_dispatch(); 58a1a: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 58a1c: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3 58a22: 4e5e unlk %fp 58a24: 4e75 rts Timer_server_Control *timer_server = _Timer_server; if ( !timer_server ) return RTEMS_INCORRECT_STATE; if ( !_TOD_Is_set ) 58a26: 700b moveq #11,%d0 <== NOT EXECUTED case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 58a28: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3 <== NOT EXECUTED 58a2e: 4e5e unlk %fp <== NOT EXECUTED 58a30: 4e75 rts <== NOT EXECUTED return RTEMS_INCORRECT_STATE; if ( !_TOD_Is_set ) return RTEMS_NOT_DEFINED; if ( !routine ) 58a32: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 58a34: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3 58a3a: 4e5e unlk %fp 58a3c: 4e75 rts Timer_Control *the_timer; Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; if ( !timer_server ) 58a3e: 700e moveq #14,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 58a40: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3 58a46: 4e5e unlk %fp 58a48: 4e75 rts seconds = _TOD_To_seconds( wall_time ); if ( seconds <= _TOD_Seconds_since_epoch() ) return RTEMS_INVALID_CLOCK; the_timer = _Timer_Get( id, &location ); switch ( location ) { 58a4a: 7004 moveq #4,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 58a4c: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3 58a52: 4e5e unlk %fp 58a54: 4e75 rts ... 00046840 : int sched_rr_get_interval( pid_t pid, struct timespec *interval ) { 46840: 4e56 0000 linkw %fp,#0 46844: 2f03 movel %d3,%sp@- 46846: 262e 0008 movel %fp@(8),%d3 4684a: 2f02 movel %d2,%sp@- 4684c: 242e 000c movel %fp@(12),%d2 /* * Only supported for the "calling process" (i.e. this node). */ if ( pid && pid != getpid() ) 46850: 4a83 tstl %d3 46852: 6622 bnes 46876 <== NEVER TAKEN rtems_set_errno_and_return_minus_one( ESRCH ); if ( !interval ) 46854: 4a82 tstl %d2 46856: 6742 beqs 4689a rtems_set_errno_and_return_minus_one( EINVAL ); _Timespec_From_ticks( _Thread_Ticks_per_timeslice, interval ); 46858: 2f02 movel %d2,%sp@- 4685a: 2f39 0006 04d4 movel 604d4 <_Thread_Ticks_per_timeslice>,%sp@- 46860: 4eb9 0004 9f9c jsr 49f9c <_Timespec_From_ticks> return 0; } 46866: 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; 4686a: 508f addql #8,%sp rtems_set_errno_and_return_minus_one( ESRCH ); if ( !interval ) rtems_set_errno_and_return_minus_one( EINVAL ); _Timespec_From_ticks( _Thread_Ticks_per_timeslice, interval ); 4686c: 4280 clrl %d0 return 0; } 4686e: 262e fffc movel %fp@(-4),%d3 46872: 4e5e unlk %fp 46874: 4e75 rts { /* * Only supported for the "calling process" (i.e. this node). */ if ( pid && pid != getpid() ) 46876: 4eb9 0004 3134 jsr 43134 4687c: b680 cmpl %d0,%d3 4687e: 67d4 beqs 46854 rtems_set_errno_and_return_minus_one( ESRCH ); 46880: 4eb9 0004 fd30 jsr 4fd30 <__errno> 46886: 7403 moveq #3,%d2 46888: 2040 moveal %d0,%a0 4688a: 70ff moveq #-1,%d0 4688c: 2082 movel %d2,%a0@ if ( !interval ) rtems_set_errno_and_return_minus_one( EINVAL ); _Timespec_From_ticks( _Thread_Ticks_per_timeslice, interval ); return 0; } 4688e: 242e fff8 movel %fp@(-8),%d2 46892: 262e fffc movel %fp@(-4),%d3 46896: 4e5e unlk %fp 46898: 4e75 rts if ( pid && pid != getpid() ) rtems_set_errno_and_return_minus_one( ESRCH ); if ( !interval ) rtems_set_errno_and_return_minus_one( EINVAL ); 4689a: 4eb9 0004 fd30 jsr 4fd30 <__errno> _Timespec_From_ticks( _Thread_Ticks_per_timeslice, interval ); return 0; } 468a0: 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 ); 468a4: 2040 moveal %d0,%a0 468a6: 7216 moveq #22,%d1 468a8: 70ff moveq #-1,%d0 _Timespec_From_ticks( _Thread_Ticks_per_timeslice, interval ); return 0; } 468aa: 262e fffc movel %fp@(-4),%d3 468ae: 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 ); 468b0: 2081 movel %d1,%a0@ _Timespec_From_ticks( _Thread_Ticks_per_timeslice, interval ); return 0; } 468b2: 4e75 rts 000488e8 : int oflag, ... /* mode_t mode, */ /* unsigned int value */ ) { 488e8: 4e56 ffe0 linkw %fp,#-32 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 488ec: 2039 0006 40e0 movel 640e0 <_Thread_Dispatch_disable_level>,%d0 488f2: 5280 addql #1,%d0 488f4: 48d7 043c moveml %d2-%d5/%a2,%sp@ 488f8: 23c0 0006 40e0 movel %d0,640e0 <_Thread_Dispatch_disable_level> 488fe: 2a2e 0008 movel %fp@(8),%d5 48902: 262e 000c movel %fp@(12),%d3 POSIX_Semaphore_Control *the_semaphore; Objects_Locations location; _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { 48906: 2803 movel %d3,%d4 48908: 0284 0000 0200 andil #512,%d4 4890e: 6600 0086 bnew 48996 48912: 95ca subal %a2,%a2 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 ); 48914: 486e fffc pea %fp@(-4) 48918: 2f05 movel %d5,%sp@- 4891a: 4eb9 0004 efc4 jsr 4efc4 <_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 ) { 48920: 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 ); 48922: 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 ) { 48924: 6726 beqs 4894c /* * 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) ) ) { 48926: 7002 moveq #2,%d0 48928: b082 cmpl %d2,%d0 4892a: 6604 bnes 48930 <== ALWAYS TAKEN 4892c: 4a84 tstl %d4 4892e: 666e bnes 4899e _Thread_Enable_dispatch(); 48930: 4eb9 0004 b32c jsr 4b32c <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one_cast( status, sem_t * ); 48936: 4eb9 0005 2cf4 jsr 52cf4 <__errno> 4893c: 2040 moveal %d0,%a0 4893e: 70ff moveq #-1,%d0 48940: 2082 movel %d2,%a0@ id = &the_semaphore->Semaphore_id; #else id = (sem_t *)&the_semaphore->Object.id; #endif return id; } 48942: 4cee 043c ffe0 moveml %fp@(-32),%d2-%d5/%a2 48948: 4e5e unlk %fp 4894a: 4e75 rts /* * Check for existence with creation. */ if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { 4894c: 0283 0000 0a00 andil #2560,%d3 48952: 0c83 0000 0a00 cmpil #2560,%d3 48958: 676e beqs 489c8 4895a: 486e fff4 pea %fp@(-12) 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(); 4895e: 45f9 0004 b32c lea 4b32c <_Thread_Enable_dispatch>,%a2 48964: 2f2e fffc movel %fp@(-4),%sp@- 48968: 4879 0006 433a pea 6433a <_POSIX_Semaphore_Information> 4896e: 4eb9 0004 aa4c jsr 4aa4c <_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; 48974: 2040 moveal %d0,%a0 48976: 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 ); 4897a: 2d40 fff8 movel %d0,%fp@(-8) the_semaphore->open_count += 1; _Thread_Enable_dispatch(); 4897e: 4e92 jsr %a2@ _Thread_Enable_dispatch(); 48980: 4e92 jsr %a2@ return_id: #if defined(RTEMS_USE_16_BIT_OBJECT) the_semaphore->Semaphore_id = the_semaphore->Object.id; id = &the_semaphore->Semaphore_id; #else id = (sem_t *)&the_semaphore->Object.id; 48982: 202e fff8 movel %fp@(-8),%d0 the_semaphore = _POSIX_Semaphore_Get( &the_semaphore_id, &location ); the_semaphore->open_count += 1; _Thread_Enable_dispatch(); _Thread_Enable_dispatch(); goto return_id; 48986: 4fef 000c lea %sp@(12),%sp return_id: #if defined(RTEMS_USE_16_BIT_OBJECT) the_semaphore->Semaphore_id = the_semaphore->Object.id; id = &the_semaphore->Semaphore_id; #else id = (sem_t *)&the_semaphore->Object.id; 4898a: 5080 addql #8,%d0 #endif return id; } 4898c: 4cee 043c ffe0 moveml %fp@(-32),%d2-%d5/%a2 48992: 4e5e unlk %fp 48994: 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 ); 48996: 246e 0014 moveal %fp@(20),%a2 4899a: 6000 ff78 braw 48914 <== ALWAYS TAKEN /* * 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( 4899e: 486e fff8 pea %fp@(-8) 489a2: 2f0a movel %a2,%sp@- 489a4: 42a7 clrl %sp@- 489a6: 2f05 movel %d5,%sp@- 489a8: 4eb9 0004 ee0c jsr 4ee0c <_POSIX_Semaphore_Create_support> 489ae: 2400 movel %d0,%d2 /* * errno was set by Create_support, so don't set it again. */ _Thread_Enable_dispatch(); 489b0: 4eb9 0004 b32c jsr 4b32c <_Thread_Enable_dispatch> if ( status == -1 ) 489b6: 4fef 0010 lea %sp@(16),%sp 489ba: 70ff moveq #-1,%d0 489bc: b082 cmpl %d2,%d0 489be: 6782 beqs 48942 return_id: #if defined(RTEMS_USE_16_BIT_OBJECT) the_semaphore->Semaphore_id = the_semaphore->Object.id; id = &the_semaphore->Semaphore_id; #else id = (sem_t *)&the_semaphore->Object.id; 489c0: 202e fff8 movel %fp@(-8),%d0 489c4: 5080 addql #8,%d0 489c6: 60c4 bras 4898c <== ALWAYS TAKEN /* * Check for existence with creation. */ if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { _Thread_Enable_dispatch(); 489c8: 4eb9 0004 b32c jsr 4b32c <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * ); 489ce: 4eb9 0005 2cf4 jsr 52cf4 <__errno> 489d4: 7211 moveq #17,%d1 489d6: 2040 moveal %d0,%a0 489d8: 70ff moveq #-1,%d0 id = &the_semaphore->Semaphore_id; #else id = (sem_t *)&the_semaphore->Object.id; #endif return id; } 489da: 4cee 043c ffe0 moveml %fp@(-32),%d2-%d5/%a2 * 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 * ); 489e0: 2081 movel %d1,%a0@ id = &the_semaphore->Semaphore_id; #else id = (sem_t *)&the_semaphore->Object.id; #endif return id; } 489e2: 4e5e unlk %fp 489e4: 4e75 rts ... 00048a40 : int sem_timedwait( sem_t *sem, const struct timespec *abstime ) { 48a40: 4e56 fffc linkw %fp,#-4 48a44: 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 ); 48a46: 486e fffc pea %fp@(-4) 48a4a: 2f2e 000c movel %fp@(12),%sp@- int sem_timedwait( sem_t *sem, const struct timespec *abstime ) { 48a4e: 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 ); 48a52: 4eb9 0004 e3b4 jsr 4e3b4 <_POSIX_Absolute_timeout_to_ticks> if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) 48a58: 508f addql #8,%sp 48a5a: 7203 moveq #3,%d1 48a5c: b280 cmpl %d0,%d1 48a5e: 671a beqs 48a7a <== NEVER TAKEN do_wait = false; lock_status = _POSIX_Semaphore_Wait_support( sem, do_wait, ticks ); 48a60: 2f2e fffc movel %fp@(-4),%sp@- <== NOT EXECUTED 48a64: 42a7 clrl %sp@- <== NOT EXECUTED 48a66: 2f02 movel %d2,%sp@- <== NOT EXECUTED 48a68: 4eb9 0004 f03c jsr 4f03c <_POSIX_Semaphore_Wait_support> <== NOT EXECUTED break; } } return lock_status; } 48a6e: 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 ); 48a72: 4fef 000c lea %sp@(12),%sp <== NOT EXECUTED break; } } return lock_status; } 48a76: 4e5e unlk %fp <== NOT EXECUTED 48a78: 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 ); 48a7a: 2f2e fffc movel %fp@(-4),%sp@- 48a7e: 4878 0001 pea 1 48a82: 2f02 movel %d2,%sp@- 48a84: 4eb9 0004 f03c jsr 4f03c <_POSIX_Semaphore_Wait_support> break; } } return lock_status; } 48a8a: 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 ); 48a8e: 4fef 000c lea %sp@(12),%sp break; } } return lock_status; } 48a92: 4e5e unlk %fp 48a94: 4e75 rts ... 00046650 : int sigaction( int sig, const struct sigaction *act, struct sigaction *oact ) { 46650: 4e56 fff4 linkw %fp,#-12 46654: 226e 0010 moveal %fp@(16),%a1 46658: 48d7 040c moveml %d2-%d3/%a2,%sp@ 4665c: 242e 0008 movel %fp@(8),%d2 46660: 246e 000c moveal %fp@(12),%a2 ISR_Level level; if ( oact ) 46664: 4a89 tstl %a1 46666: 6718 beqs 46680 *oact = _POSIX_signals_Vectors[ sig ]; 46668: 2202 movel %d2,%d1 4666a: 2002 movel %d2,%d0 4666c: e989 lsll #4,%d1 4666e: e588 lsll #2,%d0 46670: 2041 moveal %d1,%a0 46672: 91c0 subal %d0,%a0 46674: d1fc 0006 1552 addal #398674,%a0 4667a: 22d8 movel %a0@+,%a1@+ 4667c: 22d8 movel %a0@+,%a1@+ 4667e: 2290 movel %a0@,%a1@ if ( !sig ) 46680: 4a82 tstl %d2 46682: 6778 beqs 466fc rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 46684: 2002 movel %d2,%d0 46686: 5380 subql #1,%d0 46688: 721f moveq #31,%d1 4668a: b280 cmpl %d0,%d1 4668c: 656e bcss 466fc * * NOTE: Solaris documentation claims to "silently enforce" this which * contradicts the POSIX specification. */ if ( sig == SIGKILL ) 4668e: 7009 moveq #9,%d0 46690: b082 cmpl %d2,%d0 46692: 6768 beqs 466fc /* * Evaluate the new action structure and set the global signal vector * appropriately. */ if ( act ) { 46694: 4a8a tstl %a2 46696: 6736 beqs 466ce <== ALWAYS 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 ); 46698: 203c 0000 0700 movel #1792,%d0 4669e: 40c3 movew %sr,%d3 466a0: 8083 orl %d3,%d0 466a2: 46c0 movew %d0,%sr if ( act->sa_handler == SIG_DFL ) { 466a4: 4aaa 0008 tstl %a2@(8) 466a8: 6730 beqs 466da _POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ]; } else { _POSIX_signals_Clear_process_signals( sig ); 466aa: 2f02 movel %d2,%sp@- 466ac: 4eb9 0004 c304 jsr 4c304 <_POSIX_signals_Clear_process_signals> _POSIX_signals_Vectors[ sig ] = *act; 466b2: 588f addql #4,%sp 466b4: 2202 movel %d2,%d1 466b6: 224a moveal %a2,%a1 466b8: e989 lsll #4,%d1 466ba: e58a lsll #2,%d2 466bc: 2041 moveal %d1,%a0 466be: 91c2 subal %d2,%a0 466c0: d1fc 0006 1552 addal #398674,%a0 466c6: 20d9 movel %a1@+,%a0@+ 466c8: 20d9 movel %a1@+,%a0@+ 466ca: 2091 movel %a1@,%a0@ } _ISR_Enable( level ); 466cc: 46c3 movew %d3,%sr 466ce: 4280 clrl %d0 * + If we are now ignoring a signal that was previously pending, * we clear the pending signal indicator. */ return 0; } 466d0: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 466d6: 4e5e unlk %fp 466d8: 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 ]; 466da: 2002 movel %d2,%d0 466dc: e58a lsll #2,%d2 466de: e988 lsll #4,%d0 466e0: 9082 subl %d2,%d0 466e2: 2040 moveal %d0,%a0 466e4: 2240 moveal %d0,%a1 466e6: d1fc 0006 1552 addal #398674,%a0 466ec: d3fc 0005 eab2 addal #387762,%a1 466f2: 20d9 movel %a1@+,%a0@+ 466f4: 20d9 movel %a1@+,%a0@+ 466f6: 2091 movel %a1@,%a0@ } else { _POSIX_signals_Clear_process_signals( sig ); _POSIX_signals_Vectors[ sig ] = *act; } _ISR_Enable( level ); 466f8: 46c3 movew %d3,%sr 466fa: 60d2 bras 466ce <== ALWAYS TAKEN * NOTE: Solaris documentation claims to "silently enforce" this which * contradicts the POSIX specification. */ if ( sig == SIGKILL ) rtems_set_errno_and_return_minus_one( EINVAL ); 466fc: 4eb9 0004 fe2c jsr 4fe2c <__errno> 46702: 7216 moveq #22,%d1 46704: 2040 moveal %d0,%a0 46706: 70ff moveq #-1,%d0 * + If we are now ignoring a signal that was previously pending, * we clear the pending signal indicator. */ return 0; } 46708: 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 ); 4670e: 2081 movel %d1,%a0@ * + If we are now ignoring a signal that was previously pending, * we clear the pending signal indicator. */ return 0; } 46710: 4e5e unlk %fp 46712: 4e75 rts 00048984 : #include int sigsuspend( const sigset_t *sigmask ) { 48984: 4e56 ffec linkw %fp,#-20 48988: 48d7 040c moveml %d2-%d3/%a2,%sp@ int status; POSIX_API_Control *api; api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; status = sigprocmask( SIG_BLOCK, sigmask, &saved_signals_blocked ); 4898c: 240e movel %fp,%d2 4898e: 5982 subql #4,%d2 48990: 45f9 0004 895c lea 4895c ,%a2 (void) sigfillset( &all_signals ); 48996: 260e movel %fp,%d3 48998: 5183 subql #8,%d3 int status; POSIX_API_Control *api; api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; status = sigprocmask( SIG_BLOCK, sigmask, &saved_signals_blocked ); 4899a: 2f02 movel %d2,%sp@- 4899c: 2f2e 0008 movel %fp@(8),%sp@- 489a0: 4878 0001 pea 1 489a4: 4e92 jsr %a2@ (void) sigfillset( &all_signals ); 489a6: 2f03 movel %d3,%sp@- 489a8: 4eb9 0004 88b8 jsr 488b8 status = sigtimedwait( &all_signals, NULL, NULL ); 489ae: 42a7 clrl %sp@- 489b0: 42a7 clrl %sp@- 489b2: 2f03 movel %d3,%sp@- 489b4: 4eb9 0004 8a40 jsr 48a40 489ba: 2600 movel %d0,%d3 (void) sigprocmask( SIG_SETMASK, &saved_signals_blocked, NULL ); 489bc: 42a7 clrl %sp@- 489be: 2f02 movel %d2,%sp@- 489c0: 42a7 clrl %sp@- 489c2: 4e92 jsr %a2@ /* * sigtimedwait() returns the signal number while sigsuspend() * is supposed to return -1 and EINTR when a signal is caught. */ if ( status != -1 ) 489c4: 4fef 0028 lea %sp@(40),%sp 489c8: 70ff moveq #-1,%d0 489ca: b083 cmpl %d3,%d0 489cc: 660c bnes 489da <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EINTR ); return status; } 489ce: 70ff moveq #-1,%d0 <== NOT EXECUTED 489d0: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 <== NOT EXECUTED 489d6: 4e5e unlk %fp <== NOT EXECUTED 489d8: 4e75 rts <== NOT EXECUTED /* * sigtimedwait() returns the signal number while sigsuspend() * is supposed to return -1 and EINTR when a signal is caught. */ if ( status != -1 ) rtems_set_errno_and_return_minus_one( EINTR ); 489da: 4eb9 0005 2038 jsr 52038 <__errno> 489e0: 2040 moveal %d0,%a0 489e2: 7004 moveq #4,%d0 return status; } 489e4: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 /* * sigtimedwait() returns the signal number while sigsuspend() * is supposed to return -1 and EINTR when a signal is caught. */ if ( status != -1 ) rtems_set_errno_and_return_minus_one( EINTR ); 489ea: 2080 movel %d0,%a0@ return status; } 489ec: 70ff moveq #-1,%d0 489ee: 4e5e unlk %fp 489f0: 4e75 rts ... 00046ac8 : int sigtimedwait( const sigset_t *set, siginfo_t *info, const struct timespec *timeout ) { 46ac8: 4e56 ffdc linkw %fp,#-36 46acc: 48d7 1c1c moveml %d2-%d4/%a2-%a4,%sp@ 46ad0: 266e 0008 moveal %fp@(8),%a3 46ad4: 246e 000c moveal %fp@(12),%a2 46ad8: 242e 0010 movel %fp@(16),%d2 ISR_Level level; /* * Error check parameters before disabling interrupts. */ if ( !set ) 46adc: 4a8b tstl %a3 46ade: 6700 0184 beqw 46c64 /* NOTE: This is very specifically a RELATIVE not ABSOLUTE time * in the Open Group specification. */ interval = 0; if ( timeout ) { 46ae2: 4a82 tstl %d2 46ae4: 6700 0116 beqw 46bfc if ( !_Timespec_Is_valid( timeout ) ) 46ae8: 2f02 movel %d2,%sp@- 46aea: 4eb9 0004 a310 jsr 4a310 <_Timespec_Is_valid> 46af0: 588f addql #4,%sp 46af2: 4a00 tstb %d0 46af4: 6700 0188 beqw 46c7e rtems_set_errno_and_return_minus_one( EINVAL ); interval = _Timespec_To_ticks( timeout ); 46af8: 2f02 movel %d2,%sp@- 46afa: 4eb9 0004 a390 jsr 4a390 <_Timespec_To_ticks> if ( !interval ) 46b00: 588f addql #4,%sp 46b02: 4a80 tstl %d0 46b04: 6700 015e beqw 46c64 <== ALWAYS TAKEN /* * Initialize local variables. */ the_info = ( info ) ? info : &signal_information; 46b08: 4a8a tstl %a2 46b0a: 6700 00f8 beqw 46c04 <== ALWAYS TAKEN the_thread = _Thread_Executing; 46b0e: 2079 0006 160e moveal 6160e <_Thread_Executing>,%a0 * What if they are already pending? */ /* API signals pending? */ _ISR_Disable( level ); 46b14: 223c 0000 0700 movel #1792,%d1 the_info = ( info ) ? info : &signal_information; the_thread = _Thread_Executing; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 46b1a: 2868 010e moveal %a0@(270),%a4 * What if they are already pending? */ /* API signals pending? */ _ISR_Disable( level ); 46b1e: 40c3 movew %sr,%d3 46b20: 8283 orl %d3,%d1 46b22: 46c1 movew %d1,%sr if ( *set & api->signals_pending ) { 46b24: 2213 movel %a3@,%d1 46b26: 2801 movel %d1,%d4 46b28: 242c 00c8 movel %a4@(200),%d2 46b2c: c882 andl %d2,%d4 46b2e: 6600 00fc bnew 46c2c <== ALWAYS TAKEN return the_info->si_signo; } /* Process pending signals? */ if ( *set & _POSIX_signals_Pending ) { 46b32: 2439 0006 1bce movel 61bce <_POSIX_signals_Pending>,%d2 46b38: c282 andl %d2,%d1 46b3a: 6600 0086 bnew 46bc2 46b3e: 2239 0006 1554 movel 61554 <_Thread_Dispatch_disable_level>,%d1 46b44: 5281 addql #1,%d1 46b46: 23c1 0006 1554 movel %d1,61554 <_Thread_Dispatch_disable_level> the_info->si_code = SI_USER; the_info->si_value.sival_int = 0; return signo; } the_info->si_signo = -1; 46b4c: 72ff moveq #-1,%d1 46b4e: 2481 movel %d1,%a2@ _Thread_Disable_dispatch(); the_thread->Wait.queue = &_POSIX_signals_Wait_queue; the_thread->Wait.return_code = EINTR; 46b50: 7204 moveq #4,%d1 } the_info->si_signo = -1; _Thread_Disable_dispatch(); the_thread->Wait.queue = &_POSIX_signals_Wait_queue; 46b52: 43f9 0006 1b8e lea 61b8e <_POSIX_signals_Wait_queue>,%a1 the_thread->Wait.return_code = EINTR; 46b58: 2141 0034 movel %d1,%a0@(52) the_thread->Wait.option = *set; 46b5c: 2153 0030 movel %a3@,%a0@(48) RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section ( Thread_queue_Control *the_thread_queue ) { the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 46b60: 123c 0001 moveb #1,%d1 the_thread->Wait.return_argument = the_info; 46b64: 214a 0028 movel %a2,%a0@(40) } the_info->si_signo = -1; _Thread_Disable_dispatch(); the_thread->Wait.queue = &_POSIX_signals_Wait_queue; 46b68: 2149 0044 movel %a1,%a0@(68) 46b6c: 23c1 0006 1bbe movel %d1,61bbe <_POSIX_signals_Wait_queue+0x30> the_thread->Wait.return_code = EINTR; the_thread->Wait.option = *set; the_thread->Wait.return_argument = the_info; _Thread_queue_Enter_critical_section( &_POSIX_signals_Wait_queue ); _ISR_Enable( level ); 46b72: 46c3 movew %d3,%sr _Thread_queue_Enqueue( &_POSIX_signals_Wait_queue, interval ); 46b74: 4879 0004 9d2c pea 49d2c <_Thread_queue_Timeout> 46b7a: 2f00 movel %d0,%sp@- 46b7c: 4879 0006 1b8e pea 61b8e <_POSIX_signals_Wait_queue> 46b82: 4eb9 0004 99cc jsr 499cc <_Thread_queue_Enqueue_with_handler> _Thread_Enable_dispatch(); 46b88: 4eb9 0004 9480 jsr 49480 <_Thread_Enable_dispatch> /* * When the thread is set free by a signal, it is need to eliminate * the signal. */ _POSIX_signals_Clear_signals( api, the_info->si_signo, the_info, false, false ); 46b8e: 42a7 clrl %sp@- 46b90: 42a7 clrl %sp@- 46b92: 2f0a movel %a2,%sp@- 46b94: 2f12 movel %a2@,%sp@- 46b96: 2f0c movel %a4,%sp@- 46b98: 4eb9 0004 ca9c jsr 4ca9c <_POSIX_signals_Clear_signals> errno = _Thread_Executing->Wait.return_code; 46b9e: 4fef 0020 lea %sp@(32),%sp 46ba2: 4eb9 0005 0240 jsr 50240 <__errno> 46ba8: 2079 0006 160e moveal 6160e <_Thread_Executing>,%a0 46bae: 2240 moveal %d0,%a1 46bb0: 22a8 0034 movel %a0@(52),%a1@ return the_info->si_signo; 46bb4: 2412 movel %a2@,%d2 } 46bb6: 2002 movel %d2,%d0 46bb8: 4cee 1c1c ffdc moveml %fp@(-36),%d2-%d4/%a2-%a4 46bbe: 4e5e unlk %fp 46bc0: 4e75 rts } /* Process pending signals? */ if ( *set & _POSIX_signals_Pending ) { signo = _POSIX_signals_Get_highest( _POSIX_signals_Pending ); 46bc2: 2f02 movel %d2,%sp@- 46bc4: 4eb9 0004 6a7c jsr 46a7c <_POSIX_signals_Get_highest> 46bca: 2400 movel %d0,%d2 _POSIX_signals_Clear_signals( api, signo, the_info, true, false ); 46bcc: 42a7 clrl %sp@- 46bce: 4878 0001 pea 1 46bd2: 2f0a movel %a2,%sp@- 46bd4: 2f00 movel %d0,%sp@- 46bd6: 2f0c movel %a4,%sp@- 46bd8: 4eb9 0004 ca9c jsr 4ca9c <_POSIX_signals_Clear_signals> _ISR_Enable( level ); 46bde: 46c3 movew %d3,%sr the_info->si_signo = signo; the_info->si_code = SI_USER; 46be0: 7201 moveq #1,%d1 */ _POSIX_signals_Clear_signals( api, the_info->si_signo, the_info, false, false ); errno = _Thread_Executing->Wait.return_code; return the_info->si_signo; } 46be2: 2002 movel %d2,%d0 _ISR_Enable( level ); the_info->si_signo = signo; the_info->si_code = SI_USER; the_info->si_value.sival_int = 0; return signo; 46be4: 4fef 0018 lea %sp@(24),%sp _POSIX_signals_Clear_signals( api, signo, the_info, true, false ); _ISR_Enable( level ); the_info->si_signo = signo; the_info->si_code = SI_USER; the_info->si_value.sival_int = 0; 46be8: 42aa 0008 clrl %a2@(8) if ( *set & _POSIX_signals_Pending ) { signo = _POSIX_signals_Get_highest( _POSIX_signals_Pending ); _POSIX_signals_Clear_signals( api, signo, the_info, true, false ); _ISR_Enable( level ); the_info->si_signo = signo; 46bec: 2482 movel %d2,%a2@ the_info->si_code = SI_USER; 46bee: 2541 0004 movel %d1,%a2@(4) */ _POSIX_signals_Clear_signals( api, the_info->si_signo, the_info, false, false ); errno = _Thread_Executing->Wait.return_code; return the_info->si_signo; } 46bf2: 4cee 1c1c ffdc moveml %fp@(-36),%d2-%d4/%a2-%a4 46bf8: 4e5e unlk %fp 46bfa: 4e75 rts rtems_set_errno_and_return_minus_one( EINVAL ); interval = _Timespec_To_ticks( timeout ); if ( !interval ) rtems_set_errno_and_return_minus_one( EINVAL ); 46bfc: 4280 clrl %d0 /* * Initialize local variables. */ the_info = ( info ) ? info : &signal_information; 46bfe: 4a8a tstl %a2 46c00: 6600 ff0c bnew 46b0e the_thread = _Thread_Executing; 46c04: 2079 0006 160e moveal 6160e <_Thread_Executing>,%a0 /* * Initialize local variables. */ the_info = ( info ) ? info : &signal_information; 46c0a: 45ee fff4 lea %fp@(-12),%a2 * What if they are already pending? */ /* API signals pending? */ _ISR_Disable( level ); 46c0e: 223c 0000 0700 movel #1792,%d1 the_info = ( info ) ? info : &signal_information; the_thread = _Thread_Executing; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 46c14: 2868 010e moveal %a0@(270),%a4 * What if they are already pending? */ /* API signals pending? */ _ISR_Disable( level ); 46c18: 40c3 movew %sr,%d3 46c1a: 8283 orl %d3,%d1 46c1c: 46c1 movew %d1,%sr if ( *set & api->signals_pending ) { 46c1e: 2213 movel %a3@,%d1 46c20: 2801 movel %d1,%d4 46c22: 242c 00c8 movel %a4@(200),%d2 46c26: c882 andl %d2,%d4 46c28: 6700 ff08 beqw 46b32 /* XXX real info later */ the_info->si_signo = _POSIX_signals_Get_highest( api->signals_pending ); 46c2c: 2f02 movel %d2,%sp@- 46c2e: 4eb9 0004 6a7c jsr 46a7c <_POSIX_signals_Get_highest> 46c34: 2480 movel %d0,%a2@ _POSIX_signals_Clear_signals( 46c36: 42a7 clrl %sp@- 46c38: 42a7 clrl %sp@- 46c3a: 2f0a movel %a2,%sp@- 46c3c: 2f00 movel %d0,%sp@- 46c3e: 2f0c movel %a4,%sp@- 46c40: 4eb9 0004 ca9c jsr 4ca9c <_POSIX_signals_Clear_signals> the_info->si_signo, the_info, false, false ); _ISR_Enable( level ); 46c46: 46c3 movew %d3,%sr the_info->si_code = SI_USER; 46c48: 7001 moveq #1,%d0 the_info->si_value.sival_int = 0; return the_info->si_signo; 46c4a: 4fef 0018 lea %sp@(24),%sp 46c4e: 2412 movel %a2@,%d2 false, false ); _ISR_Enable( level ); the_info->si_code = SI_USER; 46c50: 2540 0004 movel %d0,%a2@(4) */ _POSIX_signals_Clear_signals( api, the_info->si_signo, the_info, false, false ); errno = _Thread_Executing->Wait.return_code; return the_info->si_signo; } 46c54: 2002 movel %d2,%d0 false ); _ISR_Enable( level ); the_info->si_code = SI_USER; the_info->si_value.sival_int = 0; 46c56: 42aa 0008 clrl %a2@(8) */ _POSIX_signals_Clear_signals( api, the_info->si_signo, the_info, false, false ); errno = _Thread_Executing->Wait.return_code; return the_info->si_signo; } 46c5a: 4cee 1c1c ffdc moveml %fp@(-36),%d2-%d4/%a2-%a4 46c60: 4e5e unlk %fp 46c62: 4e75 rts rtems_set_errno_and_return_minus_one( EINVAL ); interval = _Timespec_To_ticks( timeout ); if ( !interval ) rtems_set_errno_and_return_minus_one( EINVAL ); 46c64: 4eb9 0005 0240 jsr 50240 <__errno> 46c6a: 74ff moveq #-1,%d2 46c6c: 7616 moveq #22,%d3 46c6e: 2040 moveal %d0,%a0 */ _POSIX_signals_Clear_signals( api, the_info->si_signo, the_info, false, false ); errno = _Thread_Executing->Wait.return_code; return the_info->si_signo; } 46c70: 2002 movel %d2,%d0 rtems_set_errno_and_return_minus_one( EINVAL ); interval = _Timespec_To_ticks( timeout ); if ( !interval ) rtems_set_errno_and_return_minus_one( EINVAL ); 46c72: 2083 movel %d3,%a0@ */ _POSIX_signals_Clear_signals( api, the_info->si_signo, the_info, false, false ); errno = _Thread_Executing->Wait.return_code; return the_info->si_signo; } 46c74: 4cee 1c1c ffdc moveml %fp@(-36),%d2-%d4/%a2-%a4 46c7a: 4e5e unlk %fp 46c7c: 4e75 rts interval = 0; if ( timeout ) { if ( !_Timespec_Is_valid( timeout ) ) rtems_set_errno_and_return_minus_one( EINVAL ); 46c7e: 4eb9 0005 0240 jsr 50240 <__errno> 46c84: 74ff moveq #-1,%d2 46c86: 7816 moveq #22,%d4 46c88: 2240 moveal %d0,%a1 */ _POSIX_signals_Clear_signals( api, the_info->si_signo, the_info, false, false ); errno = _Thread_Executing->Wait.return_code; return the_info->si_signo; } 46c8a: 2002 movel %d2,%d0 interval = 0; if ( timeout ) { if ( !_Timespec_Is_valid( timeout ) ) rtems_set_errno_and_return_minus_one( EINVAL ); 46c8c: 2284 movel %d4,%a1@ */ _POSIX_signals_Clear_signals( api, the_info->si_signo, the_info, false, false ); errno = _Thread_Executing->Wait.return_code; return the_info->si_signo; } 46c8e: 4cee 1c1c ffdc moveml %fp@(-36),%d2-%d4/%a2-%a4 46c94: 4e5e unlk %fp 46c96: 4e75 rts 00048c28 : int sigwait( const sigset_t *set, int *sig ) { 48c28: 4e56 0000 linkw %fp,#0 48c2c: 2f0a movel %a2,%sp@- int status; status = sigtimedwait( set, NULL, NULL ); 48c2e: 42a7 clrl %sp@- int sigwait( const sigset_t *set, int *sig ) { 48c30: 246e 000c moveal %fp@(12),%a2 int status; status = sigtimedwait( set, NULL, NULL ); 48c34: 42a7 clrl %sp@- 48c36: 2f2e 0008 movel %fp@(8),%sp@- 48c3a: 4eb9 0004 8a40 jsr 48a40 if ( status != -1 ) { 48c40: 4fef 000c lea %sp@(12),%sp 48c44: 72ff moveq #-1,%d1 48c46: b280 cmpl %d0,%d1 48c48: 6710 beqs 48c5a if ( sig ) 48c4a: 4a8a tstl %a2 48c4c: 6702 beqs 48c50 <== ALWAYS TAKEN *sig = status; 48c4e: 2480 movel %d0,%a2@ return 0; } return errno; } 48c50: 246e fffc moveal %fp@(-4),%a2 status = sigtimedwait( set, NULL, NULL ); if ( status != -1 ) { if ( sig ) *sig = status; 48c54: 4280 clrl %d0 return 0; } return errno; } 48c56: 4e5e unlk %fp 48c58: 4e75 rts if ( sig ) *sig = status; return 0; } return errno; 48c5a: 4eb9 0005 2038 jsr 52038 <__errno> } 48c60: 246e fffc moveal %fp@(-4),%a2 if ( sig ) *sig = status; return 0; } return errno; 48c64: 2040 moveal %d0,%a0 } 48c66: 4e5e unlk %fp if ( sig ) *sig = status; return 0; } return errno; 48c68: 2010 movel %a0@,%d0 } 48c6a: 4e75 rts 000458d0 : timer_t *timerid ) { POSIX_Timer_Control *ptimer; if ( clock_id != CLOCK_REALTIME ) 458d0: 7001 moveq #1,%d0 int timer_create( clockid_t clock_id, struct sigevent *evp, timer_t *timerid ) { 458d2: 4e56 0000 linkw %fp,#0 458d6: 2f0b movel %a3,%sp@- 458d8: 266e 0010 moveal %fp@(16),%a3 458dc: 2f0a movel %a2,%sp@- 458de: 246e 000c moveal %fp@(12),%a2 POSIX_Timer_Control *ptimer; if ( clock_id != CLOCK_REALTIME ) 458e2: b0ae 0008 cmpl %fp@(8),%d0 458e6: 6600 00c4 bnew 459ac rtems_set_errno_and_return_minus_one( EINVAL ); if ( !timerid ) 458ea: 4a8b tstl %a3 458ec: 6700 00be beqw 459ac /* * The data of the structure evp are checked in order to verify if they * are coherent. */ if (evp != NULL) { 458f0: 4a8a tstl %a2 458f2: 671e beqs 45912 /* The structure has data */ if ( ( evp->sigev_notify != SIGEV_NONE ) && 458f4: 2012 movel %a2@,%d0 458f6: 7201 moveq #1,%d1 458f8: 5380 subql #1,%d0 458fa: b280 cmpl %d0,%d1 458fc: 6500 00ae bcsw 459ac <== ALWAYS TAKEN ( evp->sigev_notify != SIGEV_SIGNAL ) ) { /* The value of the field sigev_notify is not valid */ rtems_set_errno_and_return_minus_one( EINVAL ); } if ( !evp->sigev_signo ) 45900: 202a 0004 movel %a2@(4),%d0 45904: 6700 00a6 beqw 459ac <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(evp->sigev_signo) ) 45908: 5380 subql #1,%d0 4590a: 721f moveq #31,%d1 4590c: b280 cmpl %d0,%d1 4590e: 6500 009c bcsw 459ac <== ALWAYS TAKEN rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 45912: 2039 0005 fe74 movel 5fe74 <_Thread_Dispatch_disable_level>,%d0 45918: 5280 addql #1,%d0 4591a: 23c0 0005 fe74 movel %d0,5fe74 <_Thread_Dispatch_disable_level> * the inactive chain of free timer control blocks. */ RTEMS_INLINE_ROUTINE POSIX_Timer_Control *_POSIX_Timer_Allocate( void ) { return (POSIX_Timer_Control *) _Objects_Allocate( &_POSIX_Timer_Information ); 45920: 4879 0006 0108 pea 60108 <_POSIX_Timer_Information> 45926: 4eb9 0004 79e0 jsr 479e0 <_Objects_Allocate> /* * Allocate a timer */ ptimer = _POSIX_Timer_Allocate(); if ( !ptimer ) { 4592c: 588f addql #4,%sp 4592e: 2040 moveal %d0,%a0 45930: 4a80 tstl %d0 45932: 6700 0092 beqw 459c6 rtems_set_errno_and_return_minus_one( EAGAIN ); } /* The data of the created timer are stored to use them later */ ptimer->state = POSIX_TIMER_STATE_CREATE_NEW; 45936: 7002 moveq #2,%d0 45938: 1140 003c moveb %d0,%a0@(60) ptimer->thread_id = _Thread_Executing->Object.id; 4593c: 2279 0005 ff2e moveal 5ff2e <_Thread_Executing>,%a1 45942: 2169 0008 0038 movel %a1@(8),%a0@(56) if ( evp != NULL ) { 45948: 4a8a tstl %a2 4594a: 6710 beqs 4595c ptimer->inf.sigev_notify = evp->sigev_notify; 4594c: 2152 003e movel %a2@,%a0@(62) ptimer->inf.sigev_signo = evp->sigev_signo; ptimer->inf.sigev_value = evp->sigev_value; 45950: 216a 0008 0046 movel %a2@(8),%a0@(70) ptimer->state = POSIX_TIMER_STATE_CREATE_NEW; ptimer->thread_id = _Thread_Executing->Object.id; if ( evp != NULL ) { ptimer->inf.sigev_notify = evp->sigev_notify; ptimer->inf.sigev_signo = evp->sigev_signo; 45956: 216a 0004 0042 movel %a2@(4),%a0@(66) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4595c: 2028 0008 movel %a0@(8),%d0 45960: 4281 clrl %d1 45962: 2279 0006 0120 moveal 60120 <_POSIX_Timer_Information+0x18>,%a1 45968: 3200 movew %d0,%d1 ptimer->inf.sigev_value = evp->sigev_value; } ptimer->overrun = 0; 4596a: 42a8 0066 clrl %a0@(102) 4596e: 2388 1c00 movel %a0,%a1@(00000000,%d1:l:4) ptimer->timer_data.it_value.tv_sec = 0; 45972: 42a8 005a clrl %a0@(90) _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 45976: 42a8 000c clrl %a0@(12) ptimer->timer_data.it_value.tv_nsec = 0; 4597a: 42a8 005e clrl %a0@(94) ptimer->timer_data.it_interval.tv_sec = 0; 4597e: 42a8 0052 clrl %a0@(82) ptimer->timer_data.it_interval.tv_nsec = 0; 45982: 42a8 0056 clrl %a0@(86) void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; 45986: 42a8 0030 clrl %a0@(48) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 4598a: 42a8 0018 clrl %a0@(24) _Watchdog_Initialize( &ptimer->Timer, NULL, 0, NULL ); _Objects_Open_u32(&_POSIX_Timer_Information, &ptimer->Object, 0); *timerid = ptimer->Object.id; 4598e: 2680 movel %d0,%a3@ the_watchdog->routine = routine; 45990: 42a8 002c clrl %a0@(44) the_watchdog->id = id; the_watchdog->user_data = user_data; 45994: 42a8 0034 clrl %a0@(52) _Thread_Enable_dispatch(); 45998: 4eb9 0004 868c jsr 4868c <_Thread_Enable_dispatch> return 0; } 4599e: 246e fff8 moveal %fp@(-8),%a2 _Watchdog_Initialize( &ptimer->Timer, NULL, 0, NULL ); _Objects_Open_u32(&_POSIX_Timer_Information, &ptimer->Object, 0); *timerid = ptimer->Object.id; _Thread_Enable_dispatch(); 459a2: 4280 clrl %d0 return 0; } 459a4: 266e fffc moveal %fp@(-4),%a3 459a8: 4e5e unlk %fp 459aa: 4e75 rts if ( !evp->sigev_signo ) rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(evp->sigev_signo) ) rtems_set_errno_and_return_minus_one( EINVAL ); 459ac: 4eb9 0004 f6b4 jsr 4f6b4 <__errno> _Objects_Open_u32(&_POSIX_Timer_Information, &ptimer->Object, 0); *timerid = ptimer->Object.id; _Thread_Enable_dispatch(); return 0; } 459b2: 246e fff8 moveal %fp@(-8),%a2 if ( !evp->sigev_signo ) rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(evp->sigev_signo) ) rtems_set_errno_and_return_minus_one( EINVAL ); 459b6: 2040 moveal %d0,%a0 459b8: 7216 moveq #22,%d1 459ba: 70ff moveq #-1,%d0 _Objects_Open_u32(&_POSIX_Timer_Information, &ptimer->Object, 0); *timerid = ptimer->Object.id; _Thread_Enable_dispatch(); return 0; } 459bc: 266e fffc moveal %fp@(-4),%a3 459c0: 4e5e unlk %fp if ( !evp->sigev_signo ) rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(evp->sigev_signo) ) rtems_set_errno_and_return_minus_one( EINVAL ); 459c2: 2081 movel %d1,%a0@ _Objects_Open_u32(&_POSIX_Timer_Information, &ptimer->Object, 0); *timerid = ptimer->Object.id; _Thread_Enable_dispatch(); return 0; } 459c4: 4e75 rts /* * Allocate a timer */ ptimer = _POSIX_Timer_Allocate(); if ( !ptimer ) { _Thread_Enable_dispatch(); 459c6: 4eb9 0004 868c jsr 4868c <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EAGAIN ); 459cc: 4eb9 0004 f6b4 jsr 4f6b4 <__errno> _Objects_Open_u32(&_POSIX_Timer_Information, &ptimer->Object, 0); *timerid = ptimer->Object.id; _Thread_Enable_dispatch(); return 0; } 459d2: 246e fff8 moveal %fp@(-8),%a2 * Allocate a timer */ ptimer = _POSIX_Timer_Allocate(); if ( !ptimer ) { _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EAGAIN ); 459d6: 2040 moveal %d0,%a0 459d8: 720b moveq #11,%d1 459da: 70ff moveq #-1,%d0 _Objects_Open_u32(&_POSIX_Timer_Information, &ptimer->Object, 0); *timerid = ptimer->Object.id; _Thread_Enable_dispatch(); return 0; } 459dc: 266e fffc moveal %fp@(-4),%a3 459e0: 4e5e unlk %fp * Allocate a timer */ ptimer = _POSIX_Timer_Allocate(); if ( !ptimer ) { _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EAGAIN ); 459e2: 2081 movel %d1,%a0@ _Objects_Open_u32(&_POSIX_Timer_Information, &ptimer->Object, 0); *timerid = ptimer->Object.id; _Thread_Enable_dispatch(); return 0; } 459e4: 4e75 rts ... 000459e8 : timer_t timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue ) { 459e8: 4e56 ffc8 linkw %fp,#-56 459ec: 202e 000c movel %fp@(12),%d0 459f0: 48d7 3c1c moveml %d2-%d4/%a2-%a5,%sp@ 459f4: 266e 0010 moveal %fp@(16),%a3 459f8: 282e 0014 movel %fp@(20),%d4 Objects_Locations location; bool activated; uint32_t initial_period; struct itimerspec normalize; if ( !value ) 459fc: 4a8b tstl %a3 459fe: 6700 0194 beqw 45b94 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); /* First, it verifies if the structure "value" is correct */ if ( ( value->it_value.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) || 45a02: 223c 3b9a c9ff movel #999999999,%d1 45a08: b2ab 000c cmpl %a3@(12),%d1 45a0c: 6500 0186 bcsw 45b94 <== ALWAYS TAKEN ( value->it_value.tv_nsec < 0 ) || ( value->it_interval.tv_nsec >= TOD_NANOSECONDS_PER_SECOND) || 45a10: b2ab 0004 cmpl %a3@(4),%d1 45a14: 6500 017e bcsw 45b94 <== ALWAYS TAKEN ( value->it_interval.tv_nsec < 0 )) { /* The number of nanoseconds is not correct */ rtems_set_errno_and_return_minus_one( EINVAL ); } if ( flags != TIMER_ABSTIME && flags != POSIX_TIMER_RELATIVE ) { 45a18: 7204 moveq #4,%d1 45a1a: b280 cmpl %d0,%d1 45a1c: 6700 00fa beqw 45b18 <== ALWAYS TAKEN 45a20: 4a80 tstl %d0 45a22: 6600 0170 bnew 45b94 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); } normalize = *value; 45a26: 260e movel %fp,%d3 45a28: 0683 ffff ffe4 addil #-28,%d3 45a2e: 204b moveal %a3,%a0 45a30: 2243 moveal %d3,%a1 45a32: 240e movel %fp,%d2 45a34: 0682 ffff ffe8 addil #-24,%d2 45a3a: 49ee ffec lea %fp@(-20),%a4 45a3e: 4bee fff0 lea %fp@(-16),%a5 45a42: 2298 movel %a0@+,%a1@ 45a44: 2242 moveal %d2,%a1 45a46: 2298 movel %a0@+,%a1@ 45a48: 2898 movel %a0@+,%a4@ 45a4a: 2a90 movel %a0@,%a5@ RTEMS_INLINE_ROUTINE POSIX_Timer_Control *_POSIX_Timer_Get ( timer_t id, Objects_Locations *location ) { return (POSIX_Timer_Control *) 45a4c: 486e fffc pea %fp@(-4) 45a50: 2f2e 0008 movel %fp@(8),%sp@- 45a54: 4879 0006 0108 pea 60108 <_POSIX_Timer_Information> 45a5a: 4eb9 0004 7e7c jsr 47e7c <_Objects_Get> * something with the structure of times of the timer: to stop, start * or start it again */ ptimer = _POSIX_Timer_Get( timerid, &location ); switch ( location ) { 45a60: 4fef 000c lea %sp@(12),%sp 45a64: 2440 moveal %d0,%a2 45a66: 4aae fffc tstl %fp@(-4) 45a6a: 6600 0128 bnew 45b94 <== ALWAYS TAKEN case OBJECTS_LOCAL: /* First, it verifies if the timer must be stopped */ if ( normalize.it_value.tv_sec == 0 && normalize.it_value.tv_nsec == 0 ) { 45a6e: 4aae ffec tstl %fp@(-20) 45a72: 6608 bnes 45a7c 45a74: 4aae fff0 tstl %fp@(-16) 45a78: 6700 0132 beqw 45bac _Thread_Enable_dispatch(); return 0; } /* Convert from seconds and nanoseconds to ticks */ ptimer->ticks = _Timespec_To_ticks( &value->it_interval ); 45a7c: 2f0b movel %a3,%sp@- 45a7e: 47f9 0004 95a4 lea 495a4 <_Timespec_To_ticks>,%a3 45a84: 4e93 jsr %a3@ 45a86: 2540 0062 movel %d0,%a2@(98) initial_period = _Timespec_To_ticks( &normalize.it_value ); 45a8a: 2f0c movel %a4,%sp@- 45a8c: 4e93 jsr %a3@ activated = _POSIX_Timer_Insert_helper( 45a8e: 2f0a movel %a2,%sp@- 45a90: 4879 0004 5cb4 pea 45cb4 <_POSIX_Timer_TSR> 45a96: 2f2a 0008 movel %a2@(8),%sp@- 45a9a: 2f00 movel %d0,%sp@- 45a9c: 486a 0010 pea %a2@(16) 45aa0: 4eb9 0004 bed4 jsr 4bed4 <_POSIX_Timer_Insert_helper> initial_period, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) { 45aa6: 4fef 001c lea %sp@(28),%sp 45aaa: 4a00 tstb %d0 45aac: 6700 0166 beqw 45c14 <== ALWAYS TAKEN /* * The timer has been started and is running. So we return the * old ones in "ovalue" */ if ( ovalue ) 45ab0: 4a84 tstl %d4 45ab2: 6700 0172 beqw 45c26 *ovalue = ptimer->timer_data; 45ab6: 220a movel %a2,%d1 45ab8: 0681 0000 0052 addil #82,%d1 45abe: 2044 moveal %d4,%a0 45ac0: 2241 moveal %d1,%a1 45ac2: 200a movel %a2,%d0 45ac4: 0680 0000 0056 addil #86,%d0 45aca: 47ea 005a lea %a2@(90),%a3 45ace: 280a movel %a2,%d4 45ad0: 0684 0000 005e addil #94,%d4 45ad6: 20d1 movel %a1@,%a0@+ 45ad8: 2240 moveal %d0,%a1 45ada: 20d1 movel %a1@,%a0@+ 45adc: 2244 moveal %d4,%a1 45ade: 20d3 movel %a3@,%a0@+ 45ae0: 2091 movel %a1@,%a0@ ptimer->timer_data = normalize; 45ae2: 2041 moveal %d1,%a0 45ae4: 2243 moveal %d3,%a1 45ae6: 2091 movel %a1@,%a0@ 45ae8: 2040 moveal %d0,%a0 45aea: 2242 moveal %d2,%a1 45aec: 2091 movel %a1@,%a0@ 45aee: 2044 moveal %d4,%a0 45af0: 2694 movel %a4@,%a3@ 45af2: 2095 movel %a5@,%a0@ /* Indicate that the time is running */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; 45af4: 7003 moveq #3,%d0 45af6: 1540 003c moveb %d0,%a2@(60) _TOD_Get( &ptimer->time ); 45afa: 486a 006a pea %a2@(106) 45afe: 4eb9 0004 7470 jsr 47470 <_TOD_Get> _Thread_Enable_dispatch(); 45b04: 4eb9 0004 868c jsr 4868c <_Thread_Enable_dispatch> return 0; 45b0a: 588f addql #4,%sp ptimer->timer_data = normalize; /* Indicate that the time is running */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; _TOD_Get( &ptimer->time ); _Thread_Enable_dispatch(); 45b0c: 4280 clrl %d0 case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EINVAL ); } 45b0e: 4cee 3c1c ffc8 moveml %fp@(-56),%d2-%d4/%a2-%a5 45b14: 4e5e unlk %fp 45b16: 4e75 rts if ( flags != TIMER_ABSTIME && flags != POSIX_TIMER_RELATIVE ) { rtems_set_errno_and_return_minus_one( EINVAL ); } normalize = *value; 45b18: 260e movel %fp,%d3 45b1a: 0683 ffff ffe4 addil #-28,%d3 45b20: 204b moveal %a3,%a0 45b22: 2243 moveal %d3,%a1 45b24: 240e movel %fp,%d2 45b26: 0682 ffff ffe8 addil #-24,%d2 45b2c: 200e movel %fp,%d0 45b2e: 0680 ffff ffec addil #-20,%d0 /* Convert absolute to relative time */ if (flags == TIMER_ABSTIME) { struct timespec now; _TOD_Get( &now ); /* Check for seconds in the past */ if ( _Timespec_Greater_than( &now, &normalize.it_value ) ) 45b34: 2840 moveal %d0,%a4 if ( flags != TIMER_ABSTIME && flags != POSIX_TIMER_RELATIVE ) { rtems_set_errno_and_return_minus_one( EINVAL ); } normalize = *value; 45b36: 4bee fff0 lea %fp@(-16),%a5 /* Convert absolute to relative time */ if (flags == TIMER_ABSTIME) { struct timespec now; _TOD_Get( &now ); 45b3a: 45ee fff4 lea %fp@(-12),%a2 if ( flags != TIMER_ABSTIME && flags != POSIX_TIMER_RELATIVE ) { rtems_set_errno_and_return_minus_one( EINVAL ); } normalize = *value; 45b3e: 2298 movel %a0@+,%a1@ 45b40: 2242 moveal %d2,%a1 45b42: 2298 movel %a0@+,%a1@ 45b44: 2898 movel %a0@+,%a4@ 45b46: 2a90 movel %a0@,%a5@ /* Convert absolute to relative time */ if (flags == TIMER_ABSTIME) { struct timespec now; _TOD_Get( &now ); 45b48: 2f0a movel %a2,%sp@- 45b4a: 4eb9 0004 7470 jsr 47470 <_TOD_Get> /* Check for seconds in the past */ if ( _Timespec_Greater_than( &now, &normalize.it_value ) ) 45b50: 2f0c movel %a4,%sp@- 45b52: 2f0a movel %a2,%sp@- 45b54: 4eb9 0004 951c jsr 4951c <_Timespec_Greater_than> 45b5a: 4fef 000c lea %sp@(12),%sp 45b5e: 4a00 tstb %d0 45b60: 6632 bnes 45b94 rtems_set_errno_and_return_minus_one( EINVAL ); _Timespec_Subtract( &now, &normalize.it_value, &normalize.it_value ); 45b62: 2f0c movel %a4,%sp@- 45b64: 2f0c movel %a4,%sp@- 45b66: 2f0a movel %a2,%sp@- 45b68: 4eb9 0004 9550 jsr 49550 <_Timespec_Subtract> 45b6e: 4fef 000c lea %sp@(12),%sp 45b72: 486e fffc pea %fp@(-4) 45b76: 2f2e 0008 movel %fp@(8),%sp@- 45b7a: 4879 0006 0108 pea 60108 <_POSIX_Timer_Information> 45b80: 4eb9 0004 7e7c jsr 47e7c <_Objects_Get> * something with the structure of times of the timer: to stop, start * or start it again */ ptimer = _POSIX_Timer_Get( timerid, &location ); switch ( location ) { 45b86: 4fef 000c lea %sp@(12),%sp 45b8a: 2440 moveal %d0,%a2 45b8c: 4aae fffc tstl %fp@(-4) 45b90: 6700 fedc beqw 45a6e #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EINVAL ); 45b94: 4eb9 0004 f6b4 jsr 4f6b4 <__errno> 45b9a: 7216 moveq #22,%d1 45b9c: 2040 moveal %d0,%a0 45b9e: 70ff moveq #-1,%d0 } 45ba0: 4cee 3c1c ffc8 moveml %fp@(-56),%d2-%d4/%a2-%a5 #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EINVAL ); 45ba6: 2081 movel %d1,%a0@ } 45ba8: 4e5e unlk %fp 45baa: 4e75 rts case OBJECTS_LOCAL: /* First, it verifies if the timer must be stopped */ if ( normalize.it_value.tv_sec == 0 && normalize.it_value.tv_nsec == 0 ) { /* Stop the timer */ (void) _Watchdog_Remove( &ptimer->Timer ); 45bac: 486a 0010 pea %a2@(16) 45bb0: 4eb9 0004 99f8 jsr 499f8 <_Watchdog_Remove> /* The old data of the timer are returned */ if ( ovalue ) 45bb6: 588f addql #4,%sp 45bb8: 4a84 tstl %d4 45bba: 6700 00b6 beqw 45c72 *ovalue = ptimer->timer_data; 45bbe: 220a movel %a2,%d1 45bc0: 0681 0000 0052 addil #82,%d1 45bc6: 2244 moveal %d4,%a1 45bc8: 2041 moveal %d1,%a0 45bca: 200a movel %a2,%d0 45bcc: 0680 0000 0056 addil #86,%d0 45bd2: 47ea 005a lea %a2@(90),%a3 45bd6: 280a movel %a2,%d4 45bd8: 0684 0000 005e addil #94,%d4 45bde: 22d0 movel %a0@,%a1@+ 45be0: 2040 moveal %d0,%a0 45be2: 22d0 movel %a0@,%a1@+ 45be4: 2044 moveal %d4,%a0 45be6: 22d3 movel %a3@,%a1@+ 45be8: 2290 movel %a0@,%a1@ /* The new data are set */ ptimer->timer_data = normalize; 45bea: 2241 moveal %d1,%a1 45bec: 2043 moveal %d3,%a0 45bee: 2290 movel %a0@,%a1@ 45bf0: 2240 moveal %d0,%a1 45bf2: 2042 moveal %d2,%a0 45bf4: 2290 movel %a0@,%a1@ 45bf6: 2244 moveal %d4,%a1 45bf8: 2694 movel %a4@,%a3@ 45bfa: 2295 movel %a5@,%a1@ /* Indicates that the timer is created and stopped */ ptimer->state = POSIX_TIMER_STATE_CREATE_STOP; 45bfc: 7004 moveq #4,%d0 45bfe: 1540 003c moveb %d0,%a2@(60) /* Returns with success */ _Thread_Enable_dispatch(); 45c02: 4eb9 0004 868c jsr 4868c <_Thread_Enable_dispatch> 45c08: 4280 clrl %d0 case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EINVAL ); } 45c0a: 4cee 3c1c ffc8 moveml %fp@(-56),%d2-%d4/%a2-%a5 45c10: 4e5e unlk %fp 45c12: 4e75 rts ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) { _Thread_Enable_dispatch(); 45c14: 4eb9 0004 868c jsr 4868c <_Thread_Enable_dispatch> 45c1a: 4280 clrl %d0 case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EINVAL ); } 45c1c: 4cee 3c1c ffc8 moveml %fp@(-56),%d2-%d4/%a2-%a5 45c22: 4e5e unlk %fp 45c24: 4e75 rts 45c26: 220a movel %a2,%d1 45c28: 0681 0000 0052 addil #82,%d1 * The timer has been started and is running. So we return the * old ones in "ovalue" */ if ( ovalue ) *ovalue = ptimer->timer_data; ptimer->timer_data = normalize; 45c2e: 2041 moveal %d1,%a0 45c30: 2243 moveal %d3,%a1 45c32: 200a movel %a2,%d0 45c34: 0680 0000 0056 addil #86,%d0 45c3a: 47ea 005a lea %a2@(90),%a3 45c3e: 280a movel %a2,%d4 45c40: 0684 0000 005e addil #94,%d4 45c46: 2091 movel %a1@,%a0@ 45c48: 2040 moveal %d0,%a0 45c4a: 2242 moveal %d2,%a1 45c4c: 2091 movel %a1@,%a0@ 45c4e: 2044 moveal %d4,%a0 45c50: 2694 movel %a4@,%a3@ 45c52: 2095 movel %a5@,%a0@ /* Indicate that the time is running */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; 45c54: 7003 moveq #3,%d0 45c56: 1540 003c moveb %d0,%a2@(60) _TOD_Get( &ptimer->time ); 45c5a: 486a 006a pea %a2@(106) 45c5e: 4eb9 0004 7470 jsr 47470 <_TOD_Get> _Thread_Enable_dispatch(); 45c64: 4eb9 0004 868c jsr 4868c <_Thread_Enable_dispatch> return 0; 45c6a: 588f addql #4,%sp ptimer->timer_data = normalize; /* Indicate that the time is running */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; _TOD_Get( &ptimer->time ); _Thread_Enable_dispatch(); 45c6c: 4280 clrl %d0 45c6e: 6000 fe9e braw 45b0e <== ALWAYS TAKEN 45c72: 220a movel %a2,%d1 45c74: 0681 0000 0052 addil #82,%d1 (void) _Watchdog_Remove( &ptimer->Timer ); /* The old data of the timer are returned */ if ( ovalue ) *ovalue = ptimer->timer_data; /* The new data are set */ ptimer->timer_data = normalize; 45c7a: 2241 moveal %d1,%a1 45c7c: 2043 moveal %d3,%a0 45c7e: 200a movel %a2,%d0 45c80: 0680 0000 0056 addil #86,%d0 45c86: 47ea 005a lea %a2@(90),%a3 45c8a: 280a movel %a2,%d4 45c8c: 0684 0000 005e addil #94,%d4 45c92: 2290 movel %a0@,%a1@ 45c94: 2240 moveal %d0,%a1 45c96: 2042 moveal %d2,%a0 45c98: 2290 movel %a0@,%a1@ 45c9a: 2244 moveal %d4,%a1 45c9c: 2694 movel %a4@,%a3@ 45c9e: 2295 movel %a5@,%a1@ /* Indicates that the timer is created and stopped */ ptimer->state = POSIX_TIMER_STATE_CREATE_STOP; 45ca0: 7004 moveq #4,%d0 45ca2: 1540 003c moveb %d0,%a2@(60) /* Returns with success */ _Thread_Enable_dispatch(); 45ca6: 4eb9 0004 868c jsr 4868c <_Thread_Enable_dispatch> 45cac: 4280 clrl %d0 45cae: 6000 ff5a braw 45c0a <== ALWAYS TAKEN ... 0004b4a0 : useconds_t ualarm( useconds_t useconds, useconds_t interval ) { 4b4a0: 4e56 ffe8 linkw %fp,#-24 4b4a4: 48d7 041c moveml %d2-%d4/%a2,%sp@ 4b4a8: 242e 0008 movel %fp@(8),%d2 /* * Initialize the timer used to implement alarm(). */ if ( !the_timer->routine ) { 4b4ac: 4ab9 0005 f96e tstl 5f96e <_POSIX_signals_Ualarm_timer+0x1c> 4b4b2: 6700 0086 beqw 4b53a _Watchdog_Initialize( the_timer, _POSIX_signals_Ualarm_TSR, 0, NULL ); } else { Watchdog_States state; state = _Watchdog_Remove( the_timer ); 4b4b6: 4879 0005 f952 pea 5f952 <_POSIX_signals_Ualarm_timer> 4b4bc: 4eb9 0004 90a0 jsr 490a0 <_Watchdog_Remove> if ( (state == WATCHDOG_ACTIVE) || (state == WATCHDOG_REMOVE_IT) ) { 4b4c2: 588f addql #4,%sp 4b4c4: 7201 moveq #1,%d1 4b4c6: 5580 subql #2,%d0 4b4c8: b280 cmpl %d0,%d1 4b4ca: 6400 0098 bccw 4b564 <== NEVER TAKEN 4b4ce: 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 ) { 4b4d0: 4a82 tstl %d2 <== NOT EXECUTED 4b4d2: 660c bnes 4b4e0 <== NOT EXECUTED _Watchdog_Insert_ticks( the_timer, _Timespec_To_ticks( &tp ) ); } return remaining; } 4b4d4: 2003 movel %d3,%d0 4b4d6: 4cee 041c ffe8 moveml %fp@(-24),%d2-%d4/%a2 4b4dc: 4e5e unlk %fp 4b4de: 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 ); 4b4e0: 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; 4b4e2: 223c 000f 4240 movel #1000000,%d1 tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; ticks = _Timespec_To_ticks( &tp ); 4b4e8: 5184 subql #8,%d4 4b4ea: 45f9 0004 c5c4 lea 4c5c4 <_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; 4b4f0: 4c41 2000 remul %d1,%d0,%d2 4b4f4: 4c41 2002 remul %d1,%d2,%d2 tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; 4b4f8: 223c 0000 03e8 movel #1000,%d1 * less than a single clock tick, then fudge it to a clock tick. */ if ( useconds ) { Watchdog_Interval ticks; tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND; 4b4fe: 2d42 fff8 movel %d2,%fp@(-8) tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; 4b502: 4c00 1800 mulsl %d0,%d1 ticks = _Timespec_To_ticks( &tp ); 4b506: 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; 4b508: 2d41 fffc movel %d1,%fp@(-4) ticks = _Timespec_To_ticks( &tp ); 4b50c: 4e92 jsr %a2@ if ( ticks == 0 ) ticks = 1; _Watchdog_Insert_ticks( the_timer, _Timespec_To_ticks( &tp ) ); 4b50e: 2f04 movel %d4,%sp@- 4b510: 4e92 jsr %a2@ 4b512: 4879 0005 f952 pea 5f952 <_POSIX_signals_Ualarm_timer> 4b518: 4879 0005 f22c pea 5f22c <_Watchdog_Ticks_chain> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 4b51e: 23c0 0005 f95e movel %d0,5f95e <_POSIX_signals_Ualarm_timer+0xc> _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 4b524: 4eb9 0004 8f58 jsr 48f58 <_Watchdog_Insert> 4b52a: 4fef 0010 lea %sp@(16),%sp } return remaining; } 4b52e: 2003 movel %d3,%d0 4b530: 4cee 041c ffe8 moveml %fp@(-24),%d2-%d4/%a2 4b536: 4e5e unlk %fp 4b538: 4e75 rts Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 4b53a: 42b9 0005 f95a clrl 5f95a <_POSIX_signals_Ualarm_timer+0x8> the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 4b540: 4283 clrl %d3 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 4b542: 203c 0004 b5ac movel #308652,%d0 the_watchdog->id = id; 4b548: 42b9 0005 f972 clrl 5f972 <_POSIX_signals_Ualarm_timer+0x20> Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 4b54e: 23c0 0005 f96e movel %d0,5f96e <_POSIX_signals_Ualarm_timer+0x1c> the_watchdog->id = id; the_watchdog->user_data = user_data; 4b554: 42b9 0005 f976 clrl 5f976 <_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 ) { 4b55a: 4a82 tstl %d2 4b55c: 6700 ff76 beqw 4b4d4 <== ALWAYS TAKEN 4b560: 6000 ff7e braw 4b4e0 <== ALWAYS TAKEN * 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); 4b564: 2039 0005 f966 movel 5f966 <_POSIX_signals_Ualarm_timer+0x14>,%d0 4b56a: d0b9 0005 f95e addl 5f95e <_POSIX_signals_Ualarm_timer+0xc>,%d0 /* remaining is now in ticks */ _Timespec_From_ticks( ticks, &tp ); 4b570: 486e fff8 pea %fp@(-8) 4b574: 90b9 0005 f96a subl 5f96a <_POSIX_signals_Ualarm_timer+0x18>,%d0 remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND; 4b57a: 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 ); 4b580: 2f00 movel %d0,%sp@- 4b582: 4eb9 0004 c588 jsr 4c588 <_Timespec_From_ticks> remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND; 4b588: 202e fff8 movel %fp@(-8),%d0 4b58c: 4c04 0800 mulsl %d4,%d0 remaining += tp.tv_nsec / 1000; 4b590: 283c 0000 03e8 movel #1000,%d4 4b596: 508f addql #8,%sp 4b598: 262e fffc movel %fp@(-4),%d3 4b59c: 4c44 3803 remsl %d4,%d3,%d3 4b5a0: 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 ) { 4b5a2: 4a82 tstl %d2 4b5a4: 6700 ff2e beqw 4b4d4 <== NEVER TAKEN 4b5a8: 6000 ff36 braw 4b4e0 <== NOT EXECUTED