=============================================================================== 000461d4 <_API_Mutex_Unlock>: #include void _API_Mutex_Unlock( API_Mutex_Control *the_mutex ) { 461d4: 4e56 0000 linkw %fp,#0 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 461d8: 2039 0005 e9c8 movel 5e9c8 <_Thread_Dispatch_disable_level>,%d0 461de: 5280 addql #1,%d0 461e0: 206e 0008 moveal %fp@(8),%a0 461e4: 23c0 0005 e9c8 movel %d0,5e9c8 <_Thread_Dispatch_disable_level> _Thread_Disable_dispatch(); _CORE_mutex_Surrender( 461ea: 42a7 clrl %sp@- 461ec: 2f28 0008 movel %a0@(8),%sp@- 461f0: 4868 0010 pea %a0@(16) 461f4: 4eb9 0004 6458 jsr 46458 <_CORE_mutex_Surrender> &the_mutex->Mutex, the_mutex->Object.id, NULL ); _Thread_Enable_dispatch(); 461fa: 4fef 000c lea %sp@(12),%sp } 461fe: 4e5e unlk %fp _CORE_mutex_Surrender( &the_mutex->Mutex, the_mutex->Object.id, NULL ); _Thread_Enable_dispatch(); 46200: 4ef9 0004 7ac2 jmp 47ac2 <_Thread_Enable_dispatch> ... =============================================================================== 000483b0 <_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 ); 483b0: 203c 0000 0700 movel #1792,%d0 Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_RWLock_API_mp_support_callout api_rwlock_mp_support ) { 483b6: 4e56 ffe8 linkw %fp,#-24 483ba: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@ 483be: 246e 0008 moveal %fp@(8),%a2 483c2: 282e 000c movel %fp@(12),%d4 483c6: 262e 0014 movel %fp@(20),%d3 483ca: 1a2e 0013 moveb %fp@(19),%d5 ISR_Level level; Thread_Control *executing = _Thread_Executing; 483ce: 2679 0006 1a86 moveal 61a86 <_Per_CPU_Information+0xc>,%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 ); 483d4: 40c2 movew %sr,%d2 483d6: 8082 orl %d2,%d0 483d8: 46c0 movew %d0,%sr switch ( the_rwlock->current_state ) { 483da: 202a 0044 movel %a2@(68),%d0 483de: 6708 beqs 483e8 <_CORE_RWLock_Obtain_for_reading+0x38> 483e0: 7201 moveq #1,%d1 483e2: b280 cmpl %d0,%d1 483e4: 662a bnes 48410 <_CORE_RWLock_Obtain_for_reading+0x60><== NEVER TAKEN 483e6: 600e bras 483f6 <_CORE_RWLock_Obtain_for_reading+0x46> case CORE_RWLOCK_UNLOCKED: the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING; 483e8: 7001 moveq #1,%d0 the_rwlock->number_of_readers += 1; 483ea: 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; 483ee: 2540 0044 movel %d0,%a2@(68) the_rwlock->number_of_readers += 1; _ISR_Enable( level ); 483f2: 46c2 movew %d2,%sr 483f4: 6014 bras 4840a <_CORE_RWLock_Obtain_for_reading+0x5a> executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; return; case CORE_RWLOCK_LOCKED_FOR_READING: { Thread_Control *waiter; waiter = _Thread_queue_First( &the_rwlock->Wait_queue ); 483f6: 2f0a movel %a2,%sp@- 483f8: 4eb9 0004 a254 jsr 4a254 <_Thread_queue_First> if ( !waiter ) { 483fe: 588f addql #4,%sp 48400: 4a80 tstl %d0 48402: 660c bnes 48410 <_CORE_RWLock_Obtain_for_reading+0x60> the_rwlock->number_of_readers += 1; 48404: 52aa 0048 addql #1,%a2@(72) _ISR_Enable( level ); 48408: 46c2 movew %d2,%sr executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 4840a: 42ab 0034 clrl %a3@(52) return; 4840e: 6046 bras 48456 <_CORE_RWLock_Obtain_for_reading+0xa6> /* * If the thread is not willing to wait, then return immediately. */ if ( !wait ) { 48410: 4a05 tstb %d5 48412: 660a bnes 4841e <_CORE_RWLock_Obtain_for_reading+0x6e> _ISR_Enable( level ); 48414: 46c2 movew %d2,%sr executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; 48416: 7202 moveq #2,%d1 48418: 2741 0034 movel %d1,%a3@(52) 4841c: 6038 bras 48456 <_CORE_RWLock_Obtain_for_reading+0xa6> 4841e: 7001 moveq #1,%d0 48420: 2540 0030 movel %d0,%a2@(48) /* * We need to wait to enter this critical section */ _Thread_queue_Enter_critical_section( &the_rwlock->Wait_queue ); executing->Wait.queue = &the_rwlock->Wait_queue; 48424: 274a 0044 movel %a2,%a3@(68) executing->Wait.id = id; 48428: 2744 0020 movel %d4,%a3@(32) executing->Wait.option = CORE_RWLOCK_THREAD_WAITING_FOR_READ; 4842c: 42ab 0030 clrl %a3@(48) executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 48430: 42ab 0034 clrl %a3@(52) _ISR_Enable( level ); 48434: 46c2 movew %d2,%sr _Thread_queue_Enqueue_with_handler( 48436: 2d43 000c movel %d3,%fp@(12) 4843a: 223c 0004 85a0 movel #296352,%d1 48440: 2d4a 0008 movel %a2,%fp@(8) timeout, _CORE_RWLock_Timeout ); /* return to API level so it can dispatch and we block */ } 48444: 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( 4844a: 2d41 0010 movel %d1,%fp@(16) timeout, _CORE_RWLock_Timeout ); /* return to API level so it can dispatch and we block */ } 4844e: 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( 48450: 4ef9 0004 9f40 jmp 49f40 <_Thread_queue_Enqueue_with_handler> timeout, _CORE_RWLock_Timeout ); /* return to API level so it can dispatch and we block */ } 48456: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 4845c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000484ec <_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 ); 484ec: 223c 0000 0700 movel #1792,%d1 */ CORE_RWLock_Status _CORE_RWLock_Release( CORE_RWLock_Control *the_rwlock ) { 484f2: 4e56 fff0 linkw %fp,#-16 ISR_Level level; Thread_Control *executing = _Thread_Executing; 484f6: 2079 0006 1a86 moveal 61a86 <_Per_CPU_Information+0xc>,%a0 */ CORE_RWLock_Status _CORE_RWLock_Release( CORE_RWLock_Control *the_rwlock ) { 484fc: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ 48500: 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 ); 48504: 40c0 movew %sr,%d0 48506: 8280 orl %d0,%d1 48508: 46c1 movew %d1,%sr if ( the_rwlock->current_state == CORE_RWLOCK_UNLOCKED){ 4850a: 222a 0044 movel %a2@(68),%d1 4850e: 660a bnes 4851a <_CORE_RWLock_Release+0x2e> _ISR_Enable( level ); 48510: 46c0 movew %d0,%sr executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; 48512: 7002 moveq #2,%d0 48514: 2140 0034 movel %d0,%a0@(52) return CORE_RWLOCK_SUCCESSFUL; 48518: 6078 bras 48592 <_CORE_RWLock_Release+0xa6> } if ( the_rwlock->current_state == CORE_RWLOCK_LOCKED_FOR_READING ) { 4851a: 7401 moveq #1,%d2 4851c: b481 cmpl %d1,%d2 4851e: 6610 bnes 48530 <_CORE_RWLock_Release+0x44> the_rwlock->number_of_readers -= 1; 48520: 222a 0048 movel %a2@(72),%d1 48524: 5381 subql #1,%d1 48526: 2541 0048 movel %d1,%a2@(72) if ( the_rwlock->number_of_readers != 0 ) { 4852a: 6704 beqs 48530 <_CORE_RWLock_Release+0x44> /* must be unlocked again */ _ISR_Enable( level ); 4852c: 46c0 movew %d0,%sr return CORE_RWLOCK_SUCCESSFUL; 4852e: 6062 bras 48592 <_CORE_RWLock_Release+0xa6> } } /* CORE_RWLOCK_LOCKED_FOR_WRITING or READING with readers */ executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 48530: 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; 48534: 42aa 0044 clrl %a2@(68) _ISR_Enable( level ); 48538: 46c0 movew %d0,%sr next = _Thread_queue_Dequeue( &the_rwlock->Wait_queue ); 4853a: 2f0a movel %a2,%sp@- 4853c: 4eb9 0004 9e00 jsr 49e00 <_Thread_queue_Dequeue> if ( next ) { 48542: 588f addql #4,%sp 48544: 4a80 tstl %d0 48546: 674a beqs 48592 <_CORE_RWLock_Release+0xa6> if ( next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) { 48548: 7201 moveq #1,%d1 4854a: 2040 moveal %d0,%a0 4854c: b2a8 0030 cmpl %a0@(48),%d1 48550: 6608 bnes 4855a <_CORE_RWLock_Release+0x6e> the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_WRITING; 48552: 7002 moveq #2,%d0 48554: 2540 0044 movel %d0,%a2@(68) return CORE_RWLOCK_SUCCESSFUL; 48558: 6038 bras 48592 <_CORE_RWLock_Release+0xa6> /* * Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING */ the_rwlock->number_of_readers += 1; the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING; 4855a: 7201 moveq #1,%d1 } /* * Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING */ the_rwlock->number_of_readers += 1; 4855c: 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 ); 48560: 49f9 0004 a254 lea 4a254 <_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 ); 48566: 47f9 0004 a124 lea 4a124 <_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; 4856c: 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 ); 48570: 2f0a movel %a2,%sp@- 48572: 4e94 jsr %a4@ if ( !next || 48574: 588f addql #4,%sp 48576: 4a80 tstl %d0 48578: 6718 beqs 48592 <_CORE_RWLock_Release+0xa6> 4857a: 7401 moveq #1,%d2 4857c: 2040 moveal %d0,%a0 4857e: b4a8 0030 cmpl %a0@(48),%d2 48582: 670e beqs 48592 <_CORE_RWLock_Release+0xa6> <== NEVER TAKEN next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) return CORE_RWLOCK_SUCCESSFUL; the_rwlock->number_of_readers += 1; 48584: 52aa 0048 addql #1,%a2@(72) _Thread_queue_Extract( &the_rwlock->Wait_queue, next ); 48588: 2f00 movel %d0,%sp@- 4858a: 2f0a movel %a2,%sp@- 4858c: 4e93 jsr %a3@ } 4858e: 508f addql #8,%sp 48590: 60de bras 48570 <_CORE_RWLock_Release+0x84> } /* indentation is to match _ISR_Disable at top */ return CORE_RWLOCK_SUCCESSFUL; } 48592: 4280 clrl %d0 48594: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 4859a: 4e5e unlk %fp ... =============================================================================== 000485a0 <_CORE_RWLock_Timeout>: void _CORE_RWLock_Timeout( Objects_Id id, void *ignored ) { 485a0: 4e56 fffc linkw %fp,#-4 Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 485a4: 486e fffc pea %fp@(-4) 485a8: 2f2e 0008 movel %fp@(8),%sp@- 485ac: 4eb9 0004 9b38 jsr 49b38 <_Thread_Get> switch ( location ) { 485b2: 508f addql #8,%sp 485b4: 4aae fffc tstl %fp@(-4) 485b8: 6618 bnes 485d2 <_CORE_RWLock_Timeout+0x32> <== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 485ba: 2f00 movel %d0,%sp@- 485bc: 4eb9 0004 a354 jsr 4a354 <_Thread_queue_Process_timeout> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 485c2: 588f addql #4,%sp 485c4: 2039 0006 161c movel 6161c <_Thread_Dispatch_disable_level>,%d0 485ca: 5380 subql #1,%d0 485cc: 23c0 0006 161c movel %d0,6161c <_Thread_Dispatch_disable_level> _Thread_Unnest_dispatch(); break; } } 485d2: 4e5e unlk %fp ... =============================================================================== 0004726c <_CORE_barrier_Wait>: Thread_Control *executing; ISR_Level level; executing = _Thread_Executing; executing->Wait.return_code = CORE_BARRIER_STATUS_SUCCESSFUL; _ISR_Disable( level ); 4726c: 203c 0000 0700 movel #1792,%d0 Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_barrier_API_mp_support_callout api_barrier_mp_support ) { 47272: 4e56 fff4 linkw %fp,#-12 Thread_Control *executing; ISR_Level level; executing = _Thread_Executing; 47276: 2279 0006 0416 moveal 60416 <_Per_CPU_Information+0xc>,%a1 Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_barrier_API_mp_support_callout api_barrier_mp_support ) { 4727c: 48d7 001c moveml %d2-%d4,%sp@ 47280: 206e 0008 moveal %fp@(8),%a0 Thread_Control *executing; ISR_Level level; executing = _Thread_Executing; executing->Wait.return_code = CORE_BARRIER_STATUS_SUCCESSFUL; 47284: 42a9 0034 clrl %a1@(52) Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_barrier_API_mp_support_callout api_barrier_mp_support ) { 47288: 242e 000c movel %fp@(12),%d2 4728c: 262e 0014 movel %fp@(20),%d3 47290: 282e 0018 movel %fp@(24),%d4 Thread_Control *executing; ISR_Level level; executing = _Thread_Executing; executing->Wait.return_code = CORE_BARRIER_STATUS_SUCCESSFUL; _ISR_Disable( level ); 47294: 40c1 movew %sr,%d1 47296: 8081 orl %d1,%d0 47298: 46c0 movew %d0,%sr the_barrier->number_of_waiting_threads++; 4729a: 2028 0048 movel %a0@(72),%d0 4729e: 5280 addql #1,%d0 472a0: 2140 0048 movel %d0,%a0@(72) if ( _CORE_barrier_Is_automatic( &the_barrier->Attributes ) ) { 472a4: 4aa8 0040 tstl %a0@(64) 472a8: 6626 bnes 472d0 <_CORE_barrier_Wait+0x64> if ( the_barrier->number_of_waiting_threads == 472aa: b0a8 0044 cmpl %a0@(68),%d0 472ae: 6620 bnes 472d0 <_CORE_barrier_Wait+0x64> the_barrier->Attributes.maximum_count) { executing->Wait.return_code = CORE_BARRIER_STATUS_AUTOMATICALLY_RELEASED; 472b0: 7001 moveq #1,%d0 472b2: 2340 0034 movel %d0,%a1@(52) _ISR_Enable( level ); 472b6: 46c1 movew %d1,%sr _CORE_barrier_Release( the_barrier, id, api_barrier_mp_support ); 472b8: 2d44 0010 movel %d4,%fp@(16) 472bc: 2d42 000c movel %d2,%fp@(12) executing->Wait.queue = &the_barrier->Wait_queue; executing->Wait.id = id; _ISR_Enable( level ); _Thread_queue_Enqueue( &the_barrier->Wait_queue, timeout ); } 472c0: 4cd7 001c moveml %sp@,%d2-%d4 if ( _CORE_barrier_Is_automatic( &the_barrier->Attributes ) ) { if ( the_barrier->number_of_waiting_threads == the_barrier->Attributes.maximum_count) { executing->Wait.return_code = CORE_BARRIER_STATUS_AUTOMATICALLY_RELEASED; _ISR_Enable( level ); _CORE_barrier_Release( the_barrier, id, api_barrier_mp_support ); 472c4: 2d48 0008 movel %a0,%fp@(8) executing->Wait.queue = &the_barrier->Wait_queue; executing->Wait.id = id; _ISR_Enable( level ); _Thread_queue_Enqueue( &the_barrier->Wait_queue, timeout ); } 472c8: 4e5e unlk %fp if ( _CORE_barrier_Is_automatic( &the_barrier->Attributes ) ) { if ( the_barrier->number_of_waiting_threads == the_barrier->Attributes.maximum_count) { executing->Wait.return_code = CORE_BARRIER_STATUS_AUTOMATICALLY_RELEASED; _ISR_Enable( level ); _CORE_barrier_Release( the_barrier, id, api_barrier_mp_support ); 472ca: 4ef9 0004 bc58 jmp 4bc58 <_CORE_barrier_Release> 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; 472d0: 7001 moveq #1,%d0 472d2: 2140 0030 movel %d0,%a0@(48) return; } } _Thread_queue_Enter_critical_section( &the_barrier->Wait_queue ); executing->Wait.queue = &the_barrier->Wait_queue; 472d6: 2348 0044 movel %a0,%a1@(68) executing->Wait.id = id; 472da: 2342 0020 movel %d2,%a1@(32) _ISR_Enable( level ); 472de: 46c1 movew %d1,%sr _Thread_queue_Enqueue( &the_barrier->Wait_queue, timeout ); 472e0: 2d43 000c movel %d3,%fp@(12) 472e4: 203c 0004 91f4 movel #299508,%d0 472ea: 2d48 0008 movel %a0,%fp@(8) } 472ee: 4cd7 001c moveml %sp@,%d2-%d4 _Thread_queue_Enter_critical_section( &the_barrier->Wait_queue ); executing->Wait.queue = &the_barrier->Wait_queue; executing->Wait.id = id; _ISR_Enable( level ); _Thread_queue_Enqueue( &the_barrier->Wait_queue, timeout ); 472f2: 2d40 0010 movel %d0,%fp@(16) } 472f6: 4e5e unlk %fp _Thread_queue_Enter_critical_section( &the_barrier->Wait_queue ); executing->Wait.queue = &the_barrier->Wait_queue; executing->Wait.id = id; _ISR_Enable( level ); _Thread_queue_Enqueue( &the_barrier->Wait_queue, timeout ); 472f8: 4ef9 0004 8ee0 jmp 48ee0 <_Thread_queue_Enqueue_with_handler> ... =============================================================================== 0004e084 <_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)) { 4e084: 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 ) { 4e086: 4e56 fff4 linkw %fp,#-12 4e08a: 222e 0014 movel %fp@(20),%d1 4e08e: 48d7 040c moveml %d2-%d3/%a2,%sp@ 4e092: 246e 0008 moveal %fp@(8),%a2 4e096: 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)) { 4e09a: c081 andl %d1,%d0 ) { size_t message_buffering_required; size_t allocated_message_size; the_message_queue->maximum_pending_messages = maximum_pending_messages; 4e09c: 2542 0044 movel %d2,%a2@(68) the_message_queue->number_of_pending_messages = 0; 4e0a0: 42aa 0048 clrl %a2@(72) the_message_queue->maximum_message_size = maximum_message_size; 4e0a4: 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; 4e0a8: 42aa 0060 clrl %a2@(96) the_message_queue->notify_argument = the_argument; 4e0ac: 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)) { 4e0b0: 4a80 tstl %d0 4e0b2: 670e beqs 4e0c2 <_CORE_message_queue_Initialize+0x3e> allocated_message_size += sizeof(uint32_t); 4e0b4: 2001 movel %d1,%d0 4e0b6: 5880 addql #4,%d0 allocated_message_size &= ~(sizeof(uint32_t) - 1); 4e0b8: 76fc moveq #-4,%d3 4e0ba: c083 andl %d3,%d0 } if (allocated_message_size < maximum_message_size) 4e0bc: b280 cmpl %d0,%d1 4e0be: 6272 bhis 4e132 <_CORE_message_queue_Initialize+0xae><== NEVER TAKEN 4e0c0: 6002 bras 4e0c4 <_CORE_message_queue_Initialize+0x40> /* * 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)) { 4e0c2: 2001 movel %d1,%d0 /* * 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)); 4e0c4: 2600 movel %d0,%d3 4e0c6: 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 * 4e0cc: 2203 movel %d3,%d1 4e0ce: 4c02 1800 mulsl %d2,%d1 (allocated_message_size + sizeof(CORE_message_queue_Buffer_control)); if (message_buffering_required < allocated_message_size) 4e0d2: b081 cmpl %d1,%d0 4e0d4: 625c bhis 4e132 <_CORE_message_queue_Initialize+0xae><== NEVER TAKEN /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) _Workspace_Allocate( message_buffering_required ); 4e0d6: 2f01 movel %d1,%sp@- 4e0d8: 4eb9 0005 0b44 jsr 50b44 <_Workspace_Allocate> if (the_message_queue->message_buffers == 0) 4e0de: 588f addql #4,%sp return false; /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) 4e0e0: 2540 005c movel %d0,%a2@(92) _Workspace_Allocate( message_buffering_required ); if (the_message_queue->message_buffers == 0) 4e0e4: 674c beqs 4e132 <_CORE_message_queue_Initialize+0xae> /* * Initialize the pool of inactive messages, pending messages, * and set of waiting threads. */ _Chain_Initialize ( 4e0e6: 2f03 movel %d3,%sp@- 4e0e8: 2f02 movel %d2,%sp@- 4e0ea: 2f00 movel %d0,%sp@- 4e0ec: 486a 0068 pea %a2@(104) 4e0f0: 4eb9 0005 2d8c jsr 52d8c <_Chain_Initialize> RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 4e0f6: 41ea 0054 lea %a2@(84),%a0 allocated_message_size + sizeof( CORE_message_queue_Buffer_control ) ); _Chain_Initialize_empty( &the_message_queue->Pending_messages ); _Thread_queue_Initialize( 4e0fa: 7001 moveq #1,%d0 4e0fc: 2548 0050 movel %a0,%a2@(80) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); 4e100: 41ea 0050 lea %a2@(80),%a0 Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; 4e104: 42aa 0054 clrl %a2@(84) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); 4e108: 2548 0058 movel %a0,%a2@(88) 4e10c: 4878 0006 pea 6 4e110: 206e 000c moveal %fp@(12),%a0 4e114: 4878 0080 pea 80 4e118: b090 cmpl %a0@,%d0 4e11a: 57c0 seq %d0 4e11c: 49c0 extbl %d0 4e11e: 4480 negl %d0 4e120: 2f00 movel %d0,%sp@- 4e122: 2f0a movel %a2,%sp@- 4e124: 4eb9 0005 02a0 jsr 502a0 <_Thread_queue_Initialize> THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; 4e12a: 4fef 0020 lea %sp@(32),%sp 4e12e: 7001 moveq #1,%d0 4e130: 6002 bras 4e134 <_CORE_message_queue_Initialize+0xb0> */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) _Workspace_Allocate( message_buffering_required ); if (the_message_queue->message_buffers == 0) return false; 4e132: 4200 clrb %d0 STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; } 4e134: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 4e13a: 4e5e unlk %fp ... =============================================================================== 0004e140 <_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 ); 4e140: 223c 0000 0700 movel #1792,%d1 void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 4e146: 4e56 ffe0 linkw %fp,#-32 ISR_Level level; CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; 4e14a: 2079 0006 7a3a moveal 67a3a <_Per_CPU_Information+0xc>,%a0 void *buffer, size_t *size_p, bool wait, Watchdog_Interval timeout ) { 4e150: 48d7 3c3c moveml %d2-%d5/%a2-%a5,%sp@ 4e154: 246e 0008 moveal %fp@(8),%a2 4e158: 262e 000c movel %fp@(12),%d3 4e15c: 2a2e 0010 movel %fp@(16),%d5 4e160: 226e 0014 moveal %fp@(20),%a1 4e164: 242e 001c movel %fp@(28),%d2 4e168: 182e 001b moveb %fp@(27),%d4 ISR_Level level; CORE_message_queue_Buffer_control *the_message; Thread_Control *executing; executing = _Thread_Executing; executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; 4e16c: 42a8 0034 clrl %a0@(52) _ISR_Disable( level ); 4e170: 40c0 movew %sr,%d0 4e172: 8280 orl %d0,%d1 4e174: 46c1 movew %d1,%sr RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 4e176: 220a movel %a2,%d1 4e178: 0681 0000 0054 addil #84,%d1 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 ); } 4e17e: 266a 0050 moveal %a2@(80),%a3 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 4e182: b28b cmpl %a3,%d1 4e184: 6700 00a6 beqw 4e22c <_CORE_message_queue_Seize+0xec> Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; 4e188: 2a53 moveal %a3@,%a5 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_first_unprotected( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); 4e18a: 49ea 0050 lea %a2@(80),%a4 Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; head->next = new_first; 4e18e: 254d 0050 movel %a5,%a2@(80) */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_first_unprotected( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); 4e192: 2b4c 0004 movel %a4,%a5@(4) executing = _Thread_Executing; executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; _ISR_Disable( level ); the_message = _CORE_message_queue_Get_pending_message( the_message_queue ); if ( the_message != NULL ) { 4e196: 4a8b tstl %a3 4e198: 6700 0092 beqw 4e22c <_CORE_message_queue_Seize+0xec> the_message_queue->number_of_pending_messages -= 1; 4e19c: 53aa 0048 subql #1,%a2@(72) _ISR_Enable( level ); 4e1a0: 46c0 movew %d0,%sr *size_p = the_message->Contents.size; _Thread_Executing->Wait.count = 4e1a2: 2079 0006 7a3a moveal 67a3a <_Per_CPU_Information+0xc>,%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; 4e1a8: 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, 4e1ac: 240b movel %a3,%d2 4e1ae: 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 = 4e1b4: 216b 0008 0024 movel %a3@(8),%a0@(36) const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 4e1ba: 49f9 0005 55dc lea 555dc ,%a4 4e1c0: 2f11 movel %a1@,%sp@- 4e1c2: 2f02 movel %d2,%sp@- 4e1c4: 2f05 movel %d5,%sp@- 4e1c6: 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 ); 4e1c8: 2f0a movel %a2,%sp@- 4e1ca: 4eb9 0004 ff1c jsr 4ff1c <_Thread_queue_Dequeue> if ( !the_thread ) { 4e1d0: 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 ); 4e1d4: 2040 moveal %d0,%a0 if ( !the_thread ) { 4e1d6: 4a80 tstl %d0 4e1d8: 661a bnes 4e1f4 <_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 ); 4e1da: 45ea 0068 lea %a2@(104),%a2 4e1de: 2d4b 000c movel %a3,%fp@(12) 4e1e2: 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 ); } 4e1e6: 4cee 3c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a5 4e1ec: 4e5e unlk %fp 4e1ee: 4ef9 0004 dfc0 jmp 4dfc0 <_Chain_Append> */ _CORE_message_queue_Set_message_priority( the_message, the_thread->Wait.count ); the_message->Contents.size = (size_t) the_thread->Wait.option; 4e1f4: 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; 4e1f8: 2768 0024 0008 movel %a0@(36),%a3@(8) 4e1fe: 2740 000c movel %d0,%a3@(12) const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 4e202: 2f00 movel %d0,%sp@- 4e204: 2f28 002c movel %a0@(44),%sp@- 4e208: 2f02 movel %d2,%sp@- 4e20a: 4e94 jsr %a4@ the_thread->Wait.return_argument_second.immutable_object, the_message->Contents.buffer, the_message->Contents.size ); _CORE_message_queue_Insert_message( 4e20c: 2d6b 0008 0010 movel %a3@(8),%fp@(16) 4e212: 4fef 000c lea %sp@(12),%sp 4e216: 2d4b 000c movel %a3,%fp@(12) 4e21a: 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 ); } 4e21e: 4cee 3c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a5 4e224: 4e5e unlk %fp the_thread->Wait.return_argument_second.immutable_object, the_message->Contents.buffer, the_message->Contents.size ); _CORE_message_queue_Insert_message( 4e226: 4ef9 0005 2dd0 jmp 52dd0 <_CORE_message_queue_Insert_message> return; } #endif } if ( !wait ) { 4e22c: 4a04 tstb %d4 4e22e: 6612 bnes 4e242 <_CORE_message_queue_Seize+0x102> _ISR_Enable( level ); 4e230: 46c0 movew %d0,%sr executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT; 4e232: 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 ); } 4e234: 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; 4e23a: 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 ); } 4e23e: 4e5e unlk %fp 4e240: 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; 4e242: 7201 moveq #1,%d1 4e244: 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; 4e248: 2145 002c movel %d5,%a0@(44) executing->Wait.return_code = CORE_MESSAGE_QUEUE_STATUS_UNSATISFIED_NOWAIT; return; } _Thread_queue_Enter_critical_section( &the_message_queue->Wait_queue ); executing->Wait.queue = &the_message_queue->Wait_queue; 4e24c: 214a 0044 movel %a2,%a0@(68) executing->Wait.id = id; 4e250: 2143 0020 movel %d3,%a0@(32) executing->Wait.return_argument_second.mutable_object = buffer; executing->Wait.return_argument = size_p; 4e254: 2149 0028 movel %a1,%a0@(40) /* Wait.count will be filled in with the message priority */ _ISR_Enable( level ); 4e258: 46c0 movew %d0,%sr _Thread_queue_Enqueue( &the_message_queue->Wait_queue, timeout ); 4e25a: 49f9 0005 0370 lea 50370 <_Thread_queue_Timeout>,%a4 4e260: 2d42 000c movel %d2,%fp@(12) 4e264: 2d4c 0010 movel %a4,%fp@(16) 4e268: 2d4a 0008 movel %a2,%fp@(8) } 4e26c: 4cee 3c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a5 4e272: 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 ); 4e274: 4ef9 0005 005c jmp 5005c <_Thread_queue_Enqueue_with_handler> ... =============================================================================== 000463b4 <_CORE_mutex_Seize>: Objects_Id _id, bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { 463b4: 4e56 0000 linkw %fp,#0 _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); 463b8: 2039 0005 e9c8 movel 5e9c8 <_Thread_Dispatch_disable_level>,%d0 Objects_Id _id, bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { 463be: 2f0a movel %a2,%sp@- 463c0: 246e 0008 moveal %fp@(8),%a2 463c4: 2f02 movel %d2,%sp@- 463c6: 142e 0013 moveb %fp@(19),%d2 _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); 463ca: 4a80 tstl %d0 463cc: 671c beqs 463ea <_CORE_mutex_Seize+0x36> 463ce: 4a02 tstb %d2 463d0: 6718 beqs 463ea <_CORE_mutex_Seize+0x36> <== NEVER TAKEN 463d2: 7001 moveq #1,%d0 463d4: b0b9 0005 eb14 cmpl 5eb14 <_System_state_Current>,%d0 463da: 640e bccs 463ea <_CORE_mutex_Seize+0x36> 463dc: 4878 0012 pea 12 463e0: 42a7 clrl %sp@- 463e2: 42a7 clrl %sp@- 463e4: 4eb9 0004 6a08 jsr 46a08 <_Internal_error_Occurred> 463ea: 486e 0018 pea %fp@(24) 463ee: 2f0a movel %a2,%sp@- 463f0: 4eb9 0004 ac50 jsr 4ac50 <_CORE_mutex_Seize_interrupt_trylock> 463f6: 508f addql #8,%sp 463f8: 4a80 tstl %d0 463fa: 6750 beqs 4644c <_CORE_mutex_Seize+0x98> 463fc: 4a02 tstb %d2 463fe: 6614 bnes 46414 <_CORE_mutex_Seize+0x60> 46400: 202e 0018 movel %fp@(24),%d0 46404: 46c0 movew %d0,%sr 46406: 2079 0005 ee32 moveal 5ee32 <_Per_CPU_Information+0xc>,%a0 4640c: 7001 moveq #1,%d0 4640e: 2140 0034 movel %d0,%a0@(52) 46412: 6038 bras 4644c <_CORE_mutex_Seize+0x98> 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; 46414: 7001 moveq #1,%d0 46416: 2079 0005 ee32 moveal 5ee32 <_Per_CPU_Information+0xc>,%a0 4641c: 2540 0030 movel %d0,%a2@(48) 46420: 2039 0005 e9c8 movel 5e9c8 <_Thread_Dispatch_disable_level>,%d0 46426: 5280 addql #1,%d0 46428: 216e 000c 0020 movel %fp@(12),%a0@(32) 4642e: 214a 0044 movel %a2,%a0@(68) 46432: 23c0 0005 e9c8 movel %d0,5e9c8 <_Thread_Dispatch_disable_level> 46438: 202e 0018 movel %fp@(24),%d0 4643c: 46c0 movew %d0,%sr 4643e: 2f2e 0014 movel %fp@(20),%sp@- 46442: 2f0a movel %a2,%sp@- 46444: 4eb9 0004 6350 jsr 46350 <_CORE_mutex_Seize_interrupt_blocking> 4644a: 508f addql #8,%sp } 4644c: 242e fff8 movel %fp@(-8),%d2 46450: 246e fffc moveal %fp@(-4),%a2 46454: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00046590 <_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 ) { 46590: 4e56 0000 linkw %fp,#0 46594: 2f0a movel %a2,%sp@- 46596: 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)) ) { 4659a: 2f0a movel %a2,%sp@- 4659c: 4eb9 0004 7db0 jsr 47db0 <_Thread_queue_Dequeue> 465a2: 588f addql #4,%sp 465a4: 4a80 tstl %d0 465a6: 6624 bnes 465cc <_CORE_semaphore_Surrender+0x3c> if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_semaphore_mp_support) ( the_thread, id ); #endif } else { _ISR_Disable( level ); 465a8: 303c 0700 movew #1792,%d0 465ac: 40c1 movew %sr,%d1 465ae: 8081 orl %d1,%d0 465b0: 46c0 movew %d0,%sr if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 465b2: 202a 0048 movel %a2@(72),%d0 465b6: b0aa 0040 cmpl %a2@(64),%d0 465ba: 640a bccs 465c6 <_CORE_semaphore_Surrender+0x36> <== NEVER TAKEN the_semaphore->count += 1; 465bc: 5280 addql #1,%d0 465be: 2540 0048 movel %d0,%a2@(72) { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 465c2: 4280 clrl %d0 465c4: 6002 bras 465c8 <_CORE_semaphore_Surrender+0x38> } else { _ISR_Disable( level ); if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) the_semaphore->count += 1; else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; 465c6: 7004 moveq #4,%d0 <== NOT EXECUTED _ISR_Enable( level ); 465c8: 46c1 movew %d1,%sr 465ca: 6002 bras 465ce <_CORE_semaphore_Surrender+0x3e> { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 465cc: 4280 clrl %d0 status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); } return status; } 465ce: 246e fffc moveal %fp@(-4),%a2 465d2: 4e5e unlk %fp ... =============================================================================== 00045458 <_Event_Surrender>: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; option_set = (rtems_option) the_thread->Wait.option; _ISR_Disable( level ); 45458: 203c 0000 0700 movel #1792,%d0 */ void _Event_Surrender( Thread_Control *the_thread ) { 4545e: 4e56 ffe8 linkw %fp,#-24 45462: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@ 45466: 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 ]; 4546a: 206a 00fe moveal %a2@(254),%a0 option_set = (rtems_option) the_thread->Wait.option; 4546e: 282a 0030 movel %a2@(48),%d4 _ISR_Disable( level ); 45472: 40c1 movew %sr,%d1 45474: 8081 orl %d1,%d0 45476: 46c0 movew %d0,%sr pending_events = api->pending_events; event_condition = (rtems_event_set) the_thread->Wait.count; 45478: 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 ); 4547c: 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; 4547e: 2410 movel %a0@,%d2 45480: 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 ) ) { 45482: 6606 bnes 4548a <_Event_Surrender+0x32> _ISR_Enable( level ); 45484: 46c1 movew %d1,%sr return; 45486: 6000 00ca braw 45552 <_Event_Surrender+0xfa> /* * 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() && 4548a: 4ab9 0005 ee2e tstl 5ee2e <_Per_CPU_Information+0x8> 45490: 674a beqs 454dc <_Event_Surrender+0x84> 45492: b5f9 0005 ee32 cmpal 5ee32 <_Per_CPU_Information+0xc>,%a2 45498: 6642 bnes 454dc <_Event_Surrender+0x84> _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 4549a: 2279 0005 f204 moveal 5f204 <_Event_Sync_state>,%a1 /* * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) && 454a0: 7a02 moveq #2,%d5 454a2: ba89 cmpl %a1,%d5 454a4: 670e beqs 454b4 <_Event_Surrender+0x5c> <== NEVER TAKEN ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { 454a6: 2279 0005 f204 moveal 5f204 <_Event_Sync_state>,%a1 * If we are in an ISR and sending to the current thread, then * we have a critical section issue to deal with. */ if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 454ac: 1a3c 0001 moveb #1,%d5 454b0: ba89 cmpl %a1,%d5 454b2: 6628 bnes 454dc <_Event_Surrender+0x84> (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { 454b4: b680 cmpl %d0,%d3 454b6: 6706 beqs 454be <_Event_Surrender+0x66> 454b8: 0804 0001 btst #1,%d4 454bc: 671a beqs 454d8 <_Event_Surrender+0x80> <== NEVER TAKEN RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Clear( rtems_event_set the_event_set, rtems_event_set the_mask ) { return ( the_event_set & ~(the_mask) ); 454be: 2600 movel %d0,%d3 454c0: 4683 notl %d3 454c2: c682 andl %d2,%d3 454c4: 2083 movel %d3,%a0@ api->pending_events = _Event_sets_Clear( pending_events,seized_events ); the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 454c6: 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; 454ca: 42aa 0024 clrl %a2@(36) *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 454ce: 2080 movel %d0,%a0@ _Event_Sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 454d0: 7003 moveq #3,%d0 454d2: 23c0 0005 f204 movel %d0,5f204 <_Event_Sync_state> } _ISR_Enable( level ); 454d8: 46c1 movew %d1,%sr return; 454da: 6076 bras 45552 <_Event_Surrender+0xfa> */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_for_event ( States_Control the_states ) { return (the_states & STATES_WAITING_FOR_EVENT); 454dc: 2a2a 0010 movel %a2@(16),%d5 454e0: 0285 0000 0100 andil #256,%d5 } /* * Otherwise, this is a normal send to another thread */ if ( _States_Is_waiting_for_event( the_thread->current_state ) ) { 454e6: 6768 beqs 45550 <_Event_Surrender+0xf8> if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { 454e8: b680 cmpl %d0,%d3 454ea: 6706 beqs 454f2 <_Event_Surrender+0x9a> 454ec: 0804 0001 btst #1,%d4 454f0: 675e beqs 45550 <_Event_Surrender+0xf8> <== NEVER TAKEN 454f2: 2600 movel %d0,%d3 454f4: 4683 notl %d3 454f6: c682 andl %d2,%d3 454f8: 2083 movel %d3,%a0@ api->pending_events = _Event_sets_Clear( pending_events, seized_events ); the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 454fa: 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; 454fe: 42aa 0024 clrl %a2@(36) *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 45502: 2080 movel %d0,%a0@ _ISR_Flash( level ); 45504: 203c 0000 0700 movel #1792,%d0 4550a: 46c1 movew %d1,%sr 4550c: 8081 orl %d1,%d0 4550e: 46c0 movew %d0,%sr 45510: 47f9 0004 7780 lea 47780 <_Thread_Clear_state>,%a3 if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 45516: 7a02 moveq #2,%d5 45518: baaa 0050 cmpl %a2@(80),%d5 4551c: 6710 beqs 4552e <_Event_Surrender+0xd6> _ISR_Enable( level ); 4551e: 46c1 movew %d1,%sr RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 45520: 2f3c 1003 fff8 movel #268697592,%sp@- 45526: 2f0a movel %a2,%sp@- 45528: 4e93 jsr %a3@ 4552a: 508f addql #8,%sp 4552c: 6024 bras 45552 <_Event_Surrender+0xfa> RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 4552e: 7003 moveq #3,%d0 45530: 2540 0050 movel %d0,%a2@(80) _Thread_Unblock( the_thread ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 45534: 46c1 movew %d1,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 45536: 486a 0048 pea %a2@(72) 4553a: 4eb9 0004 8880 jsr 48880 <_Watchdog_Remove> 45540: 2f3c 1003 fff8 movel #268697592,%sp@- 45546: 2f0a movel %a2,%sp@- 45548: 4e93 jsr %a3@ 4554a: 4fef 000c lea %sp@(12),%sp 4554e: 6002 bras 45552 <_Event_Surrender+0xfa> _Thread_Unblock( the_thread ); } return; } } _ISR_Enable( level ); 45550: 46c1 movew %d1,%sr } 45552: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 45558: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004555c <_Event_Timeout>: void _Event_Timeout( Objects_Id id, void *ignored ) { 4555c: 4e56 fffc linkw %fp,#-4 45560: 2f03 movel %d3,%sp@- 45562: 2f02 movel %d2,%sp@- Thread_Control *the_thread; Objects_Locations location; ISR_Level level; the_thread = _Thread_Get( id, &location ); 45564: 486e fffc pea %fp@(-4) 45568: 2f2e 0008 movel %fp@(8),%sp@- 4556c: 4eb9 0004 7ae8 jsr 47ae8 <_Thread_Get> switch ( location ) { 45572: 508f addql #8,%sp 45574: 4aae fffc tstl %fp@(-4) 45578: 6656 bnes 455d0 <_Event_Timeout+0x74> <== NEVER TAKEN * * If it is not satisfied, then it is "nothing happened" and * this is the "timeout" transition. After a request is satisfied, * a timeout is not allowed to occur. */ _ISR_Disable( level ); 4557a: 223c 0000 0700 movel #1792,%d1 45580: 40c2 movew %sr,%d2 45582: 8282 orl %d2,%d1 45584: 46c1 movew %d1,%sr _ISR_Enable( level ); return; } #endif the_thread->Wait.count = 0; 45586: 2040 moveal %d0,%a0 45588: 42a8 0024 clrl %a0@(36) if ( _Thread_Is_executing( the_thread ) ) { 4558c: b0b9 0005 ee32 cmpl 5ee32 <_Per_CPU_Information+0xc>,%d0 45592: 6614 bnes 455a8 <_Event_Timeout+0x4c> if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 45594: 2239 0005 f204 movel 5f204 <_Event_Sync_state>,%d1 4559a: 7601 moveq #1,%d3 4559c: b681 cmpl %d1,%d3 4559e: 6608 bnes 455a8 <_Event_Timeout+0x4c> _Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 455a0: 7202 moveq #2,%d1 455a2: 23c1 0005 f204 movel %d1,5f204 <_Event_Sync_state> } the_thread->Wait.return_code = RTEMS_TIMEOUT; 455a8: 7606 moveq #6,%d3 455aa: 2040 moveal %d0,%a0 455ac: 2143 0034 movel %d3,%a0@(52) _ISR_Enable( level ); 455b0: 46c2 movew %d2,%sr 455b2: 2f3c 1003 fff8 movel #268697592,%sp@- 455b8: 2f00 movel %d0,%sp@- 455ba: 4eb9 0004 7780 jsr 47780 <_Thread_Clear_state> _Thread_Unblock( the_thread ); _Thread_Unnest_dispatch(); break; 455c0: 508f addql #8,%sp */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 455c2: 2039 0005 e9c8 movel 5e9c8 <_Thread_Dispatch_disable_level>,%d0 455c8: 5380 subql #1,%d0 455ca: 23c0 0005 e9c8 movel %d0,5e9c8 <_Thread_Dispatch_disable_level> case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 455d0: 242e fff4 movel %fp@(-12),%d2 455d4: 262e fff8 movel %fp@(-8),%d3 455d8: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004b228 <_Heap_Extend>: Heap_Control *heap, void *extend_area_begin_ptr, uintptr_t extend_area_size, uintptr_t *extended_size_ptr ) { 4b228: 4e56 ffcc linkw %fp,#-52 4b22c: 202e 0010 movel %fp@(16),%d0 4b230: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 4b234: 246e 0008 moveal %fp@(8),%a2 4b238: 262e 000c movel %fp@(12),%d3 Heap_Block *extend_first_block = NULL; Heap_Block *extend_last_block = NULL; uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; uintptr_t const extend_area_begin = (uintptr_t) extend_area_begin_ptr; uintptr_t const extend_area_end = extend_area_begin + extend_area_size; 4b23c: 2403 movel %d3,%d2 4b23e: d480 addl %d0,%d2 uintptr_t const free_size = stats->free_size; 4b240: 206a 0030 moveal %a2@(48),%a0 uintptr_t extend_area_size, uintptr_t *extended_size_ptr ) { Heap_Statistics *const stats = &heap->stats; Heap_Block *const first_block = heap->first_block; 4b244: 282a 0020 movel %a2@(32),%d4 Heap_Block *merge_above_block = NULL; Heap_Block *link_below_block = NULL; Heap_Block *link_above_block = NULL; Heap_Block *extend_first_block = NULL; Heap_Block *extend_last_block = NULL; uintptr_t const page_size = heap->page_size; 4b248: 2a2a 0010 movel %a2@(16),%d5 uintptr_t const min_block_size = heap->min_block_size; 4b24c: 222a 0014 movel %a2@(20),%d1 Heap_Block *start_block = first_block; Heap_Block *merge_below_block = NULL; Heap_Block *merge_above_block = NULL; Heap_Block *link_below_block = NULL; Heap_Block *link_above_block = NULL; Heap_Block *extend_first_block = NULL; 4b250: 42ae fffc clrl %fp@(-4) Heap_Block *extend_last_block = NULL; 4b254: 42ae fff8 clrl %fp@(-8) uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; uintptr_t const extend_area_begin = (uintptr_t) extend_area_begin_ptr; uintptr_t const extend_area_end = extend_area_begin + extend_area_size; uintptr_t const free_size = stats->free_size; 4b258: 2d48 fff4 movel %a0,%fp@(-12) uintptr_t extend_first_block_size = 0; uintptr_t extended_size = 0; bool extend_area_ok = false; if ( extend_area_end < extend_area_begin ) { 4b25c: b682 cmpl %d2,%d3 4b25e: 6200 01aa bhiw 4b40a <_Heap_Extend+0x1e2> return false; } extend_area_ok = _Heap_Get_first_and_last_block( 4b262: 486e fff8 pea %fp@(-8) 4b266: 486e fffc pea %fp@(-4) 4b26a: 2f01 movel %d1,%sp@- 4b26c: 2f05 movel %d5,%sp@- 4b26e: 2f00 movel %d0,%sp@- 4b270: 2f03 movel %d3,%sp@- 4b272: 4eb9 0004 6ac6 jsr 46ac6 <_Heap_Get_first_and_last_block> page_size, min_block_size, &extend_first_block, &extend_last_block ); if (!extend_area_ok ) { 4b278: 4fef 0018 lea %sp@(24),%sp 4b27c: 4a00 tstb %d0 4b27e: 6700 018a beqw 4b40a <_Heap_Extend+0x1e2> 4b282: 2044 moveal %d4,%a0 4b284: 9bcd subal %a5,%a5 4b286: 4281 clrl %d1 4b288: 97cb subal %a3,%a3 4b28a: 99cc subal %a4,%a4 return false; } do { uintptr_t const sub_area_begin = (start_block != first_block) ? (uintptr_t) start_block : heap->area_begin; 4b28c: b888 cmpl %a0,%d4 4b28e: 6704 beqs 4b294 <_Heap_Extend+0x6c> 4b290: 2248 moveal %a0,%a1 4b292: 6004 bras 4b298 <_Heap_Extend+0x70> 4b294: 226a 0018 moveal %a2@(24),%a1 uintptr_t const sub_area_end = start_block->prev_size; 4b298: 2010 movel %a0@,%d0 Heap_Block *const end_block = _Heap_Block_of_alloc_area( sub_area_end, page_size ); if ( 4b29a: b680 cmpl %d0,%d3 4b29c: 6406 bccs 4b2a4 <_Heap_Extend+0x7c> sub_area_end > extend_area_begin && extend_area_end > sub_area_begin 4b29e: b3c2 cmpal %d2,%a1 4b2a0: 6500 0168 bcsw 4b40a <_Heap_Extend+0x1e2> ) { return false; } if ( extend_area_end == sub_area_begin ) { 4b2a4: b3c2 cmpal %d2,%a1 4b2a6: 6706 beqs 4b2ae <_Heap_Extend+0x86> merge_below_block = start_block; } else if ( extend_area_end < sub_area_end ) { 4b2a8: b082 cmpl %d2,%d0 4b2aa: 6206 bhis 4b2b2 <_Heap_Extend+0x8a> 4b2ac: 6006 bras 4b2b4 <_Heap_Extend+0x8c> sub_area_end > extend_area_begin && extend_area_end > sub_area_begin ) { return false; } if ( extend_area_end == sub_area_begin ) { 4b2ae: 2848 moveal %a0,%a4 4b2b0: 6002 bras 4b2b4 <_Heap_Extend+0x8c> merge_below_block = start_block; } else if ( extend_area_end < sub_area_end ) { 4b2b2: 2208 movel %a0,%d1 4b2b4: 2e00 movel %d0,%d7 4b2b6: 2240 moveal %d0,%a1 4b2b8: 5189 subql #8,%a1 4b2ba: 4c45 7006 remul %d5,%d6,%d7 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 4b2be: 93c6 subal %d6,%a1 link_below_block = start_block; } if ( sub_area_end == extend_area_begin ) { 4b2c0: b680 cmpl %d0,%d3 4b2c2: 6606 bnes 4b2ca <_Heap_Extend+0xa2> start_block->prev_size = extend_area_end; 4b2c4: 2082 movel %d2,%a0@ 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 ) 4b2c6: 2649 moveal %a1,%a3 4b2c8: 6006 bras 4b2d0 <_Heap_Extend+0xa8> merge_above_block = end_block; } else if ( sub_area_end < extend_area_begin ) { 4b2ca: b680 cmpl %d0,%d3 4b2cc: 6302 blss 4b2d0 <_Heap_Extend+0xa8> 4b2ce: 2a49 moveal %a1,%a5 - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 4b2d0: 70fe moveq #-2,%d0 4b2d2: c0a9 0004 andl %a1@(4),%d0 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4b2d6: 41f1 0800 lea %a1@(00000000,%d0:l),%a0 link_above_block = end_block; } start_block = _Heap_Block_at( end_block, _Heap_Block_size( end_block ) ); } while ( start_block != first_block ); 4b2da: b888 cmpl %a0,%d4 4b2dc: 66ae bnes 4b28c <_Heap_Extend+0x64> if ( extend_area_begin < heap->area_begin ) { 4b2de: b6aa 0018 cmpl %a2@(24),%d3 4b2e2: 6406 bccs 4b2ea <_Heap_Extend+0xc2> heap->area_begin = extend_area_begin; 4b2e4: 2543 0018 movel %d3,%a2@(24) 4b2e8: 600a bras 4b2f4 <_Heap_Extend+0xcc> } else if ( heap->area_end < extend_area_end ) { 4b2ea: b4aa 001c cmpl %a2@(28),%d2 4b2ee: 6304 blss 4b2f4 <_Heap_Extend+0xcc> heap->area_end = extend_area_end; 4b2f0: 2542 001c movel %d2,%a2@(28) } extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; 4b2f4: 206e fff8 moveal %fp@(-8),%a0 heap->area_begin = extend_area_begin; } else if ( heap->area_end < extend_area_end ) { heap->area_end = extend_area_end; } extend_first_block_size = 4b2f8: 2008 movel %a0,%d0 (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; extend_first_block->prev_size = extend_area_end; extend_first_block->size_and_flag = extend_first_block_size | HEAP_PREV_BLOCK_USED; 4b2fa: 7801 moveq #1,%d4 } else if ( heap->area_end < extend_area_end ) { heap->area_end = extend_area_end; } extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; 4b2fc: 226e fffc moveal %fp@(-4),%a1 heap->area_begin = extend_area_begin; } else if ( heap->area_end < extend_area_end ) { heap->area_end = extend_area_end; } extend_first_block_size = 4b300: 9089 subl %a1,%d0 (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; extend_first_block->prev_size = extend_area_end; extend_first_block->size_and_flag = extend_first_block_size | HEAP_PREV_BLOCK_USED; 4b302: 8880 orl %d0,%d4 } extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; extend_first_block->prev_size = extend_area_end; 4b304: 2282 movel %d2,%a1@ extend_first_block->size_and_flag = extend_first_block_size | HEAP_PREV_BLOCK_USED; 4b306: 2344 0004 movel %d4,%a1@(4) _Heap_Protection_block_initialize( heap, extend_first_block ); extend_last_block->prev_size = extend_first_block_size; 4b30a: 2080 movel %d0,%a0@ extend_last_block->size_and_flag = 0; 4b30c: 42a8 0004 clrl %a0@(4) _Heap_Protection_block_initialize( heap, extend_last_block ); if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) { 4b310: b3ea 0020 cmpal %a2@(32),%a1 4b314: 6406 bccs 4b31c <_Heap_Extend+0xf4> heap->first_block = extend_first_block; 4b316: 2549 0020 movel %a1,%a2@(32) 4b31a: 600a bras 4b326 <_Heap_Extend+0xfe> } else if ( (uintptr_t) extend_last_block > (uintptr_t) heap->last_block ) { 4b31c: b1ea 0024 cmpal %a2@(36),%a0 4b320: 6304 blss 4b326 <_Heap_Extend+0xfe> heap->last_block = extend_last_block; 4b322: 2548 0024 movel %a0,%a2@(36) } if ( merge_below_block != NULL ) { 4b326: 4a8c tstl %a4 4b328: 6732 beqs 4b35c <_Heap_Extend+0x134> Heap_Control *heap, uintptr_t extend_area_begin, Heap_Block *first_block ) { uintptr_t const page_size = heap->page_size; 4b32a: 202a 0010 movel %a2@(16),%d0 uintptr_t const new_first_block_alloc_begin = _Heap_Align_up( extend_area_begin + HEAP_BLOCK_HEADER_SIZE, page_size ); 4b32e: 5083 addql #8,%d3 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up( uintptr_t value, uintptr_t alignment ) { uintptr_t remainder = value % alignment; 4b330: 2803 movel %d3,%d4 4b332: 4c40 4001 remul %d0,%d1,%d4 if ( remainder != 0 ) { 4b336: 4a81 tstl %d1 4b338: 6704 beqs 4b33e <_Heap_Extend+0x116> return value - remainder + alignment; 4b33a: d680 addl %d0,%d3 4b33c: 9681 subl %d1,%d3 uintptr_t const new_first_block_begin = 4b33e: 2043 moveal %d3,%a0 4b340: 5188 subql #8,%a0 new_first_block_alloc_begin - HEAP_BLOCK_HEADER_SIZE; uintptr_t const first_block_begin = (uintptr_t) first_block; uintptr_t const new_first_block_size = 4b342: 200c movel %a4,%d0 4b344: 9088 subl %a0,%d0 first_block_begin - new_first_block_begin; Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin; new_first_block->prev_size = first_block->prev_size; new_first_block->size_and_flag = new_first_block_size | HEAP_PREV_BLOCK_USED; 4b346: 7201 moveq #1,%d1 4b348: 8280 orl %d0,%d1 uintptr_t const first_block_begin = (uintptr_t) first_block; uintptr_t const new_first_block_size = first_block_begin - new_first_block_begin; Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin; new_first_block->prev_size = first_block->prev_size; 4b34a: 2094 movel %a4@,%a0@ new_first_block->size_and_flag = new_first_block_size | HEAP_PREV_BLOCK_USED; 4b34c: 2141 0004 movel %d1,%a0@(4) _Heap_Free_block( heap, new_first_block ); 4b350: 2f08 movel %a0,%sp@- 4b352: 2f0a movel %a2,%sp@- 4b354: 4eba feb6 jsr %pc@(4b20c <_Heap_Free_block>) 4b358: 508f addql #8,%sp 4b35a: 6012 bras 4b36e <_Heap_Extend+0x146> heap->last_block = extend_last_block; } if ( merge_below_block != NULL ) { _Heap_Merge_below( heap, extend_area_begin, merge_below_block ); } else if ( link_below_block != NULL ) { 4b35c: 4a81 tstl %d1 4b35e: 670e beqs 4b36e <_Heap_Extend+0x146> _Heap_Link_below( 4b360: 206e fff8 moveal %fp@(-8),%a0 { uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const link_begin = (uintptr_t) link; last_block->size_and_flag = (link_begin - last_block_begin) | HEAP_PREV_BLOCK_USED; 4b364: 7801 moveq #1,%d4 4b366: 9288 subl %a0,%d1 4b368: 8881 orl %d1,%d4 4b36a: 2144 0004 movel %d4,%a0@(4) link_below_block, extend_last_block ); } if ( merge_above_block != NULL ) { 4b36e: 4a8b tstl %a3 4b370: 6734 beqs 4b3a6 <_Heap_Extend+0x17e> ) { uintptr_t const page_size = heap->page_size; uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const last_block_new_size = _Heap_Align_down( extend_area_end - last_block_begin - HEAP_BLOCK_HEADER_SIZE, 4b372: 5182 subql #8,%d2 uintptr_t extend_area_end ) { uintptr_t const page_size = heap->page_size; uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const last_block_new_size = _Heap_Align_down( 4b374: 948b subl %a3,%d2 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4b376: 2202 movel %d2,%d1 4b378: 4c6a 1000 0010 remul %a2@(16),%d0,%d1 Heap_Block *const new_last_block = _Heap_Block_at( last_block, last_block_new_size ); new_last_block->size_and_flag = (last_block->size_and_flag - last_block_new_size) | HEAP_PREV_BLOCK_USED; 4b37e: 7201 moveq #1,%d1 4b380: 9480 subl %d0,%d2 ); Heap_Block *const new_last_block = _Heap_Block_at( last_block, last_block_new_size ); new_last_block->size_and_flag = (last_block->size_and_flag - last_block_new_size) 4b382: 202b 0004 movel %a3@(4),%d0 4b386: 9082 subl %d2,%d0 | HEAP_PREV_BLOCK_USED; 4b388: 8280 orl %d0,%d1 RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 4b38a: 7001 moveq #1,%d0 4b38c: 2781 2804 movel %d1,%a3@(00000004,%d2:l) 4b390: c0ab 0004 andl %a3@(4),%d0 block->size_and_flag = size | flag; 4b394: 8480 orl %d0,%d2 4b396: 2742 0004 movel %d2,%a3@(4) _Heap_Block_set_size( last_block, last_block_new_size ); _Heap_Free_block( heap, last_block ); 4b39a: 2f0b movel %a3,%sp@- 4b39c: 2f0a movel %a2,%sp@- 4b39e: 4eba fe6c jsr %pc@(4b20c <_Heap_Free_block>) 4b3a2: 508f addql #8,%sp 4b3a4: 6020 bras 4b3c6 <_Heap_Extend+0x19e> ); } if ( merge_above_block != NULL ) { _Heap_Merge_above( heap, merge_above_block, extend_area_end ); } else if ( link_above_block != NULL ) { 4b3a6: 4a8d tstl %a5 4b3a8: 671c beqs 4b3c6 <_Heap_Extend+0x19e> RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 4b3aa: 7001 moveq #1,%d0 uintptr_t const link_begin = (uintptr_t) link; uintptr_t const first_block_begin = (uintptr_t) first_block; _Heap_Block_set_size( link, first_block_begin - link_begin ); last_block->size_and_flag |= HEAP_PREV_BLOCK_USED; 4b3ac: 7801 moveq #1,%d4 ) { uintptr_t const link_begin = (uintptr_t) link; uintptr_t const first_block_begin = (uintptr_t) first_block; _Heap_Block_set_size( link, first_block_begin - link_begin ); 4b3ae: 222e fffc movel %fp@(-4),%d1 4b3b2: 928d subl %a5,%d1 4b3b4: c0ad 0004 andl %a5@(4),%d0 } if ( merge_above_block != NULL ) { _Heap_Merge_above( heap, merge_above_block, extend_area_end ); } else if ( link_above_block != NULL ) { _Heap_Link_above( 4b3b8: 206e fff8 moveal %fp@(-8),%a0 block->size_and_flag = size | flag; 4b3bc: 8280 orl %d0,%d1 4b3be: 2b41 0004 movel %d1,%a5@(4) uintptr_t const link_begin = (uintptr_t) link; uintptr_t const first_block_begin = (uintptr_t) first_block; _Heap_Block_set_size( link, first_block_begin - link_begin ); last_block->size_and_flag |= HEAP_PREV_BLOCK_USED; 4b3c2: 89a8 0004 orl %d4,%a0@(4) extend_first_block, extend_last_block ); } if ( merge_below_block == NULL && merge_above_block == NULL ) { 4b3c6: 4a8c tstl %a4 4b3c8: 6610 bnes 4b3da <_Heap_Extend+0x1b2> 4b3ca: 4a8b tstl %a3 4b3cc: 660c bnes 4b3da <_Heap_Extend+0x1b2> _Heap_Free_block( heap, extend_first_block ); 4b3ce: 2f2e fffc movel %fp@(-4),%sp@- 4b3d2: 2f0a movel %a2,%sp@- 4b3d4: 4eba fe36 jsr %pc@(4b20c <_Heap_Free_block>) 4b3d8: 508f addql #8,%sp */ RTEMS_INLINE_ROUTINE void _Heap_Set_last_block_size( Heap_Control *heap ) { _Heap_Block_set_size( heap->last_block, (uintptr_t) heap->first_block - (uintptr_t) heap->last_block 4b3da: 206a 0024 moveal %a2@(36),%a0 RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 4b3de: 7001 moveq #1,%d0 * This feature will be used to terminate the scattered heap area list. See * also _Heap_Extend(). */ RTEMS_INLINE_ROUTINE void _Heap_Set_last_block_size( Heap_Control *heap ) { _Heap_Block_set_size( 4b3e0: 222a 0020 movel %a2@(32),%d1 4b3e4: 9288 subl %a0,%d1 RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 4b3e6: c0a8 0004 andl %a0@(4),%d0 block->size_and_flag = size | flag; 4b3ea: 8280 orl %d0,%d1 } _Heap_Set_last_block_size( heap ); extended_size = stats->free_size - free_size; 4b3ec: 202a 0030 movel %a2@(48),%d0 4b3f0: 90ae fff4 subl %fp@(-12),%d0 4b3f4: 2141 0004 movel %d1,%a0@(4) /* Statistics */ stats->size += extended_size; 4b3f8: d1aa 002c addl %d0,%a2@(44) if ( extended_size_ptr != NULL ) 4b3fc: 4aae 0014 tstl %fp@(20) 4b400: 670c beqs 4b40e <_Heap_Extend+0x1e6> <== NEVER TAKEN *extended_size_ptr = extended_size; 4b402: 206e 0014 moveal %fp@(20),%a0 4b406: 2080 movel %d0,%a0@ 4b408: 6004 bras 4b40e <_Heap_Extend+0x1e6> _Heap_Block_of_alloc_area( sub_area_end, page_size ); if ( sub_area_end > extend_area_begin && extend_area_end > sub_area_begin ) { return false; 4b40a: 4200 clrb %d0 4b40c: 6002 bras 4b410 <_Heap_Extend+0x1e8> stats->size += extended_size; if ( extended_size_ptr != NULL ) *extended_size_ptr = extended_size; return true; 4b40e: 7001 moveq #1,%d0 } 4b410: 4cee 3cfc ffcc moveml %fp@(-52),%d2-%d7/%a2-%a5 4b416: 4e5e unlk %fp ... =============================================================================== 0004af2c <_Heap_Free>: return do_free; } #endif bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { 4af2c: 4e56 ffe8 linkw %fp,#-24 4af30: 206e 0008 moveal %fp@(8),%a0 4af34: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@ 4af38: 202e 000c movel %fp@(12),%d0 /* * If NULL return true so a free on NULL is considered a valid release. This * is a special case that could be handled by the in heap check how-ever that * would result in false being returned which is wrong. */ if ( alloc_begin_ptr == NULL ) { 4af3c: 6700 0150 beqw 4b08e <_Heap_Free+0x162> 4af40: 2240 moveal %d0,%a1 4af42: 5189 subql #8,%a1 4af44: 4c68 0001 0010 remul %a0@(16),%d1,%d0 RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap( const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block 4af4a: 2828 0020 movel %a0@(32),%d4 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 4af4e: 93c1 subal %d1,%a1 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 4af50: b889 cmpl %a1,%d4 4af52: 620c bhis 4af60 <_Heap_Free+0x34> 4af54: b3e8 0024 cmpal %a0@(36),%a1 4af58: 53c0 sls %d0 4af5a: 49c0 extbl %d0 4af5c: 4480 negl %d0 4af5e: 6002 bras 4af62 <_Heap_Free+0x36> 4af60: 4280 clrl %d0 } alloc_begin = (uintptr_t) alloc_begin_ptr; block = _Heap_Block_of_alloc_area( alloc_begin, heap->page_size ); if ( !_Heap_Is_block_in_heap( heap, block ) ) { 4af62: 4a00 tstb %d0 4af64: 6700 012c beqw 4b092 <_Heap_Free+0x166> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 4af68: 2629 0004 movel %a1@(4),%d3 - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 4af6c: 70fe moveq #-2,%d0 4af6e: 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); 4af70: 45f1 0800 lea %a1@(00000000,%d0:l),%a2 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 4af74: b88a cmpl %a2,%d4 4af76: 620c bhis 4af84 <_Heap_Free+0x58> <== NEVER TAKEN 4af78: b5e8 0024 cmpal %a0@(36),%a2 4af7c: 53c1 sls %d1 4af7e: 49c1 extbl %d1 4af80: 4481 negl %d1 4af82: 6002 bras 4af86 <_Heap_Free+0x5a> 4af84: 4281 clrl %d1 <== NOT EXECUTED _Heap_Protection_block_check( heap, block ); block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 4af86: 4a01 tstb %d1 4af88: 6700 0108 beqw 4b092 <_Heap_Free+0x166> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 4af8c: 242a 0004 movel %a2@(4),%d2 return false; } _Heap_Protection_block_check( heap, next_block ); if ( !_Heap_Is_prev_used( next_block ) ) { 4af90: 0802 0000 btst #0,%d2 4af94: 6700 00fc beqw 4b092 <_Heap_Free+0x166> - 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; 4af98: 72fe moveq #-2,%d1 if ( !_Heap_Protection_determine_block_free( heap, block ) ) { return true; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block 4af9a: 2668 0024 moveal %a0@(36),%a3 4af9e: c481 andl %d1,%d2 && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); 4afa0: b7ca cmpal %a2,%a3 4afa2: 670c beqs 4afb0 <_Heap_Free+0x84> 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; 4afa4: 7201 moveq #1,%d1 4afa6: c2b2 2804 andl %a2@(00000004,%d2:l),%d1 return do_free; } #endif bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) 4afaa: 5381 subql #1,%d1 4afac: 4481 negl %d1 4afae: 6002 bras 4afb2 <_Heap_Free+0x86> return true; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); 4afb0: 4281 clrl %d1 if ( !_Heap_Protection_determine_block_free( heap, block ) ) { return true; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block 4afb2: 1a01 moveb %d1,%d5 && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); if ( !_Heap_Is_prev_used( block ) ) { 4afb4: 0803 0000 btst #0,%d3 4afb8: 6662 bnes 4b01c <_Heap_Free+0xf0> uintptr_t const prev_size = block->prev_size; 4afba: 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); 4afbc: 93c3 subal %d3,%a1 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 4afbe: b889 cmpl %a1,%d4 4afc0: 620a bhis 4afcc <_Heap_Free+0xa0> <== NEVER TAKEN 4afc2: b3cb cmpal %a3,%a1 4afc4: 53c1 sls %d1 4afc6: 49c1 extbl %d1 4afc8: 4481 negl %d1 4afca: 6002 bras 4afce <_Heap_Free+0xa2> 4afcc: 4281 clrl %d1 <== NOT EXECUTED Heap_Block * const prev_block = _Heap_Block_at( block, -prev_size ); if ( !_Heap_Is_block_in_heap( heap, prev_block ) ) { 4afce: 4a01 tstb %d1 4afd0: 6700 00c0 beqw 4b092 <_Heap_Free+0x166> 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; 4afd4: 7201 moveq #1,%d1 4afd6: c2a9 0004 andl %a1@(4),%d1 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) ) { 4afda: 6700 00b6 beqw 4b092 <_Heap_Free+0x166> _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ 4afde: 4a05 tstb %d5 4afe0: 6726 beqs 4b008 <_Heap_Free+0xdc> return _Heap_Free_list_tail(heap)->prev; } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; 4afe2: 266a 0008 moveal %a2@(8),%a3 uintptr_t const size = block_size + prev_size + next_block_size; 4afe6: d480 addl %d0,%d2 4afe8: d682 addl %d2,%d3 _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4afea: 7401 moveq #1,%d2 Heap_Block *prev = block->prev; 4afec: 246a 000c moveal %a2@(12),%a2 prev->next = next; 4aff0: 254b 0008 movel %a3,%a2@(8) 4aff4: 8483 orl %d3,%d2 next->prev = prev; 4aff6: 274a 000c movel %a2,%a3@(12) } if ( next_is_free ) { /* coalesce both */ uintptr_t const size = block_size + prev_size + next_block_size; _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 4affa: 53a8 0038 subql #1,%a0@(56) prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; next_block = _Heap_Block_at( prev_block, size ); _HAssert(!_Heap_Is_prev_used( next_block)); next_block->prev_size = size; 4affe: 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; 4b002: 2342 0004 movel %d2,%a1@(4) 4b006: 607a bras 4b082 <_Heap_Free+0x156> 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; 4b008: d680 addl %d0,%d3 prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4b00a: 7201 moveq #1,%d1 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4b00c: 74fe moveq #-2,%d2 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; 4b00e: 8283 orl %d3,%d1 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = size; 4b010: 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; 4b012: 2341 0004 movel %d1,%a1@(4) next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4b016: c5aa 0004 andl %d2,%a2@(4) 4b01a: 6066 bras 4b082 <_Heap_Free+0x156> next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ 4b01c: 4a01 tstb %d1 4b01e: 672a beqs 4b04a <_Heap_Free+0x11e> RTEMS_INLINE_ROUTINE void _Heap_Free_list_replace( Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; 4b020: 266a 0008 moveal %a2@(8),%a3 uintptr_t const size = block_size + next_block_size; 4b024: 2202 movel %d2,%d1 4b026: d280 addl %d0,%d1 _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4b028: 7401 moveq #1,%d2 Heap_Block *prev = old_block->prev; 4b02a: 246a 000c moveal %a2@(12),%a2 new_block->next = next; 4b02e: 234b 0008 movel %a3,%a1@(8) 4b032: 8481 orl %d1,%d2 new_block->prev = prev; 4b034: 234a 000c movel %a2,%a1@(12) next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; 4b038: 2381 1800 movel %d1,%a1@(00000000,%d1:l) next->prev = new_block; 4b03c: 2749 000c movel %a1,%a3@(12) prev->next = new_block; 4b040: 2549 0008 movel %a1,%a2@(8) next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ uintptr_t const size = block_size + next_block_size; _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4b044: 2342 0004 movel %d2,%a1@(4) 4b048: 6038 bras 4b082 <_Heap_Free+0x156> 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; 4b04a: 7201 moveq #1,%d1 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4b04c: 74fe moveq #-2,%d2 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; 4b04e: 8280 orl %d0,%d1 RTEMS_INLINE_ROUTINE void _Heap_Free_list_insert_after( Heap_Block *block_before, Heap_Block *new_block ) { Heap_Block *next = block_before->next; 4b050: 2668 0008 moveal %a0@(8),%a3 new_block->next = next; new_block->prev = block_before; 4b054: 2348 000c movel %a0,%a1@(12) 4b058: 2341 0004 movel %d1,%a1@(4) next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; 4b05c: 2228 0038 movel %a0@(56),%d1 4b060: 5281 addql #1,%d1 Heap_Block *new_block ) { Heap_Block *next = block_before->next; new_block->next = next; 4b062: 234b 0008 movel %a3,%a1@(8) } 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; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4b066: c5aa 0004 andl %d2,%a2@(4) new_block->prev = block_before; block_before->next = new_block; next->prev = new_block; 4b06a: 2749 000c movel %a1,%a3@(12) next_block->prev_size = block_size; 4b06e: 2480 movel %d0,%a2@ { Heap_Block *next = block_before->next; new_block->next = next; new_block->prev = block_before; block_before->next = new_block; 4b070: 2149 0008 movel %a1,%a0@(8) /* Statistics */ ++stats->free_blocks; 4b074: 2141 0038 movel %d1,%a0@(56) if ( stats->max_free_blocks < stats->free_blocks ) { 4b078: b2a8 003c cmpl %a0@(60),%d1 4b07c: 6304 blss 4b082 <_Heap_Free+0x156> stats->max_free_blocks = stats->free_blocks; 4b07e: 2141 003c movel %d1,%a0@(60) } } /* Statistics */ --stats->used_blocks; 4b082: 53a8 0040 subql #1,%a0@(64) ++stats->frees; 4b086: 52a8 0050 addql #1,%a0@(80) stats->free_size += block_size; 4b08a: d1a8 0030 addl %d0,%a0@(48) * If NULL return true so a free on NULL is considered a valid release. This * is a special case that could be handled by the in heap check how-ever that * would result in false being returned which is wrong. */ if ( alloc_begin_ptr == NULL ) { return true; 4b08e: 7001 moveq #1,%d0 4b090: 6002 bras 4b094 <_Heap_Free+0x168> /* As we always coalesce free blocks, the block that preceedes prev_block must have been used. */ if ( !_Heap_Is_prev_used ( prev_block) ) { _HAssert( false ); return( false ); 4b092: 4200 clrb %d0 --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 4b094: 4cd7 0c3c moveml %sp@,%d2-%d5/%a2-%a3 4b098: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0005b188 <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { 5b188: 4e56 0000 linkw %fp,#0 5b18c: 202e 000c movel %fp@(12),%d0 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 5b190: 2040 moveal %d0,%a0 5b192: 5188 subql #8,%a0 5b194: 226e 0008 moveal %fp@(8),%a1 5b198: 2f02 movel %d2,%sp@- 5b19a: 2400 movel %d0,%d2 5b19c: 4c69 2001 0010 remul %a1@(16),%d1,%d2 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 5b1a2: 2429 0020 movel %a1@(32),%d2 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 5b1a6: 91c1 subal %d1,%a0 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 5b1a8: b488 cmpl %a0,%d2 5b1aa: 620c bhis 5b1b8 <_Heap_Size_of_alloc_area+0x30> 5b1ac: b1e9 0024 cmpal %a1@(36),%a0 5b1b0: 53c1 sls %d1 5b1b2: 49c1 extbl %d1 5b1b4: 4481 negl %d1 5b1b6: 6002 bras 5b1ba <_Heap_Size_of_alloc_area+0x32> 5b1b8: 4281 clrl %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 ) ) { 5b1ba: 4a01 tstb %d1 5b1bc: 6738 beqs 5b1f6 <_Heap_Size_of_alloc_area+0x6e> - 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; 5b1be: 72fe moveq #-2,%d1 5b1c0: c2a8 0004 andl %a0@(4),%d1 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 5b1c4: d1c1 addal %d1,%a0 const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block && (uintptr_t) block <= (uintptr_t) heap->last_block; 5b1c6: b488 cmpl %a0,%d2 5b1c8: 620c bhis 5b1d6 <_Heap_Size_of_alloc_area+0x4e> <== NEVER TAKEN 5b1ca: b1e9 0024 cmpal %a1@(36),%a0 5b1ce: 53c1 sls %d1 5b1d0: 49c1 extbl %d1 5b1d2: 4481 negl %d1 5b1d4: 6002 bras 5b1d8 <_Heap_Size_of_alloc_area+0x50> 5b1d6: 4281 clrl %d1 <== NOT EXECUTED } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( 5b1d8: 4a01 tstb %d1 5b1da: 671a beqs 5b1f6 <_Heap_Size_of_alloc_area+0x6e> <== NEVER TAKEN block->size_and_flag = size | flag; } RTEMS_INLINE_ROUTINE bool _Heap_Is_prev_used( const Heap_Block *block ) { return block->size_and_flag & HEAP_PREV_BLOCK_USED; 5b1dc: 7201 moveq #1,%d1 5b1de: c2a8 0004 andl %a0@(4),%d1 !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) 5b1e2: 6712 beqs 5b1f6 <_Heap_Size_of_alloc_area+0x6e> <== NEVER TAKEN ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; 5b1e4: 7204 moveq #4,%d1 5b1e6: 9280 subl %d0,%d1 5b1e8: 2001 movel %d1,%d0 5b1ea: d088 addl %a0,%d0 5b1ec: 226e 0010 moveal %fp@(16),%a1 5b1f0: 2280 movel %d0,%a1@ return true; 5b1f2: 7001 moveq #1,%d0 5b1f4: 6002 bras 5b1f8 <_Heap_Size_of_alloc_area+0x70> if ( !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) ) { return false; 5b1f6: 4200 clrb %d0 } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; return true; } 5b1f8: 241f movel %sp@+,%d2 5b1fa: 4e5e unlk %fp ... =============================================================================== 00047426 <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 47426: 4e56 ffd0 linkw %fp,#-48 4742a: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 4742e: 266e 0008 moveal %fp@(8),%a3 uintptr_t const min_block_size = heap->min_block_size; Heap_Block *const first_block = heap->first_block; Heap_Block *const last_block = heap->last_block; Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 47432: 45fa ffac lea %pc@(473e0 <_Heap_Walk_print_nothing>),%a2 bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 47436: 242e 000c movel %fp@(12),%d2 uintptr_t const page_size = heap->page_size; 4743a: 282b 0010 movel %a3@(16),%d4 uintptr_t const min_block_size = heap->min_block_size; 4743e: 2a2b 0014 movel %a3@(20),%d5 Heap_Block *const first_block = heap->first_block; 47442: 2c2b 0020 movel %a3@(32),%d6 Heap_Block *const last_block = heap->last_block; 47446: 2e2b 0024 movel %a3@(36),%d7 Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 4744a: 4a2e 0013 tstb %fp@(19) 4744e: 6704 beqs 47454 <_Heap_Walk+0x2e> 47450: 45fa ff96 lea %pc@(473e8 <_Heap_Walk_print>),%a2 if ( !_System_state_Is_up( _System_state_Get() ) ) { 47454: 7003 moveq #3,%d0 47456: b0b9 0006 0ebc cmpl 60ebc <_System_state_Current>,%d0 4745c: 6600 02fc bnew 4775a <_Heap_Walk+0x334> 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)( 47460: 2f2b 000c movel %a3@(12),%sp@- 47464: 2f2b 0008 movel %a3@(8),%sp@- 47468: 2f07 movel %d7,%sp@- 4746a: 2f06 movel %d6,%sp@- 4746c: 2f2b 001c movel %a3@(28),%sp@- 47470: 2f2b 0018 movel %a3@(24),%sp@- 47474: 2f05 movel %d5,%sp@- 47476: 2f04 movel %d4,%sp@- 47478: 4879 0005 d139 pea 5d139 <_Status_Object_name_errors_to_status+0x5d> 4747e: 42a7 clrl %sp@- 47480: 2f02 movel %d2,%sp@- 47482: 4e92 jsr %a2@ heap->area_begin, heap->area_end, first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { 47484: 4fef 002c lea %sp@(44),%sp 47488: 4a84 tstl %d4 4748a: 6608 bnes 47494 <_Heap_Walk+0x6e> (*printer)( source, true, "page size is zero\n" ); 4748c: 4879 0005 d1ca pea 5d1ca <_Status_Object_name_errors_to_status+0xee> 47492: 6050 bras 474e4 <_Heap_Walk+0xbe> ) { #if (CPU_ALIGNMENT == 0) return true; #else return (((uintptr_t)address % CPU_ALIGNMENT) == 0); 47494: 7003 moveq #3,%d0 47496: c084 andl %d4,%d0 return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 47498: 670c beqs 474a6 <_Heap_Walk+0x80> (*printer)( 4749a: 2f04 movel %d4,%sp@- 4749c: 4879 0005 d1dd pea 5d1dd <_Status_Object_name_errors_to_status+0x101> 474a2: 6000 02ca braw 4776e <_Heap_Walk+0x348> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 474a6: 2205 movel %d5,%d1 474a8: 4c44 1000 remul %d4,%d0,%d1 ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 474ac: 4a80 tstl %d0 474ae: 670c beqs 474bc <_Heap_Walk+0x96> (*printer)( 474b0: 2f05 movel %d5,%sp@- 474b2: 4879 0005 d1fb pea 5d1fb <_Status_Object_name_errors_to_status+0x11f> 474b8: 6000 02b4 braw 4776e <_Heap_Walk+0x348> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 474bc: 2006 movel %d6,%d0 474be: 5080 addql #8,%d0 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 474c0: 4c44 0001 remul %d4,%d1,%d0 ); return false; } if ( 474c4: 4a81 tstl %d1 474c6: 670c beqs 474d4 <_Heap_Walk+0xae> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 474c8: 2f06 movel %d6,%sp@- 474ca: 4879 0005 d21f pea 5d21f <_Status_Object_name_errors_to_status+0x143> 474d0: 6000 029c braw 4776e <_Heap_Walk+0x348> 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; 474d4: 7001 moveq #1,%d0 474d6: 2046 moveal %d6,%a0 474d8: c0a8 0004 andl %a0@(4),%d0 ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 474dc: 6616 bnes 474f4 <_Heap_Walk+0xce> (*printer)( 474de: 4879 0005 d250 pea 5d250 <_Status_Object_name_errors_to_status+0x174> 474e4: 4878 0001 pea 1 474e8: 2f02 movel %d2,%sp@- 474ea: 4e92 jsr %a2@ 474ec: 4fef 000c lea %sp@(12),%sp 474f0: 6000 00ba braw 475ac <_Heap_Walk+0x186> - 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; 474f4: 70fe moveq #-2,%d0 474f6: 2047 moveal %d7,%a0 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 474f8: 2847 moveal %d7,%a4 - 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; 474fa: c0a8 0004 andl %a0@(4),%d0 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 474fe: d9c0 addal %d0,%a4 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; 47500: 7001 moveq #1,%d0 47502: c0ac 0004 andl %a4@(4),%d0 ); return false; } if ( _Heap_Is_free( last_block ) ) { 47506: 6608 bnes 47510 <_Heap_Walk+0xea> (*printer)( 47508: 4879 0005 d27e pea 5d27e <_Status_Object_name_errors_to_status+0x1a2> 4750e: 60d4 bras 474e4 <_Heap_Walk+0xbe> ); return false; } if ( 47510: bc8c cmpl %a4,%d6 47512: 6708 beqs 4751c <_Heap_Walk+0xf6> _Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block ) { (*printer)( 47514: 4879 0005 d293 pea 5d293 <_Status_Object_name_errors_to_status+0x1b7> 4751a: 60c8 bras 474e4 <_Heap_Walk+0xbe> int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 4751c: 262b 0010 movel %a3@(16),%d3 const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); 47520: 220b movel %a3,%d1 block = next_block; } while ( block != first_block ); return true; } 47522: 206b 0008 moveal %a3@(8),%a0 47526: 2d44 fff8 movel %d4,%fp@(-8) 4752a: 2d43 fffc movel %d3,%fp@(-4) 4752e: 6000 0088 braw 475b8 <_Heap_Walk+0x192> 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; 47532: b1eb 0020 cmpal %a3@(32),%a0 47536: 650c bcss 47544 <_Heap_Walk+0x11e> 47538: b1eb 0024 cmpal %a3@(36),%a0 4753c: 53c0 sls %d0 4753e: 49c0 extbl %d0 47540: 4480 negl %d0 47542: 6002 bras 47546 <_Heap_Walk+0x120> 47544: 4280 clrl %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 ) ) { 47546: 4a00 tstb %d0 47548: 660c bnes 47556 <_Heap_Walk+0x130> (*printer)( 4754a: 2f08 movel %a0,%sp@- 4754c: 4879 0005 d2c2 pea 5d2c2 <_Status_Object_name_errors_to_status+0x1e6> 47552: 6000 021a braw 4776e <_Heap_Walk+0x348> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 47556: 4be8 0008 lea %a0@(8),%a5 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 4755a: 200d movel %a5,%d0 4755c: 262e fffc movel %fp@(-4),%d3 47560: 4c43 0004 remul %d3,%d4,%d0 ); return false; } if ( 47564: 4a84 tstl %d4 47566: 670c beqs 47574 <_Heap_Walk+0x14e> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 47568: 2f08 movel %a0,%sp@- 4756a: 4879 0005 d2e2 pea 5d2e2 <_Status_Object_name_errors_to_status+0x206> 47570: 6000 01fc braw 4776e <_Heap_Walk+0x348> - 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; 47574: 70fe moveq #-2,%d0 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; 47576: 7601 moveq #1,%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; 47578: c0a8 0004 andl %a0@(4),%d0 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; 4757c: c6b0 0804 andl %a0@(00000004,%d0:l),%d3 ); return false; } if ( _Heap_Is_used( free_block ) ) { 47580: 670c beqs 4758e <_Heap_Walk+0x168> (*printer)( 47582: 2f08 movel %a0,%sp@- 47584: 4879 0005 d312 pea 5d312 <_Status_Object_name_errors_to_status+0x236> 4758a: 6000 01e2 braw 4776e <_Heap_Walk+0x348> ); return false; } if ( free_block->prev != prev_block ) { 4758e: 2028 000c movel %a0@(12),%d0 47592: b280 cmpl %d0,%d1 47594: 671c beqs 475b2 <_Heap_Walk+0x18c> (*printer)( 47596: 2f00 movel %d0,%sp@- 47598: 2f08 movel %a0,%sp@- 4759a: 4879 0005 d32e pea 5d32e <_Status_Object_name_errors_to_status+0x252> 475a0: 4878 0001 pea 1 475a4: 2f02 movel %d2,%sp@- 475a6: 4e92 jsr %a2@ 475a8: 4fef 0014 lea %sp@(20),%sp if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 475ac: 4200 clrb %d0 475ae: 6000 01ac braw 4775c <_Heap_Walk+0x336> return false; } prev_block = free_block; free_block = free_block->next; 475b2: 2208 movel %a0,%d1 475b4: 2068 0008 moveal %a0@(8),%a0 const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); const Heap_Block *const first_free_block = _Heap_Free_list_first( heap ); const Heap_Block *prev_block = free_list_tail; const Heap_Block *free_block = first_free_block; while ( free_block != free_list_tail ) { 475b8: b7c8 cmpal %a0,%a3 475ba: 6600 ff76 bnew 47532 <_Heap_Walk+0x10c> 475be: 282e fff8 movel %fp@(-8),%d4 475c2: 6002 bras 475c6 <_Heap_Walk+0x1a0> block->prev_size ); } block = next_block; } while ( block != first_block ); 475c4: 284d moveal %a5,%a4 return true; } 475c6: 202c 0004 movel %a4@(4),%d0 - HEAP_BLOCK_HEADER_SIZE); } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 475ca: 76fe moveq #-2,%d3 475cc: c680 andl %d0,%d3 475ce: 2d40 fffc movel %d0,%fp@(-4) RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 475d2: 4bf4 3800 lea %a4@(00000000,%d3:l),%a5 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; 475d6: bbeb 0020 cmpal %a3@(32),%a5 475da: 650c bcss 475e8 <_Heap_Walk+0x1c2> <== NEVER TAKEN 475dc: bbeb 0024 cmpal %a3@(36),%a5 475e0: 53c0 sls %d0 475e2: 49c0 extbl %d0 475e4: 4480 negl %d0 475e6: 6002 bras 475ea <_Heap_Walk+0x1c4> 475e8: 4280 clrl %d0 <== NOT EXECUTED bool const prev_used = _Heap_Is_prev_used( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); uintptr_t const next_block_begin = (uintptr_t) next_block; bool const is_not_last_block = block != last_block; if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 475ea: 4a00 tstb %d0 475ec: 660c bnes 475fa <_Heap_Walk+0x1d4> (*printer)( 475ee: 2f0d movel %a5,%sp@- 475f0: 2f0c movel %a4,%sp@- 475f2: 4879 0005 d360 pea 5d360 <_Status_Object_name_errors_to_status+0x284> 475f8: 60a6 bras 475a0 <_Heap_Walk+0x17a> uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); bool const prev_used = _Heap_Is_prev_used( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); uintptr_t const next_block_begin = (uintptr_t) next_block; bool const is_not_last_block = block != last_block; 475fa: be8c cmpl %a4,%d7 475fc: 56c0 sne %d0 475fe: 2200 movel %d0,%d1 47600: 4481 negl %d1 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 47602: 2003 movel %d3,%d0 47604: 1d41 fffb moveb %d1,%fp@(-5) 47608: 4c44 0001 remul %d4,%d1,%d0 ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { 4760c: 4a81 tstl %d1 4760e: 6714 beqs 47624 <_Heap_Walk+0x1fe> 47610: 4a2e fffb tstb %fp@(-5) 47614: 670e beqs 47624 <_Heap_Walk+0x1fe> (*printer)( 47616: 2f03 movel %d3,%sp@- 47618: 2f0c movel %a4,%sp@- 4761a: 4879 0005 d38d pea 5d38d <_Status_Object_name_errors_to_status+0x2b1> 47620: 6000 ff7e braw 475a0 <_Heap_Walk+0x17a> ); return false; } if ( block_size < min_block_size && is_not_last_block ) { 47624: ba83 cmpl %d3,%d5 47626: 6322 blss 4764a <_Heap_Walk+0x224> 47628: 4a2e fffb tstb %fp@(-5) 4762c: 671c beqs 4764a <_Heap_Walk+0x224> <== NEVER TAKEN (*printer)( 4762e: 2f05 movel %d5,%sp@- 47630: 2f03 movel %d3,%sp@- 47632: 2f0c movel %a4,%sp@- 47634: 4879 0005 d3bb pea 5d3bb <_Status_Object_name_errors_to_status+0x2df> 4763a: 4878 0001 pea 1 4763e: 2f02 movel %d2,%sp@- 47640: 4e92 jsr %a2@ block, block_size, min_block_size ); return false; 47642: 4fef 0018 lea %sp@(24),%sp 47646: 6000 ff64 braw 475ac <_Heap_Walk+0x186> } if ( next_block_begin <= block_begin && is_not_last_block ) { 4764a: b9cd cmpal %a5,%a4 4764c: 6514 bcss 47662 <_Heap_Walk+0x23c> 4764e: 4a2e fffb tstb %fp@(-5) 47652: 670e beqs 47662 <_Heap_Walk+0x23c> (*printer)( 47654: 2f0d movel %a5,%sp@- 47656: 2f0c movel %a4,%sp@- 47658: 4879 0005 d3e6 pea 5d3e6 <_Status_Object_name_errors_to_status+0x30a> 4765e: 6000 ff40 braw 475a0 <_Heap_Walk+0x17a> 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; 47662: 7001 moveq #1,%d0 47664: c0ae fffc andl %fp@(-4),%d0 47668: 2d40 fffc movel %d0,%fp@(-4) 4766c: 7001 moveq #1,%d0 4766e: c0ad 0004 andl %a5@(4),%d0 ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 47672: 6600 00ae bnew 47722 <_Heap_Walk+0x2fc> block = next_block; } while ( block != first_block ); return true; } 47676: 222b 0008 movel %a3@(8),%d1 Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 4767a: 43f9 0005 d106 lea 5d106 <_Status_Object_name_errors_to_status+0x2a>,%a1 block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? 47680: 206c 0008 moveal %a4@(8),%a0 block = next_block; } while ( block != first_block ); return true; } 47684: 2d41 fff8 movel %d1,%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)( 47688: b1eb 000c cmpal %a3@(12),%a0 4768c: 6710 beqs 4769e <_Heap_Walk+0x278> " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 4768e: 43f9 0005 d04e lea 5d04e ,%a1 47694: b7c8 cmpal %a0,%a3 47696: 6606 bnes 4769e <_Heap_Walk+0x278> 47698: 43f9 0005 d115 lea 5d115 <_Status_Object_name_errors_to_status+0x39>,%a1 false, "block 0x%08x: size %u, prev 0x%08x%s, next 0x%08x%s\n", block, block_size, block->prev, block->prev == first_free_block ? 4769e: 202c 000c movel %a4@(12),%d0 Heap_Block *const last_free_block = _Heap_Free_list_last( heap ); bool const prev_used = _Heap_Is_prev_used( block ); uintptr_t const block_size = _Heap_Block_size( block ); Heap_Block *const next_block = _Heap_Block_at( block, block_size ); (*printer)( 476a2: 223c 0005 d11f movel #381215,%d1 476a8: b0ae fff8 cmpl %fp@(-8),%d0 476ac: 6710 beqs 476be <_Heap_Walk+0x298> block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 476ae: 223c 0005 d04e movel #381006,%d1 476b4: b7c0 cmpal %d0,%a3 476b6: 6606 bnes 476be <_Heap_Walk+0x298> 476b8: 223c 0005 d12f movel #381231,%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)( 476be: 2f09 movel %a1,%sp@- 476c0: 2f08 movel %a0,%sp@- 476c2: 2f01 movel %d1,%sp@- 476c4: 2f00 movel %d0,%sp@- 476c6: 2f03 movel %d3,%sp@- 476c8: 2f0c movel %a4,%sp@- 476ca: 4879 0005 d41a pea 5d41a <_Status_Object_name_errors_to_status+0x33e> 476d0: 42a7 clrl %sp@- 476d2: 2f02 movel %d2,%sp@- 476d4: 4e92 jsr %a2@ block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { 476d6: 2015 movel %a5@,%d0 476d8: 4fef 0024 lea %sp@(36),%sp 476dc: b083 cmpl %d3,%d0 476de: 671e beqs 476fe <_Heap_Walk+0x2d8> (*printer)( 476e0: 2f0d movel %a5,%sp@- 476e2: 2f00 movel %d0,%sp@- 476e4: 2f03 movel %d3,%sp@- 476e6: 2f0c movel %a4,%sp@- 476e8: 4879 0005 d44f pea 5d44f <_Status_Object_name_errors_to_status+0x373> 476ee: 4878 0001 pea 1 476f2: 2f02 movel %d2,%sp@- 476f4: 4e92 jsr %a2@ 476f6: 4fef 001c lea %sp@(28),%sp 476fa: 6000 feb0 braw 475ac <_Heap_Walk+0x186> ); return false; } if ( !prev_used ) { 476fe: 4aae fffc tstl %fp@(-4) 47702: 660a bnes 4770e <_Heap_Walk+0x2e8> (*printer)( 47704: 2f0c movel %a4,%sp@- 47706: 4879 0005 d488 pea 5d488 <_Status_Object_name_errors_to_status+0x3ac> 4770c: 6060 bras 4776e <_Heap_Walk+0x348> block = next_block; } while ( block != first_block ); return true; } 4770e: 206b 0008 moveal %a3@(8),%a0 47712: 6008 bras 4771c <_Heap_Walk+0x2f6> { 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 ) { 47714: b9c8 cmpal %a0,%a4 47716: 673c beqs 47754 <_Heap_Walk+0x32e> return true; } free_block = free_block->next; 47718: 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 ) { 4771c: b7c8 cmpal %a0,%a3 4771e: 66f4 bnes 47714 <_Heap_Walk+0x2ee> 47720: 6044 bras 47766 <_Heap_Walk+0x340> if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { 47722: 4aae fffc tstl %fp@(-4) 47726: 6716 beqs 4773e <_Heap_Walk+0x318> (*printer)( 47728: 2f03 movel %d3,%sp@- 4772a: 2f0c movel %a4,%sp@- 4772c: 4879 0005 d4b7 pea 5d4b7 <_Status_Object_name_errors_to_status+0x3db> 47732: 42a7 clrl %sp@- 47734: 2f02 movel %d2,%sp@- 47736: 4e92 jsr %a2@ 47738: 4fef 0014 lea %sp@(20),%sp 4773c: 6016 bras 47754 <_Heap_Walk+0x32e> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 4773e: 2f14 movel %a4@,%sp@- 47740: 2f03 movel %d3,%sp@- 47742: 2f0c movel %a4,%sp@- 47744: 4879 0005 d4ce pea 5d4ce <_Status_Object_name_errors_to_status+0x3f2> 4774a: 42a7 clrl %sp@- 4774c: 2f02 movel %d2,%sp@- 4774e: 4e92 jsr %a2@ 47750: 4fef 0018 lea %sp@(24),%sp block->prev_size ); } block = next_block; } while ( block != first_block ); 47754: bc8d cmpl %a5,%d6 47756: 6600 fe6c bnew 475c4 <_Heap_Walk+0x19e> Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; 4775a: 7001 moveq #1,%d0 block = next_block; } while ( block != first_block ); return true; } 4775c: 4cee 3cfc ffd0 moveml %fp@(-48),%d2-%d7/%a2-%a5 47762: 4e5e unlk %fp 47764: 4e75 rts return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 47766: 2f0c movel %a4,%sp@- 47768: 4879 0005 d4f3 pea 5d4f3 <_Status_Object_name_errors_to_status+0x417> 4776e: 4878 0001 pea 1 47772: 2f02 movel %d2,%sp@- 47774: 4e92 jsr %a2@ 47776: 4fef 0010 lea %sp@(16),%sp 4777a: 6000 fe30 braw 475ac <_Heap_Walk+0x186> ... =============================================================================== 000473e8 <_Heap_Walk_print>: static void _Heap_Walk_print( int source, bool error, const char *fmt, ... ) { 473e8: 41f9 0004 3de0 lea 43de0 ,%a0 473ee: 4e56 0000 linkw %fp,#0 473f2: 202e 0008 movel %fp@(8),%d0 va_list ap; if ( error ) { 473f6: 4a2e 000f tstb %fp@(15) 473fa: 670a beqs 47406 <_Heap_Walk_print+0x1e> <== NEVER TAKEN printk( "FAIL[%d]: ", source ); 473fc: 2f00 movel %d0,%sp@- 473fe: 4879 0005 d0f0 pea 5d0f0 <_Status_Object_name_errors_to_status+0x14> 47404: 6008 bras 4740e <_Heap_Walk_print+0x26> } else { printk( "PASS[%d]: ", source ); 47406: 2f00 movel %d0,%sp@- 47408: 4879 0005 d0fb pea 5d0fb <_Status_Object_name_errors_to_status+0x1f> 4740e: 4e90 jsr %a0@ 47410: 508f addql #8,%sp } va_start( ap, fmt ); vprintk( fmt, ap ); 47412: 486e 0014 pea %fp@(20) 47416: 2f2e 0010 movel %fp@(16),%sp@- 4741a: 4eb9 0004 56f8 jsr 456f8 va_end( ap ); 47420: 508f addql #8,%sp } 47422: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00046a08 <_Internal_error_Occurred>: void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 46a08: 4e56 0000 linkw %fp,#0 46a0c: 222e 000c movel %fp@(12),%d1 46a10: 2f02 movel %d2,%sp@- 46a12: 242e 0010 movel %fp@(16),%d2 _Internal_errors_What_happened.the_source = the_source; _Internal_errors_What_happened.is_internal = is_internal; 46a16: 13c1 0005 ea62 moveb %d1,5ea62 <_Internal_errors_What_happened+0x4> _Internal_errors_What_happened.the_error = the_error; _User_extensions_Fatal( the_source, is_internal, the_error ); 46a1c: 2f02 movel %d2,%sp@- void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 46a1e: 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 ); 46a22: 0281 0000 00ff andil #255,%d1 bool is_internal, Internal_errors_t the_error ) { _Internal_errors_What_happened.the_source = the_source; 46a28: 23c0 0005 ea5e movel %d0,5ea5e <_Internal_errors_What_happened> _Internal_errors_What_happened.is_internal = is_internal; _Internal_errors_What_happened.the_error = the_error; _User_extensions_Fatal( the_source, is_internal, the_error ); 46a2e: 2f01 movel %d1,%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; 46a30: 23c2 0005 ea64 movel %d2,5ea64 <_Internal_errors_What_happened+0x6> _User_extensions_Fatal( the_source, is_internal, the_error ); 46a36: 2f00 movel %d0,%sp@- 46a38: 4eb9 0004 860e jsr 4860e <_User_extensions_Fatal> RTEMS_INLINE_ROUTINE void _System_state_Set ( System_state_Codes state ) { _System_state_Current = state; 46a3e: 7005 moveq #5,%d0 <== NOT EXECUTED _System_state_Set( SYSTEM_STATE_FAILED ); _CPU_Fatal_halt( the_error ); 46a40: 2042 moveal %d2,%a0 <== NOT EXECUTED 46a42: 243c 0000 0700 movel #1792,%d2 <== NOT EXECUTED 46a48: 23c0 0005 eb14 movel %d0,5eb14 <_System_state_Current> <== NOT EXECUTED 46a4e: 40c0 movew %sr,%d0 <== NOT EXECUTED 46a50: 8082 orl %d2,%d0 <== NOT EXECUTED 46a52: 46c0 movew %d0,%sr <== NOT EXECUTED 46a54: 2008 movel %a0,%d0 <== NOT EXECUTED 46a56: 223c dead beef movel #-559038737,%d1 <== NOT EXECUTED 46a5c: 4ac8 halt <== NOT EXECUTED 46a5e: 4fef 000c lea %sp@(12),%sp <== NOT EXECUTED 46a62: 60fe bras 46a62 <_Internal_error_Occurred+0x5a> <== NOT EXECUTED =============================================================================== 00046ac4 <_Objects_Allocate>: */ Objects_Control *_Objects_Allocate( Objects_Information *information ) { 46ac4: 4e56 fff0 linkw %fp,#-16 46ac8: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ 46acc: 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 ) 46ad0: 4aaa 0014 tstl %a2@(20) 46ad4: 675e beqs 46b34 <_Objects_Allocate+0x70> <== NEVER TAKEN /* * OK. The manager should be initialized and configured to have objects. * With any luck, it is safe to attempt to allocate an object. */ the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 46ad6: 240a movel %a2,%d2 46ad8: 0682 0000 001c addil #28,%d2 46ade: 47f9 0004 6268 lea 46268 <_Chain_Get>,%a3 46ae4: 2f02 movel %d2,%sp@- 46ae6: 4e93 jsr %a3@ if ( information->auto_extend ) { 46ae8: 588f addql #4,%sp 46aea: 4a2a 0010 tstb %a2@(16) 46aee: 6746 beqs 46b36 <_Objects_Allocate+0x72> /* * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { 46af0: 4a80 tstl %d0 46af2: 6612 bnes 46b06 <_Objects_Allocate+0x42> _Objects_Extend_information( information ); 46af4: 2f0a movel %a2,%sp@- 46af6: 4eb9 0004 6b6c jsr 46b6c <_Objects_Extend_information> the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 46afc: 2f02 movel %d2,%sp@- 46afe: 4e93 jsr %a3@ } if ( the_object ) { 46b00: 508f addql #8,%sp 46b02: 4a80 tstl %d0 46b04: 6730 beqs 46b36 <_Objects_Allocate+0x72> uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 46b06: 2040 moveal %d0,%a0 46b08: 4281 clrl %d1 46b0a: 4282 clrl %d2 46b0c: 3228 000a movew %a0@(10),%d1 46b10: 342a 0008 movew %a2@(8),%d2 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 46b14: 206a 002a moveal %a2@(42),%a0 } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 46b18: 9282 subl %d2,%d1 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; 46b1a: 342a 0012 movew %a2@(18),%d2 46b1e: 4c42 1001 remul %d2,%d1,%d1 information->inactive_per_block[ block ]--; 46b22: e589 lsll #2,%d1 46b24: d1c1 addal %d1,%a0 46b26: 5390 subql #1,%a0@ information->inactive--; 46b28: 322a 0028 movew %a2@(40),%d1 46b2c: 5381 subql #1,%d1 46b2e: 3541 0028 movew %d1,%a2@(40) 46b32: 6002 bras 46b36 <_Objects_Allocate+0x72> * still attempts to create the object, the information block * should be all zeroed out because it is in the BSS. So let's * check that code for this manager is even present. */ if ( information->size == 0 ) return NULL; 46b34: 4280 clrl %d0 <== NOT EXECUTED ); } #endif return the_object; } 46b36: 4cee 0c0c fff0 moveml %fp@(-16),%d2-%d3/%a2-%a3 46b3c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00046b40 <_Objects_Close>: RTEMS_INLINE_ROUTINE void _Objects_Invalidate_Id( Objects_Information *information, Objects_Control *the_object ) { _Objects_Set_local_object( 46b40: 4280 clrl %d0 void _Objects_Close( Objects_Information *information, Objects_Control *the_object ) { 46b42: 4e56 0000 linkw %fp,#0 46b46: 226e 000c moveal %fp@(12),%a1 46b4a: 206e 0008 moveal %fp@(8),%a0 46b4e: 2f0a movel %a2,%sp@- #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 46b50: 2468 0018 moveal %a0@(24),%a2 RTEMS_INLINE_ROUTINE void _Objects_Invalidate_Id( Objects_Information *information, Objects_Control *the_object ) { _Objects_Set_local_object( 46b54: 3029 000a movew %a1@(10),%d0 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 46b58: 42b2 0c00 clrl %a2@(00000000,%d0:l:4) _Objects_Invalidate_Id( information, the_object ); _Objects_Namespace_remove( information, the_object ); } 46b5c: 245f moveal %sp@+,%a2 Objects_Control *the_object ) { _Objects_Invalidate_Id( information, the_object ); _Objects_Namespace_remove( information, the_object ); 46b5e: 2d49 000c movel %a1,%fp@(12) } 46b62: 4e5e unlk %fp Objects_Control *the_object ) { _Objects_Invalidate_Id( information, the_object ); _Objects_Namespace_remove( information, the_object ); 46b64: 4ef9 0004 7074 jmp 47074 <_Objects_Namespace_remove> ... =============================================================================== 00046e64 <_Objects_Get_information>: Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint16_t the_class ) { 46e64: 4e56 0000 linkw %fp,#0 46e68: 2f03 movel %d3,%sp@- 46e6a: 362e 000e movew %fp@(14),%d3 46e6e: 2f02 movel %d2,%sp@- 46e70: 242e 0008 movel %fp@(8),%d2 Objects_Information *info; int the_class_api_maximum; if ( !the_class ) 46e74: 4a43 tstw %d3 46e76: 673a beqs 46eb2 <_Objects_Get_information+0x4e> /* * 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 ); 46e78: 2f02 movel %d2,%sp@- 46e7a: 4eb9 0004 b09c jsr 4b09c <_Objects_API_maximum_class> if ( the_class_api_maximum == 0 ) 46e80: 588f addql #4,%sp 46e82: 4a80 tstl %d0 46e84: 672c beqs 46eb2 <_Objects_Get_information+0x4e> return NULL; if ( the_class > (uint32_t) the_class_api_maximum ) 46e86: 0283 0000 ffff andil #65535,%d3 46e8c: b083 cmpl %d3,%d0 46e8e: 6522 bcss 46eb2 <_Objects_Get_information+0x4e> return NULL; if ( !_Objects_Information_table[ the_api ] ) 46e90: 41f9 0005 e984 lea 5e984 <_Objects_Information_table>,%a0 46e96: 2070 2c00 moveal %a0@(00000000,%d2:l:4),%a0 46e9a: 4a88 tstl %a0 46e9c: 6714 beqs 46eb2 <_Objects_Get_information+0x4e> <== NEVER TAKEN return NULL; info = _Objects_Information_table[ the_api ][ the_class ]; 46e9e: 2030 3c00 movel %a0@(00000000,%d3:l:4),%d0 if ( !info ) 46ea2: 6710 beqs 46eb4 <_Objects_Get_information+0x50> <== NEVER TAKEN * Thus we may have 0 local instances and still have a valid object * pointer. */ #if !defined(RTEMS_MULTIPROCESSING) if ( info->maximum == 0 ) return NULL; 46ea4: 2040 moveal %d0,%a0 46ea6: 4a68 000e tstw %a0@(14) 46eaa: 56c1 sne %d1 46eac: 49c1 extbl %d1 46eae: c081 andl %d1,%d0 46eb0: 6002 bras 46eb4 <_Objects_Get_information+0x50> if ( the_class > (uint32_t) the_class_api_maximum ) return NULL; if ( !_Objects_Information_table[ the_api ] ) return NULL; 46eb2: 4280 clrl %d0 if ( info->maximum == 0 ) return NULL; #endif return info; } 46eb4: 242e fff8 movel %fp@(-8),%d2 46eb8: 262e fffc movel %fp@(-4),%d3 46ebc: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0005468c <_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; 5468c: 7001 moveq #1,%d0 if ( information->maximum >= index ) { 5468e: 4281 clrl %d1 Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 54690: 4e56 0000 linkw %fp,#0 54694: 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; 54698: 90a8 0006 subl %a0@(6),%d0 5469c: d0ae 000c addl %fp@(12),%d0 if ( information->maximum >= index ) { 546a0: 3228 000e movew %a0@(14),%d1 Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 546a4: 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 ) { 546a8: b081 cmpl %d1,%d0 546aa: 620e bhis 546ba <_Objects_Get_no_protection+0x2e> if ( (the_object = information->local_table[ index ]) != NULL ) { 546ac: 2068 0018 moveal %a0@(24),%a0 546b0: 2030 0c00 movel %a0@(00000000,%d0:l:4),%d0 546b4: 6704 beqs 546ba <_Objects_Get_no_protection+0x2e><== NEVER TAKEN *location = OBJECTS_LOCAL; 546b6: 4291 clrl %a1@ return the_object; 546b8: 6006 bras 546c0 <_Objects_Get_no_protection+0x34> /* * This isn't supported or required yet for Global objects so * if it isn't local, we don't find it. */ *location = OBJECTS_ERROR; 546ba: 7001 moveq #1,%d0 546bc: 2280 movel %d0,%a1@ return NULL; 546be: 4280 clrl %d0 } 546c0: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00047e44 <_Objects_Id_to_name>: */ Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { 47e44: 4e56 fffc linkw %fp,#-4 47e48: 222e 0008 movel %fp@(8),%d1 47e4c: 2f02 movel %d2,%sp@- /* * Caller is trusted for name != NULL. */ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 47e4e: 4a81 tstl %d1 47e50: 660a bnes 47e5c <_Objects_Id_to_name+0x18> 47e52: 2079 0006 02ea moveal 602ea <_Per_CPU_Information+0xc>,%a0 47e58: 2228 0008 movel %a0@(8),%d1 47e5c: 7418 moveq #24,%d2 47e5e: 2001 movel %d1,%d0 47e60: e4a8 lsrl %d2,%d0 47e62: 143c 0007 moveb #7,%d2 47e66: c082 andl %d2,%d0 */ RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid( uint32_t the_api ) { if ( !the_api || the_api > OBJECTS_APIS_LAST ) 47e68: 143c 0002 moveb #2,%d2 47e6c: 2040 moveal %d0,%a0 47e6e: 5388 subql #1,%a0 47e70: b488 cmpl %a0,%d2 47e72: 6540 bcss 47eb4 <_Objects_Id_to_name+0x70> 47e74: 6048 bras 47ebe <_Objects_Id_to_name+0x7a> */ RTEMS_INLINE_ROUTINE uint32_t _Objects_Get_class( Objects_Id id ) { return (uint32_t) 47e76: 2001 movel %d1,%d0 47e78: 741b moveq #27,%d2 47e7a: e4a8 lsrl %d2,%d0 if ( !_Objects_Information_table[ the_api ] ) return OBJECTS_INVALID_ID; the_class = _Objects_Get_class( tmpId ); information = _Objects_Information_table[ the_api ][ the_class ]; 47e7c: 2070 0c00 moveal %a0@(00000000,%d0:l:4),%a0 if ( !information ) 47e80: 4a88 tstl %a0 47e82: 6730 beqs 47eb4 <_Objects_Id_to_name+0x70> <== NEVER TAKEN return OBJECTS_INVALID_ID; #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) 47e84: 4a28 0032 tstb %a0@(50) 47e88: 662a bnes 47eb4 <_Objects_Id_to_name+0x70> <== NEVER TAKEN return OBJECTS_INVALID_ID; #endif the_object = _Objects_Get( information, tmpId, &ignored_location ); 47e8a: 486e fffc pea %fp@(-4) 47e8e: 2f01 movel %d1,%sp@- 47e90: 2f08 movel %a0,%sp@- 47e92: 4eb9 0004 7de4 jsr 47de4 <_Objects_Get> if ( !the_object ) 47e98: 4fef 000c lea %sp@(12),%sp 47e9c: 4a80 tstl %d0 47e9e: 6714 beqs 47eb4 <_Objects_Id_to_name+0x70> return OBJECTS_INVALID_ID; *name = the_object->name; 47ea0: 206e 000c moveal %fp@(12),%a0 47ea4: 2240 moveal %d0,%a1 47ea6: 20a9 000c movel %a1@(12),%a0@ _Thread_Enable_dispatch(); 47eaa: 4eb9 0004 8a1a jsr 48a1a <_Thread_Enable_dispatch> return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; 47eb0: 4280 clrl %d0 47eb2: 6002 bras 47eb6 <_Objects_Id_to_name+0x72> the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; if ( !_Objects_Information_table[ the_api ] ) return OBJECTS_INVALID_ID; 47eb4: 7003 moveq #3,%d0 return OBJECTS_INVALID_ID; *name = the_object->name; _Thread_Enable_dispatch(); return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; } 47eb6: 242e fff8 movel %fp@(-8),%d2 47eba: 4e5e unlk %fp 47ebc: 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 ] ) 47ebe: 41f9 0005 fe3c lea 5fe3c <_Objects_Information_table>,%a0 47ec4: 2070 0c00 moveal %a0@(00000000,%d0:l:4),%a0 47ec8: 4a88 tstl %a0 47eca: 66aa bnes 47e76 <_Objects_Id_to_name+0x32> 47ecc: 60e6 bras 47eb4 <_Objects_Id_to_name+0x70> ... =============================================================================== 0004748c <_Objects_Set_name>: { size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 4748c: 4280 clrl %d0 bool _Objects_Set_name( Objects_Information *information, Objects_Control *the_object, const char *name ) { 4748e: 4e56 ffec linkw %fp,#-20 47492: 48d7 3c04 moveml %d2/%a2-%a5,%sp@ 47496: 2a6e 0008 moveal %fp@(8),%a5 size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 4749a: 302d 0034 movew %a5@(52),%d0 bool _Objects_Set_name( Objects_Information *information, Objects_Control *the_object, const char *name ) { 4749e: 246e 0010 moveal %fp@(16),%a2 size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 474a2: 2f00 movel %d0,%sp@- bool _Objects_Set_name( Objects_Information *information, Objects_Control *the_object, const char *name ) { 474a4: 286e 000c moveal %fp@(12),%a4 size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 474a8: 2f0a movel %a2,%sp@- 474aa: 4eb9 0004 e69c jsr 4e69c #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) { 474b0: 508f addql #8,%sp { size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 474b2: 2640 moveal %d0,%a3 #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) { 474b4: 4a2d 0032 tstb %a5@(50) 474b8: 673c beqs 474f6 <_Objects_Set_name+0x6a> char *d; d = _Workspace_Allocate( length + 1 ); 474ba: 486b 0001 pea %a3@(1) 474be: 4eb9 0004 8e18 jsr 48e18 <_Workspace_Allocate> if ( !d ) 474c4: 588f addql #4,%sp #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) { char *d; d = _Workspace_Allocate( length + 1 ); 474c6: 2a40 moveal %d0,%a5 if ( !d ) 474c8: 4a80 tstl %d0 474ca: 677a beqs 47546 <_Objects_Set_name+0xba> <== NEVER TAKEN return false; _Workspace_Free( (void *)the_object->name.name_p ); 474cc: 2f2c 000c movel %a4@(12),%sp@- 474d0: 4eb9 0004 8e34 jsr 48e34 <_Workspace_Free> the_object->name.name_p = NULL; 474d6: 42ac 000c clrl %a4@(12) strncpy( d, name, length ); 474da: 2f0b movel %a3,%sp@- 474dc: 2f0a movel %a2,%sp@- 474de: 2f0d movel %a5,%sp@- 474e0: 4eb9 0004 e618 jsr 4e618 d[length] = '\0'; the_object->name.name_p = d; 474e6: 4fef 0010 lea %sp@(16),%sp _Workspace_Free( (void *)the_object->name.name_p ); the_object->name.name_p = NULL; strncpy( d, name, length ); d[length] = '\0'; 474ea: 4200 clrb %d0 474ec: 1b80 b800 moveb %d0,%a5@(00000000,%a3:l) the_object->name.name_p = d; 474f0: 294d 000c movel %a5,%a4@(12) 474f4: 604c bras 47542 <_Objects_Set_name+0xb6> } else #endif { the_object->name.name_u32 = _Objects_Build_name( 474f6: 7418 moveq #24,%d2 474f8: 1212 moveb %a2@,%d1 474fa: 7020 moveq #32,%d0 474fc: 4840 swap %d0 474fe: 49c1 extbl %d1 47500: e5a9 lsll %d2,%d1 47502: 143c 0001 moveb #1,%d2 47506: b48b cmpl %a3,%d2 47508: 640a bccs 47514 <_Objects_Set_name+0x88> 4750a: 102a 0001 moveb %a2@(1),%d0 4750e: 49c0 extbl %d0 47510: 4840 swap %d0 47512: 4240 clrw %d0 47514: 7402 moveq #2,%d2 47516: 8280 orl %d0,%d1 47518: 203c 0000 2000 movel #8192,%d0 4751e: b48b cmpl %a3,%d2 47520: 6408 bccs 4752a <_Objects_Set_name+0x9e> 47522: 102a 0002 moveb %a2@(2),%d0 47526: 49c0 extbl %d0 47528: e188 lsll #8,%d0 4752a: 8081 orl %d1,%d0 4752c: 7203 moveq #3,%d1 4752e: b28b cmpl %a3,%d1 47530: 6408 bccs 4753a <_Objects_Set_name+0xae> 47532: 142a 0003 moveb %a2@(3),%d2 47536: 49c2 extbl %d2 47538: 6002 bras 4753c <_Objects_Set_name+0xb0> 4753a: 7420 moveq #32,%d2 4753c: 8082 orl %d2,%d0 4753e: 2940 000c movel %d0,%a4@(12) ((3 < length) ? s[ 3 ] : ' ') ); } return true; 47542: 7001 moveq #1,%d0 47544: 6002 bras 47548 <_Objects_Set_name+0xbc> if ( information->is_string ) { char *d; d = _Workspace_Allocate( length + 1 ); if ( !d ) return false; 47546: 4200 clrb %d0 ); } return true; } 47548: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 4754e: 4e5e unlk %fp ... =============================================================================== 00045924 <_POSIX_Keys_Free_memory>: #include void _POSIX_Keys_Free_memory( POSIX_Keys_Control *the_key ) { 45924: 4e56 0000 linkw %fp,#0 45928: 2f0b movel %a3,%sp@- uint32_t the_api; for ( the_api = 1; the_api <= OBJECTS_APIS_LAST; the_api++ ) _Workspace_Free( the_key->Values[ the_api ] ); 4592a: 47f9 0004 983c lea 4983c <_Workspace_Free>,%a3 #include void _POSIX_Keys_Free_memory( POSIX_Keys_Control *the_key ) { 45930: 2f0a movel %a2,%sp@- 45932: 246e 0008 moveal %fp@(8),%a2 uint32_t the_api; for ( the_api = 1; the_api <= OBJECTS_APIS_LAST; the_api++ ) _Workspace_Free( the_key->Values[ the_api ] ); 45936: 2f2a 0018 movel %a2@(24),%sp@- 4593a: 4e93 jsr %a3@ 4593c: 2f2a 001c movel %a2@(28),%sp@- 45940: 4e93 jsr %a3@ 45942: 2d6a 0020 0008 movel %a2@(32),%fp@(8) 45948: 508f addql #8,%sp } 4594a: 246e fff8 moveal %fp@(-8),%a2 4594e: 266e fffc moveal %fp@(-4),%a3 45952: 4e5e unlk %fp ) { uint32_t the_api; for ( the_api = 1; the_api <= OBJECTS_APIS_LAST; the_api++ ) _Workspace_Free( the_key->Values[ the_api ] ); 45954: 4ef9 0004 983c jmp 4983c <_Workspace_Free> ... =============================================================================== 00049bc4 <_POSIX_Message_queue_Delete>: */ void _POSIX_Message_queue_Delete( POSIX_Message_queue_Control *the_mq ) { 49bc4: 4e56 0000 linkw %fp,#0 49bc8: 2f0a movel %a2,%sp@- 49bca: 246e 0008 moveal %fp@(8),%a2 if ( !the_mq->linked && !the_mq->open_count ) { 49bce: 4a2a 0015 tstb %a2@(21) 49bd2: 6636 bnes 49c0a <_POSIX_Message_queue_Delete+0x46><== NEVER TAKEN 49bd4: 4aaa 0016 tstl %a2@(22) 49bd8: 6630 bnes 49c0a <_POSIX_Message_queue_Delete+0x46> ); _Workspace_Free( (void *)the_object->name.name_p ); } #endif _Objects_Close( &_POSIX_Message_queue_Information, the_object ); 49bda: 2f0a movel %a2,%sp@- 49bdc: 4879 0006 6e8e pea 66e8e <_POSIX_Message_queue_Information> 49be2: 4eb9 0004 c8a4 jsr 4c8a4 <_Objects_Close> _CORE_message_queue_Close( 49be8: 4878 0005 pea 5 49bec: 42a7 clrl %sp@- 49bee: 486a 001a pea %a2@(26) 49bf2: 4eb9 0004 bcfc jsr 4bcfc <_CORE_message_queue_Close> RTEMS_INLINE_ROUTINE void _POSIX_Message_queue_Free ( POSIX_Message_queue_Control *the_mq ) { _Objects_Free( &_POSIX_Message_queue_Information, &the_mq->Object ); 49bf8: 2f0a movel %a2,%sp@- 49bfa: 4879 0006 6e8e pea 66e8e <_POSIX_Message_queue_Information> 49c00: 4eb9 0004 cb18 jsr 4cb18 <_Objects_Free> 49c06: 4fef 001c lea %sp@(28),%sp ); _POSIX_Message_queue_Free( the_mq ); } } 49c0a: 246e fffc moveal %fp@(-4),%a2 49c0e: 4e5e unlk %fp ... =============================================================================== 00049f00 <_POSIX_Message_queue_Receive_support>: size_t msg_len, unsigned int *msg_prio, bool wait, Watchdog_Interval timeout ) { 49f00: 4e56 ffe4 linkw %fp,#-28 49f04: 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( 49f08: 486e fffc pea %fp@(-4) 49f0c: 242e 0008 movel %fp@(8),%d2 49f10: 2f02 movel %d2,%sp@- 49f12: 4879 0006 6ffc pea 66ffc <_POSIX_Message_queue_Information_fds> 49f18: 162e 001b moveb %fp@(27),%d3 49f1c: 4eb9 0004 cc7c jsr 4cc7c <_Objects_Get> Objects_Locations location; size_t length_out; bool do_wait; the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); switch ( location ) { 49f22: 4fef 000c lea %sp@(12),%sp 49f26: 4aae fffc tstl %fp@(-4) 49f2a: 6600 00c0 bnew 49fec <_POSIX_Message_queue_Receive_support+0xec> case OBJECTS_LOCAL: if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) { 49f2e: 2040 moveal %d0,%a0 49f30: 7803 moveq #3,%d4 49f32: 7a01 moveq #1,%d5 49f34: 2228 0014 movel %a0@(20),%d1 49f38: c881 andl %d1,%d4 49f3a: ba84 cmpl %d4,%d5 49f3c: 660a bnes 49f48 <_POSIX_Message_queue_Receive_support+0x48> _Thread_Enable_dispatch(); 49f3e: 4eb9 0004 d832 jsr 4d832 <_Thread_Enable_dispatch> 49f44: 6000 00a6 braw 49fec <_POSIX_Message_queue_Receive_support+0xec> rtems_set_errno_and_return_minus_one( EBADF ); } the_mq = the_mq_fd->Queue; 49f48: 2240 moveal %d0,%a1 49f4a: 2069 0010 moveal %a1@(16),%a0 if ( msg_len < the_mq->Message_queue.maximum_message_size ) { 49f4e: 2028 0066 movel %a0@(102),%d0 49f52: b0ae 0010 cmpl %fp@(16),%d0 49f56: 6316 blss 49f6e <_POSIX_Message_queue_Receive_support+0x6e> _Thread_Enable_dispatch(); 49f58: 4eb9 0004 d832 jsr 4d832 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EMSGSIZE ); 49f5e: 4eb9 0005 2f48 jsr 52f48 <__errno> 49f64: 727a moveq #122,%d1 49f66: 2040 moveal %d0,%a0 49f68: 2081 movel %d1,%a0@ 49f6a: 6000 008c braw 49ff8 <_POSIX_Message_queue_Receive_support+0xf8> /* * Now if something goes wrong, we return a "length" of -1 * to indicate an error. */ length_out = -1; 49f6e: 70ff moveq #-1,%d0 49f70: 2d40 fff8 movel %d0,%fp@(-8) /* * A timed receive with a bad time will do a poll regardless. */ if ( wait ) 49f74: 4a03 tstb %d3 49f76: 670a beqs 49f82 <_POSIX_Message_queue_Receive_support+0x82><== NEVER TAKEN do_wait = (the_mq_fd->oflag & O_NONBLOCK) ? false : true; 49f78: 0801 000e btst #14,%d1 49f7c: 57c0 seq %d0 49f7e: 4480 negl %d0 49f80: 6002 bras 49f84 <_POSIX_Message_queue_Receive_support+0x84> length_out = -1; /* * A timed receive with a bad time will do a poll regardless. */ if ( wait ) 49f82: 4200 clrb %d0 <== NOT EXECUTED do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 49f84: 2f2e 001c movel %fp@(28),%sp@- 49f88: 0280 0000 00ff andil #255,%d0 49f8e: 2f00 movel %d0,%sp@- 49f90: 486e fff8 pea %fp@(-8) 49f94: 2f2e 000c movel %fp@(12),%sp@- 49f98: 2f02 movel %d2,%sp@- 49f9a: 4868 001a pea %a0@(26) 49f9e: 4eb9 0004 bd98 jsr 4bd98 <_CORE_message_queue_Seize> &length_out, do_wait, timeout ); _Thread_Enable_dispatch(); 49fa4: 4eb9 0004 d832 jsr 4d832 <_Thread_Enable_dispatch> *msg_prio = _POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count); 49faa: 2079 0006 706e moveal 6706e <_Per_CPU_Information+0xc>,%a0 RTEMS_INLINE_ROUTINE unsigned int _POSIX_Message_queue_Priority_from_core( CORE_message_queue_Submit_types priority ) { /* absolute value without a library dependency */ return ((priority >= 0) ? priority : -priority); 49fb0: 2028 0024 movel %a0@(36),%d0 49fb4: 6c02 bges 49fb8 <_POSIX_Message_queue_Receive_support+0xb8> 49fb6: 4480 negl %d0 do_wait, timeout ); _Thread_Enable_dispatch(); *msg_prio = 49fb8: 226e 0014 moveal %fp@(20),%a1 _POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count); if ( !_Thread_Executing->Wait.return_code ) 49fbc: 4fef 0018 lea %sp@(24),%sp do_wait, timeout ); _Thread_Enable_dispatch(); *msg_prio = 49fc0: 2280 movel %d0,%a1@ _POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count); if ( !_Thread_Executing->Wait.return_code ) 49fc2: 4aa8 0034 tstl %a0@(52) 49fc6: 6606 bnes 49fce <_POSIX_Message_queue_Receive_support+0xce> return length_out; 49fc8: 202e fff8 movel %fp@(-8),%d0 49fcc: 602c bras 49ffa <_POSIX_Message_queue_Receive_support+0xfa> rtems_set_errno_and_return_minus_one( 49fce: 4eb9 0005 2f48 jsr 52f48 <__errno> 49fd4: 2079 0006 706e moveal 6706e <_Per_CPU_Information+0xc>,%a0 49fda: 2440 moveal %d0,%a2 49fdc: 2f28 0034 movel %a0@(52),%sp@- 49fe0: 4eb9 0004 a214 jsr 4a214 <_POSIX_Message_queue_Translate_core_message_queue_return_code> 49fe6: 588f addql #4,%sp 49fe8: 2480 movel %d0,%a2@ 49fea: 600c bras 49ff8 <_POSIX_Message_queue_Receive_support+0xf8> #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); 49fec: 4eb9 0005 2f48 jsr 52f48 <__errno> 49ff2: 2040 moveal %d0,%a0 49ff4: 7009 moveq #9,%d0 49ff6: 2080 movel %d0,%a0@ 49ff8: 70ff moveq #-1,%d0 } 49ffa: 4cee 043c ffe4 moveml %fp@(-28),%d2-%d5/%a2 4a000: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004a280 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch>: #include void _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch( Thread_Control *the_thread ) { 4a280: 4e56 0000 linkw %fp,#0 4a284: 226e 0008 moveal %fp@(8),%a1 POSIX_API_Control *thread_support; thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4a288: 2069 0102 moveal %a1@(258),%a0 if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 4a28c: 4aa8 00d8 tstl %a0@(216) 4a290: 662e bnes 4a2c0 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x40><== NEVER TAKEN 4a292: 7001 moveq #1,%d0 4a294: b0a8 00dc cmpl %a0@(220),%d0 4a298: 6626 bnes 4a2c0 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x40> thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS && 4a29a: 4aa8 00e0 tstl %a0@(224) 4a29e: 6720 beqs 4a2c0 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x40> thread_support->cancelation_requested ) { _Thread_Unnest_dispatch(); _POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED ); 4a2a0: 4878 ffff pea ffffffff */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 4a2a4: 2039 0005 f03c movel 5f03c <_Thread_Dispatch_disable_level>,%d0 4a2aa: 5380 subql #1,%d0 4a2ac: 2f09 movel %a1,%sp@- 4a2ae: 23c0 0005 f03c movel %d0,5f03c <_Thread_Dispatch_disable_level> 4a2b4: 4eb9 0004 aa58 jsr 4aa58 <_POSIX_Thread_Exit> 4a2ba: 508f addql #8,%sp } else _Thread_Enable_dispatch(); } 4a2bc: 4e5e unlk %fp 4a2be: 4e75 rts 4a2c0: 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(); 4a2c2: 4ef9 0004 7dde jmp 47dde <_Thread_Enable_dispatch> =============================================================================== 0004b4d4 <_POSIX_Thread_Translate_sched_param>: int policy, struct sched_param *param, Thread_CPU_budget_algorithms *budget_algorithm, Thread_CPU_budget_algorithm_callout *budget_callout ) { 4b4d4: 4e56 ffec linkw %fp,#-20 4b4d8: 48d7 3c04 moveml %d2/%a2-%a5,%sp@ 4b4dc: 246e 000c moveal %fp@(12),%a2 if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) 4b4e0: 2f12 movel %a2@,%sp@- int policy, struct sched_param *param, Thread_CPU_budget_algorithms *budget_algorithm, Thread_CPU_budget_algorithm_callout *budget_callout ) { 4b4e2: 242e 0008 movel %fp@(8),%d2 4b4e6: 266e 0010 moveal %fp@(16),%a3 4b4ea: 286e 0014 moveal %fp@(20),%a4 if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) 4b4ee: 4eb9 0004 b4b0 jsr 4b4b0 <_POSIX_Priority_Is_valid> 4b4f4: 588f addql #4,%sp 4b4f6: 4a00 tstb %d0 4b4f8: 6778 beqs 4b572 <_POSIX_Thread_Translate_sched_param+0x9e><== NEVER TAKEN return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 4b4fa: 4293 clrl %a3@ *budget_callout = NULL; 4b4fc: 4294 clrl %a4@ if ( policy == SCHED_OTHER ) { 4b4fe: 4a82 tstl %d2 4b500: 6606 bnes 4b508 <_POSIX_Thread_Translate_sched_param+0x34> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 4b502: 7201 moveq #1,%d1 4b504: 2681 movel %d1,%a3@ 4b506: 6066 bras 4b56e <_POSIX_Thread_Translate_sched_param+0x9a> return 0; } if ( policy == SCHED_FIFO ) { 4b508: 7001 moveq #1,%d0 4b50a: b082 cmpl %d2,%d0 4b50c: 6760 beqs 4b56e <_POSIX_Thread_Translate_sched_param+0x9a> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; return 0; } if ( policy == SCHED_RR ) { 4b50e: 103c 0002 moveb #2,%d0 4b512: b082 cmpl %d2,%d0 4b514: 6606 bnes 4b51c <_POSIX_Thread_Translate_sched_param+0x48> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; 4b516: 2680 movel %d0,%a3@ return 0; 4b518: 4200 clrb %d0 4b51a: 6058 bras 4b574 <_POSIX_Thread_Translate_sched_param+0xa0> } if ( policy == SCHED_SPORADIC ) { 4b51c: 7004 moveq #4,%d0 4b51e: b082 cmpl %d2,%d0 4b520: 6650 bnes 4b572 <_POSIX_Thread_Translate_sched_param+0x9e> if ( (param->sched_ss_repl_period.tv_sec == 0) && 4b522: 4aaa 0008 tstl %a2@(8) 4b526: 6606 bnes 4b52e <_POSIX_Thread_Translate_sched_param+0x5a> 4b528: 4aaa 000c tstl %a2@(12) 4b52c: 6744 beqs 4b572 <_POSIX_Thread_Translate_sched_param+0x9e> (param->sched_ss_repl_period.tv_nsec == 0) ) return EINVAL; if ( (param->sched_ss_init_budget.tv_sec == 0) && 4b52e: 4aaa 0010 tstl %a2@(16) 4b532: 6606 bnes 4b53a <_POSIX_Thread_Translate_sched_param+0x66> 4b534: 4aaa 0014 tstl %a2@(20) 4b538: 6738 beqs 4b572 <_POSIX_Thread_Translate_sched_param+0x9e> (param->sched_ss_init_budget.tv_nsec == 0) ) return EINVAL; if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) < 4b53a: 486a 0008 pea %a2@(8) 4b53e: 4bf9 0004 93cc lea 493cc <_Timespec_To_ticks>,%a5 4b544: 4e95 jsr %a5@ _Timespec_To_ticks( ¶m->sched_ss_init_budget ) ) 4b546: 486a 0010 pea %a2@(16) if ( (param->sched_ss_init_budget.tv_sec == 0) && (param->sched_ss_init_budget.tv_nsec == 0) ) return EINVAL; if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) < 4b54a: 2400 movel %d0,%d2 _Timespec_To_ticks( ¶m->sched_ss_init_budget ) ) 4b54c: 4e95 jsr %a5@ if ( (param->sched_ss_init_budget.tv_sec == 0) && (param->sched_ss_init_budget.tv_nsec == 0) ) return EINVAL; if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) < 4b54e: 508f addql #8,%sp 4b550: b082 cmpl %d2,%d0 4b552: 621e bhis 4b572 <_POSIX_Thread_Translate_sched_param+0x9e> _Timespec_To_ticks( ¶m->sched_ss_init_budget ) ) return EINVAL; if ( !_POSIX_Priority_Is_valid( param->sched_ss_low_priority ) ) 4b554: 2f2a 0004 movel %a2@(4),%sp@- 4b558: 4eb9 0004 b4b0 jsr 4b4b0 <_POSIX_Priority_Is_valid> 4b55e: 588f addql #4,%sp 4b560: 4a00 tstb %d0 4b562: 670e beqs 4b572 <_POSIX_Thread_Translate_sched_param+0x9e> return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; 4b564: 7003 moveq #3,%d0 4b566: 2680 movel %d0,%a3@ *budget_callout = _POSIX_Threads_Sporadic_budget_callout; 4b568: 28bc 0004 5edc movel #286428,%a4@ return 0; } if ( policy == SCHED_FIFO ) { *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; return 0; 4b56e: 4280 clrl %d0 4b570: 6002 bras 4b574 <_POSIX_Thread_Translate_sched_param+0xa0> if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) < _Timespec_To_ticks( ¶m->sched_ss_init_budget ) ) return EINVAL; if ( !_POSIX_Priority_Is_valid( param->sched_ss_low_priority ) ) return EINVAL; 4b572: 7016 moveq #22,%d0 *budget_callout = _POSIX_Threads_Sporadic_budget_callout; return 0; } return EINVAL; } 4b574: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 4b57a: 4e5e unlk %fp ... =============================================================================== 00045c0c <_POSIX_Threads_Initialize_user_threads_body>: * * Output parameters: NONE */ void _POSIX_Threads_Initialize_user_threads_body(void) { 45c0c: 4e56 ff98 linkw %fp,#-104 45c10: 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; 45c14: 2479 0005 e11e moveal 5e11e ,%a2 maximum = Configuration_POSIX_API.number_of_initialization_threads; 45c1a: 2839 0005 e11a movel 5e11a ,%d4 if ( !user_threads || maximum == 0 ) 45c20: 4a8a tstl %a2 45c22: 676a beqs 45c8e <_POSIX_Threads_Initialize_user_threads_body+0x82><== NEVER TAKEN 45c24: 4a84 tstl %d4 45c26: 6766 beqs 45c8e <_POSIX_Threads_Initialize_user_threads_body+0x82><== NEVER TAKEN for ( index=0 ; index < maximum ; index++ ) { /* * There is no way for these calls to fail in this situation. */ (void) pthread_attr_init( &attr ); 45c28: 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( 45c2a: 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 ) 45c2c: 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 ); 45c2e: 0682 ffff ffbc addil #-68,%d2 45c34: 2c3c 0004 b580 movel #308608,%d6 (void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); 45c3a: 4bf9 0004 b5ac lea 4b5ac ,%a5 (void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size); 45c40: 49f9 0004 b5e4 lea 4b5e4 ,%a4 status = pthread_create( 45c46: 5985 subql #4,%d5 45c48: 47f9 0004 5960 lea 45960 ,%a3 for ( index=0 ; index < maximum ; index++ ) { /* * There is no way for these calls to fail in this situation. */ (void) pthread_attr_init( &attr ); 45c4e: 2f02 movel %d2,%sp@- 45c50: 2046 moveal %d6,%a0 45c52: 4e90 jsr %a0@ (void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); 45c54: 4878 0002 pea 2 45c58: 2f02 movel %d2,%sp@- 45c5a: 4e95 jsr %a5@ (void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size); 45c5c: 2f2a 0004 movel %a2@(4),%sp@- 45c60: 2f02 movel %d2,%sp@- 45c62: 4e94 jsr %a4@ status = pthread_create( 45c64: 42a7 clrl %sp@- 45c66: 2f12 movel %a2@,%sp@- 45c68: 2f02 movel %d2,%sp@- 45c6a: 2f05 movel %d5,%sp@- 45c6c: 4e93 jsr %a3@ &thread_id, &attr, user_threads[ index ].thread_entry, NULL ); if ( status ) 45c6e: 4fef 0024 lea %sp@(36),%sp 45c72: 4a80 tstl %d0 45c74: 6710 beqs 45c86 <_POSIX_Threads_Initialize_user_threads_body+0x7a> _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status ); 45c76: 2f00 movel %d0,%sp@- 45c78: 4878 0001 pea 1 45c7c: 4878 0002 pea 2 45c80: 4eb9 0004 7924 jsr 47924 <_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++ ) { 45c86: 5283 addql #1,%d3 45c88: 508a addql #8,%a2 45c8a: b883 cmpl %d3,%d4 45c8c: 62c0 bhis 45c4e <_POSIX_Threads_Initialize_user_threads_body+0x42><== NEVER TAKEN NULL ); if ( status ) _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status ); } } 45c8e: 4cee 3c7c ff98 moveml %fp@(-104),%d2-%d6/%a2-%a5 45c94: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004a618 <_POSIX_Threads_Sporadic_budget_TSR>: */ void _POSIX_Threads_Sporadic_budget_TSR( Objects_Id id __attribute__((unused)), void *argument ) { 4a618: 4e56 0000 linkw %fp,#0 4a61c: 2f0b movel %a3,%sp@- 4a61e: 2f0a movel %a2,%sp@- 4a620: 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 ]; 4a624: 266a 0102 moveal %a2@(258),%a3 /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_init_budget ); 4a628: 486b 0098 pea %a3@(152) 4a62c: 4eb9 0004 b388 jsr 4b388 <_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 ) { 4a632: 588f addql #4,%sp api = the_thread->API_Extensions[ THREAD_API_POSIX ]; /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_init_budget ); the_thread->cpu_time_budget = ticks; 4a634: 2540 0076 movel %d0,%a2@(118) RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( int priority ) { return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1); 4a638: 4280 clrl %d0 4a63a: 1039 0005 d0d2 moveb 5d0d2 ,%d0 4a640: 90ab 0088 subl %a3@(136),%d0 new_priority = _POSIX_Priority_To_core( api->schedparam.sched_priority ); the_thread->real_priority = new_priority; 4a644: 2540 0018 movel %d0,%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 ) { 4a648: 4aaa 001c tstl %a2@(28) 4a64c: 6618 bnes 4a666 <_POSIX_Threads_Sporadic_budget_TSR+0x4e><== NEVER TAKEN /* * If this would make them less important, then do not change it. */ if ( the_thread->current_priority > new_priority ) { 4a64e: b0aa 0014 cmpl %a2@(20),%d0 4a652: 6412 bccs 4a666 <_POSIX_Threads_Sporadic_budget_TSR+0x4e> _Thread_Change_priority( the_thread, new_priority, true ); 4a654: 4878 0001 pea 1 4a658: 2f00 movel %d0,%sp@- 4a65a: 2f0a movel %a2,%sp@- 4a65c: 4eb9 0004 76a4 jsr 476a4 <_Thread_Change_priority> 4a662: 4fef 000c lea %sp@(12),%sp #endif } } /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_repl_period ); 4a666: 486b 0090 pea %a3@(144) 4a66a: 4eb9 0004 b388 jsr 4b388 <_Timespec_To_ticks> _Watchdog_Insert_ticks( &api->Sporadic_timer, ticks ); } 4a670: 246e fff8 moveal %fp@(-8),%a2 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 4a674: 588f addql #4,%sp Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 4a676: 2740 00b4 movel %d0,%a3@(180) } /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_repl_period ); _Watchdog_Insert_ticks( &api->Sporadic_timer, ticks ); 4a67a: 47eb 00a8 lea %a3@(168),%a3 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 4a67e: 203c 0005 ea88 movel #387720,%d0 4a684: 2d4b 000c movel %a3,%fp@(12) } 4a688: 266e fffc moveal %fp@(-4),%a3 4a68c: 2d40 0008 movel %d0,%fp@(8) 4a690: 4e5e unlk %fp 4a692: 4ef9 0004 8758 jmp 48758 <_Watchdog_Insert> =============================================================================== 0004a698 <_POSIX_Threads_Sporadic_budget_callout>: /* * 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 */ 4a698: 70ff moveq #-1,%d0 * _POSIX_Threads_Sporadic_budget_callout */ void _POSIX_Threads_Sporadic_budget_callout( Thread_Control *the_thread ) { 4a69a: 4e56 0000 linkw %fp,#0 4a69e: 206e 0008 moveal %fp@(8),%a0 /* * 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 */ 4a6a2: 2140 0076 movel %d0,%a0@(118) 4a6a6: 4280 clrl %d0 4a6a8: 1039 0005 d0d2 moveb 5d0d2 ,%d0 ) { POSIX_API_Control *api; uint32_t new_priority; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4a6ae: 2268 0102 moveal %a0@(258),%a1 4a6b2: 90a9 008c subl %a1@(140),%d0 * while at low priority. */ the_thread->cpu_time_budget = 0xFFFFFFFF; /* XXX should be based on MAX_U32 */ new_priority = _POSIX_Priority_To_core(api->schedparam.sched_ss_low_priority); the_thread->real_priority = new_priority; 4a6b6: 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 ) { 4a6ba: 4aa8 001c tstl %a0@(28) 4a6be: 6618 bnes 4a6d8 <_POSIX_Threads_Sporadic_budget_callout+0x40><== NEVER TAKEN /* * Make sure we are actually lowering it. If they have lowered it * to logically lower than sched_ss_low_priority, then we do not want to * change it. */ if ( the_thread->current_priority < new_priority ) { 4a6c0: b0a8 0014 cmpl %a0@(20),%d0 4a6c4: 6312 blss 4a6d8 <_POSIX_Threads_Sporadic_budget_callout+0x40><== NEVER TAKEN _Thread_Change_priority( the_thread, new_priority, true ); 4a6c6: 4878 0001 pea 1 4a6ca: 2f00 movel %d0,%sp@- 4a6cc: 2f08 movel %a0,%sp@- 4a6ce: 4eb9 0004 76a4 jsr 476a4 <_Thread_Change_priority> 4a6d4: 4fef 000c lea %sp@(12),%sp #if 0 printk( "lower priority\n" ); #endif } } } 4a6d8: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00045794 <_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) { 45794: 4e56 0000 linkw %fp,#0 45798: 2f0a movel %a2,%sp@- 4579a: 246e 000c moveal %fp@(12),%a2 bool activated; ptimer = (POSIX_Timer_Control *)data; /* Increment the number of expirations. */ ptimer->overrun = ptimer->overrun + 1; 4579e: 52aa 0066 addql #1,%a2@(102) /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || 457a2: 4aaa 0052 tstl %a2@(82) 457a6: 6606 bnes 457ae <_POSIX_Timer_TSR+0x1a> 457a8: 4aaa 0056 tstl %a2@(86) 457ac: 6736 beqs 457e4 <_POSIX_Timer_TSR+0x50> <== NEVER TAKEN ( ptimer->timer_data.it_interval.tv_nsec != 0 ) ) { activated = _POSIX_Timer_Insert_helper( 457ae: 2f0a movel %a2,%sp@- 457b0: 4879 0004 5794 pea 45794 <_POSIX_Timer_TSR> 457b6: 2f2a 0008 movel %a2@(8),%sp@- 457ba: 2f2a 0062 movel %a2@(98),%sp@- 457be: 486a 0010 pea %a2@(16) 457c2: 4eb9 0004 af80 jsr 4af80 <_POSIX_Timer_Insert_helper> ptimer->ticks, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) 457c8: 4fef 0014 lea %sp@(20),%sp 457cc: 4a00 tstb %d0 457ce: 672e beqs 457fe <_POSIX_Timer_TSR+0x6a> <== NEVER TAKEN return; /* Store the time when the timer was started again */ _TOD_Get( &ptimer->time ); 457d0: 486a 006a pea %a2@(106) 457d4: 4eb9 0004 6cc4 jsr 46cc4 <_TOD_Get> /* The state really did not change but just to be safe */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; 457da: 588f addql #4,%sp 457dc: 7003 moveq #3,%d0 457de: 1540 003c moveb %d0,%a2@(60) 457e2: 6006 bras 457ea <_POSIX_Timer_TSR+0x56> } else { /* Indicates that the timer is stopped */ ptimer->state = POSIX_TIMER_STATE_CREATE_STOP; 457e4: 7004 moveq #4,%d0 <== NOT EXECUTED 457e6: 1540 003c moveb %d0,%a2@(60) <== NOT EXECUTED /* * The sending of the signal to the process running the handling function * specified for that signal is simulated */ if ( pthread_kill ( ptimer->thread_id, ptimer->inf.sigev_signo ) ) { 457ea: 2f2a 0042 movel %a2@(66),%sp@- 457ee: 2f2a 0038 movel %a2@(56),%sp@- 457f2: 4eb9 0004 ab74 jsr 4ab74 } /* After the signal handler returns, the count of expirations of the * timer must be set to 0. */ ptimer->overrun = 0; 457f8: 508f addql #8,%sp 457fa: 42aa 0066 clrl %a2@(102) } 457fe: 246e fffc moveal %fp@(-4),%a2 45802: 4e5e unlk %fp ... =============================================================================== 0004c3f4 <_POSIX_signals_Check_signal>: { siginfo_t siginfo_struct; sigset_t saved_signals_blocked; Thread_Wait_information stored_thread_wait_information; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 4c3f4: 4280 clrl %d0 bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 4c3f6: 4e56 ffb4 linkw %fp,#-76 siginfo_t siginfo_struct; sigset_t saved_signals_blocked; Thread_Wait_information stored_thread_wait_information; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 4c3fa: 102e 0013 moveb %fp@(19),%d0 bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 4c3fe: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@ siginfo_t siginfo_struct; sigset_t saved_signals_blocked; Thread_Wait_information stored_thread_wait_information; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 4c402: 4878 0001 pea 1 4c406: 2a0e movel %fp,%d5 4c408: 0685 ffff fff4 addil #-12,%d5 4c40e: 2f00 movel %d0,%sp@- bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 4c410: 242e 000c movel %fp@(12),%d2 siginfo_t siginfo_struct; sigset_t saved_signals_blocked; Thread_Wait_information stored_thread_wait_information; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 4c414: 2f05 movel %d5,%sp@- bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 4c416: 246e 0008 moveal %fp@(8),%a2 siginfo_t siginfo_struct; sigset_t saved_signals_blocked; Thread_Wait_information stored_thread_wait_information; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 4c41a: 2f02 movel %d2,%sp@- 4c41c: 2f0a movel %a2,%sp@- 4c41e: 4eb9 0004 c4cc jsr 4c4cc <_POSIX_signals_Clear_signals> 4c424: 4fef 0014 lea %sp@(20),%sp 4c428: 4a00 tstb %d0 4c42a: 6700 0092 beqw 4c4be <_POSIX_signals_Check_signal+0xca> #endif /* * Just to prevent sending a signal which is currently being ignored. */ if ( _POSIX_signals_Vectors[ signo ].sa_handler == SIG_IGN ) 4c42e: 2002 movel %d2,%d0 4c430: 2602 movel %d2,%d3 4c432: e588 lsll #2,%d0 4c434: e98b lsll #4,%d3 4c436: 9680 subl %d0,%d3 4c438: 2043 moveal %d3,%a0 4c43a: d1fc 0005 ee64 addal #388708,%a0 4c440: 7001 moveq #1,%d0 4c442: 2668 0008 moveal %a0@(8),%a3 4c446: b08b cmpl %a3,%d0 4c448: 6774 beqs 4c4be <_POSIX_signals_Check_signal+0xca><== NEVER TAKEN /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; 4c44a: 2028 0004 movel %a0@(4),%d0 return false; /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; 4c44e: 282a 00d0 movel %a2@(208),%d4 api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; 4c452: 8084 orl %d4,%d0 /* * We have to save the blocking information of the current wait queue * because the signal handler may subsequently go on and put the thread * on a wait queue, for its own purposes. */ memcpy( &stored_thread_wait_information, &_Thread_Executing->Wait, 4c454: 2079 0005 ee32 moveal 5ee32 <_Per_CPU_Information+0xc>,%a0 4c45a: 41e8 0020 lea %a0@(32),%a0 /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; 4c45e: 2540 00d0 movel %d0,%a2@(208) /* * We have to save the blocking information of the current wait queue * because the signal handler may subsequently go on and put the thread * on a wait queue, for its own purposes. */ memcpy( &stored_thread_wait_information, &_Thread_Executing->Wait, 4c462: 4878 0028 pea 28 4c466: 2f08 movel %a0,%sp@- 4c468: 486e ffcc pea %fp@(-52) 4c46c: 4eb9 0004 d37c jsr 4d37c sizeof( Thread_Wait_information )); /* * Here, the signal handler function executes */ switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) { 4c472: 4fef 000c lea %sp@(12),%sp 4c476: 41f9 0005 ee64 lea 5ee64 <_POSIX_signals_Vectors>,%a0 4c47c: 7002 moveq #2,%d0 4c47e: b0b0 3800 cmpl %a0@(00000000,%d3:l),%d0 4c482: 660e bnes 4c492 <_POSIX_signals_Check_signal+0x9e> case SA_SIGINFO: (*_POSIX_signals_Vectors[ signo ].sa_sigaction)( 4c484: 42a7 clrl %sp@- 4c486: 2f05 movel %d5,%sp@- 4c488: 2f02 movel %d2,%sp@- 4c48a: 4e93 jsr %a3@ signo, &siginfo_struct, NULL /* context is undefined per 1003.1b-1993, p. 66 */ ); break; 4c48c: 4fef 000c lea %sp@(12),%sp 4c490: 6006 bras 4c498 <_POSIX_signals_Check_signal+0xa4> default: (*_POSIX_signals_Vectors[ signo ].sa_handler)( signo ); 4c492: 2f02 movel %d2,%sp@- 4c494: 4e93 jsr %a3@ break; 4c496: 588f addql #4,%sp } /* * Restore the blocking information */ memcpy( &_Thread_Executing->Wait, &stored_thread_wait_information, 4c498: 4878 0028 pea 28 4c49c: 486e ffcc pea %fp@(-52) 4c4a0: 2079 0005 ee32 moveal 5ee32 <_Per_CPU_Information+0xc>,%a0 4c4a6: 41e8 0020 lea %a0@(32),%a0 4c4aa: 2f08 movel %a0,%sp@- 4c4ac: 4eb9 0004 d37c jsr 4d37c /* * Restore the previous set of blocked signals */ api->signals_blocked = saved_signals_blocked; return true; 4c4b2: 4fef 000c lea %sp@(12),%sp sizeof( Thread_Wait_information )); /* * Restore the previous set of blocked signals */ api->signals_blocked = saved_signals_blocked; 4c4b6: 2544 00d0 movel %d4,%a2@(208) return true; 4c4ba: 7001 moveq #1,%d0 4c4bc: 6002 bras 4c4c0 <_POSIX_signals_Check_signal+0xcc> /* * Just to prevent sending a signal which is currently being ignored. */ if ( _POSIX_signals_Vectors[ signo ].sa_handler == SIG_IGN ) return false; 4c4be: 4200 clrb %d0 * Restore the previous set of blocked signals */ api->signals_blocked = saved_signals_blocked; return true; } 4c4c0: 4cee 0c3c ffb4 moveml %fp@(-76),%d2-%d5/%a2-%a3 4c4c6: 4e5e unlk %fp ... =============================================================================== 0004ca44 <_POSIX_signals_Clear_process_signals>: clear_signal = true; mask = signo_to_mask( signo ); ISR_Level level; _ISR_Disable( level ); 4ca44: 203c 0000 0700 movel #1792,%d0 */ void _POSIX_signals_Clear_process_signals( int signo ) { 4ca4a: 4e56 0000 linkw %fp,#0 4ca4e: 222e 0008 movel %fp@(8),%d1 4ca52: 2f03 movel %d3,%sp@- 4ca54: 2f02 movel %d2,%sp@- clear_signal = true; mask = signo_to_mask( signo ); ISR_Level level; _ISR_Disable( level ); 4ca56: 40c2 movew %sr,%d2 4ca58: 8082 orl %d2,%d0 4ca5a: 46c0 movew %d0,%sr if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { 4ca5c: 2601 movel %d1,%d3 4ca5e: 2001 movel %d1,%d0 4ca60: 41f9 0005 ee64 lea 5ee64 <_POSIX_signals_Vectors>,%a0 4ca66: e58b lsll #2,%d3 4ca68: e988 lsll #4,%d0 4ca6a: 9083 subl %d3,%d0 4ca6c: 7602 moveq #2,%d3 4ca6e: b6b0 0800 cmpl %a0@(00000000,%d0:l),%d3 4ca72: 6614 bnes 4ca88 <_POSIX_signals_Clear_process_signals+0x44> RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 4ca74: 2040 moveal %d0,%a0 4ca76: d1fc 0005 f060 addal #389216,%a0 if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) 4ca7c: 43f9 0005 f05c lea 5f05c <_POSIX_signals_Siginfo>,%a1 4ca82: b1f1 0800 cmpal %a1@(00000000,%d0:l),%a0 4ca86: 660e bnes 4ca96 <_POSIX_signals_Clear_process_signals+0x52><== NEVER TAKEN 4ca88: 5381 subql #1,%d1 4ca8a: 7001 moveq #1,%d0 4ca8c: e3a8 lsll %d1,%d0 clear_signal = false; } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; 4ca8e: 4680 notl %d0 4ca90: c1b9 0005 f058 andl %d0,5f058 <_POSIX_signals_Pending> } _ISR_Enable( level ); 4ca96: 46c2 movew %d2,%sr } 4ca98: 241f movel %sp@+,%d2 4ca9a: 261f movel %sp@+,%d3 4ca9c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00046284 <_POSIX_signals_Get_lowest>: sigset_t set ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 46284: 701b moveq #27,%d0 #include int _POSIX_signals_Get_lowest( sigset_t set ) { 46286: 4e56 fff4 linkw %fp,#-12 4628a: 48d7 001c moveml %d2-%d4,%sp@ 4628e: 242e 0008 movel %fp@(8),%d2 46292: 7601 moveq #1,%d3 #include #include #include #include int _POSIX_signals_Get_lowest( 46294: 2200 movel %d0,%d1 46296: 5381 subql #1,%d1 46298: 2803 movel %d3,%d4 4629a: e3ac lsll %d1,%d4 4629c: 2204 movel %d4,%d1 ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { if ( set & signo_to_mask( signo ) ) { 4629e: c282 andl %d2,%d1 462a0: 6626 bnes 462c8 <_POSIX_signals_Get_lowest+0x44> <== NEVER TAKEN sigset_t set ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 462a2: 5280 addql #1,%d0 462a4: 123c 0020 moveb #32,%d1 462a8: b280 cmpl %d0,%d1 462aa: 66e8 bnes 46294 <_POSIX_signals_Get_lowest+0x10> 462ac: 7001 moveq #1,%d0 462ae: 7601 moveq #1,%d3 #include #include #include #include int _POSIX_signals_Get_lowest( 462b0: 2200 movel %d0,%d1 462b2: 5381 subql #1,%d1 462b4: 2803 movel %d3,%d4 462b6: e3ac lsll %d1,%d4 462b8: 2204 movel %d4,%d1 #if (SIGHUP != 1) #error "Assumption that SIGHUP==1 violated!!" #endif for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { if ( set & signo_to_mask( signo ) ) { 462ba: c282 andl %d2,%d1 462bc: 660a bnes 462c8 <_POSIX_signals_Get_lowest+0x44> */ #if (SIGHUP != 1) #error "Assumption that SIGHUP==1 violated!!" #endif for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { 462be: 5280 addql #1,%d0 462c0: 123c 001b moveb #27,%d1 462c4: b280 cmpl %d0,%d1 462c6: 66e8 bnes 462b0 <_POSIX_signals_Get_lowest+0x2c> <== ALWAYS TAKEN * a return 0. This routine will NOT be called unless a signal * is pending in the set passed in. */ found_it: return signo; } 462c8: 4cd7 001c moveml %sp@,%d2-%d4 462cc: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0005ae6c <_POSIX_signals_Unblock_thread>: 5ae6c: 7201 moveq #1,%d1 bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, siginfo_t *info ) { 5ae6e: 4e56 fff4 linkw %fp,#-12 5ae72: 226e 0010 moveal %fp@(16),%a1 5ae76: 48d7 040c moveml %d2-%d3/%a2,%sp@ 5ae7a: 242e 000c movel %fp@(12),%d2 5ae7e: 2002 movel %d2,%d0 5ae80: 5380 subql #1,%d0 5ae82: 246e 0008 moveal %fp@(8),%a2 5ae86: e1a9 lsll %d0,%d1 /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 5ae88: 202a 0010 movel %a2@(16),%d0 5ae8c: 2600 movel %d0,%d3 5ae8e: 0283 1000 8000 andil #268468224,%d3 { POSIX_API_Control *api; sigset_t mask; siginfo_t *the_info = NULL; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 5ae94: 206a 0102 moveal %a2@(258),%a0 /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 5ae98: 0c83 1000 8000 cmpil #268468224,%d3 5ae9e: 6650 bnes 5aef0 <_POSIX_signals_Unblock_thread+0x84> if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { 5aea0: 2001 movel %d1,%d0 5aea2: c0aa 0030 andl %a2@(48),%d0 5aea6: 660c bnes 5aeb4 <_POSIX_signals_Unblock_thread+0x48> 5aea8: 2028 00d0 movel %a0@(208),%d0 5aeac: 4680 notl %d0 5aeae: c280 andl %d0,%d1 5aeb0: 6700 00a8 beqw 5af5a <_POSIX_signals_Unblock_thread+0xee> the_thread->Wait.return_code = EINTR; 5aeb4: 7004 moveq #4,%d0 the_info = (siginfo_t *) the_thread->Wait.return_argument; 5aeb6: 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; 5aeba: 2540 0034 movel %d0,%a2@(52) the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { 5aebe: 4a89 tstl %a1 5aec0: 660e bnes 5aed0 <_POSIX_signals_Unblock_thread+0x64> the_info->si_signo = signo; the_info->si_code = SI_USER; 5aec2: 7201 moveq #1,%d1 the_thread->Wait.return_code = EINTR; the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { the_info->si_signo = signo; 5aec4: 2082 movel %d2,%a0@ the_info->si_code = SI_USER; 5aec6: 2141 0004 movel %d1,%a0@(4) the_info->si_value.sival_int = 0; 5aeca: 42a8 0008 clrl %a0@(8) 5aece: 6012 bras 5aee2 <_POSIX_signals_Unblock_thread+0x76> } else { *the_info = *info; 5aed0: 4878 000c pea c 5aed4: 2f09 movel %a1,%sp@- 5aed6: 2f08 movel %a0,%sp@- 5aed8: 4eb9 0004 d37c jsr 4d37c 5aede: 4fef 000c lea %sp@(12),%sp } _Thread_queue_Extract_with_proxy( the_thread ); 5aee2: 2f0a movel %a2,%sp@- 5aee4: 4eb9 0004 80d4 jsr 480d4 <_Thread_queue_Extract_with_proxy> return true; 5aeea: 588f addql #4,%sp 5aeec: 7001 moveq #1,%d0 5aeee: 606c bras 5af5c <_POSIX_signals_Unblock_thread+0xf0> } /* * Thread is not waiting due to a sigwait. */ if ( ~api->signals_blocked & mask ) { 5aef0: 2428 00d0 movel %a0@(208),%d2 5aef4: 4682 notl %d2 5aef6: c282 andl %d2,%d1 5aef8: 6760 beqs 5af5a <_POSIX_signals_Unblock_thread+0xee> * it is not blocked, THEN * we need to dispatch at the end of this ISR. * + Any other combination, do nothing. */ if ( _States_Is_interruptible_by_signal( the_thread->current_state ) ) { 5aefa: 0800 001c btst #28,%d0 5aefe: 673e beqs 5af3e <_POSIX_signals_Unblock_thread+0xd2> the_thread->Wait.return_code = EINTR; 5af00: 7204 moveq #4,%d1 5af02: 2541 0034 movel %d1,%a2@(52) */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue ( States_Control the_states ) { return (the_states & STATES_WAITING_ON_THREAD_QUEUE); 5af06: 2200 movel %d0,%d1 5af08: 0281 0003 bee0 andil #245472,%d1 /* * In pthread_cond_wait, a thread will be blocking on a thread * queue, but is also interruptible by a POSIX signal. */ if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) ) 5af0e: 670c beqs 5af1c <_POSIX_signals_Unblock_thread+0xb0> _Thread_queue_Extract_with_proxy( the_thread ); 5af10: 2f0a movel %a2,%sp@- 5af12: 4eb9 0004 80d4 jsr 480d4 <_Thread_queue_Extract_with_proxy> 5af18: 588f addql #4,%sp 5af1a: 603e bras 5af5a <_POSIX_signals_Unblock_thread+0xee> else if ( _States_Is_delaying(the_thread->current_state) ) { 5af1c: 44c0 movew %d0,%ccr 5af1e: 6a3a bpls 5af5a <_POSIX_signals_Unblock_thread+0xee><== NEVER TAKEN (void) _Watchdog_Remove( &the_thread->Timer ); 5af20: 486a 0048 pea %a2@(72) 5af24: 4eb9 0004 8880 jsr 48880 <_Watchdog_Remove> RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 5af2a: 2f3c 1003 fff8 movel #268697592,%sp@- 5af30: 2f0a movel %a2,%sp@- 5af32: 4eb9 0004 7780 jsr 47780 <_Thread_Clear_state> 5af38: 4fef 000c lea %sp@(12),%sp 5af3c: 601c bras 5af5a <_POSIX_signals_Unblock_thread+0xee> _Thread_Unblock( the_thread ); } } else if ( the_thread->current_state == STATES_READY ) { 5af3e: 4a80 tstl %d0 5af40: 6618 bnes 5af5a <_POSIX_signals_Unblock_thread+0xee><== NEVER TAKEN if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 5af42: 4ab9 0005 ee2e tstl 5ee2e <_Per_CPU_Information+0x8> 5af48: 6710 beqs 5af5a <_POSIX_signals_Unblock_thread+0xee> 5af4a: b5f9 0005 ee32 cmpal 5ee32 <_Per_CPU_Information+0xc>,%a2 5af50: 6608 bnes 5af5a <_POSIX_signals_Unblock_thread+0xee><== NEVER TAKEN _Thread_Dispatch_necessary = true; 5af52: 7001 moveq #1,%d0 5af54: 13c0 0005 ee3e moveb %d0,5ee3e <_Per_CPU_Information+0x18> } } return false; 5af5a: 4200 clrb %d0 } 5af5c: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 5af62: 4e5e unlk %fp ... =============================================================================== 0004637c <_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 ) { 4637c: 4e56 ffd4 linkw %fp,#-44 46380: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@ 46384: 266e 0008 moveal %fp@(8),%a3 /* * Determine elapsed wall time since period initiated. */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _TOD_Get_uptime( &uptime ); 46388: 240e movel %fp,%d2 4638a: 5182 subql #8,%d2 _Timestamp_Subtract( 4638c: 45f9 0004 9bbc lea 49bbc <_Timespec_Subtract>,%a2 ) { #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ Timestamp_Control uptime; #endif Thread_Control *owning_thread = the_period->owner; 46392: 286b 0040 moveal %a3@(64),%a4 /* * Determine elapsed wall time since period initiated. */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _TOD_Get_uptime( &uptime ); 46396: 2f02 movel %d2,%sp@- 46398: 4eb9 0004 7b18 jsr 47b18 <_TOD_Get_uptime> _Timestamp_Subtract( 4639e: 2f2e 000c movel %fp@(12),%sp@- 463a2: 2f02 movel %d2,%sp@- 463a4: 486b 004c pea %a3@(76) 463a8: 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) { 463aa: 4fef 0010 lea %sp@(16),%sp #endif /* * Determine cpu usage since period initiated. */ used = owning_thread->cpu_time_used; 463ae: 202c 0082 movel %a4@(130),%d0 463b2: 222c 0086 movel %a4@(134),%d1 463b6: 2d40 fff0 movel %d0,%fp@(-16) 463ba: 2d41 fff4 movel %d1,%fp@(-12) #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ if (owning_thread == _Thread_Executing) { 463be: b9f9 0006 0a4c cmpal 60a4c <_Per_CPU_Information+0xc>,%a4 463c4: 6644 bnes 4640a <_Rate_monotonic_Get_status+0x8e><== NEVER TAKEN Thread_CPU_usage_t ran; /* How much time time since last context switch */ _Timestamp_Subtract( 463c6: 260e movel %fp,%d3 463c8: 0683 ffff ffe8 addil #-24,%d3 /* * The cpu usage info was reset while executing. Can't * determine a status. */ if (_Timestamp_Less_than(&used, &the_period->cpu_usage_period_initiated)) 463ce: 47eb 0044 lea %a3@(68),%a3 if (owning_thread == _Thread_Executing) { Thread_CPU_usage_t ran; /* How much time time since last context switch */ _Timestamp_Subtract( 463d2: 2f03 movel %d3,%sp@- 463d4: 2f02 movel %d2,%sp@- 463d6: 4879 0006 068e pea 6068e <_Thread_Time_of_last_context_switch> &_Thread_Time_of_last_context_switch, &uptime, &ran ); /* cpu usage += ran */ _Timestamp_Add_to( &used, &ran ); 463dc: 5182 subql #8,%d2 if (owning_thread == _Thread_Executing) { Thread_CPU_usage_t ran; /* How much time time since last context switch */ _Timestamp_Subtract( 463de: 4e92 jsr %a2@ &_Thread_Time_of_last_context_switch, &uptime, &ran ); /* cpu usage += ran */ _Timestamp_Add_to( &used, &ran ); 463e0: 2f03 movel %d3,%sp@- 463e2: 2f02 movel %d2,%sp@- 463e4: 4eb9 0004 9a94 jsr 49a94 <_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)) 463ea: 2f0b movel %a3,%sp@- 463ec: 2f02 movel %d2,%sp@- 463ee: 4eb9 0004 9b8c jsr 49b8c <_Timespec_Less_than> 463f4: 4fef 001c lea %sp@(28),%sp 463f8: 4a00 tstb %d0 463fa: 6612 bnes 4640e <_Rate_monotonic_Get_status+0x92> return false; /* used = current cpu usage - cpu usage at start of period */ _Timestamp_Subtract( 463fc: 2f2e 0010 movel %fp@(16),%sp@- 46400: 2f02 movel %d2,%sp@- 46402: 2f0b movel %a3,%sp@- 46404: 4e92 jsr %a2@ 46406: 4fef 000c lea %sp@(12),%sp if (used < the_period->cpu_usage_period_initiated) return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; 4640a: 7001 moveq #1,%d0 4640c: 6002 bras 46410 <_Rate_monotonic_Get_status+0x94> /* * The cpu usage info was reset while executing. Can't * determine a status. */ if (_Timestamp_Less_than(&used, &the_period->cpu_usage_period_initiated)) return false; 4640e: 4200 clrb %d0 return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; } 46410: 4cee 1c0c ffd4 moveml %fp@(-44),%d2-%d3/%a2-%a4 46416: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000582d8 <_Region_Process_queue>: */ void _Region_Process_queue( Region_Control *the_region ) { 582d8: 4e56 ffe4 linkw %fp,#-28 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 582dc: 2039 0007 751c movel 7751c <_Thread_Dispatch_disable_level>,%d0 582e2: 5280 addql #1,%d0 582e4: 48d7 3c1c moveml %d2-%d4/%a2-%a5,%sp@ 582e8: 266e 0008 moveal %fp@(8),%a3 582ec: 23c0 0007 751c movel %d0,7751c <_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(); 582f2: 2f39 0007 75bc movel 775bc <_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 ); 582f8: 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 ); 582fa: 260b movel %a3,%d3 582fc: 0682 0000 0010 addil #16,%d2 58302: 0683 0000 0068 addil #104,%d3 58308: 4bf9 0005 375c lea 5375c <_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 ); 5830e: 49f9 0005 8968 lea 58968 <_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(); 58314: 4eb9 0005 2cf0 jsr 52cf0 <_API_Mutex_Unlock> 5831a: 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 ); 5831c: 283c 0005 8a6c movel #363116,%d4 58322: 2f02 movel %d2,%sp@- 58324: 2044 moveal %d4,%a0 58326: 4e90 jsr %a0@ if ( the_thread == NULL ) 58328: 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 ); 5832a: 2440 moveal %d0,%a2 if ( the_thread == NULL ) 5832c: 4a80 tstl %d0 5832e: 672c beqs 5835c <_Region_Process_queue+0x84> 58330: 42a7 clrl %sp@- 58332: 42a7 clrl %sp@- 58334: 2f2a 0024 movel %a2@(36),%sp@- 58338: 2f03 movel %d3,%sp@- 5833a: 4e95 jsr %a5@ the_segment = (void **) _Region_Allocate_segment( the_region, the_thread->Wait.count ); if ( the_segment == NULL ) 5833c: 4fef 0010 lea %sp@(16),%sp 58340: 4a80 tstl %d0 58342: 6718 beqs 5835c <_Region_Process_queue+0x84> break; *(void **)the_thread->Wait.return_argument = the_segment; 58344: 206a 0028 moveal %a2@(40),%a0 58348: 2080 movel %d0,%a0@ the_region->number_of_used_blocks += 1; 5834a: 52ab 0064 addql #1,%a3@(100) _Thread_queue_Extract( &the_region->Wait_queue, the_thread ); 5834e: 2f0a movel %a2,%sp@- 58350: 2f02 movel %d2,%sp@- 58352: 4e94 jsr %a4@ the_thread->Wait.return_code = RTEMS_SUCCESSFUL; } 58354: 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; 58356: 42aa 0034 clrl %a2@(52) } 5835a: 60c6 bras 58322 <_Region_Process_queue+0x4a> _Thread_Enable_dispatch(); } 5835c: 4cee 3c1c ffe4 moveml %fp@(-28),%d2-%d4/%a2-%a5 58362: 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(); 58364: 4ef9 0005 526e jmp 5526e <_Thread_Enable_dispatch> ... =============================================================================== 00047244 <_Scheduler_Handler_initialization>: #include #include #include void _Scheduler_Handler_initialization(void) { 47244: 4e56 0000 linkw %fp,#0 (*_Scheduler.Operations.initialize)(); } 47248: 4e5e unlk %fp #include #include void _Scheduler_Handler_initialization(void) { (*_Scheduler.Operations.initialize)(); 4724a: 2279 0005 d004 moveal 5d004 <_Scheduler+0x4>,%a1 47250: 4ed1 jmp %a1@ ... =============================================================================== 00047270 <_Scheduler_priority_Block>: #include void _Scheduler_priority_Block( Thread_Control *the_thread ) { 47270: 4e56 0000 linkw %fp,#0 47274: 226e 0008 moveal %fp@(8),%a1 47278: 2f0a movel %a2,%sp@- ) { Scheduler_priority_Per_thread *sched_info; Chain_Control *ready; sched_info = (Scheduler_priority_Per_thread *) the_thread->scheduler_info; 4727a: 2469 008a moveal %a1@(138),%a2 ready = sched_info->ready_chain; 4727e: 2052 moveal %a2@,%a0 if ( _Chain_Has_only_one_node( ready ) ) { 47280: 2028 0008 movel %a0@(8),%d0 47284: b090 cmpl %a0@,%d0 47286: 6632 bnes 472ba <_Scheduler_priority_Block+0x4a> Chain_Node *tail = _Chain_Tail( the_chain ); 47288: 2008 movel %a0,%d0 4728a: 5880 addql #4,%d0 head->next = tail; head->previous = NULL; 4728c: 42a8 0004 clrl %a0@(4) RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 47290: 2080 movel %d0,%a0@ RTEMS_INLINE_ROUTINE void _Priority_bit_map_Remove ( Priority_bit_map_Information *the_priority_map ) { *the_priority_map->minor &= the_priority_map->block_minor; 47292: 302a 000e movew %a2@(14),%d0 head->next = tail; head->previous = NULL; tail->previous = head; 47296: 2148 0008 movel %a0,%a0@(8) 4729a: 206a 0004 moveal %a2@(4),%a0 4729e: 3210 movew %a0@,%d1 472a0: c081 andl %d1,%d0 472a2: 3080 movew %d0,%a0@ if ( *the_priority_map->minor == 0 ) 472a4: 6620 bnes 472c6 <_Scheduler_priority_Block+0x56> _Priority_Major_bit_map &= the_priority_map->block_major; 472a6: 3039 0005 ee40 movew 5ee40 <_Priority_Major_bit_map>,%d0 472ac: 322a 000c movew %a2@(12),%d1 472b0: c081 andl %d1,%d0 472b2: 33c0 0005 ee40 movew %d0,5ee40 <_Priority_Major_bit_map> 472b8: 600c bras 472c6 <_Scheduler_priority_Block+0x56> ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 472ba: 2451 moveal %a1@,%a2 previous = the_node->previous; 472bc: 2069 0004 moveal %a1@(4),%a0 next->previous = previous; 472c0: 2548 0004 movel %a0,%a2@(4) previous->next = next; 472c4: 208a movel %a2,%a0@ _Scheduler_priority_Ready_queue_extract( the_thread ); /* TODO: flash critical section? */ if ( _Thread_Is_heir( the_thread ) ) 472c6: b3f9 0005 ee36 cmpal 5ee36 <_Per_CPU_Information+0x10>,%a1 472cc: 6646 bnes 47314 <_Scheduler_priority_Block+0xa4> RTEMS_INLINE_ROUTINE Priority_Control _Priority_bit_map_Get_highest( void ) { Priority_bit_map_Control minor; Priority_bit_map_Control major; _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); 472ce: 3039 0005 ee40 movew 5ee40 <_Priority_Major_bit_map>,%d0 472d4: 4840 swap %d0 472d6: 04c0 ff1 %d0 _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 472d8: 41f9 0005 ee44 lea 5ee44 <_Priority_Bit_map>,%a0 472de: 0280 0000 ffff andil #65535,%d0 472e4: 3230 0a00 movew %a0@(00000000,%d0:l:2),%d1 472e8: 4841 swap %d1 472ea: 04c1 ff1 %d1 _Scheduler_priority_Schedule_body(); if ( _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; } 472ec: 2079 0005 d000 moveal 5d000 <_Scheduler>,%a0 return (_Priority_Bits_index( major ) << 4) + 472f2: 0281 0000 ffff andil #65535,%d1 472f8: e988 lsll #4,%d0 472fa: d081 addl %d1,%d0 Chain_Control *the_ready_queue ) { Priority_Control index = _Priority_bit_map_Get_highest(); if ( !_Chain_Is_empty( &the_ready_queue[ index ] ) ) 472fc: 2200 movel %d0,%d1 472fe: e988 lsll #4,%d0 47300: e589 lsll #2,%d1 47302: 9081 subl %d1,%d0 47304: d1c0 addal %d0,%a0 47306: 2018 movel %a0@+,%d0 47308: b1c0 cmpal %d0,%a0 4730a: 6602 bnes 4730e <_Scheduler_priority_Block+0x9e> <== ALWAYS TAKEN return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] ); return NULL; 4730c: 4280 clrl %d0 <== NOT EXECUTED * * @param[in] the_thread - pointer to thread */ RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void) { _Thread_Heir = _Scheduler_priority_Ready_queue_first( 4730e: 23c0 0005 ee36 movel %d0,5ee36 <_Per_CPU_Information+0x10> /* TODO: flash critical section? */ if ( _Thread_Is_heir( the_thread ) ) _Scheduler_priority_Schedule_body(); if ( _Thread_Is_executing( the_thread ) ) 47314: b3f9 0005 ee32 cmpal 5ee32 <_Per_CPU_Information+0xc>,%a1 4731a: 6608 bnes 47324 <_Scheduler_priority_Block+0xb4> _Thread_Dispatch_necessary = true; 4731c: 7001 moveq #1,%d0 4731e: 13c0 0005 ee3e moveb %d0,5ee3e <_Per_CPU_Information+0x18> } 47324: 245f moveal %sp@+,%a2 47326: 4e5e unlk %fp ... =============================================================================== 0004741c <_Scheduler_priority_Free>: #include void _Scheduler_priority_Free ( Thread_Control *the_thread ) { 4741c: 4e56 0000 linkw %fp,#0 _Workspace_Free( the_thread->scheduler_info ); 47420: 206e 0008 moveal %fp@(8),%a0 47424: 2d68 008a 0008 movel %a0@(138),%fp@(8) } 4742a: 4e5e unlk %fp void _Scheduler_priority_Free ( Thread_Control *the_thread ) { _Workspace_Free( the_thread->scheduler_info ); 4742c: 4ef9 0004 89f4 jmp 489f4 <_Workspace_Free> ... =============================================================================== 0004749c <_Scheduler_priority_Schedule>: #include #include #include void _Scheduler_priority_Schedule(void) { 4749c: 4e56 0000 linkw %fp,#0 RTEMS_INLINE_ROUTINE Priority_Control _Priority_bit_map_Get_highest( void ) { Priority_bit_map_Control minor; Priority_bit_map_Control major; _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); 474a0: 3039 0005 ee40 movew 5ee40 <_Priority_Major_bit_map>,%d0 474a6: 4840 swap %d0 474a8: 04c0 ff1 %d0 _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 474aa: 41f9 0005 ee44 lea 5ee44 <_Priority_Bit_map>,%a0 474b0: 0280 0000 ffff andil #65535,%d0 474b6: 3230 0a00 movew %a0@(00000000,%d0:l:2),%d1 474ba: 4841 swap %d1 474bc: 04c1 ff1 %d1 _Scheduler_priority_Schedule_body(); } 474be: 2079 0005 d000 moveal 5d000 <_Scheduler>,%a0 return (_Priority_Bits_index( major ) << 4) + 474c4: 0281 0000 ffff andil #65535,%d1 474ca: e988 lsll #4,%d0 474cc: d081 addl %d1,%d0 Chain_Control *the_ready_queue ) { Priority_Control index = _Priority_bit_map_Get_highest(); if ( !_Chain_Is_empty( &the_ready_queue[ index ] ) ) 474ce: 2200 movel %d0,%d1 474d0: e988 lsll #4,%d0 474d2: e589 lsll #2,%d1 474d4: 9081 subl %d1,%d0 474d6: d1c0 addal %d0,%a0 474d8: 2018 movel %a0@+,%d0 474da: b1c0 cmpal %d0,%a0 474dc: 6602 bnes 474e0 <_Scheduler_priority_Schedule+0x44><== ALWAYS TAKEN return (Thread_Control *) _Chain_First( &the_ready_queue[ index ] ); return NULL; 474de: 4280 clrl %d0 <== NOT EXECUTED * * @param[in] the_thread - pointer to thread */ RTEMS_INLINE_ROUTINE void _Scheduler_priority_Schedule_body(void) { _Thread_Heir = _Scheduler_priority_Ready_queue_first( 474e0: 23c0 0005 ee36 movel %d0,5ee36 <_Per_CPU_Information+0x10> 474e6: 4e5e unlk %fp ... =============================================================================== 0004627c <_TOD_Validate>: */ bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 4627c: 4e56 0000 linkw %fp,#0 46280: 206e 0008 moveal %fp@(8),%a0 46284: 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(); 46286: 2039 0005 f180 movel 5f180 ,%d0 */ bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 4628c: 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) || 4628e: 4a88 tstl %a0 46290: 6762 beqs 462f4 <_TOD_Validate+0x78> <== NEVER TAKEN ) { uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / 46292: 243c 000f 4240 movel #1000000,%d2 46298: 4c40 2002 remul %d0,%d2,%d2 rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 4629c: b4a8 0018 cmpl %a0@(24),%d2 462a0: 6352 blss 462f4 <_TOD_Validate+0x78> (the_tod->ticks >= ticks_per_second) || 462a2: 763b moveq #59,%d3 462a4: b6a8 0014 cmpl %a0@(20),%d3 462a8: 654a bcss 462f4 <_TOD_Validate+0x78> (the_tod->second >= TOD_SECONDS_PER_MINUTE) || 462aa: b6a8 0010 cmpl %a0@(16),%d3 462ae: 6544 bcss 462f4 <_TOD_Validate+0x78> (the_tod->minute >= TOD_MINUTES_PER_HOUR) || 462b0: 7017 moveq #23,%d0 462b2: b0a8 000c cmpl %a0@(12),%d0 462b6: 653c bcss 462f4 <_TOD_Validate+0x78> (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || 462b8: 2028 0004 movel %a0@(4),%d0 rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || (the_tod->ticks >= ticks_per_second) || (the_tod->second >= TOD_SECONDS_PER_MINUTE) || (the_tod->minute >= TOD_MINUTES_PER_HOUR) || (the_tod->hour >= TOD_HOURS_PER_DAY) || 462bc: 6736 beqs 462f4 <_TOD_Validate+0x78> <== NEVER TAKEN (the_tod->month == 0) || 462be: 720c moveq #12,%d1 462c0: b280 cmpl %d0,%d1 462c2: 6530 bcss 462f4 <_TOD_Validate+0x78> (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || 462c4: 2410 movel %a0@,%d2 (the_tod->ticks >= ticks_per_second) || (the_tod->second >= TOD_SECONDS_PER_MINUTE) || (the_tod->minute >= TOD_MINUTES_PER_HOUR) || (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || 462c6: 0c82 0000 07c3 cmpil #1987,%d2 462cc: 6326 blss 462f4 <_TOD_Validate+0x78> (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) 462ce: 2228 0008 movel %a0@(8),%d1 (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) || 462d2: 6720 beqs 462f4 <_TOD_Validate+0x78> <== NEVER TAKEN (the_tod->day == 0) ) return false; if ( (the_tod->year % 4) == 0 ) 462d4: 163c 0003 moveb #3,%d3 462d8: 41f9 0005 e136 lea 5e136 <_TOD_Days_per_month>,%a0 462de: c483 andl %d3,%d2 462e0: 6606 bnes 462e8 <_TOD_Validate+0x6c> days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; 462e2: 2030 0c34 movel %a0@(00000034,%d0:l:4),%d0 462e6: 6004 bras 462ec <_TOD_Validate+0x70> else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; 462e8: 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( 462ec: b081 cmpl %d1,%d0 462ee: 54c0 scc %d0 462f0: 4480 negl %d0 462f2: 6002 bras 462f6 <_TOD_Validate+0x7a> (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) return false; 462f4: 4200 clrb %d0 if ( the_tod->day > days_in_month ) return false; return true; } 462f6: 241f movel %sp@+,%d2 462f8: 261f movel %sp@+,%d3 462fa: 4e5e unlk %fp ... =============================================================================== 000476a4 <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 476a4: 4e56 fff0 linkw %fp,#-16 476a8: 48d7 041c moveml %d2-%d4/%a2,%sp@ 476ac: 246e 0008 moveal %fp@(8),%a2 States_Control state, original_state; /* * Save original state */ original_state = the_thread->current_state; 476b0: 282a 0010 movel %a2@(16),%d4 void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 476b4: 242e 000c movel %fp@(12),%d2 /* * Set a transient state for the thread so it is pulled off the Ready chains. * This will prevent it from being scheduled no matter what happens in an * ISR. */ _Thread_Set_transient( the_thread ); 476b8: 2f0a movel %a2,%sp@- void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 476ba: 162e 0013 moveb %fp@(19),%d3 /* * 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 ); 476be: 4eb9 0004 8298 jsr 48298 <_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 ) 476c4: 588f addql #4,%sp 476c6: b4aa 0014 cmpl %a2@(20),%d2 476ca: 670c beqs 476d8 <_Thread_Change_priority+0x34> _Thread_Set_priority( the_thread, new_priority ); 476cc: 2f02 movel %d2,%sp@- 476ce: 2f0a movel %a2,%sp@- 476d0: 4eb9 0004 823c jsr 4823c <_Thread_Set_priority> 476d6: 508f addql #8,%sp _ISR_Disable( level ); 476d8: 203c 0000 0700 movel #1792,%d0 476de: 40c2 movew %sr,%d2 476e0: 8082 orl %d2,%d0 476e2: 46c0 movew %d0,%sr 476e4: 7204 moveq #4,%d1 /* * 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; 476e6: 202a 0010 movel %a2@(16),%d0 476ea: c284 andl %d4,%d1 if ( state != STATES_TRANSIENT ) { 476ec: 7804 moveq #4,%d4 476ee: b880 cmpl %d0,%d4 476f0: 672e beqs 47720 <_Thread_Change_priority+0x7c> /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) 476f2: 4a81 tstl %d1 476f4: 6608 bnes 476fe <_Thread_Change_priority+0x5a> <== NEVER TAKEN RTEMS_INLINE_ROUTINE States_Control _States_Clear ( States_Control states_to_clear, States_Control current_state ) { return (current_state & ~states_to_clear); 476f6: 72fb moveq #-5,%d1 476f8: c280 andl %d0,%d1 476fa: 2541 0010 movel %d1,%a2@(16) the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); _ISR_Enable( level ); 476fe: 46c2 movew %d2,%sr */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue ( States_Control the_states ) { return (the_states & STATES_WAITING_ON_THREAD_QUEUE); 47700: 0280 0003 bee0 andil #245472,%d0 if ( _States_Is_waiting_on_thread_queue( state ) ) { 47706: 676c beqs 47774 <_Thread_Change_priority+0xd0> _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); 47708: 2d4a 000c movel %a2,%fp@(12) 4770c: 2d6a 0044 0008 movel %a2@(68),%fp@(8) if ( !_Thread_Is_executing_also_the_heir() && _Thread_Executing->is_preemptible ) _Thread_Dispatch_necessary = true; _ISR_Enable( level ); } 47712: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 47718: 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 ); 4771a: 4ef9 0004 81a0 jmp 481a0 <_Thread_queue_Requeue> } return; } /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) { 47720: 4a81 tstl %d1 47722: 661e bnes 47742 <_Thread_Change_priority+0x9e> <== NEVER TAKEN * Interrupts are STILL disabled. * We now know the thread will be in the READY state when we remove * the TRANSIENT state. So we have to place it on the appropriate * Ready Queue with interrupts off. */ the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); 47724: 42aa 0010 clrl %a2@(16) if ( prepend_it ) 47728: 4a03 tstb %d3 4772a: 670a beqs 47736 <_Thread_Change_priority+0x92> */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue_first( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue_first( the_thread ); 4772c: 2f0a movel %a2,%sp@- 4772e: 2079 0005 d028 moveal 5d028 <_Scheduler+0x28>,%a0 47734: 6008 bras 4773e <_Thread_Change_priority+0x9a> */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue( the_thread ); 47736: 2079 0005 d024 moveal 5d024 <_Scheduler+0x24>,%a0 4773c: 2f0a movel %a2,%sp@- 4773e: 4e90 jsr %a0@ 47740: 588f addql #4,%sp _Scheduler_Enqueue_first( the_thread ); else _Scheduler_Enqueue( the_thread ); } _ISR_Flash( level ); 47742: 203c 0000 0700 movel #1792,%d0 47748: 46c2 movew %d2,%sr 4774a: 8082 orl %d2,%d0 4774c: 46c0 movew %d0,%sr * This kernel routine implements the scheduling decision logic for * the scheduler. It does NOT dispatch. */ RTEMS_INLINE_ROUTINE void _Scheduler_Schedule( void ) { _Scheduler.Operations.schedule(); 4774e: 2079 0005 d008 moveal 5d008 <_Scheduler+0x8>,%a0 47754: 4e90 jsr %a0@ * is also the heir thread, and false otherwise. */ RTEMS_INLINE_ROUTINE bool _Thread_Is_executing_also_the_heir( void ) { return ( _Thread_Executing == _Thread_Heir ); 47756: 2079 0005 ee32 moveal 5ee32 <_Per_CPU_Information+0xc>,%a0 * We altered the set of thread priorities. So let's figure out * who is the heir and if we need to switch to them. */ _Scheduler_Schedule(); if ( !_Thread_Is_executing_also_the_heir() && 4775c: b1f9 0005 ee36 cmpal 5ee36 <_Per_CPU_Information+0x10>,%a0 47762: 670e beqs 47772 <_Thread_Change_priority+0xce> 47764: 4a28 0074 tstb %a0@(116) 47768: 6708 beqs 47772 <_Thread_Change_priority+0xce> _Thread_Executing->is_preemptible ) _Thread_Dispatch_necessary = true; 4776a: 7801 moveq #1,%d4 4776c: 13c4 0005 ee3e moveb %d4,5ee3e <_Per_CPU_Information+0x18> _ISR_Enable( level ); 47772: 46c2 movew %d2,%sr } 47774: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 4777a: 4e5e unlk %fp ... =============================================================================== 00047948 <_Thread_Delay_ended>: void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { 47948: 4e56 fffc linkw %fp,#-4 Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 4794c: 486e fffc pea %fp@(-4) 47950: 2f2e 0008 movel %fp@(8),%sp@- 47954: 4eb9 0004 7ae8 jsr 47ae8 <_Thread_Get> switch ( location ) { 4795a: 508f addql #8,%sp 4795c: 4aae fffc tstl %fp@(-4) 47960: 661e bnes 47980 <_Thread_Delay_ended+0x38> <== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_Clear_state( 47962: 2f3c 1000 0018 movel #268435480,%sp@- 47968: 2f00 movel %d0,%sp@- 4796a: 4eb9 0004 7780 jsr 47780 <_Thread_Clear_state> 47970: 508f addql #8,%sp 47972: 2039 0005 e9c8 movel 5e9c8 <_Thread_Dispatch_disable_level>,%d0 47978: 5380 subql #1,%d0 4797a: 23c0 0005 e9c8 movel %d0,5e9c8 <_Thread_Dispatch_disable_level> | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Thread_Unnest_dispatch(); break; } } 47980: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00047984 <_Thread_Dispatch>: * dispatch thread * no dispatch thread */ void _Thread_Dispatch( void ) { 47984: 4e56 ffc8 linkw %fp,#-56 47988: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ Thread_Control *executing; Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); 4798c: 283c 0000 0700 movel #1792,%d4 47992: 2204 movel %d4,%d1 { Thread_Control *executing; Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; 47994: 2479 0005 ee32 moveal 5ee32 <_Per_CPU_Information+0xc>,%a2 _ISR_Disable( level ); 4799a: 40c0 movew %sr,%d0 4799c: 8280 orl %d0,%d1 4799e: 46c1 movew %d1,%sr _ISR_Enable( level ); #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 479a0: 260e movel %fp,%d3 _Timestamp_Subtract( 479a2: 240e movel %fp,%d2 _ISR_Enable( level ); #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 479a4: 5183 subql #8,%d3 _Timestamp_Subtract( 479a6: 0682 ffff fff0 addil #-16,%d2 &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); 479ac: 2e3c 0004 846c movel #296044,%d7 if ( _Thread_libc_reent ) { executing->libc_reent = *_Thread_libc_reent; *_Thread_libc_reent = heir->libc_reent; } _User_extensions_Thread_switch( executing, heir ); 479b2: 2c3c 0004 8720 movel #296736,%d6 if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 479b8: 2a3c 0004 8a44 movel #297540,%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 ); 479be: 4bf9 0004 8bac lea 48bac <_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 ); 479c4: 49f9 0004 8b8a lea 48b8a <_CPU_Context_save_fp>,%a4 Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Thread_Dispatch_necessary == true ) { 479ca: 6000 00d4 braw 47aa0 <_Thread_Dispatch+0x11c> heir = _Thread_Heir; _Thread_Dispatch_disable_level = 1; 479ce: 7201 moveq #1,%d1 479d0: 23c1 0005 e9c8 movel %d1,5e9c8 <_Thread_Dispatch_disable_level> ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Thread_Dispatch_necessary == true ) { heir = _Thread_Heir; 479d6: 2679 0005 ee36 moveal 5ee36 <_Per_CPU_Information+0x10>,%a3 _Thread_Dispatch_disable_level = 1; _Thread_Dispatch_necessary = false; 479dc: 4201 clrb %d1 _Thread_Executing = heir; 479de: 23cb 0005 ee32 movel %a3,5ee32 <_Per_CPU_Information+0xc> executing = _Thread_Executing; _ISR_Disable( level ); while ( _Thread_Dispatch_necessary == true ) { heir = _Thread_Heir; _Thread_Dispatch_disable_level = 1; _Thread_Dispatch_necessary = false; 479e4: 13c1 0005 ee3e moveb %d1,5ee3e <_Per_CPU_Information+0x18> /* * When the heir and executing are the same, then we are being * requested to do the post switch dispatching. This is normally * done to dispatch signals. */ if ( heir == executing ) 479ea: b5cb cmpal %a3,%a2 479ec: 6700 00bc beqw 47aaa <_Thread_Dispatch+0x126> */ #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 ) 479f0: 7201 moveq #1,%d1 479f2: b2ab 007a cmpl %a3@(122),%d1 479f6: 660a bnes 47a02 <_Thread_Dispatch+0x7e> heir->cpu_time_budget = _Thread_Ticks_per_timeslice; 479f8: 41f9 0005 e980 lea 5e980 <_Thread_Ticks_per_timeslice>,%a0 479fe: 2750 0076 movel %a0@,%a3@(118) _ISR_Enable( level ); 47a02: 46c0 movew %d0,%sr #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 47a04: 2f03 movel %d3,%sp@- 47a06: 4eb9 0004 ad48 jsr 4ad48 <_TOD_Get_uptime> _Timestamp_Subtract( 47a0c: 2f02 movel %d2,%sp@- 47a0e: 2f03 movel %d3,%sp@- 47a10: 4879 0005 ea74 pea 5ea74 <_Thread_Time_of_last_context_switch> 47a16: 4eb9 0004 84a4 jsr 484a4 <_Timespec_Subtract> &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); 47a1c: 2047 moveal %d7,%a0 47a1e: 2f02 movel %d2,%sp@- 47a20: 486a 0082 pea %a2@(130) 47a24: 4e90 jsr %a0@ #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 47a26: 2079 0005 ea4e moveal 5ea4e <_Thread_libc_reent>,%a0 47a2c: 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; 47a30: 202e fff8 movel %fp@(-8),%d0 47a34: 222e fffc movel %fp@(-4),%d1 47a38: 23c0 0005 ea74 movel %d0,5ea74 <_Thread_Time_of_last_context_switch> 47a3e: 23c1 0005 ea78 movel %d1,5ea78 <_Thread_Time_of_last_context_switch+0x4> #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 47a44: 4a88 tstl %a0 47a46: 6708 beqs 47a50 <_Thread_Dispatch+0xcc> <== NEVER TAKEN executing->libc_reent = *_Thread_libc_reent; 47a48: 2550 00fa movel %a0@,%a2@(250) *_Thread_libc_reent = heir->libc_reent; 47a4c: 20ab 00fa movel %a3@(250),%a0@ } _User_extensions_Thread_switch( executing, heir ); 47a50: 2f0b movel %a3,%sp@- 47a52: 2046 moveal %d6,%a0 47a54: 2f0a movel %a2,%sp@- 47a56: 4e90 jsr %a0@ if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 47a58: 486b 00c2 pea %a3@(194) 47a5c: 2045 moveal %d5,%a0 47a5e: 486a 00c2 pea %a2@(194) 47a62: 4e90 jsr %a0@ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && 47a64: 4fef 0010 lea %sp@(16),%sp 47a68: 4aaa 00f6 tstl %a2@(246) 47a6c: 6724 beqs 47a92 <_Thread_Dispatch+0x10e> #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 ); 47a6e: 2079 0005 ea4a moveal 5ea4a <_Thread_Allocated_fp>,%a0 47a74: b1ca cmpal %a2,%a0 47a76: 671a beqs 47a92 <_Thread_Dispatch+0x10e> !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) 47a78: 4a88 tstl %a0 47a7a: 6708 beqs 47a84 <_Thread_Dispatch+0x100> _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 47a7c: 4868 00f6 pea %a0@(246) 47a80: 4e94 jsr %a4@ 47a82: 588f addql #4,%sp _Context_Restore_fp( &executing->fp_context ); 47a84: 486a 00f6 pea %a2@(246) 47a88: 4e95 jsr %a5@ _Thread_Allocated_fp = executing; 47a8a: 588f addql #4,%sp 47a8c: 23ca 0005 ea4a movel %a2,5ea4a <_Thread_Allocated_fp> if ( executing->fp_context != NULL ) _Context_Restore_fp( &executing->fp_context ); #endif #endif executing = _Thread_Executing; 47a92: 2479 0005 ee32 moveal 5ee32 <_Per_CPU_Information+0xc>,%a2 _ISR_Disable( level ); 47a98: 2204 movel %d4,%d1 47a9a: 40c0 movew %sr,%d0 47a9c: 8280 orl %d0,%d1 47a9e: 46c1 movew %d1,%sr Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Thread_Dispatch_necessary == true ) { 47aa0: 1239 0005 ee3e moveb 5ee3e <_Per_CPU_Information+0x18>,%d1 47aa6: 6600 ff26 bnew 479ce <_Thread_Dispatch+0x4a> _ISR_Disable( level ); } post_switch: _Thread_Dispatch_disable_level = 0; 47aaa: 42b9 0005 e9c8 clrl 5e9c8 <_Thread_Dispatch_disable_level> _ISR_Enable( level ); 47ab0: 46c0 movew %d0,%sr _API_extensions_Run_postswitch(); 47ab2: 4eb9 0004 60e0 jsr 460e0 <_API_extensions_Run_postswitch> } 47ab8: 4cee 3cfc ffc8 moveml %fp@(-56),%d2-%d7/%a2-%a5 47abe: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004c8e8 <_Thread_Handler>: * * Output parameters: NONE */ void _Thread_Handler( void ) { 4c8e8: 4e56 0000 linkw %fp,#0 4c8ec: 2f0a movel %a2,%sp@- #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static char doneConstructors; char doneCons; #endif executing = _Thread_Executing; 4c8ee: 2479 0005 ee32 moveal 5ee32 <_Per_CPU_Information+0xc>,%a2 * * Output parameters: NONE */ void _Thread_Handler( void ) { 4c8f4: 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; 4c8f6: 222a 00a8 movel %a2@(168),%d1 _ISR_Set_level(level); 4c8fa: 40c0 movew %sr,%d0 4c8fc: e189 lsll #8,%d1 4c8fe: 0280 0000 f8ff andil #63743,%d0 4c904: 8081 orl %d1,%d0 4c906: 46c0 movew %d0,%sr #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) doneCons = doneConstructors; doneConstructors = 1; 4c908: 7001 moveq #1,%d0 level = executing->Start.isr_level; _ISR_Set_level(level); #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) doneCons = doneConstructors; 4c90a: 1439 0005 e188 moveb 5e188 ,%d2 doneConstructors = 1; 4c910: 13c0 0005 e188 moveb %d0,5e188 #endif #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && 4c916: 4aaa 00f6 tstl %a2@(246) 4c91a: 6720 beqs 4c93c <_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 ); 4c91c: 2079 0005 ea4a moveal 5ea4a <_Thread_Allocated_fp>,%a0 4c922: b1ca cmpal %a2,%a0 4c924: 6716 beqs 4c93c <_Thread_Handler+0x54> !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) 4c926: 4a88 tstl %a0 4c928: 670c beqs 4c936 <_Thread_Handler+0x4e> _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 4c92a: 4868 00f6 pea %a0@(246) 4c92e: 4eb9 0004 8b8a jsr 48b8a <_CPU_Context_save_fp> 4c934: 588f addql #4,%sp _Thread_Allocated_fp = executing; 4c936: 23ca 0005 ea4a movel %a2,5ea4a <_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 ); 4c93c: 2f0a movel %a2,%sp@- 4c93e: 4eb9 0004 859c jsr 4859c <_User_extensions_Thread_begin> /* * At this point, the dispatch disable level BETTER be 1. */ _Thread_Enable_dispatch(); 4c944: 4eb9 0004 7ac2 jsr 47ac2 <_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) */ { 4c94a: 588f addql #4,%sp 4c94c: 4a02 tstb %d2 4c94e: 6606 bnes 4c956 <_Thread_Handler+0x6e> INIT_NAME (); 4c950: 4eb9 0005 b294 jsr 5b294 <_init> } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 4c956: 202a 0092 movel %a2@(146),%d0 4c95a: 6606 bnes 4c962 <_Thread_Handler+0x7a> executing->Wait.return_argument = (*(Thread_Entry_numeric) executing->Start.entry_point)( 4c95c: 2f2a 009a movel %a2@(154),%sp@- 4c960: 600a bras 4c96c <_Thread_Handler+0x84> executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { 4c962: 7201 moveq #1,%d1 4c964: b280 cmpl %d0,%d1 4c966: 6610 bnes 4c978 <_Thread_Handler+0x90> <== NEVER TAKEN executing->Wait.return_argument = (*(Thread_Entry_pointer) executing->Start.entry_point)( 4c968: 2f2a 0096 movel %a2@(150),%sp@- 4c96c: 206a 008e moveal %a2@(142),%a0 4c970: 4e90 jsr %a0@ executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { executing->Wait.return_argument = 4c972: 588f addql #4,%sp 4c974: 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 ); 4c978: 2f0a movel %a2,%sp@- 4c97a: 4eb9 0004 85d4 jsr 485d4 <_User_extensions_Thread_exitted> _Internal_error_Occurred( 4c980: 4878 0005 pea 5 4c984: 4878 0001 pea 1 4c988: 42a7 clrl %sp@- 4c98a: 4eb9 0004 6a08 jsr 46a08 <_Internal_error_Occurred> =============================================================================== 000489f4 <_Thread_Restart>: */ RTEMS_INLINE_ROUTINE bool _States_Is_dormant ( States_Control the_states ) { return (the_states & STATES_DORMANT); 489f4: 7001 moveq #1,%d0 bool _Thread_Restart( Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { 489f6: 4e56 0000 linkw %fp,#0 489fa: 2f0a movel %a2,%sp@- 489fc: 246e 0008 moveal %fp@(8),%a2 48a00: c0aa 0010 andl %a2@(16),%d0 if ( !_States_Is_dormant( the_thread->current_state ) ) { 48a04: 6664 bnes 48a6a <_Thread_Restart+0x76> _Thread_Set_transient( the_thread ); 48a06: 2f0a movel %a2,%sp@- 48a08: 4eb9 0004 8ad4 jsr 48ad4 <_Thread_Set_transient> _Thread_Reset( the_thread, pointer_argument, numeric_argument ); 48a0e: 2f2e 0010 movel %fp@(16),%sp@- 48a12: 2f2e 000c movel %fp@(12),%sp@- 48a16: 2f0a movel %a2,%sp@- 48a18: 4eb9 0004 bc04 jsr 4bc04 <_Thread_Reset> _Thread_Load_environment( the_thread ); 48a1e: 2f0a movel %a2,%sp@- 48a20: 4eb9 0004 b93c jsr 4b93c <_Thread_Load_environment> _Thread_Ready( the_thread ); 48a26: 2f0a movel %a2,%sp@- 48a28: 4eb9 0004 bbd4 jsr 4bbd4 <_Thread_Ready> _User_extensions_Thread_restart( the_thread ); 48a2e: 2f0a movel %a2,%sp@- 48a30: 4eb9 0004 8f1c jsr 48f1c <_User_extensions_Thread_restart> if ( _Thread_Is_executing ( the_thread ) ) 48a36: 4fef 001c lea %sp@(28),%sp 48a3a: b5f9 0005 f95a cmpal 5f95a <_Per_CPU_Information+0xc>,%a2 48a40: 662c bnes 48a6e <_Thread_Restart+0x7a> */ RTEMS_INLINE_ROUTINE void _Thread_Restart_self( void ) { #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( _Thread_Executing->fp_context != NULL ) 48a42: 4aaa 00f6 tstl %a2@(246) 48a46: 670c beqs 48a54 <_Thread_Restart+0x60> _Context_Restore_fp( &_Thread_Executing->fp_context ); 48a48: 486a 00f6 pea %a2@(246) 48a4c: 4eb9 0004 9428 jsr 49428 <_CPU_Context_restore_fp> 48a52: 588f addql #4,%sp #endif _CPU_Context_Restart_self( &_Thread_Executing->Registers ); 48a54: 2079 0005 f95a moveal 5f95a <_Per_CPU_Information+0xc>,%a0 48a5a: 41e8 00c2 lea %a0@(194),%a0 48a5e: 2f08 movel %a0,%sp@- 48a60: 4eb9 0004 92d6 jsr 492d6 <_CPU_Context_Restart_self> 48a66: 588f addql #4,%sp <== NOT EXECUTED 48a68: 6004 bras 48a6e <_Thread_Restart+0x7a> <== NOT EXECUTED _Thread_Restart_self(); return true; } return false; 48a6a: 4200 clrb %d0 48a6c: 6002 bras 48a70 <_Thread_Restart+0x7c> _User_extensions_Thread_restart( the_thread ); if ( _Thread_Is_executing ( the_thread ) ) _Thread_Restart_self(); return true; 48a6e: 7001 moveq #1,%d0 } return false; } 48a70: 246e fffc moveal %fp@(-4),%a2 48a74: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000483f8 <_Thread_Tickle_timeslice>: * * Output parameters: NONE */ void _Thread_Tickle_timeslice( void ) { 483f8: 4e56 0000 linkw %fp,#0 483fc: 2f0a movel %a2,%sp@- Thread_Control *executing; executing = _Thread_Executing; 483fe: 2479 0005 ee32 moveal 5ee32 <_Per_CPU_Information+0xc>,%a2 /* * If the thread is not preemptible or is not ready, then * just return. */ if ( !executing->is_preemptible ) 48404: 4a2a 0074 tstb %a2@(116) 48408: 6758 beqs 48462 <_Thread_Tickle_timeslice+0x6a> return; if ( !_States_Is_ready( executing->current_state ) ) 4840a: 4aaa 0010 tstl %a2@(16) 4840e: 6652 bnes 48462 <_Thread_Tickle_timeslice+0x6a> /* * The cpu budget algorithm determines what happens next. */ switch ( executing->budget_algorithm ) { 48410: 202a 007a movel %a2@(122),%d0 48414: 7201 moveq #1,%d1 48416: b280 cmpl %d0,%d1 48418: 6248 bhis 48462 <_Thread_Tickle_timeslice+0x6a> 4841a: 123c 0002 moveb #2,%d1 4841e: b280 cmpl %d0,%d1 48420: 640a bccs 4842c <_Thread_Tickle_timeslice+0x34> 48422: 123c 0003 moveb #3,%d1 48426: b280 cmpl %d0,%d1 48428: 6638 bnes 48462 <_Thread_Tickle_timeslice+0x6a> <== NEVER TAKEN 4842a: 6020 bras 4844c <_Thread_Tickle_timeslice+0x54> 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 ) { 4842c: 202a 0076 movel %a2@(118),%d0 48430: 5380 subql #1,%d0 48432: 2540 0076 movel %d0,%a2@(118) 48436: 6e2a bgts 48462 <_Thread_Tickle_timeslice+0x6a> * always operates on the scheduler that 'owns' the currently executing * thread. */ RTEMS_INLINE_ROUTINE void _Scheduler_Yield( void ) { _Scheduler.Operations.yield(); 48438: 2079 0005 d00c moveal 5d00c <_Scheduler+0xc>,%a0 4843e: 4e90 jsr %a0@ * executing thread's timeslice is reset. Otherwise, the * currently executing thread is placed at the rear of the * FIFO for this priority and a new heir is selected. */ _Scheduler_Yield( ); executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 48440: 41f9 0005 e980 lea 5e980 <_Thread_Ticks_per_timeslice>,%a0 48446: 2550 0076 movel %a0@,%a2@(118) 4844a: 6016 bras 48462 <_Thread_Tickle_timeslice+0x6a> } break; #if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT) case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: if ( --executing->cpu_time_budget == 0 ) 4844c: 202a 0076 movel %a2@(118),%d0 48450: 5380 subql #1,%d0 48452: 2540 0076 movel %d0,%a2@(118) 48456: 660a bnes 48462 <_Thread_Tickle_timeslice+0x6a> (*executing->budget_callout)( executing ); 48458: 2f0a movel %a2,%sp@- 4845a: 206a 007e moveal %a2@(126),%a0 4845e: 4e90 jsr %a0@ 48460: 588f addql #4,%sp break; #endif } } 48462: 246e fffc moveal %fp@(-4),%a2 48466: 4e5e unlk %fp ... =============================================================================== 00047654 <_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 ) ) { 47654: 7202 moveq #2,%d1 Thread_blocking_operation_States sync_state __attribute__((unused)), #endif Thread_Control *the_thread, ISR_Level level ) { 47656: 4e56 0000 linkw %fp,#0 4765a: 202e 0010 movel %fp@(16),%d0 4765e: 2f0a movel %a2,%sp@- 47660: 246e 000c moveal %fp@(12),%a2 #endif /* * The thread is not waiting on anything after this completes. */ the_thread->Wait.queue = NULL; 47664: 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 ) ) { 47668: b2aa 0050 cmpl %a2@(80),%d1 4766c: 6618 bnes 47686 <_Thread_blocking_operation_Cancel+0x32> RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 4766e: 123c 0003 moveb #3,%d1 47672: 2541 0050 movel %d1,%a2@(80) _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 47676: 46c0 movew %d0,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 47678: 486a 0048 pea %a2@(72) 4767c: 4eb9 0004 8880 jsr 48880 <_Watchdog_Remove> 47682: 588f addql #4,%sp 47684: 6002 bras 47688 <_Thread_blocking_operation_Cancel+0x34> } else _ISR_Enable( level ); 47686: 46c0 movew %d0,%sr RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 47688: 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 } 4768c: 246e fffc moveal %fp@(-4),%a2 47690: 203c 1003 fff8 movel #268697592,%d0 47696: 2d40 000c movel %d0,%fp@(12) 4769a: 4e5e unlk %fp 4769c: 4ef9 0004 7780 jmp 47780 <_Thread_Clear_state> ... =============================================================================== 0004c990 <_Thread_queue_Extract_fifo>: Thread_Control *the_thread ) { ISR_Level level; _ISR_Disable( level ); 4c990: 223c 0000 0700 movel #1792,%d1 void _Thread_queue_Extract_fifo( Thread_queue_Control *the_thread_queue __attribute__((unused)), Thread_Control *the_thread ) { 4c996: 4e56 0000 linkw %fp,#0 4c99a: 2f0a movel %a2,%sp@- 4c99c: 246e 000c moveal %fp@(12),%a2 ISR_Level level; _ISR_Disable( level ); 4c9a0: 40c0 movew %sr,%d0 4c9a2: 8280 orl %d0,%d1 4c9a4: 46c1 movew %d1,%sr 4c9a6: 222a 0010 movel %a2@(16),%d1 4c9aa: 0281 0003 bee0 andil #245472,%d1 if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 4c9b0: 660a bnes 4c9bc <_Thread_queue_Extract_fifo+0x2c> _ISR_Enable( level ); 4c9b2: 46c0 movew %d0,%sr #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); #endif } 4c9b4: 246e fffc moveal %fp@(-4),%a2 4c9b8: 4e5e unlk %fp 4c9ba: 4e75 rts ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 4c9bc: 2252 moveal %a2@,%a1 _Chain_Extract_unprotected( &the_thread->Object.Node ); the_thread->Wait.queue = NULL; if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 4c9be: 7202 moveq #2,%d1 previous = the_node->previous; 4c9c0: 206a 0004 moveal %a2@(4),%a0 next->previous = previous; 4c9c4: 2348 0004 movel %a0,%a1@(4) previous->next = next; 4c9c8: 2089 movel %a1,%a0@ return; } _Chain_Extract_unprotected( &the_thread->Object.Node ); the_thread->Wait.queue = NULL; 4c9ca: 42aa 0044 clrl %a2@(68) if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 4c9ce: b2aa 0050 cmpl %a2@(80),%d1 4c9d2: 6704 beqs 4c9d8 <_Thread_queue_Extract_fifo+0x48> _ISR_Enable( level ); 4c9d4: 46c0 movew %d0,%sr 4c9d6: 6014 bras 4c9ec <_Thread_queue_Extract_fifo+0x5c> 4c9d8: 7203 moveq #3,%d1 4c9da: 2541 0050 movel %d1,%a2@(80) } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 4c9de: 46c0 movew %d0,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 4c9e0: 486a 0048 pea %a2@(72) 4c9e4: 4eb9 0004 8880 jsr 48880 <_Watchdog_Remove> 4c9ea: 588f addql #4,%sp RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 4c9ec: 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 } 4c9f0: 246e fffc moveal %fp@(-4),%a2 4c9f4: 203c 1003 fff8 movel #268697592,%d0 4c9fa: 2d40 000c movel %d0,%fp@(12) 4c9fe: 4e5e unlk %fp 4ca00: 4ef9 0004 7780 jmp 47780 <_Thread_Clear_state> ... =============================================================================== 0004b314 <_Thread_queue_Process_timeout>: #include void _Thread_queue_Process_timeout( Thread_Control *the_thread ) { 4b314: 4e56 0000 linkw %fp,#0 4b318: 226e 0008 moveal %fp@(8),%a1 Thread_queue_Control *the_thread_queue = the_thread->Wait.queue; 4b31c: 2069 0044 moveal %a1@(68),%a0 * 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 && 4b320: 2028 0030 movel %a0@(48),%d0 4b324: 671c beqs 4b342 <_Thread_queue_Process_timeout+0x2e> 4b326: b3f9 0005 ee32 cmpal 5ee32 <_Per_CPU_Information+0xc>,%a1 4b32c: 6614 bnes 4b342 <_Thread_queue_Process_timeout+0x2e><== NEVER TAKEN _Thread_Is_executing( the_thread ) ) { if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) { 4b32e: 7203 moveq #3,%d1 4b330: b280 cmpl %d0,%d1 4b332: 6720 beqs 4b354 <_Thread_queue_Process_timeout+0x40> the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 4b334: 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; 4b336: 2368 003c 0034 movel %a0@(60),%a1@(52) the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 4b33c: 2140 0030 movel %d0,%a0@(48) 4b340: 6012 bras 4b354 <_Thread_queue_Process_timeout+0x40> } } else { the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; 4b342: 2368 003c 0034 movel %a0@(60),%a1@(52) _Thread_queue_Extract( the_thread->Wait.queue, the_thread ); 4b348: 2f09 movel %a1,%sp@- 4b34a: 2f08 movel %a0,%sp@- 4b34c: 4eb9 0004 b210 jsr 4b210 <_Thread_queue_Extract> 4b352: 508f addql #8,%sp } } 4b354: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000481a0 <_Thread_queue_Requeue>: void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { 481a0: 4e56 fff0 linkw %fp,#-16 481a4: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 481a8: 246e 0008 moveal %fp@(8),%a2 481ac: 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 ) 481b0: 4a8a tstl %a2 481b2: 6746 beqs 481fa <_Thread_queue_Requeue+0x5a> <== NEVER TAKEN /* * If queueing by FIFO, there is nothing to do. This only applies to * priority blocking discipline. */ if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_PRIORITY ) { 481b4: 7001 moveq #1,%d0 481b6: b0aa 0034 cmpl %a2@(52),%d0 481ba: 663e bnes 481fa <_Thread_queue_Requeue+0x5a> <== NEVER TAKEN Thread_queue_Control *tq = the_thread_queue; ISR_Level level; ISR_Level level_ignored; _ISR_Disable( level ); 481bc: 303c 0700 movew #1792,%d0 481c0: 40c2 movew %sr,%d2 481c2: 8082 orl %d2,%d0 481c4: 46c0 movew %d0,%sr 481c6: 202b 0010 movel %a3@(16),%d0 481ca: 0280 0003 bee0 andil #245472,%d0 if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 481d0: 6726 beqs 481f8 <_Thread_queue_Requeue+0x58> <== NEVER TAKEN 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; 481d2: 7001 moveq #1,%d0 481d4: 2540 0030 movel %d0,%a2@(48) _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); 481d8: 4878 0001 pea 1 481dc: 2f0b movel %a3,%sp@- 481de: 2f0a movel %a2,%sp@- 481e0: 4eb9 0004 b248 jsr 4b248 <_Thread_queue_Extract_priority_helper> (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); 481e6: 486e fffc pea %fp@(-4) 481ea: 2f0b movel %a3,%sp@- 481ec: 2f0a movel %a2,%sp@- 481ee: 4eb9 0004 7f88 jsr 47f88 <_Thread_queue_Enqueue_priority> 481f4: 4fef 0018 lea %sp@(24),%sp } _ISR_Enable( level ); 481f8: 46c2 movew %d2,%sr } } 481fa: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3 48200: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00048204 <_Thread_queue_Timeout>: void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { 48204: 4e56 fffc linkw %fp,#-4 Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 48208: 486e fffc pea %fp@(-4) 4820c: 2f2e 0008 movel %fp@(8),%sp@- 48210: 4eb9 0004 7ae8 jsr 47ae8 <_Thread_Get> switch ( location ) { 48216: 508f addql #8,%sp 48218: 4aae fffc tstl %fp@(-4) 4821c: 6618 bnes 48236 <_Thread_queue_Timeout+0x32> <== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 4821e: 2f00 movel %d0,%sp@- 48220: 4eb9 0004 b314 jsr 4b314 <_Thread_queue_Process_timeout> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 48226: 588f addql #4,%sp 48228: 2039 0005 e9c8 movel 5e9c8 <_Thread_Dispatch_disable_level>,%d0 4822e: 5380 subql #1,%d0 48230: 23c0 0005 e9c8 movel %d0,5e9c8 <_Thread_Dispatch_disable_level> _Thread_Unnest_dispatch(); break; } } 48236: 4e5e unlk %fp ... =============================================================================== 00052292 <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 52292: 4e56 ffb4 linkw %fp,#-76 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 52296: 41ee ffec lea %fp@(-20),%a0 5229a: 200e movel %fp,%d0 5229c: 220e movel %fp,%d1 5229e: 5181 subql #8,%d1 522a0: 0680 ffff fff4 addil #-12,%d0 522a6: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 522aa: 246e 0008 moveal %fp@(8),%a2 522ae: 260e movel %fp,%d3 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_tail( const Chain_Control *the_chain ) { return &the_chain->Tail.Node; 522b0: 2808 movel %a0,%d4 static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 522b2: 2c0a movel %a2,%d6 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 522b4: 0683 ffff ffe8 addil #-24,%d3 522ba: 0686 0000 0040 addil #64,%d6 */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 522c0: 2a0a movel %a2,%d5 /* * 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 ); 522c2: 240a movel %a2,%d2 */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 522c4: 0685 0000 0030 addil #48,%d5 522ca: 47f9 0005 60a8 lea 560a8 <_Watchdog_Adjust_to_chain>,%a3 /* * 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 ); 522d0: 0682 0000 0068 addil #104,%d2 522d6: 4bf9 0005 6028 lea 56028 <_Watchdog_Adjust>,%a5 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_tail( const Chain_Control *the_chain ) { return &the_chain->Tail.Node; 522dc: 2e01 movel %d1,%d7 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 522de: 2d48 ffe8 movel %a0,%fp@(-24) static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 522e2: 41ea 0008 lea %a2@(8),%a0 522e6: 2d41 fff4 movel %d1,%fp@(-12) head->previous = NULL; 522ea: 42ae fff8 clrl %fp@(-8) tail->previous = head; 522ee: 2d40 fffc movel %d0,%fp@(-4) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; 522f2: 42ae ffec clrl %fp@(-20) tail->previous = head; 522f6: 2d43 fff0 movel %d3,%fp@(-16) 522fa: 2d48 ffe4 movel %a0,%fp@(-28) static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 522fe: 2d46 ffe0 movel %d6,%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; 52302: 41ee fff4 lea %fp@(-12),%a0 ) { 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 ); 52306: 49f9 0005 6138 lea 56138 <_Watchdog_Insert>,%a4 { /* * 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; 5230c: 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; 52310: 2039 0007 7626 movel 77626 <_Watchdog_Ticks_since_boot>,%d0 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 52316: 222a 003c movel %a2@(60),%d1 watchdogs->last_snapshot = snapshot; 5231a: 2540 003c movel %d0,%a2@(60) _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 5231e: 9081 subl %d1,%d0 52320: 2f03 movel %d3,%sp@- 52322: 2f00 movel %d0,%sp@- 52324: 2f05 movel %d5,%sp@- 52326: 4e93 jsr %a3@ static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 52328: 2039 0007 75a6 movel 775a6 <_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 ) { 5232e: 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; 52332: 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 ) { 52336: b280 cmpl %d0,%d1 52338: 6412 bccs 5234c <_Timer_server_Body+0xba> /* * 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 ); 5233a: 2f03 movel %d3,%sp@- 5233c: 2c00 movel %d0,%d6 5233e: 9c81 subl %d1,%d6 52340: 2f06 movel %d6,%sp@- 52342: 2d40 ffdc movel %d0,%fp@(-36) 52346: 2f02 movel %d2,%sp@- 52348: 4e93 jsr %a3@ 5234a: 6014 bras 52360 <_Timer_server_Body+0xce> } else if ( snapshot < last_snapshot ) { 5234c: b280 cmpl %d0,%d1 5234e: 6318 blss 52368 <_Timer_server_Body+0xd6> /* * 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 ); 52350: 9280 subl %d0,%d1 52352: 2f01 movel %d1,%sp@- 52354: 4878 0001 pea 1 52358: 2d40 ffdc movel %d0,%fp@(-36) 5235c: 2f02 movel %d2,%sp@- 5235e: 4e95 jsr %a5@ 52360: 202e ffdc movel %fp@(-36),%d0 52364: 4fef 000c lea %sp@(12),%sp } watchdogs->last_snapshot = snapshot; 52368: 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 ); 5236c: 202a 0078 movel %a2@(120),%d0 52370: 2f00 movel %d0,%sp@- 52372: 4eb9 0005 2d84 jsr 52d84 <_Chain_Get> if ( timer == NULL ) { 52378: 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 ); 5237a: 2040 moveal %d0,%a0 if ( timer == NULL ) { 5237c: 4a80 tstl %d0 5237e: 6724 beqs 523a4 <_Timer_server_Body+0x112> static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 52380: 2028 0038 movel %a0@(56),%d0 52384: 7201 moveq #1,%d1 52386: b280 cmpl %d0,%d1 52388: 6608 bnes 52392 <_Timer_server_Body+0x100> _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 5238a: 4868 0010 pea %a0@(16) 5238e: 2f05 movel %d5,%sp@- 52390: 600c bras 5239e <_Timer_server_Body+0x10c> } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 52392: 7c03 moveq #3,%d6 52394: bc80 cmpl %d0,%d6 52396: 66d4 bnes 5236c <_Timer_server_Body+0xda> <== NEVER TAKEN _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 52398: 4868 0010 pea %a0@(16) 5239c: 2f02 movel %d2,%sp@- 5239e: 4e94 jsr %a4@ 523a0: 508f addql #8,%sp 523a2: 60c8 bras 5236c <_Timer_server_Body+0xda> * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); 523a4: 203c 0000 0700 movel #1792,%d0 523aa: 40c1 movew %sr,%d1 523ac: 8081 orl %d1,%d0 523ae: 46c0 movew %d0,%sr if ( _Chain_Is_empty( insert_chain ) ) { 523b0: beae fff4 cmpl %fp@(-12),%d7 523b4: 6614 bnes 523ca <_Timer_server_Body+0x138> <== NEVER TAKEN ts->insert_chain = NULL; 523b6: 42aa 0078 clrl %a2@(120) _ISR_Enable( level ); 523ba: 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 ); 523bc: 2c3c 0000 0700 movel #1792,%d6 _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 ) ) { 523c2: b8ae ffe8 cmpl %fp@(-24),%d4 523c6: 6608 bnes 523d0 <_Timer_server_Body+0x13e> 523c8: 6042 bras 5240c <_Timer_server_Body+0x17a> ts->insert_chain = NULL; _ISR_Enable( level ); break; } else { _ISR_Enable( level ); 523ca: 46c1 movew %d1,%sr <== NOT EXECUTED 523cc: 6000 ff42 braw 52310 <_Timer_server_Body+0x7e> <== NOT EXECUTED /* * It is essential that interrupts are disable here since an interrupt * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); 523d0: 2006 movel %d6,%d0 523d2: 40c1 movew %sr,%d1 523d4: 8081 orl %d1,%d0 523d6: 46c0 movew %d0,%sr initialized = false; } #endif return status; } 523d8: 206e ffe8 moveal %fp@(-24),%a0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 523dc: b888 cmpl %a0,%d4 523de: 6726 beqs 52406 <_Timer_server_Body+0x174> Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; 523e0: 2250 moveal %a0@,%a1 head->next = new_first; 523e2: 2d49 ffe8 movel %a1,%fp@(-24) new_first->previous = head; 523e6: 2343 0004 movel %d3,%a1@(4) * It is essential that interrupts are disable here since an interrupt * service routine may remove a watchdog from the chain. */ _ISR_Disable( level ); watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { 523ea: 4a88 tstl %a0 523ec: 6718 beqs 52406 <_Timer_server_Body+0x174> <== NEVER TAKEN watchdog->state = WATCHDOG_INACTIVE; 523ee: 42a8 0008 clrl %a0@(8) _ISR_Enable( level ); 523f2: 46c1 movew %d1,%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 ); 523f4: 2f28 0024 movel %a0@(36),%sp@- 523f8: 2f28 0020 movel %a0@(32),%sp@- 523fc: 2068 001c moveal %a0@(28),%a0 52400: 4e90 jsr %a0@ } 52402: 508f addql #8,%sp 52404: 60ca bras 523d0 <_Timer_server_Body+0x13e> watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; _ISR_Enable( level ); } else { _ISR_Enable( level ); 52406: 46c1 movew %d1,%sr 52408: 6000 fef8 braw 52302 <_Timer_server_Body+0x70> static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 5240c: 49f9 0005 6260 lea 56260 <_Watchdog_Remove>,%a4 * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); } } else { ts->active = false; 52412: 4200 clrb %d0 52414: 1540 007c moveb %d0,%a2@(124) /* * Block until there is something to do. */ _Thread_Disable_dispatch(); 52418: 4eba fd9e jsr %pc@(521b8 <_Thread_Disable_dispatch>) _Thread_Set_state( ts->thread, STATES_DELAYING ); 5241c: 4878 0008 pea 8 52420: 2f12 movel %a2@,%sp@- 52422: 4eb9 0005 5a84 jsr 55a84 <_Thread_Set_state> _Timer_server_Reset_interval_system_watchdog( ts ); 52428: 2f0a movel %a2,%sp@- 5242a: 4eba fda2 jsr %pc@(521ce <_Timer_server_Reset_interval_system_watchdog>) _Timer_server_Reset_tod_system_watchdog( ts ); 5242e: 2f0a movel %a2,%sp@- 52430: 4eba fdfc jsr %pc@(5222e <_Timer_server_Reset_tod_system_watchdog>) _Thread_Enable_dispatch(); 52434: 4eb9 0005 526e jsr 5526e <_Thread_Enable_dispatch> ts->active = true; 5243a: 7201 moveq #1,%d1 5243c: 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 ); 52440: 2f2e ffe4 movel %fp@(-28),%sp@- 52444: 4e94 jsr %a4@ static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 52446: 2f2e ffe0 movel %fp@(-32),%sp@- 5244a: 4e94 jsr %a4@ 5244c: 4fef 0018 lea %sp@(24),%sp 52450: 6000 feb0 braw 52302 <_Timer_server_Body+0x70> =============================================================================== 00052454 <_Timer_server_Schedule_operation_method>: static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 52454: 4e56 fff0 linkw %fp,#-16 52458: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ 5245c: 246e 0008 moveal %fp@(8),%a2 52460: 266e 000c moveal %fp@(12),%a3 if ( ts->insert_chain == NULL ) { 52464: 202a 0078 movel %a2@(120),%d0 52468: 6600 00ea bnew 52554 <_Timer_server_Schedule_operation_method+0x100> * is the reference point for the delta chain. Thus if we do not update the * reference point we have to add DT to the initial delta of the watchdog * being inserted. This could result in an integer overflow. */ _Thread_Disable_dispatch(); 5246c: 4eba fd4a jsr %pc@(521b8 <_Thread_Disable_dispatch>) if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 52470: 202b 0038 movel %a3@(56),%d0 52474: 7201 moveq #1,%d1 52476: b280 cmpl %d0,%d1 52478: 665c bnes 524d6 <_Timer_server_Schedule_operation_method+0x82> /* * We have to advance the last known ticks value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 5247a: 203c 0000 0700 movel #1792,%d0 52480: 40c2 movew %sr,%d2 52482: 8082 orl %d2,%d0 52484: 46c0 movew %d0,%sr snapshot = _Watchdog_Ticks_since_boot; 52486: 2039 0007 7626 movel 77626 <_Watchdog_Ticks_since_boot>,%d0 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 5248c: 43ea 0034 lea %a2@(52),%a1 last_snapshot = ts->Interval_watchdogs.last_snapshot; 52490: 222a 003c movel %a2@(60),%d1 initialized = false; } #endif return status; } 52494: 206a 0030 moveal %a2@(48),%a0 * the watchdog chain accordingly. */ _ISR_Disable( level ); snapshot = _Watchdog_Ticks_since_boot; last_snapshot = ts->Interval_watchdogs.last_snapshot; if ( !_Chain_Is_empty( &ts->Interval_watchdogs.Chain ) ) { 52498: b3c8 cmpal %a0,%a1 5249a: 6716 beqs 524b2 <_Timer_server_Schedule_operation_method+0x5e> first_watchdog = _Watchdog_First( &ts->Interval_watchdogs.Chain ); /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; 5249c: 2240 moveal %d0,%a1 5249e: 93c1 subal %d1,%a1 delta_interval = first_watchdog->delta_interval; 524a0: 2228 0010 movel %a0@(16),%d1 if (delta_interval > delta) { 524a4: b3c1 cmpal %d1,%a1 524a6: 6404 bccs 524ac <_Timer_server_Schedule_operation_method+0x58> delta_interval -= delta; 524a8: 9289 subl %a1,%d1 524aa: 6002 bras 524ae <_Timer_server_Schedule_operation_method+0x5a> } else { delta_interval = 0; 524ac: 4281 clrl %d1 } first_watchdog->delta_interval = delta_interval; 524ae: 2141 0010 movel %d1,%a0@(16) } ts->Interval_watchdogs.last_snapshot = snapshot; 524b2: 2540 003c movel %d0,%a2@(60) _ISR_Enable( level ); 524b6: 46c2 movew %d2,%sr _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 524b8: 486b 0010 pea %a3@(16) 524bc: 486a 0030 pea %a2@(48) 524c0: 4eb9 0005 6138 jsr 56138 <_Watchdog_Insert> if ( !ts->active ) { 524c6: 508f addql #8,%sp 524c8: 102a 007c moveb %a2@(124),%d0 524cc: 6678 bnes 52546 <_Timer_server_Schedule_operation_method+0xf2> _Timer_server_Reset_interval_system_watchdog( ts ); 524ce: 2f0a movel %a2,%sp@- 524d0: 4eba fcfc jsr %pc@(521ce <_Timer_server_Reset_interval_system_watchdog>) 524d4: 606e bras 52544 <_Timer_server_Schedule_operation_method+0xf0> } } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 524d6: 7203 moveq #3,%d1 524d8: b280 cmpl %d0,%d1 524da: 666a bnes 52546 <_Timer_server_Schedule_operation_method+0xf2> /* * We have to advance the last known seconds value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 524dc: 203c 0000 0700 movel #1792,%d0 524e2: 40c2 movew %sr,%d2 524e4: 8082 orl %d2,%d0 524e6: 46c0 movew %d0,%sr 524e8: 200a movel %a2,%d0 524ea: 0680 0000 006c addil #108,%d0 snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 524f0: 2239 0007 75a6 movel 775a6 <_TOD_Now>,%d1 last_snapshot = ts->TOD_watchdogs.last_snapshot; 524f6: 226a 0074 moveal %a2@(116),%a1 initialized = false; } #endif return status; } 524fa: 206a 0068 moveal %a2@(104),%a0 * the watchdog chain accordingly. */ _ISR_Disable( level ); snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); last_snapshot = ts->TOD_watchdogs.last_snapshot; if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { 524fe: b088 cmpl %a0,%d0 52500: 6720 beqs 52522 <_Timer_server_Schedule_operation_method+0xce> first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; 52502: 2028 0010 movel %a0@(16),%d0 if ( snapshot > last_snapshot ) { 52506: b3c1 cmpal %d1,%a1 52508: 640c bccs 52516 <_Timer_server_Schedule_operation_method+0xc2> /* * We advanced in time. */ delta = snapshot - last_snapshot; 5250a: 2841 moveal %d1,%a4 5250c: 99c9 subal %a1,%a4 if (delta_interval > delta) { 5250e: b9c0 cmpal %d0,%a4 52510: 640a bccs 5251c <_Timer_server_Schedule_operation_method+0xc8><== NEVER TAKEN delta_interval -= delta; 52512: 908c subl %a4,%d0 52514: 6008 bras 5251e <_Timer_server_Schedule_operation_method+0xca> } } else { /* * Someone put us in the past. */ delta = last_snapshot - snapshot; 52516: d089 addl %a1,%d0 delta_interval += delta; 52518: 9081 subl %d1,%d0 5251a: 6002 bras 5251e <_Timer_server_Schedule_operation_method+0xca> */ delta = snapshot - last_snapshot; if (delta_interval > delta) { delta_interval -= delta; } else { delta_interval = 0; 5251c: 4280 clrl %d0 <== NOT EXECUTED * Someone put us in the past. */ delta = last_snapshot - snapshot; delta_interval += delta; } first_watchdog->delta_interval = delta_interval; 5251e: 2140 0010 movel %d0,%a0@(16) } ts->TOD_watchdogs.last_snapshot = snapshot; 52522: 2541 0074 movel %d1,%a2@(116) _ISR_Enable( level ); 52526: 46c2 movew %d2,%sr _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 52528: 486b 0010 pea %a3@(16) 5252c: 486a 0068 pea %a2@(104) 52530: 4eb9 0005 6138 jsr 56138 <_Watchdog_Insert> if ( !ts->active ) { 52536: 508f addql #8,%sp 52538: 102a 007c moveb %a2@(124),%d0 5253c: 6608 bnes 52546 <_Timer_server_Schedule_operation_method+0xf2> _Timer_server_Reset_tod_system_watchdog( ts ); 5253e: 2f0a movel %a2,%sp@- 52540: 4eba fcec jsr %pc@(5222e <_Timer_server_Reset_tod_system_watchdog>) 52544: 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 ); } } 52546: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 5254c: 4e5e unlk %fp if ( !ts->active ) { _Timer_server_Reset_tod_system_watchdog( ts ); } } _Thread_Enable_dispatch(); 5254e: 4ef9 0005 526e jmp 5526e <_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 ); 52554: 202a 0078 movel %a2@(120),%d0 52558: 2d4b 000c movel %a3,%fp@(12) } } 5255c: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 * 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 ); 52562: 2d40 0008 movel %d0,%fp@(8) } } 52566: 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 ); 52568: 4ef9 0005 2d24 jmp 52d24 <_Chain_Append> =============================================================================== 0004860e <_User_extensions_Fatal>: void _User_extensions_Fatal ( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 4860e: 4e56 fff0 linkw %fp,#-16 48612: 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 ); 48616: 4282 clrl %d2 48618: 142e 000f moveb %fp@(15),%d2 void _User_extensions_Fatal ( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 4861c: 282e 0008 movel %fp@(8),%d4 48620: 262e 0010 movel %fp@(16),%d3 the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.fatal != NULL ) (*the_extension->Callouts.fatal)( the_source, is_internal, the_error ); } } 48624: 2479 0005 eb20 moveal 5eb20 <_User_extensions_List+0x8>,%a2 ) { Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _Chain_Last( &_User_extensions_List ); 4862a: 6018 bras 48644 <_User_extensions_Fatal+0x36> !_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 ) 4862c: 206a 0030 moveal %a2@(48),%a0 48630: 4a88 tstl %a0 48632: 670c beqs 48640 <_User_extensions_Fatal+0x32> (*the_extension->Callouts.fatal)( the_source, is_internal, the_error ); 48634: 2f03 movel %d3,%sp@- 48636: 2f02 movel %d2,%sp@- 48638: 2f04 movel %d4,%sp@- 4863a: 4e90 jsr %a0@ 4863c: 4fef 000c lea %sp@(12),%sp <== NOT EXECUTED Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _Chain_Last( &_User_extensions_List ); !_Chain_Is_head( &_User_extensions_List, the_node ) ; the_node = the_node->previous ) { 48640: 246a 0004 moveal %a2@(4),%a2 ) { Chain_Node *the_node; User_extensions_Control *the_extension; for ( the_node = _Chain_Last( &_User_extensions_List ); 48644: b5fc 0005 eb18 cmpal #387864,%a2 4864a: 66e0 bnes 4862c <_User_extensions_Fatal+0x1e> <== ALWAYS TAKEN the_extension = (User_extensions_Control *) the_node; if ( the_extension->Callouts.fatal != NULL ) (*the_extension->Callouts.fatal)( the_source, is_internal, the_error ); } } 4864c: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 <== NOT EXECUTED 48652: 4e5e unlk %fp <== NOT EXECUTED ... =============================================================================== 000484e8 <_User_extensions_Handler_initialization>: #include #include #include void _User_extensions_Handler_initialization(void) { 484e8: 4e56 ffe8 linkw %fp,#-24 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 484ec: 203c 0005 eb1c movel #387868,%d0 484f2: 23c0 0005 eb18 movel %d0,5eb18 <_User_extensions_List> head->previous = NULL; tail->previous = head; 484f8: 203c 0005 eb18 movel #387864,%d0 484fe: 23c0 0005 eb20 movel %d0,5eb20 <_User_extensions_List+0x8> ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 48504: 203c 0005 e9d0 movel #387536,%d0 4850a: 23c0 0005 e9cc movel %d0,5e9cc <_User_extensions_Switches_list> head->previous = NULL; tail->previous = head; 48510: 203c 0005 e9cc movel #387532,%d0 { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; 48516: 42b9 0005 eb1c clrl 5eb1c <_User_extensions_List+0x4> 4851c: 48d7 1c1c moveml %d2-%d4/%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; 48520: 2839 0005 d10a movel 5d10a ,%d4 initial_extensions = Configuration.User_extension_table; 48526: 2639 0005 d10e movel 5d10e ,%d3 4852c: 42b9 0005 e9d0 clrl 5e9d0 <_User_extensions_Switches_list+0x4> tail->previous = head; 48532: 23c0 0005 e9d4 movel %d0,5e9d4 <_User_extensions_Switches_list+0x8> _Chain_Initialize_empty( &_User_extensions_List ); _Chain_Initialize_empty( &_User_extensions_Switches_list ); if ( initial_extensions ) { 48538: 4a83 tstl %d3 4853a: 6754 beqs 48590 <_User_extensions_Handler_initialization+0xa8><== NEVER TAKEN extension = (User_extensions_Control *) _Workspace_Allocate_or_fatal_error( 4853c: 7434 moveq #52,%d2 4853e: 4c04 2800 mulsl %d4,%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; 48542: 49f9 0004 d37c lea 4d37c ,%a4 _User_extensions_Add_set( extension ); 48548: 47f9 0004 b3d8 lea 4b3d8 <_User_extensions_Add_set>,%a3 4854e: 2f02 movel %d2,%sp@- 48550: 4eb9 0004 8a0e jsr 48a0e <_Workspace_Allocate_or_fatal_error> 48556: 2440 moveal %d0,%a2 number_of_extensions * sizeof( User_extensions_Control ) ); memset ( 48558: 2f02 movel %d2,%sp@- extension, 0, number_of_extensions * sizeof( User_extensions_Control ) ); for ( i = 0 ; i < number_of_extensions ; i++ ) { 4855a: 4282 clrl %d2 extension = (User_extensions_Control *) _Workspace_Allocate_or_fatal_error( number_of_extensions * sizeof( User_extensions_Control ) ); memset ( 4855c: 42a7 clrl %sp@- 4855e: 2f00 movel %d0,%sp@- 48560: 4eb9 0004 d3ec jsr 4d3ec extension, 0, number_of_extensions * sizeof( User_extensions_Control ) ); for ( i = 0 ; i < number_of_extensions ; i++ ) { 48566: 4fef 0010 lea %sp@(16),%sp 4856a: 6020 bras 4858c <_User_extensions_Handler_initialization+0xa4> RTEMS_INLINE_ROUTINE void _User_extensions_Add_set_with_table( User_extensions_Control *extension, const User_extensions_Table *extension_table ) { extension->Callouts = *extension_table; 4856c: 4878 0020 pea 20 48570: 5282 addql #1,%d2 48572: 2f03 movel %d3,%sp@- 48574: 486a 0014 pea %a2@(20) 48578: 0683 0000 0020 addil #32,%d3 4857e: 4e94 jsr %a4@ _User_extensions_Add_set( extension ); 48580: 2f0a movel %a2,%sp@- _User_extensions_Add_set_with_table (extension, &initial_extensions[i]); extension++; 48582: 45ea 0034 lea %a2@(52),%a2 48586: 4e93 jsr %a3@ extension, 0, number_of_extensions * sizeof( User_extensions_Control ) ); for ( i = 0 ; i < number_of_extensions ; i++ ) { 48588: 4fef 0010 lea %sp@(16),%sp 4858c: b882 cmpl %d2,%d4 4858e: 62dc bhis 4856c <_User_extensions_Handler_initialization+0x84> _User_extensions_Add_set_with_table (extension, &initial_extensions[i]); extension++; } } } 48590: 4cee 1c1c ffe8 moveml %fp@(-24),%d2-%d4/%a2-%a4 48596: 4e5e unlk %fp ... =============================================================================== 00049c38 <_Watchdog_Adjust>: Watchdog_Interval units ) { ISR_Level level; _ISR_Disable( level ); 49c38: 327c 0700 moveaw #1792,%a1 49c3c: 2209 movel %a1,%d1 void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 49c3e: 4e56 ffe8 linkw %fp,#-24 49c42: 48d7 1c1c moveml %d2-%d4/%a2-%a4,%sp@ 49c46: 266e 0008 moveal %fp@(8),%a3 49c4a: 262e 000c movel %fp@(12),%d3 49c4e: 242e 0010 movel %fp@(16),%d2 ISR_Level level; _ISR_Disable( level ); 49c52: 40c0 movew %sr,%d0 49c54: 8280 orl %d0,%d1 49c56: 46c1 movew %d1,%sr } } _ISR_Enable( level ); } 49c58: 244b moveal %a3,%a2 49c5a: 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 ) ) { 49c5c: b5c8 cmpal %a0,%a2 49c5e: 674c beqs 49cac <_Watchdog_Adjust+0x74> switch ( direction ) { 49c60: 4a83 tstl %d3 49c62: 673c beqs 49ca0 <_Watchdog_Adjust+0x68> 49c64: 7201 moveq #1,%d1 49c66: b283 cmpl %d3,%d1 49c68: 6642 bnes 49cac <_Watchdog_Adjust+0x74> <== NEVER TAKEN case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; 49c6a: d5a8 0010 addl %d2,%a0@(16) break; 49c6e: 603c bras 49cac <_Watchdog_Adjust+0x74> RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First( Chain_Control *header ) { return ( (Watchdog_Control *) _Chain_First( header ) ); 49c70: 2053 moveal %a3@,%a0 case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { 49c72: 2628 0010 movel %a0@(16),%d3 49c76: b682 cmpl %d2,%d3 49c78: 6308 blss 49c82 <_Watchdog_Adjust+0x4a> _Watchdog_First( header )->delta_interval -= units; 49c7a: 9682 subl %d2,%d3 49c7c: 2143 0010 movel %d3,%a0@(16) break; 49c80: 602a bras 49cac <_Watchdog_Adjust+0x74> } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; 49c82: 7201 moveq #1,%d1 49c84: 2141 0010 movel %d1,%a0@(16) _ISR_Enable( level ); 49c88: 46c0 movew %d0,%sr _Watchdog_Tickle( header ); 49c8a: 2f0b movel %a3,%sp@- 49c8c: 4e94 jsr %a4@ _ISR_Disable( level ); 49c8e: 2204 movel %d4,%d1 49c90: 40c0 movew %sr,%d0 49c92: 8280 orl %d0,%d1 49c94: 46c1 movew %d1,%sr if ( _Chain_Is_empty( header ) ) 49c96: 588f addql #4,%sp 49c98: b5d3 cmpal %a3@,%a2 49c9a: 6710 beqs 49cac <_Watchdog_Adjust+0x74> while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; 49c9c: 9483 subl %d3,%d2 49c9e: 6008 bras 49ca8 <_Watchdog_Adjust+0x70> _Watchdog_First( header )->delta_interval = 1; _ISR_Enable( level ); _Watchdog_Tickle( header ); 49ca0: 49f9 0004 9e5c lea 49e5c <_Watchdog_Tickle>,%a4 _ISR_Disable( level ); 49ca6: 2809 movel %a1,%d4 switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 49ca8: 4a82 tstl %d2 49caa: 66c4 bnes 49c70 <_Watchdog_Adjust+0x38> <== ALWAYS TAKEN } break; } } _ISR_Enable( level ); 49cac: 46c0 movew %d0,%sr } 49cae: 4cee 1c1c ffe8 moveml %fp@(-24),%d2-%d4/%a2-%a4 49cb4: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00048880 <_Watchdog_Remove>: { ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 48880: 203c 0000 0700 movel #1792,%d0 */ Watchdog_States _Watchdog_Remove( Watchdog_Control *the_watchdog ) { 48886: 4e56 0000 linkw %fp,#0 4888a: 206e 0008 moveal %fp@(8),%a0 4888e: 2f0a movel %a2,%sp@- 48890: 2f02 movel %d2,%sp@- ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 48892: 40c1 movew %sr,%d1 48894: 8081 orl %d1,%d0 48896: 46c0 movew %d0,%sr previous_state = the_watchdog->state; 48898: 2028 0008 movel %a0@(8),%d0 switch ( previous_state ) { 4889c: 7401 moveq #1,%d2 4889e: b480 cmpl %d0,%d2 488a0: 670c beqs 488ae <_Watchdog_Remove+0x2e> 488a2: 6242 bhis 488e6 <_Watchdog_Remove+0x66> 488a4: 143c 0003 moveb #3,%d2 488a8: b480 cmpl %d0,%d2 488aa: 653a bcss 488e6 <_Watchdog_Remove+0x66> <== NEVER TAKEN 488ac: 6006 bras 488b4 <_Watchdog_Remove+0x34> /* * It is not actually on the chain so just change the state and * the Insert operation we interrupted will be aborted. */ the_watchdog->state = WATCHDOG_INACTIVE; 488ae: 42a8 0008 clrl %a0@(8) break; 488b2: 6032 bras 488e6 <_Watchdog_Remove+0x66> } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; _ISR_Enable( level ); return( previous_state ); } 488b4: 2250 moveal %a0@,%a1 break; case WATCHDOG_ACTIVE: case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; 488b6: 42a8 0008 clrl %a0@(8) next_watchdog = _Watchdog_Next( the_watchdog ); if ( _Watchdog_Next(next_watchdog) ) 488ba: 4a91 tstl %a1@ 488bc: 6708 beqs 488c6 <_Watchdog_Remove+0x46> next_watchdog->delta_interval += the_watchdog->delta_interval; 488be: 2428 0010 movel %a0@(16),%d2 488c2: d5a9 0010 addl %d2,%a1@(16) if ( _Watchdog_Sync_count ) 488c6: 2479 0005 eace moveal 5eace <_Watchdog_Sync_count>,%a2 488cc: 4a8a tstl %a2 488ce: 670c beqs 488dc <_Watchdog_Remove+0x5c> _Watchdog_Sync_level = _ISR_Nest_level; 488d0: 45f9 0005 ee2e lea 5ee2e <_Per_CPU_Information+0x8>,%a2 488d6: 23d2 0005 ea6c movel %a2@,5ea6c <_Watchdog_Sync_level> { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 488dc: 2468 0004 moveal %a0@(4),%a2 next->previous = previous; 488e0: 234a 0004 movel %a2,%a1@(4) previous->next = next; 488e4: 2489 movel %a1,%a2@ _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 488e6: 2279 0005 ead2 moveal 5ead2 <_Watchdog_Ticks_since_boot>,%a1 488ec: 2149 0018 movel %a1,%a0@(24) _ISR_Enable( level ); 488f0: 46c1 movew %d1,%sr return( previous_state ); } 488f2: 241f movel %sp@+,%d2 488f4: 245f moveal %sp@+,%a2 488f6: 4e5e unlk %fp ... =============================================================================== 00049830 <_Watchdog_Report_chain>: ) { ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 49830: 203c 0000 0700 movel #1792,%d0 void _Watchdog_Report_chain( const char *name, Chain_Control *header ) { 49836: 4e56 ffec linkw %fp,#-20 4983a: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@ 4983e: 242e 0008 movel %fp@(8),%d2 49842: 266e 000c moveal %fp@(12),%a3 ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 49846: 40c3 movew %sr,%d3 49848: 8083 orl %d3,%d0 4984a: 46c0 movew %d0,%sr printk( "Watchdog Chain: %s %p\n", name, header ); 4984c: 2f0b movel %a3,%sp@- 4984e: 49f9 0004 404c lea 4404c ,%a4 49854: 2f02 movel %d2,%sp@- 49856: 4879 0005 dd1a pea 5dd1a <_Status_Object_name_errors_to_status+0x14> 4985c: 4e94 jsr %a4@ printk( "== end of %s \n", name ); } else { printk( "Chain is empty\n" ); } _ISR_Enable( level ); } 4985e: 245b moveal %a3@+,%a2 ISR_Level level; Chain_Node *node; _ISR_Disable( level ); printk( "Watchdog Chain: %s %p\n", name, header ); if ( !_Chain_Is_empty( header ) ) { 49860: 4fef 000c lea %sp@(12),%sp 49864: b7ca cmpal %a2,%a3 49866: 6726 beqs 4988e <_Watchdog_Report_chain+0x5e> node != _Chain_Tail(header) ; node = node->next ) { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); 49868: 49f9 0004 98a4 lea 498a4 <_Watchdog_Report>,%a4 4986e: 2f0a movel %a2,%sp@- 49870: 42a7 clrl %sp@- 49872: 4e94 jsr %a4@ _ISR_Disable( level ); printk( "Watchdog Chain: %s %p\n", name, header ); if ( !_Chain_Is_empty( header ) ) { for ( node = _Chain_First( header ) ; node != _Chain_Tail(header) ; node = node->next ) 49874: 2452 moveal %a2@,%a2 Chain_Node *node; _ISR_Disable( level ); printk( "Watchdog Chain: %s %p\n", name, header ); if ( !_Chain_Is_empty( header ) ) { for ( node = _Chain_First( header ) ; 49876: 508f addql #8,%sp 49878: b7ca cmpal %a2,%a3 4987a: 66f2 bnes 4986e <_Watchdog_Report_chain+0x3e> <== NEVER TAKEN { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); 4987c: 2f02 movel %d2,%sp@- 4987e: 4879 0005 dd31 pea 5dd31 <_Status_Object_name_errors_to_status+0x2b> 49884: 4eb9 0004 404c jsr 4404c 4988a: 508f addql #8,%sp 4988c: 600a bras 49898 <_Watchdog_Report_chain+0x68> } else { printk( "Chain is empty\n" ); 4988e: 4879 0005 dd40 pea 5dd40 <_Status_Object_name_errors_to_status+0x3a> 49894: 4e94 jsr %a4@ 49896: 588f addql #4,%sp } _ISR_Enable( level ); 49898: 46c3 movew %d3,%sr } 4989a: 4cee 1c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a4 498a0: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000488fc <_Watchdog_Tickle>: * See the comment in watchdoginsert.c and watchdogadjust.c * about why it's safe not to declare header a pointer to * volatile data - till, 2003/7 */ _ISR_Disable( level ); 488fc: 203c 0000 0700 movel #1792,%d0 */ void _Watchdog_Tickle( Chain_Control *header ) { 48902: 4e56 ffe8 linkw %fp,#-24 48906: 48d7 3c0c moveml %d2-%d3/%a2-%a5,%sp@ 4890a: 286e 0008 moveal %fp@(8),%a4 * See the comment in watchdoginsert.c and watchdogadjust.c * about why it's safe not to declare header a pointer to * volatile data - till, 2003/7 */ _ISR_Disable( level ); 4890e: 40c2 movew %sr,%d2 48910: 8082 orl %d2,%d0 48912: 46c0 movew %d0,%sr } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); } 48914: 264c moveal %a4,%a3 48916: 245b moveal %a3@+,%a2 * volatile data - till, 2003/7 */ _ISR_Disable( level ); if ( _Chain_Is_empty( header ) ) 48918: b7ca cmpal %a2,%a3 4891a: 674c beqs 48968 <_Watchdog_Tickle+0x6c> * to be inserted has already had its delta_interval adjusted to 0, and * so is added to the head of the chain with a delta_interval of 0. * * Steven Johnson - 12/2005 (gcc-3.2.3 -O3 on powerpc) */ if (the_watchdog->delta_interval != 0) { 4891c: 202a 0010 movel %a2@(16),%d0 48920: 6708 beqs 4892a <_Watchdog_Tickle+0x2e> the_watchdog->delta_interval--; 48922: 5380 subql #1,%d0 48924: 2540 0010 movel %d0,%a2@(16) if ( the_watchdog->delta_interval != 0 ) 48928: 663e bnes 48968 <_Watchdog_Tickle+0x6c> goto leave; } do { watchdog_state = _Watchdog_Remove( the_watchdog ); 4892a: 4bf9 0004 8880 lea 48880 <_Watchdog_Remove>,%a5 case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 48930: 263c 0000 0700 movel #1792,%d3 if ( the_watchdog->delta_interval != 0 ) goto leave; } do { watchdog_state = _Watchdog_Remove( the_watchdog ); 48936: 2f0a movel %a2,%sp@- 48938: 4e95 jsr %a5@ _ISR_Enable( level ); 4893a: 46c2 movew %d2,%sr switch( watchdog_state ) { 4893c: 7202 moveq #2,%d1 4893e: 588f addql #4,%sp 48940: b280 cmpl %d0,%d1 48942: 6610 bnes 48954 <_Watchdog_Tickle+0x58> <== NEVER TAKEN case WATCHDOG_ACTIVE: (*the_watchdog->routine)( 48944: 2f2a 0024 movel %a2@(36),%sp@- 48948: 2f2a 0020 movel %a2@(32),%sp@- 4894c: 206a 001c moveal %a2@(28),%a0 48950: 4e90 jsr %a0@ the_watchdog->id, the_watchdog->user_data ); break; 48952: 508f addql #8,%sp case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 48954: 2003 movel %d3,%d0 48956: 40c2 movew %sr,%d2 48958: 8082 orl %d2,%d0 4895a: 46c0 movew %d0,%sr } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); } 4895c: 2454 moveal %a4@,%a2 _ISR_Disable( level ); the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); 4895e: b7ca cmpal %a2,%a3 48960: 6706 beqs 48968 <_Watchdog_Tickle+0x6c> } _ISR_Disable( level ); the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && 48962: 4aaa 0010 tstl %a2@(16) 48966: 67ce beqs 48936 <_Watchdog_Tickle+0x3a> (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); 48968: 46c2 movew %d2,%sr } 4896a: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 48970: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00045f94 : * operation(s) cannot be canceled */ int aio_cancel(int fildes, struct aiocb *aiocbp) { 45f94: 4e56 ffe8 linkw %fp,#-24 45f98: 48d7 3c0c moveml %d2-%d3/%a2-%a5,%sp@ rtems_aio_request_chain *r_chain; int result; pthread_mutex_lock (&aio_request_queue.mutex); 45f9c: 4879 0006 1378 pea 61378 45fa2: 49f9 0004 7078 lea 47078 ,%a4 * operation(s) cannot be canceled */ int aio_cancel(int fildes, struct aiocb *aiocbp) { 45fa8: 242e 0008 movel %fp@(8),%d2 45fac: 266e 000c moveal %fp@(12),%a3 rtems_aio_request_chain *r_chain; int result; pthread_mutex_lock (&aio_request_queue.mutex); 45fb0: 4e94 jsr %a4@ if (fcntl (fildes, F_GETFD) < 0) { 45fb2: 4878 0001 pea 1 45fb6: 2f02 movel %d2,%sp@- 45fb8: 4eb9 0004 c2b0 jsr 4c2b0 45fbe: 4fef 000c lea %sp@(12),%sp 45fc2: 4a80 tstl %d0 45fc4: 6c1c bges 45fe2 pthread_mutex_unlock(&aio_request_queue.mutex); 45fc6: 4879 0006 1378 pea 61378 45fcc: 4eb9 0004 7110 jsr 47110 rtems_set_errno_and_return_minus_one (EBADF); 45fd2: 4eb9 0004 f150 jsr 4f150 <__errno> 45fd8: 7209 moveq #9,%d1 45fda: 2040 moveal %d0,%a0 45fdc: 2081 movel %d1,%a0@ 45fde: 6000 00f4 braw 460d4 } /* if aiocbp is NULL remove all request for given file descriptor */ if (aiocbp == NULL) { 45fe2: 4a8b tstl %a3 45fe4: 6600 00d0 bnew 460b6 AIO_printf ("Cancel all requests\n"); r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0); 45fe8: 42a7 clrl %sp@- 45fea: 47f9 0004 634a lea 4634a ,%a3 45ff0: 2f02 movel %d2,%sp@- 45ff2: 4879 0006 13c0 pea 613c0 45ff8: 4e93 jsr %a3@ if (r_chain == NULL) { 45ffa: 4fef 000c lea %sp@(12),%sp /* if aiocbp is NULL remove all request for given file descriptor */ if (aiocbp == NULL) { AIO_printf ("Cancel all requests\n"); r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0); 45ffe: 2440 moveal %d0,%a2 if (r_chain == NULL) { 46000: 4a80 tstl %d0 46002: 667a bnes 4607e AIO_printf ("Request chain not on [WQ]\n"); if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) { 46004: 203c 0006 13d0 movel #398288,%d0 4600a: b0b9 0006 13cc cmpl 613cc ,%d0 46010: 6700 0136 beqw 46148 r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0); 46014: 42a7 clrl %sp@- 46016: 45f9 0004 7110 lea 47110 ,%a2 4601c: 2f02 movel %d2,%sp@- 4601e: 4879 0006 13cc pea 613cc 46024: 4e93 jsr %a3@ if (r_chain == NULL) { 46026: 4fef 000c lea %sp@(12),%sp r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0); if (r_chain == NULL) { AIO_printf ("Request chain not on [WQ]\n"); if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) { r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0); 4602a: 2400 movel %d0,%d2 if (r_chain == NULL) { 4602c: 6612 bnes 46040 pthread_mutex_unlock(&aio_request_queue.mutex); 4602e: 4879 0006 1378 pea 61378 return AIO_ALLDONE; 46034: 143c 0002 moveb #2,%d2 AIO_printf ("Request chain not on [WQ]\n"); if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) { r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0); if (r_chain == NULL) { pthread_mutex_unlock(&aio_request_queue.mutex); 46038: 4e92 jsr %a2@ return AIO_ALLDONE; 4603a: 588f addql #4,%sp 4603c: 6000 014c braw 4618a */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 46040: 2f00 movel %d0,%sp@- AIO_printf ("Request chain on [IQ]\n"); rtems_chain_extract (&r_chain->next_fd); rtems_aio_remove_fd (r_chain); pthread_mutex_destroy (&r_chain->mutex); 46042: 2602 movel %d2,%d3 46044: 0683 0000 001c addil #28,%d3 4604a: 4eb9 0004 88b8 jsr 488b8 <_Chain_Extract> } AIO_printf ("Request chain on [IQ]\n"); rtems_chain_extract (&r_chain->next_fd); rtems_aio_remove_fd (r_chain); 46050: 2f02 movel %d2,%sp@- 46052: 4eb9 0004 669e jsr 4669e pthread_mutex_destroy (&r_chain->mutex); 46058: 2f03 movel %d3,%sp@- 4605a: 4eb9 0004 6e40 jsr 46e40 pthread_cond_destroy (&r_chain->mutex); 46060: 2f03 movel %d3,%sp@- 46062: 4eb9 0004 6b3c jsr 46b3c free (r_chain); 46068: 2f02 movel %d2,%sp@- 4606a: 4eb9 0004 3434 jsr 43434 pthread_mutex_unlock (&aio_request_queue.mutex); 46070: 4879 0006 1378 pea 61378 46076: 4e92 jsr %a2@ return AIO_CANCELED; 46078: 4fef 0018 lea %sp@(24),%sp 4607c: 6032 bras 460b0 return AIO_ALLDONE; } AIO_printf ("Request chain on [WQ]\n"); pthread_mutex_lock (&r_chain->mutex); 4607e: 2400 movel %d0,%d2 46080: 0682 0000 001c addil #28,%d2 46086: 2f02 movel %d2,%sp@- 46088: 4e94 jsr %a4@ 4608a: 2f0a movel %a2,%sp@- 4608c: 4eb9 0004 88b8 jsr 488b8 <_Chain_Extract> rtems_chain_extract (&r_chain->next_fd); rtems_aio_remove_fd (r_chain); 46092: 2f0a movel %a2,%sp@- pthread_mutex_unlock (&r_chain->mutex); 46094: 45f9 0004 7110 lea 47110 ,%a2 AIO_printf ("Request chain on [WQ]\n"); pthread_mutex_lock (&r_chain->mutex); rtems_chain_extract (&r_chain->next_fd); rtems_aio_remove_fd (r_chain); 4609a: 4eb9 0004 669e jsr 4669e pthread_mutex_unlock (&r_chain->mutex); 460a0: 2f02 movel %d2,%sp@- 460a2: 4e92 jsr %a2@ pthread_mutex_unlock (&aio_request_queue.mutex); 460a4: 4879 0006 1378 pea 61378 460aa: 4e92 jsr %a2@ return AIO_CANCELED; 460ac: 4fef 0014 lea %sp@(20),%sp 460b0: 4282 clrl %d2 460b2: 6000 00d6 braw 4618a } else { AIO_printf ("Cancel request\n"); if (aiocbp->aio_fildes != fildes) { 460b6: 2613 movel %a3@,%d3 460b8: b483 cmpl %d3,%d2 460ba: 6720 beqs 460dc pthread_mutex_unlock (&aio_request_queue.mutex); 460bc: 4879 0006 1378 pea 61378 460c2: 4eb9 0004 7110 jsr 47110 rtems_set_errno_and_return_minus_one (EINVAL); 460c8: 4eb9 0004 f150 jsr 4f150 <__errno> 460ce: 2040 moveal %d0,%a0 460d0: 7016 moveq #22,%d0 460d2: 2080 movel %d0,%a0@ 460d4: 588f addql #4,%sp 460d6: 74ff moveq #-1,%d2 460d8: 6000 00b0 braw 4618a } r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0); 460dc: 42a7 clrl %sp@- 460de: 4bf9 0004 634a lea 4634a ,%a5 460e4: 2f03 movel %d3,%sp@- 460e6: 4879 0006 13c0 pea 613c0 460ec: 4e95 jsr %a5@ if (r_chain == NULL) { 460ee: 4fef 000c lea %sp@(12),%sp if (aiocbp->aio_fildes != fildes) { pthread_mutex_unlock (&aio_request_queue.mutex); rtems_set_errno_and_return_minus_one (EINVAL); } r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0); 460f2: 2440 moveal %d0,%a2 if (r_chain == NULL) { 460f4: 4a80 tstl %d0 460f6: 6662 bnes 4615a if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) { 460f8: 203c 0006 13d0 movel #398288,%d0 460fe: b0b9 0006 13cc cmpl 613cc ,%d0 46104: 6742 beqs 46148 <== NEVER TAKEN r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0); 46106: 42a7 clrl %sp@- 46108: 45f9 0004 7110 lea 47110 ,%a2 4610e: 2f03 movel %d3,%sp@- 46110: 4879 0006 13cc pea 613cc 46116: 4e95 jsr %a5@ if (r_chain == NULL) { 46118: 4fef 000c lea %sp@(12),%sp 4611c: 4a80 tstl %d0 4611e: 660a bnes 4612a pthread_mutex_unlock (&aio_request_queue.mutex); 46120: 4879 0006 1378 pea 61378 46126: 4e92 jsr %a2@ 46128: 609e bras 460c8 rtems_set_errno_and_return_minus_one (EINVAL); } AIO_printf ("Request on [IQ]\n"); result = rtems_aio_remove_req (&r_chain->perfd, aiocbp); 4612a: 2f0b movel %a3,%sp@- 4612c: 2040 moveal %d0,%a0 4612e: 4868 0008 pea %a0@(8) 46132: 4eb9 0004 66f4 jsr 466f4 pthread_mutex_unlock (&aio_request_queue.mutex); 46138: 4879 0006 1378 pea 61378 rtems_set_errno_and_return_minus_one (EINVAL); } AIO_printf ("Request on [IQ]\n"); result = rtems_aio_remove_req (&r_chain->perfd, aiocbp); 4613e: 2400 movel %d0,%d2 pthread_mutex_unlock (&aio_request_queue.mutex); 46140: 4e92 jsr %a2@ return result; 46142: 4fef 000c lea %sp@(12),%sp 46146: 6042 bras 4618a } else { pthread_mutex_unlock (&aio_request_queue.mutex); 46148: 4879 0006 1378 pea 61378 <== NOT EXECUTED return AIO_ALLDONE; 4614e: 7402 moveq #2,%d2 <== NOT EXECUTED result = rtems_aio_remove_req (&r_chain->perfd, aiocbp); pthread_mutex_unlock (&aio_request_queue.mutex); return result; } else { pthread_mutex_unlock (&aio_request_queue.mutex); 46150: 4eb9 0004 7110 jsr 47110 <== NOT EXECUTED return AIO_ALLDONE; 46156: 588f addql #4,%sp <== NOT EXECUTED 46158: 6030 bras 4618a <== NOT EXECUTED } } AIO_printf ("Request on [WQ]\n"); pthread_mutex_lock (&r_chain->mutex); 4615a: 2600 movel %d0,%d3 4615c: 0683 0000 001c addil #28,%d3 46162: 2f03 movel %d3,%sp@- 46164: 4e94 jsr %a4@ result = rtems_aio_remove_req (&r_chain->perfd, aiocbp); 46166: 2f0b movel %a3,%sp@- 46168: 486a 0008 pea %a2@(8) pthread_mutex_unlock (&r_chain->mutex); 4616c: 45f9 0004 7110 lea 47110 ,%a2 } } AIO_printf ("Request on [WQ]\n"); pthread_mutex_lock (&r_chain->mutex); result = rtems_aio_remove_req (&r_chain->perfd, aiocbp); 46172: 4eb9 0004 66f4 jsr 466f4 46178: 2400 movel %d0,%d2 pthread_mutex_unlock (&r_chain->mutex); 4617a: 2f03 movel %d3,%sp@- 4617c: 4e92 jsr %a2@ pthread_mutex_unlock (&aio_request_queue.mutex); 4617e: 4879 0006 1378 pea 61378 46184: 4e92 jsr %a2@ return result; 46186: 4fef 0014 lea %sp@(20),%sp } return AIO_ALLDONE; } 4618a: 2002 movel %d2,%d0 4618c: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 46192: 4e5e unlk %fp ... =============================================================================== 000461a8 : ) { rtems_aio_request *req; int mode; if (op != O_SYNC) 461a8: 203c 0000 2000 movel #8192,%d0 int aio_fsync( int op, struct aiocb *aiocbp ) { 461ae: 4e56 0000 linkw %fp,#0 461b2: 2f0a movel %a2,%sp@- 461b4: 246e 000c moveal %fp@(12),%a2 rtems_aio_request *req; int mode; if (op != O_SYNC) 461b8: b0ae 0008 cmpl %fp@(8),%d0 461bc: 671a beqs 461d8 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 461be: 7216 moveq #22,%d1 461c0: 70ff moveq #-1,%d0 461c2: 2541 0030 movel %d1,%a2@(48) 461c6: 2540 0034 movel %d0,%a2@(52) 461ca: 4eb9 0004 f150 jsr 4f150 <__errno> 461d0: 2040 moveal %d0,%a0 461d2: 7016 moveq #22,%d0 461d4: 2080 movel %d0,%a0@ 461d6: 607e bras 46256 mode = fcntl (aiocbp->aio_fildes, F_GETFL); 461d8: 4878 0003 pea 3 461dc: 2f12 movel %a2@,%sp@- 461de: 4eb9 0004 c2b0 jsr 4c2b0 if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) 461e4: 508f addql #8,%sp 461e6: 7203 moveq #3,%d1 461e8: c081 andl %d1,%d0 461ea: 123c 0001 moveb #1,%d1 461ee: 5380 subql #1,%d0 461f0: b280 cmpl %d0,%d1 461f2: 641a bccs 4620e rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); 461f4: 72ff moveq #-1,%d1 461f6: 7009 moveq #9,%d0 461f8: 2541 0034 movel %d1,%a2@(52) 461fc: 2540 0030 movel %d0,%a2@(48) 46200: 4eb9 0004 f150 jsr 4f150 <__errno> 46206: 7209 moveq #9,%d1 46208: 2040 moveal %d0,%a0 4620a: 2081 movel %d1,%a0@ 4620c: 6048 bras 46256 req = malloc (sizeof (rtems_aio_request)); 4620e: 4878 0018 pea 18 46212: 4eb9 0004 395c jsr 4395c if (req == NULL) 46218: 588f addql #4,%sp 4621a: 4a80 tstl %d0 4621c: 661c bnes 4623a <== ALWAYS TAKEN rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 4621e: 103c 000b moveb #11,%d0 <== NOT EXECUTED 46222: 72ff moveq #-1,%d1 <== NOT EXECUTED 46224: 2540 0030 movel %d0,%a2@(48) <== NOT EXECUTED 46228: 2541 0034 movel %d1,%a2@(52) <== NOT EXECUTED 4622c: 4eb9 0004 f150 jsr 4f150 <__errno> <== NOT EXECUTED 46232: 2040 moveal %d0,%a0 <== NOT EXECUTED 46234: 700b moveq #11,%d0 <== NOT EXECUTED 46236: 2080 movel %d0,%a0@ <== NOT EXECUTED 46238: 601c bras 46256 <== NOT EXECUTED req->aiocbp = aiocbp; 4623a: 2040 moveal %d0,%a0 req->aiocbp->aio_lio_opcode = LIO_SYNC; 4623c: 7203 moveq #3,%d1 req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; 4623e: 214a 0014 movel %a2,%a0@(20) req->aiocbp->aio_lio_opcode = LIO_SYNC; 46242: 2541 002c movel %d1,%a2@(44) return rtems_aio_enqueue (req); } 46246: 246e fffc moveal %fp@(-4),%a2 rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_SYNC; return rtems_aio_enqueue (req); 4624a: 2d40 0008 movel %d0,%fp@(8) } 4624e: 4e5e unlk %fp rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_SYNC; return rtems_aio_enqueue (req); 46250: 4ef9 0004 6750 jmp 46750 } 46256: 246e fffc moveal %fp@(-4),%a2 4625a: 70ff moveq #-1,%d0 4625c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00046950 : * 0 - otherwise */ int aio_read (struct aiocb *aiocbp) { 46950: 4e56 0000 linkw %fp,#0 46954: 2f0a movel %a2,%sp@- rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 46956: 4878 0003 pea 3 * 0 - otherwise */ int aio_read (struct aiocb *aiocbp) { 4695a: 246e 0008 moveal %fp@(8),%a2 rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 4695e: 2f12 movel %a2@,%sp@- 46960: 4eb9 0004 c2b0 jsr 4c2b0 if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR))) 46966: 508f addql #8,%sp 46968: 7203 moveq #3,%d1 4696a: c081 andl %d1,%d0 4696c: 6722 beqs 46990 <== NEVER TAKEN 4696e: 123c 0002 moveb #2,%d1 46972: b280 cmpl %d0,%d1 46974: 671a beqs 46990 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); 46976: 7009 moveq #9,%d0 46978: 72ff moveq #-1,%d1 4697a: 2540 0030 movel %d0,%a2@(48) 4697e: 2541 0034 movel %d1,%a2@(52) 46982: 4eb9 0004 f150 jsr 4f150 <__errno> 46988: 2040 moveal %d0,%a0 4698a: 7009 moveq #9,%d0 4698c: 2080 movel %d0,%a0@ 4698e: 606e bras 469fe if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) 46990: 4aaa 0014 tstl %a2@(20) 46994: 6606 bnes 4699c rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) 46996: 4aaa 0004 tstl %a2@(4) 4699a: 6a1a bpls 469b6 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 4699c: 72ff moveq #-1,%d1 4699e: 7016 moveq #22,%d0 469a0: 2541 0034 movel %d1,%a2@(52) 469a4: 2540 0030 movel %d0,%a2@(48) 469a8: 4eb9 0004 f150 jsr 4f150 <__errno> 469ae: 7216 moveq #22,%d1 469b0: 2040 moveal %d0,%a0 469b2: 2081 movel %d1,%a0@ 469b4: 6048 bras 469fe req = malloc (sizeof (rtems_aio_request)); 469b6: 4878 0018 pea 18 469ba: 4eb9 0004 395c jsr 4395c if (req == NULL) 469c0: 588f addql #4,%sp 469c2: 4a80 tstl %d0 469c4: 661c bnes 469e2 <== ALWAYS TAKEN rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 469c6: 103c 000b moveb #11,%d0 <== NOT EXECUTED 469ca: 72ff moveq #-1,%d1 <== NOT EXECUTED 469cc: 2540 0030 movel %d0,%a2@(48) <== NOT EXECUTED 469d0: 2541 0034 movel %d1,%a2@(52) <== NOT EXECUTED 469d4: 4eb9 0004 f150 jsr 4f150 <__errno> <== NOT EXECUTED 469da: 2040 moveal %d0,%a0 <== NOT EXECUTED 469dc: 700b moveq #11,%d0 <== NOT EXECUTED 469de: 2080 movel %d0,%a0@ <== NOT EXECUTED 469e0: 601c bras 469fe <== NOT EXECUTED req->aiocbp = aiocbp; 469e2: 2040 moveal %d0,%a0 req->aiocbp->aio_lio_opcode = LIO_READ; 469e4: 7201 moveq #1,%d1 req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; 469e6: 214a 0014 movel %a2,%a0@(20) req->aiocbp->aio_lio_opcode = LIO_READ; 469ea: 2541 002c movel %d1,%a2@(44) return rtems_aio_enqueue (req); } 469ee: 246e fffc moveal %fp@(-4),%a2 rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_READ; return rtems_aio_enqueue (req); 469f2: 2d40 0008 movel %d0,%fp@(8) } 469f6: 4e5e unlk %fp rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_READ; return rtems_aio_enqueue (req); 469f8: 4ef9 0004 6750 jmp 46750 } 469fe: 246e fffc moveal %fp@(-4),%a2 46a02: 70ff moveq #-1,%d0 46a04: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00046a18 : * 0 - otherwise */ int aio_write (struct aiocb *aiocbp) { 46a18: 4e56 0000 linkw %fp,#0 46a1c: 2f0a movel %a2,%sp@- rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 46a1e: 4878 0003 pea 3 * 0 - otherwise */ int aio_write (struct aiocb *aiocbp) { 46a22: 246e 0008 moveal %fp@(8),%a2 rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 46a26: 2f12 movel %a2@,%sp@- 46a28: 4eb9 0004 c2b0 jsr 4c2b0 if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) 46a2e: 508f addql #8,%sp 46a30: 7203 moveq #3,%d1 46a32: c081 andl %d1,%d0 46a34: 123c 0001 moveb #1,%d1 46a38: 5380 subql #1,%d0 46a3a: b280 cmpl %d0,%d1 46a3c: 641a bccs 46a58 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); 46a3e: 7009 moveq #9,%d0 46a40: 72ff moveq #-1,%d1 46a42: 2540 0030 movel %d0,%a2@(48) 46a46: 2541 0034 movel %d1,%a2@(52) 46a4a: 4eb9 0004 f150 jsr 4f150 <__errno> 46a50: 2040 moveal %d0,%a0 46a52: 7009 moveq #9,%d0 46a54: 2080 movel %d0,%a0@ 46a56: 606e bras 46ac6 if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) 46a58: 4aaa 0014 tstl %a2@(20) 46a5c: 6606 bnes 46a64 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) 46a5e: 4aaa 0004 tstl %a2@(4) 46a62: 6a1a bpls 46a7e rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 46a64: 72ff moveq #-1,%d1 46a66: 7016 moveq #22,%d0 46a68: 2541 0034 movel %d1,%a2@(52) 46a6c: 2540 0030 movel %d0,%a2@(48) 46a70: 4eb9 0004 f150 jsr 4f150 <__errno> 46a76: 7216 moveq #22,%d1 46a78: 2040 moveal %d0,%a0 46a7a: 2081 movel %d1,%a0@ 46a7c: 6048 bras 46ac6 req = malloc (sizeof (rtems_aio_request)); 46a7e: 4878 0018 pea 18 46a82: 4eb9 0004 395c jsr 4395c if (req == NULL) 46a88: 588f addql #4,%sp 46a8a: 4a80 tstl %d0 46a8c: 661c bnes 46aaa <== ALWAYS TAKEN rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 46a8e: 103c 000b moveb #11,%d0 <== NOT EXECUTED 46a92: 72ff moveq #-1,%d1 <== NOT EXECUTED 46a94: 2540 0030 movel %d0,%a2@(48) <== NOT EXECUTED 46a98: 2541 0034 movel %d1,%a2@(52) <== NOT EXECUTED 46a9c: 4eb9 0004 f150 jsr 4f150 <__errno> <== NOT EXECUTED 46aa2: 2040 moveal %d0,%a0 <== NOT EXECUTED 46aa4: 700b moveq #11,%d0 <== NOT EXECUTED 46aa6: 2080 movel %d0,%a0@ <== NOT EXECUTED 46aa8: 601c bras 46ac6 <== NOT EXECUTED req->aiocbp = aiocbp; 46aaa: 2040 moveal %d0,%a0 req->aiocbp->aio_lio_opcode = LIO_WRITE; 46aac: 7202 moveq #2,%d1 req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; 46aae: 214a 0014 movel %a2,%a0@(20) req->aiocbp->aio_lio_opcode = LIO_WRITE; 46ab2: 2541 002c movel %d1,%a2@(44) return rtems_aio_enqueue (req); } 46ab6: 246e fffc moveal %fp@(-4),%a2 rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_WRITE; return rtems_aio_enqueue (req); 46aba: 2d40 0008 movel %d0,%fp@(8) } 46abe: 4e5e unlk %fp rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_WRITE; return rtems_aio_enqueue (req); 46ac0: 4ef9 0004 6750 jmp 46750 } 46ac6: 246e fffc moveal %fp@(-4),%a2 46aca: 70ff moveq #-1,%d0 46acc: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000456cc : int clock_gettime( clockid_t clock_id, struct timespec *tp ) { 456cc: 4e56 0000 linkw %fp,#0 456d0: 222e 0008 movel %fp@(8),%d1 456d4: 202e 000c movel %fp@(12),%d0 456d8: 2f02 movel %d2,%sp@- if ( !tp ) 456da: 4a80 tstl %d0 456dc: 6608 bnes 456e6 rtems_set_errno_and_return_minus_one( EINVAL ); 456de: 4eb9 0004 d94c jsr 4d94c <__errno> 456e4: 6042 bras 45728 if ( clock_id == CLOCK_REALTIME ) { 456e6: 7401 moveq #1,%d2 456e8: b481 cmpl %d1,%d2 456ea: 660a bnes 456f6 <== NEVER TAKEN _TOD_Get(tp); 456ec: 2f00 movel %d0,%sp@- 456ee: 4eb9 0004 7334 jsr 47334 <_TOD_Get> 456f4: 6014 bras 4570a return 0; } #ifdef CLOCK_MONOTONIC if ( clock_id == CLOCK_MONOTONIC ) { 456f6: 7404 moveq #4,%d2 456f8: b481 cmpl %d1,%d2 456fa: 6706 beqs 45702 <== NEVER TAKEN return 0; } #endif #ifdef _POSIX_CPUTIME if ( clock_id == CLOCK_PROCESS_CPUTIME ) { 456fc: 7402 moveq #2,%d2 456fe: b481 cmpl %d1,%d2 45700: 660e bnes 45710 _TOD_Get_uptime_as_timespec( tp ); 45702: 2f00 movel %d0,%sp@- 45704: 4eb9 0004 7398 jsr 47398 <_TOD_Get_uptime_as_timespec> return 0; 4570a: 588f addql #4,%sp 4570c: 4280 clrl %d0 4570e: 6020 bras 45730 45710: 41f9 0004 d94c lea 4d94c <__errno>,%a0 } #endif #ifdef _POSIX_THREAD_CPUTIME if ( clock_id == CLOCK_THREAD_CPUTIME ) 45716: 7003 moveq #3,%d0 45718: b081 cmpl %d1,%d0 4571a: 660a bnes 45726 rtems_set_errno_and_return_minus_one( ENOSYS ); 4571c: 4e90 jsr %a0@ 4571e: 7258 moveq #88,%d1 45720: 2040 moveal %d0,%a0 45722: 2081 movel %d1,%a0@ 45724: 6008 bras 4572e #endif rtems_set_errno_and_return_minus_one( EINVAL ); 45726: 4e90 jsr %a0@ 45728: 2040 moveal %d0,%a0 4572a: 7016 moveq #22,%d0 4572c: 2080 movel %d0,%a0@ 4572e: 70ff moveq #-1,%d0 return 0; } 45730: 242e fffc movel %fp@(-4),%d2 45734: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00045738 : int clock_settime( clockid_t clock_id, const struct timespec *tp ) { 45738: 4e56 0000 linkw %fp,#0 4573c: 222e 0008 movel %fp@(8),%d1 45740: 206e 000c moveal %fp@(12),%a0 if ( !tp ) 45744: 4a88 tstl %a0 45746: 6710 beqs 45758 <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { 45748: 7001 moveq #1,%d0 4574a: b081 cmpl %d1,%d0 4574c: 6634 bnes 45782 if ( tp->tv_sec < TOD_SECONDS_1970_THROUGH_1988 ) 4574e: 203c 21da e4ff movel #567993599,%d0 45754: b090 cmpl %a0@,%d0 45756: 6508 bcss 45760 rtems_set_errno_and_return_minus_one( EINVAL ); 45758: 4eb9 0004 d94c jsr 4d94c <__errno> 4575e: 6048 bras 457a8 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 45760: 2039 0006 0668 movel 60668 <_Thread_Dispatch_disable_level>,%d0 45766: 5280 addql #1,%d0 45768: 23c0 0006 0668 movel %d0,60668 <_Thread_Dispatch_disable_level> _Thread_Disable_dispatch(); _TOD_Set( tp ); 4576e: 2f08 movel %a0,%sp@- 45770: 4eb9 0004 73f0 jsr 473f0 <_TOD_Set> _Thread_Enable_dispatch(); 45776: 4eb9 0004 883a jsr 4883a <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( ENOSYS ); #endif else rtems_set_errno_and_return_minus_one( EINVAL ); return 0; 4577c: 588f addql #4,%sp 4577e: 4280 clrl %d0 45780: 602e bras 457b0 _Thread_Disable_dispatch(); _TOD_Set( tp ); _Thread_Enable_dispatch(); } #ifdef _POSIX_CPUTIME else if ( clock_id == CLOCK_PROCESS_CPUTIME ) 45782: 7002 moveq #2,%d0 45784: b081 cmpl %d1,%d0 45786: 6608 bnes 45790 rtems_set_errno_and_return_minus_one( ENOSYS ); 45788: 4eb9 0004 d94c jsr 4d94c <__errno> 4578e: 600e bras 4579e 45790: 41f9 0004 d94c lea 4d94c <__errno>,%a0 #endif #ifdef _POSIX_THREAD_CPUTIME else if ( clock_id == CLOCK_THREAD_CPUTIME ) 45796: 7003 moveq #3,%d0 45798: b081 cmpl %d1,%d0 4579a: 660a bnes 457a6 rtems_set_errno_and_return_minus_one( ENOSYS ); 4579c: 4e90 jsr %a0@ 4579e: 2040 moveal %d0,%a0 457a0: 7258 moveq #88,%d1 457a2: 2081 movel %d1,%a0@ 457a4: 6008 bras 457ae #endif else rtems_set_errno_and_return_minus_one( EINVAL ); 457a6: 4e90 jsr %a0@ 457a8: 2040 moveal %d0,%a0 457aa: 7016 moveq #22,%d0 457ac: 2080 movel %d0,%a0@ 457ae: 70ff moveq #-1,%d0 return 0; } 457b0: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0005ac38 : int killinfo( pid_t pid, int sig, const union sigval *value ) { 5ac38: 4e56 ffd0 linkw %fp,#-48 5ac3c: 48d7 1cfc moveml %d2-%d7/%a2-%a4,%sp@ 5ac40: 242e 000c movel %fp@(12),%d2 5ac44: 246e 0010 moveal %fp@(16),%a2 POSIX_signals_Siginfo_node *psiginfo; /* * Only supported for the "calling process" (i.e. this node). */ if ( pid != getpid() ) 5ac48: 4eb9 0005 a85c jsr 5a85c 5ac4e: b0ae 0008 cmpl %fp@(8),%d0 5ac52: 6710 beqs 5ac64 rtems_set_errno_and_return_minus_one( ESRCH ); 5ac54: 4eb9 0004 cad0 jsr 4cad0 <__errno> 5ac5a: 7403 moveq #3,%d2 5ac5c: 2040 moveal %d0,%a0 5ac5e: 2082 movel %d2,%a0@ 5ac60: 6000 01ae braw 5ae10 /* * Validate the signal passed. */ if ( !sig ) 5ac64: 4a82 tstl %d2 5ac66: 670a beqs 5ac72 static inline bool is_valid_signo( int signo ) { return ((signo) >= 1 && (signo) <= 32 ); 5ac68: 2202 movel %d2,%d1 5ac6a: 5381 subql #1,%d1 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 5ac6c: 701f moveq #31,%d0 5ac6e: b081 cmpl %d1,%d0 5ac70: 6410 bccs 5ac82 rtems_set_errno_and_return_minus_one( EINVAL ); 5ac72: 4eb9 0004 cad0 jsr 4cad0 <__errno> 5ac78: 7216 moveq #22,%d1 5ac7a: 2040 moveal %d0,%a0 5ac7c: 2081 movel %d1,%a0@ 5ac7e: 6000 0190 braw 5ae10 /* * If the signal is being ignored, then we are out of here. */ if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) 5ac82: 2602 movel %d2,%d3 5ac84: 2002 movel %d2,%d0 5ac86: e58b lsll #2,%d3 5ac88: e988 lsll #4,%d0 5ac8a: 9083 subl %d3,%d0 5ac8c: 0680 0005 ee6c addil #388716,%d0 5ac92: 7601 moveq #1,%d3 5ac94: 2040 moveal %d0,%a0 5ac96: b690 cmpl %a0@,%d3 5ac98: 6700 01a6 beqw 5ae40 /* * 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 ) ) 5ac9c: 7008 moveq #8,%d0 5ac9e: b082 cmpl %d2,%d0 5aca0: 6710 beqs 5acb2 5aca2: 163c 0004 moveb #4,%d3 5aca6: b682 cmpl %d2,%d3 5aca8: 6708 beqs 5acb2 5acaa: 103c 000b moveb #11,%d0 5acae: b082 cmpl %d2,%d0 5acb0: 6616 bnes 5acc8 return pthread_kill( pthread_self(), sig ); 5acb2: 4eb9 0005 b014 jsr 5b014 5acb8: 2f02 movel %d2,%sp@- 5acba: 2f00 movel %d0,%sp@- 5acbc: 4eb9 0005 af68 jsr 5af68 5acc2: 508f addql #8,%sp 5acc4: 6000 017c braw 5ae42 static inline sigset_t signo_to_mask( uint32_t sig ) { return 1u << (sig - 1); 5acc8: 7601 moveq #1,%d3 /* * Build up a siginfo structure */ siginfo = &siginfo_struct; siginfo->si_signo = sig; siginfo->si_code = SI_USER; 5acca: 7001 moveq #1,%d0 5accc: e3ab lsll %d1,%d3 /* * Build up a siginfo structure */ siginfo = &siginfo_struct; siginfo->si_signo = sig; 5acce: 2d42 fff4 movel %d2,%fp@(-12) siginfo->si_code = SI_USER; 5acd2: 2d40 fff8 movel %d0,%fp@(-8) if ( !value ) { 5acd6: 4a8a tstl %a2 5acd8: 6606 bnes 5ace0 siginfo->si_value.sival_int = 0; 5acda: 42ae fffc clrl %fp@(-4) 5acde: 6004 bras 5ace4 } else { siginfo->si_value = *value; 5ace0: 2d52 fffc movel %a2@,%fp@(-4) 5ace4: 2039 0005 e9c8 movel 5e9c8 <_Thread_Dispatch_disable_level>,%d0 5acea: 5280 addql #1,%d0 5acec: 23c0 0005 e9c8 movel %d0,5e9c8 <_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; 5acf2: 2079 0005 ee32 moveal 5ee32 <_Per_CPU_Information+0xc>,%a0 api = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( _POSIX_signals_Is_interested( api, mask ) ) { 5acf8: 2268 0102 moveal %a0@(258),%a1 5acfc: 2029 00d0 movel %a1@(208),%d0 5ad00: 4680 notl %d0 5ad02: c083 andl %d3,%d0 5ad04: 6600 00ae bnew 5adb4 } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); return 0; } 5ad08: 2279 0005 eff0 moveal 5eff0 <_POSIX_signals_Wait_queue>,%a1 /* XXX violation of visibility -- need to define thread queue support */ the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = _Chain_First( the_chain ); 5ad0e: 601e bras 5ad2e #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 5ad10: 2003 movel %d3,%d0 for ( the_node = _Chain_First( the_chain ); !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { the_thread = (Thread_Control *)the_node; 5ad12: 2049 moveal %a1,%a0 #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 5ad14: c0a9 0030 andl %a1@(48),%d0 for ( the_node = _Chain_First( the_chain ); !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { the_thread = (Thread_Control *)the_node; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 5ad18: 2469 0102 moveal %a1@(258),%a2 #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 5ad1c: 6600 0096 bnew 5adb4 /* * Is this thread is blocked waiting for another signal but has * not blocked this one? */ if (~api->signals_blocked & mask) 5ad20: 202a 00d0 movel %a2@(208),%d0 5ad24: 4680 notl %d0 5ad26: c083 andl %d3,%d0 5ad28: 6600 008a bnew 5adb4 the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = _Chain_First( the_chain ); !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { 5ad2c: 2251 moveal %a1@,%a1 /* XXX violation of visibility -- need to define thread queue support */ the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = _Chain_First( the_chain ); 5ad2e: b3fc 0005 eff4 cmpal #389108,%a1 5ad34: 66da bnes 5ad10 * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 5ad36: 4280 clrl %d0 5ad38: 1039 0005 d0d2 moveb 5d0d2 ,%d0 5ad3e: 45f9 0005 e98c lea 5e98c <_Objects_Information_table+0x8>,%a2 5ad44: 5280 addql #1,%d0 * * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; 5ad46: 91c8 subal %a0,%a0 for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) { /* * This can occur when no one is interested and an API is not configured. */ if ( !_Objects_Information_table[ the_api ] ) 5ad48: 225a moveal %a2@+,%a1 5ad4a: 4a89 tstl %a1 5ad4c: 675a beqs 5ada8 <== NEVER TAKEN continue; the_info = _Objects_Information_table[ the_api ][ 1 ]; 5ad4e: 2269 0004 moveal %a1@(4),%a1 */ if ( !the_info ) continue; #endif maximum = the_info->maximum; 5ad52: 4287 clrl %d7 object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 5ad54: 7801 moveq #1,%d4 */ #define _POSIX_signals_Is_interested( _api, _mask ) \ ( ~(_api)->signals_blocked & (_mask) ) int killinfo( 5ad56: 2669 0018 moveal %a1@(24),%a3 5ad5a: 588b addql #4,%a3 */ if ( !the_info ) continue; #endif maximum = the_info->maximum; 5ad5c: 3e29 000e movew %a1@(14),%d7 object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 5ad60: 6042 bras 5ada4 the_thread = (Thread_Control *) object_table[ index ]; 5ad62: 225b moveal %a3@+,%a1 if ( !the_thread ) 5ad64: 4a89 tstl %a1 5ad66: 673a beqs 5ada2 /* * If this thread is of lower priority than the interested thread, * go on to the next thread. */ if ( the_thread->current_priority > interested_priority ) 5ad68: 2229 0014 movel %a1@(20),%d1 5ad6c: b081 cmpl %d1,%d0 5ad6e: 6532 bcss 5ada2 #if defined(RTEMS_DEBUG) if ( !api ) continue; #endif if ( !_POSIX_signals_Is_interested( api, mask ) ) 5ad70: 2869 0102 moveal %a1@(258),%a4 5ad74: 2a2c 00d0 movel %a4@(208),%d5 5ad78: 4685 notl %d5 5ad7a: ca83 andl %d3,%d5 5ad7c: 6724 beqs 5ada2 * * 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 ) { 5ad7e: b081 cmpl %d1,%d0 5ad80: 621c bhis 5ad9e * and blocking interruptibutable by signal. * * If the interested thread is ready, don't think about changing. */ if ( interested && !_States_Is_ready( interested->current_state ) ) { 5ad82: 4a88 tstl %a0 5ad84: 671c beqs 5ada2 <== NEVER TAKEN 5ad86: 2c28 0010 movel %a0@(16),%d6 5ad8a: 6716 beqs 5ada2 <== NEVER TAKEN /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 5ad8c: 2a29 0010 movel %a1@(16),%d5 5ad90: 670c beqs 5ad9e continue; } DEBUG_STEP("6"); /* prefer blocked/interruptible over blocked/not interruptible */ if ( !_States_Is_interruptible_by_signal(interested->current_state) ) { 5ad92: 0806 001c btst #28,%d6 5ad96: 660a bnes 5ada2 DEBUG_STEP("7"); if ( _States_Is_interruptible_by_signal(the_thread->current_state) ) { 5ad98: 0805 001c btst #28,%d5 5ad9c: 6704 beqs 5ada2 */ if ( interested && !_States_Is_ready( interested->current_state ) ) { /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 5ad9e: 2001 movel %d1,%d0 5ada0: 2049 moveal %a1,%a0 #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 5ada2: 5284 addql #1,%d4 5ada4: be84 cmpl %d4,%d7 5ada6: 64ba bccs 5ad62 * + 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++) { 5ada8: b5fc 0005 e994 cmpal #387476,%a2 5adae: 6698 bnes 5ad48 } } } } if ( interested ) { 5adb0: 4a88 tstl %a0 5adb2: 6716 beqs 5adca /* * 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 ) ) { 5adb4: 486e fff4 pea %fp@(-12) 5adb8: 2f02 movel %d2,%sp@- 5adba: 2f08 movel %a0,%sp@- 5adbc: 4eb9 0005 ae6c jsr 5ae6c <_POSIX_signals_Unblock_thread> 5adc2: 4fef 000c lea %sp@(12),%sp 5adc6: 4a00 tstb %d0 5adc8: 6670 bnes 5ae3a /* * 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 ); 5adca: 2f03 movel %d3,%sp@- if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { 5adcc: 7602 moveq #2,%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 ); 5adce: 4eb9 0005 ae4c jsr 5ae4c <_POSIX_signals_Set_process_signals> if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { 5add4: 588f addql #4,%sp 5add6: 2002 movel %d2,%d0 5add8: 41f9 0005 ee64 lea 5ee64 <_POSIX_signals_Vectors>,%a0 5adde: e588 lsll #2,%d0 5ade0: e98a lsll #4,%d2 5ade2: 9480 subl %d0,%d2 5ade4: b6b0 2800 cmpl %a0@(00000000,%d2:l),%d3 5ade8: 6650 bnes 5ae3a psiginfo = (POSIX_signals_Siginfo_node *) _Chain_Get( &_POSIX_signals_Inactive_siginfo ); 5adea: 4879 0005 efe4 pea 5efe4 <_POSIX_signals_Inactive_siginfo> 5adf0: 4eb9 0004 6268 jsr 46268 <_Chain_Get> if ( !psiginfo ) { 5adf6: 588f addql #4,%sp _POSIX_signals_Set_process_signals( mask ); if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { psiginfo = (POSIX_signals_Siginfo_node *) _Chain_Get( &_POSIX_signals_Inactive_siginfo ); 5adf8: 2440 moveal %d0,%a2 if ( !psiginfo ) { 5adfa: 4a80 tstl %d0 5adfc: 6616 bnes 5ae14 _Thread_Enable_dispatch(); 5adfe: 4eb9 0004 7ac2 jsr 47ac2 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EAGAIN ); 5ae04: 4eb9 0004 cad0 jsr 4cad0 <__errno> 5ae0a: 2040 moveal %d0,%a0 5ae0c: 700b moveq #11,%d0 5ae0e: 2080 movel %d0,%a0@ 5ae10: 70ff moveq #-1,%d0 5ae12: 602e bras 5ae42 } psiginfo->Info = *siginfo; 5ae14: 4878 000c pea c _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 5ae18: 0682 0005 f05c addil #389212,%d2 if ( !psiginfo ) { _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EAGAIN ); } psiginfo->Info = *siginfo; 5ae1e: 486e fff4 pea %fp@(-12) 5ae22: 486a 0008 pea %a2@(8) 5ae26: 4eb9 0004 d37c jsr 4d37c _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 5ae2c: 2f0a movel %a2,%sp@- 5ae2e: 2f02 movel %d2,%sp@- 5ae30: 4eb9 0004 6208 jsr 46208 <_Chain_Append> 5ae36: 4fef 0014 lea %sp@(20),%sp } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); 5ae3a: 4eb9 0004 7ac2 jsr 47ac2 <_Thread_Enable_dispatch> /* * If the signal is being ignored, then we are out of here. */ if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) return 0; 5ae40: 4280 clrl %d0 } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); return 0; } 5ae42: 4cee 1cfc ffd0 moveml %fp@(-48),%d2-%d7/%a2-%a4 5ae48: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004a56c : int pthread_attr_setschedpolicy( pthread_attr_t *attr, int policy ) { 4a56c: 4e56 0000 linkw %fp,#0 4a570: 206e 0008 moveal %fp@(8),%a0 4a574: 222e 000c movel %fp@(12),%d1 4a578: 2f02 movel %d2,%sp@- if ( !attr || !attr->is_initialized ) 4a57a: 4a88 tstl %a0 4a57c: 671e beqs 4a59c 4a57e: 4a90 tstl %a0@ 4a580: 671a beqs 4a59c return EINVAL; switch ( policy ) { 4a582: 7004 moveq #4,%d0 4a584: b081 cmpl %d1,%d0 4a586: 6518 bcss 4a5a0 4a588: 103c 0001 moveb #1,%d0 4a58c: 7417 moveq #23,%d2 4a58e: e3a8 lsll %d1,%d0 4a590: c082 andl %d2,%d0 4a592: 670c beqs 4a5a0 <== NEVER TAKEN case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: case SCHED_SPORADIC: attr->schedpolicy = policy; 4a594: 2141 0014 movel %d1,%a0@(20) return 0; 4a598: 4280 clrl %d0 4a59a: 600a bras 4a5a6 pthread_attr_t *attr, int policy ) { if ( !attr || !attr->is_initialized ) return EINVAL; 4a59c: 7016 moveq #22,%d0 4a59e: 6006 bras 4a5a6 case SCHED_SPORADIC: attr->schedpolicy = policy; return 0; default: return ENOTSUP; 4a5a0: 203c 0000 0086 movel #134,%d0 } } 4a5a6: 241f movel %sp@+,%d2 4a5a8: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00045c0c : int pthread_barrier_init( pthread_barrier_t *barrier, const pthread_barrierattr_t *attr, unsigned int count ) { 45c0c: 4e56 ffdc linkw %fp,#-36 45c10: 206e 000c moveal %fp@(12),%a0 45c14: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@ 45c18: 246e 0008 moveal %fp@(8),%a2 45c1c: 242e 0010 movel %fp@(16),%d2 const pthread_barrierattr_t *the_attr; /* * Error check parameters */ if ( !barrier ) 45c20: 4a8a tstl %a2 45c22: 6700 008e beqw 45cb2 return EINVAL; if ( count == 0 ) 45c26: 4a82 tstl %d2 45c28: 6700 0088 beqw 45cb2 return EINVAL; /* * If the user passed in NULL, use the default attributes */ if ( attr ) { 45c2c: 4a88 tstl %a0 45c2e: 6614 bnes 45c44 the_attr = attr; } else { (void) pthread_barrierattr_init( &my_attr ); 45c30: 260e movel %fp,%d3 45c32: 0683 ffff fff0 addil #-16,%d3 45c38: 2f03 movel %d3,%sp@- 45c3a: 4eb9 0004 5b50 jsr 45b50 45c40: 588f addql #4,%sp the_attr = &my_attr; 45c42: 2043 moveal %d3,%a0 } /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) 45c44: 4a90 tstl %a0@ 45c46: 676a beqs 45cb2 return EINVAL; switch ( the_attr->process_shared ) { 45c48: 4aa8 0004 tstl %a0@(4) 45c4c: 6664 bnes 45cb2 <== NEVER TAKEN rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 45c4e: 2039 0005 ffac movel 5ffac <_Thread_Dispatch_disable_level>,%d0 45c54: 5280 addql #1,%d0 } /* * Convert from POSIX attributes to Core Barrier attributes */ the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE; 45c56: 42ae fff8 clrl %fp@(-8) the_attributes.maximum_count = count; 45c5a: 2d42 fffc movel %d2,%fp@(-4) 45c5e: 23c0 0005 ffac movel %d0,5ffac <_Thread_Dispatch_disable_level> * the inactive chain of free barrier control blocks. */ RTEMS_INLINE_ROUTINE POSIX_Barrier_Control *_POSIX_Barrier_Allocate( void ) { return (POSIX_Barrier_Control *) _Objects_Allocate( &_POSIX_Barrier_Information ); 45c64: 4879 0006 02aa pea 602aa <_POSIX_Barrier_Information> 45c6a: 49f9 0004 8ab2 lea 48ab2 <_Thread_Enable_dispatch>,%a4 45c70: 4eb9 0004 7b28 jsr 47b28 <_Objects_Allocate> */ _Thread_Disable_dispatch(); /* prevents deletion */ the_barrier = _POSIX_Barrier_Allocate(); if ( !the_barrier ) { 45c76: 588f addql #4,%sp 45c78: 2640 moveal %d0,%a3 45c7a: 4a80 tstl %d0 45c7c: 6606 bnes 45c84 _Thread_Enable_dispatch(); 45c7e: 4e94 jsr %a4@ return EAGAIN; 45c80: 700b moveq #11,%d0 45c82: 6030 bras 45cb4 } _CORE_barrier_Initialize( &the_barrier->Barrier, &the_attributes ); 45c84: 486e fff8 pea %fp@(-8) 45c88: 486b 0010 pea %a3@(16) 45c8c: 4eb9 0004 7230 jsr 47230 <_CORE_barrier_Initialize> uint32_t name ) { _Objects_Set_local_object( information, _Objects_Get_index( the_object->id ), 45c92: 202b 0008 movel %a3@(8),%d0 Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 45c96: 4281 clrl %d1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 45c98: 2079 0006 02c2 moveal 602c2 <_POSIX_Barrier_Information+0x18>,%a0 Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 45c9e: 3200 movew %d0,%d1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 45ca0: 218b 1c00 movel %a3,%a0@(00000000,%d1:l:4) _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 45ca4: 42ab 000c clrl %a3@(12) ); /* * Exit the critical section and return the user an operational barrier */ *barrier = the_barrier->Object.id; 45ca8: 2480 movel %d0,%a2@ _Thread_Enable_dispatch(); 45caa: 4e94 jsr %a4@ return 0; 45cac: 508f addql #8,%sp 45cae: 4280 clrl %d0 45cb0: 6002 bras 45cb4 switch ( the_attr->process_shared ) { case PTHREAD_PROCESS_PRIVATE: /* only supported values */ break; case PTHREAD_PROCESS_SHARED: default: return EINVAL; 45cb2: 7016 moveq #22,%d0 * Exit the critical section and return the user an operational barrier */ *barrier = the_barrier->Object.id; _Thread_Enable_dispatch(); return 0; } 45cb4: 4cee 1c0c ffdc moveml %fp@(-36),%d2-%d3/%a2-%a4 45cba: 4e5e unlk %fp ... =============================================================================== 00045630 : void pthread_cleanup_push( void (*routine)( void * ), void *arg ) { 45630: 4e56 0000 linkw %fp,#0 45634: 2f03 movel %d3,%sp@- 45636: 262e 000c movel %fp@(12),%d3 4563a: 2f02 movel %d2,%sp@- 4563c: 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 ) 45640: 6754 beqs 45696 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 45642: 2039 0005 f8f2 movel 5f8f2 <_Thread_Dispatch_disable_level>,%d0 45648: 5280 addql #1,%d0 4564a: 23c0 0005 f8f2 movel %d0,5f8f2 <_Thread_Dispatch_disable_level> return; _Thread_Disable_dispatch(); handler = _Workspace_Allocate( sizeof( POSIX_Cancel_Handler_control ) ); 45650: 4878 0010 pea 10 45654: 4eb9 0004 94b8 jsr 494b8 <_Workspace_Allocate> if ( handler ) { 4565a: 588f addql #4,%sp 4565c: 4a80 tstl %d0 4565e: 6726 beqs 45686 <== NEVER TAKEN thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 45660: 2079 0005 fd5c moveal 5fd5c <_Per_CPU_Information+0xc>,%a0 handler_stack = &thread_support->Cancellation_Handlers; 45666: 2228 0102 movel %a0@(258),%d1 handler->routine = routine; 4566a: 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; 4566c: 0681 0000 00e4 addil #228,%d1 handler->routine = routine; 45672: 2142 0008 movel %d2,%a0@(8) handler->arg = arg; 45676: 2143 000c movel %d3,%a0@(12) _Chain_Append( handler_stack, &handler->Node ); 4567a: 2f00 movel %d0,%sp@- 4567c: 2f01 movel %d1,%sp@- 4567e: 4eb9 0004 6cc8 jsr 46cc8 <_Chain_Append> 45684: 508f addql #8,%sp } _Thread_Enable_dispatch(); } 45686: 242e fff8 movel %fp@(-8),%d2 4568a: 262e fffc movel %fp@(-4),%d3 4568e: 4e5e unlk %fp handler->routine = routine; handler->arg = arg; _Chain_Append( handler_stack, &handler->Node ); } _Thread_Enable_dispatch(); 45690: 4ef9 0004 850e jmp 4850e <_Thread_Enable_dispatch> } 45696: 242e fff8 movel %fp@(-8),%d2 4569a: 262e fffc movel %fp@(-4),%d3 4569e: 4e5e unlk %fp ... =============================================================================== 00046354 : int pthread_cond_init( pthread_cond_t *cond, const pthread_condattr_t *attr ) { 46354: 4e56 fff4 linkw %fp,#-12 46358: 48d7 1c00 moveml %a2-%a4,%sp@ 4635c: 246e 000c moveal %fp@(12),%a2 POSIX_Condition_variables_Control *the_cond; const pthread_condattr_t *the_attr; if ( attr ) the_attr = attr; 46360: 4a8a tstl %a2 46362: 6606 bnes 4636a else the_attr = &_POSIX_Condition_variables_Default_attributes; 46364: 45f9 0005 e662 lea 5e662 <_POSIX_Condition_variables_Default_attributes>,%a2 /* * Be careful about attributes when global!!! */ if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) 4636a: 7001 moveq #1,%d0 4636c: b0aa 0004 cmpl %a2@(4),%d0 46370: 6778 beqs 463ea <== NEVER TAKEN return EINVAL; if ( !the_attr->is_initialized ) 46372: 4a92 tstl %a2@ 46374: 6774 beqs 463ea rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 46376: 2039 0006 0ed8 movel 60ed8 <_Thread_Dispatch_disable_level>,%d0 4637c: 5280 addql #1,%d0 4637e: 23c0 0006 0ed8 movel %d0,60ed8 <_Thread_Dispatch_disable_level> RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *_POSIX_Condition_variables_Allocate( void ) { return (POSIX_Condition_variables_Control *) _Objects_Allocate( &_POSIX_Condition_variables_Information ); 46384: 4879 0006 1262 pea 61262 <_POSIX_Condition_variables_Information> 4638a: 49f9 0004 96fe lea 496fe <_Thread_Enable_dispatch>,%a4 46390: 4eb9 0004 8774 jsr 48774 <_Objects_Allocate> _Thread_Disable_dispatch(); the_cond = _POSIX_Condition_variables_Allocate(); if ( !the_cond ) { 46396: 588f addql #4,%sp 46398: 2640 moveal %d0,%a3 4639a: 4a80 tstl %d0 4639c: 6606 bnes 463a4 _Thread_Enable_dispatch(); 4639e: 4e94 jsr %a4@ return ENOMEM; 463a0: 700c moveq #12,%d0 463a2: 6048 bras 463ec } the_cond->process_shared = the_attr->process_shared; 463a4: 276a 0004 0010 movel %a2@(4),%a3@(16) the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX; 463aa: 42ab 0014 clrl %a3@(20) _Thread_queue_Initialize( 463ae: 4878 0074 pea 74 463b2: 2f3c 1000 0800 movel #268437504,%sp@- 463b8: 42a7 clrl %sp@- 463ba: 486b 0018 pea %a3@(24) 463be: 4eb9 0004 9dd0 jsr 49dd0 <_Thread_queue_Initialize> uint32_t name ) { _Objects_Set_local_object( information, _Objects_Get_index( the_object->id ), 463c4: 202b 0008 movel %a3@(8),%d0 Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 463c8: 4281 clrl %d1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 463ca: 2079 0006 127a moveal 6127a <_POSIX_Condition_variables_Information+0x18>,%a0 Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 463d0: 3200 movew %d0,%d1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 463d2: 218b 1c00 movel %a3,%a0@(00000000,%d1:l:4) &_POSIX_Condition_variables_Information, &the_cond->Object, 0 ); *cond = the_cond->Object.id; 463d6: 206e 0008 moveal %fp@(8),%a0 _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 463da: 42ab 000c clrl %a3@(12) 463de: 2080 movel %d0,%a0@ _Thread_Enable_dispatch(); 463e0: 4e94 jsr %a4@ return 0; 463e2: 4fef 0010 lea %sp@(16),%sp 463e6: 4280 clrl %d0 463e8: 6002 bras 463ec */ if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) return EINVAL; if ( !the_attr->is_initialized ) return EINVAL; 463ea: 7016 moveq #22,%d0 *cond = the_cond->Object.id; _Thread_Enable_dispatch(); return 0; } 463ec: 4cee 1c00 fff4 moveml %fp@(-12),%a2-%a4 463f2: 4e5e unlk %fp ... =============================================================================== 000461f0 : */ int pthread_condattr_destroy( pthread_condattr_t *attr ) { 461f0: 4e56 0000 linkw %fp,#0 461f4: 206e 0008 moveal %fp@(8),%a0 if ( !attr || attr->is_initialized == false ) 461f8: 4a88 tstl %a0 461fa: 670a beqs 46206 461fc: 4a90 tstl %a0@ 461fe: 6706 beqs 46206 <== NEVER TAKEN return EINVAL; attr->is_initialized = false; 46200: 4290 clrl %a0@ return 0; 46202: 4280 clrl %d0 46204: 6002 bras 46208 int pthread_condattr_destroy( pthread_condattr_t *attr ) { if ( !attr || attr->is_initialized == false ) return EINVAL; 46206: 7016 moveq #22,%d0 attr->is_initialized = false; return 0; } 46208: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004c634 : } void pthread_exit( void *value_ptr ) { 4c634: 4e56 0000 linkw %fp,#0 _POSIX_Thread_Exit( _Thread_Executing, value_ptr ); 4c638: 2f2e 0008 movel %fp@(8),%sp@- 4c63c: 2f39 0005 ee32 movel 5ee32 <_Per_CPU_Information+0xc>,%sp@- 4c642: 4eb9 0004 c5c4 jsr 4c5c4 <_POSIX_Thread_Exit> 4c648: 508f addql #8,%sp <== NOT EXECUTED } 4c64a: 4e5e unlk %fp <== NOT EXECUTED ... =============================================================================== 0005af68 : int pthread_kill( pthread_t thread, int sig ) { 5af68: 4e56 fff0 linkw %fp,#-16 5af6c: 48d7 040c moveml %d2-%d3/%a2,%sp@ 5af70: 242e 000c movel %fp@(12),%d2 POSIX_API_Control *api; Thread_Control *the_thread; Objects_Locations location; if ( !sig ) 5af74: 670a beqs 5af80 static inline bool is_valid_signo( int signo ) { return ((signo) >= 1 && (signo) <= 32 ); 5af76: 2602 movel %d2,%d3 5af78: 5383 subql #1,%d3 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 5af7a: 701f moveq #31,%d0 5af7c: b083 cmpl %d3,%d0 5af7e: 640e bccs 5af8e rtems_set_errno_and_return_minus_one( EINVAL ); 5af80: 4eb9 0004 cad0 jsr 4cad0 <__errno> 5af86: 7216 moveq #22,%d1 5af88: 2040 moveal %d0,%a0 5af8a: 2081 movel %d1,%a0@ 5af8c: 607a bras 5b008 the_thread = _Thread_Get( thread, &location ); 5af8e: 486e fffc pea %fp@(-4) 5af92: 2f2e 0008 movel %fp@(8),%sp@- 5af96: 4eb9 0004 7ae8 jsr 47ae8 <_Thread_Get> switch ( location ) { 5af9c: 508f addql #8,%sp rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) rtems_set_errno_and_return_minus_one( EINVAL ); the_thread = _Thread_Get( thread, &location ); 5af9e: 2440 moveal %d0,%a2 switch ( location ) { 5afa0: 4aae fffc tstl %fp@(-4) 5afa4: 6656 bnes 5affc <== NEVER TAKEN api = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( sig ) { if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) { 5afa6: 2202 movel %d2,%d1 5afa8: 2002 movel %d2,%d0 5afaa: e589 lsll #2,%d1 5afac: e988 lsll #4,%d0 case OBJECTS_LOCAL: /* * If sig == 0 then just validate arguments */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 5afae: 206a 0102 moveal %a2@(258),%a0 if ( sig ) { if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) { 5afb2: 9081 subl %d1,%d0 5afb4: 0680 0005 ee6c addil #388716,%d0 5afba: 7201 moveq #1,%d1 5afbc: 2240 moveal %d0,%a1 5afbe: b291 cmpl %a1@,%d1 5afc0: 6730 beqs 5aff2 static inline sigset_t signo_to_mask( uint32_t sig ) { return 1u << (sig - 1); 5afc2: 7001 moveq #1,%d0 5afc4: e7a8 lsll %d3,%d0 return 0; } /* XXX critical section */ api->signals_pending |= signo_to_mask( sig ); 5afc6: 81a8 00d4 orl %d0,%a0@(212) (void) _POSIX_signals_Unblock_thread( the_thread, sig, NULL ); 5afca: 42a7 clrl %sp@- 5afcc: 2f02 movel %d2,%sp@- 5afce: 2f0a movel %a2,%sp@- 5afd0: 4eb9 0005 ae6c jsr 5ae6c <_POSIX_signals_Unblock_thread> if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 5afd6: 4fef 000c lea %sp@(12),%sp 5afda: 4ab9 0005 ee2e tstl 5ee2e <_Per_CPU_Information+0x8> 5afe0: 6710 beqs 5aff2 5afe2: b5f9 0005 ee32 cmpal 5ee32 <_Per_CPU_Information+0xc>,%a2 5afe8: 6608 bnes 5aff2 _Thread_Dispatch_necessary = true; 5afea: 7001 moveq #1,%d0 5afec: 13c0 0005 ee3e moveb %d0,5ee3e <_Per_CPU_Information+0x18> } _Thread_Enable_dispatch(); 5aff2: 4eb9 0004 7ac2 jsr 47ac2 <_Thread_Enable_dispatch> return 0; 5aff8: 4280 clrl %d0 5affa: 600e bras 5b00a #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( ESRCH ); 5affc: 4eb9 0004 cad0 jsr 4cad0 <__errno> <== NOT EXECUTED 5b002: 2040 moveal %d0,%a0 <== NOT EXECUTED 5b004: 7003 moveq #3,%d0 <== NOT EXECUTED 5b006: 2080 movel %d0,%a0@ <== NOT EXECUTED 5b008: 70ff moveq #-1,%d0 } 5b00a: 4cee 040c fff0 moveml %fp@(-16),%d2-%d3/%a2 5b010: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000475c4 : int pthread_mutex_timedlock( pthread_mutex_t *mutex, const struct timespec *abstime ) { 475c4: 4e56 fffc linkw %fp,#-4 475c8: 2f03 movel %d3,%sp@- 475ca: 2f02 movel %d2,%sp@- * * If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID, * POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW, * then we should not wait. */ status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks ); 475cc: 486e fffc pea %fp@(-4) 475d0: 2f2e 000c movel %fp@(12),%sp@- 475d4: 4eb9 0004 76ac jsr 476ac <_POSIX_Absolute_timeout_to_ticks> int _EXFUN(pthread_mutex_trylock, (pthread_mutex_t *__mutex)); int _EXFUN(pthread_mutex_unlock, (pthread_mutex_t *__mutex)); #if defined(_POSIX_TIMEOUTS) int _EXFUN(pthread_mutex_timedlock, 475da: 508f addql #8,%sp 475dc: 2400 movel %d0,%d2 475de: 7003 moveq #3,%d0 475e0: b082 cmpl %d2,%d0 475e2: 57c3 seq %d3 if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; lock_status = _POSIX_Mutex_Lock_support( mutex, do_wait, ticks ); 475e4: 2f2e fffc movel %fp@(-4),%sp@- 475e8: 4483 negl %d3 475ea: 4280 clrl %d0 475ec: 1003 moveb %d3,%d0 475ee: 2f00 movel %d0,%sp@- 475f0: 2f2e 0008 movel %fp@(8),%sp@- 475f4: 4eb9 0004 74cc jsr 474cc <_POSIX_Mutex_Lock_support> * This service only gives us the option to block. We used a polling * attempt to lock if the abstime was not in the future. If we did * not obtain the mutex, then not look at the status immediately, * make sure the right reason is returned. */ if ( !do_wait && (lock_status == EBUSY) ) { 475fa: 4fef 000c lea %sp@(12),%sp 475fe: 4a03 tstb %d3 47600: 661c bnes 4761e 47602: 7210 moveq #16,%d1 47604: b280 cmpl %d0,%d1 47606: 6616 bnes 4761e <== NEVER TAKEN if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID ) 47608: 4a82 tstl %d2 4760a: 670c beqs 47618 <== NEVER TAKEN return EINVAL; if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST || 4760c: 5382 subql #1,%d2 4760e: 123c 0001 moveb #1,%d1 47612: b282 cmpl %d2,%d1 47614: 6508 bcss 4761e <== NEVER TAKEN 47616: 6004 bras 4761c * not obtain the mutex, then not look at the status immediately, * make sure the right reason is returned. */ if ( !do_wait && (lock_status == EBUSY) ) { if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID ) return EINVAL; 47618: 7016 moveq #22,%d0 <== NOT EXECUTED 4761a: 6002 bras 4761e <== NOT EXECUTED if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST || status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; 4761c: 7074 moveq #116,%d0 } return lock_status; } 4761e: 242e fff4 movel %fp@(-12),%d2 47622: 262e fff8 movel %fp@(-8),%d3 47626: 4e5e unlk %fp ... =============================================================================== 0004547c : #if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES) int pthread_mutexattr_gettype( const pthread_mutexattr_t *attr, int *type ) { 4547c: 4e56 0000 linkw %fp,#0 45480: 206e 0008 moveal %fp@(8),%a0 45484: 226e 000c moveal %fp@(12),%a1 if ( !attr ) 45488: 4a88 tstl %a0 4548a: 6710 beqs 4549c return EINVAL; if ( !attr->is_initialized ) 4548c: 4a90 tstl %a0@ 4548e: 670c beqs 4549c return EINVAL; if ( !type ) 45490: 4a89 tstl %a1 45492: 6708 beqs 4549c <== NEVER TAKEN return EINVAL; *type = attr->type; 45494: 22a8 0010 movel %a0@(16),%a1@ return 0; 45498: 4280 clrl %d0 4549a: 6002 bras 4549e if ( !attr->is_initialized ) return EINVAL; if ( !type ) return EINVAL; 4549c: 7016 moveq #22,%d0 *type = attr->type; return 0; } 4549e: 4e5e unlk %fp ... =============================================================================== 0004720c : int pthread_mutexattr_setpshared( pthread_mutexattr_t *attr, int pshared ) { 4720c: 4e56 0000 linkw %fp,#0 47210: 206e 0008 moveal %fp@(8),%a0 47214: 202e 000c movel %fp@(12),%d0 if ( !attr || !attr->is_initialized ) 47218: 4a88 tstl %a0 4721a: 6712 beqs 4722e 4721c: 4a90 tstl %a0@ 4721e: 670e beqs 4722e return EINVAL; switch ( pshared ) { 47220: 7201 moveq #1,%d1 47222: b280 cmpl %d0,%d1 47224: 6508 bcss 4722e <== NEVER TAKEN case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; 47226: 2140 0004 movel %d0,%a0@(4) return 0; 4722a: 4280 clrl %d0 4722c: 6002 bras 47230 default: return EINVAL; 4722e: 7016 moveq #22,%d0 } } 47230: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000454d0 : #if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES) int pthread_mutexattr_settype( pthread_mutexattr_t *attr, int type ) { 454d0: 4e56 0000 linkw %fp,#0 454d4: 206e 0008 moveal %fp@(8),%a0 454d8: 202e 000c movel %fp@(12),%d0 if ( !attr || !attr->is_initialized ) 454dc: 4a88 tstl %a0 454de: 6712 beqs 454f2 454e0: 4a90 tstl %a0@ 454e2: 670e beqs 454f2 <== NEVER TAKEN return EINVAL; switch ( type ) { 454e4: 7203 moveq #3,%d1 454e6: b280 cmpl %d0,%d1 454e8: 6508 bcss 454f2 case PTHREAD_MUTEX_NORMAL: case PTHREAD_MUTEX_RECURSIVE: case PTHREAD_MUTEX_ERRORCHECK: case PTHREAD_MUTEX_DEFAULT: attr->type = type; 454ea: 2140 0010 movel %d0,%a0@(16) return 0; 454ee: 4280 clrl %d0 454f0: 6002 bras 454f4 default: return EINVAL; 454f2: 7016 moveq #22,%d0 } } 454f4: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00045f6c : int pthread_once( pthread_once_t *once_control, void (*init_routine)(void) ) { 45f6c: 4e56 fffc linkw %fp,#-4 45f70: 2f0b movel %a3,%sp@- 45f72: 266e 000c moveal %fp@(12),%a3 45f76: 2f0a movel %a2,%sp@- 45f78: 246e 0008 moveal %fp@(8),%a2 if ( !once_control || !init_routine ) 45f7c: 4a8a tstl %a2 45f7e: 674a beqs 45fca 45f80: 4a8b tstl %a3 45f82: 6746 beqs 45fca return EINVAL; if ( !once_control->init_executed ) { 45f84: 4aaa 0004 tstl %a2@(4) 45f88: 6644 bnes 45fce rtems_mode saveMode; rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode); 45f8a: 486e fffc pea %fp@(-4) 45f8e: 4878 0100 pea 100 45f92: 4878 0100 pea 100 45f96: 4eb9 0004 6a78 jsr 46a78 if ( !once_control->init_executed ) { 45f9c: 4fef 000c lea %sp@(12),%sp 45fa0: 4aaa 0004 tstl %a2@(4) 45fa4: 660c bnes 45fb2 <== NEVER TAKEN once_control->is_initialized = true; 45fa6: 7001 moveq #1,%d0 45fa8: 2480 movel %d0,%a2@ once_control->init_executed = true; 45faa: 7001 moveq #1,%d0 45fac: 2540 0004 movel %d0,%a2@(4) (*init_routine)(); 45fb0: 4e93 jsr %a3@ } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); 45fb2: 486e fffc pea %fp@(-4) 45fb6: 4878 0100 pea 100 45fba: 2f2e fffc movel %fp@(-4),%sp@- 45fbe: 4eb9 0004 6a78 jsr 46a78 45fc4: 4fef 000c lea %sp@(12),%sp 45fc8: 6004 bras 45fce pthread_once_t *once_control, void (*init_routine)(void) ) { if ( !once_control || !init_routine ) return EINVAL; 45fca: 7016 moveq #22,%d0 45fcc: 6002 bras 45fd0 once_control->init_executed = true; (*init_routine)(); } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); } return 0; 45fce: 4280 clrl %d0 } 45fd0: 246e fff4 moveal %fp@(-12),%a2 45fd4: 266e fff8 moveal %fp@(-8),%a3 45fd8: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00046748 : int pthread_rwlock_init( pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr ) { 46748: 4e56 ffe4 linkw %fp,#-28 4674c: 206e 000c moveal %fp@(12),%a0 46750: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ 46754: 246e 0008 moveal %fp@(8),%a2 const pthread_rwlockattr_t *the_attr; /* * Error check parameters */ if ( !rwlock ) 46758: 4a8a tstl %a2 4675a: 6700 0084 beqw 467e0 return EINVAL; /* * If the user passed in NULL, use the default attributes */ if ( attr ) { 4675e: 4a88 tstl %a0 46760: 6614 bnes 46776 the_attr = attr; } else { (void) pthread_rwlockattr_init( &default_attr ); 46762: 240e movel %fp,%d2 46764: 0682 ffff fff4 addil #-12,%d2 4676a: 2f02 movel %d2,%sp@- 4676c: 4eb9 0004 7064 jsr 47064 46772: 588f addql #4,%sp the_attr = &default_attr; 46774: 2042 moveal %d2,%a0 } /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) 46776: 4a90 tstl %a0@ 46778: 6766 beqs 467e0 <== NEVER TAKEN return EINVAL; switch ( the_attr->process_shared ) { 4677a: 4aa8 0004 tstl %a0@(4) 4677e: 6660 bnes 467e0 <== NEVER TAKEN rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 46780: 2039 0006 161c movel 6161c <_Thread_Dispatch_disable_level>,%d0 46786: 5280 addql #1,%d0 */ RTEMS_INLINE_ROUTINE void _CORE_RWLock_Initialize_attributes( CORE_RWLock_Attributes *the_attributes ) { the_attributes->XXX = 0; 46788: 42ae fffc clrl %fp@(-4) 4678c: 23c0 0006 161c movel %d0,6161c <_Thread_Dispatch_disable_level> * the inactive chain of free RWLock control blocks. */ RTEMS_INLINE_ROUTINE POSIX_RWLock_Control *_POSIX_RWLock_Allocate( void ) { return (POSIX_RWLock_Control *) _Objects_Allocate( &_POSIX_RWLock_Information ); 46792: 4879 0006 1784 pea 61784 <_POSIX_RWLock_Information> 46798: 49f9 0004 9b12 lea 49b12 <_Thread_Enable_dispatch>,%a4 4679e: 4eb9 0004 8b88 jsr 48b88 <_Objects_Allocate> */ _Thread_Disable_dispatch(); /* prevents deletion */ the_rwlock = _POSIX_RWLock_Allocate(); if ( !the_rwlock ) { 467a4: 588f addql #4,%sp 467a6: 2640 moveal %d0,%a3 467a8: 4a80 tstl %d0 467aa: 6606 bnes 467b2 _Thread_Enable_dispatch(); 467ac: 4e94 jsr %a4@ return EAGAIN; 467ae: 700b moveq #11,%d0 467b0: 6030 bras 467e2 } _CORE_RWLock_Initialize( &the_rwlock->RWLock, &the_attributes ); 467b2: 486e fffc pea %fp@(-4) 467b6: 486b 0010 pea %a3@(16) 467ba: 4eb9 0004 837c jsr 4837c <_CORE_RWLock_Initialize> uint32_t name ) { _Objects_Set_local_object( information, _Objects_Get_index( the_object->id ), 467c0: 202b 0008 movel %a3@(8),%d0 Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 467c4: 4281 clrl %d1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 467c6: 2079 0006 179c moveal 6179c <_POSIX_RWLock_Information+0x18>,%a0 Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 467cc: 3200 movew %d0,%d1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 467ce: 218b 1c00 movel %a3,%a0@(00000000,%d1:l:4) _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 467d2: 42ab 000c clrl %a3@(12) &_POSIX_RWLock_Information, &the_rwlock->Object, 0 ); *rwlock = the_rwlock->Object.id; 467d6: 2480 movel %d0,%a2@ _Thread_Enable_dispatch(); 467d8: 4e94 jsr %a4@ return 0; 467da: 508f addql #8,%sp 467dc: 4280 clrl %d0 467de: 6002 bras 467e2 switch ( the_attr->process_shared ) { case PTHREAD_PROCESS_PRIVATE: /* only supported values */ break; case PTHREAD_PROCESS_SHARED: default: return EINVAL; 467e0: 7016 moveq #22,%d0 *rwlock = the_rwlock->Object.id; _Thread_Enable_dispatch(); return 0; } 467e2: 4cee 1c04 ffe4 moveml %fp@(-28),%d2/%a2-%a4 467e8: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000467ec : */ int pthread_rwlock_rdlock( pthread_rwlock_t *rwlock ) { 467ec: 4e56 fffc linkw %fp,#-4 467f0: 2f0a movel %a2,%sp@- 467f2: 246e 0008 moveal %fp@(8),%a2 POSIX_RWLock_Control *the_rwlock; Objects_Locations location; if ( !rwlock ) 467f6: 4a8a tstl %a2 467f8: 674e beqs 46848 <== NEVER TAKEN RTEMS_INLINE_ROUTINE POSIX_RWLock_Control *_POSIX_RWLock_Get ( pthread_rwlock_t *RWLock, Objects_Locations *location ) { return (POSIX_RWLock_Control *) _Objects_Get( 467fa: 486e fffc pea %fp@(-4) 467fe: 2f12 movel %a2@,%sp@- 46800: 4879 0006 1784 pea 61784 <_POSIX_RWLock_Information> 46806: 4eb9 0004 8fdc jsr 48fdc <_Objects_Get> return EINVAL; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { 4680c: 4fef 000c lea %sp@(12),%sp 46810: 4aae fffc tstl %fp@(-4) 46814: 6632 bnes 46848 case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_reading( 46816: 42a7 clrl %sp@- 46818: 2040 moveal %d0,%a0 4681a: 42a7 clrl %sp@- 4681c: 4878 0001 pea 1 46820: 2f12 movel %a2@,%sp@- 46822: 4868 0010 pea %a0@(16) 46826: 4eb9 0004 83b0 jsr 483b0 <_CORE_RWLock_Obtain_for_reading> true, /* we are willing to wait forever */ 0, NULL ); _Thread_Enable_dispatch(); 4682c: 4eb9 0004 9b12 jsr 49b12 <_Thread_Enable_dispatch> return _POSIX_RWLock_Translate_core_RWLock_return_code( (CORE_RWLock_Status) _Thread_Executing->Wait.return_code 46832: 2079 0006 1a86 moveal 61a86 <_Per_CPU_Information+0xc>,%a0 0, NULL ); _Thread_Enable_dispatch(); return _POSIX_RWLock_Translate_core_RWLock_return_code( 46838: 2f28 0034 movel %a0@(52),%sp@- 4683c: 4eb9 0004 69ac jsr 469ac <_POSIX_RWLock_Translate_core_RWLock_return_code> 46842: 4fef 0018 lea %sp@(24),%sp 46846: 6002 bras 4684a #endif case OBJECTS_ERROR: break; } return EINVAL; 46848: 7016 moveq #22,%d0 } 4684a: 246e fff8 moveal %fp@(-8),%a2 4684e: 4e5e unlk %fp ... =============================================================================== 00046854 : int pthread_rwlock_timedrdlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { 46854: 4e56 ffec linkw %fp,#-20 46858: 48d7 040c moveml %d2-%d3/%a2,%sp@ 4685c: 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 ) 46860: 4a8a tstl %a2 46862: 6700 008c beqw 468f0 * * 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 ); 46866: 486e fff8 pea %fp@(-8) 4686a: 2f2e 000c movel %fp@(12),%sp@- 4686e: 4eb9 0004 c430 jsr 4c430 <_POSIX_Absolute_timeout_to_ticks> 46874: 486e fffc pea %fp@(-4) 46878: 2400 movel %d0,%d2 4687a: 2f12 movel %a2@,%sp@- 4687c: 4879 0006 1784 pea 61784 <_POSIX_RWLock_Information> 46882: 4eb9 0004 8fdc jsr 48fdc <_Objects_Get> if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { 46888: 4fef 0014 lea %sp@(20),%sp 4688c: 4aae fffc tstl %fp@(-4) 46890: 665e bnes 468f0 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, 46892: 7203 moveq #3,%d1 46894: b282 cmpl %d2,%d1 46896: 57c3 seq %d3 case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_reading( 46898: 42a7 clrl %sp@- 4689a: 2f2e fff8 movel %fp@(-8),%sp@- 4689e: 4483 negl %d3 468a0: 4281 clrl %d1 468a2: 1203 moveb %d3,%d1 468a4: 2040 moveal %d0,%a0 468a6: 2f01 movel %d1,%sp@- 468a8: 2f12 movel %a2@,%sp@- 468aa: 4868 0010 pea %a0@(16) 468ae: 4eb9 0004 83b0 jsr 483b0 <_CORE_RWLock_Obtain_for_reading> do_wait, ticks, NULL ); _Thread_Enable_dispatch(); 468b4: 4eb9 0004 9b12 jsr 49b12 <_Thread_Enable_dispatch> if ( !do_wait ) { 468ba: 4fef 0014 lea %sp@(20),%sp 468be: 4a03 tstb %d3 468c0: 661a bnes 468dc if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) { 468c2: 2079 0006 1a86 moveal 61a86 <_Per_CPU_Information+0xc>,%a0 468c8: 7002 moveq #2,%d0 468ca: b0a8 0034 cmpl %a0@(52),%d0 468ce: 660c bnes 468dc if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID ) 468d0: 4a82 tstl %d2 468d2: 671c beqs 468f0 <== NEVER TAKEN return EINVAL; if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST || 468d4: 5382 subql #1,%d2 468d6: 7201 moveq #1,%d1 468d8: b282 cmpl %d2,%d1 468da: 6418 bccs 468f4 <== ALWAYS TAKEN return ETIMEDOUT; } } return _POSIX_RWLock_Translate_core_RWLock_return_code( (CORE_RWLock_Status) _Thread_Executing->Wait.return_code 468dc: 2079 0006 1a86 moveal 61a86 <_Per_CPU_Information+0xc>,%a0 status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; } } return _POSIX_RWLock_Translate_core_RWLock_return_code( 468e2: 2f28 0034 movel %a0@(52),%sp@- 468e6: 4eb9 0004 69ac jsr 469ac <_POSIX_RWLock_Translate_core_RWLock_return_code> 468ec: 588f addql #4,%sp 468ee: 6006 bras 468f6 _Thread_Enable_dispatch(); if ( !do_wait ) { if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) { if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID ) return EINVAL; 468f0: 7016 moveq #22,%d0 468f2: 6002 bras 468f6 if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST || status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; 468f4: 7074 moveq #116,%d0 case OBJECTS_ERROR: break; } return EINVAL; } 468f6: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 468fc: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00046900 : int pthread_rwlock_timedwrlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { 46900: 4e56 ffec linkw %fp,#-20 46904: 48d7 040c moveml %d2-%d3/%a2,%sp@ 46908: 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 ) 4690c: 4a8a tstl %a2 4690e: 6700 008c beqw 4699c * * 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 ); 46912: 486e fff8 pea %fp@(-8) 46916: 2f2e 000c movel %fp@(12),%sp@- 4691a: 4eb9 0004 c430 jsr 4c430 <_POSIX_Absolute_timeout_to_ticks> 46920: 486e fffc pea %fp@(-4) 46924: 2400 movel %d0,%d2 46926: 2f12 movel %a2@,%sp@- 46928: 4879 0006 1784 pea 61784 <_POSIX_RWLock_Information> 4692e: 4eb9 0004 8fdc jsr 48fdc <_Objects_Get> if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { 46934: 4fef 0014 lea %sp@(20),%sp 46938: 4aae fffc tstl %fp@(-4) 4693c: 665e bnes 4699c (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, 4693e: 7203 moveq #3,%d1 46940: b282 cmpl %d2,%d1 46942: 57c3 seq %d3 case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_writing( 46944: 42a7 clrl %sp@- 46946: 2f2e fff8 movel %fp@(-8),%sp@- 4694a: 4483 negl %d3 4694c: 4281 clrl %d1 4694e: 1203 moveb %d3,%d1 46950: 2040 moveal %d0,%a0 46952: 2f01 movel %d1,%sp@- 46954: 2f12 movel %a2@,%sp@- 46956: 4868 0010 pea %a0@(16) 4695a: 4eb9 0004 8460 jsr 48460 <_CORE_RWLock_Obtain_for_writing> do_wait, ticks, NULL ); _Thread_Enable_dispatch(); 46960: 4eb9 0004 9b12 jsr 49b12 <_Thread_Enable_dispatch> if ( !do_wait && 46966: 4fef 0014 lea %sp@(20),%sp 4696a: 4a03 tstb %d3 4696c: 661a bnes 46988 (_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) { 4696e: 2079 0006 1a86 moveal 61a86 <_Per_CPU_Information+0xc>,%a0 ticks, NULL ); _Thread_Enable_dispatch(); if ( !do_wait && 46974: 7002 moveq #2,%d0 46976: b0a8 0034 cmpl %a0@(52),%d0 4697a: 660c bnes 46988 (_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) { if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID ) 4697c: 4a82 tstl %d2 4697e: 671c beqs 4699c <== NEVER TAKEN return EINVAL; if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST || 46980: 5382 subql #1,%d2 46982: 7201 moveq #1,%d1 46984: b282 cmpl %d2,%d1 46986: 6418 bccs 469a0 <== ALWAYS TAKEN status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; } return _POSIX_RWLock_Translate_core_RWLock_return_code( (CORE_RWLock_Status) _Thread_Executing->Wait.return_code 46988: 2079 0006 1a86 moveal 61a86 <_Per_CPU_Information+0xc>,%a0 if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST || status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; } return _POSIX_RWLock_Translate_core_RWLock_return_code( 4698e: 2f28 0034 movel %a0@(52),%sp@- 46992: 4eb9 0004 69ac jsr 469ac <_POSIX_RWLock_Translate_core_RWLock_return_code> 46998: 588f addql #4,%sp 4699a: 6006 bras 469a2 _Thread_Enable_dispatch(); if ( !do_wait && (_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) { if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID ) return EINVAL; 4699c: 7016 moveq #22,%d0 4699e: 6002 bras 469a2 if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST || status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; 469a0: 7074 moveq #116,%d0 case OBJECTS_ERROR: break; } return EINVAL; } 469a2: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 469a8: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00047084 : int pthread_rwlockattr_setpshared( pthread_rwlockattr_t *attr, int pshared ) { 47084: 4e56 0000 linkw %fp,#0 47088: 206e 0008 moveal %fp@(8),%a0 4708c: 202e 000c movel %fp@(12),%d0 if ( !attr ) 47090: 4a88 tstl %a0 47092: 6712 beqs 470a6 return EINVAL; if ( !attr->is_initialized ) 47094: 4a90 tstl %a0@ 47096: 670e beqs 470a6 return EINVAL; switch ( pshared ) { 47098: 7201 moveq #1,%d1 4709a: b280 cmpl %d0,%d1 4709c: 6508 bcss 470a6 <== NEVER TAKEN case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; 4709e: 2140 0004 movel %d0,%a0@(4) return 0; 470a2: 4280 clrl %d0 470a4: 6002 bras 470a8 default: return EINVAL; 470a6: 7016 moveq #22,%d0 } } 470a8: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00047dc8 : int pthread_setschedparam( pthread_t thread, int policy, struct sched_param *param ) { 47dc8: 4e56 ffe0 linkw %fp,#-32 47dcc: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 47dd0: 242e 000c movel %fp@(12),%d2 47dd4: 282e 0010 movel %fp@(16),%d4 int rc; /* * Check all the parameters */ if ( !param ) 47dd8: 6700 00d8 beqw 47eb2 return EINVAL; rc = _POSIX_Thread_Translate_sched_param( 47ddc: 486e fff8 pea %fp@(-8) 47de0: 486e fffc pea %fp@(-4) 47de4: 2f04 movel %d4,%sp@- 47de6: 2f02 movel %d2,%sp@- 47de8: 4eb9 0004 d2a4 jsr 4d2a4 <_POSIX_Thread_Translate_sched_param> policy, param, &budget_algorithm, &budget_callout ); if ( rc ) 47dee: 4fef 0010 lea %sp@(16),%sp * Check all the parameters */ if ( !param ) return EINVAL; rc = _POSIX_Thread_Translate_sched_param( 47df2: 2600 movel %d0,%d3 policy, param, &budget_algorithm, &budget_callout ); if ( rc ) 47df4: 6600 00c2 bnew 47eb8 return rc; /* * Actually change the scheduling policy and parameters */ the_thread = _Thread_Get( thread, &location ); 47df8: 486e fff4 pea %fp@(-12) 47dfc: 2f2e 0008 movel %fp@(8),%sp@- 47e00: 4eb9 0004 a6e8 jsr 4a6e8 <_Thread_Get> switch ( location ) { 47e06: 508f addql #8,%sp return rc; /* * Actually change the scheduling policy and parameters */ the_thread = _Thread_Get( thread, &location ); 47e08: 2640 moveal %d0,%a3 switch ( location ) { 47e0a: 4aae fff4 tstl %fp@(-12) 47e0e: 6600 00a6 bnew 47eb6 case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 47e12: 246b 0102 moveal %a3@(258),%a2 if ( api->schedpolicy == SCHED_SPORADIC ) 47e16: 7004 moveq #4,%d0 47e18: b0aa 0084 cmpl %a2@(132),%d0 47e1c: 660c bnes 47e2a (void) _Watchdog_Remove( &api->Sporadic_timer ); 47e1e: 486a 00a8 pea %a2@(168) 47e22: 4eb9 0004 b5ec jsr 4b5ec <_Watchdog_Remove> 47e28: 588f addql #4,%sp api->schedpolicy = policy; 47e2a: 2542 0084 movel %d2,%a2@(132) api->schedparam = *param; 47e2e: 4878 001c pea 1c 47e32: 2f04 movel %d4,%sp@- 47e34: 486a 0088 pea %a2@(136) 47e38: 4eb9 0004 fe38 jsr 4fe38 the_thread->budget_algorithm = budget_algorithm; 47e3e: 276e fffc 007a movel %fp@(-4),%a3@(122) the_thread->budget_callout = budget_callout; switch ( api->schedpolicy ) { 47e44: 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; 47e48: 276e fff8 007e movel %fp@(-8),%a3@(126) switch ( api->schedpolicy ) { 47e4e: 4a82 tstl %d2 47e50: 6d58 blts 47eaa <== NEVER TAKEN 47e52: 7002 moveq #2,%d0 47e54: b082 cmpl %d2,%d0 47e56: 6c0a bges 47e62 47e58: 103c 0004 moveb #4,%d0 47e5c: b082 cmpl %d2,%d0 47e5e: 664a bnes 47eaa <== NEVER TAKEN 47e60: 602a bras 47e8c 47e62: 4280 clrl %d0 47e64: 1039 0006 1bf6 moveb 61bf6 ,%d0 case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; 47e6a: 41f9 0006 34d0 lea 634d0 <_Thread_Ticks_per_timeslice>,%a0 47e70: 90aa 0088 subl %a2@(136),%d0 47e74: 2750 0076 movel %a0@,%a3@(118) the_thread->real_priority = 47e78: 2740 0018 movel %d0,%a3@(24) _POSIX_Priority_To_core( api->schedparam.sched_priority ); _Thread_Change_priority( 47e7c: 4878 0001 pea 1 47e80: 2f00 movel %d0,%sp@- 47e82: 2f0b movel %a3,%sp@- 47e84: 4eb9 0004 a2a4 jsr 4a2a4 <_Thread_Change_priority> 47e8a: 601a bras 47ea6 true ); break; case SCHED_SPORADIC: api->ss_high_priority = api->schedparam.sched_priority; 47e8c: 256a 0088 00a4 movel %a2@(136),%a2@(164) _Watchdog_Remove( &api->Sporadic_timer ); 47e92: 486a 00a8 pea %a2@(168) 47e96: 4eb9 0004 b5ec jsr 4b5ec <_Watchdog_Remove> _POSIX_Threads_Sporadic_budget_TSR( 0, the_thread ); 47e9c: 2f0b movel %a3,%sp@- 47e9e: 42a7 clrl %sp@- 47ea0: 4eb9 0004 7ca4 jsr 47ca4 <_POSIX_Threads_Sporadic_budget_TSR> break; 47ea6: 4fef 000c lea %sp@(12),%sp } _Thread_Enable_dispatch(); 47eaa: 4eb9 0004 a6c2 jsr 4a6c2 <_Thread_Enable_dispatch> return 0; 47eb0: 6006 bras 47eb8 /* * Check all the parameters */ if ( !param ) return EINVAL; 47eb2: 7616 moveq #22,%d3 47eb4: 6002 bras 47eb8 #endif case OBJECTS_ERROR: break; } return ESRCH; 47eb6: 7603 moveq #3,%d3 } 47eb8: 2003 movel %d3,%d0 47eba: 4cee 0c1c ffe0 moveml %fp@(-32),%d2-%d4/%a2-%a3 47ec0: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00045d54 : * * 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183 */ void pthread_testcancel( void ) { 45d54: 4e56 0000 linkw %fp,#0 45d58: 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() ) 45d5a: 4ab9 0005 fd58 tstl 5fd58 <_Per_CPU_Information+0x8> 45d60: 6646 bnes 45da8 <== NEVER TAKEN return; thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 45d62: 2079 0005 fd5c moveal 5fd5c <_Per_CPU_Information+0xc>,%a0 45d68: 2039 0005 f8f2 movel 5f8f2 <_Thread_Dispatch_disable_level>,%d0 45d6e: 5280 addql #1,%d0 45d70: 2068 0102 moveal %a0@(258),%a0 45d74: 23c0 0005 f8f2 movel %d0,5f8f2 <_Thread_Dispatch_disable_level> _Thread_Disable_dispatch(); if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 45d7a: 4aa8 00d8 tstl %a0@(216) 45d7e: 660a bnes 45d8a <== NEVER TAKEN /* 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)); 45d80: 4aa8 00e0 tstl %a0@(224) 45d84: 56c2 sne %d2 45d86: 4482 negl %d2 45d88: 6002 bras 45d8c */ void pthread_testcancel( void ) { POSIX_API_Control *thread_support; bool cancel = false; 45d8a: 4202 clrb %d2 <== NOT EXECUTED _Thread_Disable_dispatch(); if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && thread_support->cancelation_requested ) cancel = true; _Thread_Enable_dispatch(); 45d8c: 4eb9 0004 850e jsr 4850e <_Thread_Enable_dispatch> if ( cancel ) 45d92: 4a02 tstb %d2 45d94: 6712 beqs 45da8 _POSIX_Thread_Exit( _Thread_Executing, PTHREAD_CANCELED ); 45d96: 4878 ffff pea ffffffff 45d9a: 2f39 0005 fd5c movel 5fd5c <_Per_CPU_Information+0xc>,%sp@- 45da0: 4eb9 0004 b1c8 jsr 4b1c8 <_POSIX_Thread_Exit> 45da6: 508f addql #8,%sp <== NOT EXECUTED } 45da8: 242e fffc movel %fp@(-4),%d2 45dac: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00046750 : * errno - otherwise */ int rtems_aio_enqueue (rtems_aio_request *req) { 46750: 4e56 ffc0 linkw %fp,#-64 46754: 48d7 3c1c moveml %d2-%d4/%a2-%a5,%sp@ struct sched_param param; /* The queue should be initialized */ AIO_assert (aio_request_queue.initialized == AIO_QUEUE_INITIALIZED); result = pthread_mutex_lock (&aio_request_queue.mutex); 46758: 4879 0006 1378 pea 61378 4675e: 4bf9 0004 7078 lea 47078 ,%a5 * errno - otherwise */ int rtems_aio_enqueue (rtems_aio_request *req) { 46764: 246e 0008 moveal %fp@(8),%a2 struct sched_param param; /* The queue should be initialized */ AIO_assert (aio_request_queue.initialized == AIO_QUEUE_INITIALIZED); result = pthread_mutex_lock (&aio_request_queue.mutex); 46768: 4e95 jsr %a5@ if (result != 0) { 4676a: 588f addql #4,%sp struct sched_param param; /* The queue should be initialized */ AIO_assert (aio_request_queue.initialized == AIO_QUEUE_INITIALIZED); result = pthread_mutex_lock (&aio_request_queue.mutex); 4676c: 2400 movel %d0,%d2 if (result != 0) { 4676e: 670c beqs 4677c <== ALWAYS TAKEN free (req); 46770: 2f0a movel %a2,%sp@- <== NOT EXECUTED 46772: 4eb9 0004 3434 jsr 43434 <== NOT EXECUTED 46778: 6000 01c6 braw 46940 <== NOT EXECUTED return result; } /* _POSIX_PRIORITIZED_IO and _POSIX_PRIORITY_SCHEDULING are defined, we can use aio_reqprio to lower the priority of the request */ pthread_getschedparam (pthread_self(), &policy, ¶m); 4677c: 47f9 0004 784c lea 4784c ,%a3 46782: 4e93 jsr %a3@ 46784: 486e ffdc pea %fp@(-36) 46788: 486e fff8 pea %fp@(-8) 4678c: 2f00 movel %d0,%sp@- 4678e: 4eb9 0004 7478 jsr 47478 req->caller_thread = pthread_self (); 46794: 4e93 jsr %a3@ req->priority = param.sched_priority - req->aiocbp->aio_reqprio; 46796: 206a 0014 moveal %a2@(20),%a0 req->policy = policy; req->aiocbp->error_code = EINPROGRESS; 4679a: 7277 moveq #119,%d1 req->aiocbp->return_value = 0; if ((aio_request_queue.idle_threads == 0) && 4679c: 4fef 000c lea %sp@(12),%sp /* _POSIX_PRIORITIZED_IO and _POSIX_PRIORITY_SCHEDULING are defined, we can use aio_reqprio to lower the priority of the request */ pthread_getschedparam (pthread_self(), &policy, ¶m); req->caller_thread = pthread_self (); 467a0: 2540 0010 movel %d0,%a2@(16) req->priority = param.sched_priority - req->aiocbp->aio_reqprio; 467a4: 202e ffdc movel %fp@(-36),%d0 467a8: 90a8 0014 subl %a0@(20),%d0 req->policy = policy; 467ac: 256e fff8 0008 movel %fp@(-8),%a2@(8) /* _POSIX_PRIORITIZED_IO and _POSIX_PRIORITY_SCHEDULING are defined, we can use aio_reqprio to lower the priority of the request */ pthread_getschedparam (pthread_self(), &policy, ¶m); req->caller_thread = pthread_self (); req->priority = param.sched_priority - req->aiocbp->aio_reqprio; 467b2: 2540 000c movel %d0,%a2@(12) req->policy = policy; req->aiocbp->error_code = EINPROGRESS; 467b6: 2141 0030 movel %d1,%a0@(48) req->aiocbp->return_value = 0; 467ba: 42a8 0034 clrl %a0@(52) if ((aio_request_queue.idle_threads == 0) && 467be: 4ab9 0006 13e0 tstl 613e0 467c4: 6600 00ae bnew 46874 467c8: 7004 moveq #4,%d0 467ca: b0b9 0006 13dc cmpl 613dc ,%d0 467d0: 6d00 00a2 bltw 46874 aio_request_queue.active_threads < AIO_MAX_THREADS) /* we still have empty places on the active_threads chain */ { chain = &aio_request_queue.work_req; r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1); 467d4: 4878 0001 pea 1 467d8: 2f10 movel %a0@,%sp@- 467da: 4879 0006 13c0 pea 613c0 467e0: 4eb9 0004 634a jsr 4634a if (r_chain->new_fd == 1) { 467e6: 4fef 000c lea %sp@(12),%sp 467ea: 7201 moveq #1,%d1 if ((aio_request_queue.idle_threads == 0) && aio_request_queue.active_threads < AIO_MAX_THREADS) /* we still have empty places on the active_threads chain */ { chain = &aio_request_queue.work_req; r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1); 467ec: 2640 moveal %d0,%a3 467ee: 2800 movel %d0,%d4 467f0: 2600 movel %d0,%d3 467f2: 5084 addql #8,%d4 467f4: 0683 0000 001c addil #28,%d3 467fa: 49eb 0020 lea %a3@(32),%a4 if (r_chain->new_fd == 1) { 467fe: b2ab 0018 cmpl %a3@(24),%d1 46802: 665e bnes 46862 RTEMS_INLINE_ROUTINE void _Chain_Prepend( Chain_Control *the_chain, Chain_Node *the_node ) { _Chain_Insert(_Chain_Head(the_chain), the_node); 46804: 2f0a movel %a2,%sp@- 46806: 2f04 movel %d4,%sp@- 46808: 4eb9 0004 8914 jsr 48914 <_Chain_Insert> rtems_chain_prepend (&r_chain->perfd, &req->next_prio); r_chain->new_fd = 0; 4680e: 42ab 0018 clrl %a3@(24) pthread_mutex_init (&r_chain->mutex, NULL); 46812: 42a7 clrl %sp@- 46814: 2f03 movel %d3,%sp@- 46816: 4eb9 0004 6f60 jsr 46f60 pthread_cond_init (&r_chain->cond, NULL); 4681c: 42a7 clrl %sp@- 4681e: 2f0c movel %a4,%sp@- 46820: 4eb9 0004 6c00 jsr 46c00 AIO_printf ("New thread \n"); result = pthread_create (&thid, &aio_request_queue.attr, 46826: 2f0b movel %a3,%sp@- 46828: 487a fbe8 pea %pc@(46412 ) 4682c: 4879 0006 1380 pea 61380 46832: 486e fffc pea %fp@(-4) 46836: 4eb9 0004 7270 jsr 47270 rtems_aio_handle, (void *) r_chain); if (result != 0) { 4683c: 4fef 0028 lea %sp@(40),%sp r_chain->new_fd = 0; pthread_mutex_init (&r_chain->mutex, NULL); pthread_cond_init (&r_chain->cond, NULL); AIO_printf ("New thread \n"); result = pthread_create (&thid, &aio_request_queue.attr, 46840: 2600 movel %d0,%d3 rtems_aio_handle, (void *) r_chain); if (result != 0) { 46842: 6714 beqs 46858 <== ALWAYS TAKEN pthread_mutex_unlock (&aio_request_queue.mutex); 46844: 4879 0006 1378 pea 61378 <== NOT EXECUTED return result; 4684a: 2403 movel %d3,%d2 <== NOT EXECUTED AIO_printf ("New thread \n"); result = pthread_create (&thid, &aio_request_queue.attr, rtems_aio_handle, (void *) r_chain); if (result != 0) { pthread_mutex_unlock (&aio_request_queue.mutex); 4684c: 4eb9 0004 7110 jsr 47110 <== NOT EXECUTED return result; 46852: 588f addql #4,%sp <== NOT EXECUTED 46854: 6000 00ec braw 46942 <== NOT EXECUTED } ++aio_request_queue.active_threads; 46858: 52b9 0006 13dc addql #1,613dc 4685e: 6000 00d4 braw 46934 } else { /* put request in the fd chain it belongs to */ pthread_mutex_lock (&r_chain->mutex); 46862: 2f03 movel %d3,%sp@- 46864: 4e95 jsr %a5@ rtems_aio_insert_prio (&r_chain->perfd, req); 46866: 2f0a movel %a2,%sp@- 46868: 2f04 movel %d4,%sp@- 4686a: 4eb9 0004 664c jsr 4664c pthread_cond_signal (&r_chain->cond); 46870: 2f0c movel %a4,%sp@- 46872: 603c bras 468b0 else { /* the maximum number of threads has been already created even though some of them might be idle. The request belongs to one of the active fd chain */ r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, 46874: 42a7 clrl %sp@- 46876: 2f10 movel %a0@,%sp@- 46878: 49f9 0004 634a lea 4634a ,%a4 4687e: 4879 0006 13c0 pea 613c0 46884: 4e94 jsr %a4@ req->aiocbp->aio_fildes, 0); if (r_chain != NULL) 46886: 4fef 000c lea %sp@(12),%sp else { /* the maximum number of threads has been already created even though some of them might be idle. The request belongs to one of the active fd chain */ r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, 4688a: 2640 moveal %d0,%a3 req->aiocbp->aio_fildes, 0); if (r_chain != NULL) 4688c: 4a80 tstl %d0 4688e: 6734 beqs 468c4 { pthread_mutex_lock (&r_chain->mutex); 46890: 2600 movel %d0,%d3 46892: 0683 0000 001c addil #28,%d3 46898: 2f03 movel %d3,%sp@- 4689a: 4eb9 0004 7078 jsr 47078 rtems_aio_insert_prio (&r_chain->perfd, req); 468a0: 2f0a movel %a2,%sp@- 468a2: 486b 0008 pea %a3@(8) 468a6: 4eb9 0004 664c jsr 4664c pthread_cond_signal (&r_chain->cond); 468ac: 486b 0020 pea %a3@(32) 468b0: 4eb9 0004 6ca4 jsr 46ca4 pthread_mutex_unlock (&r_chain->mutex); 468b6: 2f03 movel %d3,%sp@- 468b8: 4eb9 0004 7110 jsr 47110 468be: 4fef 0014 lea %sp@(20),%sp 468c2: 6070 bras 46934 } else { /* or to the idle chain */ chain = &aio_request_queue.idle_req; r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1); 468c4: 4878 0001 pea 1 468c8: 206a 0014 moveal %a2@(20),%a0 468cc: 2f10 movel %a0@,%sp@- 468ce: 4879 0006 13cc pea 613cc 468d4: 4e94 jsr %a4@ if (r_chain->new_fd == 1) { 468d6: 4fef 000c lea %sp@(12),%sp 468da: 7201 moveq #1,%d1 } else { /* or to the idle chain */ chain = &aio_request_queue.idle_req; r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1); 468dc: 2640 moveal %d0,%a3 468de: 5080 addql #8,%d0 if (r_chain->new_fd == 1) { 468e0: b2ab 0018 cmpl %a3@(24),%d1 468e4: 662c bnes 46912 468e6: 2f0a movel %a2,%sp@- 468e8: 2f00 movel %d0,%sp@- 468ea: 4eb9 0004 8914 jsr 48914 <_Chain_Insert> /* If this is a new fd chain we signal the idle threads that might be waiting for requests */ AIO_printf (" New chain on waiting queue \n "); rtems_chain_prepend (&r_chain->perfd, &req->next_prio); r_chain->new_fd = 0; 468f0: 42ab 0018 clrl %a3@(24) pthread_mutex_init (&r_chain->mutex, NULL); 468f4: 42a7 clrl %sp@- 468f6: 486b 001c pea %a3@(28) 468fa: 4eb9 0004 6f60 jsr 46f60 pthread_cond_init (&r_chain->cond, NULL); 46900: 42a7 clrl %sp@- 46902: 486b 0020 pea %a3@(32) 46906: 4eb9 0004 6c00 jsr 46c00 4690c: 4fef 0018 lea %sp@(24),%sp 46910: 600c bras 4691e } else /* just insert the request in the existing fd chain */ rtems_aio_insert_prio (&r_chain->perfd, req); 46912: 2f0a movel %a2,%sp@- 46914: 2f00 movel %d0,%sp@- 46916: 4eb9 0004 664c jsr 4664c 4691c: 508f addql #8,%sp if (aio_request_queue.idle_threads > 0) 4691e: 4ab9 0006 13e0 tstl 613e0 46924: 6f0e bles 46934 <== ALWAYS TAKEN pthread_cond_signal (&aio_request_queue.new_req); 46926: 4879 0006 137c pea 6137c <== NOT EXECUTED 4692c: 4eb9 0004 6ca4 jsr 46ca4 <== NOT EXECUTED 46932: 588f addql #4,%sp <== NOT EXECUTED } } pthread_mutex_unlock (&aio_request_queue.mutex); 46934: 4879 0006 1378 pea 61378 4693a: 4eb9 0004 7110 jsr 47110 return 0; 46940: 588f addql #4,%sp } 46942: 2002 movel %d2,%d0 46944: 4cee 3c1c ffc0 moveml %fp@(-64),%d2-%d4/%a2-%a5 4694a: 4e5e unlk %fp ... =============================================================================== 00046412 : * NULL - if error */ static void * rtems_aio_handle (void *arg) { 46412: 4e56 ffa8 linkw %fp,#-88 46416: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ pthread_mutex_unlock (&r_chain->mutex); pthread_mutex_lock (&aio_request_queue.mutex); if (rtems_chain_is_empty (chain)) { clock_gettime (CLOCK_REALTIME, &timeout); 4641a: 240e movel %fp,%d2 node = rtems_chain_first (chain); req = (rtems_aio_request *) node; /* See _POSIX_PRIORITIZE_IO and _POSIX_PRIORITY_SCHEDULING discussion in rtems_aio_enqueue () */ pthread_getschedparam (pthread_self(), &policy, ¶m); 4641c: 280e movel %fp,%d4 /* acquire the mutex of the current fd chain. we don't need to lock the queue mutex since we can add requests to idle fd chains or even active ones if the working request has been extracted from the chain */ result = pthread_mutex_lock (&r_chain->mutex); 4641e: 2e3c 0004 7078 movel #290936,%d7 46424: 4bf9 0004 7110 lea 47110 ,%a5 pthread_mutex_unlock (&r_chain->mutex); pthread_mutex_lock (&aio_request_queue.mutex); if (rtems_chain_is_empty (chain)) { clock_gettime (CLOCK_REALTIME, &timeout); 4642a: 0682 ffff fff4 addil #-12,%d2 46430: 2c3c 0004 6ad0 movel #289488,%d6 timeout.tv_sec += 3; timeout.tv_nsec = 0; result = pthread_cond_timedwait (&r_chain->cond, 46436: 2a3c 0004 6d18 movel #290072,%d5 */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 4643c: 49f9 0004 88b8 lea 488b8 <_Chain_Extract>,%a4 node = rtems_chain_first (chain); req = (rtems_aio_request *) node; /* See _POSIX_PRIORITIZE_IO and _POSIX_PRIORITY_SCHEDULING discussion in rtems_aio_enqueue () */ pthread_getschedparam (pthread_self(), &policy, ¶m); 46442: 0684 ffff ffd8 addil #-40,%d4 static void * rtems_aio_handle (void *arg) { rtems_aio_request_chain *r_chain = arg; 46448: 246e 0008 moveal %fp@(8),%a2 /* acquire the mutex of the current fd chain. we don't need to lock the queue mutex since we can add requests to idle fd chains or even active ones if the working request has been extracted from the chain */ result = pthread_mutex_lock (&r_chain->mutex); 4644c: 260a movel %a2,%d3 4644e: 0683 0000 001c addil #28,%d3 46454: 2047 moveal %d7,%a0 46456: 2f03 movel %d3,%sp@- 46458: 4e90 jsr %a0@ if (result != 0) 4645a: 588f addql #4,%sp 4645c: 4a80 tstl %d0 4645e: 6600 01e0 bnew 46640 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 46462: 200a movel %a2,%d0 46464: 0680 0000 000c addil #12,%d0 } } AIO_printf ("Thread finished\n"); return NULL; } 4646a: 266a 0008 moveal %a2@(8),%a3 /* If the locked chain is not empty, take the first request extract it, unlock the chain and process the request, in this way the user can supply more requests to this fd chain */ if (!rtems_chain_is_empty (chain)) { 4646e: b08b cmpl %a3,%d0 46470: 6700 00da beqw 4654c node = rtems_chain_first (chain); req = (rtems_aio_request *) node; /* See _POSIX_PRIORITIZE_IO and _POSIX_PRIORITY_SCHEDULING discussion in rtems_aio_enqueue () */ pthread_getschedparam (pthread_self(), &policy, ¶m); 46474: 41f9 0004 784c lea 4784c ,%a0 4647a: 2d48 ffd0 movel %a0,%fp@(-48) 4647e: 4e90 jsr %a0@ 46480: 2f04 movel %d4,%sp@- 46482: 486e fffc pea %fp@(-4) 46486: 2f00 movel %d0,%sp@- 46488: 4eb9 0004 7478 jsr 47478 param.sched_priority = req->priority; pthread_setschedparam (pthread_self(), req->policy, ¶m); 4648e: 202b 0008 movel %a3@(8),%d0 req = (rtems_aio_request *) node; /* See _POSIX_PRIORITIZE_IO and _POSIX_PRIORITY_SCHEDULING discussion in rtems_aio_enqueue () */ pthread_getschedparam (pthread_self(), &policy, ¶m); param.sched_priority = req->priority; 46492: 2d6b 000c ffd8 movel %a3@(12),%fp@(-40) pthread_setschedparam (pthread_self(), req->policy, ¶m); 46498: 206e ffd0 moveal %fp@(-48),%a0 4649c: 2d40 ffd4 movel %d0,%fp@(-44) 464a0: 4e90 jsr %a0@ 464a2: 2f04 movel %d4,%sp@- 464a4: 2f2e ffd4 movel %fp@(-44),%sp@- 464a8: 2f00 movel %d0,%sp@- 464aa: 4eb9 0004 7860 jsr 47860 464b0: 2f0b movel %a3,%sp@- 464b2: 4e94 jsr %a4@ rtems_chain_extract (node); pthread_mutex_unlock (&r_chain->mutex); 464b4: 2f03 movel %d3,%sp@- 464b6: 4e95 jsr %a5@ switch (req->aiocbp->aio_lio_opcode) { 464b8: 206b 0014 moveal %a3@(20),%a0 464bc: 4fef 0020 lea %sp@(32),%sp 464c0: 7202 moveq #2,%d1 464c2: 2028 002c movel %a0@(44),%d0 464c6: b280 cmpl %d0,%d1 464c8: 672a beqs 464f4 464ca: 123c 0003 moveb #3,%d1 464ce: b280 cmpl %d0,%d1 464d0: 6740 beqs 46512 <== NEVER TAKEN 464d2: 123c 0001 moveb #1,%d1 464d6: b280 cmpl %d0,%d1 464d8: 6648 bnes 46522 <== NEVER TAKEN case LIO_READ: AIO_printf ("read\n"); result = pread (req->aiocbp->aio_fildes, 464da: 2f28 0008 movel %a0@(8),%sp@- 464de: 2f28 0004 movel %a0@(4),%sp@- 464e2: 2f28 0010 movel %a0@(16),%sp@- 464e6: 2f28 000c movel %a0@(12),%sp@- 464ea: 2f10 movel %a0@,%sp@- 464ec: 4eb9 0004 fbf6 jsr 4fbf6 464f2: 6018 bras 4650c req->aiocbp->aio_nbytes, req->aiocbp->aio_offset); break; case LIO_WRITE: AIO_printf ("write\n"); result = pwrite (req->aiocbp->aio_fildes, 464f4: 2f28 0008 movel %a0@(8),%sp@- 464f8: 2f28 0004 movel %a0@(4),%sp@- 464fc: 2f28 0010 movel %a0@(16),%sp@- 46500: 2f28 000c movel %a0@(12),%sp@- 46504: 2f10 movel %a0@,%sp@- 46506: 4eb9 0004 fcbe jsr 4fcbe (void *) req->aiocbp->aio_buf, req->aiocbp->aio_nbytes, req->aiocbp->aio_offset); break; 4650c: 4fef 0014 lea %sp@(20),%sp 46510: 600a bras 4651c case LIO_SYNC: AIO_printf ("sync\n"); result = fsync (req->aiocbp->aio_fildes); 46512: 2f10 movel %a0@,%sp@- <== NOT EXECUTED 46514: 4eb9 0004 c438 jsr 4c438 <== NOT EXECUTED break; 4651a: 588f addql #4,%sp <== NOT EXECUTED default: result = -1; } if (result == -1) { 4651c: 72ff moveq #-1,%d1 4651e: b280 cmpl %d0,%d1 46520: 661a bnes 4653c <== ALWAYS TAKEN req->aiocbp->return_value = -1; 46522: 266b 0014 moveal %a3@(20),%a3 <== NOT EXECUTED 46526: 70ff moveq #-1,%d0 <== NOT EXECUTED 46528: 2740 0034 movel %d0,%a3@(52) <== NOT EXECUTED req->aiocbp->error_code = errno; 4652c: 4eb9 0004 f150 jsr 4f150 <__errno> <== NOT EXECUTED 46532: 2040 moveal %d0,%a0 <== NOT EXECUTED 46534: 2750 0030 movel %a0@,%a3@(48) <== NOT EXECUTED 46538: 6000 ff12 braw 4644c <== NOT EXECUTED } else { req->aiocbp->return_value = result; 4653c: 206b 0014 moveal %a3@(20),%a0 46540: 2140 0034 movel %d0,%a0@(52) req->aiocbp->error_code = 0; 46544: 42a8 0030 clrl %a0@(48) 46548: 6000 ff02 braw 4644c struct timespec timeout; AIO_printf ("Chain is empty [WQ], wait for work\n"); pthread_mutex_unlock (&r_chain->mutex); 4654c: 2f03 movel %d3,%sp@- 4654e: 4e95 jsr %a5@ pthread_mutex_lock (&aio_request_queue.mutex); 46550: 4879 0006 1378 pea 61378 46556: 2047 moveal %d7,%a0 46558: 4e90 jsr %a0@ if (rtems_chain_is_empty (chain)) 4655a: 508f addql #8,%sp 4655c: b7ea 0008 cmpal %a2@(8),%a3 46560: 6600 00d0 bnew 46632 { clock_gettime (CLOCK_REALTIME, &timeout); 46564: 2f02 movel %d2,%sp@- 46566: 4878 0001 pea 1 4656a: 2046 moveal %d6,%a0 timeout.tv_sec += 3; timeout.tv_nsec = 0; result = pthread_cond_timedwait (&r_chain->cond, 4656c: 47ea 0020 lea %a2@(32),%a3 pthread_mutex_unlock (&r_chain->mutex); pthread_mutex_lock (&aio_request_queue.mutex); if (rtems_chain_is_empty (chain)) { clock_gettime (CLOCK_REALTIME, &timeout); 46570: 4e90 jsr %a0@ timeout.tv_sec += 3; 46572: 56ae fff4 addql #3,%fp@(-12) timeout.tv_nsec = 0; result = pthread_cond_timedwait (&r_chain->cond, 46576: 2045 moveal %d5,%a0 46578: 2f02 movel %d2,%sp@- 4657a: 4879 0006 1378 pea 61378 if (rtems_chain_is_empty (chain)) { clock_gettime (CLOCK_REALTIME, &timeout); timeout.tv_sec += 3; timeout.tv_nsec = 0; 46580: 42ae fff8 clrl %fp@(-8) result = pthread_cond_timedwait (&r_chain->cond, 46584: 2f0b movel %a3,%sp@- 46586: 4e90 jsr %a0@ &aio_request_queue.mutex, &timeout); /* If no requests were added to the chain we delete the fd chain from the queue and start working with idle fd chains */ if (result == ETIMEDOUT) { 46588: 4fef 0014 lea %sp@(20),%sp 4658c: 7274 moveq #116,%d1 4658e: b280 cmpl %d0,%d1 46590: 6600 00a0 bnew 46632 46594: 2f0a movel %a2,%sp@- 46596: 4e94 jsr %a4@ rtems_chain_extract (&r_chain->next_fd); pthread_mutex_destroy (&r_chain->mutex); 46598: 2f03 movel %d3,%sp@- 4659a: 4eb9 0004 6e40 jsr 46e40 pthread_cond_destroy (&r_chain->cond); 465a0: 2f0b movel %a3,%sp@- 465a2: 4eb9 0004 6b3c jsr 46b3c free (r_chain); 465a8: 2f0a movel %a2,%sp@- 465aa: 4eb9 0004 3434 jsr 43434 /* If the idle chain is empty sleep for 3 seconds and wait for a signal. The thread now becomes idle. */ if (rtems_chain_is_empty (&aio_request_queue.idle_req)) { 465b0: 4fef 0010 lea %sp@(16),%sp 465b4: 41f9 0006 13d0 lea 613d0 ,%a0 465ba: b1f9 0006 13cc cmpal 613cc ,%a0 465c0: 6650 bnes 46612 AIO_printf ("Chain is empty [IQ], wait for work\n"); ++aio_request_queue.idle_threads; --aio_request_queue.active_threads; clock_gettime (CLOCK_REALTIME, &timeout); 465c2: 2f02 movel %d2,%sp@- 465c4: 4878 0001 pea 1 /* If the idle chain is empty sleep for 3 seconds and wait for a signal. The thread now becomes idle. */ if (rtems_chain_is_empty (&aio_request_queue.idle_req)) { AIO_printf ("Chain is empty [IQ], wait for work\n"); ++aio_request_queue.idle_threads; 465c8: 52b9 0006 13e0 addql #1,613e0 --aio_request_queue.active_threads; clock_gettime (CLOCK_REALTIME, &timeout); 465ce: 2046 moveal %d6,%a0 signal. The thread now becomes idle. */ if (rtems_chain_is_empty (&aio_request_queue.idle_req)) { AIO_printf ("Chain is empty [IQ], wait for work\n"); ++aio_request_queue.idle_threads; --aio_request_queue.active_threads; 465d0: 53b9 0006 13dc subql #1,613dc clock_gettime (CLOCK_REALTIME, &timeout); 465d6: 4e90 jsr %a0@ timeout.tv_sec += 3; 465d8: 56ae fff4 addql #3,%fp@(-12) timeout.tv_nsec = 0; result = pthread_cond_timedwait (&aio_request_queue.new_req, 465dc: 2045 moveal %d5,%a0 465de: 2f02 movel %d2,%sp@- 465e0: 4879 0006 1378 pea 61378 465e6: 4879 0006 137c pea 6137c ++aio_request_queue.idle_threads; --aio_request_queue.active_threads; clock_gettime (CLOCK_REALTIME, &timeout); timeout.tv_sec += 3; timeout.tv_nsec = 0; 465ec: 42ae fff8 clrl %fp@(-8) result = pthread_cond_timedwait (&aio_request_queue.new_req, 465f0: 4e90 jsr %a0@ &aio_request_queue.mutex, &timeout); /* If no new fd chain was added in the idle requests then this thread is finished */ if (result == ETIMEDOUT) { 465f2: 4fef 0014 lea %sp@(20),%sp 465f6: 7274 moveq #116,%d1 465f8: b280 cmpl %d0,%d1 465fa: 6616 bnes 46612 <== NEVER TAKEN AIO_printf ("Etimeout\n"); --aio_request_queue.idle_threads; pthread_mutex_unlock (&aio_request_queue.mutex); 465fc: 4879 0006 1378 pea 61378 /* If no new fd chain was added in the idle requests then this thread is finished */ if (result == ETIMEDOUT) { AIO_printf ("Etimeout\n"); --aio_request_queue.idle_threads; 46602: 53b9 0006 13e0 subql #1,613e0 pthread_mutex_unlock (&aio_request_queue.mutex); 46608: 4eb9 0004 7110 jsr 47110 return NULL; 4660e: 588f addql #4,%sp 46610: 602e bras 46640 } } AIO_printf ("Thread finished\n"); return NULL; } 46612: 2479 0006 13cc moveal 613cc ,%a2 } } /* Otherwise move this chain to the working chain and start the loop all over again */ AIO_printf ("Work on idle\n"); --aio_request_queue.idle_threads; 46618: 53b9 0006 13e0 subql #1,613e0 ++aio_request_queue.active_threads; 4661e: 52b9 0006 13dc addql #1,613dc 46624: 2f0a movel %a2,%sp@- 46626: 4e94 jsr %a4@ node = rtems_chain_first (&aio_request_queue.idle_req); rtems_chain_extract (node); r_chain = (rtems_aio_request_chain *) node; rtems_aio_move_to_work (r_chain); 46628: 2f0a movel %a2,%sp@- 4662a: 4eb9 0004 63dc jsr 463dc 46630: 508f addql #8,%sp } } /* If there was a request added in the initial fd chain then release the mutex and process it */ pthread_mutex_unlock (&aio_request_queue.mutex); 46632: 4879 0006 1378 pea 61378 46638: 4e95 jsr %a5@ 4663a: 588f addql #4,%sp 4663c: 6000 fe0e braw 4644c } } AIO_printf ("Thread finished\n"); return NULL; } 46640: 4280 clrl %d0 46642: 4cee 3cfc ffa8 moveml %fp@(-88),%d2-%d7/%a2-%a5 46648: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00046260 : * 0 - if initialization succeeded */ int rtems_aio_init (void) { 46260: 4e56 0000 linkw %fp,#0 46264: 2f02 movel %d2,%sp@- int result = 0; result = pthread_attr_init (&aio_request_queue.attr); 46266: 4879 0006 1380 pea 61380 4626c: 4eb9 0004 721c jsr 4721c if (result != 0) 46272: 588f addql #4,%sp int rtems_aio_init (void) { int result = 0; result = pthread_attr_init (&aio_request_queue.attr); 46274: 2400 movel %d0,%d2 if (result != 0) 46276: 6600 00c8 bnew 46340 return result; result = 4627a: 42a7 clrl %sp@- 4627c: 4879 0006 1380 pea 61380 46282: 4eb9 0004 7248 jsr 47248 pthread_attr_setdetachstate (&aio_request_queue.attr, PTHREAD_CREATE_DETACHED); if (result != 0) 46288: 508f addql #8,%sp 4628a: 4a80 tstl %d0 4628c: 670e beqs 4629c <== ALWAYS TAKEN pthread_attr_destroy (&aio_request_queue.attr); 4628e: 4879 0006 1380 pea 61380 <== NOT EXECUTED 46294: 4eb9 0004 7200 jsr 47200 <== NOT EXECUTED 4629a: 588f addql #4,%sp <== NOT EXECUTED result = pthread_mutex_init (&aio_request_queue.mutex, NULL); 4629c: 42a7 clrl %sp@- 4629e: 4879 0006 1378 pea 61378 462a4: 4eb9 0004 6f60 jsr 46f60 if (result != 0) 462aa: 508f addql #8,%sp 462ac: 4a80 tstl %d0 462ae: 670e beqs 462be <== ALWAYS TAKEN pthread_attr_destroy (&aio_request_queue.attr); 462b0: 4879 0006 1380 pea 61380 <== NOT EXECUTED 462b6: 4eb9 0004 7200 jsr 47200 <== NOT EXECUTED 462bc: 588f addql #4,%sp <== NOT EXECUTED result = pthread_cond_init (&aio_request_queue.new_req, NULL); 462be: 42a7 clrl %sp@- 462c0: 4879 0006 137c pea 6137c 462c6: 4eb9 0004 6c00 jsr 46c00 if (result != 0) { 462cc: 508f addql #8,%sp result = pthread_mutex_init (&aio_request_queue.mutex, NULL); if (result != 0) pthread_attr_destroy (&aio_request_queue.attr); result = pthread_cond_init (&aio_request_queue.new_req, NULL); 462ce: 2400 movel %d0,%d2 if (result != 0) { 462d0: 671a beqs 462ec <== ALWAYS TAKEN pthread_mutex_destroy (&aio_request_queue.mutex); 462d2: 4879 0006 1378 pea 61378 <== NOT EXECUTED 462d8: 4eb9 0004 6e40 jsr 46e40 <== NOT EXECUTED pthread_attr_destroy (&aio_request_queue.attr); 462de: 4879 0006 1380 pea 61380 <== NOT EXECUTED 462e4: 4eb9 0004 7200 jsr 47200 <== NOT EXECUTED 462ea: 508f addql #8,%sp <== NOT EXECUTED { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; 462ec: 42b9 0006 13c4 clrl 613c4 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 462f2: 203c 0006 13c4 movel #398276,%d0 462f8: 23c0 0006 13c0 movel %d0,613c0 head->previous = NULL; tail->previous = head; 462fe: 203c 0006 13c0 movel #398272,%d0 46304: 23c0 0006 13c8 movel %d0,613c8 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 4630a: 203c 0006 13d0 movel #398288,%d0 46310: 23c0 0006 13cc movel %d0,613cc head->previous = NULL; tail->previous = head; 46316: 203c 0006 13cc movel #398284,%d0 4631c: 23c0 0006 13d4 movel %d0,613d4 rtems_chain_initialize_empty (&aio_request_queue.work_req); rtems_chain_initialize_empty (&aio_request_queue.idle_req); aio_request_queue.active_threads = 0; aio_request_queue.idle_threads = 0; aio_request_queue.initialized = AIO_QUEUE_INITIALIZED; 46322: 203c 0000 b00b movel #45067,%d0 { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; 46328: 42b9 0006 13d0 clrl 613d0 } rtems_chain_initialize_empty (&aio_request_queue.work_req); rtems_chain_initialize_empty (&aio_request_queue.idle_req); aio_request_queue.active_threads = 0; 4632e: 42b9 0006 13dc clrl 613dc aio_request_queue.idle_threads = 0; 46334: 42b9 0006 13e0 clrl 613e0 aio_request_queue.initialized = AIO_QUEUE_INITIALIZED; 4633a: 23c0 0006 13d8 movel %d0,613d8 return result; } 46340: 2002 movel %d2,%d0 46342: 242e fffc movel %fp@(-4),%d2 46346: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004664c : * NONE */ void rtems_aio_insert_prio (rtems_chain_control *chain, rtems_aio_request *req) { 4664c: 4e56 0000 linkw %fp,#0 46650: 202e 0008 movel %fp@(8),%d0 } } AIO_printf ("Thread finished\n"); return NULL; } 46654: 2240 moveal %d0,%a1 * NONE */ void rtems_aio_insert_prio (rtems_chain_control *chain, rtems_aio_request *req) { 46656: 2f0b movel %a3,%sp@- 46658: 2f0a movel %a2,%sp@- 4665a: 246e 000c moveal %fp@(12),%a2 } } AIO_printf ("Thread finished\n"); return NULL; } 4665e: 2059 moveal %a1@+,%a0 rtems_chain_node *node; AIO_printf ("FD exists \n"); node = rtems_chain_first (chain); if (rtems_chain_is_empty (chain)) { 46660: b3c8 cmpal %a0,%a1 46662: 672e beqs 46692 <== NEVER TAKEN AIO_printf ("First in chain \n"); rtems_chain_prepend (chain, &req->next_prio); } else { AIO_printf ("Add by priority \n"); int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio; 46664: 2668 0014 moveal %a0@(20),%a3 46668: 202b 0014 movel %a3@(20),%d0 while (req->aiocbp->aio_reqprio > prio && 4666c: 266a 0014 moveal %a2@(20),%a3 46670: 222b 0014 movel %a3@(20),%d1 46674: 600a bras 46680 } } AIO_printf ("Thread finished\n"); return NULL; } 46676: 2050 moveal %a0@,%a0 <== NOT EXECUTED int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio; while (req->aiocbp->aio_reqprio > prio && !rtems_chain_is_tail (chain, node)) { node = rtems_chain_next (node); prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio; 46678: 2668 0014 moveal %a0@(20),%a3 <== NOT EXECUTED 4667c: 202b 0014 movel %a3@(20),%d0 <== NOT EXECUTED rtems_chain_prepend (chain, &req->next_prio); } else { AIO_printf ("Add by priority \n"); int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio; while (req->aiocbp->aio_reqprio > prio && 46680: b081 cmpl %d1,%d0 46682: 6c04 bges 46688 <== ALWAYS TAKEN 46684: b3c8 cmpal %a0,%a1 <== NOT EXECUTED 46686: 66ee bnes 46676 <== NOT EXECUTED RTEMS_INLINE_ROUTINE void rtems_chain_insert( rtems_chain_node *after_node, rtems_chain_node *the_node ) { _Chain_Insert( after_node, the_node ); 46688: 2d4a 000c movel %a2,%fp@(12) 4668c: 2d68 0004 0008 movel %a0@(4),%fp@(8) } rtems_chain_insert (node->previous, &req->next_prio); } } 46692: 245f moveal %sp@+,%a2 46694: 265f moveal %sp@+,%a3 46696: 4e5e unlk %fp 46698: 4ef9 0004 8914 jmp 48914 <_Chain_Insert> =============================================================================== 000463dc : * NONE */ void rtems_aio_move_to_work (rtems_aio_request_chain *r_chain) { 463dc: 4e56 0000 linkw %fp,#0 463e0: 226e 0008 moveal %fp@(8),%a1 } } AIO_printf ("Thread finished\n"); return NULL; } 463e4: 2079 0006 13c0 moveal 613c0 ,%a0 rtems_chain_node *node; node = rtems_chain_first (&aio_request_queue.work_req); temp = (rtems_aio_request_chain *) node; while (temp->fildes < r_chain->fildes && 463ea: 2029 0014 movel %a1@(20),%d0 463ee: 6002 bras 463f2 } } AIO_printf ("Thread finished\n"); return NULL; } 463f0: 2050 moveal %a0@,%a0 rtems_chain_node *node; node = rtems_chain_first (&aio_request_queue.work_req); temp = (rtems_aio_request_chain *) node; while (temp->fildes < r_chain->fildes && 463f2: b0a8 0014 cmpl %a0@(20),%d0 463f6: 6f08 bles 46400 463f8: b1fc 0006 13c4 cmpal #398276,%a0 463fe: 66f0 bnes 463f0 <== ALWAYS TAKEN 46400: 2f09 movel %a1,%sp@- 46402: 2f28 0004 movel %a0@(4),%sp@- 46406: 4eb9 0004 8914 jsr 48914 <_Chain_Insert> 4640c: 508f addql #8,%sp node = rtems_chain_next (node); temp = (rtems_aio_request_chain *) node; } rtems_chain_insert (rtems_chain_previous (node), &r_chain->next_fd); } 4640e: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000466f4 : * AIO_NOTCANCELED - if request was not canceled * AIO_CANCELED - if request was canceled */ int rtems_aio_remove_req (rtems_chain_control *chain, struct aiocb *aiocbp) { 466f4: 4e56 0000 linkw %fp,#0 } } AIO_printf ("Thread finished\n"); return NULL; } 466f8: 206e 0008 moveal %fp@(8),%a0 * AIO_NOTCANCELED - if request was not canceled * AIO_CANCELED - if request was canceled */ int rtems_aio_remove_req (rtems_chain_control *chain, struct aiocb *aiocbp) { 466fc: 2f0a movel %a2,%sp@- 466fe: 202e 000c movel %fp@(12),%d0 } } AIO_printf ("Thread finished\n"); return NULL; } 46702: 2458 moveal %a0@+,%a2 * AIO_CANCELED - if request was canceled */ int rtems_aio_remove_req (rtems_chain_control *chain, struct aiocb *aiocbp) { if (rtems_chain_is_empty (chain)) 46704: b1ca cmpal %a2,%a0 46706: 6608 bnes 46710 46708: 6038 bras 46742 } } AIO_printf ("Thread finished\n"); return NULL; } 4670a: 2451 moveal %a1@,%a2 <== NOT EXECUTED rtems_chain_node *node = rtems_chain_first (chain); rtems_aio_request *current; current = (rtems_aio_request *) node; while (!rtems_chain_is_tail (chain, node) && current->aiocbp != aiocbp) { 4670c: b1ca cmpal %a2,%a0 <== NOT EXECUTED 4670e: 6736 beqs 46746 <== NOT EXECUTED node = rtems_chain_next (node); current = (rtems_aio_request *) node; 46710: 224a moveal %a2,%a1 rtems_chain_node *node = rtems_chain_first (chain); rtems_aio_request *current; current = (rtems_aio_request *) node; while (!rtems_chain_is_tail (chain, node) && current->aiocbp != aiocbp) { 46712: b0aa 0014 cmpl %a2@(20),%d0 46716: 66f2 bnes 4670a <== NEVER TAKEN 46718: 2f0a movel %a2,%sp@- 4671a: 4eb9 0004 88b8 jsr 488b8 <_Chain_Extract> if (rtems_chain_is_tail (chain, node)) return AIO_NOTCANCELED; else { rtems_chain_extract (node); current->aiocbp->error_code = ECANCELED; 46720: 206a 0014 moveal %a2@(20),%a0 46724: 203c 0000 008c movel #140,%d0 4672a: 2140 0030 movel %d0,%a0@(48) current->aiocbp->return_value = -1; 4672e: 70ff moveq #-1,%d0 46730: 2140 0034 movel %d0,%a0@(52) free (current); 46734: 2f0a movel %a2,%sp@- 46736: 4eb9 0004 3434 jsr 43434 } return AIO_CANCELED; 4673c: 508f addql #8,%sp 4673e: 4280 clrl %d0 46740: 6006 bras 46748 */ int rtems_aio_remove_req (rtems_chain_control *chain, struct aiocb *aiocbp) { if (rtems_chain_is_empty (chain)) return AIO_ALLDONE; 46742: 7002 moveq #2,%d0 46744: 6002 bras 46748 node = rtems_chain_next (node); current = (rtems_aio_request *) node; } if (rtems_chain_is_tail (chain, node)) return AIO_NOTCANCELED; 46746: 7001 moveq #1,%d0 <== NOT EXECUTED current->aiocbp->return_value = -1; free (current); } return AIO_CANCELED; } 46748: 246e fffc moveal %fp@(-4),%a2 4674c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004cf60 : */ rtems_status_code rtems_barrier_delete( rtems_id id ) { 4cf60: 4e56 fffc linkw %fp,#-4 4cf64: 2f0a movel %a2,%sp@- Objects_Id id, Objects_Locations *location ) { return (Barrier_Control *) _Objects_Get( &_Barrier_Information, id, location ); 4cf66: 486e fffc pea %fp@(-4) 4cf6a: 2f2e 0008 movel %fp@(8),%sp@- 4cf6e: 4879 0006 15b8 pea 615b8 <_Barrier_Information> 4cf74: 4eb9 0004 8c14 jsr 48c14 <_Objects_Get> Barrier_Control *the_barrier; Objects_Locations location; the_barrier = _Barrier_Get( id, &location ); switch ( location ) { 4cf7a: 4fef 000c lea %sp@(12),%sp 4cf7e: 2440 moveal %d0,%a2 4cf80: 4aae fffc tstl %fp@(-4) 4cf84: 663a bnes 4cfc0 <== NEVER TAKEN case OBJECTS_LOCAL: _CORE_barrier_Flush( 4cf86: 4878 0002 pea 2 4cf8a: 42a7 clrl %sp@- 4cf8c: 486a 0014 pea %a2@(20) 4cf90: 4eb9 0004 9db8 jsr 49db8 <_Thread_queue_Flush> &the_barrier->Barrier, NULL, CORE_BARRIER_WAS_DELETED ); _Objects_Close( &_Barrier_Information, &the_barrier->Object ); 4cf96: 2f0a movel %a2,%sp@- 4cf98: 4879 0006 15b8 pea 615b8 <_Barrier_Information> 4cf9e: 4eb9 0004 883c jsr 4883c <_Objects_Close> */ RTEMS_INLINE_ROUTINE void _Barrier_Free ( Barrier_Control *the_barrier ) { _Objects_Free( &_Barrier_Information, &the_barrier->Object ); 4cfa4: 2f0a movel %a2,%sp@- 4cfa6: 4879 0006 15b8 pea 615b8 <_Barrier_Information> 4cfac: 4eb9 0004 8ab0 jsr 48ab0 <_Objects_Free> _Barrier_Free( the_barrier ); _Thread_Enable_dispatch(); 4cfb2: 4eb9 0004 977a jsr 4977a <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 4cfb8: 4fef 001c lea %sp@(28),%sp 4cfbc: 4280 clrl %d0 4cfbe: 6002 bras 4cfc2 #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 4cfc0: 7004 moveq #4,%d0 } 4cfc2: 246e fff8 moveal %fp@(-8),%a2 4cfc6: 4e5e unlk %fp ... =============================================================================== 000464a4 : rtems_chain_control *chain, rtems_event_set events, rtems_interval timeout, rtems_chain_node **node_ptr ) { 464a4: 4e56 ffe0 linkw %fp,#-32 464a8: 48d7 0c7c moveml %d2-%d6/%a2-%a3,%sp@ while ( sc == RTEMS_SUCCESSFUL && (node = rtems_chain_get( chain )) == NULL ) { rtems_event_set out; sc = rtems_event_receive( 464ac: 260e movel %fp,%d3 */ RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get( rtems_chain_control *the_chain ) { return _Chain_Get( the_chain ); 464ae: 47f9 0004 6a80 lea 46a80 <_Chain_Get>,%a3 464b4: 5983 subql #4,%d3 464b6: 45f9 0004 5930 lea 45930 ,%a2 rtems_chain_control *chain, rtems_event_set events, rtems_interval timeout, rtems_chain_node **node_ptr ) { 464bc: 2c2e 0008 movel %fp@(8),%d6 464c0: 2a2e 000c movel %fp@(12),%d5 464c4: 282e 0010 movel %fp@(16),%d4 464c8: 6012 bras 464dc while ( sc == RTEMS_SUCCESSFUL && (node = rtems_chain_get( chain )) == NULL ) { rtems_event_set out; sc = rtems_event_receive( 464ca: 2f03 movel %d3,%sp@- 464cc: 2f04 movel %d4,%sp@- 464ce: 42a7 clrl %sp@- 464d0: 2f05 movel %d5,%sp@- 464d2: 4e92 jsr %a2@ ) { rtems_status_code sc = RTEMS_SUCCESSFUL; rtems_chain_node *node = NULL; while ( 464d4: 4fef 0010 lea %sp@(16),%sp 464d8: 4a80 tstl %d0 464da: 660c bnes 464e8 <== ALWAYS TAKEN 464dc: 2f06 movel %d6,%sp@- 464de: 4e93 jsr %a3@ sc == RTEMS_SUCCESSFUL && (node = rtems_chain_get( chain )) == NULL 464e0: 588f addql #4,%sp 464e2: 2400 movel %d0,%d2 464e4: 67e4 beqs 464ca 464e6: 4280 clrl %d0 timeout, &out ); } *node_ptr = node; 464e8: 206e 0014 moveal %fp@(20),%a0 464ec: 2082 movel %d2,%a0@ return sc; } 464ee: 4cee 0c7c ffe0 moveml %fp@(-32),%d2-%d6/%a2-%a3 464f4: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004f3b8 : #include rtems_status_code rtems_clock_get_tod_timeval( struct timeval *time ) { 4f3b8: 4e56 fff8 linkw %fp,#-8 4f3bc: 2f0a movel %a2,%sp@- 4f3be: 246e 0008 moveal %fp@(8),%a2 4f3c2: 2f02 movel %d2,%sp@- if ( !time ) 4f3c4: 4a8a tstl %a2 4f3c6: 673c beqs 4f404 <== NEVER TAKEN return RTEMS_INVALID_ADDRESS; if ( !_TOD_Is_set ) 4f3c8: 4a39 0007 752c tstb 7752c <_TOD_Is_set> 4f3ce: 6738 beqs 4f408 <== NEVER TAKEN { ISR_Level level; struct timespec now; suseconds_t useconds; _ISR_Disable(level); 4f3d0: 203c 0000 0700 movel #1792,%d0 4f3d6: 40c2 movew %sr,%d2 4f3d8: 8082 orl %d2,%d0 4f3da: 46c0 movew %d0,%sr _TOD_Get( &now ); 4f3dc: 486e fff8 pea %fp@(-8) 4f3e0: 4eb9 0005 355c jsr 5355c <_TOD_Get> _ISR_Enable(level); 4f3e6: 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; 4f3e8: 243c 0000 03e8 movel #1000,%d2 return RTEMS_NOT_DEFINED; _TOD_Get_timeval( time ); return RTEMS_SUCCESSFUL; 4f3ee: 588f addql #4,%sp _ISR_Disable(level); _TOD_Get( &now ); _ISR_Enable(level); useconds = (suseconds_t)now.tv_nsec; 4f3f0: 202e fffc movel %fp@(-4),%d0 useconds /= (suseconds_t)TOD_NANOSECONDS_PER_MICROSECOND; time->tv_sec = now.tv_sec; time->tv_usec = useconds; 4f3f4: 4c42 0800 remsl %d2,%d0,%d0 _ISR_Enable(level); useconds = (suseconds_t)now.tv_nsec; useconds /= (suseconds_t)TOD_NANOSECONDS_PER_MICROSECOND; time->tv_sec = now.tv_sec; 4f3f8: 24ae fff8 movel %fp@(-8),%a2@ time->tv_usec = useconds; 4f3fc: 2540 0004 movel %d0,%a2@(4) 4f400: 4280 clrl %d0 4f402: 6006 bras 4f40a rtems_status_code rtems_clock_get_tod_timeval( struct timeval *time ) { if ( !time ) return RTEMS_INVALID_ADDRESS; 4f404: 7009 moveq #9,%d0 4f406: 6002 bras 4f40a if ( !_TOD_Is_set ) return RTEMS_NOT_DEFINED; 4f408: 700b moveq #11,%d0 _TOD_Get_timeval( time ); return RTEMS_SUCCESSFUL; } 4f40a: 242e fff0 movel %fp@(-16),%d2 4f40e: 246e fff4 moveal %fp@(-12),%a2 4f412: 4e5e unlk %fp ... =============================================================================== 00047dc0 : #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) { 47dc0: 4e56 fff0 linkw %fp,#-16 47dc4: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ 47dc8: 286e 0008 moveal %fp@(8),%a4 uint32_t i; uint32_t api_index; Thread_Control *the_thread; Objects_Information *information; if ( !routine ) 47dcc: 4a8c tstl %a4 47dce: 6738 beqs 47e08 <== NEVER TAKEN 47dd0: 45f9 0006 0e08 lea 60e08 <_Objects_Information_table+0x4>,%a2 #if !defined(RTEMS_POSIX_API) || defined(RTEMS_DEBUG) if ( !_Objects_Information_table[ api_index ] ) continue; #endif information = _Objects_Information_table[ api_index ][ 1 ]; 47dd6: 205a moveal %a2@+,%a0 47dd8: 2668 0004 moveal %a0@(4),%a3 if ( !information ) 47ddc: 4a8b tstl %a3 47dde: 6720 beqs 47e00 47de0: 7401 moveq #1,%d2 47de2: 6012 bras 47df6 continue; for ( i=1 ; i <= information->maximum ; i++ ) { the_thread = (Thread_Control *)information->local_table[ i ]; 47de4: 206b 0018 moveal %a3@(24),%a0 47de8: 2030 2c00 movel %a0@(00000000,%d2:l:4),%d0 if ( !the_thread ) 47dec: 6706 beqs 47df4 <== NEVER TAKEN continue; (*routine)(the_thread); 47dee: 2f00 movel %d0,%sp@- 47df0: 4e94 jsr %a4@ 47df2: 588f addql #4,%sp information = _Objects_Information_table[ api_index ][ 1 ]; if ( !information ) continue; for ( i=1 ; i <= information->maximum ; i++ ) { 47df4: 5282 addql #1,%d2 47df6: 4280 clrl %d0 47df8: 302b 000e movew %a3@(14),%d0 47dfc: b082 cmpl %d2,%d0 47dfe: 64e4 bccs 47de4 Objects_Information *information; if ( !routine ) return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { 47e00: b5fc 0006 0e14 cmpal #396820,%a2 47e06: 66ce bnes 47dd6 (*routine)(the_thread); } } } 47e08: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 47e0e: 4e5e unlk %fp ... =============================================================================== 00050188 : rtems_status_code rtems_partition_return_buffer( rtems_id id, void *buffer ) { 50188: 4e56 fffc linkw %fp,#-4 5018c: 2f0a movel %a2,%sp@- 5018e: 2f02 movel %d2,%sp@- Objects_Id id, Objects_Locations *location ) { return (Partition_Control *) _Objects_Get( &_Partition_Information, id, location ); 50190: 486e fffc pea %fp@(-4) 50194: 2f2e 0008 movel %fp@(8),%sp@- 50198: 4879 0007 73b2 pea 773b2 <_Partition_Information> 5019e: 242e 000c movel %fp@(12),%d2 501a2: 4eb9 0005 46c4 jsr 546c4 <_Objects_Get> register Partition_Control *the_partition; Objects_Locations location; the_partition = _Partition_Get( id, &location ); switch ( location ) { 501a8: 4fef 000c lea %sp@(12),%sp 501ac: 2440 moveal %d0,%a2 501ae: 4aae fffc tstl %fp@(-4) 501b2: 663e bnes 501f2 ) { void *starting; void *ending; starting = the_partition->starting_address; 501b4: 202a 0010 movel %a2@(16),%d0 ending = _Addresses_Add_offset( starting, the_partition->length ); 501b8: 222a 0014 movel %a2@(20),%d1 const void *address, const void *base, const void *limit ) { return (address >= base && address <= limit); 501bc: b082 cmpl %d2,%d0 501be: 6240 bhis 50200 RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset ( const void *base, uintptr_t offset ) { return (void *)((uintptr_t)base + offset); 501c0: d280 addl %d0,%d1 const void *address, const void *base, const void *limit ) { return (address >= base && address <= limit); 501c2: b282 cmpl %d2,%d1 501c4: 653a bcss 50200 <== NEVER TAKEN RTEMS_INLINE_ROUTINE int32_t _Addresses_Subtract ( const void *left, const void *right ) { return (int32_t) ((const char *) left - (const char *) right); 501c6: 2202 movel %d2,%d1 501c8: 9280 subl %d0,%d1 501ca: 2001 movel %d1,%d0 offset = (uint32_t) _Addresses_Subtract( the_buffer, the_partition->starting_address ); return ((offset % the_partition->buffer_size) == 0); 501cc: 4c6a 0001 0018 remul %a2@(24),%d1,%d0 starting = the_partition->starting_address; ending = _Addresses_Add_offset( starting, the_partition->length ); return ( _Addresses_Is_in_range( the_buffer, starting, ending ) && 501d2: 4a81 tstl %d1 501d4: 662a bnes 50200 RTEMS_INLINE_ROUTINE void _Partition_Free_buffer ( Partition_Control *the_partition, Chain_Node *the_buffer ) { _Chain_Append( &the_partition->Memory, the_buffer ); 501d6: 2f02 movel %d2,%sp@- 501d8: 486a 0024 pea %a2@(36) 501dc: 4eb9 0005 2d24 jsr 52d24 <_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; 501e2: 53aa 0020 subql #1,%a2@(32) _Thread_Enable_dispatch(); 501e6: 4eb9 0005 526e jsr 5526e <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 501ec: 508f addql #8,%sp 501ee: 4280 clrl %d0 501f0: 6002 bras 501f4 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 501f2: 7004 moveq #4,%d0 } 501f4: 242e fff4 movel %fp@(-12),%d2 501f8: 246e fff8 moveal %fp@(-8),%a2 501fc: 4e5e unlk %fp 501fe: 4e75 rts _Partition_Free_buffer( the_partition, buffer ); the_partition->number_of_used_blocks -= 1; _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } _Thread_Enable_dispatch(); 50200: 4eb9 0005 526e jsr 5526e <_Thread_Enable_dispatch> return RTEMS_INVALID_ADDRESS; 50206: 7009 moveq #9,%d0 50208: 60ea bras 501f4 ... =============================================================================== 0004f7ac : rtems_status_code rtems_port_internal_to_external( rtems_id id, void *internal, void **external ) { 4f7ac: 4e56 fffc linkw %fp,#-4 4f7b0: 2f0a movel %a2,%sp@- 4f7b2: 246e 0010 moveal %fp@(16),%a2 4f7b6: 2f02 movel %d2,%sp@- 4f7b8: 242e 000c movel %fp@(12),%d2 register Dual_ported_memory_Control *the_port; Objects_Locations location; uint32_t ending; if ( !external ) 4f7bc: 4a8a tstl %a2 4f7be: 6740 beqs 4f800 <== NEVER TAKEN 4f7c0: 486e fffc pea %fp@(-4) 4f7c4: 2f2e 0008 movel %fp@(8),%sp@- 4f7c8: 4879 0007 7378 pea 77378 <_Dual_ported_memory_Information> 4f7ce: 4eb9 0005 46c4 jsr 546c4 <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_port = _Dual_ported_memory_Get( id, &location ); switch ( location ) { 4f7d4: 4fef 000c lea %sp@(12),%sp 4f7d8: 2040 moveal %d0,%a0 4f7da: 4aae fffc tstl %fp@(-4) 4f7de: 6624 bnes 4f804 <== NEVER TAKEN RTEMS_INLINE_ROUTINE int32_t _Addresses_Subtract ( const void *left, const void *right ) { return (int32_t) ((const char *) left - (const char *) right); 4f7e0: 2002 movel %d2,%d0 4f7e2: 90a8 0010 subl %a0@(16),%d0 case OBJECTS_LOCAL: ending = _Addresses_Subtract( internal, the_port->internal_base ); if ( ending > the_port->length ) 4f7e6: b0a8 0018 cmpl %a0@(24),%d0 4f7ea: 6304 blss 4f7f0 *external = internal; 4f7ec: 2482 movel %d2,%a2@ 4f7ee: 6006 bras 4f7f6 RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset ( const void *base, uintptr_t offset ) { return (void *)((uintptr_t)base + offset); 4f7f0: d0a8 0014 addl %a0@(20),%d0 4f7f4: 2480 movel %d0,%a2@ else *external = _Addresses_Add_offset( the_port->external_base, ending ); _Thread_Enable_dispatch(); 4f7f6: 4eb9 0005 526e jsr 5526e <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 4f7fc: 4280 clrl %d0 4f7fe: 6006 bras 4f806 register Dual_ported_memory_Control *the_port; Objects_Locations location; uint32_t ending; if ( !external ) return RTEMS_INVALID_ADDRESS; 4f800: 7009 moveq #9,%d0 4f802: 6002 bras 4f806 #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 4f804: 7004 moveq #4,%d0 } 4f806: 242e fff4 movel %fp@(-12),%d2 4f80a: 246e fff8 moveal %fp@(-8),%a2 4f80e: 4e5e unlk %fp ... =============================================================================== 0004bfb4 : rtems_status_code rtems_rate_monotonic_get_statistics( rtems_id id, rtems_rate_monotonic_period_statistics *statistics ) { 4bfb4: 4e56 fffc linkw %fp,#-4 4bfb8: 2f0a movel %a2,%sp@- 4bfba: 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 ) 4bfbe: 4a8a tstl %a2 4bfc0: 6700 0096 beqw 4c058 4bfc4: 486e fffc pea %fp@(-4) 4bfc8: 2f2e 0008 movel %fp@(8),%sp@- 4bfcc: 4879 0006 04ec pea 604ec <_Rate_monotonic_Information> 4bfd2: 4eb9 0004 8540 jsr 48540 <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 4bfd8: 4fef 000c lea %sp@(12),%sp 4bfdc: 2040 moveal %d0,%a0 4bfde: 4aae fffc tstl %fp@(-4) 4bfe2: 6678 bnes 4c05c <== NEVER TAKEN case OBJECTS_LOCAL: dst = statistics; src = &the_period->Statistics; dst->count = src->count; 4bfe4: 24a8 0054 movel %a0@(84),%a2@ dst->missed_count = src->missed_count; 4bfe8: 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 ); 4bfee: 2028 005c movel %a0@(92),%d0 4bff2: 2228 0060 movel %a0@(96),%d1 4bff6: 2540 0008 movel %d0,%a2@(8) 4bffa: 2541 000c movel %d1,%a2@(12) _Timestamp_To_timespec( &src->max_cpu_time, &dst->max_cpu_time ); 4bffe: 2028 0064 movel %a0@(100),%d0 4c002: 2228 0068 movel %a0@(104),%d1 4c006: 2540 0010 movel %d0,%a2@(16) 4c00a: 2541 0014 movel %d1,%a2@(20) _Timestamp_To_timespec( &src->total_cpu_time, &dst->total_cpu_time ); 4c00e: 2028 006c movel %a0@(108),%d0 4c012: 2228 0070 movel %a0@(112),%d1 4c016: 2540 0018 movel %d0,%a2@(24) 4c01a: 2541 001c movel %d1,%a2@(28) _Timestamp_To_timespec( &src->min_wall_time, &dst->min_wall_time ); 4c01e: 2028 0074 movel %a0@(116),%d0 4c022: 2228 0078 movel %a0@(120),%d1 4c026: 2540 0020 movel %d0,%a2@(32) 4c02a: 2541 0024 movel %d1,%a2@(36) _Timestamp_To_timespec( &src->max_wall_time, &dst->max_wall_time ); 4c02e: 2028 007c movel %a0@(124),%d0 4c032: 2228 0080 movel %a0@(128),%d1 4c036: 2540 0028 movel %d0,%a2@(40) 4c03a: 2541 002c movel %d1,%a2@(44) _Timestamp_To_timespec( &src->total_wall_time, &dst->total_wall_time ); 4c03e: 2028 0084 movel %a0@(132),%d0 4c042: 2228 0088 movel %a0@(136),%d1 4c046: 2540 0030 movel %d0,%a2@(48) 4c04a: 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(); 4c04e: 4eb9 0004 90ea jsr 490ea <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 4c054: 4280 clrl %d0 4c056: 6006 bras 4c05e Rate_monotonic_Control *the_period; rtems_rate_monotonic_period_statistics *dst; Rate_monotonic_Statistics *src; if ( !statistics ) return RTEMS_INVALID_ADDRESS; 4c058: 7009 moveq #9,%d0 4c05a: 6002 bras 4c05e #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 4c05c: 7004 moveq #4,%d0 } 4c05e: 246e fff8 moveal %fp@(-8),%a2 4c062: 4e5e unlk %fp ... =============================================================================== 00046586 : rtems_status_code rtems_rate_monotonic_period( rtems_id id, rtems_interval length ) { 46586: 4e56 ffec linkw %fp,#-20 4658a: 48d7 041c moveml %d2-%d4/%a2,%sp@ Objects_Id id, Objects_Locations *location ) { return (Rate_monotonic_Control *) _Objects_Get( &_Rate_monotonic_Information, id, location ); 4658e: 486e fffc pea %fp@(-4) 46592: 262e 0008 movel %fp@(8),%d3 46596: 2f03 movel %d3,%sp@- 46598: 4879 0006 04ec pea 604ec <_Rate_monotonic_Information> 4659e: 242e 000c movel %fp@(12),%d2 465a2: 4eb9 0004 8540 jsr 48540 <_Objects_Get> rtems_rate_monotonic_period_states local_state; ISR_Level level; the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 465a8: 4fef 000c lea %sp@(12),%sp 465ac: 2440 moveal %d0,%a2 465ae: 4aae fffc tstl %fp@(-4) 465b2: 6600 0148 bnew 466fc case OBJECTS_LOCAL: if ( !_Thread_Is_executing( the_period->owner ) ) { 465b6: 2039 0006 0a4c movel 60a4c <_Per_CPU_Information+0xc>,%d0 465bc: b0aa 0040 cmpl %a2@(64),%d0 465c0: 670c beqs 465ce _Thread_Enable_dispatch(); 465c2: 4eb9 0004 90ea jsr 490ea <_Thread_Enable_dispatch> return RTEMS_NOT_OWNER_OF_RESOURCE; 465c8: 7417 moveq #23,%d2 465ca: 6000 0132 braw 466fe } if ( length == RTEMS_PERIOD_STATUS ) { 465ce: 4a82 tstl %d2 465d0: 6622 bnes 465f4 switch ( the_period->state ) { 465d2: 202a 0038 movel %a2@(56),%d0 465d6: 7204 moveq #4,%d1 465d8: b280 cmpl %d0,%d1 465da: 650c bcss 465e8 <== NEVER TAKEN 465dc: 41f9 0005 db46 lea 5db46 ,%a0 465e2: 2430 0c00 movel %a0@(00000000,%d0:l:4),%d2 465e6: 6002 bras 465ea 465e8: 4282 clrl %d2 <== NOT EXECUTED case RATE_MONOTONIC_ACTIVE: default: /* unreached -- only to remove warnings */ return_value = RTEMS_SUCCESSFUL; break; } _Thread_Enable_dispatch(); 465ea: 4eb9 0004 90ea jsr 490ea <_Thread_Enable_dispatch> return( return_value ); 465f0: 6000 010c braw 466fe } _ISR_Disable( level ); 465f4: 203c 0000 0700 movel #1792,%d0 465fa: 40c4 movew %sr,%d4 465fc: 8084 orl %d4,%d0 465fe: 46c0 movew %d0,%sr if ( the_period->state == RATE_MONOTONIC_INACTIVE ) { 46600: 202a 0038 movel %a2@(56),%d0 46604: 664a bnes 46650 _ISR_Enable( level ); 46606: 46c4 movew %d4,%sr /* * Baseline statistics information for the beginning of a period. */ _Rate_monotonic_Initiate_statistics( the_period ); 46608: 2f0a movel %a2,%sp@- 4660a: 4eb9 0004 641a jsr 4641a <_Rate_monotonic_Initiate_statistics> the_period->state = RATE_MONOTONIC_ACTIVE; 46610: 7002 moveq #2,%d0 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 46612: 223c 0004 6948 movel #289096,%d1 46618: 2540 0038 movel %d0,%a2@(56) 4661c: 2541 002c movel %d1,%a2@(44) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 46620: 42aa 0018 clrl %a2@(24) the_watchdog->routine = routine; the_watchdog->id = id; 46624: 2543 0030 movel %d3,%a2@(48) the_watchdog->user_data = user_data; 46628: 42aa 0034 clrl %a2@(52) _Rate_monotonic_Timeout, id, NULL ); the_period->next_length = length; 4662c: 2542 003c movel %d2,%a2@(60) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 46630: 2542 001c movel %d2,%a2@(28) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 46634: 486a 0010 pea %a2@(16) 46638: 4879 0006 06a2 pea 606a2 <_Watchdog_Ticks_chain> 4663e: 4eb9 0004 9e70 jsr 49e70 <_Watchdog_Insert> _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 46644: 4eb9 0004 90ea jsr 490ea <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 4664a: 4fef 000c lea %sp@(12),%sp 4664e: 606c bras 466bc } if ( the_period->state == RATE_MONOTONIC_ACTIVE ) { 46650: 7202 moveq #2,%d1 46652: b280 cmpl %d0,%d1 46654: 666a bnes 466c0 /* * Update statistics from the concluding period. */ _Rate_monotonic_Update_statistics( the_period ); 46656: 2f0a movel %a2,%sp@- 46658: 4eb9 0004 6492 jsr 46492 <_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; 4665e: 7001 moveq #1,%d0 the_period->next_length = length; 46660: 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; 46664: 2540 0038 movel %d0,%a2@(56) the_period->next_length = length; _ISR_Enable( level ); 46668: 46c4 movew %d4,%sr _Thread_Executing->Wait.id = the_period->Object.id; 4666a: 2079 0006 0a4c moveal 60a4c <_Per_CPU_Information+0xc>,%a0 46670: 216a 0008 0020 movel %a2@(8),%a0@(32) _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 46676: 4878 4000 pea 4000 4667a: 2f08 movel %a0,%sp@- 4667c: 4eb9 0004 987c jsr 4987c <_Thread_Set_state> /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); 46682: 203c 0000 0700 movel #1792,%d0 46688: 40c1 movew %sr,%d1 4668a: 8081 orl %d1,%d0 4668c: 46c0 movew %d0,%sr local_state = the_period->state; the_period->state = RATE_MONOTONIC_ACTIVE; 4668e: 7402 moveq #2,%d2 /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); local_state = the_period->state; 46690: 202a 0038 movel %a2@(56),%d0 the_period->state = RATE_MONOTONIC_ACTIVE; 46694: 2542 0038 movel %d2,%a2@(56) _ISR_Enable( level ); 46698: 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 ) 4669a: 7203 moveq #3,%d1 4669c: 4fef 000c lea %sp@(12),%sp 466a0: b280 cmpl %d0,%d1 466a2: 6612 bnes 466b6 _Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 466a4: 4878 4000 pea 4000 466a8: 2f39 0006 0a4c movel 60a4c <_Per_CPU_Information+0xc>,%sp@- 466ae: 4eb9 0004 8da8 jsr 48da8 <_Thread_Clear_state> 466b4: 508f addql #8,%sp _Thread_Enable_dispatch(); 466b6: 4eb9 0004 90ea jsr 490ea <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 466bc: 4282 clrl %d2 466be: 603e bras 466fe } if ( the_period->state == RATE_MONOTONIC_EXPIRED ) { 466c0: 7204 moveq #4,%d1 466c2: b280 cmpl %d0,%d1 466c4: 6636 bnes 466fc <== NEVER TAKEN /* * Update statistics from the concluding period */ _Rate_monotonic_Update_statistics( the_period ); 466c6: 2f0a movel %a2,%sp@- 466c8: 4eb9 0004 6492 jsr 46492 <_Rate_monotonic_Update_statistics> _ISR_Enable( level ); 466ce: 46c4 movew %d4,%sr the_period->state = RATE_MONOTONIC_ACTIVE; 466d0: 7002 moveq #2,%d0 the_period->next_length = length; 466d2: 2542 003c movel %d2,%a2@(60) */ _Rate_monotonic_Update_statistics( the_period ); _ISR_Enable( level ); the_period->state = RATE_MONOTONIC_ACTIVE; 466d6: 2540 0038 movel %d0,%a2@(56) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 466da: 2542 001c movel %d2,%a2@(28) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 466de: 486a 0010 pea %a2@(16) the_period->next_length = length; _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); return RTEMS_TIMEOUT; 466e2: 7406 moveq #6,%d2 466e4: 4879 0006 06a2 pea 606a2 <_Watchdog_Ticks_chain> 466ea: 4eb9 0004 9e70 jsr 49e70 <_Watchdog_Insert> the_period->state = RATE_MONOTONIC_ACTIVE; the_period->next_length = length; _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 466f0: 4eb9 0004 90ea jsr 490ea <_Thread_Enable_dispatch> return RTEMS_TIMEOUT; 466f6: 4fef 000c lea %sp@(12),%sp 466fa: 6002 bras 466fe #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 466fc: 7404 moveq #4,%d2 } 466fe: 2002 movel %d2,%d0 46700: 4cee 041c ffec moveml %fp@(-20),%d2-%d4/%a2 46706: 4e5e unlk %fp ... =============================================================================== 00050d70 : rtems_status_code rtems_region_get_segment_size( rtems_id id, void *segment, uintptr_t *size ) { 50d70: 4e56 fffc linkw %fp,#-4 50d74: 2f03 movel %d3,%sp@- 50d76: 262e 0010 movel %fp@(16),%d3 50d7a: 2f02 movel %d2,%sp@- 50d7c: 242e 000c movel %fp@(12),%d2 Objects_Locations location; rtems_status_code return_status = RTEMS_SUCCESSFUL; register Region_Control *the_region; if ( !segment ) 50d80: 6768 beqs 50dea return RTEMS_INVALID_ADDRESS; if ( !size ) 50d82: 4a83 tstl %d3 50d84: 6764 beqs 50dea return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); 50d86: 2f39 0007 75bc movel 775bc <_RTEMS_Allocator_Mutex>,%sp@- 50d8c: 4eb9 0005 2c90 jsr 52c90 <_API_Mutex_Lock> 50d92: 486e fffc pea %fp@(-4) 50d96: 2f2e 0008 movel %fp@(8),%sp@- 50d9a: 4879 0007 7426 pea 77426 <_Region_Information> 50da0: 4eb9 0005 468c jsr 5468c <_Objects_Get_no_protection> the_region = _Region_Get( id, &location ); switch ( location ) { 50da6: 222e fffc movel %fp@(-4),%d1 50daa: 4fef 0010 lea %sp@(16),%sp 50dae: 6708 beqs 50db8 50db0: 7001 moveq #1,%d0 50db2: b081 cmpl %d1,%d0 50db4: 661a bnes 50dd0 <== NEVER TAKEN 50db6: 601c bras 50dd4 case OBJECTS_LOCAL: if ( !_Heap_Size_of_alloc_area( &the_region->Memory, segment, size ) ) 50db8: 2f03 movel %d3,%sp@- 50dba: 2040 moveal %d0,%a0 50dbc: 2f02 movel %d2,%sp@- 50dbe: 4868 0068 pea %a0@(104) 50dc2: 4eb9 0005 4104 jsr 54104 <_Heap_Size_of_alloc_area> 50dc8: 4fef 000c lea %sp@(12),%sp 50dcc: 4a00 tstb %d0 50dce: 6708 beqs 50dd8 <== NEVER TAKEN void *segment, uintptr_t *size ) { Objects_Locations location; rtems_status_code return_status = RTEMS_SUCCESSFUL; 50dd0: 4282 clrl %d2 50dd2: 6006 bras 50dda case OBJECTS_REMOTE: /* this error cannot be returned */ break; #endif case OBJECTS_ERROR: return_status = RTEMS_INVALID_ID; 50dd4: 7404 moveq #4,%d2 50dd6: 6002 bras 50dda the_region = _Region_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: if ( !_Heap_Size_of_alloc_area( &the_region->Memory, segment, size ) ) return_status = RTEMS_INVALID_ADDRESS; 50dd8: 7409 moveq #9,%d2 <== NOT EXECUTED case OBJECTS_ERROR: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 50dda: 2f39 0007 75bc movel 775bc <_RTEMS_Allocator_Mutex>,%sp@- 50de0: 4eb9 0005 2cf0 jsr 52cf0 <_API_Mutex_Unlock> return return_status; 50de6: 588f addql #4,%sp 50de8: 6002 bras 50dec if ( !segment ) return RTEMS_INVALID_ADDRESS; if ( !size ) return RTEMS_INVALID_ADDRESS; 50dea: 7409 moveq #9,%d2 break; } _RTEMS_Unlock_allocator(); return return_status; } 50dec: 2002 movel %d2,%d0 50dee: 242e fff4 movel %fp@(-12),%d2 50df2: 262e fff8 movel %fp@(-8),%d3 50df6: 4e5e unlk %fp ... =============================================================================== 00045e94 : void rtems_shutdown_executive( uint32_t result ) { if ( _System_state_Is_up( _System_state_Get() ) ) { 45e94: 7003 moveq #3,%d0 */ void rtems_shutdown_executive( uint32_t result ) { 45e96: 4e56 0000 linkw %fp,#0 if ( _System_state_Is_up( _System_state_Get() ) ) { 45e9a: b0b9 0005 eb14 cmpl 5eb14 <_System_state_Current>,%d0 45ea0: 6618 bnes 45eba 45ea2: 103c 0004 moveb #4,%d0 * 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 ); 45ea6: 4879 0005 e994 pea 5e994 <_Thread_BSP_context> 45eac: 23c0 0005 eb14 movel %d0,5eb14 <_System_state_Current> 45eb2: 4eb9 0004 8a5a jsr 48a5a <_CPU_Context_Restart_self> 45eb8: 588f addql #4,%sp <== NOT EXECUTED _System_state_Set( SYSTEM_STATE_SHUTDOWN ); _Thread_Stop_multitasking(); } _Internal_error_Occurred( 45eba: 4878 0014 pea 14 45ebe: 4878 0001 pea 1 45ec2: 42a7 clrl %sp@- 45ec4: 4eb9 0004 6a08 jsr 46a08 <_Internal_error_Occurred> ... =============================================================================== 000513d0 : rtems_status_code rtems_signal_send( rtems_id id, rtems_signal_set signal_set ) { 513d0: 4e56 fffc linkw %fp,#-4 513d4: 2f03 movel %d3,%sp@- 513d6: 2f02 movel %d2,%sp@- 513d8: 242e 000c movel %fp@(12),%d2 register Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; ASR_Information *asr; if ( !signal_set ) 513dc: 677a beqs 51458 <== NEVER TAKEN return RTEMS_INVALID_NUMBER; the_thread = _Thread_Get( id, &location ); 513de: 486e fffc pea %fp@(-4) 513e2: 2f2e 0008 movel %fp@(8),%sp@- 513e6: 4eb9 0005 5294 jsr 55294 <_Thread_Get> switch ( location ) { 513ec: 508f addql #8,%sp 513ee: 4aae fffc tstl %fp@(-4) 513f2: 6668 bnes 5145c <== NEVER TAKEN case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; 513f4: 2240 moveal %d0,%a1 513f6: 2069 00fe moveal %a1@(254),%a0 asr = &api->Signal; if ( ! _ASR_Is_null_handler( asr->handler ) ) { 513fa: 4aa8 000a tstl %a0@(10) 513fe: 674e beqs 5144e if ( asr->is_enabled ) { 51400: 4a28 0008 tstb %a0@(8) 51404: 672c beqs 51432 rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 51406: 223c 0000 0700 movel #1792,%d1 5140c: 40c3 movew %sr,%d3 5140e: 8283 orl %d3,%d1 51410: 46c1 movew %d1,%sr *signal_set |= signals; 51412: 85a8 0012 orl %d2,%a0@(18) _ISR_Enable( _level ); 51416: 46c3 movew %d3,%sr _ASR_Post_signals( signal_set, &asr->signals_posted ); if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 51418: 4ab9 0007 798a tstl 7798a <_Per_CPU_Information+0x8> 5141e: 6724 beqs 51444 51420: b0b9 0007 798e cmpl 7798e <_Per_CPU_Information+0xc>,%d0 51426: 661c bnes 51444 <== NEVER TAKEN _Thread_Dispatch_necessary = true; 51428: 7001 moveq #1,%d0 5142a: 13c0 0007 799a moveb %d0,7799a <_Per_CPU_Information+0x18> 51430: 6012 bras 51444 rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 51432: 203c 0000 0700 movel #1792,%d0 51438: 40c1 movew %sr,%d1 5143a: 8081 orl %d1,%d0 5143c: 46c0 movew %d0,%sr *signal_set |= signals; 5143e: 85a8 0016 orl %d2,%a0@(22) _ISR_Enable( _level ); 51442: 46c1 movew %d1,%sr } else { _ASR_Post_signals( signal_set, &asr->signals_pending ); } _Thread_Enable_dispatch(); 51444: 4eb9 0005 526e jsr 5526e <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 5144a: 4280 clrl %d0 5144c: 6010 bras 5145e } _Thread_Enable_dispatch(); 5144e: 4eb9 0005 526e jsr 5526e <_Thread_Enable_dispatch> return RTEMS_NOT_DEFINED; 51454: 700b moveq #11,%d0 51456: 6006 bras 5145e Objects_Locations location; RTEMS_API_Control *api; ASR_Information *asr; if ( !signal_set ) return RTEMS_INVALID_NUMBER; 51458: 700a moveq #10,%d0 5145a: 6002 bras 5145e case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 5145c: 7004 moveq #4,%d0 } 5145e: 242e fff4 movel %fp@(-12),%d2 51462: 262e fff8 movel %fp@(-8),%d3 51466: 4e5e unlk %fp ... =============================================================================== 0004c650 : rtems_status_code rtems_task_mode( rtems_mode mode_set, rtems_mode mask, rtems_mode *previous_mode_set ) { 4c650: 4e56 ffe4 linkw %fp,#-28 4c654: 48d7 1c3c moveml %d2-%d5/%a2-%a4,%sp@ 4c658: 262e 0008 movel %fp@(8),%d3 4c65c: 282e 000c movel %fp@(12),%d4 4c660: 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 ) 4c664: 4a8c tstl %a4 4c666: 6700 0104 beqw 4c76c return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; 4c66a: 2679 0005 ee32 moveal 5ee32 <_Per_CPU_Information+0xc>,%a3 api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 4c670: 4a2b 0074 tstb %a3@(116) 4c674: 57c2 seq %d2 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 4c676: 246b 00fe moveal %a3@(254),%a2 asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 4c67a: 49c2 extbl %d2 4c67c: 0282 0000 0100 andil #256,%d2 if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) 4c682: 4aab 007a tstl %a3@(122) 4c686: 6704 beqs 4c68c old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; 4c688: 08c2 0009 bset #9,%d2 old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; 4c68c: 4a2a 0008 tstb %a2@(8) 4c690: 57c5 seq %d5 old_mode |= _ISR_Get_level(); 4c692: 4eb9 0004 8b00 jsr 48b00 <_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; 4c698: 49c5 extbl %d5 4c69a: 0285 0000 0400 andil #1024,%d5 4c6a0: 8085 orl %d5,%d0 old_mode |= _ISR_Get_level(); 4c6a2: 8082 orl %d2,%d0 4c6a4: 2880 movel %d0,%a4@ *previous_mode_set = old_mode; /* * These are generic thread scheduling characteristics. */ if ( mask & RTEMS_PREEMPT_MASK ) 4c6a6: 0804 0008 btst #8,%d4 4c6aa: 670c beqs 4c6b8 executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; 4c6ac: 0803 0008 btst #8,%d3 4c6b0: 57c0 seq %d0 4c6b2: 4480 negl %d0 4c6b4: 1740 0074 moveb %d0,%a3@(116) if ( mask & RTEMS_TIMESLICE_MASK ) { 4c6b8: 0804 0009 btst #9,%d4 4c6bc: 671c beqs 4c6da if ( _Modes_Is_timeslice(mode_set) ) { 4c6be: 0803 0009 btst #9,%d3 4c6c2: 6712 beqs 4c6d6 executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 4c6c4: 41f9 0005 e980 lea 5e980 <_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; 4c6ca: 7001 moveq #1,%d0 executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 4c6cc: 2750 0076 movel %a0@,%a3@(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; 4c6d0: 2740 007a movel %d0,%a3@(122) 4c6d4: 6004 bras 4c6da executing->cpu_time_budget = _Thread_Ticks_per_timeslice; } else executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 4c6d6: 42ab 007a clrl %a3@(122) } /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) 4c6da: 7007 moveq #7,%d0 4c6dc: c084 andl %d4,%d0 4c6de: 6712 beqs 4c6f2 */ RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level ( Modes_Control mode_set ) { _ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) ); 4c6e0: 40c0 movew %sr,%d0 */ RTEMS_INLINE_ROUTINE ISR_Level _Modes_Get_interrupt_level ( Modes_Control mode_set ) { return ( mode_set & RTEMS_INTERRUPT_MASK ); 4c6e2: 7207 moveq #7,%d1 4c6e4: c283 andl %d3,%d1 */ RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level ( Modes_Control mode_set ) { _ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) ); 4c6e6: 0280 0000 f8ff andil #63743,%d0 4c6ec: e189 lsll #8,%d1 4c6ee: 8081 orl %d1,%d0 4c6f0: 46c0 movew %d0,%sr * This is specific to the RTEMS API */ is_asr_enabled = false; needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { 4c6f2: 0804 000a btst #10,%d4 4c6f6: 6740 beqs 4c738 is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true; if ( is_asr_enabled != asr->is_enabled ) { 4c6f8: 4281 clrl %d1 4c6fa: 122a 0008 moveb %a2@(8),%d1 4c6fe: 4282 clrl %d2 * Output: * *previous_mode_set - previous mode set * always return RTEMS_SUCCESSFUL; */ rtems_status_code rtems_task_mode( 4c700: 0803 000a btst #10,%d3 4c704: 57c0 seq %d0 4c706: 4480 negl %d0 is_asr_enabled = false; needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true; if ( is_asr_enabled != asr->is_enabled ) { 4c708: 1400 moveb %d0,%d2 4c70a: b282 cmpl %d2,%d1 4c70c: 672a beqs 4c738 asr->is_enabled = is_asr_enabled; 4c70e: 1540 0008 moveb %d0,%a2@(8) ) { rtems_signal_set _signals; ISR_Level _level; _ISR_Disable( _level ); 4c712: 203c 0000 0700 movel #1792,%d0 4c718: 40c1 movew %sr,%d1 4c71a: 8081 orl %d1,%d0 4c71c: 46c0 movew %d0,%sr _signals = information->signals_pending; 4c71e: 202a 0016 movel %a2@(22),%d0 information->signals_pending = information->signals_posted; 4c722: 256a 0012 0016 movel %a2@(18),%a2@(22) information->signals_posted = _signals; 4c728: 2540 0012 movel %d0,%a2@(18) _ISR_Enable( _level ); 4c72c: 46c1 movew %d1,%sr /* * This is specific to the RTEMS API */ is_asr_enabled = false; needs_asr_dispatching = false; 4c72e: 4aaa 0012 tstl %a2@(18) 4c732: 56c0 sne %d0 4c734: 4480 negl %d0 4c736: 6002 bras 4c73a 4c738: 4200 clrb %d0 needs_asr_dispatching = true; } } } if ( _System_state_Is_up( _System_state_Get() ) ) { 4c73a: 7203 moveq #3,%d1 4c73c: b2b9 0005 eb14 cmpl 5eb14 <_System_state_Current>,%d1 4c742: 662c bnes 4c770 bool are_signals_pending ) { Thread_Control *executing; executing = _Thread_Executing; 4c744: 2079 0005 ee32 moveal 5ee32 <_Per_CPU_Information+0xc>,%a0 if ( are_signals_pending || 4c74a: 4a00 tstb %d0 4c74c: 660e bnes 4c75c 4c74e: b1f9 0005 ee36 cmpal 5ee36 <_Per_CPU_Information+0x10>,%a0 4c754: 671a beqs 4c770 (!_Thread_Is_heir( executing ) && executing->is_preemptible) ) { 4c756: 4a28 0074 tstb %a0@(116) 4c75a: 6714 beqs 4c770 <== NEVER TAKEN _Thread_Dispatch_necessary = true; 4c75c: 7001 moveq #1,%d0 4c75e: 13c0 0005 ee3e moveb %d0,5ee3e <_Per_CPU_Information+0x18> if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) ) _Thread_Dispatch(); 4c764: 4eb9 0004 7984 jsr 47984 <_Thread_Dispatch> 4c76a: 6004 bras 4c770 bool is_asr_enabled = false; bool needs_asr_dispatching = false; rtems_mode old_mode; if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; 4c76c: 7009 moveq #9,%d0 4c76e: 6002 bras 4c772 if ( _System_state_Is_up( _System_state_Get() ) ) { if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) ) _Thread_Dispatch(); } return RTEMS_SUCCESSFUL; 4c770: 4280 clrl %d0 } 4c772: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4 4c778: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004952c : rtems_status_code rtems_task_set_priority( rtems_id id, rtems_task_priority new_priority, rtems_task_priority *old_priority ) { 4952c: 4e56 fffc linkw %fp,#-4 49530: 2f0a movel %a2,%sp@- 49532: 246e 0010 moveal %fp@(16),%a2 49536: 2f02 movel %d2,%sp@- 49538: 242e 000c movel %fp@(12),%d2 register Thread_Control *the_thread; Objects_Locations location; if ( new_priority != RTEMS_CURRENT_PRIORITY && 4953c: 670c beqs 4954a RTEMS_INLINE_ROUTINE bool _RTEMS_tasks_Priority_is_valid ( rtems_task_priority the_priority ) { return ( ( the_priority >= RTEMS_MINIMUM_PRIORITY ) && ( the_priority <= RTEMS_MAXIMUM_PRIORITY ) ); 4953e: 4280 clrl %d0 49540: 1039 0006 0952 moveb 60952 ,%d0 49546: b082 cmpl %d2,%d0 49548: 654e bcss 49598 !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; if ( !old_priority ) 4954a: 4a8a tstl %a2 4954c: 674e beqs 4959c return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); 4954e: 486e fffc pea %fp@(-4) 49552: 2f2e 0008 movel %fp@(8),%sp@- 49556: 4eb9 0004 b580 jsr 4b580 <_Thread_Get> switch ( location ) { 4955c: 508f addql #8,%sp return RTEMS_INVALID_PRIORITY; if ( !old_priority ) return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); 4955e: 2040 moveal %d0,%a0 switch ( location ) { 49560: 4aae fffc tstl %fp@(-4) 49564: 663a bnes 495a0 case OBJECTS_LOCAL: /* XXX need helper to "convert" from core priority */ *old_priority = the_thread->current_priority; 49566: 24a8 0014 movel %a0@(20),%a2@ if ( new_priority != RTEMS_CURRENT_PRIORITY ) { 4956a: 4a82 tstl %d2 4956c: 6720 beqs 4958e the_thread->real_priority = new_priority; 4956e: 2142 0018 movel %d2,%a0@(24) if ( the_thread->resource_count == 0 || 49572: 4aa8 001c tstl %a0@(28) 49576: 6706 beqs 4957e 49578: b4a8 0014 cmpl %a0@(20),%d2 4957c: 6410 bccs 4958e <== ALWAYS TAKEN the_thread->current_priority > new_priority ) _Thread_Change_priority( the_thread, new_priority, false ); 4957e: 42a7 clrl %sp@- 49580: 2f02 movel %d2,%sp@- 49582: 2f08 movel %a0,%sp@- 49584: 4eb9 0004 b13c jsr 4b13c <_Thread_Change_priority> 4958a: 4fef 000c lea %sp@(12),%sp } _Thread_Enable_dispatch(); 4958e: 4eb9 0004 b55a jsr 4b55a <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 49594: 4280 clrl %d0 49596: 600a bras 495a2 register Thread_Control *the_thread; Objects_Locations location; if ( new_priority != RTEMS_CURRENT_PRIORITY && !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; 49598: 7013 moveq #19,%d0 4959a: 6006 bras 495a2 if ( !old_priority ) return RTEMS_INVALID_ADDRESS; 4959c: 7009 moveq #9,%d0 4959e: 6002 bras 495a2 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 495a0: 7004 moveq #4,%d0 } 495a2: 242e fff4 movel %fp@(-12),%d2 495a6: 246e fff8 moveal %fp@(-8),%a2 495aa: 4e5e unlk %fp ... =============================================================================== 000468d4 : rtems_status_code rtems_task_variable_get( rtems_id tid, void **ptr, void **result ) { 468d4: 4e56 fffc linkw %fp,#-4 468d8: 2f0a movel %a2,%sp@- 468da: 246e 0010 moveal %fp@(16),%a2 468de: 2f02 movel %d2,%sp@- 468e0: 242e 000c movel %fp@(12),%d2 Thread_Control *the_thread; Objects_Locations location; rtems_task_variable_t *tvp; if ( !ptr ) 468e4: 6742 beqs 46928 return RTEMS_INVALID_ADDRESS; if ( !result ) 468e6: 4a8a tstl %a2 468e8: 673e beqs 46928 <== NEVER TAKEN return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get (tid, &location); 468ea: 486e fffc pea %fp@(-4) 468ee: 2f2e 0008 movel %fp@(8),%sp@- 468f2: 4eb9 0004 86c0 jsr 486c0 <_Thread_Get> switch (location) { 468f8: 508f addql #8,%sp 468fa: 4aae fffc tstl %fp@(-4) 468fe: 662c bnes 4692c case OBJECTS_LOCAL: /* * Figure out if the variable is in this task's list. */ tvp = the_thread->task_variables; 46900: 2240 moveal %d0,%a1 46902: 2069 010a moveal %a1@(266),%a0 while (tvp) { 46906: 6016 bras 4691e if (tvp->ptr == ptr) { 46908: b4a8 0004 cmpl %a0@(4),%d2 4690c: 660e bnes 4691c /* * Should this return the current (i.e not the * saved) value if `tid' is the current task? */ *result = tvp->tval; 4690e: 24a8 000c movel %a0@(12),%a2@ _Thread_Enable_dispatch(); 46912: 4eb9 0004 869a jsr 4869a <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 46918: 4280 clrl %d0 4691a: 6012 bras 4692e } tvp = (rtems_task_variable_t *)tvp->next; 4691c: 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) { 4691e: 4a88 tstl %a0 46920: 66e6 bnes 46908 _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } tvp = (rtems_task_variable_t *)tvp->next; } _Thread_Enable_dispatch(); 46922: 4eb9 0004 869a jsr 4869a <_Thread_Enable_dispatch> if ( !ptr ) return RTEMS_INVALID_ADDRESS; if ( !result ) return RTEMS_INVALID_ADDRESS; 46928: 7009 moveq #9,%d0 4692a: 6002 bras 4692e #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 4692c: 7004 moveq #4,%d0 } 4692e: 242e fff4 movel %fp@(-12),%d2 46932: 246e fff8 moveal %fp@(-8),%a2 46936: 4e5e unlk %fp ... =============================================================================== 0004692c : */ rtems_status_code rtems_task_wake_when( rtems_time_of_day *time_buffer ) { 4692c: 4e56 0000 linkw %fp,#0 46930: 2f0a movel %a2,%sp@- 46932: 246e 0008 moveal %fp@(8),%a2 Watchdog_Interval seconds; if ( !_TOD_Is_set ) 46936: 4a39 0005 ff80 tstb 5ff80 <_TOD_Is_set> 4693c: 6700 0096 beqw 469d4 return RTEMS_NOT_DEFINED; if ( !time_buffer ) 46940: 4a8a tstl %a2 46942: 6700 0094 beqw 469d8 return RTEMS_INVALID_ADDRESS; time_buffer->ticks = 0; 46946: 42aa 0018 clrl %a2@(24) if ( !_TOD_Validate( time_buffer ) ) 4694a: 2f0a movel %a2,%sp@- 4694c: 4eb9 0004 5de0 jsr 45de0 <_TOD_Validate> 46952: 588f addql #4,%sp 46954: 4a00 tstb %d0 46956: 6700 0084 beqw 469dc return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( time_buffer ); 4695a: 2f0a movel %a2,%sp@- 4695c: 4eb9 0004 5d44 jsr 45d44 <_TOD_To_seconds> if ( seconds <= _TOD_Seconds_since_epoch() ) 46962: 588f addql #4,%sp time_buffer->ticks = 0; if ( !_TOD_Validate( time_buffer ) ) return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( time_buffer ); 46964: 2440 moveal %d0,%a2 if ( seconds <= _TOD_Seconds_since_epoch() ) 46966: b0b9 0005 fffa cmpl 5fffa <_TOD_Now>,%d0 4696c: 636e blss 469dc <== NEVER TAKEN 4696e: 2039 0005 ff70 movel 5ff70 <_Thread_Dispatch_disable_level>,%d0 46974: 5280 addql #1,%d0 46976: 23c0 0005 ff70 movel %d0,5ff70 <_Thread_Dispatch_disable_level> return RTEMS_INVALID_CLOCK; _Thread_Disable_dispatch(); _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_TIME ); 4697c: 4878 0010 pea 10 46980: 2f39 0006 03da movel 603da <_Per_CPU_Information+0xc>,%sp@- 46986: 4eb9 0004 8e7c jsr 48e7c <_Thread_Set_state> _Watchdog_Initialize( &_Thread_Executing->Timer, _Thread_Delay_ended, _Thread_Executing->Object.id, 4698c: 2079 0006 03da moveal 603da <_Per_CPU_Information+0xc>,%a0 NULL ); _Watchdog_Insert_seconds( 46992: 95f9 0005 fffa subal 5fffa <_TOD_Now>,%a2 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 46998: 223c 0004 8570 movel #296304,%d1 if ( seconds <= _TOD_Seconds_since_epoch() ) return RTEMS_INVALID_CLOCK; _Thread_Disable_dispatch(); _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_TIME ); _Watchdog_Initialize( 4699e: 2028 0008 movel %a0@(8),%d0 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 469a2: 42a8 0050 clrl %a0@(80) the_watchdog->routine = routine; the_watchdog->id = id; 469a6: 2140 0068 movel %d0,%a0@(104) Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 469aa: 2141 0064 movel %d1,%a0@(100) the_watchdog->id = id; the_watchdog->user_data = user_data; 469ae: 42a8 006c clrl %a0@(108) &_Thread_Executing->Timer, _Thread_Delay_ended, _Thread_Executing->Object.id, NULL ); _Watchdog_Insert_seconds( 469b2: 214a 0054 movel %a2,%a0@(84) ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Seconds_chain, the_watchdog ); 469b6: 4868 0048 pea %a0@(72) 469ba: 4879 0006 0024 pea 60024 <_Watchdog_Seconds_chain> 469c0: 4eb9 0004 9400 jsr 49400 <_Watchdog_Insert> &_Thread_Executing->Timer, seconds - _TOD_Seconds_since_epoch() ); _Thread_Enable_dispatch(); 469c6: 4eb9 0004 86ea jsr 486ea <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 469cc: 4fef 0010 lea %sp@(16),%sp 469d0: 4280 clrl %d0 469d2: 600a bras 469de ) { Watchdog_Interval seconds; if ( !_TOD_Is_set ) return RTEMS_NOT_DEFINED; 469d4: 700b moveq #11,%d0 469d6: 6006 bras 469de if ( !time_buffer ) return RTEMS_INVALID_ADDRESS; 469d8: 7009 moveq #9,%d0 469da: 6002 bras 469de return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( time_buffer ); if ( seconds <= _TOD_Seconds_since_epoch() ) return RTEMS_INVALID_CLOCK; 469dc: 7014 moveq #20,%d0 &_Thread_Executing->Timer, seconds - _TOD_Seconds_since_epoch() ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } 469de: 246e fffc moveal %fp@(-4),%a2 469e2: 4e5e unlk %fp ... =============================================================================== 00051c5c : */ rtems_status_code rtems_timer_cancel( rtems_id id ) { 51c5c: 4e56 fffc linkw %fp,#-4 Objects_Id id, Objects_Locations *location ) { return (Timer_Control *) _Objects_Get( &_Timer_Information, id, location ); 51c60: 486e fffc pea %fp@(-4) 51c64: 2f2e 0008 movel %fp@(8),%sp@- 51c68: 4879 0007 7d9e pea 77d9e <_Timer_Information> 51c6e: 4eb9 0005 46c4 jsr 546c4 <_Objects_Get> Timer_Control *the_timer; Objects_Locations location; the_timer = _Timer_Get( id, &location ); switch ( location ) { 51c74: 4fef 000c lea %sp@(12),%sp 51c78: 4aae fffc tstl %fp@(-4) 51c7c: 6620 bnes 51c9e case OBJECTS_LOCAL: if ( !_Timer_Is_dormant_class( the_timer->the_class ) ) 51c7e: 7204 moveq #4,%d1 51c80: 2040 moveal %d0,%a0 51c82: b2a8 0038 cmpl %a0@(56),%d1 51c86: 670c beqs 51c94 <== NEVER TAKEN (void) _Watchdog_Remove( &the_timer->Ticker ); 51c88: 4868 0010 pea %a0@(16) 51c8c: 4eb9 0005 6260 jsr 56260 <_Watchdog_Remove> 51c92: 588f addql #4,%sp _Thread_Enable_dispatch(); 51c94: 4eb9 0005 526e jsr 5526e <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 51c9a: 4280 clrl %d0 51c9c: 6002 bras 51ca0 #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 51c9e: 7004 moveq #4,%d0 } 51ca0: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00051f98 : */ rtems_status_code rtems_timer_reset( rtems_id id ) { 51f98: 4e56 fffc linkw %fp,#-4 51f9c: 2f0b movel %a3,%sp@- 51f9e: 2f0a movel %a2,%sp@- 51fa0: 486e fffc pea %fp@(-4) 51fa4: 2f2e 0008 movel %fp@(8),%sp@- 51fa8: 4879 0007 7d9e pea 77d9e <_Timer_Information> 51fae: 4eb9 0005 46c4 jsr 546c4 <_Objects_Get> Timer_Control *the_timer; Objects_Locations location; rtems_status_code status = RTEMS_SUCCESSFUL; the_timer = _Timer_Get( id, &location ); switch ( location ) { 51fb4: 4fef 000c lea %sp@(12),%sp 51fb8: 2440 moveal %d0,%a2 51fba: 4aae fffc tstl %fp@(-4) 51fbe: 6656 bnes 52016 <== NEVER TAKEN case OBJECTS_LOCAL: if ( the_timer->the_class == TIMER_INTERVAL ) { 51fc0: 202a 0038 movel %a2@(56),%d0 51fc4: 661c bnes 51fe2 _Watchdog_Remove( &the_timer->Ticker ); 51fc6: 45ea 0010 lea %a2@(16),%a2 51fca: 2f0a movel %a2,%sp@- 51fcc: 4eb9 0005 6260 jsr 56260 <_Watchdog_Remove> _Watchdog_Insert( &_Watchdog_Ticks_chain, &the_timer->Ticker ); 51fd2: 2f0a movel %a2,%sp@- 51fd4: 4879 0007 75dc pea 775dc <_Watchdog_Ticks_chain> 51fda: 4eb9 0005 6138 jsr 56138 <_Watchdog_Insert> 51fe0: 6020 bras 52002 } else if ( the_timer->the_class == TIMER_INTERVAL_ON_TASK ) { 51fe2: 7201 moveq #1,%d1 51fe4: b280 cmpl %d0,%d1 51fe6: 6622 bnes 5200a <== NEVER TAKEN if ( !timer_server ) { _Thread_Enable_dispatch(); return RTEMS_INCORRECT_STATE; } #endif _Watchdog_Remove( &the_timer->Ticker ); 51fe8: 486a 0010 pea %a2@(16) 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; 51fec: 2679 0007 7dd8 moveal 77dd8 <_Timer_server>,%a3 if ( !timer_server ) { _Thread_Enable_dispatch(); return RTEMS_INCORRECT_STATE; } #endif _Watchdog_Remove( &the_timer->Ticker ); 51ff2: 4eb9 0005 6260 jsr 56260 <_Watchdog_Remove> (*timer_server->schedule_operation)( timer_server, the_timer ); 51ff8: 2f0a movel %a2,%sp@- 51ffa: 2f0b movel %a3,%sp@- 51ffc: 206b 0004 moveal %a3@(4),%a0 52000: 4e90 jsr %a0@ 52002: 4fef 000c lea %sp@(12),%sp rtems_id id ) { Timer_Control *the_timer; Objects_Locations location; rtems_status_code status = RTEMS_SUCCESSFUL; 52006: 95ca subal %a2,%a2 52008: 6004 bras 5200e /* * Must be dormant or time of day timer (e.g. TIMER_DORMANT, * TIMER_TIME_OF_DAY, or TIMER_TIME_OF_DAY_ON_TASK). We * can only reset active interval timers. */ status = RTEMS_NOT_DEFINED; 5200a: 347c 000b moveaw #11,%a2 } _Thread_Enable_dispatch(); 5200e: 4eb9 0005 526e jsr 5526e <_Thread_Enable_dispatch> return status; 52014: 6004 bras 5201a #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 52016: 347c 0004 moveaw #4,%a2 } 5201a: 200a movel %a2,%d0 5201c: 246e fff4 moveal %fp@(-12),%a2 52020: 266e fff8 moveal %fp@(-8),%a3 52024: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000520e4 : rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ) { 520e4: 4e56 ffe8 linkw %fp,#-24 520e8: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 520ec: 262e 0008 movel %fp@(8),%d3 520f0: 242e 000c movel %fp@(12),%d2 520f4: 282e 0010 movel %fp@(16),%d4 Timer_Control *the_timer; Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; 520f8: 2679 0007 7dd8 moveal 77dd8 <_Timer_server>,%a3 if ( !timer_server ) 520fe: 4a8b tstl %a3 52100: 6700 0098 beqw 5219a return RTEMS_INCORRECT_STATE; if ( !_TOD_Is_set ) 52104: 4a39 0007 752c tstb 7752c <_TOD_Is_set> 5210a: 6700 0092 beqw 5219e return RTEMS_NOT_DEFINED; if ( !routine ) 5210e: 4a84 tstl %d4 52110: 6700 0090 beqw 521a2 return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) 52114: 2f02 movel %d2,%sp@- 52116: 4eb9 0004 f5a4 jsr 4f5a4 <_TOD_Validate> 5211c: 588f addql #4,%sp 5211e: 4a00 tstb %d0 52120: 6700 0084 beqw 521a6 return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 52124: 2f02 movel %d2,%sp@- 52126: 4eb9 0004 f508 jsr 4f508 <_TOD_To_seconds> if ( seconds <= _TOD_Seconds_since_epoch() ) 5212c: 588f addql #4,%sp return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 5212e: 2400 movel %d0,%d2 if ( seconds <= _TOD_Seconds_since_epoch() ) 52130: b0b9 0007 75a6 cmpl 775a6 <_TOD_Now>,%d0 52136: 636e blss 521a6 52138: 486e fffc pea %fp@(-4) 5213c: 2f03 movel %d3,%sp@- 5213e: 4879 0007 7d9e pea 77d9e <_Timer_Information> 52144: 4eb9 0005 46c4 jsr 546c4 <_Objects_Get> return RTEMS_INVALID_CLOCK; the_timer = _Timer_Get( id, &location ); switch ( location ) { 5214a: 4fef 000c lea %sp@(12),%sp 5214e: 2440 moveal %d0,%a2 52150: 4aae fffc tstl %fp@(-4) 52154: 6654 bnes 521aa case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); 52156: 486a 0010 pea %a2@(16) 5215a: 4eb9 0005 6260 jsr 56260 <_Watchdog_Remove> the_watchdog->user_data = user_data; 52160: 256e 0014 0034 movel %fp@(20),%a2@(52) the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK; _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); 52166: 94b9 0007 75a6 subl 775a6 <_TOD_Now>,%d2 the_timer = _Timer_Get( id, &location ); switch ( location ) { case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK; 5216c: 7003 moveq #3,%d0 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 5216e: 42aa 0018 clrl %a2@(24) 52172: 2540 0038 movel %d0,%a2@(56) the_watchdog->routine = routine; 52176: 2544 002c movel %d4,%a2@(44) the_watchdog->id = id; 5217a: 2543 0030 movel %d3,%a2@(48) _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); 5217e: 2542 001c movel %d2,%a2@(28) (*timer_server->schedule_operation)( timer_server, the_timer ); 52182: 2f0a movel %a2,%sp@- 52184: 2f0b movel %a3,%sp@- 52186: 206b 0004 moveal %a3@(4),%a0 5218a: 4e90 jsr %a0@ _Thread_Enable_dispatch(); 5218c: 4eb9 0005 526e jsr 5526e <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 52192: 4fef 000c lea %sp@(12),%sp 52196: 4280 clrl %d0 52198: 6012 bras 521ac Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; if ( !timer_server ) return RTEMS_INCORRECT_STATE; 5219a: 700e moveq #14,%d0 5219c: 600e bras 521ac if ( !_TOD_Is_set ) return RTEMS_NOT_DEFINED; 5219e: 700b moveq #11,%d0 <== NOT EXECUTED 521a0: 600a bras 521ac <== NOT EXECUTED if ( !routine ) return RTEMS_INVALID_ADDRESS; 521a2: 7009 moveq #9,%d0 521a4: 6006 bras 521ac if ( !_TOD_Validate( wall_time ) ) return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); if ( seconds <= _TOD_Seconds_since_epoch() ) return RTEMS_INVALID_CLOCK; 521a6: 7014 moveq #20,%d0 521a8: 6002 bras 521ac #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 521aa: 7004 moveq #4,%d0 } 521ac: 4cee 0c1c ffe8 moveml %fp@(-24),%d2-%d4/%a2-%a3 521b2: 4e5e unlk %fp ... =============================================================================== 00045ff0 : int sched_get_priority_max( int policy ) { switch ( policy ) { 45ff0: 7004 moveq #4,%d0 #include int sched_get_priority_max( int policy ) { 45ff2: 4e56 0000 linkw %fp,#0 45ff6: 222e 0008 movel %fp@(8),%d1 switch ( policy ) { 45ffa: b081 cmpl %d1,%d0 45ffc: 650c bcss 4600a <== NEVER TAKEN 45ffe: 103c 0001 moveb #1,%d0 46002: e3a8 lsll %d1,%d0 46004: 7217 moveq #23,%d1 46006: c081 andl %d1,%d0 46008: 6610 bnes 4601a <== ALWAYS TAKEN case SCHED_RR: case SCHED_SPORADIC: break; default: rtems_set_errno_and_return_minus_one( EINVAL ); 4600a: 4eb9 0004 d690 jsr 4d690 <__errno> 46010: 2040 moveal %d0,%a0 46012: 7016 moveq #22,%d0 46014: 2080 movel %d0,%a0@ 46016: 70ff moveq #-1,%d0 46018: 600a bras 46024 } return POSIX_SCHEDULER_MAXIMUM_PRIORITY; 4601a: 4280 clrl %d0 4601c: 1039 0005 e126 moveb 5e126 ,%d0 46022: 5380 subql #1,%d0 } 46024: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00046028 : int sched_get_priority_min( int policy ) { switch ( policy ) { 46028: 7004 moveq #4,%d0 #include int sched_get_priority_min( int policy ) { 4602a: 4e56 0000 linkw %fp,#0 4602e: 222e 0008 movel %fp@(8),%d1 switch ( policy ) { 46032: b081 cmpl %d1,%d0 46034: 650c bcss 46042 46036: 103c 0001 moveb #1,%d0 4603a: e3a8 lsll %d1,%d0 4603c: 7217 moveq #23,%d1 4603e: c081 andl %d1,%d0 46040: 6610 bnes 46052 <== ALWAYS TAKEN case SCHED_RR: case SCHED_SPORADIC: break; default: rtems_set_errno_and_return_minus_one( EINVAL ); 46042: 4eb9 0004 d690 jsr 4d690 <__errno> 46048: 2040 moveal %d0,%a0 4604a: 7016 moveq #22,%d0 4604c: 2080 movel %d0,%a0@ 4604e: 70ff moveq #-1,%d0 46050: 6002 bras 46054 } return POSIX_SCHEDULER_MINIMUM_PRIORITY; 46052: 7001 moveq #1,%d0 } 46054: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00046058 : int sched_rr_get_interval( pid_t pid, struct timespec *interval ) { 46058: 4e56 0000 linkw %fp,#0 4605c: 2f03 movel %d3,%sp@- 4605e: 262e 0008 movel %fp@(8),%d3 46062: 2f02 movel %d2,%sp@- 46064: 242e 000c movel %fp@(12),%d2 /* * Only supported for the "calling process" (i.e. this node). */ if ( pid && pid != getpid() ) 46068: 4a83 tstl %d3 4606a: 6718 beqs 46084 <== NEVER TAKEN 4606c: 4eb9 0004 3100 jsr 43100 46072: b083 cmpl %d3,%d0 46074: 670e beqs 46084 rtems_set_errno_and_return_minus_one( ESRCH ); 46076: 4eb9 0004 d690 jsr 4d690 <__errno> 4607c: 7203 moveq #3,%d1 4607e: 2040 moveal %d0,%a0 46080: 2081 movel %d1,%a0@ 46082: 6010 bras 46094 if ( !interval ) 46084: 4a82 tstl %d2 46086: 6610 bnes 46098 rtems_set_errno_and_return_minus_one( EINVAL ); 46088: 4eb9 0004 d690 jsr 4d690 <__errno> 4608e: 2040 moveal %d0,%a0 46090: 7016 moveq #22,%d0 46092: 2080 movel %d0,%a0@ 46094: 70ff moveq #-1,%d0 46096: 6012 bras 460aa _Timespec_From_ticks( _Thread_Ticks_per_timeslice, interval ); 46098: 2f02 movel %d2,%sp@- 4609a: 2f39 0005 f9a0 movel 5f9a0 <_Thread_Ticks_per_timeslice>,%sp@- 460a0: 4eb9 0004 934c jsr 4934c <_Timespec_From_ticks> return 0; 460a6: 508f addql #8,%sp 460a8: 4280 clrl %d0 } 460aa: 242e fff8 movel %fp@(-8),%d2 460ae: 262e fffc movel %fp@(-4),%d3 460b2: 4e5e unlk %fp ... =============================================================================== 00048694 : int oflag, ... /* mode_t mode, */ /* unsigned int value */ ) { 48694: 4e56 ffe0 linkw %fp,#-32 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 48698: 2039 0006 3934 movel 63934 <_Thread_Dispatch_disable_level>,%d0 4869e: 5280 addql #1,%d0 486a0: 48d7 043c moveml %d2-%d5/%a2,%sp@ 486a4: 242e 0008 movel %fp@(8),%d2 486a8: 282e 000c movel %fp@(12),%d4 486ac: 23c0 0006 3934 movel %d0,63934 <_Thread_Dispatch_disable_level> POSIX_Semaphore_Control *the_semaphore; Objects_Locations location; _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { 486b2: 2a04 movel %d4,%d5 486b4: 0285 0000 0200 andil #512,%d5 486ba: 6706 beqs 486c2 va_start(arg, oflag); mode = (mode_t) va_arg( arg, unsigned int ); value = va_arg( arg, unsigned int ); 486bc: 262e 0014 movel %fp@(20),%d3 486c0: 6002 bras 486c4 /* unsigned int value */ ) { va_list arg; mode_t mode; unsigned int value = 0; 486c2: 4283 clrl %d3 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 ); 486c4: 486e fffc pea %fp@(-4) 486c8: 2f02 movel %d2,%sp@- 486ca: 4eb9 0004 e204 jsr 4e204 <_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 ) { 486d0: 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 ); 486d2: 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 ) { 486d4: 4a80 tstl %d0 486d6: 671c beqs 486f4 /* * 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) ) ) { 486d8: 7002 moveq #2,%d0 486da: b08a cmpl %a2,%d0 486dc: 6604 bnes 486e2 <== NEVER TAKEN 486de: 4a85 tstl %d5 486e0: 665e bnes 48740 _Thread_Enable_dispatch(); 486e2: 4eb9 0004 b10a jsr 4b10a <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one_cast( status, sem_t * ); 486e8: 4eb9 0005 093c jsr 5093c <__errno> 486ee: 2040 moveal %d0,%a0 486f0: 208a movel %a2,%a0@ 486f2: 6076 bras 4876a 486f4: 45f9 0004 b10a lea 4b10a <_Thread_Enable_dispatch>,%a2 /* * Check for existence with creation. */ if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { 486fa: 0284 0000 0a00 andil #2560,%d4 48700: 0c84 0000 0a00 cmpil #2560,%d4 48706: 6610 bnes 48718 _Thread_Enable_dispatch(); 48708: 4e92 jsr %a2@ rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * ); 4870a: 4eb9 0005 093c jsr 5093c <__errno> 48710: 2040 moveal %d0,%a0 48712: 7011 moveq #17,%d0 48714: 2080 movel %d0,%a0@ 48716: 6052 bras 4876a 48718: 486e fff4 pea %fp@(-12) 4871c: 2f2e fffc movel %fp@(-4),%sp@- 48720: 4879 0006 3b4a pea 63b4a <_POSIX_Semaphore_Information> 48726: 4eb9 0004 a554 jsr 4a554 <_Objects_Get> } the_semaphore = _POSIX_Semaphore_Get( &the_semaphore_id, &location ); the_semaphore->open_count += 1; 4872c: 2040 moveal %d0,%a0 4872e: 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 ); 48732: 2d40 fff8 movel %d0,%fp@(-8) the_semaphore->open_count += 1; _Thread_Enable_dispatch(); 48736: 4e92 jsr %a2@ _Thread_Enable_dispatch(); 48738: 4e92 jsr %a2@ goto return_id; 4873a: 4fef 000c lea %sp@(12),%sp 4873e: 6022 bras 48762 /* * 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( 48740: 486e fff8 pea %fp@(-8) 48744: 2f03 movel %d3,%sp@- 48746: 42a7 clrl %sp@- 48748: 2f02 movel %d2,%sp@- 4874a: 4eb9 0004 e0c0 jsr 4e0c0 <_POSIX_Semaphore_Create_support> 48750: 2400 movel %d0,%d2 /* * errno was set by Create_support, so don't set it again. */ _Thread_Enable_dispatch(); 48752: 4eb9 0004 b10a jsr 4b10a <_Thread_Enable_dispatch> if ( status == -1 ) 48758: 4fef 0010 lea %sp@(16),%sp 4875c: 70ff moveq #-1,%d0 4875e: b082 cmpl %d2,%d0 48760: 6708 beqs 4876a 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; 48762: 202e fff8 movel %fp@(-8),%d0 48766: 5080 addql #8,%d0 #endif return id; 48768: 6002 bras 4876c */ _Thread_Enable_dispatch(); if ( status == -1 ) return SEM_FAILED; 4876a: 70ff moveq #-1,%d0 id = &the_semaphore->Semaphore_id; #else id = (sem_t *)&the_semaphore->Object.id; #endif return id; } 4876c: 4cee 043c ffe0 moveml %fp@(-32),%d2-%d5/%a2 48772: 4e5e unlk %fp ... =============================================================================== 00045ee4 : int sigaction( int sig, const struct sigaction *act, struct sigaction *oact ) { 45ee4: 4e56 ffec linkw %fp,#-20 45ee8: 222e 0010 movel %fp@(16),%d1 45eec: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 45ef0: 242e 0008 movel %fp@(8),%d2 45ef4: 246e 000c moveal %fp@(12),%a2 ISR_Level level; if ( oact ) 45ef8: 4a81 tstl %d1 45efa: 6722 beqs 45f1e *oact = _POSIX_signals_Vectors[ sig ]; 45efc: 2602 movel %d2,%d3 45efe: 2002 movel %d2,%d0 45f00: 4878 000c pea c 45f04: e58b lsll #2,%d3 45f06: e988 lsll #4,%d0 45f08: 9083 subl %d3,%d0 45f0a: 0680 0006 0b04 addil #396036,%d0 45f10: 2f00 movel %d0,%sp@- 45f12: 2f01 movel %d1,%sp@- 45f14: 4eb9 0004 e210 jsr 4e210 45f1a: 4fef 000c lea %sp@(12),%sp if ( !sig ) 45f1e: 4a82 tstl %d2 45f20: 6710 beqs 45f32 static inline bool is_valid_signo( int signo ) { return ((signo) >= 1 && (signo) <= 32 ); 45f22: 2002 movel %d2,%d0 45f24: 5380 subql #1,%d0 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 45f26: 721f moveq #31,%d1 45f28: b280 cmpl %d0,%d1 45f2a: 6506 bcss 45f32 * * NOTE: Solaris documentation claims to "silently enforce" this which * contradicts the POSIX specification. */ if ( sig == SIGKILL ) 45f2c: 7009 moveq #9,%d0 45f2e: b082 cmpl %d2,%d0 45f30: 6610 bnes 45f42 rtems_set_errno_and_return_minus_one( EINVAL ); 45f32: 4eb9 0004 d94c jsr 4d94c <__errno> 45f38: 2040 moveal %d0,%a0 45f3a: 7016 moveq #22,%d0 45f3c: 2080 movel %d0,%a0@ 45f3e: 70ff moveq #-1,%d0 45f40: 6060 bras 45fa2 /* * Evaluate the new action structure and set the global signal vector * appropriately. */ if ( act ) { 45f42: 4a8a tstl %a2 45f44: 675a beqs 45fa0 <== NEVER TAKEN /* * Unless the user is installing the default signal actions, then * we can just copy the provided sigaction structure into the vectors. */ _ISR_Disable( level ); 45f46: 203c 0000 0700 movel #1792,%d0 45f4c: 40c3 movew %sr,%d3 45f4e: 8083 orl %d3,%d0 45f50: 46c0 movew %d0,%sr 45f52: 780c moveq #12,%d4 45f54: 4c02 4800 mulsl %d2,%d4 45f58: 47f9 0004 e210 lea 4e210 ,%a3 if ( act->sa_handler == SIG_DFL ) { 45f5e: 4aaa 0008 tstl %a2@(8) 45f62: 661e bnes 45f82 _POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ]; 45f64: 4878 000c pea c 45f68: 2004 movel %d4,%d0 45f6a: 0680 0005 e066 addil #385126,%d0 45f70: 2f00 movel %d0,%sp@- 45f72: 0684 0006 0b04 addil #396036,%d4 45f78: 2f04 movel %d4,%sp@- 45f7a: 4e93 jsr %a3@ 45f7c: 4fef 000c lea %sp@(12),%sp 45f80: 601c bras 45f9e } else { _POSIX_signals_Clear_process_signals( sig ); 45f82: 2f02 movel %d2,%sp@- _POSIX_signals_Vectors[ sig ] = *act; 45f84: 0684 0006 0b04 addil #396036,%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 ); 45f8a: 4eb9 0004 b0c8 jsr 4b0c8 <_POSIX_signals_Clear_process_signals> _POSIX_signals_Vectors[ sig ] = *act; 45f90: 4878 000c pea c 45f94: 2f0a movel %a2,%sp@- 45f96: 2f04 movel %d4,%sp@- 45f98: 4e93 jsr %a3@ 45f9a: 4fef 0010 lea %sp@(16),%sp } _ISR_Enable( level ); 45f9e: 46c3 movew %d3,%sr * now (signals not posted when SIG_IGN). * + If we are now ignoring a signal that was previously pending, * we clear the pending signal indicator. */ return 0; 45fa0: 4280 clrl %d0 } 45fa2: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 45fa8: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000462d0 : int sigtimedwait( const sigset_t *set, siginfo_t *info, const struct timespec *timeout ) { 462d0: 4e56 ffd8 linkw %fp,#-40 462d4: 48d7 3c1c moveml %d2-%d4/%a2-%a5,%sp@ 462d8: 266e 0008 moveal %fp@(8),%a3 462dc: 246e 000c moveal %fp@(12),%a2 462e0: 242e 0010 movel %fp@(16),%d2 ISR_Level level; /* * Error check parameters before disabling interrupts. */ if ( !set ) 462e4: 4a8b tstl %a3 462e6: 6730 beqs 46318 /* NOTE: This is very specifically a RELATIVE not ABSOLUTE time * in the Open Group specification. */ interval = 0; if ( timeout ) { 462e8: 4a82 tstl %d2 462ea: 673c beqs 46328 if ( !_Timespec_Is_valid( timeout ) ) 462ec: 2f02 movel %d2,%sp@- 462ee: 4eb9 0004 962c jsr 4962c <_Timespec_Is_valid> 462f4: 588f addql #4,%sp 462f6: 4a00 tstb %d0 462f8: 6610 bnes 4630a rtems_set_errno_and_return_minus_one( EINVAL ); 462fa: 4eb9 0004 dec8 jsr 4dec8 <__errno> 46300: 7616 moveq #22,%d3 46302: 2240 moveal %d0,%a1 46304: 2283 movel %d3,%a1@ 46306: 6000 0144 braw 4644c interval = _Timespec_To_ticks( timeout ); 4630a: 2f02 movel %d2,%sp@- 4630c: 4eb9 0004 9698 jsr 49698 <_Timespec_To_ticks> if ( !interval ) 46312: 588f addql #4,%sp 46314: 4a80 tstl %d0 46316: 6612 bnes 4632a <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); 46318: 4eb9 0004 dec8 jsr 4dec8 <__errno> 4631e: 7416 moveq #22,%d2 46320: 2040 moveal %d0,%a0 46322: 2082 movel %d2,%a0@ 46324: 6000 0126 braw 4644c /* NOTE: This is very specifically a RELATIVE not ABSOLUTE time * in the Open Group specification. */ interval = 0; 46328: 4280 clrl %d0 /* * Initialize local variables. */ the_info = ( info ) ? info : &signal_information; 4632a: 4a8a tstl %a2 4632c: 6604 bnes 46332 4632e: 45ee fff4 lea %fp@(-12),%a2 the_thread = _Thread_Executing; 46332: 2079 0006 0ea2 moveal 60ea2 <_Per_CPU_Information+0xc>,%a0 * What if they are already pending? */ /* API signals pending? */ _ISR_Disable( level ); 46338: 223c 0000 0700 movel #1792,%d1 the_info = ( info ) ? info : &signal_information; the_thread = _Thread_Executing; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4633e: 2868 0102 moveal %a0@(258),%a4 * What if they are already pending? */ /* API signals pending? */ _ISR_Disable( level ); 46342: 40c3 movew %sr,%d3 46344: 8283 orl %d3,%d1 46346: 46c1 movew %d1,%sr if ( *set & api->signals_pending ) { 46348: 2413 movel %a3@,%d2 4634a: 2802 movel %d2,%d4 4634c: 222c 00d4 movel %a4@(212),%d1 46350: c881 andl %d1,%d4 46352: 672a beqs 4637e /* XXX real info later */ the_info->si_signo = _POSIX_signals_Get_lowest( api->signals_pending ); 46354: 2f01 movel %d1,%sp@- 46356: 4eb9 0004 6284 jsr 46284 <_POSIX_signals_Get_lowest> 4635c: 2480 movel %d0,%a2@ _POSIX_signals_Clear_signals( 4635e: 4297 clrl %sp@ 46360: 42a7 clrl %sp@- 46362: 2f0a movel %a2,%sp@- 46364: 2f00 movel %d0,%sp@- 46366: 2f0c movel %a4,%sp@- 46368: 4eb9 0004 b70c jsr 4b70c <_POSIX_signals_Clear_signals> the_info->si_signo, the_info, false, false ); _ISR_Enable( level ); 4636e: 46c3 movew %d3,%sr the_info->si_code = SI_USER; 46370: 7001 moveq #1,%d0 the_info->si_value.sival_int = 0; 46372: 42aa 0008 clrl %a2@(8) return the_info->si_signo; 46376: 2412 movel %a2@,%d2 false, false ); _ISR_Enable( level ); the_info->si_code = SI_USER; 46378: 2540 0004 movel %d0,%a2@(4) 4637c: 6036 bras 463b4 return the_info->si_signo; } /* Process pending signals? */ if ( *set & _POSIX_signals_Pending ) { 4637e: 2239 0006 10c8 movel 610c8 <_POSIX_signals_Pending>,%d1 46384: 4bf9 0004 b70c lea 4b70c <_POSIX_signals_Clear_signals>,%a5 4638a: c481 andl %d1,%d2 4638c: 672e beqs 463bc signo = _POSIX_signals_Get_lowest( _POSIX_signals_Pending ); 4638e: 2f01 movel %d1,%sp@- 46390: 4eb9 0004 6284 jsr 46284 <_POSIX_signals_Get_lowest> 46396: 2400 movel %d0,%d2 _POSIX_signals_Clear_signals( api, signo, the_info, true, false ); 46398: 4297 clrl %sp@ 4639a: 4878 0001 pea 1 4639e: 2f0a movel %a2,%sp@- 463a0: 2f00 movel %d0,%sp@- 463a2: 2f0c movel %a4,%sp@- 463a4: 4e95 jsr %a5@ _ISR_Enable( level ); 463a6: 46c3 movew %d3,%sr the_info->si_signo = signo; the_info->si_code = SI_USER; 463a8: 7201 moveq #1,%d1 if ( *set & _POSIX_signals_Pending ) { signo = _POSIX_signals_Get_lowest( _POSIX_signals_Pending ); _POSIX_signals_Clear_signals( api, signo, the_info, true, false ); _ISR_Enable( level ); the_info->si_signo = signo; 463aa: 2482 movel %d2,%a2@ the_info->si_code = SI_USER; 463ac: 2541 0004 movel %d1,%a2@(4) the_info->si_value.sival_int = 0; 463b0: 42aa 0008 clrl %a2@(8) return signo; 463b4: 4fef 0014 lea %sp@(20),%sp 463b8: 6000 0094 braw 4644e } the_info->si_signo = -1; 463bc: 72ff moveq #-1,%d1 463be: 2481 movel %d1,%a2@ 463c0: 2239 0006 0a38 movel 60a38 <_Thread_Dispatch_disable_level>,%d1 463c6: 5281 addql #1,%d1 463c8: 23c1 0006 0a38 movel %d1,60a38 <_Thread_Dispatch_disable_level> _Thread_Disable_dispatch(); the_thread->Wait.queue = &_POSIX_signals_Wait_queue; the_thread->Wait.return_code = EINTR; 463ce: 7204 moveq #4,%d1 } the_info->si_signo = -1; _Thread_Disable_dispatch(); the_thread->Wait.queue = &_POSIX_signals_Wait_queue; 463d0: 43f9 0006 1060 lea 61060 <_POSIX_signals_Wait_queue>,%a1 the_thread->Wait.return_code = EINTR; 463d6: 2141 0034 movel %d1,%a0@(52) the_thread->Wait.option = *set; 463da: 2153 0030 movel %a3@,%a0@(48) RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section ( Thread_queue_Control *the_thread_queue ) { the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 463de: 123c 0001 moveb #1,%d1 the_thread->Wait.return_argument = the_info; 463e2: 214a 0028 movel %a2,%a0@(40) } the_info->si_signo = -1; _Thread_Disable_dispatch(); the_thread->Wait.queue = &_POSIX_signals_Wait_queue; 463e6: 2149 0044 movel %a1,%a0@(68) 463ea: 23c1 0006 1090 movel %d1,61090 <_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 ); 463f0: 46c3 movew %d3,%sr _Thread_queue_Enqueue( &_POSIX_signals_Wait_queue, interval ); 463f2: 4879 0004 938c pea 4938c <_Thread_queue_Timeout> 463f8: 2f00 movel %d0,%sp@- 463fa: 4879 0006 1060 pea 61060 <_POSIX_signals_Wait_queue> 46400: 4eb9 0004 9078 jsr 49078 <_Thread_queue_Enqueue_with_handler> _Thread_Enable_dispatch(); 46406: 4eb9 0004 8c4a jsr 48c4a <_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 ); 4640c: 42a7 clrl %sp@- 4640e: 42a7 clrl %sp@- 46410: 2f0a movel %a2,%sp@- 46412: 2f12 movel %a2@,%sp@- 46414: 2f0c movel %a4,%sp@- 46416: 4e95 jsr %a5@ /* Set errno only if return code is not EINTR or * if EINTR was caused by a signal being caught, which * was not in our set. */ if ( (_Thread_Executing->Wait.return_code != EINTR) 46418: 2079 0006 0ea2 moveal 60ea2 <_Per_CPU_Information+0xc>,%a0 4641e: 4fef 0020 lea %sp@(32),%sp 46422: 7004 moveq #4,%d0 46424: b0a8 0034 cmpl %a0@(52),%d0 46428: 6610 bnes 4643a || !(*set & signo_to_mask( the_info->si_signo )) ) { 4642a: 2412 movel %a2@,%d2 4642c: 2202 movel %d2,%d1 4642e: 5381 subql #1,%d1 46430: 103c 0001 moveb #1,%d0 46434: e3a8 lsll %d1,%d0 46436: c093 andl %a3@,%d0 46438: 6614 bnes 4644e errno = _Thread_Executing->Wait.return_code; 4643a: 4eb9 0004 dec8 jsr 4dec8 <__errno> 46440: 2079 0006 0ea2 moveal 60ea2 <_Per_CPU_Information+0xc>,%a0 46446: 2240 moveal %d0,%a1 46448: 22a8 0034 movel %a0@(52),%a1@ return -1; 4644c: 74ff moveq #-1,%d2 } return the_info->si_signo; } 4644e: 2002 movel %d2,%d0 46450: 4cee 3c1c ffd8 moveml %fp@(-40),%d2-%d4/%a2-%a5 46456: 4e5e unlk %fp ... =============================================================================== 00047ff4 : int sigwait( const sigset_t *set, int *sig ) { 47ff4: 4e56 0000 linkw %fp,#0 47ff8: 2f0a movel %a2,%sp@- 47ffa: 246e 000c moveal %fp@(12),%a2 int status; status = sigtimedwait( set, NULL, NULL ); 47ffe: 42a7 clrl %sp@- 48000: 42a7 clrl %sp@- 48002: 2f2e 0008 movel %fp@(8),%sp@- 48006: 4eb9 0004 7e50 jsr 47e50 if ( status != -1 ) { 4800c: 4fef 000c lea %sp@(12),%sp 48010: 72ff moveq #-1,%d1 48012: b280 cmpl %d0,%d1 48014: 6708 beqs 4801e if ( sig ) 48016: 4a8a tstl %a2 48018: 6710 beqs 4802a <== NEVER TAKEN *sig = status; 4801a: 2480 movel %d0,%a2@ 4801c: 600c bras 4802a return 0; } return errno; 4801e: 4eb9 0004 f698 jsr 4f698 <__errno> 48024: 2040 moveal %d0,%a0 48026: 2010 movel %a0@,%d0 48028: 6002 bras 4802c status = sigtimedwait( set, NULL, NULL ); if ( status != -1 ) { if ( sig ) *sig = status; return 0; 4802a: 4280 clrl %d0 } return errno; } 4802c: 246e fffc moveal %fp@(-4),%a2 48030: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000454f4 : timer_t *timerid ) { POSIX_Timer_Control *ptimer; if ( clock_id != CLOCK_REALTIME ) 454f4: 7001 moveq #1,%d0 int timer_create( clockid_t clock_id, struct sigevent *evp, timer_t *timerid ) { 454f6: 4e56 0000 linkw %fp,#0 454fa: 2f0b movel %a3,%sp@- 454fc: 266e 0010 moveal %fp@(16),%a3 45500: 2f0a movel %a2,%sp@- 45502: 246e 000c moveal %fp@(12),%a2 POSIX_Timer_Control *ptimer; if ( clock_id != CLOCK_REALTIME ) 45506: b0ae 0008 cmpl %fp@(8),%d0 4550a: 6620 bnes 4552c rtems_set_errno_and_return_minus_one( EINVAL ); if ( !timerid ) 4550c: 4a8b tstl %a3 4550e: 671c beqs 4552c /* * The data of the structure evp are checked in order to verify if they * are coherent. */ if (evp != NULL) { 45510: 4a8a tstl %a2 45512: 6726 beqs 4553a /* The structure has data */ if ( ( evp->sigev_notify != SIGEV_NONE ) && 45514: 2012 movel %a2@,%d0 45516: 7201 moveq #1,%d1 45518: 5380 subql #1,%d0 4551a: b280 cmpl %d0,%d1 4551c: 650e bcss 4552c <== NEVER TAKEN ( evp->sigev_notify != SIGEV_SIGNAL ) ) { /* The value of the field sigev_notify is not valid */ rtems_set_errno_and_return_minus_one( EINVAL ); } if ( !evp->sigev_signo ) 4551e: 202a 0004 movel %a2@(4),%d0 45522: 6708 beqs 4552c <== NEVER TAKEN static inline bool is_valid_signo( int signo ) { return ((signo) >= 1 && (signo) <= 32 ); 45524: 5380 subql #1,%d0 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(evp->sigev_signo) ) 45526: 721f moveq #31,%d1 45528: b280 cmpl %d0,%d1 4552a: 640e bccs 4553a <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); 4552c: 4eb9 0004 d3b4 jsr 4d3b4 <__errno> 45532: 7216 moveq #22,%d1 45534: 2040 moveal %d0,%a0 45536: 2081 movel %d1,%a0@ 45538: 6034 bras 4556e rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 4553a: 2039 0005 f548 movel 5f548 <_Thread_Dispatch_disable_level>,%d0 45540: 5280 addql #1,%d0 45542: 23c0 0005 f548 movel %d0,5f548 <_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 ); 45548: 4879 0005 f798 pea 5f798 <_POSIX_Timer_Information> 4554e: 4eb9 0004 71b0 jsr 471b0 <_Objects_Allocate> /* * Allocate a timer */ ptimer = _POSIX_Timer_Allocate(); if ( !ptimer ) { 45554: 588f addql #4,%sp 45556: 2040 moveal %d0,%a0 45558: 4a80 tstl %d0 4555a: 6616 bnes 45572 _Thread_Enable_dispatch(); 4555c: 4eb9 0004 813a jsr 4813a <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EAGAIN ); 45562: 4eb9 0004 d3b4 jsr 4d3b4 <__errno> 45568: 2040 moveal %d0,%a0 4556a: 700b moveq #11,%d0 4556c: 2080 movel %d0,%a0@ 4556e: 70ff moveq #-1,%d0 45570: 606a bras 455dc } /* The data of the created timer are stored to use them later */ ptimer->state = POSIX_TIMER_STATE_CREATE_NEW; 45572: 7002 moveq #2,%d0 45574: 1140 003c moveb %d0,%a0@(60) ptimer->thread_id = _Thread_Executing->Object.id; 45578: 2279 0005 f9b2 moveal 5f9b2 <_Per_CPU_Information+0xc>,%a1 4557e: 2169 0008 0038 movel %a1@(8),%a0@(56) if ( evp != NULL ) { 45584: 4a8a tstl %a2 45586: 6710 beqs 45598 ptimer->inf.sigev_notify = evp->sigev_notify; 45588: 2152 003e movel %a2@,%a0@(62) ptimer->inf.sigev_signo = evp->sigev_signo; 4558c: 216a 0004 0042 movel %a2@(4),%a0@(66) ptimer->inf.sigev_value = evp->sigev_value; 45592: 216a 0008 0046 movel %a2@(8),%a0@(70) uint32_t name ) { _Objects_Set_local_object( information, _Objects_Get_index( the_object->id ), 45598: 2028 0008 movel %a0@(8),%d0 Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 4559c: 4281 clrl %d1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4559e: 2279 0005 f7b0 moveal 5f7b0 <_POSIX_Timer_Information+0x18>,%a1 Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 455a4: 3200 movew %d0,%d1 } ptimer->overrun = 0; 455a6: 42a8 0066 clrl %a0@(102) ptimer->timer_data.it_value.tv_sec = 0; 455aa: 42a8 005a clrl %a0@(90) ptimer->timer_data.it_value.tv_nsec = 0; 455ae: 42a8 005e clrl %a0@(94) ptimer->timer_data.it_interval.tv_sec = 0; 455b2: 42a8 0052 clrl %a0@(82) ptimer->timer_data.it_interval.tv_nsec = 0; 455b6: 42a8 0056 clrl %a0@(86) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 455ba: 42a8 0018 clrl %a0@(24) the_watchdog->routine = routine; 455be: 42a8 002c clrl %a0@(44) the_watchdog->id = id; 455c2: 42a8 0030 clrl %a0@(48) the_watchdog->user_data = user_data; 455c6: 42a8 0034 clrl %a0@(52) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 455ca: 2388 1c00 movel %a0,%a1@(00000000,%d1:l:4) _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 455ce: 42a8 000c clrl %a0@(12) _Watchdog_Initialize( &ptimer->Timer, NULL, 0, NULL ); _Objects_Open_u32(&_POSIX_Timer_Information, &ptimer->Object, 0); *timerid = ptimer->Object.id; 455d2: 2680 movel %d0,%a3@ _Thread_Enable_dispatch(); 455d4: 4eb9 0004 813a jsr 4813a <_Thread_Enable_dispatch> return 0; 455da: 4280 clrl %d0 } 455dc: 246e fff8 moveal %fp@(-8),%a2 455e0: 266e fffc moveal %fp@(-4),%a3 455e4: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000456ba : useconds_t ualarm( useconds_t useconds, useconds_t interval ) { 456ba: 4e56 ffe8 linkw %fp,#-24 456be: 48d7 041c moveml %d2-%d4/%a2,%sp@ 456c2: 262e 0008 movel %fp@(8),%d3 /* * Initialize the timer used to implement alarm(). */ if ( !the_timer->routine ) { 456c6: 4ab9 0006 09d8 tstl 609d8 <_POSIX_signals_Ualarm_timer+0x1c> 456cc: 6620 bnes 456ee Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 456ce: 42b9 0006 09c4 clrl 609c4 <_POSIX_signals_Ualarm_timer+0x8> the_watchdog->routine = routine; 456d4: 203c 0004 5678 movel #284280,%d0 the_watchdog->id = id; 456da: 42b9 0006 09dc clrl 609dc <_POSIX_signals_Ualarm_timer+0x20> Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 456e0: 23c0 0006 09d8 movel %d0,609d8 <_POSIX_signals_Ualarm_timer+0x1c> the_watchdog->id = id; the_watchdog->user_data = user_data; 456e6: 42b9 0006 09e0 clrl 609e0 <_POSIX_signals_Ualarm_timer+0x24> 456ec: 6056 bras 45744 _Watchdog_Initialize( the_timer, _POSIX_signals_Ualarm_TSR, 0, NULL ); } else { Watchdog_States state; state = _Watchdog_Remove( the_timer ); 456ee: 4879 0006 09bc pea 609bc <_POSIX_signals_Ualarm_timer> 456f4: 4eb9 0004 8e34 jsr 48e34 <_Watchdog_Remove> if ( (state == WATCHDOG_ACTIVE) || (state == WATCHDOG_REMOVE_IT) ) { 456fa: 588f addql #4,%sp 456fc: 7201 moveq #1,%d1 456fe: 5580 subql #2,%d0 45700: b280 cmpl %d0,%d1 45702: 6540 bcss 45744 <== NEVER TAKEN * boot. Since alarm() is dealing in seconds, we must account for * this. */ ticks = the_timer->initial; ticks -= (the_timer->stop_time - the_timer->start_time); 45704: 2039 0006 09d0 movel 609d0 <_POSIX_signals_Ualarm_timer+0x14>,%d0 4570a: d0b9 0006 09c8 addl 609c8 <_POSIX_signals_Ualarm_timer+0xc>,%d0 /* remaining is now in ticks */ _Timespec_From_ticks( ticks, &tp ); 45710: 486e fff8 pea %fp@(-8) 45714: 90b9 0006 09d4 subl 609d4 <_POSIX_signals_Ualarm_timer+0x18>,%d0 remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND; 4571a: 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 ); 45720: 2f00 movel %d0,%sp@- 45722: 4eb9 0004 894c jsr 4894c <_Timespec_From_ticks> remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND; 45728: 202e fff8 movel %fp@(-8),%d0 4572c: 4c04 0800 mulsl %d4,%d0 remaining += tp.tv_nsec / 1000; 45730: 283c 0000 03e8 movel #1000,%d4 45736: 508f addql #8,%sp 45738: 242e fffc movel %fp@(-4),%d2 4573c: 4c44 2802 remsl %d4,%d2,%d2 45740: d480 addl %d0,%d2 45742: 6002 bras 45746 useconds_t ualarm( useconds_t useconds, useconds_t interval ) { useconds_t remaining = 0; 45744: 4282 clrl %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 ) { 45746: 4a83 tstl %d3 45748: 674e beqs 45798 Watchdog_Interval ticks; tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND; tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; 4574a: 283c 0000 03e8 movel #1000,%d4 ticks = _Timespec_To_ticks( &tp ); 45750: 45f9 0004 89cc lea 489cc <_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; 45756: 223c 000f 4240 movel #1000000,%d1 4575c: 4c41 3000 remul %d1,%d0,%d3 45760: 4c41 3003 remul %d1,%d3,%d3 45764: 2d43 fff8 movel %d3,%fp@(-8) tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; 45768: 4c00 4800 mulsl %d0,%d4 ticks = _Timespec_To_ticks( &tp ); 4576c: 260e movel %fp,%d3 4576e: 5183 subql #8,%d3 */ if ( useconds ) { Watchdog_Interval ticks; tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND; tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; 45770: 2d44 fffc movel %d4,%fp@(-4) ticks = _Timespec_To_ticks( &tp ); 45774: 2f03 movel %d3,%sp@- 45776: 4e92 jsr %a2@ if ( ticks == 0 ) ticks = 1; _Watchdog_Insert_ticks( the_timer, _Timespec_To_ticks( &tp ) ); 45778: 2f03 movel %d3,%sp@- 4577a: 4e92 jsr %a2@ ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 4577c: 4879 0006 09bc pea 609bc <_POSIX_signals_Ualarm_timer> 45782: 4879 0006 0268 pea 60268 <_Watchdog_Ticks_chain> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 45788: 23c0 0006 09c8 movel %d0,609c8 <_POSIX_signals_Ualarm_timer+0xc> _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 4578e: 4eb9 0004 8d0c jsr 48d0c <_Watchdog_Insert> 45794: 4fef 0010 lea %sp@(16),%sp } return remaining; } 45798: 2002 movel %d2,%d0 4579a: 4cee 041c ffe8 moveml %fp@(-24),%d2-%d4/%a2 457a0: 4e5e unlk %fp <== NOT EXECUTED