0004576c <_API_extensions_Run_postdriver>: * * _API_extensions_Run_postdriver */ void _API_extensions_Run_postdriver( void ) { 4576c: 4e56 0000 linkw %fp,#0 45770: 2f0a movel %a2,%sp@- Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _API_extensions_List.first ; 45772: 2479 0005 d064 moveal 5d064 <_API_extensions_List>,%a2 45778: 6008 bras 45782 <_API_extensions_Run_postdriver+0x16> <== 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)(); 4577a: 206a 0008 moveal %a2@(8),%a0 4577e: 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 ) { 45780: 2452 moveal %a2@,%a2 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 45782: b5fc 0005 d068 cmpal #381032,%a2 45788: 66f0 bnes 4577a <_API_extensions_Run_postdriver+0xe> #if defined(FUNCTIONALITY_NOT_CURRENTLY_USED_BY_ANY_API) if ( the_extension->postdriver_hook ) #endif (*the_extension->postdriver_hook)(); } } 4578a: 246e fffc moveal %fp@(-4),%a2 4578e: 4e5e unlk %fp 45790: 4e75 rts 00045792 <_API_extensions_Run_postswitch>: * * _API_extensions_Run_postswitch */ void _API_extensions_Run_postswitch( void ) { 45792: 4e56 0000 linkw %fp,#0 45796: 2f0a movel %a2,%sp@- Chain_Node *the_node; API_extensions_Control *the_extension; for ( the_node = _API_extensions_List.first ; 45798: 2479 0005 d064 moveal 5d064 <_API_extensions_List>,%a2 4579e: 6010 bras 457b0 <_API_extensions_Run_postswitch+0x1e> <== ALWAYS TAKEN * provide this hook. */ #if defined(RTEMS_ITRON_API) if ( the_extension->postswitch_hook ) #endif (*the_extension->postswitch_hook)( _Thread_Executing ); 457a0: 2f39 0005 cf7e movel 5cf7e <_Thread_Executing>,%sp@- 457a6: 206a 000c moveal %a2@(12),%a0 457aa: 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 ) { 457ac: 2452 moveal %a2@,%a2 457ae: 588f addql #4,%sp 457b0: b5fc 0005 d068 cmpal #381032,%a2 457b6: 66e8 bnes 457a0 <_API_extensions_Run_postswitch+0xe> #if defined(RTEMS_ITRON_API) if ( the_extension->postswitch_hook ) #endif (*the_extension->postswitch_hook)( _Thread_Executing ); } } 457b8: 246e fffc moveal %fp@(-4),%a2 457bc: 4e5e unlk %fp 457be: 4e75 rts 000477ec <_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 ); 477ec: 203c 0000 0700 movel #1792,%d0 Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_RWLock_API_mp_support_callout api_rwlock_mp_support ) { 477f2: 4e56 ffe8 linkw %fp,#-24 477f6: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@ 477fa: 246e 0008 moveal %fp@(8),%a2 477fe: 282e 000c movel %fp@(12),%d4 47802: 262e 0014 movel %fp@(20),%d3 47806: 1a2e 0013 moveb %fp@(19),%d5 ISR_Level level; Thread_Control *executing = _Thread_Executing; 4780a: 2679 0005 f8e2 moveal 5f8e2 <_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 ); 47810: 40c2 movew %sr,%d2 47812: 8082 orl %d2,%d0 47814: 46c0 movew %d0,%sr switch ( the_rwlock->current_state ) { 47816: 202a 0044 movel %a2@(68),%d0 4781a: 6708 beqs 47824 <_CORE_RWLock_Obtain_for_reading+0x38> 4781c: 7201 moveq #1,%d1 4781e: b280 cmpl %d0,%d1 47820: 662a bnes 4784c <_CORE_RWLock_Obtain_for_reading+0x60> 47822: 600e bras 47832 <_CORE_RWLock_Obtain_for_reading+0x46> <== ALWAYS TAKEN case CORE_RWLOCK_UNLOCKED: the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING; 47824: 7001 moveq #1,%d0 the_rwlock->number_of_readers += 1; 47826: 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; 4782a: 2540 0044 movel %d0,%a2@(68) the_rwlock->number_of_readers += 1; _ISR_Enable( level ); 4782e: 46c2 movew %d2,%sr 47830: 6014 bras 47846 <_CORE_RWLock_Obtain_for_reading+0x5a> <== ALWAYS TAKEN 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 ); 47832: 2f0a movel %a2,%sp@- 47834: 4eb9 0004 92e4 jsr 492e4 <_Thread_queue_First> if ( !waiter ) { 4783a: 588f addql #4,%sp 4783c: 4a80 tstl %d0 4783e: 660c bnes 4784c <_CORE_RWLock_Obtain_for_reading+0x60> <== ALWAYS TAKEN the_rwlock->number_of_readers += 1; 47840: 52aa 0048 addql #1,%a2@(72) _ISR_Enable( level ); 47844: 46c2 movew %d2,%sr executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 47846: 42ab 0034 clrl %a3@(52) return; 4784a: 6046 bras 47892 <_CORE_RWLock_Obtain_for_reading+0xa6> <== ALWAYS TAKEN /* * If the thread is not willing to wait, then return immediately. */ if ( !wait ) { 4784c: 4a05 tstb %d5 4784e: 660a bnes 4785a <_CORE_RWLock_Obtain_for_reading+0x6e> _ISR_Enable( level ); 47850: 46c2 movew %d2,%sr executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; 47852: 7202 moveq #2,%d1 47854: 2741 0034 movel %d1,%a3@(52) 47858: 6038 bras 47892 <_CORE_RWLock_Obtain_for_reading+0xa6> <== ALWAYS TAKEN 4785a: 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; 4785c: 2744 0020 movel %d4,%a3@(32) executing->Wait.option = CORE_RWLOCK_THREAD_WAITING_FOR_READ; executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 47860: 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; 47864: 274a 0044 movel %a2,%a3@(68) executing->Wait.id = id; executing->Wait.option = CORE_RWLOCK_THREAD_WAITING_FOR_READ; 47868: 42ab 0030 clrl %a3@(48) 4786c: 2540 0030 movel %d0,%a2@(48) executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; _ISR_Enable( level ); 47870: 46c2 movew %d2,%sr _Thread_queue_Enqueue_with_handler( 47872: 2d43 000c movel %d3,%fp@(12) 47876: 223c 0004 79dc movel #293340,%d1 4787c: 2d4a 0008 movel %a2,%fp@(8) timeout, _CORE_RWLock_Timeout ); /* return to API level so it can dispatch and we block */ } 47880: 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( 47886: 2d41 0010 movel %d1,%fp@(16) timeout, _CORE_RWLock_Timeout ); /* return to API level so it can dispatch and we block */ } 4788a: 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( 4788c: 4ef9 0004 8fe4 jmp 48fe4 <_Thread_queue_Enqueue_with_handler> timeout, _CORE_RWLock_Timeout ); /* return to API level so it can dispatch and we block */ } 47892: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 47898: 4e5e unlk %fp 4789a: 4e75 rts 0004789c <_CORE_RWLock_Obtain_for_writing>: * Otherwise, we have to block. * If locked for reading and no waiters, then OK to read. * If any thread is waiting, then we wait. */ _ISR_Disable( level ); 4789c: 223c 0000 0700 movel #1792,%d1 Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_RWLock_API_mp_support_callout api_rwlock_mp_support ) { 478a2: 4e56 fff4 linkw %fp,#-12 478a6: 226e 0008 moveal %fp@(8),%a1 478aa: 48d7 001c moveml %d2-%d4,%sp@ 478ae: 262e 000c movel %fp@(12),%d3 478b2: 282e 0010 movel %fp@(16),%d4 478b6: 242e 0014 movel %fp@(20),%d2 ISR_Level level; Thread_Control *executing = _Thread_Executing; 478ba: 2079 0005 f8e2 moveal 5f8e2 <_Thread_Executing>,%a0 * 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 ); 478c0: 40c0 movew %sr,%d0 478c2: 8280 orl %d0,%d1 478c4: 46c1 movew %d1,%sr switch ( the_rwlock->current_state ) { 478c6: 4aa9 0044 tstl %a1@(68) 478ca: 660e bnes 478da <_CORE_RWLock_Obtain_for_writing+0x3e> case CORE_RWLOCK_UNLOCKED: the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_WRITING; 478cc: 7202 moveq #2,%d1 478ce: 2341 0044 movel %d1,%a1@(68) _ISR_Enable( level ); 478d2: 46c0 movew %d0,%sr executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 478d4: 42a8 0034 clrl %a0@(52) return; 478d8: 6044 bras 4791e <_CORE_RWLock_Obtain_for_writing+0x82> <== ALWAYS TAKEN /* * If the thread is not willing to wait, then return immediately. */ if ( !wait ) { 478da: 4a04 tstb %d4 478dc: 660a bnes 478e8 <_CORE_RWLock_Obtain_for_writing+0x4c> _ISR_Enable( level ); 478de: 46c0 movew %d0,%sr executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; 478e0: 7002 moveq #2,%d0 478e2: 2140 0034 movel %d0,%a0@(52) 478e6: 6036 bras 4791e <_CORE_RWLock_Obtain_for_writing+0x82> <== ALWAYS TAKEN */ _Thread_queue_Enter_critical_section( &the_rwlock->Wait_queue ); executing->Wait.queue = &the_rwlock->Wait_queue; executing->Wait.id = id; executing->Wait.option = CORE_RWLOCK_THREAD_WAITING_FOR_WRITE; 478e8: 7201 moveq #1,%d1 * 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; 478ea: 2143 0020 movel %d3,%a0@(32) executing->Wait.option = CORE_RWLOCK_THREAD_WAITING_FOR_WRITE; executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 478ee: 42a8 0034 clrl %a0@(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; 478f2: 2149 0044 movel %a1,%a0@(68) executing->Wait.id = id; executing->Wait.option = CORE_RWLOCK_THREAD_WAITING_FOR_WRITE; 478f6: 2141 0030 movel %d1,%a0@(48) 478fa: 2341 0030 movel %d1,%a1@(48) executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; _ISR_Enable( level ); 478fe: 46c0 movew %d0,%sr _Thread_queue_Enqueue_with_handler( 47900: 2d42 000c movel %d2,%fp@(12) 47904: 203c 0004 79dc movel #293340,%d0 4790a: 2d49 0008 movel %a1,%fp@(8) 4790e: 2d40 0010 movel %d0,%fp@(16) _CORE_RWLock_Timeout ); /* return to API level so it can dispatch and we block */ } 47912: 4cd7 001c moveml %sp@,%d2-%d4 47916: 4e5e unlk %fp executing->Wait.id = id; executing->Wait.option = CORE_RWLOCK_THREAD_WAITING_FOR_WRITE; executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; _ISR_Enable( level ); _Thread_queue_Enqueue_with_handler( 47918: 4ef9 0004 8fe4 jmp 48fe4 <_Thread_queue_Enqueue_with_handler> _CORE_RWLock_Timeout ); /* return to API level so it can dispatch and we block */ } 4791e: 4cd7 001c moveml %sp@,%d2-%d4 47922: 4e5e unlk %fp 47924: 4e75 rts ... 00047928 <_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 ); 47928: 223c 0000 0700 movel #1792,%d1 */ CORE_RWLock_Status _CORE_RWLock_Release( CORE_RWLock_Control *the_rwlock ) { 4792e: 4e56 fff0 linkw %fp,#-16 ISR_Level level; Thread_Control *executing = _Thread_Executing; 47932: 2079 0005 f8e2 moveal 5f8e2 <_Thread_Executing>,%a0 */ CORE_RWLock_Status _CORE_RWLock_Release( CORE_RWLock_Control *the_rwlock ) { 47938: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ 4793c: 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 ); 47940: 40c0 movew %sr,%d0 47942: 8280 orl %d0,%d1 47944: 46c1 movew %d1,%sr if ( the_rwlock->current_state == CORE_RWLOCK_UNLOCKED){ 47946: 222a 0044 movel %a2@(68),%d1 4794a: 660a bnes 47956 <_CORE_RWLock_Release+0x2e> _ISR_Enable( level ); 4794c: 46c0 movew %d0,%sr executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; 4794e: 7002 moveq #2,%d0 47950: 2140 0034 movel %d0,%a0@(52) return CORE_RWLOCK_SUCCESSFUL; 47954: 6078 bras 479ce <_CORE_RWLock_Release+0xa6> <== ALWAYS TAKEN } if ( the_rwlock->current_state == CORE_RWLOCK_LOCKED_FOR_READING ) { 47956: 7401 moveq #1,%d2 47958: b481 cmpl %d1,%d2 4795a: 6610 bnes 4796c <_CORE_RWLock_Release+0x44> the_rwlock->number_of_readers -= 1; 4795c: 222a 0048 movel %a2@(72),%d1 47960: 5381 subql #1,%d1 47962: 2541 0048 movel %d1,%a2@(72) if ( the_rwlock->number_of_readers != 0 ) { 47966: 6704 beqs 4796c <_CORE_RWLock_Release+0x44> /* must be unlocked again */ _ISR_Enable( level ); 47968: 46c0 movew %d0,%sr return CORE_RWLOCK_SUCCESSFUL; 4796a: 6062 bras 479ce <_CORE_RWLock_Release+0xa6> <== ALWAYS TAKEN } } /* CORE_RWLOCK_LOCKED_FOR_WRITING or READING with readers */ executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 4796c: 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; 47970: 42aa 0044 clrl %a2@(68) _ISR_Enable( level ); 47974: 46c0 movew %d0,%sr next = _Thread_queue_Dequeue( &the_rwlock->Wait_queue ); 47976: 2f0a movel %a2,%sp@- 47978: 4eb9 0004 8ea4 jsr 48ea4 <_Thread_queue_Dequeue> if ( next ) { 4797e: 588f addql #4,%sp 47980: 4a80 tstl %d0 47982: 674a beqs 479ce <_CORE_RWLock_Release+0xa6> if ( next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) { 47984: 7201 moveq #1,%d1 47986: 2040 moveal %d0,%a0 47988: b2a8 0030 cmpl %a0@(48),%d1 4798c: 6608 bnes 47996 <_CORE_RWLock_Release+0x6e> the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_WRITING; 4798e: 7002 moveq #2,%d0 47990: 2540 0044 movel %d0,%a2@(68) return CORE_RWLOCK_SUCCESSFUL; 47994: 6038 bras 479ce <_CORE_RWLock_Release+0xa6> <== ALWAYS TAKEN /* * Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING */ the_rwlock->number_of_readers += 1; the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING; 47996: 7201 moveq #1,%d1 } /* * Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING */ the_rwlock->number_of_readers += 1; 47998: 52aa 0048 addql #1,%a2@(72) /* * Now see if more readers can be let go. */ while ( 1 ) { next = _Thread_queue_First( &the_rwlock->Wait_queue ); 4799c: 49f9 0004 92e4 lea 492e4 <_Thread_queue_First>,%a4 if ( !next || next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) return CORE_RWLOCK_SUCCESSFUL; the_rwlock->number_of_readers += 1; _Thread_queue_Extract( &the_rwlock->Wait_queue, next ); 479a2: 47f9 0004 91b8 lea 491b8 <_Thread_queue_Extract>,%a3 /* * Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING */ the_rwlock->number_of_readers += 1; the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING; 479a8: 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 ); 479ac: 2f0a movel %a2,%sp@- 479ae: 4e94 jsr %a4@ if ( !next || 479b0: 588f addql #4,%sp 479b2: 4a80 tstl %d0 479b4: 6718 beqs 479ce <_CORE_RWLock_Release+0xa6> next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) 479b6: 7401 moveq #1,%d2 479b8: 2040 moveal %d0,%a0 479ba: b4a8 0030 cmpl %a0@(48),%d2 479be: 670e beqs 479ce <_CORE_RWLock_Release+0xa6> <== ALWAYS TAKEN return CORE_RWLOCK_SUCCESSFUL; the_rwlock->number_of_readers += 1; 479c0: 52aa 0048 addql #1,%a2@(72) _Thread_queue_Extract( &the_rwlock->Wait_queue, next ); 479c4: 2f00 movel %d0,%sp@- 479c6: 2f0a movel %a2,%sp@- 479c8: 4e93 jsr %a3@ } 479ca: 508f addql #8,%sp 479cc: 60de bras 479ac <_CORE_RWLock_Release+0x84> <== ALWAYS TAKEN } /* indentation is to match _ISR_Disable at top */ return CORE_RWLOCK_SUCCESSFUL; } 479ce: 4280 clrl %d0 479d0: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 479d6: 4e5e unlk %fp 479d8: 4e75 rts ... 000479dc <_CORE_RWLock_Timeout>: void _CORE_RWLock_Timeout( Objects_Id id, void *ignored ) { 479dc: 4e56 fffc linkw %fp,#-4 Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 479e0: 486e fffc pea %fp@(-4) 479e4: 2f2e 0008 movel %fp@(8),%sp@- 479e8: 4eb9 0004 8b80 jsr 48b80 <_Thread_Get> switch ( location ) { 479ee: 508f addql #8,%sp 479f0: 4aae fffc tstl %fp@(-4) 479f4: 6618 bnes 47a0e <_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 ); 479f6: 2f00 movel %d0,%sp@- 479f8: 4eb9 0004 93c8 jsr 493c8 <_Thread_queue_Process_timeout> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 479fe: 588f addql #4,%sp 47a00: 2039 0005 f828 movel 5f828 <_Thread_Dispatch_disable_level>,%d0 47a06: 5380 subql #1,%d0 47a08: 23c0 0005 f828 movel %d0,5f828 <_Thread_Dispatch_disable_level> _Thread_Unnest_dispatch(); break; } } 47a0e: 4e5e unlk %fp 47a10: 4e75 rts ... 0004c184 <_CORE_barrier_Release>: #else Objects_Id id __attribute__((unused)), CORE_barrier_API_mp_support_callout api_barrier_mp_support __attribute__((unused)) #endif ) { 4c184: 4e56 fff4 linkw %fp,#-12 4c188: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 4c18c: 246e 0008 moveal %fp@(8),%a2 Thread_Control *the_thread; uint32_t count; count = 0; while ( (the_thread = _Thread_queue_Dequeue(&the_barrier->Wait_queue)) ) { 4c190: 4282 clrl %d2 4c192: 47f9 0004 7038 lea 47038 <_Thread_queue_Dequeue>,%a3 4c198: 6002 bras 4c19c <_CORE_barrier_Release+0x18> <== ALWAYS TAKEN #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_barrier_mp_support) ( the_thread, id ); #endif count++; 4c19a: 5282 addql #1,%d2 { Thread_Control *the_thread; uint32_t count; count = 0; while ( (the_thread = _Thread_queue_Dequeue(&the_barrier->Wait_queue)) ) { 4c19c: 2f0a movel %a2,%sp@- 4c19e: 4e93 jsr %a3@ 4c1a0: 588f addql #4,%sp 4c1a2: 4a80 tstl %d0 4c1a4: 66f4 bnes 4c19a <_CORE_barrier_Release+0x16> #endif count++; } the_barrier->number_of_waiting_threads = 0; return count; } 4c1a6: 2002 movel %d2,%d0 if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_barrier_mp_support) ( the_thread, id ); #endif count++; } the_barrier->number_of_waiting_threads = 0; 4c1a8: 42aa 0048 clrl %a2@(72) return count; } 4c1ac: 4cee 0c04 fff4 moveml %fp@(-12),%d2/%a2-%a3 4c1b2: 4e5e unlk %fp 4c1b4: 4e75 rts ... 0005192c <_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 ) { 5192c: 4e56 ffe0 linkw %fp,#-32 51930: 48d7 3c3c moveml %d2-%d5/%a2-%a5,%sp@ 51934: 246e 0008 moveal %fp@(8),%a2 51938: 2a2e 000c movel %fp@(12),%d5 5193c: 262e 0010 movel %fp@(16),%d3 51940: 286e 001c moveal %fp@(28),%a4 Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; if ( size > the_message_queue->maximum_message_size ) { 51944: b6aa 004c cmpl %a2@(76),%d3 51948: 6304 blss 5194e <_CORE_message_queue_Broadcast+0x22> <== NEVER TAKEN 5194a: 7001 moveq #1,%d0 <== NOT EXECUTED 5194c: 6042 bras 51990 <_CORE_message_queue_Broadcast+0x64> <== NOT EXECUTED * NOTE: This check is critical because threads can block on * send and receive and this ensures that we are broadcasting * the message to threads waiting to receive -- not to send. */ if ( the_message_queue->number_of_pending_messages != 0 ) { 5194e: 4aaa 0048 tstl %a2@(72) 51952: 6610 bnes 51964 <_CORE_message_queue_Broadcast+0x38> * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { 51954: 4282 clrl %d2 51956: 283c 0005 3c30 movel #343088,%d4 const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 5195c: 4bf9 0005 9e68 lea 59e68 ,%a5 51962: 601a bras 5197e <_CORE_message_queue_Broadcast+0x52> <== ALWAYS TAKEN * 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; 51964: 4294 clrl %a4@ 51966: 6026 bras 5198e <_CORE_message_queue_Broadcast+0x62> <== ALWAYS TAKEN 51968: 2f03 movel %d3,%sp@- */ number_broadcasted = 0; while ((the_thread = _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { waitp = &the_thread->Wait; number_broadcasted += 1; 5196a: 5282 addql #1,%d2 5196c: 2f05 movel %d5,%sp@- 5196e: 2f2b 002c movel %a3@(44),%sp@- 51972: 4e95 jsr %a5@ buffer, waitp->return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; 51974: 206b 0028 moveal %a3@(40),%a0 51978: 4fef 000c lea %sp@(12),%sp 5197c: 2083 movel %d3,%a0@ * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { 5197e: 2f0a movel %a2,%sp@- 51980: 2044 moveal %d4,%a0 51982: 4e90 jsr %a0@ /* * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = 51984: 588f addql #4,%sp _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { 51986: 2640 moveal %d0,%a3 /* * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = 51988: 4a80 tstl %d0 5198a: 66dc bnes 51968 <_CORE_message_queue_Broadcast+0x3c> if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_message_queue_mp_support) ( the_thread, id ); #endif } *count = number_broadcasted; 5198c: 2882 movel %d2,%a4@ 5198e: 4280 clrl %d0 return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; } 51990: 4cee 3c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a5 51996: 4e5e unlk %fp 51998: 4e75 rts ... 0004dce8 <_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)) { 4dce8: 7003 moveq #3,%d0 CORE_message_queue_Control *the_message_queue, CORE_message_queue_Attributes *the_message_queue_attributes, uint32_t maximum_pending_messages, size_t maximum_message_size ) { 4dcea: 4e56 fff4 linkw %fp,#-12 4dcee: 222e 0014 movel %fp@(20),%d1 4dcf2: 48d7 040c moveml %d2-%d3/%a2,%sp@ 4dcf6: 246e 0008 moveal %fp@(8),%a2 4dcfa: 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)) { 4dcfe: c081 andl %d1,%d0 ) { size_t message_buffering_required; size_t allocated_message_size; the_message_queue->maximum_pending_messages = maximum_pending_messages; 4dd00: 2542 0044 movel %d2,%a2@(68) the_message_queue->number_of_pending_messages = 0; 4dd04: 42aa 0048 clrl %a2@(72) the_message_queue->maximum_message_size = maximum_message_size; 4dd08: 2541 004c movel %d1,%a2@(76) CORE_message_queue_Control *the_message_queue, CORE_message_queue_Notify_Handler the_handler, void *the_argument ) { the_message_queue->notify_handler = the_handler; 4dd0c: 42aa 0060 clrl %a2@(96) the_message_queue->notify_argument = the_argument; 4dd10: 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)) { 4dd14: 4a80 tstl %d0 4dd16: 6604 bnes 4dd1c <_CORE_message_queue_Initialize+0x34> 4dd18: 2001 movel %d1,%d0 4dd1a: 600c bras 4dd28 <_CORE_message_queue_Initialize+0x40> <== ALWAYS TAKEN allocated_message_size += sizeof(uint32_t); 4dd1c: 2001 movel %d1,%d0 4dd1e: 5880 addql #4,%d0 allocated_message_size &= ~(sizeof(uint32_t) - 1); 4dd20: 76fc moveq #-4,%d3 4dd22: c083 andl %d3,%d0 } if (allocated_message_size < maximum_message_size) 4dd24: b280 cmpl %d0,%d1 4dd26: 626e bhis 4dd96 <_CORE_message_queue_Initialize+0xae> <== ALWAYS TAKEN /* * Calculate how much total memory is required for message buffering and * check for overflow on the multiplication. */ message_buffering_required = (size_t) maximum_pending_messages * (allocated_message_size + sizeof(CORE_message_queue_Buffer_control)); 4dd28: 2600 movel %d0,%d3 4dd2a: 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 * 4dd30: 2203 movel %d3,%d1 4dd32: 4c02 1800 mulsl %d2,%d1 (allocated_message_size + sizeof(CORE_message_queue_Buffer_control)); if (message_buffering_required < allocated_message_size) 4dd36: b081 cmpl %d1,%d0 4dd38: 625c bhis 4dd96 <_CORE_message_queue_Initialize+0xae> <== ALWAYS TAKEN return false; /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) 4dd3a: 2f01 movel %d1,%sp@- 4dd3c: 4eb9 0005 06a0 jsr 506a0 <_Workspace_Allocate> _Workspace_Allocate( message_buffering_required ); if (the_message_queue->message_buffers == 0) 4dd42: 588f addql #4,%sp return false; /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) 4dd44: 2540 005c movel %d0,%a2@(92) _Workspace_Allocate( message_buffering_required ); if (the_message_queue->message_buffers == 0) 4dd48: 674c beqs 4dd96 <_CORE_message_queue_Initialize+0xae> /* * Initialize the pool of inactive messages, pending messages, * and set of waiting threads. */ _Chain_Initialize ( 4dd4a: 2f03 movel %d3,%sp@- 4dd4c: 2f02 movel %d2,%sp@- 4dd4e: 2f00 movel %d0,%sp@- 4dd50: 486a 0068 pea %a2@(104) 4dd54: 4eb9 0005 272c jsr 5272c <_Chain_Initialize> allocated_message_size + sizeof( CORE_message_queue_Buffer_control ) ); _Chain_Initialize_empty( &the_message_queue->Pending_messages ); _Thread_queue_Initialize( 4dd5a: 4878 0006 pea 6 4dd5e: 7001 moveq #1,%d0 4dd60: 206e 000c moveal %fp@(12),%a0 4dd64: b090 cmpl %a0@,%d0 4dd66: 57c0 seq %d0 4dd68: 4878 0080 pea 80 4dd6c: 49c0 extbl %d0 4dd6e: 4480 negl %d0 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 4dd70: 41ea 0054 lea %a2@(84),%a0 4dd74: 2f00 movel %d0,%sp@- 4dd76: 2548 0050 movel %a0,%a2@(80) the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 4dd7a: 41ea 0050 lea %a2@(80),%a0 4dd7e: 2548 0058 movel %a0,%a2@(88) 4dd82: 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; 4dd84: 42aa 0054 clrl %a2@(84) 4dd88: 4eb9 0004 fbac jsr 4fbac <_Thread_queue_Initialize> THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; 4dd8e: 4fef 0020 lea %sp@(32),%sp allocated_message_size + sizeof( CORE_message_queue_Buffer_control ) ); _Chain_Initialize_empty( &the_message_queue->Pending_messages ); _Thread_queue_Initialize( 4dd92: 7001 moveq #1,%d0 THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; 4dd94: 6002 bras 4dd98 <_CORE_message_queue_Initialize+0xb0> <== ALWAYS TAKEN 4dd96: 4200 clrb %d0 } 4dd98: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 4dd9e: 4e5e unlk %fp 4dda0: 4e75 rts ... 0005276c <_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 ) { 5276c: 4e56 0000 linkw %fp,#0 52770: 226e 000c moveal %fp@(12),%a1 52774: 2f0b movel %a3,%sp@- 52776: 202e 0010 movel %fp@(16),%d0 5277a: 206e 0008 moveal %fp@(8),%a0 5277e: 2f0a movel %a2,%sp@- 52780: 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 ) { 52784: 0c80 7fff ffff cmpil #2147483647,%d0 5278a: 6628 bnes 527b4 <_CORE_message_queue_Insert_message+0x48> _ISR_Disable( level ); 5278c: 203c 0000 0700 movel #1792,%d0 52792: 40c1 movew %sr,%d1 52794: 8081 orl %d1,%d0 52796: 46c0 movew %d0,%sr Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 52798: 45e8 0054 lea %a0@(84),%a2 SET_NOTIFY(); the_message_queue->number_of_pending_messages++; 5279c: 52a8 0048 addql #1,%a0@(72) 527a0: 228a movel %a2,%a1@ old_last_node = the_chain->last; 527a2: 2468 0058 moveal %a0@(88),%a2 the_chain->last = the_node; 527a6: 2149 0058 movel %a1,%a0@(88) old_last_node->next = the_node; the_node->previous = old_last_node; 527aa: 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; 527ae: 2489 movel %a1,%a2@ _CORE_message_queue_Append_unprotected(the_message_queue, the_message); _ISR_Enable( level ); 527b0: 46c1 movew %d1,%sr 527b2: 606c bras 52820 <_CORE_message_queue_Insert_message+0xb4> <== ALWAYS TAKEN } else if ( submit_type == CORE_MESSAGE_QUEUE_URGENT_REQUEST ) { 527b4: 0c80 8000 0000 cmpil #-2147483648,%d0 527ba: 6626 bnes 527e2 <_CORE_message_queue_Insert_message+0x76> _ISR_Disable( level ); 527bc: 203c 0000 0700 movel #1792,%d0 527c2: 40c1 movew %sr,%d1 527c4: 8081 orl %d1,%d0 527c6: 46c0 movew %d0,%sr */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Head( Chain_Control *the_chain ) { return (Chain_Node *) the_chain; 527c8: 45e8 0050 lea %a0@(80),%a2 SET_NOTIFY(); the_message_queue->number_of_pending_messages++; 527cc: 52a8 0048 addql #1,%a0@(72) ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 527d0: 2652 moveal %a2@,%a3 Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 527d2: 234a 0004 movel %a2,%a1@(4) before_node = after_node->next; after_node->next = the_node; 527d6: 2489 movel %a1,%a2@ the_node->next = before_node; before_node->previous = the_node; 527d8: 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; 527dc: 228b movel %a3,%a1@ _CORE_message_queue_Prepend_unprotected(the_message_queue, the_message); _ISR_Enable( level ); 527de: 46c1 movew %d1,%sr 527e0: 603e bras 52820 <_CORE_message_queue_Insert_message+0xb4> <== ALWAYS TAKEN */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 527e2: 2208 movel %a0,%d1 527e4: 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; 527ea: 2468 0050 moveal %a0@(80),%a2 while ( !_Chain_Is_tail( the_header, the_node ) ) { 527ee: 6008 bras 527f8 <_CORE_message_queue_Insert_message+0x8c> <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE int _CORE_message_queue_Get_message_priority ( CORE_message_queue_Buffer_control *the_message ) { #if defined(RTEMS_SCORE_COREMSG_ENABLE_MESSAGE_PRIORITY) return the_message->priority; 527f0: b0aa 0008 cmpl %a2@(8),%d0 527f4: 6d06 blts 527fc <_CORE_message_queue_Insert_message+0x90> this_message = (CORE_message_queue_Buffer_control *) the_node; this_priority = _CORE_message_queue_Get_message_priority(this_message); if ( this_priority <= the_priority ) { the_node = the_node->next; 527f6: 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 ) ) { 527f8: b28a cmpl %a2,%d1 527fa: 66f4 bnes 527f0 <_CORE_message_queue_Insert_message+0x84> the_node = the_node->next; continue; } break; } _ISR_Disable( level ); 527fc: 203c 0000 0700 movel #1792,%d0 52802: 40c1 movew %sr,%d1 52804: 8081 orl %d1,%d0 52806: 46c0 movew %d0,%sr SET_NOTIFY(); the_message_queue->number_of_pending_messages++; _Chain_Insert_unprotected( the_node->previous, &the_message->Node ); 52808: 246a 0004 moveal %a2@(4),%a2 } break; } _ISR_Disable( level ); SET_NOTIFY(); the_message_queue->number_of_pending_messages++; 5280c: 52a8 0048 addql #1,%a0@(72) ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 52810: 2652 moveal %a2@,%a3 Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 52812: 234a 0004 movel %a2,%a1@(4) before_node = after_node->next; after_node->next = the_node; 52816: 2489 movel %a1,%a2@ the_node->next = before_node; before_node->previous = the_node; 52818: 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; 5281c: 228b movel %a3,%a1@ _Chain_Insert_unprotected( the_node->previous, &the_message->Node ); _ISR_Enable( level ); 5281e: 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 ) 52820: 2268 0060 moveal %a0@(96),%a1 52824: 4a89 tstl %a1 52826: 670e beqs 52836 <_CORE_message_queue_Insert_message+0xca> (*the_message_queue->notify_handler)(the_message_queue->notify_argument); 52828: 2d68 0064 0008 movel %a0@(100),%fp@(8) #endif } 5282e: 245f moveal %sp@+,%a2 52830: 265f moveal %sp@+,%a3 52832: 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); 52834: 4ed1 jmp %a1@ #endif } 52836: 245f moveal %sp@+,%a2 52838: 265f moveal %sp@+,%a3 5283a: 4e5e unlk %fp 5283c: 4e75 rts ... 0004dda4 <_CORE_message_queue_Seize>: CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; _ISR_Disable( level ); 4dda4: 223c 0000 0700 movel #1792,%d1 void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 4ddaa: 4e56 ffe0 linkw %fp,#-32 ISR_Level level; CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; 4ddae: 2079 0006 65e2 moveal 665e2 <_Thread_Executing>,%a0 void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 4ddb4: 48d7 3c3c moveml %d2-%d5/%a2-%a5,%sp@ 4ddb8: 282e 000c movel %fp@(12),%d4 4ddbc: 242e 001c movel %fp@(28),%d2 4ddc0: 246e 0008 moveal %fp@(8),%a2 ISR_Level level; CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; 4ddc4: 42a8 0034 clrl %a0@(52) void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 4ddc8: 262e 0010 movel %fp@(16),%d3 4ddcc: 226e 0014 moveal %fp@(20),%a1 4ddd0: 1a2e 001b moveb %fp@(27),%d5 CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; _ISR_Disable( level ); 4ddd4: 40c0 movew %sr,%d0 4ddd6: 8280 orl %d0,%d1 4ddd8: 46c1 movew %d1,%sr */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4ddda: 220a movel %a2,%d1 4dddc: 0681 0000 0054 addil #84,%d1 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 4dde2: 266a 0050 moveal %a2@(80),%a3 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4dde6: b28b cmpl %a3,%d1 4dde8: 6700 00a6 beqw 4de90 <_CORE_message_queue_Seize+0xec> { Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; 4ddec: 2853 moveal %a3@,%a4 the_chain->first = new_first; new_first->previous = _Chain_Head(the_chain); 4ddee: 4bea 0050 lea %a2@(80),%a5 Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; the_chain->first = new_first; 4ddf2: 254c 0050 movel %a4,%a2@(80) new_first->previous = _Chain_Head(the_chain); 4ddf6: 294d 0004 movel %a5,%a4@(4) the_message = _CORE_message_queue_Get_pending_message( the_message_queue ); if ( the_message != NULL ) { 4ddfa: 4a8b tstl %a3 4ddfc: 6700 0092 beqw 4de90 <_CORE_message_queue_Seize+0xec> <== ALWAYS TAKEN the_message_queue->number_of_pending_messages -= 1; 4de00: 53aa 0048 subql #1,%a2@(72) _ISR_Enable( level ); 4de04: 46c0 movew %d0,%sr *size_p = the_message->Contents.size; _Thread_Executing->Wait.count = 4de06: 2079 0006 65e2 moveal 665e2 <_Thread_Executing>,%a0 the_message = _CORE_message_queue_Get_pending_message( the_message_queue ); if ( the_message != NULL ) { the_message_queue->number_of_pending_messages -= 1; _ISR_Enable( level ); *size_p = the_message->Contents.size; 4de0c: 22ab 000c movel %a3@(12),%a1@ _Thread_Executing->Wait.count = _CORE_message_queue_Get_message_priority( the_message ); _CORE_message_queue_Copy_buffer( the_message->Contents.buffer, 4de10: 240b movel %a3,%d2 4de12: 0682 0000 0010 addil #16,%d2 if ( the_message != NULL ) { the_message_queue->number_of_pending_messages -= 1; _ISR_Enable( level ); *size_p = the_message->Contents.size; _Thread_Executing->Wait.count = 4de18: 216b 0008 0024 movel %a3@(8),%a0@(36) const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 4de1e: 49f9 0005 5830 lea 55830 ,%a4 4de24: 2f11 movel %a1@,%sp@- 4de26: 2f02 movel %d2,%sp@- 4de28: 2f03 movel %d3,%sp@- 4de2a: 4e94 jsr %a4@ * is not, then we can go ahead and free the buffer. * * NOTE: If we note that the queue was not full before this receive, * then we can avoid this dequeue. */ the_thread = _Thread_queue_Dequeue( &the_message_queue->Wait_queue ); 4de2c: 2f0a movel %a2,%sp@- 4de2e: 4eb9 0004 f83c jsr 4f83c <_Thread_queue_Dequeue> if ( !the_thread ) { 4de34: 4fef 0010 lea %sp@(16),%sp * is not, then we can go ahead and free the buffer. * * NOTE: If we note that the queue was not full before this receive, * then we can avoid this dequeue. */ the_thread = _Thread_queue_Dequeue( &the_message_queue->Wait_queue ); 4de38: 2040 moveal %d0,%a0 if ( !the_thread ) { 4de3a: 4a80 tstl %d0 4de3c: 661a bnes 4de58 <_CORE_message_queue_Seize+0xb4> RTEMS_INLINE_ROUTINE void _CORE_message_queue_Free_message_buffer ( CORE_message_queue_Control *the_message_queue, CORE_message_queue_Buffer_control *the_message ) { _Chain_Append( &the_message_queue->Inactive_messages, &the_message->Node ); 4de3e: 45ea 0068 lea %a2@(104),%a2 4de42: 2d4b 000c movel %a3,%fp@(12) 4de46: 2d4a 0008 movel %a2,%fp@(8) executing->Wait.return_argument = size_p; /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); } 4de4a: 4cee 3c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a5 4de50: 4e5e unlk %fp 4de52: 4ef9 0004 dc24 jmp 4dc24 <_Chain_Append> */ _CORE_message_queue_Set_message_priority( the_message, the_thread->Wait.count ); the_message->Contents.size = (size_t) the_thread->Wait.option; 4de58: 2028 0030 movel %a0@(48),%d0 CORE_message_queue_Buffer_control *the_message, int priority ) { #if defined(RTEMS_SCORE_COREMSG_ENABLE_MESSAGE_PRIORITY) the_message->priority = priority; 4de5c: 2768 0024 0008 movel %a0@(36),%a3@(8) 4de62: 2740 000c movel %d0,%a3@(12) const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 4de66: 2f00 movel %d0,%sp@- 4de68: 2f28 002c movel %a0@(44),%sp@- 4de6c: 2f02 movel %d2,%sp@- 4de6e: 4e94 jsr %a4@ the_thread->Wait.return_argument_second.immutable_object, the_message->Contents.buffer, the_message->Contents.size ); _CORE_message_queue_Insert_message( 4de70: 2d6b 0008 0010 movel %a3@(8),%fp@(16) 4de76: 4fef 000c lea %sp@(12),%sp 4de7a: 2d4b 000c movel %a3,%fp@(12) 4de7e: 2d4a 0008 movel %a2,%fp@(8) executing->Wait.return_argument = size_p; /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); } 4de82: 4cee 3c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a5 4de88: 4e5e unlk %fp the_thread->Wait.return_argument_second.immutable_object, the_message->Contents.buffer, the_message->Contents.size ); _CORE_message_queue_Insert_message( 4de8a: 4ef9 0005 276c jmp 5276c <_CORE_message_queue_Insert_message> return; } #endif } if ( !wait ) { 4de90: 4a05 tstb %d5 4de92: 6612 bnes 4dea6 <_CORE_message_queue_Seize+0x102> _ISR_Enable( level ); 4de94: 46c0 movew %d0,%sr executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT; 4de96: 7004 moveq #4,%d0 executing->Wait.return_argument = size_p; /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); } 4de98: 4cee 3c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a5 #endif } if ( !wait ) { _ISR_Enable( level ); executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT; 4de9e: 2140 0034 movel %d0,%a0@(52) executing->Wait.return_argument = size_p; /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); } 4dea2: 4e5e unlk %fp 4dea4: 4e75 rts RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section ( Thread_queue_Control *the_thread_queue ) { the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 4dea6: 7201 moveq #1,%d1 4dea8: 2541 0030 movel %d1,%a2@(48) _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue ); executing->Wait.queue = &the_message_queue->Wait_queue; executing->Wait.id = id; executing->Wait.return_argument_second.mutable_object = buffer; executing->Wait.return_argument = size_p; 4deac: 2149 0028 movel %a1,%a0@(40) } _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue ); executing->Wait.queue = &the_message_queue->Wait_queue; executing->Wait.id = id; executing->Wait.return_argument_second.mutable_object = buffer; 4deb0: 2143 002c movel %d3,%a0@(44) return; } _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue ); executing->Wait.queue = &the_message_queue->Wait_queue; executing->Wait.id = id; 4deb4: 2144 0020 movel %d4,%a0@(32) executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT; return; } _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue ); executing->Wait.queue = &the_message_queue->Wait_queue; 4deb8: 214a 0044 movel %a2,%a0@(68) executing->Wait.id = id; executing->Wait.return_argument_second.mutable_object = buffer; executing->Wait.return_argument = size_p; /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); 4debc: 46c0 movew %d0,%sr _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); 4debe: 4bf9 0004 fc68 lea 4fc68 <_Thread_queue_Timeout>,%a5 4dec4: 2d42 000c movel %d2,%fp@(12) 4dec8: 2d4d 0010 movel %a5,%fp@(16) 4decc: 2d4a 0008 movel %a2,%fp@(8) } 4ded0: 4cee 3c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a5 4ded6: 4e5e unlk %fp executing->Wait.return_argument_second.mutable_object = buffer; executing->Wait.return_argument = size_p; /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); 4ded8: 4ef9 0004 f97c jmp 4f97c <_Thread_queue_Enqueue_with_handler> ... 0004dee0 <_CORE_message_queue_Submit>: #endif CORE_message_queue_Submit_types submit_type, bool wait, Watchdog_Interval timeout ) { 4dee0: 4e56 ffe8 linkw %fp,#-24 4dee4: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@ 4dee8: 246e 0008 moveal %fp@(8),%a2 4deec: 282e 000c movel %fp@(12),%d4 4def0: 242e 0010 movel %fp@(16),%d2 4def4: 262e 001c movel %fp@(28),%d3 4def8: 1a2e 0023 moveb %fp@(35),%d5 CORE_message_queue_Buffer_control *the_message; Thread_Control *the_thread; if ( size > the_message_queue->maximum_message_size ) { 4defc: b4aa 004c cmpl %a2@(76),%d2 4df00: 6306 blss 4df08 <_CORE_message_queue_Submit+0x28> 4df02: 7001 moveq #1,%d0 4df04: 6000 00d6 braw 4dfdc <_CORE_message_queue_Submit+0xfc> <== ALWAYS TAKEN } /* * Is there a thread currently waiting on this message queue? */ if ( the_message_queue->number_of_pending_messages == 0 ) { 4df08: 4aaa 0048 tstl %a2@(72) 4df0c: 6632 bnes 4df40 <_CORE_message_queue_Submit+0x60> the_thread = _Thread_queue_Dequeue( &the_message_queue->Wait_queue ); 4df0e: 2f0a movel %a2,%sp@- 4df10: 4eb9 0004 f83c jsr 4f83c <_Thread_queue_Dequeue> if ( the_thread ) { 4df16: 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 ); 4df18: 2640 moveal %d0,%a3 if ( the_thread ) { 4df1a: 4a80 tstl %d0 4df1c: 6722 beqs 4df40 <_CORE_message_queue_Submit+0x60> 4df1e: 2f02 movel %d2,%sp@- 4df20: 2f04 movel %d4,%sp@- 4df22: 2f2b 002c movel %a3@(44),%sp@- 4df26: 4eb9 0005 5830 jsr 55830 _CORE_message_queue_Copy_buffer( buffer, the_thread->Wait.return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; 4df2c: 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; 4df30: 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; 4df34: 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; 4df36: 2082 movel %d2,%a0@ the_thread->Wait.count = (uint32_t) submit_type; 4df38: 2743 0024 movel %d3,%a3@(36) #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; 4df3c: 6000 009e braw 4dfdc <_CORE_message_queue_Submit+0xfc> <== ALWAYS TAKEN /* * 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 ) { 4df40: 202a 0044 movel %a2@(68),%d0 4df44: b0aa 0048 cmpl %a2@(72),%d0 4df48: 6336 blss 4df80 <_CORE_message_queue_Submit+0xa0> 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 *) 4df4a: 486a 0068 pea %a2@(104) 4df4e: 4eb9 0004 dc84 jsr 4dc84 <_Chain_Get> 4df54: 2640 moveal %d0,%a3 const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 4df56: 2f02 movel %d2,%sp@- 4df58: 2f04 movel %d4,%sp@- 4df5a: 486b 0010 pea %a3@(16) 4df5e: 4eb9 0005 5830 jsr 55830 _CORE_message_queue_Copy_buffer( buffer, the_message->Contents.buffer, size ); the_message->Contents.size = size; 4df64: 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; 4df68: 2743 0008 movel %d3,%a3@(8) _CORE_message_queue_Set_message_priority( the_message, submit_type ); _CORE_message_queue_Insert_message( 4df6c: 2f03 movel %d3,%sp@- 4df6e: 2f0b movel %a3,%sp@- 4df70: 2f0a movel %a2,%sp@- 4df72: 4eb9 0005 276c jsr 5276c <_CORE_message_queue_Insert_message> the_message_queue, the_message, submit_type ); return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; 4df78: 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( 4df7c: 4280 clrl %d0 the_message_queue, the_message, submit_type ); return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; 4df7e: 605c bras 4dfdc <_CORE_message_queue_Submit+0xfc> <== ALWAYS TAKEN /* * 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 ) { 4df80: 4a05 tstb %d5 4df82: 6604 bnes 4df88 <_CORE_message_queue_Submit+0xa8> 4df84: 7002 moveq #2,%d0 4df86: 6054 bras 4dfdc <_CORE_message_queue_Submit+0xfc> <== ALWAYS TAKEN /* * 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() ) { 4df88: 2039 0006 65c2 movel 665c2 <_ISR_Nest_level>,%d0 4df8e: 6704 beqs 4df94 <_CORE_message_queue_Submit+0xb4> 4df90: 7003 moveq #3,%d0 4df92: 6048 bras 4dfdc <_CORE_message_queue_Submit+0xfc> <== ALWAYS TAKEN * 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; 4df94: 2079 0006 65e2 moveal 665e2 <_Thread_Executing>,%a0 ISR_Level level; _ISR_Disable( level ); 4df9a: 203c 0000 0700 movel #1792,%d0 4dfa0: 40c1 movew %sr,%d1 4dfa2: 8081 orl %d1,%d0 4dfa4: 46c0 movew %d0,%sr 4dfa6: 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; 4dfa8: 216e 0014 0020 movel %fp@(20),%a0@(32) 4dfae: 2540 0030 movel %d0,%a2@(48) executing->Wait.return_argument_second.immutable_object = buffer; executing->Wait.option = (uint32_t) size; executing->Wait.count = submit_type; 4dfb2: 2143 0024 movel %d3,%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; 4dfb6: 2144 002c movel %d4,%a0@(44) executing->Wait.option = (uint32_t) size; 4dfba: 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; 4dfbe: 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 ); 4dfc2: 46c1 movew %d1,%sr _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); 4dfc4: 4879 0004 fc68 pea 4fc68 <_Thread_queue_Timeout> 4dfca: 2f2e 0024 movel %fp@(36),%sp@- 4dfce: 2f0a movel %a2,%sp@- 4dfd0: 4eb9 0004 f97c jsr 4f97c <_Thread_queue_Enqueue_with_handler> } return CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_WAIT; 4dfd6: 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 ); 4dfda: 7007 moveq #7,%d0 } return CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_WAIT; #endif } 4dfdc: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 4dfe2: 4e5e unlk %fp 4dfe4: 4e75 rts ... 00045920 <_CORE_mutex_Initialize>: CORE_mutex_Status _CORE_mutex_Initialize( CORE_mutex_Control *the_mutex, CORE_mutex_Attributes *the_mutex_attributes, uint32_t initial_lock ) { 45920: 4e56 fff4 linkw %fp,#-12 45924: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ /* 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; 45928: 4878 000e pea e CORE_mutex_Status _CORE_mutex_Initialize( CORE_mutex_Control *the_mutex, CORE_mutex_Attributes *the_mutex_attributes, uint32_t initial_lock ) { 4592c: 266e 000c moveal %fp@(12),%a3 45930: 246e 0008 moveal %fp@(8),%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; 45934: 2f0b movel %a3,%sp@- 45936: 486a 0040 pea %a2@(64) CORE_mutex_Status _CORE_mutex_Initialize( CORE_mutex_Control *the_mutex, CORE_mutex_Attributes *the_mutex_attributes, uint32_t initial_lock ) { 4593a: 242e 0010 movel %fp@(16),%d2 /* 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; 4593e: 4eb9 0004 d478 jsr 4d478 the_mutex->lock = initial_lock; the_mutex->blocked_count = 0; if ( initial_lock == CORE_MUTEX_LOCKED ) { 45944: 4fef 000c lea %sp@(12),%sp rtems_assert( initial_lock == CORE_MUTEX_LOCKED || initial_lock == CORE_MUTEX_UNLOCKED ); */ the_mutex->Attributes = *the_mutex_attributes; the_mutex->lock = initial_lock; 45948: 2542 004e movel %d2,%a2@(78) the_mutex->blocked_count = 0; 4594c: 42aa 0056 clrl %a2@(86) if ( initial_lock == CORE_MUTEX_LOCKED ) { 45950: 4a82 tstl %d2 45952: 663c bnes 45990 <_CORE_mutex_Initialize+0x70> the_mutex->nest_count = 1; the_mutex->holder = _Thread_Executing; 45954: 2079 0005 cf7e moveal 5cf7e <_Thread_Executing>,%a0 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; 4595a: 7001 moveq #1,%d0 the_mutex->holder = _Thread_Executing; the_mutex->holder_id = _Thread_Executing->Object.id; if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || 4595c: 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; 4595e: 2540 0052 movel %d0,%a2@(82) the_mutex->holder = _Thread_Executing; the_mutex->holder_id = _Thread_Executing->Object.id; 45962: 2568 0008 005e movel %a0@(8),%a2@(94) */ RTEMS_INLINE_ROUTINE bool _CORE_mutex_Is_inherit_priority( CORE_mutex_Attributes *the_attribute ) { return the_attribute->discipline == CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT; 45968: 202a 0046 movel %a2@(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; 4596c: 2548 005a movel %a0,%a2@(90) the_mutex->holder_id = _Thread_Executing->Object.id; if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || 45970: b280 cmpl %d0,%d1 45972: 6708 beqs 4597c <_CORE_mutex_Initialize+0x5c> 45974: 123c 0003 moveb #3,%d1 45978: b280 cmpl %d0,%d1 4597a: 6620 bnes 4599c <_CORE_mutex_Initialize+0x7c> _CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) { if ( _Thread_Executing->current_priority < the_mutex->Attributes.priority_ceiling ) 4597c: 202a 004a movel %a2@(74),%d0 45980: b0a8 0014 cmpl %a0@(20),%d0 45984: 6304 blss 4598a <_CORE_mutex_Initialize+0x6a> 45986: 7006 moveq #6,%d0 45988: 6034 bras 459be <_CORE_mutex_Initialize+0x9e> <== ALWAYS TAKEN _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++; 4598a: 52a8 001c addql #1,%a0@(28) 4598e: 600c bras 4599c <_CORE_mutex_Initialize+0x7c> <== ALWAYS TAKEN } } else { the_mutex->nest_count = 0; 45990: 42aa 0052 clrl %a2@(82) the_mutex->holder = NULL; 45994: 42aa 005a clrl %a2@(90) the_mutex->holder_id = 0; 45998: 42aa 005e clrl %a2@(94) } _Thread_queue_Initialize( 4599c: 4aab 0006 tstl %a3@(6) 459a0: 56c0 sne %d0 459a2: 4878 0005 pea 5 459a6: 49c0 extbl %d0 459a8: 4878 0400 pea 400 459ac: 4480 negl %d0 459ae: 2f00 movel %d0,%sp@- 459b0: 2f0a movel %a2,%sp@- 459b2: 4eb9 0004 73a8 jsr 473a8 <_Thread_queue_Initialize> THREAD_QUEUE_DISCIPLINE_FIFO : THREAD_QUEUE_DISCIPLINE_PRIORITY, STATES_WAITING_FOR_MUTEX, CORE_MUTEX_TIMEOUT ); return CORE_MUTEX_STATUS_SUCCESSFUL; 459b8: 4fef 0010 lea %sp@(16),%sp the_mutex->nest_count = 0; the_mutex->holder = NULL; the_mutex->holder_id = 0; } _Thread_queue_Initialize( 459bc: 4280 clrl %d0 STATES_WAITING_FOR_MUTEX, CORE_MUTEX_TIMEOUT ); return CORE_MUTEX_STATUS_SUCCESSFUL; } 459be: 4cee 0c04 fff4 moveml %fp@(-12),%d2/%a2-%a3 459c4: 4e5e unlk %fp 459c6: 4e75 rts 00045a2c <_CORE_mutex_Seize>: Objects_Id _id, bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { 45a2c: 4e56 0000 linkw %fp,#0 45a30: 202e 0010 movel %fp@(16),%d0 45a34: 2f0a movel %a2,%sp@- 45a36: 246e 0008 moveal %fp@(8),%a2 45a3a: 2f02 movel %d2,%sp@- _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); 45a3c: 2239 0005 cec4 movel 5cec4 <_Thread_Dispatch_disable_level>,%d1 Objects_Id _id, bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { 45a42: 1400 moveb %d0,%d2 _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); 45a44: 4a81 tstl %d1 45a46: 671c beqs 45a64 <_CORE_mutex_Seize+0x38> 45a48: 4a00 tstb %d0 45a4a: 6718 beqs 45a64 <_CORE_mutex_Seize+0x38> <== ALWAYS TAKEN 45a4c: 7001 moveq #1,%d0 45a4e: b0b9 0005 d04c cmpl 5d04c <_System_state_Current>,%d0 45a54: 640e bccs 45a64 <_CORE_mutex_Seize+0x38> 45a56: 4878 0013 pea 13 45a5a: 42a7 clrl %sp@- 45a5c: 42a7 clrl %sp@- 45a5e: 4eb9 0004 5fe4 jsr 45fe4 <_Internal_error_Occurred> 45a64: 486e 0018 pea %fp@(24) 45a68: 2f0a movel %a2,%sp@- 45a6a: 4eb9 0004 a1c8 jsr 4a1c8 <_CORE_mutex_Seize_interrupt_trylock> 45a70: 508f addql #8,%sp 45a72: 4a80 tstl %d0 45a74: 6750 beqs 45ac6 <_CORE_mutex_Seize+0x9a> 45a76: 4a02 tstb %d2 45a78: 6614 bnes 45a8e <_CORE_mutex_Seize+0x62> 45a7a: 202e 0018 movel %fp@(24),%d0 45a7e: 46c0 movew %d0,%sr 45a80: 2079 0005 cf7e moveal 5cf7e <_Thread_Executing>,%a0 45a86: 7001 moveq #1,%d0 45a88: 2140 0034 movel %d0,%a0@(52) 45a8c: 6038 bras 45ac6 <_CORE_mutex_Seize+0x9a> <== ALWAYS TAKEN 45a8e: 2039 0005 cec4 movel 5cec4 <_Thread_Dispatch_disable_level>,%d0 45a94: 5280 addql #1,%d0 45a96: 2079 0005 cf7e moveal 5cf7e <_Thread_Executing>,%a0 45a9c: 216e 000c 0020 movel %fp@(12),%a0@(32) 45aa2: 23c0 0005 cec4 movel %d0,5cec4 <_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; 45aa8: 7001 moveq #1,%d0 45aaa: 214a 0044 movel %a2,%a0@(68) 45aae: 2540 0030 movel %d0,%a2@(48) 45ab2: 202e 0018 movel %fp@(24),%d0 45ab6: 46c0 movew %d0,%sr 45ab8: 2f2e 0014 movel %fp@(20),%sp@- 45abc: 2f0a movel %a2,%sp@- 45abe: 4eb9 0004 59c8 jsr 459c8 <_CORE_mutex_Seize_interrupt_blocking> 45ac4: 508f addql #8,%sp } 45ac6: 242e fff8 movel %fp@(-8),%d2 45aca: 246e fffc moveal %fp@(-4),%a2 45ace: 4e5e unlk %fp 45ad0: 4e75 rts ... 0004a1c8 <_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 ) { 4a1c8: 4e56 0000 linkw %fp,#0 { Thread_Control *executing; /* disabled when you get here */ executing = _Thread_Executing; 4a1cc: 2279 0005 cf7e moveal 5cf7e <_Thread_Executing>,%a1 4a1d2: 2f0b movel %a3,%sp@- 4a1d4: 206e 0008 moveal %fp@(8),%a0 4a1d8: 2f0a movel %a2,%sp@- 4a1da: 246e 000c moveal %fp@(12),%a2 executing->Wait.return_code = CORE_MUTEX_STATUS_SUCCESSFUL; 4a1de: 42a9 0034 clrl %a1@(52) if ( !_CORE_mutex_Is_locked( the_mutex ) ) { 4a1e2: 4aa8 004e tstl %a0@(78) 4a1e6: 6700 0098 beqw 4a280 <_CORE_mutex_Seize_interrupt_trylock+0xb8> the_mutex->lock = CORE_MUTEX_LOCKED; 4a1ea: 42a8 004e clrl %a0@(78) the_mutex->holder = executing; the_mutex->holder_id = executing->Object.id; the_mutex->nest_count = 1; 4a1ee: 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; 4a1f0: 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; 4a1f6: 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; 4a1fa: 2141 0052 movel %d1,%a0@(82) if ( _CORE_mutex_Is_inherit_priority( &the_mutex->Attributes ) || 4a1fe: 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; 4a202: 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 ) || 4a206: b280 cmpl %d0,%d1 4a208: 6708 beqs 4a212 <_CORE_mutex_Seize_interrupt_trylock+0x4a> 4a20a: 123c 0003 moveb #3,%d1 4a20e: b280 cmpl %d0,%d1 4a210: 660a bnes 4a21c <_CORE_mutex_Seize_interrupt_trylock+0x54> _Chain_Prepend_unprotected( &executing->lock_mutex, &the_mutex->queue.lock_queue ); the_mutex->queue.priority_before = executing->current_priority; #endif executing->resource_count++; 4a212: 52a9 001c addql #1,%a1@(28) } if ( !_CORE_mutex_Is_priority_ceiling( &the_mutex->Attributes ) ) { 4a216: 7203 moveq #3,%d1 4a218: b280 cmpl %d0,%d1 4a21a: 6706 beqs 4a222 <_CORE_mutex_Seize_interrupt_trylock+0x5a> _ISR_Enable( *level_p ); 4a21c: 2012 movel %a2@,%d0 4a21e: 46c0 movew %d0,%sr 4a220: 607c bras 4a29e <_CORE_mutex_Seize_interrupt_trylock+0xd6> <== ALWAYS TAKEN */ { Priority_Control ceiling; Priority_Control current; ceiling = the_mutex->Attributes.priority_ceiling; 4a222: 2028 004a movel %a0@(74),%d0 current = executing->current_priority; 4a226: 2229 0014 movel %a1@(20),%d1 if ( current == ceiling ) { 4a22a: b081 cmpl %d1,%d0 4a22c: 6606 bnes 4a234 <_CORE_mutex_Seize_interrupt_trylock+0x6c> _ISR_Enable( *level_p ); 4a22e: 2012 movel %a2@,%d0 4a230: 46c0 movew %d0,%sr 4a232: 606a bras 4a29e <_CORE_mutex_Seize_interrupt_trylock+0xd6> <== ALWAYS TAKEN return 0; } if ( current > ceiling ) { 4a234: b081 cmpl %d1,%d0 4a236: 642e bccs 4a266 <_CORE_mutex_Seize_interrupt_trylock+0x9e> rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 4a238: 2039 0005 cec4 movel 5cec4 <_Thread_Dispatch_disable_level>,%d0 4a23e: 5280 addql #1,%d0 4a240: 23c0 0005 cec4 movel %d0,5cec4 <_Thread_Dispatch_disable_level> _Thread_Disable_dispatch(); _ISR_Enable( *level_p ); 4a246: 2012 movel %a2@,%d0 4a248: 46c0 movew %d0,%sr _Thread_Change_priority( 4a24a: 42a7 clrl %sp@- 4a24c: 2f28 004a movel %a0@(74),%sp@- 4a250: 2f28 005a movel %a0@(90),%sp@- 4a254: 4eb9 0004 67f4 jsr 467f4 <_Thread_Change_priority> the_mutex->holder, the_mutex->Attributes.priority_ceiling, false ); _Thread_Enable_dispatch(); 4a25a: 4eb9 0004 6cee jsr 46cee <_Thread_Enable_dispatch> 4a260: 4fef 000c lea %sp@(12),%sp 4a264: 6038 bras 4a29e <_CORE_mutex_Seize_interrupt_trylock+0xd6> <== ALWAYS TAKEN return 0; } /* if ( current < ceiling ) */ { executing->Wait.return_code = CORE_MUTEX_STATUS_CEILING_VIOLATED; 4a266: 7006 moveq #6,%d0 the_mutex->lock = CORE_MUTEX_UNLOCKED; 4a268: 7201 moveq #1,%d1 ); _Thread_Enable_dispatch(); return 0; } /* if ( current < ceiling ) */ { executing->Wait.return_code = CORE_MUTEX_STATUS_CEILING_VIOLATED; 4a26a: 2340 0034 movel %d0,%a1@(52) the_mutex->lock = CORE_MUTEX_UNLOCKED; the_mutex->nest_count = 0; /* undo locking above */ 4a26e: 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; 4a272: 2141 004e movel %d1,%a0@(78) the_mutex->nest_count = 0; /* undo locking above */ executing->resource_count--; /* undo locking above */ 4a276: 53a9 001c subql #1,%a1@(28) _ISR_Enable( *level_p ); 4a27a: 2012 movel %a2@,%d0 4a27c: 46c0 movew %d0,%sr 4a27e: 601e bras 4a29e <_CORE_mutex_Seize_interrupt_trylock+0xd6> <== 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 ) ) { 4a280: 2668 005a moveal %a0@(90),%a3 4a284: b3cb cmpal %a3,%a1 4a286: 6626 bnes 4a2ae <_CORE_mutex_Seize_interrupt_trylock+0xe6> switch ( the_mutex->Attributes.lock_nesting_behavior ) { 4a288: 2028 0040 movel %a0@(64),%d0 4a28c: 6708 beqs 4a296 <_CORE_mutex_Seize_interrupt_trylock+0xce> 4a28e: 7201 moveq #1,%d1 4a290: b280 cmpl %d0,%d1 4a292: 661a bnes 4a2ae <_CORE_mutex_Seize_interrupt_trylock+0xe6> 4a294: 600c bras 4a2a2 <_CORE_mutex_Seize_interrupt_trylock+0xda> <== ALWAYS TAKEN case CORE_MUTEX_NESTING_ACQUIRES: the_mutex->nest_count++; 4a296: 52a8 0052 addql #1,%a0@(82) _ISR_Enable( *level_p ); 4a29a: 2012 movel %a2@,%d0 4a29c: 46c0 movew %d0,%sr 4a29e: 4280 clrl %d0 4a2a0: 600e bras 4a2b0 <_CORE_mutex_Seize_interrupt_trylock+0xe8> <== ALWAYS TAKEN return 0; case CORE_MUTEX_NESTING_IS_ERROR: executing->Wait.return_code = CORE_MUTEX_STATUS_NESTING_NOT_ALLOWED; 4a2a2: 7002 moveq #2,%d0 4a2a4: 2740 0034 movel %d0,%a3@(52) _ISR_Enable( *level_p ); 4a2a8: 2012 movel %a2@,%d0 4a2aa: 46c0 movew %d0,%sr 4a2ac: 60f0 bras 4a29e <_CORE_mutex_Seize_interrupt_trylock+0xd6> <== ALWAYS TAKEN 4a2ae: 7001 moveq #1,%d0 return _CORE_mutex_Seize_interrupt_trylock_body( the_mutex, level_p ); } 4a2b0: 246e fff8 moveal %fp@(-8),%a2 4a2b4: 266e fffc moveal %fp@(-4),%a3 4a2b8: 4e5e unlk %fp 4a2ba: 4e75 rts 00045ad4 <_CORE_mutex_Surrender>: #else Objects_Id id __attribute__((unused)), CORE_mutex_API_mp_support_callout api_mutex_mp_support __attribute__((unused)) #endif ) { 45ad4: 4e56 0000 linkw %fp,#0 45ad8: 2f0a movel %a2,%sp@- 45ada: 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; 45ade: 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 ) { 45ae2: 4a2a 0044 tstb %a2@(68) 45ae6: 670e beqs 45af6 <_CORE_mutex_Surrender+0x22> if ( !_Thread_Is_executing( holder ) ) 45ae8: b1f9 0005 cf7e cmpal 5cf7e <_Thread_Executing>,%a0 45aee: 6706 beqs 45af6 <_CORE_mutex_Surrender+0x22> 45af0: 7003 moveq #3,%d0 45af2: 6000 00ce braw 45bc2 <_CORE_mutex_Surrender+0xee> <== ALWAYS TAKEN return CORE_MUTEX_STATUS_NOT_OWNER_OF_RESOURCE; } /* XXX already unlocked -- not right status */ if ( !the_mutex->nest_count ) 45af6: 202a 0052 movel %a2@(82),%d0 45afa: 6700 00c4 beqw 45bc0 <_CORE_mutex_Surrender+0xec> return CORE_MUTEX_STATUS_SUCCESSFUL; the_mutex->nest_count--; 45afe: 5380 subql #1,%d0 45b00: 2540 0052 movel %d0,%a2@(82) if ( the_mutex->nest_count != 0 ) { 45b04: 6600 00ba bnew 45bc0 <_CORE_mutex_Surrender+0xec> 45b08: 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 ) || 45b0c: 7202 moveq #2,%d1 45b0e: b280 cmpl %d0,%d1 45b10: 6708 beqs 45b1a <_CORE_mutex_Surrender+0x46> 45b12: 123c 0003 moveb #3,%d1 45b16: b280 cmpl %d0,%d1 45b18: 6604 bnes 45b1e <_CORE_mutex_Surrender+0x4a> the_mutex->nest_count++; return CORE_MUTEX_RELEASE_NOT_ORDER; } first_node = _Chain_Get_first_unprotected(&holder->lock_mutex); #endif holder->resource_count--; 45b1a: 53a8 001c subql #1,%a0@(28) 45b1e: 202a 0046 movel %a2@(70),%d0 /* * 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 ) || 45b22: 7202 moveq #2,%d1 } first_node = _Chain_Get_first_unprotected(&holder->lock_mutex); #endif holder->resource_count--; } the_mutex->holder = NULL; 45b24: 42aa 005a clrl %a2@(90) the_mutex->holder_id = 0; 45b28: 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 ) || 45b2c: b280 cmpl %d0,%d1 45b2e: 6708 beqs 45b38 <_CORE_mutex_Surrender+0x64> 45b30: 123c 0003 moveb #3,%d1 45b34: b280 cmpl %d0,%d1 45b36: 6622 bnes 45b5a <_CORE_mutex_Surrender+0x86> _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 && 45b38: 4aa8 001c tstl %a0@(28) 45b3c: 661c bnes 45b5a <_CORE_mutex_Surrender+0x86> holder->real_priority != holder->current_priority ) { 45b3e: 2028 0018 movel %a0@(24),%d0 45b42: b0a8 0014 cmpl %a0@(20),%d0 45b46: 6712 beqs 45b5a <_CORE_mutex_Surrender+0x86> _Thread_Change_priority( holder, holder->real_priority, true ); 45b48: 4878 0001 pea 1 45b4c: 2f00 movel %d0,%sp@- 45b4e: 2f08 movel %a0,%sp@- 45b50: 4eb9 0004 67f4 jsr 467f4 <_Thread_Change_priority> 45b56: 4fef 000c lea %sp@(12),%sp /* * 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 ) ) ) { 45b5a: 2f0a movel %a2,%sp@- 45b5c: 4eb9 0004 7038 jsr 47038 <_Thread_queue_Dequeue> 45b62: 588f addql #4,%sp 45b64: 2040 moveal %d0,%a0 45b66: 4a80 tstl %d0 45b68: 674c beqs 45bb6 <_CORE_mutex_Surrender+0xe2> #endif { the_mutex->holder = the_thread; the_mutex->holder_id = the_thread->Object.id; the_mutex->nest_count = 1; 45b6a: 7201 moveq #1,%d1 } else #endif { the_mutex->holder = the_thread; the_mutex->holder_id = the_thread->Object.id; 45b6c: 2568 0008 005e movel %a0@(8),%a2@(94) the_mutex->nest_count = 1; switch ( the_mutex->Attributes.discipline ) { 45b72: 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; 45b76: 2541 0052 movel %d1,%a2@(82) switch ( the_mutex->Attributes.discipline ) { 45b7a: 123c 0002 moveb #2,%d1 } else #endif { the_mutex->holder = the_thread; 45b7e: 2548 005a movel %a0,%a2@(90) the_mutex->holder_id = the_thread->Object.id; the_mutex->nest_count = 1; switch ( the_mutex->Attributes.discipline ) { 45b82: b280 cmpl %d0,%d1 45b84: 670a beqs 45b90 <_CORE_mutex_Surrender+0xbc> 45b86: 123c 0003 moveb #3,%d1 45b8a: b280 cmpl %d0,%d1 45b8c: 6632 bnes 45bc0 <_CORE_mutex_Surrender+0xec> 45b8e: 6006 bras 45b96 <_CORE_mutex_Surrender+0xc2> <== ALWAYS TAKEN 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++; 45b90: 52a8 001c addql #1,%a0@(28) 45b94: 602a bras 45bc0 <_CORE_mutex_Surrender+0xec> <== 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++; 45b96: 52a8 001c addql #1,%a0@(28) if (the_mutex->Attributes.priority_ceiling < 45b9a: 202a 004a movel %a2@(74),%d0 the_thread->current_priority){ 45b9e: b0a8 0014 cmpl %a0@(20),%d0 45ba2: 641c bccs 45bc0 <_CORE_mutex_Surrender+0xec> _Thread_Change_priority( 45ba4: 42a7 clrl %sp@- 45ba6: 2f00 movel %d0,%sp@- 45ba8: 2f08 movel %a0,%sp@- 45baa: 4eb9 0004 67f4 jsr 467f4 <_Thread_Change_priority> 45bb0: 4fef 000c lea %sp@(12),%sp 45bb4: 600a bras 45bc0 <_CORE_mutex_Surrender+0xec> <== ALWAYS TAKEN } break; } } } else the_mutex->lock = CORE_MUTEX_UNLOCKED; 45bb6: 7001 moveq #1,%d0 45bb8: 2540 004e movel %d0,%a2@(78) 45bbc: 4200 clrb %d0 45bbe: 6002 bras 45bc2 <_CORE_mutex_Surrender+0xee> <== ALWAYS TAKEN 45bc0: 4280 clrl %d0 return CORE_MUTEX_STATUS_SUCCESSFUL; } 45bc2: 246e fffc moveal %fp@(-4),%a2 45bc6: 4e5e unlk %fp 45bc8: 4e75 rts ... 0004dcd0 <_CORE_semaphore_Seize>: Thread_Control *executing; ISR_Level level; executing = _Thread_Executing; executing->Wait.return_code = CORE_SEMAPHORE_STATUS_SUCCESSFUL; _ISR_Disable( level ); 4dcd0: 223c 0000 0700 movel #1792,%d1 CORE_semaphore_Control *the_semaphore, Objects_Id id, bool wait, Watchdog_Interval timeout ) { 4dcd6: 4e56 fff4 linkw %fp,#-12 Thread_Control *executing; ISR_Level level; executing = _Thread_Executing; 4dcda: 2279 0006 1c4a moveal 61c4a <_Thread_Executing>,%a1 CORE_semaphore_Control *the_semaphore, Objects_Id id, bool wait, Watchdog_Interval timeout ) { 4dce0: 48d7 001c moveml %d2-%d4,%sp@ 4dce4: 262e 000c movel %fp@(12),%d3 4dce8: 242e 0014 movel %fp@(20),%d2 Thread_Control *executing; ISR_Level level; executing = _Thread_Executing; executing->Wait.return_code = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 4dcec: 42a9 0034 clrl %a1@(52) CORE_semaphore_Control *the_semaphore, Objects_Id id, bool wait, Watchdog_Interval timeout ) { 4dcf0: 206e 0008 moveal %fp@(8),%a0 4dcf4: 282e 0010 movel %fp@(16),%d4 Thread_Control *executing; ISR_Level level; executing = _Thread_Executing; executing->Wait.return_code = CORE_SEMAPHORE_STATUS_SUCCESSFUL; _ISR_Disable( level ); 4dcf8: 40c0 movew %sr,%d0 4dcfa: 8280 orl %d0,%d1 4dcfc: 46c1 movew %d1,%sr if ( the_semaphore->count != 0 ) { 4dcfe: 2228 0048 movel %a0@(72),%d1 4dd02: 670a beqs 4dd0e <_CORE_semaphore_Seize+0x3e> the_semaphore->count -= 1; 4dd04: 5381 subql #1,%d1 4dd06: 2141 0048 movel %d1,%a0@(72) _ISR_Enable( level ); 4dd0a: 46c0 movew %d0,%sr return; 4dd0c: 603c bras 4dd4a <_CORE_semaphore_Seize+0x7a> <== ALWAYS TAKEN /* * If the semaphore was not available and the caller was not willing * to block, then return immediately with a status indicating that * the semaphore was not available and the caller never blocked. */ if ( !wait ) { 4dd0e: 4a04 tstb %d4 4dd10: 660a bnes 4dd1c <_CORE_semaphore_Seize+0x4c> _ISR_Enable( level ); 4dd12: 46c0 movew %d0,%sr executing->Wait.return_code = CORE_SEMAPHORE_STATUS_UNSATISFIED_NOWAIT; 4dd14: 7001 moveq #1,%d0 4dd16: 2340 0034 movel %d0,%a1@(52) 4dd1a: 602e bras 4dd4a <_CORE_semaphore_Seize+0x7a> <== ALWAYS TAKEN 4dd1c: 7201 moveq #1,%d1 * If the semaphore is not available and the caller is willing to * block, then we now block the caller with optional timeout. */ _Thread_queue_Enter_critical_section( &the_semaphore->Wait_queue ); executing->Wait.queue = &the_semaphore->Wait_queue; executing->Wait.id = id; 4dd1e: 2343 0020 movel %d3,%a1@(32) /* * If the semaphore is not available and the caller is willing to * block, then we now block the caller with optional timeout. */ _Thread_queue_Enter_critical_section( &the_semaphore->Wait_queue ); executing->Wait.queue = &the_semaphore->Wait_queue; 4dd22: 2348 0044 movel %a0,%a1@(68) 4dd26: 2141 0030 movel %d1,%a0@(48) executing->Wait.id = id; _ISR_Enable( level ); 4dd2a: 46c0 movew %d0,%sr _Thread_queue_Enqueue( &the_semaphore->Wait_queue, timeout ); 4dd2c: 2d42 000c movel %d2,%fp@(12) 4dd30: 203c 0004 a938 movel #305464,%d0 4dd36: 2d48 0008 movel %a0,%fp@(8) 4dd3a: 2d40 0010 movel %d0,%fp@(16) } 4dd3e: 4cd7 001c moveml %sp@,%d2-%d4 4dd42: 4e5e unlk %fp */ _Thread_queue_Enter_critical_section( &the_semaphore->Wait_queue ); executing->Wait.queue = &the_semaphore->Wait_queue; executing->Wait.id = id; _ISR_Enable( level ); _Thread_queue_Enqueue( &the_semaphore->Wait_queue, timeout ); 4dd44: 4ef9 0004 a64c jmp 4a64c <_Thread_queue_Enqueue_with_handler> } 4dd4a: 4cd7 001c moveml %sp@,%d2-%d4 4dd4e: 4e5e unlk %fp 4dd50: 4e75 rts ... 00045c20 <_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 ) { 45c20: 4e56 0000 linkw %fp,#0 45c24: 2f0a movel %a2,%sp@- 45c26: 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)) ) { 45c2a: 2f0a movel %a2,%sp@- 45c2c: 4eb9 0004 7038 jsr 47038 <_Thread_queue_Dequeue> 45c32: 588f addql #4,%sp 45c34: 4a80 tstl %d0 45c36: 6704 beqs 45c3c <_CORE_semaphore_Surrender+0x1c> 45c38: 4280 clrl %d0 45c3a: 6024 bras 45c60 <_CORE_semaphore_Surrender+0x40> <== ALWAYS TAKEN if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_semaphore_mp_support) ( the_thread, id ); #endif } else { _ISR_Disable( level ); 45c3c: 203c 0000 0700 movel #1792,%d0 45c42: 40c1 movew %sr,%d1 45c44: 8081 orl %d1,%d0 45c46: 46c0 movew %d0,%sr if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 45c48: 202a 0048 movel %a2@(72),%d0 45c4c: b0aa 0040 cmpl %a2@(64),%d0 45c50: 6504 bcss 45c56 <_CORE_semaphore_Surrender+0x36> <== NEVER TAKEN 45c52: 7004 moveq #4,%d0 <== NOT EXECUTED 45c54: 6008 bras 45c5e <_CORE_semaphore_Surrender+0x3e> <== NOT EXECUTED the_semaphore->count += 1; 45c56: 5280 addql #1,%d0 45c58: 2540 0048 movel %d0,%a2@(72) 45c5c: 4280 clrl %d0 else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); 45c5e: 46c1 movew %d1,%sr } return status; } 45c60: 246e fffc moveal %fp@(-4),%a2 45c64: 4e5e unlk %fp 45c66: 4e75 rts 00046584 <_CORE_spinlock_Release>: CORE_spinlock_Control *the_spinlock ) { ISR_Level level; _ISR_Disable( level ); 46584: 223c 0000 0700 movel #1792,%d1 */ CORE_spinlock_Status _CORE_spinlock_Release( CORE_spinlock_Control *the_spinlock ) { 4658a: 4e56 0000 linkw %fp,#0 4658e: 206e 0008 moveal %fp@(8),%a0 ISR_Level level; _ISR_Disable( level ); 46592: 40c0 movew %sr,%d0 46594: 8280 orl %d0,%d1 46596: 46c1 movew %d1,%sr /* * It must locked before it can be unlocked. */ if ( the_spinlock->lock == CORE_SPINLOCK_UNLOCKED ) { 46598: 2228 0004 movel %a0@(4),%d1 4659c: 6606 bnes 465a4 <_CORE_spinlock_Release+0x20> _ISR_Enable( level ); 4659e: 46c0 movew %d0,%sr 465a0: 7006 moveq #6,%d0 return CORE_SPINLOCK_NOT_LOCKED; 465a2: 602c bras 465d0 <_CORE_spinlock_Release+0x4c> <== ALWAYS TAKEN } /* * It must locked by the current thread before it can be unlocked. */ if ( the_spinlock->holder != _Thread_Executing->Object.id ) { 465a4: 2228 000c movel %a0@(12),%d1 465a8: 2279 0005 df2e moveal 5df2e <_Thread_Executing>,%a1 465ae: b2a9 0008 cmpl %a1@(8),%d1 465b2: 6706 beqs 465ba <_CORE_spinlock_Release+0x36> _ISR_Enable( level ); 465b4: 46c0 movew %d0,%sr 465b6: 7002 moveq #2,%d0 return CORE_SPINLOCK_NOT_HOLDER; 465b8: 6016 bras 465d0 <_CORE_spinlock_Release+0x4c> <== ALWAYS TAKEN } /* * Let it be unlocked. */ the_spinlock->users -= 1; 465ba: 2228 0008 movel %a0@(8),%d1 465be: 5381 subql #1,%d1 465c0: 2141 0008 movel %d1,%a0@(8) the_spinlock->lock = CORE_SPINLOCK_UNLOCKED; 465c4: 42a8 0004 clrl %a0@(4) the_spinlock->holder = 0; 465c8: 42a8 000c clrl %a0@(12) _ISR_Enable( level ); 465cc: 46c0 movew %d0,%sr 465ce: 4280 clrl %d0 return CORE_SPINLOCK_SUCCESSFUL; } 465d0: 4e5e unlk %fp 465d2: 4e75 rts 000465d4 <_CORE_spinlock_Wait>: ISR_Level level; #if defined(FUNCTIONALITY_NOT_CURRENTLY_USED_BY_ANY_API) Watchdog_Interval limit = _Watchdog_Ticks_since_boot + timeout; #endif _ISR_Disable( level ); 465d4: 223c 0000 0700 movel #1792,%d1 CORE_spinlock_Status _CORE_spinlock_Wait( CORE_spinlock_Control *the_spinlock, bool wait, Watchdog_Interval timeout ) { 465da: 4e56 fff0 linkw %fp,#-16 465de: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ 465e2: 246e 0008 moveal %fp@(8),%a2 465e6: 162e 000f moveb %fp@(15),%d3 ISR_Level level; #if defined(FUNCTIONALITY_NOT_CURRENTLY_USED_BY_ANY_API) Watchdog_Interval limit = _Watchdog_Ticks_since_boot + timeout; #endif _ISR_Disable( level ); 465ea: 40c0 movew %sr,%d0 465ec: 8280 orl %d0,%d1 465ee: 46c1 movew %d1,%sr if ( (the_spinlock->lock == CORE_SPINLOCK_LOCKED) && 465f0: 222a 0004 movel %a2@(4),%d1 465f4: 7401 moveq #1,%d2 465f6: b481 cmpl %d1,%d2 465f8: 6616 bnes 46610 <_CORE_spinlock_Wait+0x3c> (the_spinlock->holder == _Thread_Executing->Object.id) ) { 465fa: 222a 000c movel %a2@(12),%d1 465fe: 2079 0005 df2e moveal 5df2e <_Thread_Executing>,%a0 46604: b2a8 0008 cmpl %a0@(8),%d1 46608: 6606 bnes 46610 <_CORE_spinlock_Wait+0x3c> _ISR_Enable( level ); 4660a: 46c0 movew %d0,%sr 4660c: 7001 moveq #1,%d0 return CORE_SPINLOCK_HOLDER_RELOCKING; 4660e: 6068 bras 46678 <_CORE_spinlock_Wait+0xa4> <== ALWAYS TAKEN } the_spinlock->users += 1; 46610: 222a 0008 movel %a2@(8),%d1 46614: 5281 addql #1,%d1 */ _ISR_Enable( level ); /* An ISR could occur here */ _Thread_Enable_dispatch(); 46616: 47f9 0004 769a lea 4769a <_Thread_Enable_dispatch>,%a3 /* Another thread could get dispatched here */ /* Reenter the critical sections so we can attempt the lock again. */ _Thread_Disable_dispatch(); _ISR_Disable( level ); 4661c: 243c 0000 0700 movel #1792,%d2 if ( (the_spinlock->lock == CORE_SPINLOCK_LOCKED) && (the_spinlock->holder == _Thread_Executing->Object.id) ) { _ISR_Enable( level ); return CORE_SPINLOCK_HOLDER_RELOCKING; } the_spinlock->users += 1; 46622: 2541 0008 movel %d1,%a2@(8) for ( ;; ) { if ( the_spinlock->lock == CORE_SPINLOCK_UNLOCKED ) { 46626: 222a 0004 movel %a2@(4),%d1 4662a: 661c bnes 46648 <_CORE_spinlock_Wait+0x74> the_spinlock->lock = CORE_SPINLOCK_LOCKED; 4662c: 123c 0001 moveb #1,%d1 the_spinlock->holder = _Thread_Executing->Object.id; 46630: 2079 0005 df2e moveal 5df2e <_Thread_Executing>,%a0 return CORE_SPINLOCK_HOLDER_RELOCKING; } the_spinlock->users += 1; for ( ;; ) { if ( the_spinlock->lock == CORE_SPINLOCK_UNLOCKED ) { the_spinlock->lock = CORE_SPINLOCK_LOCKED; 46636: 2541 0004 movel %d1,%a2@(4) the_spinlock->holder = _Thread_Executing->Object.id; 4663a: 2228 0008 movel %a0@(8),%d1 4663e: 2541 000c movel %d1,%a2@(12) _ISR_Enable( level ); 46642: 46c0 movew %d0,%sr 46644: 4280 clrl %d0 return CORE_SPINLOCK_SUCCESSFUL; 46646: 6030 bras 46678 <_CORE_spinlock_Wait+0xa4> <== ALWAYS TAKEN } /* * Spinlock is unavailable. If not willing to wait, return. */ if ( !wait ) { 46648: 4a03 tstb %d3 4664a: 6610 bnes 4665c <_CORE_spinlock_Wait+0x88> the_spinlock->users -= 1; 4664c: 222a 0008 movel %a2@(8),%d1 46650: 5381 subql #1,%d1 46652: 2541 0008 movel %d1,%a2@(8) _ISR_Enable( level ); 46656: 46c0 movew %d0,%sr 46658: 7005 moveq #5,%d0 return CORE_SPINLOCK_UNAVAILABLE; 4665a: 601c bras 46678 <_CORE_spinlock_Wait+0xa4> <== ALWAYS TAKEN * * A spinlock cannot be deleted while it is being used so we are * safe from deletion. */ _ISR_Enable( level ); 4665c: 46c0 movew %d0,%sr /* An ISR could occur here */ _Thread_Enable_dispatch(); 4665e: 4e93 jsr %a3@ 46660: 2039 0005 de74 movel 5de74 <_Thread_Dispatch_disable_level>,%d0 46666: 5280 addql #1,%d0 46668: 23c0 0005 de74 movel %d0,5de74 <_Thread_Dispatch_disable_level> /* Another thread could get dispatched here */ /* Reenter the critical sections so we can attempt the lock again. */ _Thread_Disable_dispatch(); _ISR_Disable( level ); 4666e: 2202 movel %d2,%d1 46670: 40c0 movew %sr,%d0 46672: 8280 orl %d0,%d1 46674: 46c1 movew %d1,%sr } 46676: 60ae bras 46626 <_CORE_spinlock_Wait+0x52> <== ALWAYS TAKEN } 46678: 4cee 0c0c fff0 moveml %fp@(-16),%d2-%d3/%a2-%a3 4667e: 4e5e unlk %fp 46680: 4e75 rts ... 0004a154 <_Chain_Get>: { ISR_Level level; Chain_Node *return_node; return_node = NULL; _ISR_Disable( level ); 4a154: 203c 0000 0700 movel #1792,%d0 */ Chain_Node *_Chain_Get( Chain_Control *the_chain ) { 4a15a: 4e56 0000 linkw %fp,#0 4a15e: 206e 0008 moveal %fp@(8),%a0 4a162: 2f0a movel %a2,%sp@- ISR_Level level; Chain_Node *return_node; return_node = NULL; _ISR_Disable( level ); 4a164: 40c1 movew %sr,%d1 4a166: 8081 orl %d1,%d0 4a168: 46c0 movew %d0,%sr */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 4a16a: 2248 moveal %a0,%a1 4a16c: 2019 movel %a1@+,%d0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4a16e: b3c0 cmpal %d0,%a1 4a170: 6604 bnes 4a176 <_Chain_Get+0x22> 4a172: 4280 clrl %d0 4a174: 600a bras 4a180 <_Chain_Get+0x2c> <== ALWAYS TAKEN { Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; 4a176: 2440 moveal %d0,%a2 4a178: 2252 moveal %a2@,%a1 the_chain->first = new_first; 4a17a: 2089 movel %a1,%a0@ new_first->previous = _Chain_Head(the_chain); 4a17c: 2348 0004 movel %a0,%a1@(4) if ( !_Chain_Is_empty( the_chain ) ) return_node = _Chain_Get_first_unprotected( the_chain ); _ISR_Enable( level ); 4a180: 46c1 movew %d1,%sr return return_node; } 4a182: 245f moveal %sp@+,%a2 4a184: 4e5e unlk %fp 4a186: 4e75 rts 0004a188 <_Chain_Initialize>: Chain_Control *the_chain, void *starting_address, size_t number_nodes, size_t node_size ) { 4a188: 4e56 0000 linkw %fp,#0 4a18c: 202e 0010 movel %fp@(16),%d0 4a190: 2f0a movel %a2,%sp@- 4a192: 246e 0008 moveal %fp@(8),%a2 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Head( Chain_Control *the_chain ) { return (Chain_Node *) the_chain; 4a196: 204a moveal %a2,%a0 Chain_Node *current; Chain_Node *next; count = number_nodes; current = _Chain_Head( the_chain ); the_chain->permanent_null = NULL; 4a198: 42aa 0004 clrl %a2@(4) Chain_Control *the_chain, void *starting_address, size_t number_nodes, size_t node_size ) { 4a19c: 222e 0014 movel %fp@(20),%d1 Chain_Node *next; count = number_nodes; current = _Chain_Head( the_chain ); the_chain->permanent_null = NULL; next = starting_address; 4a1a0: 226e 000c moveal %fp@(12),%a1 while ( count-- ) { 4a1a4: 600c bras 4a1b2 <_Chain_Initialize+0x2a> <== ALWAYS TAKEN current->next = next; next->previous = current; 4a1a6: 2348 0004 movel %a0,%a1@(4) current = next; next = (Chain_Node *) 4a1aa: 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; 4a1ac: 2089 movel %a1,%a0@ next->previous = current; current = next; next = (Chain_Node *) 4a1ae: 2049 moveal %a1,%a0 4a1b0: d3c1 addal %d1,%a1 count = number_nodes; current = _Chain_Head( the_chain ); the_chain->permanent_null = NULL; next = starting_address; while ( count-- ) { 4a1b2: 4a80 tstl %d0 4a1b4: 66f0 bnes 4a1a6 <_Chain_Initialize+0x1e> next->previous = current; current = next; next = (Chain_Node *) _Addresses_Add_offset( (void *) next, node_size ); } current->next = _Chain_Tail( the_chain ); 4a1b6: 200a movel %a2,%d0 4a1b8: 5880 addql #4,%d0 4a1ba: 2080 movel %d0,%a0@ the_chain->last = current; 4a1bc: 2548 0008 movel %a0,%a2@(8) } 4a1c0: 245f moveal %sp@+,%a2 4a1c2: 4e5e unlk %fp 4a1c4: 4e75 rts ... 000449d8 <_Event_Seize>: executing = _Thread_Executing; executing->Wait.return_code = RTEMS_SUCCESSFUL; api = executing->API_Extensions[ THREAD_API_RTEMS ]; _ISR_Disable( level ); 449d8: 203c 0000 0700 movel #1792,%d0 rtems_event_set event_in, rtems_option option_set, rtems_interval ticks, rtems_event_set *event_out ) { 449de: 4e56 ffec linkw %fp,#-20 449e2: 226e 0010 moveal %fp@(16),%a1 449e6: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ rtems_event_set pending_events; ISR_Level level; RTEMS_API_Control *api; Thread_blocking_operation_States sync_state; executing = _Thread_Executing; 449ea: 2479 0005 cf7e moveal 5cf7e <_Thread_Executing>,%a2 rtems_event_set event_in, rtems_option option_set, rtems_interval ticks, rtems_event_set *event_out ) { 449f0: 242e 0008 movel %fp@(8),%d2 449f4: 262e 000c movel %fp@(12),%d3 ISR_Level level; RTEMS_API_Control *api; Thread_blocking_operation_States sync_state; executing = _Thread_Executing; executing->Wait.return_code = RTEMS_SUCCESSFUL; 449f8: 42aa 0034 clrl %a2@(52) rtems_event_set event_in, rtems_option option_set, rtems_interval ticks, rtems_event_set *event_out ) { 449fc: 206e 0014 moveal %fp@(20),%a0 Thread_blocking_operation_States sync_state; executing = _Thread_Executing; executing->Wait.return_code = RTEMS_SUCCESSFUL; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 44a00: 266a 010a moveal %a2@(266),%a3 _ISR_Disable( level ); 44a04: 40c1 movew %sr,%d1 44a06: 8081 orl %d1,%d0 44a08: 46c0 movew %d0,%sr pending_events = api->pending_events; 44a0a: 2813 movel %a3@,%d4 RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Get( rtems_event_set the_event_set, rtems_event_set the_event_condition ) { return ( the_event_set & the_event_condition ); 44a0c: 2002 movel %d2,%d0 44a0e: c084 andl %d4,%d0 seized_events = _Event_sets_Get( pending_events, event_in ); if ( !_Event_sets_Is_empty( seized_events ) && 44a10: 6716 beqs 44a28 <_Event_Seize+0x50> 44a12: b480 cmpl %d0,%d2 44a14: 6706 beqs 44a1c <_Event_Seize+0x44> 44a16: 0803 0001 btst #1,%d3 44a1a: 670c beqs 44a28 <_Event_Seize+0x50> <== ALWAYS TAKEN (seized_events == event_in || _Options_Is_any( option_set )) ) { api->pending_events = 44a1c: 2400 movel %d0,%d2 44a1e: 4682 notl %d2 44a20: c484 andl %d4,%d2 44a22: 2682 movel %d2,%a3@ _Event_sets_Clear( pending_events, seized_events ); _ISR_Enable( level ); 44a24: 46c1 movew %d1,%sr 44a26: 600e bras 44a36 <_Event_Seize+0x5e> <== ALWAYS TAKEN *event_out = seized_events; return; } if ( _Options_Is_no_wait( option_set ) ) { 44a28: 0803 0000 btst #0,%d3 44a2c: 670e beqs 44a3c <_Event_Seize+0x64> _ISR_Enable( level ); 44a2e: 46c1 movew %d1,%sr executing->Wait.return_code = RTEMS_UNSATISFIED; 44a30: 720d moveq #13,%d1 44a32: 2541 0034 movel %d1,%a2@(52) *event_out = seized_events; 44a36: 2080 movel %d0,%a0@ return; 44a38: 6000 0096 braw 44ad0 <_Event_Seize+0xf8> <== ALWAYS TAKEN * * NOTE: Since interrupts are disabled, this isn't that much of an * issue but better safe than sorry. */ executing->Wait.option = (uint32_t) option_set; executing->Wait.count = (uint32_t) event_in; 44a3c: 2542 0024 movel %d2,%a2@(36) executing->Wait.return_argument = event_out; _Event_Sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 44a40: 7401 moveq #1,%d2 * set properly when we are marked as in the event critical section. * * NOTE: Since interrupts are disabled, this isn't that much of an * issue but better safe than sorry. */ executing->Wait.option = (uint32_t) option_set; 44a42: 2543 0030 movel %d3,%a2@(48) executing->Wait.count = (uint32_t) event_in; executing->Wait.return_argument = event_out; 44a46: 2548 0028 movel %a0,%a2@(40) _Event_Sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 44a4a: 23c2 0005 d6ea movel %d2,5d6ea <_Event_Sync_state> _ISR_Enable( level ); 44a50: 46c1 movew %d1,%sr if ( ticks ) { 44a52: 4a89 tstl %a1 44a54: 6730 beqs 44a86 <_Event_Seize+0xae> _Watchdog_Initialize( 44a56: 202a 0008 movel %a2@(8),%d0 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 44a5a: 223c 0004 4c38 movel #281656,%d1 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 44a60: 2549 0054 movel %a1,%a2@(84) Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 44a64: 2541 0064 movel %d1,%a2@(100) the_watchdog->id = id; 44a68: 2540 0068 movel %d0,%a2@(104) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 44a6c: 42aa 0050 clrl %a2@(80) the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 44a70: 42aa 006c clrl %a2@(108) ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 44a74: 486a 0048 pea %a2@(72) 44a78: 4879 0005 cf9c pea 5cf9c <_Watchdog_Ticks_chain> 44a7e: 4eb9 0004 7c54 jsr 47c54 <_Watchdog_Insert> 44a84: 508f addql #8,%sp NULL ); _Watchdog_Insert_ticks( &executing->Timer, ticks ); } _Thread_Set_state( executing, STATES_WAITING_FOR_EVENT ); 44a86: 4878 0100 pea 100 44a8a: 2f0a movel %a2,%sp@- 44a8c: 4eb9 0004 750c jsr 4750c <_Thread_Set_state> _ISR_Disable( level ); 44a92: 203c 0000 0700 movel #1792,%d0 44a98: 40c1 movew %sr,%d1 44a9a: 8081 orl %d1,%d0 44a9c: 46c0 movew %d0,%sr sync_state = _Event_Sync_state; _Event_Sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) { 44a9e: 7401 moveq #1,%d2 44aa0: 508f addql #8,%sp _Thread_Set_state( executing, STATES_WAITING_FOR_EVENT ); _ISR_Disable( level ); sync_state = _Event_Sync_state; 44aa2: 2039 0005 d6ea movel 5d6ea <_Event_Sync_state>,%d0 _Event_Sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 44aa8: 42b9 0005 d6ea clrl 5d6ea <_Event_Sync_state> if ( sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) { 44aae: b480 cmpl %d0,%d2 44ab0: 6604 bnes 44ab6 <_Event_Seize+0xde> _ISR_Enable( level ); 44ab2: 46c1 movew %d1,%sr 44ab4: 601a bras 44ad0 <_Event_Seize+0xf8> <== ALWAYS TAKEN * An interrupt completed the thread's blocking request. * The blocking thread was satisfied by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ _Thread_blocking_operation_Cancel( sync_state, executing, level ); 44ab6: 2d4a 000c movel %a2,%fp@(12) 44aba: 2d41 0010 movel %d1,%fp@(16) } 44abe: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 * An interrupt completed the thread's blocking request. * The blocking thread was satisfied by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ _Thread_blocking_operation_Cancel( sync_state, executing, level ); 44ac4: 2d40 0008 movel %d0,%fp@(8) } 44ac8: 4e5e unlk %fp * An interrupt completed the thread's blocking request. * The blocking thread was satisfied by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ _Thread_blocking_operation_Cancel( sync_state, executing, level ); 44aca: 4ef9 0004 67a4 jmp 467a4 <_Thread_blocking_operation_Cancel> } 44ad0: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 44ad6: 4e5e unlk %fp 44ad8: 4e75 rts ... 00044b30 <_Event_Surrender>: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; option_set = (rtems_option) the_thread->Wait.option; _ISR_Disable( level ); 44b30: 203c 0000 0700 movel #1792,%d0 */ void _Event_Surrender( Thread_Control *the_thread ) { 44b36: 4e56 ffe8 linkw %fp,#-24 44b3a: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@ 44b3e: 246e 0008 moveal %fp@(8),%a2 rtems_event_set event_condition; rtems_event_set seized_events; rtems_option option_set; RTEMS_API_Control *api; api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; 44b42: 206a 010a moveal %a2@(266),%a0 option_set = (rtems_option) the_thread->Wait.option; 44b46: 282a 0030 movel %a2@(48),%d4 _ISR_Disable( level ); 44b4a: 40c1 movew %sr,%d1 44b4c: 8081 orl %d1,%d0 44b4e: 46c0 movew %d0,%sr pending_events = api->pending_events; event_condition = (rtems_event_set) the_thread->Wait.count; 44b50: 262a 0024 movel %a2@(36),%d3 RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Get( rtems_event_set the_event_set, rtems_event_set the_event_condition ) { return ( the_event_set & the_event_condition ); 44b54: 2003 movel %d3,%d0 api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; option_set = (rtems_option) the_thread->Wait.option; _ISR_Disable( level ); pending_events = api->pending_events; 44b56: 2410 movel %a0@,%d2 44b58: c082 andl %d2,%d0 seized_events = _Event_sets_Get( pending_events, event_condition ); /* * No events were seized in this operation */ if ( _Event_sets_Is_empty( seized_events ) ) { 44b5a: 6606 bnes 44b62 <_Event_Surrender+0x32> _ISR_Enable( level ); 44b5c: 46c1 movew %d1,%sr return; 44b5e: 6000 00cc braw 44c2c <_Event_Surrender+0xfc> <== ALWAYS TAKEN /* * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && 44b62: 2279 0005 cf5e moveal 5cf5e <_ISR_Nest_level>,%a1 44b68: 4a89 tstl %a1 44b6a: 674a beqs 44bb6 <_Event_Surrender+0x86> 44b6c: b5f9 0005 cf7e cmpal 5cf7e <_Thread_Executing>,%a2 44b72: 6642 bnes 44bb6 <_Event_Surrender+0x86> _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 44b74: 2279 0005 d6ea moveal 5d6ea <_Event_Sync_state>,%a1 /* * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && 44b7a: 7a02 moveq #2,%d5 44b7c: ba89 cmpl %a1,%d5 44b7e: 670e beqs 44b8e <_Event_Surrender+0x5e> <== ALWAYS TAKEN _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { 44b80: 2279 0005 d6ea moveal 5d6ea <_Event_Sync_state>,%a1 /* * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && 44b86: 1a3c 0001 moveb #1,%d5 44b8a: ba89 cmpl %a1,%d5 44b8c: 6628 bnes 44bb6 <_Event_Surrender+0x86> _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { 44b8e: b680 cmpl %d0,%d3 44b90: 6706 beqs 44b98 <_Event_Surrender+0x68> 44b92: 0804 0001 btst #1,%d4 44b96: 671a beqs 44bb2 <_Event_Surrender+0x82> <== ALWAYS TAKEN api->pending_events = _Event_sets_Clear( pending_events,seized_events ); 44b98: 2600 movel %d0,%d3 44b9a: 4683 notl %d3 44b9c: c682 andl %d2,%d3 44b9e: 2083 movel %d3,%a0@ the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 44ba0: 206a 0028 moveal %a2@(40),%a0 _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { api->pending_events = _Event_sets_Clear( pending_events,seized_events ); the_thread->Wait.count = 0; 44ba4: 42aa 0024 clrl %a2@(36) *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 44ba8: 2080 movel %d0,%a0@ _Event_Sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 44baa: 7003 moveq #3,%d0 44bac: 23c0 0005 d6ea movel %d0,5d6ea <_Event_Sync_state> } _ISR_Enable( level ); 44bb2: 46c1 movew %d1,%sr return; 44bb4: 6076 bras 44c2c <_Event_Surrender+0xfc> <== ALWAYS TAKEN } /* * Otherwise, this is a normal send to another thread */ if ( _States_Is_waiting_for_event( the_thread->current_state ) ) { 44bb6: 2a2a 0010 movel %a2@(16),%d5 44bba: 0285 0000 0100 andil #256,%d5 44bc0: 6768 beqs 44c2a <_Event_Surrender+0xfa> if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { 44bc2: b680 cmpl %d0,%d3 44bc4: 6706 beqs 44bcc <_Event_Surrender+0x9c> 44bc6: 0804 0001 btst #1,%d4 44bca: 675e beqs 44c2a <_Event_Surrender+0xfa> <== ALWAYS TAKEN api->pending_events = _Event_sets_Clear( pending_events, seized_events ); 44bcc: 2600 movel %d0,%d3 44bce: 4683 notl %d3 44bd0: c682 andl %d2,%d3 44bd2: 2083 movel %d3,%a0@ the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 44bd4: 206a 0028 moveal %a2@(40),%a0 * Otherwise, this is a normal send to another thread */ if ( _States_Is_waiting_for_event( the_thread->current_state ) ) { if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { api->pending_events = _Event_sets_Clear( pending_events, seized_events ); the_thread->Wait.count = 0; 44bd8: 42aa 0024 clrl %a2@(36) *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 44bdc: 2080 movel %d0,%a0@ _ISR_Flash( level ); 44bde: 203c 0000 0700 movel #1792,%d0 44be4: 46c1 movew %d1,%sr 44be6: 8081 orl %d1,%d0 44be8: 46c0 movew %d0,%sr 44bea: 47f9 0004 6934 lea 46934 <_Thread_Clear_state>,%a3 if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 44bf0: 7a02 moveq #2,%d5 44bf2: baaa 0050 cmpl %a2@(80),%d5 44bf6: 6710 beqs 44c08 <_Event_Surrender+0xd8> _ISR_Enable( level ); 44bf8: 46c1 movew %d1,%sr RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 44bfa: 2f3c 1003 fff8 movel #268697592,%sp@- 44c00: 2f0a movel %a2,%sp@- 44c02: 4e93 jsr %a3@ 44c04: 508f addql #8,%sp 44c06: 6024 bras 44c2c <_Event_Surrender+0xfc> <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 44c08: 7003 moveq #3,%d0 44c0a: 2540 0050 movel %d0,%a2@(80) _Thread_Unblock( the_thread ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 44c0e: 46c1 movew %d1,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 44c10: 486a 0048 pea %a2@(72) 44c14: 4eb9 0004 7d70 jsr 47d70 <_Watchdog_Remove> 44c1a: 2f3c 1003 fff8 movel #268697592,%sp@- 44c20: 2f0a movel %a2,%sp@- 44c22: 4e93 jsr %a3@ 44c24: 4fef 000c lea %sp@(12),%sp 44c28: 6002 bras 44c2c <_Event_Surrender+0xfc> <== ALWAYS TAKEN _Thread_Unblock( the_thread ); } return; } } _ISR_Enable( level ); 44c2a: 46c1 movew %d1,%sr } 44c2c: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 44c32: 4e5e unlk %fp 44c34: 4e75 rts ... 00044c38 <_Event_Timeout>: void _Event_Timeout( Objects_Id id, void *ignored ) { 44c38: 4e56 fffc linkw %fp,#-4 44c3c: 2f03 movel %d3,%sp@- 44c3e: 2f02 movel %d2,%sp@- Thread_Control *the_thread; Objects_Locations location; ISR_Level level; the_thread = _Thread_Get( id, &location ); 44c40: 486e fffc pea %fp@(-4) 44c44: 2f2e 0008 movel %fp@(8),%sp@- 44c48: 4eb9 0004 6d14 jsr 46d14 <_Thread_Get> switch ( location ) { 44c4e: 508f addql #8,%sp 44c50: 4aae fffc tstl %fp@(-4) 44c54: 6656 bnes 44cac <_Event_Timeout+0x74> <== 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 ); 44c56: 223c 0000 0700 movel #1792,%d1 44c5c: 40c2 movew %sr,%d2 44c5e: 8282 orl %d2,%d1 44c60: 46c1 movew %d1,%sr _ISR_Enable( level ); return; } #endif the_thread->Wait.count = 0; 44c62: 2040 moveal %d0,%a0 44c64: 42a8 0024 clrl %a0@(36) if ( _Thread_Is_executing( the_thread ) ) { 44c68: b0b9 0005 cf7e cmpl 5cf7e <_Thread_Executing>,%d0 44c6e: 6614 bnes 44c84 <_Event_Timeout+0x4c> if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 44c70: 2239 0005 d6ea movel 5d6ea <_Event_Sync_state>,%d1 44c76: 7601 moveq #1,%d3 44c78: b681 cmpl %d1,%d3 44c7a: 6608 bnes 44c84 <_Event_Timeout+0x4c> _Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 44c7c: 7202 moveq #2,%d1 44c7e: 23c1 0005 d6ea movel %d1,5d6ea <_Event_Sync_state> } the_thread->Wait.return_code = RTEMS_TIMEOUT; 44c84: 7606 moveq #6,%d3 44c86: 2040 moveal %d0,%a0 44c88: 2143 0034 movel %d3,%a0@(52) _ISR_Enable( level ); 44c8c: 46c2 movew %d2,%sr 44c8e: 2f3c 1003 fff8 movel #268697592,%sp@- 44c94: 2f00 movel %d0,%sp@- 44c96: 4eb9 0004 6934 jsr 46934 <_Thread_Clear_state> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 44c9c: 508f addql #8,%sp 44c9e: 2039 0005 cec4 movel 5cec4 <_Thread_Dispatch_disable_level>,%d0 44ca4: 5380 subql #1,%d0 44ca6: 23c0 0005 cec4 movel %d0,5cec4 <_Thread_Dispatch_disable_level> case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 44cac: 242e fff4 movel %fp@(-12),%d2 44cb0: 262e fff8 movel %fp@(-8),%d3 44cb4: 4e5e unlk %fp 44cb6: 4e75 rts 0004a394 <_Heap_Allocate_aligned_with_boundary>: Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 4a394: 4e56 ffc8 linkw %fp,#-56 4a398: 202e 000c movel %fp@(12),%d0 4a39c: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 4a3a0: 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; 4a3a4: 2840 moveal %d0,%a4 4a3a6: 588c addql #4,%a4 Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 4a3a8: 222e 0010 movel %fp@(16),%d1 4a3ac: 2a2e 0014 movel %fp@(20),%d5 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 4a3b0: 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; 4a3b4: 2e2a 0010 movel %a2@(16),%d7 uintptr_t alloc_begin = 0; uint32_t search_count = 0; if ( block_size_floor < alloc_size ) { 4a3b8: b08c cmpl %a4,%d0 4a3ba: 6200 0120 bhiw 4a4dc <_Heap_Allocate_aligned_with_boundary+0x148> <== ALWAYS TAKEN /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { 4a3be: 4a85 tstl %d5 4a3c0: 670c beqs 4a3ce <_Heap_Allocate_aligned_with_boundary+0x3a> if ( boundary < alloc_size ) { 4a3c2: b085 cmpl %d5,%d0 4a3c4: 6200 0116 bhiw 4a4dc <_Heap_Allocate_aligned_with_boundary+0x148> <== ALWAYS TAKEN return NULL; } if ( alignment == 0 ) { 4a3c8: 4a81 tstl %d1 4a3ca: 6602 bnes 4a3ce <_Heap_Allocate_aligned_with_boundary+0x3a> 4a3cc: 2207 movel %d7,%d1 uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; 4a3ce: 2407 movel %d7,%d2 4a3d0: 5e82 addql #7,%d2 if ( boundary != 0 ) { if ( boundary < alloc_size ) { return NULL; } if ( alignment == 0 ) { 4a3d2: 4283 clrl %d3 4a3d4: 2a43 moveal %d3,%a5 uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; 4a3d6: 2d42 fff8 movel %d2,%fp@(-8) uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; 4a3da: 7404 moveq #4,%d2 4a3dc: 9480 subl %d0,%d2 4a3de: 2d42 fff4 movel %d2,%fp@(-12) 4a3e2: 6000 00c6 braw 4a4aa <_Heap_Allocate_aligned_with_boundary+0x116> <== ALWAYS TAKEN /* * 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 ) { 4a3e6: 2628 0004 movel %a0@(4),%d3 while ( block != free_list_tail ) { _HAssert( _Heap_Is_prev_used( block ) ); /* Statistics */ ++search_count; 4a3ea: 528d addql #1,%a5 /* * The HEAP_PREV_BLOCK_USED flag is always set in the block size_and_flag * field. Thus the value is about one unit larger than the real block * size. The greater than operator takes this into account. */ if ( block->size_and_flag > block_size_floor ) { 4a3ec: b9c3 cmpal %d3,%a4 4a3ee: 6400 00b6 bccw 4a4a6 <_Heap_Allocate_aligned_with_boundary+0x112> 4a3f2: 43e8 0008 lea %a0@(8),%a1 if ( alignment == 0 ) { 4a3f6: 4a81 tstl %d1 4a3f8: 6606 bnes 4a400 <_Heap_Allocate_aligned_with_boundary+0x6c> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 4a3fa: 2409 movel %a1,%d2 4a3fc: 6000 00a4 braw 4a4a2 <_Heap_Allocate_aligned_with_boundary+0x10e> <== ALWAYS TAKEN 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; 4a400: 74fe moveq #-2,%d2 4a402: c682 andl %d2,%d3 uintptr_t alignment, uintptr_t boundary ) { uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; 4a404: 266a 0014 moveal %a2@(20),%a3 uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; 4a408: d688 addl %a0,%d3 uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; 4a40a: 282e fff8 movel %fp@(-8),%d4 4a40e: 988b subl %a3,%d4 uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; 4a410: 242e fff4 movel %fp@(-12),%d2 4a414: d483 addl %d3,%d2 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4a416: 2c02 movel %d2,%d6 uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; 4a418: d684 addl %d4,%d3 4a41a: 4c41 6004 remul %d1,%d4,%d6 uintptr_t alignment, uintptr_t boundary ) { uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; 4a41e: 2d4b fff0 movel %a3,%fp@(-16) 4a422: 9484 subl %d4,%d2 uintptr_t alloc_begin = alloc_end - alloc_size; alloc_begin = _Heap_Align_down( alloc_begin, alignment ); /* Ensure that the we have a valid new block at the end */ if ( alloc_begin > alloc_begin_ceiling ) { 4a424: b682 cmpl %d2,%d3 4a426: 640a bccs 4a432 <_Heap_Allocate_aligned_with_boundary+0x9e> 4a428: 2803 movel %d3,%d4 4a42a: 4c41 4002 remul %d1,%d2,%d4 4a42e: 9682 subl %d2,%d3 4a430: 2403 movel %d3,%d2 } alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { 4a432: 4a85 tstl %d5 4a434: 674e beqs 4a484 <_Heap_Allocate_aligned_with_boundary+0xf0> /* Ensure that the we have a valid new block at the end */ if ( alloc_begin > alloc_begin_ceiling ) { alloc_begin = _Heap_Align_down( alloc_begin_ceiling, alignment ); } alloc_end = alloc_begin + alloc_size; 4a436: 2802 movel %d2,%d4 4a438: d880 addl %d0,%d4 4a43a: 2604 movel %d4,%d3 /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; 4a43c: 47f1 0800 lea %a1@(00000000,%d0:l),%a3 4a440: 4c45 3006 remul %d5,%d6,%d3 4a444: 2d4b fffc movel %a3,%fp@(-4) 4a448: 2604 movel %d4,%d3 4a44a: 9686 subl %d6,%d3 4a44c: 2c03 movel %d3,%d6 4a44e: 266e fff0 moveal %fp@(-16),%a3 4a452: 6020 bras 4a474 <_Heap_Allocate_aligned_with_boundary+0xe0> <== ALWAYS TAKEN uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { if ( boundary_line < boundary_floor ) { 4a454: bcae fffc cmpl %fp@(-4),%d6 4a458: 654c bcss 4a4a6 <_Heap_Allocate_aligned_with_boundary+0x112> 4a45a: 2803 movel %d3,%d4 4a45c: 4c41 4002 remul %d1,%d2,%d4 4a460: 9682 subl %d2,%d3 return 0; } alloc_begin = boundary_line - alloc_size; alloc_begin = _Heap_Align_down( alloc_begin, alignment ); alloc_end = alloc_begin + alloc_size; 4a462: 2803 movel %d3,%d4 4a464: d880 addl %d0,%d4 4a466: 2403 movel %d3,%d2 4a468: 2604 movel %d4,%d3 4a46a: 4c45 3006 remul %d5,%d6,%d3 4a46e: 2604 movel %d4,%d3 4a470: 9686 subl %d6,%d3 4a472: 2c03 movel %d3,%d6 while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { if ( boundary_line < boundary_floor ) { return 0; } alloc_begin = boundary_line - alloc_size; 4a474: 2606 movel %d6,%d3 4a476: 9680 subl %d0,%d3 /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { 4a478: bc82 cmpl %d2,%d6 4a47a: 6304 blss 4a480 <_Heap_Allocate_aligned_with_boundary+0xec> 4a47c: b886 cmpl %d6,%d4 4a47e: 62d4 bhis 4a454 <_Heap_Allocate_aligned_with_boundary+0xc0> 4a480: 2d4b fff0 movel %a3,%fp@(-16) boundary_line = _Heap_Align_down( alloc_end, boundary ); } } /* Ensure that the we have a valid new block at the beginning */ if ( alloc_begin >= alloc_begin_floor ) { 4a484: b3c2 cmpal %d2,%a1 4a486: 621e bhis 4a4a6 <_Heap_Allocate_aligned_with_boundary+0x112> uintptr_t const alloc_block_begin = (uintptr_t) _Heap_Block_of_alloc_area( alloc_begin, page_size ); uintptr_t const free_size = alloc_block_begin - block_begin; 4a488: 2802 movel %d2,%d4 4a48a: 327c fff8 moveaw #-8,%a1 4a48e: 93c8 subal %a0,%a1 4a490: d3c2 addal %d2,%a1 4a492: 4c47 4003 remul %d7,%d3,%d4 4a496: 93c3 subal %d3,%a1 if ( free_size >= min_block_size || free_size == 0 ) { 4a498: b3ee fff0 cmpal %fp@(-16),%a1 4a49c: 6404 bccs 4a4a2 <_Heap_Allocate_aligned_with_boundary+0x10e> 4a49e: 4a89 tstl %a1 4a4a0: 6604 bnes 4a4a6 <_Heap_Allocate_aligned_with_boundary+0x112> boundary ); } } if ( alloc_begin != 0 ) { 4a4a2: 4a82 tstl %d2 4a4a4: 6610 bnes 4a4b6 <_Heap_Allocate_aligned_with_boundary+0x122> <== NEVER TAKEN break; } block = block->next; 4a4a6: 2068 0008 moveal %a0@(8),%a0 if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { 4a4aa: b5c8 cmpal %a0,%a2 4a4ac: 6600 ff38 bnew 4a3e6 <_Heap_Allocate_aligned_with_boundary+0x52> 4a4b0: 260d movel %a5,%d3 4a4b2: 4282 clrl %d2 4a4b4: 6018 bras 4a4ce <_Heap_Allocate_aligned_with_boundary+0x13a> <== ALWAYS TAKEN if ( alloc_begin != 0 ) { /* Statistics */ stats->searches += search_count; block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 4a4b6: 2f00 movel %d0,%sp@- 4a4b8: 260d movel %a5,%d3 block = block->next; } if ( alloc_begin != 0 ) { /* Statistics */ stats->searches += search_count; 4a4ba: d7aa 004c addl %d3,%a2@(76) block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 4a4be: 2f02 movel %d2,%sp@- 4a4c0: 2f08 movel %a0,%sp@- 4a4c2: 2f0a movel %a2,%sp@- 4a4c4: 4eb9 0004 5eee jsr 45eee <_Heap_Block_allocate> 4a4ca: 4fef 0010 lea %sp@(16),%sp uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { Heap_Statistics *const stats = &heap->stats; 4a4ce: b6aa 0044 cmpl %a2@(68),%d3 4a4d2: 6304 blss 4a4d8 <_Heap_Allocate_aligned_with_boundary+0x144> ); } /* Statistics */ if ( stats->max_search < search_count ) { stats->max_search = search_count; 4a4d4: 2543 0044 movel %d3,%a2@(68) } return (void *) alloc_begin; 4a4d8: 2002 movel %d2,%d0 4a4da: 6002 bras 4a4de <_Heap_Allocate_aligned_with_boundary+0x14a> <== ALWAYS TAKEN 4a4dc: 4280 clrl %d0 } 4a4de: 4cee 3cfc ffc8 moveml %fp@(-56),%d2-%d7/%a2-%a5 4a4e4: 4e5e unlk %fp 4a4e6: 4e75 rts 00045eee <_Heap_Block_allocate>: Heap_Block *free_list_anchor = NULL; _HAssert( alloc_area_begin <= alloc_begin ); if ( _Heap_Is_free( block ) ) { 45eee: 70fe moveq #-2,%d0 Heap_Control *heap, Heap_Block *block, uintptr_t alloc_begin, uintptr_t alloc_size ) { 45ef0: 4e56 ffe0 linkw %fp,#-32 45ef4: 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; 45ef8: 2241 moveal %d1,%a1 45efa: 5189 subql #8,%a1 45efc: 48d7 3c3c moveml %d2-%d5/%a2-%a5,%sp@ 45f00: 246e 000c moveal %fp@(12),%a2 Heap_Block *free_list_anchor = NULL; _HAssert( alloc_area_begin <= alloc_begin ); if ( _Heap_Is_free( block ) ) { 45f04: 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; 45f06: 2a49 moveal %a1,%a5 45f08: 240a movel %a2,%d2 45f0a: 9bca subal %a2,%a5 Heap_Block *free_list_anchor = NULL; _HAssert( alloc_area_begin <= alloc_begin ); if ( _Heap_Is_free( block ) ) { 45f0c: c0aa 0004 andl %a2@(4),%d0 Heap_Control *heap, Heap_Block *block, uintptr_t alloc_begin, uintptr_t alloc_size ) { 45f10: 266e 0008 moveal %fp@(8),%a3 Heap_Block *free_list_anchor = NULL; _HAssert( alloc_area_begin <= alloc_begin ); if ( _Heap_Is_free( block ) ) { 45f14: c6b2 0804 andl %a2@(00000004,%d0:l),%d3 Heap_Control *heap, Heap_Block *block, uintptr_t alloc_begin, uintptr_t alloc_size ) { 45f18: 2a2e 0014 movel %fp@(20),%d5 Heap_Block *free_list_anchor = NULL; _HAssert( alloc_area_begin <= alloc_begin ); if ( _Heap_Is_free( block ) ) { 45f1c: 4a03 tstb %d3 45f1e: 6626 bnes 45f46 <_Heap_Block_allocate+0x58> free_list_anchor = block->prev; _Heap_Free_list_remove( block ); /* Statistics */ --stats->free_blocks; 45f20: 53ab 0038 subql #1,%a3@(56) ++stats->used_blocks; stats->free_size -= _Heap_Block_size( block ); 45f24: 76fe moveq #-2,%d3 _Heap_Free_list_remove( block ); /* Statistics */ --stats->free_blocks; ++stats->used_blocks; 45f26: 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; 45f2a: 202a 0008 movel %a2@(8),%d0 Heap_Block *prev = block->prev; prev->next = next; next->prev = prev; 45f2e: 2840 moveal %d0,%a4 stats->free_size -= _Heap_Block_size( block ); 45f30: c6aa 0004 andl %a2@(4),%d3 Heap_Block *free_list_anchor = NULL; _HAssert( alloc_area_begin <= alloc_begin ); if ( _Heap_Is_free( block ) ) { free_list_anchor = block->prev; 45f34: 206a 000c moveal %a2@(12),%a0 _Heap_Free_list_remove( block ); /* Statistics */ --stats->free_blocks; ++stats->used_blocks; stats->free_size -= _Heap_Block_size( block ); 45f38: 97ab 0030 subl %d3,%a3@(48) 45f3c: 2948 000c movel %a0,%a4@(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; 45f40: 2140 0008 movel %d0,%a0@(8) 45f44: 6002 bras 45f48 <_Heap_Block_allocate+0x5a> <== ALWAYS TAKEN } else { free_list_anchor = _Heap_Free_list_head( heap ); 45f46: 204b moveal %a3,%a0 } if ( alloc_area_offset < heap->page_size ) { 45f48: 202b 0010 movel %a3@(16),%d0 45f4c: b08d cmpl %a5,%d0 45f4e: 630a blss 45f5a <_Heap_Block_allocate+0x6c> Heap_Block *block, Heap_Block *free_list_anchor, uintptr_t alloc_size ) { _Heap_Block_split( heap, block, free_list_anchor, alloc_size ); 45f50: 4875 5800 pea %a5@(00000000,%d5:l) 45f54: 2f08 movel %a0,%sp@- 45f56: 2f0a movel %a2,%sp@- 45f58: 6062 bras 45fbc <_Heap_Block_allocate+0xce> <== 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; 45f5a: 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 ) 45f5e: 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 ) ) { 45f62: 7201 moveq #1,%d1 45f64: 93c4 subal %d4,%a1 _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; 45f66: 2009 movel %a1,%d0 45f68: 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; 45f6a: d1ab 0030 addl %d0,%a3@(48) if ( _Heap_Is_prev_used( block ) ) { 45f6e: c2aa 0004 andl %a2@(4),%d1 45f72: 671c beqs 45f90 <_Heap_Block_allocate+0xa2> RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after( Heap_Block *block_before, Heap_Block *new_block ) { Heap_Block *next = block_before->next; 45f74: 2a68 0008 moveal %a0@(8),%a5 _Heap_Free_list_insert_after( free_list_anchor, block ); free_list_anchor = block; /* Statistics */ ++stats->free_blocks; 45f78: 52ab 0038 addql #1,%a3@(56) 45f7c: 220a movel %a2,%d1 new_block->next = next; 45f7e: 254d 0008 movel %a5,%a2@(8) new_block->prev = block_before; 45f82: 2548 000c movel %a0,%a2@(12) block_before->next = new_block; 45f86: 214a 0008 movel %a2,%a0@(8) next->prev = new_block; 45f8a: 2b4a 000c movel %a2,%a5@(12) 45f8e: 600c bras 45f9c <_Heap_Block_allocate+0xae> <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Prev_block( const Heap_Block *block ) { return (Heap_Block *) ((uintptr_t) block - block->prev_size); 45f90: 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; 45f92: 78fe moveq #-2,%d4 45f94: 2208 movel %a0,%d1 45f96: c8aa 0004 andl %a2@(4),%d4 45f9a: 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; 45f9c: 78fe moveq #-2,%d4 45f9e: 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; 45fa0: 7801 moveq #1,%d4 45fa2: 8880 orl %d0,%d4 new_block->prev_size = block_size; 45fa4: 2280 movel %d0,%a1@ new_block->size_and_flag = new_block_size; 45fa6: 2002 movel %d2,%d0 45fa8: d083 addl %d3,%d0 45faa: 9089 subl %a1,%d0 block = prev_block; block_begin = (uintptr_t) block; block_size += prev_block_size; } block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; 45fac: 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 ); 45fb0: 2449 moveal %a1,%a2 } block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; new_block->prev_size = block_size; new_block->size_and_flag = new_block_size; 45fb2: 2340 0004 movel %d0,%a1@(4) _Heap_Block_split( heap, new_block, free_list_anchor, alloc_size ); 45fb6: 2f05 movel %d5,%sp@- 45fb8: 2f01 movel %d1,%sp@- 45fba: 2f09 movel %a1,%sp@- 45fbc: 2f0b movel %a3,%sp@- 45fbe: 4eb9 0004 5e20 jsr 45e20 <_Heap_Block_split> alloc_size ); } /* Statistics */ if ( stats->min_free_size > stats->free_size ) { 45fc4: 202b 0030 movel %a3@(48),%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; _Heap_Block_split( heap, new_block, free_list_anchor, alloc_size ); 45fc8: 4fef 0010 lea %sp@(16),%sp Heap_Block *block, uintptr_t alloc_begin, uintptr_t alloc_size ) { Heap_Statistics *const stats = &heap->stats; 45fcc: b0ab 0034 cmpl %a3@(52),%d0 45fd0: 6404 bccs 45fd6 <_Heap_Block_allocate+0xe8> ); } /* Statistics */ if ( stats->min_free_size > stats->free_size ) { stats->min_free_size = stats->free_size; 45fd2: 2740 0034 movel %d0,%a3@(52) } return block; } 45fd6: 200a movel %a2,%d0 45fd8: 4cee 3c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a5 45fde: 4e5e unlk %fp 45fe0: 4e75 rts ... 00045e20 <_Heap_Block_split>: - 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; 45e20: 70fe moveq #-2,%d0 Heap_Control *heap, Heap_Block *block, Heap_Block *free_list_anchor, uintptr_t alloc_size ) { 45e22: 4e56 ffe0 linkw %fp,#-32 45e26: 48d7 1c7c moveml %d2-%d6/%a2-%a4,%sp@ 45e2a: 246e 0008 moveal %fp@(8),%a2 45e2e: 266e 000c moveal %fp@(12),%a3 Heap_Statistics *const stats = &heap->stats; uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; 45e32: 282a 0014 movel %a2@(20),%d4 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; 45e36: 2044 moveal %d4,%a0 45e38: 5188 subql #8,%a0 45e3a: 262b 0004 movel %a3@(4),%d3 Heap_Control *heap, Heap_Block *block, Heap_Block *free_list_anchor, uintptr_t alloc_size ) { 45e3e: 286e 0010 moveal %fp@(16),%a4 Heap_Statistics *const stats = &heap->stats; uintptr_t const page_size = heap->page_size; 45e42: 222a 0010 movel %a2@(16),%d1 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; 45e46: 242e 0014 movel %fp@(20),%d2 45e4a: c083 andl %d3,%d0 45e4c: b1c2 cmpal %d2,%a0 45e4e: 6302 blss 45e52 <_Heap_Block_split+0x32> 45e50: 2408 movel %a0,%d2 45e52: 5082 addql #8,%d2 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up( uintptr_t value, uintptr_t alignment ) { uintptr_t remainder = value % alignment; 45e54: 2c02 movel %d2,%d6 45e56: 4c41 6005 remul %d1,%d5,%d6 if ( remainder != 0 ) { 45e5a: 4a85 tstl %d5 45e5c: 6604 bnes 45e62 <_Heap_Block_split+0x42> 45e5e: 2202 movel %d2,%d1 45e60: 6004 bras 45e66 <_Heap_Block_split+0x46> <== ALWAYS TAKEN return value - remainder + alignment; 45e62: d282 addl %d2,%d1 45e64: 9285 subl %d5,%d1 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 ) { 45e66: 2240 moveal %d0,%a1 45e68: 5889 addql #4,%a1 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 45e6a: 41f3 0800 lea %a3@(00000000,%d0:l),%a0 45e6e: 93c2 subal %d2,%a1 45e70: 5884 addql #4,%d4 45e72: b889 cmpl %a1,%d4 45e74: 626a bhis 45ee0 <_Heap_Block_split+0xc0> uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; block->size_and_flag = size | flag; 45e76: 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); 45e78: 43f3 1800 lea %a3@(00000000,%d1:l),%a1 Heap_Block *const free_block = _Heap_Block_at( block, used_block_size ); uintptr_t free_block_size = block_size - used_block_size; 45e7c: 9081 subl %d1,%d0 uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; block->size_and_flag = size | flag; 45e7e: c682 andl %d2,%d3 45e80: 8283 orl %d3,%d1 45e82: 2741 0004 movel %d1,%a3@(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; 45e86: d1aa 0030 addl %d0,%a2@(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; 45e8a: 72fe moveq #-2,%d1 45e8c: c2a8 0004 andl %a0@(4),%d1 if ( _Heap_Is_used( next_block ) ) { 45e90: c4b0 1804 andl %a0@(00000004,%d1:l),%d2 45e94: 671a beqs 45eb0 <_Heap_Block_split+0x90> RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after( Heap_Block *block_before, Heap_Block *new_block ) { Heap_Block *next = block_before->next; 45e96: 266c 0008 moveal %a4@(8),%a3 _Heap_Free_list_insert_after( free_list_anchor, free_block ); /* Statistics */ ++stats->free_blocks; 45e9a: 52aa 0038 addql #1,%a2@(56) new_block->next = next; 45e9e: 234b 0008 movel %a3,%a1@(8) new_block->prev = block_before; 45ea2: 234c 000c movel %a4,%a1@(12) block_before->next = new_block; 45ea6: 2949 0008 movel %a1,%a4@(8) next->prev = new_block; 45eaa: 2749 000c movel %a1,%a3@(12) 45eae: 601e bras 45ece <_Heap_Block_split+0xae> <== ALWAYS TAKEN Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; Heap_Block *prev = old_block->prev; 45eb0: 2668 000c moveal %a0@(12),%a3 } 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; 45eb4: d081 addl %d1,%d0 RTEMS_INLINE_ROUTINE void _Heap_Free_list_replace( Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; 45eb6: 2468 0008 moveal %a0@(8),%a2 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 45eba: 41f1 0800 lea %a1@(00000000,%d0:l),%a0 ) { Heap_Block *next = old_block->next; Heap_Block *prev = old_block->prev; new_block->next = next; 45ebe: 234a 0008 movel %a2,%a1@(8) new_block->prev = prev; 45ec2: 234b 000c movel %a3,%a1@(12) next->prev = new_block; prev->next = new_block; 45ec6: 2749 0008 movel %a1,%a3@(8) Heap_Block *prev = old_block->prev; new_block->next = next; new_block->prev = prev; next->prev = new_block; 45eca: 2549 000c movel %a1,%a2@(12) next_block = _Heap_Block_at( free_block, free_block_size ); } free_block->size_and_flag = free_block_size | HEAP_PREV_BLOCK_USED; 45ece: 7201 moveq #1,%d1 next_block->prev_size = free_block_size; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 45ed0: 74fe moveq #-2,%d2 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; 45ed2: 8280 orl %d0,%d1 next_block->prev_size = free_block_size; 45ed4: 2080 movel %d0,%a0@ 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; 45ed6: 2341 0004 movel %d1,%a1@(4) next_block->prev_size = free_block_size; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 45eda: c5a8 0004 andl %d2,%a0@(4) 45ede: 6006 bras 45ee6 <_Heap_Block_split+0xc6> <== ALWAYS TAKEN } else { next_block->size_and_flag |= HEAP_PREV_BLOCK_USED; 45ee0: 7001 moveq #1,%d0 45ee2: 81a8 0004 orl %d0,%a0@(4) } } 45ee6: 4cd7 1c7c moveml %sp@,%d2-%d6/%a2-%a4 45eea: 4e5e unlk %fp 45eec: 4e75 rts 0004e538 <_Heap_Extend>: Heap_Control *heap, void *area_begin_ptr, uintptr_t area_size, uintptr_t *amount_extended ) { 4e538: 4e56 fff4 linkw %fp,#-12 4e53c: 206e 0008 moveal %fp@(8),%a0 4e540: 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; 4e544: 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; 4e548: 2268 0024 moveal %a0@(36),%a1 Heap_Control *heap, void *area_begin_ptr, uintptr_t area_size, uintptr_t *amount_extended ) { 4e54c: 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; 4e550: b0a8 0018 cmpl %a0@(24),%d0 4e554: 6508 bcss 4e55e <_Heap_Extend+0x26> * 5. non-contiguous higher address (NOT SUPPORTED) * * As noted, this code only supports (4). */ if ( area_begin >= heap_area_begin && area_begin < heap_area_end ) { 4e556: b280 cmpl %d0,%d1 4e558: 6304 blss 4e55e <_Heap_Extend+0x26> 4e55a: 7001 moveq #1,%d0 4e55c: 606c bras 4e5ca <_Heap_Extend+0x92> <== ALWAYS TAKEN return HEAP_EXTEND_ERROR; /* case 3 */ } else if ( area_begin != heap_area_end ) { 4e55e: b280 cmpl %d0,%d1 4e560: 6704 beqs 4e566 <_Heap_Extend+0x2e> 4e562: 7002 moveq #2,%d0 4e564: 6064 bras 4e5ca <_Heap_Extend+0x92> <== ALWAYS TAKEN { 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; 4e566: 2200 movel %d0,%d1 4e568: d2ae 0010 addl %fp@(16),%d1 * block and free it. */ heap->area_end = new_heap_area_end; extend_size = new_heap_area_end 4e56c: 70f8 moveq #-8,%d0 4e56e: 9089 subl %a1,%d0 4e570: d081 addl %d1,%d0 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4e572: 2600 movel %d0,%d3 4e574: 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; 4e57a: 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; 4e57e: 246e 0014 moveal %fp@(20),%a2 4e582: 9082 subl %d2,%d0 4e584: 2480 movel %d0,%a2@ if( extend_size >= heap->min_block_size ) { 4e586: b0a8 0014 cmpl %a0@(20),%d0 4e58a: 653c bcss 4e5c8 <_Heap_Extend+0x90> <== ALWAYS TAKEN uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; block->size_and_flag = size | flag; 4e58c: 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); 4e58e: 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; 4e592: c4a9 0004 andl %a1@(4),%d2 Heap_Block *const new_last_block = _Heap_Block_at( last_block, extend_size ); _Heap_Block_set_size( last_block, extend_size ); new_last_block->size_and_flag = 4e596: 2228 0020 movel %a0@(32),%d1 4e59a: 928a subl %a2,%d1 4e59c: 8480 orl %d0,%d2 ((uintptr_t) heap->first_block - (uintptr_t) new_last_block) | HEAP_PREV_BLOCK_USED; heap->last_block = new_last_block; 4e59e: 214a 0024 movel %a2,%a0@(36) 4e5a2: 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 = 4e5a6: 7401 moveq #1,%d2 4e5a8: 8481 orl %d1,%d2 4e5aa: 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 )); 4e5ae: 4869 0008 pea %a1@(8) | HEAP_PREV_BLOCK_USED; heap->last_block = new_last_block; /* Statistics */ stats->size += extend_size; 4e5b2: d1a8 002c addl %d0,%a0@(44) ++stats->used_blocks; 4e5b6: 52a8 0040 addql #1,%a0@(64) --stats->frees; /* Do not count subsequent call as actual free() */ 4e5ba: 53a8 0050 subql #1,%a0@(80) _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( last_block )); 4e5be: 2f08 movel %a0,%sp@- 4e5c0: 4eb9 0004 98a8 jsr 498a8 <_Heap_Free> 4e5c6: 508f addql #8,%sp 4e5c8: 4280 clrl %d0 } return HEAP_EXTEND_SUCCESSFUL; } 4e5ca: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 4e5d0: 4e5e unlk %fp 4e5d2: 4e75 rts 0004a4e8 <_Heap_Free>: #include #include #include bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { 4a4e8: 4e56 ffe8 linkw %fp,#-24 4a4ec: 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 ) 4a4f0: 2240 moveal %d0,%a1 4a4f2: 5189 subql #8,%a1 4a4f4: 206e 0008 moveal %fp@(8),%a0 4a4f8: 4c68 0001 0010 remul %a0@(16),%d1,%d0 4a4fe: 48d7 0c3c moveml %d2-%d5/%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; 4a502: 2828 0020 movel %a0@(32),%d4 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 ) 4a506: 93c1 subal %d1,%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 4a508: b889 cmpl %a1,%d4 4a50a: 6200 0140 bhiw 4a64c <_Heap_Free+0x164> 4a50e: b3e8 0024 cmpal %a0@(36),%a1 4a512: 53c0 sls %d0 4a514: 49c0 extbl %d0 4a516: 4480 negl %d0 Heap_Block *next_block = NULL; uintptr_t block_size = 0; uintptr_t next_block_size = 0; bool next_is_free = false; if ( !_Heap_Is_block_in_heap( heap, block ) ) { 4a518: 4a00 tstb %d0 4a51a: 6700 0130 beqw 4a64c <_Heap_Free+0x164> <== 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; 4a51e: 2629 0004 movel %a1@(4),%d3 4a522: 70fe moveq #-2,%d0 4a524: c083 andl %d3,%d0 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4a526: 45f1 0800 lea %a1@(00000000,%d0: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 4a52a: b88a cmpl %a2,%d4 4a52c: 6200 011e bhiw 4a64c <_Heap_Free+0x164> <== ALWAYS TAKEN 4a530: b5e8 0024 cmpal %a0@(36),%a2 4a534: 53c1 sls %d1 4a536: 49c1 extbl %d1 4a538: 4481 negl %d1 } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 4a53a: 4a01 tstb %d1 4a53c: 6700 010e beqw 4a64c <_Heap_Free+0x164> <== 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; 4a540: 222a 0004 movel %a2@(4),%d1 _HAssert( false ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 4a544: 7401 moveq #1,%d2 4a546: c481 andl %d1,%d2 4a548: 4a02 tstb %d2 4a54a: 6700 0100 beqw 4a64c <_Heap_Free+0x164> <== 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; 4a54e: 74fe moveq #-2,%d2 return false; } 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 )); 4a550: 2668 0024 moveal %a0@(36),%a3 4a554: c282 andl %d2,%d1 _HAssert( false ); return false; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block 4a556: b7ca cmpal %a2,%a3 4a558: 6604 bnes 4a55e <_Heap_Free+0x76> 4a55a: 4282 clrl %d2 4a55c: 6010 bras 4a56e <_Heap_Free+0x86> <== ALWAYS TAKEN 4a55e: 7401 moveq #1,%d2 4a560: 7a01 moveq #1,%d5 4a562: c4b2 1804 andl %a2@(00000004,%d1:l),%d2 4a566: bb82 eorl %d5,%d2 4a568: 0282 0000 00ff andil #255,%d2 && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); if ( !_Heap_Is_prev_used( block ) ) { 4a56e: 7a01 moveq #1,%d5 4a570: c685 andl %d5,%d3 4a572: 4a03 tstb %d3 4a574: 6662 bnes 4a5d8 <_Heap_Free+0xf0> uintptr_t const prev_size = block->prev_size; 4a576: 2611 movel %a1@,%d3 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4a578: 93c3 subal %d3,%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 4a57a: b889 cmpl %a1,%d4 4a57c: 6200 00ce bhiw 4a64c <_Heap_Free+0x164> <== ALWAYS TAKEN 4a580: b3cb cmpal %a3,%a1 4a582: 53c4 sls %d4 4a584: 49c4 extbl %d4 4a586: 4484 negl %d4 Heap_Block * const prev_block = _Heap_Block_at( block, -prev_size ); if ( !_Heap_Is_block_in_heap( heap, prev_block ) ) { 4a588: 4a04 tstb %d4 4a58a: 6700 00c0 beqw 4a64c <_Heap_Free+0x164> <== 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) ) { 4a58e: 7801 moveq #1,%d4 4a590: c8a9 0004 andl %a1@(4),%d4 4a594: 4a04 tstb %d4 4a596: 6700 00b4 beqw 4a64c <_Heap_Free+0x164> <== ALWAYS TAKEN _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ 4a59a: 4a02 tstb %d2 4a59c: 6726 beqs 4a5c4 <_Heap_Free+0xdc> uintptr_t const size = block_size + prev_size + next_block_size; 4a59e: d280 addl %d0,%d1 4a5a0: d681 addl %d1,%d3 _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 4a5a2: 53a8 0038 subql #1,%a0@(56) prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4a5a6: 7201 moveq #1,%d1 } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; Heap_Block *prev = block->prev; 4a5a8: 266a 000c moveal %a2@(12),%a3 4a5ac: 8283 orl %d3,%d1 return _Heap_Free_list_tail(heap)->prev; } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; 4a5ae: 246a 0008 moveal %a2@(8),%a2 next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; 4a5b2: 2383 3800 movel %d3,%a1@(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; 4a5b6: 2341 0004 movel %d1,%a1@(4) Heap_Block *prev = block->prev; prev->next = next; next->prev = prev; 4a5ba: 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; 4a5be: 274a 0008 movel %a2,%a3@(8) 4a5c2: 6078 bras 4a63c <_Heap_Free+0x154> <== ALWAYS TAKEN 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; 4a5c4: d680 addl %d0,%d3 prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4a5c6: 7401 moveq #1,%d2 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4a5c8: 7afe moveq #-2,%d5 next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; } else { /* coalesce prev */ uintptr_t const size = block_size + prev_size; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4a5ca: 8483 orl %d3,%d2 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = size; 4a5cc: 2483 movel %d3,%a2@ 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; 4a5ce: 2342 0004 movel %d2,%a1@(4) next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4a5d2: cbaa 0004 andl %d5,%a2@(4) 4a5d6: 6064 bras 4a63c <_Heap_Free+0x154> <== ALWAYS TAKEN next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ 4a5d8: 4a02 tstb %d2 4a5da: 6728 beqs 4a604 <_Heap_Free+0x11c> Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; Heap_Block *prev = old_block->prev; 4a5dc: 266a 000c moveal %a2@(12),%a3 uintptr_t const size = block_size + next_block_size; 4a5e0: d280 addl %d0,%d1 _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4a5e2: 7401 moveq #1,%d2 RTEMS_INLINE_ROUTINE void _Heap_Free_list_replace( Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; 4a5e4: 246a 0008 moveal %a2@(8),%a2 Heap_Block *prev = old_block->prev; new_block->next = next; new_block->prev = prev; 4a5e8: 234b 000c movel %a3,%a1@(12) 4a5ec: 8481 orl %d1,%d2 ) { Heap_Block *next = old_block->next; Heap_Block *prev = old_block->prev; new_block->next = next; 4a5ee: 234a 0008 movel %a2,%a1@(8) next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; 4a5f2: 2381 1800 movel %d1,%a1@(00000000,%d1:l) 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; 4a5f6: 2342 0004 movel %d2,%a1@(4) new_block->prev = prev; next->prev = new_block; 4a5fa: 2549 000c movel %a1,%a2@(12) prev->next = new_block; 4a5fe: 2749 0008 movel %a1,%a3@(8) 4a602: 6038 bras 4a63c <_Heap_Free+0x154> <== 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; 4a604: 7a01 moveq #1,%d5 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4a606: 72fe moveq #-2,%d1 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; 4a608: 8a80 orl %d0,%d5 RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after( Heap_Block *block_before, Heap_Block *new_block ) { Heap_Block *next = block_before->next; 4a60a: 2668 0008 moveal %a0@(8),%a3 4a60e: 2345 0004 movel %d5,%a1@(4) next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4a612: c3aa 0004 andl %d1,%a2@(4) next_block->prev_size = block_size; 4a616: 2480 movel %d0,%a2@ /* Statistics */ ++stats->free_blocks; 4a618: 2228 0038 movel %a0@(56),%d1 4a61c: 5281 addql #1,%d1 new_block->next = next; 4a61e: 234b 0008 movel %a3,%a1@(8) new_block->prev = block_before; 4a622: 2348 000c movel %a0,%a1@(12) block_before->next = new_block; 4a626: 2149 0008 movel %a1,%a0@(8) next->prev = new_block; 4a62a: 2749 000c movel %a1,%a3@(12) 4a62e: 2141 0038 movel %d1,%a0@(56) #include #include bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { Heap_Statistics *const stats = &heap->stats; 4a632: b2a8 003c cmpl %a0@(60),%d1 4a636: 6304 blss 4a63c <_Heap_Free+0x154> 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; 4a638: 2141 003c movel %d1,%a0@(60) } /* Statistics */ --stats->used_blocks; ++stats->frees; stats->free_size += block_size; 4a63c: d1a8 0030 addl %d0,%a0@(48) stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 4a640: 53a8 0040 subql #1,%a0@(64) ++stats->frees; 4a644: 52a8 0050 addql #1,%a0@(80) stats->free_size += block_size; 4a648: 7001 moveq #1,%d0 return( true ); 4a64a: 6002 bras 4a64e <_Heap_Free+0x166> <== ALWAYS TAKEN 4a64c: 4200 clrb %d0 } 4a64e: 4cd7 0c3c moveml %sp@,%d2-%d5/%a2-%a3 4a652: 4e5e unlk %fp 4a654: 4e75 rts ... 00063db0 <_Heap_Get_free_information>: void _Heap_Get_free_information( Heap_Control *the_heap, Heap_Information *info ) { 63db0: 4e56 0000 linkw %fp,#0 63db4: 206e 000c moveal %fp@(12),%a0 63db8: 2f0a movel %a2,%sp@- 63dba: 246e 0008 moveal %fp@(8),%a2 Heap_Block *the_block; Heap_Block *const tail = _Heap_Free_list_tail(the_heap); info->number = 0; 63dbe: 4290 clrl %a0@ return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 63dc0: 226a 0008 moveal %a2@(8),%a1 info->largest = 0; 63dc4: 42a8 0004 clrl %a0@(4) info->total = 0; 63dc8: 42a8 0008 clrl %a0@(8) for(the_block = _Heap_Free_list_first(the_heap); 63dcc: 601a bras 63de8 <_Heap_Get_free_information+0x38> <== 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; 63dce: 70fe moveq #-2,%d0 63dd0: c0a9 0004 andl %a1@(4),%d0 uint32_t const the_size = _Heap_Block_size(the_block); /* As we always coalesce free blocks, prev block must have been used. */ _HAssert(_Heap_Is_prev_used(the_block)); info->number++; 63dd4: 5290 addql #1,%a0@ info->total += the_size; 63dd6: d1a8 0008 addl %d0,%a0@(8) if ( info->largest < the_size ) 63dda: b0a8 0004 cmpl %a0@(4),%d0 63dde: 6304 blss 63de4 <_Heap_Get_free_information+0x34> info->largest = the_size; 63de0: 2140 0004 movel %d0,%a0@(4) info->largest = 0; info->total = 0; for(the_block = _Heap_Free_list_first(the_heap); the_block != tail; the_block = the_block->next) 63de4: 2269 0008 moveal %a1@(8),%a1 info->number = 0; info->largest = 0; info->total = 0; for(the_block = _Heap_Free_list_first(the_heap); 63de8: b5c9 cmpal %a1,%a2 63dea: 66e2 bnes 63dce <_Heap_Get_free_information+0x1e> info->number++; info->total += the_size; if ( info->largest < the_size ) info->largest = the_size; } } 63dec: 245f moveal %sp@+,%a2 63dee: 4e5e unlk %fp 63df0: 4e75 rts ... 000720ac <_Heap_Get_information>: void _Heap_Get_information( Heap_Control *the_heap, Heap_Information_block *the_info ) { 720ac: 4e56 fff4 linkw %fp,#-12 720b0: 206e 000c moveal %fp@(12),%a0 720b4: 226e 0008 moveal %fp@(8),%a1 720b8: 48d7 040c moveml %d2-%d3/%a2,%sp@ 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; 720bc: 2408 movel %a0,%d2 720be: 0682 0000 000c addil #12,%d2 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; 720c4: 4290 clrl %a0@ Heap_Control *the_heap, Heap_Information_block *the_info ) { Heap_Block *the_block = the_heap->first_block; Heap_Block *const end = the_heap->last_block; 720c6: 2229 0024 movel %a1@(36),%d1 _HAssert(the_block->prev_size == the_heap->page_size); _HAssert(_Heap_Is_prev_used(the_block)); the_info->Free.number = 0; the_info->Free.total = 0; 720ca: 42a8 0008 clrl %a0@(8) void _Heap_Get_information( Heap_Control *the_heap, Heap_Information_block *the_info ) { Heap_Block *the_block = the_heap->first_block; 720ce: 2469 0020 moveal %a1@(32),%a2 _HAssert(the_block->prev_size == the_heap->page_size); _HAssert(_Heap_Is_prev_used(the_block)); the_info->Free.number = 0; the_info->Free.total = 0; the_info->Free.largest = 0; 720d2: 42a8 0004 clrl %a0@(4) the_info->Used.number = 0; 720d6: 42a8 000c clrl %a0@(12) the_info->Used.total = 0; 720da: 42a8 0014 clrl %a0@(20) the_info->Used.largest = 0; 720de: 42a8 0010 clrl %a0@(16) while ( the_block != end ) { 720e2: 6022 bras 72106 <_Heap_Get_information+0x5a> <== 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; 720e4: 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) ) 720e6: 7601 moveq #1,%d3 720e8: c0aa 0004 andl %a2@(4),%d0 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 720ec: d5c0 addal %d0,%a2 720ee: c6aa 0004 andl %a2@(4),%d3 720f2: 6602 bnes 720f6 <_Heap_Get_information+0x4a> 720f4: 2248 moveal %a0,%a1 info = &the_info->Used; else info = &the_info->Free; info->number++; 720f6: 5291 addql #1,%a1@ info->total += the_size; 720f8: d1a9 0008 addl %d0,%a1@(8) if ( info->largest < the_size ) 720fc: b0a9 0004 cmpl %a1@(4),%d0 72100: 6304 blss 72106 <_Heap_Get_information+0x5a> info->largest = the_size; 72102: 2340 0004 movel %d0,%a1@(4) while ( the_block != end ) { uintptr_t const the_size = _Heap_Block_size(the_block); Heap_Block *const next_block = _Heap_Block_at(the_block, the_size); Heap_Information *info; if ( _Heap_Is_prev_used(next_block) ) 72106: 2242 moveal %d2,%a1 the_info->Free.largest = 0; the_info->Used.number = 0; the_info->Used.total = 0; the_info->Used.largest = 0; while ( the_block != end ) { 72108: b28a cmpl %a2,%d1 7210a: 66d8 bnes 720e4 <_Heap_Get_information+0x38> /* * 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; 7210c: 50a8 0014 addql #8,%a0@(20) } 72110: 4cd7 040c moveml %sp@,%d2-%d3/%a2 72114: 4e5e unlk %fp 72116: 4e75 rts 00045d0c <_Heap_Initialize>: Heap_Control *heap, void *heap_area_begin_ptr, uintptr_t heap_area_size, uintptr_t page_size ) { 45d0c: 4e56 ffe8 linkw %fp,#-24 45d10: 206e 0008 moveal %fp@(8),%a0 45d14: 48d7 047c moveml %d2-%d6/%a2,%sp@ 45d18: 262e 000c movel %fp@(12),%d3 45d1c: 242e 0010 movel %fp@(16),%d2 45d20: 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 ) { 45d24: 6606 bnes 45d2c <_Heap_Initialize+0x20> 45d26: 123c 0004 moveb #4,%d1 45d2a: 6012 bras 45d3e <_Heap_Initialize+0x32> <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up( uintptr_t value, uintptr_t alignment ) { uintptr_t remainder = value % alignment; 45d2c: 7003 moveq #3,%d0 45d2e: c081 andl %d1,%d0 if ( remainder != 0 ) { 45d30: 6704 beqs 45d36 <_Heap_Initialize+0x2a> return value - remainder + alignment; 45d32: 5881 addql #4,%d1 45d34: 9280 subl %d0,%d1 page_size = CPU_ALIGNMENT; } else { page_size = _Heap_Align_up( page_size, CPU_ALIGNMENT ); if ( page_size < CPU_ALIGNMENT ) { 45d36: 7003 moveq #3,%d0 45d38: b081 cmpl %d1,%d0 45d3a: 6400 00da bccw 45e16 <_Heap_Initialize+0x10a> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up( uintptr_t value, uintptr_t alignment ) { uintptr_t remainder = value % alignment; 45d3e: 7810 moveq #16,%d4 45d40: 4c41 4000 remul %d1,%d0,%d4 if ( remainder != 0 ) { 45d44: 4a80 tstl %d0 45d46: 6604 bnes 45d4c <_Heap_Initialize+0x40> 45d48: 7810 moveq #16,%d4 45d4a: 600a bras 45d56 <_Heap_Initialize+0x4a> <== ALWAYS TAKEN return value - remainder + alignment; 45d4c: 2801 movel %d1,%d4 45d4e: 0684 0000 0010 addil #16,%d4 45d54: 9880 subl %d0,%d4 ) { 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; 45d56: 2003 movel %d3,%d0 45d58: 5080 addql #8,%d0 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up( uintptr_t value, uintptr_t alignment ) { uintptr_t remainder = value % alignment; 45d5a: 2c00 movel %d0,%d6 45d5c: 4c41 6005 remul %d1,%d5,%d6 if ( remainder != 0 ) { 45d60: 4a85 tstl %d5 45d62: 6704 beqs 45d68 <_Heap_Initialize+0x5c> return value - remainder + alignment; 45d64: d081 addl %d1,%d0 45d66: 9085 subl %d5,%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; 45d68: 2c03 movel %d3,%d6 45d6a: dc82 addl %d2,%d6 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 ( 45d6c: b686 cmpl %d6,%d3 45d6e: 6200 00a6 bhiw 45e16 <_Heap_Initialize+0x10a> } 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); 45d72: 2a00 movel %d0,%d5 45d74: 2240 moveal %d0,%a1 45d76: 9a83 subl %d3,%d5 45d78: 5189 subql #8,%a1 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 ( 45d7a: ba82 cmpl %d2,%d5 45d7c: 6400 0098 bccw 45e16 <_Heap_Initialize+0x10a> 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; 45d80: 9485 subl %d5,%d2 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 45d82: 2a02 movel %d2,%d5 45d84: 4c41 5000 remul %d1,%d0,%d5 45d88: 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 ( 45d8a: b882 cmpl %d2,%d4 45d8c: 6200 0088 bhiw 45e16 <_Heap_Initialize+0x10a> } /* 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; 45d90: 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); 45d92: 45f1 2800 lea %a1@(00000000,%d2:l),%a2 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; 45d96: 2002 movel %d2,%d0 45d98: 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; 45d9a: 8a82 orl %d2,%d5 return 0; } /* First block */ first_block = (Heap_Block *) first_block_begin; first_block->prev_size = page_size; 45d9c: 2281 movel %d1,%a1@ first_block->size_and_flag = first_block_size | HEAP_PREV_BLOCK_USED; 45d9e: 2345 0004 movel %d5,%a1@(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; 45da2: 2a09 movel %a1,%d5 45da4: 9a8a subl %a2,%d5 45da6: 2545 0004 movel %d5,%a2@(4) stats->max_search = 0; stats->allocs = 0; stats->searches = 0; stats->frees = 0; stats->resizes = 0; stats->instance = instance++; 45daa: 2a39 0005 c664 movel 5c664 ,%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; 45db0: 2482 movel %d2,%a2@ last_block->size_and_flag = first_block_begin - (uintptr_t) last_block; /* Heap control */ heap->page_size = page_size; 45db2: 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; 45db6: 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 ); 45db8: 2348 0008 movel %a0,%a1@(8) first_block->prev = _Heap_Free_list_head( heap ); 45dbc: 2348 000c movel %a0,%a1@(12) stats->max_search = 0; stats->allocs = 0; stats->searches = 0; stats->frees = 0; stats->resizes = 0; stats->instance = instance++; 45dc0: 2145 0028 movel %d5,%a0@(40) 45dc4: 5285 addql #1,%d5 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; 45dc6: 2144 0014 movel %d4,%a0@(20) heap->area_begin = heap_area_begin; 45dca: 2143 0018 movel %d3,%a0@(24) heap->area_end = heap_area_end; 45dce: 2146 001c movel %d6,%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; 45dd2: 2142 0034 movel %d2,%a0@(52) 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; 45dd6: 2142 002c movel %d2,%a0@(44) stats->free_size = first_block_size; 45dda: 2142 0030 movel %d2,%a0@(48) stats->min_free_size = first_block_size; stats->free_blocks = 1; 45dde: 2141 0038 movel %d1,%a0@(56) stats->max_free_blocks = 1; 45de2: 2141 003c movel %d1,%a0@(60) stats->used_blocks = 0; 45de6: 42a8 0040 clrl %a0@(64) stats->max_search = 0; 45dea: 42a8 0044 clrl %a0@(68) stats->allocs = 0; 45dee: 42a8 0048 clrl %a0@(72) stats->searches = 0; 45df2: 42a8 004c clrl %a0@(76) stats->frees = 0; 45df6: 42a8 0050 clrl %a0@(80) stats->resizes = 0; 45dfa: 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; 45dfe: 214a 0024 movel %a2,%a0@(36) stats->max_search = 0; stats->allocs = 0; stats->searches = 0; stats->frees = 0; stats->resizes = 0; stats->instance = instance++; 45e02: 23c5 0005 c664 movel %d5,5c664 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; 45e08: 2149 000c movel %a1,%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; 45e0c: 2149 0020 movel %a1,%a0@(32) heap->last_block = last_block; _Heap_Free_list_head( heap )->next = first_block; 45e10: 2149 0008 movel %a1,%a0@(8) ); _HAssert( _Heap_Is_aligned( _Heap_Alloc_area_of_block( last_block ), page_size ) ); return alloc_area_size; 45e14: 6002 bras 45e18 <_Heap_Initialize+0x10c> <== ALWAYS TAKEN 45e16: 4280 clrl %d0 } 45e18: 4cd7 047c moveml %sp@,%d2-%d6/%a2 45e1c: 4e5e unlk %fp 45e1e: 4e75 rts 00059990 <_Heap_Resize_block>: void *alloc_begin_ptr, uintptr_t new_alloc_size, uintptr_t *old_size, uintptr_t *new_size ) { 59990: 4e56 ffe0 linkw %fp,#-32 59994: 48d7 1c7c moveml %d2-%d6/%a2-%a4,%sp@ 59998: 242e 000c movel %fp@(12),%d2 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_of_alloc_area( uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) 5999c: 2202 movel %d2,%d1 5999e: 2042 moveal %d2,%a0 599a0: 5188 subql #8,%a0 599a2: 246e 0008 moveal %fp@(8),%a2 599a6: 286e 0014 moveal %fp@(20),%a4 599aa: 4c6a 1000 0010 remul %a2@(16),%d0,%d1 uintptr_t const alloc_begin = (uintptr_t) alloc_begin_ptr; Heap_Block *const block = _Heap_Block_of_alloc_area( alloc_begin, page_size ); *old_size = 0; 599b0: 4294 clrl %a4@ void *alloc_begin_ptr, uintptr_t new_alloc_size, uintptr_t *old_size, uintptr_t *new_size ) { 599b2: 266e 0018 moveal %fp@(24),%a3 599b6: 91c0 subal %d0,%a0 599b8: 2a2e 0010 movel %fp@(16),%d5 uintptr_t const alloc_begin = (uintptr_t) alloc_begin_ptr; Heap_Block *const block = _Heap_Block_of_alloc_area( alloc_begin, page_size ); *old_size = 0; *new_size = 0; 599bc: 4293 clrl %a3@ 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 599be: b1ea 0020 cmpal %a2@(32),%a0 599c2: 6500 0096 bcsw 59a5a <_Heap_Resize_block+0xca> 599c6: b1ea 0024 cmpal %a2@(36),%a0 599ca: 6200 008e bhiw 59a5a <_Heap_Resize_block+0xca> - 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; 599ce: 70fe moveq #-2,%d0 599d0: 72fe moveq #-2,%d1 RTEMS_INLINE_ROUTINE bool _Heap_Is_free( const Heap_Block *block ) { return !_Heap_Is_used( block ); 599d2: 7801 moveq #1,%d4 599d4: 7c01 moveq #1,%d6 uintptr_t const block_begin = (uintptr_t) block; uintptr_t block_size = _Heap_Block_size( block ); uintptr_t block_end = block_begin + block_size; uintptr_t alloc_size = block_end - alloc_begin + HEAP_BLOCK_SIZE_OFFSET; 599d6: 7604 moveq #4,%d3 599d8: 9682 subl %d2,%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; 599da: c0a8 0004 andl %a0@(4),%d0 { Heap_Statistics *const stats = &heap->stats; uintptr_t const block_begin = (uintptr_t) block; uintptr_t block_size = _Heap_Block_size( block ); uintptr_t block_end = block_begin + block_size; 599de: 43f0 0800 lea %a0@(00000000,%d0:l),%a1 uintptr_t alloc_size = block_end - alloc_begin + HEAP_BLOCK_SIZE_OFFSET; 599e2: d689 addl %a1,%d3 599e4: c2a9 0004 andl %a1@(4),%d1 RTEMS_INLINE_ROUTINE bool _Heap_Is_free( const Heap_Block *block ) { return !_Heap_Is_used( block ); 599e8: c8b1 1804 andl %a1@(00000004,%d1:l),%d4 bool next_block_is_free = _Heap_Is_free( next_block );; _HAssert( _Heap_Is_block_in_heap( heap, next_block ) ); _HAssert( _Heap_Is_prev_used( next_block ) ); *old_size = alloc_size; 599ec: 2883 movel %d3,%a4@ 599ee: bd84 eorl %d6,%d4 599f0: 1c04 moveb %d4,%d6 if ( next_block_is_free ) { 599f2: 6704 beqs 599f8 <_Heap_Resize_block+0x68> block_size += next_block_size; 599f4: d081 addl %d1,%d0 alloc_size += next_block_size; 599f6: d681 addl %d1,%d3 } if ( new_alloc_size > alloc_size ) { 599f8: b685 cmpl %d5,%d3 599fa: 6404 bccs 59a00 <_Heap_Resize_block+0x70> 599fc: 7001 moveq #1,%d0 599fe: 605c bras 59a5c <_Heap_Resize_block+0xcc> <== ALWAYS TAKEN return HEAP_RESIZE_UNSATISFIED; } if ( next_block_is_free ) { 59a00: 4a06 tstb %d6 59a02: 672a beqs 59a2e <_Heap_Resize_block+0x9e> uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; block->size_and_flag = size | flag; 59a04: 7601 moveq #1,%d3 59a06: c6a8 0004 andl %a0@(4),%d3 } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; Heap_Block *prev = block->prev; 59a0a: 2869 000c moveal %a1@(12),%a4 uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; block->size_and_flag = size | flag; 59a0e: 8680 orl %d0,%d3 return _Heap_Free_list_tail(heap)->prev; } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; 59a10: 2269 0008 moveal %a1@(8),%a1 uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; block->size_and_flag = size | flag; 59a14: 2143 0004 movel %d3,%a0@(4) _Heap_Block_set_size( block, block_size ); _Heap_Free_list_remove( next_block ); next_block = _Heap_Block_at( block, block_size ); next_block->size_and_flag |= HEAP_PREV_BLOCK_USED; 59a18: 7601 moveq #1,%d3 59a1a: 87b0 0804 orl %d3,%a0@(00000004,%d0:l) { Heap_Block *next = block->next; Heap_Block *prev = block->prev; prev->next = next; next->prev = prev; 59a1e: 234c 000c movel %a4,%a1@(12) /* Statistics */ --stats->free_blocks; stats->free_size -= next_block_size; 59a22: 93aa 0030 subl %d1,%a2@(48) next_block = _Heap_Block_at( block, block_size ); next_block->size_and_flag |= HEAP_PREV_BLOCK_USED; /* Statistics */ --stats->free_blocks; 59a26: 53aa 0038 subql #1,%a2@(56) RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; Heap_Block *prev = block->prev; prev->next = next; 59a2a: 2949 0008 movel %a1,%a4@(8) stats->free_size -= next_block_size; } block = _Heap_Block_allocate( heap, block, alloc_begin, new_alloc_size ); 59a2e: 2f05 movel %d5,%sp@- 59a30: 2f02 movel %d2,%sp@- 59a32: 2f08 movel %a0,%sp@- 59a34: 2f0a movel %a2,%sp@- 59a36: 4eb9 0004 5eee jsr 45eee <_Heap_Block_allocate> block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); *new_size = (uintptr_t) next_block - alloc_begin + HEAP_BLOCK_SIZE_OFFSET; /* Statistics */ ++stats->resizes; 59a3c: 4fef 0010 lea %sp@(16),%sp block = _Heap_Block_allocate( heap, block, alloc_begin, new_alloc_size ); block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); *new_size = (uintptr_t) next_block - alloc_begin + HEAP_BLOCK_SIZE_OFFSET; 59a40: 72fe moveq #-2,%d1 /* Statistics */ --stats->free_blocks; stats->free_size -= next_block_size; } block = _Heap_Block_allocate( heap, block, alloc_begin, new_alloc_size ); 59a42: 2040 moveal %d0,%a0 block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); *new_size = (uintptr_t) next_block - alloc_begin + HEAP_BLOCK_SIZE_OFFSET; 59a44: 2240 moveal %d0,%a1 59a46: 93c2 subal %d2,%a1 /* Statistics */ ++stats->resizes; 59a48: 4280 clrl %d0 block = _Heap_Block_allocate( heap, block, alloc_begin, new_alloc_size ); block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); *new_size = (uintptr_t) next_block - alloc_begin + HEAP_BLOCK_SIZE_OFFSET; 59a4a: c2a8 0004 andl %a0@(4),%d1 59a4e: 43f1 1804 lea %a1@(00000004,%d1:l),%a1 59a52: 2689 movel %a1,%a3@ /* Statistics */ ++stats->resizes; 59a54: 52aa 0054 addql #1,%a2@(84) 59a58: 6002 bras 59a5c <_Heap_Resize_block+0xcc> <== ALWAYS TAKEN 59a5a: 7002 moveq #2,%d0 new_size ); } else { return HEAP_RESIZE_FATAL_ERROR; } } 59a5c: 4cee 1c7c ffe0 moveml %fp@(-32),%d2-%d6/%a2-%a4 59a62: 4e5e unlk %fp 59a64: 4e75 rts ... 00059a68 <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { 59a68: 4e56 0000 linkw %fp,#0 59a6c: 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 ) 59a70: 2040 moveal %d0,%a0 59a72: 5188 subql #8,%a0 59a74: 226e 0008 moveal %fp@(8),%a1 59a78: 2f02 movel %d2,%sp@- 59a7a: 2400 movel %d0,%d2 59a7c: 4c69 2001 0010 remul %a1@(16),%d1,%d2 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 59a82: 2429 0020 movel %a1@(32),%d2 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_of_alloc_area( uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) 59a86: 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 59a88: b488 cmpl %a0,%d2 59a8a: 6244 bhis 59ad0 <_Heap_Size_of_alloc_area+0x68> 59a8c: b1e9 0024 cmpal %a1@(36),%a0 59a90: 53c1 sls %d1 59a92: 49c1 extbl %d1 59a94: 4481 negl %d1 uintptr_t const alloc_begin = (uintptr_t) alloc_begin_ptr; Heap_Block *block = _Heap_Block_of_alloc_area( alloc_begin, page_size ); Heap_Block *next_block = NULL; uintptr_t block_size = 0; if ( !_Heap_Is_block_in_heap( heap, block ) ) { 59a96: 4a01 tstb %d1 59a98: 6736 beqs 59ad0 <_Heap_Size_of_alloc_area+0x68> <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 59a9a: 72fe moveq #-2,%d1 59a9c: c2a8 0004 andl %a0@(4),%d1 59aa0: d1c1 addal %d1,%a0 RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap( const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block 59aa2: b488 cmpl %a0,%d2 59aa4: 622a bhis 59ad0 <_Heap_Size_of_alloc_area+0x68> <== ALWAYS TAKEN 59aa6: b1e9 0024 cmpal %a1@(36),%a0 59aaa: 53c1 sls %d1 59aac: 49c1 extbl %d1 59aae: 4481 negl %d1 } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( 59ab0: 4a01 tstb %d1 59ab2: 671c beqs 59ad0 <_Heap_Size_of_alloc_area+0x68> <== ALWAYS TAKEN 59ab4: 7201 moveq #1,%d1 59ab6: c2a8 0004 andl %a0@(4),%d1 59aba: 4a01 tstb %d1 59abc: 6712 beqs 59ad0 <_Heap_Size_of_alloc_area+0x68> <== ALWAYS TAKEN || !_Heap_Is_prev_used( next_block ) ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_BLOCK_SIZE_OFFSET - alloc_begin; 59abe: 7204 moveq #4,%d1 59ac0: 9280 subl %d0,%d1 59ac2: 2001 movel %d1,%d0 59ac4: d088 addl %a0,%d0 59ac6: 226e 0010 moveal %fp@(16),%a1 59aca: 2280 movel %d0,%a1@ 59acc: 7001 moveq #1,%d0 return true; 59ace: 6002 bras 59ad2 <_Heap_Size_of_alloc_area+0x6a> <== ALWAYS TAKEN 59ad0: 4200 clrb %d0 } 59ad2: 241f movel %sp@+,%d2 59ad4: 4e5e unlk %fp 59ad6: 4e75 rts 000469a8 <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 469a8: 4e56 ffd0 linkw %fp,#-48 469ac: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 469b0: 286e 0008 moveal %fp@(8),%a4 uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; Heap_Block *const last_block = heap->last_block; Heap_Block *block = heap->first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 469b4: 47fa 031a lea %pc@(46cd0 <_Heap_Walk_print>),%a3 bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 469b8: 242e 000c movel %fp@(12),%d2 uintptr_t const page_size = heap->page_size; 469bc: 2c2c 0010 movel %a4@(16),%d6 uintptr_t const min_block_size = heap->min_block_size; 469c0: 262c 0014 movel %a4@(20),%d3 Heap_Block *const last_block = heap->last_block; 469c4: 2a2c 0024 movel %a4@(36),%d5 Heap_Block *block = heap->first_block; 469c8: 246c 0020 moveal %a4@(32),%a2 Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 469cc: 4a2e 0013 tstb %fp@(19) 469d0: 6604 bnes 469d6 <_Heap_Walk+0x2e> 469d2: 47fa ffcc lea %pc@(469a0 <_Heap_Walk_print_nothing>),%a3 if ( !_System_state_Is_up( _System_state_Get() ) ) { 469d6: 7003 moveq #3,%d0 469d8: b0b9 0005 f3e4 cmpl 5f3e4 <_System_state_Current>,%d0 469de: 6600 02da bnew 46cba <_Heap_Walk+0x312> <== ALWAYS TAKEN 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)( 469e2: 2f2c 000c movel %a4@(12),%sp@- 469e6: 2f2c 0008 movel %a4@(8),%sp@- 469ea: 2f05 movel %d5,%sp@- 469ec: 2f0a movel %a2,%sp@- 469ee: 2f2c 001c movel %a4@(28),%sp@- 469f2: 2f2c 0018 movel %a4@(24),%sp@- 469f6: 2f03 movel %d3,%sp@- 469f8: 2f06 movel %d6,%sp@- 469fa: 4879 0005 b562 pea 5b562 46a00: 42a7 clrl %sp@- 46a02: 2f02 movel %d2,%sp@- 46a04: 4e93 jsr %a3@ heap->area_begin, heap->area_end, first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { 46a06: 4fef 002c lea %sp@(44),%sp 46a0a: 4a86 tstl %d6 46a0c: 6608 bnes 46a16 <_Heap_Walk+0x6e> (*printer)( source, true, "page size is zero\n" ); 46a0e: 4879 0005 b5f3 pea 5b5f3 46a14: 607e bras 46a94 <_Heap_Walk+0xec> <== ALWAYS TAKEN return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 46a16: 7003 moveq #3,%d0 46a18: c086 andl %d6,%d0 46a1a: 670c beqs 46a28 <_Heap_Walk+0x80> (*printer)( 46a1c: 2f06 movel %d6,%sp@- 46a1e: 4879 0005 b606 pea 5b606 46a24: 6000 0268 braw 46c8e <_Heap_Walk+0x2e6> ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 46a28: 2203 movel %d3,%d1 46a2a: 4c46 1000 remul %d6,%d0,%d1 46a2e: 4a80 tstl %d0 46a30: 670c beqs 46a3e <_Heap_Walk+0x96> (*printer)( 46a32: 2f03 movel %d3,%sp@- 46a34: 4879 0005 b624 pea 5b624 46a3a: 6000 0252 braw 46c8e <_Heap_Walk+0x2e6> ); return false; } if ( 46a3e: 200a movel %a2,%d0 46a40: 5080 addql #8,%d0 46a42: 4c46 0001 remul %d6,%d1,%d0 46a46: 4a81 tstl %d1 46a48: 670c beqs 46a56 <_Heap_Walk+0xae> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 46a4a: 2f0a movel %a2,%sp@- 46a4c: 4879 0005 b648 pea 5b648 46a52: 6000 023a braw 46c8e <_Heap_Walk+0x2e6> ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 46a56: 7001 moveq #1,%d0 46a58: c0aa 0004 andl %a2@(4),%d0 46a5c: 4a00 tstb %d0 46a5e: 6608 bnes 46a68 <_Heap_Walk+0xc0> (*printer)( 46a60: 4879 0005 b679 pea 5b679 46a66: 602c bras 46a94 <_Heap_Walk+0xec> <== ALWAYS TAKEN ); return false; } if ( first_block->prev_size != page_size ) { 46a68: 2812 movel %a2@,%d4 46a6a: bc84 cmpl %d4,%d6 46a6c: 670e beqs 46a7c <_Heap_Walk+0xd4> (*printer)( 46a6e: 2f06 movel %d6,%sp@- 46a70: 2f04 movel %d4,%sp@- 46a72: 4879 0005 b6a7 pea 5b6a7 46a78: 6000 0150 braw 46bca <_Heap_Walk+0x222> <== ALWAYS TAKEN ); return false; } if ( _Heap_Is_free( last_block ) ) { 46a7c: 2045 moveal %d5,%a0 46a7e: 70fe moveq #-2,%d0 46a80: 7201 moveq #1,%d1 46a82: c0a8 0004 andl %a0@(4),%d0 46a86: c2b0 0804 andl %a0@(00000004,%d0:l),%d1 46a8a: 4a01 tstb %d1 46a8c: 6616 bnes 46aa4 <_Heap_Walk+0xfc> (*printer)( 46a8e: 4879 0005 b6d2 pea 5b6d2 46a94: 4878 0001 pea 1 46a98: 2f02 movel %d2,%sp@- 46a9a: 4e93 jsr %a3@ 46a9c: 4fef 000c lea %sp@(12),%sp 46aa0: 6000 01f8 braw 46c9a <_Heap_Walk+0x2f2> int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 46aa4: 2c2c 0010 movel %a4@(16),%d6 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 46aa8: 220c movel %a4,%d1 46aaa: 206c 0008 moveal %a4@(8),%a0 46aae: 606a bras 46b1a <_Heap_Walk+0x172> <== ALWAYS TAKEN 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 46ab0: b1ec 0020 cmpal %a4@(32),%a0 46ab4: 650e bcss 46ac4 <_Heap_Walk+0x11c> 46ab6: b1ec 0024 cmpal %a4@(36),%a0 46aba: 53c0 sls %d0 46abc: 49c0 extbl %d0 46abe: 4480 negl %d0 const Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); const Heap_Block *prev_block = free_list_tail; const Heap_Block *free_block = first_free_block; while ( free_block != free_list_tail ) { if ( !_Heap_Is_block_in_heap( heap, free_block ) ) { 46ac0: 4a00 tstb %d0 46ac2: 660c bnes 46ad0 <_Heap_Walk+0x128> <== NEVER TAKEN (*printer)( 46ac4: 2f08 movel %a0,%sp@- 46ac6: 4879 0005 b6e7 pea 5b6e7 46acc: 6000 01c0 braw 46c8e <_Heap_Walk+0x2e6> ); return false; } if ( 46ad0: 4c46 7000 remul %d6,%d0,%d7 46ad4: 4a80 tstl %d0 46ad6: 670c beqs 46ae4 <_Heap_Walk+0x13c> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 46ad8: 2f08 movel %a0,%sp@- 46ada: 4879 0005 b707 pea 5b707 46ae0: 6000 01ac braw 46c8e <_Heap_Walk+0x2e6> ); return false; } if ( _Heap_Is_used( free_block ) ) { 46ae4: 70fe moveq #-2,%d0 46ae6: 7e01 moveq #1,%d7 46ae8: c0a8 0004 andl %a0@(4),%d0 46aec: ceb0 0804 andl %a0@(00000004,%d0:l),%d7 46af0: 670c beqs 46afe <_Heap_Walk+0x156> (*printer)( 46af2: 2f08 movel %a0,%sp@- 46af4: 4879 0005 b737 pea 5b737 46afa: 6000 0192 braw 46c8e <_Heap_Walk+0x2e6> ); return false; } if ( free_block->prev != prev_block ) { 46afe: 2028 000c movel %a0@(12),%d0 46b02: b280 cmpl %d0,%d1 46b04: 670e beqs 46b14 <_Heap_Walk+0x16c> (*printer)( 46b06: 2f00 movel %d0,%sp@- 46b08: 2f08 movel %a0,%sp@- 46b0a: 4879 0005 b753 pea 5b753 46b10: 6000 00b8 braw 46bca <_Heap_Walk+0x222> <== ALWAYS TAKEN return false; } prev_block = free_block; free_block = free_block->next; 46b14: 2208 movel %a0,%d1 46b16: 2068 0008 moveal %a0@(8),%a0 ); return false; } if ( 46b1a: 2e08 movel %a0,%d7 46b1c: 5087 addql #8,%d7 const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); const Heap_Block *prev_block = free_list_tail; const Heap_Block *free_block = first_free_block; while ( free_block != free_list_tail ) { 46b1e: b9c8 cmpal %a0,%a4 46b20: 668e bnes 46ab0 <_Heap_Walk+0x108> 46b22: 6000 0190 braw 46cb4 <_Heap_Walk+0x30c> - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 46b26: 202a 0004 movel %a2@(4),%d0 46b2a: 7cfe moveq #-2,%d6 uintptr_t const block_size = _Heap_Block_size( block ); bool const prev_used = _Heap_Is_prev_used( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); uintptr_t const next_block_begin = (uintptr_t) next_block; if ( prev_used ) { 46b2c: 7201 moveq #1,%d1 46b2e: cc80 andl %d0,%d6 46b30: 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); 46b32: 4bf2 6800 lea %a2@(00000000,%d6:l),%a5 46b36: 4a00 tstb %d0 46b38: 6716 beqs 46b50 <_Heap_Walk+0x1a8> (*printer)( 46b3a: 2f06 movel %d6,%sp@- 46b3c: 2f0a movel %a2,%sp@- 46b3e: 4879 0005 b785 pea 5b785 46b44: 42a7 clrl %sp@- 46b46: 2f02 movel %d2,%sp@- 46b48: 4e93 jsr %a3@ 46b4a: 4fef 0014 lea %sp@(20),%sp 46b4e: 6016 bras 46b66 <_Heap_Walk+0x1be> <== ALWAYS TAKEN "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 46b50: 2f12 movel %a2@,%sp@- 46b52: 2f06 movel %d6,%sp@- 46b54: 2f0a movel %a2,%sp@- 46b56: 4879 0005 b79c pea 5b79c 46b5c: 42a7 clrl %sp@- 46b5e: 2f02 movel %d2,%sp@- 46b60: 4e93 jsr %a3@ 46b62: 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 46b66: bbec 0020 cmpal %a4@(32),%a5 46b6a: 650e bcss 46b7a <_Heap_Walk+0x1d2> <== ALWAYS TAKEN 46b6c: bbec 0024 cmpal %a4@(36),%a5 46b70: 53c0 sls %d0 46b72: 49c0 extbl %d0 46b74: 4480 negl %d0 block_size, block->prev_size ); } if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 46b76: 4a00 tstb %d0 46b78: 660c bnes 46b86 <_Heap_Walk+0x1de> (*printer)( 46b7a: 2f0d movel %a5,%sp@- 46b7c: 2f0a movel %a2,%sp@- 46b7e: 4879 0005 b7c1 pea 5b7c1 46b84: 6044 bras 46bca <_Heap_Walk+0x222> <== ALWAYS TAKEN ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) ) { 46b86: 2206 movel %d6,%d1 46b88: 4c44 1000 remul %d4,%d0,%d1 46b8c: 4a80 tstl %d0 46b8e: 670c beqs 46b9c <_Heap_Walk+0x1f4> (*printer)( 46b90: 2f06 movel %d6,%sp@- 46b92: 2f0a movel %a2,%sp@- 46b94: 4879 0005 b7ee pea 5b7ee 46b9a: 602e bras 46bca <_Heap_Walk+0x222> <== ALWAYS TAKEN ); return false; } if ( block_size < min_block_size ) { 46b9c: b686 cmpl %d6,%d3 46b9e: 631c blss 46bbc <_Heap_Walk+0x214> (*printer)( 46ba0: 2f03 movel %d3,%sp@- 46ba2: 2f06 movel %d6,%sp@- 46ba4: 2f0a movel %a2,%sp@- 46ba6: 4879 0005 b81c pea 5b81c 46bac: 4878 0001 pea 1 46bb0: 2f02 movel %d2,%sp@- 46bb2: 4e93 jsr %a3@ block, block_size, min_block_size ); return false; 46bb4: 4fef 0018 lea %sp@(24),%sp 46bb8: 6000 00e0 braw 46c9a <_Heap_Walk+0x2f2> } if ( next_block_begin <= block_begin ) { 46bbc: b5cd cmpal %a5,%a2 46bbe: 651a bcss 46bda <_Heap_Walk+0x232> (*printer)( 46bc0: 2f0d movel %a5,%sp@- 46bc2: 2f0a movel %a2,%sp@- 46bc4: 4879 0005 b847 pea 5b847 46bca: 4878 0001 pea 1 46bce: 2f02 movel %d2,%sp@- 46bd0: 4e93 jsr %a3@ "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 46bd2: 4fef 0014 lea %sp@(20),%sp 46bd6: 6000 00c2 braw 46c9a <_Heap_Walk+0x2f2> } if ( !_Heap_Is_prev_used( next_block ) ) { 46bda: 7001 moveq #1,%d0 46bdc: c0ad 0004 andl %a5@(4),%d0 46be0: 4a00 tstb %d0 46be2: 6600 00ce bnew 46cb2 <_Heap_Walk+0x30a> block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 46be6: 2e2a 0004 movel %a2@(4),%d7 - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 46bea: 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; 46bec: 43f9 0005 b87b lea 5b87b ,%a1 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 46bf2: 206c 0008 moveal %a4@(8),%a0 - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 46bf6: cc87 andl %d7,%d6 block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 46bf8: 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); 46bfc: 2e0a movel %a2,%d7 46bfe: de86 addl %d6,%d7 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 46c00: 2d48 fff8 movel %a0,%fp@(-8) Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 46c04: 206a 0008 moveal %a2@(8),%a0 } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_last( Heap_Control *heap ) { return _Heap_Free_list_tail(heap)->prev; 46c08: b1ec 000c cmpal %a4@(12),%a0 46c0c: 6710 beqs 46c1e <_Heap_Walk+0x276> " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") 46c0e: 43f9 0005 b885 lea 5b885 ,%a1 46c14: b9c8 cmpal %a0,%a4 46c16: 6706 beqs 46c1e <_Heap_Walk+0x276> 46c18: 43f9 0005 b4b2 lea 5b4b2 ,%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)( 46c1e: 202a 000c movel %a2@(12),%d0 46c22: 223c 0005 b88f movel #374927,%d1 46c28: b0ae fff8 cmpl %fp@(-8),%d0 46c2c: 6710 beqs 46c3e <_Heap_Walk+0x296> "block 0x%08x: prev 0x%08x%s, next 0x%08x%s\n", block, block->prev, block->prev == first_free_block ? " (= first)" : (block->prev == free_list_head ? " (= head)" : ""), 46c2e: 223c 0005 b89a movel #374938,%d1 46c34: b9c0 cmpal %d0,%a4 46c36: 6706 beqs 46c3e <_Heap_Walk+0x296> 46c38: 223c 0005 b4b2 movel #373938,%d1 Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 46c3e: 2f09 movel %a1,%sp@- 46c40: 2f08 movel %a0,%sp@- 46c42: 2f01 movel %d1,%sp@- 46c44: 2f00 movel %d0,%sp@- 46c46: 2f0a movel %a2,%sp@- 46c48: 4879 0005 b8a4 pea 5b8a4 46c4e: 42a7 clrl %sp@- 46c50: 2f02 movel %d2,%sp@- 46c52: 4e93 jsr %a3@ block->next == last_free_block ? " (= last)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { 46c54: 4fef 0020 lea %sp@(32),%sp 46c58: 2047 moveal %d7,%a0 46c5a: 2010 movel %a0@,%d0 46c5c: b086 cmpl %d6,%d0 46c5e: 671c beqs 46c7c <_Heap_Walk+0x2d4> (*printer)( 46c60: 2f07 movel %d7,%sp@- 46c62: 2f00 movel %d0,%sp@- 46c64: 2f06 movel %d6,%sp@- 46c66: 2f0a movel %a2,%sp@- 46c68: 4879 0005 b8d0 pea 5b8d0 46c6e: 4878 0001 pea 1 46c72: 2f02 movel %d2,%sp@- 46c74: 4e93 jsr %a3@ 46c76: 4fef 001c lea %sp@(28),%sp 46c7a: 601e bras 46c9a <_Heap_Walk+0x2f2> <== ALWAYS TAKEN ); return false; } if ( !prev_used ) { 46c7c: 7001 moveq #1,%d0 46c7e: c0ae fffc andl %fp@(-4),%d0 46c82: 4a00 tstb %d0 46c84: 6618 bnes 46c9e <_Heap_Walk+0x2f6> (*printer)( 46c86: 2f0a movel %a2,%sp@- 46c88: 4879 0005 b909 pea 5b909 46c8e: 4878 0001 pea 1 46c92: 2f02 movel %d2,%sp@- 46c94: 4e93 jsr %a3@ 46c96: 4fef 0010 lea %sp@(16),%sp 46c9a: 4200 clrb %d0 46c9c: 601e bras 46cbc <_Heap_Walk+0x314> <== ALWAYS TAKEN return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 46c9e: 206c 0008 moveal %a4@(8),%a0 46ca2: 6008 bras 46cac <_Heap_Walk+0x304> <== ALWAYS TAKEN { const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *free_block = _Heap_Free_list_first( heap ); while ( free_block != free_list_tail ) { if ( free_block == block ) { 46ca4: b5c8 cmpal %a0,%a2 46ca6: 670a beqs 46cb2 <_Heap_Walk+0x30a> return true; } free_block = free_block->next; 46ca8: 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 ) { 46cac: b9c8 cmpal %a0,%a4 46cae: 66f4 bnes 46ca4 <_Heap_Walk+0x2fc> 46cb0: 6014 bras 46cc6 <_Heap_Walk+0x31e> <== ALWAYS TAKEN 46cb2: 244d moveal %a5,%a2 if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; } while ( block != last_block ) { 46cb4: ba8a cmpl %a2,%d5 46cb6: 6600 fe6e bnew 46b26 <_Heap_Walk+0x17e> <== ALWAYS TAKEN 46cba: 7001 moveq #1,%d0 block = next_block; } return true; } 46cbc: 4cee 3cfc ffd0 moveml %fp@(-48),%d2-%d7/%a2-%a5 46cc2: 4e5e unlk %fp 46cc4: 4e75 rts return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 46cc6: 2f0a movel %a2,%sp@- 46cc8: 4879 0005 b938 pea 5b938 46cce: 60be bras 46c8e <_Heap_Walk+0x2e6> <== ALWAYS TAKEN 00046cd0 <_Heap_Walk_print>: { /* Do nothing */ } static void _Heap_Walk_print( int source, bool error, const char *fmt, ... ) { 46cd0: 41f9 0004 3474 lea 43474 ,%a0 46cd6: 4e56 0000 linkw %fp,#0 46cda: 202e 0008 movel %fp@(8),%d0 va_list ap; if ( error ) { 46cde: 4a2e 000f tstb %fp@(15) 46ce2: 670a beqs 46cee <_Heap_Walk_print+0x1e> printk( "FAIL[%d]: ", source ); 46ce4: 2f00 movel %d0,%sp@- 46ce6: 4879 0005 b963 pea 5b963 46cec: 6008 bras 46cf6 <_Heap_Walk_print+0x26> <== ALWAYS TAKEN } else { printk( "PASS[%d]: ", source ); 46cee: 2f00 movel %d0,%sp@- 46cf0: 4879 0005 b96e pea 5b96e 46cf6: 4e90 jsr %a0@ 46cf8: 508f addql #8,%sp } va_start( ap, fmt ); vprintk( fmt, ap ); 46cfa: 486e 0014 pea %fp@(20) 46cfe: 2f2e 0010 movel %fp@(16),%sp@- 46d02: 4eb9 0004 4df8 jsr 44df8 46d08: 508f addql #8,%sp va_end( ap ); } 46d0a: 4e5e unlk %fp 46d0c: 4e75 rts ... 000455dc <_IO_Initialize_all_drivers>: * * Output Parameters: NONE */ void _IO_Initialize_all_drivers( void ) { 455dc: 4e56 0000 linkw %fp,#0 455e0: 2f0a movel %a2,%sp@- rtems_device_major_number major; for ( major=0 ; major < _IO_Number_of_drivers ; major ++ ) (void) rtems_io_initialize( major, 0, NULL ); 455e2: 45f9 0004 a0d4 lea 4a0d4 ,%a2 * * Output Parameters: NONE */ void _IO_Initialize_all_drivers( void ) { 455e8: 2f02 movel %d2,%sp@- 455ea: 4282 clrl %d2 rtems_device_major_number major; for ( major=0 ; major < _IO_Number_of_drivers ; major ++ ) 455ec: 600e bras 455fc <_IO_Initialize_all_drivers+0x20> <== ALWAYS TAKEN (void) rtems_io_initialize( major, 0, NULL ); 455ee: 42a7 clrl %sp@- 455f0: 42a7 clrl %sp@- 455f2: 2f02 movel %d2,%sp@- void _IO_Initialize_all_drivers( void ) { rtems_device_major_number major; for ( major=0 ; major < _IO_Number_of_drivers ; major ++ ) 455f4: 5282 addql #1,%d2 (void) rtems_io_initialize( major, 0, NULL ); 455f6: 4e92 jsr %a2@ void _IO_Initialize_all_drivers( void ) { rtems_device_major_number major; for ( major=0 ; major < _IO_Number_of_drivers ; major ++ ) 455f8: 4fef 000c lea %sp@(12),%sp 455fc: b4b9 0005 d728 cmpl 5d728 <_IO_Number_of_drivers>,%d2 45602: 65ea bcss 455ee <_IO_Initialize_all_drivers+0x12> (void) rtems_io_initialize( major, 0, NULL ); } 45604: 242e fff8 movel %fp@(-8),%d2 45608: 246e fffc moveal %fp@(-4),%a2 4560c: 4e5e unlk %fp 4560e: 4e75 rts 00045610 <_IO_Manager_initialization>: * workspace. * */ void _IO_Manager_initialization(void) { 45610: 4e56 ffe0 linkw %fp,#-32 45614: 48d7 1c7c moveml %d2-%d6/%a2-%a4,%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; 45618: 2479 0005 b746 moveal 5b746 ,%a2 drivers_in_table = Configuration.number_of_device_drivers; 4561e: 2a39 0005 b742 movel 5b742 ,%d5 number_of_drivers = Configuration.maximum_drivers; 45624: 2439 0005 b73e movel 5b73e ,%d2 /* * 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 ) 4562a: ba82 cmpl %d2,%d5 4562c: 6440 bccs 4566e <_IO_Manager_initialization+0x5e> /* * 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 *) 4562e: 2002 movel %d2,%d0 45630: 2602 movel %d2,%d3 _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) _IO_Driver_address_table[index] = driver_table[index]; 45632: 4284 clrl %d4 45634: 4286 clrl %d6 45636: 49f9 0004 d478 lea 4d478 ,%a4 /* * 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 *) 4563c: e788 lsll #3,%d0 4563e: eb8b lsll #5,%d3 45640: 9680 subl %d0,%d3 45642: 2f03 movel %d3,%sp@- 45644: 4eb9 0004 7e68 jsr 47e68 <_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( 4564a: 2f03 movel %d3,%sp@- 4564c: 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; 4564e: 23c2 0005 d728 movel %d2,5d728 <_IO_Number_of_drivers> memset( 45654: 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 *) 45656: 23c0 0005 d72c movel %d0,5d72c <_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( 4565c: 4eb9 0004 d4e8 jsr 4d4e8 _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) _IO_Driver_address_table[index] = driver_table[index]; 45662: 2679 0005 d72c moveal 5d72c <_IO_Driver_address_table>,%a3 memset( _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 45668: 4fef 0010 lea %sp@(16),%sp 4566c: 6028 bras 45696 <_IO_Manager_initialization+0x86> <== ALWAYS TAKEN * 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; 4566e: 23ca 0005 d72c movel %a2,5d72c <_IO_Driver_address_table> _IO_Number_of_drivers = number_of_drivers; 45674: 23c5 0005 d728 movel %d5,5d728 <_IO_Number_of_drivers> return; 4567a: 601e bras 4569a <_IO_Manager_initialization+0x8a> <== ALWAYS TAKEN _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) _IO_Driver_address_table[index] = driver_table[index]; 4567c: 4878 0018 pea 18 45680: 4872 4800 pea %a2@(00000000,%d4:l) 45684: 4873 4800 pea %a3@(00000000,%d4:l) memset( _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 45688: 5286 addql #1,%d6 4568a: 0684 0000 0018 addil #24,%d4 _IO_Driver_address_table[index] = driver_table[index]; 45690: 4e94 jsr %a4@ memset( _IO_Driver_address_table, 0, sizeof( rtems_driver_address_table ) * ( number_of_drivers ) ); for ( index = 0 ; index < drivers_in_table ; index++ ) 45692: 4fef 000c lea %sp@(12),%sp 45696: ba86 cmpl %d6,%d5 45698: 62e2 bhis 4567c <_IO_Manager_initialization+0x6c> _IO_Driver_address_table[index] = driver_table[index]; number_of_drivers = drivers_in_table; } 4569a: 4cee 1c7c ffe0 moveml %fp@(-32),%d2-%d6/%a2-%a4 456a0: 4e5e unlk %fp 456a2: 4e75 rts 00045fe4 <_Internal_error_Occurred>: void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 45fe4: 4e56 0000 linkw %fp,#0 45fe8: 222e 000c movel %fp@(12),%d1 45fec: 2f03 movel %d3,%sp@- _Internal_errors_What_happened.the_source = the_source; _Internal_errors_What_happened.is_internal = is_internal; _Internal_errors_What_happened.the_error = the_error; _User_extensions_Fatal( the_source, is_internal, the_error ); 45fee: 4283 clrl %d3 45ff0: 1601 moveb %d1,%d3 void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 45ff2: 2f02 movel %d2,%sp@- 45ff4: 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 ); 45ff8: 2f02 movel %d2,%sp@- void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 45ffa: 202e 0008 movel %fp@(8),%d0 _Internal_errors_What_happened.the_source = the_source; _Internal_errors_What_happened.is_internal = is_internal; _Internal_errors_What_happened.the_error = the_error; _User_extensions_Fatal( the_source, is_internal, the_error ); 45ffe: 2f03 movel %d3,%sp@- _System_state_Set( SYSTEM_STATE_FAILED ); _CPU_Fatal_halt( the_error ); 46000: 263c 0000 0700 movel #1792,%d3 _Internal_errors_What_happened.the_source = the_source; _Internal_errors_What_happened.is_internal = is_internal; _Internal_errors_What_happened.the_error = the_error; _User_extensions_Fatal( the_source, is_internal, the_error ); 46006: 2f00 movel %d0,%sp@- Internal_errors_t the_error ) { _Internal_errors_What_happened.the_source = the_source; _Internal_errors_What_happened.is_internal = is_internal; 46008: 13c1 0005 cf6e moveb %d1,5cf6e <_Internal_errors_What_happened+0x4> bool is_internal, Internal_errors_t the_error ) { _Internal_errors_What_happened.the_source = the_source; 4600e: 23c0 0005 cf6a movel %d0,5cf6a <_Internal_errors_What_happened> _Internal_errors_What_happened.is_internal = is_internal; _Internal_errors_What_happened.the_error = the_error; 46014: 23c2 0005 cf70 movel %d2,5cf70 <_Internal_errors_What_happened+0x6> _User_extensions_Fatal( the_source, is_internal, the_error ); 4601a: 4eb9 0004 7b0e jsr 47b0e <_User_extensions_Fatal> _System_state_Set( SYSTEM_STATE_FAILED ); _CPU_Fatal_halt( the_error ); 46020: 40c0 movew %sr,%d0 46022: 8083 orl %d3,%d0 46024: 46c0 movew %d0,%sr 46026: 2002 movel %d2,%d0 <== NOT EXECUTED 46028: 223c dead beef movel #-559038737,%d1 <== NOT EXECUTED 4602e: 4ac8 halt <== NOT EXECUTED RTEMS_INLINE_ROUTINE void _System_state_Set ( System_state_Codes state ) { _System_state_Current = state; 46030: 7005 moveq #5,%d0 46032: 4fef 000c lea %sp@(12),%sp 46036: 23c0 0005 d04c movel %d0,5d04c <_System_state_Current> 4603c: 60fe bras 4603c <_Internal_error_Occurred+0x58> <== ALWAYS TAKEN ... 0004a658 <_Objects_API_maximum_class>: case OBJECTS_NO_API: default: break; } return 0; } 4a658: 7203 moveq #3,%d1 #include unsigned int _Objects_API_maximum_class( uint32_t api ) { 4a65a: 4e56 0000 linkw %fp,#0 case OBJECTS_NO_API: default: break; } return 0; } 4a65e: 202e 0008 movel %fp@(8),%d0 4a662: 5380 subql #1,%d0 4a664: b280 cmpl %d0,%d1 4a666: 6404 bccs 4a66c <_Objects_API_maximum_class+0x14> 4a668: 4280 clrl %d0 4a66a: 600a bras 4a676 <_Objects_API_maximum_class+0x1e> <== ALWAYS TAKEN 4a66c: 41f9 0005 abc0 lea 5abc0 ,%a0 4a672: 2030 0c00 movel %a0@(00000000,%d0:l:4),%d0 4a676: 4e5e unlk %fp 4a678: 4e75 rts ... 000460a8 <_Objects_Allocate>: */ Objects_Control *_Objects_Allocate( Objects_Information *information ) { 460a8: 4e56 fff0 linkw %fp,#-16 460ac: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ 460b0: 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 ) 460b4: 4aaa 0014 tstl %a2@(20) 460b8: 6604 bnes 460be <_Objects_Allocate+0x16> <== NEVER TAKEN 460ba: 4280 clrl %d0 <== NOT EXECUTED 460bc: 605e bras 4611c <_Objects_Allocate+0x74> <== NOT EXECUTED /* * OK. The manager should be initialized and configured to have objects. * With any luck, it is safe to attempt to allocate an object. */ the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 460be: 240a movel %a2,%d2 460c0: 0682 0000 001c addil #28,%d2 460c6: 47f9 0004 a154 lea 4a154 <_Chain_Get>,%a3 460cc: 2f02 movel %d2,%sp@- 460ce: 4e93 jsr %a3@ if ( information->auto_extend ) { 460d0: 588f addql #4,%sp 460d2: 4a2a 0010 tstb %a2@(16) 460d6: 6744 beqs 4611c <_Objects_Allocate+0x74> /* * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { 460d8: 4a80 tstl %d0 460da: 6612 bnes 460ee <_Objects_Allocate+0x46> _Objects_Extend_information( information ); 460dc: 2f0a movel %a2,%sp@- 460de: 4eb9 0004 6154 jsr 46154 <_Objects_Extend_information> the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 460e4: 2f02 movel %d2,%sp@- 460e6: 4e93 jsr %a3@ } if ( the_object ) { 460e8: 508f addql #8,%sp 460ea: 4a80 tstl %d0 460ec: 672e beqs 4611c <_Objects_Allocate+0x74> uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 460ee: 2040 moveal %d0,%a0 460f0: 4281 clrl %d1 460f2: 4283 clrl %d3 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 460f4: 4282 clrl %d2 } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 460f6: 362a 0008 movew %a2@(8),%d3 460fa: 3228 000a movew %a0@(10),%d1 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 460fe: 342a 0012 movew %a2@(18),%d2 information->inactive--; 46102: 306a 0028 moveaw %a2@(40),%a0 } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 46106: 9283 subl %d3,%d1 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 46108: 4c42 1001 remul %d2,%d1,%d1 information->inactive--; 4610c: 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 ]--; 4610e: e589 lsll #2,%d1 information->inactive--; 46110: 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 ]--; 46114: 206a 002a moveal %a2@(42),%a0 46118: d1c1 addal %d1,%a0 4611a: 5390 subql #1,%a0@ information->inactive--; } } return the_object; } 4611c: 4cee 0c0c fff0 moveml %fp@(-16),%d2-%d3/%a2-%a3 46122: 4e5e unlk %fp 46124: 4e75 rts ... 00046154 <_Objects_Extend_information>: */ void _Objects_Extend_information( Objects_Information *information ) { 46154: 4e56 ffc8 linkw %fp,#-56 46158: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 4615c: 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 ); 46160: 4283 clrl %d3 index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 46162: 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 ); 46166: 362a 0008 movew %a2@(8),%d3 index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 4616a: 4a88 tstl %a0 4616c: 6608 bnes 46176 <_Objects_Extend_information+0x22> 4616e: 2403 movel %d3,%d2 46170: 4284 clrl %d4 46172: 4285 clrl %d5 46174: 602a bras 461a0 <_Objects_Extend_information+0x4c> <== ALWAYS TAKEN block_count = 0; else { block_count = information->maximum / information->allocation_size; 46176: 4280 clrl %d0 46178: 2403 movel %d3,%d2 4617a: 4284 clrl %d4 4617c: 302a 0012 movew %a2@(18),%d0 46180: 3a2a 000e movew %a2@(14),%d5 46184: 0285 0000 ffff andil #65535,%d5 4618a: 8ac0 divuw %d0,%d5 4618c: 0285 0000 ffff andil #65535,%d5 for ( ; block < block_count; block++ ) { 46192: 6008 bras 4619c <_Objects_Extend_information+0x48> <== ALWAYS TAKEN if ( information->object_blocks[ block ] == NULL ) 46194: 4a98 tstl %a0@+ 46196: 6708 beqs 461a0 <_Objects_Extend_information+0x4c> 46198: d480 addl %d0,%d2 if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { 4619a: 5284 addql #1,%d4 4619c: ba84 cmpl %d4,%d5 4619e: 62f4 bhis 46194 <_Objects_Extend_information+0x40> else index_base += information->allocation_size; } } maximum = (uint32_t) information->maximum + information->allocation_size; 461a0: 4280 clrl %d0 461a2: 4287 clrl %d7 461a4: 302a 0012 movew %a2@(18),%d0 461a8: 3e2a 000e movew %a2@(14),%d7 461ac: de80 addl %d0,%d7 /* * 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 ) { 461ae: 0c87 0000 ffff cmpil #65535,%d7 461b4: 6200 01da bhiw 46390 <_Objects_Extend_information+0x23c> <== 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; 461b8: 41ea 0014 lea %a2@(20),%a0 461bc: 4c10 0800 mulsl %a0@,%d0 if ( information->auto_extend ) { 461c0: 4a2a 0010 tstb %a2@(16) 461c4: 6712 beqs 461d8 <_Objects_Extend_information+0x84> new_object_block = _Workspace_Allocate( block_size ); 461c6: 2f00 movel %d0,%sp@- 461c8: 4eb9 0004 7e9c jsr 47e9c <_Workspace_Allocate> if ( !new_object_block ) 461ce: 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 ); 461d0: 2c00 movel %d0,%d6 if ( !new_object_block ) 461d2: 6610 bnes 461e4 <_Objects_Extend_information+0x90> 461d4: 6000 01ba braw 46390 <_Objects_Extend_information+0x23c> <== ALWAYS TAKEN return; } else { new_object_block = _Workspace_Allocate_or_fatal_error( block_size ); 461d8: 2f00 movel %d0,%sp@- 461da: 4eb9 0004 7e68 jsr 47e68 <_Workspace_Allocate_or_fatal_error> 461e0: 588f addql #4,%sp 461e2: 2c00 movel %d0,%d6 } /* * If the index_base is the maximum we need to grow the tables. */ if (index_base >= information->maximum ) { 461e4: 4280 clrl %d0 461e6: 302a 000e movew %a2@(14),%d0 461ea: b082 cmpl %d2,%d0 461ec: 6200 0112 bhiw 46300 <_Objects_Extend_information+0x1ac> */ /* * Up the block count and maximum */ block_count++; 461f0: 2845 moveal %d5,%a4 461f2: 528c addql #1,%a4 * 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 ); 461f4: 2007 movel %d7,%d0 461f6: d083 addl %d3,%d0 461f8: 41f4 ca00 lea %a4@(00000000,%a4:l:2),%a0 461fc: d088 addl %a0,%d0 461fe: e588 lsll #2,%d0 46200: 2f00 movel %d0,%sp@- 46202: 4eb9 0004 7e9c jsr 47e9c <_Workspace_Allocate> if ( !object_blocks ) { 46208: 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 ); 4620a: 2640 moveal %d0,%a3 if ( !object_blocks ) { 4620c: 4a80 tstl %d0 4620e: 660e bnes 4621e <_Objects_Extend_information+0xca> _Workspace_Free( new_object_block ); 46210: 2f06 movel %d6,%sp@- 46212: 4eb9 0004 7eb8 jsr 47eb8 <_Workspace_Free> return; 46218: 588f addql #4,%sp 4621a: 6000 0174 braw 46390 <_Objects_Extend_information+0x23c> <== ALWAYS TAKEN } /* * Break the block into the various sections. */ inactive_per_block = (uint32_t *) _Addresses_Add_offset( 4621e: 200c movel %a4,%d0 46220: e588 lsll #2,%d0 46222: 2840 moveal %d0,%a4 * Take the block count down. Saves all the (block_count - 1) * in the copies. */ block_count--; if ( information->maximum > minimum_index ) { 46224: 4280 clrl %d0 RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset ( const void *base, uintptr_t offset ) { return (void *)((uintptr_t)base + offset); 46226: 4bf3 c800 lea %a3@(00000000,%a4:l),%a5 4622a: 49f5 c800 lea %a5@(00000000,%a4:l),%a4 4622e: 302a 000e movew %a2@(14),%d0 46232: b680 cmpl %d0,%d3 46234: 6506 bcss 4623c <_Objects_Extend_information+0xe8> 46236: 204c moveal %a4,%a0 46238: 4280 clrl %d0 4623a: 604a bras 46286 <_Objects_Extend_information+0x132> <== 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, 4623c: 2205 movel %d5,%d1 4623e: e589 lsll #2,%d1 46240: 2f01 movel %d1,%sp@- 46242: 2f2a 002e movel %a2@(46),%sp@- 46246: 2d41 fff0 movel %d1,%fp@(-16) 4624a: 2f0b movel %a3,%sp@- 4624c: 4eb9 0004 d478 jsr 4d478 information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, 46252: 222e fff0 movel %fp@(-16),%d1 46256: 2f01 movel %d1,%sp@- 46258: 2f2a 002a movel %a2@(42),%sp@- 4625c: 2f0d movel %a5,%sp@- 4625e: 4eb9 0004 d478 jsr 4d478 information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, 46264: 4280 clrl %d0 46266: 302a 000e movew %a2@(14),%d0 4626a: d680 addl %d0,%d3 4626c: e58b lsll #2,%d3 4626e: 2f03 movel %d3,%sp@- 46270: 2f2a 0018 movel %a2@(24),%sp@- 46274: 2f0c movel %a4,%sp@- 46276: 4eb9 0004 d478 jsr 4d478 4627c: 4fef 0024 lea %sp@(36),%sp 46280: 6008 bras 4628a <_Objects_Extend_information+0x136> <== ALWAYS TAKEN /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { local_table[ index ] = NULL; 46282: 4298 clrl %a0@+ } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 46284: 5280 addql #1,%d0 46286: b680 cmpl %d0,%d3 46288: 62f8 bhis 46282 <_Objects_Extend_information+0x12e> */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); 4628a: 4281 clrl %d1 4628c: 2002 movel %d2,%d0 } /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; 4628e: e58d lsll #2,%d5 inactive_per_block[block_count] = 0; for ( index=index_base ; index < ( information->allocation_size + index_base ); 46290: 322a 0012 movew %a2@(18),%d1 46294: 41f4 2c00 lea %a4@(00000000,%d2:l:4),%a0 /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; inactive_per_block[block_count] = 0; 46298: 42b5 5800 clrl %a5@(00000000,%d5:l) for ( index=index_base ; index < ( information->allocation_size + index_base ); 4629c: d282 addl %d2,%d1 } /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; 4629e: 42b3 5800 clrl %a3@(00000000,%d5:l) inactive_per_block[block_count] = 0; for ( index=index_base ; 462a2: 6004 bras 462a8 <_Objects_Extend_information+0x154> <== ALWAYS TAKEN index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; 462a4: 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++ ) { 462a6: 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 ; 462a8: b280 cmpl %d0,%d1 462aa: 62f8 bhis 462a4 <_Objects_Extend_information+0x150> index < ( information->allocation_size + index_base ); index++ ) { local_table[ index ] = NULL; } _ISR_Disable( level ); 462ac: 203c 0000 0700 movel #1792,%d0 462b2: 40c3 movew %sr,%d3 462b4: 8083 orl %d3,%d0 462b6: 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( 462b8: 2012 movel %a2@,%d0 462ba: 7218 moveq #24,%d1 462bc: 4285 clrl %d5 462be: e3a8 lsll %d1,%d0 462c0: 3a07 movew %d7,%d5 462c2: 4281 clrl %d1 462c4: 2245 moveal %d5,%a1 462c6: 7a1b moveq #27,%d5 462c8: 322a 0004 movew %a2@(4),%d1 462cc: 08c0 0010 bset #16,%d0 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; 462d0: 3547 000e movew %d7,%a2@(14) information->maximum_id = _Objects_Build_id( 462d4: eba9 lsll %d5,%d1 462d6: 2e09 movel %a1,%d7 462d8: 8081 orl %d1,%d0 local_table[ index ] = NULL; } _ISR_Disable( level ); old_tables = information->object_blocks; 462da: 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( 462de: 8e80 orl %d0,%d7 _ISR_Disable( level ); old_tables = information->object_blocks; information->object_blocks = object_blocks; 462e0: 254b 002e movel %a3,%a2@(46) information->inactive_per_block = inactive_per_block; 462e4: 254d 002a movel %a5,%a2@(42) information->local_table = local_table; information->maximum = (Objects_Maximum) maximum; information->maximum_id = _Objects_Build_id( 462e8: 2547 000a movel %d7,%a2@(10) old_tables = information->object_blocks; information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; information->local_table = local_table; 462ec: 254c 0018 movel %a4,%a2@(24) information->the_class, _Objects_Local_node, information->maximum ); _ISR_Enable( level ); 462f0: 46c3 movew %d3,%sr if ( old_tables ) 462f2: 4a88 tstl %a0 462f4: 670a beqs 46300 <_Objects_Extend_information+0x1ac> _Workspace_Free( old_tables ); 462f6: 2f08 movel %a0,%sp@- 462f8: 4eb9 0004 7eb8 jsr 47eb8 <_Workspace_Free> 462fe: 588f addql #4,%sp } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 46300: 206a 002e moveal %a2@(46),%a0 /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 46304: 4281 clrl %d1 46306: 200e movel %fp,%d0 46308: 0680 ffff fff4 addil #-12,%d0 /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { 4630e: 2a00 movel %d0,%d5 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 46310: 260a movel %a2,%d3 46312: 0683 0000 001c addil #28,%d3 /* * Move from the local chain, initialise, then append to the inactive chain */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { 46318: 49f9 0004 a154 lea 4a154 <_Chain_Get>,%a4 information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 4631e: 47f9 0004 58dc lea 458dc <_Chain_Append>,%a3 } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 46324: e58c lsll #2,%d4 /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 46326: 322a 0012 movew %a2@(18),%d1 } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 4632a: 2186 4800 movel %d6,%a0@(00000000,%d4:l) /* * Initialize objects .. add to a local chain first. */ _Chain_Initialize( 4632e: 2f2a 0014 movel %a2@(20),%sp@- 46332: 2f01 movel %d1,%sp@- 46334: 2f06 movel %d6,%sp@- 46336: 2f00 movel %d0,%sp@- 46338: 4eb9 0004 a188 jsr 4a188 <_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 ) { 4633e: 4fef 0010 lea %sp@(16),%sp 46342: 6028 bras 4636c <_Objects_Extend_information+0x218> <== ALWAYS TAKEN the_object->id = _Objects_Build_id( 46344: 2212 movel %a2@,%d1 46346: 7c18 moveq #24,%d6 46348: 7e1b moveq #27,%d7 4634a: 2040 moveal %d0,%a0 4634c: eda9 lsll %d6,%d1 4634e: 4286 clrl %d6 46350: 3c2a 0004 movew %a2@(4),%d6 46354: 08c1 0010 bset #16,%d1 46358: efae lsll %d7,%d6 4635a: 8286 orl %d6,%d1 4635c: 8282 orl %d2,%d1 index ); _Chain_Append( &information->Inactive, &the_object->Node ); index++; 4635e: 5282 addql #1,%d2 */ index = index_base; while ((the_object = (Objects_Control *) _Chain_Get( &Inactive )) != NULL ) { the_object->id = _Objects_Build_id( 46360: 2141 0008 movel %d1,%a0@(8) information->the_class, _Objects_Local_node, index ); _Chain_Append( &information->Inactive, &the_object->Node ); 46364: 2f00 movel %d0,%sp@- 46366: 2f03 movel %d3,%sp@- 46368: 4e93 jsr %a3@ index++; 4636a: 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 ) { 4636c: 2f05 movel %d5,%sp@- 4636e: 4e94 jsr %a4@ 46370: 588f addql #4,%sp 46372: 4a80 tstl %d0 46374: 66ce bnes 46344 <_Objects_Extend_information+0x1f0> _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 46376: 4280 clrl %d0 information->inactive = 46378: 322a 0028 movew %a2@(40),%d1 4637c: 326a 0012 moveaw %a2@(18),%a1 _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 46380: 206a 002a moveal %a2@(42),%a0 information->inactive = 46384: d289 addl %a1,%d1 _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 46386: 3009 movew %a1,%d0 information->inactive = 46388: 3541 0028 movew %d1,%a2@(40) _Chain_Append( &information->Inactive, &the_object->Node ); index++; } information->inactive_per_block[ block ] = information->allocation_size; 4638c: 2180 4800 movel %d0,%a0@(00000000,%d4:l) information->inactive = (Objects_Maximum)(information->inactive + information->allocation_size); } 46390: 4cee 3cfc ffc8 moveml %fp@(-56),%d2-%d7/%a2-%a5 46396: 4e5e unlk %fp 46398: 4e75 rts ... 000464f4 <_Objects_Get>: * always NULL. * * If the Id is valid but the object has not been created yet, then * the local_table entry will be NULL. */ index = id - information->minimum_id + 1; 464f4: 7001 moveq #1,%d0 /* * If the index is less than maximum, then it is OK to use it to * index into the local_table array. */ if ( index <= information->maximum ) { 464f6: 4281 clrl %d1 Objects_Control *_Objects_Get( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 464f8: 4e56 0000 linkw %fp,#0 464fc: 206e 0008 moveal %fp@(8),%a0 * always NULL. * * If the Id is valid but the object has not been created yet, then * the local_table entry will be NULL. */ index = id - information->minimum_id + 1; 46500: 90a8 0006 subl %a0@(6),%d0 46504: d0ae 000c addl %fp@(12),%d0 Objects_Control *_Objects_Get( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 46508: 2f0a movel %a2,%sp@- 4650a: 246e 0010 moveal %fp@(16),%a2 /* * If the index is less than maximum, then it is OK to use it to * index into the local_table array. */ if ( index <= information->maximum ) { 4650e: 3228 000e movew %a0@(14),%d1 Objects_Control *_Objects_Get( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 46512: 2f02 movel %d2,%sp@- /* * If the index is less than maximum, then it is OK to use it to * index into the local_table array. */ if ( index <= information->maximum ) { 46514: b280 cmpl %d0,%d1 46516: 6528 bcss 46540 <_Objects_Get+0x4c> 46518: 2239 0005 cec4 movel 5cec4 <_Thread_Dispatch_disable_level>,%d1 4651e: 5281 addql #1,%d1 46520: 23c1 0005 cec4 movel %d1,5cec4 <_Thread_Dispatch_disable_level> _Thread_Disable_dispatch(); if ( (the_object = information->local_table[ index ]) != NULL ) { 46526: 2068 0018 moveal %a0@(24),%a0 4652a: 2430 0c00 movel %a0@(00000000,%d0:l:4),%d2 4652e: 6704 beqs 46534 <_Objects_Get+0x40> *location = OBJECTS_LOCAL; 46530: 4292 clrl %a2@ return the_object; 46532: 6012 bras 46546 <_Objects_Get+0x52> <== ALWAYS TAKEN /* * Valid Id for this API, Class and Node but the object has not * been allocated yet. */ _Thread_Enable_dispatch(); 46534: 4eb9 0004 6cee jsr 46cee <_Thread_Enable_dispatch> *location = OBJECTS_ERROR; 4653a: 7201 moveq #1,%d1 4653c: 2481 movel %d1,%a2@ return NULL; 4653e: 6006 bras 46546 <_Objects_Get+0x52> <== ALWAYS TAKEN /* * Object Id is not within this API and Class on this node. So * it may be global in a multiprocessing system. But it is clearly * invalid on a single processor system. */ *location = OBJECTS_ERROR; 46540: 7001 moveq #1,%d0 46542: 4282 clrl %d2 46544: 2480 movel %d0,%a2@ _Objects_MP_Is_remote( information, id, location, &the_object ); return the_object; #else return NULL; #endif } 46546: 2002 movel %d2,%d0 46548: 242e fff8 movel %fp@(-8),%d2 4654c: 246e fffc moveal %fp@(-4),%a2 46550: 4e5e unlk %fp 46552: 4e75 rts 0004644c <_Objects_Get_information>: Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint32_t the_class ) { 4644c: 4e56 0000 linkw %fp,#0 46450: 2f03 movel %d3,%sp@- 46452: 262e 0008 movel %fp@(8),%d3 46456: 2f02 movel %d2,%sp@- 46458: 242e 000c movel %fp@(12),%d2 Objects_Information *info; int the_class_api_maximum; if ( !the_class ) 4645c: 672e beqs 4648c <_Objects_Get_information+0x40> /* * This call implicitly validates the_api so we do not call * _Objects_Is_api_valid above here. */ the_class_api_maximum = _Objects_API_maximum_class( the_api ); 4645e: 2f03 movel %d3,%sp@- 46460: 4eb9 0004 a658 jsr 4a658 <_Objects_API_maximum_class> if ( the_class_api_maximum == 0 ) 46466: 588f addql #4,%sp 46468: 4a80 tstl %d0 4646a: 6720 beqs 4648c <_Objects_Get_information+0x40> return NULL; if ( the_class > (uint32_t) the_class_api_maximum ) 4646c: b082 cmpl %d2,%d0 4646e: 651c bcss 4648c <_Objects_Get_information+0x40> return NULL; if ( !_Objects_Information_table[ the_api ] ) 46470: 41f9 0005 ce7c lea 5ce7c <_Objects_Information_table>,%a0 46476: 2070 3c00 moveal %a0@(00000000,%d3:l:4),%a0 4647a: 4a88 tstl %a0 4647c: 670e beqs 4648c <_Objects_Get_information+0x40> <== ALWAYS TAKEN return NULL; info = _Objects_Information_table[ the_api ][ the_class ]; 4647e: 2030 2c00 movel %a0@(00000000,%d2:l:4),%d0 if ( !info ) 46482: 670a beqs 4648e <_Objects_Get_information+0x42> <== 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 ) 46484: 2040 moveal %d0,%a0 46486: 4a68 000e tstw %a0@(14) 4648a: 6602 bnes 4648e <_Objects_Get_information+0x42> 4648c: 4280 clrl %d0 return NULL; #endif return info; } 4648e: 242e fff8 movel %fp@(-8),%d2 46492: 262e fffc movel %fp@(-4),%d3 46496: 4e5e unlk %fp 46498: 4e75 rts ... 0004649c <_Objects_Get_isr_disable>: { Objects_Control *the_object; uint32_t index; ISR_Level level; index = id - information->minimum_id + 1; 4649c: 7001 moveq #1,%d0 Objects_Information *information, Objects_Id id, Objects_Locations *location, ISR_Level *level_p ) { 4649e: 4e56 0000 linkw %fp,#0 464a2: 226e 0008 moveal %fp@(8),%a1 Objects_Control *the_object; uint32_t index; ISR_Level level; index = id - information->minimum_id + 1; 464a6: 90a9 0006 subl %a1@(6),%d0 464aa: d0ae 000c addl %fp@(12),%d0 Objects_Information *information, Objects_Id id, Objects_Locations *location, ISR_Level *level_p ) { 464ae: 2f02 movel %d2,%sp@- 464b0: 206e 0010 moveal %fp@(16),%a0 uint32_t index; ISR_Level level; index = id - information->minimum_id + 1; _ISR_Disable( level ); 464b4: 243c 0000 0700 movel #1792,%d2 464ba: 40c1 movew %sr,%d1 464bc: 8481 orl %d1,%d2 464be: 46c2 movew %d2,%sr if ( information->maximum >= index ) { 464c0: 4282 clrl %d2 464c2: 3429 000e movew %a1@(14),%d2 464c6: b082 cmpl %d2,%d0 464c8: 621c bhis 464e6 <_Objects_Get_isr_disable+0x4a> if ( (the_object = information->local_table[ index ]) != NULL ) { 464ca: 2269 0018 moveal %a1@(24),%a1 464ce: 2031 0c00 movel %a1@(00000000,%d0:l:4),%d0 464d2: 670a beqs 464de <_Objects_Get_isr_disable+0x42> *location = OBJECTS_LOCAL; *level_p = level; 464d4: 226e 0014 moveal %fp@(20),%a1 index = id - information->minimum_id + 1; _ISR_Disable( level ); if ( information->maximum >= index ) { if ( (the_object = information->local_table[ index ]) != NULL ) { *location = OBJECTS_LOCAL; 464d8: 4290 clrl %a0@ *level_p = level; 464da: 2281 movel %d1,%a1@ return the_object; 464dc: 6010 bras 464ee <_Objects_Get_isr_disable+0x52> <== ALWAYS TAKEN } _ISR_Enable( level ); 464de: 46c1 movew %d1,%sr *location = OBJECTS_ERROR; 464e0: 7201 moveq #1,%d1 464e2: 2081 movel %d1,%a0@ return NULL; 464e4: 6008 bras 464ee <_Objects_Get_isr_disable+0x52> <== ALWAYS TAKEN } _ISR_Enable( level ); 464e6: 46c1 movew %d1,%sr *location = OBJECTS_ERROR; 464e8: 7001 moveq #1,%d0 464ea: 2080 movel %d0,%a0@ 464ec: 4280 clrl %d0 _Objects_MP_Is_remote( information, id, location, &the_object ); return the_object; #else return NULL; #endif } 464ee: 241f movel %sp@+,%d2 464f0: 4e5e unlk %fp 464f2: 4e75 rts 000508e4 <_Objects_Get_name_as_string>: char *_Objects_Get_name_as_string( Objects_Id id, size_t length, char *name ) { 508e4: 4e56 ffe0 linkw %fp,#-32 508e8: 48d7 043c moveml %d2-%d5/%a2,%sp@ 508ec: 262e 0008 movel %fp@(8),%d3 508f0: 282e 000c movel %fp@(12),%d4 508f4: 242e 0010 movel %fp@(16),%d2 char lname[5]; Objects_Control *the_object; Objects_Locations location; Objects_Id tmpId; if ( length == 0 ) 508f8: 4a84 tstl %d4 508fa: 6700 00be beqw 509ba <_Objects_Get_name_as_string+0xd6> return NULL; if ( name == NULL ) 508fe: 4a82 tstl %d2 50900: 6700 00ba beqw 509bc <_Objects_Get_name_as_string+0xd8> return NULL; tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 50904: 4a83 tstl %d3 50906: 660a bnes 50912 <_Objects_Get_name_as_string+0x2e> 50908: 2079 0006 87a6 moveal 687a6 <_Thread_Executing>,%a0 5090e: 2628 0008 movel %a0@(8),%d3 information = _Objects_Get_information_id( tmpId ); 50912: 2f03 movel %d3,%sp@- 50914: 4eb9 0004 9d80 jsr 49d80 <_Objects_Get_information_id> if ( !information ) 5091a: 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 ); 5091c: 2440 moveal %d0,%a2 if ( !information ) 5091e: 4a80 tstl %d0 50920: 6700 0098 beqw 509ba <_Objects_Get_name_as_string+0xd6> return NULL; the_object = _Objects_Get( information, tmpId, &location ); 50924: 486e fffc pea %fp@(-4) 50928: 2f03 movel %d3,%sp@- 5092a: 2f00 movel %d0,%sp@- 5092c: 4eb9 0004 9e54 jsr 49e54 <_Objects_Get> switch ( location ) { 50932: 4fef 000c lea %sp@(12),%sp 50936: 4aae fffc tstl %fp@(-4) 5093a: 667e bnes 509ba <_Objects_Get_name_as_string+0xd6> return NULL; case OBJECTS_LOCAL: #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) { 5093c: 4a2a 0032 tstb %a2@(50) 50940: 670e beqs 50950 <_Objects_Get_name_as_string+0x6c> s = the_object->name.name_p; 50942: 2040 moveal %d0,%a0 50944: 2268 000c moveal %a0@(12),%a1 lname[ 4 ] = '\0'; s = lname; } d = name; if ( s ) { 50948: 4a89 tstl %a1 5094a: 6634 bnes 50980 <_Objects_Get_name_as_string+0x9c> 5094c: 2042 moveal %d2,%a0 5094e: 6060 bras 509b0 <_Objects_Get_name_as_string+0xcc> <== ALWAYS TAKEN if ( information->is_string ) { s = the_object->name.name_p; } else #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; 50950: 2040 moveal %d0,%a0 lname[ 0 ] = (u32_name >> 24) & 0xff; 50952: 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'; 50954: 43ee fff7 lea %fp@(-9),%a1 if ( information->is_string ) { s = the_object->name.name_p; } else #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; 50958: 2028 000c movel %a0@(12),%d0 lname[ 0 ] = (u32_name >> 24) & 0xff; 5095c: 2a00 movel %d0,%d5 5095e: e2ad lsrl %d1,%d5 lname[ 1 ] = (u32_name >> 16) & 0xff; lname[ 2 ] = (u32_name >> 8) & 0xff; 50960: 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; 50962: 2600 movel %d0,%d3 lname[ 2 ] = (u32_name >> 8) & 0xff; 50964: e089 lsrl #8,%d1 lname[ 3 ] = (u32_name >> 0) & 0xff; 50966: 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; 5096a: 4243 clrw %d3 5096c: 4843 swap %d3 lname[ 2 ] = (u32_name >> 8) & 0xff; lname[ 3 ] = (u32_name >> 0) & 0xff; lname[ 4 ] = '\0'; 5096e: 4200 clrb %d0 } else #endif { uint32_t u32_name = (uint32_t) the_object->name.name_u32; lname[ 0 ] = (u32_name >> 24) & 0xff; 50970: 1d45 fff7 moveb %d5,%fp@(-9) lname[ 1 ] = (u32_name >> 16) & 0xff; 50974: 1d43 fff8 moveb %d3,%fp@(-8) lname[ 2 ] = (u32_name >> 8) & 0xff; 50978: 1d41 fff9 moveb %d1,%fp@(-7) lname[ 3 ] = (u32_name >> 0) & 0xff; lname[ 4 ] = '\0'; 5097c: 1d40 fffb moveb %d0,%fp@(-5) s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 50980: 5384 subql #1,%d4 lname[ 0 ] = (u32_name >> 24) & 0xff; lname[ 1 ] = (u32_name >> 16) & 0xff; lname[ 2 ] = (u32_name >> 8) & 0xff; lname[ 3 ] = (u32_name >> 0) & 0xff; lname[ 4 ] = '\0'; 50982: 2042 moveal %d2,%a0 50984: 4280 clrl %d0 50986: 6018 bras 509a0 <_Objects_Get_name_as_string+0xbc> <== ALWAYS TAKEN } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { *d = (isprint((unsigned char)*s)) ? *s : '*'; 50988: 2479 0006 6954 moveal 66954 <__ctype_ptr__>,%a2 5098e: 1632 3801 moveb %a2@(00000001,%d3:l),%d3 50992: 49c3 extbl %d3 50994: 0283 0000 0097 andil #151,%d3 5099a: 6602 bnes 5099e <_Objects_Get_name_as_string+0xba> 5099c: 722a moveq #42,%d1 5099e: 10c1 moveb %d1,%a0@+ s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 509a0: b880 cmpl %d0,%d4 509a2: 630c blss 509b0 <_Objects_Get_name_as_string+0xcc> *d = (isprint((unsigned char)*s)) ? *s : '*'; 509a4: 4283 clrl %d3 s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 509a6: 1231 0800 moveb %a1@(00000000,%d0:l),%d1 509aa: 5280 addql #1,%d0 *d = (isprint((unsigned char)*s)) ? *s : '*'; 509ac: 1601 moveb %d1,%d3 s = lname; } d = name; if ( s ) { for ( i=0 ; i<(length-1) && *s ; i++, s++, d++ ) { 509ae: 66d8 bnes 50988 <_Objects_Get_name_as_string+0xa4> *d = (isprint((unsigned char)*s)) ? *s : '*'; } } *d = '\0'; 509b0: 4210 clrb %a0@ _Thread_Enable_dispatch(); 509b2: 4eb9 0004 a752 jsr 4a752 <_Thread_Enable_dispatch> return name; 509b8: 6002 bras 509bc <_Objects_Get_name_as_string+0xd8> <== ALWAYS TAKEN 509ba: 4282 clrl %d2 } return NULL; /* unreachable path */ } 509bc: 2002 movel %d2,%d0 509be: 4cee 043c ffe0 moveml %fp@(-32),%d2-%d5/%a2 509c4: 4e5e unlk %fp 509c6: 4e75 rts 000532c0 <_Objects_Get_next>: Objects_Information *information, Objects_Id id, Objects_Locations *location_p, Objects_Id *next_id_p ) { 532c0: 4e56 ffec linkw %fp,#-20 532c4: 48d7 3c04 moveml %d2/%a2-%a5,%sp@ 532c8: 266e 0008 moveal %fp@(8),%a3 532cc: 242e 000c movel %fp@(12),%d2 532d0: 246e 0010 moveal %fp@(16),%a2 532d4: 286e 0014 moveal %fp@(20),%a4 Objects_Control *object; Objects_Id next_id; if ( !information ) 532d8: 4a8b tstl %a3 532da: 6746 beqs 53322 <_Objects_Get_next+0x62> return NULL; if ( !location_p ) 532dc: 4a8a tstl %a2 532de: 6742 beqs 53322 <_Objects_Get_next+0x62> return NULL; if ( !next_id_p ) 532e0: 4a8c tstl %a4 532e2: 673e beqs 53322 <_Objects_Get_next+0x62> return NULL; if (_Objects_Get_index(id) == OBJECTS_ID_INITIAL_INDEX) 532e4: 4a42 tstw %d2 532e6: 6604 bnes 532ec <_Objects_Get_next+0x2c> next_id = information->minimum_id; 532e8: 242b 0006 movel %a3@(6),%d2 *location_p = OBJECTS_ERROR; goto final; } /* try to grab one */ object = _Objects_Get(information, next_id, location_p); 532ec: 4bf9 0004 9e54 lea 49e54 <_Objects_Get>,%a5 else next_id = id; do { /* walked off end of list? */ if (_Objects_Get_index(next_id) > information->maximum) 532f2: 4281 clrl %d1 532f4: 4280 clrl %d0 532f6: 322b 000e movew %a3@(14),%d1 532fa: 3002 movew %d2,%d0 532fc: b081 cmpl %d1,%d0 532fe: 630c blss 5330c <_Objects_Get_next+0x4c> { *location_p = OBJECTS_ERROR; 53300: 7401 moveq #1,%d2 *next_id_p = next_id; return object; final: *next_id_p = OBJECTS_ID_FINAL; 53302: 72ff moveq #-1,%d1 53304: 4280 clrl %d0 do { /* walked off end of list? */ if (_Objects_Get_index(next_id) > information->maximum) { *location_p = OBJECTS_ERROR; 53306: 2482 movel %d2,%a2@ *next_id_p = next_id; return object; final: *next_id_p = OBJECTS_ID_FINAL; 53308: 2881 movel %d1,%a4@ return 0; 5330a: 6018 bras 53324 <_Objects_Get_next+0x64> <== ALWAYS TAKEN *location_p = OBJECTS_ERROR; goto final; } /* try to grab one */ object = _Objects_Get(information, next_id, location_p); 5330c: 2f0a movel %a2,%sp@- 5330e: 2f02 movel %d2,%sp@- next_id++; 53310: 5282 addql #1,%d2 *location_p = OBJECTS_ERROR; goto final; } /* try to grab one */ object = _Objects_Get(information, next_id, location_p); 53312: 2f0b movel %a3,%sp@- 53314: 4e95 jsr %a5@ next_id++; } while (*location_p != OBJECTS_LOCAL); 53316: 4fef 000c lea %sp@(12),%sp 5331a: 4a92 tstl %a2@ 5331c: 66d4 bnes 532f2 <_Objects_Get_next+0x32> *next_id_p = next_id; 5331e: 2882 movel %d2,%a4@ return object; 53320: 6002 bras 53324 <_Objects_Get_next+0x64> <== ALWAYS TAKEN final: *next_id_p = OBJECTS_ID_FINAL; return 0; 53322: 4280 clrl %d0 } 53324: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 5332a: 4e5e unlk %fp 5332c: 4e75 rts ... 00052ff8 <_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; 52ff8: 7001 moveq #1,%d0 if ( information->maximum >= index ) { 52ffa: 4281 clrl %d1 Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 52ffc: 4e56 0000 linkw %fp,#0 53000: 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; 53004: 90a8 0006 subl %a0@(6),%d0 53008: d0ae 000c addl %fp@(12),%d0 if ( information->maximum >= index ) { 5300c: 3228 000e movew %a0@(14),%d1 Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 53010: 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 ) { 53014: b081 cmpl %d1,%d0 53016: 620e bhis 53026 <_Objects_Get_no_protection+0x2e> if ( (the_object = information->local_table[ index ]) != NULL ) { 53018: 2068 0018 moveal %a0@(24),%a0 5301c: 2030 0c00 movel %a0@(00000000,%d0:l:4),%d0 53020: 6704 beqs 53026 <_Objects_Get_no_protection+0x2e> <== ALWAYS TAKEN *location = OBJECTS_LOCAL; 53022: 4291 clrl %a1@ return the_object; 53024: 6006 bras 5302c <_Objects_Get_no_protection+0x34> <== ALWAYS TAKEN /* * This isn't supported or required yet for Global objects so * if it isn't local, we don't find it. */ *location = OBJECTS_ERROR; 53026: 7001 moveq #1,%d0 53028: 2280 movel %d0,%a1@ 5302a: 4280 clrl %d0 return NULL; } 5302c: 4e5e unlk %fp 5302e: 4e75 rts 00049eb4 <_Objects_Id_to_name>: */ Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { 49eb4: 4e56 fffc linkw %fp,#-4 49eb8: 222e 0008 movel %fp@(8),%d1 49ebc: 2f02 movel %d2,%sp@- /* * Caller is trusted for name != NULL. */ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 49ebe: 4a81 tstl %d1 49ec0: 660a bnes 49ecc <_Objects_Id_to_name+0x18> 49ec2: 2079 0006 87a6 moveal 687a6 <_Thread_Executing>,%a0 49ec8: 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); 49ecc: 7418 moveq #24,%d2 49ece: 2001 movel %d1,%d0 49ed0: e4a8 lsrl %d2,%d0 49ed2: 143c 0007 moveb #7,%d2 49ed6: c082 andl %d2,%d0 */ RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid( uint32_t the_api ) { if ( !the_api || the_api > OBJECTS_APIS_LAST ) 49ed8: 143c 0003 moveb #3,%d2 49edc: 2040 moveal %d0,%a0 49ede: 5388 subql #1,%a0 49ee0: b488 cmpl %a0,%d2 49ee2: 6540 bcss 49f24 <_Objects_Id_to_name+0x70> 49ee4: 6048 bras 49f2e <_Objects_Id_to_name+0x7a> <== ALWAYS TAKEN if ( !_Objects_Information_table[ the_api ] ) return OBJECTS_INVALID_ID; the_class = _Objects_Get_class( tmpId ); information = _Objects_Information_table[ the_api ][ the_class ]; 49ee6: 2001 movel %d1,%d0 49ee8: 741b moveq #27,%d2 49eea: e4a8 lsrl %d2,%d0 49eec: 2070 0c00 moveal %a0@(00000000,%d0:l:4),%a0 if ( !information ) 49ef0: 4a88 tstl %a0 49ef2: 6730 beqs 49f24 <_Objects_Id_to_name+0x70> <== ALWAYS TAKEN return OBJECTS_INVALID_ID; #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) 49ef4: 4a28 0032 tstb %a0@(50) 49ef8: 662a bnes 49f24 <_Objects_Id_to_name+0x70> <== ALWAYS TAKEN return OBJECTS_INVALID_ID; #endif the_object = _Objects_Get( information, tmpId, &ignored_location ); 49efa: 486e fffc pea %fp@(-4) 49efe: 2f01 movel %d1,%sp@- 49f00: 2f08 movel %a0,%sp@- 49f02: 4eb9 0004 9e54 jsr 49e54 <_Objects_Get> if ( !the_object ) 49f08: 4fef 000c lea %sp@(12),%sp 49f0c: 4a80 tstl %d0 49f0e: 6714 beqs 49f24 <_Objects_Id_to_name+0x70> return OBJECTS_INVALID_ID; *name = the_object->name; 49f10: 206e 000c moveal %fp@(12),%a0 49f14: 2240 moveal %d0,%a1 49f16: 20a9 000c movel %a1@(12),%a0@ _Thread_Enable_dispatch(); 49f1a: 4eb9 0004 a752 jsr 4a752 <_Thread_Enable_dispatch> 49f20: 4280 clrl %d0 return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; 49f22: 6002 bras 49f26 <_Objects_Id_to_name+0x72> <== ALWAYS TAKEN 49f24: 7003 moveq #3,%d0 } 49f26: 242e fff8 movel %fp@(-8),%d2 49f2a: 4e5e unlk %fp 49f2c: 4e75 rts the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; if ( !_Objects_Information_table[ the_api ] ) 49f2e: 41f9 0006 86a4 lea 686a4 <_Objects_Information_table>,%a0 49f34: 2070 0c00 moveal %a0@(00000000,%d0:l:4),%a0 49f38: 4a88 tstl %a0 49f3a: 66aa bnes 49ee6 <_Objects_Id_to_name+0x32> 49f3c: 60e6 bras 49f24 <_Objects_Id_to_name+0x70> <== ALWAYS TAKEN ... 00046554 <_Objects_Initialize_information>: information->maximum = 0; /* * Register this Object Class in the Object Information Table. */ _Objects_Information_table[ the_api ][ the_class ] = information; 46554: 41f9 0005 ce7c lea 5ce7c <_Objects_Information_table>,%a0 , bool supports_global, Objects_Thread_queue_Extract_callout extract #endif ) { 4655a: 4e56 ffec linkw %fp,#-20 4655e: 202e 000c movel %fp@(12),%d0 information->maximum = 0; /* * Register this Object Class in the Object Information Table. */ _Objects_Information_table[ the_api ][ the_class ] = information; 46562: 2270 0c00 moveal %a0@(00000000,%d0:l:4),%a1 , bool supports_global, Objects_Thread_queue_Extract_callout extract #endif ) { 46566: 48d7 007c moveml %d2-%d6,%sp@ 4656a: 222e 0014 movel %fp@(20),%d1 4656e: 4285 clrl %d5 /* * Are we operating in limited or unlimited (e.g. auto-extend) mode. */ information->auto_extend = (maximum & OBJECTS_UNLIMITED_OBJECTS) ? true : false; 46570: 2601 movel %d1,%d3 , bool supports_global, Objects_Thread_queue_Extract_callout extract #endif ) { 46572: 206e 0008 moveal %fp@(8),%a0 information->the_class = the_class; information->size = size; information->local_table = 0; information->inactive_per_block = 0; information->object_blocks = 0; information->inactive = 0; 46576: 4242 clrw %d2 , bool supports_global, Objects_Thread_queue_Extract_callout extract #endif ) { 46578: 3a2e 001a movew %fp@(26),%d5 4657c: 282e 0010 movel %fp@(16),%d4 /* * Are we operating in limited or unlimited (e.g. auto-extend) mode. */ information->auto_extend = (maximum & OBJECTS_UNLIMITED_OBJECTS) ? true : false; 46580: d683 addl %d3,%d3 46582: 9783 subxl %d3,%d3 46584: 4483 negl %d3 information->the_class = the_class; information->size = size; information->local_table = 0; information->inactive_per_block = 0; information->object_blocks = 0; information->inactive = 0; 46586: 3142 0028 movew %d2,%a0@(40) /* * Set the maximum value to 0. It will be updated when objects are * added to the inactive set from _Objects_Extend_information() */ information->maximum = 0; 4658a: 4246 clrw %d6 , bool supports_global, Objects_Thread_queue_Extract_callout extract #endif ) { 4658c: 242e 0020 movel %fp@(32),%d2 information->local_table = 0; information->inactive_per_block = 0; information->object_blocks = 0; information->inactive = 0; #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) information->is_string = is_string; 46590: 116e 001f 0032 moveb %fp@(31),%a0@(50) #if defined(RTEMS_MULTIPROCESSING) uint32_t index; #endif information->the_api = the_api; information->the_class = the_class; 46596: 3144 0004 movew %d4,%a0@(4) /* * Set the maximum value to 0. It will be updated when objects are * added to the inactive set from _Objects_Extend_information() */ information->maximum = 0; 4659a: 3146 000e movew %d6,%a0@(14) uint32_t index; #endif information->the_api = the_api; information->the_class = the_class; information->size = size; 4659e: 2145 0014 movel %d5,%a0@(20) information->maximum = 0; /* * Register this Object Class in the Object Information Table. */ _Objects_Information_table[ the_api ][ the_class ] = information; 465a2: 2388 4c00 movel %a0,%a1@(00000000,%d4:l:4) /* * Are we operating in limited or unlimited (e.g. auto-extend) mode. */ information->auto_extend = 465a6: 1143 0010 moveb %d3,%a0@(16) (maximum & OBJECTS_UNLIMITED_OBJECTS) ? true : false; maximum_per_allocation = maximum & ~OBJECTS_UNLIMITED_OBJECTS; 465aa: 0881 001f bclr #31,%d1 uint32_t maximum_per_allocation; #if defined(RTEMS_MULTIPROCESSING) uint32_t index; #endif information->the_api = the_api; 465ae: 2080 movel %d0,%a0@ information->the_class = the_class; information->size = size; information->local_table = 0; 465b0: 42a8 0018 clrl %a0@(24) information->inactive_per_block = 0; 465b4: 42a8 002a clrl %a0@(42) information->object_blocks = 0; 465b8: 42a8 002e clrl %a0@(46) maximum_per_allocation = maximum & ~OBJECTS_UNLIMITED_OBJECTS; /* * Unlimited and maximum of zero is illogical. */ if ( information->auto_extend && maximum_per_allocation == 0) { 465bc: 4a03 tstb %d3 465be: 6714 beqs 465d4 <_Objects_Initialize_information+0x80> 465c0: 4a81 tstl %d1 465c2: 6610 bnes 465d4 <_Objects_Initialize_information+0x80> _Internal_error_Occurred( 465c4: 4878 0014 pea 14 465c8: 4878 0001 pea 1 465cc: 42a7 clrl %sp@- 465ce: 4eb9 0004 5fe4 jsr 45fe4 <_Internal_error_Occurred> /* * Calculate minimum and maximum Id's */ minimum_index = (maximum_per_allocation == 0) ? 0 : 1; information->minimum_id = 465d4: 7a18 moveq #24,%d5 465d6: 4a81 tstl %d1 465d8: 56c3 sne %d3 465da: eba8 lsll %d5,%d0 465dc: 7c1b moveq #27,%d6 465de: 49c3 extbl %d3 465e0: 4483 negl %d3 /* * Calculate the maximum name length */ name_length = maximum_name_length; if ( name_length & (OBJECTS_NAME_ALIGNMENT-1) ) 465e2: 1a3c 0003 moveb #3,%d5 information->allocation_size = maximum_per_allocation; /* * Provide a null local table entry for the case of any empty table. */ information->local_table = &null_local_table; 465e6: 43f9 0005 c668 lea 5c668 ,%a1 /* * Calculate minimum and maximum Id's */ minimum_index = (maximum_per_allocation == 0) ? 0 : 1; information->minimum_id = 465ec: edac lsll %d6,%d4 465ee: 08c0 0010 bset #16,%d0 /* * Calculate the maximum name length */ name_length = maximum_name_length; if ( name_length & (OBJECTS_NAME_ALIGNMENT-1) ) 465f2: ca82 andl %d2,%d5 } /* * The allocation unit is the maximum value */ information->allocation_size = maximum_per_allocation; 465f4: 3141 0012 movew %d1,%a0@(18) /* * Provide a null local table entry for the case of any empty table. */ information->local_table = &null_local_table; 465f8: 2149 0018 movel %a1,%a0@(24) /* * Calculate minimum and maximum Id's */ minimum_index = (maximum_per_allocation == 0) ? 0 : 1; information->minimum_id = 465fc: 8084 orl %d4,%d0 465fe: 8083 orl %d3,%d0 46600: 2140 0006 movel %d0,%a0@(6) /* * Calculate the maximum name length */ name_length = maximum_name_length; if ( name_length & (OBJECTS_NAME_ALIGNMENT-1) ) 46604: 4a85 tstl %d5 46606: 6604 bnes 4660c <_Objects_Initialize_information+0xb8> 46608: 2002 movel %d2,%d0 4660a: 6008 bras 46614 <_Objects_Initialize_information+0xc0> <== ALWAYS TAKEN name_length = (name_length + OBJECTS_NAME_ALIGNMENT) & 4660c: 2002 movel %d2,%d0 4660e: 5880 addql #4,%d0 46610: 74fc moveq #-4,%d2 46612: c082 andl %d2,%d0 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 46614: 43e8 0020 lea %a0@(32),%a1 46618: 2149 001c movel %a1,%a0@(28) the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 4661c: 43e8 001c lea %a0@(28),%a1 ~(OBJECTS_NAME_ALIGNMENT-1); information->name_length = name_length; 46620: 3140 0034 movew %d0,%a0@(52) RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 46624: 42a8 0020 clrl %a0@(32) the_chain->last = _Chain_Head(the_chain); 46628: 2149 0024 movel %a1,%a0@(36) _Chain_Initialize_empty( &information->Inactive ); /* * Initialize objects .. if there are any */ if ( maximum_per_allocation ) { 4662c: 4a81 tstl %d1 4662e: 6712 beqs 46642 <_Objects_Initialize_information+0xee> /* * Always have the maximum size available so the current performance * figures are create are met. If the user moves past the maximum * number then a performance hit is taken. */ _Objects_Extend_information( information ); 46630: 2d48 0008 movel %a0,%fp@(8) _Chain_Initialize_empty( &information->global_table[ index ] ); } else information->global_table = NULL; #endif } 46634: 4cee 007c ffec moveml %fp@(-20),%d2-%d6 4663a: 4e5e unlk %fp /* * Always have the maximum size available so the current performance * figures are create are met. If the user moves past the maximum * number then a performance hit is taken. */ _Objects_Extend_information( information ); 4663c: 4ef9 0004 6154 jmp 46154 <_Objects_Extend_information> _Chain_Initialize_empty( &information->global_table[ index ] ); } else information->global_table = NULL; #endif } 46642: 4cee 007c ffec moveml %fp@(-20),%d2-%d6 46648: 4e5e unlk %fp 4664a: 4e75 rts 000505ac <_Objects_Name_to_id_string>: Objects_Name_or_id_lookup_errors _Objects_Name_to_id_string( Objects_Information *information, const char *name, Objects_Id *id ) { 505ac: 4e56 ffe4 linkw %fp,#-28 505b0: 48d7 3c1c moveml %d2-%d4/%a2-%a5,%sp@ 505b4: 266e 0008 moveal %fp@(8),%a3 505b8: 262e 000c movel %fp@(12),%d3 505bc: 286e 0010 moveal %fp@(16),%a4 uint32_t index; uint32_t name_length; /* ASSERT: information->is_string == true */ if ( !id ) 505c0: 4a8c tstl %a4 505c2: 6604 bnes 505c8 <_Objects_Name_to_id_string+0x1c> 505c4: 7002 moveq #2,%d0 505c6: 6050 bras 50618 <_Objects_Name_to_id_string+0x6c> <== ALWAYS TAKEN return OBJECTS_INVALID_ADDRESS; if ( !name ) 505c8: 4a83 tstl %d3 505ca: 674a beqs 50616 <_Objects_Name_to_id_string+0x6a> return OBJECTS_INVALID_NAME; if ( information->maximum != 0 ) { 505cc: 382b 000e movew %a3@(14),%d4 505d0: 6744 beqs 50616 <_Objects_Name_to_id_string+0x6a> 505d2: 7401 moveq #1,%d2 continue; if ( !the_object->name.name_p ) continue; if (!strncmp( name, the_object->name.name_p, information->name_length)) { 505d4: 4bf9 0005 428c lea 5428c ,%a5 return OBJECTS_INVALID_NAME; if ( information->maximum != 0 ) { name_length = information->name_length; for ( index = 1; index <= information->maximum; index++ ) { 505da: 0284 0000 ffff andil #65535,%d4 505e0: 6030 bras 50612 <_Objects_Name_to_id_string+0x66> <== ALWAYS TAKEN the_object = information->local_table[ index ]; 505e2: 206b 0018 moveal %a3@(24),%a0 505e6: 2470 2c00 moveal %a0@(00000000,%d2:l:4),%a2 return OBJECTS_INVALID_NAME; if ( information->maximum != 0 ) { name_length = information->name_length; for ( index = 1; index <= information->maximum; index++ ) { 505ea: 5282 addql #1,%d2 the_object = information->local_table[ index ]; if ( !the_object ) 505ec: 4a8a tstl %a2 505ee: 6722 beqs 50612 <_Objects_Name_to_id_string+0x66> continue; if ( !the_object->name.name_p ) 505f0: 202a 000c movel %a2@(12),%d0 505f4: 671c beqs 50612 <_Objects_Name_to_id_string+0x66> continue; if (!strncmp( name, the_object->name.name_p, information->name_length)) { 505f6: 4281 clrl %d1 505f8: 322b 0034 movew %a3@(52),%d1 505fc: 2f01 movel %d1,%sp@- 505fe: 2f00 movel %d0,%sp@- 50600: 2f03 movel %d3,%sp@- 50602: 4e95 jsr %a5@ 50604: 4fef 000c lea %sp@(12),%sp 50608: 4a80 tstl %d0 5060a: 6606 bnes 50612 <_Objects_Name_to_id_string+0x66> *id = the_object->id; 5060c: 28aa 0008 movel %a2@(8),%a4@ return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; 50610: 6006 bras 50618 <_Objects_Name_to_id_string+0x6c> <== ALWAYS TAKEN return OBJECTS_INVALID_NAME; if ( information->maximum != 0 ) { name_length = information->name_length; for ( index = 1; index <= information->maximum; index++ ) { 50612: b882 cmpl %d2,%d4 50614: 64cc bccs 505e2 <_Objects_Name_to_id_string+0x36> 50616: 7001 moveq #1,%d0 } } } return OBJECTS_INVALID_NAME; } 50618: 4cee 3c1c ffe4 moveml %fp@(-28),%d2-%d4/%a2-%a5 5061e: 4e5e unlk %fp 50620: 4e75 rts ... 0004667c <_Objects_Name_to_id_u32>: Objects_Information *information, uint32_t name, uint32_t node, Objects_Id *id ) { 4667c: 4e56 fff4 linkw %fp,#-12 46680: 226e 0008 moveal %fp@(8),%a1 46684: 48d7 040c moveml %d2-%d3/%a2,%sp@ 46688: 242e 000c movel %fp@(12),%d2 4668c: 202e 0010 movel %fp@(16),%d0 46690: 246e 0014 moveal %fp@(20),%a2 Objects_Name name_for_mp; #endif /* ASSERT: information->is_string == false */ if ( !id ) 46694: 4a8a tstl %a2 46696: 6604 bnes 4669c <_Objects_Name_to_id_u32+0x20> 46698: 7002 moveq #2,%d0 4669a: 6048 bras 466e4 <_Objects_Name_to_id_u32+0x68> <== ALWAYS TAKEN return OBJECTS_INVALID_ADDRESS; if ( name == 0 ) 4669c: 4a82 tstl %d2 4669e: 6742 beqs 466e2 <_Objects_Name_to_id_u32+0x66> return OBJECTS_INVALID_NAME; search_local_node = false; if ( information->maximum != 0 && 466a0: 3229 000e movew %a1@(14),%d1 466a4: 673c beqs 466e2 <_Objects_Name_to_id_u32+0x66> 466a6: 4a80 tstl %d0 466a8: 672c beqs 466d6 <_Objects_Name_to_id_u32+0x5a> 466aa: 0c80 7fff ffff cmpil #2147483647,%d0 466b0: 6724 beqs 466d6 <_Objects_Name_to_id_u32+0x5a> 466b2: 7601 moveq #1,%d3 466b4: b680 cmpl %d0,%d3 466b6: 662a bnes 466e2 <_Objects_Name_to_id_u32+0x66> 466b8: 601c bras 466d6 <_Objects_Name_to_id_u32+0x5a> <== ALWAYS TAKEN if ( search_local_node ) { name_length = information->name_length; for ( index = 1; index <= information->maximum; index++ ) { the_object = information->local_table[ index ]; 466ba: 2069 0018 moveal %a1@(24),%a0 466be: 2070 0c00 moveal %a0@(00000000,%d0:l:4),%a0 search_local_node = true; if ( search_local_node ) { name_length = information->name_length; for ( index = 1; index <= information->maximum; index++ ) { 466c2: 5280 addql #1,%d0 the_object = information->local_table[ index ]; if ( !the_object ) 466c4: 4a88 tstl %a0 466c6: 6716 beqs 466de <_Objects_Name_to_id_u32+0x62> continue; if ( name == the_object->name.name_u32 ) { 466c8: b4a8 000c cmpl %a0@(12),%d2 466cc: 6610 bnes 466de <_Objects_Name_to_id_u32+0x62> *id = the_object->id; 466ce: 24a8 0008 movel %a0@(8),%a2@ 466d2: 4280 clrl %d0 return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; 466d4: 600e bras 466e4 <_Objects_Name_to_id_u32+0x68> <== ALWAYS TAKEN search_local_node = true; if ( search_local_node ) { name_length = information->name_length; for ( index = 1; index <= information->maximum; index++ ) { 466d6: 7001 moveq #1,%d0 466d8: 0281 0000 ffff andil #65535,%d1 466de: b280 cmpl %d0,%d1 466e0: 64d8 bccs 466ba <_Objects_Name_to_id_u32+0x3e> 466e2: 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 } 466e4: 4cd7 040c moveml %sp@,%d2-%d3/%a2 466e8: 4e5e unlk %fp 466ea: 4e75 rts 00046a50 <_Objects_Set_name>: { size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 46a50: 4280 clrl %d0 bool _Objects_Set_name( Objects_Information *information, Objects_Control *the_object, const char *name ) { 46a52: 4e56 ffe0 linkw %fp,#-32 46a56: 48d7 3c3c moveml %d2-%d5/%a2-%a5,%sp@ 46a5a: 2a6e 0008 moveal %fp@(8),%a5 size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 46a5e: 302d 0034 movew %a5@(52),%d0 bool _Objects_Set_name( Objects_Information *information, Objects_Control *the_object, const char *name ) { 46a62: 246e 0010 moveal %fp@(16),%a2 size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 46a66: 2f00 movel %d0,%sp@- bool _Objects_Set_name( Objects_Information *information, Objects_Control *the_object, const char *name ) { 46a68: 286e 000c moveal %fp@(12),%a4 size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 46a6c: 2f0a movel %a2,%sp@- 46a6e: 4eb9 0004 e784 jsr 4e784 #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) { 46a74: 508f addql #8,%sp { size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 46a76: 2640 moveal %d0,%a3 #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) { 46a78: 4a2d 0032 tstb %a5@(50) 46a7c: 6748 beqs 46ac6 <_Objects_Set_name+0x76> char *d; d = _Workspace_Allocate( length + 1 ); 46a7e: 486b 0001 pea %a3@(1) 46a82: 4eb9 0004 82d4 jsr 482d4 <_Workspace_Allocate> if ( !d ) 46a88: 588f addql #4,%sp #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) { char *d; d = _Workspace_Allocate( length + 1 ); 46a8a: 2a40 moveal %d0,%a5 if ( !d ) 46a8c: 4a80 tstl %d0 46a8e: 6604 bnes 46a94 <_Objects_Set_name+0x44> <== NEVER TAKEN 46a90: 4200 clrb %d0 <== NOT EXECUTED 46a92: 6076 bras 46b0a <_Objects_Set_name+0xba> <== NOT EXECUTED return false; if ( the_object->name.name_p ) { 46a94: 202c 000c movel %a4@(12),%d0 46a98: 670e beqs 46aa8 <_Objects_Set_name+0x58> _Workspace_Free( (void *)the_object->name.name_p ); 46a9a: 2f00 movel %d0,%sp@- 46a9c: 4eb9 0004 82f0 jsr 482f0 <_Workspace_Free> the_object->name.name_p = NULL; 46aa2: 588f addql #4,%sp 46aa4: 42ac 000c clrl %a4@(12) } strncpy( d, name, length ); 46aa8: 2f0b movel %a3,%sp@- 46aaa: 2f0a movel %a2,%sp@- 46aac: 2f0d movel %a5,%sp@- 46aae: 4eb9 0004 e6fc jsr 4e6fc d[length] = '\0'; the_object->name.name_p = d; 46ab4: 4fef 000c lea %sp@(12),%sp _Workspace_Free( (void *)the_object->name.name_p ); the_object->name.name_p = NULL; } strncpy( d, name, length ); d[length] = '\0'; 46ab8: 4200 clrb %d0 46aba: 1b80 b800 moveb %d0,%a5@(00000000,%a3:l) the_object->name.name_p = d; 46abe: 7001 moveq #1,%d0 46ac0: 294d 000c movel %a5,%a4@(12) 46ac4: 6044 bras 46b0a <_Objects_Set_name+0xba> <== ALWAYS TAKEN } else #endif { the_object->name.name_u32 = _Objects_Build_name( 46ac6: 7201 moveq #1,%d1 46ac8: 1012 moveb %a2@,%d0 46aca: b28b cmpl %a3,%d1 46acc: 6446 bccs 46b14 <_Objects_Set_name+0xc4> 46ace: 7602 moveq #2,%d3 46ad0: 142a 0001 moveb %a2@(1),%d2 46ad4: 49c2 extbl %d2 46ad6: 4842 swap %d2 46ad8: 4242 clrw %d2 46ada: b68b cmpl %a3,%d3 46adc: 643a bccs 46b18 <_Objects_Set_name+0xc8> 46ade: 7a03 moveq #3,%d5 46ae0: 122a 0002 moveb %a2@(2),%d1 46ae4: 49c1 extbl %d1 46ae6: e189 lsll #8,%d1 46ae8: ba8b cmpl %a3,%d5 46aea: 6506 bcss 46af2 <_Objects_Set_name+0xa2> 46aec: 163c 0020 moveb #32,%d3 46af0: 6006 bras 46af8 <_Objects_Set_name+0xa8> <== ALWAYS TAKEN 46af2: 162a 0003 moveb %a2@(3),%d3 46af6: 49c3 extbl %d3 46af8: 2800 movel %d0,%d4 46afa: 7a18 moveq #24,%d5 46afc: ebac lsll %d5,%d4 46afe: 7001 moveq #1,%d0 46b00: 8484 orl %d4,%d2 46b02: 8481 orl %d1,%d2 46b04: 8483 orl %d3,%d2 46b06: 2942 000c movel %d2,%a4@(12) ); } return true; } 46b0a: 4cee 3c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a5 46b10: 4e5e unlk %fp 46b12: 4e75 rts d[length] = '\0'; the_object->name.name_p = d; } else #endif { the_object->name.name_u32 = _Objects_Build_name( 46b14: 7420 moveq #32,%d2 46b16: 4842 swap %d2 46b18: 223c 0000 2000 movel #8192,%d1 46b1e: 7620 moveq #32,%d3 46b20: 60d6 bras 46af8 <_Objects_Set_name+0xa8> <== ALWAYS TAKEN ... 000466ec <_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) / 466ec: 4280 clrl %d0 466ee: 4281 clrl %d1 */ void _Objects_Shrink_information( Objects_Information *information ) { 466f0: 4e56 ffec linkw %fp,#-20 466f4: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 466f8: 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 ); 466fc: 4283 clrl %d3 block_count = (information->maximum - index_base) / 466fe: 4284 clrl %d4 /* * Search the list to find block or chunk with all objects inactive. */ index_base = _Objects_Get_index( information->minimum_id ); 46700: 362a 0008 movew %a2@(8),%d3 block_count = (information->maximum - index_base) / 46704: 302a 000e movew %a2@(14),%d0 46708: 322a 0012 movew %a2@(18),%d1 4670c: 9083 subl %d3,%d0 4670e: 4c41 0000 remul %d1,%d0,%d0 information->allocation_size; for ( block = 0; block < block_count; block++ ) { 46712: 6070 bras 46784 <_Objects_Shrink_information+0x98> <== ALWAYS TAKEN 46714: 2404 movel %d4,%d2 46716: 5284 addql #1,%d4 46718: e58a lsll #2,%d2 if ( information->inactive_per_block[ block ] == 4671a: 206a 002a moveal %a2@(42),%a0 4671e: b2b0 2800 cmpl %a0@(00000000,%d2:l),%d1 46722: 665e bnes 46782 <_Objects_Shrink_information+0x96> information->allocation_size ) { /* * Assume the Inactive chain is never empty at this point */ the_object = (Objects_Control *) information->Inactive.first; 46724: 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 ); 46728: 47f9 0004 a12c lea 4a12c <_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 ); 4672e: 4280 clrl %d0 46730: 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; 46734: 2810 movel %a0@,%d4 if ((index >= index_base) && 46736: b680 cmpl %d0,%d3 46738: 6212 bhis 4674c <_Objects_Shrink_information+0x60> (index < (index_base + information->allocation_size))) { 4673a: 4281 clrl %d1 4673c: 322a 0012 movew %a2@(18),%d1 46740: d283 addl %d3,%d1 46742: b280 cmpl %d0,%d1 46744: 6306 blss 4674c <_Objects_Shrink_information+0x60> _Chain_Extract( &extract_me->Node ); 46746: 2f08 movel %a0,%sp@- 46748: 4e93 jsr %a3@ 4674a: 588f addql #4,%sp } } while ( the_object ); 4674c: 2044 moveal %d4,%a0 4674e: 4a84 tstl %d4 46750: 66dc bnes 4672e <_Objects_Shrink_information+0x42> /* * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); 46752: 206a 002e moveal %a2@(46),%a0 46756: 2f30 2800 movel %a0@(00000000,%d2:l),%sp@- 4675a: 4eb9 0004 7eb8 jsr 47eb8 <_Workspace_Free> information->object_blocks[ block ] = NULL; 46760: 206a 002e moveal %a2@(46),%a0 information->inactive_per_block[ block ] = 0; information->inactive -= information->allocation_size; return; 46764: 588f addql #4,%sp * Free the memory and reset the structures in the object' information */ _Workspace_Free( information->object_blocks[ block ] ); information->object_blocks[ block ] = NULL; information->inactive_per_block[ block ] = 0; 46766: 226a 002a moveal %a2@(42),%a1 information->inactive -= information->allocation_size; 4676a: 302a 0028 movew %a2@(40),%d0 4676e: 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; 46772: 42b1 2800 clrl %a1@(00000000,%d2:l) information->inactive -= information->allocation_size; 46776: 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; 46778: 42b0 2800 clrl %a0@(00000000,%d2:l) information->inactive_per_block[ block ] = 0; information->inactive -= information->allocation_size; 4677c: 3540 0028 movew %d0,%a2@(40) return; 46780: 6006 bras 46788 <_Objects_Shrink_information+0x9c> <== ALWAYS TAKEN } index_base += information->allocation_size; 46782: d681 addl %d1,%d3 index_base = _Objects_Get_index( information->minimum_id ); block_count = (information->maximum - index_base) / information->allocation_size; for ( block = 0; block < block_count; block++ ) { 46784: b084 cmpl %d4,%d0 46786: 628c bhis 46714 <_Objects_Shrink_information+0x28> return; } index_base += information->allocation_size; } } 46788: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 4678e: 4e5e unlk %fp 46790: 4e75 rts ... 00046de0 <_POSIX_Absolute_timeout_to_ticks>: */ POSIX_Absolute_timeout_conversion_results_t _POSIX_Absolute_timeout_to_ticks( const struct timespec *abstime, Watchdog_Interval *ticks_out ) { 46de0: 4e56 ffe0 linkw %fp,#-32 46de4: 48d7 041c moveml %d2-%d4/%a2,%sp@ 46de8: 262e 0008 movel %fp@(8),%d3 46dec: 246e 000c moveal %fp@(12),%a2 *ticks_out = 0; /* * Is the absolute time even valid? */ if ( !_Timespec_Is_valid(abstime) ) 46df0: 2f03 movel %d3,%sp@- /* * Make sure there is always a value returned. */ *ticks_out = 0; 46df2: 4292 clrl %a2@ /* * Is the absolute time even valid? */ if ( !_Timespec_Is_valid(abstime) ) 46df4: 4eb9 0004 a65c jsr 4a65c <_Timespec_Is_valid> 46dfa: 588f addql #4,%sp 46dfc: 4a00 tstb %d0 46dfe: 6604 bnes 46e04 <_POSIX_Absolute_timeout_to_ticks+0x24> 46e00: 4280 clrl %d0 46e02: 604e bras 46e52 <_POSIX_Absolute_timeout_to_ticks+0x72> <== ALWAYS TAKEN return POSIX_ABSOLUTE_TIMEOUT_INVALID; /* * Is the absolute time in the past? */ _TOD_Get( ¤t_time ); 46e04: 240e movel %fp,%d2 46e06: 5182 subql #8,%d2 46e08: 2f02 movel %d2,%sp@- 46e0a: 4eb9 0004 88bc jsr 488bc <_TOD_Get> if ( _Timespec_Less_than( abstime, ¤t_time ) ) 46e10: 2f02 movel %d2,%sp@- 46e12: 2f03 movel %d3,%sp@- 46e14: 4eb9 0004 a684 jsr 4a684 <_Timespec_Less_than> 46e1a: 4fef 000c lea %sp@(12),%sp 46e1e: 4a00 tstb %d0 46e20: 6704 beqs 46e26 <_POSIX_Absolute_timeout_to_ticks+0x46> 46e22: 7001 moveq #1,%d0 46e24: 602c bras 46e52 <_POSIX_Absolute_timeout_to_ticks+0x72> <== ALWAYS TAKEN return POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST; /* * How long until the requested absolute time? */ _Timespec_Subtract( ¤t_time, abstime, &difference ); 46e26: 280e movel %fp,%d4 46e28: 0684 ffff fff0 addil #-16,%d4 46e2e: 2f04 movel %d4,%sp@- 46e30: 2f03 movel %d3,%sp@- 46e32: 2f02 movel %d2,%sp@- 46e34: 4eb9 0004 a6b4 jsr 4a6b4 <_Timespec_Subtract> /* * Internally the SuperCore uses ticks, so convert to them. */ *ticks_out = _Timespec_To_ticks( &difference ); 46e3a: 2f04 movel %d4,%sp@- 46e3c: 4eb9 0004 a6fc jsr 4a6fc <_Timespec_To_ticks> /* * If the difference was 0, then the future is now. It is so bright * we better wear shades. */ if ( !*ticks_out ) 46e42: 4fef 0010 lea %sp@(16),%sp 46e46: 4a80 tstl %d0 46e48: 57c1 seq %d1 _Timespec_Subtract( ¤t_time, abstime, &difference ); /* * Internally the SuperCore uses ticks, so convert to them. */ *ticks_out = _Timespec_To_ticks( &difference ); 46e4a: 2480 movel %d0,%a2@ /* * If the difference was 0, then the future is now. It is so bright * we better wear shades. */ if ( !*ticks_out ) 46e4c: 1001 moveb %d1,%d0 46e4e: 49c0 extbl %d0 46e50: 5680 addql #3,%d0 /* * This is the case we were expecting and it took this long to * get here. */ return POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE; } 46e52: 4cee 041c ffe0 moveml %fp@(-32),%d2-%d4/%a2 46e58: 4e5e unlk %fp 46e5a: 4e75 rts 000459ec <_POSIX_Condition_variables_Get>: POSIX_Condition_variables_Control *_POSIX_Condition_variables_Get ( pthread_cond_t *cond, Objects_Locations *location ) { 459ec: 4e56 0000 linkw %fp,#0 459f0: 2f0b movel %a3,%sp@- 459f2: 266e 000c moveal %fp@(12),%a3 459f6: 2f0a movel %a2,%sp@- 459f8: 246e 0008 moveal %fp@(8),%a2 int status; if ( !cond ) { 459fc: 4a8a tstl %a2 459fe: 6716 beqs 45a16 <_POSIX_Condition_variables_Get+0x2a> *location = OBJECTS_ERROR; return (POSIX_Condition_variables_Control *) 0; } if ( *cond == PTHREAD_COND_INITIALIZER ) { 45a00: 70ff moveq #-1,%d0 45a02: b092 cmpl %a2@,%d0 45a04: 6618 bnes 45a1e <_POSIX_Condition_variables_Get+0x32> /* * Do an "auto-create" here. */ status = pthread_cond_init( cond, 0 ); 45a06: 42a7 clrl %sp@- 45a08: 2f0a movel %a2,%sp@- 45a0a: 4eb9 0004 5a40 jsr 45a40 if ( status ) { 45a10: 508f addql #8,%sp 45a12: 4a80 tstl %d0 45a14: 6708 beqs 45a1e <_POSIX_Condition_variables_Get+0x32> *location = OBJECTS_ERROR; 45a16: 7001 moveq #1,%d0 45a18: 2680 movel %d0,%a3@ 45a1a: 4280 clrl %d0 return (POSIX_Condition_variables_Control *) 0; 45a1c: 6014 bras 45a32 <_POSIX_Condition_variables_Get+0x46> <== ALWAYS TAKEN } /* * Now call Objects_Get() */ return (POSIX_Condition_variables_Control *)_Objects_Get( 45a1e: 2f0b movel %a3,%sp@- 45a20: 2f12 movel %a2@,%sp@- 45a22: 4879 0005 f792 pea 5f792 <_POSIX_Condition_variables_Information> 45a28: 4eb9 0004 8210 jsr 48210 <_Objects_Get> 45a2e: 4fef 000c lea %sp@(12),%sp &_POSIX_Condition_variables_Information, (Objects_Id) *cond, location ); } 45a32: 246e fff8 moveal %fp@(-8),%a2 45a36: 266e fffc moveal %fp@(-4),%a3 45a3a: 4e5e unlk %fp 45a3c: 4e75 rts ... 00045af8 <_POSIX_Condition_variables_Signal_support>: int _POSIX_Condition_variables_Signal_support( pthread_cond_t *cond, bool is_broadcast ) { 45af8: 4e56 ffec linkw %fp,#-20 45afc: 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 ); 45b00: 486e fffc pea %fp@(-4) 45b04: 2f2e 0008 movel %fp@(8),%sp@- int _POSIX_Condition_variables_Signal_support( pthread_cond_t *cond, bool is_broadcast ) { 45b08: 162e 000f moveb %fp@(15),%d3 register POSIX_Condition_variables_Control *the_cond; Objects_Locations location; Thread_Control *the_thread; the_cond = _POSIX_Condition_variables_Get( cond, &location ); 45b0c: 4eb9 0004 59ec jsr 459ec <_POSIX_Condition_variables_Get> switch ( location ) { 45b12: 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 ); 45b14: 2440 moveal %d0,%a2 switch ( location ) { 45b16: 4aae fffc tstl %fp@(-4) 45b1a: 6704 beqs 45b20 <_POSIX_Condition_variables_Signal_support+0x28> 45b1c: 7016 moveq #22,%d0 45b1e: 602c bras 45b4c <_POSIX_Condition_variables_Signal_support+0x54> <== ALWAYS TAKEN case OBJECTS_LOCAL: do { the_thread = _Thread_queue_Dequeue( &the_cond->Wait_queue ); 45b20: 2400 movel %d0,%d2 45b22: 0682 0000 0018 addil #24,%d2 45b28: 47f9 0004 8ce4 lea 48ce4 <_Thread_queue_Dequeue>,%a3 45b2e: 2f02 movel %d2,%sp@- 45b30: 4e93 jsr %a3@ if ( !the_thread ) 45b32: 588f addql #4,%sp 45b34: 4a80 tstl %d0 45b36: 6604 bnes 45b3c <_POSIX_Condition_variables_Signal_support+0x44> the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX; 45b38: 42aa 0014 clrl %a2@(20) } while ( is_broadcast && the_thread ); 45b3c: 4a03 tstb %d3 45b3e: 6704 beqs 45b44 <_POSIX_Condition_variables_Signal_support+0x4c> 45b40: 4a80 tstl %d0 45b42: 66ea bnes 45b2e <_POSIX_Condition_variables_Signal_support+0x36> _Thread_Enable_dispatch(); 45b44: 4eb9 0004 899a jsr 4899a <_Thread_Enable_dispatch> 45b4a: 4280 clrl %d0 case OBJECTS_ERROR: break; } return EINVAL; } 45b4c: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3 45b52: 4e5e unlk %fp 45b54: 4e75 rts ... 00045bbc <_POSIX_Condition_variables_Wait_support>: pthread_cond_t *cond, pthread_mutex_t *mutex, Watchdog_Interval timeout, bool already_timedout ) { 45bbc: 4e56 ffe4 linkw %fp,#-28 45bc0: 48d7 3c0c moveml %d2-%d3/%a2-%a5,%sp@ register POSIX_Condition_variables_Control *the_cond; Objects_Locations location; int status; int mutex_status; if ( !_POSIX_Mutex_Get( mutex, &location ) ) { 45bc4: 240e movel %fp,%d2 45bc6: 5982 subql #4,%d2 pthread_cond_t *cond, pthread_mutex_t *mutex, Watchdog_Interval timeout, bool already_timedout ) { 45bc8: 246e 000c moveal %fp@(12),%a2 register POSIX_Condition_variables_Control *the_cond; Objects_Locations location; int status; int mutex_status; if ( !_POSIX_Mutex_Get( mutex, &location ) ) { 45bcc: 2f02 movel %d2,%sp@- pthread_cond_t *cond, pthread_mutex_t *mutex, Watchdog_Interval timeout, bool already_timedout ) { 45bce: 2a6e 0008 moveal %fp@(8),%a5 register POSIX_Condition_variables_Control *the_cond; Objects_Locations location; int status; int mutex_status; if ( !_POSIX_Mutex_Get( mutex, &location ) ) { 45bd2: 2f0a movel %a2,%sp@- pthread_cond_t *cond, pthread_mutex_t *mutex, Watchdog_Interval timeout, bool already_timedout ) { 45bd4: 162e 0017 moveb %fp@(23),%d3 register POSIX_Condition_variables_Control *the_cond; Objects_Locations location; int status; int mutex_status; if ( !_POSIX_Mutex_Get( mutex, &location ) ) { 45bd8: 4eb9 0004 5d6e jsr 45d6e <_POSIX_Mutex_Get> 45bde: 508f addql #8,%sp 45be0: 4a80 tstl %d0 45be2: 6700 00ae beqw 45c92 <_POSIX_Condition_variables_Wait_support+0xd6> <== ALWAYS TAKEN */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 45be6: 2039 0005 f3c4 movel 5f3c4 <_Thread_Dispatch_disable_level>,%d0 45bec: 5380 subql #1,%d0 return EINVAL; } _Thread_Unnest_dispatch(); the_cond = _POSIX_Condition_variables_Get( cond, &location ); 45bee: 2f02 movel %d2,%sp@- 45bf0: 23c0 0005 f3c4 movel %d0,5f3c4 <_Thread_Dispatch_disable_level> 45bf6: 2f0d movel %a5,%sp@- 45bf8: 4eb9 0004 59ec jsr 459ec <_POSIX_Condition_variables_Get> switch ( location ) { 45bfe: 508f addql #8,%sp return EINVAL; } _Thread_Unnest_dispatch(); the_cond = _POSIX_Condition_variables_Get( cond, &location ); 45c00: 2640 moveal %d0,%a3 switch ( location ) { 45c02: 4aae fffc tstl %fp@(-4) 45c06: 6600 008a bnew 45c92 <_POSIX_Condition_variables_Wait_support+0xd6> case OBJECTS_LOCAL: if ( the_cond->Mutex && ( the_cond->Mutex != *mutex ) ) { 45c0a: 202b 0014 movel %a3@(20),%d0 45c0e: 670c beqs 45c1c <_POSIX_Condition_variables_Wait_support+0x60> 45c10: b092 cmpl %a2@,%d0 45c12: 6708 beqs 45c1c <_POSIX_Condition_variables_Wait_support+0x60> _Thread_Enable_dispatch(); 45c14: 4eb9 0004 899a jsr 4899a <_Thread_Enable_dispatch> 45c1a: 6076 bras 45c92 <_POSIX_Condition_variables_Wait_support+0xd6> <== ALWAYS TAKEN return EINVAL; } (void) pthread_mutex_unlock( mutex ); 45c1c: 2f0a movel %a2,%sp@- 45c1e: 49f9 0004 899a lea 4899a <_Thread_Enable_dispatch>,%a4 45c24: 4eb9 0004 5f74 jsr 45f74 _Thread_Enable_dispatch(); return EINVAL; } */ if ( !already_timedout ) { 45c2a: 588f addql #4,%sp 45c2c: 4a03 tstb %d3 45c2e: 6650 bnes 45c80 <_POSIX_Condition_variables_Wait_support+0xc4> the_cond->Mutex = *mutex; 45c30: 2752 0014 movel %a2@,%a3@(20) _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); _Thread_Executing->Wait.return_code = 0; _Thread_Executing->Wait.queue = &the_cond->Wait_queue; 45c34: 200b movel %a3,%d0 45c36: 0680 0000 0018 addil #24,%d0 RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section ( Thread_queue_Control *the_thread_queue ) { the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 45c3c: 7201 moveq #1,%d1 if ( !already_timedout ) { the_cond->Mutex = *mutex; _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); _Thread_Executing->Wait.return_code = 0; 45c3e: 2079 0005 f47e moveal 5f47e <_Thread_Executing>,%a0 45c44: 42a8 0034 clrl %a0@(52) _Thread_Executing->Wait.queue = &the_cond->Wait_queue; _Thread_Executing->Wait.id = *cond; 45c48: 2155 0020 movel %a5@,%a0@(32) if ( !already_timedout ) { the_cond->Mutex = *mutex; _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); _Thread_Executing->Wait.return_code = 0; _Thread_Executing->Wait.queue = &the_cond->Wait_queue; 45c4c: 2140 0044 movel %d0,%a0@(68) 45c50: 2741 0048 movel %d1,%a3@(72) _Thread_Executing->Wait.id = *cond; _Thread_queue_Enqueue( &the_cond->Wait_queue, timeout ); 45c54: 4879 0004 9168 pea 49168 <_Thread_queue_Timeout> 45c5a: 2f2e 0010 movel %fp@(16),%sp@- 45c5e: 2f00 movel %d0,%sp@- 45c60: 4eb9 0004 8e24 jsr 48e24 <_Thread_queue_Enqueue_with_handler> _Thread_Enable_dispatch(); 45c66: 4e94 jsr %a4@ /* * Switch ourself out because we blocked as a result of the * _Thread_queue_Enqueue. */ status = _Thread_Executing->Wait.return_code; 45c68: 2079 0005 f47e moveal 5f47e <_Thread_Executing>,%a0 if ( status && status != ETIMEDOUT ) 45c6e: 4fef 000c lea %sp@(12),%sp /* * Switch ourself out because we blocked as a result of the * _Thread_queue_Enqueue. */ status = _Thread_Executing->Wait.return_code; 45c72: 2428 0034 movel %a0@(52),%d2 if ( status && status != ETIMEDOUT ) 45c76: 670c beqs 45c84 <_POSIX_Condition_variables_Wait_support+0xc8> 45c78: 7074 moveq #116,%d0 45c7a: b082 cmpl %d2,%d0 45c7c: 6616 bnes 45c94 <_POSIX_Condition_variables_Wait_support+0xd8> <== ALWAYS TAKEN 45c7e: 6004 bras 45c84 <_POSIX_Condition_variables_Wait_support+0xc8> <== ALWAYS TAKEN return status; } else { _Thread_Enable_dispatch(); 45c80: 4e94 jsr %a4@ 45c82: 7474 moveq #116,%d2 /* * When we get here the dispatch disable level is 0. */ mutex_status = pthread_mutex_lock( mutex ); 45c84: 2f0a movel %a2,%sp@- 45c86: 4eb9 0004 5edc jsr 45edc if ( mutex_status ) 45c8c: 588f addql #4,%sp 45c8e: 4a80 tstl %d0 45c90: 6702 beqs 45c94 <_POSIX_Condition_variables_Wait_support+0xd8> 45c92: 7416 moveq #22,%d2 case OBJECTS_ERROR: break; } return EINVAL; } 45c94: 2002 movel %d2,%d0 45c96: 4cee 3c0c ffe4 moveml %fp@(-28),%d2-%d3/%a2-%a5 45c9c: 4e5e unlk %fp 45c9e: 4e75 rts 0004b9d0 <_POSIX_Keys_Run_destructors>: */ RTEMS_INLINE_ROUTINE Objects_APIs _Objects_Get_API( Objects_Id id ) { return (Objects_APIs) ((id >> OBJECTS_API_START_BIT) & OBJECTS_API_VALID_BITS); 4b9d0: 7218 moveq #24,%d1 */ void _POSIX_Keys_Run_destructors( Thread_Control *thread ) { 4b9d2: 4e56 ffe8 linkw %fp,#-24 uint32_t iterations; bool are_all_null; POSIX_Keys_Control *the_key; void *value; thread_index = _Objects_Get_index( thread->Object.id ); 4b9d6: 206e 0008 moveal %fp@(8),%a0 */ void _POSIX_Keys_Run_destructors( Thread_Control *thread ) { 4b9da: 48d7 047c moveml %d2-%d6/%a2,%sp@ uint32_t iterations; bool are_all_null; POSIX_Keys_Control *the_key; void *value; thread_index = _Objects_Get_index( thread->Object.id ); 4b9de: 2428 0008 movel %a0@(8),%d2 4b9e2: 2002 movel %d2,%d0 4b9e4: e2a8 lsrl %d1,%d0 4b9e6: 123c 0007 moveb #7,%d1 if ( !the_key ) continue; if ( !the_key->destructor ) continue; value = the_key->Values[ thread_api ][ thread_index ]; 4b9ea: 4284 clrl %d4 4b9ec: 0282 0000 ffff andil #65535,%d2 4b9f2: c081 andl %d1,%d0 4b9f4: e58a lsll #2,%d2 4b9f6: 2c00 movel %d0,%d6 4b9f8: 5a86 addql #5,%d6 4b9fa: 7601 moveq #1,%d3 4b9fc: 7a01 moveq #1,%d5 for ( ; ; ) { are_all_null = true; for ( index=1 ; index <= _POSIX_Keys_Information.maximum ; index++ ) { 4b9fe: 6034 bras 4ba34 <_POSIX_Keys_Run_destructors+0x64> <== ALWAYS TAKEN the_key = (POSIX_Keys_Control *) 4ba00: 2079 0005 d270 moveal 5d270 <_POSIX_Keys_Information+0x18>,%a0 4ba06: 2470 3c00 moveal %a0@(00000000,%d3:l:4),%a2 for ( ; ; ) { are_all_null = true; for ( index=1 ; index <= _POSIX_Keys_Information.maximum ; index++ ) { 4ba0a: 5283 addql #1,%d3 the_key = (POSIX_Keys_Control *) _POSIX_Keys_Information.local_table[ index ]; if ( !the_key ) 4ba0c: 4a8a tstl %a2 4ba0e: 6724 beqs 4ba34 <_POSIX_Keys_Run_destructors+0x64> continue; if ( !the_key->destructor ) 4ba10: 206a 0010 moveal %a2@(16),%a0 4ba14: 4a88 tstl %a0 4ba16: 671c beqs 4ba34 <_POSIX_Keys_Run_destructors+0x64> continue; value = the_key->Values[ thread_api ][ thread_index ]; 4ba18: 2272 6c00 moveal %a2@(00000000,%d6:l:4),%a1 4ba1c: 2031 2800 movel %a1@(00000000,%d2:l),%d0 if ( value ) { 4ba20: 6712 beqs 4ba34 <_POSIX_Keys_Run_destructors+0x64> (*the_key->destructor)( value ); 4ba22: 2f00 movel %d0,%sp@- 4ba24: 4e90 jsr %a0@ if ( the_key->Values[ thread_api ][ thread_index ] ) 4ba26: 588f addql #4,%sp 4ba28: 2072 6c00 moveal %a2@(00000000,%d6:l:4),%a0 4ba2c: 4ab0 2800 tstl %a0@(00000000,%d2:l) 4ba30: 57c0 seq %d0 4ba32: ca80 andl %d0,%d5 for ( ; ; ) { are_all_null = true; for ( index=1 ; index <= _POSIX_Keys_Information.maximum ; index++ ) { 4ba34: 4280 clrl %d0 4ba36: 3039 0005 d266 movew 5d266 <_POSIX_Keys_Information+0xe>,%d0 4ba3c: b083 cmpl %d3,%d0 4ba3e: 64c0 bccs 4ba00 <_POSIX_Keys_Run_destructors+0x30> if ( the_key->Values[ thread_api ][ thread_index ] ) are_all_null = false; } } if ( are_all_null == true ) 4ba40: 4a05 tstb %d5 4ba42: 6608 bnes 4ba4c <_POSIX_Keys_Run_destructors+0x7c> return; iterations++; 4ba44: 5284 addql #1,%d4 * loop. It seems rude to unnecessarily lock up a system. * * Reference: 17.1.1.2 P1003.1c/Draft 10, p. 163, line 99. */ if ( iterations >= PTHREAD_DESTRUCTOR_ITERATIONS ) 4ba46: 7004 moveq #4,%d0 4ba48: b084 cmpl %d4,%d0 4ba4a: 66ae bnes 4b9fa <_POSIX_Keys_Run_destructors+0x2a> return; } } 4ba4c: 4cee 047c ffe8 moveml %fp@(-24),%d2-%d6/%a2 4ba52: 4e5e unlk %fp 4ba54: 4e75 rts ... 0004f1a8 <_POSIX_Message_queue_Create_support>: const char *name_arg, int pshared, struct mq_attr *attr_ptr, POSIX_Message_queue_Control **message_queue ) { 4f1a8: 4e56 ffd8 linkw %fp,#-40 4f1ac: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@ CORE_message_queue_Attributes *the_mq_attr; struct mq_attr attr; char *name; size_t n; n = strnlen( name_arg, NAME_MAX ); 4f1b0: 4878 00ff pea ff const char *name_arg, int pshared, struct mq_attr *attr_ptr, POSIX_Message_queue_Control **message_queue ) { 4f1b4: 2a2e 0008 movel %fp@(8),%d5 4f1b8: 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 ); 4f1bc: 2f05 movel %d5,%sp@- 4f1be: 4eb9 0005 43dc jsr 543dc 4f1c4: 2640 moveal %d0,%a3 4f1c6: 2039 0006 4bd0 movel 64bd0 <_Thread_Dispatch_disable_level>,%d0 4f1cc: 5280 addql #1,%d0 4f1ce: 23c0 0006 4bd0 movel %d0,64bd0 <_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 ) { 4f1d4: 508f addql #8,%sp 4f1d6: 4a8a tstl %a2 4f1d8: 6606 bnes 4f1e0 <_POSIX_Message_queue_Create_support+0x38> 4f1da: 760a moveq #10,%d3 4f1dc: 7810 moveq #16,%d4 4f1de: 6040 bras 4f220 <_POSIX_Message_queue_Create_support+0x78> <== ALWAYS TAKEN attr.mq_maxmsg = 10; attr.mq_msgsize = 16; } else { if ( attr_ptr->mq_maxmsg <= 0 ){ 4f1e0: 4aaa 0004 tstl %a2@(4) 4f1e4: 6f06 bles 4f1ec <_POSIX_Message_queue_Create_support+0x44> _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EINVAL ); } if ( attr_ptr->mq_msgsize <= 0 ){ 4f1e6: 4aaa 0008 tstl %a2@(8) 4f1ea: 6e18 bgts 4f204 <_POSIX_Message_queue_Create_support+0x5c> _Thread_Enable_dispatch(); 4f1ec: 4eb9 0004 c7aa jsr 4c7aa <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EINVAL ); 4f1f2: 7816 moveq #22,%d4 4f1f4: 4eb9 0005 2870 jsr 52870 <__errno> 4f1fa: 72ff moveq #-1,%d1 4f1fc: 2040 moveal %d0,%a0 4f1fe: 2084 movel %d4,%a0@ 4f200: 6000 010e braw 4f310 <_POSIX_Message_queue_Create_support+0x168> <== ALWAYS TAKEN } attr = *attr_ptr; 4f204: 4878 0010 pea 10 4f208: 2f0a movel %a2,%sp@- 4f20a: 486e fff0 pea %fp@(-16) 4f20e: 4eb9 0005 30a8 jsr 530a8 4f214: 262e fff4 movel %fp@(-12),%d3 4f218: 4fef 000c lea %sp@(12),%sp 4f21c: 282e fff8 movel %fp@(-8),%d4 */ RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Allocate( void ) { return (POSIX_Message_queue_Control *) 4f220: 4879 0006 4e9e pea 64e9e <_POSIX_Message_queue_Information> 4f226: 4eb9 0004 bb0c jsr 4bb0c <_Objects_Allocate> } the_mq = _POSIX_Message_queue_Allocate(); if ( !the_mq ) { 4f22c: 588f addql #4,%sp 4f22e: 2440 moveal %d0,%a2 4f230: 4a80 tstl %d0 4f232: 6618 bnes 4f24c <_POSIX_Message_queue_Create_support+0xa4> _Thread_Enable_dispatch(); 4f234: 4eb9 0004 c7aa jsr 4c7aa <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( ENFILE ); 4f23a: 7617 moveq #23,%d3 4f23c: 4eb9 0005 2870 jsr 52870 <__errno> 4f242: 72ff moveq #-1,%d1 4f244: 2040 moveal %d0,%a0 4f246: 2083 movel %d3,%a0@ 4f248: 6000 00c6 braw 4f310 <_POSIX_Message_queue_Create_support+0x168> <== ALWAYS TAKEN } the_mq->process_shared = pshared; the_mq->named = true; the_mq->open_count = 1; 4f24c: 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); 4f24e: 528b addql #1,%a3 if ( !the_mq ) { _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( ENFILE ); } the_mq->process_shared = pshared; 4f250: 256e 000c 0010 movel %fp@(12),%a2@(16) the_mq->named = true; 4f256: 1540 0014 moveb %d0,%a2@(20) the_mq->open_count = 1; 4f25a: 2540 0016 movel %d0,%a2@(22) the_mq->linked = true; 4f25e: 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); 4f262: 2f0b movel %a3,%sp@- 4f264: 4eb9 0004 da44 jsr 4da44 <_Workspace_Allocate> if (!name) { 4f26a: 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); 4f26c: 2400 movel %d0,%d2 if (!name) { 4f26e: 6626 bnes 4f296 <_POSIX_Message_queue_Create_support+0xee> RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free ( POSIX_Message_queue_Control *the_mq ) { _Objects_Free( &_POSIX_Message_queue_Information, &the_mq->Object ); 4f270: 2f0a movel %a2,%sp@- 4f272: 4879 0006 4e9e pea 64e9e <_POSIX_Message_queue_Information> _POSIX_Message_queue_Free( the_mq ); _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( ENOMEM ); 4f278: 740c moveq #12,%d2 4f27a: 4eb9 0004 be00 jsr 4be00 <_Objects_Free> * dynamically constructed. */ name = _Workspace_Allocate(n+1); if (!name) { _POSIX_Message_queue_Free( the_mq ); _Thread_Enable_dispatch(); 4f280: 4eb9 0004 c7aa jsr 4c7aa <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( ENOMEM ); 4f286: 4eb9 0005 2870 jsr 52870 <__errno> 4f28c: 508f addql #8,%sp 4f28e: 72ff moveq #-1,%d1 4f290: 2040 moveal %d0,%a0 4f292: 2082 movel %d2,%a0@ 4f294: 607a bras 4f310 <_POSIX_Message_queue_Create_support+0x168> <== ALWAYS TAKEN } strncpy( name, name_arg, n+1 ); 4f296: 2f0b movel %a3,%sp@- 4f298: 47f9 0004 c7aa lea 4c7aa <_Thread_Enable_dispatch>,%a3 4f29e: 2f05 movel %d5,%sp@- 4f2a0: 2f00 movel %d0,%sp@- 4f2a2: 4eb9 0005 4354 jsr 54354 * * 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; 4f2a8: 42aa 005a clrl %a2@(90) if ( !_CORE_message_queue_Initialize( 4f2ac: 2f04 movel %d4,%sp@- 4f2ae: 2f03 movel %d3,%sp@- 4f2b0: 486a 005a pea %a2@(90) 4f2b4: 486a 001a pea %a2@(26) 4f2b8: 4eb9 0005 0024 jsr 50024 <_CORE_message_queue_Initialize> 4f2be: 4fef 001c lea %sp@(28),%sp 4f2c2: 4a00 tstb %d0 4f2c4: 662c bnes 4f2f2 <_POSIX_Message_queue_Create_support+0x14a> 4f2c6: 2f0a movel %a2,%sp@- 4f2c8: 4879 0006 4e9e pea 64e9e <_POSIX_Message_queue_Information> 4f2ce: 4eb9 0004 be00 jsr 4be00 <_Objects_Free> attr.mq_maxmsg, attr.mq_msgsize ) ) { _POSIX_Message_queue_Free( the_mq ); _Workspace_Free(name); 4f2d4: 2f02 movel %d2,%sp@- 4f2d6: 4eb9 0004 da60 jsr 4da60 <_Workspace_Free> _Thread_Enable_dispatch(); 4f2dc: 4e93 jsr %a3@ rtems_set_errno_and_return_minus_one( ENOSPC ); 4f2de: 4eb9 0005 2870 jsr 52870 <__errno> 4f2e4: 4fef 000c lea %sp@(12),%sp 4f2e8: 72ff moveq #-1,%d1 4f2ea: 2040 moveal %d0,%a0 4f2ec: 701c moveq #28,%d0 4f2ee: 2080 movel %d0,%a0@ 4f2f0: 601e bras 4f310 <_POSIX_Message_queue_Create_support+0x168> <== ALWAYS TAKEN #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4f2f2: 4280 clrl %d0 4f2f4: 2079 0006 4eb6 moveal 64eb6 <_POSIX_Message_queue_Information+0x18>,%a0 4f2fa: 302a 000a movew %a2@(10),%d0 4f2fe: 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; 4f302: 2542 000c movel %d2,%a2@(12) &_POSIX_Message_queue_Information, &the_mq->Object, name ); *message_queue = the_mq; 4f306: 206e 0014 moveal %fp@(20),%a0 4f30a: 208a movel %a2,%a0@ _Thread_Enable_dispatch(); 4f30c: 4e93 jsr %a3@ 4f30e: 4281 clrl %d1 return 0; } 4f310: 2001 movel %d1,%d0 4f312: 4cee 0c3c ffd8 moveml %fp@(-40),%d2-%d5/%a2-%a3 4f318: 4e5e unlk %fp 4f31a: 4e75 rts 0004f31c <_POSIX_Message_queue_Name_to_id>: */ int _POSIX_Message_queue_Name_to_id( const char *name, Objects_Id *id ) { 4f31c: 4e56 fffc linkw %fp,#-4 4f320: 2f0a movel %a2,%sp@- 4f322: 246e 0008 moveal %fp@(8),%a2 Objects_Name_or_id_lookup_errors status; Objects_Id the_id; if ( !name ) 4f326: 4a8a tstl %a2 4f328: 6748 beqs 4f372 <_POSIX_Message_queue_Name_to_id+0x56> return EINVAL; if ( !name[0] ) 4f32a: 4a12 tstb %a2@ 4f32c: 6744 beqs 4f372 <_POSIX_Message_queue_Name_to_id+0x56> return EINVAL; if ( strnlen( name, NAME_MAX ) >= NAME_MAX ) 4f32e: 4878 00ff pea ff 4f332: 2f0a movel %a2,%sp@- 4f334: 4eb9 0005 43dc jsr 543dc 4f33a: 508f addql #8,%sp 4f33c: 0c80 0000 00fe cmpil #254,%d0 4f342: 6304 blss 4f348 <_POSIX_Message_queue_Name_to_id+0x2c> 4f344: 705b moveq #91,%d0 4f346: 602c bras 4f374 <_POSIX_Message_queue_Name_to_id+0x58> <== ALWAYS TAKEN return ENAMETOOLONG; status = _Objects_Name_to_id_string( 4f348: 486e fffc pea %fp@(-4) 4f34c: 2f0a movel %a2,%sp@- 4f34e: 4879 0006 4e9e pea 64e9e <_POSIX_Message_queue_Information> 4f354: 4eb9 0005 05ac jsr 505ac <_Objects_Name_to_id_string> &_POSIX_Message_queue_Information, name, &the_id ); *id = the_id; 4f35a: 206e 000c moveal %fp@(12),%a0 if ( status == OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL ) 4f35e: 4fef 000c lea %sp@(12),%sp status = _Objects_Name_to_id_string( &_POSIX_Message_queue_Information, name, &the_id ); *id = the_id; 4f362: 20ae fffc movel %fp@(-4),%a0@ if ( status == OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL ) 4f366: 4a80 tstl %d0 4f368: 6704 beqs 4f36e <_POSIX_Message_queue_Name_to_id+0x52> 4f36a: 7002 moveq #2,%d0 4f36c: 6006 bras 4f374 <_POSIX_Message_queue_Name_to_id+0x58> <== ALWAYS TAKEN 4f36e: 4280 clrl %d0 4f370: 6002 bras 4f374 <_POSIX_Message_queue_Name_to_id+0x58> <== ALWAYS TAKEN 4f372: 7016 moveq #22,%d0 return 0; return ENOENT; } 4f374: 246e fff8 moveal %fp@(-8),%a2 4f378: 4e5e unlk %fp 4f37a: 4e75 rts 00049268 <_POSIX_Message_queue_Receive_support>: size_t msg_len, unsigned int *msg_prio, bool wait, Watchdog_Interval timeout ) { 49268: 4e56 ffe4 linkw %fp,#-28 4926c: 48d7 043c moveml %d2-%d5/%a2,%sp@ RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control_fd *_POSIX_Message_queue_Get_fd ( mqd_t id, Objects_Locations *location ) { return (POSIX_Message_queue_Control_fd *) _Objects_Get( 49270: 486e fffc pea %fp@(-4) 49274: 242e 0008 movel %fp@(8),%d2 49278: 2f02 movel %d2,%sp@- 4927a: 4879 0006 500c pea 6500c <_POSIX_Message_queue_Information_fds> 49280: 246e 0014 moveal %fp@(20),%a2 49284: 262e 0018 movel %fp@(24),%d3 49288: 4eb9 0004 bf58 jsr 4bf58 <_Objects_Get> Objects_Locations location; size_t length_out; bool do_wait; the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); switch ( location ) { 4928e: 4fef 000c lea %sp@(12),%sp 49292: 4aae fffc tstl %fp@(-4) 49296: 6600 00c4 bnew 4935c <_POSIX_Message_queue_Receive_support+0xf4> case OBJECTS_LOCAL: if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) { 4929a: 2040 moveal %d0,%a0 4929c: 7803 moveq #3,%d4 4929e: 7a01 moveq #1,%d5 492a0: 2228 0014 movel %a0@(20),%d1 492a4: c881 andl %d1,%d4 492a6: ba84 cmpl %d4,%d5 492a8: 660a bnes 492b4 <_POSIX_Message_queue_Receive_support+0x4c> _Thread_Enable_dispatch(); 492aa: 4eb9 0004 c7aa jsr 4c7aa <_Thread_Enable_dispatch> 492b0: 6000 00aa braw 4935c <_POSIX_Message_queue_Receive_support+0xf4> <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EBADF ); } the_mq = the_mq_fd->Queue; 492b4: 2240 moveal %d0,%a1 492b6: 2069 0010 moveal %a1@(16),%a0 if ( msg_len < the_mq->Message_queue.maximum_message_size ) { 492ba: 2028 0066 movel %a0@(102),%d0 492be: b0ae 0010 cmpl %fp@(16),%d0 492c2: 6318 blss 492dc <_POSIX_Message_queue_Receive_support+0x74> _Thread_Enable_dispatch(); 492c4: 4eb9 0004 c7aa jsr 4c7aa <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EMSGSIZE ); 492ca: 747a moveq #122,%d2 492cc: 4eb9 0005 2870 jsr 52870 <__errno> 492d2: 72ff moveq #-1,%d1 492d4: 2040 moveal %d0,%a0 492d6: 2082 movel %d2,%a0@ 492d8: 6000 0090 braw 4936a <_POSIX_Message_queue_Receive_support+0x102> <== ALWAYS TAKEN length_out = -1; /* * A timed receive with a bad time will do a poll regardless. */ if ( wait ) 492dc: 4a03 tstb %d3 492de: 6604 bnes 492e4 <_POSIX_Message_queue_Receive_support+0x7c> <== NEVER TAKEN 492e0: 4200 clrb %d0 <== NOT EXECUTED 492e2: 600c bras 492f0 <_POSIX_Message_queue_Receive_support+0x88> <== NOT EXECUTED do_wait = (the_mq_fd->oflag & O_NONBLOCK) ? false : true; 492e4: 2001 movel %d1,%d0 492e6: 760e moveq #14,%d3 492e8: 7a01 moveq #1,%d5 492ea: e6a8 lsrl %d3,%d0 492ec: bb80 eorl %d5,%d0 492ee: c085 andl %d5,%d0 do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 492f0: 2f2e 001c movel %fp@(28),%sp@- 492f4: 7201 moveq #1,%d1 /* * Now if something goes wrong, we return a "length" of -1 * to indicate an error. */ length_out = -1; 492f6: 76ff moveq #-1,%d3 do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 492f8: c280 andl %d0,%d1 /* * Now if something goes wrong, we return a "length" of -1 * to indicate an error. */ length_out = -1; 492fa: 2d43 fff8 movel %d3,%fp@(-8) do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 492fe: 2f01 movel %d1,%sp@- 49300: 486e fff8 pea %fp@(-8) 49304: 2f2e 000c movel %fp@(12),%sp@- 49308: 2f02 movel %d2,%sp@- 4930a: 4868 001a pea %a0@(26) 4930e: 4eb9 0004 b0a0 jsr 4b0a0 <_CORE_message_queue_Seize> &length_out, do_wait, timeout ); _Thread_Enable_dispatch(); 49314: 4eb9 0004 c7aa jsr 4c7aa <_Thread_Enable_dispatch> *msg_prio = _POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count); 4931a: 2079 0006 4c8a moveal 64c8a <_Thread_Executing>,%a0 do_wait, timeout ); _Thread_Enable_dispatch(); *msg_prio = 49320: 24a8 0024 movel %a0@(36),%a2@ 49324: 6c06 bges 4932c <_POSIX_Message_queue_Receive_support+0xc4> 49326: 2a12 movel %a2@,%d5 49328: 4485 negl %d5 4932a: 2485 movel %d5,%a2@ _POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count); if ( !_Thread_Executing->Wait.return_code ) 4932c: 4fef 0018 lea %sp@(24),%sp 49330: 4aa8 0034 tstl %a0@(52) 49334: 6606 bnes 4933c <_POSIX_Message_queue_Receive_support+0xd4> return length_out; 49336: 222e fff8 movel %fp@(-8),%d1 4933a: 602e bras 4936a <_POSIX_Message_queue_Receive_support+0x102> <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( 4933c: 4eb9 0005 2870 jsr 52870 <__errno> 49342: 2079 0006 4c8a moveal 64c8a <_Thread_Executing>,%a0 49348: 2440 moveal %d0,%a2 4934a: 2f28 0034 movel %a0@(52),%sp@- 4934e: 4eb9 0004 9594 jsr 49594 <_POSIX_Message_queue_Translate_core_message_queue_return_code> 49354: 588f addql #4,%sp 49356: 72ff moveq #-1,%d1 49358: 2480 movel %d0,%a2@ 4935a: 600e bras 4936a <_POSIX_Message_queue_Receive_support+0x102> <== ALWAYS TAKEN #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); 4935c: 4eb9 0005 2870 jsr 52870 <__errno> 49362: 72ff moveq #-1,%d1 49364: 2040 moveal %d0,%a0 49366: 7009 moveq #9,%d0 49368: 2080 movel %d0,%a0@ } 4936a: 2001 movel %d1,%d0 4936c: 4cee 043c ffe4 moveml %fp@(-28),%d2-%d5/%a2 49372: 4e5e unlk %fp 49374: 4e75 rts ... 0004939c <_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 ) 4939c: 7020 moveq #32,%d0 size_t msg_len, uint32_t msg_prio, bool wait, Watchdog_Interval timeout ) { 4939e: 4e56 ffe8 linkw %fp,#-24 493a2: 48d7 043c moveml %d2-%d5/%a2,%sp@ 493a6: 242e 0008 movel %fp@(8),%d2 493aa: 262e 0014 movel %fp@(20),%d3 493ae: 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 ) 493b2: b083 cmpl %d3,%d0 493b4: 6412 bccs 493c8 <_POSIX_Message_queue_Send_support+0x2c> rtems_set_errno_and_return_minus_one( EINVAL ); 493b6: 4eb9 0005 2870 jsr 52870 <__errno> 493bc: 7416 moveq #22,%d2 493be: 72ff moveq #-1,%d1 493c0: 2040 moveal %d0,%a0 493c2: 2082 movel %d2,%a0@ 493c4: 6000 00bc braw 49482 <_POSIX_Message_queue_Send_support+0xe6> 493c8: 486e fffc pea %fp@(-4) 493cc: 2f02 movel %d2,%sp@- 493ce: 4879 0006 500c pea 6500c <_POSIX_Message_queue_Information_fds> 493d4: 4eb9 0004 bf58 jsr 4bf58 <_Objects_Get> the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); switch ( location ) { 493da: 4fef 000c lea %sp@(12),%sp 493de: 4aae fffc tstl %fp@(-4) 493e2: 6600 0090 bnew 49474 <_POSIX_Message_queue_Send_support+0xd8> <== ALWAYS TAKEN case OBJECTS_LOCAL: if ( (the_mq_fd->oflag & O_ACCMODE) == O_RDONLY ) { 493e6: 2240 moveal %d0,%a1 493e8: 7a03 moveq #3,%d5 493ea: 2229 0014 movel %a1@(20),%d1 493ee: ca81 andl %d1,%d5 493f0: 6608 bnes 493fa <_POSIX_Message_queue_Send_support+0x5e> _Thread_Enable_dispatch(); 493f2: 4eb9 0004 c7aa jsr 4c7aa <_Thread_Enable_dispatch> 493f8: 607a bras 49474 <_POSIX_Message_queue_Send_support+0xd8> rtems_set_errno_and_return_minus_one( EBADF ); } the_mq = the_mq_fd->Queue; 493fa: 2240 moveal %d0,%a1 493fc: 2069 0010 moveal %a1@(16),%a0 /* * A timed receive with a bad time will do a poll regardless. */ if ( wait ) 49400: 4a04 tstb %d4 49402: 6604 bnes 49408 <_POSIX_Message_queue_Send_support+0x6c> 49404: 4200 clrb %d0 49406: 600c bras 49414 <_POSIX_Message_queue_Send_support+0x78> <== ALWAYS TAKEN do_wait = (the_mq_fd->oflag & O_NONBLOCK) ? false : true; 49408: 2001 movel %d1,%d0 4940a: 780e moveq #14,%d4 4940c: 7201 moveq #1,%d1 4940e: e8a8 lsrl %d4,%d0 49410: b380 eorl %d1,%d0 49412: c081 andl %d1,%d0 do_wait = wait; /* * Now perform the actual message receive */ msg_status = _CORE_message_queue_Submit( 49414: 2f2e 001c movel %fp@(28),%sp@- 49418: 7801 moveq #1,%d4 4941a: 4483 negl %d3 4941c: c880 andl %d0,%d4 4941e: 2f04 movel %d4,%sp@- 49420: 2f03 movel %d3,%sp@- 49422: 42a7 clrl %sp@- 49424: 2f02 movel %d2,%sp@- 49426: 2f2e 0010 movel %fp@(16),%sp@- 4942a: 2f2e 000c movel %fp@(12),%sp@- 4942e: 4868 001a pea %a0@(26) 49432: 4eb9 0004 b1dc jsr 4b1dc <_CORE_message_queue_Submit> _POSIX_Message_queue_Priority_to_core( msg_prio ), do_wait, timeout /* no timeout */ ); _Thread_Enable_dispatch(); 49438: 4fef 0020 lea %sp@(32),%sp do_wait = wait; /* * Now perform the actual message receive */ msg_status = _CORE_message_queue_Submit( 4943c: 2400 movel %d0,%d2 _POSIX_Message_queue_Priority_to_core( msg_prio ), do_wait, timeout /* no timeout */ ); _Thread_Enable_dispatch(); 4943e: 4eb9 0004 c7aa jsr 4c7aa <_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 ) 49444: 7007 moveq #7,%d0 49446: b082 cmpl %d2,%d0 49448: 660a bnes 49454 <_POSIX_Message_queue_Send_support+0xb8> msg_status = _Thread_Executing->Wait.return_code; 4944a: 2079 0006 4c8a moveal 64c8a <_Thread_Executing>,%a0 49450: 2428 0034 movel %a0@(52),%d2 if ( !msg_status ) 49454: 4a82 tstl %d2 49456: 6604 bnes 4945c <_POSIX_Message_queue_Send_support+0xc0> 49458: 4281 clrl %d1 4945a: 6026 bras 49482 <_POSIX_Message_queue_Send_support+0xe6> <== ALWAYS TAKEN return msg_status; rtems_set_errno_and_return_minus_one( 4945c: 4eb9 0005 2870 jsr 52870 <__errno> 49462: 2440 moveal %d0,%a2 49464: 2f02 movel %d2,%sp@- 49466: 4eb9 0004 9594 jsr 49594 <_POSIX_Message_queue_Translate_core_message_queue_return_code> 4946c: 588f addql #4,%sp 4946e: 72ff moveq #-1,%d1 49470: 2480 movel %d0,%a2@ 49472: 600e bras 49482 <_POSIX_Message_queue_Send_support+0xe6> <== ALWAYS TAKEN #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); 49474: 4eb9 0005 2870 jsr 52870 <__errno> 4947a: 72ff moveq #-1,%d1 4947c: 2040 moveal %d0,%a0 4947e: 7009 moveq #9,%d0 49480: 2080 movel %d0,%a0@ } 49482: 2001 movel %d1,%d0 49484: 4cee 043c ffe8 moveml %fp@(-24),%d2-%d5/%a2 4948a: 4e5e unlk %fp 4948c: 4e75 rts ... 00046a6a <_POSIX_Mutex_Get>: POSIX_Mutex_Control *_POSIX_Mutex_Get ( pthread_mutex_t *mutex, Objects_Locations *location ) { 46a6a: 4e56 0000 linkw %fp,#0 46a6e: 2f0b movel %a3,%sp@- 46a70: 266e 000c moveal %fp@(12),%a3 46a74: 2f0a movel %a2,%sp@- 46a76: 246e 0008 moveal %fp@(8),%a2 ___POSIX_Mutex_Get_support_error_check( mutex, location ); 46a7a: 4a8a tstl %a2 46a7c: 6716 beqs 46a94 <_POSIX_Mutex_Get+0x2a> ___POSIX_Mutex_Get_support_auto_initialization( mutex, location ); 46a7e: 70ff moveq #-1,%d0 46a80: b092 cmpl %a2@,%d0 46a82: 6618 bnes 46a9c <_POSIX_Mutex_Get+0x32> 46a84: 42a7 clrl %sp@- 46a86: 2f0a movel %a2,%sp@- 46a88: 4eb9 0004 6b04 jsr 46b04 46a8e: 508f addql #8,%sp 46a90: 4a80 tstl %d0 46a92: 6708 beqs 46a9c <_POSIX_Mutex_Get+0x32> 46a94: 7201 moveq #1,%d1 46a96: 4280 clrl %d0 46a98: 2681 movel %d1,%a3@ 46a9a: 6014 bras 46ab0 <_POSIX_Mutex_Get+0x46> <== ALWAYS TAKEN return (POSIX_Mutex_Control *) 46a9c: 2f0b movel %a3,%sp@- 46a9e: 2f12 movel %a2@,%sp@- 46aa0: 4879 0006 1c8c pea 61c8c <_POSIX_Mutex_Information> 46aa6: 4eb9 0004 921c jsr 4921c <_Objects_Get> 46aac: 4fef 000c lea %sp@(12),%sp _Objects_Get( &_POSIX_Mutex_Information, (Objects_Id) *mutex, location ); } 46ab0: 246e fff8 moveal %fp@(-8),%a2 46ab4: 266e fffc moveal %fp@(-4),%a3 46ab8: 4e5e unlk %fp 46aba: 4e75 rts 00046a14 <_POSIX_Mutex_Get_interrupt_disable>: POSIX_Mutex_Control *_POSIX_Mutex_Get_interrupt_disable ( pthread_mutex_t *mutex, Objects_Locations *location, ISR_Level *level ) { 46a14: 4e56 0000 linkw %fp,#0 46a18: 2f0b movel %a3,%sp@- 46a1a: 266e 000c moveal %fp@(12),%a3 46a1e: 2f0a movel %a2,%sp@- 46a20: 246e 0008 moveal %fp@(8),%a2 ___POSIX_Mutex_Get_support_error_check( mutex, location ); 46a24: 4a8a tstl %a2 46a26: 6716 beqs 46a3e <_POSIX_Mutex_Get_interrupt_disable+0x2a> ___POSIX_Mutex_Get_support_auto_initialization( mutex, location ); 46a28: 70ff moveq #-1,%d0 46a2a: b092 cmpl %a2@,%d0 46a2c: 6618 bnes 46a46 <_POSIX_Mutex_Get_interrupt_disable+0x32> 46a2e: 42a7 clrl %sp@- 46a30: 2f0a movel %a2,%sp@- 46a32: 4eb9 0004 6b04 jsr 46b04 46a38: 508f addql #8,%sp 46a3a: 4a80 tstl %d0 46a3c: 6708 beqs 46a46 <_POSIX_Mutex_Get_interrupt_disable+0x32> 46a3e: 7001 moveq #1,%d0 46a40: 2680 movel %d0,%a3@ 46a42: 4280 clrl %d0 46a44: 6018 bras 46a5e <_POSIX_Mutex_Get_interrupt_disable+0x4a> <== ALWAYS TAKEN return (POSIX_Mutex_Control *) _Objects_Get_isr_disable( 46a46: 2f2e 0010 movel %fp@(16),%sp@- 46a4a: 2f0b movel %a3,%sp@- 46a4c: 2f12 movel %a2@,%sp@- 46a4e: 4879 0006 1c8c pea 61c8c <_POSIX_Mutex_Information> 46a54: 4eb9 0004 91c4 jsr 491c4 <_Objects_Get_isr_disable> 46a5a: 4fef 0010 lea %sp@(16),%sp &_POSIX_Mutex_Information, (Objects_Id) *mutex, location, level ); } 46a5e: 246e fff8 moveal %fp@(-8),%a2 46a62: 266e fffc moveal %fp@(-4),%a3 46a66: 4e5e unlk %fp 46a68: 4e75 rts 00046c38 <_POSIX_Mutex_Lock_support>: int _POSIX_Mutex_Lock_support( pthread_mutex_t *mutex, bool blocking, Watchdog_Interval timeout ) { 46c38: 4e56 fff8 linkw %fp,#-8 46c3c: 2f02 movel %d2,%sp@- register POSIX_Mutex_Control *the_mutex; Objects_Locations location; ISR_Level level; the_mutex = _POSIX_Mutex_Get_interrupt_disable( mutex, &location, &level ); 46c3e: 486e fff8 pea %fp@(-8) 46c42: 486e fffc pea %fp@(-4) 46c46: 2f2e 0008 movel %fp@(8),%sp@- int _POSIX_Mutex_Lock_support( pthread_mutex_t *mutex, bool blocking, Watchdog_Interval timeout ) { 46c4a: 142e 000f moveb %fp@(15),%d2 register POSIX_Mutex_Control *the_mutex; Objects_Locations location; ISR_Level level; the_mutex = _POSIX_Mutex_Get_interrupt_disable( mutex, &location, &level ); 46c4e: 4eb9 0004 6a14 jsr 46a14 <_POSIX_Mutex_Get_interrupt_disable> switch ( location ) { 46c54: 4fef 000c lea %sp@(12),%sp 46c58: 4aae fffc tstl %fp@(-4) 46c5c: 6704 beqs 46c62 <_POSIX_Mutex_Lock_support+0x2a> 46c5e: 7016 moveq #22,%d0 46c60: 6034 bras 46c96 <_POSIX_Mutex_Lock_support+0x5e> <== ALWAYS TAKEN case OBJECTS_LOCAL: _CORE_mutex_Seize( 46c62: 2f2e fff8 movel %fp@(-8),%sp@- 46c66: 2040 moveal %d0,%a0 46c68: 2f2e 0010 movel %fp@(16),%sp@- 46c6c: 0282 0000 00ff andil #255,%d2 46c72: 2f02 movel %d2,%sp@- 46c74: 2f28 0008 movel %a0@(8),%sp@- 46c78: 4868 0014 pea %a0@(20) 46c7c: 4eb9 0004 8680 jsr 48680 <_CORE_mutex_Seize> the_mutex->Object.id, blocking, timeout, level ); return _POSIX_Mutex_Translate_core_mutex_return_code( 46c82: 2079 0006 1a3e moveal 61a3e <_Thread_Executing>,%a0 46c88: 2f28 0034 movel %a0@(52),%sp@- 46c8c: 4eb9 0004 6d60 jsr 46d60 <_POSIX_Mutex_Translate_core_mutex_return_code> 46c92: 4fef 0018 lea %sp@(24),%sp case OBJECTS_ERROR: break; } return EINVAL; } 46c96: 242e fff4 movel %fp@(-12),%d2 46c9a: 4e5e unlk %fp 46c9c: 4e75 rts ... 0004a890 <_POSIX_Priority_Is_valid>: #include bool _POSIX_Priority_Is_valid( int priority ) { 4a890: 4e56 0000 linkw %fp,#0 4a894: 202e 0008 movel %fp@(8),%d0 return ((priority >= POSIX_SCHEDULER_MINIMUM_PRIORITY) && 4a898: 6e04 bgts 4a89e <_POSIX_Priority_Is_valid+0xe> 4a89a: 4280 clrl %d0 4a89c: 6010 bras 4a8ae <_POSIX_Priority_Is_valid+0x1e> <== ALWAYS TAKEN 4a89e: 4281 clrl %d1 4a8a0: 1239 0005 c706 moveb 5c706 ,%d1 4a8a6: b081 cmpl %d1,%d0 4a8a8: 5dc0 slt %d0 4a8aa: 49c0 extbl %d0 4a8ac: 4480 negl %d0 (priority <= POSIX_SCHEDULER_MAXIMUM_PRIORITY)); } 4a8ae: 4e5e unlk %fp 4a8b0: 4e75 rts ... 0004d328 <_POSIX_Semaphore_Create_support>: const char *name, int pshared, unsigned int value, POSIX_Semaphore_Control **the_sem ) { 4d328: 4e56 0000 linkw %fp,#0 4d32c: 2f0a movel %a2,%sp@- 4d32e: 2f02 movel %d2,%sp@- 4d330: 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) 4d334: 4aae 000c tstl %fp@(12) 4d338: 6712 beqs 4d34c <_POSIX_Semaphore_Create_support+0x24> rtems_set_errno_and_return_minus_one( ENOSYS ); 4d33a: 4eb9 0005 08a0 jsr 508a0 <__errno> 4d340: 72ff moveq #-1,%d1 4d342: 2040 moveal %d0,%a0 4d344: 7058 moveq #88,%d0 4d346: 2080 movel %d0,%a0@ 4d348: 6000 00c6 braw 4d410 <_POSIX_Semaphore_Create_support+0xe8> if ( name ) { 4d34c: 4a82 tstl %d2 4d34e: 6728 beqs 4d378 <_POSIX_Semaphore_Create_support+0x50> if ( strnlen( name, NAME_MAX ) >= NAME_MAX ) 4d350: 4878 00ff pea ff 4d354: 2f02 movel %d2,%sp@- 4d356: 4eb9 0005 1db0 jsr 51db0 4d35c: 508f addql #8,%sp 4d35e: 0c80 0000 00fe cmpil #254,%d0 4d364: 6312 blss 4d378 <_POSIX_Semaphore_Create_support+0x50> rtems_set_errno_and_return_minus_one( ENAMETOOLONG ); 4d366: 4eb9 0005 08a0 jsr 508a0 <__errno> 4d36c: 745b moveq #91,%d2 4d36e: 72ff moveq #-1,%d1 4d370: 2040 moveal %d0,%a0 4d372: 2082 movel %d2,%a0@ 4d374: 6000 009a braw 4d410 <_POSIX_Semaphore_Create_support+0xe8> 4d378: 2039 0006 1b90 movel 61b90 <_Thread_Dispatch_disable_level>,%d0 4d37e: 5280 addql #1,%d0 4d380: 23c0 0006 1b90 movel %d0,61b90 <_Thread_Dispatch_disable_level> * _POSIX_Semaphore_Allocate */ RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void ) { return (POSIX_Semaphore_Control *) 4d386: 4879 0006 1dea pea 61dea <_POSIX_Semaphore_Information> 4d38c: 4eb9 0004 9524 jsr 49524 <_Objects_Allocate> _Thread_Disable_dispatch(); the_semaphore = _POSIX_Semaphore_Allocate(); if ( !the_semaphore ) { 4d392: 588f addql #4,%sp 4d394: 2440 moveal %d0,%a2 4d396: 4a80 tstl %d0 4d398: 6616 bnes 4d3b0 <_POSIX_Semaphore_Create_support+0x88> _Thread_Enable_dispatch(); 4d39a: 4eb9 0004 a1c2 jsr 4a1c2 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( ENOSPC ); 4d3a0: 4eb9 0005 08a0 jsr 508a0 <__errno> 4d3a6: 72ff moveq #-1,%d1 4d3a8: 2040 moveal %d0,%a0 4d3aa: 701c moveq #28,%d0 4d3ac: 2080 movel %d0,%a0@ 4d3ae: 6060 bras 4d410 <_POSIX_Semaphore_Create_support+0xe8> } the_semaphore->process_shared = pshared; 4d3b0: 42aa 0010 clrl %a2@(16) if ( name ) { 4d3b4: 4a82 tstl %d2 4d3b6: 6708 beqs 4d3c0 <_POSIX_Semaphore_Create_support+0x98> the_semaphore->named = true; the_semaphore->open_count = 1; 4d3b8: 7001 moveq #1,%d0 4d3ba: 2540 0016 movel %d0,%a2@(22) 4d3be: 6006 bras 4d3c6 <_POSIX_Semaphore_Create_support+0x9e> <== ALWAYS TAKEN the_semaphore->linked = true; } else { the_semaphore->named = false; the_semaphore->open_count = 0; 4d3c0: 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; 4d3c4: 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; 4d3c6: 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; 4d3ca: 1540 0014 moveb %d0,%a2@(20) the_semaphore->open_count = 0; the_semaphore->linked = false; 4d3ce: 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; 4d3d2: 70ff moveq #-1,%d0 4d3d4: 2540 005a movel %d0,%a2@(90) _CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value ); 4d3d8: 2f2e 0010 movel %fp@(16),%sp@- 4d3dc: 486a 005a pea %a2@(90) 4d3e0: 486a 001a pea %a2@(26) 4d3e4: 4eb9 0004 9054 jsr 49054 <_CORE_semaphore_Initialize> #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4d3ea: 2079 0006 1e02 moveal 61e02 <_POSIX_Semaphore_Information+0x18>,%a0 4d3f0: 4280 clrl %d0 4d3f2: 302a 000a movew %a2@(10),%d0 4d3f6: 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; 4d3fa: 2542 000c movel %d2,%a2@(12) &_POSIX_Semaphore_Information, &the_semaphore->Object, name_p ); *the_sem = the_semaphore; 4d3fe: 206e 0014 moveal %fp@(20),%a0 4d402: 208a movel %a2,%a0@ _Thread_Enable_dispatch(); 4d404: 4eb9 0004 a1c2 jsr 4a1c2 <_Thread_Enable_dispatch> return 0; 4d40a: 4fef 000c lea %sp@(12),%sp name_p ); *the_sem = the_semaphore; _Thread_Enable_dispatch(); 4d40e: 4281 clrl %d1 return 0; } 4d410: 242e fff8 movel %fp@(-8),%d2 4d414: 2001 movel %d1,%d0 4d416: 246e fffc moveal %fp@(-4),%a2 4d41a: 4e5e unlk %fp 4d41c: 4e75 rts ... 0004d470 <_POSIX_Semaphore_Name_to_id>: int _POSIX_Semaphore_Name_to_id( const char *name, sem_t *id ) { 4d470: 4e56 fffc linkw %fp,#-4 4d474: 206e 0008 moveal %fp@(8),%a0 Objects_Name_or_id_lookup_errors status; Objects_Id the_id; if ( !name ) 4d478: 4a88 tstl %a0 4d47a: 672e beqs 4d4aa <_POSIX_Semaphore_Name_to_id+0x3a> return EINVAL; if ( !name[0] ) 4d47c: 4a10 tstb %a0@ 4d47e: 672a beqs 4d4aa <_POSIX_Semaphore_Name_to_id+0x3a> return EINVAL; status = _Objects_Name_to_id_string( 4d480: 486e fffc pea %fp@(-4) 4d484: 2f08 movel %a0,%sp@- 4d486: 4879 0006 1dea pea 61dea <_POSIX_Semaphore_Information> 4d48c: 4eb9 0004 e180 jsr 4e180 <_Objects_Name_to_id_string> &_POSIX_Semaphore_Information, name, &the_id ); *id = the_id; 4d492: 206e 000c moveal %fp@(12),%a0 if ( status == OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL ) 4d496: 4fef 000c lea %sp@(12),%sp status = _Objects_Name_to_id_string( &_POSIX_Semaphore_Information, name, &the_id ); *id = the_id; 4d49a: 20ae fffc movel %fp@(-4),%a0@ if ( status == OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL ) 4d49e: 4a80 tstl %d0 4d4a0: 6704 beqs 4d4a6 <_POSIX_Semaphore_Name_to_id+0x36> 4d4a2: 7002 moveq #2,%d0 4d4a4: 6006 bras 4d4ac <_POSIX_Semaphore_Name_to_id+0x3c> <== ALWAYS TAKEN 4d4a6: 4280 clrl %d0 4d4a8: 6002 bras 4d4ac <_POSIX_Semaphore_Name_to_id+0x3c> <== ALWAYS TAKEN 4d4aa: 7016 moveq #22,%d0 return 0; return ENOENT; } 4d4ac: 4e5e unlk %fp 4d4ae: 4e75 rts 0004d4e4 <_POSIX_Semaphore_Wait_support>: int _POSIX_Semaphore_Wait_support( sem_t *sem, bool blocking, Watchdog_Interval timeout ) { 4d4e4: 4e56 fffc linkw %fp,#-4 4d4e8: 206e 0008 moveal %fp@(8),%a0 4d4ec: 2f0a movel %a2,%sp@- 4d4ee: 2f02 movel %d2,%sp@- RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Get ( sem_t *id, Objects_Locations *location ) { return (POSIX_Semaphore_Control *) 4d4f0: 486e fffc pea %fp@(-4) 4d4f4: 2f10 movel %a0@,%sp@- 4d4f6: 4879 0006 1dea pea 61dea <_POSIX_Semaphore_Information> 4d4fc: 142e 000f moveb %fp@(15),%d2 4d500: 4eb9 0004 9970 jsr 49970 <_Objects_Get> POSIX_Semaphore_Control *the_semaphore; Objects_Locations location; the_semaphore = _POSIX_Semaphore_Get( sem, &location ); switch ( location ) { 4d506: 4fef 000c lea %sp@(12),%sp 4d50a: 4aae fffc tstl %fp@(-4) 4d50e: 6656 bnes 4d566 <_POSIX_Semaphore_Wait_support+0x82> case OBJECTS_LOCAL: _CORE_semaphore_Seize( 4d510: 2f2e 0010 movel %fp@(16),%sp@- 4d514: 2040 moveal %d0,%a0 4d516: 0282 0000 00ff andil #255,%d2 4d51c: 2f02 movel %d2,%sp@- 4d51e: 2f28 0008 movel %a0@(8),%sp@- 4d522: 4868 001a pea %a0@(26) 4d526: 4eb9 0004 dcd0 jsr 4dcd0 <_CORE_semaphore_Seize> &the_semaphore->Semaphore, the_semaphore->Object.id, blocking, timeout ); _Thread_Enable_dispatch(); 4d52c: 4eb9 0004 a1c2 jsr 4a1c2 <_Thread_Enable_dispatch> if ( !_Thread_Executing->Wait.return_code ) 4d532: 2079 0006 1c4a moveal 61c4a <_Thread_Executing>,%a0 4d538: 4fef 0010 lea %sp@(16),%sp 4d53c: 4aa8 0034 tstl %a0@(52) 4d540: 6604 bnes 4d546 <_POSIX_Semaphore_Wait_support+0x62> 4d542: 4281 clrl %d1 4d544: 602e bras 4d574 <_POSIX_Semaphore_Wait_support+0x90> <== ALWAYS TAKEN return 0; rtems_set_errno_and_return_minus_one( 4d546: 4eb9 0005 08a0 jsr 508a0 <__errno> 4d54c: 2079 0006 1c4a moveal 61c4a <_Thread_Executing>,%a0 4d552: 2440 moveal %d0,%a2 4d554: 2f28 0034 movel %a0@(52),%sp@- 4d558: 4eb9 0004 f8b4 jsr 4f8b4 <_POSIX_Semaphore_Translate_core_semaphore_return_code> 4d55e: 588f addql #4,%sp 4d560: 72ff moveq #-1,%d1 4d562: 2480 movel %d0,%a2@ 4d564: 600e bras 4d574 <_POSIX_Semaphore_Wait_support+0x90> <== ALWAYS TAKEN #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EINVAL ); 4d566: 4eb9 0005 08a0 jsr 508a0 <__errno> 4d56c: 72ff moveq #-1,%d1 4d56e: 2040 moveal %d0,%a0 4d570: 7016 moveq #22,%d0 4d572: 2080 movel %d0,%a0@ } 4d574: 242e fff4 movel %fp@(-12),%d2 4d578: 2001 movel %d1,%d0 4d57a: 246e fff8 moveal %fp@(-8),%a2 4d57e: 4e5e unlk %fp 4d580: 4e75 rts ... 00049830 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch>: #include void _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch( Thread_Control *the_thread ) { 49830: 4e56 0000 linkw %fp,#0 49834: 226e 0008 moveal %fp@(8),%a1 POSIX_API_Control *thread_support; thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; 49838: 2069 010e moveal %a1@(270),%a0 if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 4983c: 4aa8 00cc tstl %a0@(204) 49840: 662e bnes 49870 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x40> <== ALWAYS TAKEN thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS && 49842: 7001 moveq #1,%d0 49844: b0a8 00d0 cmpl %a0@(208),%d0 49848: 6626 bnes 49870 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x40> thread_support->cancelation_requested ) { 4984a: 4aa8 00d4 tstl %a0@(212) 4984e: 6720 beqs 49870 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x40> _Thread_Unnest_dispatch(); _POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED ); 49850: 4878 ffff pea ffffffff */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 49854: 2039 0005 d558 movel 5d558 <_Thread_Dispatch_disable_level>,%d0 4985a: 5380 subql #1,%d0 4985c: 2f09 movel %a1,%sp@- 4985e: 23c0 0005 d558 movel %d0,5d558 <_Thread_Dispatch_disable_level> 49864: 4eb9 0004 9e5c jsr 49e5c <_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 && 4986a: 508f addql #8,%sp _Thread_Unnest_dispatch(); _POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED ); } else _Thread_Enable_dispatch(); } 4986c: 4e5e unlk %fp 4986e: 4e75 rts 49870: 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(); 49872: 4ef9 0004 701a jmp 4701a <_Thread_Enable_dispatch> 0004a8b4 <_POSIX_Thread_Translate_sched_param>: int policy, struct sched_param *param, Thread_CPU_budget_algorithms *budget_algorithm, Thread_CPU_budget_algorithm_callout *budget_callout ) { 4a8b4: 4e56 ffec linkw %fp,#-20 4a8b8: 48d7 3c04 moveml %d2/%a2-%a5,%sp@ 4a8bc: 246e 000c moveal %fp@(12),%a2 if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) 4a8c0: 2f12 movel %a2@,%sp@- int policy, struct sched_param *param, Thread_CPU_budget_algorithms *budget_algorithm, Thread_CPU_budget_algorithm_callout *budget_callout ) { 4a8c2: 242e 0008 movel %fp@(8),%d2 4a8c6: 266e 0010 moveal %fp@(16),%a3 4a8ca: 286e 0014 moveal %fp@(20),%a4 if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) 4a8ce: 4eb9 0004 a890 jsr 4a890 <_POSIX_Priority_Is_valid> 4a8d4: 588f addql #4,%sp 4a8d6: 4a00 tstb %d0 4a8d8: 677c beqs 4a956 <_POSIX_Thread_Translate_sched_param+0xa2> <== ALWAYS TAKEN return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 4a8da: 4293 clrl %a3@ *budget_callout = NULL; 4a8dc: 4294 clrl %a4@ if ( policy == SCHED_OTHER ) { 4a8de: 4a82 tstl %d2 4a8e0: 6608 bnes 4a8ea <_POSIX_Thread_Translate_sched_param+0x36> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 4a8e2: 7201 moveq #1,%d1 4a8e4: 4280 clrl %d0 4a8e6: 2681 movel %d1,%a3@ return 0; 4a8e8: 606e bras 4a958 <_POSIX_Thread_Translate_sched_param+0xa4> <== ALWAYS TAKEN } if ( policy == SCHED_FIFO ) { 4a8ea: 7001 moveq #1,%d0 4a8ec: b082 cmpl %d2,%d0 4a8ee: 6604 bnes 4a8f4 <_POSIX_Thread_Translate_sched_param+0x40> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 4a8f0: 4293 clrl %a3@ 4a8f2: 6008 bras 4a8fc <_POSIX_Thread_Translate_sched_param+0x48> <== ALWAYS TAKEN return 0; } if ( policy == SCHED_RR ) { 4a8f4: 7002 moveq #2,%d0 4a8f6: b082 cmpl %d2,%d0 4a8f8: 6606 bnes 4a900 <_POSIX_Thread_Translate_sched_param+0x4c> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; 4a8fa: 2680 movel %d0,%a3@ 4a8fc: 4200 clrb %d0 return 0; 4a8fe: 6058 bras 4a958 <_POSIX_Thread_Translate_sched_param+0xa4> <== ALWAYS TAKEN } if ( policy == SCHED_SPORADIC ) { 4a900: 7003 moveq #3,%d0 4a902: b082 cmpl %d2,%d0 4a904: 6650 bnes 4a956 <_POSIX_Thread_Translate_sched_param+0xa2> if ( (param->ss_replenish_period.tv_sec == 0) && 4a906: 4aaa 0008 tstl %a2@(8) 4a90a: 6606 bnes 4a912 <_POSIX_Thread_Translate_sched_param+0x5e> (param->ss_replenish_period.tv_nsec == 0) ) 4a90c: 4aaa 000c tstl %a2@(12) 4a910: 6744 beqs 4a956 <_POSIX_Thread_Translate_sched_param+0xa2> return EINVAL; if ( (param->ss_initial_budget.tv_sec == 0) && 4a912: 4aaa 0010 tstl %a2@(16) 4a916: 6606 bnes 4a91e <_POSIX_Thread_Translate_sched_param+0x6a> (param->ss_initial_budget.tv_nsec == 0) ) 4a918: 4aaa 0014 tstl %a2@(20) 4a91c: 6738 beqs 4a956 <_POSIX_Thread_Translate_sched_param+0xa2> return EINVAL; if ( _Timespec_To_ticks( ¶m->ss_replenish_period ) < 4a91e: 486a 0008 pea %a2@(8) 4a922: 4bf9 0004 88b0 lea 488b0 <_Timespec_To_ticks>,%a5 4a928: 4e95 jsr %a5@ 4a92a: 486a 0010 pea %a2@(16) 4a92e: 2400 movel %d0,%d2 4a930: 4e95 jsr %a5@ 4a932: 508f addql #8,%sp 4a934: b082 cmpl %d2,%d0 4a936: 621e bhis 4a956 <_POSIX_Thread_Translate_sched_param+0xa2> _Timespec_To_ticks( ¶m->ss_initial_budget ) ) return EINVAL; if ( !_POSIX_Priority_Is_valid( param->ss_low_priority ) ) 4a938: 2f2a 0004 movel %a2@(4),%sp@- 4a93c: 4eb9 0004 a890 jsr 4a890 <_POSIX_Priority_Is_valid> 4a942: 588f addql #4,%sp 4a944: 4a00 tstb %d0 4a946: 670e beqs 4a956 <_POSIX_Thread_Translate_sched_param+0xa2> return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; 4a948: 7003 moveq #3,%d0 *budget_callout = _POSIX_Threads_Sporadic_budget_callout; 4a94a: 28bc 0004 554e movel #283982,%a4@ return EINVAL; if ( !_POSIX_Priority_Is_valid( param->ss_low_priority ) ) return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; 4a950: 2680 movel %d0,%a3@ *budget_callout = _POSIX_Threads_Sporadic_budget_callout; 4a952: 4280 clrl %d0 return 0; 4a954: 6002 bras 4a958 <_POSIX_Thread_Translate_sched_param+0xa4> <== ALWAYS TAKEN 4a956: 7016 moveq #22,%d0 } return EINVAL; } 4a958: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 4a95e: 4e5e unlk %fp 4a960: 4e75 rts ... 0004994e <_POSIX_Threads_Create_extension>: bool _POSIX_Threads_Create_extension( Thread_Control *executing __attribute__((unused)), Thread_Control *created ) { 4994e: 4e56 fff4 linkw %fp,#-12 49952: 48d7 1c00 moveml %a2-%a4,%sp@ POSIX_API_Control *api; POSIX_API_Control *executing_api; api = _Workspace_Allocate( sizeof( POSIX_API_Control ) ); 49956: 4878 00e4 pea e4 bool _POSIX_Threads_Create_extension( Thread_Control *executing __attribute__((unused)), Thread_Control *created ) { 4995a: 266e 000c moveal %fp@(12),%a3 POSIX_API_Control *api; POSIX_API_Control *executing_api; api = _Workspace_Allocate( sizeof( POSIX_API_Control ) ); 4995e: 4eb9 0004 7e9c jsr 47e9c <_Workspace_Allocate> if ( !api ) 49964: 588f addql #4,%sp ) { POSIX_API_Control *api; POSIX_API_Control *executing_api; api = _Workspace_Allocate( sizeof( POSIX_API_Control ) ); 49966: 2440 moveal %d0,%a2 if ( !api ) 49968: 4a80 tstl %d0 4996a: 6606 bnes 49972 <_POSIX_Threads_Create_extension+0x24> 4996c: 4200 clrb %d0 4996e: 6000 00c8 braw 49a38 <_POSIX_Threads_Create_extension+0xea> <== ALWAYS TAKEN return false; created->API_Extensions[ THREAD_API_POSIX ] = api; /* XXX check all fields are touched */ api->Attributes = _POSIX_Threads_Default_attributes; 49972: 4878 0038 pea 38 49976: 49f9 0004 d478 lea 4d478 ,%a4 4997c: 4879 0005 ab88 pea 5ab88 <_POSIX_Threads_Default_attributes> api = _Workspace_Allocate( sizeof( POSIX_API_Control ) ); if ( !api ) return false; created->API_Extensions[ THREAD_API_POSIX ] = api; 49982: 2740 010e movel %d0,%a3@(270) /* XXX check all fields are touched */ api->Attributes = _POSIX_Threads_Default_attributes; 49986: 2f00 movel %d0,%sp@- 49988: 4e94 jsr %a4@ api->detachstate = _POSIX_Threads_Default_attributes.detachstate; 4998a: 7001 moveq #1,%d0 4998c: 2540 0038 movel %d0,%a2@(56) api->schedpolicy = _POSIX_Threads_Default_attributes.schedpolicy; 49990: 2540 007c movel %d0,%a2@(124) api->schedparam = _POSIX_Threads_Default_attributes.schedparam; 49994: 4878 0018 pea 18 49998: 4879 0005 aba0 pea 5aba0 <_POSIX_Threads_Default_attributes+0x18> 4999e: 486a 0080 pea %a2@(128) 499a2: 4e94 jsr %a4@ * 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 499a4: 4fef 0018 lea %sp@(24),%sp /* 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; api->schedparam.sched_priority = 499a8: 4280 clrl %d0 499aa: 1039 0005 b712 moveb 5b712 ,%d0 499b0: 90ab 0014 subl %a3@(20),%d0 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 499b4: 41ea 00dc lea %a2@(220),%a0 * 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 499b8: 7207 moveq #7,%d1 /* 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; api->schedparam.sched_priority = 499ba: 2540 0080 movel %d0,%a2@(128) * 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 499be: 4280 clrl %d0 * * The check for class == 1 is debug. Should never really happen. */ /* XXX use signal constants */ api->signals_pending = 0; 499c0: 42aa 00c8 clrl %a2@(200) if ( _Objects_Get_API( created->Object.id ) == OBJECTS_POSIX_API 499c4: 102b 0008 moveb %a3@(8),%d0 499c8: 2548 00d8 movel %a0,%a2@(216) the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 499cc: 41ea 00d8 lea %a2@(216),%a0 499d0: c081 andl %d1,%d0 _POSIX_Priority_From_core( created->current_priority ); /* * POSIX 1003.1 1996, 18.2.2.2 */ api->cancelation_requested = 0; 499d2: 42aa 00d4 clrl %a2@(212) * 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 499d6: 123c 0003 moveb #3,%d1 499da: 2548 00e0 movel %a0,%a2@(224) /* * POSIX 1003.1 1996, 18.2.2.2 */ api->cancelation_requested = 0; api->cancelability_state = PTHREAD_CANCEL_ENABLE; 499de: 42aa 00cc clrl %a2@(204) api->cancelability_type = PTHREAD_CANCEL_DEFERRED; 499e2: 42aa 00d0 clrl %a2@(208) RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 499e6: 42aa 00dc clrl %a2@(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 499ea: b280 cmpl %d0,%d1 499ec: 6612 bnes 49a00 <_POSIX_Threads_Create_extension+0xb2> #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; 499ee: 2079 0005 cf7e moveal 5cf7e <_Thread_Executing>,%a0 499f4: 2068 010e moveal %a0@(270),%a0 499f8: 2568 00c4 00c4 movel %a0@(196),%a2@(196) 499fe: 6006 bras 49a06 <_POSIX_Threads_Create_extension+0xb8> <== ALWAYS TAKEN } else { api->signals_blocked = 0xffffffff; 49a00: 70ff moveq #-1,%d0 49a02: 2540 00c4 movel %d0,%a2@(196) } _Thread_queue_Initialize( 49a06: 42a7 clrl %sp@- 49a08: 4878 1000 pea 1000 49a0c: 42a7 clrl %sp@- 49a0e: 486a 003c pea %a2@(60) 49a12: 4eb9 0004 73a8 jsr 473a8 <_Thread_queue_Initialize> THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_JOIN_AT_EXIT, 0 ); _Watchdog_Initialize( 49a18: 222b 0008 movel %a3@(8),%d1 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 49a1c: 41f9 0004 9a86 lea 49a86 <_POSIX_Threads_Sporadic_budget_TSR>,%a0 _POSIX_Threads_Sporadic_budget_TSR, created->Object.id, created ); return true; 49a22: 4fef 0010 lea %sp@(16),%sp the_watchdog->id = id; the_watchdog->user_data = user_data; 49a26: 7001 moveq #1,%d0 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 49a28: 2548 00b8 movel %a0,%a2@(184) the_watchdog->id = id; the_watchdog->user_data = user_data; 49a2c: 254b 00c0 movel %a3,%a2@(192) void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; 49a30: 2541 00bc movel %d1,%a2@(188) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 49a34: 42aa 00a4 clrl %a2@(164) } 49a38: 4cee 1c00 fff4 moveml %fp@(-12),%a2-%a4 49a3e: 4e5e unlk %fp 49a40: 4e75 rts 000498da <_POSIX_Threads_Delete_extension>: */ void _POSIX_Threads_Delete_extension( Thread_Control *executing __attribute__((unused)), Thread_Control *deleted ) { 498da: 4e56 ffec linkw %fp,#-20 498de: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@ 498e2: 246e 000c moveal %fp@(12),%a2 /* * Wakeup all the tasks which joined with this one */ value_ptr = (void **) deleted->Wait.return_argument; while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) ) 498e6: 49f9 0004 7038 lea 47038 <_Thread_queue_Dequeue>,%a4 api = deleted->API_Extensions[ THREAD_API_POSIX ]; /* * Run the POSIX cancellation handlers */ _POSIX_Threads_cancel_run( deleted ); 498ec: 2f0a movel %a2,%sp@- { Thread_Control *the_thread; POSIX_API_Control *api; void **value_ptr; api = deleted->API_Extensions[ THREAD_API_POSIX ]; 498ee: 266a 010e moveal %a2@(270),%a3 /* * Wakeup all the tasks which joined with this one */ value_ptr = (void **) deleted->Wait.return_argument; while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) ) 498f2: 260b movel %a3,%d3 498f4: 0683 0000 003c addil #60,%d3 api = deleted->API_Extensions[ THREAD_API_POSIX ]; /* * Run the POSIX cancellation handlers */ _POSIX_Threads_cancel_run( deleted ); 498fa: 4eb9 0004 b96c jsr 4b96c <_POSIX_Threads_cancel_run> /* * Run all the key destructors */ _POSIX_Keys_Run_destructors( deleted ); 49900: 2f0a movel %a2,%sp@- 49902: 4eb9 0004 b9d0 jsr 4b9d0 <_POSIX_Keys_Run_destructors> /* * Wakeup all the tasks which joined with this one */ value_ptr = (void **) deleted->Wait.return_argument; 49908: 242a 0028 movel %a2@(40),%d2 while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) ) 4990c: 508f addql #8,%sp 4990e: 6008 bras 49918 <_POSIX_Threads_Delete_extension+0x3e> <== ALWAYS TAKEN *(void **)the_thread->Wait.return_argument = value_ptr; 49910: 2240 moveal %d0,%a1 49912: 2069 0028 moveal %a1@(40),%a0 49916: 2082 movel %d2,%a0@ /* * Wakeup all the tasks which joined with this one */ value_ptr = (void **) deleted->Wait.return_argument; while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) ) 49918: 2f03 movel %d3,%sp@- 4991a: 4e94 jsr %a4@ 4991c: 588f addql #4,%sp 4991e: 4a80 tstl %d0 49920: 66ee bnes 49910 <_POSIX_Threads_Delete_extension+0x36> *(void **)the_thread->Wait.return_argument = value_ptr; if ( api->schedpolicy == SCHED_SPORADIC ) 49922: 103c 0003 moveb #3,%d0 49926: b0ab 007c cmpl %a3@(124),%d0 4992a: 660c bnes 49938 <_POSIX_Threads_Delete_extension+0x5e> (void) _Watchdog_Remove( &api->Sporadic_timer ); 4992c: 486b 009c pea %a3@(156) 49930: 4eb9 0004 7d70 jsr 47d70 <_Watchdog_Remove> 49936: 588f addql #4,%sp deleted->API_Extensions[ THREAD_API_POSIX ] = NULL; 49938: 42aa 010e clrl %a2@(270) (void) _Workspace_Free( api ); 4993c: 2d4b 0008 movel %a3,%fp@(8) } 49940: 4cee 1c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a4 49946: 4e5e unlk %fp if ( api->schedpolicy == SCHED_SPORADIC ) (void) _Watchdog_Remove( &api->Sporadic_timer ); deleted->API_Extensions[ THREAD_API_POSIX ] = NULL; (void) _Workspace_Free( api ); 49948: 4ef9 0004 7eb8 jmp 47eb8 <_Workspace_Free> 000452cc <_POSIX_Threads_Initialize_user_threads_body>: * * Output parameters: NONE */ void _POSIX_Threads_Initialize_user_threads_body(void) { 452cc: 4e56 ffa0 linkw %fp,#-96 452d0: 48d7 3c7c moveml %d2-%d6/%a2-%a5,%sp@ uint32_t maximum; posix_initialization_threads_table *user_threads; pthread_t thread_id; pthread_attr_t attr; user_threads = Configuration_POSIX_API.User_initialization_threads_table; 452d4: 2479 0005 c6fe moveal 5c6fe ,%a2 maximum = Configuration_POSIX_API.number_of_initialization_threads; 452da: 2839 0005 c6fa movel 5c6fa ,%d4 if ( !user_threads || maximum == 0 ) 452e0: 4a8a tstl %a2 452e2: 676a beqs 4534e <_POSIX_Threads_Initialize_user_threads_body+0x82> <== ALWAYS TAKEN 452e4: 4a84 tstl %d4 452e6: 6766 beqs 4534e <_POSIX_Threads_Initialize_user_threads_body+0x82> <== ALWAYS TAKEN for ( index=0 ; index < maximum ; index++ ) { /* * There is no way for these calls to fail in this situation. */ (void) pthread_attr_init( &attr ); 452e8: 240e movel %fp,%d2 (void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); (void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size); status = pthread_create( 452ea: 2a0e movel %fp,%d5 pthread_attr_t attr; user_threads = Configuration_POSIX_API.User_initialization_threads_table; maximum = Configuration_POSIX_API.number_of_initialization_threads; if ( !user_threads || maximum == 0 ) 452ec: 4283 clrl %d3 for ( index=0 ; index < maximum ; index++ ) { /* * There is no way for these calls to fail in this situation. */ (void) pthread_attr_init( &attr ); 452ee: 0682 ffff ffc4 addil #-60,%d2 452f4: 2c3c 0004 a964 movel #305508,%d6 (void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); 452fa: 4bf9 0004 a990 lea 4a990 ,%a5 (void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size); 45300: 49f9 0004 a9c8 lea 4a9c8 ,%a4 status = pthread_create( 45306: 5985 subql #4,%d5 45308: 47f9 0004 5024 lea 45024 ,%a3 for ( index=0 ; index < maximum ; index++ ) { /* * There is no way for these calls to fail in this situation. */ (void) pthread_attr_init( &attr ); 4530e: 2f02 movel %d2,%sp@- 45310: 2046 moveal %d6,%a0 45312: 4e90 jsr %a0@ (void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); 45314: 4878 0002 pea 2 45318: 2f02 movel %d2,%sp@- 4531a: 4e95 jsr %a5@ (void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size); 4531c: 2f2a 0004 movel %a2@(4),%sp@- 45320: 2f02 movel %d2,%sp@- 45322: 4e94 jsr %a4@ status = pthread_create( 45324: 42a7 clrl %sp@- 45326: 2f12 movel %a2@,%sp@- 45328: 2f02 movel %d2,%sp@- 4532a: 2f05 movel %d5,%sp@- 4532c: 4e93 jsr %a3@ &thread_id, &attr, user_threads[ index ].thread_entry, NULL ); if ( status ) 4532e: 4fef 0024 lea %sp@(36),%sp 45332: 4a80 tstl %d0 45334: 6710 beqs 45346 <_POSIX_Threads_Initialize_user_threads_body+0x7a> _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status ); 45336: 2f00 movel %d0,%sp@- 45338: 4878 0001 pea 1 4533c: 4878 0002 pea 2 45340: 4eb9 0004 6eac jsr 46eac <_Internal_error_Occurred> * * Setting the attributes explicitly is critical, since we don't want * to inherit the idle tasks attributes. */ for ( index=0 ; index < maximum ; index++ ) { 45346: 5283 addql #1,%d3 45348: 508a addql #8,%a2 4534a: b883 cmpl %d3,%d4 4534c: 62c0 bhis 4530e <_POSIX_Threads_Initialize_user_threads_body+0x42> <== ALWAYS TAKEN NULL ); if ( status ) _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status ); } } 4534e: 4cee 3c7c ffa0 moveml %fp@(-96),%d2-%d6/%a2-%a5 45354: 4e5e unlk %fp 45356: 4e75 rts 00049a86 <_POSIX_Threads_Sporadic_budget_TSR>: */ void _POSIX_Threads_Sporadic_budget_TSR( Objects_Id id __attribute__((unused)), void *argument ) { 49a86: 4e56 0000 linkw %fp,#0 49a8a: 2f0b movel %a3,%sp@- 49a8c: 2f0a movel %a2,%sp@- 49a8e: 246e 000c moveal %fp@(12),%a2 Thread_Control *the_thread; POSIX_API_Control *api; the_thread = argument; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 49a92: 266a 010e moveal %a2@(270),%a3 /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.ss_initial_budget ); 49a96: 486b 0090 pea %a3@(144) 49a9a: 4eb9 0004 ab08 jsr 4ab08 <_Timespec_To_ticks> */ #if 0 printk( "TSR %d %d %d\n", the_thread->resource_count, the_thread->current_priority, new_priority ); #endif if ( the_thread->resource_count == 0 ) { 49aa0: 588f addql #4,%sp 49aa2: 4281 clrl %d1 49aa4: 1239 0005 b712 moveb 5b712 ,%d1 49aaa: 92ab 0098 subl %a3@(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; 49aae: 2540 0076 movel %d0,%a2@(118) new_priority = _POSIX_Priority_To_core( api->ss_high_priority ); the_thread->real_priority = new_priority; 49ab2: 2541 0018 movel %d1,%a2@(24) */ #if 0 printk( "TSR %d %d %d\n", the_thread->resource_count, the_thread->current_priority, new_priority ); #endif if ( the_thread->resource_count == 0 ) { 49ab6: 4aaa 001c tstl %a2@(28) 49aba: 6618 bnes 49ad4 <_POSIX_Threads_Sporadic_budget_TSR+0x4e> <== ALWAYS TAKEN /* * If this would make them less important, then do not change it. */ if ( the_thread->current_priority > new_priority ) { 49abc: b2aa 0014 cmpl %a2@(20),%d1 49ac0: 6412 bccs 49ad4 <_POSIX_Threads_Sporadic_budget_TSR+0x4e> _Thread_Change_priority( the_thread, new_priority, true ); 49ac2: 4878 0001 pea 1 49ac6: 2f01 movel %d1,%sp@- 49ac8: 2f0a movel %a2,%sp@- 49aca: 4eb9 0004 67f4 jsr 467f4 <_Thread_Change_priority> 49ad0: 4fef 000c lea %sp@(12),%sp #endif } } /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.ss_replenish_period ); 49ad4: 486b 0088 pea %a3@(136) 49ad8: 4eb9 0004 ab08 jsr 4ab08 <_Timespec_To_ticks> _Watchdog_Insert_ticks( &api->Sporadic_timer, ticks ); } 49ade: 246e fff8 moveal %fp@(-8),%a2 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 49ae2: 588f addql #4,%sp Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 49ae4: 2740 00a8 movel %d0,%a3@(168) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 49ae8: 47eb 009c lea %a3@(156),%a3 49aec: 203c 0005 cf9c movel #380828,%d0 49af2: 2d4b 000c movel %a3,%fp@(12) 49af6: 266e fffc moveal %fp@(-4),%a3 49afa: 2d40 0008 movel %d0,%fp@(8) 49afe: 4e5e unlk %fp 49b00: 4ef9 0004 7c54 jmp 47c54 <_Watchdog_Insert> ... 00049a42 <_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); 49a42: 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 */ 49a44: 72ff moveq #-1,%d1 * _POSIX_Threads_Sporadic_budget_callout */ void _POSIX_Threads_Sporadic_budget_callout( Thread_Control *the_thread ) { 49a46: 4e56 0000 linkw %fp,#0 49a4a: 206e 0008 moveal %fp@(8),%a0 49a4e: 1039 0005 b712 moveb 5b712 ,%d0 POSIX_API_Control *api; uint32_t new_priority; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 49a54: 2268 010e moveal %a0@(270),%a1 49a58: 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 */ 49a5c: 2141 0076 movel %d1,%a0@(118) new_priority = _POSIX_Priority_To_core( api->schedparam.ss_low_priority ); the_thread->real_priority = new_priority; 49a60: 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 ) { 49a64: 4aa8 001c tstl %a0@(28) 49a68: 6618 bnes 49a82 <_POSIX_Threads_Sporadic_budget_callout+0x40> <== 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 ) { 49a6a: b0a8 0014 cmpl %a0@(20),%d0 49a6e: 6312 blss 49a82 <_POSIX_Threads_Sporadic_budget_callout+0x40> _Thread_Change_priority( the_thread, new_priority, true ); 49a70: 4878 0001 pea 1 49a74: 2f00 movel %d0,%sp@- 49a76: 2f08 movel %a0,%sp@- 49a78: 4eb9 0004 67f4 jsr 467f4 <_Thread_Change_priority> 49a7e: 4fef 000c lea %sp@(12),%sp #if 0 printk( "lower priority\n" ); #endif } } } 49a82: 4e5e unlk %fp 49a84: 4e75 rts 0004b96c <_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; 4b96c: 7001 moveq #1,%d0 #include void _POSIX_Threads_cancel_run( Thread_Control *the_thread ) { 4b96e: 4e56 ffec linkw %fp,#-20 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 ]; 4b972: 206e 0008 moveal %fp@(8),%a0 #include void _POSIX_Threads_cancel_run( Thread_Control *the_thread ) { 4b976: 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 ]; 4b97a: 2468 010e moveal %a0@(270),%a2 handler_stack = &thread_support->Cancellation_Handlers; thread_support->cancelability_state = PTHREAD_CANCEL_DISABLE; while ( !_Chain_Is_empty( handler_stack ) ) { _ISR_Disable( level ); 4b97e: 243c 0000 0700 movel #1792,%d2 _Chain_Extract_unprotected( &handler->Node ); _ISR_Enable( level ); (*handler->routine)( handler->arg ); _Workspace_Free( handler ); 4b984: 49f9 0004 7eb8 lea 47eb8 <_Workspace_Free>,%a4 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4b98a: 47ea 00dc lea %a2@(220),%a3 thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; handler_stack = &thread_support->Cancellation_Handlers; thread_support->cancelability_state = PTHREAD_CANCEL_DISABLE; 4b98e: 2540 00cc movel %d0,%a2@(204) while ( !_Chain_Is_empty( handler_stack ) ) { 4b992: 6028 bras 4b9bc <_POSIX_Threads_cancel_run+0x50> <== ALWAYS TAKEN _ISR_Disable( level ); 4b994: 40c1 movew %sr,%d1 4b996: 8081 orl %d1,%d0 4b998: 46c0 movew %d0,%sr handler = (POSIX_Cancel_Handler_control *) 4b99a: 2a6b 0004 moveal %a3@(4),%a5 ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 4b99e: 2055 moveal %a5@,%a0 previous = the_node->previous; 4b9a0: 226d 0004 moveal %a5@(4),%a1 next->previous = previous; previous->next = next; 4b9a4: 2288 movel %a0,%a1@ Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 4b9a6: 2149 0004 movel %a1,%a0@(4) _Chain_Tail( handler_stack )->previous; _Chain_Extract_unprotected( &handler->Node ); _ISR_Enable( level ); 4b9aa: 46c1 movew %d1,%sr (*handler->routine)( handler->arg ); 4b9ac: 2f2d 000c movel %a5@(12),%sp@- 4b9b0: 206d 0008 moveal %a5@(8),%a0 4b9b4: 4e90 jsr %a0@ _Workspace_Free( handler ); 4b9b6: 2f0d movel %a5,%sp@- 4b9b8: 4e94 jsr %a4@ 4b9ba: 508f addql #8,%sp handler_stack = &thread_support->Cancellation_Handlers; thread_support->cancelability_state = PTHREAD_CANCEL_DISABLE; while ( !_Chain_Is_empty( handler_stack ) ) { _ISR_Disable( level ); 4b9bc: 2002 movel %d2,%d0 POSIX_API_Control *thread_support; ISR_Level level; thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; handler_stack = &thread_support->Cancellation_Handlers; 4b9be: b7ea 00d8 cmpal %a2@(216),%a3 4b9c2: 66d0 bnes 4b994 <_POSIX_Threads_cancel_run+0x28> (*handler->routine)( handler->arg ); _Workspace_Free( handler ); } } 4b9c4: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 4b9ca: 4e5e unlk %fp 4b9cc: 4e75 rts ... 00044e64 <_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) { 44e64: 4e56 0000 linkw %fp,#0 44e68: 2f0a movel %a2,%sp@- 44e6a: 246e 000c moveal %fp@(12),%a2 bool activated; ptimer = (POSIX_Timer_Control *)data; /* Increment the number of expirations. */ ptimer->overrun = ptimer->overrun + 1; 44e6e: 52aa 0066 addql #1,%a2@(102) /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || 44e72: 4aaa 0052 tstl %a2@(82) 44e76: 6606 bnes 44e7e <_POSIX_Timer_TSR+0x1a> ( ptimer->timer_data.it_interval.tv_nsec != 0 ) ) { 44e78: 4aaa 0056 tstl %a2@(86) 44e7c: 6732 beqs 44eb0 <_POSIX_Timer_TSR+0x4c> <== ALWAYS TAKEN activated = _POSIX_Timer_Insert_helper( 44e7e: 2f0a movel %a2,%sp@- 44e80: 4879 0004 4e64 pea 44e64 <_POSIX_Timer_TSR> 44e86: 2f2a 0008 movel %a2@(8),%sp@- 44e8a: 2f2a 0062 movel %a2@(98),%sp@- 44e8e: 486a 0010 pea %a2@(16) 44e92: 4eb9 0004 a3b0 jsr 4a3b0 <_POSIX_Timer_Insert_helper> ptimer->ticks, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) 44e98: 4fef 0014 lea %sp@(20),%sp 44e9c: 4a00 tstb %d0 44e9e: 672a beqs 44eca <_POSIX_Timer_TSR+0x66> <== ALWAYS TAKEN return; /* Store the time when the timer was started again */ _TOD_Get( &ptimer->time ); 44ea0: 486a 006a pea %a2@(106) 44ea4: 4eb9 0004 6348 jsr 46348 <_TOD_Get> /* Increment the number of expirations. */ ptimer->overrun = ptimer->overrun + 1; /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || 44eaa: 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; 44eac: 7003 moveq #3,%d0 44eae: 6002 bras 44eb2 <_POSIX_Timer_TSR+0x4e> <== ALWAYS TAKEN } else { /* Indicates that the timer is stopped */ ptimer->state = POSIX_TIMER_STATE_CREATE_STOP; 44eb0: 7004 moveq #4,%d0 <== NOT EXECUTED 44eb2: 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 ) ) { 44eb6: 2f2a 0042 movel %a2@(66),%sp@- 44eba: 2f2a 0038 movel %a2@(56),%sp@- 44ebe: 4eb9 0004 9fa8 jsr 49fa8 } /* After the signal handler returns, the count of expirations of the * timer must be set to 0. */ ptimer->overrun = 0; 44ec4: 508f addql #8,%sp 44ec6: 42aa 0066 clrl %a2@(102) } 44eca: 246e fffc moveal %fp@(-4),%a2 44ece: 4e5e unlk %fp 44ed0: 4e75 rts ... 0004ba70 <_POSIX_signals_Check_signal>: ) { siginfo_t siginfo_struct; sigset_t saved_signals_blocked; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 4ba70: 4280 clrl %d0 bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 4ba72: 4e56 ffdc linkw %fp,#-36 siginfo_t siginfo_struct; sigset_t saved_signals_blocked; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 4ba76: 102e 0013 moveb %fp@(19),%d0 bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 4ba7a: 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, 4ba7e: 4878 0001 pea 1 4ba82: 260e movel %fp,%d3 4ba84: 0683 ffff fff4 addil #-12,%d3 4ba8a: 2f00 movel %d0,%sp@- bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 4ba8c: 242e 000c movel %fp@(12),%d2 siginfo_t siginfo_struct; sigset_t saved_signals_blocked; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 4ba90: 2f03 movel %d3,%sp@- bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 4ba92: 246e 0008 moveal %fp@(8),%a2 siginfo_t siginfo_struct; sigset_t saved_signals_blocked; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 4ba96: 2f02 movel %d2,%sp@- 4ba98: 2f0a movel %a2,%sp@- 4ba9a: 4eb9 0004 bb0c jsr 4bb0c <_POSIX_signals_Clear_signals> 4baa0: 4fef 0014 lea %sp@(20),%sp 4baa4: 4a00 tstb %d0 4baa6: 6758 beqs 4bb00 <_POSIX_signals_Check_signal+0x90> #endif /* * Just to prevent sending a signal which is currently being ignored. */ if ( _POSIX_signals_Vectors[ signo ].sa_handler == SIG_IGN ) 4baa8: 2202 movel %d2,%d1 4baaa: 2002 movel %d2,%d0 4baac: 43f9 0005 d372 lea 5d372 <_POSIX_signals_Vectors>,%a1 4bab2: e589 lsll #2,%d1 4bab4: e988 lsll #4,%d0 4bab6: 9081 subl %d1,%d0 4bab8: 2040 moveal %d0,%a0 4baba: d1fc 0005 d37a addal #381818,%a0 4bac0: 7201 moveq #1,%d1 4bac2: 2050 moveal %a0@,%a0 4bac4: b288 cmpl %a0,%d1 4bac6: 6738 beqs 4bb00 <_POSIX_signals_Check_signal+0x90> <== ALWAYS TAKEN /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; 4bac8: 2842 moveal %d2,%a4 4baca: 47f4 2a01 lea %a4@(00000001,%d2:l:2),%a3 return false; /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; 4bace: 282a 00c4 movel %a2@(196),%d4 api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; 4bad2: 2231 bc00 movel %a1@(00000000,%a3:l:4),%d1 4bad6: 8284 orl %d4,%d1 4bad8: 2541 00c4 movel %d1,%a2@(196) /* * Here, the signal handler function executes */ switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) { 4badc: 7202 moveq #2,%d1 4bade: b2b1 0800 cmpl %a1@(00000000,%d0:l),%d1 4bae2: 660e bnes 4baf2 <_POSIX_signals_Check_signal+0x82> case SA_SIGINFO: (*_POSIX_signals_Vectors[ signo ].sa_sigaction)( 4bae4: 42a7 clrl %sp@- 4bae6: 2f03 movel %d3,%sp@- 4bae8: 2f02 movel %d2,%sp@- 4baea: 4e90 jsr %a0@ signo, &siginfo_struct, NULL /* context is undefined per 1003.1b-1993, p. 66 */ ); break; 4baec: 4fef 000c lea %sp@(12),%sp 4baf0: 6006 bras 4baf8 <_POSIX_signals_Check_signal+0x88> <== ALWAYS TAKEN default: (*_POSIX_signals_Vectors[ signo ].sa_handler)( signo ); 4baf2: 2f02 movel %d2,%sp@- 4baf4: 4e90 jsr %a0@ 4baf6: 588f addql #4,%sp } /* * Restore the previous set of blocked signals */ api->signals_blocked = saved_signals_blocked; 4baf8: 2544 00c4 movel %d4,%a2@(196) 4bafc: 7001 moveq #1,%d0 return true; 4bafe: 6002 bras 4bb02 <_POSIX_signals_Check_signal+0x92> <== ALWAYS TAKEN 4bb00: 4200 clrb %d0 } 4bb02: 4cee 1c1c ffdc moveml %fp@(-36),%d2-%d4/%a2-%a4 4bb08: 4e5e unlk %fp 4bb0a: 4e75 rts 0004c9a8 <_POSIX_signals_Clear_process_signals>: clear_signal = true; mask = signo_to_mask( signo ); ISR_Level level; _ISR_Disable( level ); 4c9a8: 203c 0000 0700 movel #1792,%d0 */ void _POSIX_signals_Clear_process_signals( int signo ) { 4c9ae: 4e56 0000 linkw %fp,#0 4c9b2: 222e 0008 movel %fp@(8),%d1 4c9b6: 2f03 movel %d3,%sp@- 4c9b8: 2f02 movel %d2,%sp@- clear_signal = true; mask = signo_to_mask( signo ); ISR_Level level; _ISR_Disable( level ); 4c9ba: 40c2 movew %sr,%d2 4c9bc: 8082 orl %d2,%d0 4c9be: 46c0 movew %d0,%sr if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { 4c9c0: 2601 movel %d1,%d3 4c9c2: 2001 movel %d1,%d0 4c9c4: 41f9 0005 d372 lea 5d372 <_POSIX_signals_Vectors>,%a0 4c9ca: e58b lsll #2,%d3 4c9cc: e988 lsll #4,%d0 4c9ce: 9083 subl %d3,%d0 4c9d0: 7602 moveq #2,%d3 4c9d2: b6b0 0800 cmpl %a0@(00000000,%d0:l),%d3 4c9d6: 6610 bnes 4c9e8 <_POSIX_signals_Clear_process_signals+0x40> if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) 4c9d8: 2040 moveal %d0,%a0 4c9da: d1fc 0005 d542 addal #382274,%a0 4c9e0: 2008 movel %a0,%d0 4c9e2: 5880 addql #4,%d0 4c9e4: b090 cmpl %a0@,%d0 4c9e6: 661c bnes 4ca04 <_POSIX_signals_Clear_process_signals+0x5c> <== ALWAYS TAKEN clear_signal = false; } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; 4c9e8: 5381 subql #1,%d1 4c9ea: 7001 moveq #1,%d0 4c9ec: e3a8 lsll %d1,%d0 4c9ee: 4680 notl %d0 4c9f0: c0b9 0005 d53e andl 5d53e <_POSIX_signals_Pending>,%d0 4c9f6: 23c0 0005 d53e movel %d0,5d53e <_POSIX_signals_Pending> if ( !_POSIX_signals_Pending ) 4c9fc: 6606 bnes 4ca04 <_POSIX_signals_Clear_process_signals+0x5c> <== ALWAYS TAKEN _Thread_Do_post_task_switch_extension--; 4c9fe: 53b9 0005 cf66 subql #1,5cf66 <_Thread_Do_post_task_switch_extension> } _ISR_Enable( level ); 4ca04: 46c2 movew %d2,%sr } 4ca06: 241f movel %sp@+,%d2 4ca08: 261f movel %sp@+,%d3 4ca0a: 4e5e unlk %fp 4ca0c: 4e75 rts ... 0004bb0c <_POSIX_signals_Clear_signals>: static inline sigset_t signo_to_mask( uint32_t sig ) { return 1u << (sig - 1); 4bb0c: 7001 moveq #1,%d0 int signo, siginfo_t *info, bool is_global, bool check_blocked ) { 4bb0e: 4e56 ffec linkw %fp,#-20 4bb12: 206e 0008 moveal %fp@(8),%a0 4bb16: 48d7 043c moveml %d2-%d5/%a2,%sp@ 4bb1a: 242e 000c movel %fp@(12),%d2 4bb1e: 2202 movel %d2,%d1 4bb20: 5381 subql #1,%d1 4bb22: 1a2e 0017 moveb %fp@(23),%d5 4bb26: 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 ) 4bb28: 4a2e 001b tstb %fp@(27) 4bb2c: 6604 bnes 4bb32 <_POSIX_signals_Clear_signals+0x26> 4bb2e: 78ff moveq #-1,%d4 4bb30: 6006 bras 4bb38 <_POSIX_signals_Clear_signals+0x2c> <== ALWAYS TAKEN signals_blocked = ~api->signals_blocked; 4bb32: 2828 00c4 movel %a0@(196),%d4 4bb36: 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 ); 4bb38: 223c 0000 0700 movel #1792,%d1 4bb3e: 40c3 movew %sr,%d3 4bb40: 8283 orl %d3,%d1 4bb42: 46c1 movew %d1,%sr if ( is_global ) { 4bb44: 4a05 tstb %d5 4bb46: 6700 008a beqw 4bbd2 <_POSIX_signals_Clear_signals+0xc6> if ( mask & (_POSIX_signals_Pending & signals_blocked) ) { 4bb4a: c0b9 0005 d53e andl 5d53e <_POSIX_signals_Pending>,%d0 4bb50: c084 andl %d4,%d0 4bb52: 6700 0096 beqw 4bbea <_POSIX_signals_Clear_signals+0xde> if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { 4bb56: 2202 movel %d2,%d1 4bb58: 2002 movel %d2,%d0 4bb5a: 41f9 0005 d372 lea 5d372 <_POSIX_signals_Vectors>,%a0 4bb60: e589 lsll #2,%d1 4bb62: e988 lsll #4,%d0 4bb64: 9081 subl %d1,%d0 4bb66: 7202 moveq #2,%d1 4bb68: b2b0 0800 cmpl %a0@(00000000,%d0:l),%d1 4bb6c: 6658 bnes 4bbc6 <_POSIX_signals_Clear_signals+0xba> psiginfo = (POSIX_signals_Siginfo_node *) 4bb6e: 2040 moveal %d0,%a0 4bb70: d1fc 0005 d542 addal #382274,%a0 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 4bb76: 2248 moveal %a0,%a1 4bb78: 2459 moveal %a1@+,%a2 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4bb7a: b3ca cmpal %a2,%a1 4bb7c: 6604 bnes 4bb82 <_POSIX_signals_Clear_signals+0x76> 4bb7e: 95ca subal %a2,%a2 4bb80: 6008 bras 4bb8a <_POSIX_signals_Clear_signals+0x7e> <== ALWAYS TAKEN { Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; 4bb82: 2252 moveal %a2@,%a1 the_chain->first = new_first; 4bb84: 2089 movel %a1,%a0@ new_first->previous = _Chain_Head(the_chain); 4bb86: 2348 0004 movel %a0,%a1@(4) _Chain_Get_unprotected( &_POSIX_signals_Siginfo[ signo ] ); _POSIX_signals_Clear_process_signals( signo ); 4bb8a: 2f02 movel %d2,%sp@- 4bb8c: 4eb9 0004 c9a8 jsr 4c9a8 <_POSIX_signals_Clear_process_signals> /* * 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 ) { 4bb92: 588f addql #4,%sp 4bb94: 4a8a tstl %a2 4bb96: 672e beqs 4bbc6 <_POSIX_signals_Clear_signals+0xba> *info = psiginfo->Info; 4bb98: 4878 000c pea c 4bb9c: 486a 0008 pea %a2@(8) 4bba0: 2f2e 0010 movel %fp@(16),%sp@- 4bba4: 4eb9 0004 d478 jsr 4d478 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; 4bbaa: 4fef 000c lea %sp@(12),%sp Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 4bbae: 24bc 0005 d4f6 movel #382198,%a2@ old_last_node = the_chain->last; 4bbb4: 2079 0005 d4fa moveal 5d4fa <_POSIX_signals_Inactive_siginfo+0x8>,%a0 the_chain->last = the_node; 4bbba: 23ca 0005 d4fa movel %a2,5d4fa <_POSIX_signals_Inactive_siginfo+0x8> old_last_node->next = the_node; the_node->previous = old_last_node; 4bbc0: 2548 0004 movel %a0,%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; 4bbc4: 208a movel %a2,%a0@ &psiginfo->Node ); } else do_callout = false; } _POSIX_signals_Clear_process_signals( signo ); 4bbc6: 2f02 movel %d2,%sp@- 4bbc8: 4eb9 0004 c9a8 jsr 4c9a8 <_POSIX_signals_Clear_process_signals> 4bbce: 588f addql #4,%sp 4bbd0: 6014 bras 4bbe6 <_POSIX_signals_Clear_signals+0xda> <== ALWAYS TAKEN do_callout = true; } } else { if ( mask & (api->signals_pending & signals_blocked) ) { 4bbd2: 2428 00c8 movel %a0@(200),%d2 4bbd6: 2200 movel %d0,%d1 4bbd8: c282 andl %d2,%d1 4bbda: c284 andl %d4,%d1 4bbdc: 670c beqs 4bbea <_POSIX_signals_Clear_signals+0xde> api->signals_pending &= ~mask; 4bbde: 4680 notl %d0 4bbe0: c082 andl %d2,%d0 4bbe2: 2140 00c8 movel %d0,%a0@(200) 4bbe6: 7001 moveq #1,%d0 4bbe8: 6002 bras 4bbec <_POSIX_signals_Clear_signals+0xe0> <== ALWAYS TAKEN 4bbea: 4200 clrb %d0 do_callout = true; } } _ISR_Enable( level ); 4bbec: 46c3 movew %d3,%sr return do_callout; } 4bbee: 4cee 043c ffec moveml %fp@(-20),%d2-%d5/%a2 4bbf4: 4e5e unlk %fp 4bbf6: 4e75 rts 00045968 <_POSIX_signals_Get_highest>: #include int _POSIX_signals_Get_highest( sigset_t set ) { 45968: 701b moveq #27,%d0 4596a: 4e56 fff4 linkw %fp,#-12 4596e: 48d7 001c moveml %d2-%d4,%sp@ 45972: 242e 0008 movel %fp@(8),%d2 int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { if ( set & signo_to_mask( signo ) ) { 45976: 7601 moveq #1,%d3 45978: 2200 movel %d0,%d1 4597a: 5381 subql #1,%d1 4597c: 2803 movel %d3,%d4 4597e: e3ac lsll %d1,%d4 45980: 2204 movel %d4,%d1 45982: c282 andl %d2,%d1 45984: 6626 bnes 459ac <_POSIX_signals_Get_highest+0x44> <== ALWAYS TAKEN sigset_t set ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 45986: 5280 addql #1,%d0 45988: 123c 0020 moveb #32,%d1 4598c: b280 cmpl %d0,%d1 4598e: 66e8 bnes 45978 <_POSIX_signals_Get_highest+0x10> 45990: 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 ) ) { 45992: 7601 moveq #1,%d3 45994: 2200 movel %d0,%d1 45996: 5381 subql #1,%d1 45998: 2803 movel %d3,%d4 4599a: e3ac lsll %d1,%d4 4599c: 2204 movel %d4,%d1 4599e: c282 andl %d2,%d1 459a0: 660a bnes 459ac <_POSIX_signals_Get_highest+0x44> */ #if (SIGHUP != 1) #error "Assumption that SIGHUP==1 violated!!" #endif for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { 459a2: 5280 addql #1,%d0 459a4: 123c 001b moveb #27,%d1 459a8: b280 cmpl %d0,%d1 459aa: 66e8 bnes 45994 <_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; } 459ac: 4cd7 001c moveml %sp@,%d2-%d4 459b0: 4e5e unlk %fp 459b2: 4e75 rts 00049694 <_POSIX_signals_Manager_Initialization>: * * _POSIX_signals_Manager_Initialization */ void _POSIX_signals_Manager_Initialization(void) { 49694: 4e56 0000 linkw %fp,#0 49698: 2f02 movel %d2,%sp@- assert( sizeof(_POSIX_signals_Vectors) == sizeof(_POSIX_signals_Default_vectors) ); #endif memcpy( 4969a: 4878 0180 pea 180 4969e: 4879 0005 aa08 pea 5aa08 <_POSIX_signals_Default_vectors> 496a4: 4879 0005 d372 pea 5d372 <_POSIX_signals_Vectors> void _POSIX_signals_Manager_Initialization(void) { uint32_t signo; uint32_t maximum_queued_signals; maximum_queued_signals = Configuration_POSIX_API.maximum_queued_signals; 496aa: 2439 0005 bd16 movel 5bd16 ,%d2 assert( sizeof(_POSIX_signals_Vectors) == sizeof(_POSIX_signals_Default_vectors) ); #endif memcpy( 496b0: 4eb9 0004 d478 jsr 4d478 ); /* * Initialize the set of pending signals for the entire process */ sigemptyset( &_POSIX_signals_Pending ); 496b6: 4879 0005 d53e pea 5d53e <_POSIX_signals_Pending> 496bc: 4eb9 0004 9b70 jsr 49b70 /* * Initialize the queue we use to block for signals */ _Thread_queue_Initialize( 496c2: 4878 000b pea b 496c6: 2f3c 1000 8000 movel #268468224,%sp@- 496cc: 42a7 clrl %sp@- 496ce: 4879 0005 d4fe pea 5d4fe <_POSIX_signals_Wait_queue> 496d4: 4eb9 0004 73a8 jsr 473a8 <_Thread_queue_Initialize> /*PAGE * * _POSIX_signals_Manager_Initialization */ void _POSIX_signals_Manager_Initialization(void) 496da: 4fef 0020 lea %sp@(32),%sp sigemptyset( &_POSIX_signals_Pending ); /* * Initialize the queue we use to block for signals */ _Thread_queue_Initialize( 496de: 41f9 0005 d54e lea 5d54e <_POSIX_signals_Siginfo+0xc>,%a0 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 496e4: 2008 movel %a0,%d0 496e6: 5880 addql #4,%d0 the_chain->permanent_null = NULL; 496e8: 42a8 0004 clrl %a0@(4) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 496ec: 2080 movel %d0,%a0@ the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 496ee: 2148 0008 movel %a0,%a0@(8) 496f2: 41e8 000c lea %a0@(12),%a0 /* XXX status codes */ /* * Allocate the siginfo pools. */ for ( signo=1 ; signo<= SIGRTMAX ; signo++ ) 496f6: b1fc 0005 d6c2 cmpal #382658,%a0 496fc: 66e6 bnes 496e4 <_POSIX_signals_Manager_Initialization+0x50> _Chain_Initialize_empty( &_POSIX_signals_Siginfo[ signo ] ); if ( maximum_queued_signals ) { 496fe: 4a82 tstl %d2 49700: 672a beqs 4972c <_POSIX_signals_Manager_Initialization+0x98> _Chain_Initialize( 49702: 2002 movel %d2,%d0 49704: e988 lsll #4,%d0 49706: 2040 moveal %d0,%a0 49708: 4870 2c00 pea %a0@(00000000,%d2:l:4) 4970c: 4eb9 0004 7e68 jsr 47e68 <_Workspace_Allocate_or_fatal_error> 49712: 4878 0014 pea 14 49716: 2f02 movel %d2,%sp@- 49718: 2f00 movel %d0,%sp@- 4971a: 4879 0005 d4f2 pea 5d4f2 <_POSIX_signals_Inactive_siginfo> 49720: 4eb9 0004 a188 jsr 4a188 <_Chain_Initialize> 49726: 4fef 0014 lea %sp@(20),%sp 4972a: 601e bras 4974a <_POSIX_signals_Manager_Initialization+0xb6> <== ALWAYS TAKEN 4972c: 41f9 0005 d4f2 lea 5d4f2 <_POSIX_signals_Inactive_siginfo>,%a0 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 49732: 203c 0005 d4f6 movel #382198,%d0 the_chain->permanent_null = NULL; 49738: 42b9 0005 d4f6 clrl 5d4f6 <_POSIX_signals_Inactive_siginfo+0x4> */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 4973e: 23c0 0005 d4f2 movel %d0,5d4f2 <_POSIX_signals_Inactive_siginfo> the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 49744: 23c8 0005 d4fa movel %a0,5d4fa <_POSIX_signals_Inactive_siginfo+0x8> /* * Initialize the Alarm Timer */ _Watchdog_Initialize( &_POSIX_signals_Alarm_timer, NULL, 0, NULL ); _Watchdog_Initialize( &_POSIX_signals_Ualarm_timer, NULL, 0, NULL ); } 4974a: 242e fffc movel %fp@(-4),%d2 4974e: 4e5e unlk %fp Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 49750: 42b9 0005 d738 clrl 5d738 <_POSIX_signals_Alarm_timer+0x8> the_watchdog->routine = routine; 49756: 42b9 0005 d74c clrl 5d74c <_POSIX_signals_Alarm_timer+0x1c> the_watchdog->id = id; 4975c: 42b9 0005 d750 clrl 5d750 <_POSIX_signals_Alarm_timer+0x20> the_watchdog->user_data = user_data; 49762: 42b9 0005 d754 clrl 5d754 <_POSIX_signals_Alarm_timer+0x24> Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 49768: 42b9 0005 d6ca clrl 5d6ca <_POSIX_signals_Ualarm_timer+0x8> the_watchdog->routine = routine; 4976e: 42b9 0005 d6de clrl 5d6de <_POSIX_signals_Ualarm_timer+0x1c> the_watchdog->id = id; 49774: 42b9 0005 d6e2 clrl 5d6e2 <_POSIX_signals_Ualarm_timer+0x20> the_watchdog->user_data = user_data; 4977a: 42b9 0005 d6e6 clrl 5d6e6 <_POSIX_signals_Ualarm_timer+0x24> 49780: 4e75 rts 00049782 <_POSIX_signals_Post_switch_extension>: */ void _POSIX_signals_Post_switch_extension( Thread_Control *the_thread ) { 49782: 4e56 fff0 linkw %fp,#-16 POSIX_API_Control *api; int signo; ISR_Level level; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 49786: 206e 0008 moveal %fp@(8),%a0 */ void _POSIX_signals_Post_switch_extension( Thread_Control *the_thread ) { 4978a: 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 ]; 4978e: 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 ); 49792: 263c 0000 0700 movel #1792,%d3 break; } _ISR_Enable( level ); for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { _POSIX_signals_Check_signal( api, signo, false ); 49798: 47f9 0004 ba70 lea 4ba70 <_POSIX_signals_Check_signal>,%a3 * * The first thing done is to check there are any signals to be * processed at all. No point in doing this loop otherwise. */ while (1) { _ISR_Disable( level ); 4979e: 2003 movel %d3,%d0 497a0: 40c1 movew %sr,%d1 497a2: 8081 orl %d1,%d0 497a4: 46c0 movew %d0,%sr if ( !(~api->signals_blocked & (api->signals_pending | _POSIX_signals_Pending)) ) { 497a6: 2039 0005 d53e movel 5d53e <_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 & 497ac: 242a 00c4 movel %a2@(196),%d2 497b0: 4682 notl %d2 (api->signals_pending | _POSIX_signals_Pending)) ) { 497b2: 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 & 497b6: c082 andl %d2,%d0 497b8: 660c bnes 497c6 <_POSIX_signals_Post_switch_extension+0x44> (api->signals_pending | _POSIX_signals_Pending)) ) { _ISR_Enable( level ); 497ba: 46c1 movew %d1,%sr for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { _POSIX_signals_Check_signal( api, signo, false ); _POSIX_signals_Check_signal( api, signo, true ); } } } 497bc: 4cee 0c0c fff0 moveml %fp@(-16),%d2-%d3/%a2-%a3 497c2: 4e5e unlk %fp 497c4: 4e75 rts if ( !(~api->signals_blocked & (api->signals_pending | _POSIX_signals_Pending)) ) { _ISR_Enable( level ); break; } _ISR_Enable( level ); 497c6: 46c1 movew %d1,%sr 497c8: 741b moveq #27,%d2 for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { _POSIX_signals_Check_signal( api, signo, false ); 497ca: 42a7 clrl %sp@- 497cc: 2f02 movel %d2,%sp@- 497ce: 2f0a movel %a2,%sp@- 497d0: 4e93 jsr %a3@ _POSIX_signals_Check_signal( api, signo, true ); 497d2: 4878 0001 pea 1 497d6: 2f02 movel %d2,%sp@- _ISR_Enable( level ); break; } _ISR_Enable( level ); for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 497d8: 5282 addql #1,%d2 _POSIX_signals_Check_signal( api, signo, false ); _POSIX_signals_Check_signal( api, signo, true ); 497da: 2f0a movel %a2,%sp@- 497dc: 4e93 jsr %a3@ _ISR_Enable( level ); break; } _ISR_Enable( level ); for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 497de: 4fef 0018 lea %sp@(24),%sp 497e2: 7020 moveq #32,%d0 497e4: b082 cmpl %d2,%d0 497e6: 66e2 bnes 497ca <_POSIX_signals_Post_switch_extension+0x48> 497e8: 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 ); 497ea: 42a7 clrl %sp@- 497ec: 2f02 movel %d2,%sp@- 497ee: 2f0a movel %a2,%sp@- 497f0: 4e93 jsr %a3@ _POSIX_signals_Check_signal( api, signo, true ); 497f2: 4878 0001 pea 1 497f6: 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++ ) { 497f8: 5282 addql #1,%d2 _POSIX_signals_Check_signal( api, signo, false ); _POSIX_signals_Check_signal( api, signo, true ); 497fa: 2f0a movel %a2,%sp@- 497fc: 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++ ) { 497fe: 4fef 0018 lea %sp@(24),%sp 49802: 701b moveq #27,%d0 49804: b082 cmpl %d2,%d0 49806: 66e2 bnes 497ea <_POSIX_signals_Post_switch_extension+0x68> 49808: 6094 bras 4979e <_POSIX_signals_Post_switch_extension+0x1c> <== ALWAYS TAKEN 0004ca40 <_POSIX_signals_Unblock_thread>: 4ca40: 7001 moveq #1,%d0 bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, siginfo_t *info ) { 4ca42: 4e56 fff4 linkw %fp,#-12 4ca46: 226e 000c moveal %fp@(12),%a1 4ca4a: 48d7 040c moveml %d2-%d3/%a2,%sp@ 4ca4e: 246e 0008 moveal %fp@(8),%a2 4ca52: 2609 movel %a1,%d3 4ca54: 5383 subql #1,%d3 /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 4ca56: 242a 0010 movel %a2@(16),%d2 4ca5a: 0282 1000 8000 andil #268468224,%d2 bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, siginfo_t *info ) { 4ca60: 222e 0010 movel %fp@(16),%d1 POSIX_API_Control *api; sigset_t mask; siginfo_t *the_info = NULL; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4ca64: 206a 010e moveal %a2@(270),%a0 4ca68: e7a8 lsll %d3,%d0 /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 4ca6a: 0c82 1000 8000 cmpil #268468224,%d2 4ca70: 6652 bnes 4cac4 <_POSIX_signals_Unblock_thread+0x84> if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { 4ca72: 2400 movel %d0,%d2 4ca74: c4aa 0030 andl %a2@(48),%d2 4ca78: 660c bnes 4ca86 <_POSIX_signals_Unblock_thread+0x46> 4ca7a: 2428 00c4 movel %a0@(196),%d2 4ca7e: 4682 notl %d2 4ca80: c082 andl %d2,%d0 4ca82: 6700 00ac beqw 4cb30 <_POSIX_signals_Unblock_thread+0xf0> the_thread->Wait.return_code = EINTR; 4ca86: 7004 moveq #4,%d0 the_info = (siginfo_t *) the_thread->Wait.return_argument; 4ca88: 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; 4ca8c: 2540 0034 movel %d0,%a2@(52) the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { 4ca90: 4a81 tstl %d1 4ca92: 6610 bnes 4caa4 <_POSIX_signals_Unblock_thread+0x64> the_info->si_signo = signo; the_info->si_code = SI_USER; 4ca94: 123c 0001 moveb #1,%d1 the_thread->Wait.return_code = EINTR; the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { the_info->si_signo = signo; 4ca98: 2089 movel %a1,%a0@ the_info->si_code = SI_USER; the_info->si_value.sival_int = 0; 4ca9a: 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; 4ca9e: 2141 0004 movel %d1,%a0@(4) 4caa2: 6012 bras 4cab6 <_POSIX_signals_Unblock_thread+0x76> <== ALWAYS TAKEN the_info->si_value.sival_int = 0; } else { *the_info = *info; 4caa4: 4878 000c pea c 4caa8: 2f01 movel %d1,%sp@- 4caaa: 2f08 movel %a0,%sp@- 4caac: 4eb9 0004 d478 jsr 4d478 4cab2: 4fef 000c lea %sp@(12),%sp } _Thread_queue_Extract_with_proxy( the_thread ); 4cab6: 2f0a movel %a2,%sp@- 4cab8: 4eb9 0004 734c jsr 4734c <_Thread_queue_Extract_with_proxy> return true; 4cabe: 588f addql #4,%sp the_info->si_value.sival_int = 0; } else { *the_info = *info; } _Thread_queue_Extract_with_proxy( the_thread ); 4cac0: 7001 moveq #1,%d0 return true; 4cac2: 606e bras 4cb32 <_POSIX_signals_Unblock_thread+0xf2> <== ALWAYS TAKEN } /* * Thread is not waiting due to a sigwait. */ if ( ~api->signals_blocked & mask ) { 4cac4: 2228 00c4 movel %a0@(196),%d1 4cac8: 4681 notl %d1 4caca: c081 andl %d1,%d0 4cacc: 6762 beqs 4cb30 <_POSIX_signals_Unblock_thread+0xf0> * + Any other combination, do nothing. */ the_thread->do_post_task_switch_extension = true; if ( the_thread->current_state & STATES_INTERRUPTIBLE_BY_SIGNAL ) { 4cace: 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; 4cad2: 7201 moveq #1,%d1 4cad4: 1541 0074 moveb %d1,%a2@(116) if ( the_thread->current_state & STATES_INTERRUPTIBLE_BY_SIGNAL ) { 4cad8: 0800 001c btst #28,%d0 4cadc: 6736 beqs 4cb14 <_POSIX_signals_Unblock_thread+0xd4> the_thread->Wait.return_code = EINTR; 4cade: 7004 moveq #4,%d0 4cae0: 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) ){ 4cae4: 103c 0008 moveb #8,%d0 4cae8: c0aa 0010 andl %a2@(16),%d0 4caec: 6742 beqs 4cb30 <_POSIX_signals_Unblock_thread+0xf0> <== ALWAYS TAKEN if ( _Watchdog_Is_active( &the_thread->Timer ) ) 4caee: 7202 moveq #2,%d1 4caf0: b2aa 0050 cmpl %a2@(80),%d1 4caf4: 660c bnes 4cb02 <_POSIX_signals_Unblock_thread+0xc2> <== ALWAYS TAKEN (void) _Watchdog_Remove( &the_thread->Timer ); 4caf6: 486a 0048 pea %a2@(72) 4cafa: 4eb9 0004 7d70 jsr 47d70 <_Watchdog_Remove> 4cb00: 588f addql #4,%sp RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 4cb02: 2f3c 1003 fff8 movel #268697592,%sp@- 4cb08: 2f0a movel %a2,%sp@- 4cb0a: 4eb9 0004 6934 jsr 46934 <_Thread_Clear_state> 4cb10: 508f addql #8,%sp 4cb12: 601c bras 4cb30 <_POSIX_signals_Unblock_thread+0xf0> <== ALWAYS TAKEN _Thread_Unblock( the_thread ); } } else if ( the_thread->current_state == STATES_READY ) { 4cb14: 4a80 tstl %d0 4cb16: 6618 bnes 4cb30 <_POSIX_signals_Unblock_thread+0xf0> <== ALWAYS TAKEN if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 4cb18: 2039 0005 cf5e movel 5cf5e <_ISR_Nest_level>,%d0 4cb1e: 6710 beqs 4cb30 <_POSIX_signals_Unblock_thread+0xf0> 4cb20: b5f9 0005 cf7e cmpal 5cf7e <_Thread_Executing>,%a2 4cb26: 6608 bnes 4cb30 <_POSIX_signals_Unblock_thread+0xf0> <== ALWAYS TAKEN _ISR_Signals_to_thread_executing = true; 4cb28: 7001 moveq #1,%d0 4cb2a: 13c0 0005 d00c moveb %d0,5d00c <_ISR_Signals_to_thread_executing> 4cb30: 4200 clrb %d0 } } return false; } 4cb32: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 4cb38: 4e5e unlk %fp 4cb3a: 4e75 rts 00063fd0 <_Protected_heap_Get_information>: bool _Protected_heap_Get_information( Heap_Control *the_heap, Heap_Information_block *the_info ) { 63fd0: 4e56 0000 linkw %fp,#0 63fd4: 2f03 movel %d3,%sp@- 63fd6: 262e 000c movel %fp@(12),%d3 63fda: 2f02 movel %d2,%sp@- 63fdc: 242e 0008 movel %fp@(8),%d2 if ( !the_heap ) 63fe0: 672e beqs 64010 <_Protected_heap_Get_information+0x40> return false; if ( !the_info ) 63fe2: 4a83 tstl %d3 63fe4: 672a beqs 64010 <_Protected_heap_Get_information+0x40> return false; _RTEMS_Lock_allocator(); 63fe6: 2f39 0009 beaa movel 9beaa <_RTEMS_Allocator_Mutex>,%sp@- 63fec: 4eb9 0004 abcc jsr 4abcc <_API_Mutex_Lock> _Heap_Get_information( the_heap, the_info ); 63ff2: 2f03 movel %d3,%sp@- 63ff4: 2f02 movel %d2,%sp@- 63ff6: 4eb9 0007 20ac jsr 720ac <_Heap_Get_information> _RTEMS_Unlock_allocator(); 63ffc: 2f39 0009 beaa movel 9beaa <_RTEMS_Allocator_Mutex>,%sp@- 64002: 4eb9 0004 ac2c jsr 4ac2c <_API_Mutex_Unlock> return true; 64008: 4fef 0010 lea %sp@(16),%sp if ( !the_info ) return false; _RTEMS_Lock_allocator(); _Heap_Get_information( the_heap, the_info ); _RTEMS_Unlock_allocator(); 6400c: 7001 moveq #1,%d0 return true; 6400e: 6002 bras 64012 <_Protected_heap_Get_information+0x42> <== ALWAYS TAKEN 64010: 4200 clrb %d0 } 64012: 242e fff8 movel %fp@(-8),%d2 64016: 262e fffc movel %fp@(-4),%d3 6401a: 4e5e unlk %fp 6401c: 4e75 rts ... 0004a044 <_RTEMS_Tasks_Invoke_task_variable_dtor>: void _RTEMS_Tasks_Invoke_task_variable_dtor( Thread_Control *the_thread, rtems_task_variable_t *tvp ) { 4a044: 4e56 0000 linkw %fp,#0 void (*dtor)(void *); void *value; dtor = tvp->dtor; if (_Thread_Is_executing(the_thread)) { 4a048: 2039 0005 cf7e movel 5cf7e <_Thread_Executing>,%d0 void _RTEMS_Tasks_Invoke_task_variable_dtor( Thread_Control *the_thread, rtems_task_variable_t *tvp ) { 4a04e: 2f0a movel %a2,%sp@- 4a050: 246e 000c moveal %fp@(12),%a2 void (*dtor)(void *); void *value; dtor = tvp->dtor; 4a054: 206a 0010 moveal %a2@(16),%a0 if (_Thread_Is_executing(the_thread)) { 4a058: b0ae 0008 cmpl %fp@(8),%d0 4a05c: 660c bnes 4a06a <_RTEMS_Tasks_Invoke_task_variable_dtor+0x26> value = *tvp->ptr; 4a05e: 226a 0004 moveal %a2@(4),%a1 4a062: 2011 movel %a1@,%d0 *tvp->ptr = tvp->gval; 4a064: 22aa 0008 movel %a2@(8),%a1@ 4a068: 6004 bras 4a06e <_RTEMS_Tasks_Invoke_task_variable_dtor+0x2a> <== ALWAYS TAKEN } else { value = tvp->tval; 4a06a: 202a 000c movel %a2@(12),%d0 } if ( dtor ) 4a06e: 4a88 tstl %a0 4a070: 6706 beqs 4a078 <_RTEMS_Tasks_Invoke_task_variable_dtor+0x34> (*dtor)(value); 4a072: 2f00 movel %d0,%sp@- 4a074: 4e90 jsr %a0@ 4a076: 588f addql #4,%sp _Workspace_Free(tvp); 4a078: 2d4a 0008 movel %a2,%fp@(8) } 4a07c: 246e fffc moveal %fp@(-4),%a2 4a080: 4e5e unlk %fp } if ( dtor ) (*dtor)(value); _Workspace_Free(tvp); 4a082: 4ef9 0004 7eb8 jmp 47eb8 <_Workspace_Free> 00049fce <_RTEMS_tasks_Create_extension>: bool _RTEMS_tasks_Create_extension( Thread_Control *executing, Thread_Control *created ) { 49fce: 4e56 0000 linkw %fp,#0 49fd2: 2f0a movel %a2,%sp@- 49fd4: 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() ) 49fd8: 4a39 0005 b6e4 tstb 5b6e4 49fde: 6604 bnes 49fe4 <_RTEMS_tasks_Create_extension+0x16> 49fe0: 701e moveq #30,%d0 49fe2: 6002 bras 49fe6 <_RTEMS_tasks_Create_extension+0x18> <== ALWAYS TAKEN 49fe4: 705e moveq #94,%d0 to_allocate -= (RTEMS_NUMBER_NOTEPADS * sizeof(uint32_t)); api = _Workspace_Allocate( to_allocate ); 49fe6: 2f00 movel %d0,%sp@- 49fe8: 4eb9 0004 7e9c jsr 47e9c <_Workspace_Allocate> if ( !api ) 49fee: 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 ); 49ff0: 2040 moveal %d0,%a0 if ( !api ) 49ff2: 4a80 tstl %d0 49ff4: 6604 bnes 49ffa <_RTEMS_tasks_Create_extension+0x2c> 49ff6: 4200 clrb %d0 49ff8: 6042 bras 4a03c <_RTEMS_tasks_Create_extension+0x6e> <== 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; 49ffa: 42aa 011a clrl %a2@(282) */ RTEMS_INLINE_ROUTINE void _ASR_Initialize ( ASR_Information *information ) { information->is_enabled = false; 49ffe: 4200 clrb %d0 api = _Workspace_Allocate( to_allocate ); if ( !api ) return false; created->API_Extensions[ THREAD_API_RTEMS ] = api; 4a000: 2548 010a movel %a0,%a2@(266) 4a004: 1140 0008 moveb %d0,%a0@(8) api->pending_events = EVENT_SETS_NONE_PENDING; 4a008: 4290 clrl %a0@ api->event_condition = 0; 4a00a: 42a8 0004 clrl %a0@(4) information->handler = NULL; 4a00e: 42a8 000a clrl %a0@(10) information->mode_set = RTEMS_DEFAULT_MODES; 4a012: 42a8 000e clrl %a0@(14) information->signals_posted = 0; 4a016: 42a8 0012 clrl %a0@(18) information->signals_pending = 0; 4a01a: 42a8 0016 clrl %a0@(22) information->nest_level = 0; 4a01e: 42a8 001a clrl %a0@(26) _ASR_Initialize( &api->Signal ); created->task_variables = NULL; if ( rtems_configuration_get_notepads_enabled() ) { 4a022: 4a39 0005 b6e4 tstb 5b6e4 4a028: 6710 beqs 4a03a <_RTEMS_tasks_Create_extension+0x6c> 4a02a: 41e8 001e lea %a0@(30),%a0 4a02e: 4280 clrl %d0 for (i=0; i < RTEMS_NUMBER_NOTEPADS; i++) api->Notepads[i] = 0; 4a030: 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++) 4a032: 5280 addql #1,%d0 4a034: 7210 moveq #16,%d1 4a036: b280 cmpl %d0,%d1 4a038: 66f6 bnes 4a030 <_RTEMS_tasks_Create_extension+0x62> 4a03a: 7001 moveq #1,%d0 api->Notepads[i] = 0; } return true; } 4a03c: 246e fffc moveal %fp@(-4),%a2 4a040: 4e5e unlk %fp 4a042: 4e75 rts 00049f88 <_RTEMS_tasks_Delete_extension>: void _RTEMS_tasks_Delete_extension( Thread_Control *executing, Thread_Control *deleted ) { 49f88: 4e56 fff4 linkw %fp,#-12 49f8c: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 49f90: 246e 000c moveal %fp@(12),%a2 tvp = deleted->task_variables; deleted->task_variables = NULL; while (tvp) { next = (rtems_task_variable_t *)tvp->next; _RTEMS_Tasks_Invoke_task_variable_dtor( deleted, tvp ); 49f94: 47f9 0004 a044 lea 4a044 <_RTEMS_Tasks_Invoke_task_variable_dtor>,%a3 /* * Free per task variable memory */ tvp = deleted->task_variables; 49f9a: 206a 011a moveal %a2@(282),%a0 deleted->task_variables = NULL; 49f9e: 42aa 011a clrl %a2@(282) while (tvp) { 49fa2: 600c bras 49fb0 <_RTEMS_tasks_Delete_extension+0x28> <== ALWAYS TAKEN next = (rtems_task_variable_t *)tvp->next; 49fa4: 2410 movel %a0@,%d2 _RTEMS_Tasks_Invoke_task_variable_dtor( deleted, tvp ); 49fa6: 2f08 movel %a0,%sp@- 49fa8: 2f0a movel %a2,%sp@- 49faa: 4e93 jsr %a3@ 49fac: 508f addql #8,%sp 49fae: 2042 moveal %d2,%a0 * Free per task variable memory */ tvp = deleted->task_variables; deleted->task_variables = NULL; while (tvp) { 49fb0: 4a88 tstl %a0 49fb2: 66f0 bnes 49fa4 <_RTEMS_tasks_Delete_extension+0x1c> /* * Free API specific memory */ (void) _Workspace_Free( deleted->API_Extensions[ THREAD_API_RTEMS ] ); 49fb4: 2f2a 010a movel %a2@(266),%sp@- 49fb8: 4eb9 0004 7eb8 jsr 47eb8 <_Workspace_Free> deleted->API_Extensions[ THREAD_API_RTEMS ] = NULL; 49fbe: 588f addql #4,%sp 49fc0: 42aa 010a clrl %a2@(266) } 49fc4: 4cee 0c04 fff4 moveml %fp@(-12),%d2/%a2-%a3 49fca: 4e5e unlk %fp 49fcc: 4e75 rts 000452dc <_RTEMS_tasks_Initialize_user_tasks_body>: * * Output parameters: NONE */ void _RTEMS_tasks_Initialize_user_tasks_body( void ) { 452dc: 4e56 ffe4 linkw %fp,#-28 452e0: 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; 452e4: 2479 0005 b70a moveal 5b70a ,%a2 maximum = Configuration_RTEMS_API.number_of_initialization_tasks; 452ea: 2839 0005 b706 movel 5b706 ,%d4 /* * Verify that we have a set of user tasks to iterate */ if ( !user_tasks ) 452f0: 4a8a tstl %a2 452f2: 6762 beqs 45356 <_RTEMS_tasks_Initialize_user_tasks_body+0x7a> /* * Now iterate over the initialization tasks and create/start them. */ for ( index=0 ; index < maximum ; index++ ) { return_value = rtems_task_create( 452f4: 260e movel %fp,%d3 maximum = Configuration_RTEMS_API.number_of_initialization_tasks; /* * Verify that we have a set of user tasks to iterate */ if ( !user_tasks ) 452f6: 4282 clrl %d2 /* * Now iterate over the initialization tasks and create/start them. */ for ( index=0 ; index < maximum ; index++ ) { return_value = rtems_task_create( 452f8: 5983 subql #4,%d3 452fa: 49f9 0004 50e4 lea 450e4 ,%a4 &id ); if ( !rtems_is_status_successful( return_value ) ) _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); return_value = rtems_task_start( 45300: 47f9 0004 5360 lea 45360 ,%a3 45306: 604a bras 45352 <_RTEMS_tasks_Initialize_user_tasks_body+0x76> <== ALWAYS TAKEN /* * Now iterate over the initialization tasks and create/start them. */ for ( index=0 ; index < maximum ; index++ ) { return_value = rtems_task_create( 45308: 2f03 movel %d3,%sp@- 4530a: 2f2a 000c movel %a2@(12),%sp@- 4530e: 2f2a 0014 movel %a2@(20),%sp@- 45312: 2f2a 0004 movel %a2@(4),%sp@- 45316: 2f2a 0008 movel %a2@(8),%sp@- 4531a: 2f12 movel %a2@,%sp@- 4531c: 4e94 jsr %a4@ user_tasks[ index ].stack_size, user_tasks[ index ].mode_set, user_tasks[ index ].attribute_set, &id ); if ( !rtems_is_status_successful( return_value ) ) 4531e: 4fef 0018 lea %sp@(24),%sp 45322: 4a80 tstl %d0 45324: 661a bnes 45340 <_RTEMS_tasks_Initialize_user_tasks_body+0x64> _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); return_value = rtems_task_start( 45326: 2f2a 0018 movel %a2@(24),%sp@- 4532a: 2f2a 0010 movel %a2@(16),%sp@- 4532e: 45ea 001c lea %a2@(28),%a2 45332: 2f2e fffc movel %fp@(-4),%sp@- 45336: 4e93 jsr %a3@ id, user_tasks[ index ].entry_point, user_tasks[ index ].argument ); if ( !rtems_is_status_successful( return_value ) ) 45338: 4fef 000c lea %sp@(12),%sp 4533c: 4a80 tstl %d0 4533e: 6710 beqs 45350 <_RTEMS_tasks_Initialize_user_tasks_body+0x74> _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); 45340: 2f00 movel %d0,%sp@- 45342: 4878 0001 pea 1 45346: 4878 0001 pea 1 4534a: 4eb9 0004 5fe4 jsr 45fe4 <_Internal_error_Occurred> return; /* * Now iterate over the initialization tasks and create/start them. */ for ( index=0 ; index < maximum ; index++ ) { 45350: 5282 addql #1,%d2 45352: b882 cmpl %d2,%d4 45354: 62b2 bhis 45308 <_RTEMS_tasks_Initialize_user_tasks_body+0x2c> user_tasks[ index ].argument ); if ( !rtems_is_status_successful( return_value ) ) _Internal_error_Occurred( INTERNAL_ERROR_RTEMS_API, true, return_value ); } } 45356: 4cee 1c1c ffe4 moveml %fp@(-28),%d2-%d4/%a2-%a4 4535c: 4e5e unlk %fp 4535e: 4e75 rts 00049f16 <_RTEMS_tasks_Post_switch_extension>: */ void _RTEMS_tasks_Post_switch_extension( Thread_Control *executing ) { 49f16: 4e56 ffec linkw %fp,#-20 49f1a: 206e 0008 moveal %fp@(8),%a0 49f1e: 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 ]; 49f22: 2468 010a moveal %a0@(266),%a2 if ( !api ) 49f26: 4a8a tstl %a2 49f28: 6754 beqs 49f7e <_RTEMS_tasks_Post_switch_extension+0x68> <== ALWAYS TAKEN * Signal Processing */ asr = &api->Signal; _ISR_Disable( level ); 49f2a: 203c 0000 0700 movel #1792,%d0 49f30: 40c1 movew %sr,%d1 49f32: 8081 orl %d1,%d0 49f34: 46c0 movew %d0,%sr signal_set = asr->signals_posted; 49f36: 262a 0012 movel %a2@(18),%d3 asr->signals_posted = 0; 49f3a: 42aa 0012 clrl %a2@(18) _ISR_Enable( level ); 49f3e: 46c1 movew %d1,%sr if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ 49f40: 4a83 tstl %d3 49f42: 673a beqs 49f7e <_RTEMS_tasks_Post_switch_extension+0x68> return; asr->nest_level += 1; 49f44: 52aa 001a addql #1,%a2@(26) rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 49f48: 240e movel %fp,%d2 49f4a: 5982 subql #4,%d2 49f4c: 47f9 0004 be6c lea 4be6c ,%a3 49f52: 2f02 movel %d2,%sp@- 49f54: 2f3c 0000 ffff movel #65535,%sp@- 49f5a: 2f2a 000e movel %a2@(14),%sp@- 49f5e: 4e93 jsr %a3@ (*asr->handler)( signal_set ); 49f60: 2f03 movel %d3,%sp@- 49f62: 206a 000a moveal %a2@(10),%a0 49f66: 4e90 jsr %a0@ asr->nest_level -= 1; 49f68: 53aa 001a subql #1,%a2@(26) rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 49f6c: 2f02 movel %d2,%sp@- 49f6e: 2f3c 0000 ffff movel #65535,%sp@- 49f74: 2f2e fffc movel %fp@(-4),%sp@- 49f78: 4e93 jsr %a3@ 49f7a: 4fef 001c lea %sp@(28),%sp } 49f7e: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3 49f84: 4e5e unlk %fp 49f86: 4e75 rts 00049e76 <_RTEMS_tasks_Switch_extension>: void _RTEMS_tasks_Switch_extension( Thread_Control *executing, Thread_Control *heir ) { 49e76: 4e56 0000 linkw %fp,#0 49e7a: 206e 0008 moveal %fp@(8),%a0 /* * Per Task Variables */ tvp = executing->task_variables; 49e7e: 2068 011a moveal %a0@(282),%a0 while (tvp) { 49e82: 600e bras 49e92 <_RTEMS_tasks_Switch_extension+0x1c> <== ALWAYS TAKEN tvp->tval = *tvp->ptr; 49e84: 2268 0004 moveal %a0@(4),%a1 49e88: 2151 000c movel %a1@,%a0@(12) *tvp->ptr = tvp->gval; 49e8c: 22a8 0008 movel %a0@(8),%a1@ tvp = (rtems_task_variable_t *)tvp->next; 49e90: 2050 moveal %a0@,%a0 /* * Per Task Variables */ tvp = executing->task_variables; while (tvp) { 49e92: 4a88 tstl %a0 49e94: 66ee bnes 49e84 <_RTEMS_tasks_Switch_extension+0xe> tvp->tval = *tvp->ptr; *tvp->ptr = tvp->gval; tvp = (rtems_task_variable_t *)tvp->next; } tvp = heir->task_variables; 49e96: 206e 000c moveal %fp@(12),%a0 49e9a: 2068 011a moveal %a0@(282),%a0 while (tvp) { 49e9e: 600e bras 49eae <_RTEMS_tasks_Switch_extension+0x38> <== ALWAYS TAKEN tvp->gval = *tvp->ptr; 49ea0: 2268 0004 moveal %a0@(4),%a1 49ea4: 2151 0008 movel %a1@,%a0@(8) *tvp->ptr = tvp->tval; 49ea8: 22a8 000c movel %a0@(12),%a1@ tvp = (rtems_task_variable_t *)tvp->next; 49eac: 2050 moveal %a0@,%a0 *tvp->ptr = tvp->gval; tvp = (rtems_task_variable_t *)tvp->next; } tvp = heir->task_variables; while (tvp) { 49eae: 4a88 tstl %a0 49eb0: 66ee bnes 49ea0 <_RTEMS_tasks_Switch_extension+0x2a> tvp->gval = *tvp->ptr; *tvp->ptr = tvp->tval; tvp = (rtems_task_variable_t *)tvp->next; } } 49eb2: 4e5e unlk %fp 49eb4: 4e75 rts 00071828 <_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 ) { 71828: 4e56 ffcc linkw %fp,#-52 7182c: 48d7 1c3c moveml %d2-%d5/%a2-%a4,%sp@ /* * Determine elapsed wall time since period initiated. */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _TOD_Get_uptime( &uptime ); 71830: 280e movel %fp,%d4 71832: 5184 subql #8,%d4 _Timestamp_Subtract( 71834: 45f9 0004 cff0 lea 4cff0 <_Timespec_Subtract>,%a2 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 ) { 7183a: 266e 0008 moveal %fp@(8),%a3 /* * Determine elapsed wall time since period initiated. */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _TOD_Get_uptime( &uptime ); 7183e: 2f04 movel %d4,%sp@- ) { #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ Timestamp_Control uptime; #endif Thread_Control *owning_thread = the_period->owner; 71840: 286b 0040 moveal %a3@(64),%a4 /* * Determine elapsed wall time since period initiated. */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _TOD_Get_uptime( &uptime ); 71844: 4eb9 0006 39f0 jsr 639f0 <_TOD_Get_uptime> _Timestamp_Subtract( 7184a: 2f2e 000c movel %fp@(12),%sp@- 7184e: 2f04 movel %d4,%sp@- 71850: 486b 004c pea %a3@(76) 71854: 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) { 71856: 4fef 0010 lea %sp@(16),%sp #endif /* * Determine cpu usage since period initiated. */ used = owning_thread->cpu_time_used; 7185a: 202c 0082 movel %a4@(130),%d0 7185e: 222c 0086 movel %a4@(134),%d1 71862: 2d40 fff0 movel %d0,%fp@(-16) 71866: 2d41 fff4 movel %d1,%fp@(-12) #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ if (owning_thread == _Thread_Executing) { 7186a: b9f9 0009 beb2 cmpal 9beb2 <_Thread_Executing>,%a4 71870: 6652 bnes 718c4 <_Rate_monotonic_Get_status+0x9c> Thread_CPU_usage_t ran; /* How much time time since last context switch */ _Timestamp_Subtract( 71872: 2a0e movel %fp,%d5 71874: 0685 ffff ffe8 addil #-24,%d5 &_Thread_Time_of_last_context_switch, &uptime, &ran ); /* cpu usage += ran */ _Timestamp_Add_to( &used, &ran ); 7187a: 240e movel %fp,%d2 7187c: 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)) 71882: 260b movel %a3,%d3 71884: 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( 7188a: 2f05 movel %d5,%sp@- 7188c: 2f04 movel %d4,%sp@- 7188e: 4879 0009 beba pea 9beba <_Thread_Time_of_last_context_switch> 71894: 4e92 jsr %a2@ &_Thread_Time_of_last_context_switch, &uptime, &ran ); /* cpu usage += ran */ _Timestamp_Add_to( &used, &ran ); 71896: 2f05 movel %d5,%sp@- 71898: 2f02 movel %d2,%sp@- 7189a: 4eb9 0004 cfb0 jsr 4cfb0 <_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)) 718a0: 2f03 movel %d3,%sp@- 718a2: 2f02 movel %d2,%sp@- 718a4: 4eb9 0007 2268 jsr 72268 <_Timespec_Less_than> 718aa: 4fef 001c lea %sp@(28),%sp 718ae: 4a00 tstb %d0 718b0: 6704 beqs 718b6 <_Rate_monotonic_Get_status+0x8e> 718b2: 4200 clrb %d0 718b4: 6010 bras 718c6 <_Rate_monotonic_Get_status+0x9e> <== ALWAYS TAKEN return false; /* used = current cpu usage - cpu usage at start of period */ _Timestamp_Subtract( 718b6: 2f2e 0010 movel %fp@(16),%sp@- 718ba: 2f02 movel %d2,%sp@- 718bc: 2f03 movel %d3,%sp@- 718be: 4e92 jsr %a2@ 718c0: 4fef 000c lea %sp@(12),%sp 718c4: 7001 moveq #1,%d0 return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; } 718c6: 4cee 1c3c ffcc moveml %fp@(-52),%d2-%d5/%a2-%a4 718cc: 4e5e unlk %fp 718ce: 4e75 rts 00071b38 <_Rate_monotonic_Timeout>: void _Rate_monotonic_Timeout( Objects_Id id, void *ignored ) { 71b38: 4e56 fffc linkw %fp,#-4 71b3c: 2f0a movel %a2,%sp@- 71b3e: 486e fffc pea %fp@(-4) 71b42: 2f2e 0008 movel %fp@(8),%sp@- 71b46: 4879 0009 c89c pea 9c89c <_Rate_monotonic_Information> 71b4c: 4eb9 0004 ba80 jsr 4ba80 <_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 ) { 71b52: 4fef 000c lea %sp@(12),%sp 71b56: 2440 moveal %d0,%a2 71b58: 4aae fffc tstl %fp@(-4) 71b5c: 6600 0096 bnew 71bf4 <_Rate_monotonic_Timeout+0xbc> <== ALWAYS TAKEN case OBJECTS_LOCAL: the_thread = the_period->owner; 71b60: 206a 0040 moveal %a2@(64),%a0 if ( _States_Is_waiting_for_period( the_thread->current_state ) && 71b64: 2028 0010 movel %a0@(16),%d0 71b68: 0280 0000 4000 andil #16384,%d0 71b6e: 673c beqs 71bac <_Rate_monotonic_Timeout+0x74> the_thread->Wait.id == the_period->Object.id ) { 71b70: 202a 0008 movel %a2@(8),%d0 71b74: b0a8 0020 cmpl %a0@(32),%d0 71b78: 6632 bnes 71bac <_Rate_monotonic_Timeout+0x74> RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 71b7a: 2f3c 1003 fff8 movel #268697592,%sp@- 71b80: 2f08 movel %a0,%sp@- 71b82: 4eb9 0004 bf80 jsr 4bf80 <_Thread_Clear_state> _Thread_Unblock( the_thread ); _Rate_monotonic_Initiate_statistics( the_period ); 71b88: 2f0a movel %a2,%sp@- 71b8a: 4eb9 0007 17b0 jsr 717b0 <_Rate_monotonic_Initiate_statistics> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 71b90: 256a 003c 001c movel %a2@(60),%a2@(28) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 71b96: 486a 0010 pea %a2@(16) 71b9a: 4879 0009 bed0 pea 9bed0 <_Watchdog_Ticks_chain> 71ba0: 4eb9 0004 d2a0 jsr 4d2a0 <_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 ) && 71ba6: 4fef 0014 lea %sp@(20),%sp 71baa: 603a bras 71be6 <_Rate_monotonic_Timeout+0xae> <== ALWAYS TAKEN _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 ) { 71bac: 7001 moveq #1,%d0 71bae: b0aa 0038 cmpl %a2@(56),%d0 71bb2: 662c bnes 71be0 <_Rate_monotonic_Timeout+0xa8> the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING; 71bb4: 103c 0003 moveb #3,%d0 71bb8: 2540 0038 movel %d0,%a2@(56) _Rate_monotonic_Initiate_statistics( the_period ); 71bbc: 2f0a movel %a2,%sp@- 71bbe: 4eb9 0007 17b0 jsr 717b0 <_Rate_monotonic_Initiate_statistics> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 71bc4: 256a 003c 001c movel %a2@(60),%a2@(28) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 71bca: 486a 0010 pea %a2@(16) 71bce: 4879 0009 bed0 pea 9bed0 <_Watchdog_Ticks_chain> 71bd4: 4eb9 0004 d2a0 jsr 4d2a0 <_Watchdog_Insert> 71bda: 4fef 000c lea %sp@(12),%sp 71bde: 6006 bras 71be6 <_Rate_monotonic_Timeout+0xae> <== ALWAYS TAKEN _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else the_period->state = RATE_MONOTONIC_EXPIRED; 71be0: 7004 moveq #4,%d0 71be2: 2540 0038 movel %d0,%a2@(56) */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 71be6: 2039 0009 bdf8 movel 9bdf8 <_Thread_Dispatch_disable_level>,%d0 71bec: 5380 subql #1,%d0 71bee: 23c0 0009 bdf8 movel %d0,9bdf8 <_Thread_Dispatch_disable_level> case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 71bf4: 246e fff8 moveal %fp@(-8),%a2 71bf8: 4e5e unlk %fp 71bfa: 4e75 rts 000718d0 <_Rate_monotonic_Update_statistics>: * Update the counts. */ stats = &the_period->Statistics; stats->count++; if ( the_period->state == RATE_MONOTONIC_EXPIRED ) 718d0: 7004 moveq #4,%d0 } void _Rate_monotonic_Update_statistics( Rate_monotonic_Control *the_period ) { 718d2: 4e56 fff0 linkw %fp,#-16 718d6: 2f0a movel %a2,%sp@- 718d8: 246e 0008 moveal %fp@(8),%a2 /* * Update the counts. */ stats = &the_period->Statistics; stats->count++; 718dc: 52aa 0054 addql #1,%a2@(84) } void _Rate_monotonic_Update_statistics( Rate_monotonic_Control *the_period ) { 718e0: 2f02 movel %d2,%sp@- * Update the counts. */ stats = &the_period->Statistics; stats->count++; if ( the_period->state == RATE_MONOTONIC_EXPIRED ) 718e2: b0aa 0038 cmpl %a2@(56),%d0 718e6: 6604 bnes 718ec <_Rate_monotonic_Update_statistics+0x1c> stats->missed_count++; 718e8: 52aa 0058 addql #1,%a2@(88) /* * Grab status for time statistics. */ valid_status = _Rate_monotonic_Get_status( the_period, &since_last_period, &executed ); 718ec: 240e movel %fp,%d2 718ee: 5182 subql #8,%d2 718f0: 2f02 movel %d2,%sp@- 718f2: 486e fff0 pea %fp@(-16) 718f6: 2f0a movel %a2,%sp@- 718f8: 4eb9 0007 1828 jsr 71828 <_Rate_monotonic_Get_status> if (!valid_status) 718fe: 4fef 000c lea %sp@(12),%sp 71902: 4a00 tstb %d0 71904: 6700 00b2 beqw 719b8 <_Rate_monotonic_Update_statistics+0xe8> <== ALWAYS TAKEN /* * Update CPU time */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_cpu_time, &executed ); 71908: 2f02 movel %d2,%sp@- 7190a: 486a 006c pea %a2@(108) 7190e: 4eb9 0004 cfb0 jsr 4cfb0 <_Timespec_Add_to> if ( _Timestamp_Less_than( &executed, &stats->min_cpu_time ) ) 71914: 486a 005c pea %a2@(92) 71918: 2f02 movel %d2,%sp@- 7191a: 4eb9 0007 2268 jsr 72268 <_Timespec_Less_than> 71920: 4fef 0010 lea %sp@(16),%sp 71924: 4a00 tstb %d0 71926: 6710 beqs 71938 <_Rate_monotonic_Update_statistics+0x68> stats->min_cpu_time = executed; 71928: 202e fff8 movel %fp@(-8),%d0 7192c: 222e fffc movel %fp@(-4),%d1 71930: 2540 005c movel %d0,%a2@(92) 71934: 2541 0060 movel %d1,%a2@(96) if ( _Timestamp_Greater_than( &executed, &stats->max_cpu_time ) ) 71938: 486a 0064 pea %a2@(100) 7193c: 486e fff8 pea %fp@(-8) 71940: 4eb9 0007 2238 jsr 72238 <_Timespec_Greater_than> 71946: 508f addql #8,%sp 71948: 4a00 tstb %d0 7194a: 6710 beqs 7195c <_Rate_monotonic_Update_statistics+0x8c> stats->max_cpu_time = executed; 7194c: 202e fff8 movel %fp@(-8),%d0 71950: 222e fffc movel %fp@(-4),%d1 71954: 2540 0064 movel %d0,%a2@(100) 71958: 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 ); 7195c: 240e movel %fp,%d2 7195e: 0682 ffff fff0 addil #-16,%d2 71964: 2f02 movel %d2,%sp@- 71966: 486a 0084 pea %a2@(132) 7196a: 4eb9 0004 cfb0 jsr 4cfb0 <_Timespec_Add_to> if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) ) 71970: 486a 0074 pea %a2@(116) 71974: 2f02 movel %d2,%sp@- 71976: 4eb9 0007 2268 jsr 72268 <_Timespec_Less_than> 7197c: 4fef 0010 lea %sp@(16),%sp 71980: 4a00 tstb %d0 71982: 6710 beqs 71994 <_Rate_monotonic_Update_statistics+0xc4> stats->min_wall_time = since_last_period; 71984: 202e fff0 movel %fp@(-16),%d0 71988: 222e fff4 movel %fp@(-12),%d1 7198c: 2540 0074 movel %d0,%a2@(116) 71990: 2541 0078 movel %d1,%a2@(120) if ( _Timestamp_Greater_than( &since_last_period, &stats->max_wall_time ) ) 71994: 486a 007c pea %a2@(124) 71998: 486e fff0 pea %fp@(-16) 7199c: 4eb9 0007 2238 jsr 72238 <_Timespec_Greater_than> 719a2: 508f addql #8,%sp 719a4: 4a00 tstb %d0 719a6: 6710 beqs 719b8 <_Rate_monotonic_Update_statistics+0xe8> stats->max_wall_time = since_last_period; 719a8: 202e fff0 movel %fp@(-16),%d0 719ac: 222e fff4 movel %fp@(-12),%d1 719b0: 2540 007c movel %d0,%a2@(124) 719b4: 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 } 719b8: 242e ffe8 movel %fp@(-24),%d2 719bc: 246e ffec moveal %fp@(-20),%a2 719c0: 4e5e unlk %fp 719c2: 4e75 rts 00056ce8 <_Region_Process_queue>: */ void _Region_Process_queue( Region_Control *the_region ) { 56ce8: 4e56 ffe4 linkw %fp,#-28 56cec: 2039 0007 4ec8 movel 74ec8 <_Thread_Dispatch_disable_level>,%d0 56cf2: 5280 addql #1,%d0 56cf4: 48d7 3c1c moveml %d2-%d4/%a2-%a5,%sp@ 56cf8: 266e 0008 moveal %fp@(8),%a3 56cfc: 23c0 0007 4ec8 movel %d0,74ec8 <_Thread_Dispatch_disable_level> * NOTE: Be sure to disable dispatching before unlocking the mutex * since we do not want to open a window where a context * switch could occur. */ _Thread_Disable_dispatch(); _RTEMS_Unlock_allocator(); 56d02: 2f39 0007 4f7a movel 74f7a <_RTEMS_Allocator_Mutex>,%sp@- /* * NOTE: The following loop is O(n) where n is the number of * threads whose memory request is satisfied. */ for ( ; ; ) { the_thread = _Thread_queue_First( &the_region->Wait_queue ); 56d08: 240b movel %a3,%d2 RTEMS_INLINE_ROUTINE void *_Region_Allocate_segment ( Region_Control *the_region, uintptr_t size ) { return _Heap_Allocate( &the_region->Memory, size ); 56d0a: 280b movel %a3,%d4 56d0c: 0682 0000 0010 addil #16,%d2 56d12: 0684 0000 0068 addil #104,%d4 56d18: 4bf9 0005 22b8 lea 522b8 <_Heap_Allocate_aligned_with_boundary>,%a5 if ( the_segment == NULL ) break; *(void **)the_thread->Wait.return_argument = the_segment; the_region->number_of_used_blocks += 1; _Thread_queue_Extract( &the_region->Wait_queue, the_thread ); 56d1e: 49f9 0005 73f4 lea 573f4 <_Thread_queue_Extract>,%a4 * NOTE: Be sure to disable dispatching before unlocking the mutex * since we do not want to open a window where a context * switch could occur. */ _Thread_Disable_dispatch(); _RTEMS_Unlock_allocator(); 56d24: 4eb9 0005 184c jsr 5184c <_API_Mutex_Unlock> 56d2a: 588f addql #4,%sp /* * NOTE: The following loop is O(n) where n is the number of * threads whose memory request is satisfied. */ for ( ; ; ) { the_thread = _Thread_queue_First( &the_region->Wait_queue ); 56d2c: 263c 0005 74f8 movel #357624,%d3 56d32: 2f02 movel %d2,%sp@- 56d34: 2043 moveal %d3,%a0 56d36: 4e90 jsr %a0@ if ( the_thread == NULL ) 56d38: 588f addql #4,%sp /* * NOTE: The following loop is O(n) where n is the number of * threads whose memory request is satisfied. */ for ( ; ; ) { the_thread = _Thread_queue_First( &the_region->Wait_queue ); 56d3a: 2440 moveal %d0,%a2 if ( the_thread == NULL ) 56d3c: 4a80 tstl %d0 56d3e: 672c beqs 56d6c <_Region_Process_queue+0x84> 56d40: 42a7 clrl %sp@- 56d42: 42a7 clrl %sp@- 56d44: 2f2a 0024 movel %a2@(36),%sp@- 56d48: 2f04 movel %d4,%sp@- 56d4a: 4e95 jsr %a5@ the_segment = (void **) _Region_Allocate_segment( the_region, the_thread->Wait.count ); if ( the_segment == NULL ) 56d4c: 4fef 0010 lea %sp@(16),%sp 56d50: 4a80 tstl %d0 56d52: 6718 beqs 56d6c <_Region_Process_queue+0x84> break; *(void **)the_thread->Wait.return_argument = the_segment; 56d54: 206a 0028 moveal %a2@(40),%a0 the_region->number_of_used_blocks += 1; 56d58: 52ab 0064 addql #1,%a3@(100) ); if ( the_segment == NULL ) break; *(void **)the_thread->Wait.return_argument = the_segment; 56d5c: 2080 movel %d0,%a0@ the_region->number_of_used_blocks += 1; _Thread_queue_Extract( &the_region->Wait_queue, the_thread ); 56d5e: 2f0a movel %a2,%sp@- 56d60: 2f02 movel %d2,%sp@- 56d62: 4e94 jsr %a4@ the_thread->Wait.return_code = RTEMS_SUCCESSFUL; } 56d64: 508f addql #8,%sp break; *(void **)the_thread->Wait.return_argument = the_segment; the_region->number_of_used_blocks += 1; _Thread_queue_Extract( &the_region->Wait_queue, the_thread ); the_thread->Wait.return_code = RTEMS_SUCCESSFUL; 56d66: 42aa 0034 clrl %a2@(52) } 56d6a: 60c6 bras 56d32 <_Region_Process_queue+0x4a> <== ALWAYS TAKEN _Thread_Enable_dispatch(); } 56d6c: 4cee 3c1c ffe4 moveml %fp@(-28),%d2-%d4/%a2-%a5 56d72: 4e5e unlk %fp *(void **)the_thread->Wait.return_argument = the_segment; the_region->number_of_used_blocks += 1; _Thread_queue_Extract( &the_region->Wait_queue, the_thread ); the_thread->Wait.return_code = RTEMS_SUCCESSFUL; } _Thread_Enable_dispatch(); 56d74: 4ef9 0005 38b6 jmp 538b6 <_Thread_Enable_dispatch> ... 0004a2bc <_TOD_Get>: /* assume time checked for NULL by caller */ /* _TOD_Now is the native current time */ nanoseconds = 0; _ISR_Disable( level ); 4a2bc: 203c 0000 0700 movel #1792,%d0 */ void _TOD_Get( struct timespec *time ) { 4a2c2: 4e56 fff0 linkw %fp,#-16 4a2c6: 2f02 movel %d2,%sp@- /* assume time checked for NULL by caller */ /* _TOD_Now is the native current time */ nanoseconds = 0; _ISR_Disable( level ); 4a2c8: 40c2 movew %sr,%d2 4a2ca: 8082 orl %d2,%d0 4a2cc: 46c0 movew %d0,%sr now = _TOD_Now; if ( _Watchdog_Nanoseconds_since_tick_handler ) 4a2ce: 2079 0005 d050 moveal 5d050 <_Watchdog_Nanoseconds_since_tick_handler>,%a0 /* assume time checked for NULL by caller */ /* _TOD_Now is the native current time */ nanoseconds = 0; _ISR_Disable( level ); now = _TOD_Now; 4a2d4: 2039 0005 cf56 movel 5cf56 <_TOD_Now>,%d0 4a2da: 2239 0005 cf5a movel 5cf5a <_TOD_Now+0x4>,%d1 4a2e0: 2d40 fff0 movel %d0,%fp@(-16) 4a2e4: 2d41 fff4 movel %d1,%fp@(-12) if ( _Watchdog_Nanoseconds_since_tick_handler ) 4a2e8: 4a88 tstl %a0 4a2ea: 6604 bnes 4a2f0 <_TOD_Get+0x34> 4a2ec: 4280 clrl %d0 4a2ee: 6002 bras 4a2f2 <_TOD_Get+0x36> <== ALWAYS TAKEN nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)(); 4a2f0: 4e90 jsr %a0@ _ISR_Enable( level ); 4a2f2: 46c2 movew %d2,%sr _Timestamp_Set( &offset, 0, nanoseconds ); _Timestamp_Add_to( &now, &offset ); 4a2f4: 486e fff8 pea %fp@(-8) 4a2f8: 486e fff0 pea %fp@(-16) now = _TOD_Now; if ( _Watchdog_Nanoseconds_since_tick_handler ) nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)(); _ISR_Enable( level ); _Timestamp_Set( &offset, 0, nanoseconds ); 4a2fc: 2d40 fffc movel %d0,%fp@(-4) 4a300: 42ae fff8 clrl %fp@(-8) _Timestamp_Add_to( &now, &offset ); 4a304: 4eb9 0004 7964 jsr 47964 <_Timespec_Add_to> _Timestamp_To_timespec( &now, time ); 4a30a: 206e 0008 moveal %fp@(8),%a0 4a30e: 508f addql #8,%sp 4a310: 202e fff0 movel %fp@(-16),%d0 4a314: 222e fff4 movel %fp@(-12),%d1 } 4a318: 242e ffec movel %fp@(-20),%d2 4a31c: 4e5e unlk %fp nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)(); _ISR_Enable( level ); _Timestamp_Set( &offset, 0, nanoseconds ); _Timestamp_Add_to( &now, &offset ); _Timestamp_To_timespec( &now, time ); 4a31e: 2080 movel %d0,%a0@ 4a320: 2141 0004 movel %d1,%a0@(4) } 4a324: 4e75 rts ... 0004a328 <_TOD_Get_uptime>: /* assume time checked for NULL by caller */ /* _TOD_Uptime is in native timestamp format */ nanoseconds = 0; _ISR_Disable( level ); 4a328: 203c 0000 0700 movel #1792,%d0 */ void _TOD_Get_uptime( Timestamp_Control *uptime ) { 4a32e: 4e56 fff0 linkw %fp,#-16 4a332: 2f02 movel %d2,%sp@- /* assume time checked for NULL by caller */ /* _TOD_Uptime is in native timestamp format */ nanoseconds = 0; _ISR_Disable( level ); 4a334: 40c2 movew %sr,%d2 4a336: 8082 orl %d2,%d0 4a338: 46c0 movew %d0,%sr up = _TOD_Uptime; if ( _Watchdog_Nanoseconds_since_tick_handler ) 4a33a: 2079 0005 d050 moveal 5d050 <_Watchdog_Nanoseconds_since_tick_handler>,%a0 /* assume time checked for NULL by caller */ /* _TOD_Uptime is in native timestamp format */ nanoseconds = 0; _ISR_Disable( level ); up = _TOD_Uptime; 4a340: 2039 0005 cf42 movel 5cf42 <_TOD_Uptime>,%d0 4a346: 2239 0005 cf46 movel 5cf46 <_TOD_Uptime+0x4>,%d1 4a34c: 2d40 fff0 movel %d0,%fp@(-16) 4a350: 2d41 fff4 movel %d1,%fp@(-12) if ( _Watchdog_Nanoseconds_since_tick_handler ) 4a354: 4a88 tstl %a0 4a356: 6604 bnes 4a35c <_TOD_Get_uptime+0x34> 4a358: 4280 clrl %d0 4a35a: 6002 bras 4a35e <_TOD_Get_uptime+0x36> <== ALWAYS TAKEN nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)(); 4a35c: 4e90 jsr %a0@ _ISR_Enable( level ); 4a35e: 46c2 movew %d2,%sr _Timestamp_Set( &offset, 0, nanoseconds ); _Timestamp_Add_to( &up, &offset ); 4a360: 486e fff8 pea %fp@(-8) 4a364: 486e fff0 pea %fp@(-16) up = _TOD_Uptime; if ( _Watchdog_Nanoseconds_since_tick_handler ) nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)(); _ISR_Enable( level ); _Timestamp_Set( &offset, 0, nanoseconds ); 4a368: 2d40 fffc movel %d0,%fp@(-4) 4a36c: 42ae fff8 clrl %fp@(-8) _Timestamp_Add_to( &up, &offset ); 4a370: 4eb9 0004 7964 jsr 47964 <_Timespec_Add_to> *uptime = up; 4a376: 206e 0008 moveal %fp@(8),%a0 4a37a: 508f addql #8,%sp 4a37c: 202e fff0 movel %fp@(-16),%d0 4a380: 222e fff4 movel %fp@(-12),%d1 } 4a384: 242e ffec movel %fp@(-20),%d2 4a388: 4e5e unlk %fp nanoseconds = (*_Watchdog_Nanoseconds_since_tick_handler)(); _ISR_Enable( level ); _Timestamp_Set( &offset, 0, nanoseconds ); _Timestamp_Add_to( &up, &offset ); *uptime = up; 4a38a: 2080 movel %d0,%a0@ 4a38c: 2141 0004 movel %d1,%a0@(4) } 4a390: 4e75 rts ... 00046eac <_TOD_Set>: */ void _TOD_Set( const struct timespec *time ) { 46eac: 4e56 0000 linkw %fp,#0 46eb0: 2039 0006 6d54 movel 66d54 <_Thread_Dispatch_disable_level>,%d0 46eb6: 5280 addql #1,%d0 46eb8: 2f0a movel %a2,%sp@- 46eba: 246e 0008 moveal %fp@(8),%a2 46ebe: 23c0 0006 6d54 movel %d0,66d54 <_Thread_Dispatch_disable_level> long seconds; _Thread_Disable_dispatch(); _TOD_Deactivate(); seconds = _TOD_Seconds_since_epoch(); 46ec4: 2039 0006 6de6 movel 66de6 <_TOD_Now>,%d0 46eca: 41f9 0004 9194 lea 49194 <_Watchdog_Adjust>,%a0 if ( time->tv_sec < seconds ) 46ed0: 2212 movel %a2@,%d1 46ed2: b081 cmpl %d1,%d0 46ed4: 6f0a bles 46ee0 <_TOD_Set+0x34> Watchdog_Adjust_directions direction, Watchdog_Interval units ) { _Watchdog_Adjust( &_Watchdog_Seconds_chain, direction, units ); 46ed6: 9081 subl %d1,%d0 46ed8: 2f00 movel %d0,%sp@- 46eda: 4878 0001 pea 1 46ede: 6006 bras 46ee6 <_TOD_Set+0x3a> <== ALWAYS TAKEN 46ee0: 9280 subl %d0,%d1 46ee2: 2f01 movel %d1,%sp@- 46ee4: 42a7 clrl %sp@- 46ee6: 4879 0006 6e20 pea 66e20 <_Watchdog_Seconds_chain> 46eec: 4e90 jsr %a0@ _Watchdog_Adjust_seconds( WATCHDOG_BACKWARD, seconds - time->tv_sec ); else _Watchdog_Adjust_seconds( WATCHDOG_FORWARD, time->tv_sec - seconds ); /* POSIX format TOD (timespec) */ _Timestamp_Set( &_TOD_Now, time->tv_sec, time->tv_nsec ); 46eee: 23d2 0006 6de6 movel %a2@,66de6 <_TOD_Now> 46ef4: 588a addql #4,%a2 46ef6: 4fef 000c lea %sp@(12),%sp 46efa: 23d2 0006 6dea movel %a2@,66dea <_TOD_Now+0x4> _TOD_Is_set = true; _TOD_Activate(); _Thread_Enable_dispatch(); } 46f00: 246e fffc moveal %fp@(-4),%a2 46f04: 4e5e unlk %fp else _Watchdog_Adjust_seconds( WATCHDOG_FORWARD, time->tv_sec - seconds ); /* POSIX format TOD (timespec) */ _Timestamp_Set( &_TOD_Now, time->tv_sec, time->tv_nsec ); _TOD_Is_set = true; 46f06: 7001 moveq #1,%d0 46f08: 13c0 0006 6d68 moveb %d0,66d68 <_TOD_Is_set> _TOD_Activate(); _Thread_Enable_dispatch(); 46f0e: 4ef9 0004 803a jmp 4803a <_Thread_Enable_dispatch> 00045c98 <_TOD_Tickle_ticks>: * * Output parameters: NONE */ void _TOD_Tickle_ticks( void ) { 45c98: 4e56 ffe8 linkw %fp,#-24 Timestamp_Control tick; uint32_t seconds; /* Convert the tick quantum to a timestamp */ _Timestamp_Set( &tick, 0, rtems_configuration_get_nanoseconds_per_tick() ); 45c9c: 2239 0005 b720 movel 5b720 ,%d1 * * Output parameters: NONE */ void _TOD_Tickle_ticks( void ) { 45ca2: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ /* Update the counter of ticks since boot */ _Watchdog_Ticks_since_boot += 1; /* Update the timespec format uptime */ _Timestamp_Add_to( &_TOD_Uptime, &tick ); 45ca6: 240e movel %fp,%d2 45ca8: 5182 subql #8,%d2 { Timestamp_Control tick; uint32_t seconds; /* Convert the tick quantum to a timestamp */ _Timestamp_Set( &tick, 0, rtems_configuration_get_nanoseconds_per_tick() ); 45caa: 263c 0000 03e8 movel #1000,%d3 45cb0: 4c03 1800 mulsl %d3,%d1 /* Update the counter of ticks since boot */ _Watchdog_Ticks_since_boot += 1; /* Update the timespec format uptime */ _Timestamp_Add_to( &_TOD_Uptime, &tick ); 45cb4: 45f9 0004 7964 lea 47964 <_Timespec_Add_to>,%a2 */ RTEMS_INLINE_ROUTINE void _Watchdog_Tickle_seconds( void ) { _Watchdog_Tickle( &_Watchdog_Seconds_chain ); 45cba: 47f9 0004 7dec lea 47dec <_Watchdog_Tickle>,%a3 /* Convert the tick quantum to a timestamp */ _Timestamp_Set( &tick, 0, rtems_configuration_get_nanoseconds_per_tick() ); /* Update the counter of ticks since boot */ _Watchdog_Ticks_since_boot += 1; 45cc0: 2039 0005 d008 movel 5d008 <_Watchdog_Ticks_since_boot>,%d0 45cc6: 5280 addql #1,%d0 /* Update the timespec format uptime */ _Timestamp_Add_to( &_TOD_Uptime, &tick ); 45cc8: 2f02 movel %d2,%sp@- 45cca: 4879 0005 cf42 pea 5cf42 <_TOD_Uptime> { Timestamp_Control tick; uint32_t seconds; /* Convert the tick quantum to a timestamp */ _Timestamp_Set( &tick, 0, rtems_configuration_get_nanoseconds_per_tick() ); 45cd0: 2d41 fffc movel %d1,%fp@(-4) /* Update the counter of ticks since boot */ _Watchdog_Ticks_since_boot += 1; 45cd4: 23c0 0005 d008 movel %d0,5d008 <_Watchdog_Ticks_since_boot> { Timestamp_Control tick; uint32_t seconds; /* Convert the tick quantum to a timestamp */ _Timestamp_Set( &tick, 0, rtems_configuration_get_nanoseconds_per_tick() ); 45cda: 42ae fff8 clrl %fp@(-8) /* Update the counter of ticks since boot */ _Watchdog_Ticks_since_boot += 1; /* Update the timespec format uptime */ _Timestamp_Add_to( &_TOD_Uptime, &tick ); 45cde: 4e92 jsr %a2@ /* we do not care how much the uptime changed */ /* Update the timespec format TOD */ seconds = _Timestamp_Add_to_at_tick( &_TOD_Now, &tick ); 45ce0: 2f02 movel %d2,%sp@- 45ce2: 4879 0005 cf56 pea 5cf56 <_TOD_Now> 45ce8: 4e92 jsr %a2@ while ( seconds ) { 45cea: 4fef 0010 lea %sp@(16),%sp /* Update the timespec format uptime */ _Timestamp_Add_to( &_TOD_Uptime, &tick ); /* we do not care how much the uptime changed */ /* Update the timespec format TOD */ seconds = _Timestamp_Add_to_at_tick( &_TOD_Now, &tick ); 45cee: 2400 movel %d0,%d2 while ( seconds ) { 45cf0: 600c bras 45cfe <_TOD_Tickle_ticks+0x66> <== ALWAYS TAKEN 45cf2: 4879 0005 cf90 pea 5cf90 <_Watchdog_Seconds_chain> _Watchdog_Tickle_seconds(); seconds--; 45cf8: 5382 subql #1,%d2 45cfa: 4e93 jsr %a3@ 45cfc: 588f addql #4,%sp _Timestamp_Add_to( &_TOD_Uptime, &tick ); /* we do not care how much the uptime changed */ /* Update the timespec format TOD */ seconds = _Timestamp_Add_to_at_tick( &_TOD_Now, &tick ); while ( seconds ) { 45cfe: 4a82 tstl %d2 45d00: 66f0 bnes 45cf2 <_TOD_Tickle_ticks+0x5a> _Watchdog_Tickle_seconds(); seconds--; } } 45d02: 4cee 0c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a3 45d08: 4e5e unlk %fp 45d0a: 4e75 rts 000457c8 <_TOD_To_seconds>: */ uint32_t _TOD_To_seconds( const rtems_time_of_day *the_tod ) { 457c8: 43f9 0005 c582 lea 5c582 <_TOD_Days_to_date>,%a1 457ce: 4e56 fff0 linkw %fp,#-16 457d2: 206e 0008 moveal %fp@(8),%a0 457d6: 48d7 041c moveml %d2-%d4/%a2,%sp@ uint32_t time; uint32_t year_mod_4; time = the_tod->day - 1; year_mod_4 = the_tod->year & 3; 457da: 2210 movel %a0@,%d1 457dc: 7603 moveq #3,%d3 ) { uint32_t time; uint32_t year_mod_4; time = the_tod->day - 1; 457de: 2028 0008 movel %a0@(8),%d0 457e2: 5380 subql #1,%d0 year_mod_4 = the_tod->year & 3; 457e4: c681 andl %d1,%d3 if ( year_mod_4 == 0 ) 457e6: 660c bnes 457f4 <_TOD_To_seconds+0x2c> time += _TOD_Days_to_date[ 1 ][ the_tod->month ]; 457e8: 2428 0004 movel %a0@(4),%d2 457ec: 0682 0000 000d addil #13,%d2 457f2: 6004 bras 457f8 <_TOD_To_seconds+0x30> <== ALWAYS TAKEN else time += _TOD_Days_to_date[ 0 ][ the_tod->month ]; 457f4: 2428 0004 movel %a0@(4),%d2 time += ( (the_tod->year - TOD_BASE_YEAR) / 4 ) * 457f8: 45f9 0005 c5b6 lea 5c5b6 <_TOD_Days_since_last_leap_year>,%a2 457fe: 283c 0000 05b5 movel #1461,%d4 year_mod_4 = the_tod->year & 3; if ( year_mod_4 == 0 ) time += _TOD_Days_to_date[ 1 ][ the_tod->month ]; else time += _TOD_Days_to_date[ 0 ][ the_tod->month ]; 45804: 3431 2a00 movew %a1@(00000000,%d2:l:2),%d2 time += ( (the_tod->year - TOD_BASE_YEAR) / 4 ) * 45808: 3632 3a00 movew %a2@(00000000,%d3:l:2),%d3 year_mod_4 = the_tod->year & 3; if ( year_mod_4 == 0 ) time += _TOD_Days_to_date[ 1 ][ the_tod->month ]; else time += _TOD_Days_to_date[ 0 ][ the_tod->month ]; 4580c: 0282 0000 ffff andil #65535,%d2 time += ( (the_tod->year - TOD_BASE_YEAR) / 4 ) * 45812: 0283 0000 ffff andil #65535,%d3 year_mod_4 = the_tod->year & 3; if ( year_mod_4 == 0 ) time += _TOD_Days_to_date[ 1 ][ the_tod->month ]; else time += _TOD_Days_to_date[ 0 ][ the_tod->month ]; 45818: 2242 moveal %d2,%a1 4581a: d3c0 addal %d0,%a1 time += ( (the_tod->year - TOD_BASE_YEAR) / 4 ) * 4581c: 2001 movel %d1,%d0 4581e: 0680 ffff f83c addil #-1988,%d0 45824: e488 lsrl #2,%d0 45826: 4c04 0800 mulsl %d4,%d0 time *= TOD_SECONDS_PER_DAY; time += ((the_tod->hour * TOD_MINUTES_PER_HOUR) + the_tod->minute) * TOD_SECONDS_PER_MINUTE; time += the_tod->second; 4582a: 2428 000c movel %a0@(12),%d2 4582e: 2202 movel %d2,%d1 if ( year_mod_4 == 0 ) time += _TOD_Days_to_date[ 1 ][ the_tod->month ]; else time += _TOD_Days_to_date[ 0 ][ the_tod->month ]; time += ( (the_tod->year - TOD_BASE_YEAR) / 4 ) * 45830: d083 addl %d3,%d0 ( (TOD_DAYS_PER_YEAR * 4) + 1); time += _TOD_Days_since_last_leap_year[ year_mod_4 ]; time *= TOD_SECONDS_PER_DAY; 45832: 263c 0001 5180 movel #86400,%d3 time += _TOD_Days_to_date[ 0 ][ the_tod->month ]; time += ( (the_tod->year - TOD_BASE_YEAR) / 4 ) * ( (TOD_DAYS_PER_YEAR * 4) + 1); time += _TOD_Days_since_last_leap_year[ year_mod_4 ]; 45838: d089 addl %a1,%d0 time *= TOD_SECONDS_PER_DAY; 4583a: 4c03 0800 mulsl %d3,%d0 time += ((the_tod->hour * TOD_MINUTES_PER_HOUR) + the_tod->minute) * TOD_SECONDS_PER_MINUTE; time += the_tod->second; 4583e: e58a lsll #2,%d2 45840: ed89 lsll #6,%d1 45842: 9282 subl %d2,%d1 45844: d2a8 0010 addl %a0@(16),%d1 45848: 2401 movel %d1,%d2 4584a: e589 lsll #2,%d1 4584c: ed8a lsll #6,%d2 time += _TOD_Days_since_last_leap_year[ year_mod_4 ]; time *= TOD_SECONDS_PER_DAY; time += ((the_tod->hour * TOD_MINUTES_PER_HOUR) + the_tod->minute) 4584e: 2068 0014 moveal %a0@(20),%a0 * TOD_SECONDS_PER_MINUTE; time += the_tod->second; 45852: 9481 subl %d1,%d2 time += _TOD_Days_since_last_leap_year[ year_mod_4 ]; time *= TOD_SECONDS_PER_DAY; time += ((the_tod->hour * TOD_MINUTES_PER_HOUR) + the_tod->minute) 45854: d1fc 21da e500 addal #567993600,%a0 * TOD_SECONDS_PER_MINUTE; time += the_tod->second; 4585a: d488 addl %a0,%d2 time += TOD_SECONDS_1970_THROUGH_1988; return( time ); } 4585c: d082 addl %d2,%d0 4585e: 4cd7 041c moveml %sp@,%d2-%d4/%a2 45862: 4e5e unlk %fp 45864: 4e75 rts ... 00045868 <_TOD_Validate>: */ bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 45868: 4e56 0000 linkw %fp,#0 4586c: 206e 0008 moveal %fp@(8),%a0 45870: 2f03 movel %d3,%sp@- uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); 45872: 2039 0005 d7e0 movel 5d7e0 ,%d0 */ bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 45878: 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) || 4587a: 4a88 tstl %a0 4587c: 6762 beqs 458e0 <_TOD_Validate+0x78> <== ALWAYS TAKEN (the_tod->ticks >= ticks_per_second) || 4587e: 243c 000f 4240 movel #1000000,%d2 45884: 4c40 2002 remul %d0,%d2,%d2 45888: b4a8 0018 cmpl %a0@(24),%d2 4588c: 6352 blss 458e0 <_TOD_Validate+0x78> (the_tod->second >= TOD_SECONDS_PER_MINUTE) || 4588e: 763b moveq #59,%d3 45890: b6a8 0014 cmpl %a0@(20),%d3 45894: 654a bcss 458e0 <_TOD_Validate+0x78> (the_tod->minute >= TOD_MINUTES_PER_HOUR) || 45896: b6a8 0010 cmpl %a0@(16),%d3 4589a: 6544 bcss 458e0 <_TOD_Validate+0x78> (the_tod->hour >= TOD_HOURS_PER_DAY) || 4589c: 7017 moveq #23,%d0 4589e: b0a8 000c cmpl %a0@(12),%d0 458a2: 653c bcss 458e0 <_TOD_Validate+0x78> (the_tod->month == 0) || 458a4: 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) || 458a8: 6736 beqs 458e0 <_TOD_Validate+0x78> <== ALWAYS TAKEN 458aa: 720c moveq #12,%d1 458ac: b280 cmpl %d0,%d1 458ae: 6530 bcss 458e0 <_TOD_Validate+0x78> (the_tod->second >= TOD_SECONDS_PER_MINUTE) || (the_tod->minute >= TOD_MINUTES_PER_HOUR) || (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || 458b0: 2410 movel %a0@,%d2 uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 458b2: 0c82 0000 07c3 cmpil #1987,%d2 458b8: 6326 blss 458e0 <_TOD_Validate+0x78> (the_tod->minute >= TOD_MINUTES_PER_HOUR) || (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) 458ba: 2228 0008 movel %a0@(8),%d1 uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 458be: 6720 beqs 458e0 <_TOD_Validate+0x78> <== 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 ) 458c0: 163c 0003 moveb #3,%d3 458c4: 41f9 0005 c5be lea 5c5be <_TOD_Days_per_month>,%a0 458ca: c483 andl %d3,%d2 458cc: 6606 bnes 458d4 <_TOD_Validate+0x6c> days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; 458ce: 2030 0c34 movel %a0@(00000034,%d0:l:4),%d0 458d2: 6004 bras 458d8 <_TOD_Validate+0x70> <== ALWAYS TAKEN else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; 458d4: 2030 0c00 movel %a0@(00000000,%d0:l:4),%d0 * false - if the the_tod is invalid * * NOTE: This routine only works for leap-years through 2099. */ bool _TOD_Validate( 458d8: b081 cmpl %d1,%d0 458da: 54c0 scc %d0 458dc: 4480 negl %d0 458de: 6002 bras 458e2 <_TOD_Validate+0x7a> <== ALWAYS TAKEN 458e0: 4200 clrb %d0 if ( the_tod->day > days_in_month ) return false; return true; } 458e2: 241f movel %sp@+,%d2 458e4: 261f movel %sp@+,%d3 458e6: 4e5e unlk %fp 458e8: 4e75 rts ... 000467f4 <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 467f4: 4e56 fff0 linkw %fp,#-16 467f8: 48d7 041c moveml %d2-%d4/%a2,%sp@ 467fc: 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 ); 46800: 2f0a movel %a2,%sp@- void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 46802: 262e 000c movel %fp@(12),%d3 */ /* * Save original state */ original_state = the_thread->current_state; 46806: 242a 0010 movel %a2@(16),%d2 void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 4680a: 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 ); 4680e: 4eb9 0004 75f4 jsr 475f4 <_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 ) 46814: 588f addql #4,%sp 46816: b6aa 0014 cmpl %a2@(20),%d3 4681a: 670c beqs 46828 <_Thread_Change_priority+0x34> _Thread_Set_priority( the_thread, new_priority ); 4681c: 2f03 movel %d3,%sp@- 4681e: 2f0a movel %a2,%sp@- 46820: 4eb9 0004 749c jsr 4749c <_Thread_Set_priority> 46826: 508f addql #8,%sp _ISR_Disable( level ); 46828: 223c 0000 0700 movel #1792,%d1 4682e: 40c0 movew %sr,%d0 46830: 8280 orl %d0,%d1 46832: 46c1 movew %d1,%sr 46834: 7604 moveq #4,%d3 /* * If the thread has more than STATES_TRANSIENT set, then it is blocked, * If it is blocked on a thread queue, then we need to requeue it. */ state = the_thread->current_state; 46836: 222a 0010 movel %a2@(16),%d1 4683a: c483 andl %d3,%d2 if ( state != STATES_TRANSIENT ) { 4683c: b681 cmpl %d1,%d3 4683e: 6730 beqs 46870 <_Thread_Change_priority+0x7c> /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) 46840: 4a82 tstl %d2 46842: 6608 bnes 4684c <_Thread_Change_priority+0x58> <== ALWAYS TAKEN the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); 46844: 74fb moveq #-5,%d2 46846: c481 andl %d1,%d2 46848: 2542 0010 movel %d2,%a2@(16) _ISR_Enable( level ); 4684c: 46c0 movew %d0,%sr if ( _States_Is_waiting_on_thread_queue( state ) ) { 4684e: 0281 0003 bee0 andil #245472,%d1 46854: 6700 00d2 beqw 46928 <_Thread_Change_priority+0x134> _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); 46858: 2d4a 000c movel %a2,%fp@(12) 4685c: 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 ); } 46862: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 46868: 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 ); 4686a: 4ef9 0004 7400 jmp 47400 <_Thread_queue_Requeue> } return; } /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) { 46870: 4a82 tstl %d2 46872: 6650 bnes 468c4 <_Thread_Change_priority+0xd0> <== 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; 46874: 226a 008e moveal %a2@(142),%a1 46878: 322a 0094 movew %a2@(148),%d1 4687c: 3411 movew %a1@,%d2 4687e: 206a 008a moveal %a2@(138),%a0 46882: 8282 orl %d2,%d1 * Interrupts are STILL disabled. * We now know the thread will be in the READY state when we remove * the TRANSIENT state. So we have to place it on the appropriate * Ready Queue with interrupts off. */ the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); 46884: 42aa 0010 clrl %a2@(16) 46888: 3281 movew %d1,%a1@ _Priority_Major_bit_map |= the_priority_map->ready_major; 4688a: 3239 0005 cf74 movew 5cf74 <_Priority_Major_bit_map>,%d1 46890: 342a 0092 movew %a2@(146),%d2 46894: 8282 orl %d2,%d1 46896: 33c1 0005 cf74 movew %d1,5cf74 <_Priority_Major_bit_map> _Priority_Add_to_bit_map( &the_thread->Priority_map ); if ( prepend_it ) 4689c: 4a04 tstb %d4 4689e: 6710 beqs 468b0 <_Thread_Change_priority+0xbc> ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 468a0: 2250 moveal %a0@,%a1 Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 468a2: 2548 0004 movel %a0,%a2@(4) before_node = after_node->next; after_node->next = the_node; 468a6: 208a movel %a2,%a0@ the_node->next = before_node; before_node->previous = the_node; 468a8: 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; 468ac: 2489 movel %a1,%a2@ 468ae: 6014 bras 468c4 <_Thread_Change_priority+0xd0> <== ALWAYS TAKEN Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 468b0: 2608 movel %a0,%d3 468b2: 5883 addql #4,%d3 468b4: 2483 movel %d3,%a2@ old_last_node = the_chain->last; 468b6: 2268 0008 moveal %a0@(8),%a1 the_chain->last = the_node; 468ba: 214a 0008 movel %a2,%a0@(8) old_last_node->next = the_node; the_node->previous = old_last_node; 468be: 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; 468c2: 228a movel %a2,%a1@ _Chain_Prepend_unprotected( the_thread->ready, &the_thread->Object.Node ); else _Chain_Append_unprotected( the_thread->ready, &the_thread->Object.Node ); } _ISR_Flash( level ); 468c4: 223c 0000 0700 movel #1792,%d1 468ca: 46c0 movew %d0,%sr 468cc: 8280 orl %d0,%d1 468ce: 46c1 movew %d1,%sr RTEMS_INLINE_ROUTINE Priority_Control _Priority_Get_highest( void ) { Priority_Bit_map_control minor; Priority_Bit_map_control major; _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); 468d0: 3239 0005 cf74 movew 5cf74 <_Priority_Major_bit_map>,%d1 468d6: 4841 swap %d1 468d8: 04c1 ff1 %d1 _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 468da: 4282 clrl %d2 468dc: 41f9 0005 cfe4 lea 5cfe4 <_Priority_Bit_map>,%a0 468e2: 3401 movew %d1,%d2 468e4: 3230 2a00 movew %a0@(00000000,%d2:l:2),%d1 468e8: 4841 swap %d1 468ea: 04c1 ff1 %d1 * ready thread. */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) 468ec: 4283 clrl %d3 468ee: e98a lsll #4,%d2 468f0: 3601 movew %d1,%d3 468f2: 2279 0005 ce70 moveal 5ce70 <_Thread_Ready_chain>,%a1 468f8: 2202 movel %d2,%d1 468fa: d283 addl %d3,%d1 468fc: 2401 movel %d1,%d2 468fe: e58a lsll #2,%d2 46900: e989 lsll #4,%d1 * is also the heir thread, and false otherwise. */ RTEMS_INLINE_ROUTINE bool _Thread_Is_executing_also_the_heir( void ) { return ( _Thread_Executing == _Thread_Heir ); 46902: 2079 0005 cf7e moveal 5cf7e <_Thread_Executing>,%a0 * ready thread. */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) 46908: 93c2 subal %d2,%a1 4690a: 2231 1800 movel %a1@(00000000,%d1:l),%d1 4690e: 23c1 0005 cf52 movel %d1,5cf52 <_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() && 46914: b288 cmpl %a0,%d1 46916: 670e beqs 46926 <_Thread_Change_priority+0x132> _Thread_Executing->is_preemptible ) 46918: 4a28 0075 tstb %a0@(117) 4691c: 6708 beqs 46926 <_Thread_Change_priority+0x132> _Context_Switch_necessary = true; 4691e: 7201 moveq #1,%d1 46920: 13c1 0005 cf8e moveb %d1,5cf8e <_Context_Switch_necessary> _ISR_Enable( level ); 46926: 46c0 movew %d0,%sr } 46928: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 4692e: 4e5e unlk %fp 46930: 4e75 rts ... 00046934 <_Thread_Clear_state>: void _Thread_Clear_state( Thread_Control *the_thread, States_Control state ) { 46934: 4e56 ffec linkw %fp,#-20 46938: 206e 0008 moveal %fp@(8),%a0 4693c: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ ISR_Level level; States_Control current_state; _ISR_Disable( level ); 46940: 263c 0000 0700 movel #1792,%d3 46946: 2203 movel %d3,%d1 void _Thread_Clear_state( Thread_Control *the_thread, States_Control state ) { 46948: 202e 000c movel %fp@(12),%d0 ISR_Level level; States_Control current_state; _ISR_Disable( level ); 4694c: 40c2 movew %sr,%d2 4694e: 8282 orl %d2,%d1 46950: 46c1 movew %d1,%sr current_state = the_thread->current_state; 46952: 2228 0010 movel %a0@(16),%d1 if ( current_state & state ) { 46956: 2800 movel %d0,%d4 46958: c881 andl %d1,%d4 4695a: 6778 beqs 469d4 <_Thread_Clear_state+0xa0> RTEMS_INLINE_ROUTINE States_Control _States_Clear ( States_Control states_to_clear, States_Control current_state ) { return (current_state & ~states_to_clear); 4695c: 4680 notl %d0 4695e: c081 andl %d1,%d0 current_state = 46960: 2140 0010 movel %d0,%a0@(16) the_thread->current_state = _States_Clear( state, current_state ); if ( _States_Is_ready( current_state ) ) { 46964: 666e bnes 469d4 <_Thread_Clear_state+0xa0> RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 46966: 2668 008e moveal %a0@(142),%a3 4696a: 3028 0094 movew %a0@(148),%d0 4696e: 3213 movew %a3@,%d1 _Priority_Add_to_bit_map( &the_thread->Priority_map ); _Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node); 46970: 2268 008a moveal %a0@(138),%a1 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 46974: 2809 movel %a1,%d4 46976: 5884 addql #4,%d4 46978: 8081 orl %d1,%d0 4697a: 2084 movel %d4,%a0@ old_last_node = the_chain->last; 4697c: 2469 0008 moveal %a1@(8),%a2 46980: 3680 movew %d0,%a3@ the_chain->last = the_node; 46982: 2348 0008 movel %a0,%a1@(8) _Priority_Major_bit_map |= the_priority_map->ready_major; 46986: 3039 0005 cf74 movew 5cf74 <_Priority_Major_bit_map>,%d0 4698c: 3228 0092 movew %a0@(146),%d1 old_last_node->next = the_node; the_node->previous = old_last_node; 46990: 214a 0004 movel %a2,%a0@(4) 46994: 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; 46996: 2488 movel %a0,%a2@ 46998: 33c0 0005 cf74 movew %d0,5cf74 <_Priority_Major_bit_map> _ISR_Flash( level ); 4699e: 2003 movel %d3,%d0 469a0: 46c2 movew %d2,%sr 469a2: 8082 orl %d2,%d0 469a4: 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 ) { 469a6: 2028 0014 movel %a0@(20),%d0 469aa: 2279 0005 cf52 moveal 5cf52 <_Thread_Heir>,%a1 469b0: b0a9 0014 cmpl %a1@(20),%d0 469b4: 641e bccs 469d4 <_Thread_Clear_state+0xa0> _Thread_Heir = the_thread; 469b6: 23c8 0005 cf52 movel %a0,5cf52 <_Thread_Heir> if ( _Thread_Executing->is_preemptible || 469bc: 2079 0005 cf7e moveal 5cf7e <_Thread_Executing>,%a0 469c2: 4a28 0075 tstb %a0@(117) 469c6: 6604 bnes 469cc <_Thread_Clear_state+0x98> 469c8: 4a80 tstl %d0 469ca: 6608 bnes 469d4 <_Thread_Clear_state+0xa0> <== NEVER TAKEN the_thread->current_priority == 0 ) _Context_Switch_necessary = true; 469cc: 7001 moveq #1,%d0 469ce: 13c0 0005 cf8e moveb %d0,5cf8e <_Context_Switch_necessary> } } } _ISR_Enable( level ); 469d4: 46c2 movew %d2,%sr } 469d6: 4cd7 0c1c moveml %sp@,%d2-%d4/%a2-%a3 469da: 4e5e unlk %fp 469dc: 4e75 rts ... 00046b60 <_Thread_Delay_ended>: void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { 46b60: 4e56 fffc linkw %fp,#-4 Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 46b64: 486e fffc pea %fp@(-4) 46b68: 2f2e 0008 movel %fp@(8),%sp@- 46b6c: 4eb9 0004 6d14 jsr 46d14 <_Thread_Get> switch ( location ) { 46b72: 508f addql #8,%sp 46b74: 4aae fffc tstl %fp@(-4) 46b78: 661e bnes 46b98 <_Thread_Delay_ended+0x38> <== ALWAYS TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_Clear_state( 46b7a: 2f3c 1000 0018 movel #268435480,%sp@- 46b80: 2f00 movel %d0,%sp@- 46b82: 4eb9 0004 6934 jsr 46934 <_Thread_Clear_state> 46b88: 508f addql #8,%sp 46b8a: 2039 0005 cec4 movel 5cec4 <_Thread_Dispatch_disable_level>,%d0 46b90: 5380 subql #1,%d0 46b92: 23c0 0005 cec4 movel %d0,5cec4 <_Thread_Dispatch_disable_level> | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Thread_Unnest_dispatch(); break; } } 46b98: 4e5e unlk %fp 46b9a: 4e75 rts 00046b9c <_Thread_Dispatch>: Thread_Control *executing; Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); 46b9c: 307c 0700 moveaw #1792,%a0 46ba0: 2208 movel %a0,%d1 * dispatch thread * no dispatch thread */ void _Thread_Dispatch( void ) { 46ba2: 4e56 ffc8 linkw %fp,#-56 46ba6: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ Thread_Control *executing; Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; 46baa: 2479 0005 cf7e moveal 5cf7e <_Thread_Executing>,%a2 _ISR_Disable( level ); 46bb0: 40c0 movew %sr,%d0 46bb2: 8280 orl %d0,%d1 46bb4: 46c1 movew %d1,%sr _ISR_Enable( level ); #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 46bb6: 260e movel %fp,%d3 _Timestamp_Subtract( 46bb8: 240e movel %fp,%d2 _ISR_Enable( level ); #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 46bba: 5183 subql #8,%d3 _Timestamp_Subtract( 46bbc: 0682 ffff fff0 addil #-16,%d2 46bc2: 2e3c 0004 79a4 movel #293284,%d7 &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); 46bc8: 2c3c 0004 7964 movel #293220,%d6 if ( _Thread_libc_reent ) { executing->libc_reent = *_Thread_libc_reent; *_Thread_libc_reent = heir->libc_reent; } _User_extensions_Thread_switch( executing, heir ); 46bce: 2a3c 0004 7c1c movel #293916,%d5 #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); _Context_Restore_fp( &executing->fp_context ); 46bd4: 4bf9 0004 8084 lea 48084 <_CPU_Context_restore_fp>,%a5 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 46bda: 49f9 0004 8062 lea 48062 <_CPU_Context_save_fp>,%a4 if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 46be0: 283c 0004 7f34 movel #294708,%d4 Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { 46be6: 6000 00d0 braw 46cb8 <_Thread_Dispatch+0x11c> <== ALWAYS TAKEN heir = _Thread_Heir; _Thread_Dispatch_disable_level = 1; 46bea: 7201 moveq #1,%d1 46bec: 23c1 0005 cec4 movel %d1,5cec4 <_Thread_Dispatch_disable_level> ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { heir = _Thread_Heir; 46bf2: 2679 0005 cf52 moveal 5cf52 <_Thread_Heir>,%a3 _Thread_Dispatch_disable_level = 1; _Context_Switch_necessary = false; 46bf8: 4201 clrb %d1 _Thread_Executing = heir; 46bfa: 23cb 0005 cf7e movel %a3,5cf7e <_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; 46c00: 13c1 0005 cf8e moveb %d1,5cf8e <_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 ) 46c06: 7201 moveq #1,%d1 46c08: b2ab 007a cmpl %a3@(122),%d1 46c0c: 660a bnes 46c18 <_Thread_Dispatch+0x7c> heir->cpu_time_budget = _Thread_Ticks_per_timeslice; 46c0e: 41f9 0005 ce74 lea 5ce74 <_Thread_Ticks_per_timeslice>,%a0 46c14: 2750 0076 movel %a0@,%a3@(118) _ISR_Enable( level ); 46c18: 46c0 movew %d0,%sr #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 46c1a: 2f03 movel %d3,%sp@- 46c1c: 4eb9 0004 a328 jsr 4a328 <_TOD_Get_uptime> _Timestamp_Subtract( 46c22: 2047 moveal %d7,%a0 46c24: 2f02 movel %d2,%sp@- 46c26: 2f03 movel %d3,%sp@- 46c28: 4879 0005 cf86 pea 5cf86 <_Thread_Time_of_last_context_switch> 46c2e: 4e90 jsr %a0@ &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); 46c30: 2046 moveal %d6,%a0 46c32: 2f02 movel %d2,%sp@- 46c34: 486a 0082 pea %a2@(130) 46c38: 4e90 jsr %a0@ #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 46c3a: 2079 0005 cf4e moveal 5cf4e <_Thread_libc_reent>,%a0 46c40: 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; 46c44: 202e fff8 movel %fp@(-8),%d0 46c48: 222e fffc movel %fp@(-4),%d1 46c4c: 23c0 0005 cf86 movel %d0,5cf86 <_Thread_Time_of_last_context_switch> 46c52: 23c1 0005 cf8a movel %d1,5cf8a <_Thread_Time_of_last_context_switch+0x4> #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 46c58: 4a88 tstl %a0 46c5a: 6708 beqs 46c64 <_Thread_Dispatch+0xc8> <== ALWAYS TAKEN executing->libc_reent = *_Thread_libc_reent; 46c5c: 2550 0106 movel %a0@,%a2@(262) *_Thread_libc_reent = heir->libc_reent; 46c60: 20ab 0106 movel %a3@(262),%a0@ } _User_extensions_Thread_switch( executing, heir ); 46c64: 2f0b movel %a3,%sp@- 46c66: 2045 moveal %d5,%a0 46c68: 2f0a movel %a2,%sp@- 46c6a: 4e90 jsr %a0@ if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 46c6c: 486b 00ce pea %a3@(206) 46c70: 2044 moveal %d4,%a0 46c72: 486a 00ce pea %a2@(206) 46c76: 4e90 jsr %a0@ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && 46c78: 4fef 0010 lea %sp@(16),%sp 46c7c: 4aaa 0102 tstl %a2@(258) 46c80: 6724 beqs 46ca6 <_Thread_Dispatch+0x10a> #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) RTEMS_INLINE_ROUTINE bool _Thread_Is_allocated_fp ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Allocated_fp ); 46c82: 2079 0005 cf4a moveal 5cf4a <_Thread_Allocated_fp>,%a0 46c88: b1ca cmpal %a2,%a0 46c8a: 671a beqs 46ca6 <_Thread_Dispatch+0x10a> !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) 46c8c: 4a88 tstl %a0 46c8e: 6708 beqs 46c98 <_Thread_Dispatch+0xfc> _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 46c90: 4868 0102 pea %a0@(258) 46c94: 4e94 jsr %a4@ 46c96: 588f addql #4,%sp _Context_Restore_fp( &executing->fp_context ); 46c98: 486a 0102 pea %a2@(258) 46c9c: 4e95 jsr %a5@ _Thread_Allocated_fp = executing; 46c9e: 588f addql #4,%sp 46ca0: 23ca 0005 cf4a movel %a2,5cf4a <_Thread_Allocated_fp> if ( executing->fp_context != NULL ) _Context_Restore_fp( &executing->fp_context ); #endif #endif executing = _Thread_Executing; 46ca6: 2479 0005 cf7e moveal 5cf7e <_Thread_Executing>,%a2 _ISR_Disable( level ); 46cac: 223c 0000 0700 movel #1792,%d1 46cb2: 40c0 movew %sr,%d0 46cb4: 8280 orl %d0,%d1 46cb6: 46c1 movew %d1,%sr Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { 46cb8: 1239 0005 cf8e moveb 5cf8e <_Context_Switch_necessary>,%d1 46cbe: 6600 ff2a bnew 46bea <_Thread_Dispatch+0x4e> executing = _Thread_Executing; _ISR_Disable( level ); } _Thread_Dispatch_disable_level = 0; 46cc2: 42b9 0005 cec4 clrl 5cec4 <_Thread_Dispatch_disable_level> _ISR_Enable( level ); 46cc8: 46c0 movew %d0,%sr if ( _Thread_Do_post_task_switch_extension || 46cca: 4ab9 0005 cf66 tstl 5cf66 <_Thread_Do_post_task_switch_extension> 46cd0: 6606 bnes 46cd8 <_Thread_Dispatch+0x13c> executing->do_post_task_switch_extension ) { 46cd2: 4a2a 0074 tstb %a2@(116) 46cd6: 670c beqs 46ce4 <_Thread_Dispatch+0x148> executing->do_post_task_switch_extension = false; 46cd8: 4200 clrb %d0 46cda: 1540 0074 moveb %d0,%a2@(116) _API_extensions_Run_postswitch(); 46cde: 4eb9 0004 5792 jsr 45792 <_API_extensions_Run_postswitch> } } 46ce4: 4cee 3cfc ffc8 moveml %fp@(-56),%d2-%d7/%a2-%a5 46cea: 4e5e unlk %fp 46cec: 4e75 rts 0004c264 <_Thread_Evaluate_mode>: * * XXX */ bool _Thread_Evaluate_mode( void ) { 4c264: 4e56 0000 linkw %fp,#0 Thread_Control *executing; executing = _Thread_Executing; 4c268: 2079 0005 cf7e moveal 5cf7e <_Thread_Executing>,%a0 if ( !_States_Is_ready( executing->current_state ) || 4c26e: 4aa8 0010 tstl %a0@(16) 4c272: 660e bnes 4c282 <_Thread_Evaluate_mode+0x1e> <== ALWAYS TAKEN 4c274: b1f9 0005 cf52 cmpal 5cf52 <_Thread_Heir>,%a0 4c27a: 6710 beqs 4c28c <_Thread_Evaluate_mode+0x28> ( !_Thread_Is_heir( executing ) && executing->is_preemptible ) ) { 4c27c: 4a28 0075 tstb %a0@(117) 4c280: 670a beqs 4c28c <_Thread_Evaluate_mode+0x28> <== ALWAYS TAKEN _Context_Switch_necessary = true; 4c282: 7001 moveq #1,%d0 4c284: 13c0 0005 cf8e moveb %d0,5cf8e <_Context_Switch_necessary> return true; 4c28a: 6002 bras 4c28e <_Thread_Evaluate_mode+0x2a> <== ALWAYS TAKEN 4c28c: 4200 clrb %d0 } return false; } 4c28e: 4e5e unlk %fp 4c290: 4e75 rts ... 00046d14 <_Thread_Get>: Thread_Control *_Thread_Get ( Objects_Id id, Objects_Locations *location ) { 46d14: 4e56 0000 linkw %fp,#0 46d18: 202e 0008 movel %fp@(8),%d0 46d1c: 2f03 movel %d3,%sp@- 46d1e: 206e 000c moveal %fp@(12),%a0 46d22: 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 ) ) { 46d24: 4a80 tstl %d0 46d26: 6618 bnes 46d40 <_Thread_Get+0x2c> rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 46d28: 2039 0005 cec4 movel 5cec4 <_Thread_Dispatch_disable_level>,%d0 46d2e: 5280 addql #1,%d0 46d30: 23c0 0005 cec4 movel %d0,5cec4 <_Thread_Dispatch_disable_level> _Thread_Disable_dispatch(); *location = OBJECTS_LOCAL; 46d36: 4290 clrl %a0@ tp = _Thread_Executing; 46d38: 2039 0005 cf7e movel 5cf7e <_Thread_Executing>,%d0 goto done; 46d3e: 6044 bras 46d84 <_Thread_Get+0x70> <== ALWAYS TAKEN */ RTEMS_INLINE_ROUTINE Objects_APIs _Objects_Get_API( Objects_Id id ) { return (Objects_APIs) ((id >> OBJECTS_API_START_BIT) & OBJECTS_API_VALID_BITS); 46d40: 7418 moveq #24,%d2 46d42: 2200 movel %d0,%d1 46d44: e4a9 lsrl %d2,%d1 46d46: 7607 moveq #7,%d3 */ RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid( uint32_t the_api ) { if ( !the_api || the_api > OBJECTS_APIS_LAST ) 46d48: 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); 46d4c: c283 andl %d3,%d1 */ RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid( uint32_t the_api ) { if ( !the_api || the_api > OBJECTS_APIS_LAST ) 46d4e: 2241 moveal %d1,%a1 46d50: 5389 subql #1,%a1 46d52: b489 cmpl %a1,%d2 46d54: 643a bccs 46d90 <_Thread_Get+0x7c> 46d56: 6014 bras 46d6c <_Thread_Get+0x58> <== ALWAYS TAKEN if ( the_class != 1 ) { /* threads are always first class :) */ *location = OBJECTS_ERROR; goto done; } api_information = _Objects_Information_table[ the_api ]; 46d58: 43f9 0005 ce7c lea 5ce7c <_Objects_Information_table>,%a1 46d5e: 2271 1c00 moveal %a1@(00000000,%d1:l:4),%a1 if ( !api_information ) { 46d62: 4a89 tstl %a1 46d64: 6706 beqs 46d6c <_Thread_Get+0x58> *location = OBJECTS_ERROR; goto done; } information = api_information[ the_class ]; 46d66: 2229 0004 movel %a1@(4),%d1 if ( !information ) { 46d6a: 6608 bnes 46d74 <_Thread_Get+0x60> *location = OBJECTS_ERROR; 46d6c: 7001 moveq #1,%d0 46d6e: 2080 movel %d0,%a0@ 46d70: 4280 clrl %d0 goto done; 46d72: 6010 bras 46d84 <_Thread_Get+0x70> <== ALWAYS TAKEN } tp = (Thread_Control *) _Objects_Get( information, id, location ); 46d74: 2f08 movel %a0,%sp@- 46d76: 2f00 movel %d0,%sp@- 46d78: 2f01 movel %d1,%sp@- 46d7a: 4eb9 0004 64f4 jsr 464f4 <_Objects_Get> 46d80: 4fef 000c lea %sp@(12),%sp done: return tp; } 46d84: 242e fff8 movel %fp@(-8),%d2 46d88: 262e fffc movel %fp@(-4),%d3 46d8c: 4e5e unlk %fp 46d8e: 4e75 rts *location = OBJECTS_ERROR; goto done; } the_class = _Objects_Get_class( id ); if ( the_class != 1 ) { /* threads are always first class :) */ 46d90: 761b moveq #27,%d3 46d92: 2400 movel %d0,%d2 46d94: e6aa lsrl %d3,%d2 46d96: 163c 0001 moveb #1,%d3 46d9a: b682 cmpl %d2,%d3 46d9c: 67ba beqs 46d58 <_Thread_Get+0x44> 46d9e: 60cc bras 46d6c <_Thread_Get+0x58> <== ALWAYS TAKEN 0004c294 <_Thread_Handler>: * * Output parameters: NONE */ void _Thread_Handler( void ) { 4c294: 4e56 0000 linkw %fp,#0 4c298: 2f0a movel %a2,%sp@- #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static char doneConstructors; char doneCons; #endif executing = _Thread_Executing; 4c29a: 2479 0005 cf7e moveal 5cf7e <_Thread_Executing>,%a2 * * Output parameters: NONE */ void _Thread_Handler( void ) { 4c2a0: 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; 4c2a2: 222a 00b4 movel %a2@(180),%d1 _ISR_Set_level(level); 4c2a6: 40c0 movew %sr,%d0 4c2a8: e189 lsll #8,%d1 4c2aa: 0280 0000 f8ff andil #63743,%d0 4c2b0: 8081 orl %d1,%d0 4c2b2: 46c0 movew %d0,%sr #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) doneCons = doneConstructors; doneConstructors = 1; 4c2b4: 7001 moveq #1,%d0 level = executing->Start.isr_level; _ISR_Set_level(level); #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) doneCons = doneConstructors; 4c2b6: 1439 0005 c674 moveb 5c674 ,%d2 doneConstructors = 1; 4c2bc: 13c0 0005 c674 moveb %d0,5c674 #endif #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && 4c2c2: 4aaa 0102 tstl %a2@(258) 4c2c6: 6720 beqs 4c2e8 <_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 ); 4c2c8: 2079 0005 cf4a moveal 5cf4a <_Thread_Allocated_fp>,%a0 4c2ce: b1ca cmpal %a2,%a0 4c2d0: 6716 beqs 4c2e8 <_Thread_Handler+0x54> !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) 4c2d2: 4a88 tstl %a0 4c2d4: 670c beqs 4c2e2 <_Thread_Handler+0x4e> _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 4c2d6: 4868 0102 pea %a0@(258) 4c2da: 4eb9 0004 8062 jsr 48062 <_CPU_Context_save_fp> 4c2e0: 588f addql #4,%sp _Thread_Allocated_fp = executing; 4c2e2: 23ca 0005 cf4a movel %a2,5cf4a <_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 ); 4c2e8: 2f0a movel %a2,%sp@- 4c2ea: 4eb9 0004 7a9c jsr 47a9c <_User_extensions_Thread_begin> /* * At this point, the dispatch disable level BETTER be 1. */ _Thread_Enable_dispatch(); 4c2f0: 4eb9 0004 6cee jsr 46cee <_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) */ { 4c2f6: 588f addql #4,%sp 4c2f8: 4a02 tstb %d2 4c2fa: 6606 bnes 4c302 <_Thread_Handler+0x6e> INIT_NAME (); 4c2fc: 4eb9 0005 9b70 jsr 59b70 <_init> } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 4c302: 202a 009e movel %a2@(158),%d0 4c306: 6606 bnes 4c30e <_Thread_Handler+0x7a> executing->Wait.return_argument = (*(Thread_Entry_numeric) executing->Start.entry_point)( 4c308: 2f2a 00a6 movel %a2@(166),%sp@- 4c30c: 600a bras 4c318 <_Thread_Handler+0x84> <== ALWAYS TAKEN executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { 4c30e: 7201 moveq #1,%d1 4c310: b280 cmpl %d0,%d1 4c312: 6610 bnes 4c324 <_Thread_Handler+0x90> <== ALWAYS TAKEN executing->Wait.return_argument = (*(Thread_Entry_pointer) executing->Start.entry_point)( 4c314: 2f2a 00a2 movel %a2@(162),%sp@- 4c318: 206a 009a moveal %a2@(154),%a0 4c31c: 4e90 jsr %a0@ executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { executing->Wait.return_argument = 4c31e: 588f addql #4,%sp 4c320: 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 ); 4c324: 2f0a movel %a2,%sp@- 4c326: 4eb9 0004 7ad4 jsr 47ad4 <_User_extensions_Thread_exitted> _Internal_error_Occurred( 4c32c: 4878 0006 pea 6 4c330: 4878 0001 pea 1 4c334: 42a7 clrl %sp@- 4c336: 4eb9 0004 5fe4 jsr 45fe4 <_Internal_error_Occurred> 00046da0 <_Thread_Initialize>: Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 46da0: 4e56 ffe4 linkw %fp,#-28 46da4: 222e 0010 movel %fp@(16),%d1 46da8: 48d7 1c3c moveml %d2-%d5/%a2-%a4,%sp@ 46dac: 246e 000c moveal %fp@(12),%a2 46db0: 242e 0014 movel %fp@(20),%d2 46db4: 282e 001c movel %fp@(28),%d4 46db8: 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; 46dbc: 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 ) { 46dc0: 162e 001b moveb %fp@(27),%d3 /* * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; 46dc4: 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 ) { 46dc8: 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; 46dcc: 42aa 0112 clrl %a2@(274) extensions_area = NULL; the_thread->libc_reent = NULL; 46dd0: 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 ) { 46dd4: 4a81 tstl %d1 46dd6: 6620 bnes 46df8 <_Thread_Initialize+0x58> actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); 46dd8: 2f02 movel %d2,%sp@- 46dda: 2f0a movel %a2,%sp@- 46ddc: 4eb9 0004 7670 jsr 47670 <_Thread_Stack_Allocate> if ( !actual_stack_size || actual_stack_size < stack_size ) 46de2: 508f addql #8,%sp 46de4: 4a80 tstl %d0 46de6: 6700 0168 beqw 46f50 <_Thread_Initialize+0x1b0> 46dea: b480 cmpl %d0,%d2 46dec: 6200 0162 bhiw 46f50 <_Thread_Initialize+0x1b0> <== ALWAYS TAKEN return false; /* stack allocation failed */ stack = the_thread->Start.stack; 46df0: 222a 00ca movel %a2@(202),%d1 the_thread->Start.core_allocated_stack = true; 46df4: 7401 moveq #1,%d2 46df6: 6004 bras 46dfc <_Thread_Initialize+0x5c> <== ALWAYS TAKEN } else { stack = stack_area; actual_stack_size = stack_size; the_thread->Start.core_allocated_stack = false; 46df8: 2002 movel %d2,%d0 46dfa: 4202 clrb %d2 Stack_Control *the_stack, void *starting_address, size_t size ) { the_stack->area = starting_address; 46dfc: 2541 00c2 movel %d1,%a2@(194) 46e00: 1542 00bc moveb %d2,%a2@(188) the_stack->size = size; 46e04: 2540 00be movel %d0,%a2@(190) /* * Allocate the floating point area for this thread */ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( is_fp ) { 46e08: 4a03 tstb %d3 46e0a: 6604 bnes 46e10 <_Thread_Initialize+0x70> 46e0c: 4283 clrl %d3 46e0e: 6016 bras 46e26 <_Thread_Initialize+0x86> <== ALWAYS TAKEN fp_area = _Workspace_Allocate( CONTEXT_FP_SIZE ); 46e10: 4878 001c pea 1c 46e14: 4eb9 0004 7e9c jsr 47e9c <_Workspace_Allocate> if ( !fp_area ) 46e1a: 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 ); 46e1c: 2600 movel %d0,%d3 if ( !fp_area ) 46e1e: 6606 bnes 46e26 <_Thread_Initialize+0x86> 46e20: 4282 clrl %d2 46e22: 6000 00d4 braw 46ef8 <_Thread_Initialize+0x158> <== ALWAYS TAKEN #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { 46e26: 2039 0005 cf62 movel 5cf62 <_Thread_Maximum_extensions>,%d0 fp_area = _Workspace_Allocate( CONTEXT_FP_SIZE ); if ( !fp_area ) goto failed; fp_area = _Context_Fp_start( fp_area, 0 ); } the_thread->fp_context = fp_area; 46e2c: 2543 0102 movel %d3,%a2@(258) the_thread->Start.fp_context = fp_area; 46e30: 2543 00c6 movel %d3,%a2@(198) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 46e34: 42aa 0050 clrl %a2@(80) the_watchdog->routine = routine; 46e38: 42aa 0064 clrl %a2@(100) the_watchdog->id = id; 46e3c: 42aa 0068 clrl %a2@(104) the_watchdog->user_data = user_data; 46e40: 42aa 006c clrl %a2@(108) #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { 46e44: 4a80 tstl %d0 46e46: 6604 bnes 46e4c <_Thread_Initialize+0xac> 46e48: 4282 clrl %d2 46e4a: 6016 bras 46e62 <_Thread_Initialize+0xc2> <== ALWAYS TAKEN extensions_area = _Workspace_Allocate( 46e4c: e588 lsll #2,%d0 46e4e: 2040 moveal %d0,%a0 46e50: 4868 0004 pea %a0@(4) 46e54: 4eb9 0004 7e9c jsr 47e9c <_Workspace_Allocate> (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) 46e5a: 588f addql #4,%sp /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { extensions_area = _Workspace_Allocate( 46e5c: 2400 movel %d0,%d2 (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) 46e5e: 6700 0098 beqw 46ef8 <_Thread_Initialize+0x158> goto failed; } the_thread->extensions = (void **) extensions_area; 46e62: 2542 0116 movel %d2,%a2@(278) * if they are linked to the thread. An extension user may * create the extension long after tasks have been created * so they cannot rely on the thread create user extension * call. */ if ( the_thread->extensions ) { 46e66: 6718 beqs 46e80 <_Thread_Initialize+0xe0> for ( i = 0; i <= _Thread_Maximum_extensions ; i++ ) 46e68: 2239 0005 cf62 movel 5cf62 <_Thread_Maximum_extensions>,%d1 46e6e: 4280 clrl %d0 46e70: 600a bras 46e7c <_Thread_Initialize+0xdc> <== ALWAYS TAKEN the_thread->extensions[i] = NULL; 46e72: 206a 0116 moveal %a2@(278),%a0 46e76: 42b0 0c00 clrl %a0@(00000000,%d0:l:4) * create the extension long after tasks have been created * so they cannot rely on the thread create user extension * call. */ if ( the_thread->extensions ) { for ( i = 0; i <= _Thread_Maximum_extensions ; i++ ) 46e7a: 5280 addql #1,%d0 46e7c: b280 cmpl %d0,%d1 46e7e: 64f2 bccs 46e72 <_Thread_Initialize+0xd2> /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; 46e80: 254b 00ac movel %a3,%a2@(172) the_thread->Start.budget_callout = budget_callout; switch ( budget_algorithm ) { 46e84: 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; 46e86: 256e 0028 00b0 movel %fp@(40),%a2@(176) /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; 46e8c: 1545 00aa moveb %d5,%a2@(170) the_thread->Start.budget_algorithm = budget_algorithm; the_thread->Start.budget_callout = budget_callout; switch ( budget_algorithm ) { 46e90: b08b cmpl %a3,%d0 46e92: 660a bnes 46e9e <_Thread_Initialize+0xfe> case THREAD_CPU_BUDGET_ALGORITHM_NONE: case THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE: break; #if defined(RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE) case THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; 46e94: 41f9 0005 ce74 lea 5ce74 <_Thread_Ticks_per_timeslice>,%a0 46e9a: 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 ); 46e9e: 2f04 movel %d4,%sp@- case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; 46ea0: 256e 002c 00b4 movel %fp@(44),%a2@(180) the_thread->current_state = STATES_DORMANT; 46ea6: 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 ); 46ea8: 2f0a movel %a2,%sp@- #endif } the_thread->Start.isr_level = isr_level; the_thread->current_state = STATES_DORMANT; 46eaa: 2540 0010 movel %d0,%a2@(16) the_thread->Wait.queue = NULL; 46eae: 42aa 0044 clrl %a2@(68) the_thread->resource_count = 0; 46eb2: 42aa 001c clrl %a2@(28) #if defined(RTEMS_ITRON_API) the_thread->suspend_count = 0; #endif the_thread->real_priority = priority; 46eb6: 2544 0018 movel %d4,%a2@(24) the_thread->Start.initial_priority = priority; 46eba: 2544 00b8 movel %d4,%a2@(184) _Thread_Set_priority( the_thread, priority ); 46ebe: 4eb9 0004 749c jsr 4749c <_Thread_Set_priority> #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 46ec4: 206e 0008 moveal %fp@(8),%a0 46ec8: 4280 clrl %d0 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 46eca: 256e 0030 000c movel %fp@(48),%a2@(12) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 46ed0: 2068 0018 moveal %a0@(24),%a0 46ed4: 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 ); 46ed8: 42aa 0082 clrl %a2@(130) 46edc: 218a 0c00 movel %a2,%a0@(00000000,%d0:l:4) 46ee0: 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 ); 46ee4: 2f0a movel %a2,%sp@- 46ee6: 4eb9 0004 7b58 jsr 47b58 <_User_extensions_Thread_create> if ( extension_status ) 46eec: 4fef 000c lea %sp@(12),%sp 46ef0: 4a00 tstb %d0 46ef2: 6704 beqs 46ef8 <_Thread_Initialize+0x158> 46ef4: 7001 moveq #1,%d0 46ef6: 605a bras 46f52 <_Thread_Initialize+0x1b2> <== ALWAYS TAKEN return true; failed: if ( the_thread->libc_reent ) 46ef8: 202a 0106 movel %a2@(262),%d0 46efc: 670a beqs 46f08 <_Thread_Initialize+0x168> _Workspace_Free( the_thread->libc_reent ); 46efe: 2f00 movel %d0,%sp@- 46f00: 4eb9 0004 7eb8 jsr 47eb8 <_Workspace_Free> 46f06: 588f addql #4,%sp 46f08: 47ea 010a lea %a2@(266),%a3 46f0c: 4284 clrl %d4 for ( i=0 ; i <= THREAD_API_LAST ; i++ ) if ( the_thread->API_Extensions[i] ) _Workspace_Free( the_thread->API_Extensions[i] ); 46f0e: 49f9 0004 7eb8 lea 47eb8 <_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] ) 46f14: 2013 movel %a3@,%d0 failed: if ( the_thread->libc_reent ) _Workspace_Free( the_thread->libc_reent ); for ( i=0 ; i <= THREAD_API_LAST ; i++ ) 46f16: 5284 addql #1,%d4 46f18: 588b addql #4,%a3 if ( the_thread->API_Extensions[i] ) 46f1a: 4a80 tstl %d0 46f1c: 6706 beqs 46f24 <_Thread_Initialize+0x184> _Workspace_Free( the_thread->API_Extensions[i] ); 46f1e: 2f00 movel %d0,%sp@- 46f20: 4e94 jsr %a4@ 46f22: 588f addql #4,%sp failed: if ( the_thread->libc_reent ) _Workspace_Free( the_thread->libc_reent ); for ( i=0 ; i <= THREAD_API_LAST ; i++ ) 46f24: 7003 moveq #3,%d0 46f26: b084 cmpl %d4,%d0 46f28: 66ea bnes 46f14 <_Thread_Initialize+0x174> if ( the_thread->API_Extensions[i] ) _Workspace_Free( the_thread->API_Extensions[i] ); if ( extensions_area ) 46f2a: 4a82 tstl %d2 46f2c: 670a beqs 46f38 <_Thread_Initialize+0x198> (void) _Workspace_Free( extensions_area ); 46f2e: 2f02 movel %d2,%sp@- 46f30: 4eb9 0004 7eb8 jsr 47eb8 <_Workspace_Free> 46f36: 588f addql #4,%sp #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( fp_area ) 46f38: 4a83 tstl %d3 46f3a: 670a beqs 46f46 <_Thread_Initialize+0x1a6> (void) _Workspace_Free( fp_area ); 46f3c: 2f03 movel %d3,%sp@- 46f3e: 4eb9 0004 7eb8 jsr 47eb8 <_Workspace_Free> 46f44: 588f addql #4,%sp #endif _Thread_Stack_Free( the_thread ); 46f46: 2f0a movel %a2,%sp@- 46f48: 4eb9 0004 76bc jsr 476bc <_Thread_Stack_Free> return false; 46f4e: 588f addql #4,%sp 46f50: 4200 clrb %d0 } 46f52: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4 46f58: 4e5e unlk %fp 46f5a: 4e75 rts 0004aa58 <_Thread_Reset_timeslice>: * ready chain * select heir */ void _Thread_Reset_timeslice( void ) { 4aa58: 4e56 fff4 linkw %fp,#-12 ISR_Level level; Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; 4aa5c: 2079 0005 cf7e moveal 5cf7e <_Thread_Executing>,%a0 * ready chain * select heir */ void _Thread_Reset_timeslice( void ) { 4aa62: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; ready = executing->ready; _ISR_Disable( level ); 4aa66: 243c 0000 0700 movel #1792,%d2 4aa6c: 2202 movel %d2,%d1 ISR_Level level; Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; ready = executing->ready; 4aa6e: 2268 008a moveal %a0@(138),%a1 _ISR_Disable( level ); 4aa72: 40c0 movew %sr,%d0 4aa74: 8280 orl %d0,%d1 4aa76: 46c1 movew %d1,%sr if ( _Chain_Has_only_one_node( ready ) ) { 4aa78: 2229 0008 movel %a1@(8),%d1 4aa7c: b291 cmpl %a1@,%d1 4aa7e: 6604 bnes 4aa84 <_Thread_Reset_timeslice+0x2c> _ISR_Enable( level ); 4aa80: 46c0 movew %d0,%sr return; 4aa82: 6040 bras 4aac4 <_Thread_Reset_timeslice+0x6c> <== ALWAYS TAKEN ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 4aa84: 2450 moveal %a0@,%a2 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 4aa86: 2209 movel %a1,%d1 4aa88: 5881 addql #4,%d1 { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 4aa8a: 2668 0004 moveal %a0@(4),%a3 next->previous = previous; previous->next = next; 4aa8e: 268a movel %a2,%a3@ Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 4aa90: 254b 0004 movel %a3,%a2@(4) Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 4aa94: 2081 movel %d1,%a0@ old_last_node = the_chain->last; 4aa96: 2469 0008 moveal %a1@(8),%a2 the_chain->last = the_node; 4aa9a: 2348 0008 movel %a0,%a1@(8) old_last_node->next = the_node; the_node->previous = old_last_node; 4aa9e: 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; 4aaa2: 2488 movel %a0,%a2@ } _Chain_Extract_unprotected( &executing->Object.Node ); _Chain_Append_unprotected( ready, &executing->Object.Node ); _ISR_Flash( level ); 4aaa4: 2202 movel %d2,%d1 4aaa6: 46c0 movew %d0,%sr 4aaa8: 8280 orl %d0,%d1 4aaaa: 46c1 movew %d1,%sr if ( _Thread_Is_heir( executing ) ) 4aaac: b1f9 0005 cf52 cmpal 5cf52 <_Thread_Heir>,%a0 4aab2: 6606 bnes 4aaba <_Thread_Reset_timeslice+0x62> _Thread_Heir = (Thread_Control *) ready->first; 4aab4: 23d1 0005 cf52 movel %a1@,5cf52 <_Thread_Heir> _Context_Switch_necessary = true; 4aaba: 7201 moveq #1,%d1 4aabc: 13c1 0005 cf8e moveb %d1,5cf8e <_Context_Switch_necessary> _ISR_Enable( level ); 4aac2: 46c0 movew %d0,%sr } 4aac4: 4cd7 0c04 moveml %sp@,%d2/%a2-%a3 4aac8: 4e5e unlk %fp 4aaca: 4e75 rts 00047ba8 <_Thread_Restart>: Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { if ( !_States_Is_dormant( the_thread->current_state ) ) { 47ba8: 7001 moveq #1,%d0 bool _Thread_Restart( Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { 47baa: 4e56 0000 linkw %fp,#0 47bae: 2f0a movel %a2,%sp@- 47bb0: 246e 0008 moveal %fp@(8),%a2 if ( !_States_Is_dormant( the_thread->current_state ) ) { 47bb4: c0aa 0010 andl %a2@(16),%d0 47bb8: 4a00 tstb %d0 47bba: 6704 beqs 47bc0 <_Thread_Restart+0x18> 47bbc: 4200 clrb %d0 47bbe: 6070 bras 47c30 <_Thread_Restart+0x88> <== ALWAYS TAKEN _Thread_Set_transient( the_thread ); 47bc0: 2f0a movel %a2,%sp@- 47bc2: 4eb9 0004 7d90 jsr 47d90 <_Thread_Set_transient> _Thread_Reset( the_thread, pointer_argument, numeric_argument ); 47bc8: 2f2e 0010 movel %fp@(16),%sp@- 47bcc: 2f2e 000c movel %fp@(12),%sp@- 47bd0: 2f0a movel %a2,%sp@- 47bd2: 4eb9 0004 b234 jsr 4b234 <_Thread_Reset> _Thread_Load_environment( the_thread ); 47bd8: 2f0a movel %a2,%sp@- 47bda: 4eb9 0004 aed0 jsr 4aed0 <_Thread_Load_environment> _Thread_Ready( the_thread ); 47be0: 2f0a movel %a2,%sp@- 47be2: 4eb9 0004 b174 jsr 4b174 <_Thread_Ready> _User_extensions_Thread_restart( the_thread ); 47be8: 2f0a movel %a2,%sp@- 47bea: 4eb9 0004 8378 jsr 48378 <_User_extensions_Thread_restart> if ( _Thread_Is_executing ( the_thread ) ) 47bf0: 4fef 001c lea %sp@(28),%sp 47bf4: b5f9 0005 da06 cmpal 5da06 <_Thread_Executing>,%a2 47bfa: 6704 beqs 47c00 <_Thread_Restart+0x58> 47bfc: 7001 moveq #1,%d0 47bfe: 6030 bras 47c30 <_Thread_Restart+0x88> <== ALWAYS TAKEN */ RTEMS_INLINE_ROUTINE void _Thread_Restart_self( void ) { #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( _Thread_Executing->fp_context != NULL ) 47c00: 4aaa 0102 tstl %a2@(258) 47c04: 670c beqs 47c12 <_Thread_Restart+0x6a> _Context_Restore_fp( &_Thread_Executing->fp_context ); 47c06: 486a 0102 pea %a2@(258) 47c0a: 4eb9 0004 8860 jsr 48860 <_CPU_Context_restore_fp> 47c10: 588f addql #4,%sp #endif _CPU_Context_Restart_self( &_Thread_Executing->Registers ); 47c12: 2079 0005 da06 moveal 5da06 <_Thread_Executing>,%a0 47c18: 2028 00fe movel %a0@(254),%d0 47c1c: 2228 00ce movel %a0@(206),%d1 47c20: 46c1 movew %d1,%sr 47c22: 2e40 moveal %d0,%sp 47c24: 4e75 rts 47c26: 2140 00fe movel %d0,%a0@(254) <== NOT EXECUTED 47c2a: 7001 moveq #1,%d0 <== NOT EXECUTED 47c2c: 2141 00ce movel %d1,%a0@(206) <== NOT EXECUTED return true; } return false; } 47c30: 246e fffc moveal %fp@(-4),%a2 47c34: 4e5e unlk %fp 47c36: 4e75 rts 0004abe0 <_Thread_Resume>: void _Thread_Resume( Thread_Control *the_thread, bool force ) { 4abe0: 4e56 ffec linkw %fp,#-20 4abe4: 206e 0008 moveal %fp@(8),%a0 4abe8: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ ISR_Level level; States_Control current_state; _ISR_Disable( level ); 4abec: 243c 0000 0700 movel #1792,%d2 4abf2: 2002 movel %d2,%d0 4abf4: 40c1 movew %sr,%d1 4abf6: 8081 orl %d1,%d0 4abf8: 46c0 movew %d0,%sr _ISR_Enable( level ); return; } #endif current_state = the_thread->current_state; 4abfa: 2028 0010 movel %a0@(16),%d0 if ( current_state & STATES_SUSPENDED ) { 4abfe: 0800 0001 btst #1,%d0 4ac02: 6778 beqs 4ac7c <_Thread_Resume+0x9c> <== ALWAYS TAKEN 4ac04: 76fd moveq #-3,%d3 4ac06: c083 andl %d3,%d0 current_state = 4ac08: 2140 0010 movel %d0,%a0@(16) the_thread->current_state = _States_Clear(STATES_SUSPENDED, current_state); if ( _States_Is_ready( current_state ) ) { 4ac0c: 666e bnes 4ac7c <_Thread_Resume+0x9c> RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 4ac0e: 2668 008e moveal %a0@(142),%a3 4ac12: 3028 0094 movew %a0@(148),%d0 4ac16: 3613 movew %a3@,%d3 _Priority_Add_to_bit_map( &the_thread->Priority_map ); _Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node); 4ac18: 2268 008a moveal %a0@(138),%a1 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 4ac1c: 2809 movel %a1,%d4 4ac1e: 5884 addql #4,%d4 4ac20: 8083 orl %d3,%d0 4ac22: 2084 movel %d4,%a0@ old_last_node = the_chain->last; 4ac24: 2469 0008 moveal %a1@(8),%a2 4ac28: 3680 movew %d0,%a3@ the_chain->last = the_node; 4ac2a: 2348 0008 movel %a0,%a1@(8) _Priority_Major_bit_map |= the_priority_map->ready_major; 4ac2e: 3039 0006 214c movew 6214c <_Priority_Major_bit_map>,%d0 4ac34: 3628 0092 movew %a0@(146),%d3 old_last_node->next = the_node; the_node->previous = old_last_node; 4ac38: 214a 0004 movel %a2,%a0@(4) 4ac3c: 8083 orl %d3,%d0 Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; the_chain->last = the_node; old_last_node->next = the_node; 4ac3e: 2488 movel %a0,%a2@ 4ac40: 33c0 0006 214c movew %d0,6214c <_Priority_Major_bit_map> _ISR_Flash( level ); 4ac46: 2002 movel %d2,%d0 4ac48: 46c1 movew %d1,%sr 4ac4a: 8081 orl %d1,%d0 4ac4c: 46c0 movew %d0,%sr if ( the_thread->current_priority < _Thread_Heir->current_priority ) { 4ac4e: 2028 0014 movel %a0@(20),%d0 4ac52: 2279 0006 212a moveal 6212a <_Thread_Heir>,%a1 4ac58: b0a9 0014 cmpl %a1@(20),%d0 4ac5c: 641e bccs 4ac7c <_Thread_Resume+0x9c> _Thread_Heir = the_thread; 4ac5e: 23c8 0006 212a movel %a0,6212a <_Thread_Heir> if ( _Thread_Executing->is_preemptible || 4ac64: 2079 0006 2156 moveal 62156 <_Thread_Executing>,%a0 4ac6a: 4a28 0075 tstb %a0@(117) 4ac6e: 6604 bnes 4ac74 <_Thread_Resume+0x94> 4ac70: 4a80 tstl %d0 4ac72: 6608 bnes 4ac7c <_Thread_Resume+0x9c> <== NEVER TAKEN the_thread->current_priority == 0 ) _Context_Switch_necessary = true; 4ac74: 7001 moveq #1,%d0 4ac76: 13c0 0006 2166 moveb %d0,62166 <_Context_Switch_necessary> } } } _ISR_Enable( level ); 4ac7c: 46c1 movew %d1,%sr } 4ac7e: 4cd7 0c1c moveml %sp@,%d2-%d4/%a2-%a3 4ac82: 4e5e unlk %fp 4ac84: 4e75 rts ... 0004750c <_Thread_Set_state>: { ISR_Level level; Chain_Control *ready; ready = the_thread->ready; _ISR_Disable( level ); 4750c: 223c 0000 0700 movel #1792,%d1 void _Thread_Set_state( Thread_Control *the_thread, States_Control state ) { 47512: 4e56 fff4 linkw %fp,#-12 47516: 206e 0008 moveal %fp@(8),%a0 4751a: 48d7 040c moveml %d2-%d3/%a2,%sp@ 4751e: 242e 000c movel %fp@(12),%d2 ISR_Level level; Chain_Control *ready; ready = the_thread->ready; 47522: 2268 008a moveal %a0@(138),%a1 _ISR_Disable( level ); 47526: 40c0 movew %sr,%d0 47528: 8280 orl %d0,%d1 4752a: 46c1 movew %d1,%sr if ( !_States_Is_ready( the_thread->current_state ) ) { 4752c: 2228 0010 movel %a0@(16),%d1 47530: 670c beqs 4753e <_Thread_Set_state+0x32> the_thread->current_state = 47532: 8481 orl %d1,%d2 47534: 2142 0010 movel %d2,%a0@(16) _States_Set( state, the_thread->current_state ); _ISR_Enable( level ); 47538: 46c0 movew %d0,%sr return; 4753a: 6000 00ae braw 475ea <_Thread_Set_state+0xde> <== ALWAYS TAKEN } the_thread->current_state = state; if ( _Chain_Has_only_one_node( ready ) ) { 4753e: 2229 0008 movel %a1@(8),%d1 _States_Set( state, the_thread->current_state ); _ISR_Enable( level ); return; } the_thread->current_state = state; 47542: 2142 0010 movel %d2,%a0@(16) if ( _Chain_Has_only_one_node( ready ) ) { 47546: b291 cmpl %a1@,%d1 47548: 6632 bnes 4757c <_Thread_Set_state+0x70> */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 4754a: 2209 movel %a1,%d1 4754c: 5881 addql #4,%d1 RTEMS_INLINE_ROUTINE void _Priority_Remove_from_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor &= the_priority_map->block_minor; 4754e: 2468 008e moveal %a0@(142),%a2 47552: 2281 movel %d1,%a1@ 47554: 3412 movew %a2@,%d2 47556: 3228 0098 movew %a0@(152),%d1 the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 4755a: 2349 0008 movel %a1,%a1@(8) 4755e: c282 andl %d2,%d1 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 47560: 42a9 0004 clrl %a1@(4) 47564: 3481 movew %d1,%a2@ _Chain_Initialize_empty( ready ); _Priority_Remove_from_bit_map( &the_thread->Priority_map ); 47566: 6620 bnes 47588 <_Thread_Set_state+0x7c> if ( *the_priority_map->minor == 0 ) _Priority_Major_bit_map &= the_priority_map->block_major; 47568: 3239 0005 cf74 movew 5cf74 <_Priority_Major_bit_map>,%d1 4756e: 3428 0096 movew %a0@(150),%d2 47572: c282 andl %d2,%d1 47574: 33c1 0005 cf74 movew %d1,5cf74 <_Priority_Major_bit_map> 4757a: 600c bras 47588 <_Thread_Set_state+0x7c> <== ALWAYS TAKEN ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 4757c: 2250 moveal %a0@,%a1 previous = the_node->previous; 4757e: 2468 0004 moveal %a0@(4),%a2 next->previous = previous; previous->next = next; 47582: 2489 movel %a1,%a2@ Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 47584: 234a 0004 movel %a2,%a1@(4) } else _Chain_Extract_unprotected( &the_thread->Object.Node ); _ISR_Flash( level ); 47588: 223c 0000 0700 movel #1792,%d1 4758e: 46c0 movew %d0,%sr 47590: 8280 orl %d0,%d1 47592: 46c1 movew %d1,%sr if ( _Thread_Is_heir( the_thread ) ) 47594: b1f9 0005 cf52 cmpal 5cf52 <_Thread_Heir>,%a0 4759a: 663c bnes 475d8 <_Thread_Set_state+0xcc> 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 ); 4759c: 3239 0005 cf74 movew 5cf74 <_Priority_Major_bit_map>,%d1 475a2: 4841 swap %d1 475a4: 04c1 ff1 %d1 _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 475a6: 4282 clrl %d2 475a8: 43f9 0005 cfe4 lea 5cfe4 <_Priority_Bit_map>,%a1 475ae: 3401 movew %d1,%d2 475b0: 3231 2a00 movew %a1@(00000000,%d2:l:2),%d1 475b4: 4841 swap %d1 475b6: 04c1 ff1 %d1 * ready thread. */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) 475b8: 4283 clrl %d3 475ba: e98a lsll #4,%d2 475bc: 3601 movew %d1,%d3 475be: 2279 0005 ce70 moveal 5ce70 <_Thread_Ready_chain>,%a1 475c4: 2202 movel %d2,%d1 475c6: d283 addl %d3,%d1 475c8: 2401 movel %d1,%d2 475ca: e58a lsll #2,%d2 475cc: e989 lsll #4,%d1 475ce: 93c2 subal %d2,%a1 475d0: d3c1 addal %d1,%a1 475d2: 23d1 0005 cf52 movel %a1@,5cf52 <_Thread_Heir> _Thread_Calculate_heir(); if ( _Thread_Is_executing( the_thread ) ) 475d8: b1f9 0005 cf7e cmpal 5cf7e <_Thread_Executing>,%a0 475de: 6608 bnes 475e8 <_Thread_Set_state+0xdc> _Context_Switch_necessary = true; 475e0: 7201 moveq #1,%d1 475e2: 13c1 0005 cf8e moveb %d1,5cf8e <_Context_Switch_necessary> _ISR_Enable( level ); 475e8: 46c0 movew %d0,%sr } 475ea: 4cd7 040c moveml %sp@,%d2-%d3/%a2 475ee: 4e5e unlk %fp 475f0: 4e75 rts ... 000475f4 <_Thread_Set_transient>: ISR_Level level; uint32_t old_state; Chain_Control *ready; ready = the_thread->ready; _ISR_Disable( level ); 475f4: 203c 0000 0700 movel #1792,%d0 */ void _Thread_Set_transient( Thread_Control *the_thread ) { 475fa: 4e56 0000 linkw %fp,#0 475fe: 206e 0008 moveal %fp@(8),%a0 47602: 2f0a movel %a2,%sp@- ISR_Level level; uint32_t old_state; Chain_Control *ready; ready = the_thread->ready; 47604: 2268 008a moveal %a0@(138),%a1 */ void _Thread_Set_transient( Thread_Control *the_thread ) { 47608: 2f02 movel %d2,%sp@- ISR_Level level; uint32_t old_state; Chain_Control *ready; ready = the_thread->ready; _ISR_Disable( level ); 4760a: 40c1 movew %sr,%d1 4760c: 8081 orl %d1,%d0 4760e: 46c0 movew %d0,%sr old_state = the_thread->current_state; 47610: 2028 0010 movel %a0@(16),%d0 the_thread->current_state = _States_Set( STATES_TRANSIENT, old_state ); 47614: 7404 moveq #4,%d2 47616: 8480 orl %d0,%d2 47618: 2142 0010 movel %d2,%a0@(16) if ( _States_Is_ready( old_state ) ) { 4761c: 4a80 tstl %d0 4761e: 6646 bnes 47666 <_Thread_Set_transient+0x72> if ( _Chain_Has_only_one_node( ready ) ) { 47620: 2029 0008 movel %a1@(8),%d0 47624: b091 cmpl %a1@,%d0 47626: 6632 bnes 4765a <_Thread_Set_transient+0x66> */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 47628: 2409 movel %a1,%d2 4762a: 5882 addql #4,%d2 RTEMS_INLINE_ROUTINE void _Priority_Remove_from_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor &= the_priority_map->block_minor; 4762c: 2468 008e moveal %a0@(142),%a2 47630: 2282 movel %d2,%a1@ 47632: 3412 movew %a2@,%d2 47634: 3028 0098 movew %a0@(152),%d0 the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 47638: 2349 0008 movel %a1,%a1@(8) 4763c: 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; 4763e: 42a9 0004 clrl %a1@(4) 47642: 3480 movew %d0,%a2@ _Chain_Initialize_empty( ready ); _Priority_Remove_from_bit_map( &the_thread->Priority_map ); 47644: 6620 bnes 47666 <_Thread_Set_transient+0x72> if ( *the_priority_map->minor == 0 ) _Priority_Major_bit_map &= the_priority_map->block_major; 47646: 3428 0096 movew %a0@(150),%d2 4764a: 3039 0005 cf74 movew 5cf74 <_Priority_Major_bit_map>,%d0 47650: c082 andl %d2,%d0 47652: 33c0 0005 cf74 movew %d0,5cf74 <_Priority_Major_bit_map> 47658: 600c bras 47666 <_Thread_Set_transient+0x72> <== ALWAYS TAKEN { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 4765a: 2268 0004 moveal %a0@(4),%a1 ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 4765e: 2050 moveal %a0@,%a0 previous = the_node->previous; next->previous = previous; previous->next = next; 47660: 2288 movel %a0,%a1@ Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 47662: 2149 0004 movel %a1,%a0@(4) } else _Chain_Extract_unprotected( &the_thread->Object.Node ); } _ISR_Enable( level ); 47666: 46c1 movew %d1,%sr } 47668: 241f movel %sp@+,%d2 4766a: 245f moveal %sp@+,%a2 4766c: 4e5e unlk %fp 4766e: 4e75 rts 00047670 <_Thread_Stack_Allocate>: size_t _Thread_Stack_Allocate( Thread_Control *the_thread, size_t stack_size ) { 47670: 4e56 0000 linkw %fp,#0 47674: 2039 0005 b70e movel 5b70e ,%d0 4767a: 2f02 movel %d2,%sp@- 4767c: 242e 000c movel %fp@(12),%d2 47680: b082 cmpl %d2,%d0 47682: 6302 blss 47686 <_Thread_Stack_Allocate+0x16> 47684: 2400 movel %d0,%d2 * Call ONLY the CPU table stack allocate hook, _or_ the * the RTEMS workspace allocate. This is so the stack free * routine can call the correct deallocation routine. */ if ( Configuration.stack_allocate_hook ) { 47686: 2079 0005 b734 moveal 5b734 ,%a0 4768c: 4a88 tstl %a0 4768e: 6706 beqs 47696 <_Thread_Stack_Allocate+0x26> stack_addr = (*Configuration.stack_allocate_hook)( the_stack_size ); 47690: 2f02 movel %d2,%sp@- 47692: 4e90 jsr %a0@ 47694: 6008 bras 4769e <_Thread_Stack_Allocate+0x2e> <== ALWAYS TAKEN * get and keep the stack adjust factor, the stack alignment, and * the context initialization sequence in sync. */ the_stack_size = _Stack_Adjust_size( the_stack_size ); stack_addr = _Workspace_Allocate( the_stack_size ); 47696: 2f02 movel %d2,%sp@- 47698: 4eb9 0004 7e9c jsr 47e9c <_Workspace_Allocate> } if ( !stack_addr ) 4769e: 4a80 tstl %d0 476a0: 56c1 sne %d1 the_stack_size = 0; the_thread->Start.stack = stack_addr; 476a2: 206e 0008 moveal %fp@(8),%a0 * get and keep the stack adjust factor, the stack alignment, and * the context initialization sequence in sync. */ the_stack_size = _Stack_Adjust_size( the_stack_size ); stack_addr = _Workspace_Allocate( the_stack_size ); 476a6: 588f addql #4,%sp } if ( !stack_addr ) the_stack_size = 0; the_thread->Start.stack = stack_addr; 476a8: 2140 00ca movel %d0,%a0@(202) the_stack_size = _Stack_Adjust_size( the_stack_size ); stack_addr = _Workspace_Allocate( the_stack_size ); } if ( !stack_addr ) 476ac: 1001 moveb %d1,%d0 476ae: 49c0 extbl %d0 the_stack_size = 0; the_thread->Start.stack = stack_addr; return the_stack_size; } 476b0: c082 andl %d2,%d0 476b2: 242e fffc movel %fp@(-4),%d2 476b6: 4e5e unlk %fp 476b8: 4e75 rts ... 00047790 <_Thread_Suspend>: { ISR_Level level; Chain_Control *ready; ready = the_thread->ready; _ISR_Disable( level ); 47790: 223c 0000 0700 movel #1792,%d1 */ void _Thread_Suspend( Thread_Control *the_thread ) { 47796: 4e56 fff4 linkw %fp,#-12 4779a: 206e 0008 moveal %fp@(8),%a0 4779e: 48d7 040c moveml %d2-%d3/%a2,%sp@ ISR_Level level; Chain_Control *ready; ready = the_thread->ready; 477a2: 2268 008a moveal %a0@(138),%a1 _ISR_Disable( level ); 477a6: 40c0 movew %sr,%d0 477a8: 8280 orl %d0,%d1 477aa: 46c1 movew %d1,%sr #if defined(RTEMS_ITRON_API) the_thread->suspend_count++; #endif if ( !_States_Is_ready( the_thread->current_state ) ) { 477ac: 2228 0010 movel %a0@(16),%d1 477b0: 670e beqs 477c0 <_Thread_Suspend+0x30> the_thread->current_state = 477b2: 7402 moveq #2,%d2 477b4: 8481 orl %d1,%d2 477b6: 2142 0010 movel %d2,%a0@(16) _States_Set( STATES_SUSPENDED, the_thread->current_state ); _ISR_Enable( level ); 477ba: 46c0 movew %d0,%sr return; 477bc: 6000 00b0 braw 4786e <_Thread_Suspend+0xde> <== ALWAYS TAKEN } the_thread->current_state = STATES_SUSPENDED; 477c0: 7202 moveq #2,%d1 if ( _Chain_Has_only_one_node( ready ) ) { 477c2: 2429 0008 movel %a1@(8),%d2 _States_Set( STATES_SUSPENDED, the_thread->current_state ); _ISR_Enable( level ); return; } the_thread->current_state = STATES_SUSPENDED; 477c6: 2141 0010 movel %d1,%a0@(16) if ( _Chain_Has_only_one_node( ready ) ) { 477ca: b491 cmpl %a1@,%d2 477cc: 6632 bnes 47800 <_Thread_Suspend+0x70> */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 477ce: 2209 movel %a1,%d1 477d0: 5881 addql #4,%d1 RTEMS_INLINE_ROUTINE void _Priority_Remove_from_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor &= the_priority_map->block_minor; 477d2: 2468 008e moveal %a0@(142),%a2 477d6: 2281 movel %d1,%a1@ 477d8: 3412 movew %a2@,%d2 477da: 3228 0098 movew %a0@(152),%d1 the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 477de: 2349 0008 movel %a1,%a1@(8) 477e2: c282 andl %d2,%d1 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 477e4: 42a9 0004 clrl %a1@(4) 477e8: 3481 movew %d1,%a2@ _Chain_Initialize_empty( ready ); _Priority_Remove_from_bit_map( &the_thread->Priority_map ); 477ea: 6620 bnes 4780c <_Thread_Suspend+0x7c> if ( *the_priority_map->minor == 0 ) _Priority_Major_bit_map &= the_priority_map->block_major; 477ec: 3239 0005 cf74 movew 5cf74 <_Priority_Major_bit_map>,%d1 477f2: 3428 0096 movew %a0@(150),%d2 477f6: c282 andl %d2,%d1 477f8: 33c1 0005 cf74 movew %d1,5cf74 <_Priority_Major_bit_map> 477fe: 600c bras 4780c <_Thread_Suspend+0x7c> <== ALWAYS TAKEN ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 47800: 2250 moveal %a0@,%a1 previous = the_node->previous; 47802: 2468 0004 moveal %a0@(4),%a2 next->previous = previous; previous->next = next; 47806: 2489 movel %a1,%a2@ Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 47808: 234a 0004 movel %a2,%a1@(4) } else _Chain_Extract_unprotected( &the_thread->Object.Node ); _ISR_Flash( level ); 4780c: 223c 0000 0700 movel #1792,%d1 47812: 46c0 movew %d0,%sr 47814: 8280 orl %d0,%d1 47816: 46c1 movew %d1,%sr if ( _Thread_Is_heir( the_thread ) ) 47818: b1f9 0005 cf52 cmpal 5cf52 <_Thread_Heir>,%a0 4781e: 663c bnes 4785c <_Thread_Suspend+0xcc> 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 ); 47820: 3239 0005 cf74 movew 5cf74 <_Priority_Major_bit_map>,%d1 47826: 4841 swap %d1 47828: 04c1 ff1 %d1 _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 4782a: 4282 clrl %d2 4782c: 43f9 0005 cfe4 lea 5cfe4 <_Priority_Bit_map>,%a1 47832: 3401 movew %d1,%d2 47834: 3231 2a00 movew %a1@(00000000,%d2:l:2),%d1 47838: 4841 swap %d1 4783a: 04c1 ff1 %d1 4783c: 4283 clrl %d3 4783e: e98a lsll #4,%d2 47840: 3601 movew %d1,%d3 47842: 2279 0005 ce70 moveal 5ce70 <_Thread_Ready_chain>,%a1 47848: 2202 movel %d2,%d1 4784a: d283 addl %d3,%d1 4784c: 2401 movel %d1,%d2 4784e: e58a lsll #2,%d2 47850: e989 lsll #4,%d1 47852: 93c2 subal %d2,%a1 47854: d3c1 addal %d1,%a1 47856: 23d1 0005 cf52 movel %a1@,5cf52 <_Thread_Heir> _Thread_Calculate_heir(); if ( _Thread_Is_executing( the_thread ) ) 4785c: b1f9 0005 cf7e cmpal 5cf7e <_Thread_Executing>,%a0 47862: 6608 bnes 4786c <_Thread_Suspend+0xdc> _Context_Switch_necessary = true; 47864: 7401 moveq #1,%d2 47866: 13c2 0005 cf8e moveb %d2,5cf8e <_Context_Switch_necessary> _ISR_Enable( level ); 4786c: 46c0 movew %d0,%sr } 4786e: 4cd7 040c moveml %sp@,%d2-%d3/%a2 47872: 4e5e unlk %fp 47874: 4e75 rts ... 00047878 <_Thread_Tickle_timeslice>: * * Output parameters: NONE */ void _Thread_Tickle_timeslice( void ) { 47878: 4e56 0000 linkw %fp,#0 4787c: 2f0a movel %a2,%sp@- Thread_Control *executing; executing = _Thread_Executing; 4787e: 2479 0005 cf7e moveal 5cf7e <_Thread_Executing>,%a2 /* * If the thread is not preemptible or is not ready, then * just return. */ if ( !executing->is_preemptible ) 47884: 4a2a 0075 tstb %a2@(117) 47888: 6756 beqs 478e0 <_Thread_Tickle_timeslice+0x68> return; if ( !_States_Is_ready( executing->current_state ) ) 4788a: 4aaa 0010 tstl %a2@(16) 4788e: 6650 bnes 478e0 <_Thread_Tickle_timeslice+0x68> /* * The cpu budget algorithm determines what happens next. */ switch ( executing->budget_algorithm ) { 47890: 202a 007a movel %a2@(122),%d0 47894: 7201 moveq #1,%d1 47896: b280 cmpl %d0,%d1 47898: 6246 bhis 478e0 <_Thread_Tickle_timeslice+0x68> 4789a: 123c 0002 moveb #2,%d1 4789e: b280 cmpl %d0,%d1 478a0: 640a bccs 478ac <_Thread_Tickle_timeslice+0x34> 478a2: 123c 0003 moveb #3,%d1 478a6: b280 cmpl %d0,%d1 478a8: 6636 bnes 478e0 <_Thread_Tickle_timeslice+0x68> <== ALWAYS TAKEN 478aa: 601e bras 478ca <_Thread_Tickle_timeslice+0x52> <== ALWAYS TAKEN 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 ) { 478ac: 202a 0076 movel %a2@(118),%d0 478b0: 5380 subql #1,%d0 478b2: 2540 0076 movel %d0,%a2@(118) 478b6: 6e28 bgts 478e0 <_Thread_Tickle_timeslice+0x68> _Thread_Reset_timeslice(); 478b8: 4eb9 0004 aa58 jsr 4aa58 <_Thread_Reset_timeslice> executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 478be: 41f9 0005 ce74 lea 5ce74 <_Thread_Ticks_per_timeslice>,%a0 478c4: 2550 0076 movel %a0@,%a2@(118) 478c8: 6016 bras 478e0 <_Thread_Tickle_timeslice+0x68> <== ALWAYS TAKEN } break; #if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT) case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: if ( --executing->cpu_time_budget == 0 ) 478ca: 202a 0076 movel %a2@(118),%d0 478ce: 5380 subql #1,%d0 478d0: 2540 0076 movel %d0,%a2@(118) 478d4: 660a bnes 478e0 <_Thread_Tickle_timeslice+0x68> (*executing->budget_callout)( executing ); 478d6: 2f0a movel %a2,%sp@- 478d8: 206a 007e moveal %a2@(126),%a0 478dc: 4e90 jsr %a0@ 478de: 588f addql #4,%sp break; #endif } } 478e0: 246e fffc moveal %fp@(-4),%a2 478e4: 4e5e unlk %fp 478e6: 4e75 rts 000478e8 <_Thread_Yield_processor>: * ready chain * select heir */ void _Thread_Yield_processor( void ) { 478e8: 4e56 fff4 linkw %fp,#-12 ISR_Level level; Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; 478ec: 2079 0005 cf7e moveal 5cf7e <_Thread_Executing>,%a0 * ready chain * select heir */ void _Thread_Yield_processor( void ) { 478f2: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; ready = executing->ready; _ISR_Disable( level ); 478f6: 243c 0000 0700 movel #1792,%d2 478fc: 2002 movel %d2,%d0 ISR_Level level; Thread_Control *executing; Chain_Control *ready; executing = _Thread_Executing; ready = executing->ready; 478fe: 2268 008a moveal %a0@(138),%a1 _ISR_Disable( level ); 47902: 40c1 movew %sr,%d1 47904: 8081 orl %d1,%d0 47906: 46c0 movew %d0,%sr if ( !_Chain_Has_only_one_node( ready ) ) { 47908: 2029 0008 movel %a1@(8),%d0 4790c: b091 cmpl %a1@,%d0 4790e: 6738 beqs 47948 <_Thread_Yield_processor+0x60> ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 47910: 2450 moveal %a0@,%a2 Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 47912: 2009 movel %a1,%d0 47914: 5880 addql #4,%d0 { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 47916: 2668 0004 moveal %a0@(4),%a3 next->previous = previous; previous->next = next; 4791a: 268a movel %a2,%a3@ Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 4791c: 254b 0004 movel %a3,%a2@(4) Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 47920: 2080 movel %d0,%a0@ old_last_node = the_chain->last; 47922: 2469 0008 moveal %a1@(8),%a2 the_chain->last = the_node; 47926: 2348 0008 movel %a0,%a1@(8) old_last_node->next = the_node; the_node->previous = old_last_node; 4792a: 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; 4792e: 2488 movel %a0,%a2@ _Chain_Extract_unprotected( &executing->Object.Node ); _Chain_Append_unprotected( ready, &executing->Object.Node ); _ISR_Flash( level ); 47930: 2002 movel %d2,%d0 47932: 46c1 movew %d1,%sr 47934: 8081 orl %d1,%d0 47936: 46c0 movew %d0,%sr if ( _Thread_Is_heir( executing ) ) 47938: b1f9 0005 cf52 cmpal 5cf52 <_Thread_Heir>,%a0 4793e: 6610 bnes 47950 <_Thread_Yield_processor+0x68> <== ALWAYS TAKEN _Thread_Heir = (Thread_Control *) ready->first; 47940: 23d1 0005 cf52 movel %a1@,5cf52 <_Thread_Heir> 47946: 6008 bras 47950 <_Thread_Yield_processor+0x68> <== ALWAYS TAKEN _Context_Switch_necessary = true; } else if ( !_Thread_Is_heir( executing ) ) 47948: b1f9 0005 cf52 cmpal 5cf52 <_Thread_Heir>,%a0 4794e: 6708 beqs 47958 <_Thread_Yield_processor+0x70> <== NEVER TAKEN _Context_Switch_necessary = true; 47950: 7001 moveq #1,%d0 47952: 13c0 0005 cf8e moveb %d0,5cf8e <_Context_Switch_necessary> _ISR_Enable( level ); 47958: 46c1 movew %d1,%sr } 4795a: 4cd7 0c04 moveml %sp@,%d2/%a2-%a3 4795e: 4e5e unlk %fp 47960: 4e75 rts ... 000467a4 <_Thread_blocking_operation_Cancel>: /* * If the sync state is timed out, this is very likely not needed. * But better safe than sorry when it comes to critical sections. */ if ( _Watchdog_Is_active( &the_thread->Timer ) ) { 467a4: 7202 moveq #2,%d1 Thread_blocking_operation_States sync_state __attribute__((unused)), #endif Thread_Control *the_thread, ISR_Level level ) { 467a6: 4e56 0000 linkw %fp,#0 467aa: 202e 0010 movel %fp@(16),%d0 467ae: 2f0a movel %a2,%sp@- 467b0: 246e 000c moveal %fp@(12),%a2 #endif /* * The thread is not waiting on anything after this completes. */ the_thread->Wait.queue = NULL; 467b4: 42aa 0044 clrl %a2@(68) /* * If the sync state is timed out, this is very likely not needed. * But better safe than sorry when it comes to critical sections. */ if ( _Watchdog_Is_active( &the_thread->Timer ) ) { 467b8: b2aa 0050 cmpl %a2@(80),%d1 467bc: 6618 bnes 467d6 <_Thread_blocking_operation_Cancel+0x32> RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 467be: 123c 0003 moveb #3,%d1 467c2: 2541 0050 movel %d1,%a2@(80) _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 467c6: 46c0 movew %d0,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 467c8: 486a 0048 pea %a2@(72) 467cc: 4eb9 0004 7d70 jsr 47d70 <_Watchdog_Remove> 467d2: 588f addql #4,%sp 467d4: 6002 bras 467d8 <_Thread_blocking_operation_Cancel+0x34> <== ALWAYS TAKEN } else _ISR_Enable( level ); 467d6: 46c0 movew %d0,%sr RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 467d8: 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 } 467dc: 246e fffc moveal %fp@(-4),%a2 467e0: 203c 1003 fff8 movel #268697592,%d0 467e6: 2d40 000c movel %d0,%fp@(12) 467ea: 4e5e unlk %fp 467ec: 4ef9 0004 6934 jmp 46934 <_Thread_Clear_state> ... 0004a778 <_Thread_queue_Dequeue_fifo>: ) { ISR_Level level; Thread_Control *the_thread; _ISR_Disable( level ); 4a778: 223c 0000 0700 movel #1792,%d1 */ Thread_Control *_Thread_queue_Dequeue_fifo( Thread_queue_Control *the_thread_queue ) { 4a77e: 4e56 fff4 linkw %fp,#-12 4a782: 206e 0008 moveal %fp@(8),%a0 4a786: 48d7 1c00 moveml %a2-%a4,%sp@ ISR_Level level; Thread_Control *the_thread; _ISR_Disable( level ); 4a78a: 40c0 movew %sr,%d0 4a78c: 8280 orl %d0,%d1 4a78e: 46c1 movew %d1,%sr */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 4a790: 2248 moveal %a0,%a1 4a792: 2459 moveal %a1@+,%a2 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4a794: b3ca cmpal %a2,%a1 4a796: 674e beqs 4a7e6 <_Thread_queue_Dequeue_fifo+0x6e> { Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; 4a798: 2252 moveal %a2@,%a1 if ( !_Chain_Is_empty( &the_thread_queue->Queues.Fifo ) ) { the_thread = (Thread_Control *) 4a79a: 264a moveal %a2,%a3 4a79c: 49f9 0004 6934 lea 46934 <_Thread_Clear_state>,%a4 _Chain_Get_first_unprotected( &the_thread_queue->Queues.Fifo ); the_thread->Wait.queue = NULL; if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 4a7a2: 7202 moveq #2,%d1 the_chain->first = new_first; 4a7a4: 2089 movel %a1,%a0@ new_first->previous = _Chain_Head(the_chain); 4a7a6: 2348 0004 movel %a0,%a1@(4) if ( !_Chain_Is_empty( &the_thread_queue->Queues.Fifo ) ) { the_thread = (Thread_Control *) _Chain_Get_first_unprotected( &the_thread_queue->Queues.Fifo ); the_thread->Wait.queue = NULL; 4a7aa: 42aa 0044 clrl %a2@(68) if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 4a7ae: b2aa 0050 cmpl %a2@(80),%d1 4a7b2: 6710 beqs 4a7c4 <_Thread_queue_Dequeue_fifo+0x4c> _ISR_Enable( level ); 4a7b4: 46c0 movew %d0,%sr RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 4a7b6: 2f3c 1003 fff8 movel #268697592,%sp@- 4a7bc: 2f0a movel %a2,%sp@- 4a7be: 4e94 jsr %a4@ 4a7c0: 508f addql #8,%sp 4a7c2: 6026 bras 4a7ea <_Thread_queue_Dequeue_fifo+0x72> <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 4a7c4: 7203 moveq #3,%d1 4a7c6: 2541 0050 movel %d1,%a2@(80) _Thread_Unblock( the_thread ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 4a7ca: 46c0 movew %d0,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 4a7cc: 486a 0048 pea %a2@(72) 4a7d0: 4eb9 0004 7d70 jsr 47d70 <_Watchdog_Remove> 4a7d6: 2f3c 1003 fff8 movel #268697592,%sp@- 4a7dc: 2f0a movel %a2,%sp@- 4a7de: 4e94 jsr %a4@ 4a7e0: 4fef 000c lea %sp@(12),%sp 4a7e4: 6004 bras 4a7ea <_Thread_queue_Dequeue_fifo+0x72> <== ALWAYS TAKEN #endif return the_thread; } _ISR_Enable( level ); 4a7e6: 46c0 movew %d0,%sr 4a7e8: 97cb subal %a3,%a3 return NULL; } 4a7ea: 200b movel %a3,%d0 4a7ec: 4cee 1c00 fff4 moveml %fp@(-12),%a2-%a4 4a7f2: 4e5e unlk %fp 4a7f4: 4e75 rts ... 00047094 <_Thread_queue_Dequeue_priority>: Chain_Node *new_second_node; Chain_Node *last_node; Chain_Node *next_node; Chain_Node *previous_node; _ISR_Disable( level ); 47094: 203c 0000 0700 movel #1792,%d0 */ Thread_Control *_Thread_queue_Dequeue_priority( Thread_queue_Control *the_thread_queue ) { 4709a: 4e56 ffec linkw %fp,#-20 4709e: 226e 0008 moveal %fp@(8),%a1 470a2: 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 ); 470a6: 40c1 movew %sr,%d1 470a8: 8081 orl %d1,%d0 470aa: 46c0 movew %d0,%sr 470ac: 4280 clrl %d0 470ae: 2049 moveal %a1,%a0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 470b0: 2408 movel %a0,%d2 470b2: 5882 addql #4,%d2 470b4: b490 cmpl %a0@,%d2 470b6: 6728 beqs 470e0 <_Thread_queue_Dequeue_priority+0x4c> 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 *) 470b8: 2400 movel %d0,%d2 470ba: e588 lsll #2,%d0 470bc: e98a lsll #4,%d2 470be: 9480 subl %d0,%d2 470c0: 2471 2800 moveal %a1@(00000000,%d2:l),%a2 470c4: 200a movel %a2,%d0 470c6: 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; 470cc: 206a 0038 moveal %a2@(56),%a0 new_first_thread = (Thread_Control *) new_first_node; next_node = the_thread->Object.Node.next; 470d0: 2652 moveal %a2@,%a3 previous_node = the_thread->Object.Node.previous; 470d2: 226a 0004 moveal %a2@(4),%a1 */ _ISR_Enable( level ); return NULL; dequeue: the_thread->Wait.queue = NULL; 470d6: 42aa 0044 clrl %a2@(68) 470da: b088 cmpl %a0,%d0 470dc: 6614 bnes 470f2 <_Thread_queue_Dequeue_priority+0x5e> 470de: 6046 bras 47126 <_Thread_queue_Dequeue_priority+0x92> <== ALWAYS TAKEN Chain_Node *previous_node; _ISR_Disable( level ); for( index=0 ; index < TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS ; index++ ) { 470e0: 5280 addql #1,%d0 470e2: 41e8 000c lea %a0@(12),%a0 Chain_Node *last_node; Chain_Node *next_node; Chain_Node *previous_node; _ISR_Disable( level ); for( index=0 ; 470e6: 7404 moveq #4,%d2 470e8: b480 cmpl %d0,%d2 470ea: 66c4 bnes 470b0 <_Thread_queue_Dequeue_priority+0x1c> } /* * We did not find a thread to unblock. */ _ISR_Enable( level ); 470ec: 46c1 movew %d1,%sr 470ee: 95ca subal %a2,%a2 return NULL; 470f0: 6078 bras 4716a <_Thread_queue_Dequeue_priority+0xd6> <== ALWAYS TAKEN 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; 470f2: 286a 0040 moveal %a2@(64),%a4 new_second_node = new_first_node->next; 470f6: 2a50 moveal %a0@,%a5 previous_node->next = new_first_node; next_node->previous = new_first_node; 470f8: 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; 470fc: 2288 movel %a0,%a1@ next_node->previous = new_first_node; new_first_node->next = next_node; new_first_node->previous = previous_node; 470fe: 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; 47102: 208b movel %a3,%a0@ new_first_node->previous = previous_node; if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) { 47104: 226a 0040 moveal %a2@(64),%a1 47108: b3ea 0038 cmpal %a2@(56),%a1 4710c: 671e beqs 4712c <_Thread_queue_Dequeue_priority+0x98> /* > two threads on 2-n */ new_second_node->previous = 4710e: 43e8 0038 lea %a0@(56),%a1 47112: 2b49 0004 movel %a1,%a5@(4) _Chain_Head( &new_first_thread->Wait.Block2n ); new_first_thread->Wait.Block2n.first = new_second_node; 47116: 214d 0038 movel %a5,%a0@(56) new_first_thread->Wait.Block2n.last = last_node; 4711a: 214c 0040 movel %a4,%a0@(64) last_node->next = _Chain_Tail( &new_first_thread->Wait.Block2n ); 4711e: 41e8 003c lea %a0@(60),%a0 47122: 2888 movel %a0,%a4@ 47124: 6006 bras 4712c <_Thread_queue_Dequeue_priority+0x98> <== ALWAYS TAKEN } } else { previous_node->next = next_node; next_node->previous = previous_node; 47126: 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; 4712a: 228b movel %a3,%a1@ 4712c: 47f9 0004 6934 lea 46934 <_Thread_Clear_state>,%a3 next_node->previous = previous_node; } if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 47132: 7002 moveq #2,%d0 47134: b0aa 0050 cmpl %a2@(80),%d0 47138: 6710 beqs 4714a <_Thread_queue_Dequeue_priority+0xb6> _ISR_Enable( level ); 4713a: 46c1 movew %d1,%sr RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 4713c: 2f3c 1003 fff8 movel #268697592,%sp@- 47142: 2f0a movel %a2,%sp@- 47144: 4e93 jsr %a3@ 47146: 508f addql #8,%sp 47148: 6020 bras 4716a <_Thread_queue_Dequeue_priority+0xd6> <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 4714a: 7403 moveq #3,%d2 4714c: 2542 0050 movel %d2,%a2@(80) _Thread_Unblock( the_thread ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 47150: 46c1 movew %d1,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 47152: 486a 0048 pea %a2@(72) 47156: 4eb9 0004 7d70 jsr 47d70 <_Watchdog_Remove> 4715c: 2f3c 1003 fff8 movel #268697592,%sp@- 47162: 2f0a movel %a2,%sp@- 47164: 4e93 jsr %a3@ 47166: 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 ); } 4716a: 200a movel %a2,%d0 4716c: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 47172: 4e5e unlk %fp 47174: 4e75 rts ... 0004a7f8 <_Thread_queue_Enqueue_fifo>: ) { Thread_blocking_operation_States sync_state; ISR_Level level; _ISR_Disable( level ); 4a7f8: 203c 0000 0700 movel #1792,%d0 Thread_blocking_operation_States _Thread_queue_Enqueue_fifo ( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, ISR_Level *level_p ) { 4a7fe: 4e56 0000 linkw %fp,#0 4a802: 206e 0008 moveal %fp@(8),%a0 4a806: 2f0a movel %a2,%sp@- 4a808: 226e 000c moveal %fp@(12),%a1 4a80c: 2f02 movel %d2,%sp@- Thread_blocking_operation_States sync_state; ISR_Level level; _ISR_Disable( level ); 4a80e: 40c1 movew %sr,%d1 4a810: 8081 orl %d1,%d0 4a812: 46c0 movew %d0,%sr sync_state = the_thread_queue->sync_state; 4a814: 2028 0030 movel %a0@(48),%d0 the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if (sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED) { 4a818: 7401 moveq #1,%d2 ISR_Level level; _ISR_Disable( level ); sync_state = the_thread_queue->sync_state; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 4a81a: 42a8 0030 clrl %a0@(48) if (sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED) { 4a81e: b480 cmpl %d0,%d2 4a820: 661c bnes 4a83e <_Thread_queue_Enqueue_fifo+0x46> Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 4a822: 2408 movel %a0,%d2 4a824: 5882 addql #4,%d2 4a826: 2282 movel %d2,%a1@ old_last_node = the_chain->last; 4a828: 2468 0008 moveal %a0@(8),%a2 the_chain->last = the_node; 4a82c: 2149 0008 movel %a1,%a0@(8) old_last_node->next = the_node; the_node->previous = old_last_node; 4a830: 234a 0004 movel %a2,%a1@(4) _Chain_Append_unprotected( &the_thread_queue->Queues.Fifo, &the_thread->Object.Node ); the_thread->Wait.queue = the_thread_queue; 4a834: 2348 0044 movel %a0,%a1@(68) 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; 4a838: 2489 movel %a1,%a2@ the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; _ISR_Enable( level ); 4a83a: 46c1 movew %d1,%sr return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 4a83c: 6006 bras 4a844 <_Thread_queue_Enqueue_fifo+0x4c> <== ALWAYS 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; 4a83e: 206e 0010 moveal %fp@(16),%a0 4a842: 2081 movel %d1,%a0@ return sync_state; } 4a844: 241f movel %sp@+,%d2 4a846: 245f moveal %sp@+,%a2 4a848: 4e5e unlk %fp 4a84a: 4e75 rts 00047210 <_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 ) { 47210: 4e56 ffe4 linkw %fp,#-28 47214: 206e 000c moveal %fp@(12),%a0 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 47218: 43e8 003c lea %a0@(60),%a1 Priority_Control priority; States_Control block_state; _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; 4721c: 2028 0014 movel %a0@(20),%d0 Thread_blocking_operation_States _Thread_queue_Enqueue_priority ( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, ISR_Level *level_p ) { 47220: 48d7 0c7c moveml %d2-%d6/%a2-%a3,%sp@ _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; 47224: 2400 movel %d0,%d2 47226: ec8a lsrl #6,%d2 47228: 2202 movel %d2,%d1 return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); 4722a: 283c 0000 0700 movel #1792,%d4 _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; 47230: e989 lsll #4,%d1 47232: e58a lsll #2,%d2 Thread_blocking_operation_States _Thread_queue_Enqueue_priority ( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, ISR_Level *level_p ) { 47234: 246e 0008 moveal %fp@(8),%a2 _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; 47238: 9282 subl %d2,%d1 4723a: 47f2 1800 lea %a2@(00000000,%d1:l),%a3 4723e: 2149 0038 movel %a1,%a0@(56) the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 47242: 43e8 0038 lea %a0@(56),%a1 block_state = the_thread_queue->state; 47246: 2a2a 0038 movel %a2@(56),%d5 4724a: 2149 0040 movel %a1,%a0@(64) RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 4724e: 42a8 003c clrl %a0@(60) if ( _Thread_queue_Is_reverse_search( priority ) ) 47252: 0800 0005 btst #5,%d0 47256: 6660 bnes 472b8 <_Thread_queue_Enqueue_priority+0xa8> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 47258: 2c0b movel %a3,%d6 4725a: 5886 addql #4,%d6 goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); 4725c: 2404 movel %d4,%d2 4725e: 40c1 movew %sr,%d1 47260: 8481 orl %d1,%d2 47262: 46c2 movew %d2,%sr search_thread = (Thread_Control *) header->first; 47264: 2253 moveal %a3@,%a1 47266: 76ff moveq #-1,%d3 while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 47268: 601e bras 47288 <_Thread_queue_Enqueue_priority+0x78> <== ALWAYS TAKEN search_priority = search_thread->current_priority; 4726a: 2629 0014 movel %a1@(20),%d3 if ( priority <= search_priority ) 4726e: b680 cmpl %d0,%d3 47270: 641a bccs 4728c <_Thread_queue_Enqueue_priority+0x7c> break; search_priority = search_thread->current_priority; if ( priority <= search_priority ) break; #endif _ISR_Flash( level ); 47272: 2404 movel %d4,%d2 47274: 46c1 movew %d1,%sr 47276: 8481 orl %d1,%d2 47278: 46c2 movew %d2,%sr if ( !_States_Are_set( search_thread->current_state, block_state) ) { 4727a: 2405 movel %d5,%d2 4727c: c4a9 0010 andl %a1@(16),%d2 47280: 6604 bnes 47286 <_Thread_queue_Enqueue_priority+0x76> <== NEVER TAKEN _ISR_Enable( level ); 47282: 46c1 movew %d1,%sr <== NOT EXECUTED goto restart_forward_search; 47284: 60d6 bras 4725c <_Thread_queue_Enqueue_priority+0x4c> <== NOT EXECUTED } search_thread = (Thread_Control *)search_thread->Object.Node.next; 47286: 2251 moveal %a1@,%a1 restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); search_thread = (Thread_Control *) header->first; while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 47288: bc89 cmpl %a1,%d6 4728a: 66de bnes 4726a <_Thread_queue_Enqueue_priority+0x5a> 4728c: 2401 movel %d1,%d2 } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 4728e: 7801 moveq #1,%d4 47290: b8aa 0030 cmpl %a2@(48),%d4 47294: 6600 00a4 bnew 4733a <_Thread_queue_Enqueue_priority+0x12a> THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 47298: 42aa 0030 clrl %a2@(48) if ( priority == search_priority ) 4729c: b680 cmpl %d0,%d3 4729e: 677e beqs 4731e <_Thread_queue_Enqueue_priority+0x10e> goto equal_priority; search_node = (Chain_Node *) search_thread; previous_node = search_node->previous; 472a0: 2669 0004 moveal %a1@(4),%a3 the_node = (Chain_Node *) the_thread; the_node->next = search_node; 472a4: 2089 movel %a1,%a0@ the_node->previous = previous_node; 472a6: 214b 0004 movel %a3,%a0@(4) previous_node->next = the_node; search_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 472aa: 214a 0044 movel %a2,%a0@(68) previous_node = search_node->previous; the_node = (Chain_Node *) the_thread; the_node->next = search_node; the_node->previous = previous_node; previous_node->next = the_node; 472ae: 2688 movel %a0,%a3@ search_node->previous = the_node; 472b0: 2348 0004 movel %a0,%a1@(4) the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 472b4: 46c1 movew %d1,%sr 472b6: 6062 bras 4731a <_Thread_queue_Enqueue_priority+0x10a> <== ALWAYS TAKEN return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 472b8: 4283 clrl %d3 472ba: 1639 0005 b712 moveb 5b712 ,%d3 _ISR_Disable( level ); 472c0: 2404 movel %d4,%d2 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 472c2: 5283 addql #1,%d3 _ISR_Disable( level ); 472c4: 40c1 movew %sr,%d1 472c6: 8481 orl %d1,%d2 472c8: 46c2 movew %d2,%sr search_thread = (Thread_Control *) header->last; 472ca: 226b 0008 moveal %a3@(8),%a1 while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 472ce: 6020 bras 472f0 <_Thread_queue_Enqueue_priority+0xe0> <== ALWAYS TAKEN search_priority = search_thread->current_priority; 472d0: 2629 0014 movel %a1@(20),%d3 if ( priority >= search_priority ) 472d4: b680 cmpl %d0,%d3 472d6: 631c blss 472f4 <_Thread_queue_Enqueue_priority+0xe4> break; search_priority = search_thread->current_priority; if ( priority >= search_priority ) break; #endif _ISR_Flash( level ); 472d8: 2404 movel %d4,%d2 472da: 46c1 movew %d1,%sr 472dc: 8481 orl %d1,%d2 472de: 46c2 movew %d2,%sr if ( !_States_Are_set( search_thread->current_state, block_state) ) { 472e0: 2405 movel %d5,%d2 472e2: c4a9 0010 andl %a1@(16),%d2 472e6: 6604 bnes 472ec <_Thread_queue_Enqueue_priority+0xdc> _ISR_Enable( level ); 472e8: 46c1 movew %d1,%sr goto restart_reverse_search; 472ea: 60cc bras 472b8 <_Thread_queue_Enqueue_priority+0xa8> <== ALWAYS TAKEN } search_thread = (Thread_Control *) 472ec: 2269 0004 moveal %a1@(4),%a1 restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); search_thread = (Thread_Control *) header->last; while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 472f0: b7c9 cmpal %a1,%a3 472f2: 66dc bnes 472d0 <_Thread_queue_Enqueue_priority+0xc0> 472f4: 2401 movel %d1,%d2 } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 472f6: 7801 moveq #1,%d4 472f8: b8aa 0030 cmpl %a2@(48),%d4 472fc: 663c bnes 4733a <_Thread_queue_Enqueue_priority+0x12a> THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 472fe: 42aa 0030 clrl %a2@(48) if ( priority == search_priority ) 47302: b680 cmpl %d0,%d3 47304: 6718 beqs 4731e <_Thread_queue_Enqueue_priority+0x10e> goto equal_priority; search_node = (Chain_Node *) search_thread; next_node = search_node->next; 47306: 2651 moveal %a1@,%a3 the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; 47308: 2149 0004 movel %a1,%a0@(4) search_node = (Chain_Node *) search_thread; next_node = search_node->next; the_node = (Chain_Node *) the_thread; the_node->next = next_node; 4730c: 208b movel %a3,%a0@ the_node->previous = search_node; search_node->next = the_node; next_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 4730e: 214a 0044 movel %a2,%a0@(68) next_node = search_node->next; the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; search_node->next = the_node; 47312: 2288 movel %a0,%a1@ next_node->previous = the_node; 47314: 2748 0004 movel %a0,%a3@(4) the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 47318: 46c1 movew %d1,%sr 4731a: 7001 moveq #1,%d0 return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 4731c: 6026 bras 47344 <_Thread_queue_Enqueue_priority+0x134> <== ALWAYS TAKEN 4731e: 43e9 003c lea %a1@(60),%a1 equal_priority: /* add at end of priority group */ search_node = _Chain_Tail( &search_thread->Wait.Block2n ); previous_node = search_node->previous; 47322: 2669 0004 moveal %a1@(4),%a3 the_node = (Chain_Node *) the_thread; the_node->next = search_node; 47326: 2089 movel %a1,%a0@ the_node->previous = previous_node; 47328: 214b 0004 movel %a3,%a0@(4) previous_node->next = the_node; search_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 4732c: 214a 0044 movel %a2,%a0@(68) previous_node = search_node->previous; the_node = (Chain_Node *) the_thread; the_node->next = search_node; the_node->previous = previous_node; previous_node->next = the_node; 47330: 2688 movel %a0,%a3@ search_node->previous = the_node; 47332: 2348 0004 movel %a0,%a1@(4) the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); 47336: 46c2 movew %d2,%sr 47338: 60e0 bras 4731a <_Thread_queue_Enqueue_priority+0x10a> <== ALWAYS 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; 4733a: 206e 0010 moveal %fp@(16),%a0 return the_thread_queue->sync_state; 4733e: 202a 0030 movel %a2@(48),%d0 * For example, the blocking thread could have been given * the mutex by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ *level_p = level; 47342: 2082 movel %d2,%a0@ return the_thread_queue->sync_state; } 47344: 4cd7 0c7c moveml %sp@,%d2-%d6/%a2-%a3 47348: 4e5e unlk %fp 4734a: 4e75 rts 0004c33c <_Thread_queue_Extract_fifo>: Thread_Control *the_thread ) { ISR_Level level; _ISR_Disable( level ); 4c33c: 223c 0000 0700 movel #1792,%d1 void _Thread_queue_Extract_fifo( Thread_queue_Control *the_thread_queue __attribute__((unused)), Thread_Control *the_thread ) { 4c342: 4e56 0000 linkw %fp,#0 4c346: 2f0a movel %a2,%sp@- 4c348: 246e 000c moveal %fp@(12),%a2 ISR_Level level; _ISR_Disable( level ); 4c34c: 40c0 movew %sr,%d0 4c34e: 8280 orl %d0,%d1 4c350: 46c1 movew %d1,%sr if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 4c352: 222a 0010 movel %a2@(16),%d1 4c356: 0281 0003 bee0 andil #245472,%d1 4c35c: 660a bnes 4c368 <_Thread_queue_Extract_fifo+0x2c> _ISR_Enable( level ); 4c35e: 46c0 movew %d0,%sr #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); #endif } 4c360: 246e fffc moveal %fp@(-4),%a2 4c364: 4e5e unlk %fp 4c366: 4e75 rts ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 4c368: 2052 moveal %a2@,%a0 _Chain_Extract_unprotected( &the_thread->Object.Node ); the_thread->Wait.queue = NULL; if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 4c36a: 7202 moveq #2,%d1 previous = the_node->previous; 4c36c: 226a 0004 moveal %a2@(4),%a1 return; } _Chain_Extract_unprotected( &the_thread->Object.Node ); the_thread->Wait.queue = NULL; 4c370: 42aa 0044 clrl %a2@(68) next->previous = previous; previous->next = next; 4c374: 2288 movel %a0,%a1@ Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 4c376: 2149 0004 movel %a1,%a0@(4) if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 4c37a: b2aa 0050 cmpl %a2@(80),%d1 4c37e: 6704 beqs 4c384 <_Thread_queue_Extract_fifo+0x48> _ISR_Enable( level ); 4c380: 46c0 movew %d0,%sr 4c382: 6014 bras 4c398 <_Thread_queue_Extract_fifo+0x5c> <== ALWAYS TAKEN 4c384: 7203 moveq #3,%d1 4c386: 2541 0050 movel %d1,%a2@(80) } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 4c38a: 46c0 movew %d0,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 4c38c: 486a 0048 pea %a2@(72) 4c390: 4eb9 0004 7d70 jsr 47d70 <_Watchdog_Remove> 4c396: 588f addql #4,%sp RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 4c398: 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 } 4c39c: 246e fffc moveal %fp@(-4),%a2 4c3a0: 203c 1003 fff8 movel #268697592,%d0 4c3a6: 2d40 000c movel %d0,%fp@(12) 4c3aa: 4e5e unlk %fp 4c3ac: 4ef9 0004 6934 jmp 46934 <_Thread_Clear_state> ... 0004a884 <_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 ); 4a884: 223c 0000 0700 movel #1792,%d1 void _Thread_queue_Extract_priority_helper( Thread_queue_Control *the_thread_queue __attribute__((unused)), Thread_Control *the_thread, bool requeuing ) { 4a88a: 4e56 ffec linkw %fp,#-20 4a88e: 48d7 3c04 moveml %d2/%a2-%a5,%sp@ 4a892: 246e 000c moveal %fp@(12),%a2 4a896: 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 ); 4a89a: 40c0 movew %sr,%d0 4a89c: 8280 orl %d0,%d1 4a89e: 46c1 movew %d1,%sr if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 4a8a0: 222a 0010 movel %a2@(16),%d1 4a8a4: 0281 0003 bee0 andil #245472,%d1 4a8aa: 6606 bnes 4a8b2 <_Thread_queue_Extract_priority_helper+0x2e> _ISR_Enable( level ); 4a8ac: 46c0 movew %d0,%sr return; 4a8ae: 6000 0096 braw 4a946 <_Thread_queue_Extract_priority_helper+0xc2> <== ALWAYS TAKEN */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4a8b2: 220a movel %a2,%d1 4a8b4: 0681 0000 003c addil #60,%d1 /* * The thread was actually waiting on a thread queue so let's remove it. */ next_node = the_node->next; 4a8ba: 2652 moveal %a2@,%a3 previous_node = the_node->previous; 4a8bc: 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)); 4a8c0: 206a 0038 moveal %a2@(56),%a0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4a8c4: b288 cmpl %a0,%d1 4a8c6: 6734 beqs 4a8fc <_Thread_queue_Extract_priority_helper+0x78> 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; 4a8c8: 286a 0040 moveal %a2@(64),%a4 new_second_node = new_first_node->next; 4a8cc: 2a50 moveal %a0@,%a5 previous_node->next = new_first_node; next_node->previous = new_first_node; 4a8ce: 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; 4a8d2: 2288 movel %a0,%a1@ next_node->previous = new_first_node; new_first_node->next = next_node; new_first_node->previous = previous_node; 4a8d4: 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; 4a8d8: 208b movel %a3,%a0@ new_first_node->previous = previous_node; if ( !_Chain_Has_only_one_node( &the_thread->Wait.Block2n ) ) { 4a8da: 222a 0040 movel %a2@(64),%d1 4a8de: b2aa 0038 cmpl %a2@(56),%d1 4a8e2: 671e beqs 4a902 <_Thread_queue_Extract_priority_helper+0x7e> /* > two threads on 2-n */ new_second_node->previous = 4a8e4: 43e8 0038 lea %a0@(56),%a1 4a8e8: 2b49 0004 movel %a1,%a5@(4) _Chain_Head( &new_first_thread->Wait.Block2n ); new_first_thread->Wait.Block2n.first = new_second_node; 4a8ec: 214d 0038 movel %a5,%a0@(56) new_first_thread->Wait.Block2n.last = last_node; 4a8f0: 214c 0040 movel %a4,%a0@(64) last_node->next = _Chain_Tail( &new_first_thread->Wait.Block2n ); 4a8f4: 41e8 003c lea %a0@(60),%a0 4a8f8: 2888 movel %a0,%a4@ 4a8fa: 6006 bras 4a902 <_Thread_queue_Extract_priority_helper+0x7e> <== ALWAYS TAKEN } } else { previous_node->next = next_node; next_node->previous = previous_node; 4a8fc: 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; 4a900: 228b movel %a3,%a1@ /* * If we are not supposed to touch timers or the thread's state, return. */ if ( requeuing ) { 4a902: 4a02 tstb %d2 4a904: 6704 beqs 4a90a <_Thread_queue_Extract_priority_helper+0x86> _ISR_Enable( level ); 4a906: 46c0 movew %d0,%sr 4a908: 603c bras 4a946 <_Thread_queue_Extract_priority_helper+0xc2> <== ALWAYS TAKEN return; } if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 4a90a: 7202 moveq #2,%d1 4a90c: b2aa 0050 cmpl %a2@(80),%d1 4a910: 6704 beqs 4a916 <_Thread_queue_Extract_priority_helper+0x92> _ISR_Enable( level ); 4a912: 46c0 movew %d0,%sr 4a914: 6014 bras 4a92a <_Thread_queue_Extract_priority_helper+0xa6> <== ALWAYS TAKEN 4a916: 7203 moveq #3,%d1 4a918: 2541 0050 movel %d1,%a2@(80) } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 4a91c: 46c0 movew %d0,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 4a91e: 486a 0048 pea %a2@(72) 4a922: 4eb9 0004 7d70 jsr 47d70 <_Watchdog_Remove> 4a928: 588f addql #4,%sp 4a92a: 2d4a 0008 movel %a2,%fp@(8) 4a92e: 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 } 4a934: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 4a93a: 2d49 000c movel %a1,%fp@(12) 4a93e: 4e5e unlk %fp 4a940: 4ef9 0004 6934 jmp 46934 <_Thread_Clear_state> 4a946: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 4a94c: 4e5e unlk %fp 4a94e: 4e75 rts 00049044 <_Thread_queue_First_priority>: */ Thread_Control *_Thread_queue_First_priority ( Thread_queue_Control *the_thread_queue ) { 49044: 4280 clrl %d0 49046: 4e56 0000 linkw %fp,#0 4904a: 226e 0008 moveal %fp@(8),%a1 4904e: 2049 moveal %a1,%a0 49050: 2208 movel %a0,%d1 49052: 5881 addql #4,%d1 49054: b290 cmpl %a0@,%d1 49056: 670e beqs 49066 <_Thread_queue_First_priority+0x22> for( index=0 ; index < TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS ; index++ ) { if ( !_Chain_Is_empty( &the_thread_queue->Queues.Priority[ index ] ) ) return (Thread_Control *) 49058: 2200 movel %d0,%d1 4905a: e588 lsll #2,%d0 4905c: e989 lsll #4,%d1 4905e: 9280 subl %d0,%d1 49060: 2031 1800 movel %a1@(00000000,%d1:l),%d0 49064: 600e bras 49074 <_Thread_queue_First_priority+0x30> <== ALWAYS TAKEN { uint32_t index; for( index=0 ; index < TASK_QUEUE_DATA_NUMBER_OF_PRIORITY_HEADERS ; index++ ) { 49066: 5280 addql #1,%d0 49068: 41e8 000c lea %a0@(12),%a0 Thread_queue_Control *the_thread_queue ) { uint32_t index; for( index=0 ; 4906c: 7204 moveq #4,%d1 4906e: b280 cmpl %d0,%d1 49070: 66de bnes 49050 <_Thread_queue_First_priority+0xc> 49072: 4280 clrl %d0 if ( !_Chain_Is_empty( &the_thread_queue->Queues.Priority[ index ] ) ) return (Thread_Control *) the_thread_queue->Queues.Priority[ index ].first; } return NULL; } 49074: 4e5e unlk %fp 49076: 4e75 rts 00047374 <_Thread_queue_Flush>: #else Thread_queue_Flush_callout remote_extract_callout __attribute__((unused)), #endif uint32_t status ) { 47374: 4e56 fff4 linkw %fp,#-12 47378: 48d7 040c moveml %d2-%d3/%a2,%sp@ 4737c: 262e 0008 movel %fp@(8),%d3 Thread_Control *the_thread; while ( (the_thread = _Thread_queue_Dequeue( the_thread_queue )) ) { 47380: 45f9 0004 7038 lea 47038 <_Thread_queue_Dequeue>,%a2 #else Thread_queue_Flush_callout remote_extract_callout __attribute__((unused)), #endif uint32_t status ) { 47386: 242e 0010 movel %fp@(16),%d2 Thread_Control *the_thread; while ( (the_thread = _Thread_queue_Dequeue( the_thread_queue )) ) { 4738a: 6006 bras 47392 <_Thread_queue_Flush+0x1e> <== ALWAYS TAKEN #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) ( *remote_extract_callout )( the_thread ); else #endif the_thread->Wait.return_code = status; 4738c: 2040 moveal %d0,%a0 4738e: 2142 0034 movel %d2,%a0@(52) uint32_t status ) { Thread_Control *the_thread; while ( (the_thread = _Thread_queue_Dequeue( the_thread_queue )) ) { 47392: 2f03 movel %d3,%sp@- 47394: 4e92 jsr %a2@ 47396: 588f addql #4,%sp 47398: 4a80 tstl %d0 4739a: 66f0 bnes 4738c <_Thread_queue_Flush+0x18> ( *remote_extract_callout )( the_thread ); else #endif the_thread->Wait.return_code = status; } } 4739c: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 473a2: 4e5e unlk %fp 473a4: 4e75 rts ... 000473a8 <_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 ) { 473a8: 7201 moveq #1,%d1 Thread_queue_Control *the_thread_queue, Thread_queue_Disciplines the_discipline, States_Control state, uint32_t timeout_status ) { 473aa: 4e56 0000 linkw %fp,#0 473ae: 206e 0008 moveal %fp@(8),%a0 the_thread_queue->state = state; 473b2: 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 ) { 473b8: 202e 000c movel %fp@(12),%d0 the_thread_queue->state = state; the_thread_queue->discipline = the_discipline; the_thread_queue->timeout_status = timeout_status; 473bc: 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; 473c2: 2140 0034 movel %d0,%a0@(52) the_thread_queue->timeout_status = timeout_status; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 473c6: 42a8 0030 clrl %a0@(48) if ( the_discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) { 473ca: b280 cmpl %d0,%d1 473cc: 6620 bnes 473ee <_Thread_queue_Initialize+0x46> * timeout_status - return on a timeout * * Output parameters: NONE */ void _Thread_queue_Initialize( 473ce: 2008 movel %a0,%d0 473d0: 0680 0000 0030 addil #48,%d0 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 473d6: 2208 movel %a0,%d1 473d8: 5881 addql #4,%d1 the_chain->permanent_null = NULL; 473da: 42a8 0004 clrl %a0@(4) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 473de: 2081 movel %d1,%a0@ the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 473e0: 2148 0008 movel %a0,%a0@(8) 473e4: 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 ; 473e8: b088 cmpl %a0,%d0 473ea: 66ea bnes 473d6 <_Thread_queue_Initialize+0x2e> 473ec: 600e bras 473fc <_Thread_queue_Initialize+0x54> <== ALWAYS TAKEN */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 473ee: 2008 movel %a0,%d0 473f0: 5880 addql #4,%d0 the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 473f2: 2148 0008 movel %a0,%a0@(8) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 473f6: 2080 movel %d0,%a0@ the_chain->permanent_null = NULL; 473f8: 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 ); } } 473fc: 4e5e unlk %fp 473fe: 4e75 rts 0004a950 <_Thread_queue_Process_timeout>: #include void _Thread_queue_Process_timeout( Thread_Control *the_thread ) { 4a950: 4e56 0000 linkw %fp,#0 4a954: 206e 0008 moveal %fp@(8),%a0 Thread_queue_Control *the_thread_queue = the_thread->Wait.queue; 4a958: 2268 0044 moveal %a0@(68),%a1 * If it is not satisfied, then it is "nothing happened" and * this is the "timeout" transition. After a request is satisfied, * a timeout is not allowed to occur. */ if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SYNCHRONIZED && 4a95c: 2029 0030 movel %a1@(48),%d0 4a960: 671c beqs 4a97e <_Thread_queue_Process_timeout+0x2e> 4a962: b1f9 0005 cf7e cmpal 5cf7e <_Thread_Executing>,%a0 4a968: 6614 bnes 4a97e <_Thread_queue_Process_timeout+0x2e> <== ALWAYS TAKEN _Thread_Is_executing( the_thread ) ) { if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) { 4a96a: 7203 moveq #3,%d1 4a96c: b280 cmpl %d0,%d1 4a96e: 6722 beqs 4a992 <_Thread_queue_Process_timeout+0x42> the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 4a970: 7002 moveq #2,%d0 */ if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SYNCHRONIZED && _Thread_Is_executing( the_thread ) ) { if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) { the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; 4a972: 2169 003c 0034 movel %a1@(60),%a0@(52) the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 4a978: 2340 0030 movel %d0,%a1@(48) 4a97c: 6014 bras 4a992 <_Thread_queue_Process_timeout+0x42> <== ALWAYS TAKEN } } else { the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; 4a97e: 2169 003c 0034 movel %a1@(60),%a0@(52) _Thread_queue_Extract( the_thread->Wait.queue, the_thread ); 4a984: 2f08 movel %a0,%sp@- 4a986: 2f28 0044 movel %a0@(68),%sp@- 4a98a: 4eb9 0004 a84c jsr 4a84c <_Thread_queue_Extract> 4a990: 508f addql #8,%sp } } 4a992: 4e5e unlk %fp 4a994: 4e75 rts ... 00047400 <_Thread_queue_Requeue>: void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { 47400: 4e56 fff0 linkw %fp,#-16 47404: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 47408: 246e 0008 moveal %fp@(8),%a2 4740c: 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 ) 47410: 4a8a tstl %a2 47412: 6746 beqs 4745a <_Thread_queue_Requeue+0x5a> <== 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 ) { 47414: 7001 moveq #1,%d0 47416: b0aa 0034 cmpl %a2@(52),%d0 4741a: 663e bnes 4745a <_Thread_queue_Requeue+0x5a> <== ALWAYS TAKEN Thread_queue_Control *tq = the_thread_queue; ISR_Level level; ISR_Level level_ignored; _ISR_Disable( level ); 4741c: 303c 0700 movew #1792,%d0 47420: 40c2 movew %sr,%d2 47422: 8082 orl %d2,%d0 47424: 46c0 movew %d0,%sr if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 47426: 202b 0010 movel %a3@(16),%d0 4742a: 0280 0003 bee0 andil #245472,%d0 47430: 6726 beqs 47458 <_Thread_queue_Requeue+0x58> <== ALWAYS TAKEN _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); 47432: 4878 0001 pea 1 47436: 7001 moveq #1,%d0 47438: 2f0b movel %a3,%sp@- 4743a: 2540 0030 movel %d0,%a2@(48) 4743e: 2f0a movel %a2,%sp@- 47440: 4eb9 0004 a884 jsr 4a884 <_Thread_queue_Extract_priority_helper> (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); 47446: 486e fffc pea %fp@(-4) 4744a: 2f0b movel %a3,%sp@- 4744c: 2f0a movel %a2,%sp@- 4744e: 4eb9 0004 7210 jsr 47210 <_Thread_queue_Enqueue_priority> 47454: 4fef 0018 lea %sp@(24),%sp } _ISR_Enable( level ); 47458: 46c2 movew %d2,%sr } } 4745a: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3 47460: 4e5e unlk %fp 47462: 4e75 rts 00047464 <_Thread_queue_Timeout>: void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { 47464: 4e56 fffc linkw %fp,#-4 Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 47468: 486e fffc pea %fp@(-4) 4746c: 2f2e 0008 movel %fp@(8),%sp@- 47470: 4eb9 0004 6d14 jsr 46d14 <_Thread_Get> switch ( location ) { 47476: 508f addql #8,%sp 47478: 4aae fffc tstl %fp@(-4) 4747c: 6618 bnes 47496 <_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 ); 4747e: 2f00 movel %d0,%sp@- 47480: 4eb9 0004 a950 jsr 4a950 <_Thread_queue_Process_timeout> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 47486: 588f addql #4,%sp 47488: 2039 0005 cec4 movel 5cec4 <_Thread_Dispatch_disable_level>,%d0 4748e: 5380 subql #1,%d0 47490: 23c0 0005 cec4 movel %d0,5cec4 <_Thread_Dispatch_disable_level> _Thread_Unnest_dispatch(); break; } } 47496: 4e5e unlk %fp 47498: 4e75 rts ... 00050edc <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 50edc: 4e56 ffb4 linkw %fp,#-76 50ee0: 200e movel %fp,%d0 50ee2: 0680 ffff fff4 addil #-12,%d0 50ee8: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 50eec: 246e 0008 moveal %fp@(8),%a2 50ef0: 240e movel %fp,%d2 50ef2: 2a0e movel %fp,%d5 50ef4: 260e movel %fp,%d3 50ef6: 0682 ffff ffe8 addil #-24,%d2 50efc: 5185 subql #8,%d5 50efe: 0683 ffff ffec addil #-20,%d3 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 50f04: 41ea 0008 lea %a2@(8),%a0 static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 50f08: 4bea 0040 lea %a2@(64),%a5 */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 50f0c: 2e0a movel %a2,%d7 /* * This path is for normal forward movement and cases where the * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 50f0e: 280a movel %a2,%d4 */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 50f10: 0687 0000 0030 addil #48,%d7 /* * This path is for normal forward movement and cases where the * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 50f16: 0684 0000 0068 addil #104,%d4 */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 50f1c: 49f9 0005 4aa4 lea 54aa4 <_Watchdog_Adjust_to_chain>,%a4 ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 50f22: 47f9 0005 4b34 lea 54b34 <_Watchdog_Insert>,%a3 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 50f28: 2d48 ffe4 movel %a0,%fp@(-28) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 50f2c: 2d45 fff4 movel %d5,%fp@(-12) the_chain->permanent_null = NULL; 50f30: 42ae fff8 clrl %fp@(-8) the_chain->last = _Chain_Head(the_chain); 50f34: 2d40 fffc movel %d0,%fp@(-4) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 50f38: 2d43 ffe8 movel %d3,%fp@(-24) the_chain->permanent_null = NULL; 50f3c: 42ae ffec clrl %fp@(-20) the_chain->last = _Chain_Head(the_chain); 50f40: 2d42 fff0 movel %d2,%fp@(-16) 50f44: 2d4d ffe0 movel %a5,%fp@(-32) { /* * Afterwards all timer inserts are directed to this chain and the interval * and TOD chains will be no more modified by other parties. */ ts->insert_chain = insert_chain; 50f48: 41ee fff4 lea %fp@(-12),%a0 * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); 50f4c: 3a7c 0700 moveaw #1792,%a5 { /* * Afterwards all timer inserts are directed to this chain and the interval * and TOD chains will be no more modified by other parties. */ ts->insert_chain = insert_chain; 50f50: 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; 50f54: 2039 0007 500c movel 7500c <_Watchdog_Ticks_since_boot>,%d0 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 50f5a: 222a 003c movel %a2@(60),%d1 watchdogs->last_snapshot = snapshot; 50f5e: 2540 003c movel %d0,%a2@(60) _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 50f62: 486e ffe8 pea %fp@(-24) 50f66: 9081 subl %d1,%d0 50f68: 2f00 movel %d0,%sp@- 50f6a: 2f07 movel %d7,%sp@- 50f6c: 4e94 jsr %a4@ static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 50f6e: 2039 0007 4f5a movel 74f5a <_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 ) { 50f74: 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; 50f78: 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 ) { 50f7c: b280 cmpl %d0,%d1 50f7e: 6414 bccs 50f94 <_Timer_server_Body+0xb8> /* * This path is for normal forward movement and cases where the * TOD has been set forward. */ delta = snapshot - last_snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 50f80: 486e ffe8 pea %fp@(-24) 50f84: 2c00 movel %d0,%d6 50f86: 9c81 subl %d1,%d6 50f88: 2f06 movel %d6,%sp@- 50f8a: 2d40 ffdc movel %d0,%fp@(-36) 50f8e: 2f04 movel %d4,%sp@- 50f90: 4e94 jsr %a4@ 50f92: 6018 bras 50fac <_Timer_server_Body+0xd0> <== ALWAYS TAKEN } else if ( snapshot < last_snapshot ) { 50f94: b280 cmpl %d0,%d1 50f96: 631c blss 50fb4 <_Timer_server_Body+0xd8> /* * The current TOD is before the last TOD which indicates that * TOD has been set backwards. */ delta = last_snapshot - snapshot; _Watchdog_Adjust( &watchdogs->Chain, WATCHDOG_BACKWARD, delta ); 50f98: 9280 subl %d0,%d1 50f9a: 2f01 movel %d1,%sp@- 50f9c: 4878 0001 pea 1 50fa0: 2d40 ffdc movel %d0,%fp@(-36) 50fa4: 2f04 movel %d4,%sp@- 50fa6: 4eb9 0005 4a24 jsr 54a24 <_Watchdog_Adjust> 50fac: 202e ffdc movel %fp@(-36),%d0 50fb0: 4fef 000c lea %sp@(12),%sp } watchdogs->last_snapshot = snapshot; 50fb4: 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 ); 50fb8: 202a 0078 movel %a2@(120),%d0 50fbc: 2f00 movel %d0,%sp@- 50fbe: 4eb9 0005 18b8 jsr 518b8 <_Chain_Get> if ( timer == NULL ) { 50fc4: 588f addql #4,%sp } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 50fc6: 2040 moveal %d0,%a0 if ( timer == NULL ) { 50fc8: 4a80 tstl %d0 50fca: 6724 beqs 50ff0 <_Timer_server_Body+0x114> static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 50fcc: 2028 0038 movel %a0@(56),%d0 50fd0: 7201 moveq #1,%d1 50fd2: b280 cmpl %d0,%d1 50fd4: 6608 bnes 50fde <_Timer_server_Body+0x102> _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 50fd6: 4868 0010 pea %a0@(16) 50fda: 2f07 movel %d7,%sp@- 50fdc: 600c bras 50fea <_Timer_server_Body+0x10e> <== ALWAYS TAKEN } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 50fde: 7c03 moveq #3,%d6 50fe0: bc80 cmpl %d0,%d6 50fe2: 66d4 bnes 50fb8 <_Timer_server_Body+0xdc> <== ALWAYS TAKEN _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 50fe4: 4868 0010 pea %a0@(16) 50fe8: 2f04 movel %d4,%sp@- 50fea: 4e93 jsr %a3@ 50fec: 508f addql #8,%sp 50fee: 60c8 bras 50fb8 <_Timer_server_Body+0xdc> <== 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 ); 50ff0: 200d movel %a5,%d0 50ff2: 40c1 movew %sr,%d1 50ff4: 8081 orl %d1,%d0 50ff6: 46c0 movew %d0,%sr if ( _Chain_Is_empty( insert_chain ) ) { 50ff8: baae fff4 cmpl %fp@(-12),%d5 50ffc: 6612 bnes 51010 <_Timer_server_Body+0x134> ts->insert_chain = NULL; 50ffe: 42aa 0078 clrl %a2@(120) _ISR_Enable( level ); 51002: 46c1 movew %d1,%sr /* * It is essential that interrupts are disable here since an interrupt * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); 51004: 3a7c 0700 moveaw #1792,%a5 _Chain_Initialize_empty( &fire_chain ); while ( true ) { _Timer_server_Get_watchdogs_that_fire_now( ts, &insert_chain, &fire_chain ); if ( !_Chain_Is_empty( &fire_chain ) ) { 51008: b6ae ffe8 cmpl %fp@(-24),%d3 5100c: 6608 bnes 51016 <_Timer_server_Body+0x13a> 5100e: 6042 bras 51052 <_Timer_server_Body+0x176> <== ALWAYS TAKEN ts->insert_chain = NULL; _ISR_Enable( level ); break; } else { _ISR_Enable( level ); 51010: 46c1 movew %d1,%sr 51012: 6000 ff40 braw 50f54 <_Timer_server_Body+0x78> <== ALWAYS TAKEN /* * It is essential that interrupts are disable here since an interrupt * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); 51016: 220d movel %a5,%d1 51018: 40c0 movew %sr,%d0 5101a: 8280 orl %d0,%d1 5101c: 46c1 movew %d1,%sr */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 5101e: 206e ffe8 moveal %fp@(-24),%a0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 51022: b688 cmpl %a0,%d3 51024: 6726 beqs 5104c <_Timer_server_Body+0x170> { Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; 51026: 2250 moveal %a0@,%a1 the_chain->first = new_first; 51028: 2d49 ffe8 movel %a1,%fp@(-24) new_first->previous = _Chain_Head(the_chain); 5102c: 2342 0004 movel %d2,%a1@(4) watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { 51030: 4a88 tstl %a0 51032: 6718 beqs 5104c <_Timer_server_Body+0x170> <== ALWAYS TAKEN watchdog->state = WATCHDOG_INACTIVE; 51034: 42a8 0008 clrl %a0@(8) _ISR_Enable( level ); 51038: 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 ); 5103a: 2f28 0024 movel %a0@(36),%sp@- 5103e: 2f28 0020 movel %a0@(32),%sp@- 51042: 2068 001c moveal %a0@(28),%a0 51046: 4e90 jsr %a0@ } 51048: 508f addql #8,%sp 5104a: 60ca bras 51016 <_Timer_server_Body+0x13a> <== ALWAYS TAKEN watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; _ISR_Enable( level ); } else { _ISR_Enable( level ); 5104c: 46c0 movew %d0,%sr 5104e: 6000 fef8 braw 50f48 <_Timer_server_Body+0x6c> <== ALWAYS TAKEN * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); } } else { ts->active = false; 51052: 4200 clrb %d0 51054: 1540 007c moveb %d0,%a2@(124) 51058: 2039 0007 4ec8 movel 74ec8 <_Thread_Dispatch_disable_level>,%d0 5105e: 5280 addql #1,%d0 51060: 23c0 0007 4ec8 movel %d0,74ec8 <_Thread_Dispatch_disable_level> /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); 51066: 4878 0008 pea 8 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 5106a: 4bf9 0005 4c50 lea 54c50 <_Watchdog_Remove>,%a5 /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); 51070: 2f12 movel %a2@,%sp@- 51072: 4eb9 0005 423c jsr 5423c <_Thread_Set_state> _Timer_server_Reset_interval_system_watchdog( ts ); 51078: 2f0a movel %a2,%sp@- 5107a: 4eba fd9c jsr %pc@(50e18 <_Timer_server_Reset_interval_system_watchdog>) _Timer_server_Reset_tod_system_watchdog( ts ); 5107e: 2f0a movel %a2,%sp@- 51080: 4eba fdf6 jsr %pc@(50e78 <_Timer_server_Reset_tod_system_watchdog>) _Thread_Enable_dispatch(); 51084: 4eb9 0005 38b6 jsr 538b6 <_Thread_Enable_dispatch> ts->active = true; 5108a: 7201 moveq #1,%d1 5108c: 1541 007c moveb %d1,%a2@(124) static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 51090: 2f2e ffe4 movel %fp@(-28),%sp@- 51094: 4e95 jsr %a5@ static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 51096: 2f2e ffe0 movel %fp@(-32),%sp@- 5109a: 4e95 jsr %a5@ 5109c: 4fef 0018 lea %sp@(24),%sp 510a0: 6000 fea6 braw 50f48 <_Timer_server_Body+0x6c> <== ALWAYS TAKEN 00050e18 <_Timer_server_Reset_interval_system_watchdog>: } static void _Timer_server_Reset_interval_system_watchdog( Timer_server_Control *ts ) { 50e18: 4e56 0000 linkw %fp,#0 50e1c: 2f0a movel %a2,%sp@- 50e1e: 246e 0008 moveal %fp@(8),%a2 50e22: 2f02 movel %d2,%sp@- static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 50e24: 240a movel %a2,%d2 50e26: 5082 addql #8,%d2 50e28: 2f02 movel %d2,%sp@- 50e2a: 4eb9 0005 4c50 jsr 54c50 <_Watchdog_Remove> { ISR_Level level; _Timer_server_Stop_interval_system_watchdog( ts ); _ISR_Disable( level ); 50e30: 203c 0000 0700 movel #1792,%d0 50e36: 40c1 movew %sr,%d1 50e38: 8081 orl %d1,%d0 50e3a: 46c0 movew %d0,%sr */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 50e3c: 200a movel %a2,%d0 50e3e: 588f addql #4,%sp 50e40: 0680 0000 0034 addil #52,%d0 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 50e46: 206a 0030 moveal %a2@(48),%a0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 50e4a: b088 cmpl %a0,%d0 50e4c: 671c beqs 50e6a <_Timer_server_Reset_interval_system_watchdog+0x52> if ( !_Chain_Is_empty( &ts->Interval_watchdogs.Chain ) ) { Watchdog_Interval delta_interval = _Watchdog_First( &ts->Interval_watchdogs.Chain )->delta_interval; 50e4e: 2028 0010 movel %a0@(16),%d0 _ISR_Enable( level ); 50e52: 46c1 movew %d1,%sr ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 50e54: 2f02 movel %d2,%sp@- 50e56: 4879 0007 4fa0 pea 74fa0 <_Watchdog_Ticks_chain> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 50e5c: 2540 0014 movel %d0,%a2@(20) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 50e60: 4eb9 0005 4b34 jsr 54b34 <_Watchdog_Insert> 50e66: 508f addql #8,%sp 50e68: 6002 bras 50e6c <_Timer_server_Reset_interval_system_watchdog+0x54> <== ALWAYS TAKEN _Watchdog_Insert_ticks( &ts->Interval_watchdogs.System_watchdog, delta_interval ); } else { _ISR_Enable( level ); 50e6a: 46c1 movew %d1,%sr } } 50e6c: 242e fff8 movel %fp@(-8),%d2 50e70: 246e fffc moveal %fp@(-4),%a2 50e74: 4e5e unlk %fp 50e76: 4e75 rts 00050e78 <_Timer_server_Reset_tod_system_watchdog>: } static void _Timer_server_Reset_tod_system_watchdog( Timer_server_Control *ts ) { 50e78: 4e56 0000 linkw %fp,#0 50e7c: 2f0a movel %a2,%sp@- 50e7e: 246e 0008 moveal %fp@(8),%a2 50e82: 2f02 movel %d2,%sp@- static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 50e84: 240a movel %a2,%d2 50e86: 0682 0000 0040 addil #64,%d2 50e8c: 2f02 movel %d2,%sp@- 50e8e: 4eb9 0005 4c50 jsr 54c50 <_Watchdog_Remove> { ISR_Level level; _Timer_server_Stop_tod_system_watchdog( ts ); _ISR_Disable( level ); 50e94: 203c 0000 0700 movel #1792,%d0 50e9a: 40c1 movew %sr,%d1 50e9c: 8081 orl %d1,%d0 50e9e: 46c0 movew %d0,%sr 50ea0: 200a movel %a2,%d0 50ea2: 588f addql #4,%sp 50ea4: 0680 0000 006c addil #108,%d0 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 50eaa: 206a 0068 moveal %a2@(104),%a0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 50eae: b088 cmpl %a0,%d0 50eb0: 671c beqs 50ece <_Timer_server_Reset_tod_system_watchdog+0x56> if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { Watchdog_Interval delta_interval = _Watchdog_First( &ts->TOD_watchdogs.Chain )->delta_interval; 50eb2: 2028 0010 movel %a0@(16),%d0 _ISR_Enable( level ); 50eb6: 46c1 movew %d1,%sr ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Seconds_chain, the_watchdog ); 50eb8: 2f02 movel %d2,%sp@- 50eba: 4879 0007 4f94 pea 74f94 <_Watchdog_Seconds_chain> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 50ec0: 2540 004c movel %d0,%a2@(76) _Watchdog_Insert( &_Watchdog_Seconds_chain, the_watchdog ); 50ec4: 4eb9 0005 4b34 jsr 54b34 <_Watchdog_Insert> 50eca: 508f addql #8,%sp 50ecc: 6002 bras 50ed0 <_Timer_server_Reset_tod_system_watchdog+0x58> <== ALWAYS TAKEN _Watchdog_Insert_seconds( &ts->TOD_watchdogs.System_watchdog, delta_interval ); } else { _ISR_Enable( level ); 50ece: 46c1 movew %d1,%sr } } 50ed0: 242e fff8 movel %fp@(-8),%d2 50ed4: 246e fffc moveal %fp@(-4),%a2 50ed8: 4e5e unlk %fp 50eda: 4e75 rts 000510a4 <_Timer_server_Schedule_operation_method>: static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 510a4: 4e56 fff0 linkw %fp,#-16 510a8: 206e 000c moveal %fp@(12),%a0 510ac: 48d7 041c moveml %d2-%d4/%a2,%sp@ 510b0: 246e 0008 moveal %fp@(8),%a2 if ( ts->insert_chain == NULL ) { 510b4: 202a 0078 movel %a2@(120),%d0 510b8: 6600 00f8 bnew 511b2 <_Timer_server_Schedule_operation_method+0x10e> <== ALWAYS TAKEN 510bc: 2039 0007 4ec8 movel 74ec8 <_Thread_Dispatch_disable_level>,%d0 510c2: 5280 addql #1,%d0 510c4: 23c0 0007 4ec8 movel %d0,74ec8 <_Thread_Dispatch_disable_level> * being inserted. This could result in an integer overflow. */ _Thread_Disable_dispatch(); if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 510ca: 2028 0038 movel %a0@(56),%d0 510ce: 7201 moveq #1,%d1 510d0: b280 cmpl %d0,%d1 510d2: 6660 bnes 51134 <_Timer_server_Schedule_operation_method+0x90> /* * We have to advance the last known ticks value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 510d4: 203c 0000 0700 movel #1792,%d0 510da: 40c3 movew %sr,%d3 510dc: 8083 orl %d3,%d0 510de: 46c0 movew %d0,%sr snapshot = _Watchdog_Ticks_since_boot; 510e0: 2039 0007 500c movel 7500c <_Watchdog_Ticks_since_boot>,%d0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 510e6: 220a movel %a2,%d1 510e8: 0681 0000 0034 addil #52,%d1 last_snapshot = ts->Interval_watchdogs.last_snapshot; 510ee: 242a 003c movel %a2@(60),%d2 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 510f2: 226a 0030 moveal %a2@(48),%a1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 510f6: b289 cmpl %a1,%d1 510f8: 6716 beqs 51110 <_Timer_server_Schedule_operation_method+0x6c> first_watchdog = _Watchdog_First( &ts->Interval_watchdogs.Chain ); /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; 510fa: 2800 movel %d0,%d4 510fc: 9882 subl %d2,%d4 delta_interval = first_watchdog->delta_interval; 510fe: 2229 0010 movel %a1@(16),%d1 if (delta_interval > delta) { 51102: b881 cmpl %d1,%d4 51104: 6504 bcss 5110a <_Timer_server_Schedule_operation_method+0x66> 51106: 4281 clrl %d1 51108: 6002 bras 5110c <_Timer_server_Schedule_operation_method+0x68> <== ALWAYS TAKEN delta_interval -= delta; 5110a: 9284 subl %d4,%d1 } else { delta_interval = 0; } first_watchdog->delta_interval = delta_interval; 5110c: 2341 0010 movel %d1,%a1@(16) } ts->Interval_watchdogs.last_snapshot = snapshot; 51110: 2540 003c movel %d0,%a2@(60) _ISR_Enable( level ); 51114: 46c3 movew %d3,%sr _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 51116: 4868 0010 pea %a0@(16) 5111a: 486a 0030 pea %a2@(48) 5111e: 4eb9 0005 4b34 jsr 54b34 <_Watchdog_Insert> if ( !ts->active ) { 51124: 508f addql #8,%sp 51126: 102a 007c moveb %a2@(124),%d0 5112a: 6678 bnes 511a4 <_Timer_server_Schedule_operation_method+0x100> _Timer_server_Reset_interval_system_watchdog( ts ); 5112c: 2f0a movel %a2,%sp@- 5112e: 4eba fce8 jsr %pc@(50e18 <_Timer_server_Reset_interval_system_watchdog>) 51132: 606e bras 511a2 <_Timer_server_Schedule_operation_method+0xfe> <== ALWAYS TAKEN } } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 51134: 7203 moveq #3,%d1 51136: b280 cmpl %d0,%d1 51138: 666a bnes 511a4 <_Timer_server_Schedule_operation_method+0x100> /* * We have to advance the last known seconds value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 5113a: 203c 0000 0700 movel #1792,%d0 51140: 40c3 movew %sr,%d3 51142: 8083 orl %d3,%d0 51144: 46c0 movew %d0,%sr 51146: 200a movel %a2,%d0 51148: 0680 0000 006c addil #108,%d0 snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 5114e: 2239 0007 4f5a movel 74f5a <_TOD_Now>,%d1 last_snapshot = ts->TOD_watchdogs.last_snapshot; 51154: 242a 0074 movel %a2@(116),%d2 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 51158: 226a 0068 moveal %a2@(104),%a1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 5115c: b089 cmpl %a1,%d0 5115e: 6720 beqs 51180 <_Timer_server_Schedule_operation_method+0xdc> if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; 51160: 2029 0010 movel %a1@(16),%d0 if ( snapshot > last_snapshot ) { 51164: b481 cmpl %d1,%d2 51166: 6410 bccs 51178 <_Timer_server_Schedule_operation_method+0xd4> /* * We advanced in time. */ delta = snapshot - last_snapshot; 51168: 2801 movel %d1,%d4 5116a: 9882 subl %d2,%d4 if (delta_interval > delta) { 5116c: b880 cmpl %d0,%d4 5116e: 6504 bcss 51174 <_Timer_server_Schedule_operation_method+0xd0> <== NEVER TAKEN 51170: 4280 clrl %d0 <== NOT EXECUTED 51172: 6008 bras 5117c <_Timer_server_Schedule_operation_method+0xd8> <== NOT EXECUTED delta_interval -= delta; 51174: 9084 subl %d4,%d0 51176: 6004 bras 5117c <_Timer_server_Schedule_operation_method+0xd8> <== ALWAYS TAKEN } } else { /* * Someone put us in the past. */ delta = last_snapshot - snapshot; 51178: d082 addl %d2,%d0 delta_interval += delta; 5117a: 9081 subl %d1,%d0 } first_watchdog->delta_interval = delta_interval; 5117c: 2340 0010 movel %d0,%a1@(16) } ts->TOD_watchdogs.last_snapshot = snapshot; 51180: 2541 0074 movel %d1,%a2@(116) _ISR_Enable( level ); 51184: 46c3 movew %d3,%sr _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 51186: 4868 0010 pea %a0@(16) 5118a: 486a 0068 pea %a2@(104) 5118e: 4eb9 0005 4b34 jsr 54b34 <_Watchdog_Insert> if ( !ts->active ) { 51194: 508f addql #8,%sp 51196: 102a 007c moveb %a2@(124),%d0 5119a: 6608 bnes 511a4 <_Timer_server_Schedule_operation_method+0x100> _Timer_server_Reset_tod_system_watchdog( ts ); 5119c: 2f0a movel %a2,%sp@- 5119e: 4eba fcd8 jsr %pc@(50e78 <_Timer_server_Reset_tod_system_watchdog>) 511a2: 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 ); } } 511a4: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 511aa: 4e5e unlk %fp if ( !ts->active ) { _Timer_server_Reset_tod_system_watchdog( ts ); } } _Thread_Enable_dispatch(); 511ac: 4ef9 0005 38b6 jmp 538b6 <_Thread_Enable_dispatch> * server is not preemptible, so we must be in interrupt context here. No * thread dispatch will happen until the timer server finishes its * critical section. We have to use the protected chain methods because * we may be interrupted by a higher priority interrupt. */ _Chain_Append( ts->insert_chain, &timer->Object.Node ); 511b2: 202a 0078 movel %a2@(120),%d0 511b6: 2d48 000c movel %a0,%fp@(12) } } 511ba: 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 ); 511c0: 2d40 0008 movel %d0,%fp@(8) } } 511c4: 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 ); 511c6: 4ef9 0005 1880 jmp 51880 <_Chain_Append> 00047964 <_Timespec_Add_to>: uint32_t _Timespec_Add_to( struct timespec *time, const struct timespec *add ) { 47964: 4e56 0000 linkw %fp,#0 47968: 206e 0008 moveal %fp@(8),%a0 4796c: 2f0a movel %a2,%sp@- 4796e: 246e 000c moveal %fp@(12),%a2 uint32_t seconds = add->tv_sec; /* Add the basics */ time->tv_sec += add->tv_sec; time->tv_nsec += add->tv_nsec; 47972: 226a 0004 moveal %a2@(4),%a1 47976: d3e8 0004 addal %a0@(4),%a1 4797a: 2209 movel %a1,%d1 uint32_t _Timespec_Add_to( struct timespec *time, const struct timespec *add ) { uint32_t seconds = add->tv_sec; 4797c: 2012 movel %a2@,%d0 /* Add the basics */ time->tv_sec += add->tv_sec; 4797e: d190 addl %d0,%a0@ time->tv_nsec += add->tv_nsec; 47980: 2149 0004 movel %a1,%a0@(4) /* Now adjust it so nanoseconds is in range */ while ( time->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 47984: 600a bras 47990 <_Timespec_Add_to+0x2c> <== ALWAYS TAKEN time->tv_nsec -= TOD_NANOSECONDS_PER_SECOND; time->tv_sec++; 47986: 5290 addql #1,%a0@ seconds++; 47988: 5280 addql #1,%d0 4798a: 0681 c465 3600 addil #-1000000000,%d1 /* Add the basics */ time->tv_sec += add->tv_sec; time->tv_nsec += add->tv_nsec; /* Now adjust it so nanoseconds is in range */ while ( time->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 47990: 0c81 3b9a c9ff cmpil #999999999,%d1 47996: 62ee bhis 47986 <_Timespec_Add_to+0x22> time->tv_sec++; seconds++; } return seconds; } 47998: 245f moveal %sp@+,%a2 4799a: 4e5e unlk %fp /* Add the basics */ time->tv_sec += add->tv_sec; time->tv_nsec += add->tv_nsec; /* Now adjust it so nanoseconds is in range */ while ( time->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 4799c: 2141 0004 movel %d1,%a0@(4) time->tv_sec++; seconds++; } return seconds; } 479a0: 4e75 rts ... 00048dc8 <_Timespec_Divide>: const struct timespec *lhs, const struct timespec *rhs, uint32_t *ival_percentage, uint32_t *fval_percentage ) { 48dc8: 4e56 ffdc linkw %fp,#-36 48dcc: 206e 0008 moveal %fp@(8),%a0 48dd0: 48d7 3c7c moveml %d2-%d6/%a2-%a5,%sp@ * For math simplicity just convert the timespec to nanoseconds * in a 64-bit integer. */ left = lhs->tv_sec * (uint64_t)TOD_NANOSECONDS_PER_SECOND; left += lhs->tv_nsec; right = rhs->tv_sec * (uint64_t)TOD_NANOSECONDS_PER_SECOND; 48dd4: 2f3c 3b9a ca00 movel #1000000000,%sp@- const struct timespec *lhs, const struct timespec *rhs, uint32_t *ival_percentage, uint32_t *fval_percentage ) { 48dda: 266e 000c moveal %fp@(12),%a3 * For math simplicity just convert the timespec to nanoseconds * in a 64-bit integer. */ left = lhs->tv_sec * (uint64_t)TOD_NANOSECONDS_PER_SECOND; left += lhs->tv_nsec; right = rhs->tv_sec * (uint64_t)TOD_NANOSECONDS_PER_SECOND; 48dde: 45f9 0005 a12c lea 5a12c <__muldi3>,%a2 48de4: 42a7 clrl %sp@- /* * For math simplicity just convert the timespec to nanoseconds * in a 64-bit integer. */ left = lhs->tv_sec * (uint64_t)TOD_NANOSECONDS_PER_SECOND; left += lhs->tv_nsec; 48de6: 2428 0004 movel %a0@(4),%d2 right = rhs->tv_sec * (uint64_t)TOD_NANOSECONDS_PER_SECOND; 48dea: 2f13 movel %a3@,%sp@- 48dec: 5bc0 smi %d0 48dee: 49c0 extbl %d0 48df0: 2f00 movel %d0,%sp@- /* * For math simplicity just convert the timespec to nanoseconds * in a 64-bit integer. */ left = lhs->tv_sec * (uint64_t)TOD_NANOSECONDS_PER_SECOND; 48df2: 2a10 movel %a0@,%d5 left += lhs->tv_nsec; right = rhs->tv_sec * (uint64_t)TOD_NANOSECONDS_PER_SECOND; 48df4: 4e92 jsr %a2@ const struct timespec *lhs, const struct timespec *rhs, uint32_t *ival_percentage, uint32_t *fval_percentage ) { 48df6: 286e 0010 moveal %fp@(16),%a4 * For math simplicity just convert the timespec to nanoseconds * in a 64-bit integer. */ left = lhs->tv_sec * (uint64_t)TOD_NANOSECONDS_PER_SECOND; left += lhs->tv_nsec; right = rhs->tv_sec * (uint64_t)TOD_NANOSECONDS_PER_SECOND; 48dfa: 2040 moveal %d0,%a0 48dfc: 2241 moveal %d1,%a1 48dfe: 4fef 0010 lea %sp@(16),%sp right += rhs->tv_nsec; 48e02: 282b 0004 movel %a3@(4),%d4 48e06: 5bc3 smi %d3 48e08: 49c3 extbl %d3 const struct timespec *lhs, const struct timespec *rhs, uint32_t *ival_percentage, uint32_t *fval_percentage ) { 48e0a: 266e 0014 moveal %fp@(20),%a3 * in a 64-bit integer. */ left = lhs->tv_sec * (uint64_t)TOD_NANOSECONDS_PER_SECOND; left += lhs->tv_nsec; right = rhs->tv_sec * (uint64_t)TOD_NANOSECONDS_PER_SECOND; right += rhs->tv_nsec; 48e0e: 2c08 movel %a0,%d6 48e10: d889 addl %a1,%d4 48e12: d786 addxl %d6,%d3 if ( right == 0 ) { 48e14: 6606 bnes 48e1c <_Timespec_Divide+0x54> *ival_percentage = 0; 48e16: 4294 clrl %a4@ *fval_percentage = 0; 48e18: 4293 clrl %a3@ return; 48e1a: 607a bras 48e96 <_Timespec_Divide+0xce> <== ALWAYS TAKEN * Put it back in the timespec result. * * TODO: Rounding on the last digit of the fval. */ answer = (left * 100000) / right; 48e1c: 4bf9 0005 a194 lea 5a194 <__udivdi3>,%a5 /* * For math simplicity just convert the timespec to nanoseconds * in a 64-bit integer. */ left = lhs->tv_sec * (uint64_t)TOD_NANOSECONDS_PER_SECOND; 48e22: 2f3c 3b9a ca00 movel #1000000000,%sp@- 48e28: 42a7 clrl %sp@- 48e2a: 2f05 movel %d5,%sp@- 48e2c: 5bc6 smi %d6 48e2e: 49c6 extbl %d6 48e30: 2f06 movel %d6,%sp@- 48e32: 4e92 jsr %a2@ 48e34: 4fef 0010 lea %sp@(16),%sp 48e38: 2040 moveal %d0,%a0 48e3a: 2241 moveal %d1,%a1 * Put it back in the timespec result. * * TODO: Rounding on the last digit of the fval. */ answer = (left * 100000) / right; 48e3c: 2f3c 0001 86a0 movel #100000,%sp@- 48e42: 2a08 movel %a0,%d5 48e44: 2c09 movel %a1,%d6 48e46: 2202 movel %d2,%d1 48e48: 5bc0 smi %d0 48e4a: 49c0 extbl %d0 48e4c: 42a7 clrl %sp@- 48e4e: dc81 addl %d1,%d6 48e50: db80 addxl %d0,%d5 48e52: 2f06 movel %d6,%sp@- 48e54: 2f05 movel %d5,%sp@- 48e56: 4e92 jsr %a2@ 48e58: 4fef 000c lea %sp@(12),%sp 48e5c: 2e84 movel %d4,%sp@ 48e5e: 2f03 movel %d3,%sp@- 48e60: 2f01 movel %d1,%sp@- 48e62: 2f00 movel %d0,%sp@- 48e64: 4e95 jsr %a5@ 48e66: 4fef 0010 lea %sp@(16),%sp 48e6a: 2400 movel %d0,%d2 *ival_percentage = answer / 1000; 48e6c: 4878 03e8 pea 3e8 * Put it back in the timespec result. * * TODO: Rounding on the last digit of the fval. */ answer = (left * 100000) / right; 48e70: 2601 movel %d1,%d3 *ival_percentage = answer / 1000; 48e72: 42a7 clrl %sp@- 48e74: 2f01 movel %d1,%sp@- 48e76: 2f02 movel %d2,%sp@- 48e78: 4e95 jsr %a5@ 48e7a: 4fef 0010 lea %sp@(16),%sp *fval_percentage = answer % 1000; 48e7e: 4878 03e8 pea 3e8 48e82: 42a7 clrl %sp@- * TODO: Rounding on the last digit of the fval. */ answer = (left * 100000) / right; *ival_percentage = answer / 1000; 48e84: 2881 movel %d1,%a4@ *fval_percentage = answer % 1000; 48e86: 2f03 movel %d3,%sp@- 48e88: 2f02 movel %d2,%sp@- 48e8a: 4eb9 0005 a530 jsr 5a530 <__umoddi3> 48e90: 4fef 0010 lea %sp@(16),%sp 48e94: 2681 movel %d1,%a3@ } 48e96: 4cee 3c7c ffdc moveml %fp@(-36),%d2-%d6/%a2-%a5 48e9c: 4e5e unlk %fp 48e9e: 4e75 rts 00072238 <_Timespec_Greater_than>: bool _Timespec_Greater_than( const struct timespec *lhs, const struct timespec *rhs ) { 72238: 4e56 0000 linkw %fp,#0 7223c: 226e 0008 moveal %fp@(8),%a1 72240: 206e 000c moveal %fp@(12),%a0 if ( lhs->tv_sec > rhs->tv_sec ) 72244: 2211 movel %a1@,%d1 72246: 2010 movel %a0@,%d0 72248: b081 cmpl %d1,%d0 7224a: 6c04 bges 72250 <_Timespec_Greater_than+0x18> 7224c: 7001 moveq #1,%d0 7224e: 6014 bras 72264 <_Timespec_Greater_than+0x2c> <== ALWAYS TAKEN return true; if ( lhs->tv_sec < rhs->tv_sec ) 72250: b081 cmpl %d1,%d0 72252: 6f04 bles 72258 <_Timespec_Greater_than+0x20> 72254: 4200 clrb %d0 72256: 600c bras 72264 <_Timespec_Greater_than+0x2c> <== ALWAYS TAKEN #include #include #include bool _Timespec_Greater_than( 72258: 2068 0004 moveal %a0@(4),%a0 7225c: b1e9 0004 cmpal %a1@(4),%a0 72260: 5dc0 slt %d0 72262: 4480 negl %d0 /* ASSERT: lhs->tv_sec == rhs->tv_sec */ if ( lhs->tv_nsec > rhs->tv_nsec ) return true; return false; } 72264: 4e5e unlk %fp 72266: 4e75 rts 00062584 <_Timespec_Is_valid>: #include bool _Timespec_Is_valid( const struct timespec *time ) { 62584: 4e56 0000 linkw %fp,#0 62588: 206e 0008 moveal %fp@(8),%a0 if ( !time ) 6258c: 4a88 tstl %a0 6258e: 6716 beqs 625a6 <_Timespec_Is_valid+0x22> return false; if ( time->tv_sec < 0 ) 62590: 4a90 tstl %a0@ 62592: 6d12 blts 625a6 <_Timespec_Is_valid+0x22> return false; if ( time->tv_nsec < 0 ) 62594: 2028 0004 movel %a0@(4),%d0 62598: 6d0c blts 625a6 <_Timespec_Is_valid+0x22> #include #include #include bool _Timespec_Is_valid( 6259a: 0c80 3b9a c9ff cmpil #999999999,%d0 625a0: 53c0 sls %d0 625a2: 4480 negl %d0 625a4: 6002 bras 625a8 <_Timespec_Is_valid+0x24> <== ALWAYS TAKEN 625a6: 4200 clrb %d0 if ( time->tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) return false; return true; } 625a8: 4e5e unlk %fp 625aa: 4e75 rts 00072268 <_Timespec_Less_than>: bool _Timespec_Less_than( const struct timespec *lhs, const struct timespec *rhs ) { 72268: 4e56 0000 linkw %fp,#0 7226c: 226e 0008 moveal %fp@(8),%a1 72270: 206e 000c moveal %fp@(12),%a0 if ( lhs->tv_sec < rhs->tv_sec ) 72274: 2211 movel %a1@,%d1 72276: 2010 movel %a0@,%d0 72278: b081 cmpl %d1,%d0 7227a: 6f04 bles 72280 <_Timespec_Less_than+0x18> 7227c: 7001 moveq #1,%d0 7227e: 6014 bras 72294 <_Timespec_Less_than+0x2c> <== ALWAYS TAKEN return true; if ( lhs->tv_sec > rhs->tv_sec ) 72280: b081 cmpl %d1,%d0 72282: 6c04 bges 72288 <_Timespec_Less_than+0x20> 72284: 4200 clrb %d0 72286: 600c bras 72294 <_Timespec_Less_than+0x2c> <== ALWAYS TAKEN #include #include #include bool _Timespec_Less_than( 72288: 2068 0004 moveal %a0@(4),%a0 7228c: b1e9 0004 cmpal %a1@(4),%a0 72290: 5ec0 sgt %d0 72292: 4480 negl %d0 /* ASSERT: lhs->tv_sec == rhs->tv_sec */ if ( lhs->tv_nsec < rhs->tv_nsec ) return true; return false; } 72294: 4e5e unlk %fp 72296: 4e75 rts 000479a4 <_Timespec_Subtract>: void _Timespec_Subtract( const struct timespec *start, const struct timespec *end, struct timespec *result ) { 479a4: 4e56 0000 linkw %fp,#0 479a8: 206e 0008 moveal %fp@(8),%a0 479ac: 2f0a movel %a2,%sp@- 479ae: 226e 000c moveal %fp@(12),%a1 479b2: 246e 0010 moveal %fp@(16),%a2 if (end->tv_nsec < start->tv_nsec) { 479b6: 2028 0004 movel %a0@(4),%d0 479ba: b0a9 0004 cmpl %a1@(4),%d0 479be: 6f14 bles 479d4 <_Timespec_Subtract+0x30> result->tv_sec = end->tv_sec - start->tv_sec - 1; 479c0: 2211 movel %a1@,%d1 479c2: 5381 subql #1,%d1 479c4: 9290 subl %a0@,%d1 result->tv_nsec = 479c6: 2029 0004 movel %a1@(4),%d0 479ca: 0680 3b9a ca00 addil #1000000000,%d0 struct timespec *result ) { if (end->tv_nsec < start->tv_nsec) { result->tv_sec = end->tv_sec - start->tv_sec - 1; 479d0: 2481 movel %d1,%a2@ 479d2: 600a bras 479de <_Timespec_Subtract+0x3a> <== ALWAYS TAKEN result->tv_nsec = (TOD_NANOSECONDS_PER_SECOND - start->tv_nsec) + end->tv_nsec; } else { result->tv_sec = end->tv_sec - start->tv_sec; 479d4: 2011 movel %a1@,%d0 479d6: 9090 subl %a0@,%d0 479d8: 2480 movel %d0,%a2@ result->tv_nsec = end->tv_nsec - start->tv_nsec; 479da: 2029 0004 movel %a1@(4),%d0 479de: 90a8 0004 subl %a0@(4),%d0 479e2: 2540 0004 movel %d0,%a2@(4) } } 479e6: 245f moveal %sp@+,%a2 479e8: 4e5e unlk %fp 479ea: 4e75 rts 0004ab08 <_Timespec_To_ticks>: */ uint32_t _Timespec_To_ticks( const struct timespec *time ) { 4ab08: 4e56 fff4 linkw %fp,#-12 4ab0c: 48d7 040c moveml %d2-%d3/%a2,%sp@ 4ab10: 246e 0008 moveal %fp@(8),%a2 uint32_t ticks; if ( (time->tv_sec == 0) && (time->tv_nsec == 0) ) 4ab14: 2412 movel %a2@,%d2 4ab16: 660a bnes 4ab22 <_Timespec_To_ticks+0x1a> 4ab18: 4aaa 0004 tstl %a2@(4) 4ab1c: 6604 bnes 4ab22 <_Timespec_To_ticks+0x1a> 4ab1e: 4280 clrl %d0 4ab20: 602a bras 4ab4c <_Timespec_To_ticks+0x44> <== ALWAYS TAKEN return 0; ticks = time->tv_sec * TOD_TICKS_PER_SECOND; 4ab22: 4eb9 0004 c24c jsr 4c24c ticks += time->tv_nsec / rtems_configuration_get_nanoseconds_per_tick(); 4ab28: 2239 0005 b720 movel 5b720 ,%d1 4ab2e: 263c 0000 03e8 movel #1000,%d3 4ab34: 4c03 1800 mulsl %d3,%d1 uint32_t ticks; if ( (time->tv_sec == 0) && (time->tv_nsec == 0) ) return 0; ticks = time->tv_sec * TOD_TICKS_PER_SECOND; 4ab38: 4c02 0800 mulsl %d2,%d0 ticks += time->tv_nsec / rtems_configuration_get_nanoseconds_per_tick(); 4ab3c: 262a 0004 movel %a2@(4),%d3 4ab40: 4c41 3003 remul %d1,%d3,%d3 4ab44: d083 addl %d3,%d0 if (ticks) 4ab46: 6604 bnes 4ab4c <_Timespec_To_ticks+0x44> 4ab48: 103c 0001 moveb #1,%d0 return ticks; return 1; } 4ab4c: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 4ab52: 4e5e unlk %fp 4ab54: 4e75 rts ... 00047b0e <_User_extensions_Fatal>: void _User_extensions_Fatal ( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 47b0e: 4e56 fff0 linkw %fp,#-16 47b12: 48d7 041c moveml %d2-%d4/%a2,%sp@ 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 ); 47b16: 4282 clrl %d2 47b18: 142e 000f moveb %fp@(15),%d2 void _User_extensions_Fatal ( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 47b1c: 282e 0008 movel %fp@(8),%d4 47b20: 262e 0010 movel %fp@(16),%d3 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 47b24: 2479 0005 d060 moveal 5d060 <_User_extensions_List+0x8>,%a2 47b2a: 6018 bras 47b44 <_User_extensions_Fatal+0x36> <== 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.fatal != NULL ) 47b2c: 206a 0030 moveal %a2@(48),%a0 47b30: 4a88 tstl %a0 47b32: 670c beqs 47b40 <_User_extensions_Fatal+0x32> (*the_extension->Callouts.fatal)( the_source, is_internal, the_error ); 47b34: 2f03 movel %d3,%sp@- 47b36: 2f02 movel %d2,%sp@- 47b38: 2f04 movel %d4,%sp@- 47b3a: 4e90 jsr %a0@ 47b3c: 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 ) { 47b40: 246a 0004 moveal %a2@(4),%a2 { Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; !_Chain_Is_head( &_User_extensions_List, the_node ) ; 47b44: b5fc 0005 d058 cmpal #381016,%a2 47b4a: 66e0 bnes 47b2c <_User_extensions_Fatal+0x1e> the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.fatal != NULL ) (*the_extension->Callouts.fatal)( the_source, is_internal, the_error ); } } 47b4c: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 47b52: 4e5e unlk %fp 47b54: 4e75 rts ... 000479ec <_User_extensions_Handler_initialization>: #include #include #include void _User_extensions_Handler_initialization(void) { 479ec: 4e56 ffe4 linkw %fp,#-28 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 479f0: 203c 0005 d05c movel #381020,%d0 479f6: 23c0 0005 d058 movel %d0,5d058 <_User_extensions_List> the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 479fc: 203c 0005 d058 movel #381016,%d0 47a02: 23c0 0005 d060 movel %d0,5d060 <_User_extensions_List+0x8> */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 47a08: 203c 0005 cecc movel #380620,%d0 47a0e: 23c0 0005 cec8 movel %d0,5cec8 <_User_extensions_Switches_list> the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 47a14: 203c 0005 cec8 movel #380616,%d0 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 47a1a: 42b9 0005 d05c clrl 5d05c <_User_extensions_List+0x4> 47a20: 48d7 1c3c moveml %d2-%d5/%a2-%a4,%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; 47a24: 2a39 0005 b74a movel 5b74a ,%d5 initial_extensions = Configuration.User_extension_table; 47a2a: 2639 0005 b74e movel 5b74e ,%d3 47a30: 42b9 0005 cecc clrl 5cecc <_User_extensions_Switches_list+0x4> the_chain->last = _Chain_Head(the_chain); 47a36: 23c0 0005 ced0 movel %d0,5ced0 <_User_extensions_Switches_list+0x8> _Chain_Initialize_empty( &_User_extensions_List ); _Chain_Initialize_empty( &_User_extensions_Switches_list ); if ( initial_extensions ) { 47a3c: 4a83 tstl %d3 47a3e: 6750 beqs 47a90 <_User_extensions_Handler_initialization+0xa4> extension = (User_extensions_Control *) 47a40: 7834 moveq #52,%d4 47a42: 4c05 4800 mulsl %d5,%d4 _Workspace_Allocate_or_fatal_error( number_of_extensions * sizeof( User_extensions_Control ) ); memset ( 47a46: 4282 clrl %d2 RTEMS_INLINE_ROUTINE void _User_extensions_Add_set_with_table( User_extensions_Control *extension, const User_extensions_Table *extension_table ) { extension->Callouts = *extension_table; 47a48: 49f9 0004 d478 lea 4d478 ,%a4 _User_extensions_Add_set( extension ); 47a4e: 47f9 0004 ab58 lea 4ab58 <_User_extensions_Add_set>,%a3 _Chain_Initialize_empty( &_User_extensions_List ); _Chain_Initialize_empty( &_User_extensions_Switches_list ); if ( initial_extensions ) { extension = (User_extensions_Control *) 47a54: 2f04 movel %d4,%sp@- 47a56: 4eb9 0004 7e68 jsr 47e68 <_Workspace_Allocate_or_fatal_error> 47a5c: 2440 moveal %d0,%a2 _Workspace_Allocate_or_fatal_error( number_of_extensions * sizeof( User_extensions_Control ) ); memset ( 47a5e: 2f04 movel %d4,%sp@- 47a60: 42a7 clrl %sp@- 47a62: 2f00 movel %d0,%sp@- 47a64: 4eb9 0004 d4e8 jsr 4d4e8 47a6a: 601c bras 47a88 <_User_extensions_Handler_initialization+0x9c> <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE void _User_extensions_Add_set_with_table( User_extensions_Control *extension, const User_extensions_Table *extension_table ) { extension->Callouts = *extension_table; 47a6c: 4878 0020 pea 20 extension, 0, number_of_extensions * sizeof( User_extensions_Control ) ); for ( i = 0 ; i < number_of_extensions ; i++ ) { 47a70: 5282 addql #1,%d2 47a72: 2f03 movel %d3,%sp@- 47a74: 486a 0014 pea %a2@(20) 47a78: 0683 0000 0020 addil #32,%d3 47a7e: 4e94 jsr %a4@ _User_extensions_Add_set( extension ); 47a80: 2f0a movel %a2,%sp@- _User_extensions_Add_set_with_table (extension, &initial_extensions[i]); extension++; 47a82: 45ea 0034 lea %a2@(52),%a2 47a86: 4e93 jsr %a3@ extension, 0, number_of_extensions * sizeof( User_extensions_Control ) ); for ( i = 0 ; i < number_of_extensions ; i++ ) { 47a88: 4fef 0010 lea %sp@(16),%sp 47a8c: ba82 cmpl %d2,%d5 47a8e: 62dc bhis 47a6c <_User_extensions_Handler_initialization+0x80> _User_extensions_Add_set_with_table (extension, &initial_extensions[i]); extension++; } } } 47a90: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4 47a96: 4e5e unlk %fp 47a98: 4e75 rts ... 00047a9c <_User_extensions_Thread_begin>: #include void _User_extensions_Thread_begin ( Thread_Control *executing ) { 47a9c: 4e56 0000 linkw %fp,#0 47aa0: 2f0a movel %a2,%sp@- Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.first ; 47aa2: 2479 0005 d058 moveal 5d058 <_User_extensions_List>,%a2 #include void _User_extensions_Thread_begin ( Thread_Control *executing ) { 47aa8: 2f02 movel %d2,%sp@- 47aaa: 242e 0008 movel %fp@(8),%d2 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.first ; 47aae: 6010 bras 47ac0 <_User_extensions_Thread_begin+0x24> <== 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 ) 47ab0: 206a 0028 moveal %a2@(40),%a0 47ab4: 4a88 tstl %a0 47ab6: 6706 beqs 47abe <_User_extensions_Thread_begin+0x22> (*the_extension->Callouts.thread_begin)( executing ); 47ab8: 2f02 movel %d2,%sp@- 47aba: 4e90 jsr %a0@ 47abc: 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 ) { 47abe: 2452 moveal %a2@,%a2 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 47ac0: b5fc 0005 d05c cmpal #381020,%a2 47ac6: 66e8 bnes 47ab0 <_User_extensions_Thread_begin+0x14> the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_begin != NULL ) (*the_extension->Callouts.thread_begin)( executing ); } } 47ac8: 242e fff8 movel %fp@(-8),%d2 47acc: 246e fffc moveal %fp@(-4),%a2 47ad0: 4e5e unlk %fp 47ad2: 4e75 rts 00047b58 <_User_extensions_Thread_create>: #include bool _User_extensions_Thread_create ( Thread_Control *the_thread ) { 47b58: 4e56 0000 linkw %fp,#0 47b5c: 2f0a movel %a2,%sp@- Chain_Node *the_node; User_extensions_Control *the_extension; bool status; for ( the_node = _User_extensions_List.first ; 47b5e: 2479 0005 d058 moveal 5d058 <_User_extensions_List>,%a2 #include bool _User_extensions_Thread_create ( Thread_Control *the_thread ) { 47b64: 2f02 movel %d2,%sp@- 47b66: 242e 0008 movel %fp@(8),%d2 Chain_Node *the_node; User_extensions_Control *the_extension; bool status; for ( the_node = _User_extensions_List.first ; 47b6a: 601a bras 47b86 <_User_extensions_Thread_create+0x2e> <== 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 ) { 47b6c: 206a 0014 moveal %a2@(20),%a0 47b70: 4a88 tstl %a0 47b72: 6710 beqs 47b84 <_User_extensions_Thread_create+0x2c> status = (*the_extension->Callouts.thread_create)( 47b74: 2f02 movel %d2,%sp@- 47b76: 2f39 0005 cf7e movel 5cf7e <_Thread_Executing>,%sp@- 47b7c: 4e90 jsr %a0@ _Thread_Executing, the_thread ); if ( !status ) 47b7e: 508f addql #8,%sp 47b80: 4a00 tstb %d0 47b82: 670c beqs 47b90 <_User_extensions_Thread_create+0x38> 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 ) { 47b84: 2452 moveal %a2@,%a2 47b86: b5fc 0005 d05c cmpal #381020,%a2 47b8c: 66de bnes 47b6c <_User_extensions_Thread_create+0x14> 47b8e: 7001 moveq #1,%d0 return false; } } return true; } 47b90: 242e fff8 movel %fp@(-8),%d2 47b94: 246e fffc moveal %fp@(-4),%a2 47b98: 4e5e unlk %fp 47b9a: 4e75 rts 00047b9c <_User_extensions_Thread_delete>: #include void _User_extensions_Thread_delete ( Thread_Control *the_thread ) { 47b9c: 4e56 0000 linkw %fp,#0 47ba0: 2f0a movel %a2,%sp@- Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 47ba2: 2479 0005 d060 moveal 5d060 <_User_extensions_List+0x8>,%a2 #include void _User_extensions_Thread_delete ( Thread_Control *the_thread ) { 47ba8: 2f02 movel %d2,%sp@- 47baa: 242e 0008 movel %fp@(8),%d2 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 47bae: 6018 bras 47bc8 <_User_extensions_Thread_delete+0x2c> <== 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 ) 47bb0: 206a 0020 moveal %a2@(32),%a0 47bb4: 4a88 tstl %a0 47bb6: 670c beqs 47bc4 <_User_extensions_Thread_delete+0x28> (*the_extension->Callouts.thread_delete)( 47bb8: 2f02 movel %d2,%sp@- 47bba: 2f39 0005 cf7e movel 5cf7e <_Thread_Executing>,%sp@- 47bc0: 4e90 jsr %a0@ 47bc2: 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 ) { 47bc4: 246a 0004 moveal %a2@(4),%a2 { Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; !_Chain_Is_head( &_User_extensions_List, the_node ) ; 47bc8: b5fc 0005 d058 cmpal #381016,%a2 47bce: 66e0 bnes 47bb0 <_User_extensions_Thread_delete+0x14> (*the_extension->Callouts.thread_delete)( _Thread_Executing, the_thread ); } } 47bd0: 242e fff8 movel %fp@(-8),%d2 47bd4: 246e fffc moveal %fp@(-4),%a2 47bd8: 4e5e unlk %fp 47bda: 4e75 rts 00047ad4 <_User_extensions_Thread_exitted>: void _User_extensions_Thread_exitted ( Thread_Control *executing ) { 47ad4: 4e56 0000 linkw %fp,#0 47ad8: 2f0a movel %a2,%sp@- Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 47ada: 2479 0005 d060 moveal 5d060 <_User_extensions_List+0x8>,%a2 } void _User_extensions_Thread_exitted ( Thread_Control *executing ) { 47ae0: 2f02 movel %d2,%sp@- 47ae2: 242e 0008 movel %fp@(8),%d2 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; 47ae6: 6012 bras 47afa <_User_extensions_Thread_exitted+0x26> <== 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 ) 47ae8: 206a 002c moveal %a2@(44),%a0 47aec: 4a88 tstl %a0 47aee: 6706 beqs 47af6 <_User_extensions_Thread_exitted+0x22> (*the_extension->Callouts.thread_exitted)( executing ); 47af0: 2f02 movel %d2,%sp@- 47af2: 4e90 jsr %a0@ 47af4: 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 ) { 47af6: 246a 0004 moveal %a2@(4),%a2 { Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.last ; !_Chain_Is_head( &_User_extensions_List, the_node ) ; 47afa: b5fc 0005 d058 cmpal #381016,%a2 47b00: 66e6 bnes 47ae8 <_User_extensions_Thread_exitted+0x14> the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.thread_exitted != NULL ) (*the_extension->Callouts.thread_exitted)( executing ); } } 47b02: 242e fff8 movel %fp@(-8),%d2 47b06: 246e fffc moveal %fp@(-4),%a2 47b0a: 4e5e unlk %fp 47b0c: 4e75 rts 00048378 <_User_extensions_Thread_restart>: #include void _User_extensions_Thread_restart ( Thread_Control *the_thread ) { 48378: 4e56 0000 linkw %fp,#0 4837c: 2f0a movel %a2,%sp@- Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.first ; 4837e: 2479 0005 dae0 moveal 5dae0 <_User_extensions_List>,%a2 #include void _User_extensions_Thread_restart ( Thread_Control *the_thread ) { 48384: 2f02 movel %d2,%sp@- 48386: 242e 0008 movel %fp@(8),%d2 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.first ; 4838a: 6016 bras 483a2 <_User_extensions_Thread_restart+0x2a> <== 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 ) 4838c: 206a 001c moveal %a2@(28),%a0 48390: 4a88 tstl %a0 48392: 670c beqs 483a0 <_User_extensions_Thread_restart+0x28> (*the_extension->Callouts.thread_restart)( 48394: 2f02 movel %d2,%sp@- 48396: 2f39 0005 da06 movel 5da06 <_Thread_Executing>,%sp@- 4839c: 4e90 jsr %a0@ 4839e: 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 ) { 483a0: 2452 moveal %a2@,%a2 483a2: b5fc 0005 dae4 cmpal #383716,%a2 483a8: 66e2 bnes 4838c <_User_extensions_Thread_restart+0x14> (*the_extension->Callouts.thread_restart)( _Thread_Executing, the_thread ); } } 483aa: 242e fff8 movel %fp@(-8),%d2 483ae: 246e fffc moveal %fp@(-4),%a2 483b2: 4e5e unlk %fp 483b4: 4e75 rts ... 00047bdc <_User_extensions_Thread_start>: #include void _User_extensions_Thread_start ( Thread_Control *the_thread ) { 47bdc: 4e56 0000 linkw %fp,#0 47be0: 2f0a movel %a2,%sp@- Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.first ; 47be2: 2479 0005 d058 moveal 5d058 <_User_extensions_List>,%a2 #include void _User_extensions_Thread_start ( Thread_Control *the_thread ) { 47be8: 2f02 movel %d2,%sp@- 47bea: 242e 0008 movel %fp@(8),%d2 Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _User_extensions_List.first ; 47bee: 6016 bras 47c06 <_User_extensions_Thread_start+0x2a> <== 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 ) 47bf0: 206a 0018 moveal %a2@(24),%a0 47bf4: 4a88 tstl %a0 47bf6: 670c beqs 47c04 <_User_extensions_Thread_start+0x28> (*the_extension->Callouts.thread_start)( 47bf8: 2f02 movel %d2,%sp@- 47bfa: 2f39 0005 cf7e movel 5cf7e <_Thread_Executing>,%sp@- 47c00: 4e90 jsr %a0@ 47c02: 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 ) { 47c04: 2452 moveal %a2@,%a2 47c06: b5fc 0005 d05c cmpal #381020,%a2 47c0c: 66e2 bnes 47bf0 <_User_extensions_Thread_start+0x14> (*the_extension->Callouts.thread_start)( _Thread_Executing, the_thread ); } } 47c0e: 242e fff8 movel %fp@(-8),%d2 47c12: 246e fffc moveal %fp@(-4),%a2 47c16: 4e5e unlk %fp 47c18: 4e75 rts ... 00047c1c <_User_extensions_Thread_switch>: void _User_extensions_Thread_switch ( Thread_Control *executing, Thread_Control *heir ) { 47c1c: 4e56 fff4 linkw %fp,#-12 47c20: 48d7 040c moveml %d2-%d3/%a2,%sp@ 47c24: 262e 0008 movel %fp@(8),%d3 47c28: 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 ; 47c2c: 2479 0005 cec8 moveal 5cec8 <_User_extensions_Switches_list>,%a2 47c32: 600e bras 47c42 <_User_extensions_Thread_switch+0x26> <== 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 ); 47c34: 2f02 movel %d2,%sp@- 47c36: 2f03 movel %d3,%sp@- 47c38: 206a 0008 moveal %a2@(8),%a0 47c3c: 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 ) { 47c3e: 2452 moveal %a2@,%a2 47c40: 508f addql #8,%sp 47c42: b5fc 0005 cecc cmpal #380620,%a2 47c48: 66ea bnes 47c34 <_User_extensions_Thread_switch+0x18> the_extension_switch = (User_extensions_Switch_control *) the_node; (*the_extension_switch->thread_switch)( executing, heir ); } } 47c4a: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 47c50: 4e5e unlk %fp 47c52: 4e75 rts 00049194 <_Watchdog_Adjust>: Watchdog_Interval units ) { ISR_Level level; _ISR_Disable( level ); 49194: 327c 0700 moveaw #1792,%a1 49198: 2209 movel %a1,%d1 void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 4919a: 4e56 ffe8 linkw %fp,#-24 4919e: 48d7 1c1c moveml %d2-%d4/%a2-%a4,%sp@ 491a2: 266e 0008 moveal %fp@(8),%a3 491a6: 262e 000c movel %fp@(12),%d3 491aa: 242e 0010 movel %fp@(16),%d2 ISR_Level level; _ISR_Disable( level ); 491ae: 40c0 movew %sr,%d0 491b0: 8280 orl %d0,%d1 491b2: 46c1 movew %d1,%sr */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 491b4: 244b moveal %a3,%a2 491b6: 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 ) ) { 491b8: b5c8 cmpal %a0,%a2 491ba: 674c beqs 49208 <_Watchdog_Adjust+0x74> switch ( direction ) { 491bc: 4a83 tstl %d3 491be: 673c beqs 491fc <_Watchdog_Adjust+0x68> 491c0: 7201 moveq #1,%d1 491c2: b283 cmpl %d3,%d1 491c4: 6642 bnes 49208 <_Watchdog_Adjust+0x74> <== ALWAYS TAKEN case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; 491c6: d5a8 0010 addl %d2,%a0@(16) break; 491ca: 603c bras 49208 <_Watchdog_Adjust+0x74> <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First( Chain_Control *header ) { return ( (Watchdog_Control *) header->first ); 491cc: 2053 moveal %a3@,%a0 case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { 491ce: 2628 0010 movel %a0@(16),%d3 491d2: b682 cmpl %d2,%d3 491d4: 6308 blss 491de <_Watchdog_Adjust+0x4a> _Watchdog_First( header )->delta_interval -= units; 491d6: 9682 subl %d2,%d3 491d8: 2143 0010 movel %d3,%a0@(16) break; 491dc: 602a bras 49208 <_Watchdog_Adjust+0x74> <== ALWAYS TAKEN } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; 491de: 7201 moveq #1,%d1 491e0: 2141 0010 movel %d1,%a0@(16) _ISR_Enable( level ); 491e4: 46c0 movew %d0,%sr _Watchdog_Tickle( header ); 491e6: 2f0b movel %a3,%sp@- 491e8: 4e94 jsr %a4@ _ISR_Disable( level ); 491ea: 2204 movel %d4,%d1 491ec: 40c0 movew %sr,%d0 491ee: 8280 orl %d0,%d1 491f0: 46c1 movew %d1,%sr while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; 491f2: 9483 subl %d3,%d2 _Watchdog_Tickle( header ); _ISR_Disable( level ); if ( _Chain_Is_empty( header ) ) 491f4: 588f addql #4,%sp 491f6: b5d3 cmpal %a3@,%a2 491f8: 660a bnes 49204 <_Watchdog_Adjust+0x70> 491fa: 600c bras 49208 <_Watchdog_Adjust+0x74> <== ALWAYS TAKEN _ISR_Enable( level ); _Watchdog_Tickle( header ); _ISR_Disable( level ); 491fc: 2809 movel %a1,%d4 units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; _ISR_Enable( level ); _Watchdog_Tickle( header ); 491fe: 49f9 0004 93ac lea 493ac <_Watchdog_Tickle>,%a4 switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 49204: 4a82 tstl %d2 49206: 66c4 bnes 491cc <_Watchdog_Adjust+0x38> <== NEVER TAKEN } break; } } _ISR_Enable( level ); 49208: 46c0 movew %d0,%sr } 4920a: 4cee 1c1c ffe8 moveml %fp@(-24),%d2-%d4/%a2-%a4 49210: 4e5e unlk %fp 49212: 4e75 rts 00054aa4 <_Watchdog_Adjust_to_chain>: Chain_Control *header, Watchdog_Interval units_arg, Chain_Control *to_fire ) { 54aa4: 4e56 ffe4 linkw %fp,#-28 54aa8: 202e 000c movel %fp@(12),%d0 54aac: 48d7 1c3c moveml %d2-%d5/%a2-%a4,%sp@ 54ab0: 266e 0008 moveal %fp@(8),%a3 54ab4: 246e 0010 moveal %fp@(16),%a2 Watchdog_Interval units = units_arg; ISR_Level level; Watchdog_Control *first; if ( units <= 0 ) { 54ab8: 4a80 tstl %d0 54aba: 6770 beqs 54b2c <_Watchdog_Adjust_to_chain+0x88> return; } _ISR_Disable( level ); 54abc: 307c 0700 moveaw #1792,%a0 54ac0: 2208 movel %a0,%d1 54ac2: 40c2 movew %sr,%d2 54ac4: 8282 orl %d2,%d1 54ac6: 46c1 movew %d1,%sr */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 54ac8: 260b movel %a3,%d3 54aca: 280a movel %a2,%d4 while ( 1 ) { _Chain_Extract_unprotected( &first->Node ); _Chain_Append_unprotected( to_fire, &first->Node ); _ISR_Flash( level ); 54acc: 2a08 movel %a0,%d5 54ace: 5883 addql #4,%d3 54ad0: 5884 addql #4,%d4 54ad2: 6004 bras 54ad8 <_Watchdog_Adjust_to_chain+0x34> <== ALWAYS TAKEN } _ISR_Disable( level ); while ( 1 ) { if ( units <= 0 ) { 54ad4: 4a80 tstl %d0 54ad6: 6752 beqs 54b2a <_Watchdog_Adjust_to_chain+0x86> */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 54ad8: 2253 moveal %a3@,%a1 break; } if ( _Chain_Is_empty( header ) ) { 54ada: b689 cmpl %a1,%d3 54adc: 674c beqs 54b2a <_Watchdog_Adjust_to_chain+0x86> /* * If it is longer than "units" until the first element on the chain * fires, then bump it and quit. */ if ( units < first->delta_interval ) { 54ade: 2229 0010 movel %a1@(16),%d1 54ae2: 2049 moveal %a1,%a0 54ae4: b280 cmpl %d0,%d1 54ae6: 6308 blss 54af0 <_Watchdog_Adjust_to_chain+0x4c> first->delta_interval -= units; 54ae8: 9280 subl %d0,%d1 54aea: 2341 0010 movel %d1,%a1@(16) break; 54aee: 603a bras 54b2a <_Watchdog_Adjust_to_chain+0x86> <== ALWAYS TAKEN /* * 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; 54af0: 9081 subl %d1,%d0 first->delta_interval = 0; 54af2: 42a9 0010 clrl %a1@(16) ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 54af6: 2250 moveal %a0@,%a1 previous = the_node->previous; 54af8: 2868 0004 moveal %a0@(4),%a4 next->previous = previous; previous->next = next; 54afc: 2889 movel %a1,%a4@ Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 54afe: 234c 0004 movel %a4,%a1@(4) Chain_Node *the_node ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); 54b02: 2084 movel %d4,%a0@ old_last_node = the_chain->last; 54b04: 226a 0008 moveal %a2@(8),%a1 the_chain->last = the_node; 54b08: 2548 0008 movel %a0,%a2@(8) old_last_node->next = the_node; the_node->previous = old_last_node; 54b0c: 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; 54b10: 2288 movel %a0,%a1@ while ( 1 ) { _Chain_Extract_unprotected( &first->Node ); _Chain_Append_unprotected( to_fire, &first->Node ); _ISR_Flash( level ); 54b12: 2205 movel %d5,%d1 54b14: 46c2 movew %d2,%sr 54b16: 8282 orl %d2,%d1 54b18: 46c1 movew %d1,%sr */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 54b1a: 2213 movel %a3@,%d1 54b1c: 2041 moveal %d1,%a0 if ( _Chain_Is_empty( header ) ) 54b1e: b681 cmpl %d1,%d3 54b20: 67b2 beqs 54ad4 <_Watchdog_Adjust_to_chain+0x30> break; first = _Watchdog_First( header ); if ( first->delta_interval != 0 ) 54b22: 4aa8 0010 tstl %a0@(16) 54b26: 67ce beqs 54af6 <_Watchdog_Adjust_to_chain+0x52> 54b28: 60aa bras 54ad4 <_Watchdog_Adjust_to_chain+0x30> <== ALWAYS TAKEN break; } } _ISR_Enable( level ); 54b2a: 46c2 movew %d2,%sr } 54b2c: 4cd7 1c3c moveml %sp@,%d2-%d5/%a2-%a4 54b30: 4e5e unlk %fp 54b32: 4e75 rts 00047c54 <_Watchdog_Insert>: Watchdog_Interval delta_interval; insert_isr_nest_level = _ISR_Nest_level; _ISR_Disable( level ); 47c54: 327c 0700 moveaw #1792,%a1 47c58: 2009 movel %a1,%d0 void _Watchdog_Insert( Chain_Control *header, Watchdog_Control *the_watchdog ) { 47c5a: 4e56 ffec linkw %fp,#-20 47c5e: 206e 000c moveal %fp@(12),%a0 47c62: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 47c66: 266e 0008 moveal %fp@(8),%a3 Watchdog_Control *after; uint32_t insert_isr_nest_level; Watchdog_Interval delta_interval; insert_isr_nest_level = _ISR_Nest_level; 47c6a: 2439 0005 cf5e movel 5cf5e <_ISR_Nest_level>,%d2 _ISR_Disable( level ); 47c70: 40c1 movew %sr,%d1 47c72: 8081 orl %d1,%d0 47c74: 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 ) { 47c76: 4aa8 0008 tstl %a0@(8) 47c7a: 6706 beqs 47c82 <_Watchdog_Insert+0x2e> _ISR_Enable( level ); 47c7c: 46c1 movew %d1,%sr return; 47c7e: 6000 009a braw 47d1a <_Watchdog_Insert+0xc6> <== ALWAYS TAKEN } the_watchdog->state = WATCHDOG_BEING_INSERTED; _Watchdog_Sync_count++; 47c82: 2039 0005 d004 movel 5d004 <_Watchdog_Sync_count>,%d0 47c88: 5280 addql #1,%d0 * 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 ); 47c8a: 2449 moveal %a1,%a2 _ISR_Enable( level ); return; } the_watchdog->state = WATCHDOG_BEING_INSERTED; _Watchdog_Sync_count++; 47c8c: 23c0 0005 d004 movel %d0,5d004 <_Watchdog_Sync_count> if ( the_watchdog->state != WATCHDOG_INACTIVE ) { _ISR_Enable( level ); return; } the_watchdog->state = WATCHDOG_BEING_INSERTED; 47c92: 7001 moveq #1,%d0 47c94: 2140 0008 movel %d0,%a0@(8) _Watchdog_Sync_count++; restart: delta_interval = the_watchdog->initial; 47c98: 2028 000c movel %a0@(12),%d0 * cache *header!! * * Till Straumann, 7/2003 (gcc-3.2.2 -O4 on powerpc) * */ for ( after = (Watchdog_Control *) ((volatile Chain_Control *)header)->first ; 47c9c: 2253 moveal %a3@,%a1 ; after = _Watchdog_Next( after ) ) { if ( delta_interval == 0 || !_Watchdog_Next( after ) ) 47c9e: 4a80 tstl %d0 47ca0: 673c beqs 47cde <_Watchdog_Insert+0x8a> 47ca2: 4a91 tstl %a1@ 47ca4: 6738 beqs 47cde <_Watchdog_Insert+0x8a> break; if ( delta_interval < after->delta_interval ) { 47ca6: 2629 0010 movel %a1@(16),%d3 47caa: b680 cmpl %d0,%d3 47cac: 6308 blss 47cb6 <_Watchdog_Insert+0x62> after->delta_interval -= delta_interval; 47cae: 9680 subl %d0,%d3 47cb0: 2343 0010 movel %d3,%a1@(16) break; 47cb4: 6028 bras 47cde <_Watchdog_Insert+0x8a> <== ALWAYS TAKEN * 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 ); 47cb6: 280a movel %a2,%d4 47cb8: 46c1 movew %d1,%sr 47cba: 8881 orl %d1,%d4 47cbc: 46c4 movew %d4,%sr if ( delta_interval < after->delta_interval ) { after->delta_interval -= delta_interval; break; } delta_interval -= after->delta_interval; 47cbe: 9083 subl %d3,%d0 * mechanism used here WAS redesigned to address this. */ _ISR_Flash( level ); if ( the_watchdog->state != WATCHDOG_BEING_INSERTED ) { 47cc0: 7601 moveq #1,%d3 47cc2: b6a8 0008 cmpl %a0@(8),%d3 47cc6: 663c bnes 47d04 <_Watchdog_Insert+0xb0> goto exit_insert; } if ( _Watchdog_Sync_level > insert_isr_nest_level ) { 47cc8: 2639 0005 cf7a movel 5cf7a <_Watchdog_Sync_level>,%d3 47cce: b483 cmpl %d3,%d2 47cd0: 6408 bccs 47cda <_Watchdog_Insert+0x86> _Watchdog_Sync_level = insert_isr_nest_level; 47cd2: 23c2 0005 cf7a movel %d2,5cf7a <_Watchdog_Sync_level> goto restart; 47cd8: 60be bras 47c98 <_Watchdog_Insert+0x44> <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_Next( Watchdog_Control *the_watchdog ) { return ( (Watchdog_Control *) the_watchdog->Node.next ); 47cda: 2251 moveal %a1@,%a1 } } 47cdc: 60c0 bras 47c9e <_Watchdog_Insert+0x4a> <== ALWAYS TAKEN _Watchdog_Activate( the_watchdog ); the_watchdog->delta_interval = delta_interval; _Chain_Insert_unprotected( after->Node.previous, &the_watchdog->Node ); 47cde: 2269 0004 moveal %a1@(4),%a1 the_watchdog->start_time = _Watchdog_Ticks_since_boot; 47ce2: 2639 0005 d008 movel 5d008 <_Watchdog_Ticks_since_boot>,%d3 ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 47ce8: 2451 moveal %a1@,%a2 Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 47cea: 2149 0004 movel %a1,%a0@(4) before_node = after_node->next; after_node->next = the_node; 47cee: 2288 movel %a0,%a1@ } } _Watchdog_Activate( the_watchdog ); the_watchdog->delta_interval = delta_interval; 47cf0: 2140 0010 movel %d0,%a0@(16) RTEMS_INLINE_ROUTINE void _Watchdog_Activate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_ACTIVE; 47cf4: 7002 moveq #2,%d0 _Chain_Insert_unprotected( after->Node.previous, &the_watchdog->Node ); the_watchdog->start_time = _Watchdog_Ticks_since_boot; 47cf6: 2143 0014 movel %d3,%a0@(20) the_node->next = before_node; before_node->previous = the_node; 47cfa: 2548 0004 movel %a0,%a2@(4) 47cfe: 2140 0008 movel %d0,%a0@(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; 47d02: 208a movel %a2,%a0@ exit_insert: _Watchdog_Sync_level = insert_isr_nest_level; 47d04: 23c2 0005 cf7a movel %d2,5cf7a <_Watchdog_Sync_level> _Watchdog_Sync_count--; 47d0a: 2039 0005 d004 movel 5d004 <_Watchdog_Sync_count>,%d0 47d10: 5380 subql #1,%d0 47d12: 23c0 0005 d004 movel %d0,5d004 <_Watchdog_Sync_count> _ISR_Enable( level ); 47d18: 46c1 movew %d1,%sr } 47d1a: 4cd7 0c1c moveml %sp@,%d2-%d4/%a2-%a3 47d1e: 4e5e unlk %fp 47d20: 4e75 rts ... 00047d70 <_Watchdog_Remove>: { ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 47d70: 203c 0000 0700 movel #1792,%d0 */ Watchdog_States _Watchdog_Remove( Watchdog_Control *the_watchdog ) { 47d76: 4e56 0000 linkw %fp,#0 47d7a: 206e 0008 moveal %fp@(8),%a0 47d7e: 2f0a movel %a2,%sp@- 47d80: 2f02 movel %d2,%sp@- ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 47d82: 40c1 movew %sr,%d1 47d84: 8081 orl %d1,%d0 47d86: 46c0 movew %d0,%sr previous_state = the_watchdog->state; 47d88: 2028 0008 movel %a0@(8),%d0 switch ( previous_state ) { 47d8c: 7401 moveq #1,%d2 47d8e: b480 cmpl %d0,%d2 47d90: 670c beqs 47d9e <_Watchdog_Remove+0x2e> 47d92: 6244 bhis 47dd8 <_Watchdog_Remove+0x68> 47d94: 143c 0003 moveb #3,%d2 47d98: b480 cmpl %d0,%d2 47d9a: 653c bcss 47dd8 <_Watchdog_Remove+0x68> <== ALWAYS TAKEN 47d9c: 6006 bras 47da4 <_Watchdog_Remove+0x34> <== ALWAYS TAKEN /* * 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; 47d9e: 42a8 0008 clrl %a0@(8) break; 47da2: 6034 bras 47dd8 <_Watchdog_Remove+0x68> <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_Next( Watchdog_Control *the_watchdog ) { return ( (Watchdog_Control *) the_watchdog->Node.next ); 47da4: 2250 moveal %a0@,%a1 case WATCHDOG_ACTIVE: case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; 47da6: 42a8 0008 clrl %a0@(8) next_watchdog = _Watchdog_Next( the_watchdog ); if ( _Watchdog_Next(next_watchdog) ) 47daa: 4a91 tstl %a1@ 47dac: 6708 beqs 47db6 <_Watchdog_Remove+0x46> next_watchdog->delta_interval += the_watchdog->delta_interval; 47dae: 2428 0010 movel %a0@(16),%d2 47db2: d5a9 0010 addl %d2,%a1@(16) if ( _Watchdog_Sync_count ) 47db6: 2279 0005 d004 moveal 5d004 <_Watchdog_Sync_count>,%a1 47dbc: 4a89 tstl %a1 47dbe: 670c beqs 47dcc <_Watchdog_Remove+0x5c> _Watchdog_Sync_level = _ISR_Nest_level; 47dc0: 2279 0005 cf5e moveal 5cf5e <_ISR_Nest_level>,%a1 47dc6: 23c9 0005 cf7a movel %a1,5cf7a <_Watchdog_Sync_level> ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 47dcc: 2250 moveal %a0@,%a1 previous = the_node->previous; 47dce: 2468 0004 moveal %a0@(4),%a2 next->previous = previous; previous->next = next; 47dd2: 2489 movel %a1,%a2@ Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 47dd4: 234a 0004 movel %a2,%a1@(4) _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 47dd8: 2279 0005 d008 moveal 5d008 <_Watchdog_Ticks_since_boot>,%a1 47dde: 2149 0018 movel %a1,%a0@(24) _ISR_Enable( level ); 47de2: 46c1 movew %d1,%sr return( previous_state ); } 47de4: 241f movel %sp@+,%d2 47de6: 245f moveal %sp@+,%a2 47de8: 4e5e unlk %fp 47dea: 4e75 rts 00048da8 <_Watchdog_Report_chain>: ) { ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 48da8: 203c 0000 0700 movel #1792,%d0 void _Watchdog_Report_chain( const char *name, Chain_Control *header ) { 48dae: 4e56 ffec linkw %fp,#-20 48db2: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@ 48db6: 242e 0008 movel %fp@(8),%d2 48dba: 266e 000c moveal %fp@(12),%a3 ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 48dbe: 40c3 movew %sr,%d3 48dc0: 8083 orl %d3,%d0 48dc2: 46c0 movew %d0,%sr printk( "Watchdog Chain: %s %p\n", name, header ); 48dc4: 2f0b movel %a3,%sp@- 48dc6: 49f9 0004 3640 lea 43640 ,%a4 48dcc: 2f02 movel %d2,%sp@- 48dce: 4879 0005 c1a0 pea 5c1a0 48dd4: 4e94 jsr %a4@ */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 48dd6: 245b moveal %a3@+,%a2 if ( !_Chain_Is_empty( header ) ) { 48dd8: 4fef 000c lea %sp@(12),%sp 48ddc: b7ca cmpal %a2,%a3 48dde: 6726 beqs 48e06 <_Watchdog_Report_chain+0x5e> node != _Chain_Tail(header) ; node = node->next ) { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); 48de0: 49f9 0004 8e1c lea 48e1c <_Watchdog_Report>,%a4 48de6: 2f0a movel %a2,%sp@- 48de8: 42a7 clrl %sp@- 48dea: 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 ) 48dec: 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 ; 48dee: 508f addql #8,%sp 48df0: b7ca cmpal %a2,%a3 48df2: 66f2 bnes 48de6 <_Watchdog_Report_chain+0x3e> <== ALWAYS TAKEN { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); 48df4: 2f02 movel %d2,%sp@- 48df6: 4879 0005 c1b7 pea 5c1b7 48dfc: 4eb9 0004 3640 jsr 43640 48e02: 508f addql #8,%sp 48e04: 600a bras 48e10 <_Watchdog_Report_chain+0x68> <== ALWAYS TAKEN } else { printk( "Chain is empty\n" ); 48e06: 4879 0005 c1c6 pea 5c1c6 48e0c: 4e94 jsr %a4@ 48e0e: 588f addql #4,%sp } _ISR_Enable( level ); 48e10: 46c3 movew %d3,%sr } 48e12: 4cee 1c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a4 48e18: 4e5e unlk %fp 48e1a: 4e75 rts 00044eb0 : int adjtime( struct timeval *delta, struct timeval *olddelta ) { 44eb0: 4e56 fff8 linkw %fp,#-8 44eb4: 2f0b movel %a3,%sp@- 44eb6: 266e 000c moveal %fp@(12),%a3 44eba: 2f0a movel %a2,%sp@- 44ebc: 246e 0008 moveal %fp@(8),%a2 long adjustment; /* * Simple validations */ if ( !delta ) 44ec0: 4a8a tstl %a2 44ec2: 670c beqs 44ed0 rtems_set_errno_and_return_minus_one( EINVAL ); if ( delta->tv_usec >= TOD_MICROSECONDS_PER_SECOND ) 44ec4: 227c 000f 423f moveal #999999,%a1 44eca: b3ea 0004 cmpal %a2@(4),%a1 44ece: 6412 bccs 44ee2 rtems_set_errno_and_return_minus_one( EINVAL ); 44ed0: 4eb9 0004 d5a0 jsr 4d5a0 <__errno> 44ed6: 72ff moveq #-1,%d1 44ed8: 2040 moveal %d0,%a0 44eda: 7016 moveq #22,%d0 44edc: 2080 movel %d0,%a0@ 44ede: 6000 00b2 braw 44f92 <== ALWAYS TAKEN if ( olddelta ) { 44ee2: 4a8b tstl %a3 44ee4: 6706 beqs 44eec olddelta->tv_sec = 0; 44ee6: 4293 clrl %a3@ olddelta->tv_usec = 0; 44ee8: 42ab 0004 clrl %a3@(4) } /* convert delta to microseconds */ adjustment = (delta->tv_sec * TOD_MICROSECONDS_PER_SECOND); 44eec: 203c 000f 4240 movel #1000000,%d0 44ef2: 4c12 0800 mulsl %a2@,%d0 adjustment += delta->tv_usec; 44ef6: d0aa 0004 addl %a2@(4),%d0 /* too small to account for */ if ( adjustment < rtems_configuration_get_microseconds_per_tick() ) 44efa: b0b9 0005 ca10 cmpl 5ca10 ,%d0 44f00: 6500 008e bcsw 44f90 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 44f04: 2039 0005 e2ec movel 5e2ec <_Thread_Dispatch_disable_level>,%d0 44f0a: 5280 addql #1,%d0 44f0c: 23c0 0005 e2ec movel %d0,5e2ec <_Thread_Dispatch_disable_level> * This prevents context switches while we are adjusting the TOD */ _Thread_Disable_dispatch(); _TOD_Get( &ts ); 44f12: 486e fff8 pea %fp@(-8) 44f16: 4eb9 0004 6518 jsr 46518 <_TOD_Get> ts.tv_sec += delta->tv_sec; ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; 44f1c: 202a 0004 movel %a2@(4),%d0 44f20: 223c 0000 03e8 movel #1000,%d1 44f26: 4c01 0800 mulsl %d1,%d0 /* if adjustment is too much positive */ while ( ts.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 44f2a: 588f addql #4,%sp _Thread_Disable_dispatch(); _TOD_Get( &ts ); ts.tv_sec += delta->tv_sec; 44f2c: 2212 movel %a2@,%d1 44f2e: d3ae fff8 addl %d1,%fp@(-8) ts.tv_nsec += delta->tv_usec * TOD_NANOSECONDS_PER_MICROSECOND; 44f32: d0ae fffc addl %fp@(-4),%d0 44f36: 206e fff8 moveal %fp@(-8),%a0 /* if adjustment is too much positive */ while ( ts.tv_nsec >= TOD_NANOSECONDS_PER_SECOND ) { 44f3a: 6006 bras 44f42 <== ALWAYS TAKEN 44f3c: 0680 c465 3600 addil #-1000000000,%d0 44f42: 2208 movel %a0,%d1 44f44: 5288 addql #1,%a0 44f46: 0c80 3b9a c9ff cmpil #999999999,%d0 44f4c: 62ee bhis 44f3c 44f4e: 6006 bras 44f56 <== ALWAYS TAKEN 44f50: 0680 3b9a ca00 addil #1000000000,%d0 44f56: 2041 moveal %d1,%a0 44f58: 5381 subql #1,%d1 ts.tv_nsec -= TOD_NANOSECONDS_PER_SECOND; ts.tv_sec++; } /* if adjustment is too much negative */ while ( ts.tv_nsec <= (-1 * TOD_NANOSECONDS_PER_SECOND) ) { 44f5a: 0c80 c465 3600 cmpil #-1000000000,%d0 44f60: 63ee blss 44f50 ts.tv_nsec += TOD_NANOSECONDS_PER_SECOND; ts.tv_sec--; } _TOD_Set( &ts ); 44f62: 486e fff8 pea %fp@(-8) ts.tv_nsec -= TOD_NANOSECONDS_PER_SECOND; ts.tv_sec++; } /* if adjustment is too much negative */ while ( ts.tv_nsec <= (-1 * TOD_NANOSECONDS_PER_SECOND) ) { 44f66: 2d40 fffc movel %d0,%fp@(-4) 44f6a: 2d48 fff8 movel %a0,%fp@(-8) ts.tv_nsec += TOD_NANOSECONDS_PER_SECOND; ts.tv_sec--; } _TOD_Set( &ts ); 44f6e: 4eb9 0004 65b4 jsr 465b4 <_TOD_Set> _Thread_Enable_dispatch(); 44f74: 4eb9 0004 7602 jsr 47602 <_Thread_Enable_dispatch> /* set the user's output */ if ( olddelta ) 44f7a: 588f addql #4,%sp 44f7c: 4a8b tstl %a3 44f7e: 6710 beqs 44f90 <== ALWAYS TAKEN *olddelta = *delta; 44f80: 4281 clrl %d1 44f82: 2052 moveal %a2@,%a0 44f84: 226a 0004 moveal %a2@(4),%a1 44f88: 2688 movel %a0,%a3@ 44f8a: 2749 0004 movel %a1,%a3@(4) 44f8e: 6002 bras 44f92 <== ALWAYS TAKEN 44f90: 4281 clrl %d1 return 0; } 44f92: 246e fff0 moveal %fp@(-16),%a2 44f96: 2001 movel %d1,%d0 44f98: 266e fff4 moveal %fp@(-12),%a3 44f9c: 4e5e unlk %fp 44f9e: 4e75 rts 0004b8b8 : } unsigned int alarm( unsigned int seconds ) { 4b8b8: 4e56 fff4 linkw %fp,#-12 4b8bc: 48d7 001c moveml %d2-%d4,%sp@ 4b8c0: 262e 0008 movel %fp@(8),%d3 /* * Initialize the timer used to implement alarm(). */ if ( !the_timer->routine ) { 4b8c4: 4ab9 0005 d74c tstl 5d74c <_POSIX_signals_Alarm_timer+0x1c> 4b8ca: 6622 bnes 4b8ee Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 4b8cc: 42b9 0005 d738 clrl 5d738 <_POSIX_signals_Alarm_timer+0x8> the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 4b8d2: 4282 clrl %d2 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 4b8d4: 203c 0004 b950 movel #309584,%d0 the_watchdog->id = id; 4b8da: 42b9 0005 d750 clrl 5d750 <_POSIX_signals_Alarm_timer+0x20> Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 4b8e0: 23c0 0005 d74c movel %d0,5d74c <_POSIX_signals_Alarm_timer+0x1c> the_watchdog->id = id; the_watchdog->user_data = user_data; 4b8e6: 42b9 0005 d754 clrl 5d754 <_POSIX_signals_Alarm_timer+0x24> 4b8ec: 6038 bras 4b926 <== ALWAYS TAKEN _Watchdog_Initialize( the_timer, _POSIX_signals_Alarm_TSR, 0, NULL ); } else { Watchdog_States state; state = _Watchdog_Remove( the_timer ); 4b8ee: 4879 0005 d730 pea 5d730 <_POSIX_signals_Alarm_timer> 4b8f4: 4eb9 0004 7d70 jsr 47d70 <_Watchdog_Remove> if ( (state == WATCHDOG_ACTIVE) || (state == WATCHDOG_REMOVE_IT) ) { 4b8fa: 588f addql #4,%sp 4b8fc: 7201 moveq #1,%d1 4b8fe: 5580 subql #2,%d0 4b900: b280 cmpl %d0,%d1 4b902: 6404 bccs 4b908 4b904: 4282 clrl %d2 4b906: 601e bras 4b926 <== 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); 4b908: 2839 0005 d748 movel 5d748 <_POSIX_signals_Alarm_timer+0x18>,%d4 4b90e: 98b9 0005 d744 subl 5d744 <_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 - 4b914: 2439 0005 d73c movel 5d73c <_POSIX_signals_Alarm_timer+0xc>,%d2 ((the_timer->stop_time - the_timer->start_time) / TOD_TICKS_PER_SECOND); 4b91a: 4eb9 0004 c24c jsr 4c24c * 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 - 4b920: 4c40 4004 remul %d0,%d4,%d4 4b924: 9484 subl %d4,%d2 ((the_timer->stop_time - the_timer->start_time) / TOD_TICKS_PER_SECOND); } } if ( seconds ) 4b926: 4a83 tstl %d3 4b928: 671a beqs 4b944 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Seconds_chain, the_watchdog ); 4b92a: 4879 0005 d730 pea 5d730 <_POSIX_signals_Alarm_timer> 4b930: 4879 0005 cf90 pea 5cf90 <_Watchdog_Seconds_chain> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 4b936: 23c3 0005 d73c movel %d3,5d73c <_POSIX_signals_Alarm_timer+0xc> _Watchdog_Insert( &_Watchdog_Seconds_chain, the_watchdog ); 4b93c: 4eb9 0004 7c54 jsr 47c54 <_Watchdog_Insert> 4b942: 508f addql #8,%sp _Watchdog_Insert_seconds( the_timer, seconds ); return remaining; } 4b944: 2002 movel %d2,%d0 4b946: 4cee 001c fff4 moveml %fp@(-12),%d2-%d4 4b94c: 4e5e unlk %fp 4b94e: 4e75 rts 0004525c : int clock_getres( clockid_t clock_id, struct timespec *res ) { 4525c: 4e56 0000 linkw %fp,#0 45260: 206e 000c moveal %fp@(12),%a0 45264: 2f03 movel %d3,%sp@- 45266: 2f02 movel %d2,%sp@- if ( !res ) 45268: 4a88 tstl %a0 4526a: 6730 beqs 4529c rtems_set_errno_and_return_minus_one( EINVAL ); switch ( clock_id ) { 4526c: 202e 0008 movel %fp@(8),%d0 45270: 7202 moveq #2,%d1 45272: 5380 subql #1,%d0 45274: b280 cmpl %d0,%d1 45276: 6524 bcss 4529c case CLOCK_REALTIME: case CLOCK_PROCESS_CPUTIME: case CLOCK_THREAD_CPUTIME: if ( res ) { res->tv_sec = rtems_configuration_get_microseconds_per_tick() / 45278: 2039 0005 d5b0 movel 5d5b0 ,%d0 TOD_MICROSECONDS_PER_SECOND; res->tv_nsec = rtems_configuration_get_nanoseconds_per_tick(); 4527e: 243c 0000 03e8 movel #1000,%d2 45284: 4c00 2800 mulsl %d0,%d2 45288: 4201 clrb %d1 case CLOCK_REALTIME: case CLOCK_PROCESS_CPUTIME: case CLOCK_THREAD_CPUTIME: if ( res ) { res->tv_sec = rtems_configuration_get_microseconds_per_tick() / 4528a: 263c 000f 4240 movel #1000000,%d3 TOD_MICROSECONDS_PER_SECOND; res->tv_nsec = rtems_configuration_get_nanoseconds_per_tick(); 45290: 2142 0004 movel %d2,%a0@(4) case CLOCK_REALTIME: case CLOCK_PROCESS_CPUTIME: case CLOCK_THREAD_CPUTIME: if ( res ) { res->tv_sec = rtems_configuration_get_microseconds_per_tick() / 45294: 4c43 0000 remul %d3,%d0,%d0 45298: 2080 movel %d0,%a0@ 4529a: 600e bras 452aa <== ALWAYS TAKEN res->tv_nsec = rtems_configuration_get_nanoseconds_per_tick(); } break; default: rtems_set_errno_and_return_minus_one( EINVAL ); 4529c: 4eb9 0004 d93c jsr 4d93c <__errno> 452a2: 72ff moveq #-1,%d1 452a4: 2040 moveal %d0,%a0 452a6: 7016 moveq #22,%d0 452a8: 2080 movel %d0,%a0@ } return 0; } 452aa: 242e fff8 movel %fp@(-8),%d2 452ae: 2001 movel %d1,%d0 452b0: 262e fffc movel %fp@(-4),%d3 452b4: 4e5e unlk %fp 452b6: 4e75 rts 00044da8 : int clock_gettime( clockid_t clock_id, struct timespec *tp ) { 44da8: 4e56 0000 linkw %fp,#0 44dac: 222e 0008 movel %fp@(8),%d1 44db0: 202e 000c movel %fp@(12),%d0 44db4: 2f02 movel %d2,%sp@- if ( !tp ) 44db6: 4a80 tstl %d0 44db8: 6608 bnes 44dc2 rtems_set_errno_and_return_minus_one( EINVAL ); 44dba: 4eb9 0004 d914 jsr 4d914 <__errno> 44dc0: 6044 bras 44e06 <== ALWAYS TAKEN if ( clock_id == CLOCK_REALTIME ) { 44dc2: 7401 moveq #1,%d2 44dc4: b481 cmpl %d1,%d2 44dc6: 660a bnes 44dd2 _TOD_Get(tp); 44dc8: 2f00 movel %d0,%sp@- 44dca: 4eb9 0004 69e0 jsr 469e0 <_TOD_Get> 44dd0: 600e bras 44de0 <== ALWAYS TAKEN return 0; } #ifdef CLOCK_MONOTONIC if ( clock_id == CLOCK_MONOTONIC ) { 44dd2: 7404 moveq #4,%d2 44dd4: b481 cmpl %d1,%d2 44dd6: 660e bnes 44de6 <== NEVER TAKEN _TOD_Get_uptime_as_timespec( tp ); 44dd8: 2f00 movel %d0,%sp@- 44dda: 4eb9 0004 6a4c jsr 46a4c <_TOD_Get_uptime_as_timespec> return 0; 44de0: 588f addql #4,%sp _TOD_Get(tp); return 0; } #ifdef CLOCK_MONOTONIC if ( clock_id == CLOCK_MONOTONIC ) { _TOD_Get_uptime_as_timespec( tp ); 44de2: 4281 clrl %d1 return 0; 44de4: 6028 bras 44e0e <== ALWAYS TAKEN } #endif #ifdef _POSIX_CPUTIME if ( clock_id == CLOCK_PROCESS_CPUTIME ) { 44de6: 7402 moveq #2,%d2 44de8: b481 cmpl %d1,%d2 44dea: 67ec beqs 44dd8 44dec: 41f9 0004 d914 lea 4d914 <__errno>,%a0 return 0; } #endif #ifdef _POSIX_THREAD_CPUTIME if ( clock_id == CLOCK_THREAD_CPUTIME ) 44df2: 7003 moveq #3,%d0 44df4: b081 cmpl %d1,%d0 44df6: 660c bnes 44e04 rtems_set_errno_and_return_minus_one( ENOSYS ); 44df8: 4e90 jsr %a0@ 44dfa: 7458 moveq #88,%d2 44dfc: 72ff moveq #-1,%d1 44dfe: 2040 moveal %d0,%a0 44e00: 2082 movel %d2,%a0@ 44e02: 600a bras 44e0e <== ALWAYS TAKEN #endif rtems_set_errno_and_return_minus_one( EINVAL ); 44e04: 4e90 jsr %a0@ 44e06: 2040 moveal %d0,%a0 44e08: 7016 moveq #22,%d0 44e0a: 72ff moveq #-1,%d1 44e0c: 2080 movel %d0,%a0@ return 0; } 44e0e: 242e fffc movel %fp@(-4),%d2 44e12: 2001 movel %d1,%d0 44e14: 4e5e unlk %fp 44e16: 4e75 rts 00062074 : int clock_settime( clockid_t clock_id, const struct timespec *tp ) { 62074: 4e56 0000 linkw %fp,#0 62078: 222e 0008 movel %fp@(8),%d1 6207c: 206e 000c moveal %fp@(12),%a0 if ( !tp ) 62080: 4a88 tstl %a0 62082: 6710 beqs 62094 <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { 62084: 7001 moveq #1,%d0 62086: b081 cmpl %d1,%d0 62088: 6634 bnes 620be if ( tp->tv_sec < TOD_SECONDS_1970_THROUGH_1988 ) 6208a: 203c 21da e4ff movel #567993599,%d0 62090: b090 cmpl %a0@,%d0 62092: 6508 bcss 6209c rtems_set_errno_and_return_minus_one( EINVAL ); 62094: 4eb9 0007 6188 jsr 76188 <__errno> 6209a: 604a bras 620e6 <== ALWAYS TAKEN rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 6209c: 2039 0009 bdf8 movel 9bdf8 <_Thread_Dispatch_disable_level>,%d0 620a2: 5280 addql #1,%d0 620a4: 23c0 0009 bdf8 movel %d0,9bdf8 <_Thread_Dispatch_disable_level> _Thread_Disable_dispatch(); _TOD_Set( tp ); 620aa: 2f08 movel %a0,%sp@- 620ac: 4eb9 0006 3a84 jsr 63a84 <_TOD_Set> _Thread_Enable_dispatch(); 620b2: 4eb9 0004 c33a jsr 4c33a <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( ENOSYS ); #endif else rtems_set_errno_and_return_minus_one( EINVAL ); return 0; 620b8: 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(); 620ba: 4281 clrl %d1 rtems_set_errno_and_return_minus_one( ENOSYS ); #endif else rtems_set_errno_and_return_minus_one( EINVAL ); return 0; 620bc: 6030 bras 620ee <== ALWAYS TAKEN _Thread_Disable_dispatch(); _TOD_Set( tp ); _Thread_Enable_dispatch(); } #ifdef _POSIX_CPUTIME else if ( clock_id == CLOCK_PROCESS_CPUTIME ) 620be: 7002 moveq #2,%d0 620c0: b081 cmpl %d1,%d0 620c2: 6608 bnes 620cc rtems_set_errno_and_return_minus_one( ENOSYS ); 620c4: 4eb9 0007 6188 jsr 76188 <__errno> 620ca: 600e bras 620da <== ALWAYS TAKEN 620cc: 41f9 0007 6188 lea 76188 <__errno>,%a0 #endif #ifdef _POSIX_THREAD_CPUTIME else if ( clock_id == CLOCK_THREAD_CPUTIME ) 620d2: 7003 moveq #3,%d0 620d4: b081 cmpl %d1,%d0 620d6: 660c bnes 620e4 rtems_set_errno_and_return_minus_one( ENOSYS ); 620d8: 4e90 jsr %a0@ 620da: 2040 moveal %d0,%a0 620dc: 7058 moveq #88,%d0 620de: 72ff moveq #-1,%d1 620e0: 2080 movel %d0,%a0@ 620e2: 600a bras 620ee <== ALWAYS TAKEN #endif else rtems_set_errno_and_return_minus_one( EINVAL ); 620e4: 4e90 jsr %a0@ 620e6: 2040 moveal %d0,%a0 620e8: 7016 moveq #22,%d0 620ea: 72ff moveq #-1,%d1 620ec: 2080 movel %d0,%a0@ return 0; } 620ee: 2001 movel %d1,%d0 620f0: 4e5e unlk %fp 620f2: 4e75 rts 00044bc0 : int getitimer( int which, struct itimerval *value ) { 44bc0: 4e56 0000 linkw %fp,#0 if ( !value ) 44bc4: 4aae 000c tstl %fp@(12) 44bc8: 660e bnes 44bd8 rtems_set_errno_and_return_minus_one( EFAULT ); 44bca: 4eb9 0004 d260 jsr 4d260 <__errno> 44bd0: 2040 moveal %d0,%a0 44bd2: 700e moveq #14,%d0 44bd4: 2080 movel %d0,%a0@ 44bd6: 6020 bras 44bf8 <== ALWAYS TAKEN 44bd8: 41f9 0004 d260 lea 4d260 <__errno>,%a0 switch ( which ) { 44bde: 7002 moveq #2,%d0 44be0: b0ae 0008 cmpl %fp@(8),%d0 44be4: 650a bcss 44bf0 case ITIMER_REAL: case ITIMER_VIRTUAL: case ITIMER_PROF: rtems_set_errno_and_return_minus_one( ENOSYS ); 44be6: 4e90 jsr %a0@ 44be8: 7258 moveq #88,%d1 44bea: 2040 moveal %d0,%a0 44bec: 2081 movel %d1,%a0@ 44bee: 6008 bras 44bf8 <== ALWAYS TAKEN default: break; } rtems_set_errno_and_return_minus_one( EINVAL ); 44bf0: 4e90 jsr %a0@ 44bf2: 2040 moveal %d0,%a0 44bf4: 7016 moveq #22,%d0 44bf6: 2080 movel %d0,%a0@ } 44bf8: 70ff moveq #-1,%d0 44bfa: 4e5e unlk %fp 44bfc: 4e75 rts ... 0004c784 : int killinfo( pid_t pid, int sig, const union sigval *value ) { 4c784: 4e56 ffd0 linkw %fp,#-48 4c788: 48d7 1cfc moveml %d2-%d7/%a2-%a4,%sp@ 4c78c: 242e 000c movel %fp@(12),%d2 4c790: 246e 0010 moveal %fp@(16),%a2 POSIX_signals_Siginfo_node *psiginfo; /* * Only supported for the "calling process" (i.e. this node). */ if ( pid != getpid() ) 4c794: 4eb9 0004 b8a4 jsr 4b8a4 4c79a: b0ae 0008 cmpl %fp@(8),%d0 4c79e: 6712 beqs 4c7b2 rtems_set_errno_and_return_minus_one( ESRCH ); 4c7a0: 4eb9 0004 cc58 jsr 4cc58 <__errno> 4c7a6: 7603 moveq #3,%d3 4c7a8: 72ff moveq #-1,%d1 4c7aa: 2040 moveal %d0,%a0 4c7ac: 2083 movel %d3,%a0@ 4c7ae: 6000 01ec braw 4c99c /* * Validate the signal passed. */ if ( !sig ) 4c7b2: 4a82 tstl %d2 4c7b4: 670a beqs 4c7c0 static inline bool is_valid_signo( int signo ) { return ((signo) >= 1 && (signo) <= 32 ); 4c7b6: 2202 movel %d2,%d1 4c7b8: 5381 subql #1,%d1 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 4c7ba: 701f moveq #31,%d0 4c7bc: b081 cmpl %d1,%d0 4c7be: 6412 bccs 4c7d2 rtems_set_errno_and_return_minus_one( EINVAL ); 4c7c0: 4eb9 0004 cc58 jsr 4cc58 <__errno> 4c7c6: 7416 moveq #22,%d2 4c7c8: 72ff moveq #-1,%d1 4c7ca: 2040 moveal %d0,%a0 4c7cc: 2082 movel %d2,%a0@ 4c7ce: 6000 01cc braw 4c99c /* * If the signal is being ignored, then we are out of here. */ if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) 4c7d2: 2602 movel %d2,%d3 4c7d4: 2002 movel %d2,%d0 4c7d6: e58b lsll #2,%d3 4c7d8: e988 lsll #4,%d0 4c7da: 9083 subl %d3,%d0 4c7dc: 0680 0005 d37a addil #381818,%d0 4c7e2: 7601 moveq #1,%d3 4c7e4: 2040 moveal %d0,%a0 4c7e6: b690 cmpl %a0@,%d3 4c7e8: 6700 01b0 beqw 4c99a /* * 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 ) ) 4c7ec: 7008 moveq #8,%d0 4c7ee: b082 cmpl %d2,%d0 4c7f0: 670e beqs 4c800 4c7f2: 7604 moveq #4,%d3 4c7f4: b682 cmpl %d2,%d3 4c7f6: 6708 beqs 4c800 4c7f8: 103c 000b moveb #11,%d0 4c7fc: b082 cmpl %d2,%d0 4c7fe: 6618 bnes 4c818 return pthread_kill( pthread_self(), sig ); 4c800: 4eb9 0004 cbfc jsr 4cbfc 4c806: 2f02 movel %d2,%sp@- 4c808: 2f00 movel %d0,%sp@- 4c80a: 4eb9 0004 cb3c jsr 4cb3c 4c810: 508f addql #8,%sp 4c812: 2200 movel %d0,%d1 4c814: 6000 0186 braw 4c99c <== ALWAYS TAKEN static inline sigset_t signo_to_mask( uint32_t sig ) { return 1u << (sig - 1); 4c818: 7601 moveq #1,%d3 /* * Build up a siginfo structure */ siginfo = &siginfo_struct; siginfo->si_signo = sig; siginfo->si_code = SI_USER; 4c81a: 7001 moveq #1,%d0 4c81c: e3ab lsll %d1,%d3 /* * Build up a siginfo structure */ siginfo = &siginfo_struct; siginfo->si_signo = sig; 4c81e: 2d42 fff4 movel %d2,%fp@(-12) siginfo->si_code = SI_USER; 4c822: 2d40 fff8 movel %d0,%fp@(-8) if ( !value ) { 4c826: 4a8a tstl %a2 4c828: 6606 bnes 4c830 siginfo->si_value.sival_int = 0; 4c82a: 42ae fffc clrl %fp@(-4) 4c82e: 6004 bras 4c834 <== ALWAYS TAKEN } else { siginfo->si_value = *value; 4c830: 2d52 fffc movel %a2@,%fp@(-4) 4c834: 2039 0005 cec4 movel 5cec4 <_Thread_Dispatch_disable_level>,%d0 4c83a: 5280 addql #1,%d0 4c83c: 23c0 0005 cec4 movel %d0,5cec4 <_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; 4c842: 2279 0005 cf7e moveal 5cf7e <_Thread_Executing>,%a1 api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4c848: 2069 010e moveal %a1@(270),%a0 4c84c: 2028 00c4 movel %a0@(196),%d0 4c850: 4680 notl %d0 4c852: c083 andl %d3,%d0 4c854: 6600 00b2 bnew 4c908 /* XXX violation of visibility -- need to define thread queue support */ the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = the_chain->first ; 4c858: 2079 0005 d4fe moveal 5d4fe <_POSIX_signals_Wait_queue>,%a0 4c85e: 601c bras 4c87c <== ALWAYS TAKEN #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 4c860: 2003 movel %d3,%d0 4c862: 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 ]; 4c866: 2468 010e moveal %a0@(270),%a2 #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 4c86a: 6600 009c bnew 4c908 /* * Is this thread is blocked waiting for another signal but has * not blocked this one? */ if (~api->signals_blocked & mask) 4c86e: 202a 00c4 movel %a2@(196),%d0 4c872: 4680 notl %d0 4c874: c083 andl %d3,%d0 4c876: 6600 0090 bnew 4c908 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 ) { 4c87a: 2050 moveal %a0@,%a0 the_thread = (Thread_Control *)the_node; 4c87c: 2248 moveal %a0,%a1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4c87e: b1fc 0005 d502 cmpal #382210,%a0 4c884: 66da bnes 4c860 * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 4c886: 4280 clrl %d0 4c888: 1039 0005 b712 moveb 5b712 ,%d0 4c88e: 45f9 0005 ce84 lea 5ce84 <_Objects_Information_table+0x8>,%a2 */ #define _POSIX_signals_Is_interested( _api, _mask ) \ ( ~(_api)->signals_blocked & (_mask) ) int killinfo( 4c894: 93c9 subal %a1,%a1 * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 4c896: 5280 addql #1,%d0 for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) { /* * This can occur when no one is interested and ITRON is not configured. */ if ( !_Objects_Information_table[ the_api ] ) 4c898: 2052 moveal %a2@,%a0 4c89a: 4a88 tstl %a0 4c89c: 675c beqs 4c8fa continue; the_info = _Objects_Information_table[ the_api ][ 1 ]; 4c89e: 2068 0004 moveal %a0@(4),%a0 */ if ( !the_info ) continue; #endif maximum = the_info->maximum; 4c8a2: 4287 clrl %d7 4c8a4: 7801 moveq #1,%d4 4c8a6: 2668 0018 moveal %a0@(24),%a3 4c8aa: 588b addql #4,%a3 4c8ac: 3e28 000e movew %a0@(14),%d7 object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 4c8b0: 6044 bras 4c8f6 <== ALWAYS TAKEN the_thread = (Thread_Control *) object_table[ index ]; 4c8b2: 2053 moveal %a3@,%a0 if ( !the_thread ) 4c8b4: 4a88 tstl %a0 4c8b6: 6732 beqs 4c8ea /* * If this thread is of lower priority than the interested thread, * go on to the next thread. */ if ( the_thread->current_priority > interested_priority ) 4c8b8: 2228 0014 movel %a0@(20),%d1 4c8bc: b081 cmpl %d1,%d0 4c8be: 652a bcss 4c8ea DEBUG_STEP("2"); /* * If this thread is not interested, then go on to the next thread. */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4c8c0: 2868 010e moveal %a0@(270),%a4 4c8c4: 2a2c 00c4 movel %a4@(196),%d5 4c8c8: 4685 notl %d5 4c8ca: ca83 andl %d3,%d5 4c8cc: 671c beqs 4c8ea * * 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 ) { 4c8ce: b081 cmpl %d1,%d0 4c8d0: 621c bhis 4c8ee * and blocking interruptibutable by signal. * * If the interested thread is ready, don't think about changing. */ if ( !_States_Is_ready( interested->current_state ) ) { 4c8d2: 2c29 0010 movel %a1@(16),%d6 4c8d6: 6712 beqs 4c8ea <== ALWAYS TAKEN /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 4c8d8: 2a28 0010 movel %a0@(16),%d5 4c8dc: 6710 beqs 4c8ee continue; } DEBUG_STEP("6"); /* prefer blocked/interruptible over blocked/not interruptible */ if ( !_States_Is_interruptible_by_signal(interested->current_state) ) { 4c8de: 0806 001c btst #28,%d6 4c8e2: 6606 bnes 4c8ea DEBUG_STEP("7"); if ( _States_Is_interruptible_by_signal(the_thread->current_state) ) { 4c8e4: 0805 001c btst #28,%d5 4c8e8: 6604 bnes 4c8ee 4c8ea: 2200 movel %d0,%d1 4c8ec: 6002 bras 4c8f0 <== ALWAYS TAKEN 4c8ee: 2248 moveal %a0,%a1 #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 4c8f0: 5284 addql #1,%d4 4c8f2: 588b addql #4,%a3 4c8f4: 2001 movel %d1,%d0 4c8f6: be84 cmpl %d4,%d7 4c8f8: 64b8 bccs 4c8b2 4c8fa: 588a addql #4,%a2 * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) { 4c8fc: b5fc 0005 ce90 cmpal #380560,%a2 4c902: 6694 bnes 4c898 } } } } if ( interested ) { 4c904: 4a89 tstl %a1 4c906: 671c beqs 4c924 * 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; 4c908: 7001 moveq #1,%d0 4c90a: 1340 0074 moveb %d0,%a1@(116) /* * Returns true if the signal was synchronously given to a thread * blocked waiting for the signal. */ if ( _POSIX_signals_Unblock_thread( the_thread, sig, siginfo ) ) { 4c90e: 486e fff4 pea %fp@(-12) 4c912: 2f02 movel %d2,%sp@- 4c914: 2f09 movel %a1,%sp@- 4c916: 4eb9 0004 ca40 jsr 4ca40 <_POSIX_signals_Unblock_thread> 4c91c: 4fef 000c lea %sp@(12),%sp 4c920: 4a00 tstb %d0 4c922: 6670 bnes 4c994 /* * 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 ); 4c924: 2f03 movel %d3,%sp@- if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { 4c926: 2602 movel %d2,%d3 4c928: e58a lsll #2,%d2 4c92a: e98b lsll #4,%d3 /* * We may have woken up a thread but we definitely need to post the * signal to the process wide information set. */ _POSIX_signals_Set_process_signals( mask ); 4c92c: 4eb9 0004 ca10 jsr 4ca10 <_POSIX_signals_Set_process_signals> if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { 4c932: 588f addql #4,%sp 4c934: 9682 subl %d2,%d3 4c936: 41f9 0005 d372 lea 5d372 <_POSIX_signals_Vectors>,%a0 4c93c: 7002 moveq #2,%d0 4c93e: b0b0 3800 cmpl %a0@(00000000,%d3:l),%d0 4c942: 6650 bnes 4c994 psiginfo = (POSIX_signals_Siginfo_node *) 4c944: 4879 0005 d4f2 pea 5d4f2 <_POSIX_signals_Inactive_siginfo> 4c94a: 4eb9 0004 a154 jsr 4a154 <_Chain_Get> _Chain_Get( &_POSIX_signals_Inactive_siginfo ); if ( !psiginfo ) { 4c950: 588f addql #4,%sp */ _POSIX_signals_Set_process_signals( mask ); if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { psiginfo = (POSIX_signals_Siginfo_node *) 4c952: 2440 moveal %d0,%a2 _Chain_Get( &_POSIX_signals_Inactive_siginfo ); if ( !psiginfo ) { 4c954: 4a80 tstl %d0 4c956: 6616 bnes 4c96e _Thread_Enable_dispatch(); 4c958: 4eb9 0004 6cee jsr 46cee <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EAGAIN ); 4c95e: 4eb9 0004 cc58 jsr 4cc58 <__errno> 4c964: 72ff moveq #-1,%d1 4c966: 2040 moveal %d0,%a0 4c968: 700b moveq #11,%d0 4c96a: 2080 movel %d0,%a0@ 4c96c: 602e bras 4c99c <== ALWAYS TAKEN } psiginfo->Info = *siginfo; 4c96e: 4878 000c pea c _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 4c972: 0683 0005 d542 addil #382274,%d3 if ( !psiginfo ) { _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EAGAIN ); } psiginfo->Info = *siginfo; 4c978: 486e fff4 pea %fp@(-12) 4c97c: 486a 0008 pea %a2@(8) 4c980: 4eb9 0004 d478 jsr 4d478 _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 4c986: 2f0a movel %a2,%sp@- 4c988: 2f03 movel %d3,%sp@- 4c98a: 4eb9 0004 58dc jsr 458dc <_Chain_Append> 4c990: 4fef 0014 lea %sp@(20),%sp } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); 4c994: 4eb9 0004 6cee jsr 46cee <_Thread_Enable_dispatch> 4c99a: 4281 clrl %d1 return 0; } 4c99c: 2001 movel %d1,%d0 4c99e: 4cee 1cfc ffd0 moveml %fp@(-48),%d2-%d7/%a2-%a4 4c9a4: 4e5e unlk %fp 4c9a6: 4e75 rts 00048e98 : */ int mq_close( mqd_t mqdes ) { 48e98: 4e56 fffc linkw %fp,#-4 48e9c: 2f0a movel %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( 48e9e: 486e fffc pea %fp@(-4) 48ea2: 2f2e 0008 movel %fp@(8),%sp@- 48ea6: 4879 0006 500c pea 6500c <_POSIX_Message_queue_Information_fds> 48eac: 4eb9 0004 bf58 jsr 4bf58 <_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 ); if ( location == OBJECTS_LOCAL ) { 48eb2: 4fef 000c lea %sp@(12),%sp 48eb6: 2440 moveal %d0,%a2 48eb8: 4aae fffc tstl %fp@(-4) 48ebc: 663a bnes 48ef8 * First update the actual message queue to reflect this descriptor * being disassociated. This may result in the queue being really * deleted. */ the_mq = the_mq_fd->Queue; 48ebe: 206a 0010 moveal %a2@(16),%a0 the_mq->open_count -= 1; 48ec2: 53a8 0016 subql #1,%a0@(22) _POSIX_Message_queue_Delete( the_mq ); 48ec6: 2f08 movel %a0,%sp@- 48ec8: 4eb9 0004 8f10 jsr 48f10 <_POSIX_Message_queue_Delete> /* * Now close this file descriptor. */ _Objects_Close( 48ece: 2f0a movel %a2,%sp@- 48ed0: 4879 0006 500c pea 6500c <_POSIX_Message_queue_Information_fds> 48ed6: 4eb9 0004 bb8c jsr 4bb8c <_Objects_Close> 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 ); 48edc: 2f0a movel %a2,%sp@- 48ede: 4879 0006 500c pea 6500c <_POSIX_Message_queue_Information_fds> 48ee4: 4eb9 0004 be00 jsr 4be00 <_Objects_Free> &_POSIX_Message_queue_Information_fds, &the_mq_fd->Object ); _POSIX_Message_queue_Free_fd( the_mq_fd ); _Thread_Enable_dispatch(); 48eea: 4eb9 0004 c7aa jsr 4c7aa <_Thread_Enable_dispatch> return 0; 48ef0: 4fef 0014 lea %sp@(20),%sp _Objects_Close( &_POSIX_Message_queue_Information_fds, &the_mq_fd->Object ); _POSIX_Message_queue_Free_fd( the_mq_fd ); _Thread_Enable_dispatch(); 48ef4: 4280 clrl %d0 return 0; 48ef6: 600e bras 48f06 <== ALWAYS TAKEN /* * OBJECTS_REMOTE: * OBJECTS_ERROR: */ rtems_set_errno_and_return_minus_one( EBADF ); 48ef8: 4eb9 0005 2870 jsr 52870 <__errno> 48efe: 7209 moveq #9,%d1 48f00: 2040 moveal %d0,%a0 48f02: 70ff moveq #-1,%d0 48f04: 2081 movel %d1,%a0@ } 48f06: 246e fff8 moveal %fp@(-8),%a2 48f0a: 4e5e unlk %fp 48f0c: 4e75 rts ... 00048f60 : int mq_getattr( mqd_t mqdes, struct mq_attr *mqstat ) { 48f60: 4e56 fffc linkw %fp,#-4 48f64: 2f0a movel %a2,%sp@- 48f66: 246e 000c moveal %fp@(12),%a2 POSIX_Message_queue_Control *the_mq; POSIX_Message_queue_Control_fd *the_mq_fd; Objects_Locations location; CORE_message_queue_Attributes *the_mq_attr; if ( !mqstat ) 48f6a: 4a8a tstl %a2 48f6c: 6610 bnes 48f7e rtems_set_errno_and_return_minus_one( EINVAL ); 48f6e: 4eb9 0005 2870 jsr 52870 <__errno> 48f74: 72ff moveq #-1,%d1 48f76: 2040 moveal %d0,%a0 48f78: 7016 moveq #22,%d0 48f7a: 2080 movel %d0,%a0@ 48f7c: 6052 bras 48fd0 <== ALWAYS TAKEN 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( 48f7e: 486e fffc pea %fp@(-4) 48f82: 2f2e 0008 movel %fp@(8),%sp@- 48f86: 4879 0006 500c pea 6500c <_POSIX_Message_queue_Information_fds> 48f8c: 4eb9 0004 bf58 jsr 4bf58 <_Objects_Get> the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); switch ( location ) { 48f92: 4fef 000c lea %sp@(12),%sp 48f96: 4aae fffc tstl %fp@(-4) 48f9a: 6626 bnes 48fc2 * Return the old values. */ the_mq_attr = &the_mq->Message_queue.Attributes; mqstat->mq_flags = the_mq_fd->oflag; 48f9c: 2240 moveal %d0,%a1 48f9e: 24a9 0014 movel %a1@(20),%a2@ the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); switch ( location ) { case OBJECTS_LOCAL: the_mq = the_mq_fd->Queue; 48fa2: 2069 0010 moveal %a1@(16),%a0 */ the_mq_attr = &the_mq->Message_queue.Attributes; mqstat->mq_flags = the_mq_fd->oflag; mqstat->mq_msgsize = the_mq->Message_queue.maximum_message_size; 48fa6: 2568 0066 0008 movel %a0@(102),%a2@(8) mqstat->mq_maxmsg = the_mq->Message_queue.maximum_pending_messages; 48fac: 2568 005e 0004 movel %a0@(94),%a2@(4) mqstat->mq_curmsgs = the_mq->Message_queue.number_of_pending_messages; 48fb2: 2568 0062 000c movel %a0@(98),%a2@(12) _Thread_Enable_dispatch(); 48fb8: 4eb9 0004 c7aa jsr 4c7aa <_Thread_Enable_dispatch> 48fbe: 4281 clrl %d1 return 0; 48fc0: 600e bras 48fd0 <== ALWAYS TAKEN #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); 48fc2: 4eb9 0005 2870 jsr 52870 <__errno> 48fc8: 72ff moveq #-1,%d1 48fca: 2040 moveal %d0,%a0 48fcc: 7009 moveq #9,%d0 48fce: 2080 movel %d0,%a0@ } 48fd0: 246e fff8 moveal %fp@(-8),%a2 48fd4: 2001 movel %d1,%d0 48fd6: 4e5e unlk %fp 48fd8: 4e75 rts ... 00048fdc : int mq_notify( mqd_t mqdes, const struct sigevent *notification ) { 48fdc: 4e56 fffc linkw %fp,#-4 48fe0: 2f0a movel %a2,%sp@- 48fe2: 2f02 movel %d2,%sp@- 48fe4: 486e fffc pea %fp@(-4) 48fe8: 2f2e 0008 movel %fp@(8),%sp@- 48fec: 4879 0006 500c pea 6500c <_POSIX_Message_queue_Information_fds> 48ff2: 242e 000c movel %fp@(12),%d2 48ff6: 4eb9 0004 bf58 jsr 4bf58 <_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 ) { 48ffc: 4fef 000c lea %sp@(12),%sp 49000: 4aae fffc tstl %fp@(-4) 49004: 6664 bnes 4906a case OBJECTS_LOCAL: the_mq = the_mq_fd->Queue; 49006: 2040 moveal %d0,%a0 49008: 2468 0010 moveal %a0@(16),%a2 if ( notification ) { 4900c: 4a82 tstl %d2 4900e: 6748 beqs 49058 if ( _CORE_message_queue_Is_notify_enabled( &the_mq->Message_queue ) ) { 49010: 4aaa 007a tstl %a2@(122) 49014: 6716 beqs 4902c _Thread_Enable_dispatch(); 49016: 4eb9 0004 c7aa jsr 4c7aa <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EBUSY ); 4901c: 7410 moveq #16,%d2 4901e: 4eb9 0005 2870 jsr 52870 <__errno> 49024: 72ff moveq #-1,%d1 49026: 2040 moveal %d0,%a0 49028: 2082 movel %d2,%a0@ 4902a: 604c bras 49078 <== ALWAYS TAKEN CORE_message_queue_Control *the_message_queue, CORE_message_queue_Notify_Handler the_handler, void *the_argument ) { the_message_queue->notify_handler = the_handler; 4902c: 42aa 007a clrl %a2@(122) the_message_queue->notify_argument = the_argument; 49030: 42aa 007e clrl %a2@(126) } _CORE_message_queue_Set_notify( &the_mq->Message_queue, NULL, NULL ); the_mq->notification = *notification; 49034: 4878 0014 pea 14 49038: 2f02 movel %d2,%sp@- 4903a: 486a 008e pea %a2@(142) 4903e: 4eb9 0005 30a8 jsr 530a8 49044: 4fef 000c lea %sp@(12),%sp CORE_message_queue_Control *the_message_queue, CORE_message_queue_Notify_Handler the_handler, void *the_argument ) { the_message_queue->notify_handler = the_handler; 49048: 203c 0004 9086 movel #299142,%d0 the_message_queue->notify_argument = the_argument; 4904e: 254a 007e movel %a2,%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; 49052: 2540 007a movel %d0,%a2@(122) 49056: 6008 bras 49060 <== ALWAYS TAKEN the_message_queue->notify_argument = the_argument; 49058: 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; 4905c: 42aa 007a clrl %a2@(122) _CORE_message_queue_Set_notify( &the_mq->Message_queue, NULL, NULL ); } _Thread_Enable_dispatch(); 49060: 4eb9 0004 c7aa jsr 4c7aa <_Thread_Enable_dispatch> 49066: 4281 clrl %d1 return 0; 49068: 600e bras 49078 <== ALWAYS TAKEN #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); 4906a: 4eb9 0005 2870 jsr 52870 <__errno> 49070: 72ff moveq #-1,%d1 49072: 2040 moveal %d0,%a0 49074: 7009 moveq #9,%d0 49076: 2080 movel %d0,%a0@ } 49078: 242e fff4 movel %fp@(-12),%d2 4907c: 2001 movel %d1,%d0 4907e: 246e fff8 moveal %fp@(-8),%a2 49082: 4e5e unlk %fp 49084: 4e75 rts 000490bc : int oflag, ... /* mode_t mode, */ /* struct mq_attr attr */ ) { 490bc: 4e56 ffdc linkw %fp,#-36 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 490c0: 2039 0006 4bd0 movel 64bd0 <_Thread_Dispatch_disable_level>,%d0 490c6: 5280 addql #1,%d0 490c8: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@ 490cc: 23c0 0006 4bd0 movel %d0,64bd0 <_Thread_Dispatch_disable_level> 490d2: 262e 0008 movel %fp@(8),%d3 490d6: 242e 000c movel %fp@(12),%d2 POSIX_Message_queue_Control_fd *the_mq_fd; Objects_Locations location; _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { 490da: 2a02 movel %d2,%d5 490dc: 0285 0000 0200 andil #512,%d5 490e2: 6604 bnes 490e8 490e4: 4284 clrl %d4 490e6: 6004 bras 490ec <== ALWAYS TAKEN va_start(arg, oflag); mode = (mode_t) va_arg( arg, unsigned int ); attr = (struct mq_attr *) va_arg( arg, struct mq_attr * ); 490e8: 282e 0014 movel %fp@(20),%d4 */ RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control_fd * _POSIX_Message_queue_Allocate_fd( void ) { return (POSIX_Message_queue_Control_fd *) 490ec: 4879 0006 500c pea 6500c <_POSIX_Message_queue_Information_fds> 490f2: 4eb9 0004 bb0c jsr 4bb0c <_Objects_Allocate> va_end(arg); } the_mq_fd = _POSIX_Message_queue_Allocate_fd(); if ( !the_mq_fd ) { 490f8: 588f addql #4,%sp 490fa: 2440 moveal %d0,%a2 490fc: 4a80 tstl %d0 490fe: 6618 bnes 49118 _Thread_Enable_dispatch(); 49100: 4eb9 0004 c7aa jsr 4c7aa <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( ENFILE ); 49106: 7417 moveq #23,%d2 49108: 4eb9 0005 2870 jsr 52870 <__errno> 4910e: 72ff moveq #-1,%d1 49110: 2040 moveal %d0,%a0 49112: 2082 movel %d2,%a0@ 49114: 6000 0120 braw 49236 <== ALWAYS TAKEN } the_mq_fd->oflag = oflag; 49118: 2542 0014 movel %d2,%a2@(20) status = _POSIX_Message_queue_Name_to_id( name, &the_mq_id ); 4911c: 486e fffc pea %fp@(-4) 49120: 2f03 movel %d3,%sp@- 49122: 4eb9 0004 f31c jsr 4f31c <_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 ) { 49128: 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 ); 4912a: 2640 moveal %d0,%a3 * 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 ) { 4912c: 4a80 tstl %d0 4912e: 6732 beqs 49162 /* * 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) ) ) { 49130: 7002 moveq #2,%d0 49132: b08b cmpl %a3,%d0 49134: 6606 bnes 4913c 49136: 4a85 tstl %d5 49138: 6600 00a4 bnew 491de 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 ); 4913c: 2f0a movel %a2,%sp@- 4913e: 4879 0006 500c pea 6500c <_POSIX_Message_queue_Information_fds> 49144: 4eb9 0004 be00 jsr 4be00 <_Objects_Free> _POSIX_Message_queue_Free_fd( the_mq_fd ); _Thread_Enable_dispatch(); 4914a: 4eb9 0004 c7aa jsr 4c7aa <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one_cast( status, mqd_t ); 49150: 4eb9 0005 2870 jsr 52870 <__errno> 49156: 508f addql #8,%sp 49158: 72ff moveq #-1,%d1 4915a: 2040 moveal %d0,%a0 4915c: 208b movel %a3,%a0@ 4915e: 6000 00d6 braw 49236 <== ALWAYS TAKEN 49162: 47f9 0004 c7aa lea 4c7aa <_Thread_Enable_dispatch>,%a3 } else { /* name -> ID translation succeeded */ /* * Check for existence with creation. */ if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { 49168: 0282 0000 0a00 andil #2560,%d2 4916e: 0c82 0000 0a00 cmpil #2560,%d2 49174: 6624 bnes 4919a 49176: 2f0a movel %a2,%sp@- 49178: 4879 0006 500c pea 6500c <_POSIX_Message_queue_Information_fds> 4917e: 4eb9 0004 be00 jsr 4be00 <_Objects_Free> _POSIX_Message_queue_Free_fd( the_mq_fd ); _Thread_Enable_dispatch(); 49184: 4e93 jsr %a3@ rtems_set_errno_and_return_minus_one_cast( EEXIST, mqd_t ); 49186: 4eb9 0005 2870 jsr 52870 <__errno> 4918c: 508f addql #8,%sp 4918e: 72ff moveq #-1,%d1 49190: 2040 moveal %d0,%a0 49192: 7011 moveq #17,%d0 49194: 2080 movel %d0,%a0@ 49196: 6000 009e braw 49236 <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE POSIX_Message_queue_Control *_POSIX_Message_queue_Get ( Objects_Id id, Objects_Locations *location ) { return (POSIX_Message_queue_Control *) 4919a: 486e fff4 pea %fp@(-12) 4919e: 2f2e fffc movel %fp@(-4),%sp@- 491a2: 4879 0006 4e9e pea 64e9e <_POSIX_Message_queue_Information> 491a8: 4eb9 0004 bf58 jsr 4bf58 <_Objects_Get> #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 491ae: 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; 491b0: 2040 moveal %d0,%a0 491b2: 52a8 0016 addql #1,%a0@(22) 491b6: 2079 0006 5024 moveal 65024 <_POSIX_Message_queue_Information_fds+0x18>,%a0 491bc: 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 ); 491c0: 2d40 fff8 movel %d0,%fp@(-8) 491c4: 218a 1c00 movel %a2,%a0@(00000000,%d1:l:4) the_mq->open_count += 1; the_mq_fd->Queue = the_mq; 491c8: 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; 491cc: 42aa 000c clrl %a2@(12) _Objects_Open_string( &_POSIX_Message_queue_Information_fds, &the_mq_fd->Object, NULL ); _Thread_Enable_dispatch(); 491d0: 4e93 jsr %a3@ _Thread_Enable_dispatch(); 491d2: 4e93 jsr %a3@ return (mqd_t)the_mq_fd->Object.id; 491d4: 222a 0008 movel %a2@(8),%d1 491d8: 4fef 000c lea %sp@(12),%sp 491dc: 6058 bras 49236 <== ALWAYS TAKEN /* * 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( 491de: 486e fff8 pea %fp@(-8) 491e2: 47f9 0004 c7aa lea 4c7aa <_Thread_Enable_dispatch>,%a3 491e8: 2f04 movel %d4,%sp@- 491ea: 4878 0001 pea 1 491ee: 2f03 movel %d3,%sp@- 491f0: 4eb9 0004 f1a8 jsr 4f1a8 <_POSIX_Message_queue_Create_support> ); /* * errno was set by Create_support, so don't set it again. */ if ( status == -1 ) { 491f6: 4fef 0010 lea %sp@(16),%sp 491fa: 72ff moveq #-1,%d1 491fc: b280 cmpl %d0,%d1 491fe: 6616 bnes 49216 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 ); 49200: 2f0a movel %a2,%sp@- 49202: 4879 0006 500c pea 6500c <_POSIX_Message_queue_Information_fds> 49208: 4eb9 0004 be00 jsr 4be00 <_Objects_Free> _POSIX_Message_queue_Free_fd( the_mq_fd ); _Thread_Enable_dispatch(); 4920e: 4e93 jsr %a3@ return (mqd_t) -1; 49210: 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(); 49212: 72ff moveq #-1,%d1 return (mqd_t) -1; 49214: 6020 bras 49236 <== ALWAYS TAKEN #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 49216: 4280 clrl %d0 49218: 2079 0006 5024 moveal 65024 <_POSIX_Message_queue_Information_fds+0x18>,%a0 4921e: 302a 000a movew %a2@(10),%d0 } the_mq_fd->Queue = the_mq; 49222: 256e fff8 0010 movel %fp@(-8),%a2@(16) 49228: 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; 4922c: 42aa 000c clrl %a2@(12) &_POSIX_Message_queue_Information_fds, &the_mq_fd->Object, NULL ); _Thread_Enable_dispatch(); 49230: 4e93 jsr %a3@ return (mqd_t) the_mq_fd->Object.id; 49232: 222a 0008 movel %a2@(8),%d1 } 49236: 2001 movel %d1,%d0 49238: 4cee 0c3c ffdc moveml %fp@(-36),%d2-%d5/%a2-%a3 4923e: 4e5e unlk %fp 49240: 4e75 rts ... 00049490 : int mq_setattr( mqd_t mqdes, const struct mq_attr *mqstat, struct mq_attr *omqstat ) { 49490: 4e56 fffc linkw %fp,#-4 49494: 2f0b movel %a3,%sp@- 49496: 266e 000c moveal %fp@(12),%a3 4949a: 2f0a movel %a2,%sp@- 4949c: 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 ) 494a0: 4a8b tstl %a3 494a2: 6610 bnes 494b4 rtems_set_errno_and_return_minus_one( EINVAL ); 494a4: 4eb9 0005 2870 jsr 52870 <__errno> 494aa: 72ff moveq #-1,%d1 494ac: 2040 moveal %d0,%a0 494ae: 7016 moveq #22,%d0 494b0: 2080 movel %d0,%a0@ 494b2: 605a bras 4950e <== ALWAYS TAKEN 494b4: 486e fffc pea %fp@(-4) 494b8: 2f2e 0008 movel %fp@(8),%sp@- 494bc: 4879 0006 500c pea 6500c <_POSIX_Message_queue_Information_fds> 494c2: 4eb9 0004 bf58 jsr 4bf58 <_Objects_Get> the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); switch ( location ) { 494c8: 4fef 000c lea %sp@(12),%sp 494cc: 2040 moveal %d0,%a0 494ce: 4aae fffc tstl %fp@(-4) 494d2: 662c bnes 49500 case OBJECTS_LOCAL: the_core_mq = &the_mq_fd->Queue->Message_queue; 494d4: 2268 0010 moveal %a0@(16),%a1 /* * Return the old values. */ if ( omqstat ) { 494d8: 4a8a tstl %a2 494da: 6716 beqs 494f2 omqstat->mq_flags = the_mq_fd->oflag; 494dc: 24a8 0014 movel %a0@(20),%a2@ omqstat->mq_msgsize = the_core_mq->maximum_message_size; 494e0: 2569 0066 0008 movel %a1@(102),%a2@(8) omqstat->mq_maxmsg = the_core_mq->maximum_pending_messages; 494e6: 2569 005e 0004 movel %a1@(94),%a2@(4) omqstat->mq_curmsgs = the_core_mq->number_of_pending_messages; 494ec: 2569 0062 000c movel %a1@(98),%a2@(12) } the_mq_fd->oflag = mqstat->mq_flags; 494f2: 2153 0014 movel %a3@,%a0@(20) _Thread_Enable_dispatch(); 494f6: 4eb9 0004 c7aa jsr 4c7aa <_Thread_Enable_dispatch> 494fc: 4281 clrl %d1 return 0; 494fe: 600e bras 4950e <== ALWAYS TAKEN #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); 49500: 4eb9 0005 2870 jsr 52870 <__errno> 49506: 72ff moveq #-1,%d1 49508: 2040 moveal %d0,%a0 4950a: 7009 moveq #9,%d0 4950c: 2080 movel %d0,%a0@ } 4950e: 246e fff4 moveal %fp@(-12),%a2 49512: 2001 movel %d1,%d0 49514: 266e fff8 moveal %fp@(-8),%a3 49518: 4e5e unlk %fp 4951a: 4e75 rts 000495ac : */ int mq_unlink( const char *name ) { 495ac: 4e56 fff0 linkw %fp,#-16 495b0: 2039 0006 4bd0 movel 64bd0 <_Thread_Dispatch_disable_level>,%d0 495b6: 5280 addql #1,%d0 495b8: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 495bc: 23c0 0006 4bd0 movel %d0,64bd0 <_Thread_Dispatch_disable_level> register POSIX_Message_queue_Control *the_mq; Objects_Id the_mq_id; _Thread_Disable_dispatch(); status = _POSIX_Message_queue_Name_to_id( name, &the_mq_id ); 495c2: 486e fffc pea %fp@(-4) 495c6: 45f9 0004 c7aa lea 4c7aa <_Thread_Enable_dispatch>,%a2 495cc: 2f2e 0008 movel %fp@(8),%sp@- 495d0: 4eb9 0004 f31c jsr 4f31c <_POSIX_Message_queue_Name_to_id> if ( status != 0 ) { 495d6: 508f addql #8,%sp register POSIX_Message_queue_Control *the_mq; Objects_Id the_mq_id; _Thread_Disable_dispatch(); status = _POSIX_Message_queue_Name_to_id( name, &the_mq_id ); 495d8: 2400 movel %d0,%d2 if ( status != 0 ) { 495da: 6710 beqs 495ec _Thread_Enable_dispatch(); 495dc: 4e92 jsr %a2@ rtems_set_errno_and_return_minus_one( status ); 495de: 4eb9 0005 2870 jsr 52870 <__errno> 495e4: 2040 moveal %d0,%a0 495e6: 70ff moveq #-1,%d0 495e8: 2082 movel %d2,%a0@ 495ea: 6034 bras 49620 <== ALWAYS TAKEN } the_mq = (POSIX_Message_queue_Control *) _Objects_Get_local_object( 495ec: 4280 clrl %d0 495ee: 2079 0006 4eb6 moveal 64eb6 <_POSIX_Message_queue_Information+0x18>,%a0 495f4: 302e fffe movew %fp@(-2),%d0 495f8: 2670 0c00 moveal %a0@(00000000,%d0:l:4),%a3 &_POSIX_Message_queue_Information, _Objects_Get_index( the_mq_id ) ); the_mq->linked = false; 495fc: 4200 clrb %d0 495fe: 1740 0015 moveb %d0,%a3@(21) RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Namespace_remove ( POSIX_Message_queue_Control *the_mq ) { _Objects_Namespace_remove( 49602: 2f0b movel %a3,%sp@- 49604: 4879 0006 4e9e pea 64e9e <_POSIX_Message_queue_Information> 4960a: 4eb9 0004 c0b0 jsr 4c0b0 <_Objects_Namespace_remove> _POSIX_Message_queue_Namespace_remove( the_mq ); _POSIX_Message_queue_Delete( the_mq ); 49610: 2f0b movel %a3,%sp@- 49612: 4eb9 0004 8f10 jsr 48f10 <_POSIX_Message_queue_Delete> _Thread_Enable_dispatch(); 49618: 4e92 jsr %a2@ return 0; 4961a: 4fef 000c lea %sp@(12),%sp the_mq->linked = false; _POSIX_Message_queue_Namespace_remove( the_mq ); _POSIX_Message_queue_Delete( the_mq ); _Thread_Enable_dispatch(); 4961e: 4280 clrl %d0 return 0; } 49620: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3 49626: 4e5e unlk %fp 49628: 4e75 rts ... 00062470 : int nanosleep( const struct timespec *rqtp, struct timespec *rmtp ) { 62470: 4e56 fff4 linkw %fp,#-12 62474: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 62478: 266e 0008 moveal %fp@(8),%a3 6247c: 246e 000c moveal %fp@(12),%a2 Watchdog_Interval ticks; if ( !_Timespec_Is_valid( rqtp ) ) 62480: 2f0b movel %a3,%sp@- 62482: 4eb9 0006 2584 jsr 62584 <_Timespec_Is_valid> 62488: 588f addql #4,%sp 6248a: 4a00 tstb %d0 6248c: 670a beqs 62498 * 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 ) 6248e: 4a93 tstl %a3@ 62490: 6d06 blts 62498 <== ALWAYS TAKEN 62492: 4aab 0004 tstl %a3@(4) 62496: 6c12 bges 624aa <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); 62498: 4eb9 0005 3cf4 jsr 53cf4 <__errno> 6249e: 7416 moveq #22,%d2 624a0: 72ff moveq #-1,%d1 624a2: 2040 moveal %d0,%a0 624a4: 2082 movel %d2,%a0@ 624a6: 6000 00ce braw 62576 ticks = _Timespec_To_ticks( rqtp ); 624aa: 2f0b movel %a3,%sp@- 624ac: 47f9 0004 a752 lea 4a752 <_Thread_Enable_dispatch>,%a3 624b2: 4eb9 0005 0e64 jsr 50e64 <_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 ) { 624b8: 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 ); 624ba: 2400 movel %d0,%d2 * A nanosleep for zero time is implemented as a yield. * This behavior is also beyond the POSIX specification but is * consistent with the RTEMS API and yields desirable behavior. */ if ( !ticks ) { 624bc: 6628 bnes 624e6 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 624be: 2039 0006 86ec movel 686ec <_Thread_Dispatch_disable_level>,%d0 624c4: 5280 addql #1,%d0 624c6: 23c0 0006 86ec movel %d0,686ec <_Thread_Dispatch_disable_level> _Thread_Disable_dispatch(); _Thread_Yield_processor(); 624cc: 4eb9 0004 b37c jsr 4b37c <_Thread_Yield_processor> _Thread_Enable_dispatch(); 624d2: 4e93 jsr %a3@ if ( rmtp ) { 624d4: 4a8a tstl %a2 624d6: 6700 009c beqw 62574 rmtp->tv_sec = 0; rmtp->tv_nsec = 0; 624da: 42aa 0004 clrl %a2@(4) 624de: 4281 clrl %d1 if ( !ticks ) { _Thread_Disable_dispatch(); _Thread_Yield_processor(); _Thread_Enable_dispatch(); if ( rmtp ) { rmtp->tv_sec = 0; 624e0: 4292 clrl %a2@ 624e2: 6000 0092 braw 62576 <== ALWAYS TAKEN 624e6: 2039 0006 86ec movel 686ec <_Thread_Dispatch_disable_level>,%d0 624ec: 5280 addql #1,%d0 624ee: 23c0 0006 86ec movel %d0,686ec <_Thread_Dispatch_disable_level> /* * Block for the desired amount of time */ _Thread_Disable_dispatch(); _Thread_Set_state( 624f4: 2f3c 1000 0008 movel #268435464,%sp@- 624fa: 2f39 0006 87a6 movel 687a6 <_Thread_Executing>,%sp@- 62500: 4eb9 0004 afa0 jsr 4afa0 <_Thread_Set_state> STATES_DELAYING | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Watchdog_Initialize( &_Thread_Executing->Timer, _Thread_Delay_ended, _Thread_Executing->Object.id, 62506: 2079 0006 87a6 moveal 687a6 <_Thread_Executing>,%a0 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 6250c: 203c 0004 a5c4 movel #304580,%d0 62512: 2140 0064 movel %d0,%a0@(100) _Thread_Disable_dispatch(); _Thread_Set_state( _Thread_Executing, STATES_DELAYING | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Watchdog_Initialize( 62516: 2028 0008 movel %a0@(8),%d0 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 6251a: 42a8 0050 clrl %a0@(80) the_watchdog->routine = routine; the_watchdog->id = id; 6251e: 2140 0068 movel %d0,%a0@(104) the_watchdog->user_data = user_data; 62522: 42a8 006c clrl %a0@(108) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 62526: 2142 0054 movel %d2,%a0@(84) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 6252a: 4868 0048 pea %a0@(72) 6252e: 4879 0006 87c4 pea 687c4 <_Watchdog_Ticks_chain> 62534: 4eb9 0004 b760 jsr 4b760 <_Watchdog_Insert> _Thread_Delay_ended, _Thread_Executing->Object.id, NULL ); _Watchdog_Insert_ticks( &_Thread_Executing->Timer, ticks ); _Thread_Enable_dispatch(); 6253a: 4e93 jsr %a3@ /* calculate time remaining */ if ( rmtp ) { 6253c: 4fef 0010 lea %sp@(16),%sp 62540: 4a8a tstl %a2 62542: 6730 beqs 62574 ticks -= _Thread_Executing->Timer.stop_time - _Thread_Executing->Timer.start_time; 62544: 2079 0006 87a6 moveal 687a6 <_Thread_Executing>,%a0 _Thread_Enable_dispatch(); /* calculate time remaining */ if ( rmtp ) { ticks -= 6254a: 2028 005c movel %a0@(92),%d0 6254e: 90a8 0060 subl %a0@(96),%d0 62552: d480 addl %d0,%d2 _Thread_Executing->Timer.stop_time - _Thread_Executing->Timer.start_time; _Timespec_From_ticks( ticks, rmtp ); 62554: 2f0a movel %a2,%sp@- 62556: 2f02 movel %d2,%sp@- 62558: 4eb9 0005 0e28 jsr 50e28 <_Timespec_From_ticks> */ #if defined(RTEMS_POSIX_API) /* * If there is time remaining, then we were interrupted by a signal. */ if ( ticks ) 6255e: 508f addql #8,%sp 62560: 4a82 tstl %d2 62562: 6710 beqs 62574 rtems_set_errno_and_return_minus_one( EINTR ); 62564: 4eb9 0005 3cf4 jsr 53cf4 <__errno> 6256a: 72ff moveq #-1,%d1 6256c: 2040 moveal %d0,%a0 6256e: 7004 moveq #4,%d0 62570: 2080 movel %d0,%a0@ 62572: 6002 bras 62576 <== ALWAYS TAKEN 62574: 4281 clrl %d1 #endif } return 0; } 62576: 2001 movel %d1,%d0 62578: 4cee 0c04 fff4 moveml %fp@(-12),%d2/%a2-%a3 6257e: 4e5e unlk %fp 62580: 4e75 rts ... 00048e74 : #include int pthread_attr_destroy( pthread_attr_t *attr ) { 48e74: 4e56 0000 linkw %fp,#0 48e78: 206e 0008 moveal %fp@(8),%a0 if ( !attr || !attr->is_initialized ) 48e7c: 4a88 tstl %a0 48e7e: 670a beqs 48e8a 48e80: 4a90 tstl %a0@ 48e82: 6706 beqs 48e8a return EINVAL; attr->is_initialized = false; 48e84: 4290 clrl %a0@ 48e86: 4280 clrl %d0 return 0; 48e88: 6002 bras 48e8c <== ALWAYS TAKEN 48e8a: 7016 moveq #22,%d0 } 48e8c: 4e5e unlk %fp 48e8e: 4e75 rts 000493cc : int pthread_attr_getcputime( pthread_attr_t *attr, int *clock_allowed ) { 493cc: 4e56 0000 linkw %fp,#0 493d0: 206e 0008 moveal %fp@(8),%a0 493d4: 226e 000c moveal %fp@(12),%a1 if ( !attr || !attr->is_initialized || !clock_allowed ) 493d8: 4a88 tstl %a0 493da: 6710 beqs 493ec 493dc: 4a90 tstl %a0@ 493de: 670c beqs 493ec 493e0: 4a89 tstl %a1 493e2: 6708 beqs 493ec return EINVAL; *clock_allowed = attr->cputime_clock_allowed; 493e4: 22a8 0030 movel %a0@(48),%a1@ 493e8: 4280 clrl %d0 return 0; 493ea: 6002 bras 493ee <== ALWAYS TAKEN 493ec: 7016 moveq #22,%d0 } 493ee: 4e5e unlk %fp 493f0: 4e75 rts ... 00048e90 : int pthread_attr_getdetachstate( const pthread_attr_t *attr, int *detachstate ) { 48e90: 4e56 0000 linkw %fp,#0 48e94: 206e 0008 moveal %fp@(8),%a0 48e98: 226e 000c moveal %fp@(12),%a1 if ( !attr || !attr->is_initialized || !detachstate ) 48e9c: 4a88 tstl %a0 48e9e: 6710 beqs 48eb0 48ea0: 4a90 tstl %a0@ 48ea2: 670c beqs 48eb0 48ea4: 4a89 tstl %a1 48ea6: 6708 beqs 48eb0 return EINVAL; *detachstate = attr->detachstate; 48ea8: 22a8 0034 movel %a0@(52),%a1@ 48eac: 4280 clrl %d0 return 0; 48eae: 6002 bras 48eb2 <== ALWAYS TAKEN 48eb0: 7016 moveq #22,%d0 } 48eb2: 4e5e unlk %fp 48eb4: 4e75 rts ... 00048eb8 : int pthread_attr_getinheritsched( const pthread_attr_t *attr, int *inheritsched ) { 48eb8: 4e56 0000 linkw %fp,#0 48ebc: 206e 0008 moveal %fp@(8),%a0 48ec0: 226e 000c moveal %fp@(12),%a1 if ( !attr || !attr->is_initialized || !inheritsched ) 48ec4: 4a88 tstl %a0 48ec6: 6710 beqs 48ed8 48ec8: 4a90 tstl %a0@ 48eca: 670c beqs 48ed8 48ecc: 4a89 tstl %a1 48ece: 6708 beqs 48ed8 return EINVAL; *inheritsched = attr->inheritsched; 48ed0: 22a8 0010 movel %a0@(16),%a1@ 48ed4: 4280 clrl %d0 return 0; 48ed6: 6002 bras 48eda <== ALWAYS TAKEN 48ed8: 7016 moveq #22,%d0 } 48eda: 4e5e unlk %fp 48edc: 4e75 rts ... 00048ee0 : int pthread_attr_getschedparam( const pthread_attr_t *attr, struct sched_param *param ) { 48ee0: 4e56 0000 linkw %fp,#0 48ee4: 206e 0008 moveal %fp@(8),%a0 48ee8: 202e 000c movel %fp@(12),%d0 if ( !attr || !attr->is_initialized || !param ) 48eec: 4a88 tstl %a0 48eee: 6720 beqs 48f10 48ef0: 4a90 tstl %a0@ 48ef2: 671c beqs 48f10 48ef4: 4a80 tstl %d0 48ef6: 6718 beqs 48f10 return EINVAL; *param = attr->schedparam; 48ef8: 4878 0018 pea 18 48efc: 4868 0018 pea %a0@(24) 48f00: 2f00 movel %d0,%sp@- 48f02: 4eb9 0005 2260 jsr 52260 return 0; 48f08: 4fef 000c lea %sp@(12),%sp ) { if ( !attr || !attr->is_initialized || !param ) return EINVAL; *param = attr->schedparam; 48f0c: 4280 clrl %d0 return 0; 48f0e: 6002 bras 48f12 <== ALWAYS TAKEN 48f10: 7016 moveq #22,%d0 } 48f12: 4e5e unlk %fp 48f14: 4e75 rts ... 00048f18 : int pthread_attr_getschedpolicy( const pthread_attr_t *attr, int *policy ) { 48f18: 4e56 0000 linkw %fp,#0 48f1c: 206e 0008 moveal %fp@(8),%a0 48f20: 226e 000c moveal %fp@(12),%a1 if ( !attr || !attr->is_initialized || !policy ) 48f24: 4a88 tstl %a0 48f26: 6710 beqs 48f38 48f28: 4a90 tstl %a0@ 48f2a: 670c beqs 48f38 48f2c: 4a89 tstl %a1 48f2e: 6708 beqs 48f38 return EINVAL; *policy = attr->schedpolicy; 48f30: 22a8 0014 movel %a0@(20),%a1@ 48f34: 4280 clrl %d0 return 0; 48f36: 6002 bras 48f3a <== ALWAYS TAKEN 48f38: 7016 moveq #22,%d0 } 48f3a: 4e5e unlk %fp 48f3c: 4e75 rts ... 00048f40 : int pthread_attr_getscope( const pthread_attr_t *attr, int *contentionscope ) { 48f40: 4e56 0000 linkw %fp,#0 48f44: 206e 0008 moveal %fp@(8),%a0 48f48: 226e 000c moveal %fp@(12),%a1 if ( !attr || !attr->is_initialized || !contentionscope ) 48f4c: 4a88 tstl %a0 48f4e: 6710 beqs 48f60 48f50: 4a90 tstl %a0@ 48f52: 670c beqs 48f60 48f54: 4a89 tstl %a1 48f56: 6708 beqs 48f60 return EINVAL; *contentionscope = attr->contentionscope; 48f58: 22a8 000c movel %a0@(12),%a1@ 48f5c: 4280 clrl %d0 return 0; 48f5e: 6002 bras 48f62 <== ALWAYS TAKEN 48f60: 7016 moveq #22,%d0 } 48f62: 4e5e unlk %fp 48f64: 4e75 rts ... 00048f68 : int pthread_attr_getstackaddr( const pthread_attr_t *attr, void **stackaddr ) { 48f68: 4e56 0000 linkw %fp,#0 48f6c: 206e 0008 moveal %fp@(8),%a0 48f70: 226e 000c moveal %fp@(12),%a1 if ( !attr || !attr->is_initialized || !stackaddr ) 48f74: 4a88 tstl %a0 48f76: 6710 beqs 48f88 48f78: 4a90 tstl %a0@ 48f7a: 670c beqs 48f88 48f7c: 4a89 tstl %a1 48f7e: 6708 beqs 48f88 return EINVAL; *stackaddr = attr->stackaddr; 48f80: 22a8 0004 movel %a0@(4),%a1@ 48f84: 4280 clrl %d0 return 0; 48f86: 6002 bras 48f8a <== ALWAYS TAKEN 48f88: 7016 moveq #22,%d0 } 48f8a: 4e5e unlk %fp 48f8c: 4e75 rts ... 00048f90 : int pthread_attr_getstacksize( const pthread_attr_t *attr, size_t *stacksize ) { 48f90: 4e56 0000 linkw %fp,#0 48f94: 206e 0008 moveal %fp@(8),%a0 48f98: 226e 000c moveal %fp@(12),%a1 if ( !attr || !attr->is_initialized || !stacksize ) 48f9c: 4a88 tstl %a0 48f9e: 6710 beqs 48fb0 48fa0: 4a90 tstl %a0@ 48fa2: 670c beqs 48fb0 48fa4: 4a89 tstl %a1 48fa6: 6708 beqs 48fb0 return EINVAL; *stacksize = attr->stacksize; 48fa8: 22a8 0008 movel %a0@(8),%a1@ 48fac: 4280 clrl %d0 return 0; 48fae: 6002 bras 48fb2 <== ALWAYS TAKEN 48fb0: 7016 moveq #22,%d0 } 48fb2: 4e5e unlk %fp 48fb4: 4e75 rts ... 0004a964 : #include int pthread_attr_init( pthread_attr_t *attr ) { 4a964: 4e56 0000 linkw %fp,#0 4a968: 202e 0008 movel %fp@(8),%d0 if ( !attr ) 4a96c: 6606 bnes 4a974 4a96e: 103c 0016 moveb #22,%d0 4a972: 6018 bras 4a98c <== ALWAYS TAKEN return EINVAL; *attr = _POSIX_Threads_Default_attributes; 4a974: 4878 0038 pea 38 4a978: 4879 0005 b59c pea 5b59c <_POSIX_Threads_Default_attributes> 4a97e: 2f00 movel %d0,%sp@- 4a980: 4eb9 0004 dfa8 jsr 4dfa8 return 0; 4a986: 4fef 000c lea %sp@(12),%sp ) { if ( !attr ) return EINVAL; *attr = _POSIX_Threads_Default_attributes; 4a98a: 4280 clrl %d0 return 0; } 4a98c: 4e5e unlk %fp 4a98e: 4e75 rts 00049864 : int pthread_attr_setcputime( pthread_attr_t *attr, int clock_allowed ) { 49864: 4e56 0000 linkw %fp,#0 49868: 206e 0008 moveal %fp@(8),%a0 4986c: 202e 000c movel %fp@(12),%d0 if ( !attr || !attr->is_initialized ) 49870: 4a88 tstl %a0 49872: 6712 beqs 49886 49874: 4a90 tstl %a0@ 49876: 670e beqs 49886 return EINVAL; switch ( clock_allowed ) { 49878: 7201 moveq #1,%d1 4987a: b280 cmpl %d0,%d1 4987c: 6508 bcss 49886 case CLOCK_ENABLED: case CLOCK_DISABLED: attr->cputime_clock_allowed = clock_allowed; 4987e: 2140 0030 movel %d0,%a0@(48) 49882: 4280 clrl %d0 return 0; 49884: 6002 bras 49888 <== ALWAYS TAKEN 49886: 7016 moveq #22,%d0 default: return EINVAL; } } 49888: 4e5e unlk %fp 4988a: 4e75 rts 00048fe4 : int pthread_attr_setdetachstate( pthread_attr_t *attr, int detachstate ) { 48fe4: 4e56 0000 linkw %fp,#0 48fe8: 206e 0008 moveal %fp@(8),%a0 48fec: 202e 000c movel %fp@(12),%d0 if ( !attr || !attr->is_initialized ) 48ff0: 4a88 tstl %a0 48ff2: 6712 beqs 49006 <== ALWAYS TAKEN 48ff4: 4a90 tstl %a0@ 48ff6: 670e beqs 49006 <== ALWAYS TAKEN return EINVAL; switch ( detachstate ) { 48ff8: 7201 moveq #1,%d1 48ffa: b280 cmpl %d0,%d1 48ffc: 6508 bcss 49006 <== ALWAYS TAKEN case PTHREAD_CREATE_DETACHED: case PTHREAD_CREATE_JOINABLE: attr->detachstate = detachstate; 48ffe: 2140 0034 movel %d0,%a0@(52) 49002: 4280 clrl %d0 return 0; 49004: 6002 bras 49008 <== ALWAYS TAKEN 49006: 7016 moveq #22,%d0 default: return EINVAL; } } 49008: 4e5e unlk %fp 4900a: 4e75 rts 0004a990 : int pthread_attr_setinheritsched( pthread_attr_t *attr, int inheritsched ) { 4a990: 4e56 0000 linkw %fp,#0 4a994: 206e 0008 moveal %fp@(8),%a0 4a998: 222e 000c movel %fp@(12),%d1 4a99c: 2f02 movel %d2,%sp@- if ( !attr || !attr->is_initialized ) 4a99e: 4a88 tstl %a0 4a9a0: 671c beqs 4a9be 4a9a2: 4a90 tstl %a0@ 4a9a4: 6718 beqs 4a9be return EINVAL; switch ( inheritsched ) { 4a9a6: 2241 moveal %d1,%a1 4a9a8: 5389 subql #1,%a1 4a9aa: 203c 0000 0086 movel #134,%d0 4a9b0: 7401 moveq #1,%d2 4a9b2: b489 cmpl %a1,%d2 4a9b4: 650a bcss 4a9c0 case PTHREAD_INHERIT_SCHED: case PTHREAD_EXPLICIT_SCHED: attr->inheritsched = inheritsched; 4a9b6: 2141 0010 movel %d1,%a0@(16) 4a9ba: 4200 clrb %d0 return 0; 4a9bc: 6002 bras 4a9c0 <== ALWAYS TAKEN 4a9be: 7016 moveq #22,%d0 default: return ENOTSUP; } } 4a9c0: 241f movel %sp@+,%d2 4a9c2: 4e5e unlk %fp 4a9c4: 4e75 rts ... 00049044 : int pthread_attr_setschedparam( pthread_attr_t *attr, const struct sched_param *param ) { 49044: 4e56 0000 linkw %fp,#0 49048: 206e 0008 moveal %fp@(8),%a0 4904c: 202e 000c movel %fp@(12),%d0 if ( !attr || !attr->is_initialized || !param ) 49050: 4a88 tstl %a0 49052: 6720 beqs 49074 49054: 4a90 tstl %a0@ 49056: 671c beqs 49074 49058: 4a80 tstl %d0 4905a: 6718 beqs 49074 return EINVAL; attr->schedparam = *param; 4905c: 4878 0018 pea 18 49060: 2f00 movel %d0,%sp@- 49062: 4868 0018 pea %a0@(24) 49066: 4eb9 0005 2260 jsr 52260 return 0; 4906c: 4fef 000c lea %sp@(12),%sp ) { if ( !attr || !attr->is_initialized || !param ) return EINVAL; attr->schedparam = *param; 49070: 4280 clrl %d0 return 0; 49072: 6002 bras 49076 <== ALWAYS TAKEN 49074: 7016 moveq #22,%d0 } 49076: 4e5e unlk %fp 49078: 4e75 rts ... 0004907c : int pthread_attr_setschedpolicy( pthread_attr_t *attr, int policy ) { 4907c: 4e56 0000 linkw %fp,#0 49080: 206e 0008 moveal %fp@(8),%a0 49084: 222e 000c movel %fp@(12),%d1 49088: 2f02 movel %d2,%sp@- if ( !attr || !attr->is_initialized ) 4908a: 4a88 tstl %a0 4908c: 6718 beqs 490a6 4908e: 4a90 tstl %a0@ 49090: 6714 beqs 490a6 return EINVAL; switch ( policy ) { 49092: 203c 0000 0086 movel #134,%d0 49098: 7403 moveq #3,%d2 4909a: b481 cmpl %d1,%d2 4909c: 650a bcss 490a8 case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: case SCHED_SPORADIC: attr->schedpolicy = policy; 4909e: 2141 0014 movel %d1,%a0@(20) 490a2: 4200 clrb %d0 return 0; 490a4: 6002 bras 490a8 <== ALWAYS TAKEN 490a6: 7016 moveq #22,%d0 default: return ENOTSUP; } } 490a8: 241f movel %sp@+,%d2 490aa: 4e5e unlk %fp 490ac: 4e75 rts ... 000490b0 : int pthread_attr_setscope( pthread_attr_t *attr, int contentionscope ) { 490b0: 4e56 0000 linkw %fp,#0 490b4: 206e 0008 moveal %fp@(8),%a0 490b8: 222e 000c movel %fp@(12),%d1 490bc: 2f02 movel %d2,%sp@- if ( !attr || !attr->is_initialized ) 490be: 4a88 tstl %a0 490c0: 671e beqs 490e0 490c2: 4a90 tstl %a0@ 490c4: 671a beqs 490e0 return EINVAL; switch ( contentionscope ) { 490c6: 4a81 tstl %d1 490c8: 670e beqs 490d8 490ca: 203c 0000 0086 movel #134,%d0 490d0: 7401 moveq #1,%d2 490d2: b481 cmpl %d1,%d2 490d4: 660a bnes 490e0 490d6: 600a bras 490e2 <== ALWAYS TAKEN case PTHREAD_SCOPE_PROCESS: attr->contentionscope = contentionscope; 490d8: 42a8 000c clrl %a0@(12) 490dc: 4280 clrl %d0 return 0; 490de: 6002 bras 490e2 <== ALWAYS TAKEN 490e0: 7016 moveq #22,%d0 return ENOTSUP; default: return EINVAL; } } 490e2: 241f movel %sp@+,%d2 490e4: 4e5e unlk %fp 490e6: 4e75 rts 000490e8 : int pthread_attr_setstackaddr( pthread_attr_t *attr, void *stackaddr ) { 490e8: 4e56 0000 linkw %fp,#0 490ec: 206e 0008 moveal %fp@(8),%a0 if ( !attr || !attr->is_initialized ) 490f0: 4a88 tstl %a0 490f2: 670e beqs 49102 490f4: 4a90 tstl %a0@ 490f6: 670a beqs 49102 return EINVAL; attr->stackaddr = stackaddr; 490f8: 4280 clrl %d0 490fa: 216e 000c 0004 movel %fp@(12),%a0@(4) return 0; 49100: 6002 bras 49104 <== ALWAYS TAKEN 49102: 7016 moveq #22,%d0 } 49104: 4e5e unlk %fp 49106: 4e75 rts 0004a9c8 : int pthread_attr_setstacksize( pthread_attr_t *attr, size_t stacksize ) { 4a9c8: 4e56 0000 linkw %fp,#0 4a9cc: 206e 0008 moveal %fp@(8),%a0 4a9d0: 222e 000c movel %fp@(12),%d1 if ( !attr || !attr->is_initialized ) 4a9d4: 4a88 tstl %a0 4a9d6: 671e beqs 4a9f6 4a9d8: 4a90 tstl %a0@ 4a9da: 671a beqs 4a9f6 return EINVAL; if (stacksize < PTHREAD_MINIMUM_STACK_SIZE) 4a9dc: 2039 0005 c702 movel 5c702 ,%d0 4a9e2: d080 addl %d0,%d0 4a9e4: b081 cmpl %d1,%d0 4a9e6: 6306 blss 4a9ee attr->stacksize = PTHREAD_MINIMUM_STACK_SIZE; 4a9e8: 2140 0008 movel %d0,%a0@(8) 4a9ec: 6004 bras 4a9f2 <== ALWAYS TAKEN else attr->stacksize = stacksize; 4a9ee: 2141 0008 movel %d1,%a0@(8) 4a9f2: 4280 clrl %d0 4a9f4: 6002 bras 4a9f8 <== ALWAYS TAKEN 4a9f6: 7016 moveq #22,%d0 return 0; } 4a9f8: 4e5e unlk %fp 4a9fa: 4e75 rts 00045240 : */ int pthread_barrier_destroy( pthread_barrier_t *barrier ) { 45240: 4e56 fffc linkw %fp,#-4 45244: 206e 0008 moveal %fp@(8),%a0 45248: 2f0b movel %a3,%sp@- 4524a: 2f0a movel %a2,%sp@- POSIX_Barrier_Control *the_barrier = NULL; Objects_Locations location; if ( !barrier ) 4524c: 4a88 tstl %a0 4524e: 6756 beqs 452a6 RTEMS_INLINE_ROUTINE POSIX_Barrier_Control *_POSIX_Barrier_Get ( pthread_barrier_t *barrier, Objects_Locations *location ) { return (POSIX_Barrier_Control *) _Objects_Get( 45250: 486e fffc pea %fp@(-4) 45254: 2f10 movel %a0@,%sp@- 45256: 4879 0005 e68a pea 5e68a <_POSIX_Barrier_Information> 4525c: 4eb9 0004 750c jsr 4750c <_Objects_Get> return EINVAL; the_barrier = _POSIX_Barrier_Get( barrier, &location ); switch ( location ) { 45262: 4fef 000c lea %sp@(12),%sp 45266: 2440 moveal %d0,%a2 45268: 4aae fffc tstl %fp@(-4) 4526c: 6638 bnes 452a6 4526e: 47f9 0004 7c96 lea 47c96 <_Thread_Enable_dispatch>,%a3 case OBJECTS_LOCAL: if ( the_barrier->Barrier.number_of_waiting_threads != 0 ) { 45274: 4aaa 0058 tstl %a2@(88) 45278: 6706 beqs 45280 _Thread_Enable_dispatch(); 4527a: 4e93 jsr %a3@ 4527c: 7010 moveq #16,%d0 return EBUSY; 4527e: 6028 bras 452a8 <== ALWAYS TAKEN } _Objects_Close( &_POSIX_Barrier_Information, &the_barrier->Object ); 45280: 2f00 movel %d0,%sp@- 45282: 4879 0005 e68a pea 5e68a <_POSIX_Barrier_Information> 45288: 4eb9 0004 7140 jsr 47140 <_Objects_Close> */ RTEMS_INLINE_ROUTINE void _POSIX_Barrier_Free ( POSIX_Barrier_Control *the_barrier ) { _Objects_Free( &_POSIX_Barrier_Information, &the_barrier->Object ); 4528e: 2f0a movel %a2,%sp@- 45290: 4879 0005 e68a pea 5e68a <_POSIX_Barrier_Information> 45296: 4eb9 0004 73b4 jsr 473b4 <_Objects_Free> _POSIX_Barrier_Free( the_barrier ); _Thread_Enable_dispatch(); 4529c: 4e93 jsr %a3@ return 0; 4529e: 4fef 0010 lea %sp@(16),%sp _Objects_Close( &_POSIX_Barrier_Information, &the_barrier->Object ); _POSIX_Barrier_Free( the_barrier ); _Thread_Enable_dispatch(); 452a2: 4280 clrl %d0 return 0; 452a4: 6002 bras 452a8 <== ALWAYS TAKEN 452a6: 7016 moveq #22,%d0 case OBJECTS_ERROR: break; } return EINVAL; } 452a8: 246e fff4 moveal %fp@(-12),%a2 452ac: 266e fff8 moveal %fp@(-8),%a3 452b0: 4e5e unlk %fp 452b2: 4e75 rts 000452b4 : int pthread_barrier_init( pthread_barrier_t *barrier, const pthread_barrierattr_t *attr, unsigned int count ) { 452b4: 4e56 ffe0 linkw %fp,#-32 452b8: 206e 000c moveal %fp@(12),%a0 452bc: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ 452c0: 266e 0008 moveal %fp@(8),%a3 452c4: 246e 0010 moveal %fp@(16),%a2 const pthread_barrierattr_t *the_attr; /* * Error check parameters */ if ( !barrier ) 452c8: 4a8b tstl %a3 452ca: 6700 008e beqw 4535a return EINVAL; if ( count == 0 ) 452ce: 4a8a tstl %a2 452d0: 6700 0088 beqw 4535a return EINVAL; /* * If the user passed in NULL, use the default attributes */ if ( attr ) { 452d4: 4a88 tstl %a0 452d6: 6614 bnes 452ec the_attr = attr; } else { (void) pthread_barrierattr_init( &my_attr ); 452d8: 240e movel %fp,%d2 452da: 0682 ffff fff0 addil #-16,%d2 452e0: 2f02 movel %d2,%sp@- 452e2: 4eb9 0004 51f8 jsr 451f8 452e8: 588f addql #4,%sp 452ea: 2042 moveal %d2,%a0 } /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) 452ec: 4a90 tstl %a0@ 452ee: 676a beqs 4535a return EINVAL; switch ( the_attr->process_shared ) { 452f0: 4aa8 0004 tstl %a0@(4) 452f4: 6664 bnes 4535a <== ALWAYS TAKEN rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 452f6: 2039 0005 e348 movel 5e348 <_Thread_Dispatch_disable_level>,%d0 452fc: 5280 addql #1,%d0 /* * Convert from POSIX attributes to Core Barrier attributes */ the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE; the_attributes.maximum_count = count; 452fe: 2d4a fffc movel %a2,%fp@(-4) 45302: 23c0 0005 e348 movel %d0,5e348 <_Thread_Dispatch_disable_level> } /* * Convert from POSIX attributes to Core Barrier attributes */ the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE; 45308: 42ae fff8 clrl %fp@(-8) * This function allocates a barrier control block from * the inactive chain of free barrier control blocks. */ RTEMS_INLINE_ROUTINE POSIX_Barrier_Control *_POSIX_Barrier_Allocate( void ) { return (POSIX_Barrier_Control *) 4530c: 4879 0005 e68a pea 5e68a <_POSIX_Barrier_Information> 45312: 45f9 0004 7c96 lea 47c96 <_Thread_Enable_dispatch>,%a2 45318: 4eb9 0004 70c0 jsr 470c0 <_Objects_Allocate> */ _Thread_Disable_dispatch(); /* prevents deletion */ the_barrier = _POSIX_Barrier_Allocate(); if ( !the_barrier ) { 4531e: 588f addql #4,%sp 45320: 2840 moveal %d0,%a4 45322: 4a80 tstl %d0 45324: 6606 bnes 4532c _Thread_Enable_dispatch(); 45326: 4e92 jsr %a2@ 45328: 700b moveq #11,%d0 return EAGAIN; 4532a: 6030 bras 4535c <== ALWAYS TAKEN } _CORE_barrier_Initialize( &the_barrier->Barrier, &the_attributes ); 4532c: 486e fff8 pea %fp@(-8) 45330: 486c 0010 pea %a4@(16) 45334: 4eb9 0004 685c jsr 4685c <_CORE_barrier_Initialize> #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4533a: 202c 0008 movel %a4@(8),%d0 4533e: 4281 clrl %d1 45340: 2079 0005 e6a2 moveal 5e6a2 <_POSIX_Barrier_Information+0x18>,%a0 45346: 3200 movew %d0,%d1 45348: 218c 1c00 movel %a4,%a0@(00000000,%d1:l:4) _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 4534c: 42ac 000c clrl %a4@(12) ); /* * Exit the critical section and return the user an operational barrier */ *barrier = the_barrier->Object.id; 45350: 2680 movel %d0,%a3@ _Thread_Enable_dispatch(); 45352: 4e92 jsr %a2@ return 0; 45354: 508f addql #8,%sp /* * Exit the critical section and return the user an operational barrier */ *barrier = the_barrier->Object.id; _Thread_Enable_dispatch(); 45356: 4280 clrl %d0 return 0; 45358: 6002 bras 4535c <== ALWAYS TAKEN 4535a: 7016 moveq #22,%d0 } 4535c: 4cee 1c04 ffe0 moveml %fp@(-32),%d2/%a2-%a4 45362: 4e5e unlk %fp 45364: 4e75 rts ... 00045368 : */ int pthread_barrier_wait( pthread_barrier_t *barrier ) { 45368: 4e56 fffc linkw %fp,#-4 4536c: 206e 0008 moveal %fp@(8),%a0 POSIX_Barrier_Control *the_barrier = NULL; Objects_Locations location; if ( !barrier ) 45370: 4a88 tstl %a0 45372: 6750 beqs 453c4 RTEMS_INLINE_ROUTINE POSIX_Barrier_Control *_POSIX_Barrier_Get ( pthread_barrier_t *barrier, Objects_Locations *location ) { return (POSIX_Barrier_Control *) _Objects_Get( 45374: 486e fffc pea %fp@(-4) 45378: 2f10 movel %a0@,%sp@- 4537a: 4879 0005 e68a pea 5e68a <_POSIX_Barrier_Information> 45380: 4eb9 0004 750c jsr 4750c <_Objects_Get> return EINVAL; the_barrier = _POSIX_Barrier_Get( barrier, &location ); switch ( location ) { 45386: 4fef 000c lea %sp@(12),%sp 4538a: 4aae fffc tstl %fp@(-4) 4538e: 6634 bnes 453c4 case OBJECTS_LOCAL: _CORE_barrier_Wait( 45390: 42a7 clrl %sp@- 45392: 2040 moveal %d0,%a0 45394: 42a7 clrl %sp@- 45396: 4878 0001 pea 1 4539a: 2f28 0008 movel %a0@(8),%sp@- 4539e: 4868 0010 pea %a0@(16) 453a2: 4eb9 0004 6898 jsr 46898 <_CORE_barrier_Wait> the_barrier->Object.id, true, 0, NULL ); _Thread_Enable_dispatch(); 453a8: 4eb9 0004 7c96 jsr 47c96 <_Thread_Enable_dispatch> return _POSIX_Barrier_Translate_core_barrier_return_code( 453ae: 2079 0005 e402 moveal 5e402 <_Thread_Executing>,%a0 453b4: 2f28 0034 movel %a0@(52),%sp@- 453b8: 4eb9 0004 a788 jsr 4a788 <_POSIX_Barrier_Translate_core_barrier_return_code> 453be: 4fef 0018 lea %sp@(24),%sp 453c2: 6002 bras 453c6 <== ALWAYS TAKEN 453c4: 7016 moveq #22,%d0 case OBJECTS_ERROR: break; } return EINVAL; } 453c6: 4e5e unlk %fp 453c8: 4e75 rts ... 000451b8 : */ int pthread_barrierattr_destroy( pthread_barrierattr_t *attr ) { 451b8: 4e56 0000 linkw %fp,#0 451bc: 206e 0008 moveal %fp@(8),%a0 if ( !attr || attr->is_initialized == false ) 451c0: 4a88 tstl %a0 451c2: 670a beqs 451ce 451c4: 4a90 tstl %a0@ 451c6: 6706 beqs 451ce return EINVAL; attr->is_initialized = false; 451c8: 4290 clrl %a0@ 451ca: 4280 clrl %d0 return 0; 451cc: 6002 bras 451d0 <== ALWAYS TAKEN 451ce: 7016 moveq #22,%d0 } 451d0: 4e5e unlk %fp 451d2: 4e75 rts 000451d4 : int pthread_barrierattr_getpshared( const pthread_barrierattr_t *attr, int *pshared ) { 451d4: 4e56 0000 linkw %fp,#0 451d8: 206e 0008 moveal %fp@(8),%a0 if ( !attr ) 451dc: 4a88 tstl %a0 451de: 6710 beqs 451f0 return EINVAL; if ( !attr->is_initialized ) 451e0: 4a90 tstl %a0@ 451e2: 670c beqs 451f0 return EINVAL; *pshared = attr->process_shared; 451e4: 226e 000c moveal %fp@(12),%a1 451e8: 4280 clrl %d0 451ea: 22a8 0004 movel %a0@(4),%a1@ return 0; 451ee: 6002 bras 451f2 <== ALWAYS TAKEN 451f0: 7016 moveq #22,%d0 } 451f2: 4e5e unlk %fp 451f4: 4e75 rts ... 000451f8 : */ int pthread_barrierattr_init( pthread_barrierattr_t *attr ) { 451f8: 4e56 0000 linkw %fp,#0 451fc: 206e 0008 moveal %fp@(8),%a0 if ( !attr ) 45200: 4a88 tstl %a0 45202: 6604 bnes 45208 45204: 7016 moveq #22,%d0 45206: 600a bras 45212 <== ALWAYS TAKEN return EINVAL; attr->is_initialized = true; 45208: 7201 moveq #1,%d1 attr->process_shared = PTHREAD_PROCESS_PRIVATE; 4520a: 4280 clrl %d0 4520c: 42a8 0004 clrl %a0@(4) ) { if ( !attr ) return EINVAL; attr->is_initialized = true; 45210: 2081 movel %d1,%a0@ attr->process_shared = PTHREAD_PROCESS_PRIVATE; return 0; } 45212: 4e5e unlk %fp 45214: 4e75 rts ... 00045218 : int pthread_barrierattr_setpshared( pthread_barrierattr_t *attr, int pshared ) { 45218: 4e56 0000 linkw %fp,#0 4521c: 206e 0008 moveal %fp@(8),%a0 45220: 202e 000c movel %fp@(12),%d0 if ( !attr ) 45224: 4a88 tstl %a0 45226: 6712 beqs 4523a return EINVAL; if ( !attr->is_initialized ) 45228: 4a90 tstl %a0@ 4522a: 670e beqs 4523a return EINVAL; switch ( pshared ) { 4522c: 7201 moveq #1,%d1 4522e: b280 cmpl %d0,%d1 45230: 6508 bcss 4523a case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; 45232: 2140 0004 movel %d0,%a0@(4) 45236: 4280 clrl %d0 return 0; 45238: 6002 bras 4523c <== ALWAYS TAKEN 4523a: 7016 moveq #22,%d0 default: return EINVAL; } } 4523c: 4e5e unlk %fp 4523e: 4e75 rts 00044a80 : */ int pthread_cancel( pthread_t thread ) { 44a80: 4e56 fffc linkw %fp,#-4 /* * Don't even think about deleting a resource from an ISR. */ if ( _ISR_Is_in_progress() ) 44a84: 2039 0005 d5f2 movel 5d5f2 <_ISR_Nest_level>,%d0 44a8a: 6704 beqs 44a90 44a8c: 7047 moveq #71,%d0 44a8e: 603a bras 44aca <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Get ( pthread_t id, Objects_Locations *location ) { return (Thread_Control *) 44a90: 486e fffc pea %fp@(-4) 44a94: 2f2e 0008 movel %fp@(8),%sp@- 44a98: 4879 0005 d73e pea 5d73e <_POSIX_Threads_Information> 44a9e: 4eb9 0004 6890 jsr 46890 <_Objects_Get> return EPROTO; the_thread = _POSIX_Threads_Get( thread, &location ); switch ( location ) { 44aa4: 4fef 000c lea %sp@(12),%sp 44aa8: 4aae fffc tstl %fp@(-4) 44aac: 6704 beqs 44ab2 44aae: 7016 moveq #22,%d0 44ab0: 6018 bras 44aca <== ALWAYS TAKEN case OBJECTS_LOCAL: thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; thread_support->cancelation_requested = 1; 44ab2: 2240 moveal %d0,%a1 44ab4: 7201 moveq #1,%d1 44ab6: 2069 010e moveal %a1@(270),%a0 44aba: 2141 00d4 movel %d1,%a0@(212) /* This enables dispatch implicitly */ _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch( the_thread ); 44abe: 2f00 movel %d0,%sp@- 44ac0: 4eb9 0004 9830 jsr 49830 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch> return 0; 44ac6: 588f addql #4,%sp thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; thread_support->cancelation_requested = 1; /* This enables dispatch implicitly */ _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch( the_thread ); 44ac8: 4280 clrl %d0 case OBJECTS_ERROR: break; } return EINVAL; } 44aca: 4e5e unlk %fp 44acc: 4e75 rts ... 000448f8 : */ void pthread_cleanup_pop( int execute ) { 448f8: 4e56 ffdc linkw %fp,#-36 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 448fc: 2039 0005 d1ac movel 5d1ac <_Thread_Dispatch_disable_level>,%d0 44902: 5280 addql #1,%d0 POSIX_Cancel_Handler_control tmp_handler; Chain_Control *handler_stack; POSIX_API_Control *thread_support; ISR_Level level; thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 44904: 2079 0005 d266 moveal 5d266 <_Thread_Executing>,%a0 */ void pthread_cleanup_pop( int execute ) { 4490a: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ POSIX_Cancel_Handler_control tmp_handler; Chain_Control *handler_stack; POSIX_API_Control *thread_support; ISR_Level level; thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 4490e: 2268 010e moveal %a0@(270),%a1 */ void pthread_cleanup_pop( int execute ) { 44912: 282e 0008 movel %fp@(8),%d4 44916: 23c0 0005 d1ac movel %d0,5d1ac <_Thread_Dispatch_disable_level> * ensure that we do not get prempted and deleted while we are holding * memory that needs to be freed. */ _Thread_Disable_dispatch(); _ISR_Disable( level ); 4491c: 203c 0000 0700 movel #1792,%d0 44922: 40c2 movew %sr,%d2 44924: 8082 orl %d2,%d0 44926: 46c0 movew %d0,%sr 44928: 47f9 0004 6d4a lea 46d4a <_Thread_Enable_dispatch>,%a3 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4492e: 41e9 00dc lea %a1@(220),%a0 POSIX_API_Control *thread_support; ISR_Level level; thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; handler_stack = &thread_support->Cancellation_Handlers; 44932: b1e9 00d8 cmpal %a1@(216),%a0 44936: 6606 bnes 4493e _Thread_Disable_dispatch(); _ISR_Disable( level ); if ( _Chain_Is_empty( handler_stack ) ) { _Thread_Enable_dispatch(); 44938: 4e93 jsr %a3@ _ISR_Enable( level ); 4493a: 46c2 movew %d2,%sr return; 4493c: 604c bras 4498a <== ALWAYS TAKEN } handler = (POSIX_Cancel_Handler_control *) 4493e: 2468 0004 moveal %a0@(4),%a2 ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 44942: 2052 moveal %a2@,%a0 previous = the_node->previous; 44944: 226a 0004 moveal %a2@(4),%a1 next->previous = previous; previous->next = next; 44948: 2288 movel %a0,%a1@ Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; next->previous = previous; 4494a: 2149 0004 movel %a1,%a0@(4) _Chain_Tail( handler_stack )->previous; _Chain_Extract_unprotected( &handler->Node ); _ISR_Enable( level ); 4494e: 46c2 movew %d2,%sr tmp_handler = *handler; 44950: 4878 0010 pea 10 44954: 2f0a movel %a2,%sp@- 44956: 486e fff0 pea %fp@(-16) 4495a: 4eb9 0004 d844 jsr 4d844 44960: 262e fff8 movel %fp@(-8),%d3 _Workspace_Free( handler ); 44964: 2f0a movel %a2,%sp@- _Chain_Tail( handler_stack )->previous; _Chain_Extract_unprotected( &handler->Node ); _ISR_Enable( level ); tmp_handler = *handler; 44966: 242e fffc movel %fp@(-4),%d2 _Workspace_Free( handler ); 4496a: 4eb9 0004 7f14 jsr 47f14 <_Workspace_Free> _Thread_Enable_dispatch(); 44970: 4e93 jsr %a3@ if ( execute ) 44972: 4fef 0010 lea %sp@(16),%sp 44976: 4a84 tstl %d4 44978: 6710 beqs 4498a (*tmp_handler.routine)( tmp_handler.arg ); 4497a: 2243 moveal %d3,%a1 4497c: 2d42 0008 movel %d2,%fp@(8) } 44980: 4cee 0c1c ffdc moveml %fp@(-36),%d2-%d4/%a2-%a3 44986: 4e5e unlk %fp _Workspace_Free( handler ); _Thread_Enable_dispatch(); if ( execute ) (*tmp_handler.routine)( tmp_handler.arg ); 44988: 4ed1 jmp %a1@ } 4498a: 4cee 0c1c ffdc moveml %fp@(-36),%d2-%d4/%a2-%a3 44990: 4e5e unlk %fp 44992: 4e75 rts 00044cdc : void pthread_cleanup_push( void (*routine)( void * ), void *arg ) { 44cdc: 4e56 0000 linkw %fp,#0 44ce0: 2f03 movel %d3,%sp@- 44ce2: 262e 000c movel %fp@(12),%d3 44ce6: 2f02 movel %d2,%sp@- 44ce8: 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 ) 44cec: 6754 beqs 44d42 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 44cee: 2039 0005 ddb0 movel 5ddb0 <_Thread_Dispatch_disable_level>,%d0 44cf4: 5280 addql #1,%d0 44cf6: 23c0 0005 ddb0 movel %d0,5ddb0 <_Thread_Dispatch_disable_level> return; _Thread_Disable_dispatch(); handler = _Workspace_Allocate( sizeof( POSIX_Cancel_Handler_control ) ); 44cfc: 4878 0010 pea 10 44d00: 4eb9 0004 8944 jsr 48944 <_Workspace_Allocate> if ( handler ) { 44d06: 588f addql #4,%sp 44d08: 4a80 tstl %d0 44d0a: 6726 beqs 44d32 <== ALWAYS TAKEN thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; handler_stack = &thread_support->Cancellation_Handlers; 44d0c: 2079 0005 de6a moveal 5de6a <_Thread_Executing>,%a0 44d12: 2228 010e movel %a0@(270),%d1 handler->routine = routine; 44d16: 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; 44d18: 0681 0000 00d8 addil #216,%d1 handler->routine = routine; 44d1e: 2142 0008 movel %d2,%a0@(8) handler->arg = arg; 44d22: 2143 000c movel %d3,%a0@(12) _Chain_Append( handler_stack, &handler->Node ); 44d26: 2f00 movel %d0,%sp@- 44d28: 2f01 movel %d1,%sp@- 44d2a: 4eb9 0004 6360 jsr 46360 <_Chain_Append> 44d30: 508f addql #8,%sp } _Thread_Enable_dispatch(); } 44d32: 242e fff8 movel %fp@(-8),%d2 44d36: 262e fffc movel %fp@(-4),%d3 44d3a: 4e5e unlk %fp handler->routine = routine; handler->arg = arg; _Chain_Append( handler_stack, &handler->Node ); } _Thread_Enable_dispatch(); 44d3c: 4ef9 0004 7702 jmp 47702 <_Thread_Enable_dispatch> } 44d42: 242e fff8 movel %fp@(-8),%d2 44d46: 262e fffc movel %fp@(-4),%d3 44d4a: 4e5e unlk %fp 44d4c: 4e75 rts ... 0004597c : */ int pthread_cond_destroy( pthread_cond_t *cond ) { 4597c: 4e56 fffc linkw %fp,#-4 45980: 2f0b movel %a3,%sp@- 45982: 2f0a movel %a2,%sp@- POSIX_Condition_variables_Control *the_cond; Objects_Locations location; the_cond = _POSIX_Condition_variables_Get( cond, &location ); 45984: 486e fffc pea %fp@(-4) 45988: 2f2e 0008 movel %fp@(8),%sp@- 4598c: 4eb9 0004 59ec jsr 459ec <_POSIX_Condition_variables_Get> switch ( location ) { 45992: 508f addql #8,%sp ) { POSIX_Condition_variables_Control *the_cond; Objects_Locations location; the_cond = _POSIX_Condition_variables_Get( cond, &location ); 45994: 2440 moveal %d0,%a2 switch ( location ) { 45996: 4aae fffc tstl %fp@(-4) 4599a: 6704 beqs 459a0 4599c: 7016 moveq #22,%d0 4599e: 6040 bras 459e0 <== ALWAYS TAKEN case OBJECTS_LOCAL: if ( _Thread_queue_First( &the_cond->Wait_queue ) ) { 459a0: 486a 0018 pea %a2@(24) 459a4: 47f9 0004 899a lea 4899a <_Thread_Enable_dispatch>,%a3 459aa: 4eb9 0004 9020 jsr 49020 <_Thread_queue_First> 459b0: 588f addql #4,%sp 459b2: 4a80 tstl %d0 459b4: 6706 beqs 459bc _Thread_Enable_dispatch(); 459b6: 4e93 jsr %a3@ 459b8: 7010 moveq #16,%d0 return EBUSY; 459ba: 6024 bras 459e0 <== ALWAYS TAKEN } _Objects_Close( 459bc: 2f0a movel %a2,%sp@- 459be: 4879 0005 f792 pea 5f792 <_POSIX_Condition_variables_Information> 459c4: 4eb9 0004 7e44 jsr 47e44 <_Objects_Close> RTEMS_INLINE_ROUTINE void _POSIX_Condition_variables_Free ( POSIX_Condition_variables_Control *the_condition_variable ) { _Objects_Free( 459ca: 2f0a movel %a2,%sp@- 459cc: 4879 0005 f792 pea 5f792 <_POSIX_Condition_variables_Information> 459d2: 4eb9 0004 80b8 jsr 480b8 <_Objects_Free> &_POSIX_Condition_variables_Information, &the_cond->Object ); _POSIX_Condition_variables_Free( the_cond ); _Thread_Enable_dispatch(); 459d8: 4e93 jsr %a3@ return 0; 459da: 4fef 0010 lea %sp@(16),%sp &_POSIX_Condition_variables_Information, &the_cond->Object ); _POSIX_Condition_variables_Free( the_cond ); _Thread_Enable_dispatch(); 459de: 4280 clrl %d0 case OBJECTS_ERROR: break; } return EINVAL; } 459e0: 246e fff4 moveal %fp@(-12),%a2 459e4: 266e fff8 moveal %fp@(-8),%a3 459e8: 4e5e unlk %fp 459ea: 4e75 rts 00045a40 : int pthread_cond_init( pthread_cond_t *cond, const pthread_condattr_t *attr ) { 45a40: 4e56 fff4 linkw %fp,#-12 45a44: 202e 000c movel %fp@(12),%d0 45a48: 48d7 1c00 moveml %a2-%a4,%sp@ POSIX_Condition_variables_Control *the_cond; const pthread_condattr_t *the_attr; if ( attr ) the_attr = attr; 45a4c: 45f9 0005 ca9c lea 5ca9c <_POSIX_Condition_variables_Default_attributes>,%a2 45a52: 4a80 tstl %d0 45a54: 6702 beqs 45a58 45a56: 2440 moveal %d0,%a2 /* * Be careful about attributes when global!!! */ if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) 45a58: 7001 moveq #1,%d0 45a5a: b0aa 0004 cmpl %a2@(4),%d0 45a5e: 6776 beqs 45ad6 <== ALWAYS TAKEN return EINVAL; if ( !the_attr->is_initialized ) 45a60: 4a92 tstl %a2@ 45a62: 6772 beqs 45ad6 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 45a64: 2039 0005 f3c4 movel 5f3c4 <_Thread_Dispatch_disable_level>,%d0 45a6a: 5280 addql #1,%d0 45a6c: 23c0 0005 f3c4 movel %d0,5f3c4 <_Thread_Dispatch_disable_level> */ RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *_POSIX_Condition_variables_Allocate( void ) { return (POSIX_Condition_variables_Control *) 45a72: 4879 0005 f792 pea 5f792 <_POSIX_Condition_variables_Information> 45a78: 47f9 0004 899a lea 4899a <_Thread_Enable_dispatch>,%a3 45a7e: 4eb9 0004 7dc4 jsr 47dc4 <_Objects_Allocate> _Thread_Disable_dispatch(); the_cond = _POSIX_Condition_variables_Allocate(); if ( !the_cond ) { 45a84: 588f addql #4,%sp 45a86: 2840 moveal %d0,%a4 45a88: 4a80 tstl %d0 45a8a: 6606 bnes 45a92 _Thread_Enable_dispatch(); 45a8c: 4e93 jsr %a3@ 45a8e: 700c moveq #12,%d0 return ENOMEM; 45a90: 6046 bras 45ad8 <== ALWAYS TAKEN } the_cond->process_shared = the_attr->process_shared; the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX; 45a92: 42ac 0014 clrl %a4@(20) if ( !the_cond ) { _Thread_Enable_dispatch(); return ENOMEM; } the_cond->process_shared = the_attr->process_shared; 45a96: 296a 0004 0010 movel %a2@(4),%a4@(16) the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX; /* XXX some more initialization might need to go here */ _Thread_queue_Initialize( 45a9c: 4878 0074 pea 74 45aa0: 4878 0800 pea 800 45aa4: 42a7 clrl %sp@- 45aa6: 486c 0018 pea %a4@(24) 45aaa: 4eb9 0004 90ac jsr 490ac <_Thread_queue_Initialize> #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 45ab0: 202c 0008 movel %a4@(8),%d0 45ab4: 4281 clrl %d1 45ab6: 2079 0005 f7aa moveal 5f7aa <_POSIX_Condition_variables_Information+0x18>,%a0 45abc: 3200 movew %d0,%d1 45abe: 218c 1c00 movel %a4,%a0@(00000000,%d1:l:4) _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 45ac2: 42ac 000c clrl %a4@(12) &_POSIX_Condition_variables_Information, &the_cond->Object, 0 ); *cond = the_cond->Object.id; 45ac6: 206e 0008 moveal %fp@(8),%a0 45aca: 2080 movel %d0,%a0@ _Thread_Enable_dispatch(); 45acc: 4e93 jsr %a3@ return 0; 45ace: 4fef 0010 lea %sp@(16),%sp 0 ); *cond = the_cond->Object.id; _Thread_Enable_dispatch(); 45ad2: 4280 clrl %d0 return 0; 45ad4: 6002 bras 45ad8 <== ALWAYS TAKEN 45ad6: 7016 moveq #22,%d0 } 45ad8: 4cee 1c00 fff4 moveml %fp@(-12),%a2-%a4 45ade: 4e5e unlk %fp 45ae0: 4e75 rts ... 00045b58 : int pthread_cond_timedwait( pthread_cond_t *cond, pthread_mutex_t *mutex, const struct timespec *abstime ) { 45b58: 4e56 fffc linkw %fp,#-4 * So we check the abstime provided, and hold on to whether it * is valid or not. If it isn't correct and in the future, * then we do a polling operation and convert the UNSATISFIED * status into the appropriate error. */ switch ( _POSIX_Absolute_timeout_to_ticks(abstime, &ticks) ) { 45b5c: 486e fffc pea %fp@(-4) 45b60: 2f2e 0010 movel %fp@(16),%sp@- 45b64: 4eb9 0004 5fc4 jsr 45fc4 <_POSIX_Absolute_timeout_to_ticks> 45b6a: 508f addql #8,%sp 45b6c: 4a80 tstl %d0 45b6e: 6728 beqs 45b98 45b70: 7202 moveq #2,%d1 45b72: b280 cmpl %d0,%d1 45b74: 55c0 scs %d0 45b76: 5280 addql #1,%d0 default: /* only to silence warnings */ already_timedout = false; break; } return _POSIX_Condition_variables_Wait_support( 45b78: 0280 0000 00ff andil #255,%d0 45b7e: 2f00 movel %d0,%sp@- 45b80: 2f2e fffc movel %fp@(-4),%sp@- 45b84: 2f2e 000c movel %fp@(12),%sp@- 45b88: 2f2e 0008 movel %fp@(8),%sp@- 45b8c: 4eb9 0004 5bbc jsr 45bbc <_POSIX_Condition_variables_Wait_support> 45b92: 4fef 0010 lea %sp@(16),%sp 45b96: 6002 bras 45b9a <== ALWAYS TAKEN * So we check the abstime provided, and hold on to whether it * is valid or not. If it isn't correct and in the future, * then we do a polling operation and convert the UNSATISFIED * status into the appropriate error. */ switch ( _POSIX_Absolute_timeout_to_ticks(abstime, &ticks) ) { 45b98: 7016 moveq #22,%d0 cond, mutex, ticks, already_timedout ); } 45b9a: 4e5e unlk %fp 45b9c: 4e75 rts ... 000458d8 : */ int pthread_condattr_destroy( pthread_condattr_t *attr ) { 458d8: 4e56 0000 linkw %fp,#0 458dc: 206e 0008 moveal %fp@(8),%a0 if ( !attr || attr->is_initialized == false ) 458e0: 4a88 tstl %a0 458e2: 670a beqs 458ee 458e4: 4a90 tstl %a0@ 458e6: 6706 beqs 458ee <== ALWAYS TAKEN return EINVAL; attr->is_initialized = false; 458e8: 4290 clrl %a0@ 458ea: 4280 clrl %d0 return 0; 458ec: 6002 bras 458f0 <== ALWAYS TAKEN 458ee: 7016 moveq #22,%d0 } 458f0: 4e5e unlk %fp 458f2: 4e75 rts 000458f4 : int pthread_condattr_getpshared( const pthread_condattr_t *attr, int *pshared ) { 458f4: 4e56 0000 linkw %fp,#0 458f8: 206e 0008 moveal %fp@(8),%a0 if ( !attr ) 458fc: 4a88 tstl %a0 458fe: 6604 bnes 45904 45900: 7016 moveq #22,%d0 45902: 600a bras 4590e <== ALWAYS TAKEN return EINVAL; *pshared = attr->process_shared; 45904: 226e 000c moveal %fp@(12),%a1 45908: 4280 clrl %d0 4590a: 22a8 0004 movel %a0@(4),%a1@ return 0; } 4590e: 4e5e unlk %fp 45910: 4e75 rts ... 00045914 : */ int pthread_condattr_init( pthread_condattr_t *attr ) { 45914: 4e56 0000 linkw %fp,#0 45918: 206e 0008 moveal %fp@(8),%a0 4591c: 2f02 movel %d2,%sp@- if ( !attr ) 4591e: 4a88 tstl %a0 45920: 6604 bnes 45926 45922: 7016 moveq #22,%d0 45924: 6014 bras 4593a <== ALWAYS TAKEN return EINVAL; *attr = _POSIX_Condition_variables_Default_attributes; 45926: 4280 clrl %d0 45928: 2239 0005 ca9c movel 5ca9c <_POSIX_Condition_variables_Default_attributes>,%d1 4592e: 2439 0005 caa0 movel 5caa0 <_POSIX_Condition_variables_Default_attributes+0x4>,%d2 45934: 2081 movel %d1,%a0@ 45936: 2142 0004 movel %d2,%a0@(4) return 0; } 4593a: 241f movel %sp@+,%d2 4593c: 4e5e unlk %fp 4593e: 4e75 rts 00045940 : int pthread_condattr_setpshared( pthread_condattr_t *attr, int pshared ) { 45940: 4e56 0000 linkw %fp,#0 45944: 206e 0008 moveal %fp@(8),%a0 45948: 202e 000c movel %fp@(12),%d0 if ( !attr ) 4594c: 4a88 tstl %a0 4594e: 670e beqs 4595e return EINVAL; switch ( pshared ) { 45950: 7201 moveq #1,%d1 45952: b280 cmpl %d0,%d1 45954: 6508 bcss 4595e case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; 45956: 2140 0004 movel %d0,%a0@(4) 4595a: 4280 clrl %d0 return 0; 4595c: 6002 bras 45960 <== ALWAYS TAKEN 4595e: 7016 moveq #22,%d0 default: return EINVAL; } } 45960: 4e5e unlk %fp 45962: 4e75 rts 00045024 : pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine)( void * ), void *arg ) { 45024: 4e56 ffc0 linkw %fp,#-64 45028: 202e 000c movel %fp@(12),%d0 4502c: 48d7 3c3c moveml %d2-%d5/%a2-%a5,%sp@ 45030: 282e 0010 movel %fp@(16),%d4 int schedpolicy = SCHED_RR; struct sched_param schedparam; Objects_Name name; int rc; if ( !start_routine ) 45034: 6606 bnes 4503c 45036: 740e moveq #14,%d2 45038: 6000 01e2 braw 4521c <== ALWAYS TAKEN return EFAULT; the_attr = (attr) ? attr : &_POSIX_Threads_Default_attributes; 4503c: 45f9 0005 b59c lea 5b59c <_POSIX_Threads_Default_attributes>,%a2 45042: 4a80 tstl %d0 45044: 6702 beqs 45048 45046: 2440 moveal %d0,%a2 if ( !the_attr->is_initialized ) 45048: 4a92 tstl %a2@ 4504a: 6700 01ce beqw 4521a * 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) ) 4504e: 4aaa 0004 tstl %a2@(4) 45052: 670e beqs 45062 45054: 2039 0005 c702 movel 5c702 ,%d0 4505a: b0aa 0008 cmpl %a2@(8),%d0 4505e: 6200 01ba bhiw 4521a * 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 ) { 45062: 202a 0010 movel %a2@(16),%d0 45066: 7201 moveq #1,%d1 45068: b280 cmpl %d0,%d1 4506a: 670c beqs 45078 4506c: 123c 0002 moveb #2,%d1 45070: b280 cmpl %d0,%d1 45072: 6600 01a6 bnew 4521a 45076: 6018 bras 45090 <== ALWAYS TAKEN case PTHREAD_INHERIT_SCHED: api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 45078: 2079 0005 df4e moveal 5df4e <_Thread_Executing>,%a0 4507e: 2068 010e moveal %a0@(270),%a0 schedpolicy = api->schedpolicy; 45082: 2628 007c movel %a0@(124),%d3 schedparam = api->schedparam; 45086: 4878 0018 pea 18 4508a: 4868 0080 pea %a0@(128) 4508e: 600c bras 4509c <== ALWAYS TAKEN break; case PTHREAD_EXPLICIT_SCHED: schedpolicy = the_attr->schedpolicy; 45090: 262a 0014 movel %a2@(20),%d3 schedparam = the_attr->schedparam; 45094: 4878 0018 pea 18 45098: 486a 0018 pea %a2@(24) 4509c: 486e ffe0 pea %fp@(-32) /* * Check the contentionscope since rtems only supports PROCESS wide * contention (i.e. no system wide contention). */ if ( the_attr->contentionscope != PTHREAD_SCOPE_PROCESS ) 450a0: 243c 0000 0086 movel #134,%d2 schedparam = api->schedparam; break; case PTHREAD_EXPLICIT_SCHED: schedpolicy = the_attr->schedpolicy; schedparam = the_attr->schedparam; 450a6: 4eb9 0004 dfa8 jsr 4dfa8 break; 450ac: 4fef 000c lea %sp@(12),%sp /* * Check the contentionscope since rtems only supports PROCESS wide * contention (i.e. no system wide contention). */ if ( the_attr->contentionscope != PTHREAD_SCOPE_PROCESS ) 450b0: 4aaa 000c tstl %a2@(12) 450b4: 6600 0166 bnew 4521c return ENOTSUP; /* * Interpret the scheduling parameters. */ if ( !_POSIX_Priority_Is_valid( schedparam.sched_priority ) ) 450b8: 2f2e ffe0 movel %fp@(-32),%sp@- 450bc: 4eb9 0004 a890 jsr 4a890 <_POSIX_Priority_Is_valid> 450c2: 588f addql #4,%sp 450c4: 4a00 tstb %d0 450c6: 6700 0152 beqw 4521a <== ALWAYS TAKEN core_priority = _POSIX_Priority_To_core( schedparam.sched_priority ); /* * Set the core scheduling policy information. */ rc = _POSIX_Thread_Translate_sched_param( 450ca: 486e fff8 pea %fp@(-8) 450ce: 486e fffc pea %fp@(-4) 450d2: 486e ffe0 pea %fp@(-32) * Interpret the scheduling parameters. */ if ( !_POSIX_Priority_Is_valid( schedparam.sched_priority ) ) return EINVAL; core_priority = _POSIX_Priority_To_core( schedparam.sched_priority ); 450d6: 286e ffe0 moveal %fp@(-32),%a4 /* * Set the core scheduling policy information. */ rc = _POSIX_Thread_Translate_sched_param( 450da: 2f03 movel %d3,%sp@- RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( int priority ) { return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1); 450dc: 1a39 0005 c706 moveb 5c706 ,%d5 450e2: 4eb9 0004 a8b4 jsr 4a8b4 <_POSIX_Thread_Translate_sched_param> schedpolicy, &schedparam, &budget_algorithm, &budget_callout ); if ( rc ) 450e8: 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( 450ec: 2400 movel %d0,%d2 schedpolicy, &schedparam, &budget_algorithm, &budget_callout ); if ( rc ) 450ee: 6600 012c bnew 4521c <== ALWAYS TAKEN #endif /* * Lock the allocator mutex for protection */ _RTEMS_Lock_allocator(); 450f2: 2f39 0005 df46 movel 5df46 <_RTEMS_Allocator_Mutex>,%sp@- 450f8: 4eb9 0004 6710 jsr 46710 <_API_Mutex_Lock> * _POSIX_Threads_Allocate */ RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate( void ) { return (Thread_Control *) _Objects_Allocate( &_POSIX_Threads_Information ); 450fe: 4879 0005 e07a pea 5e07a <_POSIX_Threads_Information> 45104: 4eb9 0004 6f70 jsr 46f70 <_Objects_Allocate> * Allocate the thread control block. * * NOTE: Global threads are not currently supported. */ the_thread = _POSIX_Threads_Allocate(); if ( !the_thread ) { 4510a: 508f addql #8,%sp 4510c: 2640 moveal %d0,%a3 4510e: 4a80 tstl %d0 45110: 660e bnes 45120 _RTEMS_Unlock_allocator(); 45112: 2f39 0005 df46 movel 5df46 <_RTEMS_Allocator_Mutex>,%sp@- 45118: 143c 000b moveb #11,%d2 4511c: 6000 00f2 braw 45210 <== ALWAYS TAKEN /* * Initialize the core thread for this task. */ name.name_p = NULL; /* posix threads don't have a name by default */ status = _Thread_Initialize( 45120: 222a 0008 movel %a2@(8),%d1 45124: 42a7 clrl %sp@- 45126: 2039 0005 c702 movel 5c702 ,%d0 4512c: 42a7 clrl %sp@- 4512e: 2f2e fff8 movel %fp@(-8),%sp@- 45132: 2f2e fffc movel %fp@(-4),%sp@- 45136: 4878 0001 pea 1 4513a: 0285 0000 00ff andil #255,%d5 45140: d080 addl %d0,%d0 45142: 9a8c subl %a4,%d5 45144: 2f05 movel %d5,%sp@- 45146: 4878 0001 pea 1 4514a: b280 cmpl %d0,%d1 4514c: 6302 blss 45150 4514e: 2001 movel %d1,%d0 45150: 2f00 movel %d0,%sp@- 45152: 2f2a 0004 movel %a2@(4),%sp@- 45156: 2f0b movel %a3,%sp@- 45158: 4879 0005 e07a pea 5e07a <_POSIX_Threads_Information> 4515e: 4eb9 0004 7c28 jsr 47c28 <_Thread_Initialize> budget_callout, 0, /* isr level */ name /* posix threads don't have a name */ ); if ( !status ) { 45164: 4fef 002c lea %sp@(44),%sp 45168: 4a00 tstb %d0 4516a: 6624 bnes 45190 RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free ( Thread_Control *the_pthread ) { _Objects_Free( &_POSIX_Threads_Information, &the_pthread->Object ); 4516c: 2f0b movel %a3,%sp@- 4516e: 4879 0005 e07a pea 5e07a <_POSIX_Threads_Information> _POSIX_Threads_Free( the_thread ); _RTEMS_Unlock_allocator(); 45174: 740b moveq #11,%d2 45176: 4eb9 0004 7264 jsr 47264 <_Objects_Free> 4517c: 2f39 0005 df46 movel 5df46 <_RTEMS_Allocator_Mutex>,%sp@- 45182: 4eb9 0004 6770 jsr 46770 <_API_Mutex_Unlock> return EAGAIN; 45188: 4fef 000c lea %sp@(12),%sp 4518c: 6000 008e braw 4521c <== ALWAYS TAKEN } /* * finish initializing the per API structure */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 45190: 286b 010e moveal %a3@(270),%a4 api->Attributes = *the_attr; 45194: 4878 0038 pea 38 45198: 4bf9 0004 dfa8 lea 4dfa8 ,%a5 4519e: 2f0a movel %a2,%sp@- 451a0: 2f0c movel %a4,%sp@- 451a2: 4e95 jsr %a5@ api->detachstate = the_attr->detachstate; 451a4: 296a 0034 0038 movel %a2@(52),%a4@(56) api->schedpolicy = schedpolicy; 451aa: 2943 007c movel %d3,%a4@(124) api->schedparam = schedparam; 451ae: 4878 0018 pea 18 451b2: 486e ffe0 pea %fp@(-32) 451b6: 486c 0080 pea %a4@(128) 451ba: 4e95 jsr %a5@ * 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; 451bc: 7001 moveq #1,%d0 451be: 1740 0074 moveb %d0,%a3@(116) /* * POSIX threads are allocated and started in one operation. */ status = _Thread_Start( 451c2: 42a7 clrl %sp@- 451c4: 2f2e 0014 movel %fp@(20),%sp@- 451c8: 2f04 movel %d4,%sp@- 451ca: 4878 0001 pea 1 451ce: 2f0b movel %a3,%sp@- 451d0: 4eb9 0004 85c8 jsr 485c8 <_Thread_Start> _RTEMS_Unlock_allocator(); return EINVAL; } #endif if ( schedpolicy == SCHED_SPORADIC ) { 451d6: 4fef 002c lea %sp@(44),%sp 451da: 7203 moveq #3,%d1 451dc: b283 cmpl %d3,%d1 451de: 6622 bnes 45202 _Watchdog_Insert_ticks( 451e0: 486c 0088 pea %a4@(136) 451e4: 4eb9 0004 88b0 jsr 488b0 <_Timespec_To_ticks> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 451ea: 2940 00a8 movel %d0,%a4@(168) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 451ee: 486c 009c pea %a4@(156) 451f2: 4879 0005 df6c pea 5df6c <_Watchdog_Ticks_chain> 451f8: 4eb9 0004 8bac jsr 48bac <_Watchdog_Insert> 451fe: 4fef 000c lea %sp@(12),%sp } /* * Return the id and indicate we successfully created the thread */ *thread = the_thread->Object.id; 45202: 206e 0008 moveal %fp@(8),%a0 45206: 20ab 0008 movel %a3@(8),%a0@ _RTEMS_Unlock_allocator(); 4520a: 2f39 0005 df46 movel 5df46 <_RTEMS_Allocator_Mutex>,%sp@- 45210: 4eb9 0004 6770 jsr 46770 <_API_Mutex_Unlock> return 0; 45216: 588f addql #4,%sp 45218: 6002 bras 4521c <== ALWAYS TAKEN 4521a: 7416 moveq #22,%d2 } 4521c: 2002 movel %d2,%d0 4521e: 4cee 3c3c ffc0 moveml %fp@(-64),%d2-%d5/%a2-%a5 45224: 4e5e unlk %fp 45226: 4e75 rts 000450d4 : #include int pthread_detach( pthread_t thread ) { 450d4: 4e56 fffc linkw %fp,#-4 RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Get ( pthread_t id, Objects_Locations *location ) { return (Thread_Control *) 450d8: 486e fffc pea %fp@(-4) 450dc: 2f2e 0008 movel %fp@(8),%sp@- 450e0: 4879 0005 ec8a pea 5ec8a <_POSIX_Threads_Information> 450e6: 4eb9 0004 7124 jsr 47124 <_Objects_Get> register Thread_Control *the_thread; POSIX_API_Control *api; Objects_Locations location; the_thread = _POSIX_Threads_Get( thread, &location ); switch ( location ) { 450ec: 4fef 000c lea %sp@(12),%sp 450f0: 4aae fffc tstl %fp@(-4) 450f4: 6704 beqs 450fa 450f6: 7003 moveq #3,%d0 450f8: 6012 bras 4510c <== ALWAYS TAKEN case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_POSIX ]; api->detachstate = PTHREAD_CREATE_DETACHED; 450fa: 2240 moveal %d0,%a1 450fc: 2069 010e moveal %a1@(270),%a0 45100: 42a8 0038 clrl %a0@(56) _Thread_Enable_dispatch(); 45104: 4eb9 0004 78ae jsr 478ae <_Thread_Enable_dispatch> 4510a: 4280 clrl %d0 case OBJECTS_ERROR: break; } return ESRCH; } 4510c: 4e5e unlk %fp 4510e: 4e75 rts 0004bc68 : } void pthread_exit( void *value_ptr ) { 4bc68: 4e56 0000 linkw %fp,#0 _POSIX_Thread_Exit( _Thread_Executing, value_ptr ); 4bc6c: 2f2e 0008 movel %fp@(8),%sp@- 4bc70: 2f39 0005 cf7e movel 5cf7e <_Thread_Executing>,%sp@- 4bc76: 4eb9 0004 bbf8 jsr 4bbf8 <_POSIX_Thread_Exit> 4bc7c: 508f addql #8,%sp <== NOT EXECUTED } 4bc7e: 4e5e unlk %fp <== NOT EXECUTED 4bc80: 4e75 rts <== NOT EXECUTED ... 00047110 : int pthread_getschedparam( pthread_t thread, int *policy, struct sched_param *param ) { 47110: 4e56 fff0 linkw %fp,#-16 47114: 48d7 1c00 moveml %a2-%a4,%sp@ 47118: 286e 000c moveal %fp@(12),%a4 4711c: 246e 0010 moveal %fp@(16),%a2 Objects_Locations location; POSIX_API_Control *api; register Thread_Control *the_thread; if ( !policy || !param ) 47120: 4a8c tstl %a4 47122: 675c beqs 47180 47124: 4a8a tstl %a2 47126: 6758 beqs 47180 RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Get ( pthread_t id, Objects_Locations *location ) { return (Thread_Control *) 47128: 486e fffc pea %fp@(-4) 4712c: 2f2e 0008 movel %fp@(8),%sp@- 47130: 4879 0006 1b6a pea 61b6a <_POSIX_Threads_Information> 47136: 4eb9 0004 921c jsr 4921c <_Objects_Get> return EINVAL; the_thread = _POSIX_Threads_Get( thread, &location ); switch ( location ) { 4713c: 4fef 000c lea %sp@(12),%sp 47140: 2640 moveal %d0,%a3 47142: 4aae fffc tstl %fp@(-4) 47146: 6704 beqs 4714c 47148: 7003 moveq #3,%d0 4714a: 6036 bras 47182 <== ALWAYS TAKEN case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4714c: 206b 010e moveal %a3@(270),%a0 if ( policy ) *policy = api->schedpolicy; 47150: 28a8 007c movel %a0@(124),%a4@ if ( param ) { *param = api->schedparam; 47154: 4878 0018 pea 18 47158: 4868 0080 pea %a0@(128) 4715c: 2f0a movel %a2,%sp@- 4715e: 4eb9 0004 ff04 jsr 4ff04 param->sched_priority = 47164: 4280 clrl %d0 47166: 1039 0006 0196 moveb 60196 ,%d0 4716c: 90ab 0014 subl %a3@(20),%d0 47170: 2480 movel %d0,%a2@ _POSIX_Priority_From_core( the_thread->current_priority ); } _Thread_Enable_dispatch(); 47172: 4eb9 0004 99a6 jsr 499a6 <_Thread_Enable_dispatch> return 0; 47178: 4fef 000c lea %sp@(12),%sp if ( param ) { *param = api->schedparam; param->sched_priority = _POSIX_Priority_From_core( the_thread->current_priority ); } _Thread_Enable_dispatch(); 4717c: 4280 clrl %d0 return 0; 4717e: 6002 bras 47182 <== ALWAYS TAKEN 47180: 7016 moveq #22,%d0 break; } return ESRCH; } 47182: 4cee 1c00 fff0 moveml %fp@(-16),%a2-%a4 47188: 4e5e unlk %fp 4718a: 4e75 rts 00045044 : */ void *pthread_getspecific( pthread_key_t key ) { 45044: 4e56 fffc linkw %fp,#-4 45048: 2f03 movel %d3,%sp@- 4504a: 2f02 movel %d2,%sp@- RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Get ( pthread_key_t id, Objects_Locations *location ) { return (POSIX_Keys_Control *) 4504c: 486e fffc pea %fp@(-4) 45050: 2f2e 0008 movel %fp@(8),%sp@- 45054: 4879 0005 ef18 pea 5ef18 <_POSIX_Keys_Information> 4505a: 4eb9 0004 7290 jsr 47290 <_Objects_Get> uint32_t index; Objects_Locations location; void *key_data; the_key = _POSIX_Keys_Get( key, &location ); switch ( location ) { 45060: 4fef 000c lea %sp@(12),%sp 45064: 4aae fffc tstl %fp@(-4) 45068: 6704 beqs 4506e 4506a: 4282 clrl %d2 4506c: 602c bras 4509a <== ALWAYS TAKEN case OBJECTS_LOCAL: api = _Objects_Get_API( _Thread_Executing->Object.id ); 4506e: 2079 0005 ec3e moveal 5ec3e <_Thread_Executing>,%a0 index = _Objects_Get_index( _Thread_Executing->Object.id ); key_data = (void *) the_key->Values[ api ][ index ]; 45074: 7618 moveq #24,%d3 45076: 2240 moveal %d0,%a1 the_key = _POSIX_Keys_Get( key, &location ); switch ( location ) { case OBJECTS_LOCAL: api = _Objects_Get_API( _Thread_Executing->Object.id ); 45078: 2428 0008 movel %a0@(8),%d2 index = _Objects_Get_index( _Thread_Executing->Object.id ); key_data = (void *) the_key->Values[ api ][ index ]; 4507c: 2202 movel %d2,%d1 4507e: e6a9 lsrl %d3,%d1 45080: 163c 0007 moveb #7,%d3 45084: c283 andl %d3,%d1 45086: 0282 0000 ffff andil #65535,%d2 4508c: 2071 1c14 moveal %a1@(00000014,%d1:l:4),%a0 45090: 2430 2c00 movel %a0@(00000000,%d2:l:4),%d2 _Thread_Enable_dispatch(); 45094: 4eb9 0004 7a1a jsr 47a1a <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return NULL; } 4509a: 2002 movel %d2,%d0 4509c: 242e fff4 movel %fp@(-12),%d2 450a0: 262e fff8 movel %fp@(-8),%d3 450a4: 4e5e unlk %fp 450a6: 4e75 rts 000494fc : int pthread_join( pthread_t thread, void **value_ptr ) { 494fc: 4e56 fff8 linkw %fp,#-8 49500: 2f0b movel %a3,%sp@- 49502: 2f0a movel %a2,%sp@- 49504: 486e fffc pea %fp@(-4) 49508: 2f2e 0008 movel %fp@(8),%sp@- 4950c: 4879 0006 48e6 pea 648e6 <_POSIX_Threads_Information> 49512: 246e 000c moveal %fp@(12),%a2 49516: 4eb9 0004 b554 jsr 4b554 <_Objects_Get> POSIX_API_Control *api; Objects_Locations location; void *return_pointer; the_thread = _POSIX_Threads_Get( thread, &location ); switch ( location ) { 4951c: 4fef 000c lea %sp@(12),%sp 49520: 4aae fffc tstl %fp@(-4) 49524: 6704 beqs 4952a 49526: 7003 moveq #3,%d0 49528: 605c bras 49586 <== ALWAYS TAKEN case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4952a: 2240 moveal %d0,%a1 4952c: 2069 010e moveal %a1@(270),%a0 if ( api->detachstate == PTHREAD_CREATE_DETACHED ) { 49530: 4aa8 0038 tstl %a0@(56) 49534: 660a bnes 49540 _Thread_Enable_dispatch(); 49536: 4eb9 0004 bcde jsr 4bcde <_Thread_Enable_dispatch> 4953c: 7016 moveq #22,%d0 return EINVAL; 4953e: 6046 bras 49586 <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE bool _Thread_Is_executing ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Executing ); 49540: 2279 0006 47ba moveal 647ba <_Thread_Executing>,%a1 49546: 47f9 0004 bcde lea 4bcde <_Thread_Enable_dispatch>,%a3 } if ( _Thread_Is_executing( the_thread ) ) { 4954c: b3c0 cmpal %d0,%a1 4954e: 6606 bnes 49556 _Thread_Enable_dispatch(); 49550: 4e93 jsr %a3@ 49552: 702d moveq #45,%d0 return EDEADLK; 49554: 6030 bras 49586 <== ALWAYS TAKEN /* * Put ourself on the threads join list */ _Thread_Executing->Wait.return_argument = &return_pointer; 49556: 200e movel %fp,%d0 49558: 5180 subql #8,%d0 4955a: 2340 0028 movel %d0,%a1@(40) 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; 4955e: 7001 moveq #1,%d0 49560: 2140 006c movel %d0,%a0@(108) _Thread_queue_Enter_critical_section( &api->Join_List ); _Thread_queue_Enqueue( &api->Join_List, WATCHDOG_NO_TIMEOUT ); 49564: 4879 0004 c454 pea 4c454 <_Thread_queue_Timeout> 4956a: 42a7 clrl %sp@- 4956c: 4868 003c pea %a0@(60) 49570: 4eb9 0004 c168 jsr 4c168 <_Thread_queue_Enqueue_with_handler> _Thread_Enable_dispatch(); 49576: 4e93 jsr %a3@ if ( value_ptr ) 49578: 4fef 000c lea %sp@(12),%sp 4957c: 4a8a tstl %a2 4957e: 6704 beqs 49584 *value_ptr = return_pointer; 49580: 24ae fff8 movel %fp@(-8),%a2@ 49584: 4280 clrl %d0 case OBJECTS_ERROR: break; } return ESRCH; } 49586: 246e fff0 moveal %fp@(-16),%a2 4958a: 266e fff4 moveal %fp@(-12),%a3 4958e: 4e5e unlk %fp 49590: 4e75 rts ... 00044ec8 : int pthread_key_create( pthread_key_t *key, void (*destructor)( void * ) ) { 44ec8: 4e56 ffe4 linkw %fp,#-28 44ecc: 2039 0005 eb84 movel 5eb84 <_Thread_Dispatch_disable_level>,%d0 44ed2: 5280 addql #1,%d0 44ed4: 48d7 3c1c moveml %d2-%d4/%a2-%a5,%sp@ 44ed8: 23c0 0005 eb84 movel %d0,5eb84 <_Thread_Dispatch_disable_level> * 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 ); 44ede: 4879 0005 ef18 pea 5ef18 <_POSIX_Keys_Information> 44ee4: 4eb9 0004 6e44 jsr 46e44 <_Objects_Allocate> _Thread_Disable_dispatch(); the_key = _POSIX_Keys_Allocate(); if ( !the_key ) { 44eea: 588f addql #4,%sp 44eec: 2440 moveal %d0,%a2 44eee: 4a80 tstl %d0 44ef0: 660c bnes 44efe _Thread_Enable_dispatch(); 44ef2: 4eb9 0004 7a1a jsr 47a1a <_Thread_Enable_dispatch> 44ef8: 700b moveq #11,%d0 return EAGAIN; 44efa: 6000 00ba braw 44fb6 <== ALWAYS TAKEN } the_key->destructor = destructor; 44efe: 49f9 0005 eb40 lea 5eb40 <_Objects_Information_table+0x4>,%a4 44f04: 47ea 0018 lea %a2@(24),%a3 44f08: 7401 moveq #1,%d2 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 ); 44f0a: 283c 0004 8cdc movel #298204,%d4 _Thread_Enable_dispatch(); return ENOMEM; } the_key->Values[ the_api ] = table; memset( table, '\0', bytes_to_allocate ); 44f10: 4bf9 0004 e0a4 lea 4e0a4 ,%a5 if ( !the_key ) { _Thread_Enable_dispatch(); return EAGAIN; } the_key->destructor = destructor; 44f16: 256e 000c 0010 movel %fp@(12),%a2@(16) for ( the_api = 1; the_api <= OBJECTS_APIS_LAST; the_api++ ) { if ( _Objects_Information_table[ the_api ] ) { 44f1c: 2054 moveal %a4@,%a0 44f1e: 4a88 tstl %a0 44f20: 6762 beqs 44f84 INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_IMPLEMENTATION_KEY_CREATE_INCONSISTENCY ); #endif bytes_to_allocate = sizeof( void * ) * 44f22: 2068 0004 moveal %a0@(4),%a0 44f26: 4283 clrl %d3 44f28: 3628 000e movew %a0@(14),%d3 (_Objects_Information_table[ the_api ][ 1 ]->maximum + 1); table = _Workspace_Allocate( bytes_to_allocate ); 44f2c: 2044 moveal %d4,%a0 INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_IMPLEMENTATION_KEY_CREATE_INCONSISTENCY ); #endif bytes_to_allocate = sizeof( void * ) * 44f2e: 5283 addql #1,%d3 44f30: e58b lsll #2,%d3 (_Objects_Information_table[ the_api ][ 1 ]->maximum + 1); table = _Workspace_Allocate( bytes_to_allocate ); 44f32: 2f03 movel %d3,%sp@- 44f34: 4e90 jsr %a0@ if ( !table ) { 44f36: 588f addql #4,%sp 44f38: 4a80 tstl %d0 44f3a: 6638 bnes 44f74 for ( --the_api; 44f3c: 2602 movel %d2,%d3 44f3e: 5383 subql #1,%d3 the_api >= 1; the_api-- ) _Workspace_Free( the_key->Values[ the_api ] ); 44f40: 49f9 0004 8cf8 lea 48cf8 <_Workspace_Free>,%a4 #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; 44f46: 47f2 2c10 lea %a2@(00000010,%d2:l:4),%a3 44f4a: 600a bras 44f56 <== ALWAYS TAKEN the_api >= 1; the_api-- ) _Workspace_Free( the_key->Values[ the_api ] ); 44f4c: 2f13 movel %a3@,%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-- ) 44f4e: 5383 subql #1,%d3 44f50: 598b subql #4,%a3 _Workspace_Free( the_key->Values[ the_api ] ); 44f52: 4e94 jsr %a4@ (_Objects_Information_table[ the_api ][ 1 ]->maximum + 1); table = _Workspace_Allocate( bytes_to_allocate ); if ( !table ) { for ( --the_api; the_api >= 1; the_api-- ) 44f54: 588f addql #4,%sp #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; 44f56: 4a83 tstl %d3 44f58: 66f2 bnes 44f4c */ RTEMS_INLINE_ROUTINE void _POSIX_Keys_Free ( POSIX_Keys_Control *the_key ) { _Objects_Free( &_POSIX_Keys_Information, &the_key->Object ); 44f5a: 2f0a movel %a2,%sp@- 44f5c: 4879 0005 ef18 pea 5ef18 <_POSIX_Keys_Information> 44f62: 4eb9 0004 7138 jsr 47138 <_Objects_Free> the_api >= 1; the_api-- ) _Workspace_Free( the_key->Values[ the_api ] ); _POSIX_Keys_Free( the_key ); _Thread_Enable_dispatch(); 44f68: 4eb9 0004 7a1a jsr 47a1a <_Thread_Enable_dispatch> return ENOMEM; 44f6e: 508f addql #8,%sp the_api >= 1; the_api-- ) _Workspace_Free( the_key->Values[ the_api ] ); _POSIX_Keys_Free( the_key ); _Thread_Enable_dispatch(); 44f70: 700c moveq #12,%d0 return ENOMEM; 44f72: 6042 bras 44fb6 <== ALWAYS TAKEN } the_key->Values[ the_api ] = table; 44f74: 2680 movel %d0,%a3@ memset( table, '\0', bytes_to_allocate ); 44f76: 2f03 movel %d3,%sp@- 44f78: 42a7 clrl %sp@- 44f7a: 2f00 movel %d0,%sp@- 44f7c: 4e95 jsr %a5@ 44f7e: 4fef 000c lea %sp@(12),%sp 44f82: 6002 bras 44f86 <== ALWAYS TAKEN } else { the_key->Values[ the_api ] = NULL; 44f84: 4293 clrl %a3@ * for. [NOTE: Currently RTEMS Classic API tasks are always enabled.] */ for ( the_api = 1; the_api <= OBJECTS_APIS_LAST; the_api++ ) { 44f86: 5282 addql #1,%d2 44f88: 588c addql #4,%a4 44f8a: 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; 44f8c: 7005 moveq #5,%d0 44f8e: b082 cmpl %d2,%d0 44f90: 668a bnes 44f1c #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 44f92: 202a 0008 movel %a2@(8),%d0 44f96: 4281 clrl %d1 44f98: 2079 0005 ef30 moveal 5ef30 <_POSIX_Keys_Information+0x18>,%a0 44f9e: 3200 movew %d0,%d1 44fa0: 218a 1c00 movel %a2,%a0@(00000000,%d1:l:4) _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 44fa4: 42aa 000c clrl %a2@(12) } _Objects_Open_u32( &_POSIX_Keys_Information, &the_key->Object, 0 ); *key = the_key->Object.id; 44fa8: 206e 0008 moveal %fp@(8),%a0 44fac: 2080 movel %d0,%a0@ _Thread_Enable_dispatch(); 44fae: 4eb9 0004 7a1a jsr 47a1a <_Thread_Enable_dispatch> 44fb4: 4280 clrl %d0 return 0; } 44fb6: 4cee 3c1c ffe4 moveml %fp@(-28),%d2-%d4/%a2-%a5 44fbc: 4e5e unlk %fp 44fbe: 4e75 rts 0004cb3c : int pthread_kill( pthread_t thread, int sig ) { 4cb3c: 4e56 fff0 linkw %fp,#-16 4cb40: 48d7 040c moveml %d2-%d3/%a2,%sp@ 4cb44: 242e 000c movel %fp@(12),%d2 POSIX_API_Control *api; Thread_Control *the_thread; Objects_Locations location; if ( !sig ) 4cb48: 670a beqs 4cb54 static inline bool is_valid_signo( int signo ) { return ((signo) >= 1 && (signo) <= 32 ); 4cb4a: 2602 movel %d2,%d3 4cb4c: 5383 subql #1,%d3 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 4cb4e: 701f moveq #31,%d0 4cb50: b083 cmpl %d3,%d0 4cb52: 6412 bccs 4cb66 rtems_set_errno_and_return_minus_one( EINVAL ); 4cb54: 4eb9 0004 cc58 jsr 4cc58 <__errno> 4cb5a: 7416 moveq #22,%d2 4cb5c: 72ff moveq #-1,%d1 4cb5e: 2040 moveal %d0,%a0 4cb60: 2082 movel %d2,%a0@ 4cb62: 6000 008c braw 4cbf0 RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Get ( pthread_t id, Objects_Locations *location ) { return (Thread_Control *) 4cb66: 486e fffc pea %fp@(-4) 4cb6a: 2f2e 0008 movel %fp@(8),%sp@- 4cb6e: 4879 0005 d0aa pea 5d0aa <_POSIX_Threads_Information> 4cb74: 4eb9 0004 64f4 jsr 464f4 <_Objects_Get> the_thread = _POSIX_Threads_Get( thread, &location ); switch ( location ) { 4cb7a: 4fef 000c lea %sp@(12),%sp 4cb7e: 2440 moveal %d0,%a2 4cb80: 4aae fffc tstl %fp@(-4) 4cb84: 665c bnes 4cbe2 api = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( sig ) { if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) { 4cb86: 2202 movel %d2,%d1 4cb88: 2002 movel %d2,%d0 4cb8a: e589 lsll #2,%d1 4cb8c: e988 lsll #4,%d0 case OBJECTS_LOCAL: /* * If sig == 0 then just validate arguments */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4cb8e: 206a 010e moveal %a2@(270),%a0 if ( sig ) { if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) { 4cb92: 9081 subl %d1,%d0 4cb94: 0680 0005 d37a addil #381818,%d0 4cb9a: 7201 moveq #1,%d1 4cb9c: 2240 moveal %d0,%a1 4cb9e: b291 cmpl %a1@,%d1 4cba0: 6736 beqs 4cbd8 return 0; } /* XXX critical section */ api->signals_pending |= signo_to_mask( sig ); 4cba2: 7001 moveq #1,%d0 4cba4: e7a8 lsll %d3,%d0 4cba6: 81a8 00c8 orl %d0,%a0@(200) (void) _POSIX_signals_Unblock_thread( the_thread, sig, NULL ); 4cbaa: 42a7 clrl %sp@- 4cbac: 2f02 movel %d2,%sp@- 4cbae: 2f0a movel %a2,%sp@- 4cbb0: 4eb9 0004 ca40 jsr 4ca40 <_POSIX_signals_Unblock_thread> the_thread->do_post_task_switch_extension = true; if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 4cbb6: 2039 0005 cf5e movel 5cf5e <_ISR_Nest_level>,%d0 4cbbc: 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; 4cbc0: 7201 moveq #1,%d1 4cbc2: 1541 0074 moveb %d1,%a2@(116) if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 4cbc6: 4a80 tstl %d0 4cbc8: 670e beqs 4cbd8 4cbca: b5f9 0005 cf7e cmpal 5cf7e <_Thread_Executing>,%a2 4cbd0: 6606 bnes 4cbd8 _ISR_Signals_to_thread_executing = true; 4cbd2: 13c1 0005 d00c moveb %d1,5d00c <_ISR_Signals_to_thread_executing> } _Thread_Enable_dispatch(); 4cbd8: 4eb9 0004 6cee jsr 46cee <_Thread_Enable_dispatch> 4cbde: 4281 clrl %d1 return 0; 4cbe0: 600e bras 4cbf0 <== ALWAYS TAKEN #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( ESRCH ); 4cbe2: 4eb9 0004 cc58 jsr 4cc58 <__errno> 4cbe8: 72ff moveq #-1,%d1 4cbea: 2040 moveal %d0,%a0 4cbec: 7003 moveq #3,%d0 4cbee: 2080 movel %d0,%a0@ } 4cbf0: 2001 movel %d1,%d0 4cbf2: 4cee 040c fff0 moveml %fp@(-16),%d2-%d3/%a2 4cbf8: 4e5e unlk %fp 4cbfa: 4e75 rts 0004699c : */ int pthread_mutex_destroy( pthread_mutex_t *mutex ) { 4699c: 4e56 fffc linkw %fp,#-4 469a0: 2f0b movel %a3,%sp@- 469a2: 2f0a movel %a2,%sp@- register POSIX_Mutex_Control *the_mutex; Objects_Locations location; the_mutex = _POSIX_Mutex_Get( mutex, &location ); 469a4: 486e fffc pea %fp@(-4) 469a8: 2f2e 0008 movel %fp@(8),%sp@- 469ac: 4eb9 0004 6a6a jsr 46a6a <_POSIX_Mutex_Get> switch ( location ) { 469b2: 508f addql #8,%sp ) { register POSIX_Mutex_Control *the_mutex; Objects_Locations location; the_mutex = _POSIX_Mutex_Get( mutex, &location ); 469b4: 2440 moveal %d0,%a2 switch ( location ) { 469b6: 4aae fffc tstl %fp@(-4) 469ba: 6704 beqs 469c0 469bc: 7016 moveq #22,%d0 469be: 6046 bras 46a06 <== ALWAYS TAKEN 469c0: 47f9 0004 99a6 lea 499a6 <_Thread_Enable_dispatch>,%a3 /* * XXX: There is an error for the mutex being locked * or being in use by a condition variable. */ if ( _CORE_mutex_Is_locked( &the_mutex->Mutex ) ) { 469c6: 4aaa 0062 tstl %a2@(98) 469ca: 6606 bnes 469d2 _Thread_Enable_dispatch(); 469cc: 4e93 jsr %a3@ 469ce: 7010 moveq #16,%d0 return EBUSY; 469d0: 6034 bras 46a06 <== ALWAYS TAKEN } _Objects_Close( &_POSIX_Mutex_Information, &the_mutex->Object ); 469d2: 2f00 movel %d0,%sp@- 469d4: 4879 0006 1c8c pea 61c8c <_POSIX_Mutex_Information> 469da: 4eb9 0004 8e50 jsr 48e50 <_Objects_Close> _CORE_mutex_Flush( &the_mutex->Mutex, NULL, EINVAL ); 469e0: 4878 0016 pea 16 469e4: 42a7 clrl %sp@- 469e6: 486a 0014 pea %a2@(20) 469ea: 4eb9 0004 8568 jsr 48568 <_CORE_mutex_Flush> RTEMS_INLINE_ROUTINE void _POSIX_Mutex_Free ( POSIX_Mutex_Control *the_mutex ) { _Objects_Free( &_POSIX_Mutex_Information, &the_mutex->Object ); 469f0: 2f0a movel %a2,%sp@- 469f2: 4879 0006 1c8c pea 61c8c <_POSIX_Mutex_Information> 469f8: 4eb9 0004 90c4 jsr 490c4 <_Objects_Free> _POSIX_Mutex_Free( the_mutex ); _Thread_Enable_dispatch(); 469fe: 4e93 jsr %a3@ return 0; 46a00: 4fef 001c lea %sp@(28),%sp _Objects_Close( &_POSIX_Mutex_Information, &the_mutex->Object ); _CORE_mutex_Flush( &the_mutex->Mutex, NULL, EINVAL ); _POSIX_Mutex_Free( the_mutex ); _Thread_Enable_dispatch(); 46a04: 4280 clrl %d0 case OBJECTS_ERROR: break; } return EINVAL; } 46a06: 246e fff4 moveal %fp@(-12),%a2 46a0a: 266e fff8 moveal %fp@(-8),%a3 46a0e: 4e5e unlk %fp 46a10: 4e75 rts ... 00046abc : int pthread_mutex_getprioceiling( pthread_mutex_t *mutex, int *prioceiling ) { 46abc: 4e56 fffc linkw %fp,#-4 46ac0: 2f0a movel %a2,%sp@- 46ac2: 246e 000c moveal %fp@(12),%a2 register POSIX_Mutex_Control *the_mutex; Objects_Locations location; if ( !prioceiling ) 46ac6: 4a8a tstl %a2 46ac8: 6730 beqs 46afa return EINVAL; the_mutex = _POSIX_Mutex_Get( mutex, &location ); 46aca: 486e fffc pea %fp@(-4) 46ace: 2f2e 0008 movel %fp@(8),%sp@- 46ad2: 4eb9 0004 6a6a jsr 46a6a <_POSIX_Mutex_Get> switch ( location ) { 46ad8: 508f addql #8,%sp 46ada: 4aae fffc tstl %fp@(-4) 46ade: 661a bnes 46afa case OBJECTS_LOCAL: *prioceiling = _POSIX_Priority_From_core( 46ae0: 4281 clrl %d1 46ae2: 1239 0006 0196 moveb 60196 ,%d1 46ae8: 2040 moveal %d0,%a0 46aea: 92a8 005e subl %a0@(94),%d1 46aee: 2481 movel %d1,%a2@ the_mutex->Mutex.Attributes.priority_ceiling ); _Thread_Enable_dispatch(); 46af0: 4eb9 0004 99a6 jsr 499a6 <_Thread_Enable_dispatch> 46af6: 4280 clrl %d0 return 0; 46af8: 6002 bras 46afc <== ALWAYS TAKEN 46afa: 7016 moveq #22,%d0 case OBJECTS_ERROR: break; } return EINVAL; } 46afc: 246e fff8 moveal %fp@(-8),%a2 46b00: 4e5e unlk %fp 46b02: 4e75 rts 00046b04 : int pthread_mutex_init( pthread_mutex_t *mutex, const pthread_mutexattr_t *attr ) { 46b04: 4e56 fff0 linkw %fp,#-16 46b08: 202e 000c movel %fp@(12),%d0 46b0c: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ 46b10: 286e 0008 moveal %fp@(8),%a4 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; 46b14: 47f9 0006 1d00 lea 61d00 <_POSIX_Mutex_Default_attributes>,%a3 46b1a: 4a80 tstl %d0 46b1c: 6702 beqs 46b20 46b1e: 2640 moveal %d0,%a3 else the_attr = &_POSIX_Mutex_Default_attributes; /* Check for NULL mutex */ if ( !mutex ) 46b20: 4a8c tstl %a4 46b22: 6700 00f0 beqw 46c14 <== ALWAYS TAKEN } } } #endif if ( !the_attr->is_initialized ) 46b26: 4a93 tstl %a3@ 46b28: 6700 00ea beqw 46c14 <== ALWAYS TAKEN return EINVAL; /* * We only support process private mutexes. */ if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) 46b2c: 202b 0004 movel %a3@(4),%d0 46b30: 7201 moveq #1,%d1 46b32: b280 cmpl %d0,%d1 46b34: 6606 bnes 46b3c 46b36: 7058 moveq #88,%d0 46b38: 6000 00dc braw 46c16 return ENOSYS; if ( the_attr->process_shared != PTHREAD_PROCESS_PRIVATE ) 46b3c: 4a80 tstl %d0 46b3e: 6600 00d4 bnew 46c14 <== ALWAYS TAKEN return EINVAL; /* * Determine the discipline of the mutex */ switch ( the_attr->protocol ) { 46b42: 202b 000c movel %a3@(12),%d0 46b46: 7201 moveq #1,%d1 46b48: b280 cmpl %d0,%d1 46b4a: 6710 beqs 46b5c 46b4c: 123c 0002 moveb #2,%d1 46b50: b280 cmpl %d0,%d1 46b52: 6710 beqs 46b64 46b54: 4a80 tstl %d0 46b56: 6708 beqs 46b60 46b58: 6000 00ba braw 46c14 46b5c: 7402 moveq #2,%d2 46b5e: 6006 bras 46b66 <== ALWAYS TAKEN 46b60: 4282 clrl %d2 46b62: 6002 bras 46b66 <== ALWAYS TAKEN 46b64: 7403 moveq #3,%d2 } /* * Validate the priority ceiling field -- should always be valid. */ if ( !_POSIX_Priority_Is_valid( the_attr->prio_ceiling ) ) 46b66: 2f2b 0008 movel %a3@(8),%sp@- 46b6a: 4eb9 0004 6e5c jsr 46e5c <_POSIX_Priority_Is_valid> 46b70: 588f addql #4,%sp 46b72: 4a00 tstb %d0 46b74: 6700 009e beqw 46c14 <== ALWAYS TAKEN #if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES) /* * Validate the mutex type and set appropriate SuperCore mutex * attributes. */ switch ( the_attr->type ) { 46b78: 7003 moveq #3,%d0 46b7a: b0ab 0010 cmpl %a3@(16),%d0 46b7e: 6500 0094 bcsw 46c14 <== ALWAYS TAKEN 46b82: 2039 0006 1984 movel 61984 <_Thread_Dispatch_disable_level>,%d0 46b88: 5280 addql #1,%d0 46b8a: 23c0 0006 1984 movel %d0,61984 <_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 ); 46b90: 4879 0006 1c8c pea 61c8c <_POSIX_Mutex_Information> 46b96: 4eb9 0004 8dd0 jsr 48dd0 <_Objects_Allocate> */ _Thread_Disable_dispatch(); the_mutex = _POSIX_Mutex_Allocate(); if ( !the_mutex ) { 46b9c: 588f addql #4,%sp 46b9e: 2440 moveal %d0,%a2 46ba0: 4a80 tstl %d0 46ba2: 660a bnes 46bae _Thread_Enable_dispatch(); 46ba4: 4eb9 0004 99a6 jsr 499a6 <_Thread_Enable_dispatch> 46baa: 700b moveq #11,%d0 return EAGAIN; 46bac: 6068 bras 46c16 <== ALWAYS TAKEN } the_mutex->process_shared = the_attr->process_shared; 46bae: 256b 0004 0010 movel %a3@(4),%a2@(16) the_mutex_attr = &the_mutex->Mutex.Attributes; if ( the_attr->recursive ) the_mutex_attr->lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES; 46bb4: 4aab 0014 tstl %a3@(20) 46bb8: 57c0 seq %d0 else the_mutex_attr->lock_nesting_behavior = CORE_MUTEX_NESTING_IS_ERROR; the_mutex_attr->only_owner_release = true; 46bba: 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; 46bbc: 49c0 extbl %d0 46bbe: 4480 negl %d0 else the_mutex_attr->lock_nesting_behavior = CORE_MUTEX_NESTING_IS_ERROR; the_mutex_attr->only_owner_release = true; 46bc0: 1541 0058 moveb %d1,%a2@(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; 46bc4: 2540 0054 movel %d0,%a2@(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 = 46bc8: 4280 clrl %d0 46bca: 1039 0006 0196 moveb 60196 ,%d0 46bd0: 90ab 0008 subl %a3@(8),%d0 _POSIX_Priority_To_core( the_attr->prio_ceiling ); the_mutex_attr->discipline = the_discipline; 46bd4: 2542 005a movel %d2,%a2@(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 = 46bd8: 2540 005e movel %d0,%a2@(94) the_mutex_attr->discipline = the_discipline; /* * Must be initialized to unlocked. */ _CORE_mutex_Initialize( 46bdc: 4878 0001 pea 1 46be0: 486a 0054 pea %a2@(84) 46be4: 486a 0014 pea %a2@(20) 46be8: 4eb9 0004 8574 jsr 48574 <_CORE_mutex_Initialize> #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 46bee: 202a 0008 movel %a2@(8),%d0 46bf2: 4281 clrl %d1 46bf4: 2079 0006 1ca4 moveal 61ca4 <_POSIX_Mutex_Information+0x18>,%a0 46bfa: 3200 movew %d0,%d1 46bfc: 218a 1c00 movel %a2,%a0@(00000000,%d1:l:4) _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 46c00: 42aa 000c clrl %a2@(12) CORE_MUTEX_UNLOCKED ); _Objects_Open_u32( &_POSIX_Mutex_Information, &the_mutex->Object, 0 ); *mutex = the_mutex->Object.id; 46c04: 2880 movel %d0,%a4@ _Thread_Enable_dispatch(); 46c06: 4eb9 0004 99a6 jsr 499a6 <_Thread_Enable_dispatch> return 0; 46c0c: 4fef 000c lea %sp@(12),%sp _Objects_Open_u32( &_POSIX_Mutex_Information, &the_mutex->Object, 0 ); *mutex = the_mutex->Object.id; _Thread_Enable_dispatch(); 46c10: 4280 clrl %d0 return 0; 46c12: 6002 bras 46c16 <== ALWAYS TAKEN 46c14: 7016 moveq #22,%d0 } 46c16: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 46c1c: 4e5e unlk %fp 46c1e: 4e75 rts 00046ca0 : int pthread_mutex_setprioceiling( pthread_mutex_t *mutex, int prioceiling, int *old_ceiling ) { 46ca0: 4e56 ffec linkw %fp,#-20 46ca4: 48d7 041c moveml %d2-%d4/%a2,%sp@ 46ca8: 262e 0008 movel %fp@(8),%d3 46cac: 242e 000c movel %fp@(12),%d2 46cb0: 246e 0010 moveal %fp@(16),%a2 register POSIX_Mutex_Control *the_mutex; Objects_Locations location; Priority_Control the_priority; if ( !old_ceiling ) 46cb4: 4a8a tstl %a2 46cb6: 676c beqs 46d24 return EINVAL; if ( !_POSIX_Priority_Is_valid( prioceiling ) ) 46cb8: 2f02 movel %d2,%sp@- 46cba: 4eb9 0004 6e5c jsr 46e5c <_POSIX_Priority_Is_valid> 46cc0: 588f addql #4,%sp 46cc2: 4a00 tstb %d0 46cc4: 675e beqs 46d24 /* * Must acquire the mutex before we can change it's ceiling. * POSIX says block until we acquire it. */ (void) pthread_mutex_lock( mutex ); 46cc6: 2f03 movel %d3,%sp@- RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( int priority ) { return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1); 46cc8: 1839 0006 0196 moveb 60196 ,%d4 46cce: 4eb9 0004 6c20 jsr 46c20 * operations. * * NOTE: This makes it easier to get 100% binary coverage since the * bad Id case is handled by the switch. */ the_mutex = _POSIX_Mutex_Get( mutex, &location ); 46cd4: 486e fffc pea %fp@(-4) 46cd8: 2f03 movel %d3,%sp@- 46cda: 4eb9 0004 6a6a jsr 46a6a <_POSIX_Mutex_Get> switch ( location ) { 46ce0: 4fef 000c lea %sp@(12),%sp * operations. * * NOTE: This makes it easier to get 100% binary coverage since the * bad Id case is handled by the switch. */ the_mutex = _POSIX_Mutex_Get( mutex, &location ); 46ce4: 2040 moveal %d0,%a0 switch ( location ) { 46ce6: 4aae fffc tstl %fp@(-4) 46cea: 6638 bnes 46d24 case OBJECTS_LOCAL: *old_ceiling = _POSIX_Priority_From_core( 46cec: 4280 clrl %d0 46cee: 1039 0006 0196 moveb 60196 ,%d0 46cf4: 90a8 005e subl %a0@(94),%d0 the_mutex->Mutex.Attributes.priority_ceiling ); the_mutex->Mutex.Attributes.priority_ceiling = the_priority; 46cf8: 0284 0000 00ff andil #255,%d4 */ the_mutex = _POSIX_Mutex_Get( mutex, &location ); switch ( location ) { case OBJECTS_LOCAL: *old_ceiling = _POSIX_Priority_From_core( 46cfe: 2480 movel %d0,%a2@ the_mutex->Mutex.Attributes.priority_ceiling ); the_mutex->Mutex.Attributes.priority_ceiling = the_priority; 46d00: 9882 subl %d2,%d4 46d02: 2144 005e movel %d4,%a0@(94) /* * We are required to unlock the mutex before we return. */ _CORE_mutex_Surrender( 46d06: 42a7 clrl %sp@- 46d08: 2f28 0008 movel %a0@(8),%sp@- 46d0c: 4868 0014 pea %a0@(20) 46d10: 4eb9 0004 8728 jsr 48728 <_CORE_mutex_Surrender> &the_mutex->Mutex, the_mutex->Object.id, NULL ); _Thread_Enable_dispatch(); 46d16: 4eb9 0004 99a6 jsr 499a6 <_Thread_Enable_dispatch> return 0; 46d1c: 4fef 000c lea %sp@(12),%sp _CORE_mutex_Surrender( &the_mutex->Mutex, the_mutex->Object.id, NULL ); _Thread_Enable_dispatch(); 46d20: 4280 clrl %d0 return 0; 46d22: 6002 bras 46d26 <== ALWAYS TAKEN 46d24: 7016 moveq #22,%d0 case OBJECTS_ERROR: break; } return EINVAL; } 46d26: 4cee 041c ffec moveml %fp@(-20),%d2-%d4/%a2 46d2c: 4e5e unlk %fp 46d2e: 4e75 rts 00046d90 : */ int pthread_mutex_unlock( pthread_mutex_t *mutex ) { 46d90: 4e56 fffc linkw %fp,#-4 46d94: 2f02 movel %d2,%sp@- register POSIX_Mutex_Control *the_mutex; Objects_Locations location; CORE_mutex_Status status; the_mutex = _POSIX_Mutex_Get( mutex, &location ); 46d96: 486e fffc pea %fp@(-4) 46d9a: 2f2e 0008 movel %fp@(8),%sp@- 46d9e: 4eb9 0004 6a6a jsr 46a6a <_POSIX_Mutex_Get> switch ( location ) { 46da4: 508f addql #8,%sp 46da6: 4aae fffc tstl %fp@(-4) 46daa: 6704 beqs 46db0 46dac: 7016 moveq #22,%d0 46dae: 6026 bras 46dd6 <== ALWAYS TAKEN case OBJECTS_LOCAL: status = _CORE_mutex_Surrender( 46db0: 2040 moveal %d0,%a0 46db2: 42a7 clrl %sp@- 46db4: 2f28 0008 movel %a0@(8),%sp@- 46db8: 4868 0014 pea %a0@(20) 46dbc: 4eb9 0004 8728 jsr 48728 <_CORE_mutex_Surrender> 46dc2: 2400 movel %d0,%d2 &the_mutex->Mutex, the_mutex->Object.id, NULL ); _Thread_Enable_dispatch(); 46dc4: 4eb9 0004 99a6 jsr 499a6 <_Thread_Enable_dispatch> return _POSIX_Mutex_Translate_core_mutex_return_code( status ); 46dca: 2f02 movel %d2,%sp@- 46dcc: 4eb9 0004 6d60 jsr 46d60 <_POSIX_Mutex_Translate_core_mutex_return_code> 46dd2: 4fef 0010 lea %sp@(16),%sp case OBJECTS_ERROR: break; } return EINVAL; } 46dd6: 242e fff8 movel %fp@(-8),%d2 46dda: 4e5e unlk %fp 46ddc: 4e75 rts ... 00046850 : */ int pthread_mutexattr_destroy( pthread_mutexattr_t *attr ) { 46850: 4e56 0000 linkw %fp,#0 46854: 206e 0008 moveal %fp@(8),%a0 if ( !attr || !attr->is_initialized ) 46858: 4a88 tstl %a0 4685a: 670a beqs 46866 4685c: 4a90 tstl %a0@ 4685e: 6706 beqs 46866 return EINVAL; attr->is_initialized = false; 46860: 4290 clrl %a0@ 46862: 4280 clrl %d0 return 0; 46864: 6002 bras 46868 <== ALWAYS TAKEN 46866: 7016 moveq #22,%d0 } 46868: 4e5e unlk %fp 4686a: 4e75 rts 0004686c : int pthread_mutexattr_getprioceiling( const pthread_mutexattr_t *attr, int *prioceiling ) { 4686c: 4e56 0000 linkw %fp,#0 46870: 206e 0008 moveal %fp@(8),%a0 46874: 226e 000c moveal %fp@(12),%a1 if ( !attr || !attr->is_initialized || !prioceiling ) 46878: 4a88 tstl %a0 4687a: 6710 beqs 4688c 4687c: 4a90 tstl %a0@ 4687e: 670c beqs 4688c 46880: 4a89 tstl %a1 46882: 6708 beqs 4688c return EINVAL; *prioceiling = attr->prio_ceiling; 46884: 22a8 0008 movel %a0@(8),%a1@ 46888: 4280 clrl %d0 return 0; 4688a: 6002 bras 4688e <== ALWAYS TAKEN 4688c: 7016 moveq #22,%d0 } 4688e: 4e5e unlk %fp 46890: 4e75 rts ... 00046894 : int pthread_mutexattr_getprotocol( const pthread_mutexattr_t *attr, int *protocol ) { 46894: 4e56 0000 linkw %fp,#0 46898: 206e 0008 moveal %fp@(8),%a0 4689c: 226e 000c moveal %fp@(12),%a1 if ( !attr || !attr->is_initialized || !protocol ) 468a0: 4a88 tstl %a0 468a2: 6710 beqs 468b4 468a4: 4a90 tstl %a0@ 468a6: 670c beqs 468b4 468a8: 4a89 tstl %a1 468aa: 6708 beqs 468b4 return EINVAL; *protocol = attr->protocol; 468ac: 22a8 000c movel %a0@(12),%a1@ 468b0: 4280 clrl %d0 return 0; 468b2: 6002 bras 468b6 <== ALWAYS TAKEN 468b4: 7016 moveq #22,%d0 } 468b6: 4e5e unlk %fp 468b8: 4e75 rts ... 000468bc : int pthread_mutexattr_getpshared( const pthread_mutexattr_t *attr, int *pshared ) { 468bc: 4e56 0000 linkw %fp,#0 468c0: 206e 0008 moveal %fp@(8),%a0 468c4: 226e 000c moveal %fp@(12),%a1 if ( !attr || !attr->is_initialized || !pshared ) 468c8: 4a88 tstl %a0 468ca: 6710 beqs 468dc 468cc: 4a90 tstl %a0@ 468ce: 670c beqs 468dc 468d0: 4a89 tstl %a1 468d2: 6708 beqs 468dc return EINVAL; *pshared = attr->process_shared; 468d4: 22a8 0004 movel %a0@(4),%a1@ 468d8: 4280 clrl %d0 return 0; 468da: 6002 bras 468de <== ALWAYS TAKEN 468dc: 7016 moveq #22,%d0 } 468de: 4e5e unlk %fp 468e0: 4e75 rts ... 00044b58 : #if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES) int pthread_mutexattr_gettype( const pthread_mutexattr_t *attr, int *type ) { 44b58: 4e56 0000 linkw %fp,#0 44b5c: 206e 0008 moveal %fp@(8),%a0 44b60: 226e 000c moveal %fp@(12),%a1 if ( !attr ) 44b64: 4a88 tstl %a0 44b66: 6710 beqs 44b78 return EINVAL; if ( !attr->is_initialized ) 44b68: 4a90 tstl %a0@ 44b6a: 670c beqs 44b78 return EINVAL; if ( !type ) 44b6c: 4a89 tstl %a1 44b6e: 6708 beqs 44b78 <== ALWAYS TAKEN return EINVAL; *type = attr->type; 44b70: 22a8 0010 movel %a0@(16),%a1@ 44b74: 4280 clrl %d0 return 0; 44b76: 6002 bras 44b7a <== ALWAYS TAKEN 44b78: 7016 moveq #22,%d0 } 44b7a: 4e5e unlk %fp 44b7c: 4e75 rts ... 000468e4 : */ int pthread_mutexattr_init( pthread_mutexattr_t *attr ) { 468e4: 4e56 0000 linkw %fp,#0 468e8: 202e 0008 movel %fp@(8),%d0 if ( !attr ) 468ec: 6606 bnes 468f4 468ee: 103c 0016 moveb #22,%d0 468f2: 6018 bras 4690c <== ALWAYS TAKEN return EINVAL; *attr = _POSIX_Mutex_Default_attributes; 468f4: 4878 0018 pea 18 468f8: 4879 0006 1d00 pea 61d00 <_POSIX_Mutex_Default_attributes> 468fe: 2f00 movel %d0,%sp@- 46900: 4eb9 0004 ff04 jsr 4ff04 return 0; 46906: 4fef 000c lea %sp@(12),%sp ) { if ( !attr ) return EINVAL; *attr = _POSIX_Mutex_Default_attributes; 4690a: 4280 clrl %d0 return 0; } 4690c: 4e5e unlk %fp 4690e: 4e75 rts 00046910 : int pthread_mutexattr_setprioceiling( pthread_mutexattr_t *attr, int prioceiling ) { 46910: 4e56 0000 linkw %fp,#0 46914: 2f0a movel %a2,%sp@- 46916: 246e 0008 moveal %fp@(8),%a2 4691a: 2f02 movel %d2,%sp@- 4691c: 242e 000c movel %fp@(12),%d2 if ( !attr || !attr->is_initialized ) 46920: 4a8a tstl %a2 46922: 671a beqs 4693e 46924: 4a92 tstl %a2@ 46926: 6716 beqs 4693e return EINVAL; if ( !_POSIX_Priority_Is_valid( prioceiling ) ) 46928: 2f02 movel %d2,%sp@- 4692a: 4eb9 0004 6e5c jsr 46e5c <_POSIX_Priority_Is_valid> 46930: 588f addql #4,%sp 46932: 4a00 tstb %d0 46934: 6708 beqs 4693e return EINVAL; attr->prio_ceiling = prioceiling; 46936: 2542 0008 movel %d2,%a2@(8) 4693a: 4280 clrl %d0 return 0; 4693c: 6002 bras 46940 <== ALWAYS TAKEN 4693e: 7016 moveq #22,%d0 } 46940: 242e fff8 movel %fp@(-8),%d2 46944: 246e fffc moveal %fp@(-4),%a2 46948: 4e5e unlk %fp 4694a: 4e75 rts 0004694c : int pthread_mutexattr_setprotocol( pthread_mutexattr_t *attr, int protocol ) { 4694c: 4e56 0000 linkw %fp,#0 46950: 206e 0008 moveal %fp@(8),%a0 46954: 202e 000c movel %fp@(12),%d0 if ( !attr || !attr->is_initialized ) 46958: 4a88 tstl %a0 4695a: 6712 beqs 4696e 4695c: 4a90 tstl %a0@ 4695e: 670e beqs 4696e return EINVAL; switch ( protocol ) { 46960: 7202 moveq #2,%d1 46962: b280 cmpl %d0,%d1 46964: 6508 bcss 4696e case PTHREAD_PRIO_NONE: case PTHREAD_PRIO_INHERIT: case PTHREAD_PRIO_PROTECT: attr->protocol = protocol; 46966: 2140 000c movel %d0,%a0@(12) 4696a: 4280 clrl %d0 return 0; 4696c: 6002 bras 46970 <== ALWAYS TAKEN 4696e: 7016 moveq #22,%d0 default: return EINVAL; } } 46970: 4e5e unlk %fp 46972: 4e75 rts 00046974 : int pthread_mutexattr_setpshared( pthread_mutexattr_t *attr, int pshared ) { 46974: 4e56 0000 linkw %fp,#0 46978: 206e 0008 moveal %fp@(8),%a0 4697c: 202e 000c movel %fp@(12),%d0 if ( !attr || !attr->is_initialized ) 46980: 4a88 tstl %a0 46982: 6712 beqs 46996 46984: 4a90 tstl %a0@ 46986: 670e beqs 46996 return EINVAL; switch ( pshared ) { 46988: 7201 moveq #1,%d1 4698a: b280 cmpl %d0,%d1 4698c: 6508 bcss 46996 <== ALWAYS TAKEN case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; 4698e: 2140 0004 movel %d0,%a0@(4) 46992: 4280 clrl %d0 return 0; 46994: 6002 bras 46998 <== ALWAYS TAKEN 46996: 7016 moveq #22,%d0 default: return EINVAL; } } 46998: 4e5e unlk %fp 4699a: 4e75 rts 00044bac : #if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES) int pthread_mutexattr_settype( pthread_mutexattr_t *attr, int type ) { 44bac: 4e56 0000 linkw %fp,#0 44bb0: 206e 0008 moveal %fp@(8),%a0 44bb4: 202e 000c movel %fp@(12),%d0 if ( !attr || !attr->is_initialized ) 44bb8: 4a88 tstl %a0 44bba: 6712 beqs 44bce 44bbc: 4a90 tstl %a0@ 44bbe: 670e beqs 44bce <== ALWAYS TAKEN return EINVAL; switch ( type ) { 44bc0: 7203 moveq #3,%d1 44bc2: b280 cmpl %d0,%d1 44bc4: 6508 bcss 44bce case PTHREAD_MUTEX_NORMAL: case PTHREAD_MUTEX_RECURSIVE: case PTHREAD_MUTEX_ERRORCHECK: case PTHREAD_MUTEX_DEFAULT: attr->type = type; 44bc6: 2140 0010 movel %d0,%a0@(16) 44bca: 4280 clrl %d0 return 0; 44bcc: 6002 bras 44bd0 <== ALWAYS TAKEN 44bce: 7016 moveq #22,%d0 default: return EINVAL; } } 44bd0: 4e5e unlk %fp 44bd2: 4e75 rts 00045614 : int pthread_once( pthread_once_t *once_control, void (*init_routine)(void) ) { 45614: 4e56 fffc linkw %fp,#-4 45618: 2f0b movel %a3,%sp@- 4561a: 266e 000c moveal %fp@(12),%a3 4561e: 2f0a movel %a2,%sp@- 45620: 246e 0008 moveal %fp@(8),%a2 if ( !once_control || !init_routine ) 45624: 4a8a tstl %a2 45626: 674a beqs 45672 45628: 4a8b tstl %a3 4562a: 6746 beqs 45672 return EINVAL; if ( !once_control->init_executed ) { 4562c: 4aaa 0004 tstl %a2@(4) 45630: 663c bnes 4566e rtems_mode saveMode; rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode); 45632: 486e fffc pea %fp@(-4) 45636: 4878 0100 pea 100 4563a: 4878 0100 pea 100 4563e: 4eb9 0004 6104 jsr 46104 if ( !once_control->init_executed ) { 45644: 4fef 000c lea %sp@(12),%sp 45648: 4aaa 0004 tstl %a2@(4) 4564c: 660a bnes 45658 <== ALWAYS TAKEN once_control->is_initialized = true; once_control->init_executed = true; 4564e: 7001 moveq #1,%d0 45650: 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; 45654: 2480 movel %d0,%a2@ once_control->init_executed = true; (*init_routine)(); 45656: 4e93 jsr %a3@ } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); 45658: 486e fffc pea %fp@(-4) 4565c: 4878 0100 pea 100 45660: 2f2e fffc movel %fp@(-4),%sp@- 45664: 4eb9 0004 6104 jsr 46104 4566a: 4fef 000c lea %sp@(12),%sp 4566e: 4280 clrl %d0 45670: 6002 bras 45674 <== ALWAYS TAKEN 45672: 7016 moveq #22,%d0 } return 0; } 45674: 246e fff4 moveal %fp@(-12),%a2 45678: 266e fff8 moveal %fp@(-8),%a3 4567c: 4e5e unlk %fp 4567e: 4e75 rts 00045b74 : */ int pthread_rwlock_destroy( pthread_rwlock_t *rwlock ) { 45b74: 4e56 fffc linkw %fp,#-4 45b78: 206e 0008 moveal %fp@(8),%a0 45b7c: 2f0b movel %a3,%sp@- 45b7e: 2f0a movel %a2,%sp@- POSIX_RWLock_Control *the_rwlock = NULL; Objects_Locations location; if ( !rwlock ) 45b80: 4a88 tstl %a0 45b82: 6760 beqs 45be4 RTEMS_INLINE_ROUTINE POSIX_RWLock_Control *_POSIX_RWLock_Get ( pthread_rwlock_t *RWLock, Objects_Locations *location ) { return (POSIX_RWLock_Control *) _Objects_Get( 45b84: 486e fffc pea %fp@(-4) 45b88: 2f10 movel %a0@,%sp@- 45b8a: 4879 0005 f9d4 pea 5f9d4 <_POSIX_RWLock_Information> 45b90: 4eb9 0004 83d0 jsr 483d0 <_Objects_Get> return EINVAL; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { 45b96: 4fef 000c lea %sp@(12),%sp 45b9a: 2440 moveal %d0,%a2 45b9c: 4aae fffc tstl %fp@(-4) 45ba0: 6642 bnes 45be4 case OBJECTS_LOCAL: /* * If there is at least one thread waiting, then do not delete it. */ if ( _Thread_queue_First( &the_rwlock->RWLock.Wait_queue ) != NULL ) { 45ba2: 486a 0010 pea %a2@(16) 45ba6: 47f9 0004 8b5a lea 48b5a <_Thread_Enable_dispatch>,%a3 45bac: 4eb9 0004 92e4 jsr 492e4 <_Thread_queue_First> 45bb2: 588f addql #4,%sp 45bb4: 4a80 tstl %d0 45bb6: 6706 beqs 45bbe _Thread_Enable_dispatch(); 45bb8: 4e93 jsr %a3@ 45bba: 7010 moveq #16,%d0 return EBUSY; 45bbc: 6028 bras 45be6 <== ALWAYS TAKEN /* * POSIX doesn't require behavior when it is locked. */ _Objects_Close( &_POSIX_RWLock_Information, &the_rwlock->Object ); 45bbe: 2f0a movel %a2,%sp@- 45bc0: 4879 0005 f9d4 pea 5f9d4 <_POSIX_RWLock_Information> 45bc6: 4eb9 0004 8004 jsr 48004 <_Objects_Close> */ RTEMS_INLINE_ROUTINE void _POSIX_RWLock_Free ( POSIX_RWLock_Control *the_RWLock ) { _Objects_Free( &_POSIX_RWLock_Information, &the_RWLock->Object ); 45bcc: 2f0a movel %a2,%sp@- 45bce: 4879 0005 f9d4 pea 5f9d4 <_POSIX_RWLock_Information> 45bd4: 4eb9 0004 8278 jsr 48278 <_Objects_Free> _POSIX_RWLock_Free( the_rwlock ); _Thread_Enable_dispatch(); 45bda: 4e93 jsr %a3@ return 0; 45bdc: 4fef 0010 lea %sp@(16),%sp _Objects_Close( &_POSIX_RWLock_Information, &the_rwlock->Object ); _POSIX_RWLock_Free( the_rwlock ); _Thread_Enable_dispatch(); 45be0: 4280 clrl %d0 return 0; 45be2: 6002 bras 45be6 <== ALWAYS TAKEN 45be4: 7016 moveq #22,%d0 case OBJECTS_ERROR: break; } return EINVAL; } 45be6: 246e fff4 moveal %fp@(-12),%a2 45bea: 266e fff8 moveal %fp@(-8),%a3 45bee: 4e5e unlk %fp 45bf0: 4e75 rts ... 00045bf4 : int pthread_rwlock_init( pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr ) { 45bf4: 4e56 ffe8 linkw %fp,#-24 45bf8: 48d7 1c00 moveml %a2-%a4,%sp@ 45bfc: 266e 0008 moveal %fp@(8),%a3 45c00: 246e 000c moveal %fp@(12),%a2 const pthread_rwlockattr_t *the_attr; /* * Error check parameters */ if ( !rwlock ) 45c04: 4a8b tstl %a3 45c06: 6778 beqs 45c80 return EINVAL; /* * If the user passed in NULL, use the default attributes */ if ( attr ) { 45c08: 4a8a tstl %a2 45c0a: 660e bnes 45c1a the_attr = attr; } else { (void) pthread_rwlockattr_init( &default_attr ); 45c0c: 45ee fff4 lea %fp@(-12),%a2 45c10: 2f0a movel %a2,%sp@- 45c12: 4eb9 0004 64e8 jsr 464e8 45c18: 588f addql #4,%sp } /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) 45c1a: 4a92 tstl %a2@ 45c1c: 6762 beqs 45c80 <== ALWAYS TAKEN return EINVAL; switch ( the_attr->process_shared ) { 45c1e: 4aaa 0004 tstl %a2@(4) 45c22: 665c bnes 45c80 <== ALWAYS TAKEN rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 45c24: 2039 0005 f828 movel 5f828 <_Thread_Dispatch_disable_level>,%d0 45c2a: 5280 addql #1,%d0 45c2c: 23c0 0005 f828 movel %d0,5f828 <_Thread_Dispatch_disable_level> * This function allocates a RWLock control block from * the inactive chain of free RWLock control blocks. */ RTEMS_INLINE_ROUTINE POSIX_RWLock_Control *_POSIX_RWLock_Allocate( void ) { return (POSIX_RWLock_Control *) 45c32: 4879 0005 f9d4 pea 5f9d4 <_POSIX_RWLock_Information> 45c38: 45f9 0004 8b5a lea 48b5a <_Thread_Enable_dispatch>,%a2 45c3e: 4eb9 0004 7f84 jsr 47f84 <_Objects_Allocate> */ _Thread_Disable_dispatch(); /* prevents deletion */ the_rwlock = _POSIX_RWLock_Allocate(); if ( !the_rwlock ) { 45c44: 588f addql #4,%sp 45c46: 2840 moveal %d0,%a4 45c48: 4a80 tstl %d0 45c4a: 6606 bnes 45c52 _Thread_Enable_dispatch(); 45c4c: 4e92 jsr %a2@ 45c4e: 700b moveq #11,%d0 return EAGAIN; 45c50: 6030 bras 45c82 <== ALWAYS TAKEN } _CORE_RWLock_Initialize( &the_rwlock->RWLock, &the_attributes ); 45c52: 486e fffc pea %fp@(-4) 45c56: 486c 0010 pea %a4@(16) 45c5a: 4eb9 0004 77b8 jsr 477b8 <_CORE_RWLock_Initialize> #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 45c60: 202c 0008 movel %a4@(8),%d0 45c64: 4281 clrl %d1 45c66: 2079 0005 f9ec moveal 5f9ec <_POSIX_RWLock_Information+0x18>,%a0 45c6c: 3200 movew %d0,%d1 45c6e: 218c 1c00 movel %a4,%a0@(00000000,%d1:l:4) _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 45c72: 42ac 000c clrl %a4@(12) &_POSIX_RWLock_Information, &the_rwlock->Object, 0 ); *rwlock = the_rwlock->Object.id; 45c76: 2680 movel %d0,%a3@ _Thread_Enable_dispatch(); 45c78: 4e92 jsr %a2@ return 0; 45c7a: 508f addql #8,%sp 0 ); *rwlock = the_rwlock->Object.id; _Thread_Enable_dispatch(); 45c7c: 4280 clrl %d0 return 0; 45c7e: 6002 bras 45c82 <== ALWAYS TAKEN 45c80: 7016 moveq #22,%d0 } 45c82: 4cee 1c00 ffe8 moveml %fp@(-24),%a2-%a4 45c88: 4e5e unlk %fp 45c8a: 4e75 rts 00045c8c : */ int pthread_rwlock_rdlock( pthread_rwlock_t *rwlock ) { 45c8c: 4e56 fffc linkw %fp,#-4 45c90: 2f0a movel %a2,%sp@- 45c92: 246e 0008 moveal %fp@(8),%a2 POSIX_RWLock_Control *the_rwlock; Objects_Locations location; if ( !rwlock ) 45c96: 4a8a tstl %a2 45c98: 674e beqs 45ce8 RTEMS_INLINE_ROUTINE POSIX_RWLock_Control *_POSIX_RWLock_Get ( pthread_rwlock_t *RWLock, Objects_Locations *location ) { return (POSIX_RWLock_Control *) _Objects_Get( 45c9a: 486e fffc pea %fp@(-4) 45c9e: 2f12 movel %a2@,%sp@- 45ca0: 4879 0005 f9d4 pea 5f9d4 <_POSIX_RWLock_Information> 45ca6: 4eb9 0004 83d0 jsr 483d0 <_Objects_Get> return EINVAL; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { 45cac: 4fef 000c lea %sp@(12),%sp 45cb0: 4aae fffc tstl %fp@(-4) 45cb4: 6632 bnes 45ce8 case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_reading( 45cb6: 42a7 clrl %sp@- 45cb8: 2040 moveal %d0,%a0 45cba: 42a7 clrl %sp@- 45cbc: 4878 0001 pea 1 45cc0: 2f12 movel %a2@,%sp@- 45cc2: 4868 0010 pea %a0@(16) 45cc6: 4eb9 0004 77ec jsr 477ec <_CORE_RWLock_Obtain_for_reading> true, /* we are willing to wait forever */ 0, NULL ); _Thread_Enable_dispatch(); 45ccc: 4eb9 0004 8b5a jsr 48b5a <_Thread_Enable_dispatch> return _POSIX_RWLock_Translate_core_RWLock_return_code( 45cd2: 2079 0005 f8e2 moveal 5f8e2 <_Thread_Executing>,%a0 45cd8: 2f28 0034 movel %a0@(52),%sp@- 45cdc: 4eb9 0004 5e4c jsr 45e4c <_POSIX_RWLock_Translate_core_RWLock_return_code> 45ce2: 4fef 0018 lea %sp@(24),%sp 45ce6: 6002 bras 45cea <== ALWAYS TAKEN 45ce8: 7016 moveq #22,%d0 case OBJECTS_ERROR: break; } return EINVAL; } 45cea: 246e fff8 moveal %fp@(-8),%a2 45cee: 4e5e unlk %fp 45cf0: 4e75 rts ... 00045cf4 : int pthread_rwlock_timedrdlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { 45cf4: 4e56 ffec linkw %fp,#-20 45cf8: 48d7 040c moveml %d2-%d3/%a2,%sp@ 45cfc: 246e 0008 moveal %fp@(8),%a2 Objects_Locations location; Watchdog_Interval ticks; bool do_wait = true; POSIX_Absolute_timeout_conversion_results_t status; if ( !rwlock ) 45d00: 4a8a tstl %a2 45d02: 6700 008e beqw 45d92 * * If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID, * POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW, * then we should not wait. */ status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks ); 45d06: 486e fff8 pea %fp@(-8) 45d0a: 2f2e 000c movel %fp@(12),%sp@- 45d0e: 4eb9 0004 b7f0 jsr 4b7f0 <_POSIX_Absolute_timeout_to_ticks> 45d14: 486e fffc pea %fp@(-4) 45d18: 2400 movel %d0,%d2 45d1a: 2f12 movel %a2@,%sp@- 45d1c: 4879 0005 f9d4 pea 5f9d4 <_POSIX_RWLock_Information> 45d22: 4eb9 0004 83d0 jsr 483d0 <_Objects_Get> if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { 45d28: 4fef 0014 lea %sp@(20),%sp 45d2c: 4aae fffc tstl %fp@(-4) 45d30: 6660 bnes 45d92 int _EXFUN(pthread_rwlock_init, (pthread_rwlock_t *__rwlock, _CONST pthread_rwlockattr_t *__attr)); int _EXFUN(pthread_rwlock_destroy, (pthread_rwlock_t *__rwlock)); int _EXFUN(pthread_rwlock_rdlock,(pthread_rwlock_t *__rwlock)); int _EXFUN(pthread_rwlock_tryrdlock,(pthread_rwlock_t *__rwlock)); int _EXFUN(pthread_rwlock_timedrdlock, 45d32: 7203 moveq #3,%d1 45d34: b282 cmpl %d2,%d1 45d36: 57c3 seq %d3 case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_reading( 45d38: 42a7 clrl %sp@- 45d3a: 2f2e fff8 movel %fp@(-8),%sp@- 45d3e: 4483 negl %d3 45d40: 4281 clrl %d1 45d42: 1203 moveb %d3,%d1 45d44: 2040 moveal %d0,%a0 45d46: 2f01 movel %d1,%sp@- 45d48: 2f12 movel %a2@,%sp@- 45d4a: 4868 0010 pea %a0@(16) 45d4e: 4eb9 0004 77ec jsr 477ec <_CORE_RWLock_Obtain_for_reading> do_wait, ticks, NULL ); _Thread_Enable_dispatch(); 45d54: 4eb9 0004 8b5a jsr 48b5a <_Thread_Enable_dispatch> if ( !do_wait ) { 45d5a: 4fef 0014 lea %sp@(20),%sp 45d5e: 4a03 tstb %d3 45d60: 661c bnes 45d7e if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) { 45d62: 2079 0005 f8e2 moveal 5f8e2 <_Thread_Executing>,%a0 45d68: 7002 moveq #2,%d0 45d6a: b0a8 0034 cmpl %a0@(52),%d0 45d6e: 660e bnes 45d7e switch (status) { 45d70: 4a82 tstl %d2 45d72: 671e beqs 45d92 <== ALWAYS TAKEN 45d74: b082 cmpl %d2,%d0 45d76: 6506 bcss 45d7e <== ALWAYS TAKEN 45d78: 103c 0074 moveb #116,%d0 45d7c: 6016 bras 45d94 <== ALWAYS TAKEN break; } } } return _POSIX_RWLock_Translate_core_RWLock_return_code( 45d7e: 2079 0005 f8e2 moveal 5f8e2 <_Thread_Executing>,%a0 45d84: 2f28 0034 movel %a0@(52),%sp@- 45d88: 4eb9 0004 5e4c jsr 45e4c <_POSIX_RWLock_Translate_core_RWLock_return_code> 45d8e: 588f addql #4,%sp 45d90: 6002 bras 45d94 <== ALWAYS TAKEN 45d92: 7016 moveq #22,%d0 case OBJECTS_ERROR: break; } return EINVAL; } 45d94: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 45d9a: 4e5e unlk %fp 45d9c: 4e75 rts ... 00045da0 : int pthread_rwlock_timedwrlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { 45da0: 4e56 ffec linkw %fp,#-20 45da4: 48d7 040c moveml %d2-%d3/%a2,%sp@ 45da8: 246e 0008 moveal %fp@(8),%a2 Objects_Locations location; Watchdog_Interval ticks; bool do_wait = true; POSIX_Absolute_timeout_conversion_results_t status; if ( !rwlock ) 45dac: 4a8a tstl %a2 45dae: 6700 008e beqw 45e3e * * If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID, * POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW, * then we should not wait. */ status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks ); 45db2: 486e fff8 pea %fp@(-8) 45db6: 2f2e 000c movel %fp@(12),%sp@- 45dba: 4eb9 0004 b7f0 jsr 4b7f0 <_POSIX_Absolute_timeout_to_ticks> 45dc0: 486e fffc pea %fp@(-4) 45dc4: 2400 movel %d0,%d2 45dc6: 2f12 movel %a2@,%sp@- 45dc8: 4879 0005 f9d4 pea 5f9d4 <_POSIX_RWLock_Information> 45dce: 4eb9 0004 83d0 jsr 483d0 <_Objects_Get> if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { 45dd4: 4fef 0014 lea %sp@(20),%sp 45dd8: 4aae fffc tstl %fp@(-4) 45ddc: 6660 bnes 45e3e (pthread_rwlock_t *__rwlock, _CONST struct timespec *__abstime)); int _EXFUN(pthread_rwlock_unlock,(pthread_rwlock_t *__rwlock)); int _EXFUN(pthread_rwlock_wrlock,(pthread_rwlock_t *__rwlock)); int _EXFUN(pthread_rwlock_trywrlock,(pthread_rwlock_t *__rwlock)); int _EXFUN(pthread_rwlock_timedwrlock, 45dde: 7203 moveq #3,%d1 45de0: b282 cmpl %d2,%d1 45de2: 57c3 seq %d3 case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_writing( 45de4: 42a7 clrl %sp@- 45de6: 2f2e fff8 movel %fp@(-8),%sp@- 45dea: 4483 negl %d3 45dec: 4281 clrl %d1 45dee: 1203 moveb %d3,%d1 45df0: 2040 moveal %d0,%a0 45df2: 2f01 movel %d1,%sp@- 45df4: 2f12 movel %a2@,%sp@- 45df6: 4868 0010 pea %a0@(16) 45dfa: 4eb9 0004 789c jsr 4789c <_CORE_RWLock_Obtain_for_writing> do_wait, ticks, NULL ); _Thread_Enable_dispatch(); 45e00: 4eb9 0004 8b5a jsr 48b5a <_Thread_Enable_dispatch> if ( !do_wait && 45e06: 4fef 0014 lea %sp@(20),%sp 45e0a: 4a03 tstb %d3 45e0c: 661c bnes 45e2a (_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) { 45e0e: 2079 0005 f8e2 moveal 5f8e2 <_Thread_Executing>,%a0 45e14: 7002 moveq #2,%d0 45e16: b0a8 0034 cmpl %a0@(52),%d0 45e1a: 660e bnes 45e2a switch (status) { 45e1c: 4a82 tstl %d2 45e1e: 671e beqs 45e3e <== ALWAYS TAKEN 45e20: b082 cmpl %d2,%d0 45e22: 6506 bcss 45e2a <== ALWAYS TAKEN 45e24: 103c 0074 moveb #116,%d0 45e28: 6016 bras 45e40 <== ALWAYS TAKEN case POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE: break; } } return _POSIX_RWLock_Translate_core_RWLock_return_code( 45e2a: 2079 0005 f8e2 moveal 5f8e2 <_Thread_Executing>,%a0 45e30: 2f28 0034 movel %a0@(52),%sp@- 45e34: 4eb9 0004 5e4c jsr 45e4c <_POSIX_RWLock_Translate_core_RWLock_return_code> 45e3a: 588f addql #4,%sp 45e3c: 6002 bras 45e40 <== ALWAYS TAKEN 45e3e: 7016 moveq #22,%d0 case OBJECTS_ERROR: break; } return EINVAL; } 45e40: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 45e46: 4e5e unlk %fp 45e48: 4e75 rts ... 00045e64 : */ int pthread_rwlock_tryrdlock( pthread_rwlock_t *rwlock ) { 45e64: 4e56 fffc linkw %fp,#-4 45e68: 2f0a movel %a2,%sp@- 45e6a: 246e 0008 moveal %fp@(8),%a2 POSIX_RWLock_Control *the_rwlock; Objects_Locations location; if ( !rwlock ) 45e6e: 4a8a tstl %a2 45e70: 674c beqs 45ebe 45e72: 486e fffc pea %fp@(-4) 45e76: 2f12 movel %a2@,%sp@- 45e78: 4879 0005 f9d4 pea 5f9d4 <_POSIX_RWLock_Information> 45e7e: 4eb9 0004 83d0 jsr 483d0 <_Objects_Get> return EINVAL; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { 45e84: 4fef 000c lea %sp@(12),%sp 45e88: 4aae fffc tstl %fp@(-4) 45e8c: 6630 bnes 45ebe case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_reading( 45e8e: 42a7 clrl %sp@- 45e90: 2040 moveal %d0,%a0 45e92: 42a7 clrl %sp@- 45e94: 42a7 clrl %sp@- 45e96: 2f12 movel %a2@,%sp@- 45e98: 4868 0010 pea %a0@(16) 45e9c: 4eb9 0004 77ec jsr 477ec <_CORE_RWLock_Obtain_for_reading> 0, NULL ); _Thread_Enable_dispatch(); 45ea2: 4eb9 0004 8b5a jsr 48b5a <_Thread_Enable_dispatch> return _POSIX_RWLock_Translate_core_RWLock_return_code( 45ea8: 2079 0005 f8e2 moveal 5f8e2 <_Thread_Executing>,%a0 45eae: 2f28 0034 movel %a0@(52),%sp@- 45eb2: 4eb9 0004 5e4c jsr 45e4c <_POSIX_RWLock_Translate_core_RWLock_return_code> 45eb8: 4fef 0018 lea %sp@(24),%sp 45ebc: 6002 bras 45ec0 <== ALWAYS TAKEN 45ebe: 7016 moveq #22,%d0 case OBJECTS_ERROR: break; } return EINVAL; } 45ec0: 246e fff8 moveal %fp@(-8),%a2 45ec4: 4e5e unlk %fp 45ec6: 4e75 rts 00045ec8 : */ int pthread_rwlock_trywrlock( pthread_rwlock_t *rwlock ) { 45ec8: 4e56 fffc linkw %fp,#-4 45ecc: 2f0a movel %a2,%sp@- 45ece: 246e 0008 moveal %fp@(8),%a2 POSIX_RWLock_Control *the_rwlock; Objects_Locations location; if ( !rwlock ) 45ed2: 4a8a tstl %a2 45ed4: 674c beqs 45f22 45ed6: 486e fffc pea %fp@(-4) 45eda: 2f12 movel %a2@,%sp@- 45edc: 4879 0005 f9d4 pea 5f9d4 <_POSIX_RWLock_Information> 45ee2: 4eb9 0004 83d0 jsr 483d0 <_Objects_Get> return EINVAL; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { 45ee8: 4fef 000c lea %sp@(12),%sp 45eec: 4aae fffc tstl %fp@(-4) 45ef0: 6630 bnes 45f22 case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_writing( 45ef2: 42a7 clrl %sp@- 45ef4: 2040 moveal %d0,%a0 45ef6: 42a7 clrl %sp@- 45ef8: 42a7 clrl %sp@- 45efa: 2f12 movel %a2@,%sp@- 45efc: 4868 0010 pea %a0@(16) 45f00: 4eb9 0004 789c jsr 4789c <_CORE_RWLock_Obtain_for_writing> false, /* we are not willing to wait */ 0, NULL ); _Thread_Enable_dispatch(); 45f06: 4eb9 0004 8b5a jsr 48b5a <_Thread_Enable_dispatch> return _POSIX_RWLock_Translate_core_RWLock_return_code( 45f0c: 2079 0005 f8e2 moveal 5f8e2 <_Thread_Executing>,%a0 45f12: 2f28 0034 movel %a0@(52),%sp@- 45f16: 4eb9 0004 5e4c jsr 45e4c <_POSIX_RWLock_Translate_core_RWLock_return_code> 45f1c: 4fef 0018 lea %sp@(24),%sp 45f20: 6002 bras 45f24 <== ALWAYS TAKEN 45f22: 7016 moveq #22,%d0 case OBJECTS_ERROR: break; } return EINVAL; } 45f24: 246e fff8 moveal %fp@(-8),%a2 45f28: 4e5e unlk %fp 45f2a: 4e75 rts 00045f2c : */ int pthread_rwlock_unlock( pthread_rwlock_t *rwlock ) { 45f2c: 4e56 fffc linkw %fp,#-4 45f30: 206e 0008 moveal %fp@(8),%a0 45f34: 2f02 movel %d2,%sp@- POSIX_RWLock_Control *the_rwlock; Objects_Locations location; CORE_RWLock_Status status; if ( !rwlock ) 45f36: 4a88 tstl %a0 45f38: 673c beqs 45f76 45f3a: 486e fffc pea %fp@(-4) 45f3e: 2f10 movel %a0@,%sp@- 45f40: 4879 0005 f9d4 pea 5f9d4 <_POSIX_RWLock_Information> 45f46: 4eb9 0004 83d0 jsr 483d0 <_Objects_Get> return EINVAL; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { 45f4c: 4fef 000c lea %sp@(12),%sp 45f50: 4aae fffc tstl %fp@(-4) 45f54: 6620 bnes 45f76 case OBJECTS_LOCAL: status = _CORE_RWLock_Release( &the_rwlock->RWLock ); 45f56: 2040 moveal %d0,%a0 45f58: 4868 0010 pea %a0@(16) 45f5c: 4eb9 0004 7928 jsr 47928 <_CORE_RWLock_Release> 45f62: 2400 movel %d0,%d2 _Thread_Enable_dispatch(); 45f64: 4eb9 0004 8b5a jsr 48b5a <_Thread_Enable_dispatch> return _POSIX_RWLock_Translate_core_RWLock_return_code( status ); 45f6a: 2f02 movel %d2,%sp@- 45f6c: 4eb9 0004 5e4c jsr 45e4c <_POSIX_RWLock_Translate_core_RWLock_return_code> 45f72: 508f addql #8,%sp 45f74: 6002 bras 45f78 <== ALWAYS TAKEN 45f76: 7016 moveq #22,%d0 case OBJECTS_ERROR: break; } return EINVAL; } 45f78: 242e fff8 movel %fp@(-8),%d2 45f7c: 4e5e unlk %fp 45f7e: 4e75 rts 00045f80 : */ int pthread_rwlock_wrlock( pthread_rwlock_t *rwlock ) { 45f80: 4e56 fffc linkw %fp,#-4 45f84: 2f0a movel %a2,%sp@- 45f86: 246e 0008 moveal %fp@(8),%a2 POSIX_RWLock_Control *the_rwlock; Objects_Locations location; if ( !rwlock ) 45f8a: 4a8a tstl %a2 45f8c: 674e beqs 45fdc 45f8e: 486e fffc pea %fp@(-4) 45f92: 2f12 movel %a2@,%sp@- 45f94: 4879 0005 f9d4 pea 5f9d4 <_POSIX_RWLock_Information> 45f9a: 4eb9 0004 83d0 jsr 483d0 <_Objects_Get> return EINVAL; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { 45fa0: 4fef 000c lea %sp@(12),%sp 45fa4: 4aae fffc tstl %fp@(-4) 45fa8: 6632 bnes 45fdc case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_writing( 45faa: 42a7 clrl %sp@- 45fac: 2040 moveal %d0,%a0 45fae: 42a7 clrl %sp@- 45fb0: 4878 0001 pea 1 45fb4: 2f12 movel %a2@,%sp@- 45fb6: 4868 0010 pea %a0@(16) 45fba: 4eb9 0004 789c jsr 4789c <_CORE_RWLock_Obtain_for_writing> true, /* do not timeout -- wait forever */ 0, NULL ); _Thread_Enable_dispatch(); 45fc0: 4eb9 0004 8b5a jsr 48b5a <_Thread_Enable_dispatch> return _POSIX_RWLock_Translate_core_RWLock_return_code( 45fc6: 2079 0005 f8e2 moveal 5f8e2 <_Thread_Executing>,%a0 45fcc: 2f28 0034 movel %a0@(52),%sp@- 45fd0: 4eb9 0004 5e4c jsr 45e4c <_POSIX_RWLock_Translate_core_RWLock_return_code> 45fd6: 4fef 0018 lea %sp@(24),%sp 45fda: 6002 bras 45fde <== ALWAYS TAKEN 45fdc: 7016 moveq #22,%d0 case OBJECTS_ERROR: break; } return EINVAL; } 45fde: 246e fff8 moveal %fp@(-8),%a2 45fe2: 4e5e unlk %fp 45fe4: 4e75 rts ... 000464a8 : */ int pthread_rwlockattr_destroy( pthread_rwlockattr_t *attr ) { 464a8: 4e56 0000 linkw %fp,#0 464ac: 206e 0008 moveal %fp@(8),%a0 if ( !attr || attr->is_initialized == false ) 464b0: 4a88 tstl %a0 464b2: 670a beqs 464be 464b4: 4a90 tstl %a0@ 464b6: 6706 beqs 464be return EINVAL; attr->is_initialized = false; 464b8: 4290 clrl %a0@ 464ba: 4280 clrl %d0 return 0; 464bc: 6002 bras 464c0 <== ALWAYS TAKEN 464be: 7016 moveq #22,%d0 } 464c0: 4e5e unlk %fp 464c2: 4e75 rts 000464c4 : int pthread_rwlockattr_getpshared( const pthread_rwlockattr_t *attr, int *pshared ) { 464c4: 4e56 0000 linkw %fp,#0 464c8: 206e 0008 moveal %fp@(8),%a0 if ( !attr ) 464cc: 4a88 tstl %a0 464ce: 6710 beqs 464e0 return EINVAL; if ( !attr->is_initialized ) 464d0: 4a90 tstl %a0@ 464d2: 670c beqs 464e0 return EINVAL; *pshared = attr->process_shared; 464d4: 226e 000c moveal %fp@(12),%a1 464d8: 4280 clrl %d0 464da: 22a8 0004 movel %a0@(4),%a1@ return 0; 464de: 6002 bras 464e2 <== ALWAYS TAKEN 464e0: 7016 moveq #22,%d0 } 464e2: 4e5e unlk %fp 464e4: 4e75 rts ... 000464e8 : */ int pthread_rwlockattr_init( pthread_rwlockattr_t *attr ) { 464e8: 4e56 0000 linkw %fp,#0 464ec: 206e 0008 moveal %fp@(8),%a0 if ( !attr ) 464f0: 4a88 tstl %a0 464f2: 6604 bnes 464f8 464f4: 7016 moveq #22,%d0 464f6: 600a bras 46502 <== ALWAYS TAKEN return EINVAL; attr->is_initialized = true; 464f8: 7201 moveq #1,%d1 attr->process_shared = PTHREAD_PROCESS_PRIVATE; 464fa: 4280 clrl %d0 464fc: 42a8 0004 clrl %a0@(4) ) { if ( !attr ) return EINVAL; attr->is_initialized = true; 46500: 2081 movel %d1,%a0@ attr->process_shared = PTHREAD_PROCESS_PRIVATE; return 0; } 46502: 4e5e unlk %fp 46504: 4e75 rts ... 00046508 : int pthread_rwlockattr_setpshared( pthread_rwlockattr_t *attr, int pshared ) { 46508: 4e56 0000 linkw %fp,#0 4650c: 206e 0008 moveal %fp@(8),%a0 46510: 202e 000c movel %fp@(12),%d0 if ( !attr ) 46514: 4a88 tstl %a0 46516: 6712 beqs 4652a return EINVAL; if ( !attr->is_initialized ) 46518: 4a90 tstl %a0@ 4651a: 670e beqs 4652a return EINVAL; switch ( pshared ) { 4651c: 7201 moveq #1,%d1 4651e: b280 cmpl %d0,%d1 46520: 6508 bcss 4652a <== ALWAYS TAKEN case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; 46522: 2140 0004 movel %d0,%a0@(4) 46526: 4280 clrl %d0 return 0; 46528: 6002 bras 4652c <== ALWAYS TAKEN 4652a: 7016 moveq #22,%d0 default: return EINVAL; } } 4652c: 4e5e unlk %fp 4652e: 4e75 rts 00044b70 : int pthread_setcancelstate( int state, int *oldstate ) { 44b70: 4e56 0000 linkw %fp,#0 44b74: 202e 0008 movel %fp@(8),%d0 44b78: 226e 000c moveal %fp@(12),%a1 * Don't even think about deleting a resource from an ISR. * Besides this request is supposed to be for _Thread_Executing * and the ISR context is not a thread. */ if ( _ISR_Is_in_progress() ) 44b7c: 2239 0005 d5f2 movel 5d5f2 <_ISR_Nest_level>,%d1 44b82: 6704 beqs 44b88 44b84: 7047 moveq #71,%d0 44b86: 603e bras 44bc6 <== ALWAYS TAKEN return EPROTO; if ( !oldstate ) 44b88: 4a89 tstl %a1 44b8a: 6738 beqs 44bc4 return EINVAL; if ( state != PTHREAD_CANCEL_ENABLE && state != PTHREAD_CANCEL_DISABLE ) 44b8c: 7201 moveq #1,%d1 44b8e: b280 cmpl %d0,%d1 44b90: 6532 bcss 44bc4 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 44b92: 2239 0005 d558 movel 5d558 <_Thread_Dispatch_disable_level>,%d1 44b98: 5281 addql #1,%d1 return EINVAL; thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 44b9a: 2079 0005 d612 moveal 5d612 <_Thread_Executing>,%a0 44ba0: 23c1 0005 d558 movel %d1,5d558 <_Thread_Dispatch_disable_level> 44ba6: 2068 010e moveal %a0@(270),%a0 _Thread_Disable_dispatch(); *oldstate = thread_support->cancelability_state; 44baa: 22a8 00cc movel %a0@(204),%a1@ thread_support->cancelability_state = state; 44bae: 2140 00cc movel %d0,%a0@(204) _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch(_Thread_Executing); 44bb2: 2f39 0005 d612 movel 5d612 <_Thread_Executing>,%sp@- 44bb8: 4eb9 0004 9830 jsr 49830 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch> /* * _Thread_Enable_dispatch is invoked by above call. */ return 0; 44bbe: 588f addql #4,%sp _Thread_Disable_dispatch(); *oldstate = thread_support->cancelability_state; thread_support->cancelability_state = state; _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch(_Thread_Executing); 44bc0: 4280 clrl %d0 /* * _Thread_Enable_dispatch is invoked by above call. */ return 0; 44bc2: 6002 bras 44bc6 <== ALWAYS TAKEN 44bc4: 7016 moveq #22,%d0 } 44bc6: 4e5e unlk %fp 44bc8: 4e75 rts ... 00044bcc : int pthread_setcanceltype( int type, int *oldtype ) { 44bcc: 4e56 0000 linkw %fp,#0 44bd0: 202e 0008 movel %fp@(8),%d0 44bd4: 226e 000c moveal %fp@(12),%a1 * Don't even think about deleting a resource from an ISR. * Besides this request is supposed to be for _Thread_Executing * and the ISR context is not a thread. */ if ( _ISR_Is_in_progress() ) 44bd8: 2239 0005 d5f2 movel 5d5f2 <_ISR_Nest_level>,%d1 44bde: 6704 beqs 44be4 44be0: 7047 moveq #71,%d0 44be2: 603e bras 44c22 return EPROTO; if ( !oldtype ) 44be4: 4a89 tstl %a1 44be6: 6738 beqs 44c20 return EINVAL; if ( type != PTHREAD_CANCEL_DEFERRED && type != PTHREAD_CANCEL_ASYNCHRONOUS ) 44be8: 7201 moveq #1,%d1 44bea: b280 cmpl %d0,%d1 44bec: 6532 bcss 44c20 44bee: 2239 0005 d558 movel 5d558 <_Thread_Dispatch_disable_level>,%d1 44bf4: 5281 addql #1,%d1 return EINVAL; thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 44bf6: 2079 0005 d612 moveal 5d612 <_Thread_Executing>,%a0 44bfc: 23c1 0005 d558 movel %d1,5d558 <_Thread_Dispatch_disable_level> 44c02: 2068 010e moveal %a0@(270),%a0 _Thread_Disable_dispatch(); *oldtype = thread_support->cancelability_type; 44c06: 22a8 00d0 movel %a0@(208),%a1@ thread_support->cancelability_type = type; 44c0a: 2140 00d0 movel %d0,%a0@(208) _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch(_Thread_Executing); 44c0e: 2f39 0005 d612 movel 5d612 <_Thread_Executing>,%sp@- 44c14: 4eb9 0004 9830 jsr 49830 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch> /* * _Thread_Enable_dispatch is invoked by above call. */ return 0; 44c1a: 588f addql #4,%sp _Thread_Disable_dispatch(); *oldtype = thread_support->cancelability_type; thread_support->cancelability_type = type; _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch(_Thread_Executing); 44c1c: 4280 clrl %d0 /* * _Thread_Enable_dispatch is invoked by above call. */ return 0; 44c1e: 6002 bras 44c22 <== ALWAYS TAKEN 44c20: 7016 moveq #22,%d0 } 44c22: 4e5e unlk %fp 44c24: 4e75 rts ... 000474e8 : int pthread_setschedparam( pthread_t thread, int policy, struct sched_param *param ) { 474e8: 4e56 ffe0 linkw %fp,#-32 474ec: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 474f0: 282e 000c movel %fp@(12),%d4 474f4: 262e 0010 movel %fp@(16),%d3 int rc; /* * Check all the parameters */ if ( !param ) 474f8: 6606 bnes 47500 474fa: 7416 moveq #22,%d2 474fc: 6000 00e6 braw 475e4 <== ALWAYS TAKEN return EINVAL; rc = _POSIX_Thread_Translate_sched_param( 47500: 486e fff8 pea %fp@(-8) 47504: 486e fffc pea %fp@(-4) 47508: 2f03 movel %d3,%sp@- 4750a: 2f04 movel %d4,%sp@- 4750c: 4eb9 0004 c6d8 jsr 4c6d8 <_POSIX_Thread_Translate_sched_param> policy, param, &budget_algorithm, &budget_callout ); if ( rc ) 47512: 4fef 0010 lea %sp@(16),%sp * Check all the parameters */ if ( !param ) return EINVAL; rc = _POSIX_Thread_Translate_sched_param( 47516: 2400 movel %d0,%d2 policy, param, &budget_algorithm, &budget_callout ); if ( rc ) 47518: 6600 00ca bnew 475e4 4751c: 486e fff4 pea %fp@(-12) 47520: 2f2e 0008 movel %fp@(8),%sp@- 47524: 4879 0006 1b6a pea 61b6a <_POSIX_Threads_Information> 4752a: 4eb9 0004 921c jsr 4921c <_Objects_Get> /* * Actually change the scheduling policy and parameters */ the_thread = _POSIX_Threads_Get( thread, &location ); switch ( location ) { 47530: 4fef 000c lea %sp@(12),%sp 47534: 2640 moveal %d0,%a3 47536: 4aae fff4 tstl %fp@(-12) 4753a: 6708 beqs 47544 4753c: 143c 0003 moveb #3,%d2 47540: 6000 00a2 braw 475e4 <== ALWAYS TAKEN case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 47544: 246b 010e moveal %a3@(270),%a2 if ( api->schedpolicy == SCHED_SPORADIC ) 47548: 7003 moveq #3,%d0 4754a: b0aa 007c cmpl %a2@(124),%d0 4754e: 660c bnes 4755c (void) _Watchdog_Remove( &api->Sporadic_timer ); 47550: 486a 009c pea %a2@(156) 47554: 4eb9 0004 ab94 jsr 4ab94 <_Watchdog_Remove> 4755a: 588f addql #4,%sp api->schedpolicy = policy; 4755c: 2544 007c movel %d4,%a2@(124) api->schedparam = *param; 47560: 4878 0018 pea 18 47564: 2f03 movel %d3,%sp@- 47566: 486a 0080 pea %a2@(128) 4756a: 4eb9 0004 ff04 jsr 4ff04 the_thread->budget_algorithm = budget_algorithm; 47570: 276e fffc 007a movel %fp@(-4),%a3@(122) the_thread->budget_callout = budget_callout; switch ( api->schedpolicy ) { 47576: 4fef 000c lea %sp@(12),%sp (void) _Watchdog_Remove( &api->Sporadic_timer ); api->schedpolicy = policy; api->schedparam = *param; the_thread->budget_algorithm = budget_algorithm; the_thread->budget_callout = budget_callout; 4757a: 276e fff8 007e movel %fp@(-8),%a3@(126) switch ( api->schedpolicy ) { 47580: 202a 007c movel %a2@(124),%d0 47584: 6d58 blts 475de <== ALWAYS TAKEN 47586: 7202 moveq #2,%d1 47588: b280 cmpl %d0,%d1 4758a: 6c0a bges 47596 4758c: 123c 0003 moveb #3,%d1 47590: b280 cmpl %d0,%d1 47592: 664a bnes 475de <== ALWAYS TAKEN 47594: 602a bras 475c0 <== ALWAYS TAKEN 47596: 4280 clrl %d0 47598: 1039 0006 0196 moveb 60196 ,%d0 case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; 4759e: 41f9 0006 1934 lea 61934 <_Thread_Ticks_per_timeslice>,%a0 475a4: 90aa 0080 subl %a2@(128),%d0 475a8: 2750 0076 movel %a0@,%a3@(118) the_thread->real_priority = 475ac: 2740 0018 movel %d0,%a3@(24) _POSIX_Priority_To_core( api->schedparam.sched_priority ); _Thread_Change_priority( 475b0: 4878 0001 pea 1 475b4: 2f00 movel %d0,%sp@- 475b6: 2f0b movel %a3,%sp@- 475b8: 4eb9 0004 94ac jsr 494ac <_Thread_Change_priority> 475be: 601a bras 475da <== ALWAYS TAKEN true ); break; case SCHED_SPORADIC: api->ss_high_priority = api->schedparam.sched_priority; 475c0: 256a 0080 0098 movel %a2@(128),%a2@(152) _Watchdog_Remove( &api->Sporadic_timer ); 475c6: 486a 009c pea %a2@(156) 475ca: 4eb9 0004 ab94 jsr 4ab94 <_Watchdog_Remove> _POSIX_Threads_Sporadic_budget_TSR( 0, the_thread ); 475d0: 2f0b movel %a3,%sp@- 475d2: 42a7 clrl %sp@- 475d4: 4eb9 0004 7452 jsr 47452 <_POSIX_Threads_Sporadic_budget_TSR> 475da: 4fef 000c lea %sp@(12),%sp break; } _Thread_Enable_dispatch(); 475de: 4eb9 0004 99a6 jsr 499a6 <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return ESRCH; } 475e4: 2002 movel %d2,%d0 475e6: 4cee 0c1c ffe0 moveml %fp@(-32),%d2-%d4/%a2-%a3 475ec: 4e5e unlk %fp 475ee: 4e75 rts 000450a8 : int pthread_setspecific( pthread_key_t key, const void *value ) { 450a8: 4e56 fffc linkw %fp,#-4 450ac: 2f03 movel %d3,%sp@- 450ae: 2f02 movel %d2,%sp@- 450b0: 486e fffc pea %fp@(-4) 450b4: 2f2e 0008 movel %fp@(8),%sp@- 450b8: 4879 0005 ef18 pea 5ef18 <_POSIX_Keys_Information> 450be: 4eb9 0004 7290 jsr 47290 <_Objects_Get> uint32_t api; uint32_t index; Objects_Locations location; the_key = _POSIX_Keys_Get( key, &location ); switch ( location ) { 450c4: 4fef 000c lea %sp@(12),%sp 450c8: 4aae fffc tstl %fp@(-4) 450cc: 6704 beqs 450d2 450ce: 7016 moveq #22,%d0 450d0: 6032 bras 45104 <== ALWAYS TAKEN case OBJECTS_LOCAL: api = _Objects_Get_API( _Thread_Executing->Object.id ); 450d2: 2079 0005 ec3e moveal 5ec3e <_Thread_Executing>,%a0 index = _Objects_Get_index( _Thread_Executing->Object.id ); the_key->Values[ api ][ index ] = (void *) value; 450d8: 7618 moveq #24,%d3 450da: 2240 moveal %d0,%a1 the_key = _POSIX_Keys_Get( key, &location ); switch ( location ) { case OBJECTS_LOCAL: api = _Objects_Get_API( _Thread_Executing->Object.id ); 450dc: 2428 0008 movel %a0@(8),%d2 index = _Objects_Get_index( _Thread_Executing->Object.id ); the_key->Values[ api ][ index ] = (void *) value; 450e0: 2202 movel %d2,%d1 450e2: e6a9 lsrl %d3,%d1 450e4: 163c 0007 moveb #7,%d3 450e8: c283 andl %d3,%d1 450ea: 0282 0000 ffff andil #65535,%d2 450f0: 2071 1c14 moveal %a1@(00000014,%d1:l:4),%a0 450f4: 43ee 000c lea %fp@(12),%a1 450f8: 2191 2c00 movel %a1@,%a0@(00000000,%d2:l:4) _Thread_Enable_dispatch(); 450fc: 4eb9 0004 7a1a jsr 47a1a <_Thread_Enable_dispatch> 45102: 4280 clrl %d0 case OBJECTS_ERROR: break; } return EINVAL; } 45104: 242e fff4 movel %fp@(-12),%d2 45108: 262e fff8 movel %fp@(-8),%d3 4510c: 4e5e unlk %fp 4510e: 4e75 rts 0004ac10 : int pthread_sigmask( int how, const sigset_t *set, sigset_t *oset ) { 4ac10: 4e56 0000 linkw %fp,#0 4ac14: 202e 0008 movel %fp@(8),%d0 4ac18: 2f0b movel %a3,%sp@- 4ac1a: 226e 000c moveal %fp@(12),%a1 4ac1e: 2f0a movel %a2,%sp@- 4ac20: 246e 0010 moveal %fp@(16),%a2 POSIX_API_Control *api; if ( !set && !oset ) 4ac24: 4a89 tstl %a1 4ac26: 6604 bnes 4ac2c 4ac28: 4a8a tstl %a2 4ac2a: 6742 beqs 4ac6e rtems_set_errno_and_return_minus_one( EINVAL ); api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 4ac2c: 2679 0005 eb4e moveal 5eb4e <_Thread_Executing>,%a3 4ac32: 206b 010e moveal %a3@(270),%a0 if ( oset ) 4ac36: 4a8a tstl %a2 4ac38: 6704 beqs 4ac3e *oset = api->signals_blocked; 4ac3a: 24a8 00c4 movel %a0@(196),%a2@ if ( !set ) 4ac3e: 4a89 tstl %a1 4ac40: 675c beqs 4ac9e return 0; switch ( how ) { 4ac42: 7201 moveq #1,%d1 4ac44: b280 cmpl %d0,%d1 4ac46: 670e beqs 4ac56 4ac48: 123c 0002 moveb #2,%d1 4ac4c: b280 cmpl %d0,%d1 4ac4e: 670e beqs 4ac5e 4ac50: 4a80 tstl %d0 4ac52: 6714 beqs 4ac68 4ac54: 6018 bras 4ac6e <== ALWAYS TAKEN case SIG_BLOCK: api->signals_blocked |= *set; 4ac56: 2011 movel %a1@,%d0 4ac58: 81a8 00c4 orl %d0,%a0@(196) break; 4ac5c: 6020 bras 4ac7e <== ALWAYS TAKEN case SIG_UNBLOCK: api->signals_blocked &= ~*set; 4ac5e: 2011 movel %a1@,%d0 4ac60: 4680 notl %d0 4ac62: c1a8 00c4 andl %d0,%a0@(196) break; 4ac66: 6016 bras 4ac7e <== ALWAYS TAKEN case SIG_SETMASK: api->signals_blocked = *set; 4ac68: 2151 00c4 movel %a1@,%a0@(196) break; 4ac6c: 6010 bras 4ac7e <== ALWAYS TAKEN default: rtems_set_errno_and_return_minus_one( EINVAL ); 4ac6e: 4eb9 0004 d914 jsr 4d914 <__errno> 4ac74: 72ff moveq #-1,%d1 4ac76: 2040 moveal %d0,%a0 4ac78: 7016 moveq #22,%d0 4ac7a: 2080 movel %d0,%a0@ 4ac7c: 6022 bras 4aca0 <== ALWAYS TAKEN /* XXX are there critical section problems here? */ /* XXX evaluate the new set */ if ( ~api->signals_blocked & (api->signals_pending | _POSIX_signals_Pending) ) { 4ac7e: 2039 0005 f10e movel 5f10e <_POSIX_signals_Pending>,%d0 /* XXX are there critical section problems here? */ /* XXX evaluate the new set */ if ( ~api->signals_blocked & 4ac84: 2228 00c4 movel %a0@(196),%d1 4ac88: 4681 notl %d1 (api->signals_pending | _POSIX_signals_Pending) ) { 4ac8a: 80a8 00c8 orl %a0@(200),%d0 /* XXX are there critical section problems here? */ /* XXX evaluate the new set */ if ( ~api->signals_blocked & 4ac8e: c081 andl %d1,%d0 4ac90: 670c beqs 4ac9e (api->signals_pending | _POSIX_signals_Pending) ) { _Thread_Executing->do_post_task_switch_extension = true; 4ac92: 7001 moveq #1,%d0 4ac94: 1740 0074 moveb %d0,%a3@(116) _Thread_Dispatch(); 4ac98: 4eb9 0004 79a0 jsr 479a0 <_Thread_Dispatch> 4ac9e: 4281 clrl %d1 } return 0; } 4aca0: 246e fff8 moveal %fp@(-8),%a2 4aca4: 2001 movel %d1,%d0 4aca6: 266e fffc moveal %fp@(-4),%a3 4acaa: 4e5e unlk %fp 4acac: 4e75 rts ... 00045028 : */ int pthread_spin_destroy( pthread_spinlock_t *spinlock ) { 45028: 4e56 fffc linkw %fp,#-4 4502c: 206e 0008 moveal %fp@(8),%a0 45030: 2f0b movel %a3,%sp@- 45032: 2f0a movel %a2,%sp@- POSIX_Spinlock_Control *the_spinlock = NULL; Objects_Locations location; if ( !spinlock ) 45034: 4a88 tstl %a0 45036: 6756 beqs 4508e RTEMS_INLINE_ROUTINE POSIX_Spinlock_Control *_POSIX_Spinlock_Get ( pthread_spinlock_t *spinlock, Objects_Locations *location ) { return (POSIX_Spinlock_Control *) _Objects_Get( 45038: 486e fffc pea %fp@(-4) 4503c: 2f10 movel %a0@,%sp@- 4503e: 4879 0005 e094 pea 5e094 <_POSIX_Spinlock_Information> 45044: 4eb9 0004 6f10 jsr 46f10 <_Objects_Get> return EINVAL; the_spinlock = _POSIX_Spinlock_Get( spinlock, &location ); switch ( location ) { 4504a: 4fef 000c lea %sp@(12),%sp 4504e: 2440 moveal %d0,%a2 45050: 4aae fffc tstl %fp@(-4) 45054: 6638 bnes 4508e */ RTEMS_INLINE_ROUTINE bool _CORE_spinlock_Is_busy( CORE_spinlock_Control *the_spinlock ) { return (the_spinlock->users != 0); 45056: 202a 0018 movel %a2@(24),%d0 4505a: 47f9 0004 769a lea 4769a <_Thread_Enable_dispatch>,%a3 case OBJECTS_LOCAL: if ( _CORE_spinlock_Is_busy( &the_spinlock->Spinlock ) ) { 45060: 6706 beqs 45068 _Thread_Enable_dispatch(); 45062: 4e93 jsr %a3@ 45064: 7010 moveq #16,%d0 return EBUSY; 45066: 6028 bras 45090 <== ALWAYS TAKEN } _Objects_Close( &_POSIX_Spinlock_Information, &the_spinlock->Object ); 45068: 2f0a movel %a2,%sp@- 4506a: 4879 0005 e094 pea 5e094 <_POSIX_Spinlock_Information> 45070: 4eb9 0004 6b44 jsr 46b44 <_Objects_Close> */ RTEMS_INLINE_ROUTINE void _POSIX_Spinlock_Free ( POSIX_Spinlock_Control *the_spinlock ) { _Objects_Free( &_POSIX_Spinlock_Information, &the_spinlock->Object ); 45076: 2f0a movel %a2,%sp@- 45078: 4879 0005 e094 pea 5e094 <_POSIX_Spinlock_Information> 4507e: 4eb9 0004 6db8 jsr 46db8 <_Objects_Free> _POSIX_Spinlock_Free( the_spinlock ); _Thread_Enable_dispatch(); 45084: 4e93 jsr %a3@ return 0; 45086: 4fef 0010 lea %sp@(16),%sp _Objects_Close( &_POSIX_Spinlock_Information, &the_spinlock->Object ); _POSIX_Spinlock_Free( the_spinlock ); _Thread_Enable_dispatch(); 4508a: 4280 clrl %d0 return 0; 4508c: 6002 bras 45090 <== ALWAYS TAKEN 4508e: 7016 moveq #22,%d0 case OBJECTS_ERROR: break; } return EINVAL; } 45090: 246e fff4 moveal %fp@(-12),%a2 45094: 266e fff8 moveal %fp@(-8),%a3 45098: 4e5e unlk %fp 4509a: 4e75 rts 0004509c : int pthread_spin_init( pthread_spinlock_t *spinlock, int pshared ) { 4509c: 4e56 fff0 linkw %fp,#-16 450a0: 48d7 1c00 moveml %a2-%a4,%sp@ 450a4: 266e 0008 moveal %fp@(8),%a3 POSIX_Spinlock_Control *the_spinlock; CORE_spinlock_Attributes attributes; if ( !spinlock ) 450a8: 4a8b tstl %a3 450aa: 6762 beqs 4510e return EINVAL; switch ( pshared ) { 450ac: 4aae 000c tstl %fp@(12) 450b0: 665c bnes 4510e rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 450b2: 2039 0005 de74 movel 5de74 <_Thread_Dispatch_disable_level>,%d0 450b8: 5280 addql #1,%d0 450ba: 23c0 0005 de74 movel %d0,5de74 <_Thread_Dispatch_disable_level> * This function allocates a spinlock control block from * the inactive chain of free spinlock control blocks. */ RTEMS_INLINE_ROUTINE POSIX_Spinlock_Control *_POSIX_Spinlock_Allocate( void ) { return (POSIX_Spinlock_Control *) 450c0: 4879 0005 e094 pea 5e094 <_POSIX_Spinlock_Information> 450c6: 45f9 0004 769a lea 4769a <_Thread_Enable_dispatch>,%a2 450cc: 4eb9 0004 6ac4 jsr 46ac4 <_Objects_Allocate> _Thread_Disable_dispatch(); /* prevents deletion */ the_spinlock = _POSIX_Spinlock_Allocate(); if ( !the_spinlock ) { 450d2: 588f addql #4,%sp 450d4: 2840 moveal %d0,%a4 450d6: 4a80 tstl %d0 450d8: 6606 bnes 450e0 _Thread_Enable_dispatch(); 450da: 4e92 jsr %a2@ 450dc: 700b moveq #11,%d0 return EAGAIN; 450de: 6030 bras 45110 <== ALWAYS TAKEN } _CORE_spinlock_Initialize( &the_spinlock->Spinlock, &attributes ); 450e0: 486e fffc pea %fp@(-4) 450e4: 486c 0010 pea %a4@(16) 450e8: 4eb9 0004 6564 jsr 46564 <_CORE_spinlock_Initialize> #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 450ee: 202c 0008 movel %a4@(8),%d0 450f2: 4281 clrl %d1 450f4: 2079 0005 e0ac moveal 5e0ac <_POSIX_Spinlock_Information+0x18>,%a0 450fa: 3200 movew %d0,%d1 450fc: 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; 45100: 42ac 000c clrl %a4@(12) _Objects_Open_u32( &_POSIX_Spinlock_Information, &the_spinlock->Object, 0 ); *spinlock = the_spinlock->Object.id; 45104: 2680 movel %d0,%a3@ _Thread_Enable_dispatch(); 45106: 4e92 jsr %a2@ return 0; 45108: 508f addql #8,%sp _Objects_Open_u32( &_POSIX_Spinlock_Information, &the_spinlock->Object, 0 ); *spinlock = the_spinlock->Object.id; _Thread_Enable_dispatch(); 4510a: 4280 clrl %d0 return 0; 4510c: 6002 bras 45110 <== ALWAYS TAKEN 4510e: 7016 moveq #22,%d0 } 45110: 4cee 1c00 fff0 moveml %fp@(-16),%a2-%a4 45116: 4e5e unlk %fp 45118: 4e75 rts ... 0004511c : */ int pthread_spin_lock( pthread_spinlock_t *spinlock ) { 4511c: 4e56 fffc linkw %fp,#-4 45120: 206e 0008 moveal %fp@(8),%a0 45124: 2f02 movel %d2,%sp@- POSIX_Spinlock_Control *the_spinlock = NULL; Objects_Locations location; CORE_spinlock_Status status; if ( !spinlock ) 45126: 4a88 tstl %a0 45128: 6744 beqs 4516e RTEMS_INLINE_ROUTINE POSIX_Spinlock_Control *_POSIX_Spinlock_Get ( pthread_spinlock_t *spinlock, Objects_Locations *location ) { return (POSIX_Spinlock_Control *) _Objects_Get( 4512a: 486e fffc pea %fp@(-4) 4512e: 2f10 movel %a0@,%sp@- 45130: 4879 0005 e094 pea 5e094 <_POSIX_Spinlock_Information> 45136: 4eb9 0004 6f10 jsr 46f10 <_Objects_Get> return EINVAL; the_spinlock = _POSIX_Spinlock_Get( spinlock, &location ); switch ( location ) { 4513c: 4fef 000c lea %sp@(12),%sp 45140: 4aae fffc tstl %fp@(-4) 45144: 6628 bnes 4516e case OBJECTS_LOCAL: status = _CORE_spinlock_Wait( &the_spinlock->Spinlock, true, 0 ); 45146: 42a7 clrl %sp@- 45148: 4878 0001 pea 1 4514c: 2040 moveal %d0,%a0 4514e: 4868 0010 pea %a0@(16) 45152: 4eb9 0004 65d4 jsr 465d4 <_CORE_spinlock_Wait> 45158: 2400 movel %d0,%d2 _Thread_Enable_dispatch(); 4515a: 4eb9 0004 769a jsr 4769a <_Thread_Enable_dispatch> return _POSIX_Spinlock_Translate_core_spinlock_return_code( status ); 45160: 2f02 movel %d2,%sp@- 45162: 4eb9 0004 5178 jsr 45178 <_POSIX_Spinlock_Translate_core_spinlock_return_code> 45168: 4fef 0010 lea %sp@(16),%sp 4516c: 6002 bras 45170 <== ALWAYS TAKEN 4516e: 7016 moveq #22,%d0 case OBJECTS_ERROR: break; } return EINVAL; } 45170: 242e fff8 movel %fp@(-8),%d2 45174: 4e5e unlk %fp 45176: 4e75 rts 00045190 : */ int pthread_spin_trylock( pthread_spinlock_t *spinlock ) { 45190: 4e56 fffc linkw %fp,#-4 45194: 206e 0008 moveal %fp@(8),%a0 45198: 2f02 movel %d2,%sp@- POSIX_Spinlock_Control *the_spinlock = NULL; Objects_Locations location; CORE_spinlock_Status status; if ( !spinlock ) 4519a: 4a88 tstl %a0 4519c: 6742 beqs 451e0 4519e: 486e fffc pea %fp@(-4) 451a2: 2f10 movel %a0@,%sp@- 451a4: 4879 0005 e094 pea 5e094 <_POSIX_Spinlock_Information> 451aa: 4eb9 0004 6f10 jsr 46f10 <_Objects_Get> return EINVAL; the_spinlock = _POSIX_Spinlock_Get( spinlock, &location ); switch ( location ) { 451b0: 4fef 000c lea %sp@(12),%sp 451b4: 4aae fffc tstl %fp@(-4) 451b8: 6626 bnes 451e0 case OBJECTS_LOCAL: status = _CORE_spinlock_Wait( &the_spinlock->Spinlock, false, 0 ); 451ba: 42a7 clrl %sp@- 451bc: 2040 moveal %d0,%a0 451be: 42a7 clrl %sp@- 451c0: 4868 0010 pea %a0@(16) 451c4: 4eb9 0004 65d4 jsr 465d4 <_CORE_spinlock_Wait> 451ca: 2400 movel %d0,%d2 _Thread_Enable_dispatch(); 451cc: 4eb9 0004 769a jsr 4769a <_Thread_Enable_dispatch> return _POSIX_Spinlock_Translate_core_spinlock_return_code( status ); 451d2: 2f02 movel %d2,%sp@- 451d4: 4eb9 0004 5178 jsr 45178 <_POSIX_Spinlock_Translate_core_spinlock_return_code> 451da: 4fef 0010 lea %sp@(16),%sp 451de: 6002 bras 451e2 <== ALWAYS TAKEN 451e0: 7016 moveq #22,%d0 case OBJECTS_ERROR: break; } return EINVAL; } 451e2: 242e fff8 movel %fp@(-8),%d2 451e6: 4e5e unlk %fp 451e8: 4e75 rts ... 000451ec : */ int pthread_spin_unlock( pthread_spinlock_t *spinlock ) { 451ec: 4e56 fffc linkw %fp,#-4 451f0: 206e 0008 moveal %fp@(8),%a0 451f4: 2f02 movel %d2,%sp@- POSIX_Spinlock_Control *the_spinlock = NULL; Objects_Locations location; CORE_spinlock_Status status; if ( !spinlock ) 451f6: 4a88 tstl %a0 451f8: 673c beqs 45236 451fa: 486e fffc pea %fp@(-4) 451fe: 2f10 movel %a0@,%sp@- 45200: 4879 0005 e094 pea 5e094 <_POSIX_Spinlock_Information> 45206: 4eb9 0004 6f10 jsr 46f10 <_Objects_Get> return EINVAL; the_spinlock = _POSIX_Spinlock_Get( spinlock, &location ); switch ( location ) { 4520c: 4fef 000c lea %sp@(12),%sp 45210: 4aae fffc tstl %fp@(-4) 45214: 6620 bnes 45236 case OBJECTS_LOCAL: status = _CORE_spinlock_Release( &the_spinlock->Spinlock ); 45216: 2040 moveal %d0,%a0 45218: 4868 0010 pea %a0@(16) 4521c: 4eb9 0004 6584 jsr 46584 <_CORE_spinlock_Release> 45222: 2400 movel %d0,%d2 _Thread_Enable_dispatch(); 45224: 4eb9 0004 769a jsr 4769a <_Thread_Enable_dispatch> return _POSIX_Spinlock_Translate_core_spinlock_return_code( status ); 4522a: 2f02 movel %d2,%sp@- 4522c: 4eb9 0004 5178 jsr 45178 <_POSIX_Spinlock_Translate_core_spinlock_return_code> 45232: 508f addql #8,%sp 45234: 6002 bras 45238 <== ALWAYS TAKEN 45236: 7016 moveq #22,%d0 case OBJECTS_ERROR: break; } return EINVAL; } 45238: 242e fff8 movel %fp@(-8),%d2 4523c: 4e5e unlk %fp 4523e: 4e75 rts 000453ec : * * 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183 */ void pthread_testcancel( void ) { 453ec: 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() ) 453f0: 2039 0005 de4a movel 5de4a <_ISR_Nest_level>,%d0 * * 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183 */ void pthread_testcancel( void ) { 453f6: 2f02 movel %d2,%sp@- * Don't even think about deleting a resource from an ISR. * Besides this request is supposed to be for _Thread_Executing * and the ISR context is not a thread. */ if ( _ISR_Is_in_progress() ) 453f8: 4a80 tstl %d0 453fa: 6646 bnes 45442 <== ALWAYS TAKEN return; thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 453fc: 2079 0005 de6a moveal 5de6a <_Thread_Executing>,%a0 45402: 2039 0005 ddb0 movel 5ddb0 <_Thread_Dispatch_disable_level>,%d0 45408: 5280 addql #1,%d0 4540a: 2068 010e moveal %a0@(270),%a0 4540e: 23c0 0005 ddb0 movel %d0,5ddb0 <_Thread_Dispatch_disable_level> _Thread_Disable_dispatch(); if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 45414: 4aa8 00cc tstl %a0@(204) 45418: 6704 beqs 4541e <== NEVER TAKEN 4541a: 4202 clrb %d2 <== NOT EXECUTED 4541c: 6008 bras 45426 <== NOT EXECUTED /* Setting Cancelability State, P1003.1c/Draft 10, p. 183 */ int _EXFUN(pthread_setcancelstate, (int __state, int *__oldstate)); int _EXFUN(pthread_setcanceltype, (int __type, int *__oldtype)); void _EXFUN(pthread_testcancel, (void)); 4541e: 4aa8 00d4 tstl %a0@(212) 45422: 56c2 sne %d2 45424: 4482 negl %d2 thread_support->cancelation_requested ) cancel = true; _Thread_Enable_dispatch(); 45426: 4eb9 0004 7702 jsr 47702 <_Thread_Enable_dispatch> if ( cancel ) 4542c: 4a02 tstb %d2 4542e: 6712 beqs 45442 _POSIX_Thread_Exit( _Thread_Executing, PTHREAD_CANCELED ); 45430: 4878 ffff pea ffffffff 45434: 2f39 0005 de6a movel 5de6a <_Thread_Executing>,%sp@- 4543a: 4eb9 0004 a594 jsr 4a594 <_POSIX_Thread_Exit> 45440: 508f addql #8,%sp <== NOT EXECUTED } 45442: 242e fffc movel %fp@(-4),%d2 45446: 4e5e unlk %fp 45448: 4e75 rts ... 0004bc84 : rtems_name name, rtems_attribute attribute_set, uint32_t maximum_waiters, rtems_id *id ) { 4bc84: 4e56 ffe4 linkw %fp,#-28 4bc88: 202e 0010 movel %fp@(16),%d0 4bc8c: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@ 4bc90: 242e 0008 movel %fp@(8),%d2 4bc94: 262e 000c movel %fp@(12),%d3 4bc98: 266e 0014 moveal %fp@(20),%a3 Barrier_Control *the_barrier; CORE_barrier_Attributes the_attributes; if ( !rtems_is_name_valid( name ) ) 4bc9c: 4a82 tstl %d2 4bc9e: 6606 bnes 4bca6 4bca0: 7003 moveq #3,%d0 4bca2: 6000 0088 braw 4bd2c <== ALWAYS TAKEN return RTEMS_INVALID_NAME; if ( !id ) 4bca6: 4a8b tstl %a3 4bca8: 6604 bnes 4bcae 4bcaa: 7009 moveq #9,%d0 4bcac: 607e bras 4bd2c <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; /* Initialize core barrier attributes */ if ( _Attributes_Is_barrier_automatic( attribute_set ) ) { 4bcae: 0803 0004 btst #4,%d3 4bcb2: 6710 beqs 4bcc4 the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE; if ( maximum_waiters == 0 ) 4bcb4: 4a80 tstl %d0 4bcb6: 6606 bnes 4bcbe 4bcb8: 103c 000a moveb #10,%d0 4bcbc: 606e bras 4bd2c <== ALWAYS TAKEN if ( !id ) return RTEMS_INVALID_ADDRESS; /* Initialize core barrier attributes */ if ( _Attributes_Is_barrier_automatic( attribute_set ) ) { the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE; 4bcbe: 42ae fff8 clrl %fp@(-8) 4bcc2: 6006 bras 4bcca <== ALWAYS TAKEN if ( maximum_waiters == 0 ) return RTEMS_INVALID_NUMBER; } else the_attributes.discipline = CORE_BARRIER_MANUAL_RELEASE; 4bcc4: 7201 moveq #1,%d1 4bcc6: 2d41 fff8 movel %d1,%fp@(-8) 4bcca: 2239 0005 cec4 movel 5cec4 <_Thread_Dispatch_disable_level>,%d1 4bcd0: 5281 addql #1,%d1 the_attributes.maximum_count = maximum_waiters; 4bcd2: 2d40 fffc movel %d0,%fp@(-4) 4bcd6: 23c1 0005 cec4 movel %d1,5cec4 <_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 ); 4bcdc: 4879 0005 d758 pea 5d758 <_Barrier_Information> 4bce2: 45f9 0004 6cee lea 46cee <_Thread_Enable_dispatch>,%a2 4bce8: 4eb9 0004 60a8 jsr 460a8 <_Objects_Allocate> _Thread_Disable_dispatch(); /* prevents deletion */ the_barrier = _Barrier_Allocate(); if ( !the_barrier ) { 4bcee: 588f addql #4,%sp 4bcf0: 2840 moveal %d0,%a4 4bcf2: 4a80 tstl %d0 4bcf4: 6606 bnes 4bcfc _Thread_Enable_dispatch(); 4bcf6: 4e92 jsr %a2@ 4bcf8: 7005 moveq #5,%d0 return RTEMS_TOO_MANY; 4bcfa: 6030 bras 4bd2c <== ALWAYS TAKEN } the_barrier->attribute_set = attribute_set; 4bcfc: 2943 0010 movel %d3,%a4@(16) _CORE_barrier_Initialize( &the_barrier->Barrier, &the_attributes ); 4bd00: 486e fff8 pea %fp@(-8) 4bd04: 486c 0014 pea %a4@(20) 4bd08: 4eb9 0004 c148 jsr 4c148 <_CORE_barrier_Initialize> 4bd0e: 202c 0008 movel %a4@(8),%d0 4bd12: 4281 clrl %d1 4bd14: 2079 0005 d770 moveal 5d770 <_Barrier_Information+0x18>,%a0 4bd1a: 3200 movew %d0,%d1 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 4bd1c: 2942 000c movel %d2,%a4@(12) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4bd20: 218c 1c00 movel %a4,%a0@(00000000,%d1:l:4) &_Barrier_Information, &the_barrier->Object, (Objects_Name) name ); *id = the_barrier->Object.id; 4bd24: 2680 movel %d0,%a3@ _Thread_Enable_dispatch(); 4bd26: 4e92 jsr %a2@ return RTEMS_SUCCESSFUL; 4bd28: 508f addql #8,%sp (Objects_Name) name ); *id = the_barrier->Object.id; _Thread_Enable_dispatch(); 4bd2a: 4280 clrl %d0 return RTEMS_SUCCESSFUL; } 4bd2c: 4cee 1c0c ffe4 moveml %fp@(-28),%d2-%d3/%a2-%a4 4bd32: 4e5e unlk %fp 4bd34: 4e75 rts ... 0004bd38 : */ rtems_status_code rtems_barrier_delete( rtems_id id ) { 4bd38: 4e56 fffc linkw %fp,#-4 4bd3c: 2f0a movel %a2,%sp@- RTEMS_INLINE_ROUTINE Barrier_Control *_Barrier_Get ( Objects_Id id, Objects_Locations *location ) { return (Barrier_Control *) 4bd3e: 486e fffc pea %fp@(-4) 4bd42: 2f2e 0008 movel %fp@(8),%sp@- 4bd46: 4879 0005 d758 pea 5d758 <_Barrier_Information> 4bd4c: 4eb9 0004 64f4 jsr 464f4 <_Objects_Get> Barrier_Control *the_barrier; Objects_Locations location; the_barrier = _Barrier_Get( id, &location ); switch ( location ) { 4bd52: 4fef 000c lea %sp@(12),%sp 4bd56: 2440 moveal %d0,%a2 4bd58: 4aae fffc tstl %fp@(-4) 4bd5c: 6704 beqs 4bd62 4bd5e: 7004 moveq #4,%d0 4bd60: 6038 bras 4bd9a <== ALWAYS TAKEN case OBJECTS_LOCAL: _CORE_barrier_Flush( 4bd62: 4878 0002 pea 2 4bd66: 42a7 clrl %sp@- 4bd68: 486a 0014 pea %a2@(20) 4bd6c: 4eb9 0004 7374 jsr 47374 <_Thread_queue_Flush> &the_barrier->Barrier, NULL, CORE_BARRIER_WAS_DELETED ); _Objects_Close( &_Barrier_Information, &the_barrier->Object ); 4bd72: 2f0a movel %a2,%sp@- 4bd74: 4879 0005 d758 pea 5d758 <_Barrier_Information> 4bd7a: 4eb9 0004 6128 jsr 46128 <_Objects_Close> */ RTEMS_INLINE_ROUTINE void _Barrier_Free ( Barrier_Control *the_barrier ) { _Objects_Free( &_Barrier_Information, &the_barrier->Object ); 4bd80: 2f0a movel %a2,%sp@- 4bd82: 4879 0005 d758 pea 5d758 <_Barrier_Information> 4bd88: 4eb9 0004 639c jsr 4639c <_Objects_Free> _Barrier_Free( the_barrier ); _Thread_Enable_dispatch(); 4bd8e: 4eb9 0004 6cee jsr 46cee <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 4bd94: 4fef 001c lea %sp@(28),%sp _Objects_Close( &_Barrier_Information, &the_barrier->Object ); _Barrier_Free( the_barrier ); _Thread_Enable_dispatch(); 4bd98: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4bd9a: 246e fff8 moveal %fp@(-8),%a2 4bd9e: 4e5e unlk %fp 4bda0: 4e75 rts ... 0004bda4 : rtems_status_code rtems_barrier_release( rtems_id id, uint32_t *released ) { 4bda4: 4e56 fffc linkw %fp,#-4 4bda8: 2f0a movel %a2,%sp@- 4bdaa: 246e 000c moveal %fp@(12),%a2 4bdae: 2f02 movel %d2,%sp@- 4bdb0: 242e 0008 movel %fp@(8),%d2 Barrier_Control *the_barrier; Objects_Locations location; if ( !released ) 4bdb4: 4a8a tstl %a2 4bdb6: 6604 bnes 4bdbc 4bdb8: 7009 moveq #9,%d0 4bdba: 603e bras 4bdfa <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE Barrier_Control *_Barrier_Get ( Objects_Id id, Objects_Locations *location ) { return (Barrier_Control *) 4bdbc: 486e fffc pea %fp@(-4) 4bdc0: 2f02 movel %d2,%sp@- 4bdc2: 4879 0005 d758 pea 5d758 <_Barrier_Information> 4bdc8: 4eb9 0004 64f4 jsr 464f4 <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_barrier = _Barrier_Get( id, &location ); switch ( location ) { 4bdce: 4fef 000c lea %sp@(12),%sp 4bdd2: 4aae fffc tstl %fp@(-4) 4bdd6: 6704 beqs 4bddc 4bdd8: 7004 moveq #4,%d0 4bdda: 601e bras 4bdfa <== ALWAYS TAKEN case OBJECTS_LOCAL: *released = _CORE_barrier_Release( &the_barrier->Barrier, id, NULL ); 4bddc: 42a7 clrl %sp@- 4bdde: 2040 moveal %d0,%a0 4bde0: 2f02 movel %d2,%sp@- 4bde2: 4868 0014 pea %a0@(20) 4bde6: 4eb9 0004 c184 jsr 4c184 <_CORE_barrier_Release> 4bdec: 2480 movel %d0,%a2@ _Thread_Enable_dispatch(); 4bdee: 4eb9 0004 6cee jsr 46cee <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 4bdf4: 4fef 000c lea %sp@(12),%sp the_barrier = _Barrier_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: *released = _CORE_barrier_Release( &the_barrier->Barrier, id, NULL ); _Thread_Enable_dispatch(); 4bdf8: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4bdfa: 242e fff4 movel %fp@(-12),%d2 4bdfe: 246e fff8 moveal %fp@(-8),%a2 4be02: 4e5e unlk %fp 4be04: 4e75 rts ... 0004be08 : rtems_status_code rtems_barrier_wait( rtems_id id, rtems_interval timeout ) { 4be08: 4e56 fffc linkw %fp,#-4 4be0c: 2f02 movel %d2,%sp@- 4be0e: 486e fffc pea %fp@(-4) 4be12: 242e 0008 movel %fp@(8),%d2 4be16: 2f02 movel %d2,%sp@- 4be18: 4879 0005 d758 pea 5d758 <_Barrier_Information> 4be1e: 4eb9 0004 64f4 jsr 464f4 <_Objects_Get> Barrier_Control *the_barrier; Objects_Locations location; the_barrier = _Barrier_Get( id, &location ); switch ( location ) { 4be24: 4fef 000c lea %sp@(12),%sp 4be28: 4aae fffc tstl %fp@(-4) 4be2c: 6704 beqs 4be32 4be2e: 7004 moveq #4,%d0 4be30: 6032 bras 4be64 <== ALWAYS TAKEN case OBJECTS_LOCAL: _CORE_barrier_Wait( 4be32: 42a7 clrl %sp@- 4be34: 2f2e 000c movel %fp@(12),%sp@- 4be38: 2040 moveal %d0,%a0 4be3a: 4878 0001 pea 1 4be3e: 2f02 movel %d2,%sp@- 4be40: 4868 0014 pea %a0@(20) 4be44: 4eb9 0004 c1b8 jsr 4c1b8 <_CORE_barrier_Wait> id, true, timeout, NULL ); _Thread_Enable_dispatch(); 4be4a: 4eb9 0004 6cee jsr 46cee <_Thread_Enable_dispatch> return _Barrier_Translate_core_barrier_return_code( 4be50: 2079 0005 cf7e moveal 5cf7e <_Thread_Executing>,%a0 4be56: 2f28 0034 movel %a0@(52),%sp@- 4be5a: 4eb9 0004 cc10 jsr 4cc10 <_Barrier_Translate_core_barrier_return_code> 4be60: 4fef 0018 lea %sp@(24),%sp case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4be64: 242e fff8 movel %fp@(-8),%d2 4be68: 4e5e unlk %fp 4be6a: 4e75 rts 00049afc : rtems_status_code rtems_clock_get( rtems_clock_get_options option, void *time_buffer ) { 49afc: 4e56 0000 linkw %fp,#0 49b00: 202e 0008 movel %fp@(8),%d0 49b04: 2f0a movel %a2,%sp@- 49b06: 246e 000c moveal %fp@(12),%a2 if ( !time_buffer ) 49b0a: 4a8a tstl %a2 49b0c: 6604 bnes 49b12 49b0e: 7209 moveq #9,%d1 49b10: 6066 bras 49b78 <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; if ( option == RTEMS_CLOCK_GET_TOD ) 49b12: 4a80 tstl %d0 49b14: 6610 bnes 49b26 return rtems_clock_get_tod( (rtems_time_of_day *)time_buffer ); 49b16: 2d4a 0008 movel %a2,%fp@(8) if ( option == RTEMS_CLOCK_GET_TIME_VALUE ) return rtems_clock_get_tod_timeval( (struct timeval *)time_buffer ); return RTEMS_INVALID_NUMBER; } 49b1a: 246e fffc moveal %fp@(-4),%a2 49b1e: 4e5e unlk %fp { if ( !time_buffer ) return RTEMS_INVALID_ADDRESS; if ( option == RTEMS_CLOCK_GET_TOD ) return rtems_clock_get_tod( (rtems_time_of_day *)time_buffer ); 49b20: 4ef9 0004 9bd4 jmp 49bd4 if ( option == RTEMS_CLOCK_GET_SECONDS_SINCE_EPOCH ) 49b26: 7201 moveq #1,%d1 49b28: b280 cmpl %d0,%d1 49b2a: 6610 bnes 49b3c return rtems_clock_get_seconds_since_epoch((rtems_interval *)time_buffer); 49b2c: 2d4a 0008 movel %a2,%fp@(8) if ( option == RTEMS_CLOCK_GET_TIME_VALUE ) return rtems_clock_get_tod_timeval( (struct timeval *)time_buffer ); return RTEMS_INVALID_NUMBER; } 49b30: 246e fffc moveal %fp@(-4),%a2 49b34: 4e5e unlk %fp if ( option == RTEMS_CLOCK_GET_TOD ) return rtems_clock_get_tod( (rtems_time_of_day *)time_buffer ); if ( option == RTEMS_CLOCK_GET_SECONDS_SINCE_EPOCH ) return rtems_clock_get_seconds_since_epoch((rtems_interval *)time_buffer); 49b36: 4ef9 0004 9b84 jmp 49b84 if ( option == RTEMS_CLOCK_GET_TICKS_SINCE_BOOT ) { 49b3c: 7202 moveq #2,%d1 49b3e: b280 cmpl %d0,%d1 49b40: 6608 bnes 49b4a rtems_interval *interval = (rtems_interval *)time_buffer; *interval = rtems_clock_get_ticks_since_boot(); 49b42: 4eb9 0004 9bc4 jsr 49bc4 49b48: 600c bras 49b56 <== ALWAYS TAKEN return RTEMS_SUCCESSFUL; } if ( option == RTEMS_CLOCK_GET_TICKS_PER_SECOND ) { 49b4a: 7203 moveq #3,%d1 49b4c: b280 cmpl %d0,%d1 49b4e: 660c bnes 49b5c rtems_interval *interval = (rtems_interval *)time_buffer; *interval = rtems_clock_get_ticks_per_second(); 49b50: 4eb9 0004 9bac jsr 49bac 49b56: 2480 movel %d0,%a2@ 49b58: 4281 clrl %d1 return RTEMS_SUCCESSFUL; 49b5a: 601c bras 49b78 <== ALWAYS TAKEN } if ( option == RTEMS_CLOCK_GET_TIME_VALUE ) 49b5c: 7204 moveq #4,%d1 49b5e: b280 cmpl %d0,%d1 49b60: 6706 beqs 49b68 49b62: 123c 000a moveb #10,%d1 49b66: 6010 bras 49b78 <== ALWAYS TAKEN return rtems_clock_get_tod_timeval( (struct timeval *)time_buffer ); 49b68: 2d4a 0008 movel %a2,%fp@(8) return RTEMS_INVALID_NUMBER; } 49b6c: 246e fffc moveal %fp@(-4),%a2 49b70: 4e5e unlk %fp *interval = rtems_clock_get_ticks_per_second(); return RTEMS_SUCCESSFUL; } if ( option == RTEMS_CLOCK_GET_TIME_VALUE ) return rtems_clock_get_tod_timeval( (struct timeval *)time_buffer ); 49b72: 4ef9 0004 9c88 jmp 49c88 return RTEMS_INVALID_NUMBER; } 49b78: 246e fffc moveal %fp@(-4),%a2 49b7c: 2001 movel %d1,%d0 49b7e: 4e5e unlk %fp 49b80: 4e75 rts ... 000455f0 : #include rtems_status_code rtems_clock_get_seconds_since_epoch( rtems_interval *the_interval ) { 455f0: 4e56 0000 linkw %fp,#0 455f4: 206e 0008 moveal %fp@(8),%a0 if ( !the_interval ) 455f8: 4a88 tstl %a0 455fa: 6604 bnes 45600 455fc: 7009 moveq #9,%d0 455fe: 6014 bras 45614 <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; if ( !_TOD_Is_set ) 45600: 4a39 0006 6d68 tstb 66d68 <_TOD_Is_set> 45606: 6604 bnes 4560c 45608: 700b moveq #11,%d0 4560a: 6008 bras 45614 <== ALWAYS TAKEN return RTEMS_NOT_DEFINED; *the_interval = _TOD_Seconds_since_epoch(); 4560c: 20b9 0006 6de6 movel 66de6 <_TOD_Now>,%a0@ 45612: 4280 clrl %d0 return RTEMS_SUCCESSFUL; } 45614: 4e5e unlk %fp 45616: 4e75 rts 00045640 : #include rtems_status_code rtems_clock_get_tod( rtems_time_of_day *time_buffer ) { 45640: 4e56 ffcc linkw %fp,#-52 45644: 2f0a movel %a2,%sp@- 45646: 246e 0008 moveal %fp@(8),%a2 4564a: 2f02 movel %d2,%sp@- rtems_time_of_day *tmbuf = time_buffer; struct tm time; struct timeval now; if ( !time_buffer ) 4564c: 4a8a tstl %a2 4564e: 6606 bnes 45656 45650: 7009 moveq #9,%d0 45652: 6000 0092 braw 456e6 <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; if ( !_TOD_Is_set ) 45656: 4a39 0006 6d68 tstb 66d68 <_TOD_Is_set> 4565c: 6606 bnes 45664 4565e: 700b moveq #11,%d0 45660: 6000 0084 braw 456e6 <== ALWAYS TAKEN { ISR_Level level; struct timespec now; suseconds_t useconds; _ISR_Disable(level); 45664: 203c 0000 0700 movel #1792,%d0 4566a: 40c2 movew %sr,%d2 4566c: 8082 orl %d2,%d0 4566e: 46c0 movew %d0,%sr _TOD_Get( &now ); 45670: 486e fff0 pea %fp@(-16) 45674: 4eb9 0004 6da4 jsr 46da4 <_TOD_Get> _ISR_Enable(level); 4567a: 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; 4567c: 243c 0000 03e8 movel #1000,%d2 /* Obtain the current time */ _TOD_Get_timeval( &now ); /* Split it into a closer format */ gmtime_r( &now.tv_sec, &time ); 45682: 486e ffcc pea %fp@(-52) _ISR_Disable(level); _TOD_Get( &now ); _ISR_Enable(level); useconds = (suseconds_t)now.tv_nsec; 45686: 202e fff4 movel %fp@(-12),%d0 4568a: 486e fff8 pea %fp@(-8) useconds /= (suseconds_t)TOD_NANOSECONDS_PER_MICROSECOND; time->tv_sec = now.tv_sec; 4568e: 2d6e fff0 fff8 movel %fp@(-16),%fp@(-8) time->tv_usec = useconds; 45694: 4c42 0800 remsl %d2,%d0,%d0 45698: 2d40 fffc movel %d0,%fp@(-4) 4569c: 4eb9 0004 e7c8 jsr 4e7c8 /* Now adjust it to the RTEMS format */ tmbuf->year = time.tm_year + 1900; tmbuf->month = time.tm_mon + 1; 456a2: 206e ffdc moveal %fp@(-36),%a0 456a6: 5288 addql #1,%a0 tmbuf->minute = time.tm_min; tmbuf->second = time.tm_sec; tmbuf->ticks = now.tv_usec / rtems_configuration_get_microseconds_per_tick(); return RTEMS_SUCCESSFUL; 456a8: 4fef 000c lea %sp@(12),%sp tmbuf->month = time.tm_mon + 1; tmbuf->day = time.tm_mday; tmbuf->hour = time.tm_hour; tmbuf->minute = time.tm_min; tmbuf->second = time.tm_sec; tmbuf->ticks = now.tv_usec / 456ac: 4280 clrl %d0 /* Split it into a closer format */ gmtime_r( &now.tv_sec, &time ); /* Now adjust it to the RTEMS format */ tmbuf->year = time.tm_year + 1900; tmbuf->month = time.tm_mon + 1; 456ae: 2548 0004 movel %a0,%a2@(4) /* Split it into a closer format */ gmtime_r( &now.tv_sec, &time ); /* Now adjust it to the RTEMS format */ tmbuf->year = time.tm_year + 1900; 456b2: 206e ffe0 moveal %fp@(-32),%a0 456b6: 41e8 076c lea %a0@(1900),%a0 tmbuf->month = time.tm_mon + 1; tmbuf->day = time.tm_mday; 456ba: 256e ffd8 0008 movel %fp@(-40),%a2@(8) tmbuf->hour = time.tm_hour; 456c0: 256e ffd4 000c movel %fp@(-44),%a2@(12) tmbuf->minute = time.tm_min; 456c6: 256e ffd0 0010 movel %fp@(-48),%a2@(16) tmbuf->second = time.tm_sec; 456cc: 256e ffcc 0014 movel %fp@(-52),%a2@(20) /* Split it into a closer format */ gmtime_r( &now.tv_sec, &time ); /* Now adjust it to the RTEMS format */ tmbuf->year = time.tm_year + 1900; 456d2: 2488 movel %a0,%a2@ tmbuf->month = time.tm_mon + 1; tmbuf->day = time.tm_mday; tmbuf->hour = time.tm_hour; tmbuf->minute = time.tm_min; tmbuf->second = time.tm_sec; tmbuf->ticks = now.tv_usec / 456d4: 242e fffc movel %fp@(-4),%d2 456d8: 41f9 0005 d7e0 lea 5d7e0 ,%a0 456de: 4c50 2002 remul %a0@,%d2,%d2 456e2: 2542 0018 movel %d2,%a2@(24) rtems_configuration_get_microseconds_per_tick(); return RTEMS_SUCCESSFUL; } 456e6: 242e ffc4 movel %fp@(-60),%d2 456ea: 246e ffc8 moveal %fp@(-56),%a2 456ee: 4e5e unlk %fp 456f0: 4e75 rts ... 00049c88 : #include rtems_status_code rtems_clock_get_tod_timeval( struct timeval *time ) { 49c88: 4e56 ffec linkw %fp,#-20 49c8c: 48d7 040c moveml %d2-%d3/%a2,%sp@ 49c90: 246e 0008 moveal %fp@(8),%a2 if ( !time ) 49c94: 4a8a tstl %a2 49c96: 6604 bnes 49c9c 49c98: 7009 moveq #9,%d0 49c9a: 603e bras 49cda <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; if ( !_TOD_Is_set ) 49c9c: 4a39 0009 be0c tstb 9be0c <_TOD_Is_set> 49ca2: 6604 bnes 49ca8 49ca4: 700b moveq #11,%d0 49ca6: 6032 bras 49cda <== ALWAYS TAKEN { ISR_Level level; struct timespec now; suseconds_t useconds; _ISR_Disable(level); 49ca8: 203c 0000 0700 movel #1792,%d0 49cae: 40c2 movew %sr,%d2 49cb0: 8082 orl %d2,%d0 49cb2: 46c0 movew %d0,%sr _TOD_Get( &now ); 49cb4: 486e fff8 pea %fp@(-8) 49cb8: 4eb9 0004 b048 jsr 4b048 <_TOD_Get> _ISR_Enable(level); 49cbe: 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; 49cc0: 263c 0000 03e8 movel #1000,%d3 return RTEMS_NOT_DEFINED; _TOD_Get_timeval( time ); return RTEMS_SUCCESSFUL; 49cc6: 588f addql #4,%sp 49cc8: 4280 clrl %d0 _ISR_Disable(level); _TOD_Get( &now ); _ISR_Enable(level); useconds = (suseconds_t)now.tv_nsec; 49cca: 222e fffc movel %fp@(-4),%d1 useconds /= (suseconds_t)TOD_NANOSECONDS_PER_MICROSECOND; time->tv_sec = now.tv_sec; time->tv_usec = useconds; 49cce: 4c43 1801 remsl %d3,%d1,%d1 49cd2: 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; 49cd6: 24ae fff8 movel %fp@(-8),%a2@ } 49cda: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 49ce0: 4e5e unlk %fp 49ce2: 4e75 rts 00062bf8 : * error code - if unsuccessful */ rtems_status_code rtems_clock_get_uptime( struct timespec *uptime ) { 62bf8: 4e56 0000 linkw %fp,#0 62bfc: 202e 0008 movel %fp@(8),%d0 if ( !uptime ) 62c00: 6606 bnes 62c08 62c02: 103c 0009 moveb #9,%d0 62c06: 600c bras 62c14 <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; _TOD_Get_uptime_as_timespec( uptime ); 62c08: 2f00 movel %d0,%sp@- 62c0a: 4eb9 0006 3a5c jsr 63a5c <_TOD_Get_uptime_as_timespec> return RTEMS_SUCCESSFUL; 62c10: 588f addql #4,%sp ) { if ( !uptime ) return RTEMS_INVALID_ADDRESS; _TOD_Get_uptime_as_timespec( uptime ); 62c12: 4280 clrl %d0 return RTEMS_SUCCESSFUL; } 62c14: 4e5e unlk %fp 62c16: 4e75 rts 00045710 : */ rtems_status_code rtems_clock_set( rtems_time_of_day *time_buffer ) { 45710: 4e56 fff8 linkw %fp,#-8 45714: 2f0a movel %a2,%sp@- 45716: 246e 0008 moveal %fp@(8),%a2 4571a: 2f02 movel %d2,%sp@- struct timespec newtime; if ( !time_buffer ) 4571c: 4a8a tstl %a2 4571e: 6604 bnes 45724 45720: 7009 moveq #9,%d0 45722: 605c bras 45780 <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; if ( _TOD_Validate( time_buffer ) ) { 45724: 2f0a movel %a2,%sp@- 45726: 4eb9 0004 5868 jsr 45868 <_TOD_Validate> 4572c: 588f addql #4,%sp 4572e: 4a00 tstb %d0 45730: 6604 bnes 45736 45732: 7014 moveq #20,%d0 45734: 604a bras 45780 <== ALWAYS TAKEN newtime.tv_sec = _TOD_To_seconds( time_buffer ); 45736: 2f0a movel %a2,%sp@- 45738: 4eb9 0004 57c8 jsr 457c8 <_TOD_To_seconds> newtime.tv_nsec = time_buffer->ticks * 4573e: 242a 0018 movel %a2@(24),%d2 45742: 41f9 0005 d7e0 lea 5d7e0 ,%a0 45748: 4c10 2800 mulsl %a0@,%d2 if ( !time_buffer ) return RTEMS_INVALID_ADDRESS; if ( _TOD_Validate( time_buffer ) ) { newtime.tv_sec = _TOD_To_seconds( time_buffer ); 4574c: 2d40 fff8 movel %d0,%fp@(-8) newtime.tv_nsec = time_buffer->ticks * 45750: 203c 0000 03e8 movel #1000,%d0 45756: 4c02 0800 mulsl %d2,%d0 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 4575a: 2239 0006 6d54 movel 66d54 <_Thread_Dispatch_disable_level>,%d1 45760: 5281 addql #1,%d1 45762: 2d40 fffc movel %d0,%fp@(-4) 45766: 23c1 0006 6d54 movel %d1,66d54 <_Thread_Dispatch_disable_level> rtems_configuration_get_nanoseconds_per_tick(); _Thread_Disable_dispatch(); _TOD_Set( &newtime ); 4576c: 486e fff8 pea %fp@(-8) 45770: 4eb9 0004 6eac jsr 46eac <_TOD_Set> _Thread_Enable_dispatch(); 45776: 4eb9 0004 803a jsr 4803a <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 4577c: 508f addql #8,%sp newtime.tv_nsec = time_buffer->ticks * rtems_configuration_get_nanoseconds_per_tick(); _Thread_Disable_dispatch(); _TOD_Set( &newtime ); _Thread_Enable_dispatch(); 4577e: 4280 clrl %d0 return RTEMS_SUCCESSFUL; } return RTEMS_INVALID_CLOCK; } 45780: 242e fff0 movel %fp@(-16),%d2 45784: 246e fff4 moveal %fp@(-12),%a2 45788: 4e5e unlk %fp 4578a: 4e75 rts 00044920 : * error code - if unsuccessful */ rtems_status_code rtems_clock_set_nanoseconds_extension( rtems_nanoseconds_extension_routine routine ) { 44920: 4e56 0000 linkw %fp,#0 44924: 202e 0008 movel %fp@(8),%d0 if ( !routine ) 44928: 6606 bnes 44930 4492a: 103c 0009 moveb #9,%d0 4492e: 6008 bras 44938 <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; _Watchdog_Nanoseconds_since_tick_handler = routine; 44930: 23c0 0005 d050 movel %d0,5d050 <_Watchdog_Nanoseconds_since_tick_handler> 44936: 4280 clrl %d0 return RTEMS_SUCCESSFUL; } 44938: 4e5e unlk %fp 4493a: 4e75 rts 00044978 : rtems_event_set event_in, rtems_option option_set, rtems_interval ticks, rtems_event_set *event_out ) { 44978: 4e56 0000 linkw %fp,#0 4497c: 202e 0008 movel %fp@(8),%d0 44980: 206e 0014 moveal %fp@(20),%a0 RTEMS_API_Control *api; if ( !event_out ) 44984: 4a88 tstl %a0 44986: 6604 bnes 4498c 44988: 7009 moveq #9,%d0 4498a: 6046 bras 449d2 <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; api = _Thread_Executing->API_Extensions[ THREAD_API_RTEMS ]; 4498c: 2279 0005 cf7e moveal 5cf7e <_Thread_Executing>,%a1 44992: 2269 010a moveal %a1@(266),%a1 if ( _Event_sets_Is_empty( event_in ) ) { 44996: 4a80 tstl %d0 44998: 6604 bnes 4499e *event_out = api->pending_events; 4499a: 2091 movel %a1@,%a0@ return RTEMS_SUCCESSFUL; 4499c: 6034 bras 449d2 <== ALWAYS TAKEN rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 4499e: 2239 0005 cec4 movel 5cec4 <_Thread_Dispatch_disable_level>,%d1 449a4: 5281 addql #1,%d1 449a6: 23c1 0005 cec4 movel %d1,5cec4 <_Thread_Dispatch_disable_level> } _Thread_Disable_dispatch(); _Event_Seize( event_in, option_set, ticks, event_out ); 449ac: 2f08 movel %a0,%sp@- 449ae: 2f2e 0010 movel %fp@(16),%sp@- 449b2: 2f2e 000c movel %fp@(12),%sp@- 449b6: 2f00 movel %d0,%sp@- 449b8: 4eb9 0004 49d8 jsr 449d8 <_Event_Seize> _Thread_Enable_dispatch(); 449be: 4eb9 0004 6cee jsr 46cee <_Thread_Enable_dispatch> return( _Thread_Executing->Wait.return_code ); 449c4: 2079 0005 cf7e moveal 5cf7e <_Thread_Executing>,%a0 449ca: 4fef 0010 lea %sp@(16),%sp 449ce: 2028 0034 movel %a0@(52),%d0 } 449d2: 4e5e unlk %fp 449d4: 4e75 rts ... 00044adc : rtems_status_code rtems_event_send( rtems_id id, rtems_event_set event_in ) { 44adc: 4e56 fffc linkw %fp,#-4 44ae0: 2f02 movel %d2,%sp@- register Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; the_thread = _Thread_Get( id, &location ); 44ae2: 486e fffc pea %fp@(-4) 44ae6: 2f2e 0008 movel %fp@(8),%sp@- 44aea: 4eb9 0004 6d14 jsr 46d14 <_Thread_Get> switch ( location ) { 44af0: 508f addql #8,%sp 44af2: 4aae fffc tstl %fp@(-4) 44af6: 6704 beqs 44afc 44af8: 7004 moveq #4,%d0 44afa: 602c bras 44b28 <== ALWAYS TAKEN case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; 44afc: 2240 moveal %d0,%a1 rtems_event_set *the_event_set ) { ISR_Level level; _ISR_Disable( level ); 44afe: 223c 0000 0700 movel #1792,%d1 44b04: 2069 010a moveal %a1@(266),%a0 44b08: 40c2 movew %sr,%d2 44b0a: 8282 orl %d2,%d1 44b0c: 46c1 movew %d1,%sr *the_event_set |= the_new_events; 44b0e: 222e 000c movel %fp@(12),%d1 44b12: 8390 orl %d1,%a0@ _ISR_Enable( level ); 44b14: 46c2 movew %d2,%sr _Event_sets_Post( event_in, &api->pending_events ); _Event_Surrender( the_thread ); 44b16: 2f00 movel %d0,%sp@- 44b18: 4eb9 0004 4b30 jsr 44b30 <_Event_Surrender> _Thread_Enable_dispatch(); 44b1e: 4eb9 0004 6cee jsr 46cee <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 44b24: 588f addql #4,%sp case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; _Event_sets_Post( event_in, &api->pending_events ); _Event_Surrender( the_thread ); _Thread_Enable_dispatch(); 44b26: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 44b28: 242e fff8 movel %fp@(-8),%d2 44b2c: 4e5e unlk %fp 44b2e: 4e75 rts 00048dcc : rtems_status_code rtems_extension_create( rtems_name name, const rtems_extensions_table *extension_table, rtems_id *id ) { 48dcc: 4e56 fff0 linkw %fp,#-16 48dd0: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ 48dd4: 242e 0008 movel %fp@(8),%d2 48dd8: 286e 0010 moveal %fp@(16),%a4 Extension_Control *the_extension; if ( !id ) 48ddc: 4a8c tstl %a4 48dde: 6604 bnes 48de4 48de0: 7009 moveq #9,%d0 48de2: 6072 bras 48e56 <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; if ( !rtems_is_name_valid( name ) ) 48de4: 4a82 tstl %d2 48de6: 6604 bnes 48dec 48de8: 7003 moveq #3,%d0 48dea: 606a bras 48e56 <== ALWAYS TAKEN rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 48dec: 2039 0006 86ec movel 686ec <_Thread_Dispatch_disable_level>,%d0 48df2: 5280 addql #1,%d0 48df4: 23c0 0006 86ec movel %d0,686ec <_Thread_Dispatch_disable_level> #ifndef __EXTENSION_MANAGER_inl #define __EXTENSION_MANAGER_inl RTEMS_INLINE_ROUTINE Extension_Control *_Extension_Allocate( void ) { return (Extension_Control *) _Objects_Allocate( &_Extension_Information ); 48dfa: 4879 0006 8898 pea 68898 <_Extension_Information> 48e00: 47f9 0004 a752 lea 4a752 <_Thread_Enable_dispatch>,%a3 48e06: 4eb9 0004 9a08 jsr 49a08 <_Objects_Allocate> _Thread_Disable_dispatch(); /* to prevent deletion */ the_extension = _Extension_Allocate(); if ( !the_extension ) { 48e0c: 588f addql #4,%sp 48e0e: 2440 moveal %d0,%a2 48e10: 4a80 tstl %d0 48e12: 6606 bnes 48e1a _Thread_Enable_dispatch(); 48e14: 4e93 jsr %a3@ 48e16: 7005 moveq #5,%d0 return RTEMS_TOO_MANY; 48e18: 603c bras 48e56 <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE void _User_extensions_Add_set_with_table( User_extensions_Control *extension, const User_extensions_Table *extension_table ) { extension->Callouts = *extension_table; 48e1a: 4878 0020 pea 20 48e1e: 2f2e 000c movel %fp@(12),%sp@- 48e22: 486a 0024 pea %a2@(36) 48e26: 4eb9 0005 55cc jsr 555cc _User_extensions_Add_set( extension ); 48e2c: 486a 0010 pea %a2@(16) 48e30: 4eb9 0004 b480 jsr 4b480 <_User_extensions_Add_set> #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 48e36: 202a 0008 movel %a2@(8),%d0 48e3a: 4281 clrl %d1 48e3c: 2079 0006 88b0 moveal 688b0 <_Extension_Information+0x18>,%a0 48e42: 3200 movew %d0,%d1 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 48e44: 2542 000c movel %d2,%a2@(12) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 48e48: 218a 1c00 movel %a2,%a0@(00000000,%d1:l:4) &_Extension_Information, &the_extension->Object, (Objects_Name) name ); *id = the_extension->Object.id; 48e4c: 2880 movel %d0,%a4@ _Thread_Enable_dispatch(); 48e4e: 4e93 jsr %a3@ return RTEMS_SUCCESSFUL; 48e50: 4fef 0010 lea %sp@(16),%sp &the_extension->Object, (Objects_Name) name ); *id = the_extension->Object.id; _Thread_Enable_dispatch(); 48e54: 4280 clrl %d0 return RTEMS_SUCCESSFUL; } 48e56: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 48e5c: 4e5e unlk %fp 48e5e: 4e75 rts 00048e60 : #include rtems_status_code rtems_extension_delete( rtems_id id ) { 48e60: 4e56 fffc linkw %fp,#-4 48e64: 2f0a movel %a2,%sp@- RTEMS_INLINE_ROUTINE Extension_Control *_Extension_Get ( Objects_Id id, Objects_Locations *location ) { return (Extension_Control *) 48e66: 486e fffc pea %fp@(-4) 48e6a: 2f2e 0008 movel %fp@(8),%sp@- 48e6e: 4879 0006 8898 pea 68898 <_Extension_Information> 48e74: 4eb9 0004 9e54 jsr 49e54 <_Objects_Get> Extension_Control *the_extension; Objects_Locations location; the_extension = _Extension_Get( id, &location ); switch ( location ) { 48e7a: 4fef 000c lea %sp@(12),%sp 48e7e: 2440 moveal %d0,%a2 48e80: 4aae fffc tstl %fp@(-4) 48e84: 6704 beqs 48e8a 48e86: 7004 moveq #4,%d0 48e88: 6032 bras 48ebc <== ALWAYS TAKEN case OBJECTS_LOCAL: _User_extensions_Remove_set( &the_extension->Extension ); 48e8a: 486a 0010 pea %a2@(16) 48e8e: 4eb9 0004 b574 jsr 4b574 <_User_extensions_Remove_set> _Objects_Close( &_Extension_Information, &the_extension->Object ); 48e94: 2f0a movel %a2,%sp@- 48e96: 4879 0006 8898 pea 68898 <_Extension_Information> 48e9c: 4eb9 0004 9a88 jsr 49a88 <_Objects_Close> RTEMS_INLINE_ROUTINE void _Extension_Free ( Extension_Control *the_extension ) { _Objects_Free( &_Extension_Information, &the_extension->Object ); 48ea2: 2f0a movel %a2,%sp@- 48ea4: 4879 0006 8898 pea 68898 <_Extension_Information> 48eaa: 4eb9 0004 9cfc jsr 49cfc <_Objects_Free> _Extension_Free( the_extension ); _Thread_Enable_dispatch(); 48eb0: 4eb9 0004 a752 jsr 4a752 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 48eb6: 4fef 0014 lea %sp@(20),%sp switch ( location ) { case OBJECTS_LOCAL: _User_extensions_Remove_set( &the_extension->Extension ); _Objects_Close( &_Extension_Information, &the_extension->Object ); _Extension_Free( the_extension ); _Thread_Enable_dispatch(); 48eba: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 48ebc: 246e fff8 moveal %fp@(-8),%a2 48ec0: 4e5e unlk %fp 48ec2: 4e75 rts 00044cb8 : rtems_status_code rtems_interrupt_catch( rtems_isr_entry new_isr_handler, rtems_vector_number vector, rtems_isr_entry *old_isr_handler ) { 44cb8: 4e56 0000 linkw %fp,#0 44cbc: 222e 0008 movel %fp@(8),%d1 44cc0: 202e 000c movel %fp@(12),%d0 44cc4: 206e 0010 moveal %fp@(16),%a0 if ( !_ISR_Is_vector_number_valid( vector ) ) 44cc8: 0c80 0000 00ff cmpil #255,%d0 44cce: 6304 blss 44cd4 44cd0: 700a moveq #10,%d0 44cd2: 601e bras 44cf2 <== ALWAYS TAKEN return RTEMS_INVALID_NUMBER; if ( !_ISR_Is_valid_user_handler( (void *) new_isr_handler ) ) 44cd4: 4a81 tstl %d1 44cd6: 6718 beqs 44cf0 return RTEMS_INVALID_ADDRESS; if ( !_ISR_Is_valid_user_handler( (void *) old_isr_handler ) ) 44cd8: 4a88 tstl %a0 44cda: 6714 beqs 44cf0 return RTEMS_INVALID_ADDRESS; _ISR_Install_vector( 44cdc: 2f08 movel %a0,%sp@- 44cde: 2f01 movel %d1,%sp@- 44ce0: 2f00 movel %d0,%sp@- 44ce2: 4eb9 0004 802a jsr 4802a <_CPU_ISR_install_vector> vector, (proc_ptr)new_isr_handler, (proc_ptr *)old_isr_handler ); return RTEMS_SUCCESSFUL; 44ce8: 4fef 000c lea %sp@(12),%sp return RTEMS_INVALID_ADDRESS; if ( !_ISR_Is_valid_user_handler( (void *) old_isr_handler ) ) return RTEMS_INVALID_ADDRESS; _ISR_Install_vector( 44cec: 4280 clrl %d0 vector, (proc_ptr)new_isr_handler, (proc_ptr *)old_isr_handler ); return RTEMS_SUCCESSFUL; 44cee: 6002 bras 44cf2 <== ALWAYS TAKEN 44cf0: 7009 moveq #9,%d0 } 44cf2: 4e5e unlk %fp 44cf4: 4e75 rts ... 0004bf90 : rtems_status_code rtems_io_close( rtems_device_major_number major, rtems_device_minor_number minor, void *argument ) { 4bf90: 4e56 0000 linkw %fp,#0 4bf94: 202e 0008 movel %fp@(8),%d0 4bf98: 2f03 movel %d3,%sp@- 4bf9a: 222e 000c movel %fp@(12),%d1 4bf9e: 206e 0010 moveal %fp@(16),%a0 4bfa2: 2f02 movel %d2,%sp@- rtems_device_driver_entry callout; if ( major >= _IO_Number_of_drivers ) 4bfa4: b0b9 0005 d728 cmpl 5d728 <_IO_Number_of_drivers>,%d0 4bfaa: 6504 bcss 4bfb0 4bfac: 700a moveq #10,%d0 4bfae: 6030 bras 4bfe0 <== ALWAYS TAKEN return RTEMS_INVALID_NUMBER; callout = _IO_Driver_address_table[major].close_entry; 4bfb0: 2600 movel %d0,%d3 4bfb2: 2400 movel %d0,%d2 4bfb4: e78b lsll #3,%d3 4bfb6: eb8a lsll #5,%d2 4bfb8: 2279 0005 d72c moveal 5d72c <_IO_Driver_address_table>,%a1 4bfbe: 9483 subl %d3,%d2 4bfc0: 2271 2808 moveal %a1@(00000008,%d2:l),%a1 return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL; 4bfc4: 4a89 tstl %a1 4bfc6: 6604 bnes 4bfcc 4bfc8: 4280 clrl %d0 4bfca: 6014 bras 4bfe0 <== ALWAYS TAKEN 4bfcc: 2d48 0010 movel %a0,%fp@(16) 4bfd0: 2d41 000c movel %d1,%fp@(12) 4bfd4: 2d40 0008 movel %d0,%fp@(8) } 4bfd8: 241f movel %sp@+,%d2 4bfda: 261f movel %sp@+,%d3 4bfdc: 4e5e unlk %fp if ( major >= _IO_Number_of_drivers ) return RTEMS_INVALID_NUMBER; callout = _IO_Driver_address_table[major].close_entry; return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL; 4bfde: 4ed1 jmp %a1@ } 4bfe0: 241f movel %sp@+,%d2 4bfe2: 261f movel %sp@+,%d3 4bfe4: 4e5e unlk %fp 4bfe6: 4e75 rts 0004bfe8 : rtems_status_code rtems_io_control( rtems_device_major_number major, rtems_device_minor_number minor, void *argument ) { 4bfe8: 4e56 0000 linkw %fp,#0 4bfec: 202e 0008 movel %fp@(8),%d0 4bff0: 2f03 movel %d3,%sp@- 4bff2: 222e 000c movel %fp@(12),%d1 4bff6: 206e 0010 moveal %fp@(16),%a0 4bffa: 2f02 movel %d2,%sp@- rtems_device_driver_entry callout; if ( major >= _IO_Number_of_drivers ) 4bffc: b0b9 0005 d728 cmpl 5d728 <_IO_Number_of_drivers>,%d0 4c002: 6504 bcss 4c008 4c004: 700a moveq #10,%d0 4c006: 6030 bras 4c038 return RTEMS_INVALID_NUMBER; callout = _IO_Driver_address_table[major].control_entry; 4c008: 2600 movel %d0,%d3 4c00a: 2400 movel %d0,%d2 4c00c: e78b lsll #3,%d3 4c00e: eb8a lsll #5,%d2 4c010: 2279 0005 d72c moveal 5d72c <_IO_Driver_address_table>,%a1 4c016: 9483 subl %d3,%d2 4c018: 2271 2814 moveal %a1@(00000014,%d2:l),%a1 return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL; 4c01c: 4a89 tstl %a1 4c01e: 6604 bnes 4c024 4c020: 4280 clrl %d0 4c022: 6014 bras 4c038 <== ALWAYS TAKEN 4c024: 2d48 0010 movel %a0,%fp@(16) 4c028: 2d41 000c movel %d1,%fp@(12) 4c02c: 2d40 0008 movel %d0,%fp@(8) } 4c030: 241f movel %sp@+,%d2 4c032: 261f movel %sp@+,%d3 4c034: 4e5e unlk %fp if ( major >= _IO_Number_of_drivers ) return RTEMS_INVALID_NUMBER; callout = _IO_Driver_address_table[major].control_entry; return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL; 4c036: 4ed1 jmp %a1@ } 4c038: 241f movel %sp@+,%d2 4c03a: 261f movel %sp@+,%d3 4c03c: 4e5e unlk %fp 4c03e: 4e75 rts 0004a0d4 : rtems_status_code rtems_io_initialize( rtems_device_major_number major, rtems_device_minor_number minor, void *argument ) { 4a0d4: 4e56 0000 linkw %fp,#0 4a0d8: 202e 0008 movel %fp@(8),%d0 4a0dc: 2f03 movel %d3,%sp@- 4a0de: 222e 000c movel %fp@(12),%d1 4a0e2: 206e 0010 moveal %fp@(16),%a0 4a0e6: 2f02 movel %d2,%sp@- rtems_device_driver_entry callout; if ( major >= _IO_Number_of_drivers ) 4a0e8: b0b9 0005 d728 cmpl 5d728 <_IO_Number_of_drivers>,%d0 4a0ee: 6504 bcss 4a0f4 4a0f0: 700a moveq #10,%d0 4a0f2: 6030 bras 4a124 <== ALWAYS TAKEN return RTEMS_INVALID_NUMBER; callout = _IO_Driver_address_table[major].initialization_entry; 4a0f4: 2600 movel %d0,%d3 4a0f6: 2400 movel %d0,%d2 4a0f8: e78b lsll #3,%d3 4a0fa: 2279 0005 d72c moveal 5d72c <_IO_Driver_address_table>,%a1 4a100: 93c3 subal %d3,%a1 4a102: eb8a lsll #5,%d2 4a104: 2271 2800 moveal %a1@(00000000,%d2:l),%a1 return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL; 4a108: 4a89 tstl %a1 4a10a: 6604 bnes 4a110 4a10c: 4280 clrl %d0 4a10e: 6014 bras 4a124 <== ALWAYS TAKEN 4a110: 2d48 0010 movel %a0,%fp@(16) 4a114: 2d41 000c movel %d1,%fp@(12) 4a118: 2d40 0008 movel %d0,%fp@(8) } 4a11c: 241f movel %sp@+,%d2 4a11e: 261f movel %sp@+,%d3 4a120: 4e5e unlk %fp if ( major >= _IO_Number_of_drivers ) return RTEMS_INVALID_NUMBER; callout = _IO_Driver_address_table[major].initialization_entry; return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL; 4a122: 4ed1 jmp %a1@ } 4a124: 241f movel %sp@+,%d2 4a126: 261f movel %sp@+,%d3 4a128: 4e5e unlk %fp 4a12a: 4e75 rts 0004c040 : rtems_status_code rtems_io_open( rtems_device_major_number major, rtems_device_minor_number minor, void *argument ) { 4c040: 4e56 0000 linkw %fp,#0 4c044: 202e 0008 movel %fp@(8),%d0 4c048: 2f03 movel %d3,%sp@- 4c04a: 222e 000c movel %fp@(12),%d1 4c04e: 206e 0010 moveal %fp@(16),%a0 4c052: 2f02 movel %d2,%sp@- rtems_device_driver_entry callout; if ( major >= _IO_Number_of_drivers ) 4c054: b0b9 0005 d728 cmpl 5d728 <_IO_Number_of_drivers>,%d0 4c05a: 6504 bcss 4c060 4c05c: 700a moveq #10,%d0 4c05e: 6030 bras 4c090 <== ALWAYS TAKEN return RTEMS_INVALID_NUMBER; callout = _IO_Driver_address_table[major].open_entry; 4c060: 2600 movel %d0,%d3 4c062: 2400 movel %d0,%d2 4c064: e78b lsll #3,%d3 4c066: eb8a lsll #5,%d2 4c068: 2279 0005 d72c moveal 5d72c <_IO_Driver_address_table>,%a1 4c06e: 9483 subl %d3,%d2 4c070: 2271 2804 moveal %a1@(00000004,%d2:l),%a1 return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL; 4c074: 4a89 tstl %a1 4c076: 6604 bnes 4c07c 4c078: 4280 clrl %d0 4c07a: 6014 bras 4c090 <== ALWAYS TAKEN 4c07c: 2d48 0010 movel %a0,%fp@(16) 4c080: 2d41 000c movel %d1,%fp@(12) 4c084: 2d40 0008 movel %d0,%fp@(8) } 4c088: 241f movel %sp@+,%d2 4c08a: 261f movel %sp@+,%d3 4c08c: 4e5e unlk %fp if ( major >= _IO_Number_of_drivers ) return RTEMS_INVALID_NUMBER; callout = _IO_Driver_address_table[major].open_entry; return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL; 4c08e: 4ed1 jmp %a1@ } 4c090: 241f movel %sp@+,%d2 4c092: 261f movel %sp@+,%d3 4c094: 4e5e unlk %fp 4c096: 4e75 rts 0004c098 : rtems_status_code rtems_io_read( rtems_device_major_number major, rtems_device_minor_number minor, void *argument ) { 4c098: 4e56 0000 linkw %fp,#0 4c09c: 202e 0008 movel %fp@(8),%d0 4c0a0: 2f03 movel %d3,%sp@- 4c0a2: 222e 000c movel %fp@(12),%d1 4c0a6: 206e 0010 moveal %fp@(16),%a0 4c0aa: 2f02 movel %d2,%sp@- rtems_device_driver_entry callout; if ( major >= _IO_Number_of_drivers ) 4c0ac: b0b9 0005 d728 cmpl 5d728 <_IO_Number_of_drivers>,%d0 4c0b2: 6504 bcss 4c0b8 4c0b4: 700a moveq #10,%d0 4c0b6: 6030 bras 4c0e8 <== ALWAYS TAKEN return RTEMS_INVALID_NUMBER; callout = _IO_Driver_address_table[major].read_entry; 4c0b8: 2600 movel %d0,%d3 4c0ba: 2400 movel %d0,%d2 4c0bc: e78b lsll #3,%d3 4c0be: eb8a lsll #5,%d2 4c0c0: 2279 0005 d72c moveal 5d72c <_IO_Driver_address_table>,%a1 4c0c6: 9483 subl %d3,%d2 4c0c8: 2271 280c moveal %a1@(0000000c,%d2:l),%a1 return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL; 4c0cc: 4a89 tstl %a1 4c0ce: 6604 bnes 4c0d4 4c0d0: 4280 clrl %d0 4c0d2: 6014 bras 4c0e8 <== ALWAYS TAKEN 4c0d4: 2d48 0010 movel %a0,%fp@(16) 4c0d8: 2d41 000c movel %d1,%fp@(12) 4c0dc: 2d40 0008 movel %d0,%fp@(8) } 4c0e0: 241f movel %sp@+,%d2 4c0e2: 261f movel %sp@+,%d3 4c0e4: 4e5e unlk %fp if ( major >= _IO_Number_of_drivers ) return RTEMS_INVALID_NUMBER; callout = _IO_Driver_address_table[major].read_entry; return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL; 4c0e6: 4ed1 jmp %a1@ } 4c0e8: 241f movel %sp@+,%d2 4c0ea: 261f movel %sp@+,%d3 4c0ec: 4e5e unlk %fp 4c0ee: 4e75 rts 00046d48 : 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 ) { 46d48: 4e56 0000 linkw %fp,#0 46d4c: 206e 000c moveal %fp@(12),%a0 46d50: 2f0a movel %a2,%sp@- 46d52: 226e 0010 moveal %fp@(16),%a1 46d56: 2f02 movel %d2,%sp@- 46d58: 242e 0008 movel %fp@(8),%d2 rtems_device_major_number major_limit = _IO_Number_of_drivers; 46d5c: 2039 0006 2b8e movel 62b8e <_IO_Number_of_drivers>,%d0 if ( rtems_interrupt_is_in_progress() ) 46d62: 2239 0006 2396 movel 62396 <_ISR_Nest_level>,%d1 46d68: 6706 beqs 46d70 46d6a: 7012 moveq #18,%d0 46d6c: 6000 00d6 braw 46e44 return RTEMS_CALLED_FROM_ISR; if ( registered_major == NULL ) 46d70: 4a89 tstl %a1 46d72: 6700 00ce beqw 46e42 return RTEMS_INVALID_ADDRESS; /* Set it to an invalid value */ *registered_major = major_limit; 46d76: 2280 movel %d0,%a1@ if ( driver_table == NULL ) 46d78: 4a88 tstl %a0 46d7a: 6700 00c6 beqw 46e42 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 46d7e: 4a90 tstl %a0@ 46d80: 6600 00ce bnew 46e50 46d84: 4aa8 0004 tstl %a0@(4) 46d88: 6600 00c6 bnew 46e50 46d8c: 6000 00b4 braw 46e42 <== ALWAYS TAKEN rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 46d90: 2039 0006 22fc movel 622fc <_Thread_Dispatch_disable_level>,%d0 46d96: 5280 addql #1,%d0 46d98: 23c0 0006 22fc movel %d0,622fc <_Thread_Dispatch_disable_level> if ( major >= major_limit ) return RTEMS_INVALID_NUMBER; _Thread_Disable_dispatch(); if ( major == 0 ) { 46d9e: 4a82 tstl %d2 46da0: 662c bnes 46dce static rtems_status_code rtems_io_obtain_major_number( rtems_device_major_number *major ) { rtems_device_major_number n = _IO_Number_of_drivers; 46da2: 2039 0006 2b8e movel 62b8e <_IO_Number_of_drivers>,%d0 46da8: 2479 0006 2b92 moveal 62b92 <_IO_Driver_address_table>,%a2 46dae: 6010 bras 46dc0 <== 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; 46db0: 4a92 tstl %a2@ 46db2: 6600 00a6 bnew 46e5a 46db6: 4aaa 0004 tstl %a2@(4) 46dba: 6600 009e bnew 46e5a 46dbe: 6004 bras 46dc4 <== ALWAYS TAKEN 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 ) { 46dc0: b082 cmpl %d2,%d0 46dc2: 62ec bhis 46db0 if ( rtems_io_is_empty_table( table ) ) break; } /* Assigns invalid value in case of failure */ *major = m; 46dc4: 2282 movel %d2,%a1@ if ( m != n ) 46dc6: b082 cmpl %d2,%d0 46dc8: 6634 bnes 46dfe 46dca: 6000 0098 braw 46e64 <== ALWAYS TAKEN _Thread_Enable_dispatch(); return sc; } major = *registered_major; } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major; 46dce: 2202 movel %d2,%d1 46dd0: 2002 movel %d2,%d0 46dd2: e789 lsll #3,%d1 46dd4: eb88 lsll #5,%d0 46dd6: 2479 0006 2b92 moveal 62b92 <_IO_Driver_address_table>,%a2 46ddc: 9081 subl %d1,%d0 46dde: d5c0 addal %d0,%a2 static inline bool rtems_io_is_empty_table( const rtems_driver_address_table *table ) { return table->initialization_entry == NULL && table->open_entry == NULL; 46de0: 4a92 tstl %a2@ 46de2: 660e bnes 46df2 46de4: 4aaa 0004 tstl %a2@(4) 46de8: 57c0 seq %d0 46dea: 49c0 extbl %d0 46dec: 4480 negl %d0 } major = *registered_major; } else { rtems_driver_address_table *const table = _IO_Driver_address_table + major; if ( !rtems_io_is_empty_table( table ) ) { 46dee: 4a00 tstb %d0 46df0: 660a bnes 46dfc _Thread_Enable_dispatch(); 46df2: 4eb9 0004 866e jsr 4866e <_Thread_Enable_dispatch> 46df8: 700c moveq #12,%d0 return RTEMS_RESOURCE_IN_USE; 46dfa: 6048 bras 46e44 <== ALWAYS TAKEN } *registered_major = major; 46dfc: 2282 movel %d2,%a1@ } _IO_Driver_address_table [major] = *driver_table; 46dfe: 4878 0018 pea 18 46e02: 2202 movel %d2,%d1 46e04: 2002 movel %d2,%d0 46e06: e789 lsll #3,%d1 46e08: eb88 lsll #5,%d0 46e0a: 2f08 movel %a0,%sp@- 46e0c: 9081 subl %d1,%d0 46e0e: d0b9 0006 2b92 addl 62b92 <_IO_Driver_address_table>,%d0 46e14: 2f00 movel %d0,%sp@- 46e16: 4eb9 0005 1f2c jsr 51f2c _Thread_Enable_dispatch(); 46e1c: 4eb9 0004 866e jsr 4866e <_Thread_Enable_dispatch> return rtems_io_initialize( major, 0, NULL ); } 46e22: 246e fffc moveal %fp@(-4),%a2 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 46e26: 4fef 000c lea %sp@(12),%sp 46e2a: 2d42 0008 movel %d2,%fp@(8) } 46e2e: 242e fff8 movel %fp@(-8),%d2 _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 46e32: 42ae 0010 clrl %fp@(16) 46e36: 42ae 000c clrl %fp@(12) } 46e3a: 4e5e unlk %fp _IO_Driver_address_table [major] = *driver_table; _Thread_Enable_dispatch(); return rtems_io_initialize( major, 0, NULL ); 46e3c: 4ef9 0004 eb00 jmp 4eb00 46e42: 7009 moveq #9,%d0 } 46e44: 242e fff8 movel %fp@(-8),%d2 46e48: 246e fffc moveal %fp@(-4),%a2 46e4c: 4e5e unlk %fp 46e4e: 4e75 rts return RTEMS_INVALID_ADDRESS; if ( rtems_io_is_empty_table( driver_table ) ) return RTEMS_INVALID_ADDRESS; if ( major >= major_limit ) 46e50: b082 cmpl %d2,%d0 46e52: 6200 ff3c bhiw 46d90 46e56: 700a moveq #10,%d0 46e58: 60ea bras 46e44 <== ALWAYS TAKEN 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 ) { 46e5a: 5282 addql #1,%d2 46e5c: 45ea 0018 lea %a2@(24),%a2 46e60: 6000 ff5e braw 46dc0 <== ALWAYS TAKEN if ( major == 0 ) { rtems_status_code sc = rtems_io_obtain_major_number( registered_major ); if ( sc != RTEMS_SUCCESSFUL ) { _Thread_Enable_dispatch(); 46e64: 4eb9 0004 866e jsr 4866e <_Thread_Enable_dispatch> 46e6a: 7005 moveq #5,%d0 return sc; 46e6c: 60d6 bras 46e44 <== ALWAYS TAKEN ... 00046e70 : */ rtems_status_code rtems_io_unregister_driver( rtems_device_major_number major ) { 46e70: 4e56 0000 linkw %fp,#0 46e74: 222e 0008 movel %fp@(8),%d1 if ( rtems_interrupt_is_in_progress() ) 46e78: 2039 0006 2396 movel 62396 <_ISR_Nest_level>,%d0 46e7e: 6704 beqs 46e84 46e80: 7012 moveq #18,%d0 46e82: 6042 bras 46ec6 <== ALWAYS TAKEN return RTEMS_CALLED_FROM_ISR; if ( major < _IO_Number_of_drivers ) { 46e84: b2b9 0006 2b8e cmpl 62b8e <_IO_Number_of_drivers>,%d1 46e8a: 6504 bcss 46e90 46e8c: 700d moveq #13,%d0 46e8e: 6036 bras 46ec6 <== ALWAYS TAKEN 46e90: 2039 0006 22fc movel 622fc <_Thread_Dispatch_disable_level>,%d0 46e96: 5280 addql #1,%d0 46e98: 23c0 0006 22fc movel %d0,622fc <_Thread_Dispatch_disable_level> _Thread_Disable_dispatch(); memset( 46e9e: 2001 movel %d1,%d0 46ea0: 4878 0018 pea 18 46ea4: e789 lsll #3,%d1 46ea6: eb88 lsll #5,%d0 46ea8: 42a7 clrl %sp@- 46eaa: 9081 subl %d1,%d0 46eac: d0b9 0006 2b92 addl 62b92 <_IO_Driver_address_table>,%d0 46eb2: 2f00 movel %d0,%sp@- 46eb4: 4eb9 0005 1f9c jsr 51f9c &_IO_Driver_address_table[major], 0, sizeof( rtems_driver_address_table ) ); _Thread_Enable_dispatch(); 46eba: 4eb9 0004 866e jsr 4866e <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 46ec0: 4fef 000c lea %sp@(12),%sp memset( &_IO_Driver_address_table[major], 0, sizeof( rtems_driver_address_table ) ); _Thread_Enable_dispatch(); 46ec4: 4280 clrl %d0 return RTEMS_SUCCESSFUL; } return RTEMS_UNSATISFIED; } 46ec6: 4e5e unlk %fp 46ec8: 4e75 rts ... 0004c0f0 : rtems_status_code rtems_io_write( rtems_device_major_number major, rtems_device_minor_number minor, void *argument ) { 4c0f0: 4e56 0000 linkw %fp,#0 4c0f4: 202e 0008 movel %fp@(8),%d0 4c0f8: 2f03 movel %d3,%sp@- 4c0fa: 222e 000c movel %fp@(12),%d1 4c0fe: 206e 0010 moveal %fp@(16),%a0 4c102: 2f02 movel %d2,%sp@- rtems_device_driver_entry callout; if ( major >= _IO_Number_of_drivers ) 4c104: b0b9 0005 d728 cmpl 5d728 <_IO_Number_of_drivers>,%d0 4c10a: 6504 bcss 4c110 4c10c: 700a moveq #10,%d0 4c10e: 6030 bras 4c140 <== ALWAYS TAKEN return RTEMS_INVALID_NUMBER; callout = _IO_Driver_address_table[major].write_entry; 4c110: 2600 movel %d0,%d3 4c112: 2400 movel %d0,%d2 4c114: e78b lsll #3,%d3 4c116: eb8a lsll #5,%d2 4c118: 2279 0005 d72c moveal 5d72c <_IO_Driver_address_table>,%a1 4c11e: 9483 subl %d3,%d2 4c120: 2271 2810 moveal %a1@(00000010,%d2:l),%a1 return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL; 4c124: 4a89 tstl %a1 4c126: 6604 bnes 4c12c 4c128: 4280 clrl %d0 4c12a: 6014 bras 4c140 <== ALWAYS TAKEN 4c12c: 2d48 0010 movel %a0,%fp@(16) 4c130: 2d41 000c movel %d1,%fp@(12) 4c134: 2d40 0008 movel %d0,%fp@(8) } 4c138: 241f movel %sp@+,%d2 4c13a: 261f movel %sp@+,%d3 4c13c: 4e5e unlk %fp if ( major >= _IO_Number_of_drivers ) return RTEMS_INVALID_NUMBER; callout = _IO_Driver_address_table[major].write_entry; return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL; 4c13e: 4ed1 jmp %a1@ } 4c140: 241f movel %sp@+,%d2 4c142: 261f movel %sp@+,%d3 4c144: 4e5e unlk %fp 4c146: 4e75 rts 00047324 : #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) { 47324: 4e56 fff0 linkw %fp,#-16 47328: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ 4732c: 286e 0008 moveal %fp@(8),%a4 uint32_t i; uint32_t api_index; Thread_Control *the_thread; Objects_Information *information; if ( !routine ) 47330: 4a8c tstl %a4 47332: 6740 beqs 47374 <== ALWAYS TAKEN 47334: 45f9 0006 6d10 lea 66d10 <_Objects_Information_table+0x4>,%a2 return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { if ( !_Objects_Information_table[ api_index ] ) 4733a: 2052 moveal %a2@,%a0 4733c: 4a88 tstl %a0 4733e: 672a beqs 4736a continue; information = _Objects_Information_table[ api_index ][ 1 ]; 47340: 2668 0004 moveal %a0@(4),%a3 if ( !information ) 47344: 4a8b tstl %a3 47346: 6722 beqs 4736a 47348: 7401 moveq #1,%d2 4734a: 6014 bras 47360 <== ALWAYS TAKEN continue; for ( i=1 ; i <= information->maximum ; i++ ) { the_thread = (Thread_Control *)information->local_table[ i ]; 4734c: 206b 0018 moveal %a3@(24),%a0 47350: 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++ ) { 47354: 5282 addql #1,%d2 the_thread = (Thread_Control *)information->local_table[ i ]; if ( !the_thread ) 47356: 4a80 tstl %d0 47358: 6706 beqs 47360 <== ALWAYS TAKEN continue; (*routine)(the_thread); 4735a: 2f00 movel %d0,%sp@- 4735c: 4e94 jsr %a4@ 4735e: 588f addql #4,%sp information = _Objects_Information_table[ api_index ][ 1 ]; if ( !information ) continue; for ( i=1 ; i <= information->maximum ; i++ ) { 47360: 4280 clrl %d0 47362: 302b 000e movew %a3@(14),%d0 47366: b082 cmpl %d2,%d0 47368: 64e2 bccs 4734c 4736a: 588a addql #4,%a2 Objects_Information *information; if ( !routine ) return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { 4736c: b5fc 0006 6d20 cmpal #421152,%a2 47372: 66c6 bnes 4733a (*routine)(the_thread); } } } 47374: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 4737a: 4e5e unlk %fp 4737c: 4e75 rts ... 0004e630 : rtems_id id, const void *buffer, size_t size, uint32_t *count ) { 4e630: 4e56 fff0 linkw %fp,#-16 4e634: 48d7 001c moveml %d2-%d4,%sp@ 4e638: 262e 0008 movel %fp@(8),%d3 4e63c: 242e 000c movel %fp@(12),%d2 4e640: 282e 0014 movel %fp@(20),%d4 register Message_queue_Control *the_message_queue; Objects_Locations location; CORE_message_queue_Status core_status; if ( !buffer ) 4e644: 4a82 tstl %d2 4e646: 6752 beqs 4e69a return RTEMS_INVALID_ADDRESS; if ( !count ) 4e648: 4a84 tstl %d4 4e64a: 674e beqs 4e69a RTEMS_INLINE_ROUTINE Message_queue_Control *_Message_queue_Get ( Objects_Id id, Objects_Locations *location ) { return (Message_queue_Control *) 4e64c: 486e fffc pea %fp@(-4) 4e650: 2f03 movel %d3,%sp@- 4e652: 4879 0007 56fa pea 756fa <_Message_queue_Information> 4e658: 4eb9 0005 3030 jsr 53030 <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_message_queue = _Message_queue_Get( id, &location ); switch ( location ) { 4e65e: 4fef 000c lea %sp@(12),%sp 4e662: 4aae fffc tstl %fp@(-4) 4e666: 6704 beqs 4e66c 4e668: 7004 moveq #4,%d0 4e66a: 6030 bras 4e69c <== ALWAYS TAKEN case OBJECTS_LOCAL: core_status = _CORE_message_queue_Broadcast( 4e66c: 2f04 movel %d4,%sp@- 4e66e: 2040 moveal %d0,%a0 4e670: 42a7 clrl %sp@- 4e672: 2f03 movel %d3,%sp@- 4e674: 2f2e 0010 movel %fp@(16),%sp@- 4e678: 2f02 movel %d2,%sp@- 4e67a: 4868 0014 pea %a0@(20) 4e67e: 4eb9 0005 192c jsr 5192c <_CORE_message_queue_Broadcast> 4e684: 2400 movel %d0,%d2 NULL, #endif count ); _Thread_Enable_dispatch(); 4e686: 4eb9 0005 38b6 jsr 538b6 <_Thread_Enable_dispatch> return _Message_queue_Translate_core_message_queue_return_code( core_status ); 4e68c: 2f02 movel %d2,%sp@- 4e68e: 4eb9 0004 e9b4 jsr 4e9b4 <_Message_queue_Translate_core_message_queue_return_code> #endif count ); _Thread_Enable_dispatch(); return 4e694: 4fef 001c lea %sp@(28),%sp 4e698: 6002 bras 4e69c <== ALWAYS TAKEN 4e69a: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4e69c: 4cee 001c fff0 moveml %fp@(-16),%d2-%d4 4e6a2: 4e5e unlk %fp 4e6a4: 4e75 rts ... 0004cb24 : uint32_t count, size_t max_message_size, rtems_attribute attribute_set, rtems_id *id ) { 4cb24: 4e56 ffe0 linkw %fp,#-32 4cb28: 48d7 1c3c moveml %d2-%d5/%a2-%a4,%sp@ 4cb2c: 242e 0008 movel %fp@(8),%d2 4cb30: 262e 000c movel %fp@(12),%d3 4cb34: 282e 0010 movel %fp@(16),%d4 4cb38: 2a2e 0014 movel %fp@(20),%d5 4cb3c: 286e 0018 moveal %fp@(24),%a4 CORE_message_queue_Attributes the_msgq_attributes; #if defined(RTEMS_MULTIPROCESSING) bool is_global; #endif if ( !rtems_is_name_valid( name ) ) 4cb40: 4a82 tstl %d2 4cb42: 6606 bnes 4cb4a 4cb44: 7003 moveq #3,%d0 4cb46: 6000 00a4 braw 4cbec <== ALWAYS TAKEN return RTEMS_INVALID_NAME; if ( !id ) 4cb4a: 4a8c tstl %a4 4cb4c: 6606 bnes 4cb54 4cb4e: 7009 moveq #9,%d0 4cb50: 6000 009a braw 4cbec <== ALWAYS TAKEN if ( (is_global = _Attributes_Is_global( attribute_set ) ) && !_System_state_Is_multiprocessing ) return RTEMS_MP_NOT_CONFIGURED; #endif if ( count == 0 ) 4cb54: 4a83 tstl %d3 4cb56: 6606 bnes 4cb5e 4cb58: 700a moveq #10,%d0 4cb5a: 6000 0090 braw 4cbec <== ALWAYS TAKEN return RTEMS_INVALID_NUMBER; if ( max_message_size == 0 ) 4cb5e: 4a84 tstl %d4 4cb60: 6606 bnes 4cb68 4cb62: 7008 moveq #8,%d0 4cb64: 6000 0086 braw 4cbec <== ALWAYS TAKEN rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 4cb68: 2039 0006 6528 movel 66528 <_Thread_Dispatch_disable_level>,%d0 4cb6e: 5280 addql #1,%d0 4cb70: 23c0 0006 6528 movel %d0,66528 <_Thread_Dispatch_disable_level> #endif #endif _Thread_Disable_dispatch(); /* protects object pointer */ the_message_queue = _Message_queue_Allocate(); 4cb76: 4eb9 0005 2350 jsr 52350 <_Message_queue_Allocate> 4cb7c: 2440 moveal %d0,%a2 if ( !the_message_queue ) { 4cb7e: 4a80 tstl %d0 4cb80: 660a bnes 4cb8c _Thread_Enable_dispatch(); 4cb82: 4eb9 0004 f4c2 jsr 4f4c2 <_Thread_Enable_dispatch> 4cb88: 7005 moveq #5,%d0 return RTEMS_TOO_MANY; 4cb8a: 6060 bras 4cbec <== ALWAYS TAKEN #endif the_message_queue->attribute_set = attribute_set; if (_Attributes_Is_priority( attribute_set ) ) the_msgq_attributes.discipline = CORE_MESSAGE_QUEUE_DISCIPLINES_PRIORITY; 4cb8c: 204e moveal %fp,%a0 4cb8e: 47f9 0004 f4c2 lea 4f4c2 <_Thread_Enable_dispatch>,%a3 4cb94: 44c5 movew %d5,%ccr 4cb96: 56c0 sne %d0 _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; } #endif the_message_queue->attribute_set = attribute_set; 4cb98: 2545 0010 movel %d5,%a2@(16) if (_Attributes_Is_priority( attribute_set ) ) the_msgq_attributes.discipline = CORE_MESSAGE_QUEUE_DISCIPLINES_PRIORITY; 4cb9c: 49c0 extbl %d0 4cb9e: 5280 addql #1,%d0 4cba0: 2100 movel %d0,%a0@- else the_msgq_attributes.discipline = CORE_MESSAGE_QUEUE_DISCIPLINES_FIFO; if ( ! _CORE_message_queue_Initialize( 4cba2: 2f04 movel %d4,%sp@- 4cba4: 2f03 movel %d3,%sp@- 4cba6: 2f08 movel %a0,%sp@- 4cba8: 486a 0014 pea %a2@(20) 4cbac: 4eb9 0004 dce8 jsr 4dce8 <_CORE_message_queue_Initialize> 4cbb2: 4fef 0010 lea %sp@(16),%sp 4cbb6: 4a00 tstb %d0 4cbb8: 6616 bnes 4cbd0 */ RTEMS_INLINE_ROUTINE void _Message_queue_Free ( Message_queue_Control *the_message_queue ) { _Objects_Free( &_Message_queue_Information, &the_message_queue->Object ); 4cbba: 2f0a movel %a2,%sp@- 4cbbc: 4879 0006 6d46 pea 66d46 <_Message_queue_Information> 4cbc2: 4eb9 0004 ea70 jsr 4ea70 <_Objects_Free> _Objects_MP_Close( &_Message_queue_Information, the_message_queue->Object.id); #endif _Message_queue_Free( the_message_queue ); _Thread_Enable_dispatch(); 4cbc8: 4e93 jsr %a3@ return RTEMS_UNSATISFIED; 4cbca: 508f addql #8,%sp _Objects_MP_Close( &_Message_queue_Information, the_message_queue->Object.id); #endif _Message_queue_Free( the_message_queue ); _Thread_Enable_dispatch(); 4cbcc: 700d moveq #13,%d0 return RTEMS_UNSATISFIED; 4cbce: 601c bras 4cbec <== ALWAYS TAKEN #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4cbd0: 202a 0008 movel %a2@(8),%d0 4cbd4: 4281 clrl %d1 4cbd6: 2079 0006 6d5e moveal 66d5e <_Message_queue_Information+0x18>,%a0 4cbdc: 3200 movew %d0,%d1 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 4cbde: 2542 000c movel %d2,%a2@(12) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4cbe2: 218a 1c00 movel %a2,%a0@(00000000,%d1:l:4) &_Message_queue_Information, &the_message_queue->Object, (Objects_Name) name ); *id = the_message_queue->Object.id; 4cbe6: 2880 movel %d0,%a4@ name, 0 ); #endif _Thread_Enable_dispatch(); 4cbe8: 4e93 jsr %a3@ 4cbea: 4280 clrl %d0 return RTEMS_SUCCESSFUL; } 4cbec: 4cee 1c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a4 4cbf2: 4e5e unlk %fp 4cbf4: 4e75 rts ... 0004fb64 : */ rtems_status_code rtems_message_queue_delete( rtems_id id ) { 4fb64: 4e56 fffc linkw %fp,#-4 4fb68: 2f0a movel %a2,%sp@- RTEMS_INLINE_ROUTINE Message_queue_Control *_Message_queue_Get ( Objects_Id id, Objects_Locations *location ) { return (Message_queue_Control *) 4fb6a: 486e fffc pea %fp@(-4) 4fb6e: 2f2e 0008 movel %fp@(8),%sp@- 4fb72: 4879 0006 8f64 pea 68f64 <_Message_queue_Information> 4fb78: 4eb9 0004 9e54 jsr 49e54 <_Objects_Get> register Message_queue_Control *the_message_queue; Objects_Locations location; the_message_queue = _Message_queue_Get( id, &location ); switch ( location ) { 4fb7e: 4fef 000c lea %sp@(12),%sp 4fb82: 2440 moveal %d0,%a2 4fb84: 4aae fffc tstl %fp@(-4) 4fb88: 6704 beqs 4fb8e 4fb8a: 7004 moveq #4,%d0 4fb8c: 6038 bras 4fbc6 <== ALWAYS TAKEN case OBJECTS_LOCAL: _Objects_Close( &_Message_queue_Information, 4fb8e: 2f00 movel %d0,%sp@- 4fb90: 4879 0006 8f64 pea 68f64 <_Message_queue_Information> 4fb96: 4eb9 0004 9a88 jsr 49a88 <_Objects_Close> &the_message_queue->Object ); _CORE_message_queue_Close( 4fb9c: 4878 0005 pea 5 4fba0: 42a7 clrl %sp@- 4fba2: 486a 0014 pea %a2@(20) 4fba6: 4eb9 0005 0150 jsr 50150 <_CORE_message_queue_Close> */ RTEMS_INLINE_ROUTINE void _Message_queue_Free ( Message_queue_Control *the_message_queue ) { _Objects_Free( &_Message_queue_Information, &the_message_queue->Object ); 4fbac: 2f0a movel %a2,%sp@- 4fbae: 4879 0006 8f64 pea 68f64 <_Message_queue_Information> 4fbb4: 4eb9 0004 9cfc jsr 49cfc <_Objects_Free> 0, /* Not used */ 0 ); } #endif _Thread_Enable_dispatch(); 4fbba: 4eb9 0004 a752 jsr 4a752 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 4fbc0: 4fef 001c lea %sp@(28),%sp 0, /* Not used */ 0 ); } #endif _Thread_Enable_dispatch(); 4fbc4: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4fbc6: 246e fff8 moveal %fp@(-8),%a2 4fbca: 4e5e unlk %fp 4fbcc: 4e75 rts ... 0004e7e8 : rtems_status_code rtems_message_queue_flush( rtems_id id, uint32_t *count ) { 4e7e8: 4e56 fffc linkw %fp,#-4 4e7ec: 2f0a movel %a2,%sp@- 4e7ee: 246e 000c moveal %fp@(12),%a2 register Message_queue_Control *the_message_queue; Objects_Locations location; if ( !count ) 4e7f2: 4a8a tstl %a2 4e7f4: 6604 bnes 4e7fa 4e7f6: 7009 moveq #9,%d0 4e7f8: 603a bras 4e834 RTEMS_INLINE_ROUTINE Message_queue_Control *_Message_queue_Get ( Objects_Id id, Objects_Locations *location ) { return (Message_queue_Control *) 4e7fa: 486e fffc pea %fp@(-4) 4e7fe: 2f2e 0008 movel %fp@(8),%sp@- 4e802: 4879 0007 56fa pea 756fa <_Message_queue_Information> 4e808: 4eb9 0005 3030 jsr 53030 <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_message_queue = _Message_queue_Get( id, &location ); switch ( location ) { 4e80e: 4fef 000c lea %sp@(12),%sp 4e812: 4aae fffc tstl %fp@(-4) 4e816: 6704 beqs 4e81c 4e818: 7004 moveq #4,%d0 4e81a: 6018 bras 4e834 <== ALWAYS TAKEN case OBJECTS_LOCAL: *count = _CORE_message_queue_Flush( &the_message_queue->message_queue ); 4e81c: 2040 moveal %d0,%a0 4e81e: 4868 0014 pea %a0@(20) 4e822: 4eb9 0005 19dc jsr 519dc <_CORE_message_queue_Flush> 4e828: 2480 movel %d0,%a2@ _Thread_Enable_dispatch(); 4e82a: 4eb9 0005 38b6 jsr 538b6 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 4e830: 588f addql #4,%sp the_message_queue = _Message_queue_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: *count = _CORE_message_queue_Flush( &the_message_queue->message_queue ); _Thread_Enable_dispatch(); 4e832: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4e834: 246e fff8 moveal %fp@(-8),%a2 4e838: 4e5e unlk %fp 4e83a: 4e75 rts 0004e83c : rtems_status_code rtems_message_queue_get_number_pending( rtems_id id, uint32_t *count ) { 4e83c: 4e56 fffc linkw %fp,#-4 4e840: 2f0a movel %a2,%sp@- 4e842: 246e 000c moveal %fp@(12),%a2 register Message_queue_Control *the_message_queue; Objects_Locations location; if ( !count ) 4e846: 4a8a tstl %a2 4e848: 6604 bnes 4e84e 4e84a: 7009 moveq #9,%d0 4e84c: 6030 bras 4e87e <== ALWAYS TAKEN 4e84e: 486e fffc pea %fp@(-4) 4e852: 2f2e 0008 movel %fp@(8),%sp@- 4e856: 4879 0007 56fa pea 756fa <_Message_queue_Information> 4e85c: 4eb9 0005 3030 jsr 53030 <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_message_queue = _Message_queue_Get( id, &location ); switch ( location ) { 4e862: 4fef 000c lea %sp@(12),%sp 4e866: 4aae fffc tstl %fp@(-4) 4e86a: 6704 beqs 4e870 4e86c: 7004 moveq #4,%d0 4e86e: 600e bras 4e87e <== ALWAYS TAKEN case OBJECTS_LOCAL: *count = the_message_queue->message_queue.number_of_pending_messages; 4e870: 2040 moveal %d0,%a0 4e872: 24a8 005c movel %a0@(92),%a2@ _Thread_Enable_dispatch(); 4e876: 4eb9 0005 38b6 jsr 538b6 <_Thread_Enable_dispatch> 4e87c: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4e87e: 246e fff8 moveal %fp@(-8),%a2 4e882: 4e5e unlk %fp 4e884: 4e75 rts ... 0004cc24 : void *buffer, size_t *size, rtems_option option_set, rtems_interval timeout ) { 4cc24: 4e56 fff0 linkw %fp,#-16 4cc28: 48d7 001c moveml %d2-%d4,%sp@ 4cc2c: 242e 000c movel %fp@(12),%d2 4cc30: 262e 0010 movel %fp@(16),%d3 register Message_queue_Control *the_message_queue; Objects_Locations location; bool wait; if ( !buffer ) 4cc34: 4a82 tstl %d2 4cc36: 6766 beqs 4cc9e return RTEMS_INVALID_ADDRESS; if ( !size ) 4cc38: 4a83 tstl %d3 4cc3a: 6762 beqs 4cc9e RTEMS_INLINE_ROUTINE Message_queue_Control *_Message_queue_Get ( Objects_Id id, Objects_Locations *location ) { return (Message_queue_Control *) 4cc3c: 486e fffc pea %fp@(-4) 4cc40: 2f2e 0008 movel %fp@(8),%sp@- 4cc44: 4879 0006 6d46 pea 66d46 <_Message_queue_Information> 4cc4a: 4eb9 0004 ebc8 jsr 4ebc8 <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_message_queue = _Message_queue_Get( id, &location ); switch ( location ) { 4cc50: 4fef 000c lea %sp@(12),%sp 4cc54: 4aae fffc tstl %fp@(-4) 4cc58: 6704 beqs 4cc5e 4cc5a: 7004 moveq #4,%d0 4cc5c: 6042 bras 4cca0 <== ALWAYS TAKEN if ( _Options_Is_no_wait( option_set ) ) wait = false; else wait = true; _CORE_message_queue_Seize( 4cc5e: 7201 moveq #1,%d1 4cc60: 7801 moveq #1,%d4 4cc62: 2040 moveal %d0,%a0 4cc64: c2ae 0014 andl %fp@(20),%d1 4cc68: 2f2e 0018 movel %fp@(24),%sp@- 4cc6c: b384 eorl %d1,%d4 4cc6e: 2f04 movel %d4,%sp@- 4cc70: 2f03 movel %d3,%sp@- 4cc72: 2f02 movel %d2,%sp@- 4cc74: 2f28 0008 movel %a0@(8),%sp@- 4cc78: 4868 0014 pea %a0@(20) 4cc7c: 4eb9 0004 dda4 jsr 4dda4 <_CORE_message_queue_Seize> buffer, size, wait, timeout ); _Thread_Enable_dispatch(); 4cc82: 4eb9 0004 f4c2 jsr 4f4c2 <_Thread_Enable_dispatch> return _Message_queue_Translate_core_message_queue_return_code( 4cc88: 2079 0006 65e2 moveal 665e2 <_Thread_Executing>,%a0 4cc8e: 2f28 0034 movel %a0@(52),%sp@- 4cc92: 4eb9 0004 cd24 jsr 4cd24 <_Message_queue_Translate_core_message_queue_return_code> 4cc98: 4fef 001c lea %sp@(28),%sp 4cc9c: 6002 bras 4cca0 <== ALWAYS TAKEN 4cc9e: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4cca0: 4cee 001c fff0 moveml %fp@(-16),%d2-%d4 4cca6: 4e5e unlk %fp 4cca8: 4e75 rts ... 0004ccac : rtems_status_code rtems_message_queue_send( rtems_id id, const void *buffer, size_t size ) { 4ccac: 4e56 fffc linkw %fp,#-4 4ccb0: 2f03 movel %d3,%sp@- 4ccb2: 262e 0008 movel %fp@(8),%d3 4ccb6: 2f02 movel %d2,%sp@- 4ccb8: 242e 000c movel %fp@(12),%d2 register Message_queue_Control *the_message_queue; Objects_Locations location; CORE_message_queue_Status status; if ( !buffer ) 4ccbc: 6604 bnes 4ccc2 4ccbe: 7009 moveq #9,%d0 4ccc0: 6056 bras 4cd18 <== ALWAYS TAKEN 4ccc2: 486e fffc pea %fp@(-4) 4ccc6: 2f03 movel %d3,%sp@- 4ccc8: 4879 0006 6d46 pea 66d46 <_Message_queue_Information> 4ccce: 4eb9 0004 ebc8 jsr 4ebc8 <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_message_queue = _Message_queue_Get( id, &location ); switch ( location ) { 4ccd4: 4fef 000c lea %sp@(12),%sp 4ccd8: 4aae fffc tstl %fp@(-4) 4ccdc: 6704 beqs 4cce2 4ccde: 7004 moveq #4,%d0 4cce0: 6036 bras 4cd18 <== ALWAYS TAKEN CORE_message_queue_API_mp_support_callout api_message_queue_mp_support, bool wait, Watchdog_Interval timeout ) { return _CORE_message_queue_Submit( 4cce2: 42a7 clrl %sp@- 4cce4: 2040 moveal %d0,%a0 4cce6: 42a7 clrl %sp@- 4cce8: 2f3c 7fff ffff movel #2147483647,%sp@- 4ccee: 42a7 clrl %sp@- 4ccf0: 2f03 movel %d3,%sp@- 4ccf2: 2f2e 0010 movel %fp@(16),%sp@- 4ccf6: 2f02 movel %d2,%sp@- 4ccf8: 4868 0014 pea %a0@(20) 4ccfc: 4eb9 0004 dee0 jsr 4dee0 <_CORE_message_queue_Submit> MESSAGE_QUEUE_MP_HANDLER, false, /* sender does not block */ 0 /* no timeout */ ); _Thread_Enable_dispatch(); 4cd02: 4fef 0020 lea %sp@(32),%sp 4cd06: 2400 movel %d0,%d2 4cd08: 4eb9 0004 f4c2 jsr 4f4c2 <_Thread_Enable_dispatch> /* * Since this API does not allow for blocking sends, we can directly * return the returned status. */ return _Message_queue_Translate_core_message_queue_return_code(status); 4cd0e: 2f02 movel %d2,%sp@- 4cd10: 4eb9 0004 cd24 jsr 4cd24 <_Message_queue_Translate_core_message_queue_return_code> 4cd16: 588f addql #4,%sp case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4cd18: 242e fff4 movel %fp@(-12),%d2 4cd1c: 262e fff8 movel %fp@(-8),%d3 4cd20: 4e5e unlk %fp 4cd22: 4e75 rts 0004e9cc : rtems_status_code rtems_message_queue_urgent( rtems_id id, const void *buffer, size_t size ) { 4e9cc: 4e56 fffc linkw %fp,#-4 4e9d0: 2f03 movel %d3,%sp@- 4e9d2: 262e 0008 movel %fp@(8),%d3 4e9d6: 2f02 movel %d2,%sp@- 4e9d8: 242e 000c movel %fp@(12),%d2 register Message_queue_Control *the_message_queue; Objects_Locations location; CORE_message_queue_Status status; if ( !buffer ) 4e9dc: 6604 bnes 4e9e2 4e9de: 7009 moveq #9,%d0 4e9e0: 6056 bras 4ea38 <== ALWAYS TAKEN 4e9e2: 486e fffc pea %fp@(-4) 4e9e6: 2f03 movel %d3,%sp@- 4e9e8: 4879 0007 56fa pea 756fa <_Message_queue_Information> 4e9ee: 4eb9 0005 3030 jsr 53030 <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_message_queue = _Message_queue_Get( id, &location ); switch ( location ) { 4e9f4: 4fef 000c lea %sp@(12),%sp 4e9f8: 4aae fffc tstl %fp@(-4) 4e9fc: 6704 beqs 4ea02 4e9fe: 7004 moveq #4,%d0 4ea00: 6036 bras 4ea38 <== ALWAYS TAKEN CORE_message_queue_API_mp_support_callout api_message_queue_mp_support, bool wait, Watchdog_Interval timeout ) { return _CORE_message_queue_Submit( 4ea02: 42a7 clrl %sp@- 4ea04: 2040 moveal %d0,%a0 4ea06: 42a7 clrl %sp@- 4ea08: 2f3c 8000 0000 movel #-2147483648,%sp@- 4ea0e: 42a7 clrl %sp@- 4ea10: 2f03 movel %d3,%sp@- 4ea12: 2f2e 0010 movel %fp@(16),%sp@- 4ea16: 2f02 movel %d2,%sp@- 4ea18: 4868 0014 pea %a0@(20) 4ea1c: 4eb9 0005 1c50 jsr 51c50 <_CORE_message_queue_Submit> id, MESSAGE_QUEUE_MP_HANDLER, false, /* sender does not block */ 0 /* no timeout */ ); _Thread_Enable_dispatch(); 4ea22: 4fef 0020 lea %sp@(32),%sp 4ea26: 2400 movel %d0,%d2 4ea28: 4eb9 0005 38b6 jsr 538b6 <_Thread_Enable_dispatch> /* * Since this API does not allow for blocking sends, we can directly * return the returned status. */ return _Message_queue_Translate_core_message_queue_return_code(status); 4ea2e: 2f02 movel %d2,%sp@- 4ea30: 4eb9 0004 e9b4 jsr 4e9b4 <_Message_queue_Translate_core_message_queue_return_code> 4ea36: 588f addql #4,%sp case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4ea38: 242e fff4 movel %fp@(-12),%d2 4ea3c: 262e fff8 movel %fp@(-8),%d3 4ea40: 4e5e unlk %fp 4ea42: 4e75 rts 00046504 : rtems_status_code rtems_object_get_class_information( int the_api, int the_class, rtems_object_api_class_information *info ) { 46504: 4e56 0000 linkw %fp,#0 46508: 2f0a movel %a2,%sp@- 4650a: 246e 0010 moveal %fp@(16),%a2 4650e: 2f02 movel %d2,%sp@- int i; /* * Validate parameters and look up information structure. */ if ( !info ) 46510: 4a8a tstl %a2 46512: 6604 bnes 46518 46514: 7009 moveq #9,%d0 46516: 6052 bras 4656a <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; obj_info = _Objects_Get_information( the_api, the_class ); 46518: 2f2e 000c movel %fp@(12),%sp@- 4651c: 2f2e 0008 movel %fp@(8),%sp@- 46520: 4eb9 0004 7e24 jsr 47e24 <_Objects_Get_information> if ( !obj_info ) 46526: 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 ); 46528: 2040 moveal %d0,%a0 if ( !obj_info ) 4652a: 4a80 tstl %d0 4652c: 6604 bnes 46532 4652e: 700a moveq #10,%d0 46530: 6038 bras 4656a <== ALWAYS TAKEN return RTEMS_INVALID_NUMBER; /* * Return information about this object class to the user. */ info->minimum_id = obj_info->minimum_id; 46532: 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; 46536: 4282 clrl %d2 46538: 7001 moveq #1,%d0 4653a: 4281 clrl %d1 /* * Return information about this object class to the user. */ info->minimum_id = obj_info->minimum_id; info->maximum_id = obj_info->maximum_id; 4653c: 2568 000a 0004 movel %a0@(10),%a2@(4) info->auto_extend = obj_info->auto_extend; info->maximum = obj_info->maximum; 46542: 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; 46546: 1568 0010 000c moveb %a0@(16),%a2@(12) info->maximum = obj_info->maximum; 4654c: 2542 0008 movel %d2,%a2@(8) for ( unallocated=0, i=1 ; i <= info->maximum ; i++ ) 46550: 600e bras 46560 <== ALWAYS TAKEN if ( !obj_info->local_table[i] ) 46552: 2268 0018 moveal %a0@(24),%a1 46556: 4ab1 0c00 tstl %a1@(00000000,%d0:l:4) 4655a: 6602 bnes 4655e unallocated++; 4655c: 5281 addql #1,%d1 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++ ) 4655e: 5280 addql #1,%d0 46560: b480 cmpl %d0,%d2 46562: 64ee bccs 46552 if ( !obj_info->local_table[i] ) unallocated++; info->unallocated = unallocated; 46564: 2541 000e movel %d1,%a2@(14) 46568: 4280 clrl %d0 return RTEMS_SUCCESSFUL; } 4656a: 242e fff8 movel %fp@(-8),%d2 4656e: 246e fffc moveal %fp@(-4),%a2 46572: 4e5e unlk %fp 46574: 4e75 rts ... 0004834c : rtems_status_code rtems_object_get_classic_name( rtems_id id, rtems_name *name ) { 4834c: 4e56 fffc linkw %fp,#-4 48350: 2f0a movel %a2,%sp@- 48352: 246e 000c moveal %fp@(12),%a2 Objects_Name_or_id_lookup_errors status; Objects_Name name_u; if ( !name ) 48356: 4a8a tstl %a2 48358: 6604 bnes 4835e 4835a: 7009 moveq #9,%d0 4835c: 601e bras 4837c <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; status = _Objects_Id_to_name( id, &name_u ); 4835e: 486e fffc pea %fp@(-4) 48362: 2f2e 0008 movel %fp@(8),%sp@- 48366: 4eb9 0004 9eb4 jsr 49eb4 <_Objects_Id_to_name> *name = name_u.name_u32; return _Status_Object_name_errors_to_status[ status ]; 4836c: 508f addql #8,%sp 4836e: 41f9 0006 3f24 lea 63f24 <_Status_Object_name_errors_to_status>,%a0 48374: 2030 0c00 movel %a0@(00000000,%d0:l:4),%d0 if ( !name ) return RTEMS_INVALID_ADDRESS; status = _Objects_Id_to_name( id, &name_u ); *name = name_u.name_u32; 48378: 24ae fffc movel %fp@(-4),%a2@ return _Status_Object_name_errors_to_status[ status ]; } 4837c: 246e fff8 moveal %fp@(-8),%a2 48380: 4e5e unlk %fp 48382: 4e75 rts 00045024 : */ rtems_status_code rtems_object_set_name( rtems_id id, const char *name ) { 45024: 4e56 fff0 linkw %fp,#-16 45028: 48d7 001c moveml %d2-%d4,%sp@ 4502c: 262e 0008 movel %fp@(8),%d3 45030: 282e 000c movel %fp@(12),%d4 Objects_Information *information; Objects_Locations location; Objects_Control *the_object; Objects_Id tmpId; if ( !name ) 45034: 6604 bnes 4503a 45036: 7009 moveq #9,%d0 45038: 6050 bras 4508a <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 4503a: 4a83 tstl %d3 4503c: 660a bnes 45048 4503e: 2079 0005 da16 moveal 5da16 <_Thread_Executing>,%a0 45044: 2628 0008 movel %a0@(8),%d3 information = _Objects_Get_information_id( tmpId ); 45048: 2f03 movel %d3,%sp@- 4504a: 4eb9 0004 6710 jsr 46710 <_Objects_Get_information_id> if ( !information ) 45050: 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 ); 45052: 2400 movel %d0,%d2 if ( !information ) 45054: 6732 beqs 45088 return RTEMS_INVALID_ID; the_object = _Objects_Get( information, tmpId, &location ); 45056: 486e fffc pea %fp@(-4) 4505a: 2f03 movel %d3,%sp@- 4505c: 2f00 movel %d0,%sp@- 4505e: 4eb9 0004 68c8 jsr 468c8 <_Objects_Get> switch ( location ) { 45064: 4fef 000c lea %sp@(12),%sp 45068: 4aae fffc tstl %fp@(-4) 4506c: 661a bnes 45088 case OBJECTS_LOCAL: _Objects_Set_name( information, the_object, name ); 4506e: 2f04 movel %d4,%sp@- 45070: 2f00 movel %d0,%sp@- 45072: 2f02 movel %d2,%sp@- 45074: 4eb9 0004 6a50 jsr 46a50 <_Objects_Set_name> _Thread_Enable_dispatch(); 4507a: 4eb9 0004 7126 jsr 47126 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 45080: 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(); 45084: 4280 clrl %d0 return RTEMS_SUCCESSFUL; 45086: 6002 bras 4508a <== ALWAYS TAKEN 45088: 7004 moveq #4,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4508a: 4cee 001c fff0 moveml %fp@(-16),%d2-%d4 45090: 4e5e unlk %fp 45092: 4e75 rts 0004ea44 : uint32_t length, uint32_t buffer_size, rtems_attribute attribute_set, rtems_id *id ) { 4ea44: 4e56 ffe4 linkw %fp,#-28 4ea48: 48d7 1c3c moveml %d2-%d5/%a2-%a4,%sp@ 4ea4c: 2a2e 0008 movel %fp@(8),%d5 4ea50: 282e 000c movel %fp@(12),%d4 4ea54: 262e 0010 movel %fp@(16),%d3 4ea58: 242e 0014 movel %fp@(20),%d2 4ea5c: 266e 001c moveal %fp@(28),%a3 register Partition_Control *the_partition; if ( !rtems_is_name_valid( name ) ) 4ea60: 4a85 tstl %d5 4ea62: 6606 bnes 4ea6a 4ea64: 7003 moveq #3,%d0 4ea66: 6000 00b2 braw 4eb1a <== ALWAYS TAKEN return RTEMS_INVALID_NAME; if ( !starting_address ) 4ea6a: 4a84 tstl %d4 4ea6c: 6700 00a6 beqw 4eb14 return RTEMS_INVALID_ADDRESS; if ( !id ) 4ea70: 4a8b tstl %a3 4ea72: 6700 00a0 beqw 4eb14 <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; if ( length == 0 || buffer_size == 0 || length < buffer_size || 4ea76: 4a83 tstl %d3 4ea78: 6700 009e beqw 4eb18 4ea7c: 4a82 tstl %d2 4ea7e: 6700 0098 beqw 4eb18 4ea82: b483 cmpl %d3,%d2 4ea84: 6200 0092 bhiw 4eb18 4ea88: 7003 moveq #3,%d0 4ea8a: c082 andl %d2,%d0 4ea8c: 6600 008a bnew 4eb18 !_Partition_Is_buffer_size_aligned( buffer_size ) ) return RTEMS_INVALID_SIZE; if ( !_Addresses_Is_aligned( starting_address ) ) 4ea90: 103c 0003 moveb #3,%d0 4ea94: c084 andl %d4,%d0 4ea96: 667c bnes 4eb14 4ea98: 2039 0007 4ec8 movel 74ec8 <_Thread_Dispatch_disable_level>,%d0 4ea9e: 5280 addql #1,%d0 4eaa0: 23c0 0007 4ec8 movel %d0,74ec8 <_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 ); 4eaa6: 4879 0007 4d52 pea 74d52 <_Partition_Information> 4eaac: 45f9 0005 38b6 lea 538b6 <_Thread_Enable_dispatch>,%a2 4eab2: 4eb9 0005 2bac jsr 52bac <_Objects_Allocate> _Thread_Disable_dispatch(); /* prevents deletion */ the_partition = _Partition_Allocate(); if ( !the_partition ) { 4eab8: 588f addql #4,%sp 4eaba: 2840 moveal %d0,%a4 4eabc: 4a80 tstl %d0 4eabe: 6606 bnes 4eac6 _Thread_Enable_dispatch(); 4eac0: 4e92 jsr %a2@ 4eac2: 7005 moveq #5,%d0 return RTEMS_TOO_MANY; 4eac4: 6054 bras 4eb1a <== ALWAYS TAKEN _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; } #endif the_partition->starting_address = starting_address; 4eac6: 2944 0010 movel %d4,%a4@(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, 4eaca: 2003 movel %d3,%d0 #endif the_partition->starting_address = starting_address; the_partition->length = length; the_partition->buffer_size = buffer_size; the_partition->attribute_set = attribute_set; 4eacc: 296e 0018 001c movel %fp@(24),%a4@(28) the_partition->number_of_used_blocks = 0; _Chain_Initialize( &the_partition->Memory, starting_address, 4ead2: 4c42 0000 remul %d2,%d0,%d0 return RTEMS_TOO_MANY; } #endif the_partition->starting_address = starting_address; the_partition->length = length; 4ead6: 2943 0014 movel %d3,%a4@(20) the_partition->buffer_size = buffer_size; 4eada: 2942 0018 movel %d2,%a4@(24) the_partition->attribute_set = attribute_set; the_partition->number_of_used_blocks = 0; 4eade: 42ac 0020 clrl %a4@(32) _Chain_Initialize( &the_partition->Memory, starting_address, 4eae2: 2f02 movel %d2,%sp@- 4eae4: 2f00 movel %d0,%sp@- 4eae6: 2f04 movel %d4,%sp@- 4eae8: 486c 0024 pea %a4@(36) 4eaec: 4eb9 0005 18ec jsr 518ec <_Chain_Initialize> 4eaf2: 202c 0008 movel %a4@(8),%d0 4eaf6: 4281 clrl %d1 4eaf8: 2079 0007 4d6a moveal 74d6a <_Partition_Information+0x18>,%a0 4eafe: 3200 movew %d0,%d1 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 4eb00: 2945 000c movel %d5,%a4@(12) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4eb04: 218c 1c00 movel %a4,%a0@(00000000,%d1:l:4) &_Partition_Information, &the_partition->Object, (Objects_Name) name ); *id = the_partition->Object.id; 4eb08: 2680 movel %d0,%a3@ name, 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); 4eb0a: 4e92 jsr %a2@ return RTEMS_SUCCESSFUL; 4eb0c: 4fef 0010 lea %sp@(16),%sp name, 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); 4eb10: 4280 clrl %d0 return RTEMS_SUCCESSFUL; 4eb12: 6006 bras 4eb1a <== ALWAYS TAKEN 4eb14: 7009 moveq #9,%d0 4eb16: 6002 bras 4eb1a <== ALWAYS TAKEN 4eb18: 7008 moveq #8,%d0 } 4eb1a: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4 4eb20: 4e5e unlk %fp 4eb22: 4e75 rts 0004eb24 : */ rtems_status_code rtems_partition_delete( rtems_id id ) { 4eb24: 4e56 fffc linkw %fp,#-4 4eb28: 2f0b movel %a3,%sp@- 4eb2a: 2f0a movel %a2,%sp@- RTEMS_INLINE_ROUTINE Partition_Control *_Partition_Get ( Objects_Id id, Objects_Locations *location ) { return (Partition_Control *) 4eb2c: 486e fffc pea %fp@(-4) 4eb30: 2f2e 0008 movel %fp@(8),%sp@- 4eb34: 4879 0007 4d52 pea 74d52 <_Partition_Information> 4eb3a: 4eb9 0005 3030 jsr 53030 <_Objects_Get> register Partition_Control *the_partition; Objects_Locations location; the_partition = _Partition_Get( id, &location ); switch ( location ) { 4eb40: 4fef 000c lea %sp@(12),%sp 4eb44: 2440 moveal %d0,%a2 4eb46: 4aae fffc tstl %fp@(-4) 4eb4a: 6704 beqs 4eb50 4eb4c: 7004 moveq #4,%d0 4eb4e: 6036 bras 4eb86 <== ALWAYS TAKEN 4eb50: 47f9 0005 38b6 lea 538b6 <_Thread_Enable_dispatch>,%a3 case OBJECTS_LOCAL: if ( the_partition->number_of_used_blocks == 0 ) { 4eb56: 4aaa 0020 tstl %a2@(32) 4eb5a: 6626 bnes 4eb82 _Objects_Close( &_Partition_Information, &the_partition->Object ); 4eb5c: 2f00 movel %d0,%sp@- 4eb5e: 4879 0007 4d52 pea 74d52 <_Partition_Information> 4eb64: 4eb9 0005 2c2c jsr 52c2c <_Objects_Close> */ RTEMS_INLINE_ROUTINE void _Partition_Free ( Partition_Control *the_partition ) { _Objects_Free( &_Partition_Information, &the_partition->Object ); 4eb6a: 2f0a movel %a2,%sp@- 4eb6c: 4879 0007 4d52 pea 74d52 <_Partition_Information> 4eb72: 4eb9 0005 2ea0 jsr 52ea0 <_Objects_Free> 0 /* Not used */ ); } #endif _Thread_Enable_dispatch(); 4eb78: 4e93 jsr %a3@ return RTEMS_SUCCESSFUL; 4eb7a: 4fef 0010 lea %sp@(16),%sp 0 /* Not used */ ); } #endif _Thread_Enable_dispatch(); 4eb7e: 4280 clrl %d0 return RTEMS_SUCCESSFUL; 4eb80: 6004 bras 4eb86 <== ALWAYS TAKEN } _Thread_Enable_dispatch(); 4eb82: 4e93 jsr %a3@ 4eb84: 700c moveq #12,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4eb86: 246e fff4 moveal %fp@(-12),%a2 4eb8a: 266e fff8 moveal %fp@(-8),%a3 4eb8e: 4e5e unlk %fp 4eb90: 4e75 rts ... 0004eb94 : rtems_status_code rtems_partition_get_buffer( rtems_id id, void **buffer ) { 4eb94: 4e56 fff0 linkw %fp,#-16 4eb98: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 4eb9c: 266e 000c moveal %fp@(12),%a3 register Partition_Control *the_partition; Objects_Locations location; void *the_buffer; if ( !buffer ) 4eba0: 4a8b tstl %a3 4eba2: 6604 bnes 4eba8 4eba4: 7009 moveq #9,%d0 4eba6: 604a bras 4ebf2 <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE Partition_Control *_Partition_Get ( Objects_Id id, Objects_Locations *location ) { return (Partition_Control *) 4eba8: 486e fffc pea %fp@(-4) 4ebac: 2f2e 0008 movel %fp@(8),%sp@- 4ebb0: 4879 0007 4d52 pea 74d52 <_Partition_Information> 4ebb6: 4eb9 0005 3030 jsr 53030 <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_partition = _Partition_Get( id, &location ); switch ( location ) { 4ebbc: 4fef 000c lea %sp@(12),%sp 4ebc0: 2440 moveal %d0,%a2 4ebc2: 4aae fffc tstl %fp@(-4) 4ebc6: 6704 beqs 4ebcc 4ebc8: 7004 moveq #4,%d0 4ebca: 6026 bras 4ebf2 <== ALWAYS TAKEN */ RTEMS_INLINE_ROUTINE void *_Partition_Allocate_buffer ( Partition_Control *the_partition ) { return _Chain_Get( &the_partition->Memory ); 4ebcc: 486a 0024 pea %a2@(36) 4ebd0: 4eb9 0005 18b8 jsr 518b8 <_Chain_Get> case OBJECTS_LOCAL: the_buffer = _Partition_Allocate_buffer( the_partition ); if ( the_buffer ) { 4ebd6: 588f addql #4,%sp 4ebd8: 41f9 0005 38b6 lea 538b6 <_Thread_Enable_dispatch>,%a0 4ebde: 2400 movel %d0,%d2 4ebe0: 670c beqs 4ebee the_partition->number_of_used_blocks += 1; 4ebe2: 52aa 0020 addql #1,%a2@(32) _Thread_Enable_dispatch(); 4ebe6: 4e90 jsr %a0@ *buffer = the_buffer; 4ebe8: 4280 clrl %d0 4ebea: 2682 movel %d2,%a3@ return RTEMS_SUCCESSFUL; 4ebec: 6004 bras 4ebf2 <== ALWAYS TAKEN } _Thread_Enable_dispatch(); 4ebee: 4e90 jsr %a0@ 4ebf0: 700d moveq #13,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4ebf2: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3 4ebf8: 4e5e unlk %fp 4ebfa: 4e75 rts 0004ec28 : rtems_status_code rtems_partition_return_buffer( rtems_id id, void *buffer ) { 4ec28: 4e56 fffc linkw %fp,#-4 4ec2c: 2f0a movel %a2,%sp@- 4ec2e: 2f02 movel %d2,%sp@- RTEMS_INLINE_ROUTINE Partition_Control *_Partition_Get ( Objects_Id id, Objects_Locations *location ) { return (Partition_Control *) 4ec30: 486e fffc pea %fp@(-4) 4ec34: 2f2e 0008 movel %fp@(8),%sp@- 4ec38: 4879 0007 4d52 pea 74d52 <_Partition_Information> 4ec3e: 242e 000c movel %fp@(12),%d2 4ec42: 4eb9 0005 3030 jsr 53030 <_Objects_Get> register Partition_Control *the_partition; Objects_Locations location; the_partition = _Partition_Get( id, &location ); switch ( location ) { 4ec48: 4fef 000c lea %sp@(12),%sp 4ec4c: 2440 moveal %d0,%a2 4ec4e: 4aae fffc tstl %fp@(-4) 4ec52: 6704 beqs 4ec58 4ec54: 7004 moveq #4,%d0 4ec56: 603c bras 4ec94 <== ALWAYS TAKEN ) { void *starting; void *ending; starting = the_partition->starting_address; 4ec58: 202a 0010 movel %a2@(16),%d0 ending = _Addresses_Add_offset( starting, the_partition->length ); 4ec5c: 222a 0014 movel %a2@(20),%d1 const void *address, const void *base, const void *limit ) { return (address >= base && address <= limit); 4ec60: b082 cmpl %d2,%d0 4ec62: 623c bhis 4eca0 4ec64: d280 addl %d0,%d1 4ec66: b282 cmpl %d2,%d1 4ec68: 6536 bcss 4eca0 <== ALWAYS TAKEN return ( 4ec6a: 2202 movel %d2,%d1 4ec6c: 9280 subl %d0,%d1 4ec6e: 2001 movel %d1,%d0 4ec70: 4c6a 0001 0018 remul %a2@(24),%d1,%d0 4ec76: 4a81 tstl %d1 4ec78: 6626 bnes 4eca0 RTEMS_INLINE_ROUTINE void _Partition_Free_buffer ( Partition_Control *the_partition, Chain_Node *the_buffer ) { _Chain_Append( &the_partition->Memory, the_buffer ); 4ec7a: 2f02 movel %d2,%sp@- 4ec7c: 486a 0024 pea %a2@(36) 4ec80: 4eb9 0005 1880 jsr 51880 <_Chain_Append> case OBJECTS_LOCAL: if ( _Partition_Is_buffer_valid( buffer, the_partition ) ) { _Partition_Free_buffer( the_partition, buffer ); the_partition->number_of_used_blocks -= 1; 4ec86: 53aa 0020 subql #1,%a2@(32) _Thread_Enable_dispatch(); 4ec8a: 4eb9 0005 38b6 jsr 538b6 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 4ec90: 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(); 4ec92: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4ec94: 242e fff4 movel %fp@(-12),%d2 4ec98: 246e fff8 moveal %fp@(-8),%a2 4ec9c: 4e5e unlk %fp 4ec9e: 4e75 rts _Partition_Free_buffer( the_partition, buffer ); the_partition->number_of_used_blocks -= 1; _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } _Thread_Enable_dispatch(); 4eca0: 4eb9 0005 38b6 jsr 538b6 <_Thread_Enable_dispatch> 4eca6: 7009 moveq #9,%d0 return RTEMS_INVALID_ADDRESS; 4eca8: 60ea bras 4ec94 <== ALWAYS TAKEN ... 0004e0c4 : void *internal_start, void *external_start, uint32_t length, rtems_id *id ) { 4e0c4: 4e56 ffec linkw %fp,#-20 4e0c8: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 4e0cc: 282e 0008 movel %fp@(8),%d4 4e0d0: 262e 000c movel %fp@(12),%d3 4e0d4: 242e 0010 movel %fp@(16),%d2 4e0d8: 246e 0018 moveal %fp@(24),%a2 register Dual_ported_memory_Control *the_port; if ( !rtems_is_name_valid( name ) ) 4e0dc: 4a84 tstl %d4 4e0de: 6604 bnes 4e0e4 4e0e0: 7003 moveq #3,%d0 4e0e2: 606e bras 4e152 <== ALWAYS TAKEN return RTEMS_INVALID_NAME; if ( !id ) 4e0e4: 4a8a tstl %a2 4e0e6: 6768 beqs 4e150 return RTEMS_INVALID_ADDRESS; if ( !_Addresses_Is_aligned( internal_start ) || 4e0e8: 2002 movel %d2,%d0 4e0ea: 7203 moveq #3,%d1 4e0ec: 8083 orl %d3,%d0 4e0ee: c081 andl %d1,%d0 4e0f0: 665e bnes 4e150 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 4e0f2: 2039 0007 4ec8 movel 74ec8 <_Thread_Dispatch_disable_level>,%d0 4e0f8: 5280 addql #1,%d0 4e0fa: 23c0 0007 4ec8 movel %d0,74ec8 <_Thread_Dispatch_disable_level> * of free port control blocks. */ RTEMS_INLINE_ROUTINE Dual_ported_memory_Control *_Dual_ported_memory_Allocate ( void ) { return (Dual_ported_memory_Control *) 4e100: 4879 0007 4d18 pea 74d18 <_Dual_ported_memory_Information> 4e106: 4eb9 0005 2bac jsr 52bac <_Objects_Allocate> _Thread_Disable_dispatch(); /* to prevent deletion */ the_port = _Dual_ported_memory_Allocate(); if ( !the_port ) { 4e10c: 588f addql #4,%sp 4e10e: 43f9 0005 38b6 lea 538b6 <_Thread_Enable_dispatch>,%a1 4e114: 2040 moveal %d0,%a0 4e116: 4a80 tstl %d0 4e118: 6606 bnes 4e120 _Thread_Enable_dispatch(); 4e11a: 4e91 jsr %a1@ 4e11c: 7005 moveq #5,%d0 return RTEMS_TOO_MANY; 4e11e: 6032 bras 4e152 <== ALWAYS TAKEN } the_port->internal_base = internal_start; the_port->external_base = external_start; the_port->length = length - 1; 4e120: 222e 0014 movel %fp@(20),%d1 4e124: 5381 subql #1,%d1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4e126: 2028 0008 movel %a0@(8),%d0 4e12a: 2141 0018 movel %d1,%a0@(24) 4e12e: 4281 clrl %d1 4e130: 2679 0007 4d30 moveal 74d30 <_Dual_ported_memory_Information+0x18>,%a3 4e136: 3200 movew %d0,%d1 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 4e138: 2144 000c movel %d4,%a0@(12) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4e13c: 2788 1c00 movel %a0,%a3@(00000000,%d1:l:4) &_Dual_ported_memory_Information, &the_port->Object, (Objects_Name) name ); *id = the_port->Object.id; 4e140: 2480 movel %d0,%a2@ if ( !the_port ) { _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; } the_port->internal_base = internal_start; 4e142: 2143 0010 movel %d3,%a0@(16) the_port->external_base = external_start; 4e146: 2142 0014 movel %d2,%a0@(20) &the_port->Object, (Objects_Name) name ); *id = the_port->Object.id; _Thread_Enable_dispatch(); 4e14a: 4e91 jsr %a1@ 4e14c: 4280 clrl %d0 return RTEMS_SUCCESSFUL; 4e14e: 6002 bras 4e152 <== ALWAYS TAKEN 4e150: 7009 moveq #9,%d0 } 4e152: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 4e158: 4e5e unlk %fp 4e15a: 4e75 rts 0004e15c : */ rtems_status_code rtems_port_delete( rtems_id id ) { 4e15c: 4e56 fffc linkw %fp,#-4 4e160: 2f02 movel %d2,%sp@- RTEMS_INLINE_ROUTINE Dual_ported_memory_Control *_Dual_ported_memory_Get ( Objects_Id id, Objects_Locations *location ) { return (Dual_ported_memory_Control *) 4e162: 486e fffc pea %fp@(-4) 4e166: 2f2e 0008 movel %fp@(8),%sp@- 4e16a: 4879 0007 4d18 pea 74d18 <_Dual_ported_memory_Information> 4e170: 4eb9 0005 3030 jsr 53030 <_Objects_Get> register Dual_ported_memory_Control *the_port; Objects_Locations location; the_port = _Dual_ported_memory_Get( id, &location ); switch ( location ) { 4e176: 4fef 000c lea %sp@(12),%sp 4e17a: 2400 movel %d0,%d2 4e17c: 4aae fffc tstl %fp@(-4) 4e180: 6704 beqs 4e186 4e182: 7004 moveq #4,%d0 4e184: 6028 bras 4e1ae <== ALWAYS TAKEN case OBJECTS_LOCAL: _Objects_Close( &_Dual_ported_memory_Information, &the_port->Object ); 4e186: 2f00 movel %d0,%sp@- 4e188: 4879 0007 4d18 pea 74d18 <_Dual_ported_memory_Information> 4e18e: 4eb9 0005 2c2c jsr 52c2c <_Objects_Close> */ RTEMS_INLINE_ROUTINE void _Dual_ported_memory_Free ( Dual_ported_memory_Control *the_port ) { _Objects_Free( &_Dual_ported_memory_Information, &the_port->Object ); 4e194: 2f02 movel %d2,%sp@- 4e196: 4879 0007 4d18 pea 74d18 <_Dual_ported_memory_Information> 4e19c: 4eb9 0005 2ea0 jsr 52ea0 <_Objects_Free> _Dual_ported_memory_Free( the_port ); _Thread_Enable_dispatch(); 4e1a2: 4eb9 0005 38b6 jsr 538b6 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 4e1a8: 4fef 0010 lea %sp@(16),%sp switch ( location ) { case OBJECTS_LOCAL: _Objects_Close( &_Dual_ported_memory_Information, &the_port->Object ); _Dual_ported_memory_Free( the_port ); _Thread_Enable_dispatch(); 4e1ac: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4e1ae: 242e fff8 movel %fp@(-8),%d2 4e1b2: 4e5e unlk %fp 4e1b4: 4e75 rts ... 0004e1b8 : rtems_status_code rtems_port_external_to_internal( rtems_id id, void *external, void **internal ) { 4e1b8: 4e56 fffc linkw %fp,#-4 4e1bc: 2f0a movel %a2,%sp@- 4e1be: 246e 0010 moveal %fp@(16),%a2 4e1c2: 2f02 movel %d2,%sp@- 4e1c4: 242e 000c movel %fp@(12),%d2 register Dual_ported_memory_Control *the_port; Objects_Locations location; uint32_t ending; if ( !internal ) 4e1c8: 4a8a tstl %a2 4e1ca: 6604 bnes 4e1d0 4e1cc: 7009 moveq #9,%d0 4e1ce: 6042 bras 4e212 <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE Dual_ported_memory_Control *_Dual_ported_memory_Get ( Objects_Id id, Objects_Locations *location ) { return (Dual_ported_memory_Control *) 4e1d0: 486e fffc pea %fp@(-4) 4e1d4: 2f2e 0008 movel %fp@(8),%sp@- 4e1d8: 4879 0007 4d18 pea 74d18 <_Dual_ported_memory_Information> 4e1de: 4eb9 0005 3030 jsr 53030 <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_port = _Dual_ported_memory_Get( id, &location ); switch ( location ) { 4e1e4: 4fef 000c lea %sp@(12),%sp 4e1e8: 2040 moveal %d0,%a0 4e1ea: 4aae fffc tstl %fp@(-4) 4e1ee: 6704 beqs 4e1f4 4e1f0: 7004 moveq #4,%d0 4e1f2: 601e bras 4e212 <== ALWAYS TAKEN case OBJECTS_LOCAL: ending = _Addresses_Subtract( external, the_port->external_base ); 4e1f4: 2002 movel %d2,%d0 4e1f6: 90a8 0014 subl %a0@(20),%d0 if ( ending > the_port->length ) 4e1fa: b0a8 0018 cmpl %a0@(24),%d0 4e1fe: 6304 blss 4e204 *internal = external; 4e200: 2482 movel %d2,%a2@ 4e202: 6006 bras 4e20a <== ALWAYS TAKEN else *internal = _Addresses_Add_offset( the_port->internal_base, 4e204: d0a8 0010 addl %a0@(16),%d0 4e208: 2480 movel %d0,%a2@ ending ); _Thread_Enable_dispatch(); 4e20a: 4eb9 0005 38b6 jsr 538b6 <_Thread_Enable_dispatch> 4e210: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4e212: 242e fff4 movel %fp@(-12),%d2 4e216: 246e fff8 moveal %fp@(-8),%a2 4e21a: 4e5e unlk %fp 4e21c: 4e75 rts ... 0004e248 : rtems_status_code rtems_port_internal_to_external( rtems_id id, void *internal, void **external ) { 4e248: 4e56 fffc linkw %fp,#-4 4e24c: 2f0a movel %a2,%sp@- 4e24e: 246e 0010 moveal %fp@(16),%a2 4e252: 2f02 movel %d2,%sp@- 4e254: 242e 000c movel %fp@(12),%d2 register Dual_ported_memory_Control *the_port; Objects_Locations location; uint32_t ending; if ( !external ) 4e258: 4a8a tstl %a2 4e25a: 6604 bnes 4e260 4e25c: 7009 moveq #9,%d0 4e25e: 6042 bras 4e2a2 <== ALWAYS TAKEN 4e260: 486e fffc pea %fp@(-4) 4e264: 2f2e 0008 movel %fp@(8),%sp@- 4e268: 4879 0007 4d18 pea 74d18 <_Dual_ported_memory_Information> 4e26e: 4eb9 0005 3030 jsr 53030 <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_port = _Dual_ported_memory_Get( id, &location ); switch ( location ) { 4e274: 4fef 000c lea %sp@(12),%sp 4e278: 2040 moveal %d0,%a0 4e27a: 4aae fffc tstl %fp@(-4) 4e27e: 6704 beqs 4e284 4e280: 7004 moveq #4,%d0 4e282: 601e bras 4e2a2 <== ALWAYS TAKEN case OBJECTS_LOCAL: ending = _Addresses_Subtract( internal, the_port->internal_base ); 4e284: 2002 movel %d2,%d0 4e286: 90a8 0010 subl %a0@(16),%d0 if ( ending > the_port->length ) 4e28a: b0a8 0018 cmpl %a0@(24),%d0 4e28e: 6304 blss 4e294 *external = internal; 4e290: 2482 movel %d2,%a2@ 4e292: 6006 bras 4e29a <== ALWAYS TAKEN else *external = _Addresses_Add_offset( the_port->external_base, 4e294: d0a8 0014 addl %a0@(20),%d0 4e298: 2480 movel %d0,%a2@ ending ); _Thread_Enable_dispatch(); 4e29a: 4eb9 0005 38b6 jsr 538b6 <_Thread_Enable_dispatch> 4e2a0: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4e2a2: 242e fff4 movel %fp@(-12),%d2 4e2a6: 246e fff8 moveal %fp@(-8),%a2 4e2aa: 4e5e unlk %fp 4e2ac: 4e75 rts ... 0004ecac : */ rtems_status_code rtems_rate_monotonic_cancel( rtems_id id ) { 4ecac: 4e56 fffc linkw %fp,#-4 4ecb0: 2f0b movel %a3,%sp@- 4ecb2: 2f0a movel %a2,%sp@- RTEMS_INLINE_ROUTINE Rate_monotonic_Control *_Rate_monotonic_Get ( Objects_Id id, Objects_Locations *location ) { return (Rate_monotonic_Control *) 4ecb4: 486e fffc pea %fp@(-4) 4ecb8: 2f2e 0008 movel %fp@(8),%sp@- 4ecbc: 4879 0007 4d8c pea 74d8c <_Rate_monotonic_Information> 4ecc2: 4eb9 0005 3030 jsr 53030 <_Objects_Get> Rate_monotonic_Control *the_period; Objects_Locations location; the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 4ecc8: 4fef 000c lea %sp@(12),%sp 4eccc: 2440 moveal %d0,%a2 4ecce: 4aae fffc tstl %fp@(-4) 4ecd2: 6704 beqs 4ecd8 4ecd4: 7004 moveq #4,%d0 4ecd6: 602c bras 4ed04 <== ALWAYS TAKEN case OBJECTS_LOCAL: if ( !_Thread_Is_executing( the_period->owner ) ) { 4ecd8: 2039 0007 4f82 movel 74f82 <_Thread_Executing>,%d0 4ecde: 47f9 0005 38b6 lea 538b6 <_Thread_Enable_dispatch>,%a3 4ece4: b0aa 0040 cmpl %a2@(64),%d0 4ece8: 6706 beqs 4ecf0 _Thread_Enable_dispatch(); 4ecea: 4e93 jsr %a3@ 4ecec: 7017 moveq #23,%d0 return RTEMS_NOT_OWNER_OF_RESOURCE; 4ecee: 6014 bras 4ed04 <== ALWAYS TAKEN } (void) _Watchdog_Remove( &the_period->Timer ); 4ecf0: 486a 0010 pea %a2@(16) 4ecf4: 4eb9 0005 4c50 jsr 54c50 <_Watchdog_Remove> the_period->state = RATE_MONOTONIC_INACTIVE; 4ecfa: 42aa 0038 clrl %a2@(56) _Thread_Enable_dispatch(); 4ecfe: 4e93 jsr %a3@ return RTEMS_SUCCESSFUL; 4ed00: 588f addql #4,%sp _Thread_Enable_dispatch(); return RTEMS_NOT_OWNER_OF_RESOURCE; } (void) _Watchdog_Remove( &the_period->Timer ); the_period->state = RATE_MONOTONIC_INACTIVE; _Thread_Enable_dispatch(); 4ed02: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4ed04: 246e fff4 moveal %fp@(-12),%a2 4ed08: 266e fff8 moveal %fp@(-8),%a3 4ed0c: 4e5e unlk %fp 4ed0e: 4e75 rts 000458e8 : rtems_status_code rtems_rate_monotonic_create( rtems_name name, rtems_id *id ) { 458e8: 4e56 fff0 linkw %fp,#-16 458ec: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ 458f0: 242e 0008 movel %fp@(8),%d2 458f4: 286e 000c moveal %fp@(12),%a4 Rate_monotonic_Control *the_period; if ( !rtems_is_name_valid( name ) ) 458f8: 6606 bnes 45900 458fa: 7003 moveq #3,%d0 458fc: 6000 009e braw 4599c <== ALWAYS TAKEN return RTEMS_INVALID_NAME; if ( !id ) 45900: 4a8c tstl %a4 45902: 6606 bnes 4590a 45904: 7009 moveq #9,%d0 45906: 6000 0094 braw 4599c <== ALWAYS TAKEN rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 4590a: 2039 0005 eac0 movel 5eac0 <_Thread_Dispatch_disable_level>,%d0 45910: 5280 addql #1,%d0 45912: 23c0 0005 eac0 movel %d0,5eac0 <_Thread_Dispatch_disable_level> * This function allocates a period control block from * the inactive chain of free period control blocks. */ RTEMS_INLINE_ROUTINE Rate_monotonic_Control *_Rate_monotonic_Allocate( void ) { return (Rate_monotonic_Control *) 45918: 4879 0005 e9bc pea 5e9bc <_Rate_monotonic_Information> 4591e: 47f9 0004 8282 lea 48282 <_Thread_Enable_dispatch>,%a3 45924: 4eb9 0004 7558 jsr 47558 <_Objects_Allocate> _Thread_Disable_dispatch(); /* to prevent deletion */ the_period = _Rate_monotonic_Allocate(); if ( !the_period ) { 4592a: 588f addql #4,%sp 4592c: 2440 moveal %d0,%a2 4592e: 4a80 tstl %d0 45930: 6606 bnes 45938 _Thread_Enable_dispatch(); 45932: 4e93 jsr %a3@ 45934: 7005 moveq #5,%d0 return RTEMS_TOO_MANY; 45936: 6064 bras 4599c <== ALWAYS TAKEN } the_period->owner = _Thread_Executing; 45938: 41f9 0005 eb7a lea 5eb7a <_Thread_Executing>,%a0 4593e: 2550 0040 movel %a0@,%a2@(64) the_period->state = RATE_MONOTONIC_INACTIVE; 45942: 42aa 0038 clrl %a2@(56) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 45946: 42aa 0018 clrl %a2@(24) the_watchdog->routine = routine; 4594a: 42aa 002c clrl %a2@(44) the_watchdog->id = id; 4594e: 42aa 0030 clrl %a2@(48) the_watchdog->user_data = user_data; 45952: 42aa 0034 clrl %a2@(52) _Watchdog_Initialize( &the_period->Timer, NULL, 0, NULL ); _Rate_monotonic_Reset_statistics( the_period ); 45956: 4878 0038 pea 38 4595a: 42a7 clrl %sp@- 4595c: 486a 0054 pea %a2@(84) 45960: 4eb9 0004 eb58 jsr 4eb58 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 45966: 202a 0008 movel %a2@(8),%d0 4596a: 4281 clrl %d1 4596c: 2079 0005 e9d4 moveal 5e9d4 <_Rate_monotonic_Information+0x18>,%a0 45972: 3200 movew %d0,%d1 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 45974: 2542 000c movel %d2,%a2@(12) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 45978: 218a 1c00 movel %a2,%a0@(00000000,%d1:l:4) 4597c: 223c 7fff ffff movel #2147483647,%d1 45982: 2541 005c movel %d1,%a2@(92) 45986: 2541 0060 movel %d1,%a2@(96) 4598a: 2541 0074 movel %d1,%a2@(116) 4598e: 2541 0078 movel %d1,%a2@(120) &_Rate_monotonic_Information, &the_period->Object, (Objects_Name) name ); *id = the_period->Object.id; 45992: 2880 movel %d0,%a4@ _Thread_Enable_dispatch(); 45994: 4e93 jsr %a3@ return RTEMS_SUCCESSFUL; 45996: 4fef 000c lea %sp@(12),%sp &the_period->Object, (Objects_Name) name ); *id = the_period->Object.id; _Thread_Enable_dispatch(); 4599a: 4280 clrl %d0 return RTEMS_SUCCESSFUL; } 4599c: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 459a2: 4e5e unlk %fp 459a4: 4e75 rts ... 0004edd0 : */ rtems_status_code rtems_rate_monotonic_delete( rtems_id id ) { 4edd0: 4e56 fffc linkw %fp,#-4 4edd4: 2f0a movel %a2,%sp@- RTEMS_INLINE_ROUTINE Rate_monotonic_Control *_Rate_monotonic_Get ( Objects_Id id, Objects_Locations *location ) { return (Rate_monotonic_Control *) 4edd6: 486e fffc pea %fp@(-4) 4edda: 2f2e 0008 movel %fp@(8),%sp@- 4edde: 4879 0007 4d8c pea 74d8c <_Rate_monotonic_Information> 4ede4: 4eb9 0005 3030 jsr 53030 <_Objects_Get> Rate_monotonic_Control *the_period; Objects_Locations location; the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 4edea: 4fef 000c lea %sp@(12),%sp 4edee: 2440 moveal %d0,%a2 4edf0: 4aae fffc tstl %fp@(-4) 4edf4: 6704 beqs 4edfa 4edf6: 7004 moveq #4,%d0 4edf8: 6036 bras 4ee30 <== ALWAYS TAKEN case OBJECTS_LOCAL: _Objects_Close( &_Rate_monotonic_Information, &the_period->Object ); 4edfa: 2f00 movel %d0,%sp@- 4edfc: 4879 0007 4d8c pea 74d8c <_Rate_monotonic_Information> 4ee02: 4eb9 0005 2c2c jsr 52c2c <_Objects_Close> (void) _Watchdog_Remove( &the_period->Timer ); 4ee08: 486a 0010 pea %a2@(16) 4ee0c: 4eb9 0005 4c50 jsr 54c50 <_Watchdog_Remove> the_period->state = RATE_MONOTONIC_INACTIVE; 4ee12: 42aa 0038 clrl %a2@(56) */ RTEMS_INLINE_ROUTINE void _Rate_monotonic_Free ( Rate_monotonic_Control *the_period ) { _Objects_Free( &_Rate_monotonic_Information, &the_period->Object ); 4ee16: 2f0a movel %a2,%sp@- 4ee18: 4879 0007 4d8c pea 74d8c <_Rate_monotonic_Information> 4ee1e: 4eb9 0005 2ea0 jsr 52ea0 <_Objects_Free> _Rate_monotonic_Free( the_period ); _Thread_Enable_dispatch(); 4ee24: 4eb9 0005 38b6 jsr 538b6 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 4ee2a: 4fef 0014 lea %sp@(20),%sp case OBJECTS_LOCAL: _Objects_Close( &_Rate_monotonic_Information, &the_period->Object ); (void) _Watchdog_Remove( &the_period->Timer ); the_period->state = RATE_MONOTONIC_INACTIVE; _Rate_monotonic_Free( the_period ); _Thread_Enable_dispatch(); 4ee2e: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4ee30: 246e fff8 moveal %fp@(-8),%a2 4ee34: 4e5e unlk %fp 4ee36: 4e75 rts 0007164c : rtems_status_code rtems_rate_monotonic_get_statistics( rtems_id id, rtems_rate_monotonic_period_statistics *statistics ) { 7164c: 4e56 fffc linkw %fp,#-4 71650: 2f0a movel %a2,%sp@- 71652: 246e 000c moveal %fp@(12),%a2 Objects_Locations location; Rate_monotonic_Control *the_period; rtems_rate_monotonic_period_statistics *dst; Rate_monotonic_Statistics *src; if ( !statistics ) 71656: 4a8a tstl %a2 71658: 6606 bnes 71660 7165a: 7009 moveq #9,%d0 7165c: 6000 0098 braw 716f6 <== ALWAYS TAKEN 71660: 486e fffc pea %fp@(-4) 71664: 2f2e 0008 movel %fp@(8),%sp@- 71668: 4879 0009 c89c pea 9c89c <_Rate_monotonic_Information> 7166e: 4eb9 0004 ba80 jsr 4ba80 <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 71674: 4fef 000c lea %sp@(12),%sp 71678: 2040 moveal %d0,%a0 7167a: 4aae fffc tstl %fp@(-4) 7167e: 6704 beqs 71684 71680: 7004 moveq #4,%d0 71682: 6072 bras 716f6 <== ALWAYS TAKEN case OBJECTS_LOCAL: dst = statistics; src = &the_period->Statistics; dst->count = src->count; 71684: 24a8 0054 movel %a0@(84),%a2@ dst->missed_count = src->missed_count; 71688: 2568 0058 0004 movel %a0@(88),%a2@(4) #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_To_timespec( &src->min_cpu_time, &dst->min_cpu_time ); 7168e: 2028 005c movel %a0@(92),%d0 71692: 2228 0060 movel %a0@(96),%d1 71696: 2540 0008 movel %d0,%a2@(8) 7169a: 2541 000c movel %d1,%a2@(12) _Timestamp_To_timespec( &src->max_cpu_time, &dst->max_cpu_time ); 7169e: 2028 0064 movel %a0@(100),%d0 716a2: 2228 0068 movel %a0@(104),%d1 716a6: 2540 0010 movel %d0,%a2@(16) 716aa: 2541 0014 movel %d1,%a2@(20) _Timestamp_To_timespec( &src->total_cpu_time, &dst->total_cpu_time ); 716ae: 2028 006c movel %a0@(108),%d0 716b2: 2228 0070 movel %a0@(112),%d1 716b6: 2540 0018 movel %d0,%a2@(24) 716ba: 2541 001c movel %d1,%a2@(28) _Timestamp_To_timespec( &src->min_wall_time, &dst->min_wall_time ); 716be: 2028 0074 movel %a0@(116),%d0 716c2: 2228 0078 movel %a0@(120),%d1 716c6: 2540 0020 movel %d0,%a2@(32) 716ca: 2541 0024 movel %d1,%a2@(36) _Timestamp_To_timespec( &src->max_wall_time, &dst->max_wall_time ); 716ce: 2028 007c movel %a0@(124),%d0 716d2: 2228 0080 movel %a0@(128),%d1 716d6: 2540 0028 movel %d0,%a2@(40) 716da: 2541 002c movel %d1,%a2@(44) _Timestamp_To_timespec( &src->total_wall_time, &dst->total_wall_time ); 716de: 2028 0084 movel %a0@(132),%d0 716e2: 2228 0088 movel %a0@(136),%d1 716e6: 2540 0030 movel %d0,%a2@(48) 716ea: 2541 0034 movel %d1,%a2@(52) dst->min_wall_time = src->min_wall_time; dst->max_wall_time = src->max_wall_time; dst->total_wall_time = src->total_wall_time; #endif _Thread_Enable_dispatch(); 716ee: 4eb9 0004 c33a jsr 4c33a <_Thread_Enable_dispatch> 716f4: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 716f6: 246e fff8 moveal %fp@(-8),%a2 716fa: 4e5e unlk %fp 716fc: 4e75 rts ... 00071700 : rtems_status_code rtems_rate_monotonic_get_status( rtems_id id, rtems_rate_monotonic_period_status *status ) { 71700: 4e56 ffec linkw %fp,#-20 71704: 2f0a movel %a2,%sp@- 71706: 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 ) 7170a: 4a8a tstl %a2 7170c: 6606 bnes 71714 7170e: 7009 moveq #9,%d0 71710: 6000 0094 braw 717a6 <== ALWAYS TAKEN 71714: 486e fffc pea %fp@(-4) 71718: 2f2e 0008 movel %fp@(8),%sp@- 7171c: 4879 0009 c89c pea 9c89c <_Rate_monotonic_Information> 71722: 4eb9 0004 ba80 jsr 4ba80 <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 71728: 4fef 000c lea %sp@(12),%sp 7172c: 2040 moveal %d0,%a0 7172e: 4aae fffc tstl %fp@(-4) 71732: 6704 beqs 71738 71734: 7004 moveq #4,%d0 71736: 606e bras 717a6 <== ALWAYS TAKEN case OBJECTS_LOCAL: status->owner = the_period->owner->Object.id; 71738: 2268 0040 moveal %a0@(64),%a1 status->state = the_period->state; 7173c: 2028 0038 movel %a0@(56),%d0 the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: status->owner = the_period->owner->Object.id; 71740: 24a9 0008 movel %a1@(8),%a2@ status->state = the_period->state; 71744: 2540 0004 movel %d0,%a2@(4) /* * If the period is inactive, there is no information. */ if ( status->state == RATE_MONOTONIC_INACTIVE ) { 71748: 6612 bnes 7175c #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timespec_Set_to_zero( &status->since_last_period ); _Timespec_Set_to_zero( &status->executed_since_last_period ); 7174a: 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 ); 7174e: 42aa 0008 clrl %a2@(8) 71752: 42aa 000c clrl %a2@(12) _Timespec_Set_to_zero( &status->executed_since_last_period ); 71756: 42aa 0010 clrl %a2@(16) 7175a: 6042 bras 7179e <== ALWAYS TAKEN /* * Grab the current status. */ valid_status = _Rate_monotonic_Get_status( 7175c: 486e fff4 pea %fp@(-12) 71760: 486e ffec pea %fp@(-20) 71764: 2f08 movel %a0,%sp@- 71766: 4eb9 0007 1828 jsr 71828 <_Rate_monotonic_Get_status> the_period, &since_last_period, &executed ); if (!valid_status) { 7176c: 4fef 000c lea %sp@(12),%sp 71770: 4a00 tstb %d0 71772: 660a bnes 7177e _Thread_Enable_dispatch(); 71774: 4eb9 0004 c33a jsr 4c33a <_Thread_Enable_dispatch> 7177a: 700b moveq #11,%d0 return RTEMS_NOT_DEFINED; 7177c: 6028 bras 717a6 <== ALWAYS TAKEN #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_To_timespec( &since_last_period, &status->since_last_period ); _Timestamp_To_timespec( 7177e: 202e fff4 movel %fp@(-12),%d0 71782: 222e fff8 movel %fp@(-8),%d1 71786: 2540 0010 movel %d0,%a2@(16) 7178a: 2541 0014 movel %d1,%a2@(20) _Thread_Enable_dispatch(); return RTEMS_NOT_DEFINED; } #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_To_timespec( 7178e: 202e ffec movel %fp@(-20),%d0 71792: 222e fff0 movel %fp@(-16),%d1 71796: 2540 0008 movel %d0,%a2@(8) 7179a: 2541 000c movel %d1,%a2@(12) status->since_last_period = since_last_period; status->executed_since_last_period = executed; #endif } _Thread_Enable_dispatch(); 7179e: 4eb9 0004 c33a jsr 4c33a <_Thread_Enable_dispatch> 717a4: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 717a6: 246e ffe8 moveal %fp@(-24),%a2 717aa: 4e5e unlk %fp 717ac: 4e75 rts ... 000719c4 : rtems_status_code rtems_rate_monotonic_period( rtems_id id, rtems_interval length ) { 719c4: 4e56 ffec linkw %fp,#-20 719c8: 48d7 041c moveml %d2-%d4/%a2,%sp@ 719cc: 486e fffc pea %fp@(-4) 719d0: 262e 0008 movel %fp@(8),%d3 719d4: 2f03 movel %d3,%sp@- 719d6: 4879 0009 c89c pea 9c89c <_Rate_monotonic_Information> 719dc: 242e 000c movel %fp@(12),%d2 719e0: 4eb9 0004 ba80 jsr 4ba80 <_Objects_Get> rtems_rate_monotonic_period_states local_state; ISR_Level level; the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 719e6: 4fef 000c lea %sp@(12),%sp 719ea: 2440 moveal %d0,%a2 719ec: 4aae fffc tstl %fp@(-4) 719f0: 6600 0138 bnew 71b2a case OBJECTS_LOCAL: if ( !_Thread_Is_executing( the_period->owner ) ) { 719f4: 2039 0009 beb2 movel 9beb2 <_Thread_Executing>,%d0 719fa: b0aa 0040 cmpl %a2@(64),%d0 719fe: 670c beqs 71a0c _Thread_Enable_dispatch(); 71a00: 4eb9 0004 c33a jsr 4c33a <_Thread_Enable_dispatch> 71a06: 7817 moveq #23,%d4 return RTEMS_NOT_OWNER_OF_RESOURCE; 71a08: 6000 0122 braw 71b2c <== ALWAYS TAKEN } if ( length == RTEMS_PERIOD_STATUS ) { 71a0c: 4a82 tstl %d2 71a0e: 6622 bnes 71a32 switch ( the_period->state ) { 71a10: 202a 0038 movel %a2@(56),%d0 71a14: 7204 moveq #4,%d1 71a16: b280 cmpl %d0,%d1 71a18: 6404 bccs 71a1e <== NEVER TAKEN 71a1a: 4284 clrl %d4 <== NOT EXECUTED 71a1c: 600a bras 71a28 <== NOT EXECUTED 71a1e: 41f9 0009 5e2e lea 95e2e ,%a0 71a24: 2830 0c00 movel %a0@(00000000,%d0:l:4),%d4 case RATE_MONOTONIC_ACTIVE: default: /* unreached -- only to remove warnings */ return_value = RTEMS_SUCCESSFUL; break; } _Thread_Enable_dispatch(); 71a28: 4eb9 0004 c33a jsr 4c33a <_Thread_Enable_dispatch> return( return_value ); 71a2e: 6000 00fc braw 71b2c <== ALWAYS TAKEN } _ISR_Disable( level ); 71a32: 203c 0000 0700 movel #1792,%d0 71a38: 40c4 movew %sr,%d4 71a3a: 8084 orl %d4,%d0 71a3c: 46c0 movew %d0,%sr switch ( the_period->state ) { 71a3e: 202a 0038 movel %a2@(56),%d0 71a42: 7202 moveq #2,%d1 71a44: b280 cmpl %d0,%d1 71a46: 6740 beqs 71a88 71a48: 123c 0004 moveb #4,%d1 71a4c: b280 cmpl %d0,%d1 71a4e: 6700 00a4 beqw 71af4 71a52: 4a80 tstl %d0 71a54: 6600 00d4 bnew 71b2a <== ALWAYS TAKEN case RATE_MONOTONIC_INACTIVE: { _ISR_Enable( level ); 71a58: 46c4 movew %d4,%sr /* * Baseline statistics information for the beginning of a period. */ _Rate_monotonic_Initiate_statistics( the_period ); 71a5a: 2f0a movel %a2,%sp@- ); the_period->next_length = length; _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 71a5c: 4284 clrl %d4 _ISR_Enable( level ); /* * Baseline statistics information for the beginning of a period. */ _Rate_monotonic_Initiate_statistics( the_period ); 71a5e: 4eb9 0007 17b0 jsr 717b0 <_Rate_monotonic_Initiate_statistics> Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 71a64: 203c 0007 1b38 movel #465720,%d0 the_period->state = RATE_MONOTONIC_ACTIVE; 71a6a: 7202 moveq #2,%d1 71a6c: 2540 002c movel %d0,%a2@(44) the_watchdog->id = id; 71a70: 2543 0030 movel %d3,%a2@(48) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 71a74: 2542 001c movel %d2,%a2@(28) 71a78: 2541 0038 movel %d1,%a2@(56) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 71a7c: 42aa 0018 clrl %a2@(24) the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 71a80: 42aa 0034 clrl %a2@(52) 71a84: 6000 0084 braw 71b0a <== ALWAYS TAKEN case RATE_MONOTONIC_ACTIVE: /* * Update statistics from the concluding period. */ _Rate_monotonic_Update_statistics( the_period ); 71a88: 2f0a movel %a2,%sp@- 71a8a: 4eb9 0007 18d0 jsr 718d0 <_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; 71a90: 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; 71a94: 7401 moveq #1,%d2 71a96: 2542 0038 movel %d2,%a2@(56) the_period->next_length = length; _ISR_Enable( level ); 71a9a: 46c4 movew %d4,%sr _Thread_Executing->Wait.id = the_period->Object.id; 71a9c: 2079 0009 beb2 moveal 9beb2 <_Thread_Executing>,%a0 71aa2: 216a 0008 0020 movel %a2@(8),%a0@(32) _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 71aa8: 4878 4000 pea 4000 71aac: 2f08 movel %a0,%sp@- 71aae: 4eb9 0004 cb58 jsr 4cb58 <_Thread_Set_state> /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); 71ab4: 203c 0000 0700 movel #1792,%d0 71aba: 40c1 movew %sr,%d1 71abc: 8081 orl %d1,%d0 71abe: 46c0 movew %d0,%sr local_state = the_period->state; the_period->state = RATE_MONOTONIC_ACTIVE; 71ac0: 143c 0002 moveb #2,%d2 /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); local_state = the_period->state; 71ac4: 202a 0038 movel %a2@(56),%d0 the_period->state = RATE_MONOTONIC_ACTIVE; 71ac8: 2542 0038 movel %d2,%a2@(56) _ISR_Enable( level ); 71acc: 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 ) 71ace: 7203 moveq #3,%d1 71ad0: 4fef 000c lea %sp@(12),%sp 71ad4: b280 cmpl %d0,%d1 71ad6: 6612 bnes 71aea _Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 71ad8: 4878 4000 pea 4000 71adc: 2f39 0009 beb2 movel 9beb2 <_Thread_Executing>,%sp@- 71ae2: 4eb9 0004 bf80 jsr 4bf80 <_Thread_Clear_state> 71ae8: 508f addql #8,%sp _Thread_Enable_dispatch(); 71aea: 4eb9 0004 c33a jsr 4c33a <_Thread_Enable_dispatch> 71af0: 4284 clrl %d4 return RTEMS_SUCCESSFUL; 71af2: 6038 bras 71b2c <== ALWAYS TAKEN case RATE_MONOTONIC_EXPIRED: /* * Update statistics from the concluding period */ _Rate_monotonic_Update_statistics( the_period ); 71af4: 2f0a movel %a2,%sp@- 71af6: 4eb9 0007 18d0 jsr 718d0 <_Rate_monotonic_Update_statistics> _ISR_Enable( level ); 71afc: 46c4 movew %d4,%sr the_period->state = RATE_MONOTONIC_ACTIVE; 71afe: 7002 moveq #2,%d0 the_period->next_length = length; _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 71b00: 7806 moveq #6,%d4 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 71b02: 2542 001c movel %d2,%a2@(28) */ _Rate_monotonic_Update_statistics( the_period ); _ISR_Enable( level ); the_period->state = RATE_MONOTONIC_ACTIVE; 71b06: 2540 0038 movel %d0,%a2@(56) the_period->next_length = length; 71b0a: 2542 003c movel %d2,%a2@(60) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 71b0e: 486a 0010 pea %a2@(16) 71b12: 4879 0009 bed0 pea 9bed0 <_Watchdog_Ticks_chain> 71b18: 4eb9 0004 d2a0 jsr 4d2a0 <_Watchdog_Insert> _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 71b1e: 4eb9 0004 c33a jsr 4c33a <_Thread_Enable_dispatch> return RTEMS_TIMEOUT; 71b24: 4fef 000c lea %sp@(12),%sp 71b28: 6002 bras 71b2c <== ALWAYS TAKEN 71b2a: 7804 moveq #4,%d4 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 71b2c: 2004 movel %d4,%d0 71b2e: 4cee 041c ffec moveml %fp@(-20),%d2-%d4/%a2 71b34: 4e5e unlk %fp 71b36: 4e75 rts 00062e88 : */ void rtems_rate_monotonic_report_statistics_with_plugin( void *context, rtems_printk_plugin_t print ) { 62e88: 4e56 ff78 linkw %fp,#-136 62e8c: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 62e90: 242e 0008 movel %fp@(8),%d2 62e94: 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 ) 62e98: 4a8a tstl %a2 62e9a: 6700 0158 beqw 62ff4 <== ALWAYS TAKEN return; (*print)( context, "Period information by period\n" ); 62e9e: 4879 0009 29f0 pea 929f0 <_TOD_Days_per_month+0x68> #if defined(RTEMS_DEBUG) if ( status != RTEMS_SUCCESSFUL ) continue; #endif rtems_object_get_name( the_status.owner, sizeof(name), name ); 62ea4: 2a0e movel %fp,%d5 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 ); 62ea6: 280e movel %fp,%d4 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 ); 62ea8: 4bf9 0007 1700 lea 71700 ,%a5 #if defined(RTEMS_DEBUG) if ( status != RTEMS_SUCCESSFUL ) continue; #endif rtems_object_get_name( the_status.owner, sizeof(name), name ); 62eae: 5b85 subql #5,%d5 62eb0: 49f9 0004 a0bc lea 4a0bc ,%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 ); 62eb6: 0684 ffff fff2 addil #-14,%d4 62ebc: 47f9 0006 4428 lea 64428 <_Timespec_Divide_by_integer>,%a3 char name[5]; if ( !print ) return; (*print)( context, "Period information by period\n" ); 62ec2: 2f02 movel %d2,%sp@- 62ec4: 4e92 jsr %a2@ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ (*print)( context, "--- CPU times are in seconds ---\n" ); 62ec6: 4879 0009 2a0e pea 92a0e <_TOD_Days_per_month+0x86> 62ecc: 2f02 movel %d2,%sp@- 62ece: 4e92 jsr %a2@ (*print)( context, "--- Wall times are in seconds ---\n" ); 62ed0: 4879 0009 2a30 pea 92a30 <_TOD_Days_per_month+0xa8> 62ed6: 2f02 movel %d2,%sp@- 62ed8: 4e92 jsr %a2@ Be sure to test the various cases. (*print)( context,"\ 1234567890123456789012345678901234567890123456789012345678901234567890123456789\ \n"); */ (*print)( context, " ID OWNER COUNT MISSED " 62eda: 4879 0009 2a53 pea 92a53 <_TOD_Days_per_month+0xcb> 62ee0: 2f02 movel %d2,%sp@- 62ee2: 4e92 jsr %a2@ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ " " #endif " WALL TIME\n" ); (*print)( context, " " 62ee4: 4fef 001c lea %sp@(28),%sp 62ee8: 2ebc 0009 2a9e movel #600734,%sp@ 62eee: 2f02 movel %d2,%sp@- 62ef0: 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 ; 62ef2: 2639 0009 c8a2 movel 9c8a2 <_Rate_monotonic_Information+0x6>,%d3 62ef8: 508f addql #8,%sp 62efa: 6000 00ee braw 62fea <== ALWAYS TAKEN id <= _Rate_monotonic_Information.maximum_id ; id++ ) { status = rtems_rate_monotonic_get_statistics( id, &the_stats ); 62efe: 486e ffa2 pea %fp@(-94) 62f02: 2f03 movel %d3,%sp@- 62f04: 4eb9 0007 164c jsr 7164c if ( status != RTEMS_SUCCESSFUL ) 62f0a: 508f addql #8,%sp 62f0c: 4a80 tstl %d0 62f0e: 6600 00d8 bnew 62fe8 continue; /* If the above passed, so should this but check it anyway */ status = rtems_rate_monotonic_get_status( id, &the_status ); 62f12: 486e ffda pea %fp@(-38) 62f16: 2f03 movel %d3,%sp@- 62f18: 4e95 jsr %a5@ #if defined(RTEMS_DEBUG) if ( status != RTEMS_SUCCESSFUL ) continue; #endif rtems_object_get_name( the_status.owner, sizeof(name), name ); 62f1a: 2f05 movel %d5,%sp@- 62f1c: 4878 0005 pea 5 62f20: 2f2e ffda movel %fp@(-38),%sp@- 62f24: 4e94 jsr %a4@ /* * Print part of report line that is not dependent on granularity */ (*print)( context, 62f26: 2f2e ffa6 movel %fp@(-90),%sp@- 62f2a: 2f2e ffa2 movel %fp@(-94),%sp@- 62f2e: 2f05 movel %d5,%sp@- 62f30: 2f03 movel %d3,%sp@- 62f32: 4879 0009 2aea pea 92aea <_TOD_Days_per_month+0x162> 62f38: 2f02 movel %d2,%sp@- 62f3a: 4e92 jsr %a2@ ); /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { 62f3c: 202e ffa2 movel %fp@(-94),%d0 62f40: 4fef 002c lea %sp@(44),%sp 62f44: 6610 bnes 62f56 (*print)( context, "\n" ); 62f46: 4879 0009 430a pea 9430a <__FUNCTION__.5979+0x5d> 62f4c: 2f02 movel %d2,%sp@- 62f4e: 4e92 jsr %a2@ continue; 62f50: 508f addql #8,%sp 62f52: 6000 0094 braw 62fe8 <== ALWAYS TAKEN 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 ); 62f56: 2f04 movel %d4,%sp@- (*print)( context, 62f58: 2e3c 0000 03e8 movel #1000,%d7 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 ); 62f5e: 2f00 movel %d0,%sp@- 62f60: 486e ffba pea %fp@(-70) 62f64: 4e93 jsr %a3@ (*print)( context, 62f66: 202e fff6 movel %fp@(-10),%d0 62f6a: 223c 0000 03e8 movel #1000,%d1 62f70: 4c41 0800 remsl %d1,%d0,%d0 62f74: 222e ffb6 movel %fp@(-74),%d1 62f78: 2f00 movel %d0,%sp@- 62f7a: 2f2e fff2 movel %fp@(-14),%sp@- 62f7e: 202e ffae movel %fp@(-82),%d0 62f82: 4c47 1801 remsl %d7,%d1,%d1 62f86: 4c47 0800 remsl %d7,%d0,%d0 62f8a: 2f01 movel %d1,%sp@- 62f8c: 2f2e ffb2 movel %fp@(-78),%sp@- 62f90: 2f00 movel %d0,%sp@- 62f92: 2f2e ffaa movel %fp@(-86),%sp@- 62f96: 4879 0009 2b01 pea 92b01 <_TOD_Days_per_month+0x179> 62f9c: 2f02 movel %d2,%sp@- 62f9e: 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); 62fa0: 4fef 0028 lea %sp@(40),%sp 62fa4: 2e84 movel %d4,%sp@ 62fa6: 2f2e ffa2 movel %fp@(-94),%sp@- 62faa: 486e ffd2 pea %fp@(-46) 62fae: 4e93 jsr %a3@ (*print)( context, 62fb0: 202e fff6 movel %fp@(-10),%d0 62fb4: 4c47 0800 remsl %d7,%d0,%d0 62fb8: 222e ffce movel %fp@(-50),%d1 62fbc: 2f00 movel %d0,%sp@- 62fbe: 2f2e fff2 movel %fp@(-14),%sp@- 62fc2: 4c47 1801 remsl %d7,%d1,%d1 62fc6: 202e ffc6 movel %fp@(-58),%d0 62fca: 2f01 movel %d1,%sp@- 62fcc: 2f2e ffca movel %fp@(-54),%sp@- 62fd0: 4c47 0800 remsl %d7,%d0,%d0 62fd4: 2f00 movel %d0,%sp@- 62fd6: 2f2e ffc2 movel %fp@(-62),%sp@- 62fda: 4879 0009 2b20 pea 92b20 <_TOD_Days_per_month+0x198> 62fe0: 2f02 movel %d2,%sp@- 62fe2: 4e92 jsr %a2@ 62fe4: 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 ; id <= _Rate_monotonic_Information.maximum_id ; id++ ) { 62fe8: 5283 addql #1,%d3 /* * 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 ; 62fea: b6b9 0009 c8a6 cmpl 9c8a6 <_Rate_monotonic_Information+0xa>,%d3 62ff0: 6300 ff0c blsw 62efe the_stats.min_wall_time, the_stats.max_wall_time, ival_wall, fval_wall ); #endif } } } 62ff4: 4cee 3cfc ff78 moveml %fp@(-136),%d2-%d7/%a2-%a5 62ffa: 4e5e unlk %fp 62ffc: 4e75 rts 00063018 : /* * rtems_rate_monotonic_reset_all_statistics */ void rtems_rate_monotonic_reset_all_statistics( void ) { 63018: 4e56 0000 linkw %fp,#0 6301c: 2039 0009 bdf8 movel 9bdf8 <_Thread_Dispatch_disable_level>,%d0 63022: 5280 addql #1,%d0 63024: 2f0a movel %a2,%sp@- 63026: 23c0 0009 bdf8 movel %d0,9bdf8 <_Thread_Dispatch_disable_level> 6302c: 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 ; 6302e: 2439 0009 c8a2 movel 9c8a2 <_Rate_monotonic_Information+0x6>,%d2 id <= _Rate_monotonic_Information.maximum_id ; id++ ) { status = rtems_rate_monotonic_reset_statistics( id ); 63034: 45f9 0006 305c lea 6305c ,%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 ; 6303a: 6008 bras 63044 <== ALWAYS TAKEN id <= _Rate_monotonic_Information.maximum_id ; id++ ) { status = rtems_rate_monotonic_reset_statistics( id ); 6303c: 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++ ) { 6303e: 5282 addql #1,%d2 status = rtems_rate_monotonic_reset_statistics( id ); 63040: 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 ; id <= _Rate_monotonic_Information.maximum_id ; id++ ) { 63042: 588f addql #4,%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 ; 63044: b4b9 0009 c8a6 cmpl 9c8a6 <_Rate_monotonic_Information+0xa>,%d2 6304a: 63f0 blss 6303c /* * Done so exit thread dispatching disabled critical section. */ _Thread_Enable_dispatch(); } 6304c: 242e fff8 movel %fp@(-8),%d2 63050: 246e fffc moveal %fp@(-4),%a2 63054: 4e5e unlk %fp } /* * Done so exit thread dispatching disabled critical section. */ _Thread_Enable_dispatch(); 63056: 4ef9 0004 c33a jmp 4c33a <_Thread_Enable_dispatch> 0006305c : */ rtems_status_code rtems_rate_monotonic_reset_statistics( rtems_id id ) { 6305c: 4e56 fffc linkw %fp,#-4 63060: 2f0a movel %a2,%sp@- RTEMS_INLINE_ROUTINE Rate_monotonic_Control *_Rate_monotonic_Get ( Objects_Id id, Objects_Locations *location ) { return (Rate_monotonic_Control *) 63062: 486e fffc pea %fp@(-4) 63066: 2f2e 0008 movel %fp@(8),%sp@- 6306a: 4879 0009 c89c pea 9c89c <_Rate_monotonic_Information> 63070: 4eb9 0004 ba80 jsr 4ba80 <_Objects_Get> Objects_Locations location; Rate_monotonic_Control *the_period; the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 63076: 4fef 000c lea %sp@(12),%sp 6307a: 2440 moveal %d0,%a2 6307c: 4aae fffc tstl %fp@(-4) 63080: 6704 beqs 63086 63082: 7004 moveq #4,%d0 63084: 6032 bras 630b8 <== ALWAYS TAKEN case OBJECTS_LOCAL: _Rate_monotonic_Reset_statistics( the_period ); 63086: 4878 0038 pea 38 6308a: 42a7 clrl %sp@- 6308c: 486a 0054 pea %a2@(84) 63090: 4eb9 0007 932c jsr 7932c 63096: 203c 7fff ffff movel #2147483647,%d0 6309c: 2540 0078 movel %d0,%a2@(120) 630a0: 2540 005c movel %d0,%a2@(92) 630a4: 2540 0060 movel %d0,%a2@(96) 630a8: 2540 0074 movel %d0,%a2@(116) _Thread_Enable_dispatch(); 630ac: 4eb9 0004 c33a jsr 4c33a <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 630b2: 4fef 000c lea %sp@(12),%sp the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: _Rate_monotonic_Reset_statistics( the_period ); _Thread_Enable_dispatch(); 630b6: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 630b8: 246e fff8 moveal %fp@(-8),%a2 630bc: 4e5e unlk %fp 630be: 4e75 rts 0004f414 : uintptr_t length, uintptr_t page_size, rtems_attribute attribute_set, rtems_id *id ) { 4f414: 4e56 ffe4 linkw %fp,#-28 4f418: 48d7 0c7c moveml %d2-%d6/%a2-%a3,%sp@ 4f41c: 262e 0008 movel %fp@(8),%d3 4f420: 242e 000c movel %fp@(12),%d2 4f424: 2c2e 0010 movel %fp@(16),%d6 4f428: 2a2e 0014 movel %fp@(20),%d5 4f42c: 282e 0018 movel %fp@(24),%d4 4f430: 266e 001c moveal %fp@(28),%a3 rtems_status_code return_status; Region_Control *the_region; if ( !rtems_is_name_valid( name ) ) 4f434: 4a83 tstl %d3 4f436: 6606 bnes 4f43e 4f438: 7403 moveq #3,%d2 4f43a: 6000 00c8 braw 4f504 <== ALWAYS TAKEN return RTEMS_INVALID_NAME; if ( !starting_address ) 4f43e: 4a82 tstl %d2 4f440: 6700 00c0 beqw 4f502 return RTEMS_INVALID_ADDRESS; if ( !id ) 4f444: 4a8b tstl %a3 4f446: 6700 00ba beqw 4f502 return RTEMS_INVALID_ADDRESS; if ( !_Addresses_Is_aligned( starting_address ) ) 4f44a: 7003 moveq #3,%d0 4f44c: c082 andl %d2,%d0 4f44e: 6600 00b2 bnew 4f502 return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); /* to prevent deletion */ 4f452: 2f39 0007 4f7a movel 74f7a <_RTEMS_Allocator_Mutex>,%sp@- 4f458: 4eb9 0005 17ec jsr 517ec <_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 ); 4f45e: 4879 0007 4dc6 pea 74dc6 <_Region_Information> 4f464: 4eb9 0005 2bac jsr 52bac <_Objects_Allocate> the_region = _Region_Allocate(); if ( !the_region ) 4f46a: 508f addql #8,%sp 4f46c: 2440 moveal %d0,%a2 4f46e: 4a80 tstl %d0 4f470: 6604 bnes 4f476 4f472: 7405 moveq #5,%d2 4f474: 607c bras 4f4f2 <== ALWAYS TAKEN return_status = RTEMS_TOO_MANY; else { the_region->maximum_segment_size = _Heap_Initialize( 4f476: 2f05 movel %d5,%sp@- 4f478: 2f06 movel %d6,%sp@- 4f47a: 2f02 movel %d2,%sp@- 4f47c: 486a 0068 pea %a2@(104) 4f480: 4eb9 0005 26c8 jsr 526c8 <_Heap_Initialize> &the_region->Memory, starting_address, length, page_size ); if ( !the_region->maximum_segment_size ) { 4f486: 4fef 0010 lea %sp@(16),%sp if ( !the_region ) return_status = RTEMS_TOO_MANY; else { the_region->maximum_segment_size = _Heap_Initialize( 4f48a: 2540 005c movel %d0,%a2@(92) &the_region->Memory, starting_address, length, page_size ); if ( !the_region->maximum_segment_size ) { 4f48e: 6614 bnes 4f4a4 */ RTEMS_INLINE_ROUTINE void _Region_Free ( Region_Control *the_region ) { _Objects_Free( &_Region_Information, &the_region->Object ); 4f490: 2f0a movel %a2,%sp@- 4f492: 4879 0007 4dc6 pea 74dc6 <_Region_Information> 4f498: 7408 moveq #8,%d2 4f49a: 4eb9 0005 2ea0 jsr 52ea0 <_Objects_Free> 4f4a0: 508f addql #8,%sp 4f4a2: 604e bras 4f4f2 <== ALWAYS TAKEN return_status = RTEMS_INVALID_SIZE; } else { the_region->starting_address = starting_address; 4f4a4: 2542 0050 movel %d2,%a2@(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( 4f4a8: 2004 movel %d4,%d0 4f4aa: 7201 moveq #1,%d1 4f4ac: e488 lsrl #2,%d0 &_Region_Information, &the_region->Object, (Objects_Name) name ); *id = the_region->Object.id; 4f4ae: 4282 clrl %d2 } else { the_region->starting_address = starting_address; the_region->length = length; 4f4b0: 2546 0054 movel %d6,%a2@(84) the_region->page_size = page_size; the_region->attribute_set = attribute_set; the_region->number_of_used_blocks = 0; _Thread_queue_Initialize( 4f4b4: c280 andl %d0,%d1 else { the_region->starting_address = starting_address; the_region->length = length; the_region->page_size = page_size; 4f4b6: 2545 0058 movel %d5,%a2@(88) the_region->attribute_set = attribute_set; 4f4ba: 2544 0060 movel %d4,%a2@(96) the_region->number_of_used_blocks = 0; 4f4be: 42aa 0064 clrl %a2@(100) _Thread_queue_Initialize( 4f4c2: 4878 0006 pea 6 4f4c6: 4878 0040 pea 40 4f4ca: 2f01 movel %d1,%sp@- 4f4cc: 486a 0010 pea %a2@(16) 4f4d0: 4eb9 0005 3fa0 jsr 53fa0 <_Thread_queue_Initialize> 4f4d6: 202a 0008 movel %a2@(8),%d0 4f4da: 4281 clrl %d1 &_Region_Information, &the_region->Object, (Objects_Name) name ); *id = the_region->Object.id; 4f4dc: 4fef 0010 lea %sp@(16),%sp 4f4e0: 3200 movew %d0,%d1 4f4e2: 2079 0007 4dde moveal 74dde <_Region_Information+0x18>,%a0 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 4f4e8: 2543 000c movel %d3,%a2@(12) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4f4ec: 218a 1c00 movel %a2,%a0@(00000000,%d1:l:4) 4f4f0: 2680 movel %d0,%a3@ return_status = RTEMS_SUCCESSFUL; } } _RTEMS_Unlock_allocator(); 4f4f2: 2f39 0007 4f7a movel 74f7a <_RTEMS_Allocator_Mutex>,%sp@- 4f4f8: 4eb9 0005 184c jsr 5184c <_API_Mutex_Unlock> return return_status; 4f4fe: 588f addql #4,%sp 4f500: 6002 bras 4f504 <== ALWAYS TAKEN 4f502: 7409 moveq #9,%d2 } 4f504: 2002 movel %d2,%d0 4f506: 4cee 0c7c ffe4 moveml %fp@(-28),%d2-%d6/%a2-%a3 4f50c: 4e5e unlk %fp 4f50e: 4e75 rts 0004f510 : */ rtems_status_code rtems_region_delete( rtems_id id ) { 4f510: 4e56 fffc linkw %fp,#-4 4f514: 2f0a movel %a2,%sp@- 4f516: 2f02 movel %d2,%sp@- Objects_Locations location; rtems_status_code return_status; Region_Control *the_region; _RTEMS_Lock_allocator(); 4f518: 2f39 0007 4f7a movel 74f7a <_RTEMS_Allocator_Mutex>,%sp@- 4f51e: 4eb9 0005 17ec jsr 517ec <_API_Mutex_Lock> RTEMS_INLINE_ROUTINE Region_Control *_Region_Get ( Objects_Id id, Objects_Locations *location ) { return (Region_Control *) 4f524: 486e fffc pea %fp@(-4) 4f528: 2f2e 0008 movel %fp@(8),%sp@- 4f52c: 4879 0007 4dc6 pea 74dc6 <_Region_Information> 4f532: 4eb9 0005 2ff8 jsr 52ff8 <_Objects_Get_no_protection> the_region = _Region_Get( id, &location ); switch ( location ) { 4f538: 4fef 0010 lea %sp@(16),%sp 4f53c: 2440 moveal %d0,%a2 4f53e: 4aae fffc tstl %fp@(-4) 4f542: 6704 beqs 4f548 4f544: 7404 moveq #4,%d2 4f546: 602c bras 4f574 <== ALWAYS TAKEN case OBJECTS_LOCAL: _Region_Debug_Walk( the_region, 5 ); if ( the_region->number_of_used_blocks != 0 ) 4f548: 4aaa 0064 tstl %a2@(100) 4f54c: 6704 beqs 4f552 4f54e: 740c moveq #12,%d2 4f550: 6022 bras 4f574 <== ALWAYS TAKEN return_status = RTEMS_RESOURCE_IN_USE; else { _Objects_Close( &_Region_Information, &the_region->Object ); 4f552: 2f00 movel %d0,%sp@- 4f554: 4879 0007 4dc6 pea 74dc6 <_Region_Information> */ RTEMS_INLINE_ROUTINE void _Region_Free ( Region_Control *the_region ) { _Objects_Free( &_Region_Information, &the_region->Object ); 4f55a: 4282 clrl %d2 4f55c: 4eb9 0005 2c2c jsr 52c2c <_Objects_Close> 4f562: 2f0a movel %a2,%sp@- 4f564: 4879 0007 4dc6 pea 74dc6 <_Region_Information> 4f56a: 4eb9 0005 2ea0 jsr 52ea0 <_Objects_Free> 4f570: 4fef 0010 lea %sp@(16),%sp default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 4f574: 2f39 0007 4f7a movel 74f7a <_RTEMS_Allocator_Mutex>,%sp@- 4f57a: 4eb9 0005 184c jsr 5184c <_API_Mutex_Unlock> return return_status; } 4f580: 246e fff8 moveal %fp@(-8),%a2 4f584: 2002 movel %d2,%d0 4f586: 242e fff4 movel %fp@(-12),%d2 4f58a: 4e5e unlk %fp 4f58c: 4e75 rts ... 0004f590 : rtems_status_code rtems_region_extend( rtems_id id, void *starting_address, uintptr_t length ) { 4f590: 4e56 fff8 linkw %fp,#-8 4f594: 2f0a movel %a2,%sp@- 4f596: 2f02 movel %d2,%sp@- 4f598: 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 ) 4f59c: 6606 bnes 4f5a4 4f59e: 143c 0009 moveb #9,%d2 4f5a2: 6076 bras 4f61a <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); /* to prevent deletion */ 4f5a4: 2f39 0007 4f7a movel 74f7a <_RTEMS_Allocator_Mutex>,%sp@- 4f5aa: 4eb9 0005 17ec jsr 517ec <_API_Mutex_Lock> RTEMS_INLINE_ROUTINE Region_Control *_Region_Get ( Objects_Id id, Objects_Locations *location ) { return (Region_Control *) 4f5b0: 486e fff8 pea %fp@(-8) 4f5b4: 2f2e 0008 movel %fp@(8),%sp@- 4f5b8: 4879 0007 4dc6 pea 74dc6 <_Region_Information> 4f5be: 4eb9 0005 2ff8 jsr 52ff8 <_Objects_Get_no_protection> the_region = _Region_Get( id, &location ); switch ( location ) { 4f5c4: 4fef 0010 lea %sp@(16),%sp 4f5c8: 2440 moveal %d0,%a2 4f5ca: 4aae fff8 tstl %fp@(-8) 4f5ce: 6704 beqs 4f5d4 4f5d0: 7404 moveq #4,%d2 4f5d2: 6038 bras 4f60c <== ALWAYS TAKEN case OBJECTS_LOCAL: heap_status = _Heap_Extend( 4f5d4: 486e fffc pea %fp@(-4) 4f5d8: 2f2e 0010 movel %fp@(16),%sp@- 4f5dc: 2f02 movel %d2,%sp@- 4f5de: 486a 0068 pea %a2@(104) 4f5e2: 4eb9 0005 240c jsr 5240c <_Heap_Extend> starting_address, length, &amount_extended ); if ( heap_status == HEAP_EXTEND_SUCCESSFUL ) { 4f5e8: 4fef 0010 lea %sp@(16),%sp 4f5ec: 4a80 tstl %d0 4f5ee: 6610 bnes 4f600 the_region->length += amount_extended; 4f5f0: 202e fffc movel %fp@(-4),%d0 the_region->maximum_segment_size += amount_extended; 4f5f4: d1aa 005c addl %d0,%a2@(92) 4f5f8: 4282 clrl %d2 length, &amount_extended ); if ( heap_status == HEAP_EXTEND_SUCCESSFUL ) { the_region->length += amount_extended; 4f5fa: d1aa 0054 addl %d0,%a2@(84) 4f5fe: 600c bras 4f60c <== ALWAYS TAKEN the_region->maximum_segment_size += amount_extended; return_status = RTEMS_SUCCESSFUL; } else if ( heap_status == HEAP_EXTEND_ERROR ) { 4f600: 7201 moveq #1,%d1 4f602: b280 cmpl %d0,%d1 4f604: 6704 beqs 4f60a 4f606: 7418 moveq #24,%d2 4f608: 6002 bras 4f60c <== ALWAYS TAKEN 4f60a: 7409 moveq #9,%d2 default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 4f60c: 2f39 0007 4f7a movel 74f7a <_RTEMS_Allocator_Mutex>,%sp@- 4f612: 4eb9 0005 184c jsr 5184c <_API_Mutex_Unlock> return return_status; 4f618: 588f addql #4,%sp } 4f61a: 2002 movel %d2,%d0 4f61c: 242e fff0 movel %fp@(-16),%d2 4f620: 246e fff4 moveal %fp@(-12),%a2 4f624: 4e5e unlk %fp 4f626: 4e75 rts 0004f628 : rtems_status_code rtems_region_get_free_information( rtems_id id, Heap_Information_block *the_info ) { 4f628: 4e56 fffc linkw %fp,#-4 4f62c: 2f0a movel %a2,%sp@- 4f62e: 246e 000c moveal %fp@(12),%a2 4f632: 2f02 movel %d2,%sp@- Objects_Locations location; rtems_status_code return_status; register Region_Control *the_region; if ( !the_info ) 4f634: 4a8a tstl %a2 4f636: 6604 bnes 4f63c 4f638: 7409 moveq #9,%d2 4f63a: 605a bras 4f696 <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); 4f63c: 2f39 0007 4f7a movel 74f7a <_RTEMS_Allocator_Mutex>,%sp@- 4f642: 4eb9 0005 17ec jsr 517ec <_API_Mutex_Lock> 4f648: 486e fffc pea %fp@(-4) 4f64c: 2f2e 0008 movel %fp@(8),%sp@- 4f650: 4879 0007 4dc6 pea 74dc6 <_Region_Information> 4f656: 4eb9 0005 2ff8 jsr 52ff8 <_Objects_Get_no_protection> the_region = _Region_Get( id, &location ); switch ( location ) { 4f65c: 4fef 0010 lea %sp@(16),%sp 4f660: 4aae fffc tstl %fp@(-4) 4f664: 6704 beqs 4f66a 4f666: 7404 moveq #4,%d2 4f668: 601e bras 4f688 <== ALWAYS TAKEN 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 ); 4f66a: 2f0a movel %a2,%sp@- 4f66c: 2040 moveal %d0,%a0 4f66e: 4868 0068 pea %a0@(104) 4f672: 4282 clrl %d2 the_region = _Region_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: the_info->Used.number = 0; 4f674: 42aa 000c clrl %a2@(12) the_info->Used.total = 0; 4f678: 42aa 0014 clrl %a2@(20) the_info->Used.largest = 0; 4f67c: 42aa 0010 clrl %a2@(16) _Heap_Get_free_information( &the_region->Memory, &the_info->Free ); 4f680: 4eb9 0005 2618 jsr 52618 <_Heap_Get_free_information> return_status = RTEMS_SUCCESSFUL; break; 4f686: 508f addql #8,%sp default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 4f688: 2f39 0007 4f7a movel 74f7a <_RTEMS_Allocator_Mutex>,%sp@- 4f68e: 4eb9 0005 184c jsr 5184c <_API_Mutex_Unlock> return return_status; 4f694: 588f addql #4,%sp } 4f696: 2002 movel %d2,%d0 4f698: 242e fff4 movel %fp@(-12),%d2 4f69c: 246e fff8 moveal %fp@(-8),%a2 4f6a0: 4e5e unlk %fp 4f6a2: 4e75 rts 0004f6a4 : rtems_status_code rtems_region_get_information( rtems_id id, Heap_Information_block *the_info ) { 4f6a4: 4e56 fffc linkw %fp,#-4 4f6a8: 2f02 movel %d2,%sp@- 4f6aa: 242e 000c movel %fp@(12),%d2 Objects_Locations location; rtems_status_code return_status; register Region_Control *the_region; if ( !the_info ) 4f6ae: 6606 bnes 4f6b6 4f6b0: 143c 0009 moveb #9,%d2 4f6b4: 604e bras 4f704 <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); 4f6b6: 2f39 0007 4f7a movel 74f7a <_RTEMS_Allocator_Mutex>,%sp@- 4f6bc: 4eb9 0005 17ec jsr 517ec <_API_Mutex_Lock> 4f6c2: 486e fffc pea %fp@(-4) 4f6c6: 2f2e 0008 movel %fp@(8),%sp@- 4f6ca: 4879 0007 4dc6 pea 74dc6 <_Region_Information> 4f6d0: 4eb9 0005 2ff8 jsr 52ff8 <_Objects_Get_no_protection> the_region = _Region_Get( id, &location ); switch ( location ) { 4f6d6: 4fef 0010 lea %sp@(16),%sp 4f6da: 4aae fffc tstl %fp@(-4) 4f6de: 6704 beqs 4f6e4 4f6e0: 7404 moveq #4,%d2 4f6e2: 6012 bras 4f6f6 <== ALWAYS TAKEN case OBJECTS_LOCAL: _Heap_Get_information( &the_region->Memory, the_info ); 4f6e4: 2f02 movel %d2,%sp@- 4f6e6: 2040 moveal %d0,%a0 4f6e8: 4868 0068 pea %a0@(104) 4f6ec: 4282 clrl %d2 4f6ee: 4eb9 0005 265c jsr 5265c <_Heap_Get_information> return_status = RTEMS_SUCCESSFUL; break; 4f6f4: 508f addql #8,%sp default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 4f6f6: 2f39 0007 4f7a movel 74f7a <_RTEMS_Allocator_Mutex>,%sp@- 4f6fc: 4eb9 0005 184c jsr 5184c <_API_Mutex_Unlock> return return_status; 4f702: 588f addql #4,%sp } 4f704: 2002 movel %d2,%d0 4f706: 242e fff8 movel %fp@(-8),%d2 4f70a: 4e5e unlk %fp 4f70c: 4e75 rts ... 0004f710 : uintptr_t size, rtems_option option_set, rtems_interval timeout, void **segment ) { 4f710: 4e56 ffe8 linkw %fp,#-24 4f714: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@ 4f718: 262e 0008 movel %fp@(8),%d3 4f71c: 242e 000c movel %fp@(12),%d2 4f720: 286e 0018 moveal %fp@(24),%a4 Objects_Locations location; rtems_status_code return_status; Region_Control *the_region; void *the_segment; if ( !segment ) 4f724: 4a8c tstl %a4 4f726: 6606 bnes 4f72e 4f728: 7409 moveq #9,%d2 4f72a: 6000 00e8 braw 4f814 return RTEMS_INVALID_ADDRESS; *segment = NULL; 4f72e: 4294 clrl %a4@ if ( size == 0 ) 4f730: 4a82 tstl %d2 4f732: 6608 bnes 4f73c 4f734: 143c 0008 moveb #8,%d2 4f738: 6000 00da braw 4f814 return RTEMS_INVALID_SIZE; _RTEMS_Lock_allocator(); 4f73c: 2f39 0007 4f7a movel 74f7a <_RTEMS_Allocator_Mutex>,%sp@- 4f742: 4eb9 0005 17ec jsr 517ec <_API_Mutex_Lock> 4f748: 486e fffc pea %fp@(-4) 4f74c: 2f03 movel %d3,%sp@- 4f74e: 4879 0007 4dc6 pea 74dc6 <_Region_Information> executing = _Thread_Executing; 4f754: 2679 0007 4f82 moveal 74f82 <_Thread_Executing>,%a3 4f75a: 4eb9 0005 2ff8 jsr 52ff8 <_Objects_Get_no_protection> the_region = _Region_Get( id, &location ); switch ( location ) { 4f760: 4fef 0010 lea %sp@(16),%sp 4f764: 2440 moveal %d0,%a2 4f766: 4aae fffc tstl %fp@(-4) 4f76a: 6600 0098 bnew 4f804 <== ALWAYS TAKEN case OBJECTS_LOCAL: if ( size > the_region->maximum_segment_size ) 4f76e: b4aa 005c cmpl %a2@(92),%d2 4f772: 6306 blss 4f77a 4f774: 7408 moveq #8,%d2 4f776: 6000 008e braw 4f806 * @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 ); 4f77a: 42a7 clrl %sp@- 4f77c: 42a7 clrl %sp@- 4f77e: 2f02 movel %d2,%sp@- 4f780: 486a 0068 pea %a2@(104) 4f784: 4eb9 0005 22b8 jsr 522b8 <_Heap_Allocate_aligned_with_boundary> the_segment = _Region_Allocate_segment( the_region, size ); _Region_Debug_Walk( the_region, 2 ); if ( the_segment ) { 4f78a: 4fef 0010 lea %sp@(16),%sp 4f78e: 4a80 tstl %d0 4f790: 670a beqs 4f79c the_region->number_of_used_blocks += 1; 4f792: 52aa 0064 addql #1,%a2@(100) *segment = the_segment; 4f796: 4282 clrl %d2 4f798: 2880 movel %d0,%a4@ 4f79a: 606a bras 4f806 <== ALWAYS TAKEN return_status = RTEMS_SUCCESSFUL; } else if ( _Options_Is_no_wait( option_set ) ) { 4f79c: 202e 0010 movel %fp@(16),%d0 4f7a0: 0800 0000 btst #0,%d0 4f7a4: 6704 beqs 4f7aa 4f7a6: 740d moveq #13,%d2 4f7a8: 605c bras 4f806 <== ALWAYS TAKEN rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 4f7aa: 2039 0007 4ec8 movel 74ec8 <_Thread_Dispatch_disable_level>,%d0 4f7b0: 5280 addql #1,%d0 4f7b2: 23c0 0007 4ec8 movel %d0,74ec8 <_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(); 4f7b8: 2f39 0007 4f7a movel 74f7a <_RTEMS_Allocator_Mutex>,%sp@- 4f7be: 4eb9 0005 184c jsr 5184c <_API_Mutex_Unlock> executing->Wait.queue = &the_region->Wait_queue; 4f7c4: 200a movel %a2,%d0 4f7c6: 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; 4f7cc: 7201 moveq #1,%d1 executing->Wait.id = id; executing->Wait.count = size; 4f7ce: 2742 0024 movel %d2,%a3@(36) 4f7d2: 2541 0040 movel %d1,%a2@(64) * because this thread is going to block. */ _Thread_Disable_dispatch(); _RTEMS_Unlock_allocator(); executing->Wait.queue = &the_region->Wait_queue; 4f7d6: 2740 0044 movel %d0,%a3@(68) executing->Wait.id = id; 4f7da: 2743 0020 movel %d3,%a3@(32) executing->Wait.count = size; executing->Wait.return_argument = segment; 4f7de: 274c 0028 movel %a4,%a3@(40) _Thread_queue_Enter_critical_section( &the_region->Wait_queue ); _Thread_queue_Enqueue( &the_region->Wait_queue, timeout ); 4f7e2: 4879 0005 405c pea 5405c <_Thread_queue_Timeout> 4f7e8: 2f2e 0014 movel %fp@(20),%sp@- 4f7ec: 2f00 movel %d0,%sp@- 4f7ee: 4eb9 0005 3d70 jsr 53d70 <_Thread_queue_Enqueue_with_handler> _Thread_Enable_dispatch(); 4f7f4: 4eb9 0005 38b6 jsr 538b6 <_Thread_Enable_dispatch> return (rtems_status_code) executing->Wait.return_code; 4f7fa: 242b 0034 movel %a3@(52),%d2 4f7fe: 4fef 0010 lea %sp@(16),%sp 4f802: 6010 bras 4f814 <== ALWAYS TAKEN 4f804: 7404 moveq #4,%d2 default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 4f806: 2f39 0007 4f7a movel 74f7a <_RTEMS_Allocator_Mutex>,%sp@- 4f80c: 4eb9 0005 184c jsr 5184c <_API_Mutex_Unlock> return return_status; 4f812: 588f addql #4,%sp } 4f814: 2002 movel %d2,%d0 4f816: 4cee 1c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a4 4f81c: 4e5e unlk %fp 4f81e: 4e75 rts 0004f820 : rtems_status_code rtems_region_get_segment_size( rtems_id id, void *segment, uintptr_t *size ) { 4f820: 4e56 fffc linkw %fp,#-4 4f824: 2f03 movel %d3,%sp@- 4f826: 262e 0010 movel %fp@(16),%d3 4f82a: 2f02 movel %d2,%sp@- 4f82c: 242e 000c movel %fp@(12),%d2 Objects_Locations location; rtems_status_code return_status = RTEMS_SUCCESSFUL; register Region_Control *the_region; if ( !segment ) 4f830: 6766 beqs 4f898 return RTEMS_INVALID_ADDRESS; if ( !size ) 4f832: 4a83 tstl %d3 4f834: 6762 beqs 4f898 return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); 4f836: 2f39 0007 4f7a movel 74f7a <_RTEMS_Allocator_Mutex>,%sp@- 4f83c: 4eb9 0005 17ec jsr 517ec <_API_Mutex_Lock> 4f842: 486e fffc pea %fp@(-4) 4f846: 2f2e 0008 movel %fp@(8),%sp@- 4f84a: 4879 0007 4dc6 pea 74dc6 <_Region_Information> 4f850: 4eb9 0005 2ff8 jsr 52ff8 <_Objects_Get_no_protection> the_region = _Region_Get( id, &location ); switch ( location ) { 4f856: 222e fffc movel %fp@(-4),%d1 4f85a: 4fef 0010 lea %sp@(16),%sp 4f85e: 670a beqs 4f86a 4f860: 7001 moveq #1,%d0 4f862: b081 cmpl %d1,%d0 4f864: 6620 bnes 4f886 <== ALWAYS TAKEN 4f866: 7404 moveq #4,%d2 4f868: 601e bras 4f888 <== ALWAYS TAKEN case OBJECTS_LOCAL: if ( !_Heap_Size_of_alloc_area( &the_region->Memory, segment, size ) ) 4f86a: 2f03 movel %d3,%sp@- 4f86c: 2040 moveal %d0,%a0 4f86e: 2f02 movel %d2,%sp@- 4f870: 4868 0068 pea %a0@(104) 4f874: 4eb9 0005 2a78 jsr 52a78 <_Heap_Size_of_alloc_area> 4f87a: 4fef 000c lea %sp@(12),%sp 4f87e: 4a00 tstb %d0 4f880: 6604 bnes 4f886 <== NEVER TAKEN 4f882: 7409 moveq #9,%d2 <== NOT EXECUTED 4f884: 6002 bras 4f888 <== NOT EXECUTED 4f886: 4282 clrl %d2 case OBJECTS_ERROR: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 4f888: 2f39 0007 4f7a movel 74f7a <_RTEMS_Allocator_Mutex>,%sp@- 4f88e: 4eb9 0005 184c jsr 5184c <_API_Mutex_Unlock> return return_status; 4f894: 588f addql #4,%sp 4f896: 6002 bras 4f89a <== ALWAYS TAKEN 4f898: 7409 moveq #9,%d2 } 4f89a: 2002 movel %d2,%d0 4f89c: 242e fff4 movel %fp@(-12),%d2 4f8a0: 262e fff8 movel %fp@(-8),%d3 4f8a4: 4e5e unlk %fp 4f8a6: 4e75 rts 0004f8d4 : rtems_id id, void *segment, uintptr_t size, uintptr_t *old_size ) { 4f8d4: 4e56 ffe8 linkw %fp,#-24 4f8d8: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 4f8dc: 266e 0014 moveal %fp@(20),%a3 uintptr_t osize; rtems_status_code return_status; Heap_Resize_status status; register Region_Control *the_region; if ( !old_size ) 4f8e0: 4a8b tstl %a3 4f8e2: 6700 008e beqw 4f972 return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); 4f8e6: 2f39 0007 4f7a movel 74f7a <_RTEMS_Allocator_Mutex>,%sp@- 4f8ec: 4eb9 0005 17ec jsr 517ec <_API_Mutex_Lock> 4f8f2: 486e fff8 pea %fp@(-8) 4f8f6: 2f2e 0008 movel %fp@(8),%sp@- 4f8fa: 4879 0007 4dc6 pea 74dc6 <_Region_Information> 4f900: 4eb9 0005 2ff8 jsr 52ff8 <_Objects_Get_no_protection> the_region = _Region_Get( id, &location ); switch ( location ) { 4f906: 4fef 0010 lea %sp@(16),%sp 4f90a: 2440 moveal %d0,%a2 4f90c: 4aae fff8 tstl %fp@(-8) 4f910: 664e bnes 4f960 case OBJECTS_LOCAL: _Region_Debug_Walk( the_region, 7 ); status = _Heap_Resize_block( 4f912: 486e fffc pea %fp@(-4) 4f916: 486e fff4 pea %fp@(-12) 4f91a: 2f2e 0010 movel %fp@(16),%sp@- 4f91e: 2f2e 000c movel %fp@(12),%sp@- 4f922: 486a 0068 pea %a2@(104) 4f926: 4eb9 0005 29a0 jsr 529a0 <_Heap_Resize_block> segment, (uint32_t) size, &osize, &avail_size ); *old_size = (uint32_t) osize; 4f92c: 26ae fff4 movel %fp@(-12),%a3@ case OBJECTS_LOCAL: _Region_Debug_Walk( the_region, 7 ); status = _Heap_Resize_block( 4f930: 2400 movel %d0,%d2 ); *old_size = (uint32_t) osize; _Region_Debug_Walk( the_region, 8 ); if ( status == HEAP_RESIZE_SUCCESSFUL ) 4f932: 4fef 0014 lea %sp@(20),%sp 4f936: 660e bnes 4f946 _Region_Process_queue( the_region ); /* unlocks allocator */ 4f938: 2f0a movel %a2,%sp@- 4f93a: 4eb9 0005 6ce8 jsr 56ce8 <_Region_Process_queue> 4f940: 588f addql #4,%sp 4f942: 4280 clrl %d0 4f944: 602e bras 4f974 <== ALWAYS TAKEN else _RTEMS_Unlock_allocator(); 4f946: 2f39 0007 4f7a movel 74f7a <_RTEMS_Allocator_Mutex>,%sp@- 4f94c: 4eb9 0005 184c jsr 5184c <_API_Mutex_Unlock> if (status == HEAP_RESIZE_SUCCESSFUL) return RTEMS_SUCCESSFUL; if (status == HEAP_RESIZE_UNSATISFIED) 4f952: 588f addql #4,%sp 4f954: 7001 moveq #1,%d0 4f956: b082 cmpl %d2,%d0 4f958: 6618 bnes 4f972 4f95a: 103c 000d moveb #13,%d0 4f95e: 6014 bras 4f974 <== ALWAYS TAKEN default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 4f960: 2f39 0007 4f7a movel 74f7a <_RTEMS_Allocator_Mutex>,%sp@- 4f966: 4eb9 0005 184c jsr 5184c <_API_Mutex_Unlock> return return_status; 4f96c: 588f addql #4,%sp default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 4f96e: 7004 moveq #4,%d0 return return_status; 4f970: 6002 bras 4f974 <== ALWAYS TAKEN 4f972: 7009 moveq #9,%d0 } 4f974: 4cee 0c04 ffe8 moveml %fp@(-24),%d2/%a2-%a3 4f97a: 4e5e unlk %fp 4f97c: 4e75 rts ... 0004f980 : rtems_status_code rtems_region_return_segment( rtems_id id, void *segment ) { 4f980: 4e56 fffc linkw %fp,#-4 4f984: 2f0a movel %a2,%sp@- 4f986: 2f02 movel %d2,%sp@- uint32_t size; #endif int status; register Region_Control *the_region; _RTEMS_Lock_allocator(); 4f988: 2f39 0007 4f7a movel 74f7a <_RTEMS_Allocator_Mutex>,%sp@- 4f98e: 4eb9 0005 17ec jsr 517ec <_API_Mutex_Lock> 4f994: 486e fffc pea %fp@(-4) 4f998: 2f2e 0008 movel %fp@(8),%sp@- 4f99c: 4879 0007 4dc6 pea 74dc6 <_Region_Information> 4f9a2: 4eb9 0005 2ff8 jsr 52ff8 <_Objects_Get_no_protection> the_region = _Region_Get( id, &location ); switch ( location ) { 4f9a8: 4fef 0010 lea %sp@(16),%sp 4f9ac: 2440 moveal %d0,%a2 4f9ae: 4aae fffc tstl %fp@(-4) 4f9b2: 6704 beqs 4f9b8 4f9b4: 7404 moveq #4,%d2 4f9b6: 6026 bras 4f9de <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE bool _Region_Free_segment ( Region_Control *the_region, void *the_segment ) { return _Heap_Free( &the_region->Memory, the_segment ); 4f9b8: 2f2e 000c movel %fp@(12),%sp@- 4f9bc: 486a 0068 pea %a2@(104) 4f9c0: 4eb9 0005 24a8 jsr 524a8 <_Heap_Free> #endif status = _Region_Free_segment( the_region, segment ); _Region_Debug_Walk( the_region, 4 ); if ( !status ) 4f9c6: 508f addql #8,%sp 4f9c8: 4a00 tstb %d0 4f9ca: 6710 beqs 4f9dc return_status = RTEMS_INVALID_ADDRESS; else { the_region->number_of_used_blocks -= 1; 4f9cc: 53aa 0064 subql #1,%a2@(100) _Region_Process_queue(the_region); /* unlocks allocator */ 4f9d0: 4282 clrl %d2 4f9d2: 2f0a movel %a2,%sp@- 4f9d4: 4eb9 0005 6ce8 jsr 56ce8 <_Region_Process_queue> 4f9da: 600e bras 4f9ea <== ALWAYS TAKEN return RTEMS_SUCCESSFUL; 4f9dc: 7409 moveq #9,%d2 default: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 4f9de: 2f39 0007 4f7a movel 74f7a <_RTEMS_Allocator_Mutex>,%sp@- 4f9e4: 4eb9 0005 184c jsr 5184c <_API_Mutex_Unlock> return return_status; } 4f9ea: 2002 movel %d2,%d0 return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); return return_status; 4f9ec: 588f addql #4,%sp } 4f9ee: 242e fff4 movel %fp@(-12),%d2 4f9f2: 246e fff8 moveal %fp@(-8),%a2 4f9f6: 4e5e unlk %fp 4f9f8: 4e75 rts ... 00044cf8 : uint32_t count, rtems_attribute attribute_set, rtems_task_priority priority_ceiling, rtems_id *id ) { 44cf8: 4e56 ffd0 linkw %fp,#-48 44cfc: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@ 44d00: 2a2e 0008 movel %fp@(8),%d5 44d04: 262e 000c movel %fp@(12),%d3 44d08: 242e 0010 movel %fp@(16),%d2 44d0c: 266e 0018 moveal %fp@(24),%a3 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 ) ) 44d10: 4a85 tstl %d5 44d12: 6606 bnes 44d1a 44d14: 7003 moveq #3,%d0 44d16: 6000 0172 braw 44e8a <== ALWAYS TAKEN return RTEMS_INVALID_NAME; if ( !id ) 44d1a: 4a8b tstl %a3 44d1c: 6606 bnes 44d24 44d1e: 7009 moveq #9,%d0 44d20: 6000 0168 braw 44e8a <== ALWAYS TAKEN * id - semaphore id * RTEMS_SUCCESSFUL - if successful * error code - if unsuccessful */ rtems_status_code rtems_semaphore_create( 44d24: 2002 movel %d2,%d0 44d26: 0280 0000 00c0 andil #192,%d0 return RTEMS_NOT_DEFINED; } else #endif if ( _Attributes_Is_inherit_priority( attribute_set ) || 44d2c: 671c beqs 44d4a _Attributes_Is_priority_ceiling( attribute_set ) ) { if ( ! (_Attributes_Is_binary_semaphore( attribute_set ) && 44d2e: 7230 moveq #48,%d1 44d30: 7810 moveq #16,%d4 44d32: c282 andl %d2,%d1 44d34: b881 cmpl %d1,%d4 44d36: 6600 0150 bnew 44e88 44d3a: 44c2 movew %d2,%ccr 44d3c: 6600 014a bnew 44e88 _Attributes_Is_priority( attribute_set ) ) ) return RTEMS_NOT_DEFINED; } if ( _Attributes_Is_inherit_priority( attribute_set ) && 44d40: 0c80 0000 00c0 cmpil #192,%d0 44d46: 6700 0140 beqw 44e88 */ RTEMS_INLINE_ROUTINE bool _Attributes_Is_counting_semaphore( rtems_attribute attribute_set ) { return ((attribute_set & RTEMS_SEMAPHORE_CLASS) == RTEMS_COUNTING_SEMAPHORE); 44d4a: 7830 moveq #48,%d4 44d4c: c882 andl %d2,%d4 _Attributes_Is_priority_ceiling( attribute_set ) ) return RTEMS_NOT_DEFINED; if ( !_Attributes_Is_counting_semaphore( attribute_set ) && ( count > 1 ) ) 44d4e: 670e beqs 44d5e 44d50: 7001 moveq #1,%d0 44d52: b083 cmpl %d3,%d0 44d54: 6408 bccs 44d5e 44d56: 103c 000a moveb #10,%d0 44d5a: 6000 012e braw 44e8a <== ALWAYS TAKEN rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 44d5e: 2039 0005 cec4 movel 5cec4 <_Thread_Dispatch_disable_level>,%d0 44d64: 5280 addql #1,%d0 44d66: 23c0 0005 cec4 movel %d0,5cec4 <_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 ); 44d6c: 4879 0005 cdfc pea 5cdfc <_Semaphore_Information> 44d72: 4eb9 0004 60a8 jsr 460a8 <_Objects_Allocate> _Thread_Disable_dispatch(); /* prevents deletion */ the_semaphore = _Semaphore_Allocate(); if ( !the_semaphore ) { 44d78: 588f addql #4,%sp 44d7a: 2440 moveal %d0,%a2 44d7c: 4a80 tstl %d0 44d7e: 660c bnes 44d8c _Thread_Enable_dispatch(); 44d80: 4eb9 0004 6cee jsr 46cee <_Thread_Enable_dispatch> 44d86: 7005 moveq #5,%d0 return RTEMS_TOO_MANY; 44d88: 6000 0100 braw 44e8a <== ALWAYS TAKEN 44d8c: 7004 moveq #4,%d0 _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; } #endif the_semaphore->attribute_set = attribute_set; 44d8e: 2542 0010 movel %d2,%a2@(16) 44d92: c082 andl %d2,%d0 /* * Initialize it as a counting semaphore. */ if ( _Attributes_Is_counting_semaphore( attribute_set ) ) { 44d94: 4a84 tstl %d4 44d96: 6632 bnes 44dca * 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; 44d98: 4a80 tstl %d0 44d9a: 57c0 seq %d0 * 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( 44d9c: 2f03 movel %d3,%sp@- 44d9e: 486e fff8 pea %fp@(-8) * 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; 44da2: 49c0 extbl %d0 * 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( 44da4: 486a 0014 pea %a2@(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; 44da8: 5280 addql #1,%d0 */ if ( _Attributes_Is_counting_semaphore( attribute_set ) ) { /* * This effectively disables limit checking. */ the_semaphore_attr.maximum_count = 0xFFFFFFFF; 44daa: 72ff moveq #-1,%d1 if ( _Attributes_Is_priority( attribute_set ) ) the_semaphore_attr.discipline = CORE_SEMAPHORE_DISCIPLINES_PRIORITY; 44dac: 2d40 fffc movel %d0,%fp@(-4) */ if ( _Attributes_Is_counting_semaphore( attribute_set ) ) { /* * This effectively disables limit checking. */ the_semaphore_attr.maximum_count = 0xFFFFFFFF; 44db0: 2d41 fff8 movel %d1,%fp@(-8) 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; 44db4: 42ae ffea clrl %fp@(-22) the_mutex_attr.priority_ceiling = PRIORITY_MINIMUM; 44db8: 42ae fff4 clrl %fp@(-12) _CORE_semaphore_Initialize( 44dbc: 4eb9 0004 5bd8 jsr 45bd8 <_CORE_semaphore_Initialize> 44dc2: 4fef 000c lea %sp@(12),%sp 44dc6: 6000 009e braw 44e66 <== ALWAYS TAKEN /* * 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; 44dca: 4a80 tstl %d0 44dcc: 57c0 seq %d0 44dce: 49c0 extbl %d0 44dd0: 5280 addql #1,%d0 44dd2: 2d40 fff0 movel %d0,%fp@(-16) else the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_FIFO; if ( _Attributes_Is_binary_semaphore( attribute_set ) ) { 44dd6: 7010 moveq #16,%d0 44dd8: b084 cmpl %d4,%d0 44dda: 6640 bnes 44e1c the_mutex_attr.priority_ceiling = priority_ceiling; the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES; 44ddc: 42ae ffea clrl %fp@(-22) the_mutex_attr.only_owner_release = false; if ( the_mutex_attr.discipline == CORE_MUTEX_DISCIPLINES_PRIORITY ) { 44de0: 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; 44de2: 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; 44de4: 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; 44dea: 1d41 ffee moveb %d1,%fp@(-18) if ( the_mutex_attr.discipline == CORE_MUTEX_DISCIPLINES_PRIORITY ) { 44dee: b8ae fff0 cmpl %fp@(-16),%d4 44df2: 6634 bnes 44e28 if ( _Attributes_Is_inherit_priority( attribute_set ) ) { 44df4: 0802 0006 btst #6,%d2 44df8: 6710 beqs 44e0a the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT; 44dfa: 103c 0002 moveb #2,%d0 the_mutex_attr.only_owner_release = true; 44dfe: 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; 44e00: 2d40 fff0 movel %d0,%fp@(-16) the_mutex_attr.only_owner_release = true; 44e04: 1d41 ffee moveb %d1,%fp@(-18) 44e08: 601e bras 44e28 <== ALWAYS TAKEN } else if ( _Attributes_Is_priority_ceiling( attribute_set ) ) { 44e0a: 4a02 tstb %d2 44e0c: 6c1a bges 44e28 the_mutex_attr.discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING; 44e0e: 7803 moveq #3,%d4 the_mutex_attr.only_owner_release = true; 44e10: 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; 44e12: 2d44 fff0 movel %d4,%fp@(-16) the_mutex_attr.only_owner_release = true; 44e16: 1d40 ffee moveb %d0,%fp@(-18) 44e1a: 600c bras 44e28 <== ALWAYS TAKEN } } } else /* must be simple binary semaphore */ { the_mutex_attr.lock_nesting_behavior = CORE_MUTEX_NESTING_BLOCKS; 44e1c: 7202 moveq #2,%d1 the_mutex_attr.only_owner_release = false; 44e1e: 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; 44e20: 2d41 ffea movel %d1,%fp@(-22) the_mutex_attr.only_owner_release = false; 44e24: 1d44 ffee moveb %d4,%fp@(-18) } mutex_status = _CORE_mutex_Initialize( 44e28: 7001 moveq #1,%d0 44e2a: b083 cmpl %d3,%d0 44e2c: 57c0 seq %d0 44e2e: 49c0 extbl %d0 44e30: 4480 negl %d0 44e32: 2f00 movel %d0,%sp@- 44e34: 486e ffea pea %fp@(-22) 44e38: 486a 0014 pea %a2@(20) 44e3c: 4eb9 0004 5920 jsr 45920 <_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 ) { 44e42: 4fef 000c lea %sp@(12),%sp 44e46: 7206 moveq #6,%d1 44e48: b280 cmpl %d0,%d1 44e4a: 661a bnes 44e66 */ RTEMS_INLINE_ROUTINE void _Semaphore_Free ( Semaphore_Control *the_semaphore ) { _Objects_Free( &_Semaphore_Information, &the_semaphore->Object ); 44e4c: 2f0a movel %a2,%sp@- 44e4e: 4879 0005 cdfc pea 5cdfc <_Semaphore_Information> 44e54: 4eb9 0004 639c jsr 4639c <_Objects_Free> _Semaphore_Free( the_semaphore ); _Thread_Enable_dispatch(); 44e5a: 4eb9 0004 6cee jsr 46cee <_Thread_Enable_dispatch> return RTEMS_INVALID_PRIORITY; 44e60: 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(); 44e62: 7013 moveq #19,%d0 return RTEMS_INVALID_PRIORITY; 44e64: 6024 bras 44e8a <== ALWAYS TAKEN #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 44e66: 202a 0008 movel %a2@(8),%d0 44e6a: 4281 clrl %d1 44e6c: 2079 0005 ce14 moveal 5ce14 <_Semaphore_Information+0x18>,%a0 44e72: 3200 movew %d0,%d1 information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 44e74: 2545 000c movel %d5,%a2@(12) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 44e78: 218a 1c00 movel %a2,%a0@(00000000,%d1:l:4) &_Semaphore_Information, &the_semaphore->Object, (Objects_Name) name ); *id = the_semaphore->Object.id; 44e7c: 2680 movel %d0,%a3@ the_semaphore->Object.id, name, 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); 44e7e: 4eb9 0004 6cee jsr 46cee <_Thread_Enable_dispatch> 44e84: 4280 clrl %d0 return RTEMS_SUCCESSFUL; 44e86: 6002 bras 44e8a <== ALWAYS TAKEN 44e88: 700b moveq #11,%d0 } 44e8a: 4cee 0c3c ffd0 moveml %fp@(-48),%d2-%d5/%a2-%a3 44e90: 4e5e unlk %fp 44e92: 4e75 rts 00044e94 : #endif rtems_status_code rtems_semaphore_delete( rtems_id id ) { 44e94: 4e56 fffc linkw %fp,#-4 44e98: 2f0a movel %a2,%sp@- RTEMS_INLINE_ROUTINE Semaphore_Control *_Semaphore_Get ( Objects_Id id, Objects_Locations *location ) { return (Semaphore_Control *) 44e9a: 486e fffc pea %fp@(-4) 44e9e: 2f2e 0008 movel %fp@(8),%sp@- 44ea2: 4879 0005 cdfc pea 5cdfc <_Semaphore_Information> 44ea8: 4eb9 0004 64f4 jsr 464f4 <_Objects_Get> register Semaphore_Control *the_semaphore; Objects_Locations location; the_semaphore = _Semaphore_Get( id, &location ); switch ( location ) { 44eae: 4fef 000c lea %sp@(12),%sp 44eb2: 2440 moveal %d0,%a2 44eb4: 4aae fffc tstl %fp@(-4) 44eb8: 6704 beqs 44ebe 44eba: 7004 moveq #4,%d0 44ebc: 606a bras 44f28 <== ALWAYS TAKEN 44ebe: 7030 moveq #48,%d0 44ec0: c0aa 0010 andl %a2@(16),%d0 case OBJECTS_LOCAL: if ( !_Attributes_Is_counting_semaphore(the_semaphore->attribute_set) ) { 44ec4: 6728 beqs 44eee if ( _CORE_mutex_Is_locked( &the_semaphore->Core_control.mutex ) && 44ec6: 4aaa 0062 tstl %a2@(98) 44eca: 6610 bnes 44edc 44ecc: 7220 moveq #32,%d1 44ece: b280 cmpl %d0,%d1 44ed0: 670a beqs 44edc !_Attributes_Is_simple_binary_semaphore( the_semaphore->attribute_set ) ) { _Thread_Enable_dispatch(); 44ed2: 4eb9 0004 6cee jsr 46cee <_Thread_Enable_dispatch> 44ed8: 700c moveq #12,%d0 return RTEMS_RESOURCE_IN_USE; 44eda: 604c bras 44f28 <== ALWAYS TAKEN } _CORE_mutex_Flush( 44edc: 4878 0004 pea 4 44ee0: 42a7 clrl %sp@- 44ee2: 486a 0014 pea %a2@(20) 44ee6: 4eb9 0004 5914 jsr 45914 <_CORE_mutex_Flush> 44eec: 6010 bras 44efe <== ALWAYS TAKEN &the_semaphore->Core_control.mutex, SEMAPHORE_MP_OBJECT_WAS_DELETED, CORE_MUTEX_WAS_DELETED ); } else { _CORE_semaphore_Flush( 44eee: 4878 0002 pea 2 44ef2: 42a7 clrl %sp@- 44ef4: 486a 0014 pea %a2@(20) 44ef8: 4eb9 0004 5bcc jsr 45bcc <_CORE_semaphore_Flush> SEMAPHORE_MP_OBJECT_WAS_DELETED, CORE_SEMAPHORE_WAS_DELETED ); } _Objects_Close( &_Semaphore_Information, &the_semaphore->Object ); 44efe: 508f addql #8,%sp 44f00: 2e8a movel %a2,%sp@ 44f02: 4879 0005 cdfc pea 5cdfc <_Semaphore_Information> 44f08: 4eb9 0004 6128 jsr 46128 <_Objects_Close> */ RTEMS_INLINE_ROUTINE void _Semaphore_Free ( Semaphore_Control *the_semaphore ) { _Objects_Free( &_Semaphore_Information, &the_semaphore->Object ); 44f0e: 2f0a movel %a2,%sp@- 44f10: 4879 0005 cdfc pea 5cdfc <_Semaphore_Information> 44f16: 4eb9 0004 639c jsr 4639c <_Objects_Free> 0, /* Not used */ 0 /* Not used */ ); } #endif _Thread_Enable_dispatch(); 44f1c: 4eb9 0004 6cee jsr 46cee <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 44f22: 4fef 0010 lea %sp@(16),%sp 0, /* Not used */ 0 /* Not used */ ); } #endif _Thread_Enable_dispatch(); 44f26: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 44f28: 246e fff8 moveal %fp@(-8),%a2 44f2c: 4e5e unlk %fp 44f2e: 4e75 rts 0004e6b4 : #endif rtems_status_code rtems_semaphore_flush( rtems_id id ) { 4e6b4: 4e56 fffc linkw %fp,#-4 4e6b8: 2f02 movel %d2,%sp@- 4e6ba: 486e fffc pea %fp@(-4) 4e6be: 2f2e 0008 movel %fp@(8),%sp@- 4e6c2: 4879 0006 2234 pea 62234 <_Semaphore_Information> 4e6c8: 4eb9 0004 7de4 jsr 47de4 <_Objects_Get> register Semaphore_Control *the_semaphore; Objects_Locations location; the_semaphore = _Semaphore_Get( id, &location ); switch ( location ) { 4e6ce: 4fef 000c lea %sp@(12),%sp 4e6d2: 4aae fffc tstl %fp@(-4) 4e6d6: 6704 beqs 4e6dc 4e6d8: 7004 moveq #4,%d0 4e6da: 603c bras 4e718 <== ALWAYS TAKEN case OBJECTS_LOCAL: if ( !_Attributes_Is_counting_semaphore(the_semaphore->attribute_set) ) { 4e6dc: 7430 moveq #48,%d2 4e6de: 2040 moveal %d0,%a0 4e6e0: 2200 movel %d0,%d1 4e6e2: 0681 0000 0014 addil #20,%d1 4e6e8: c4a8 0010 andl %a0@(16),%d2 4e6ec: 6710 beqs 4e6fe _CORE_mutex_Flush( 4e6ee: 4878 0001 pea 1 4e6f2: 42a7 clrl %sp@- 4e6f4: 2f01 movel %d1,%sp@- 4e6f6: 4eb9 0004 7198 jsr 47198 <_CORE_mutex_Flush> 4e6fc: 600e bras 4e70c <== ALWAYS TAKEN &the_semaphore->Core_control.mutex, SEND_OBJECT_WAS_DELETED, CORE_MUTEX_STATUS_UNSATISFIED_NOWAIT ); } else { _CORE_semaphore_Flush( 4e6fe: 4878 0001 pea 1 4e702: 42a7 clrl %sp@- 4e704: 2f01 movel %d1,%sp@- 4e706: 4eb9 0004 7450 jsr 47450 <_CORE_semaphore_Flush> 4e70c: 4fef 000c lea %sp@(12),%sp &the_semaphore->Core_control.semaphore, SEND_OBJECT_WAS_DELETED, CORE_SEMAPHORE_STATUS_UNSATISFIED_NOWAIT ); } _Thread_Enable_dispatch(); 4e710: 4eb9 0004 866e jsr 4866e <_Thread_Enable_dispatch> 4e716: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4e718: 242e fff8 movel %fp@(-8),%d2 4e71c: 4e5e unlk %fp 4e71e: 4e75 rts 00044f30 : rtems_status_code rtems_semaphore_obtain( rtems_id id, rtems_option option_set, rtems_interval timeout ) { 44f30: 4e56 ffec linkw %fp,#-20 44f34: 48d7 001c moveml %d2-%d4,%sp@ Objects_Id id, Objects_Locations *location, ISR_Level *level ) { return (Semaphore_Control *) 44f38: 486e fff8 pea %fp@(-8) 44f3c: 486e fffc pea %fp@(-4) 44f40: 242e 0008 movel %fp@(8),%d2 44f44: 2f02 movel %d2,%sp@- 44f46: 4879 0005 cdfc pea 5cdfc <_Semaphore_Information> 44f4c: 282e 000c movel %fp@(12),%d4 44f50: 262e 0010 movel %fp@(16),%d3 44f54: 4eb9 0004 649c jsr 4649c <_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 ) { 44f5a: 4fef 0010 lea %sp@(16),%sp 44f5e: 2040 moveal %d0,%a0 44f60: 4aae fffc tstl %fp@(-4) 44f64: 6706 beqs 44f6c 44f66: 7004 moveq #4,%d0 44f68: 6000 00c0 braw 4502a <== ALWAYS TAKEN case OBJECTS_LOCAL: if ( !_Attributes_Is_counting_semaphore(the_semaphore->attribute_set) ) { 44f6c: 7030 moveq #48,%d0 44f6e: c0a8 0010 andl %a0@(16),%d0 44f72: 6732 beqs 44fa6 _CORE_mutex_Seize( 44f74: 2f2e fff8 movel %fp@(-8),%sp@- 44f78: 7001 moveq #1,%d0 44f7a: c880 andl %d0,%d4 44f7c: 2f03 movel %d3,%sp@- 44f7e: b980 eorl %d4,%d0 44f80: 2f00 movel %d0,%sp@- 44f82: 2f02 movel %d2,%sp@- 44f84: 4868 0014 pea %a0@(20) 44f88: 4eb9 0004 5a2c jsr 45a2c <_CORE_mutex_Seize> id, ((_Options_Is_no_wait( option_set )) ? false : true), timeout, level ); return _Semaphore_Translate_core_mutex_return_code( 44f8e: 2079 0005 cf7e moveal 5cf7e <_Thread_Executing>,%a0 44f94: 2f28 0034 movel %a0@(52),%sp@- 44f98: 4eb9 0004 50b8 jsr 450b8 <_Semaphore_Translate_core_mutex_return_code> 44f9e: 4fef 0018 lea %sp@(24),%sp 44fa2: 6000 0086 braw 4502a <== ALWAYS TAKEN { Thread_Control *executing; /* disabled when you get here */ executing = _Thread_Executing; 44fa6: 2279 0005 cf7e moveal 5cf7e <_Thread_Executing>,%a1 executing->Wait.return_code = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 44fac: 42a9 0034 clrl %a1@(52) if ( the_semaphore->count != 0 ) { 44fb0: 2028 005c movel %a0@(92),%d0 44fb4: 670e beqs 44fc4 the_semaphore->count -= 1; 44fb6: 5380 subql #1,%d0 44fb8: 2140 005c movel %d0,%a0@(92) _ISR_Enable( *level_p ); 44fbc: 202e fff8 movel %fp@(-8),%d0 44fc0: 46c0 movew %d0,%sr 44fc2: 6054 bras 45018 <== ALWAYS TAKEN return; } if ( !wait ) { 44fc4: 0804 0000 btst #0,%d4 44fc8: 670e beqs 44fd8 _ISR_Enable( *level_p ); 44fca: 202e fff8 movel %fp@(-8),%d0 44fce: 46c0 movew %d0,%sr executing->Wait.return_code = CORE_SEMAPHORE_STATUS_UNSATISFIED_NOWAIT; 44fd0: 7001 moveq #1,%d0 44fd2: 2340 0034 movel %d0,%a1@(52) 44fd6: 6040 bras 45018 <== ALWAYS TAKEN 44fd8: 2039 0005 cec4 movel 5cec4 <_Thread_Dispatch_disable_level>,%d0 44fde: 5280 addql #1,%d0 44fe0: 23c0 0005 cec4 movel %d0,5cec4 <_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; 44fe6: 7001 moveq #1,%d0 44fe8: 2140 0044 movel %d0,%a0@(68) return; } _Thread_Disable_dispatch(); _Thread_queue_Enter_critical_section( &the_semaphore->Wait_queue ); executing->Wait.queue = &the_semaphore->Wait_queue; 44fec: 41e8 0014 lea %a0@(20),%a0 executing->Wait.id = id; 44ff0: 2342 0020 movel %d2,%a1@(32) return; } _Thread_Disable_dispatch(); _Thread_queue_Enter_critical_section( &the_semaphore->Wait_queue ); executing->Wait.queue = &the_semaphore->Wait_queue; 44ff4: 2348 0044 movel %a0,%a1@(68) executing->Wait.id = id; _ISR_Enable( *level_p ); 44ff8: 202e fff8 movel %fp@(-8),%d0 44ffc: 46c0 movew %d0,%sr _Thread_queue_Enqueue( &the_semaphore->Wait_queue, timeout ); 44ffe: 4879 0004 7464 pea 47464 <_Thread_queue_Timeout> 45004: 2f03 movel %d3,%sp@- 45006: 2f08 movel %a0,%sp@- 45008: 4eb9 0004 7178 jsr 47178 <_Thread_queue_Enqueue_with_handler> _Thread_Enable_dispatch(); 4500e: 4eb9 0004 6cee jsr 46cee <_Thread_Enable_dispatch> 45014: 4fef 000c lea %sp@(12),%sp id, ((_Options_Is_no_wait( option_set )) ? false : true), timeout, &level ); return _Semaphore_Translate_core_semaphore_return_code( 45018: 2079 0005 cf7e moveal 5cf7e <_Thread_Executing>,%a0 4501e: 2f28 0034 movel %a0@(52),%sp@- 45022: 4eb9 0004 50ce jsr 450ce <_Semaphore_Translate_core_semaphore_return_code> 45028: 588f addql #4,%sp break; } return RTEMS_INVALID_ID; } 4502a: 4cee 001c ffec moveml %fp@(-20),%d2-%d4 45030: 4e5e unlk %fp 45032: 4e75 rts 00045034 : #endif rtems_status_code rtems_semaphore_release( rtems_id id ) { 45034: 4e56 fff0 linkw %fp,#-16 45038: 48d7 040c moveml %d2-%d3/%a2,%sp@ RTEMS_INLINE_ROUTINE Semaphore_Control *_Semaphore_Get ( Objects_Id id, Objects_Locations *location ) { return (Semaphore_Control *) 4503c: 486e fffc pea %fp@(-4) 45040: 242e 0008 movel %fp@(8),%d2 45044: 2f02 movel %d2,%sp@- 45046: 4879 0005 cdfc pea 5cdfc <_Semaphore_Information> 4504c: 4eb9 0004 64f4 jsr 464f4 <_Objects_Get> Objects_Locations location; CORE_mutex_Status mutex_status; CORE_semaphore_Status semaphore_status; the_semaphore = _Semaphore_Get( id, &location ); switch ( location ) { 45052: 4fef 000c lea %sp@(12),%sp 45056: 4aae fffc tstl %fp@(-4) 4505a: 6704 beqs 45060 4505c: 7004 moveq #4,%d0 4505e: 604e bras 450ae <== ALWAYS TAKEN case OBJECTS_LOCAL: if ( !_Attributes_Is_counting_semaphore(the_semaphore->attribute_set) ) { 45060: 7630 moveq #48,%d3 45062: 2040 moveal %d0,%a0 45064: 2200 movel %d0,%d1 45066: 0681 0000 0014 addil #20,%d1 4506c: 45f9 0004 6cee lea 46cee <_Thread_Enable_dispatch>,%a2 45072: c6a8 0010 andl %a0@(16),%d3 45076: 671a beqs 45092 mutex_status = _CORE_mutex_Surrender( 45078: 42a7 clrl %sp@- 4507a: 2f02 movel %d2,%sp@- 4507c: 2f01 movel %d1,%sp@- 4507e: 4eb9 0004 5ad4 jsr 45ad4 <_CORE_mutex_Surrender> 45084: 2400 movel %d0,%d2 &the_semaphore->Core_control.mutex, id, MUTEX_MP_SUPPORT ); _Thread_Enable_dispatch(); 45086: 4e92 jsr %a2@ return _Semaphore_Translate_core_mutex_return_code( mutex_status ); 45088: 2f02 movel %d2,%sp@- 4508a: 4eb9 0004 50b8 jsr 450b8 <_Semaphore_Translate_core_mutex_return_code> 45090: 6018 bras 450aa <== ALWAYS TAKEN } else { semaphore_status = _CORE_semaphore_Surrender( 45092: 42a7 clrl %sp@- 45094: 2f02 movel %d2,%sp@- 45096: 2f01 movel %d1,%sp@- 45098: 4eb9 0004 5c20 jsr 45c20 <_CORE_semaphore_Surrender> 4509e: 2400 movel %d0,%d2 &the_semaphore->Core_control.semaphore, id, MUTEX_MP_SUPPORT ); _Thread_Enable_dispatch(); 450a0: 4e92 jsr %a2@ return _Semaphore_Translate_core_semaphore_return_code( semaphore_status ); 450a2: 2f02 movel %d2,%sp@- 450a4: 4eb9 0004 50ce jsr 450ce <_Semaphore_Translate_core_semaphore_return_code> &the_semaphore->Core_control.semaphore, id, MUTEX_MP_SUPPORT ); _Thread_Enable_dispatch(); return 450aa: 4fef 0010 lea %sp@(16),%sp case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 450ae: 4cee 040c fff0 moveml %fp@(-16),%d2-%d3/%a2 450b4: 4e5e unlk %fp 450b6: 4e75 rts 00045560 : void rtems_shutdown_executive( uint32_t result ) { if ( !_System_state_Is_shutdown( _System_state_Get() ) ) { 45560: 7004 moveq #4,%d0 */ void rtems_shutdown_executive( uint32_t result ) { 45562: 4e56 0000 linkw %fp,#0 if ( !_System_state_Is_shutdown( _System_state_Get() ) ) { 45566: b0b9 0005 d04c cmpl 5d04c <_System_state_Current>,%d0 4556c: 6726 beqs 45594 * 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 ); 4556e: 2039 0005 cec0 movel 5cec0 <_Thread_BSP_context+0x30>,%d0 45574: 2239 0005 ce90 movel 5ce90 <_Thread_BSP_context>,%d1 4557a: 46c1 movew %d1,%sr 4557c: 2e40 moveal %d0,%sp 4557e: 4e75 rts 45580: 23c0 0005 cec0 movel %d0,5cec0 <_Thread_BSP_context+0x30> <== NOT EXECUTED 45586: 7004 moveq #4,%d0 <== NOT EXECUTED 45588: 23c1 0005 ce90 movel %d1,5ce90 <_Thread_BSP_context> <== NOT EXECUTED 4558e: 23c0 0005 d04c movel %d0,5d04c <_System_state_Current> <== NOT EXECUTED _System_state_Set( SYSTEM_STATE_SHUTDOWN ); _Thread_Stop_multitasking(); } } 45594: 4e5e unlk %fp 45596: 4e75 rts 00045d94 : rtems_status_code rtems_signal_catch( rtems_asr_entry asr_handler, rtems_mode mode_set ) { 45d94: 4e56 0000 linkw %fp,#0 45d98: 2239 0005 e1dc movel 5e1dc <_Thread_Dispatch_disable_level>,%d1 45d9e: 5281 addql #1,%d1 RTEMS_API_Control *api; ASR_Information *asr; /* XXX normalize mode */ executing = _Thread_Executing; api = (RTEMS_API_Control*)executing->API_Extensions[ THREAD_API_RTEMS ]; 45da0: 2079 0005 e296 moveal 5e296 <_Thread_Executing>,%a0 rtems_status_code rtems_signal_catch( rtems_asr_entry asr_handler, rtems_mode mode_set ) { 45da6: 202e 0008 movel %fp@(8),%d0 RTEMS_API_Control *api; ASR_Information *asr; /* XXX normalize mode */ executing = _Thread_Executing; api = (RTEMS_API_Control*)executing->API_Extensions[ THREAD_API_RTEMS ]; 45daa: 2068 010a moveal %a0@(266),%a0 45dae: 23c1 0005 e1dc movel %d1,5e1dc <_Thread_Dispatch_disable_level> asr = &api->Signal; _Thread_Disable_dispatch(); /* cannot reschedule while */ /* the thread is inconsistent */ if ( !_ASR_Is_null_handler( asr_handler ) ) { 45db4: 4a80 tstl %d0 45db6: 670c beqs 45dc4 asr->mode_set = mode_set; asr->handler = asr_handler; 45db8: 2140 000a movel %d0,%a0@(10) _Thread_Disable_dispatch(); /* cannot reschedule while */ /* the thread is inconsistent */ if ( !_ASR_Is_null_handler( asr_handler ) ) { asr->mode_set = mode_set; 45dbc: 216e 000c 000e movel %fp@(12),%a0@(14) 45dc2: 601a bras 45dde <== ALWAYS TAKEN information->is_enabled = false; information->handler = NULL; information->mode_set = RTEMS_DEFAULT_MODES; information->signals_posted = 0; information->signals_pending = 0; information->nest_level = 0; 45dc4: 42a8 001a clrl %a0@(26) */ RTEMS_INLINE_ROUTINE void _ASR_Initialize ( ASR_Information *information ) { information->is_enabled = false; 45dc8: 4200 clrb %d0 information->handler = NULL; 45dca: 42a8 000a clrl %a0@(10) */ RTEMS_INLINE_ROUTINE void _ASR_Initialize ( ASR_Information *information ) { information->is_enabled = false; 45dce: 1140 0008 moveb %d0,%a0@(8) information->handler = NULL; information->mode_set = RTEMS_DEFAULT_MODES; 45dd2: 42a8 000e clrl %a0@(14) information->signals_posted = 0; 45dd6: 42a8 0012 clrl %a0@(18) information->signals_pending = 0; 45dda: 42a8 0016 clrl %a0@(22) asr->handler = asr_handler; } else _ASR_Initialize( asr ); _Thread_Enable_dispatch(); 45dde: 4eb9 0004 7c3e jsr 47c3e <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; } 45de4: 4280 clrl %d0 45de6: 4e5e unlk %fp 45de8: 4e75 rts ... 0004feb8 : rtems_status_code rtems_signal_send( rtems_id id, rtems_signal_set signal_set ) { 4feb8: 4e56 fffc linkw %fp,#-4 4febc: 2f03 movel %d3,%sp@- 4febe: 2f02 movel %d2,%sp@- 4fec0: 242e 000c movel %fp@(12),%d2 register Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; ASR_Information *asr; if ( !signal_set ) 4fec4: 6606 bnes 4fecc 4fec6: 700a moveq #10,%d0 4fec8: 6000 0084 braw 4ff4e <== ALWAYS TAKEN return RTEMS_INVALID_NUMBER; the_thread = _Thread_Get( id, &location ); 4fecc: 486e fffc pea %fp@(-4) 4fed0: 2f2e 0008 movel %fp@(8),%sp@- 4fed4: 4eb9 0005 390c jsr 5390c <_Thread_Get> switch ( location ) { 4feda: 508f addql #8,%sp 4fedc: 4aae fffc tstl %fp@(-4) 4fee0: 6704 beqs 4fee6 4fee2: 7004 moveq #4,%d0 4fee4: 6068 bras 4ff4e <== ALWAYS TAKEN case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; 4fee6: 2240 moveal %d0,%a1 4fee8: 2069 010a moveal %a1@(266),%a0 asr = &api->Signal; 4feec: 4aa8 000a tstl %a0@(10) 4fef0: 6754 beqs 4ff46 if ( ! _ASR_Is_null_handler( asr->handler ) ) { if ( asr->is_enabled ) { 4fef2: 4a28 0008 tstb %a0@(8) 4fef6: 6732 beqs 4ff2a rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 4fef8: 223c 0000 0700 movel #1792,%d1 4fefe: 40c3 movew %sr,%d3 4ff00: 8283 orl %d3,%d1 4ff02: 46c1 movew %d1,%sr *signal_set |= signals; 4ff04: 85a8 0012 orl %d2,%a0@(18) _ISR_Enable( _level ); 4ff08: 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 ) ) 4ff0a: 2239 0007 4f62 movel 74f62 <_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; 4ff10: 7401 moveq #1,%d2 4ff12: 1342 0074 moveb %d2,%a1@(116) if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 4ff16: 4a81 tstl %d1 4ff18: 6722 beqs 4ff3c 4ff1a: b0b9 0007 4f82 cmpl 74f82 <_Thread_Executing>,%d0 4ff20: 661a bnes 4ff3c <== ALWAYS TAKEN _ISR_Signals_to_thread_executing = true; 4ff22: 13c2 0007 5010 moveb %d2,75010 <_ISR_Signals_to_thread_executing> 4ff28: 6012 bras 4ff3c <== ALWAYS TAKEN rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 4ff2a: 203c 0000 0700 movel #1792,%d0 4ff30: 40c1 movew %sr,%d1 4ff32: 8081 orl %d1,%d0 4ff34: 46c0 movew %d0,%sr *signal_set |= signals; 4ff36: 85a8 0016 orl %d2,%a0@(22) _ISR_Enable( _level ); 4ff3a: 46c1 movew %d1,%sr } else { _ASR_Post_signals( signal_set, &asr->signals_pending ); } _Thread_Enable_dispatch(); 4ff3c: 4eb9 0005 38b6 jsr 538b6 <_Thread_Enable_dispatch> 4ff42: 4280 clrl %d0 return RTEMS_SUCCESSFUL; 4ff44: 6008 bras 4ff4e <== ALWAYS TAKEN } _Thread_Enable_dispatch(); 4ff46: 4eb9 0005 38b6 jsr 538b6 <_Thread_Enable_dispatch> 4ff4c: 700b moveq #11,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4ff4e: 242e fff4 movel %fp@(-12),%d2 4ff52: 262e fff8 movel %fp@(-8),%d3 4ff56: 4e5e unlk %fp 4ff58: 4e75 rts ... 000450e4 : size_t stack_size, rtems_mode initial_modes, rtems_attribute attribute_set, rtems_id *id ) { 450e4: 4e56 ffe4 linkw %fp,#-28 450e8: 48d7 1c3c moveml %d2-%d5/%a2-%a4,%sp@ 450ec: 266e 0008 moveal %fp@(8),%a3 450f0: 262e 000c movel %fp@(12),%d3 450f4: 242e 0014 movel %fp@(20),%d2 450f8: 282e 0018 movel %fp@(24),%d4 450fc: 286e 001c moveal %fp@(28),%a4 Priority_Control core_priority; RTEMS_API_Control *api; ASR_Information *asr; if ( !id ) 45100: 4a8c tstl %a4 45102: 6606 bnes 4510a 45104: 7009 moveq #9,%d0 45106: 6000 00f6 braw 451fe return RTEMS_INVALID_ADDRESS; if ( !rtems_is_name_valid( name ) ) 4510a: 4a8b tstl %a3 4510c: 6606 bnes 45114 4510e: 7003 moveq #3,%d0 45110: 6000 00ec braw 451fe /* * Validate the RTEMS API priority and convert it to the core priority range. */ if ( !_Attributes_Is_system_task( the_attribute_set ) ) { 45114: 4a44 tstw %d4 45116: 6d1e blts 45136 */ RTEMS_INLINE_ROUTINE bool _RTEMS_tasks_Priority_is_valid ( rtems_task_priority the_priority ) { return ( ( the_priority >= RTEMS_MINIMUM_PRIORITY ) && 45118: 4a83 tstl %d3 4511a: 6714 beqs 45130 4511c: 4280 clrl %d0 4511e: 1039 0005 b712 moveb 5b712 ,%d0 45124: b083 cmpl %d3,%d0 45126: 54c0 scc %d0 45128: 49c0 extbl %d0 4512a: 4480 negl %d0 if ( !_RTEMS_tasks_Priority_is_valid( initial_priority ) ) 4512c: 4a00 tstb %d0 4512e: 6606 bnes 45136 45130: 7013 moveq #19,%d0 45132: 6000 00ca braw 451fe */ /* * Lock the allocator mutex for protection */ _RTEMS_Lock_allocator(); 45136: 2f39 0005 cf76 movel 5cf76 <_RTEMS_Allocator_Mutex>,%sp@- 4513c: 4eb9 0004 5848 jsr 45848 <_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 ); 45142: 4879 0005 ce36 pea 5ce36 <_RTEMS_tasks_Information> 45148: 4eb9 0004 60a8 jsr 460a8 <_Objects_Allocate> * the event of an error. */ the_thread = _RTEMS_tasks_Allocate(); if ( !the_thread ) { 4514e: 508f addql #8,%sp 45150: 2440 moveal %d0,%a2 45152: 4a80 tstl %d0 45154: 6614 bnes 4516a _RTEMS_Unlock_allocator(); 45156: 2f39 0005 cf76 movel 5cf76 <_RTEMS_Allocator_Mutex>,%sp@- 4515c: 4eb9 0004 58a8 jsr 458a8 <_API_Mutex_Unlock> return RTEMS_TOO_MANY; 45162: 588f addql #4,%sp */ the_thread = _RTEMS_tasks_Allocate(); if ( !the_thread ) { _RTEMS_Unlock_allocator(); 45164: 7005 moveq #5,%d0 return RTEMS_TOO_MANY; 45166: 6000 0096 braw 451fe <== ALWAYS TAKEN /* * Initialize the core thread for this task. */ status = _Thread_Initialize( 4516a: 7a07 moveq #7,%d5 4516c: 7009 moveq #9,%d0 4516e: 2202 movel %d2,%d1 45170: e0a9 lsrl %d0,%d1 45172: 2002 movel %d2,%d0 45174: e088 lsrl #8,%d0 45176: 2f0b movel %a3,%sp@- 45178: 47f9 0004 58a8 lea 458a8 <_API_Mutex_Unlock>,%a3 4517e: ca82 andl %d2,%d5 45180: 2f05 movel %d5,%sp@- 45182: 7a01 moveq #1,%d5 45184: 42a7 clrl %sp@- 45186: ca81 andl %d1,%d5 45188: 7201 moveq #1,%d1 4518a: 2f05 movel %d5,%sp@- 4518c: 7a01 moveq #1,%d5 4518e: b380 eorl %d1,%d0 45190: ca80 andl %d0,%d5 45192: 7001 moveq #1,%d0 45194: 2f05 movel %d5,%sp@- 45196: c084 andl %d4,%d0 45198: 2f03 movel %d3,%sp@- 4519a: 2f00 movel %d0,%sp@- 4519c: 2f2e 0010 movel %fp@(16),%sp@- 451a0: 42a7 clrl %sp@- 451a2: 2f0a movel %a2,%sp@- 451a4: 4879 0005 ce36 pea 5ce36 <_RTEMS_tasks_Information> 451aa: 4eb9 0004 6da0 jsr 46da0 <_Thread_Initialize> NULL, /* no budget algorithm callout */ _Modes_Get_interrupt_level(initial_modes), (Objects_Name) name ); if ( !status ) { 451b0: 4fef 002c lea %sp@(44),%sp 451b4: 4a00 tstb %d0 451b6: 6624 bnes 451dc */ RTEMS_INLINE_ROUTINE void _RTEMS_tasks_Free ( Thread_Control *the_task ) { _Objects_Free( 451b8: 2f2a 0008 movel %a2@(8),%sp@- 451bc: 4eb9 0004 6420 jsr 46420 <_Objects_Get_information_id> 451c2: 2f0a movel %a2,%sp@- 451c4: 2f00 movel %d0,%sp@- 451c6: 4eb9 0004 639c jsr 4639c <_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(); 451cc: 2f39 0005 cf76 movel 5cf76 <_RTEMS_Allocator_Mutex>,%sp@- 451d2: 4e93 jsr %a3@ return RTEMS_UNSATISFIED; 451d4: 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(); 451d8: 700d moveq #13,%d0 return RTEMS_UNSATISFIED; 451da: 6022 bras 451fe <== ALWAYS TAKEN } api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; asr->is_enabled = _Modes_Is_asr_disabled(initial_modes) ? false : true; 451dc: 720a moveq #10,%d1 451de: e2aa lsrl %d1,%d2 451e0: 7a01 moveq #1,%d5 451e2: bb82 eorl %d5,%d2 451e4: 206a 010a moveal %a2@(266),%a0 451e8: c485 andl %d5,%d2 *id = the_thread->Object.id; 451ea: 28aa 0008 movel %a2@(8),%a4@ } api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; asr->is_enabled = _Modes_Is_asr_disabled(initial_modes) ? false : true; 451ee: 1142 0008 moveb %d2,%a0@(8) ); } #endif _RTEMS_Unlock_allocator(); 451f2: 2f39 0005 cf76 movel 5cf76 <_RTEMS_Allocator_Mutex>,%sp@- 451f8: 4e93 jsr %a3@ return RTEMS_SUCCESSFUL; 451fa: 588f addql #4,%sp ); } #endif _RTEMS_Unlock_allocator(); 451fc: 4280 clrl %d0 return RTEMS_SUCCESSFUL; } 451fe: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4 45204: 4e5e unlk %fp 45206: 4e75 rts 00045208 : */ rtems_status_code rtems_task_delete( rtems_id id ) { 45208: 4e56 fff0 linkw %fp,#-16 4520c: 48d7 1c00 moveml %a2-%a4,%sp@ register Thread_Control *the_thread; Objects_Locations location; Objects_Information *the_information; _RTEMS_Lock_allocator(); 45210: 2f39 0005 cf76 movel 5cf76 <_RTEMS_Allocator_Mutex>,%sp@- 45216: 47f9 0004 58a8 lea 458a8 <_API_Mutex_Unlock>,%a3 4521c: 4eb9 0004 5848 jsr 45848 <_API_Mutex_Lock> the_thread = _Thread_Get( id, &location ); 45222: 486e fffc pea %fp@(-4) 45226: 2f2e 0008 movel %fp@(8),%sp@- 4522a: 4eb9 0004 6d14 jsr 46d14 <_Thread_Get> switch ( location ) { 45230: 4fef 000c lea %sp@(12),%sp Objects_Locations location; Objects_Information *the_information; _RTEMS_Lock_allocator(); the_thread = _Thread_Get( id, &location ); 45234: 2440 moveal %d0,%a2 switch ( location ) { 45236: 4aae fffc tstl %fp@(-4) 4523a: 663c bnes 45278 case OBJECTS_LOCAL: the_information = _Objects_Get_information_id( the_thread->Object.id ); 4523c: 2f2a 0008 movel %a2@(8),%sp@- 45240: 49f9 0004 6420 lea 46420 <_Objects_Get_information_id>,%a4 45246: 4e94 jsr %a4@ 0 /* Not used */ ); } #endif _Thread_Close( the_information, the_thread ); 45248: 2f0a movel %a2,%sp@- 4524a: 2f00 movel %d0,%sp@- 4524c: 4eb9 0004 69e0 jsr 469e0 <_Thread_Close> 45252: 2f2a 0008 movel %a2@(8),%sp@- 45256: 4e94 jsr %a4@ 45258: 2f0a movel %a2,%sp@- 4525a: 2f00 movel %d0,%sp@- 4525c: 4eb9 0004 639c jsr 4639c <_Objects_Free> _RTEMS_tasks_Free( the_thread ); _RTEMS_Unlock_allocator(); 45262: 2f39 0005 cf76 movel 5cf76 <_RTEMS_Allocator_Mutex>,%sp@- 45268: 4e93 jsr %a3@ _Thread_Enable_dispatch(); 4526a: 4eb9 0004 6cee jsr 46cee <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 45270: 4fef 001c lea %sp@(28),%sp _Thread_Close( the_information, the_thread ); _RTEMS_tasks_Free( the_thread ); _RTEMS_Unlock_allocator(); _Thread_Enable_dispatch(); 45274: 4280 clrl %d0 return RTEMS_SUCCESSFUL; 45276: 600c bras 45284 <== ALWAYS TAKEN case OBJECTS_ERROR: break; } _RTEMS_Unlock_allocator(); 45278: 2f39 0005 cf76 movel 5cf76 <_RTEMS_Allocator_Mutex>,%sp@- 4527e: 4e93 jsr %a3@ return RTEMS_INVALID_ID; 45280: 588f addql #4,%sp case OBJECTS_ERROR: break; } _RTEMS_Unlock_allocator(); 45282: 7004 moveq #4,%d0 return RTEMS_INVALID_ID; } 45284: 4cee 1c00 fff0 moveml %fp@(-16),%a2-%a4 4528a: 4e5e unlk %fp 4528c: 4e75 rts ... 00046890 : rtems_status_code rtems_task_get_note( rtems_id id, uint32_t notepad, uint32_t *note ) { 46890: 4e56 fffc linkw %fp,#-4 46894: 202e 0008 movel %fp@(8),%d0 46898: 2f0a movel %a2,%sp@- 4689a: 246e 0010 moveal %fp@(16),%a2 4689e: 2f02 movel %d2,%sp@- 468a0: 242e 000c movel %fp@(12),%d2 register Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; if ( !rtems_configuration_get_notepads_enabled() ) 468a4: 4a39 0005 dc84 tstb 5dc84 468aa: 6604 bnes 468b0 468ac: 7016 moveq #22,%d0 468ae: 605e bras 4690e <== ALWAYS TAKEN return RTEMS_NOT_CONFIGURED; if ( !note ) 468b0: 4a8a tstl %a2 468b2: 6604 bnes 468b8 468b4: 7009 moveq #9,%d0 468b6: 6056 bras 4690e <== ALWAYS TAKEN /* * NOTE: There is no check for < RTEMS_NOTEPAD_FIRST because that would * be checking an unsigned number for being negative. */ if ( notepad > RTEMS_NOTEPAD_LAST ) 468b8: 720f moveq #15,%d1 468ba: b282 cmpl %d2,%d1 468bc: 6404 bccs 468c2 468be: 700a moveq #10,%d0 468c0: 604c bras 4690e <== ALWAYS TAKEN /* * Optimize the most likely case to avoid the Thread_Dispatch. */ if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) || 468c2: 4a80 tstl %d0 468c4: 670c beqs 468d2 _Objects_Are_ids_equal( id, _Thread_Executing->Object.id ) ) { 468c6: 2079 0005 f78e moveal 5f78e <_Thread_Executing>,%a0 468cc: b0a8 0008 cmpl %a0@(8),%d0 468d0: 6612 bnes 468e4 api = _Thread_Executing->API_Extensions[ THREAD_API_RTEMS ]; *note = api->Notepads[ notepad ]; 468d2: 2079 0005 f78e moveal 5f78e <_Thread_Executing>,%a0 468d8: 4280 clrl %d0 468da: 2068 010a moveal %a0@(266),%a0 468de: 24b0 2c1e movel %a0@(0000001e,%d2:l:4),%a2@ return RTEMS_SUCCESSFUL; 468e2: 602a bras 4690e <== ALWAYS TAKEN } the_thread = _Thread_Get( id, &location ); 468e4: 486e fffc pea %fp@(-4) 468e8: 2f00 movel %d0,%sp@- 468ea: 4eb9 0004 85dc jsr 485dc <_Thread_Get> switch ( location ) { 468f0: 508f addql #8,%sp 468f2: 4aae fffc tstl %fp@(-4) 468f6: 6704 beqs 468fc 468f8: 7004 moveq #4,%d0 468fa: 6012 bras 4690e <== ALWAYS TAKEN case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; *note = api->Notepads[ notepad ]; 468fc: 2240 moveal %d0,%a1 468fe: 2069 010a moveal %a1@(266),%a0 46902: 24b0 2c1e movel %a0@(0000001e,%d2:l:4),%a2@ _Thread_Enable_dispatch(); 46906: 4eb9 0004 85b6 jsr 485b6 <_Thread_Enable_dispatch> 4690c: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4690e: 242e fff4 movel %fp@(-12),%d2 46912: 246e fff8 moveal %fp@(-8),%a2 46916: 4e5e unlk %fp 46918: 4e75 rts ... 00045290 : rtems_status_code rtems_task_ident( rtems_name name, uint32_t node, rtems_id *id ) { 45290: 4e56 0000 linkw %fp,#0 45294: 202e 0008 movel %fp@(8),%d0 45298: 206e 0010 moveal %fp@(16),%a0 Objects_Name_or_id_lookup_errors status; if ( !id ) 4529c: 4a88 tstl %a0 4529e: 6604 bnes 452a4 452a0: 7009 moveq #9,%d0 452a2: 6032 bras 452d6 <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; if ( name == OBJECTS_ID_OF_SELF ) { 452a4: 4a80 tstl %d0 452a6: 660c bnes 452b4 *id = _Thread_Executing->Object.id; 452a8: 2279 0005 cf7e moveal 5cf7e <_Thread_Executing>,%a1 452ae: 20a9 0008 movel %a1@(8),%a0@ return RTEMS_SUCCESSFUL; 452b2: 6022 bras 452d6 <== ALWAYS TAKEN } status = _Objects_Name_to_id_u32( &_RTEMS_tasks_Information, name, node, id ); 452b4: 2f08 movel %a0,%sp@- 452b6: 2f2e 000c movel %fp@(12),%sp@- 452ba: 2f00 movel %d0,%sp@- 452bc: 4879 0005 ce36 pea 5ce36 <_RTEMS_tasks_Information> 452c2: 4eb9 0004 667c jsr 4667c <_Objects_Name_to_id_u32> return _Status_Object_name_errors_to_status[ status ]; 452c8: 4fef 0010 lea %sp@(16),%sp 452cc: 41f9 0005 a64c lea 5a64c <_Status_Object_name_errors_to_status>,%a0 452d2: 2030 0c00 movel %a0@(00000000,%d0:l:4),%d0 } 452d6: 4e5e unlk %fp 452d8: 4e75 rts ... 00050264 : */ rtems_status_code rtems_task_is_suspended( rtems_id id ) { 50264: 4e56 fffc linkw %fp,#-4 register Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 50268: 486e fffc pea %fp@(-4) 5026c: 2f2e 0008 movel %fp@(8),%sp@- 50270: 4eb9 0005 390c jsr 5390c <_Thread_Get> switch ( location ) { 50276: 508f addql #8,%sp 50278: 4aae fffc tstl %fp@(-4) 5027c: 6704 beqs 50282 5027e: 7004 moveq #4,%d0 50280: 601a bras 5029c <== ALWAYS TAKEN case OBJECTS_LOCAL: if ( !_States_Is_suspended( the_thread->current_state ) ) { 50282: 7202 moveq #2,%d1 50284: 2240 moveal %d0,%a1 50286: 41f9 0005 38b6 lea 538b6 <_Thread_Enable_dispatch>,%a0 5028c: c2a9 0010 andl %a1@(16),%d1 50290: 6606 bnes 50298 _Thread_Enable_dispatch(); 50292: 4e90 jsr %a0@ 50294: 4280 clrl %d0 return RTEMS_SUCCESSFUL; 50296: 6004 bras 5029c <== ALWAYS TAKEN } _Thread_Enable_dispatch(); 50298: 4e90 jsr %a0@ 5029a: 700f moveq #15,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 5029c: 4e5e unlk %fp 5029e: 4e75 rts 0004be6c : rtems_status_code rtems_task_mode( rtems_mode mode_set, rtems_mode mask, rtems_mode *previous_mode_set ) { 4be6c: 4e56 ffe4 linkw %fp,#-28 4be70: 48d7 1c3c moveml %d2-%d5/%a2-%a4,%sp@ 4be74: 262e 0008 movel %fp@(8),%d3 4be78: 282e 000c movel %fp@(12),%d4 4be7c: 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 ) 4be80: 4a8c tstl %a4 4be82: 6606 bnes 4be8a 4be84: 7009 moveq #9,%d0 4be86: 6000 00fc braw 4bf84 <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; 4be8a: 2479 0005 cf7e moveal 5cf7e <_Thread_Executing>,%a2 api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 4be90: 4a2a 0075 tstb %a2@(117) 4be94: 57c0 seq %d0 4be96: 243c 0000 0100 movel #256,%d2 4be9c: 49c0 extbl %d0 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 4be9e: 266a 010a moveal %a2@(266),%a3 asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 4bea2: c480 andl %d0,%d2 if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) 4bea4: 4aaa 007a tstl %a2@(122) 4bea8: 6704 beqs 4beae old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; 4beaa: 08c2 0009 bset #9,%d2 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; 4beae: 4a2b 0008 tstb %a3@(8) 4beb2: 57c0 seq %d0 4beb4: 2a3c 0000 0400 movel #1024,%d5 4beba: 49c0 extbl %d0 4bebc: ca80 andl %d0,%d5 old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; old_mode |= _ISR_Get_level(); 4bebe: 4eb9 0004 7ff8 jsr 47ff8 <_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; 4bec4: 8085 orl %d5,%d0 old_mode |= _ISR_Get_level(); *previous_mode_set = old_mode; 4bec6: 8082 orl %d2,%d0 4bec8: 2880 movel %d0,%a4@ /* * These are generic thread scheduling characteristics. */ if ( mask & RTEMS_PREEMPT_MASK ) 4beca: 0804 0008 btst #8,%d4 4bece: 670e beqs 4bede executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; 4bed0: 2003 movel %d3,%d0 4bed2: 7201 moveq #1,%d1 4bed4: e088 lsrl #8,%d0 4bed6: b380 eorl %d1,%d0 4bed8: c081 andl %d1,%d0 4beda: 1540 0075 moveb %d0,%a2@(117) if ( mask & RTEMS_TIMESLICE_MASK ) { 4bede: 0804 0009 btst #9,%d4 4bee2: 671c beqs 4bf00 if ( _Modes_Is_timeslice(mode_set) ) { 4bee4: 0803 0009 btst #9,%d3 4bee8: 6712 beqs 4befc executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 4beea: 41f9 0005 ce74 lea 5ce74 <_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; 4bef0: 7001 moveq #1,%d0 executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 4bef2: 2550 0076 movel %a0@,%a2@(118) if ( mask & RTEMS_PREEMPT_MASK ) executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; if ( mask & RTEMS_TIMESLICE_MASK ) { if ( _Modes_Is_timeslice(mode_set) ) { executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 4bef6: 2540 007a movel %d0,%a2@(122) 4befa: 6004 bras 4bf00 <== ALWAYS TAKEN executing->cpu_time_budget = _Thread_Ticks_per_timeslice; } else executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 4befc: 42aa 007a clrl %a2@(122) /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) 4bf00: 7007 moveq #7,%d0 4bf02: c084 andl %d4,%d0 4bf04: 6712 beqs 4bf18 */ RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level ( Modes_Control mode_set ) { _ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) ); 4bf06: 40c0 movew %sr,%d0 4bf08: 7207 moveq #7,%d1 4bf0a: c283 andl %d3,%d1 4bf0c: 0280 0000 f8ff andil #63743,%d0 4bf12: e189 lsll #8,%d1 4bf14: 8081 orl %d1,%d0 4bf16: 46c0 movew %d0,%sr */ is_asr_enabled = false; needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { 4bf18: 0804 000a btst #10,%d4 4bf1c: 6744 beqs 4bf62 * Output: * *previous_mode_set - previous mode set * always return RTEMS_SUCCESSFUL; */ rtems_status_code rtems_task_mode( 4bf1e: 700a moveq #10,%d0 4bf20: e0ab lsrl %d0,%d3 4bf22: 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; 4bf24: 4280 clrl %d0 4bf26: 102b 0008 moveb %a3@(8),%d0 * Output: * *previous_mode_set - previous mode set * always return RTEMS_SUCCESSFUL; */ rtems_status_code rtems_task_mode( 4bf2a: b383 eorl %d1,%d3 4bf2c: c681 andl %d1,%d3 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; 4bf2e: b083 cmpl %d3,%d0 4bf30: 6730 beqs 4bf62 ) { rtems_signal_set _signals; ISR_Level _level; _ISR_Disable( _level ); 4bf32: 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; 4bf38: 1743 0008 moveb %d3,%a3@(8) 4bf3c: 40c1 movew %sr,%d1 4bf3e: 8081 orl %d1,%d0 4bf40: 46c0 movew %d0,%sr _signals = information->signals_pending; 4bf42: 202b 0016 movel %a3@(22),%d0 information->signals_pending = information->signals_posted; 4bf46: 276b 0012 0016 movel %a3@(18),%a3@(22) information->signals_posted = _signals; 4bf4c: 2740 0012 movel %d0,%a3@(18) _ISR_Enable( _level ); 4bf50: 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; 4bf52: 4aab 0012 tstl %a3@(18) 4bf56: 670a beqs 4bf62 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; 4bf58: 7001 moveq #1,%d0 4bf5a: 7401 moveq #1,%d2 4bf5c: 1540 0074 moveb %d0,%a2@(116) 4bf60: 6002 bras 4bf64 <== ALWAYS TAKEN 4bf62: 4202 clrb %d2 } } } if ( _System_state_Is_up( _System_state_Get() ) ) 4bf64: 7203 moveq #3,%d1 4bf66: b2b9 0005 d04c cmpl 5d04c <_System_state_Current>,%d1 4bf6c: 6614 bnes 4bf82 <== ALWAYS TAKEN if ( _Thread_Evaluate_mode() || needs_asr_dispatching ) 4bf6e: 4eb9 0004 c264 jsr 4c264 <_Thread_Evaluate_mode> 4bf74: 4a00 tstb %d0 4bf76: 6604 bnes 4bf7c 4bf78: 4a02 tstb %d2 4bf7a: 6706 beqs 4bf82 _Thread_Dispatch(); 4bf7c: 4eb9 0004 6b9c jsr 46b9c <_Thread_Dispatch> 4bf82: 4280 clrl %d0 return RTEMS_SUCCESSFUL; } 4bf84: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4 4bf8a: 4e5e unlk %fp 4bf8c: 4e75 rts ... 00045a10 : rtems_status_code rtems_task_restart( rtems_id id, uint32_t argument ) { 45a10: 4e56 fffc linkw %fp,#-4 register Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 45a14: 486e fffc pea %fp@(-4) 45a18: 2f2e 0008 movel %fp@(8),%sp@- 45a1c: 4eb9 0004 7420 jsr 47420 <_Thread_Get> switch ( location ) { 45a22: 508f addql #8,%sp 45a24: 4aae fffc tstl %fp@(-4) 45a28: 6704 beqs 45a2e 45a2a: 7004 moveq #4,%d0 45a2c: 6026 bras 45a54 case OBJECTS_LOCAL: if ( _Thread_Restart( the_thread, NULL, argument ) ) { 45a2e: 2f2e 000c movel %fp@(12),%sp@- 45a32: 42a7 clrl %sp@- 45a34: 2f00 movel %d0,%sp@- 45a36: 4eb9 0004 7ba8 jsr 47ba8 <_Thread_Restart> 45a3c: 4fef 000c lea %sp@(12),%sp 45a40: 41f9 0004 73fa lea 473fa <_Thread_Enable_dispatch>,%a0 45a46: 4a00 tstb %d0 45a48: 6706 beqs 45a50 <== ALWAYS TAKEN _Thread_Enable_dispatch(); 45a4a: 4e90 jsr %a0@ 45a4c: 4280 clrl %d0 return RTEMS_SUCCESSFUL; 45a4e: 6004 bras 45a54 <== ALWAYS TAKEN } _Thread_Enable_dispatch(); 45a50: 4e90 jsr %a0@ 45a52: 700e moveq #14,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 45a54: 4e5e unlk %fp 45a56: 4e75 rts 00048888 : */ rtems_status_code rtems_task_resume( rtems_id id ) { 48888: 4e56 fffc linkw %fp,#-4 4888c: 2f0a movel %a2,%sp@- register Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 4888e: 486e fffc pea %fp@(-4) 48892: 2f2e 0008 movel %fp@(8),%sp@- 48896: 4eb9 0004 a458 jsr 4a458 <_Thread_Get> switch ( location ) { 4889c: 508f addql #8,%sp 4889e: 4aae fffc tstl %fp@(-4) 488a2: 6704 beqs 488a8 488a4: 7004 moveq #4,%d0 488a6: 6028 bras 488d0 <== ALWAYS TAKEN case OBJECTS_LOCAL: if ( _States_Is_suspended( the_thread->current_state ) ) { 488a8: 7202 moveq #2,%d1 488aa: 2040 moveal %d0,%a0 488ac: 45f9 0004 a402 lea 4a402 <_Thread_Enable_dispatch>,%a2 488b2: c2a8 0010 andl %a0@(16),%d1 488b6: 6714 beqs 488cc _Thread_Resume( the_thread, true ); 488b8: 4878 0001 pea 1 488bc: 2f00 movel %d0,%sp@- 488be: 4eb9 0004 abe0 jsr 4abe0 <_Thread_Resume> _Thread_Enable_dispatch(); 488c4: 4e92 jsr %a2@ return RTEMS_SUCCESSFUL; 488c6: 508f addql #8,%sp switch ( location ) { case OBJECTS_LOCAL: if ( _States_Is_suspended( the_thread->current_state ) ) { _Thread_Resume( the_thread, true ); _Thread_Enable_dispatch(); 488c8: 4280 clrl %d0 return RTEMS_SUCCESSFUL; 488ca: 6004 bras 488d0 <== ALWAYS TAKEN } _Thread_Enable_dispatch(); 488cc: 4e92 jsr %a2@ 488ce: 700e moveq #14,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 488d0: 246e fff8 moveal %fp@(-8),%a2 488d4: 4e5e unlk %fp 488d6: 4e75 rts 000469fc : rtems_status_code rtems_task_set_note( rtems_id id, uint32_t notepad, uint32_t note ) { 469fc: 4e56 fffc linkw %fp,#-4 46a00: 202e 0008 movel %fp@(8),%d0 46a04: 2f03 movel %d3,%sp@- 46a06: 262e 0010 movel %fp@(16),%d3 46a0a: 2f02 movel %d2,%sp@- 46a0c: 242e 000c movel %fp@(12),%d2 register Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; if ( !rtems_configuration_get_notepads_enabled() ) 46a10: 4a39 0005 dc84 tstb 5dc84 46a16: 6604 bnes 46a1c 46a18: 7016 moveq #22,%d0 46a1a: 6056 bras 46a72 <== ALWAYS TAKEN /* * NOTE: There is no check for < RTEMS_NOTEPAD_FIRST because that would * be checking an unsigned number for being negative. */ if ( notepad > RTEMS_NOTEPAD_LAST ) 46a1c: 720f moveq #15,%d1 46a1e: b282 cmpl %d2,%d1 46a20: 6404 bccs 46a26 46a22: 700a moveq #10,%d0 46a24: 604c bras 46a72 <== ALWAYS TAKEN /* * Optimize the most likely case to avoid the Thread_Dispatch. */ if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) || 46a26: 4a80 tstl %d0 46a28: 670c beqs 46a36 _Objects_Are_ids_equal( id, _Thread_Executing->Object.id ) ) { 46a2a: 2079 0005 f78e moveal 5f78e <_Thread_Executing>,%a0 46a30: b0a8 0008 cmpl %a0@(8),%d0 46a34: 6612 bnes 46a48 api = _Thread_Executing->API_Extensions[ THREAD_API_RTEMS ]; api->Notepads[ notepad ] = note; 46a36: 2079 0005 f78e moveal 5f78e <_Thread_Executing>,%a0 46a3c: 4280 clrl %d0 46a3e: 2068 010a moveal %a0@(266),%a0 46a42: 2183 2c1e movel %d3,%a0@(0000001e,%d2:l:4) return RTEMS_SUCCESSFUL; 46a46: 602a bras 46a72 <== ALWAYS TAKEN } the_thread = _Thread_Get( id, &location ); 46a48: 486e fffc pea %fp@(-4) 46a4c: 2f00 movel %d0,%sp@- 46a4e: 4eb9 0004 85dc jsr 485dc <_Thread_Get> switch ( location ) { 46a54: 508f addql #8,%sp 46a56: 4aae fffc tstl %fp@(-4) 46a5a: 6704 beqs 46a60 46a5c: 7004 moveq #4,%d0 46a5e: 6012 bras 46a72 <== ALWAYS TAKEN case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; api->Notepads[ notepad ] = note; 46a60: 2240 moveal %d0,%a1 46a62: 2069 010a moveal %a1@(266),%a0 46a66: 2183 2c1e movel %d3,%a0@(0000001e,%d2:l:4) _Thread_Enable_dispatch(); 46a6a: 4eb9 0004 85b6 jsr 485b6 <_Thread_Enable_dispatch> 46a70: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 46a72: 242e fff4 movel %fp@(-12),%d2 46a76: 262e fff8 movel %fp@(-8),%d3 46a7a: 4e5e unlk %fp 46a7c: 4e75 rts ... 000494a4 : rtems_status_code rtems_task_set_priority( rtems_id id, rtems_task_priority new_priority, rtems_task_priority *old_priority ) { 494a4: 4e56 fffc linkw %fp,#-4 494a8: 2f0a movel %a2,%sp@- 494aa: 246e 0010 moveal %fp@(16),%a2 494ae: 2f02 movel %d2,%sp@- 494b0: 242e 000c movel %fp@(12),%d2 register Thread_Control *the_thread; Objects_Locations location; if ( new_priority != RTEMS_CURRENT_PRIORITY && 494b4: 6710 beqs 494c6 494b6: 4280 clrl %d0 494b8: 1039 0006 0e22 moveb 60e22 ,%d0 494be: b082 cmpl %d2,%d0 494c0: 6404 bccs 494c6 494c2: 7013 moveq #19,%d0 494c4: 6054 bras 4951a <== ALWAYS TAKEN !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; if ( !old_priority ) 494c6: 4a8a tstl %a2 494c8: 6604 bnes 494ce 494ca: 7009 moveq #9,%d0 494cc: 604c bras 4951a <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); 494ce: 486e fffc pea %fp@(-4) 494d2: 2f2e 0008 movel %fp@(8),%sp@- 494d6: 4eb9 0004 b1bc jsr 4b1bc <_Thread_Get> switch ( location ) { 494dc: 508f addql #8,%sp return RTEMS_INVALID_PRIORITY; if ( !old_priority ) return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); 494de: 2040 moveal %d0,%a0 switch ( location ) { 494e0: 4aae fffc tstl %fp@(-4) 494e4: 6704 beqs 494ea 494e6: 7004 moveq #4,%d0 494e8: 6030 bras 4951a <== ALWAYS TAKEN case OBJECTS_LOCAL: /* XXX need helper to "convert" from core priority */ *old_priority = the_thread->current_priority; 494ea: 24a8 0014 movel %a0@(20),%a2@ if ( new_priority != RTEMS_CURRENT_PRIORITY ) { 494ee: 4a82 tstl %d2 494f0: 6720 beqs 49512 the_thread->real_priority = new_priority; 494f2: 2142 0018 movel %d2,%a0@(24) if ( the_thread->resource_count == 0 || 494f6: 4aa8 001c tstl %a0@(28) 494fa: 6706 beqs 49502 the_thread->current_priority > new_priority ) 494fc: b4a8 0014 cmpl %a0@(20),%d2 49500: 6410 bccs 49512 <== NEVER TAKEN _Thread_Change_priority( the_thread, new_priority, false ); 49502: 42a7 clrl %sp@- 49504: 2f02 movel %d2,%sp@- 49506: 2f08 movel %a0,%sp@- 49508: 4eb9 0004 ac6c jsr 4ac6c <_Thread_Change_priority> 4950e: 4fef 000c lea %sp@(12),%sp } _Thread_Enable_dispatch(); 49512: 4eb9 0004 b166 jsr 4b166 <_Thread_Enable_dispatch> 49518: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4951a: 242e fff4 movel %fp@(-12),%d2 4951e: 246e fff8 moveal %fp@(-8),%a2 49522: 4e5e unlk %fp 49524: 4e75 rts ... 00045360 : rtems_status_code rtems_task_start( rtems_id id, rtems_task_entry entry_point, rtems_task_argument argument ) { 45360: 4e56 fffc linkw %fp,#-4 45364: 2f02 movel %d2,%sp@- 45366: 242e 000c movel %fp@(12),%d2 register Thread_Control *the_thread; Objects_Locations location; if ( entry_point == NULL ) 4536a: 6604 bnes 45370 4536c: 7009 moveq #9,%d0 4536e: 6044 bras 453b4 <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); 45370: 486e fffc pea %fp@(-4) 45374: 2f2e 0008 movel %fp@(8),%sp@- 45378: 4eb9 0004 6d14 jsr 46d14 <_Thread_Get> switch ( location ) { 4537e: 508f addql #8,%sp 45380: 4aae fffc tstl %fp@(-4) 45384: 6704 beqs 4538a 45386: 7004 moveq #4,%d0 45388: 602a bras 453b4 <== ALWAYS TAKEN case OBJECTS_LOCAL: if ( _Thread_Start( 4538a: 2f2e 0010 movel %fp@(16),%sp@- 4538e: 42a7 clrl %sp@- 45390: 2f02 movel %d2,%sp@- 45392: 42a7 clrl %sp@- 45394: 2f00 movel %d0,%sp@- 45396: 4eb9 0004 7740 jsr 47740 <_Thread_Start> 4539c: 4fef 0014 lea %sp@(20),%sp 453a0: 41f9 0004 6cee lea 46cee <_Thread_Enable_dispatch>,%a0 453a6: 4a00 tstb %d0 453a8: 6706 beqs 453b0 the_thread, THREAD_START_NUMERIC, entry_point, NULL, argument ) ) { _Thread_Enable_dispatch(); 453aa: 4e90 jsr %a0@ 453ac: 4280 clrl %d0 return RTEMS_SUCCESSFUL; 453ae: 6004 bras 453b4 <== ALWAYS TAKEN } _Thread_Enable_dispatch(); 453b0: 4e90 jsr %a0@ 453b2: 700e moveq #14,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 453b4: 242e fff8 movel %fp@(-8),%d2 453b8: 4e5e unlk %fp 453ba: 4e75 rts 000453bc : */ rtems_status_code rtems_task_suspend( rtems_id id ) { 453bc: 4e56 fffc linkw %fp,#-4 453c0: 2f0a movel %a2,%sp@- register Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 453c2: 486e fffc pea %fp@(-4) 453c6: 2f2e 0008 movel %fp@(8),%sp@- 453ca: 4eb9 0004 6d14 jsr 46d14 <_Thread_Get> switch ( location ) { 453d0: 508f addql #8,%sp 453d2: 4aae fffc tstl %fp@(-4) 453d6: 6704 beqs 453dc 453d8: 7004 moveq #4,%d0 453da: 6024 bras 45400 <== ALWAYS TAKEN case OBJECTS_LOCAL: if ( !_States_Is_suspended( the_thread->current_state ) ) { 453dc: 7202 moveq #2,%d1 453de: 2040 moveal %d0,%a0 453e0: 45f9 0004 6cee lea 46cee <_Thread_Enable_dispatch>,%a2 453e6: c2a8 0010 andl %a0@(16),%d1 453ea: 6610 bnes 453fc _Thread_Suspend( the_thread ); 453ec: 2f00 movel %d0,%sp@- 453ee: 4eb9 0004 7790 jsr 47790 <_Thread_Suspend> _Thread_Enable_dispatch(); 453f4: 4e92 jsr %a2@ return RTEMS_SUCCESSFUL; 453f6: 588f addql #4,%sp switch ( location ) { case OBJECTS_LOCAL: if ( !_States_Is_suspended( the_thread->current_state ) ) { _Thread_Suspend( the_thread ); _Thread_Enable_dispatch(); 453f8: 4280 clrl %d0 return RTEMS_SUCCESSFUL; 453fa: 6004 bras 45400 <== ALWAYS TAKEN } _Thread_Enable_dispatch(); 453fc: 4e92 jsr %a2@ 453fe: 700f moveq #15,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 45400: 246e fff8 moveal %fp@(-8),%a2 45404: 4e5e unlk %fp 45406: 4e75 rts 00063530 : rtems_status_code rtems_task_variable_add( rtems_id tid, void **ptr, void (*dtor)(void *) ) { 63530: 4e56 fff0 linkw %fp,#-16 63534: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 63538: 246e 000c moveal %fp@(12),%a2 6353c: 242e 0010 movel %fp@(16),%d2 Thread_Control *the_thread; Objects_Locations location; rtems_task_variable_t *tvp, *new; if ( !ptr ) 63540: 4a8a tstl %a2 63542: 6604 bnes 63548 63544: 7009 moveq #9,%d0 63546: 6070 bras 635b8 return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get (tid, &location); 63548: 486e fffc pea %fp@(-4) 6354c: 2f2e 0008 movel %fp@(8),%sp@- 63550: 4eb9 0004 c360 jsr 4c360 <_Thread_Get> switch (location) { 63556: 508f addql #8,%sp rtems_task_variable_t *tvp, *new; if ( !ptr ) return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get (tid, &location); 63558: 2640 moveal %d0,%a3 switch (location) { 6355a: 4aae fffc tstl %fp@(-4) 6355e: 6704 beqs 63564 63560: 7004 moveq #4,%d0 63562: 6054 bras 635b8 <== ALWAYS TAKEN case OBJECTS_LOCAL: /* * Figure out if the variable is already in this task's list. */ tvp = the_thread->task_variables; 63564: 206b 011a moveal %a3@(282),%a0 while (tvp) { 63568: 6014 bras 6357e <== ALWAYS TAKEN if (tvp->ptr == ptr) { 6356a: b5e8 0004 cmpal %a0@(4),%a2 6356e: 660c bnes 6357c tvp->dtor = dtor; 63570: 2142 0010 movel %d2,%a0@(16) _Thread_Enable_dispatch(); 63574: 4eb9 0004 c33a jsr 4c33a <_Thread_Enable_dispatch> 6357a: 603a bras 635b6 <== ALWAYS TAKEN return RTEMS_SUCCESSFUL; } tvp = (rtems_task_variable_t *)tvp->next; 6357c: 2050 moveal %a0@,%a0 case OBJECTS_LOCAL: /* * Figure out if the variable is already in this task's list. */ tvp = the_thread->task_variables; while (tvp) { 6357e: 4a88 tstl %a0 63580: 66e8 bnes 6356a } /* * Now allocate memory for this task variable. */ new = (rtems_task_variable_t *) 63582: 4878 0014 pea 14 63586: 4eb9 0004 d4e8 jsr 4d4e8 <_Workspace_Allocate> _Workspace_Allocate(sizeof(rtems_task_variable_t)); if (new == NULL) { 6358c: 588f addql #4,%sp 6358e: 43f9 0004 c33a lea 4c33a <_Thread_Enable_dispatch>,%a1 } /* * Now allocate memory for this task variable. */ new = (rtems_task_variable_t *) 63594: 2040 moveal %d0,%a0 _Workspace_Allocate(sizeof(rtems_task_variable_t)); if (new == NULL) { 63596: 4a80 tstl %d0 63598: 6606 bnes 635a0 _Thread_Enable_dispatch(); 6359a: 4e91 jsr %a1@ 6359c: 701a moveq #26,%d0 return RTEMS_NO_MEMORY; 6359e: 6018 bras 635b8 <== ALWAYS TAKEN } new->gval = *ptr; new->ptr = ptr; new->dtor = dtor; new->next = (struct rtems_task_variable_tt *)the_thread->task_variables; 635a0: 20ab 011a movel %a3@(282),%a0@ _Workspace_Allocate(sizeof(rtems_task_variable_t)); if (new == NULL) { _Thread_Enable_dispatch(); return RTEMS_NO_MEMORY; } new->gval = *ptr; 635a4: 2152 0008 movel %a2@,%a0@(8) new->ptr = ptr; new->dtor = dtor; new->next = (struct rtems_task_variable_tt *)the_thread->task_variables; the_thread->task_variables = new; 635a8: 2740 011a movel %d0,%a3@(282) if (new == NULL) { _Thread_Enable_dispatch(); return RTEMS_NO_MEMORY; } new->gval = *ptr; new->ptr = ptr; 635ac: 214a 0004 movel %a2,%a0@(4) new->dtor = dtor; 635b0: 2142 0010 movel %d2,%a0@(16) new->next = (struct rtems_task_variable_tt *)the_thread->task_variables; the_thread->task_variables = new; _Thread_Enable_dispatch(); 635b4: 4e91 jsr %a1@ 635b6: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 635b8: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3 635be: 4e5e unlk %fp 635c0: 4e75 rts ... 000635c4 : rtems_status_code rtems_task_variable_delete( rtems_id tid, void **ptr ) { 635c4: 4e56 fffc linkw %fp,#-4 635c8: 2f02 movel %d2,%sp@- 635ca: 242e 000c movel %fp@(12),%d2 Thread_Control *the_thread; Objects_Locations location; rtems_task_variable_t *tvp, *prev; if ( !ptr ) 635ce: 675c beqs 6362c return RTEMS_INVALID_ADDRESS; prev = NULL; the_thread = _Thread_Get (tid, &location); 635d0: 486e fffc pea %fp@(-4) 635d4: 2f2e 0008 movel %fp@(8),%sp@- 635d8: 4eb9 0004 c360 jsr 4c360 <_Thread_Get> switch (location) { 635de: 508f addql #8,%sp 635e0: 4aae fffc tstl %fp@(-4) 635e4: 6704 beqs 635ea 635e6: 7004 moveq #4,%d0 635e8: 6044 bras 6362e <== ALWAYS TAKEN case OBJECTS_LOCAL: tvp = the_thread->task_variables; 635ea: 2240 moveal %d0,%a1 635ec: 2069 011a moveal %a1@(282),%a0 635f0: 93c9 subal %a1,%a1 while (tvp) { 635f2: 602e bras 63622 <== ALWAYS TAKEN if (tvp->ptr == ptr) { 635f4: b4a8 0004 cmpl %a0@(4),%d2 635f8: 6624 bnes 6361e if (prev) 635fa: 4a89 tstl %a1 635fc: 6704 beqs 63602 prev->next = tvp->next; 635fe: 2290 movel %a0@,%a1@ 63600: 6006 bras 63608 <== ALWAYS TAKEN else the_thread->task_variables = (rtems_task_variable_t *)tvp->next; 63602: 2240 moveal %d0,%a1 63604: 2350 011a movel %a0@,%a1@(282) _RTEMS_Tasks_Invoke_task_variable_dtor( the_thread, tvp ); 63608: 2f08 movel %a0,%sp@- 6360a: 2f00 movel %d0,%sp@- 6360c: 4eb9 0006 36a0 jsr 636a0 <_RTEMS_Tasks_Invoke_task_variable_dtor> _Thread_Enable_dispatch(); 63612: 4eb9 0004 c33a jsr 4c33a <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 63618: 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(); 6361a: 4280 clrl %d0 return RTEMS_SUCCESSFUL; 6361c: 6010 bras 6362e <== ALWAYS TAKEN } prev = tvp; tvp = (rtems_task_variable_t *)tvp->next; 6361e: 2248 moveal %a0,%a1 63620: 2050 moveal %a0@,%a0 the_thread = _Thread_Get (tid, &location); switch (location) { case OBJECTS_LOCAL: tvp = the_thread->task_variables; while (tvp) { 63622: 4a88 tstl %a0 63624: 66ce bnes 635f4 return RTEMS_SUCCESSFUL; } prev = tvp; tvp = (rtems_task_variable_t *)tvp->next; } _Thread_Enable_dispatch(); 63626: 4eb9 0004 c33a jsr 4c33a <_Thread_Enable_dispatch> 6362c: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 6362e: 242e fff8 movel %fp@(-8),%d2 63632: 4e5e unlk %fp 63634: 4e75 rts ... 00063638 : rtems_status_code rtems_task_variable_get( rtems_id tid, void **ptr, void **result ) { 63638: 4e56 fffc linkw %fp,#-4 6363c: 2f0a movel %a2,%sp@- 6363e: 246e 0010 moveal %fp@(16),%a2 63642: 2f02 movel %d2,%sp@- 63644: 242e 000c movel %fp@(12),%d2 Thread_Control *the_thread; Objects_Locations location; rtems_task_variable_t *tvp; if ( !ptr ) 63648: 6746 beqs 63690 return RTEMS_INVALID_ADDRESS; if ( !result ) 6364a: 4a8a tstl %a2 6364c: 6742 beqs 63690 return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get (tid, &location); 6364e: 486e fffc pea %fp@(-4) 63652: 2f2e 0008 movel %fp@(8),%sp@- 63656: 4eb9 0004 c360 jsr 4c360 <_Thread_Get> switch (location) { 6365c: 508f addql #8,%sp 6365e: 4aae fffc tstl %fp@(-4) 63662: 6704 beqs 63668 63664: 7004 moveq #4,%d0 63666: 602a bras 63692 <== ALWAYS TAKEN case OBJECTS_LOCAL: /* * Figure out if the variable is in this task's list. */ tvp = the_thread->task_variables; 63668: 2240 moveal %d0,%a1 6366a: 2069 011a moveal %a1@(282),%a0 while (tvp) { 6366e: 6016 bras 63686 <== ALWAYS TAKEN if (tvp->ptr == ptr) { 63670: b4a8 0004 cmpl %a0@(4),%d2 63674: 660e bnes 63684 /* * Should this return the current (i.e not the * saved) value if `tid' is the current task? */ *result = tvp->tval; 63676: 24a8 000c movel %a0@(12),%a2@ _Thread_Enable_dispatch(); 6367a: 4eb9 0004 c33a jsr 4c33a <_Thread_Enable_dispatch> 63680: 4280 clrl %d0 return RTEMS_SUCCESSFUL; 63682: 600e bras 63692 <== ALWAYS TAKEN } tvp = (rtems_task_variable_t *)tvp->next; 63684: 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) { 63686: 4a88 tstl %a0 63688: 66e6 bnes 63670 _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } tvp = (rtems_task_variable_t *)tvp->next; } _Thread_Enable_dispatch(); 6368a: 4eb9 0004 c33a jsr 4c33a <_Thread_Enable_dispatch> return RTEMS_INVALID_ADDRESS; 63690: 7009 moveq #9,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 63692: 242e fff4 movel %fp@(-12),%d2 63696: 246e fff8 moveal %fp@(-8),%a2 6369a: 4e5e unlk %fp 6369c: 4e75 rts ... 00045408 : */ rtems_status_code rtems_task_wake_after( rtems_interval ticks ) { 45408: 4e56 0000 linkw %fp,#0 4540c: 2039 0005 cec4 movel 5cec4 <_Thread_Dispatch_disable_level>,%d0 45412: 5280 addql #1,%d0 45414: 2f02 movel %d2,%sp@- 45416: 242e 0008 movel %fp@(8),%d2 4541a: 23c0 0005 cec4 movel %d0,5cec4 <_Thread_Dispatch_disable_level> _Thread_Disable_dispatch(); if ( ticks == 0 ) { 45420: 4a82 tstl %d2 45422: 6608 bnes 4542c _Thread_Yield_processor(); 45424: 4eb9 0004 78e8 jsr 478e8 <_Thread_Yield_processor> 4542a: 6048 bras 45474 <== ALWAYS TAKEN } else { _Thread_Set_state( _Thread_Executing, STATES_DELAYING ); 4542c: 4878 0008 pea 8 45430: 2f39 0005 cf7e movel 5cf7e <_Thread_Executing>,%sp@- 45436: 4eb9 0004 750c jsr 4750c <_Thread_Set_state> _Watchdog_Initialize( &_Thread_Executing->Timer, _Thread_Delay_ended, _Thread_Executing->Object.id, 4543c: 2079 0005 cf7e moveal 5cf7e <_Thread_Executing>,%a0 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 45442: 203c 0004 6b60 movel #289632,%d0 45448: 2140 0064 movel %d0,%a0@(100) _Thread_Disable_dispatch(); if ( ticks == 0 ) { _Thread_Yield_processor(); } else { _Thread_Set_state( _Thread_Executing, STATES_DELAYING ); _Watchdog_Initialize( 4544c: 2028 0008 movel %a0@(8),%d0 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 45450: 2142 0054 movel %d2,%a0@(84) void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; 45454: 2140 0068 movel %d0,%a0@(104) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 45458: 42a8 0050 clrl %a0@(80) the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 4545c: 42a8 006c clrl %a0@(108) ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 45460: 4868 0048 pea %a0@(72) 45464: 4879 0005 cf9c pea 5cf9c <_Watchdog_Ticks_chain> 4546a: 4eb9 0004 7c54 jsr 47c54 <_Watchdog_Insert> 45470: 4fef 0010 lea %sp@(16),%sp _Thread_Executing->Object.id, NULL ); _Watchdog_Insert_ticks( &_Thread_Executing->Timer, ticks ); } _Thread_Enable_dispatch(); 45474: 4eb9 0004 6cee jsr 46cee <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; } 4547a: 242e fffc movel %fp@(-4),%d2 4547e: 4280 clrl %d0 45480: 4e5e unlk %fp 45482: 4e75 rts 00045f9c : */ rtems_status_code rtems_task_wake_when( rtems_time_of_day *time_buffer ) { 45f9c: 4e56 0000 linkw %fp,#0 45fa0: 2f0a movel %a2,%sp@- 45fa2: 246e 0008 moveal %fp@(8),%a2 Watchdog_Interval seconds; if ( !_TOD_Is_set ) 45fa6: 4a39 0005 e430 tstb 5e430 <_TOD_Is_set> 45fac: 6606 bnes 45fb4 45fae: 700b moveq #11,%d0 45fb0: 6000 009a braw 4604c <== ALWAYS TAKEN return RTEMS_NOT_DEFINED; if ( !time_buffer ) 45fb4: 4a8a tstl %a2 45fb6: 6606 bnes 45fbe 45fb8: 7009 moveq #9,%d0 45fba: 6000 0090 braw 4604c <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; time_buffer->ticks = 0; 45fbe: 42aa 0018 clrl %a2@(24) if ( !_TOD_Validate( time_buffer ) ) 45fc2: 2f0a movel %a2,%sp@- 45fc4: 4eb9 0004 5458 jsr 45458 <_TOD_Validate> 45fca: 588f addql #4,%sp 45fcc: 4a00 tstb %d0 45fce: 677a beqs 4604a return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( time_buffer ); 45fd0: 2f0a movel %a2,%sp@- 45fd2: 4eb9 0004 53b8 jsr 453b8 <_TOD_To_seconds> if ( seconds <= _TOD_Seconds_since_epoch() ) 45fd8: 588f addql #4,%sp time_buffer->ticks = 0; if ( !_TOD_Validate( time_buffer ) ) return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( time_buffer ); 45fda: 2440 moveal %d0,%a2 if ( seconds <= _TOD_Seconds_since_epoch() ) 45fdc: b0b9 0005 e4ae cmpl 5e4ae <_TOD_Now>,%d0 45fe2: 6366 blss 4604a 45fe4: 2039 0005 e41c movel 5e41c <_Thread_Dispatch_disable_level>,%d0 45fea: 5280 addql #1,%d0 45fec: 23c0 0005 e41c movel %d0,5e41c <_Thread_Dispatch_disable_level> return RTEMS_INVALID_CLOCK; _Thread_Disable_dispatch(); _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_TIME ); 45ff2: 4878 0010 pea 10 45ff6: 2f39 0005 e4d6 movel 5e4d6 <_Thread_Executing>,%sp@- 45ffc: 4eb9 0004 8140 jsr 48140 <_Thread_Set_state> _Watchdog_Initialize( &_Thread_Executing->Timer, _Thread_Delay_ended, _Thread_Executing->Object.id, 46002: 2079 0005 e4d6 moveal 5e4d6 <_Thread_Executing>,%a0 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 46008: 203c 0004 7794 movel #292756,%d0 4600e: 2140 0064 movel %d0,%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( 46012: 2028 0008 movel %a0@(8),%d0 the_watchdog->id = id; 46016: 2140 0068 movel %d0,%a0@(104) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 4601a: 95f9 0005 e4ae subal 5e4ae <_TOD_Now>,%a2 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 46020: 42a8 0050 clrl %a0@(80) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 46024: 214a 0054 movel %a2,%a0@(84) ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 46028: 42a8 006c clrl %a0@(108) ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Seconds_chain, the_watchdog ); 4602c: 4868 0048 pea %a0@(72) 46030: 4879 0005 e4e8 pea 5e4e8 <_Watchdog_Seconds_chain> 46036: 4eb9 0004 8908 jsr 48908 <_Watchdog_Insert> ); _Watchdog_Insert_seconds( &_Thread_Executing->Timer, seconds - _TOD_Seconds_since_epoch() ); _Thread_Enable_dispatch(); 4603c: 4eb9 0004 7922 jsr 47922 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 46042: 4fef 0010 lea %sp@(16),%sp ); _Watchdog_Insert_seconds( &_Thread_Executing->Timer, seconds - _TOD_Seconds_since_epoch() ); _Thread_Enable_dispatch(); 46046: 4280 clrl %d0 return RTEMS_SUCCESSFUL; 46048: 6002 bras 4604c <== ALWAYS TAKEN 4604a: 7014 moveq #20,%d0 } 4604c: 246e fffc moveal %fp@(-4),%a2 46050: 4e5e unlk %fp 46052: 4e75 rts 00050740 : */ rtems_status_code rtems_timer_cancel( rtems_id id ) { 50740: 4e56 fffc linkw %fp,#-4 RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Get ( Objects_Id id, Objects_Locations *location ) { return (Timer_Control *) 50744: 486e fffc pea %fp@(-4) 50748: 2f2e 0008 movel %fp@(8),%sp@- 5074c: 4879 0007 5734 pea 75734 <_Timer_Information> 50752: 4eb9 0005 3030 jsr 53030 <_Objects_Get> Timer_Control *the_timer; Objects_Locations location; the_timer = _Timer_Get( id, &location ); switch ( location ) { 50758: 4fef 000c lea %sp@(12),%sp 5075c: 4aae fffc tstl %fp@(-4) 50760: 6704 beqs 50766 50762: 7004 moveq #4,%d0 50764: 601e bras 50784 <== ALWAYS TAKEN case OBJECTS_LOCAL: if ( !_Timer_Is_dormant_class( the_timer->the_class ) ) 50766: 7204 moveq #4,%d1 50768: 2040 moveal %d0,%a0 5076a: b2a8 0038 cmpl %a0@(56),%d1 5076e: 670c beqs 5077c <== ALWAYS TAKEN (void) _Watchdog_Remove( &the_timer->Ticker ); 50770: 4868 0010 pea %a0@(16) 50774: 4eb9 0005 4c50 jsr 54c50 <_Watchdog_Remove> 5077a: 588f addql #4,%sp _Thread_Enable_dispatch(); 5077c: 4eb9 0005 38b6 jsr 538b6 <_Thread_Enable_dispatch> 50782: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 50784: 4e5e unlk %fp 50786: 4e75 rts 00050810 : */ rtems_status_code rtems_timer_delete( rtems_id id ) { 50810: 4e56 fffc linkw %fp,#-4 50814: 2f0a movel %a2,%sp@- RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Get ( Objects_Id id, Objects_Locations *location ) { return (Timer_Control *) 50816: 486e fffc pea %fp@(-4) 5081a: 2f2e 0008 movel %fp@(8),%sp@- 5081e: 4879 0007 5734 pea 75734 <_Timer_Information> 50824: 4eb9 0005 3030 jsr 53030 <_Objects_Get> Timer_Control *the_timer; Objects_Locations location; the_timer = _Timer_Get( id, &location ); switch ( location ) { 5082a: 4fef 000c lea %sp@(12),%sp 5082e: 2440 moveal %d0,%a2 50830: 4aae fffc tstl %fp@(-4) 50834: 6704 beqs 5083a 50836: 7004 moveq #4,%d0 50838: 6032 bras 5086c <== ALWAYS TAKEN case OBJECTS_LOCAL: _Objects_Close( &_Timer_Information, &the_timer->Object ); 5083a: 2f00 movel %d0,%sp@- 5083c: 4879 0007 5734 pea 75734 <_Timer_Information> 50842: 4eb9 0005 2c2c jsr 52c2c <_Objects_Close> (void) _Watchdog_Remove( &the_timer->Ticker ); 50848: 486a 0010 pea %a2@(16) 5084c: 4eb9 0005 4c50 jsr 54c50 <_Watchdog_Remove> */ RTEMS_INLINE_ROUTINE void _Timer_Free ( Timer_Control *the_timer ) { _Objects_Free( &_Timer_Information, &the_timer->Object ); 50852: 2f0a movel %a2,%sp@- 50854: 4879 0007 5734 pea 75734 <_Timer_Information> 5085a: 4eb9 0005 2ea0 jsr 52ea0 <_Objects_Free> _Timer_Free( the_timer ); _Thread_Enable_dispatch(); 50860: 4eb9 0005 38b6 jsr 538b6 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 50866: 4fef 0014 lea %sp@(20),%sp case OBJECTS_LOCAL: _Objects_Close( &_Timer_Information, &the_timer->Object ); (void) _Watchdog_Remove( &the_timer->Ticker ); _Timer_Free( the_timer ); _Thread_Enable_dispatch(); 5086a: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 5086c: 246e fff8 moveal %fp@(-8),%a2 50870: 4e5e unlk %fp 50872: 4e75 rts 0004576c : rtems_id id, rtems_interval ticks, rtems_timer_service_routine_entry routine, void *user_data ) { 4576c: 4e56 ffe4 linkw %fp,#-28 45770: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@ 45774: 282e 0008 movel %fp@(8),%d4 45778: 262e 000c movel %fp@(12),%d3 4577c: 2a2e 0010 movel %fp@(16),%d5 Timer_Control *the_timer; Objects_Locations location; ISR_Level level; if ( ticks == 0 ) 45780: 4a83 tstl %d3 45782: 6606 bnes 4578a 45784: 700a moveq #10,%d0 45786: 6000 008e braw 45816 <== ALWAYS TAKEN return RTEMS_INVALID_NUMBER; if ( !routine ) 4578a: 4a85 tstl %d5 4578c: 6606 bnes 45794 4578e: 7009 moveq #9,%d0 45790: 6000 0084 braw 45816 <== ALWAYS TAKEN RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Get ( Objects_Id id, Objects_Locations *location ) { return (Timer_Control *) 45794: 486e fffc pea %fp@(-4) 45798: 2f04 movel %d4,%sp@- 4579a: 4879 0005 dd82 pea 5dd82 <_Timer_Information> 457a0: 4eb9 0004 6890 jsr 46890 <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_timer = _Timer_Get( id, &location ); switch ( location ) { 457a6: 4fef 000c lea %sp@(12),%sp 457aa: 2440 moveal %d0,%a2 457ac: 4aae fffc tstl %fp@(-4) 457b0: 6704 beqs 457b6 457b2: 7004 moveq #4,%d0 457b4: 6060 bras 45816 <== ALWAYS TAKEN case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); 457b6: 2400 movel %d0,%d2 457b8: 0682 0000 0010 addil #16,%d2 457be: 2f02 movel %d2,%sp@- 457c0: 4eb9 0004 809c jsr 4809c <_Watchdog_Remove> _ISR_Disable( level ); 457c6: 203c 0000 0700 movel #1792,%d0 457cc: 40c1 movew %sr,%d1 457ce: 8081 orl %d1,%d0 457d0: 46c0 movew %d0,%sr 457d2: 47f9 0004 701a lea 4701a <_Thread_Enable_dispatch>,%a3 /* * 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 ) { 457d8: 588f addql #4,%sp 457da: 4aaa 0018 tstl %a2@(24) 457de: 6706 beqs 457e6 _ISR_Enable( level ); 457e0: 46c1 movew %d1,%sr _Thread_Enable_dispatch(); 457e2: 4e93 jsr %a3@ 457e4: 602e bras 45814 <== ALWAYS TAKEN Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 457e6: 2545 002c movel %d5,%a2@(44) the_watchdog->id = id; the_watchdog->user_data = user_data; 457ea: 256e 0014 0034 movel %fp@(20),%a2@(52) void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; 457f0: 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; 457f4: 42aa 0038 clrl %a2@(56) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 457f8: 42aa 0018 clrl %a2@(24) _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); _ISR_Enable( level ); 457fc: 46c1 movew %d1,%sr Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 457fe: 2543 001c movel %d3,%a2@(28) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 45802: 2f02 movel %d2,%sp@- 45804: 4879 0005 d630 pea 5d630 <_Watchdog_Ticks_chain> 4580a: 4eb9 0004 7f80 jsr 47f80 <_Watchdog_Insert> _Watchdog_Insert_ticks( &the_timer->Ticker, ticks ); _Thread_Enable_dispatch(); 45810: 4e93 jsr %a3@ return RTEMS_SUCCESSFUL; 45812: 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(); 45814: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 45816: 4cee 0c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a3 4581c: 4e5e unlk %fp 4581e: 4e75 rts 00050928 : rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ) { 50928: 4e56 ffe8 linkw %fp,#-24 5092c: 48d7 043c moveml %d2-%d5/%a2,%sp@ 50930: 2a2e 0008 movel %fp@(8),%d5 50934: 242e 000c movel %fp@(12),%d2 50938: 262e 0010 movel %fp@(16),%d3 Timer_Control *the_timer; Objects_Locations location; rtems_interval seconds; if ( !_TOD_Is_set ) 5093c: 4a39 0007 4edc tstb 74edc <_TOD_Is_set> 50942: 6606 bnes 5094a 50944: 700b moveq #11,%d0 50946: 6000 00a2 braw 509ea <== ALWAYS TAKEN return RTEMS_NOT_DEFINED; if ( !_TOD_Validate( wall_time ) ) 5094a: 2f02 movel %d2,%sp@- 5094c: 4eb9 0004 e040 jsr 4e040 <_TOD_Validate> 50952: 588f addql #4,%sp 50954: 4a00 tstb %d0 50956: 6700 0090 beqw 509e8 return RTEMS_INVALID_CLOCK; if ( !routine ) 5095a: 4a83 tstl %d3 5095c: 6606 bnes 50964 5095e: 7009 moveq #9,%d0 50960: 6000 0088 braw 509ea <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; seconds = _TOD_To_seconds( wall_time ); 50964: 2f02 movel %d2,%sp@- 50966: 4eb9 0004 dfa0 jsr 4dfa0 <_TOD_To_seconds> if ( seconds <= _TOD_Seconds_since_epoch() ) 5096c: 588f addql #4,%sp return RTEMS_INVALID_CLOCK; if ( !routine ) return RTEMS_INVALID_ADDRESS; seconds = _TOD_To_seconds( wall_time ); 5096e: 2800 movel %d0,%d4 if ( seconds <= _TOD_Seconds_since_epoch() ) 50970: b0b9 0007 4f5a cmpl 74f5a <_TOD_Now>,%d0 50976: 6370 blss 509e8 50978: 486e fffc pea %fp@(-4) 5097c: 2f05 movel %d5,%sp@- 5097e: 4879 0007 5734 pea 75734 <_Timer_Information> 50984: 4eb9 0005 3030 jsr 53030 <_Objects_Get> return RTEMS_INVALID_CLOCK; the_timer = _Timer_Get( id, &location ); switch ( location ) { 5098a: 4fef 000c lea %sp@(12),%sp 5098e: 2440 moveal %d0,%a2 50990: 4aae fffc tstl %fp@(-4) 50994: 6704 beqs 5099a 50996: 7004 moveq #4,%d0 50998: 6050 bras 509ea <== ALWAYS TAKEN case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); 5099a: 2400 movel %d0,%d2 5099c: 0682 0000 0010 addil #16,%d2 509a2: 2f02 movel %d2,%sp@- 509a4: 4eb9 0005 4c50 jsr 54c50 <_Watchdog_Remove> ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 509aa: 256e 0014 0034 movel %fp@(20),%a2@(52) the_timer->the_class = TIMER_TIME_OF_DAY; 509b0: 7002 moveq #2,%d0 void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; 509b2: 2545 0030 movel %d5,%a2@(48) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 509b6: 98b9 0007 4f5a subl 74f5a <_TOD_Now>,%d4 509bc: 2540 0038 movel %d0,%a2@(56) 509c0: 2544 001c movel %d4,%a2@(28) Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 509c4: 2543 002c movel %d3,%a2@(44) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 509c8: 42aa 0018 clrl %a2@(24) ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Seconds_chain, the_watchdog ); 509cc: 2f02 movel %d2,%sp@- 509ce: 4879 0007 4f94 pea 74f94 <_Watchdog_Seconds_chain> 509d4: 4eb9 0005 4b34 jsr 54b34 <_Watchdog_Insert> _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); _Watchdog_Insert_seconds( &the_timer->Ticker, seconds - _TOD_Seconds_since_epoch() ); _Thread_Enable_dispatch(); 509da: 4eb9 0005 38b6 jsr 538b6 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 509e0: 4fef 000c lea %sp@(12),%sp _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); _Watchdog_Insert_seconds( &the_timer->Ticker, seconds - _TOD_Seconds_since_epoch() ); _Thread_Enable_dispatch(); 509e4: 4280 clrl %d0 return RTEMS_SUCCESSFUL; 509e6: 6002 bras 509ea <== ALWAYS TAKEN 509e8: 7014 moveq #20,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 509ea: 4cee 043c ffe8 moveml %fp@(-24),%d2-%d5/%a2 509f0: 4e5e unlk %fp 509f2: 4e75 rts 000509f4 : rtems_status_code rtems_timer_get_information( rtems_id id, rtems_timer_information *the_info ) { 509f4: 4e56 fffc linkw %fp,#-4 509f8: 2f0a movel %a2,%sp@- 509fa: 246e 000c moveal %fp@(12),%a2 Timer_Control *the_timer; Objects_Locations location; if ( !the_info ) 509fe: 4a8a tstl %a2 50a00: 6604 bnes 50a06 50a02: 7009 moveq #9,%d0 50a04: 6042 bras 50a48 <== ALWAYS TAKEN 50a06: 486e fffc pea %fp@(-4) 50a0a: 2f2e 0008 movel %fp@(8),%sp@- 50a0e: 4879 0007 5734 pea 75734 <_Timer_Information> 50a14: 4eb9 0005 3030 jsr 53030 <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_timer = _Timer_Get( id, &location ); switch ( location ) { 50a1a: 4fef 000c lea %sp@(12),%sp 50a1e: 2040 moveal %d0,%a0 50a20: 4aae fffc tstl %fp@(-4) 50a24: 6704 beqs 50a2a 50a26: 7004 moveq #4,%d0 50a28: 601e bras 50a48 <== ALWAYS TAKEN case OBJECTS_LOCAL: the_info->the_class = the_timer->the_class; 50a2a: 24a8 0038 movel %a0@(56),%a2@ the_info->initial = the_timer->Ticker.initial; 50a2e: 2568 001c 0004 movel %a0@(28),%a2@(4) the_info->start_time = the_timer->Ticker.start_time; 50a34: 2568 0024 0008 movel %a0@(36),%a2@(8) the_info->stop_time = the_timer->Ticker.stop_time; 50a3a: 2568 0028 000c movel %a0@(40),%a2@(12) _Thread_Enable_dispatch(); 50a40: 4eb9 0005 38b6 jsr 538b6 <_Thread_Enable_dispatch> 50a46: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 50a48: 246e fff8 moveal %fp@(-8),%a2 50a4c: 4e5e unlk %fp 50a4e: 4e75 rts 00050c94 : rtems_status_code rtems_timer_initiate_server( uint32_t priority, uint32_t stack_size, rtems_attribute attribute_set ) { 50c94: 4e56 fffc linkw %fp,#-4 50c98: 202e 0008 movel %fp@(8),%d0 50c9c: 2f03 movel %d3,%sp@- 50c9e: 2f02 movel %d2,%sp@- */ RTEMS_INLINE_ROUTINE bool _RTEMS_tasks_Priority_is_valid ( rtems_task_priority the_priority ) { return ( ( the_priority >= RTEMS_MINIMUM_PRIORITY ) && 50ca0: 4a80 tstl %d0 50ca2: 671e beqs 50cc2 50ca4: 4281 clrl %d1 50ca6: 1239 0006 f362 moveb 6f362 ,%d1 50cac: b280 cmpl %d0,%d1 50cae: 54c1 scc %d1 50cb0: 49c1 extbl %d1 50cb2: 4481 negl %d1 * Make sure the requested priority is valid. The if is * 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 ) ) { 50cb4: 4a01 tstb %d1 50cb6: 6704 beqs 50cbc 50cb8: 2400 movel %d0,%d2 50cba: 600e bras 50cca <== ALWAYS TAKEN if ( priority != RTEMS_TIMER_SERVER_DEFAULT_PRIORITY ) 50cbc: 72ff moveq #-1,%d1 50cbe: b280 cmpl %d0,%d1 50cc0: 6706 beqs 50cc8 50cc2: 7013 moveq #19,%d0 50cc4: 6000 0146 braw 50e0c <== ALWAYS TAKEN 50cc8: 4282 clrl %d2 50cca: 2039 0007 4ec8 movel 74ec8 <_Thread_Dispatch_disable_level>,%d0 50cd0: 5280 addql #1,%d0 50cd2: 23c0 0007 4ec8 movel %d0,74ec8 <_Thread_Dispatch_disable_level> /* * Just to make sure this is only called once. */ _Thread_Disable_dispatch(); tmpInitialized = initialized; initialized = true; 50cd8: 7001 moveq #1,%d0 /* * Just to make sure this is only called once. */ _Thread_Disable_dispatch(); tmpInitialized = initialized; 50cda: 1639 0007 0314 moveb 70314 ,%d3 initialized = true; 50ce0: 13c0 0007 0314 moveb %d0,70314 _Thread_Enable_dispatch(); 50ce6: 4eb9 0005 38b6 jsr 538b6 <_Thread_Enable_dispatch> if ( tmpInitialized ) 50cec: 4a03 tstb %d3 50cee: 6706 beqs 50cf6 50cf0: 700e moveq #14,%d0 50cf2: 6000 0118 braw 50e0c * 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( 50cf6: 222e 0010 movel %fp@(16),%d1 50cfa: 486e fffc pea %fp@(-4) 50cfe: 08c1 000f bset #15,%d1 50d02: 2f01 movel %d1,%sp@- 50d04: 4878 0100 pea 100 50d08: 2f2e 000c movel %fp@(12),%sp@- 50d0c: 2f02 movel %d2,%sp@- 50d0e: 2f3c 5449 4d45 movel #1414090053,%sp@- 50d14: 4eb9 0004 ff5c jsr 4ff5c /* 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) { 50d1a: 4fef 0018 lea %sp@(24),%sp 50d1e: 4a80 tstl %d0 50d20: 670c beqs 50d2e initialized = false; 50d22: 4201 clrb %d1 50d24: 13c1 0007 0314 moveb %d1,70314 return status; 50d2a: 6000 00e0 braw 50e0c <== ALWAYS TAKEN */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 50d2e: 41f9 0007 034a lea 7034a <_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( 50d34: 4282 clrl %d2 the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 50d36: 223c 0007 0346 movel #459590,%d1 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 50d3c: 23c8 0007 0346 movel %a0,70346 <_Timer_server_Default+0x30> &_RTEMS_tasks_Information, _Objects_Get_index(id) 50d42: 202e fffc movel %fp@(-4),%d0 50d46: 41f9 0007 0382 lea 70382 <_Timer_server_Default+0x6c>,%a0 50d4c: 23c8 0007 037e movel %a0,7037e <_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( 50d52: 2079 0007 4e52 moveal 74e52 <_RTEMS_tasks_Information+0x18>,%a0 50d58: 3400 movew %d0,%d2 the_chain->permanent_null = NULL; the_chain->last = _Chain_Head(the_chain); 50d5a: 23c1 0007 034e movel %d1,7034e <_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; 50d60: 2239 0007 500c movel 7500c <_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( 50d66: 41f0 2c00 lea %a0@(00000000,%d2:l:4),%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; 50d6a: 23c1 0007 0352 movel %d1,70352 <_Timer_server_Default+0x3c> /* * 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( 50d70: 23d0 0007 0316 movel %a0@,70316 <_Timer_server_Default> 50d76: 41f9 0007 037e lea 7037e <_Timer_server_Default+0x68>,%a0 _Timer_server = ts; /* * Start the timer server */ status = rtems_task_start( 50d7c: 4879 0007 0316 pea 70316 <_Timer_server_Default> 50d82: 487a 0158 pea %pc@(50edc <_Timer_server_Body>) /* * 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; 50d86: 223c 0005 10a4 movel #331940,%d1 50d8c: 23c8 0007 0386 movel %a0,70386 <_Timer_server_Default+0x70> the_watchdog->routine = routine; 50d92: 41f9 0005 3728 lea 53728 <_Thread_Delay_ended>,%a0 50d98: 23c8 0007 033a movel %a0,7033a <_Timer_server_Default+0x24> 50d9e: 23c8 0007 0372 movel %a0,70372 <_Timer_server_Default+0x5c> ts->Interval_watchdogs.last_snapshot = _Watchdog_Ticks_since_boot; ts->TOD_watchdogs.last_snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 50da4: 41f9 0007 4f5a lea 74f5a <_TOD_Now>,%a0 50daa: 23d0 0007 038a movel %a0@,7038a <_Timer_server_Default+0x74> ts->active = false; /* * The default timer server is now available. */ _Timer_server = ts; 50db0: 41f9 0007 0316 lea 70316 <_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; 50db6: 23c1 0007 031a movel %d1,7031a <_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; 50dbc: 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; 50dbe: 42b9 0007 038e clrl 7038e <_Timer_server_Default+0x78> ts->active = false; 50dc4: 13c1 0007 0392 moveb %d1,70392 <_Timer_server_Default+0x7c> _Timer_server = ts; /* * Start the timer server */ status = rtems_task_start( 50dca: 2f00 movel %d0,%sp@- ts->active = false; /* * The default timer server is now available. */ _Timer_server = ts; 50dcc: 23c8 0007 576e movel %a0,7576e <_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; 50dd2: 42b9 0007 034a clrl 7034a <_Timer_server_Default+0x34> 50dd8: 42b9 0007 0382 clrl 70382 <_Timer_server_Default+0x6c> Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 50dde: 42b9 0007 0326 clrl 70326 <_Timer_server_Default+0x10> the_watchdog->routine = routine; the_watchdog->id = id; 50de4: 23c0 0007 033e movel %d0,7033e <_Timer_server_Default+0x28> the_watchdog->user_data = user_data; 50dea: 42b9 0007 0342 clrl 70342 <_Timer_server_Default+0x2c> Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 50df0: 42b9 0007 035e clrl 7035e <_Timer_server_Default+0x48> the_watchdog->routine = routine; the_watchdog->id = id; 50df6: 23c0 0007 0376 movel %d0,70376 <_Timer_server_Default+0x60> the_watchdog->user_data = user_data; 50dfc: 42b9 0007 037a clrl 7037a <_Timer_server_Default+0x64> /* * Start the timer server */ status = rtems_task_start( 50e02: 4eb9 0005 0564 jsr 50564 if (status) { initialized = false; } #endif return status; 50e08: 4fef 000c lea %sp@(12),%sp } 50e0c: 242e fff4 movel %fp@(-12),%d2 50e10: 262e fff8 movel %fp@(-8),%d3 50e14: 4e5e unlk %fp 50e16: 4e75 rts 00050a7c : */ rtems_status_code rtems_timer_reset( rtems_id id ) { 50a7c: 4e56 fff0 linkw %fp,#-16 50a80: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 50a84: 486e fffc pea %fp@(-4) 50a88: 2f2e 0008 movel %fp@(8),%sp@- 50a8c: 4879 0007 5734 pea 75734 <_Timer_Information> 50a92: 4eb9 0005 3030 jsr 53030 <_Objects_Get> Timer_Control *the_timer; Objects_Locations location; rtems_status_code status = RTEMS_SUCCESSFUL; the_timer = _Timer_Get( id, &location ); switch ( location ) { 50a98: 4fef 000c lea %sp@(12),%sp 50a9c: 2440 moveal %d0,%a2 50a9e: 4aae fffc tstl %fp@(-4) 50aa2: 6704 beqs 50aa8 50aa4: 7404 moveq #4,%d2 50aa6: 6054 bras 50afc <== ALWAYS TAKEN case OBJECTS_LOCAL: if ( the_timer->the_class == TIMER_INTERVAL ) { 50aa8: 202a 0038 movel %a2@(56),%d0 50aac: 661e bnes 50acc _Watchdog_Remove( &the_timer->Ticker ); 50aae: 45ea 0010 lea %a2@(16),%a2 _Watchdog_Insert( &_Watchdog_Ticks_chain, &the_timer->Ticker ); 50ab2: 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 ); 50ab4: 2f0a movel %a2,%sp@- 50ab6: 4eb9 0005 4c50 jsr 54c50 <_Watchdog_Remove> _Watchdog_Insert( &_Watchdog_Ticks_chain, &the_timer->Ticker ); 50abc: 2f0a movel %a2,%sp@- 50abe: 4879 0007 4fa0 pea 74fa0 <_Watchdog_Ticks_chain> 50ac4: 4eb9 0005 4b34 jsr 54b34 <_Watchdog_Insert> 50aca: 6026 bras 50af2 <== ALWAYS TAKEN } else if ( the_timer->the_class == TIMER_INTERVAL_ON_TASK ) { 50acc: 7201 moveq #1,%d1 50ace: b280 cmpl %d0,%d1 50ad0: 6704 beqs 50ad6 50ad2: 740b moveq #11,%d2 50ad4: 6020 bras 50af6 <== ALWAYS TAKEN if ( !timer_server ) { _Thread_Enable_dispatch(); return RTEMS_INCORRECT_STATE; } #endif _Watchdog_Remove( &the_timer->Ticker ); 50ad6: 486a 0010 pea %a2@(16) (*timer_server->schedule_operation)( timer_server, the_timer ); 50ada: 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; 50adc: 2679 0007 576e moveal 7576e <_Timer_server>,%a3 if ( !timer_server ) { _Thread_Enable_dispatch(); return RTEMS_INCORRECT_STATE; } #endif _Watchdog_Remove( &the_timer->Ticker ); 50ae2: 4eb9 0005 4c50 jsr 54c50 <_Watchdog_Remove> (*timer_server->schedule_operation)( timer_server, the_timer ); 50ae8: 2f0a movel %a2,%sp@- 50aea: 2f0b movel %a3,%sp@- 50aec: 206b 0004 moveal %a3@(4),%a0 50af0: 4e90 jsr %a0@ 50af2: 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(); 50af6: 4eb9 0005 38b6 jsr 538b6 <_Thread_Enable_dispatch> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 50afc: 2002 movel %d2,%d0 50afe: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3 50b04: 4e5e unlk %fp 50b06: 4e75 rts 00050b08 : rtems_id id, rtems_interval ticks, rtems_timer_service_routine_entry routine, void *user_data ) { 50b08: 4e56 ffe4 linkw %fp,#-28 50b0c: 48d7 1c1c moveml %d2-%d4/%a2-%a4,%sp@ 50b10: 262e 0008 movel %fp@(8),%d3 50b14: 242e 000c movel %fp@(12),%d2 50b18: 282e 0010 movel %fp@(16),%d4 Timer_Control *the_timer; Objects_Locations location; ISR_Level level; Timer_server_Control *timer_server = _Timer_server; 50b1c: 2679 0007 576e moveal 7576e <_Timer_server>,%a3 if ( !timer_server ) 50b22: 4a8b tstl %a3 50b24: 6606 bnes 50b2c 50b26: 700e moveq #14,%d0 50b28: 6000 008e braw 50bb8 <== ALWAYS TAKEN return RTEMS_INCORRECT_STATE; if ( !routine ) 50b2c: 4a84 tstl %d4 50b2e: 6606 bnes 50b36 50b30: 7009 moveq #9,%d0 50b32: 6000 0084 braw 50bb8 <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; if ( ticks == 0 ) 50b36: 4a82 tstl %d2 50b38: 6604 bnes 50b3e 50b3a: 700a moveq #10,%d0 50b3c: 607a bras 50bb8 <== ALWAYS TAKEN 50b3e: 486e fffc pea %fp@(-4) 50b42: 2f03 movel %d3,%sp@- 50b44: 4879 0007 5734 pea 75734 <_Timer_Information> 50b4a: 4eb9 0005 3030 jsr 53030 <_Objects_Get> return RTEMS_INVALID_NUMBER; the_timer = _Timer_Get( id, &location ); switch ( location ) { 50b50: 4fef 000c lea %sp@(12),%sp 50b54: 2440 moveal %d0,%a2 50b56: 4aae fffc tstl %fp@(-4) 50b5a: 6704 beqs 50b60 50b5c: 7004 moveq #4,%d0 50b5e: 6058 bras 50bb8 <== ALWAYS TAKEN case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); 50b60: 486a 0010 pea %a2@(16) 50b64: 4eb9 0005 4c50 jsr 54c50 <_Watchdog_Remove> _ISR_Disable( level ); 50b6a: 203c 0000 0700 movel #1792,%d0 50b70: 40c1 movew %sr,%d1 50b72: 8081 orl %d1,%d0 50b74: 46c0 movew %d0,%sr 50b76: 49f9 0005 38b6 lea 538b6 <_Thread_Enable_dispatch>,%a4 /* * 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 ) { 50b7c: 588f addql #4,%sp 50b7e: 4aaa 0018 tstl %a2@(24) 50b82: 6706 beqs 50b8a _ISR_Enable( level ); 50b84: 46c1 movew %d1,%sr _Thread_Enable_dispatch(); 50b86: 4e94 jsr %a4@ 50b88: 602c bras 50bb6 <== ALWAYS TAKEN /* * 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_ON_TASK; 50b8a: 7001 moveq #1,%d0 ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 50b8c: 256e 0014 0034 movel %fp@(20),%a2@(52) Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 50b92: 2544 002c movel %d4,%a2@(44) the_watchdog->id = id; 50b96: 2543 0030 movel %d3,%a2@(48) _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = ticks; 50b9a: 2542 001c movel %d2,%a2@(28) /* * 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_ON_TASK; 50b9e: 2540 0038 movel %d0,%a2@(56) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 50ba2: 42aa 0018 clrl %a2@(24) _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = ticks; _ISR_Enable( level ); 50ba6: 46c1 movew %d1,%sr (*timer_server->schedule_operation)( timer_server, the_timer ); 50ba8: 2f0a movel %a2,%sp@- 50baa: 2f0b movel %a3,%sp@- 50bac: 206b 0004 moveal %a3@(4),%a0 50bb0: 4e90 jsr %a0@ _Thread_Enable_dispatch(); 50bb2: 4e94 jsr %a4@ return RTEMS_SUCCESSFUL; 50bb4: 508f addql #8,%sp the_timer->Ticker.initial = ticks; _ISR_Enable( level ); (*timer_server->schedule_operation)( timer_server, the_timer ); _Thread_Enable_dispatch(); 50bb6: 4280 clrl %d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 50bb8: 4cee 1c1c ffe4 moveml %fp@(-28),%d2-%d4/%a2-%a4 50bbe: 4e5e unlk %fp 50bc0: 4e75 rts ... 00050bc4 : rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ) { 50bc4: 4e56 ffe8 linkw %fp,#-24 50bc8: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 50bcc: 282e 0008 movel %fp@(8),%d4 50bd0: 262e 000c movel %fp@(12),%d3 50bd4: 242e 0010 movel %fp@(16),%d2 Timer_Control *the_timer; Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; 50bd8: 2679 0007 576e moveal 7576e <_Timer_server>,%a3 if ( !timer_server ) 50bde: 4a8b tstl %a3 50be0: 6606 bnes 50be8 50be2: 700e moveq #14,%d0 50be4: 6000 00a4 braw 50c8a return RTEMS_INCORRECT_STATE; if ( !_TOD_Is_set ) 50be8: 4a39 0007 4edc tstb 74edc <_TOD_Is_set> 50bee: 6606 bnes 50bf6 <== NEVER TAKEN 50bf0: 700b moveq #11,%d0 <== NOT EXECUTED 50bf2: 6000 0096 braw 50c8a <== NOT EXECUTED return RTEMS_NOT_DEFINED; if ( !routine ) 50bf6: 4a82 tstl %d2 50bf8: 6606 bnes 50c00 50bfa: 7009 moveq #9,%d0 50bfc: 6000 008c braw 50c8a <== ALWAYS TAKEN return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) 50c00: 2f03 movel %d3,%sp@- 50c02: 4eb9 0004 e040 jsr 4e040 <_TOD_Validate> 50c08: 588f addql #4,%sp 50c0a: 4a00 tstb %d0 50c0c: 677a beqs 50c88 return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 50c0e: 2f03 movel %d3,%sp@- 50c10: 4eb9 0004 dfa0 jsr 4dfa0 <_TOD_To_seconds> if ( seconds <= _TOD_Seconds_since_epoch() ) 50c16: 588f addql #4,%sp return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 50c18: 2600 movel %d0,%d3 if ( seconds <= _TOD_Seconds_since_epoch() ) 50c1a: b0b9 0007 4f5a cmpl 74f5a <_TOD_Now>,%d0 50c20: 6366 blss 50c88 50c22: 486e fffc pea %fp@(-4) 50c26: 2f04 movel %d4,%sp@- 50c28: 4879 0007 5734 pea 75734 <_Timer_Information> 50c2e: 4eb9 0005 3030 jsr 53030 <_Objects_Get> return RTEMS_INVALID_CLOCK; the_timer = _Timer_Get( id, &location ); switch ( location ) { 50c34: 4fef 000c lea %sp@(12),%sp 50c38: 2440 moveal %d0,%a2 50c3a: 4aae fffc tstl %fp@(-4) 50c3e: 6704 beqs 50c44 50c40: 7004 moveq #4,%d0 50c42: 6046 bras 50c8a <== ALWAYS TAKEN case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); 50c44: 486a 0010 pea %a2@(16) 50c48: 4eb9 0005 4c50 jsr 54c50 <_Watchdog_Remove> the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 50c4e: 256e 0014 0034 movel %fp@(20),%a2@(52) the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK; 50c54: 7003 moveq #3,%d0 void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; 50c56: 2544 0030 movel %d4,%a2@(48) _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); 50c5a: 96b9 0007 4f5a subl 74f5a <_TOD_Now>,%d3 the_timer = _Timer_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK; 50c60: 2540 0038 movel %d0,%a2@(56) _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); 50c64: 2543 001c movel %d3,%a2@(28) Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 50c68: 2542 002c movel %d2,%a2@(44) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 50c6c: 42aa 0018 clrl %a2@(24) (*timer_server->schedule_operation)( timer_server, the_timer ); 50c70: 2f0a movel %a2,%sp@- 50c72: 2f0b movel %a3,%sp@- 50c74: 206b 0004 moveal %a3@(4),%a0 50c78: 4e90 jsr %a0@ _Thread_Enable_dispatch(); 50c7a: 4eb9 0005 38b6 jsr 538b6 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 50c80: 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(); 50c84: 4280 clrl %d0 return RTEMS_SUCCESSFUL; 50c86: 6002 bras 50c8a <== ALWAYS TAKEN 50c88: 7014 moveq #20,%d0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 50c8a: 4cee 0c1c ffe8 moveml %fp@(-24),%d2-%d4/%a2-%a3 50c90: 4e5e unlk %fp 50c92: 4e75 rts 000459fc : */ bool rtems_workspace_allocate( uintptr_t bytes, void **pointer ) { 459fc: 4e56 0000 linkw %fp,#0 45a00: 202e 0008 movel %fp@(8),%d0 45a04: 2f0a movel %a2,%sp@- 45a06: 246e 000c moveal %fp@(12),%a2 void *ptr; /* * check the arguments */ if ( !pointer ) 45a0a: 4a8a tstl %a2 45a0c: 6724 beqs 45a32 return false; if ( !bytes ) 45a0e: 4a80 tstl %d0 45a10: 6720 beqs 45a32 RTEMS_INLINE_ROUTINE void *_Protected_heap_Allocate( Heap_Control *heap, uintptr_t size ) { return _Protected_heap_Allocate_aligned_with_boundary( heap, size, 0, 0 ); 45a12: 42a7 clrl %sp@- 45a14: 42a7 clrl %sp@- 45a16: 2f00 movel %d0,%sp@- 45a18: 4879 0005 ed02 pea 5ed02 <_Workspace_Area> 45a1e: 4eb9 0004 6d64 jsr 46d64 <_Protected_heap_Allocate_aligned_with_boundary> /* * Allocate the memory */ ptr = _Protected_heap_Allocate( &_Workspace_Area, (intptr_t) bytes ); if (!ptr) 45a24: 4fef 0010 lea %sp@(16),%sp 45a28: 4a80 tstl %d0 45a2a: 6706 beqs 45a32 return false; *pointer = ptr; 45a2c: 2480 movel %d0,%a2@ 45a2e: 7001 moveq #1,%d0 return true; 45a30: 6002 bras 45a34 <== ALWAYS TAKEN 45a32: 4200 clrb %d0 } 45a34: 246e fffc moveal %fp@(-4),%a2 45a38: 4e5e unlk %fp 45a3a: 4e75 rts 00045694 : int sched_get_priority_max( int policy ) { switch ( policy ) { 45694: 7003 moveq #3,%d0 #include int sched_get_priority_max( int policy ) { 45696: 4e56 0000 linkw %fp,#0 switch ( policy ) { 4569a: b0ae 0008 cmpl %fp@(8),%d0 4569e: 6410 bccs 456b0 case SCHED_RR: case SCHED_SPORADIC: break; default: rtems_set_errno_and_return_minus_one( EINVAL ); 456a0: 4eb9 0004 d788 jsr 4d788 <__errno> 456a6: 7216 moveq #22,%d1 456a8: 2040 moveal %d0,%a0 456aa: 70ff moveq #-1,%d0 456ac: 2081 movel %d1,%a0@ 456ae: 600a bras 456ba <== ALWAYS TAKEN } return POSIX_SCHEDULER_MAXIMUM_PRIORITY; 456b0: 4280 clrl %d0 456b2: 1039 0005 c706 moveb 5c706 ,%d0 456b8: 5380 subql #1,%d0 } 456ba: 4e5e unlk %fp 456bc: 4e75 rts ... 000456c0 : int sched_get_priority_min( int policy ) { switch ( policy ) { 456c0: 7003 moveq #3,%d0 #include int sched_get_priority_min( int policy ) { 456c2: 4e56 0000 linkw %fp,#0 switch ( policy ) { 456c6: b0ae 0008 cmpl %fp@(8),%d0 456ca: 6506 bcss 456d2 456cc: 103c 0001 moveb #1,%d0 456d0: 600e bras 456e0 <== ALWAYS TAKEN case SCHED_RR: case SCHED_SPORADIC: break; default: rtems_set_errno_and_return_minus_one( EINVAL ); 456d2: 4eb9 0004 d788 jsr 4d788 <__errno> 456d8: 7216 moveq #22,%d1 456da: 2040 moveal %d0,%a0 456dc: 70ff moveq #-1,%d0 456de: 2081 movel %d1,%a0@ } return POSIX_SCHEDULER_MINIMUM_PRIORITY; } 456e0: 4e5e unlk %fp 456e2: 4e75 rts 000456e4 : int sched_rr_get_interval( pid_t pid, struct timespec *interval ) { 456e4: 4e56 0000 linkw %fp,#0 456e8: 2f03 movel %d3,%sp@- 456ea: 262e 0008 movel %fp@(8),%d3 456ee: 2f02 movel %d2,%sp@- 456f0: 242e 000c movel %fp@(12),%d2 /* * Only supported for the "calling process" (i.e. this node). */ if ( pid && pid != getpid() ) 456f4: 4a83 tstl %d3 456f6: 671a beqs 45712 <== ALWAYS TAKEN 456f8: 4eb9 0004 2994 jsr 42994 456fe: b083 cmpl %d3,%d0 45700: 6710 beqs 45712 rtems_set_errno_and_return_minus_one( ESRCH ); 45702: 4eb9 0004 d788 jsr 4d788 <__errno> 45708: 7403 moveq #3,%d2 4570a: 72ff moveq #-1,%d1 4570c: 2040 moveal %d0,%a0 4570e: 2082 movel %d2,%a0@ 45710: 6026 bras 45738 <== ALWAYS TAKEN if ( !interval ) 45712: 4a82 tstl %d2 45714: 6610 bnes 45726 rtems_set_errno_and_return_minus_one( EINVAL ); 45716: 4eb9 0004 d788 jsr 4d788 <__errno> 4571c: 72ff moveq #-1,%d1 4571e: 2040 moveal %d0,%a0 45720: 7016 moveq #22,%d0 45722: 2080 movel %d0,%a0@ 45724: 6012 bras 45738 <== ALWAYS TAKEN _Timespec_From_ticks( _Thread_Ticks_per_timeslice, interval ); 45726: 2f02 movel %d2,%sp@- 45728: 2f39 0005 de44 movel 5de44 <_Thread_Ticks_per_timeslice>,%sp@- 4572e: 4eb9 0004 882c jsr 4882c <_Timespec_From_ticks> return 0; 45734: 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 ); 45736: 4281 clrl %d1 return 0; } 45738: 242e fff8 movel %fp@(-8),%d2 4573c: 2001 movel %d1,%d0 4573e: 262e fffc movel %fp@(-4),%d3 45742: 4e5e unlk %fp 45744: 4e75 rts ... 00047a64 : */ int sem_close( sem_t *sem ) { 47a64: 4e56 fffc linkw %fp,#-4 47a68: 206e 0008 moveal %fp@(8),%a0 RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Get ( sem_t *id, Objects_Locations *location ) { return (POSIX_Semaphore_Control *) 47a6c: 486e fffc pea %fp@(-4) 47a70: 2f10 movel %a0@,%sp@- 47a72: 4879 0006 1dea pea 61dea <_POSIX_Semaphore_Information> 47a78: 4eb9 0004 9970 jsr 49970 <_Objects_Get> register POSIX_Semaphore_Control *the_semaphore; Objects_Locations location; the_semaphore = _POSIX_Semaphore_Get( sem, &location ); switch ( location ) { 47a7e: 4fef 000c lea %sp@(12),%sp 47a82: 4aae fffc tstl %fp@(-4) 47a86: 661a bnes 47aa2 case OBJECTS_LOCAL: the_semaphore->open_count -= 1; 47a88: 2040 moveal %d0,%a0 47a8a: 53a8 0016 subql #1,%a0@(22) _POSIX_Semaphore_Delete( the_semaphore ); 47a8e: 2f00 movel %d0,%sp@- 47a90: 4eb9 0004 d420 jsr 4d420 <_POSIX_Semaphore_Delete> _Thread_Enable_dispatch(); 47a96: 4eb9 0004 a1c2 jsr 4a1c2 <_Thread_Enable_dispatch> return 0; 47a9c: 588f addql #4,%sp switch ( location ) { case OBJECTS_LOCAL: the_semaphore->open_count -= 1; _POSIX_Semaphore_Delete( the_semaphore ); _Thread_Enable_dispatch(); 47a9e: 4280 clrl %d0 return 0; 47aa0: 600e bras 47ab0 <== ALWAYS TAKEN #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EINVAL ); 47aa2: 4eb9 0005 08a0 jsr 508a0 <__errno> 47aa8: 7216 moveq #22,%d1 47aaa: 2040 moveal %d0,%a0 47aac: 70ff moveq #-1,%d0 47aae: 2081 movel %d1,%a0@ } 47ab0: 4e5e unlk %fp 47ab2: 4e75 rts 00047ab4 : */ int sem_destroy( sem_t *sem ) { 47ab4: 4e56 fffc linkw %fp,#-4 47ab8: 206e 0008 moveal %fp@(8),%a0 47abc: 2f0a movel %a2,%sp@- 47abe: 486e fffc pea %fp@(-4) 47ac2: 2f10 movel %a0@,%sp@- 47ac4: 4879 0006 1dea pea 61dea <_POSIX_Semaphore_Information> 47aca: 4eb9 0004 9970 jsr 49970 <_Objects_Get> register POSIX_Semaphore_Control *the_semaphore; Objects_Locations location; the_semaphore = _POSIX_Semaphore_Get( sem, &location ); switch ( location ) { 47ad0: 4fef 000c lea %sp@(12),%sp 47ad4: 4aae fffc tstl %fp@(-4) 47ad8: 6622 bnes 47afc 47ada: 45f9 0004 a1c2 lea 4a1c2 <_Thread_Enable_dispatch>,%a2 case OBJECTS_LOCAL: /* * Undefined operation on a named semaphore. */ if ( the_semaphore->named == true ) { 47ae0: 2040 moveal %d0,%a0 47ae2: 4a28 0014 tstb %a0@(20) 47ae6: 6704 beqs 47aec _Thread_Enable_dispatch(); 47ae8: 4e92 jsr %a2@ 47aea: 6010 bras 47afc <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); } _POSIX_Semaphore_Delete( the_semaphore ); 47aec: 2f00 movel %d0,%sp@- 47aee: 4eb9 0004 d420 jsr 4d420 <_POSIX_Semaphore_Delete> _Thread_Enable_dispatch(); 47af4: 4e92 jsr %a2@ return 0; 47af6: 588f addql #4,%sp _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EINVAL ); } _POSIX_Semaphore_Delete( the_semaphore ); _Thread_Enable_dispatch(); 47af8: 4281 clrl %d1 return 0; 47afa: 600e bras 47b0a <== ALWAYS TAKEN #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EINVAL ); 47afc: 4eb9 0005 08a0 jsr 508a0 <__errno> 47b02: 72ff moveq #-1,%d1 47b04: 2040 moveal %d0,%a0 47b06: 7016 moveq #22,%d0 47b08: 2080 movel %d0,%a0@ } 47b0a: 246e fff8 moveal %fp@(-8),%a2 47b0e: 2001 movel %d1,%d0 47b10: 4e5e unlk %fp 47b12: 4e75 rts 00047b14 : int sem_getvalue( sem_t *sem, int *sval ) { 47b14: 4e56 fffc linkw %fp,#-4 47b18: 206e 0008 moveal %fp@(8),%a0 47b1c: 486e fffc pea %fp@(-4) 47b20: 2f10 movel %a0@,%sp@- 47b22: 4879 0006 1dea pea 61dea <_POSIX_Semaphore_Information> 47b28: 4eb9 0004 9970 jsr 49970 <_Objects_Get> register POSIX_Semaphore_Control *the_semaphore; Objects_Locations location; the_semaphore = _POSIX_Semaphore_Get( sem, &location ); switch ( location ) { 47b2e: 4fef 000c lea %sp@(12),%sp 47b32: 4aae fffc tstl %fp@(-4) 47b36: 6614 bnes 47b4c case OBJECTS_LOCAL: *sval = _CORE_semaphore_Get_count( &the_semaphore->Semaphore ); 47b38: 206e 000c moveal %fp@(12),%a0 47b3c: 2240 moveal %d0,%a1 47b3e: 20a9 0062 movel %a1@(98),%a0@ _Thread_Enable_dispatch(); 47b42: 4eb9 0004 a1c2 jsr 4a1c2 <_Thread_Enable_dispatch> 47b48: 4280 clrl %d0 return 0; 47b4a: 600e bras 47b5a <== ALWAYS TAKEN #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EINVAL ); 47b4c: 4eb9 0005 08a0 jsr 508a0 <__errno> 47b52: 7216 moveq #22,%d1 47b54: 2040 moveal %d0,%a0 47b56: 70ff moveq #-1,%d0 47b58: 2081 movel %d1,%a0@ } 47b5a: 4e5e unlk %fp 47b5c: 4e75 rts ... 00047b60 : int sem_init( sem_t *sem, int pshared, unsigned int value ) { 47b60: 4e56 fffc linkw %fp,#-4 47b64: 2f0a movel %a2,%sp@- 47b66: 246e 0008 moveal %fp@(8),%a2 int status; POSIX_Semaphore_Control *the_semaphore; if ( !sem ) 47b6a: 4a8a tstl %a2 47b6c: 6610 bnes 47b7e rtems_set_errno_and_return_minus_one( EINVAL ); 47b6e: 4eb9 0005 08a0 jsr 508a0 <__errno> 47b74: 7216 moveq #22,%d1 47b76: 2040 moveal %d0,%a0 47b78: 70ff moveq #-1,%d0 47b7a: 2081 movel %d1,%a0@ 47b7c: 6026 bras 47ba4 <== ALWAYS TAKEN status = _POSIX_Semaphore_Create_support( 47b7e: 486e fffc pea %fp@(-4) 47b82: 2f2e 0010 movel %fp@(16),%sp@- 47b86: 2f2e 000c movel %fp@(12),%sp@- 47b8a: 42a7 clrl %sp@- 47b8c: 4eb9 0004 d328 jsr 4d328 <_POSIX_Semaphore_Create_support> pshared, value, &the_semaphore ); if ( status != -1 ) 47b92: 4fef 0010 lea %sp@(16),%sp 47b96: 72ff moveq #-1,%d1 47b98: b280 cmpl %d0,%d1 47b9a: 6708 beqs 47ba4 *sem = the_semaphore->Object.id; 47b9c: 206e fffc moveal %fp@(-4),%a0 47ba0: 24a8 0008 movel %a0@(8),%a2@ return status; } 47ba4: 246e fff8 moveal %fp@(-8),%a2 47ba8: 4e5e unlk %fp 47baa: 4e75 rts 00047bac : int oflag, ... /* mode_t mode, */ /* unsigned int value */ ) { 47bac: 4e56 ffe0 linkw %fp,#-32 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 47bb0: 2039 0006 1b90 movel 61b90 <_Thread_Dispatch_disable_level>,%d0 47bb6: 5280 addql #1,%d0 47bb8: 48d7 043c moveml %d2-%d5/%a2,%sp@ 47bbc: 23c0 0006 1b90 movel %d0,61b90 <_Thread_Dispatch_disable_level> 47bc2: 242e 0008 movel %fp@(8),%d2 47bc6: 282e 000c movel %fp@(12),%d4 POSIX_Semaphore_Control *the_semaphore; Objects_Locations location; _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { 47bca: 2a04 movel %d4,%d5 47bcc: 0285 0000 0200 andil #512,%d5 47bd2: 6604 bnes 47bd8 47bd4: 4283 clrl %d3 47bd6: 6004 bras 47bdc <== ALWAYS TAKEN va_start(arg, oflag); mode = (mode_t) va_arg( arg, unsigned int ); value = va_arg( arg, unsigned int ); 47bd8: 262e 0014 movel %fp@(20),%d3 va_end(arg); } status = _POSIX_Semaphore_Name_to_id( name, &the_semaphore_id ); 47bdc: 486e fffc pea %fp@(-4) 47be0: 2f02 movel %d2,%sp@- 47be2: 4eb9 0004 d470 jsr 4d470 <_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 ) { 47be8: 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 ); 47bea: 2440 moveal %d0,%a2 * and we can just return a pointer to the id. Otherwise we may * need to check to see if this is a "semaphore does not exist" * or some other miscellaneous error on the name. */ if ( status ) { 47bec: 4a80 tstl %d0 47bee: 671e beqs 47c0e <== ALWAYS TAKEN /* * 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) ) ) { 47bf0: 7002 moveq #2,%d0 47bf2: b08a cmpl %a2,%d0 47bf4: 6604 bnes 47bfa <== ALWAYS TAKEN 47bf6: 4a85 tstl %d5 47bf8: 6662 bnes 47c5c <== ALWAYS TAKEN _Thread_Enable_dispatch(); 47bfa: 4eb9 0004 a1c2 jsr 4a1c2 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one_cast( status, sem_t * ); 47c00: 4eb9 0005 08a0 jsr 508a0 <__errno> 47c06: 72ff moveq #-1,%d1 47c08: 2040 moveal %d0,%a0 47c0a: 208a movel %a2,%a0@ 47c0c: 607a bras 47c88 <== ALWAYS TAKEN 47c0e: 45f9 0004 a1c2 lea 4a1c2 <_Thread_Enable_dispatch>,%a2 /* * Check for existence with creation. */ if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { 47c14: 0284 0000 0a00 andil #2560,%d4 47c1a: 0c84 0000 0a00 cmpil #2560,%d4 47c20: 6612 bnes 47c34 _Thread_Enable_dispatch(); 47c22: 4e92 jsr %a2@ rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * ); 47c24: 4eb9 0005 08a0 jsr 508a0 <__errno> 47c2a: 72ff moveq #-1,%d1 47c2c: 2040 moveal %d0,%a0 47c2e: 7011 moveq #17,%d0 47c30: 2080 movel %d0,%a0@ 47c32: 6054 bras 47c88 <== ALWAYS TAKEN 47c34: 486e fff4 pea %fp@(-12) 47c38: 2f2e fffc movel %fp@(-4),%sp@- 47c3c: 4879 0006 1dea pea 61dea <_POSIX_Semaphore_Information> 47c42: 4eb9 0004 9970 jsr 49970 <_Objects_Get> } the_semaphore = _POSIX_Semaphore_Get( &the_semaphore_id, &location ); the_semaphore->open_count += 1; 47c48: 2040 moveal %d0,%a0 47c4a: 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 ); 47c4e: 2d40 fff8 movel %d0,%fp@(-8) the_semaphore->open_count += 1; _Thread_Enable_dispatch(); 47c52: 4e92 jsr %a2@ _Thread_Enable_dispatch(); 47c54: 4e92 jsr %a2@ goto return_id; 47c56: 4fef 000c lea %sp@(12),%sp 47c5a: 6026 bras 47c82 <== 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( 47c5c: 486e fff8 pea %fp@(-8) 47c60: 2f03 movel %d3,%sp@- 47c62: 42a7 clrl %sp@- 47c64: 2f02 movel %d2,%sp@- 47c66: 4eb9 0004 d328 jsr 4d328 <_POSIX_Semaphore_Create_support> 47c6c: 2400 movel %d0,%d2 /* * errno was set by Create_support, so don't set it again. */ _Thread_Enable_dispatch(); 47c6e: 4eb9 0004 a1c2 jsr 4a1c2 <_Thread_Enable_dispatch> if ( status == -1 ) 47c74: 4fef 0010 lea %sp@(16),%sp 47c78: 70ff moveq #-1,%d0 47c7a: b082 cmpl %d2,%d0 47c7c: 6604 bnes 47c82 47c7e: 72ff moveq #-1,%d1 47c80: 6006 bras 47c88 <== ALWAYS TAKEN 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; 47c82: 222e fff8 movel %fp@(-8),%d1 47c86: 5081 addql #8,%d1 #endif return id; } 47c88: 2001 movel %d1,%d0 47c8a: 4cee 043c ffe0 moveml %fp@(-32),%d2-%d5/%a2 47c90: 4e5e unlk %fp 47c92: 4e75 rts 00047c94 : */ int sem_post( sem_t *sem ) { 47c94: 4e56 fffc linkw %fp,#-4 47c98: 206e 0008 moveal %fp@(8),%a0 47c9c: 486e fffc pea %fp@(-4) 47ca0: 2f10 movel %a0@,%sp@- 47ca2: 4879 0006 1dea pea 61dea <_POSIX_Semaphore_Information> 47ca8: 4eb9 0004 9970 jsr 49970 <_Objects_Get> register POSIX_Semaphore_Control *the_semaphore; Objects_Locations location; the_semaphore = _POSIX_Semaphore_Get( sem, &location ); switch ( location ) { 47cae: 4fef 000c lea %sp@(12),%sp 47cb2: 4aae fffc tstl %fp@(-4) 47cb6: 6620 bnes 47cd8 case OBJECTS_LOCAL: _CORE_semaphore_Surrender( 47cb8: 2040 moveal %d0,%a0 47cba: 42a7 clrl %sp@- 47cbc: 2f28 0008 movel %a0@(8),%sp@- 47cc0: 4868 001a pea %a0@(26) 47cc4: 4eb9 0004 909c jsr 4909c <_CORE_semaphore_Surrender> NULL /* XXX need to define a routine to handle this case */ #else NULL #endif ); _Thread_Enable_dispatch(); 47cca: 4eb9 0004 a1c2 jsr 4a1c2 <_Thread_Enable_dispatch> return 0; 47cd0: 4fef 000c lea %sp@(12),%sp NULL /* XXX need to define a routine to handle this case */ #else NULL #endif ); _Thread_Enable_dispatch(); 47cd4: 4280 clrl %d0 return 0; 47cd6: 600e bras 47ce6 <== ALWAYS TAKEN #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EINVAL ); 47cd8: 4eb9 0005 08a0 jsr 508a0 <__errno> 47cde: 7216 moveq #22,%d1 47ce0: 2040 moveal %d0,%a0 47ce2: 70ff moveq #-1,%d0 47ce4: 2081 movel %d1,%a0@ } 47ce6: 4e5e unlk %fp 47ce8: 4e75 rts ... 00047d34 : */ int sem_unlink( const char *name ) { 47d34: 4e56 fff0 linkw %fp,#-16 47d38: 2039 0006 1b90 movel 61b90 <_Thread_Dispatch_disable_level>,%d0 47d3e: 5280 addql #1,%d0 47d40: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 47d44: 23c0 0006 1b90 movel %d0,61b90 <_Thread_Dispatch_disable_level> register POSIX_Semaphore_Control *the_semaphore; sem_t the_semaphore_id; _Thread_Disable_dispatch(); status = _POSIX_Semaphore_Name_to_id( name, &the_semaphore_id ); 47d4a: 486e fffc pea %fp@(-4) 47d4e: 45f9 0004 a1c2 lea 4a1c2 <_Thread_Enable_dispatch>,%a2 47d54: 2f2e 0008 movel %fp@(8),%sp@- 47d58: 4eb9 0004 d470 jsr 4d470 <_POSIX_Semaphore_Name_to_id> if ( status != 0 ) { 47d5e: 508f addql #8,%sp register POSIX_Semaphore_Control *the_semaphore; sem_t the_semaphore_id; _Thread_Disable_dispatch(); status = _POSIX_Semaphore_Name_to_id( name, &the_semaphore_id ); 47d60: 2400 movel %d0,%d2 if ( status != 0 ) { 47d62: 6710 beqs 47d74 _Thread_Enable_dispatch(); 47d64: 4e92 jsr %a2@ rtems_set_errno_and_return_minus_one( status ); 47d66: 4eb9 0005 08a0 jsr 508a0 <__errno> 47d6c: 2040 moveal %d0,%a0 47d6e: 70ff moveq #-1,%d0 47d70: 2082 movel %d2,%a0@ 47d72: 6034 bras 47da8 <== ALWAYS TAKEN } the_semaphore = (POSIX_Semaphore_Control *) _Objects_Get_local_object( 47d74: 4280 clrl %d0 47d76: 2079 0006 1e02 moveal 61e02 <_POSIX_Semaphore_Information+0x18>,%a0 47d7c: 302e fffe movew %fp@(-2),%d0 47d80: 2670 0c00 moveal %a0@(00000000,%d0:l:4),%a3 &_POSIX_Semaphore_Information, _Objects_Get_index( the_semaphore_id ) ); the_semaphore->linked = false; 47d84: 4200 clrb %d0 47d86: 1740 0015 moveb %d0,%a3@(21) RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Namespace_remove ( POSIX_Semaphore_Control *the_semaphore ) { _Objects_Namespace_remove( 47d8a: 2f0b movel %a3,%sp@- 47d8c: 4879 0006 1dea pea 61dea <_POSIX_Semaphore_Information> 47d92: 4eb9 0004 9ac8 jsr 49ac8 <_Objects_Namespace_remove> _POSIX_Semaphore_Namespace_remove( the_semaphore ); _POSIX_Semaphore_Delete( the_semaphore ); 47d98: 2f0b movel %a3,%sp@- 47d9a: 4eb9 0004 d420 jsr 4d420 <_POSIX_Semaphore_Delete> _Thread_Enable_dispatch(); 47da0: 4e92 jsr %a2@ return 0; 47da2: 4fef 000c lea %sp@(12),%sp the_semaphore->linked = false; _POSIX_Semaphore_Namespace_remove( the_semaphore ); _POSIX_Semaphore_Delete( the_semaphore ); _Thread_Enable_dispatch(); 47da6: 4280 clrl %d0 return 0; } 47da8: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3 47dae: 4e5e unlk %fp 47db0: 4e75 rts ... 00044c8c : int setitimer( int which, const struct itimerval *value, struct itimerval *ovalue ) { 44c8c: 4e56 0000 linkw %fp,#0 if ( !value ) 44c90: 4aae 000c tstl %fp@(12) 44c94: 6706 beqs 44c9c rtems_set_errno_and_return_minus_one( EFAULT ); if ( !ovalue ) 44c96: 4aae 0010 tstl %fp@(16) 44c9a: 660e bnes 44caa rtems_set_errno_and_return_minus_one( EFAULT ); 44c9c: 4eb9 0004 d260 jsr 4d260 <__errno> 44ca2: 2040 moveal %d0,%a0 44ca4: 700e moveq #14,%d0 44ca6: 2080 movel %d0,%a0@ 44ca8: 6020 bras 44cca <== ALWAYS TAKEN 44caa: 41f9 0004 d260 lea 4d260 <__errno>,%a0 switch ( which ) { 44cb0: 7002 moveq #2,%d0 44cb2: b0ae 0008 cmpl %fp@(8),%d0 44cb6: 650a bcss 44cc2 case ITIMER_REAL: case ITIMER_VIRTUAL: case ITIMER_PROF: rtems_set_errno_and_return_minus_one( ENOSYS ); 44cb8: 4e90 jsr %a0@ 44cba: 7258 moveq #88,%d1 44cbc: 2040 moveal %d0,%a0 44cbe: 2081 movel %d1,%a0@ 44cc0: 6008 bras 44cca <== ALWAYS TAKEN default: break; } rtems_set_errno_and_return_minus_one( EINVAL ); 44cc2: 4e90 jsr %a0@ 44cc4: 2040 moveal %d0,%a0 44cc6: 7016 moveq #22,%d0 44cc8: 2080 movel %d0,%a0@ } 44cca: 70ff moveq #-1,%d0 44ccc: 4e5e unlk %fp 44cce: 4e75 rts 000455cc : int sigaction( int sig, const struct sigaction *act, struct sigaction *oact ) { 455cc: 4e56 ffec linkw %fp,#-20 455d0: 222e 0010 movel %fp@(16),%d1 455d4: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 455d8: 242e 0008 movel %fp@(8),%d2 455dc: 246e 000c moveal %fp@(12),%a2 ISR_Level level; if ( oact ) 455e0: 4a81 tstl %d1 455e2: 6722 beqs 45606 *oact = _POSIX_signals_Vectors[ sig ]; 455e4: 2602 movel %d2,%d3 455e6: 2002 movel %d2,%d0 455e8: 4878 000c pea c 455ec: e58b lsll #2,%d3 455ee: e988 lsll #4,%d0 455f0: 9083 subl %d3,%d0 455f2: 0680 0005 ef42 addil #388930,%d0 455f8: 2f00 movel %d0,%sp@- 455fa: 2f01 movel %d1,%sp@- 455fc: 4eb9 0004 e14c jsr 4e14c 45602: 4fef 000c lea %sp@(12),%sp if ( !sig ) 45606: 4a82 tstl %d2 45608: 6710 beqs 4561a rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 4560a: 2002 movel %d2,%d0 4560c: 5380 subql #1,%d0 4560e: 721f moveq #31,%d1 45610: b280 cmpl %d0,%d1 45612: 6506 bcss 4561a * * NOTE: Solaris documentation claims to "silently enforce" this which * contradicts the POSIX specification. */ if ( sig == SIGKILL ) 45614: 7009 moveq #9,%d0 45616: b082 cmpl %d2,%d0 45618: 6610 bnes 4562a rtems_set_errno_and_return_minus_one( EINVAL ); 4561a: 4eb9 0004 d914 jsr 4d914 <__errno> 45620: 72ff moveq #-1,%d1 45622: 2040 moveal %d0,%a0 45624: 7016 moveq #22,%d0 45626: 2080 movel %d0,%a0@ 45628: 6060 bras 4568a /* * Evaluate the new action structure and set the global signal vector * appropriately. */ if ( act ) { 4562a: 4a8a tstl %a2 4562c: 675a beqs 45688 <== 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 ); 4562e: 203c 0000 0700 movel #1792,%d0 45634: 40c3 movew %sr,%d3 45636: 8083 orl %d3,%d0 45638: 46c0 movew %d0,%sr 4563a: 780c moveq #12,%d4 4563c: 47f9 0004 e14c lea 4e14c ,%a3 45642: 4c02 4800 mulsl %d2,%d4 if ( act->sa_handler == SIG_DFL ) { 45646: 4aaa 0008 tstl %a2@(8) 4564a: 661e bnes 4566a _POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ]; 4564c: 4878 000c pea c 45650: 2004 movel %d4,%d0 45652: 0680 0005 c490 addil #378000,%d0 45658: 2f00 movel %d0,%sp@- 4565a: 0684 0005 ef42 addil #388930,%d4 45660: 2f04 movel %d4,%sp@- 45662: 4e93 jsr %a3@ 45664: 4fef 000c lea %sp@(12),%sp 45668: 601c bras 45686 } else { _POSIX_signals_Clear_process_signals( sig ); 4566a: 2f02 movel %d2,%sp@- _POSIX_signals_Vectors[ sig ] = *act; 4566c: 0684 0005 ef42 addil #388930,%d4 _ISR_Disable( level ); if ( act->sa_handler == SIG_DFL ) { _POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ]; } else { _POSIX_signals_Clear_process_signals( sig ); 45672: 4eb9 0004 a6fc jsr 4a6fc <_POSIX_signals_Clear_process_signals> _POSIX_signals_Vectors[ sig ] = *act; 45678: 4878 000c pea c 4567c: 2f0a movel %a2,%sp@- 4567e: 2f04 movel %d4,%sp@- 45680: 4e93 jsr %a3@ 45682: 4fef 0010 lea %sp@(16),%sp } _ISR_Enable( level ); 45686: 46c3 movew %d3,%sr 45688: 4281 clrl %d1 * + If we are now ignoring a signal that was previously pending, * we clear the pending signal indicator. */ return 0; } 4568a: 2001 movel %d1,%d0 4568c: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 45692: 4e5e unlk %fp 45694: 4e75 rts ... 00045698 : int sigaddset( sigset_t *set, int signo ) { 45698: 4e56 0000 linkw %fp,#0 4569c: 206e 0008 moveal %fp@(8),%a0 456a0: 2f02 movel %d2,%sp@- 456a2: 242e 000c movel %fp@(12),%d2 if ( !set ) 456a6: 4a88 tstl %a0 456a8: 670c beqs 456b6 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !signo ) 456aa: 4a82 tstl %d2 456ac: 6708 beqs 456b6 456ae: 5382 subql #1,%d2 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(signo) ) 456b0: 701f moveq #31,%d0 456b2: b082 cmpl %d2,%d0 456b4: 6410 bccs 456c6 rtems_set_errno_and_return_minus_one( EINVAL ); 456b6: 4eb9 0004 d914 jsr 4d914 <__errno> 456bc: 72ff moveq #-1,%d1 456be: 2040 moveal %d0,%a0 456c0: 7016 moveq #22,%d0 456c2: 2080 movel %d0,%a0@ 456c4: 6008 bras 456ce <== ALWAYS TAKEN *set |= signo_to_mask(signo); 456c6: 7001 moveq #1,%d0 456c8: 4281 clrl %d1 456ca: e5a8 lsll %d2,%d0 456cc: 8190 orl %d0,%a0@ return 0; } 456ce: 242e fffc movel %fp@(-4),%d2 456d2: 2001 movel %d1,%d0 456d4: 4e5e unlk %fp 456d6: 4e75 rts 00047098 : int sigdelset( sigset_t *set, int signo ) { 47098: 4e56 0000 linkw %fp,#0 4709c: 226e 0008 moveal %fp@(8),%a1 470a0: 202e 000c movel %fp@(12),%d0 if ( !set ) 470a4: 4a89 tstl %a1 470a6: 6710 beqs 470b8 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !signo ) 470a8: 4a80 tstl %d0 470aa: 6604 bnes 470b0 470ac: 91c8 subal %a0,%a0 470ae: 6024 bras 470d4 <== ALWAYS TAKEN 470b0: 5380 subql #1,%d0 return 0; if ( !is_valid_signo(signo) ) 470b2: 721f moveq #31,%d1 470b4: b280 cmpl %d0,%d1 470b6: 6412 bccs 470ca rtems_set_errno_and_return_minus_one( EINVAL ); 470b8: 4eb9 0004 f3c0 jsr 4f3c0 <__errno> 470be: 307c ffff moveaw #-1,%a0 470c2: 2240 moveal %d0,%a1 470c4: 7016 moveq #22,%d0 470c6: 2280 movel %d0,%a1@ 470c8: 600a bras 470d4 <== ALWAYS TAKEN *set &= ~signo_to_mask(signo); 470ca: 7201 moveq #1,%d1 470cc: 91c8 subal %a0,%a0 470ce: e1a9 lsll %d0,%d1 470d0: 4681 notl %d1 470d2: c391 andl %d1,%a1@ return 0; } 470d4: 2008 movel %a0,%d0 470d6: 4e5e unlk %fp 470d8: 4e75 rts ... 00049b70 : #include int sigemptyset( sigset_t *set ) { 49b70: 4e56 0000 linkw %fp,#0 49b74: 206e 0008 moveal %fp@(8),%a0 if ( !set ) 49b78: 4a88 tstl %a0 49b7a: 6610 bnes 49b8c rtems_set_errno_and_return_minus_one( EINVAL ); 49b7c: 4eb9 0004 cc58 jsr 4cc58 <__errno> 49b82: 7216 moveq #22,%d1 49b84: 2040 moveal %d0,%a0 49b86: 70ff moveq #-1,%d0 49b88: 2081 movel %d1,%a0@ 49b8a: 6004 bras 49b90 <== ALWAYS TAKEN *set = 0; 49b8c: 4290 clrl %a0@ 49b8e: 4280 clrl %d0 return 0; } 49b90: 4e5e unlk %fp 49b92: 4e75 rts 00047100 : #include int sigfillset( sigset_t *set ) { 47100: 4e56 0000 linkw %fp,#0 47104: 206e 0008 moveal %fp@(8),%a0 if ( !set ) 47108: 4a88 tstl %a0 4710a: 6610 bnes 4711c rtems_set_errno_and_return_minus_one( EINVAL ); 4710c: 4eb9 0004 f3c0 jsr 4f3c0 <__errno> 47112: 7216 moveq #22,%d1 47114: 2040 moveal %d0,%a0 47116: 70ff moveq #-1,%d0 47118: 2081 movel %d1,%a0@ 4711a: 6006 bras 47122 <== ALWAYS TAKEN *set = SIGNAL_ALL_MASK; 4711c: 70ff moveq #-1,%d0 4711e: 2080 movel %d0,%a0@ 47120: 4280 clrl %d0 return 0; } 47122: 4e5e unlk %fp 47124: 4e75 rts ... 00047128 : int sigismember( const sigset_t *set, int signo ) { 47128: 4e56 0000 linkw %fp,#0 4712c: 206e 0008 moveal %fp@(8),%a0 47130: 222e 000c movel %fp@(12),%d1 if ( !set ) 47134: 4a88 tstl %a0 47136: 670c beqs 47144 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !signo ) 47138: 4a81 tstl %d1 4713a: 6724 beqs 47160 4713c: 5381 subql #1,%d1 return 0; if ( !is_valid_signo(signo) ) 4713e: 701f moveq #31,%d0 47140: b081 cmpl %d1,%d0 47142: 6410 bccs 47154 rtems_set_errno_and_return_minus_one( EINVAL ); 47144: 4eb9 0004 f3c0 jsr 4f3c0 <__errno> 4714a: 72ff moveq #-1,%d1 4714c: 2040 moveal %d0,%a0 4714e: 7016 moveq #22,%d0 47150: 2080 movel %d0,%a0@ 47152: 600c bras 47160 <== ALWAYS TAKEN 47154: 7001 moveq #1,%d0 47156: e3a8 lsll %d1,%d0 47158: c090 andl %a0@,%d0 4715a: 56c1 sne %d1 4715c: 49c1 extbl %d1 4715e: 4481 negl %d1 if ( *set & signo_to_mask(signo) ) return 1; return 0; } 47160: 2001 movel %d1,%d0 47162: 4e5e unlk %fp 47164: 4e75 rts ... 000456fc : #include int sigpending( sigset_t *set ) { 456fc: 4e56 0000 linkw %fp,#0 45700: 206e 0008 moveal %fp@(8),%a0 POSIX_API_Control *api; if ( !set ) 45704: 4a88 tstl %a0 45706: 6610 bnes 45718 rtems_set_errno_and_return_minus_one( EINVAL ); 45708: 4eb9 0004 d914 jsr 4d914 <__errno> 4570e: 7216 moveq #22,%d1 45710: 2040 moveal %d0,%a0 45712: 70ff moveq #-1,%d0 45714: 2081 movel %d1,%a0@ 45716: 6018 bras 45730 <== ALWAYS TAKEN api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; *set = api->signals_pending | _POSIX_signals_Pending; 45718: 2279 0005 eb4e moveal 5eb4e <_Thread_Executing>,%a1 4571e: 4280 clrl %d0 45720: 2239 0005 f10e movel 5f10e <_POSIX_signals_Pending>,%d1 45726: 2269 010e moveal %a1@(270),%a1 4572a: 82a9 00c8 orl %a1@(200),%d1 4572e: 2081 movel %d1,%a0@ return 0; } 45730: 4e5e unlk %fp 45732: 4e75 rts 000471c8 : #include int sigsuspend( const sigset_t *sigmask ) { 471c8: 4e56 ffec linkw %fp,#-20 471cc: 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 ); 471d0: 240e movel %fp,%d2 471d2: 5982 subql #4,%d2 471d4: 45f9 0004 71a0 lea 471a0 ,%a2 (void) sigfillset( &all_signals ); 471da: 260e movel %fp,%d3 471dc: 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 ); 471de: 2f02 movel %d2,%sp@- 471e0: 2f2e 0008 movel %fp@(8),%sp@- 471e4: 4878 0001 pea 1 471e8: 4e92 jsr %a2@ (void) sigfillset( &all_signals ); 471ea: 2f03 movel %d3,%sp@- 471ec: 4eb9 0004 7100 jsr 47100 status = sigtimedwait( &all_signals, NULL, NULL ); 471f2: 42a7 clrl %sp@- 471f4: 42a7 clrl %sp@- 471f6: 2f03 movel %d3,%sp@- 471f8: 4eb9 0004 7278 jsr 47278 471fe: 2600 movel %d0,%d3 (void) sigprocmask( SIG_SETMASK, &saved_signals_blocked, NULL ); 47200: 42a7 clrl %sp@- 47202: 2f02 movel %d2,%sp@- 47204: 42a7 clrl %sp@- 47206: 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 ) 47208: 4fef 0028 lea %sp@(40),%sp 4720c: 70ff moveq #-1,%d0 4720e: b083 cmpl %d3,%d0 47210: 670c beqs 4721e <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINTR ); 47212: 4eb9 0004 f3c0 jsr 4f3c0 <__errno> 47218: 2040 moveal %d0,%a0 4721a: 7004 moveq #4,%d0 4721c: 2080 movel %d0,%a0@ return status; } 4721e: 70ff moveq #-1,%d0 47220: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 47226: 4e5e unlk %fp 47228: 4e75 rts ... 000459b4 : int sigtimedwait( const sigset_t *set, siginfo_t *info, const struct timespec *timeout ) { 459b4: 4e56 ffd8 linkw %fp,#-40 459b8: 48d7 3c1c moveml %d2-%d4/%a2-%a5,%sp@ 459bc: 286e 0008 moveal %fp@(8),%a4 459c0: 246e 000c moveal %fp@(12),%a2 459c4: 242e 0010 movel %fp@(16),%d2 ISR_Level level; /* * Error check parameters before disabling interrupts. */ if ( !set ) 459c8: 4a8c tstl %a4 459ca: 6732 beqs 459fe /* NOTE: This is very specifically a RELATIVE not ABSOLUTE time * in the Open Group specification. */ interval = 0; if ( timeout ) { 459cc: 4a82 tstl %d2 459ce: 6740 beqs 45a10 if ( !_Timespec_Is_valid( timeout ) ) 459d0: 2f02 movel %d2,%sp@- 459d2: 4eb9 0004 8b90 jsr 48b90 <_Timespec_Is_valid> 459d8: 588f addql #4,%sp 459da: 4a00 tstb %d0 459dc: 6612 bnes 459f0 rtems_set_errno_and_return_minus_one( EINVAL ); 459de: 4eb9 0004 dc44 jsr 4dc44 <__errno> 459e4: 7816 moveq #22,%d4 459e6: 74ff moveq #-1,%d2 459e8: 2240 moveal %d0,%a1 459ea: 2284 movel %d4,%a1@ 459ec: 6000 012e braw 45b1c <== ALWAYS TAKEN interval = _Timespec_To_ticks( timeout ); 459f0: 2f02 movel %d2,%sp@- 459f2: 4eb9 0004 8c00 jsr 48c00 <_Timespec_To_ticks> if ( !interval ) 459f8: 588f addql #4,%sp 459fa: 4a80 tstl %d0 459fc: 6614 bnes 45a12 <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); 459fe: 4eb9 0004 dc44 jsr 4dc44 <__errno> 45a04: 7616 moveq #22,%d3 45a06: 74ff moveq #-1,%d2 45a08: 2040 moveal %d0,%a0 45a0a: 2083 movel %d3,%a0@ 45a0c: 6000 010e braw 45b1c <== ALWAYS TAKEN 45a10: 4280 clrl %d0 /* * Initialize local variables. */ the_info = ( info ) ? info : &signal_information; 45a12: 4a8a tstl %a2 45a14: 6604 bnes 45a1a 45a16: 45ee fff4 lea %fp@(-12),%a2 the_thread = _Thread_Executing; 45a1a: 2079 0005 eefe moveal 5eefe <_Thread_Executing>,%a0 * What if they are already pending? */ /* API signals pending? */ _ISR_Disable( level ); 45a20: 223c 0000 0700 movel #1792,%d1 the_info = ( info ) ? info : &signal_information; the_thread = _Thread_Executing; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 45a26: 2668 010e moveal %a0@(270),%a3 * What if they are already pending? */ /* API signals pending? */ _ISR_Disable( level ); 45a2a: 40c3 movew %sr,%d3 45a2c: 8283 orl %d3,%d1 45a2e: 46c1 movew %d1,%sr if ( *set & api->signals_pending ) { 45a30: 2414 movel %a4@,%d2 45a32: 2802 movel %d2,%d4 45a34: 222b 00c8 movel %a3@(200),%d1 45a38: c881 andl %d1,%d4 45a3a: 6730 beqs 45a6c /* XXX real info later */ the_info->si_signo = _POSIX_signals_Get_highest( api->signals_pending ); 45a3c: 2f01 movel %d1,%sp@- 45a3e: 4eb9 0004 5968 jsr 45968 <_POSIX_signals_Get_highest> 45a44: 2480 movel %d0,%a2@ _POSIX_signals_Clear_signals( 45a46: 42a7 clrl %sp@- 45a48: 42a7 clrl %sp@- 45a4a: 2f0a movel %a2,%sp@- 45a4c: 2f00 movel %d0,%sp@- 45a4e: 2f0b movel %a3,%sp@- 45a50: 4eb9 0004 ad34 jsr 4ad34 <_POSIX_signals_Clear_signals> the_info->si_signo, the_info, false, false ); _ISR_Enable( level ); 45a56: 46c3 movew %d3,%sr the_info->si_code = SI_USER; 45a58: 7001 moveq #1,%d0 the_info->si_value.sival_int = 0; return the_info->si_signo; 45a5a: 4fef 0018 lea %sp@(24),%sp false, false ); _ISR_Enable( level ); the_info->si_code = SI_USER; 45a5e: 2540 0004 movel %d0,%a2@(4) the_info->si_value.sival_int = 0; return the_info->si_signo; 45a62: 2412 movel %a2@,%d2 false ); _ISR_Enable( level ); the_info->si_code = SI_USER; the_info->si_value.sival_int = 0; 45a64: 42aa 0008 clrl %a2@(8) return the_info->si_signo; 45a68: 6000 00b2 braw 45b1c <== ALWAYS TAKEN } /* Process pending signals? */ if ( *set & _POSIX_signals_Pending ) { 45a6c: 2239 0005 f4be movel 5f4be <_POSIX_signals_Pending>,%d1 45a72: 4bf9 0004 ad34 lea 4ad34 <_POSIX_signals_Clear_signals>,%a5 45a78: c481 andl %d1,%d2 45a7a: 672c beqs 45aa8 signo = _POSIX_signals_Get_highest( _POSIX_signals_Pending ); 45a7c: 2f01 movel %d1,%sp@- 45a7e: 4eb9 0004 5968 jsr 45968 <_POSIX_signals_Get_highest> 45a84: 2400 movel %d0,%d2 _POSIX_signals_Clear_signals( api, signo, the_info, true, false ); 45a86: 42a7 clrl %sp@- 45a88: 4878 0001 pea 1 45a8c: 2f0a movel %a2,%sp@- 45a8e: 2f00 movel %d0,%sp@- 45a90: 2f0b movel %a3,%sp@- 45a92: 4e95 jsr %a5@ _ISR_Enable( level ); 45a94: 46c3 movew %d3,%sr the_info->si_signo = signo; the_info->si_code = SI_USER; 45a96: 7201 moveq #1,%d1 the_info->si_value.sival_int = 0; return signo; 45a98: 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; 45a9c: 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; 45aa0: 2482 movel %d2,%a2@ the_info->si_code = SI_USER; 45aa2: 2541 0004 movel %d1,%a2@(4) the_info->si_value.sival_int = 0; return signo; 45aa6: 6074 bras 45b1c <== ALWAYS TAKEN 45aa8: 2239 0005 ee44 movel 5ee44 <_Thread_Dispatch_disable_level>,%d1 45aae: 5281 addql #1,%d1 45ab0: 23c1 0005 ee44 movel %d1,5ee44 <_Thread_Dispatch_disable_level> } the_info->si_signo = -1; 45ab6: 72ff moveq #-1,%d1 45ab8: 2481 movel %d1,%a2@ _Thread_Disable_dispatch(); the_thread->Wait.queue = &_POSIX_signals_Wait_queue; the_thread->Wait.return_code = EINTR; 45aba: 7204 moveq #4,%d1 } the_info->si_signo = -1; _Thread_Disable_dispatch(); the_thread->Wait.queue = &_POSIX_signals_Wait_queue; 45abc: 43f9 0005 f47e lea 5f47e <_POSIX_signals_Wait_queue>,%a1 the_thread->Wait.return_code = EINTR; 45ac2: 2141 0034 movel %d1,%a0@(52) the_thread->Wait.option = *set; 45ac6: 2154 0030 movel %a4@,%a0@(48) RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section ( Thread_queue_Control *the_thread_queue ) { the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 45aca: 123c 0001 moveb #1,%d1 the_thread->Wait.return_argument = the_info; 45ace: 214a 0028 movel %a2,%a0@(40) } the_info->si_signo = -1; _Thread_Disable_dispatch(); the_thread->Wait.queue = &_POSIX_signals_Wait_queue; 45ad2: 2149 0044 movel %a1,%a0@(68) 45ad6: 23c1 0005 f4ae movel %d1,5f4ae <_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 ); 45adc: 46c3 movew %d3,%sr _Thread_queue_Enqueue( &_POSIX_signals_Wait_queue, interval ); 45ade: 4879 0004 8650 pea 48650 <_Thread_queue_Timeout> 45ae4: 2f00 movel %d0,%sp@- 45ae6: 4879 0005 f47e pea 5f47e <_POSIX_signals_Wait_queue> 45aec: 4eb9 0004 8364 jsr 48364 <_Thread_queue_Enqueue_with_handler> _Thread_Enable_dispatch(); 45af2: 4eb9 0004 7eda jsr 47eda <_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 ); 45af8: 42a7 clrl %sp@- 45afa: 42a7 clrl %sp@- 45afc: 2f0a movel %a2,%sp@- 45afe: 2f12 movel %a2@,%sp@- 45b00: 2f0b movel %a3,%sp@- 45b02: 4e95 jsr %a5@ errno = _Thread_Executing->Wait.return_code; 45b04: 4fef 0020 lea %sp@(32),%sp 45b08: 4eb9 0004 dc44 jsr 4dc44 <__errno> 45b0e: 2079 0005 eefe moveal 5eefe <_Thread_Executing>,%a0 45b14: 2240 moveal %d0,%a1 45b16: 22a8 0034 movel %a0@(52),%a1@ return the_info->si_signo; 45b1a: 2412 movel %a2@,%d2 } 45b1c: 2002 movel %d2,%d0 45b1e: 4cee 3c1c ffd8 moveml %fp@(-40),%d2-%d4/%a2-%a5 45b24: 4e5e unlk %fp 45b26: 4e75 rts 00047404 : int sigwait( const sigset_t *set, int *sig ) { 47404: 4e56 0000 linkw %fp,#0 47408: 2f0a movel %a2,%sp@- 4740a: 246e 000c moveal %fp@(12),%a2 int status; status = sigtimedwait( set, NULL, NULL ); 4740e: 42a7 clrl %sp@- 47410: 42a7 clrl %sp@- 47412: 2f2e 0008 movel %fp@(8),%sp@- 47416: 4eb9 0004 7278 jsr 47278 if ( status != -1 ) { 4741c: 4fef 000c lea %sp@(12),%sp 47420: 72ff moveq #-1,%d1 47422: b280 cmpl %d0,%d1 47424: 670a beqs 47430 if ( sig ) 47426: 4a8a tstl %a2 47428: 6702 beqs 4742c <== ALWAYS TAKEN *sig = status; 4742a: 2480 movel %d0,%a2@ 4742c: 4280 clrl %d0 4742e: 600a bras 4743a <== ALWAYS TAKEN return 0; } return errno; 47430: 4eb9 0004 f3c0 jsr 4f3c0 <__errno> 47436: 2040 moveal %d0,%a0 47438: 2010 movel %a0@,%d0 } 4743a: 246e fffc moveal %fp@(-4),%a2 4743e: 4e5e unlk %fp 47440: 4e75 rts ... 00044b20 : long sysconf( int name ) { if ( name == _SC_CLK_TCK ) 44b20: 7002 moveq #2,%d0 */ long sysconf( int name ) { 44b22: 4e56 0000 linkw %fp,#0 44b26: 222e 0008 movel %fp@(8),%d1 44b2a: 2f02 movel %d2,%sp@- if ( name == _SC_CLK_TCK ) 44b2c: b081 cmpl %d1,%d0 44b2e: 6612 bnes 44b42 return (TOD_MICROSECONDS_PER_SECOND / 44b30: 41f9 0005 bc74 lea 5bc74 ,%a0 44b36: 203c 000f 4240 movel #1000000,%d0 44b3c: 4c50 0000 remul %a0@,%d0,%d0 44b40: 6034 bras 44b76 <== ALWAYS TAKEN rtems_configuration_get_microseconds_per_tick()); if ( name == _SC_OPEN_MAX ) 44b42: 7004 moveq #4,%d0 44b44: b081 cmpl %d1,%d0 44b46: 6608 bnes 44b50 return rtems_libio_number_iops; 44b48: 2039 0005 bb94 movel 5bb94 ,%d0 44b4e: 6026 bras 44b76 <== ALWAYS TAKEN if ( name == _SC_GETPW_R_SIZE_MAX ) 44b50: 203c 0000 0400 movel #1024,%d0 44b56: 7433 moveq #51,%d2 44b58: b481 cmpl %d1,%d2 44b5a: 671a beqs 44b76 return 1024; if ( name == _SC_PAGESIZE ) 44b5c: 143c 0008 moveb #8,%d2 44b60: 303c 1000 movew #4096,%d0 44b64: b481 cmpl %d1,%d2 44b66: 670e beqs 44b76 #if defined(__sparc__) if ( name == 515 ) /* Solaris _SC_STACK_PROT */ return 0; #endif rtems_set_errno_and_return_minus_one( EINVAL ); 44b68: 4eb9 0004 d110 jsr 4d110 <__errno> 44b6e: 7216 moveq #22,%d1 44b70: 2040 moveal %d0,%a0 44b72: 70ff moveq #-1,%d0 44b74: 2081 movel %d1,%a0@ } 44b76: 242e fffc movel %fp@(-4),%d2 44b7a: 4e5e unlk %fp 44b7c: 4e75 rts ... 00044bc4 : timer_t *timerid ) { POSIX_Timer_Control *ptimer; if ( clock_id != CLOCK_REALTIME ) 44bc4: 7001 moveq #1,%d0 int timer_create( clockid_t clock_id, struct sigevent *evp, timer_t *timerid ) { 44bc6: 4e56 0000 linkw %fp,#0 44bca: 2f0b movel %a3,%sp@- 44bcc: 266e 0010 moveal %fp@(16),%a3 44bd0: 2f0a movel %a2,%sp@- 44bd2: 246e 000c moveal %fp@(12),%a2 POSIX_Timer_Control *ptimer; if ( clock_id != CLOCK_REALTIME ) 44bd6: b0ae 0008 cmpl %fp@(8),%d0 44bda: 6620 bnes 44bfc rtems_set_errno_and_return_minus_one( EINVAL ); if ( !timerid ) 44bdc: 4a8b tstl %a3 44bde: 671c beqs 44bfc /* * The data of the structure evp are checked in order to verify if they * are coherent. */ if (evp != NULL) { 44be0: 4a8a tstl %a2 44be2: 672a beqs 44c0e /* The structure has data */ if ( ( evp->sigev_notify != SIGEV_NONE ) && 44be4: 2012 movel %a2@,%d0 44be6: 7201 moveq #1,%d1 44be8: 5380 subql #1,%d0 44bea: b280 cmpl %d0,%d1 44bec: 650e bcss 44bfc <== 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 ) 44bee: 202a 0004 movel %a2@(4),%d0 44bf2: 6708 beqs 44bfc <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(evp->sigev_signo) ) 44bf4: 5380 subql #1,%d0 44bf6: 721f moveq #31,%d1 44bf8: b280 cmpl %d0,%d1 44bfa: 6412 bccs 44c0e <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); 44bfc: 4eb9 0004 d364 jsr 4d364 <__errno> 44c02: 72ff moveq #-1,%d1 44c04: 2040 moveal %d0,%a0 44c06: 7016 moveq #22,%d0 44c08: 2080 movel %d0,%a0@ 44c0a: 6000 00a4 braw 44cb0 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 44c0e: 2039 0005 da24 movel 5da24 <_Thread_Dispatch_disable_level>,%d0 44c14: 5280 addql #1,%d0 44c16: 23c0 0005 da24 movel %d0,5da24 <_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 ); 44c1c: 4879 0005 dcb8 pea 5dcb8 <_POSIX_Timer_Information> 44c22: 4eb9 0004 67f4 jsr 467f4 <_Objects_Allocate> /* * Allocate a timer */ ptimer = _POSIX_Timer_Allocate(); if ( !ptimer ) { 44c28: 588f addql #4,%sp 44c2a: 2040 moveal %d0,%a0 44c2c: 4a80 tstl %d0 44c2e: 6616 bnes 44c46 _Thread_Enable_dispatch(); 44c30: 4eb9 0004 73ca jsr 473ca <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EAGAIN ); 44c36: 4eb9 0004 d364 jsr 4d364 <__errno> 44c3c: 72ff moveq #-1,%d1 44c3e: 2040 moveal %d0,%a0 44c40: 700b moveq #11,%d0 44c42: 2080 movel %d0,%a0@ 44c44: 606a bras 44cb0 } /* The data of the created timer are stored to use them later */ ptimer->state = POSIX_TIMER_STATE_CREATE_NEW; 44c46: 7002 moveq #2,%d0 44c48: 1140 003c moveb %d0,%a0@(60) ptimer->thread_id = _Thread_Executing->Object.id; 44c4c: 2279 0005 dade moveal 5dade <_Thread_Executing>,%a1 44c52: 2169 0008 0038 movel %a1@(8),%a0@(56) if ( evp != NULL ) { 44c58: 4a8a tstl %a2 44c5a: 6710 beqs 44c6c ptimer->inf.sigev_notify = evp->sigev_notify; 44c5c: 2152 003e movel %a2@,%a0@(62) ptimer->inf.sigev_signo = evp->sigev_signo; ptimer->inf.sigev_value = evp->sigev_value; 44c60: 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; 44c66: 216a 0004 0042 movel %a2@(4),%a0@(66) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 44c6c: 2028 0008 movel %a0@(8),%d0 44c70: 4281 clrl %d1 44c72: 2279 0005 dcd0 moveal 5dcd0 <_POSIX_Timer_Information+0x18>,%a1 44c78: 3200 movew %d0,%d1 ptimer->inf.sigev_value = evp->sigev_value; } ptimer->overrun = 0; 44c7a: 42a8 0066 clrl %a0@(102) 44c7e: 2388 1c00 movel %a0,%a1@(00000000,%d1:l:4) ptimer->timer_data.it_value.tv_sec = 0; 44c82: 42a8 005a clrl %a0@(90) _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 44c86: 42a8 000c clrl %a0@(12) ptimer->timer_data.it_value.tv_nsec = 0; 44c8a: 42a8 005e clrl %a0@(94) ptimer->timer_data.it_interval.tv_sec = 0; 44c8e: 42a8 0052 clrl %a0@(82) ptimer->timer_data.it_interval.tv_nsec = 0; 44c92: 42a8 0056 clrl %a0@(86) void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; 44c96: 42a8 0030 clrl %a0@(48) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 44c9a: 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; 44c9e: 2680 movel %d0,%a3@ the_watchdog->routine = routine; 44ca0: 42a8 002c clrl %a0@(44) the_watchdog->id = id; the_watchdog->user_data = user_data; 44ca4: 42a8 0034 clrl %a0@(52) _Thread_Enable_dispatch(); 44ca8: 4eb9 0004 73ca jsr 473ca <_Thread_Enable_dispatch> 44cae: 4281 clrl %d1 return 0; } 44cb0: 246e fff8 moveal %fp@(-8),%a2 44cb4: 2001 movel %d1,%d0 44cb6: 266e fffc moveal %fp@(-4),%a3 44cba: 4e5e unlk %fp 44cbc: 4e75 rts ... 00045450 : int timer_delete( timer_t timerid ) { 45450: 4e56 fffc linkw %fp,#-4 45454: 2f0a movel %a2,%sp@- RTEMS_INLINE_ROUTINE POSIX_Timer_Control *_POSIX_Timer_Get ( timer_t id, Objects_Locations *location ) { return (POSIX_Timer_Control *) 45456: 486e fffc pea %fp@(-4) 4545a: 2f2e 0008 movel %fp@(8),%sp@- 4545e: 4879 0005 e5c0 pea 5e5c0 <_POSIX_Timer_Information> 45464: 4eb9 0004 7378 jsr 47378 <_Objects_Get> */ POSIX_Timer_Control *ptimer; Objects_Locations location; ptimer = _POSIX_Timer_Get( timerid, &location ); switch ( location ) { 4546a: 4fef 000c lea %sp@(12),%sp 4546e: 2440 moveal %d0,%a2 45470: 4aae fffc tstl %fp@(-4) 45474: 663a bnes 454b0 case OBJECTS_LOCAL: _Objects_Close( &_POSIX_Timer_Information, &ptimer->Object ); 45476: 2f00 movel %d0,%sp@- 45478: 4879 0005 e5c0 pea 5e5c0 <_POSIX_Timer_Information> 4547e: 4eb9 0004 6fac jsr 46fac <_Objects_Close> ptimer->state = POSIX_TIMER_STATE_FREE; 45484: 7001 moveq #1,%d0 45486: 1540 003c moveb %d0,%a2@(60) (void) _Watchdog_Remove( &ptimer->Timer ); 4548a: 486a 0010 pea %a2@(16) 4548e: 4eb9 0004 8c40 jsr 48c40 <_Watchdog_Remove> RTEMS_INLINE_ROUTINE void _POSIX_Timer_Free ( POSIX_Timer_Control *the_timer ) { _Objects_Free( &_POSIX_Timer_Information, &the_timer->Object ); 45494: 2f0a movel %a2,%sp@- 45496: 4879 0005 e5c0 pea 5e5c0 <_POSIX_Timer_Information> 4549c: 4eb9 0004 7220 jsr 47220 <_Objects_Free> _POSIX_Timer_Free( ptimer ); _Thread_Enable_dispatch(); 454a2: 4eb9 0004 7b02 jsr 47b02 <_Thread_Enable_dispatch> return 0; 454a8: 4fef 0014 lea %sp@(20),%sp case OBJECTS_LOCAL: _Objects_Close( &_POSIX_Timer_Information, &ptimer->Object ); ptimer->state = POSIX_TIMER_STATE_FREE; (void) _Watchdog_Remove( &ptimer->Timer ); _POSIX_Timer_Free( ptimer ); _Thread_Enable_dispatch(); 454ac: 4280 clrl %d0 return 0; 454ae: 600e bras 454be <== ALWAYS TAKEN #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EINVAL ); 454b0: 4eb9 0004 de0c jsr 4de0c <__errno> 454b6: 7216 moveq #22,%d1 454b8: 2040 moveal %d0,%a0 454ba: 70ff moveq #-1,%d0 454bc: 2081 movel %d1,%a0@ } 454be: 246e fff8 moveal %fp@(-8),%a2 454c2: 4e5e unlk %fp 454c4: 4e75 rts ... 00045fa4 : * its execution, _POSIX_Timer_TSR will have to set this counter to 0. */ int timer_getoverrun( timer_t timerid ) { 45fa4: 4e56 fffc linkw %fp,#-4 45fa8: 2f02 movel %d2,%sp@- RTEMS_INLINE_ROUTINE POSIX_Timer_Control *_POSIX_Timer_Get ( timer_t id, Objects_Locations *location ) { return (POSIX_Timer_Control *) 45faa: 486e fffc pea %fp@(-4) 45fae: 2f2e 0008 movel %fp@(8),%sp@- 45fb2: 4879 0005 fa74 pea 5fa74 <_POSIX_Timer_Information> 45fb8: 4eb9 0004 7e54 jsr 47e54 <_Objects_Get> int overrun; POSIX_Timer_Control *ptimer; Objects_Locations location; ptimer = _POSIX_Timer_Get( timerid, &location ); switch ( location ) { 45fbe: 4fef 000c lea %sp@(12),%sp 45fc2: 4aae fffc tstl %fp@(-4) 45fc6: 6612 bnes 45fda case OBJECTS_LOCAL: overrun = ptimer->overrun; 45fc8: 2040 moveal %d0,%a0 45fca: 2428 0066 movel %a0@(102),%d2 ptimer->overrun = 0; 45fce: 42a8 0066 clrl %a0@(102) _Thread_Enable_dispatch(); 45fd2: 4eb9 0004 85de jsr 485de <_Thread_Enable_dispatch> return overrun; 45fd8: 600e bras 45fe8 <== ALWAYS TAKEN #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EINVAL ); 45fda: 4eb9 0004 e5d4 jsr 4e5d4 <__errno> 45fe0: 74ff moveq #-1,%d2 45fe2: 2040 moveal %d0,%a0 45fe4: 7016 moveq #22,%d0 45fe6: 2080 movel %d0,%a0@ } 45fe8: 2002 movel %d2,%d0 45fea: 242e fff8 movel %fp@(-8),%d2 45fee: 4e5e unlk %fp 45ff0: 4e75 rts ... 00045ff4 : int timer_gettime( timer_t timerid, struct itimerspec *value ) { 45ff4: 4e56 fff4 linkw %fp,#-12 45ff8: 2f0b movel %a3,%sp@- 45ffa: 2f0a movel %a2,%sp@- 45ffc: 246e 000c moveal %fp@(12),%a2 POSIX_Timer_Control *ptimer; Objects_Locations location; struct timespec current_time; Watchdog_Interval left; if ( !value ) 46000: 4a8a tstl %a2 46002: 6760 beqs 46064 rtems_set_errno_and_return_minus_one( EINVAL ); /* Reads the current time */ _TOD_Get( ¤t_time ); 46004: 486e fff4 pea %fp@(-12) 46008: 4eb9 0004 7534 jsr 47534 <_TOD_Get> 4600e: 486e fffc pea %fp@(-4) 46012: 2f2e 0008 movel %fp@(8),%sp@- 46016: 4879 0005 fa74 pea 5fa74 <_POSIX_Timer_Information> 4601c: 4eb9 0004 7e54 jsr 47e54 <_Objects_Get> ptimer = _POSIX_Timer_Get( timerid, &location ); switch ( location ) { 46022: 4fef 0010 lea %sp@(16),%sp 46026: 2640 moveal %d0,%a3 46028: 4aae fffc tstl %fp@(-4) 4602c: 6636 bnes 46064 left = (ptimer->Timer.start_time + ptimer->Timer.initial) - /* expire */ _Watchdog_Ticks_since_boot; /* now */ _Timespec_From_ticks( left, &value->it_value ); 4602e: 486a 0008 pea %a2@(8) 46032: 222b 001c movel %a3@(28),%d1 46036: d2ab 0024 addl %a3@(36),%d1 case OBJECTS_LOCAL: /* Calculates the time left before the timer finishes */ left = (ptimer->Timer.start_time + ptimer->Timer.initial) - /* expire */ 4603a: 2039 0005 f924 movel 5f924 <_Watchdog_Ticks_since_boot>,%d0 _Watchdog_Ticks_since_boot; /* now */ _Timespec_From_ticks( left, &value->it_value ); 46040: 9280 subl %d0,%d1 46042: 2f01 movel %d1,%sp@- 46044: 4eb9 0004 9294 jsr 49294 <_Timespec_From_ticks> value->it_interval = ptimer->timer_data.it_interval; 4604a: 202b 0052 movel %a3@(82),%d0 4604e: 222b 0056 movel %a3@(86),%d1 46052: 2480 movel %d0,%a2@ 46054: 2541 0004 movel %d1,%a2@(4) _Thread_Enable_dispatch(); 46058: 4eb9 0004 85de jsr 485de <_Thread_Enable_dispatch> return 0; 4605e: 508f addql #8,%sp _Timespec_From_ticks( left, &value->it_value ); value->it_interval = ptimer->timer_data.it_interval; _Thread_Enable_dispatch(); 46060: 4281 clrl %d1 return 0; 46062: 600e bras 46072 <== ALWAYS TAKEN #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EINVAL ); 46064: 4eb9 0004 e5d4 jsr 4e5d4 <__errno> 4606a: 72ff moveq #-1,%d1 4606c: 2040 moveal %d0,%a0 4606e: 7016 moveq #22,%d0 46070: 2080 movel %d0,%a0@ } 46072: 246e ffec moveal %fp@(-20),%a2 46076: 2001 movel %d1,%d0 46078: 266e fff0 moveal %fp@(-16),%a3 4607c: 4e5e unlk %fp 4607e: 4e75 rts 00044cc0 : timer_t timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue ) { 44cc0: 4e56 ffd4 linkw %fp,#-44 44cc4: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ 44cc8: 262e 000c movel %fp@(12),%d3 44ccc: 266e 0010 moveal %fp@(16),%a3 44cd0: 242e 0014 movel %fp@(20),%d2 Objects_Locations location; bool activated; uint32_t initial_period; struct itimerspec normalize; if ( !value ) 44cd4: 4a8b tstl %a3 44cd6: 6700 0172 beqw 44e4a <== 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 ) || 44cda: 203c 3b9a c9ff movel #999999999,%d0 44ce0: b0ab 000c cmpl %a3@(12),%d0 44ce4: 6500 0164 bcsw 44e4a ( value->it_value.tv_nsec < 0 ) || ( value->it_interval.tv_nsec >= TOD_NANOSECONDS_PER_SECOND) || 44ce8: b0ab 0004 cmpl %a3@(4),%d0 44cec: 6500 015c bcsw 44e4a <== 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 ) { 44cf0: 7004 moveq #4,%d0 44cf2: b083 cmpl %d3,%d0 44cf4: 6706 beqs 44cfc 44cf6: 4a83 tstl %d3 44cf8: 6600 0150 bnew 44e4a rtems_set_errno_and_return_minus_one( EINVAL ); } normalize = *value; 44cfc: 4878 0010 pea 10 44d00: 2f0b movel %a3,%sp@- 44d02: 486e ffe4 pea %fp@(-28) 44d06: 4eb9 0004 db84 jsr 4db84 /* Convert absolute to relative time */ if (flags == TIMER_ABSTIME) { 44d0c: 4fef 000c lea %sp@(12),%sp 44d10: 7004 moveq #4,%d0 44d12: b083 cmpl %d3,%d0 44d14: 6638 bnes 44d4e struct timespec now; _TOD_Get( &now ); 44d16: 45ee fff4 lea %fp@(-12),%a2 /* Check for seconds in the past */ if ( _Timespec_Greater_than( &now, &normalize.it_value ) ) 44d1a: 260e movel %fp,%d3 44d1c: 0683 ffff ffec addil #-20,%d3 normalize = *value; /* Convert absolute to relative time */ if (flags == TIMER_ABSTIME) { struct timespec now; _TOD_Get( &now ); 44d22: 2f0a movel %a2,%sp@- 44d24: 4eb9 0004 6348 jsr 46348 <_TOD_Get> /* Check for seconds in the past */ if ( _Timespec_Greater_than( &now, &normalize.it_value ) ) 44d2a: 2f03 movel %d3,%sp@- 44d2c: 2f0a movel %a2,%sp@- 44d2e: 4eb9 0004 8080 jsr 48080 <_Timespec_Greater_than> 44d34: 4fef 000c lea %sp@(12),%sp 44d38: 4a00 tstb %d0 44d3a: 6600 010e bnew 44e4a rtems_set_errno_and_return_minus_one( EINVAL ); _Timespec_Subtract( &now, &normalize.it_value, &normalize.it_value ); 44d3e: 2f03 movel %d3,%sp@- 44d40: 2f03 movel %d3,%sp@- 44d42: 2f0a movel %a2,%sp@- 44d44: 4eb9 0004 80b0 jsr 480b0 <_Timespec_Subtract> 44d4a: 4fef 000c lea %sp@(12),%sp RTEMS_INLINE_ROUTINE POSIX_Timer_Control *_POSIX_Timer_Get ( timer_t id, Objects_Locations *location ) { return (POSIX_Timer_Control *) 44d4e: 486e fffc pea %fp@(-4) 44d52: 2f2e 0008 movel %fp@(8),%sp@- 44d56: 4879 0005 dcb8 pea 5dcb8 <_POSIX_Timer_Information> 44d5c: 4eb9 0004 6c40 jsr 46c40 <_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 ) { 44d62: 4fef 000c lea %sp@(12),%sp 44d66: 2440 moveal %d0,%a2 44d68: 4aae fffc tstl %fp@(-4) 44d6c: 6600 00dc bnew 44e4a 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 ) { 44d70: 4aae ffec tstl %fp@(-20) 44d74: 6650 bnes 44dc6 44d76: 4aae fff0 tstl %fp@(-16) 44d7a: 664a bnes 44dc6 /* Stop the timer */ (void) _Watchdog_Remove( &ptimer->Timer ); 44d7c: 486a 0010 pea %a2@(16) 44d80: 4eb9 0004 84cc jsr 484cc <_Watchdog_Remove> /* The old data of the timer are returned */ if ( ovalue ) 44d86: 588f addql #4,%sp 44d88: 4a82 tstl %d2 44d8a: 6714 beqs 44da0 *ovalue = ptimer->timer_data; 44d8c: 4878 0010 pea 10 44d90: 486a 0052 pea %a2@(82) 44d94: 2f02 movel %d2,%sp@- 44d96: 4eb9 0004 db84 jsr 4db84 44d9c: 4fef 000c lea %sp@(12),%sp /* The new data are set */ ptimer->timer_data = normalize; 44da0: 4878 0010 pea 10 44da4: 486e ffe4 pea %fp@(-28) 44da8: 486a 0052 pea %a2@(82) 44dac: 4eb9 0004 db84 jsr 4db84 /* Indicates that the timer is created and stopped */ ptimer->state = POSIX_TIMER_STATE_CREATE_STOP; 44db2: 7004 moveq #4,%d0 44db4: 1540 003c moveb %d0,%a2@(60) /* Returns with success */ _Thread_Enable_dispatch(); 44db8: 4eb9 0004 73ca jsr 473ca <_Thread_Enable_dispatch> return 0; 44dbe: 4fef 000c lea %sp@(12),%sp 44dc2: 6000 0082 braw 44e46 <== ALWAYS TAKEN } /* Convert from seconds and nanoseconds to ticks */ ptimer->ticks = _Timespec_To_ticks( &value->it_interval ); 44dc6: 2f0b movel %a3,%sp@- 44dc8: 47f9 0004 80f8 lea 480f8 <_Timespec_To_ticks>,%a3 44dce: 4e93 jsr %a3@ 44dd0: 2540 0062 movel %d0,%a2@(98) initial_period = _Timespec_To_ticks( &normalize.it_value ); 44dd4: 486e ffec pea %fp@(-20) 44dd8: 4e93 jsr %a3@ activated = _POSIX_Timer_Insert_helper( 44dda: 2f0a movel %a2,%sp@- 44ddc: 4879 0004 4e64 pea 44e64 <_POSIX_Timer_TSR> 44de2: 2f2a 0008 movel %a2@(8),%sp@- 44de6: 2f00 movel %d0,%sp@- 44de8: 486a 0010 pea %a2@(16) 44dec: 4eb9 0004 a3b0 jsr 4a3b0 <_POSIX_Timer_Insert_helper> initial_period, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) { 44df2: 4fef 001c lea %sp@(28),%sp 44df6: 4a00 tstb %d0 44df8: 6608 bnes 44e02 _Thread_Enable_dispatch(); 44dfa: 4eb9 0004 73ca jsr 473ca <_Thread_Enable_dispatch> 44e00: 6044 bras 44e46 <== ALWAYS TAKEN /* * The timer has been started and is running. So we return the * old ones in "ovalue" */ if ( ovalue ) 44e02: 4a82 tstl %d2 44e04: 6714 beqs 44e1a *ovalue = ptimer->timer_data; 44e06: 4878 0010 pea 10 44e0a: 486a 0052 pea %a2@(82) 44e0e: 2f02 movel %d2,%sp@- 44e10: 4eb9 0004 db84 jsr 4db84 44e16: 4fef 000c lea %sp@(12),%sp ptimer->timer_data = normalize; 44e1a: 4878 0010 pea 10 44e1e: 486e ffe4 pea %fp@(-28) 44e22: 486a 0052 pea %a2@(82) 44e26: 4eb9 0004 db84 jsr 4db84 /* Indicate that the time is running */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; 44e2c: 7003 moveq #3,%d0 44e2e: 1540 003c moveb %d0,%a2@(60) _TOD_Get( &ptimer->time ); 44e32: 486a 006a pea %a2@(106) 44e36: 4eb9 0004 6348 jsr 46348 <_TOD_Get> _Thread_Enable_dispatch(); 44e3c: 4eb9 0004 73ca jsr 473ca <_Thread_Enable_dispatch> return 0; 44e42: 4fef 0010 lea %sp@(16),%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(); 44e46: 4281 clrl %d1 return 0; 44e48: 600e bras 44e58 <== ALWAYS TAKEN #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EINVAL ); 44e4a: 4eb9 0004 d364 jsr 4d364 <__errno> 44e50: 72ff moveq #-1,%d1 44e52: 2040 moveal %d0,%a0 44e54: 7016 moveq #22,%d0 44e56: 2080 movel %d0,%a0@ } 44e58: 2001 movel %d1,%d0 44e5a: 4cee 0c0c ffd4 moveml %fp@(-44),%d2-%d3/%a2-%a3 44e60: 4e5e unlk %fp 44e62: 4e75 rts 00049b94 : useconds_t ualarm( useconds_t useconds, useconds_t interval ) { 49b94: 4e56 ffe8 linkw %fp,#-24 49b98: 48d7 041c moveml %d2-%d4/%a2,%sp@ 49b9c: 262e 0008 movel %fp@(8),%d3 /* * Initialize the timer used to implement alarm(). */ if ( !the_timer->routine ) { 49ba0: 4ab9 0005 d6de tstl 5d6de <_POSIX_signals_Ualarm_timer+0x1c> 49ba6: 6622 bnes 49bca Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 49ba8: 42b9 0005 d6ca clrl 5d6ca <_POSIX_signals_Ualarm_timer+0x8> the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 49bae: 4282 clrl %d2 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 49bb0: 203c 0004 9c80 movel #302208,%d0 the_watchdog->id = id; 49bb6: 42b9 0005 d6e2 clrl 5d6e2 <_POSIX_signals_Ualarm_timer+0x20> Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 49bbc: 23c0 0005 d6de movel %d0,5d6de <_POSIX_signals_Ualarm_timer+0x1c> the_watchdog->id = id; the_watchdog->user_data = user_data; 49bc2: 42b9 0005 d6e6 clrl 5d6e6 <_POSIX_signals_Ualarm_timer+0x24> 49bc8: 6058 bras 49c22 <== ALWAYS TAKEN _Watchdog_Initialize( the_timer, _POSIX_signals_Ualarm_TSR, 0, NULL ); } else { Watchdog_States state; state = _Watchdog_Remove( the_timer ); 49bca: 4879 0005 d6c2 pea 5d6c2 <_POSIX_signals_Ualarm_timer> 49bd0: 4eb9 0004 7d70 jsr 47d70 <_Watchdog_Remove> if ( (state == WATCHDOG_ACTIVE) || (state == WATCHDOG_REMOVE_IT) ) { 49bd6: 588f addql #4,%sp 49bd8: 7201 moveq #1,%d1 49bda: 5580 subql #2,%d0 49bdc: b280 cmpl %d0,%d1 49bde: 6404 bccs 49be4 <== NEVER TAKEN 49be0: 4282 clrl %d2 <== NOT EXECUTED 49be2: 603e bras 49c22 <== NOT EXECUTED * boot. Since alarm() is dealing in seconds, we must account for * this. */ ticks = the_timer->initial; ticks -= (the_timer->stop_time - the_timer->start_time); 49be4: 2039 0005 d6d6 movel 5d6d6 <_POSIX_signals_Ualarm_timer+0x14>,%d0 49bea: d0b9 0005 d6ce addl 5d6ce <_POSIX_signals_Ualarm_timer+0xc>,%d0 /* remaining is now in ticks */ _Timespec_From_ticks( ticks, &tp ); 49bf0: 486e fff8 pea %fp@(-8) 49bf4: 90b9 0005 d6da subl 5d6da <_POSIX_signals_Ualarm_timer+0x18>,%d0 remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND; 49bfa: 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 ); 49c00: 2f00 movel %d0,%sp@- 49c02: 4eb9 0004 aacc jsr 4aacc <_Timespec_From_ticks> remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND; 49c08: 202e fff8 movel %fp@(-8),%d0 49c0c: 4c04 0800 mulsl %d4,%d0 remaining += tp.tv_nsec / 1000; 49c10: 283c 0000 03e8 movel #1000,%d4 49c16: 508f addql #8,%sp 49c18: 242e fffc movel %fp@(-4),%d2 49c1c: 4c44 2802 remsl %d4,%d2,%d2 49c20: d480 addl %d0,%d2 /* * If useconds is non-zero, then the caller wants to schedule * the alarm repeatedly at that interval. If the interval is * less than a single clock tick, then fudge it to a clock tick. */ if ( useconds ) { 49c22: 4a83 tstl %d3 49c24: 674e beqs 49c74 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 ); 49c26: 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; 49c28: 223c 000f 4240 movel #1000000,%d1 tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; ticks = _Timespec_To_ticks( &tp ); 49c2e: 5184 subql #8,%d4 49c30: 45f9 0004 ab08 lea 4ab08 <_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; 49c36: 4c41 3000 remul %d1,%d0,%d3 49c3a: 4c41 3003 remul %d1,%d3,%d3 tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; 49c3e: 223c 0000 03e8 movel #1000,%d1 49c44: 4c00 1800 mulsl %d0,%d1 ticks = _Timespec_To_ticks( &tp ); 49c48: 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; 49c4a: 2d41 fffc movel %d1,%fp@(-4) * less than a single clock tick, then fudge it to a clock tick. */ if ( useconds ) { Watchdog_Interval ticks; tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND; 49c4e: 2d43 fff8 movel %d3,%fp@(-8) tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; ticks = _Timespec_To_ticks( &tp ); 49c52: 4e92 jsr %a2@ if ( ticks == 0 ) ticks = 1; _Watchdog_Insert_ticks( the_timer, _Timespec_To_ticks( &tp ) ); 49c54: 2f04 movel %d4,%sp@- 49c56: 4e92 jsr %a2@ ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 49c58: 4879 0005 d6c2 pea 5d6c2 <_POSIX_signals_Ualarm_timer> 49c5e: 4879 0005 cf9c pea 5cf9c <_Watchdog_Ticks_chain> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 49c64: 23c0 0005 d6ce movel %d0,5d6ce <_POSIX_signals_Ualarm_timer+0xc> _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 49c6a: 4eb9 0004 7c54 jsr 47c54 <_Watchdog_Insert> 49c70: 4fef 0010 lea %sp@(16),%sp } return remaining; } 49c74: 2002 movel %d2,%d0 49c76: 4cee 041c ffe8 moveml %fp@(-24),%d2-%d4/%a2 49c7c: 4e5e unlk %fp 49c7e: 4e75 rts