=============================================================================== 000460f8 <_API_Mutex_Unlock>: #include void _API_Mutex_Unlock( API_Mutex_Control *the_mutex ) { 460f8: 4e56 0000 linkw %fp,#0 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 460fc: 2039 0005 d90c movel 5d90c <_Thread_Dispatch_disable_level>,%d0 46102: 5280 addql #1,%d0 46104: 206e 0008 moveal %fp@(8),%a0 46108: 23c0 0005 d90c movel %d0,5d90c <_Thread_Dispatch_disable_level> _Thread_Disable_dispatch(); _CORE_mutex_Surrender( 4610e: 42a7 clrl %sp@- 46110: 2f28 0008 movel %a0@(8),%sp@- 46114: 4868 0010 pea %a0@(16) 46118: 4eb9 0004 637c jsr 4637c <_CORE_mutex_Surrender> &the_mutex->Mutex, the_mutex->Object.id, NULL ); _Thread_Enable_dispatch(); 4611e: 4fef 000c lea %sp@(12),%sp } 46122: 4e5e unlk %fp _CORE_mutex_Surrender( &the_mutex->Mutex, the_mutex->Object.id, NULL ); _Thread_Enable_dispatch(); 46124: 4ef9 0004 76ba jmp 476ba <_Thread_Enable_dispatch> ... =============================================================================== 00048120 <_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 ); 48120: 203c 0000 0700 movel #1792,%d0 Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_RWLock_API_mp_support_callout api_rwlock_mp_support ) { 48126: 4e56 ffe8 linkw %fp,#-24 4812a: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@ 4812e: 246e 0008 moveal %fp@(8),%a2 48132: 282e 000c movel %fp@(12),%d4 48136: 262e 0014 movel %fp@(20),%d3 4813a: 1a2e 0013 moveb %fp@(19),%d5 ISR_Level level; Thread_Control *executing = _Thread_Executing; 4813e: 2679 0006 07a0 moveal 607a0 <_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 ); 48144: 40c2 movew %sr,%d2 48146: 8082 orl %d2,%d0 48148: 46c0 movew %d0,%sr switch ( the_rwlock->current_state ) { 4814a: 202a 0044 movel %a2@(68),%d0 4814e: 6708 beqs 48158 <_CORE_RWLock_Obtain_for_reading+0x38> 48150: 7201 moveq #1,%d1 48152: b280 cmpl %d0,%d1 48154: 662a bnes 48180 <_CORE_RWLock_Obtain_for_reading+0x60> 48156: 600e bras 48166 <_CORE_RWLock_Obtain_for_reading+0x46> case CORE_RWLOCK_UNLOCKED: the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING; 48158: 7001 moveq #1,%d0 the_rwlock->number_of_readers += 1; 4815a: 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; 4815e: 2540 0044 movel %d0,%a2@(68) the_rwlock->number_of_readers += 1; _ISR_Enable( level ); 48162: 46c2 movew %d2,%sr 48164: 6014 bras 4817a <_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 ); 48166: 2f0a movel %a2,%sp@- 48168: 4eb9 0004 9cdc jsr 49cdc <_Thread_queue_First> if ( !waiter ) { 4816e: 588f addql #4,%sp 48170: 4a80 tstl %d0 48172: 660c bnes 48180 <_CORE_RWLock_Obtain_for_reading+0x60><== NEVER TAKEN the_rwlock->number_of_readers += 1; 48174: 52aa 0048 addql #1,%a2@(72) _ISR_Enable( level ); 48178: 46c2 movew %d2,%sr executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 4817a: 42ab 0034 clrl %a3@(52) return; 4817e: 6046 bras 481c6 <_CORE_RWLock_Obtain_for_reading+0xa6> /* * If the thread is not willing to wait, then return immediately. */ if ( !wait ) { 48180: 4a05 tstb %d5 48182: 660a bnes 4818e <_CORE_RWLock_Obtain_for_reading+0x6e> _ISR_Enable( level ); 48184: 46c2 movew %d2,%sr executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; 48186: 7202 moveq #2,%d1 48188: 2741 0034 movel %d1,%a3@(52) 4818c: 6038 bras 481c6 <_CORE_RWLock_Obtain_for_reading+0xa6> 4818e: 7001 moveq #1,%d0 48190: 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; 48194: 274a 0044 movel %a2,%a3@(68) executing->Wait.id = id; 48198: 2744 0020 movel %d4,%a3@(32) executing->Wait.option = CORE_RWLOCK_THREAD_WAITING_FOR_READ; 4819c: 42ab 0030 clrl %a3@(48) executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 481a0: 42ab 0034 clrl %a3@(52) _ISR_Enable( level ); 481a4: 46c2 movew %d2,%sr _Thread_queue_Enqueue_with_handler( 481a6: 2d43 000c movel %d3,%fp@(12) 481aa: 223c 0004 8310 movel #295696,%d1 481b0: 2d4a 0008 movel %a2,%fp@(8) timeout, _CORE_RWLock_Timeout ); /* return to API level so it can dispatch and we block */ } 481b4: 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( 481ba: 2d41 0010 movel %d1,%fp@(16) timeout, _CORE_RWLock_Timeout ); /* return to API level so it can dispatch and we block */ } 481be: 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( 481c0: 4ef9 0004 99d0 jmp 499d0 <_Thread_queue_Enqueue_with_handler> timeout, _CORE_RWLock_Timeout ); /* return to API level so it can dispatch and we block */ } 481c6: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 481cc: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004825c <_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 ); 4825c: 223c 0000 0700 movel #1792,%d1 */ CORE_RWLock_Status _CORE_RWLock_Release( CORE_RWLock_Control *the_rwlock ) { 48262: 4e56 fff0 linkw %fp,#-16 ISR_Level level; Thread_Control *executing = _Thread_Executing; 48266: 2079 0006 07a0 moveal 607a0 <_Per_CPU_Information+0xc>,%a0 */ CORE_RWLock_Status _CORE_RWLock_Release( CORE_RWLock_Control *the_rwlock ) { 4826c: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ 48270: 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 ); 48274: 40c0 movew %sr,%d0 48276: 8280 orl %d0,%d1 48278: 46c1 movew %d1,%sr if ( the_rwlock->current_state == CORE_RWLOCK_UNLOCKED){ 4827a: 222a 0044 movel %a2@(68),%d1 4827e: 660a bnes 4828a <_CORE_RWLock_Release+0x2e> _ISR_Enable( level ); 48280: 46c0 movew %d0,%sr executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; 48282: 7002 moveq #2,%d0 48284: 2140 0034 movel %d0,%a0@(52) return CORE_RWLOCK_SUCCESSFUL; 48288: 6078 bras 48302 <_CORE_RWLock_Release+0xa6> } if ( the_rwlock->current_state == CORE_RWLOCK_LOCKED_FOR_READING ) { 4828a: 7401 moveq #1,%d2 4828c: b481 cmpl %d1,%d2 4828e: 6610 bnes 482a0 <_CORE_RWLock_Release+0x44> the_rwlock->number_of_readers -= 1; 48290: 222a 0048 movel %a2@(72),%d1 48294: 5381 subql #1,%d1 48296: 2541 0048 movel %d1,%a2@(72) if ( the_rwlock->number_of_readers != 0 ) { 4829a: 6704 beqs 482a0 <_CORE_RWLock_Release+0x44> /* must be unlocked again */ _ISR_Enable( level ); 4829c: 46c0 movew %d0,%sr return CORE_RWLOCK_SUCCESSFUL; 4829e: 6062 bras 48302 <_CORE_RWLock_Release+0xa6> } } /* CORE_RWLOCK_LOCKED_FOR_WRITING or READING with readers */ executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 482a0: 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; 482a4: 42aa 0044 clrl %a2@(68) _ISR_Enable( level ); 482a8: 46c0 movew %d0,%sr next = _Thread_queue_Dequeue( &the_rwlock->Wait_queue ); 482aa: 2f0a movel %a2,%sp@- 482ac: 4eb9 0004 9894 jsr 49894 <_Thread_queue_Dequeue> if ( next ) { 482b2: 588f addql #4,%sp 482b4: 4a80 tstl %d0 482b6: 674a beqs 48302 <_CORE_RWLock_Release+0xa6> if ( next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) { 482b8: 7201 moveq #1,%d1 482ba: 2040 moveal %d0,%a0 482bc: b2a8 0030 cmpl %a0@(48),%d1 482c0: 6608 bnes 482ca <_CORE_RWLock_Release+0x6e> the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_WRITING; 482c2: 7002 moveq #2,%d0 482c4: 2540 0044 movel %d0,%a2@(68) return CORE_RWLOCK_SUCCESSFUL; 482c8: 6038 bras 48302 <_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; 482ca: 7201 moveq #1,%d1 } /* * Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING */ the_rwlock->number_of_readers += 1; 482cc: 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 ); 482d0: 49f9 0004 9cdc lea 49cdc <_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 ); 482d6: 47f9 0004 9bb0 lea 49bb0 <_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; 482dc: 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 ); 482e0: 2f0a movel %a2,%sp@- 482e2: 4e94 jsr %a4@ if ( !next || 482e4: 588f addql #4,%sp 482e6: 4a80 tstl %d0 482e8: 6718 beqs 48302 <_CORE_RWLock_Release+0xa6> 482ea: 7401 moveq #1,%d2 482ec: 2040 moveal %d0,%a0 482ee: b4a8 0030 cmpl %a0@(48),%d2 482f2: 670e beqs 48302 <_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; 482f4: 52aa 0048 addql #1,%a2@(72) _Thread_queue_Extract( &the_rwlock->Wait_queue, next ); 482f8: 2f00 movel %d0,%sp@- 482fa: 2f0a movel %a2,%sp@- 482fc: 4e93 jsr %a3@ } 482fe: 508f addql #8,%sp 48300: 60de bras 482e0 <_CORE_RWLock_Release+0x84> } /* indentation is to match _ISR_Disable at top */ return CORE_RWLOCK_SUCCESSFUL; } 48302: 4280 clrl %d0 48304: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 4830a: 4e5e unlk %fp ... =============================================================================== 00048310 <_CORE_RWLock_Timeout>: void _CORE_RWLock_Timeout( Objects_Id id, void *ignored ) { 48310: 4e56 fffc linkw %fp,#-4 Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 48314: 486e fffc pea %fp@(-4) 48318: 2f2e 0008 movel %fp@(8),%sp@- 4831c: 4eb9 0004 9570 jsr 49570 <_Thread_Get> switch ( location ) { 48322: 508f addql #8,%sp 48324: 4aae fffc tstl %fp@(-4) 48328: 6618 bnes 48342 <_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 ); 4832a: 2f00 movel %d0,%sp@- 4832c: 4eb9 0004 9ddc jsr 49ddc <_Thread_queue_Process_timeout> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 48332: 588f addql #4,%sp 48334: 2039 0006 0310 movel 60310 <_Thread_Dispatch_disable_level>,%d0 4833a: 5380 subql #1,%d0 4833c: 23c0 0006 0310 movel %d0,60310 <_Thread_Dispatch_disable_level> _Thread_Unnest_dispatch(); break; } } 48342: 4e5e unlk %fp ... =============================================================================== 00047190 <_CORE_barrier_Wait>: Thread_Control *executing; ISR_Level level; executing = _Thread_Executing; executing->Wait.return_code = CORE_BARRIER_STATUS_SUCCESSFUL; _ISR_Disable( level ); 47190: 203c 0000 0700 movel #1792,%d0 Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_barrier_API_mp_support_callout api_barrier_mp_support ) { 47196: 4e56 fff4 linkw %fp,#-12 Thread_Control *executing; ISR_Level level; executing = _Thread_Executing; 4719a: 2279 0005 f380 moveal 5f380 <_Per_CPU_Information+0xc>,%a1 Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_barrier_API_mp_support_callout api_barrier_mp_support ) { 471a0: 48d7 001c moveml %d2-%d4,%sp@ 471a4: 206e 0008 moveal %fp@(8),%a0 Thread_Control *executing; ISR_Level level; executing = _Thread_Executing; executing->Wait.return_code = CORE_BARRIER_STATUS_SUCCESSFUL; 471a8: 42a9 0034 clrl %a1@(52) Objects_Id id, bool wait, Watchdog_Interval timeout, CORE_barrier_API_mp_support_callout api_barrier_mp_support ) { 471ac: 242e 000c movel %fp@(12),%d2 471b0: 262e 0014 movel %fp@(20),%d3 471b4: 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 ); 471b8: 40c1 movew %sr,%d1 471ba: 8081 orl %d1,%d0 471bc: 46c0 movew %d0,%sr the_barrier->number_of_waiting_threads++; 471be: 2028 0048 movel %a0@(72),%d0 471c2: 5280 addql #1,%d0 471c4: 2140 0048 movel %d0,%a0@(72) if ( _CORE_barrier_Is_automatic( &the_barrier->Attributes ) ) { 471c8: 4aa8 0040 tstl %a0@(64) 471cc: 6626 bnes 471f4 <_CORE_barrier_Wait+0x64> if ( the_barrier->number_of_waiting_threads == 471ce: b0a8 0044 cmpl %a0@(68),%d0 471d2: 6620 bnes 471f4 <_CORE_barrier_Wait+0x64> the_barrier->Attributes.maximum_count) { executing->Wait.return_code = CORE_BARRIER_STATUS_AUTOMATICALLY_RELEASED; 471d4: 7001 moveq #1,%d0 471d6: 2340 0034 movel %d0,%a1@(52) _ISR_Enable( level ); 471da: 46c1 movew %d1,%sr _CORE_barrier_Release( the_barrier, id, api_barrier_mp_support ); 471dc: 2d44 0010 movel %d4,%fp@(16) 471e0: 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 ); } 471e4: 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 ); 471e8: 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 ); } 471ec: 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 ); 471ee: 4ef9 0004 ba0c jmp 4ba0c <_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; 471f4: 7001 moveq #1,%d0 471f6: 2140 0030 movel %d0,%a0@(48) return; } } _Thread_queue_Enter_critical_section( &the_barrier->Wait_queue ); executing->Wait.queue = &the_barrier->Wait_queue; 471fa: 2348 0044 movel %a0,%a1@(68) executing->Wait.id = id; 471fe: 2342 0020 movel %d2,%a1@(32) _ISR_Enable( level ); 47202: 46c1 movew %d1,%sr _Thread_queue_Enqueue( &the_barrier->Wait_queue, timeout ); 47204: 2d43 000c movel %d3,%fp@(12) 47208: 203c 0004 8e40 movel #298560,%d0 4720e: 2d48 0008 movel %a0,%fp@(8) } 47212: 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 ); 47216: 2d40 0010 movel %d0,%fp@(16) } 4721a: 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 ); 4721c: 4ef9 0004 8b30 jmp 48b30 <_Thread_queue_Enqueue_with_handler> ... =============================================================================== 00052d50 <_CORE_message_queue_Broadcast>: Objects_Id id __attribute__((unused)), CORE_message_queue_API_mp_support_callout api_message_queue_mp_support __attribute__((unused)), #endif uint32_t *count ) { 52d50: 4e56 ffe0 linkw %fp,#-32 52d54: 48d7 3c3c moveml %d2-%d5/%a2-%a5,%sp@ 52d58: 246e 0008 moveal %fp@(8),%a2 52d5c: 2a2e 000c movel %fp@(12),%d5 52d60: 262e 0010 movel %fp@(16),%d3 52d64: 286e 001c moveal %fp@(28),%a4 Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; if ( size > the_message_queue->maximum_message_size ) { 52d68: b6aa 004c cmpl %a2@(76),%d3 52d6c: 6244 bhis 52db2 <_CORE_message_queue_Broadcast+0x62><== NEVER TAKEN * NOTE: This check is critical because threads can block on * send and receive and this ensures that we are broadcasting * the message to threads waiting to receive -- not to send. */ if ( the_message_queue->number_of_pending_messages != 0 ) { 52d6e: 4aaa 0048 tstl %a2@(72) 52d72: 6610 bnes 52d84 <_CORE_message_queue_Broadcast+0x34> 52d74: 4282 clrl %d2 /* * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = 52d76: 283c 0005 51d8 movel #348632,%d4 const void *source, void *destination, size_t size ) { memcpy(destination, source, size); 52d7c: 4bf9 0005 a9bc lea 5a9bc ,%a5 52d82: 601a bras 52d9e <_CORE_message_queue_Broadcast+0x4e> * send and receive and this ensures that we are broadcasting * the message to threads waiting to receive -- not to send. */ if ( the_message_queue->number_of_pending_messages != 0 ) { *count = 0; 52d84: 4294 clrl %a4@ 52d86: 6026 bras 52dae <_CORE_message_queue_Broadcast+0x5e> 52d88: 2f03 movel %d3,%sp@- */ number_broadcasted = 0; while ((the_thread = _Thread_queue_Dequeue(&the_message_queue->Wait_queue))) { waitp = &the_thread->Wait; number_broadcasted += 1; 52d8a: 5282 addql #1,%d2 52d8c: 2f05 movel %d5,%sp@- 52d8e: 2f2b 002c movel %a3@(44),%sp@- 52d92: 4e95 jsr %a5@ buffer, waitp->return_argument_second.mutable_object, size ); *(size_t *) the_thread->Wait.return_argument = size; 52d94: 206b 0028 moveal %a3@(40),%a0 52d98: 4fef 000c lea %sp@(12),%sp 52d9c: 2083 movel %d3,%a0@ /* * There must be no pending messages if there is a thread waiting to * receive a message. */ number_broadcasted = 0; while ((the_thread = 52d9e: 2f0a movel %a2,%sp@- 52da0: 2044 moveal %d4,%a0 52da2: 4e90 jsr %a0@ 52da4: 588f addql #4,%sp 52da6: 2640 moveal %d0,%a3 52da8: 4a80 tstl %d0 52daa: 66dc bnes 52d88 <_CORE_message_queue_Broadcast+0x38> if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_message_queue_mp_support) ( the_thread, id ); #endif } *count = number_broadcasted; 52dac: 2882 movel %d2,%a4@ return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; 52dae: 4280 clrl %d0 52db0: 6002 bras 52db4 <_CORE_message_queue_Broadcast+0x64> Thread_Control *the_thread; uint32_t number_broadcasted; Thread_Wait_information *waitp; if ( size > the_message_queue->maximum_message_size ) { return CORE_MESSAGE_QUEUE_STATUS_INVALID_SIZE; 52db2: 7001 moveq #1,%d0 <== NOT EXECUTED #endif } *count = number_broadcasted; return CORE_MESSAGE_QUEUE_STATUS_SUCCESSFUL; } 52db4: 4cee 3c3c ffe0 moveml %fp@(-32),%d2-%d5/%a2-%a5 52dba: 4e5e unlk %fp ... =============================================================================== 0004dfc4 <_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)) { 4dfc4: 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 ) { 4dfc6: 4e56 fff4 linkw %fp,#-12 4dfca: 222e 0014 movel %fp@(20),%d1 4dfce: 48d7 040c moveml %d2-%d3/%a2,%sp@ 4dfd2: 246e 0008 moveal %fp@(8),%a2 4dfd6: 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)) { 4dfda: c081 andl %d1,%d0 ) { size_t message_buffering_required; size_t allocated_message_size; the_message_queue->maximum_pending_messages = maximum_pending_messages; 4dfdc: 2542 0044 movel %d2,%a2@(68) the_message_queue->number_of_pending_messages = 0; 4dfe0: 42aa 0048 clrl %a2@(72) the_message_queue->maximum_message_size = maximum_message_size; 4dfe4: 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; 4dfe8: 42aa 0060 clrl %a2@(96) the_message_queue->notify_argument = the_argument; 4dfec: 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)) { 4dff0: 4a80 tstl %d0 4dff2: 670e beqs 4e002 <_CORE_message_queue_Initialize+0x3e> allocated_message_size += sizeof(uint32_t); 4dff4: 2001 movel %d1,%d0 4dff6: 5880 addql #4,%d0 allocated_message_size &= ~(sizeof(uint32_t) - 1); 4dff8: 76fc moveq #-4,%d3 4dffa: c083 andl %d3,%d0 } if (allocated_message_size < maximum_message_size) 4dffc: b280 cmpl %d0,%d1 4dffe: 6272 bhis 4e072 <_CORE_message_queue_Initialize+0xae><== NEVER TAKEN 4e000: 6002 bras 4e004 <_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)) { 4e002: 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)); 4e004: 2600 movel %d0,%d3 4e006: 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 * 4e00c: 2203 movel %d3,%d1 4e00e: 4c02 1800 mulsl %d2,%d1 (allocated_message_size + sizeof(CORE_message_queue_Buffer_control)); if (message_buffering_required < allocated_message_size) 4e012: b081 cmpl %d1,%d0 4e014: 625c bhis 4e072 <_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 ); 4e016: 2f01 movel %d1,%sp@- 4e018: 4eb9 0005 0a34 jsr 50a34 <_Workspace_Allocate> if (the_message_queue->message_buffers == 0) 4e01e: 588f addql #4,%sp return false; /* * Attempt to allocate the message memory */ the_message_queue->message_buffers = (CORE_message_queue_Buffer *) 4e020: 2540 005c movel %d0,%a2@(92) _Workspace_Allocate( message_buffering_required ); if (the_message_queue->message_buffers == 0) 4e024: 674c beqs 4e072 <_CORE_message_queue_Initialize+0xae> /* * Initialize the pool of inactive messages, pending messages, * and set of waiting threads. */ _Chain_Initialize ( 4e026: 2f03 movel %d3,%sp@- 4e028: 2f02 movel %d2,%sp@- 4e02a: 2f00 movel %d0,%sp@- 4e02c: 486a 0068 pea %a2@(104) 4e030: 4eb9 0005 2b58 jsr 52b58 <_Chain_Initialize> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4e036: 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( 4e03a: 7001 moveq #1,%d0 4e03c: 2548 0050 movel %a0,%a2@(80) the_message_queue->message_buffers, (size_t) maximum_pending_messages, allocated_message_size + sizeof( CORE_message_queue_Buffer_control ) ); _Chain_Initialize_empty( &the_message_queue->Pending_messages ); 4e040: 41ea 0050 lea %a2@(80),%a0 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 4e044: 42aa 0054 clrl %a2@(84) 4e048: 2548 0058 movel %a0,%a2@(88) _Thread_queue_Initialize( 4e04c: 4878 0006 pea 6 4e050: 206e 000c moveal %fp@(12),%a0 4e054: 4878 0080 pea 80 4e058: b090 cmpl %a0@,%d0 4e05a: 57c0 seq %d0 4e05c: 49c0 extbl %d0 4e05e: 4480 negl %d0 4e060: 2f00 movel %d0,%sp@- 4e062: 2f0a movel %a2,%sp@- 4e064: 4eb9 0004 ff08 jsr 4ff08 <_Thread_queue_Initialize> THREAD_QUEUE_DISCIPLINE_PRIORITY : THREAD_QUEUE_DISCIPLINE_FIFO, STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; 4e06a: 4fef 0020 lea %sp@(32),%sp 4e06e: 7001 moveq #1,%d0 4e070: 6002 bras 4e074 <_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; 4e072: 4200 clrb %d0 STATES_WAITING_FOR_MESSAGE, CORE_MESSAGE_QUEUE_STATUS_TIMEOUT ); return true; } 4e074: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 4e07a: 4e5e unlk %fp ... =============================================================================== 000462d8 <_CORE_mutex_Seize>: Objects_Id _id, bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { 462d8: 4e56 0000 linkw %fp,#0 _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); 462dc: 2039 0005 d90c movel 5d90c <_Thread_Dispatch_disable_level>,%d0 Objects_Id _id, bool _wait, Watchdog_Interval _timeout, ISR_Level _level ) { 462e2: 2f0a movel %a2,%sp@- 462e4: 246e 0008 moveal %fp@(8),%a2 462e8: 2f02 movel %d2,%sp@- 462ea: 142e 0013 moveb %fp@(19),%d2 _CORE_mutex_Seize_body( _the_mutex, _id, _wait, _timeout, _level ); 462ee: 4a80 tstl %d0 462f0: 671c beqs 4630e <_CORE_mutex_Seize+0x36> 462f2: 4a02 tstb %d2 462f4: 6718 beqs 4630e <_CORE_mutex_Seize+0x36> <== NEVER TAKEN 462f6: 7001 moveq #1,%d0 462f8: b0b9 0005 da7a cmpl 5da7a <_System_state_Current>,%d0 462fe: 640e bccs 4630e <_CORE_mutex_Seize+0x36> 46300: 4878 0013 pea 13 46304: 42a7 clrl %sp@- 46306: 42a7 clrl %sp@- 46308: 4eb9 0004 694c jsr 4694c <_Internal_error_Occurred> 4630e: 486e 0018 pea %fp@(24) 46312: 2f0a movel %a2,%sp@- 46314: 4eb9 0004 a9fc jsr 4a9fc <_CORE_mutex_Seize_interrupt_trylock> 4631a: 508f addql #8,%sp 4631c: 4a80 tstl %d0 4631e: 6750 beqs 46370 <_CORE_mutex_Seize+0x98> 46320: 4a02 tstb %d2 46322: 6614 bnes 46338 <_CORE_mutex_Seize+0x60> 46324: 202e 0018 movel %fp@(24),%d0 46328: 46c0 movew %d0,%sr 4632a: 2079 0005 dd9c moveal 5dd9c <_Per_CPU_Information+0xc>,%a0 46330: 7001 moveq #1,%d0 46332: 2140 0034 movel %d0,%a0@(52) 46336: 6038 bras 46370 <_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; 46338: 7001 moveq #1,%d0 4633a: 2079 0005 dd9c moveal 5dd9c <_Per_CPU_Information+0xc>,%a0 46340: 2540 0030 movel %d0,%a2@(48) 46344: 2039 0005 d90c movel 5d90c <_Thread_Dispatch_disable_level>,%d0 4634a: 5280 addql #1,%d0 4634c: 216e 000c 0020 movel %fp@(12),%a0@(32) 46352: 214a 0044 movel %a2,%a0@(68) 46356: 23c0 0005 d90c movel %d0,5d90c <_Thread_Dispatch_disable_level> 4635c: 202e 0018 movel %fp@(24),%d0 46360: 46c0 movew %d0,%sr 46362: 2f2e 0014 movel %fp@(20),%sp@- 46366: 2f0a movel %a2,%sp@- 46368: 4eb9 0004 6274 jsr 46274 <_CORE_mutex_Seize_interrupt_blocking> 4636e: 508f addql #8,%sp } 46370: 242e fff8 movel %fp@(-8),%d2 46374: 246e fffc moveal %fp@(-4),%a2 46378: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000464c0 <_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 ) { 464c0: 4e56 0000 linkw %fp,#0 464c4: 2f0a movel %a2,%sp@- 464c6: 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)) ) { 464ca: 2f0a movel %a2,%sp@- 464cc: 4eb9 0004 7a04 jsr 47a04 <_Thread_queue_Dequeue> 464d2: 588f addql #4,%sp 464d4: 4a80 tstl %d0 464d6: 6624 bnes 464fc <_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 ); 464d8: 303c 0700 movew #1792,%d0 464dc: 40c1 movew %sr,%d1 464de: 8081 orl %d1,%d0 464e0: 46c0 movew %d0,%sr if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 464e2: 202a 0048 movel %a2@(72),%d0 464e6: b0aa 0040 cmpl %a2@(64),%d0 464ea: 640a bccs 464f6 <_CORE_semaphore_Surrender+0x36> <== NEVER TAKEN the_semaphore->count += 1; 464ec: 5280 addql #1,%d0 464ee: 2540 0048 movel %d0,%a2@(72) { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 464f2: 4280 clrl %d0 464f4: 6002 bras 464f8 <_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; 464f6: 7004 moveq #4,%d0 <== NOT EXECUTED _ISR_Enable( level ); 464f8: 46c1 movew %d1,%sr 464fa: 6002 bras 464fe <_CORE_semaphore_Surrender+0x3e> { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 464fc: 4280 clrl %d0 status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); } return status; } 464fe: 246e fffc moveal %fp@(-4),%a2 46502: 4e5e unlk %fp ... =============================================================================== 00045234 <_Event_Seize>: executing = _Thread_Executing; executing->Wait.return_code = RTEMS_SUCCESSFUL; api = executing->API_Extensions[ THREAD_API_RTEMS ]; _ISR_Disable( level ); 45234: 203c 0000 0700 movel #1792,%d0 rtems_event_set event_in, rtems_option option_set, rtems_interval ticks, rtems_event_set *event_out ) { 4523a: 4e56 ffec linkw %fp,#-20 4523e: 226e 0010 moveal %fp@(16),%a1 45242: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ rtems_event_set pending_events; ISR_Level level; RTEMS_API_Control *api; Thread_blocking_operation_States sync_state; executing = _Thread_Executing; 45246: 2479 0005 dd9c moveal 5dd9c <_Per_CPU_Information+0xc>,%a2 rtems_event_set event_in, rtems_option option_set, rtems_interval ticks, rtems_event_set *event_out ) { 4524c: 242e 0008 movel %fp@(8),%d2 45250: 262e 000c movel %fp@(12),%d3 45254: 206e 0014 moveal %fp@(20),%a0 ISR_Level level; RTEMS_API_Control *api; Thread_blocking_operation_States sync_state; executing = _Thread_Executing; executing->Wait.return_code = RTEMS_SUCCESSFUL; 45258: 42aa 0034 clrl %a2@(52) api = executing->API_Extensions[ THREAD_API_RTEMS ]; 4525c: 266a 010a moveal %a2@(266),%a3 _ISR_Disable( level ); 45260: 40c1 movew %sr,%d1 45262: 8081 orl %d1,%d0 45264: 46c0 movew %d0,%sr pending_events = api->pending_events; 45266: 2813 movel %a3@,%d4 RTEMS_INLINE_ROUTINE rtems_event_set _Event_sets_Get( rtems_event_set the_event_set, rtems_event_set the_event_condition ) { return ( the_event_set & the_event_condition ); 45268: 2002 movel %d2,%d0 4526a: c084 andl %d4,%d0 seized_events = _Event_sets_Get( pending_events, event_in ); if ( !_Event_sets_Is_empty( seized_events ) && 4526c: 6716 beqs 45284 <_Event_Seize+0x50> 4526e: b480 cmpl %d0,%d2 45270: 6706 beqs 45278 <_Event_Seize+0x44> (seized_events == event_in || _Options_Is_any( option_set )) ) { 45272: 0803 0001 btst #1,%d3 45276: 670c beqs 45284 <_Event_Seize+0x50> <== 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) ); 45278: 2400 movel %d0,%d2 4527a: 4682 notl %d2 4527c: c484 andl %d4,%d2 4527e: 2682 movel %d2,%a3@ api->pending_events = _Event_sets_Clear( pending_events, seized_events ); _ISR_Enable( level ); 45280: 46c1 movew %d1,%sr 45282: 600e bras 45292 <_Event_Seize+0x5e> *event_out = seized_events; return; } if ( _Options_Is_no_wait( option_set ) ) { 45284: 0803 0000 btst #0,%d3 45288: 670e beqs 45298 <_Event_Seize+0x64> _ISR_Enable( level ); 4528a: 46c1 movew %d1,%sr executing->Wait.return_code = RTEMS_UNSATISFIED; 4528c: 720d moveq #13,%d1 4528e: 2541 0034 movel %d1,%a2@(52) *event_out = seized_events; 45292: 2080 movel %d0,%a0@ return; 45294: 6000 0096 braw 4532c <_Event_Seize+0xf8> * * NOTE: Since interrupts are disabled, this isn't that much of an * issue but better safe than sorry. */ executing->Wait.option = (uint32_t) option_set; executing->Wait.count = (uint32_t) event_in; 45298: 2542 0024 movel %d2,%a2@(36) executing->Wait.return_argument = event_out; _Event_Sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 4529c: 7401 moveq #1,%d2 * set properly when we are marked as in the event critical section. * * NOTE: Since interrupts are disabled, this isn't that much of an * issue but better safe than sorry. */ executing->Wait.option = (uint32_t) option_set; 4529e: 2543 0030 movel %d3,%a2@(48) executing->Wait.count = (uint32_t) event_in; executing->Wait.return_argument = event_out; 452a2: 2548 0028 movel %a0,%a2@(40) _Event_Sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 452a6: 23c2 0005 e14a movel %d2,5e14a <_Event_Sync_state> _ISR_Enable( level ); 452ac: 46c1 movew %d1,%sr if ( ticks ) { 452ae: 4a89 tstl %a1 452b0: 6730 beqs 452e2 <_Event_Seize+0xae> _Watchdog_Initialize( 452b2: 202a 0008 movel %a2@(8),%d0 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 452b6: 223c 0004 5490 movel #283792,%d1 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 452bc: 42aa 0050 clrl %a2@(80) the_watchdog->routine = routine; 452c0: 2541 0064 movel %d1,%a2@(100) the_watchdog->id = id; 452c4: 2540 0068 movel %d0,%a2@(104) the_watchdog->user_data = user_data; 452c8: 42aa 006c clrl %a2@(108) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 452cc: 2549 0054 movel %a1,%a2@(84) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 452d0: 486a 0048 pea %a2@(72) 452d4: 4879 0005 d9ce pea 5d9ce <_Watchdog_Ticks_chain> 452da: 4eb9 0004 8638 jsr 48638 <_Watchdog_Insert> 452e0: 508f addql #8,%sp NULL ); _Watchdog_Insert_ticks( &executing->Timer, ticks ); } _Thread_Set_state( executing, STATES_WAITING_FOR_EVENT ); 452e2: 4878 0100 pea 100 452e6: 2f0a movel %a2,%sp@- 452e8: 4eb9 0004 7ef8 jsr 47ef8 <_Thread_Set_state> _ISR_Disable( level ); 452ee: 203c 0000 0700 movel #1792,%d0 452f4: 40c1 movew %sr,%d1 452f6: 8081 orl %d1,%d0 452f8: 46c0 movew %d0,%sr sync_state = _Event_Sync_state; _Event_Sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; if ( sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) { 452fa: 7401 moveq #1,%d2 452fc: 508f addql #8,%sp _Thread_Set_state( executing, STATES_WAITING_FOR_EVENT ); _ISR_Disable( level ); sync_state = _Event_Sync_state; 452fe: 2039 0005 e14a movel 5e14a <_Event_Sync_state>,%d0 _Event_Sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 45304: 42b9 0005 e14a clrl 5e14a <_Event_Sync_state> if ( sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) { 4530a: b480 cmpl %d0,%d2 4530c: 6604 bnes 45312 <_Event_Seize+0xde> _ISR_Enable( level ); 4530e: 46c1 movew %d1,%sr 45310: 601a bras 4532c <_Event_Seize+0xf8> * An interrupt completed the thread's blocking request. * The blocking thread was satisfied by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ _Thread_blocking_operation_Cancel( sync_state, executing, level ); 45312: 2d4a 000c movel %a2,%fp@(12) 45316: 2d41 0010 movel %d1,%fp@(16) } 4531a: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 * An interrupt completed the thread's blocking request. * The blocking thread was satisfied by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ _Thread_blocking_operation_Cancel( sync_state, executing, level ); 45320: 2d40 0008 movel %d0,%fp@(8) } 45324: 4e5e unlk %fp * An interrupt completed the thread's blocking request. * The blocking thread was satisfied by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ _Thread_blocking_operation_Cancel( sync_state, executing, level ); 45326: 4ef9 0004 7184 jmp 47184 <_Thread_blocking_operation_Cancel> } 4532c: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 45332: 4e5e unlk %fp ... =============================================================================== 0004538c <_Event_Surrender>: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; option_set = (rtems_option) the_thread->Wait.option; _ISR_Disable( level ); 4538c: 203c 0000 0700 movel #1792,%d0 */ void _Event_Surrender( Thread_Control *the_thread ) { 45392: 4e56 ffe8 linkw %fp,#-24 45396: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@ 4539a: 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 ]; 4539e: 206a 010a moveal %a2@(266),%a0 option_set = (rtems_option) the_thread->Wait.option; 453a2: 282a 0030 movel %a2@(48),%d4 _ISR_Disable( level ); 453a6: 40c1 movew %sr,%d1 453a8: 8081 orl %d1,%d0 453aa: 46c0 movew %d0,%sr pending_events = api->pending_events; event_condition = (rtems_event_set) the_thread->Wait.count; 453ac: 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 ); 453b0: 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; 453b2: 2410 movel %a0@,%d2 453b4: 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 ) ) { 453b6: 6606 bnes 453be <_Event_Surrender+0x32> _ISR_Enable( level ); 453b8: 46c1 movew %d1,%sr return; 453ba: 6000 00ca braw 45486 <_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() && 453be: 4ab9 0005 dd98 tstl 5dd98 <_Per_CPU_Information+0x8> 453c4: 674a beqs 45410 <_Event_Surrender+0x84> 453c6: b5f9 0005 dd9c cmpal 5dd9c <_Per_CPU_Information+0xc>,%a2 453cc: 6642 bnes 45410 <_Event_Surrender+0x84> _Thread_Is_executing( the_thread ) && ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 453ce: 2279 0005 e14a moveal 5e14a <_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 ) && 453d4: 7a02 moveq #2,%d5 453d6: ba89 cmpl %a1,%d5 453d8: 670e beqs 453e8 <_Event_Surrender+0x5c> <== NEVER TAKEN ((_Event_Sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { 453da: 2279 0005 e14a moveal 5e14a <_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) || 453e0: 1a3c 0001 moveb #1,%d5 453e4: ba89 cmpl %a1,%d5 453e6: 6628 bnes 45410 <_Event_Surrender+0x84> (_Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { 453e8: b680 cmpl %d0,%d3 453ea: 6706 beqs 453f2 <_Event_Surrender+0x66> 453ec: 0804 0001 btst #1,%d4 453f0: 671a beqs 4540c <_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) ); 453f2: 2600 movel %d0,%d3 453f4: 4683 notl %d3 453f6: c682 andl %d2,%d3 453f8: 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; 453fa: 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; 453fe: 42aa 0024 clrl %a2@(36) *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 45402: 2080 movel %d0,%a0@ _Event_Sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 45404: 7003 moveq #3,%d0 45406: 23c0 0005 e14a movel %d0,5e14a <_Event_Sync_state> } _ISR_Enable( level ); 4540c: 46c1 movew %d1,%sr return; 4540e: 6076 bras 45486 <_Event_Surrender+0xfa> */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_for_event ( States_Control the_states ) { return (the_states & STATES_WAITING_FOR_EVENT); 45410: 2a2a 0010 movel %a2@(16),%d5 45414: 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 ) ) { 4541a: 6768 beqs 45484 <_Event_Surrender+0xf8> if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { 4541c: b680 cmpl %d0,%d3 4541e: 6706 beqs 45426 <_Event_Surrender+0x9a> 45420: 0804 0001 btst #1,%d4 45424: 675e beqs 45484 <_Event_Surrender+0xf8> <== NEVER TAKEN 45426: 2600 movel %d0,%d3 45428: 4683 notl %d3 4542a: c682 andl %d2,%d3 4542c: 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; 4542e: 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; 45432: 42aa 0024 clrl %a2@(36) *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 45436: 2080 movel %d0,%a0@ _ISR_Flash( level ); 45438: 203c 0000 0700 movel #1792,%d0 4543e: 46c1 movew %d1,%sr 45440: 8081 orl %d1,%d0 45442: 46c0 movew %d0,%sr 45444: 47f9 0004 7314 lea 47314 <_Thread_Clear_state>,%a3 if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 4544a: 7a02 moveq #2,%d5 4544c: baaa 0050 cmpl %a2@(80),%d5 45450: 6710 beqs 45462 <_Event_Surrender+0xd6> _ISR_Enable( level ); 45452: 46c1 movew %d1,%sr RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 45454: 2f3c 1003 fff8 movel #268697592,%sp@- 4545a: 2f0a movel %a2,%sp@- 4545c: 4e93 jsr %a3@ 4545e: 508f addql #8,%sp 45460: 6024 bras 45486 <_Event_Surrender+0xfa> RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 45462: 7003 moveq #3,%d0 45464: 2540 0050 movel %d0,%a2@(80) _Thread_Unblock( the_thread ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 45468: 46c1 movew %d1,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 4546a: 486a 0048 pea %a2@(72) 4546e: 4eb9 0004 8754 jsr 48754 <_Watchdog_Remove> 45474: 2f3c 1003 fff8 movel #268697592,%sp@- 4547a: 2f0a movel %a2,%sp@- 4547c: 4e93 jsr %a3@ 4547e: 4fef 000c lea %sp@(12),%sp 45482: 6002 bras 45486 <_Event_Surrender+0xfa> _Thread_Unblock( the_thread ); } return; } } _ISR_Enable( level ); 45484: 46c1 movew %d1,%sr } 45486: 4cee 0c3c ffe8 moveml %fp@(-24),%d2-%d5/%a2-%a3 4548c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00045490 <_Event_Timeout>: void _Event_Timeout( Objects_Id id, void *ignored ) { 45490: 4e56 fffc linkw %fp,#-4 45494: 2f03 movel %d3,%sp@- 45496: 2f02 movel %d2,%sp@- Thread_Control *the_thread; Objects_Locations location; ISR_Level level; the_thread = _Thread_Get( id, &location ); 45498: 486e fffc pea %fp@(-4) 4549c: 2f2e 0008 movel %fp@(8),%sp@- 454a0: 4eb9 0004 76e0 jsr 476e0 <_Thread_Get> switch ( location ) { 454a6: 508f addql #8,%sp 454a8: 4aae fffc tstl %fp@(-4) 454ac: 6656 bnes 45504 <_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 ); 454ae: 223c 0000 0700 movel #1792,%d1 454b4: 40c2 movew %sr,%d2 454b6: 8282 orl %d2,%d1 454b8: 46c1 movew %d1,%sr _ISR_Enable( level ); return; } #endif the_thread->Wait.count = 0; 454ba: 2040 moveal %d0,%a0 454bc: 42a8 0024 clrl %a0@(36) if ( _Thread_Is_executing( the_thread ) ) { 454c0: b0b9 0005 dd9c cmpl 5dd9c <_Per_CPU_Information+0xc>,%d0 454c6: 6614 bnes 454dc <_Event_Timeout+0x4c> if ( _Event_Sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 454c8: 2239 0005 e14a movel 5e14a <_Event_Sync_state>,%d1 454ce: 7601 moveq #1,%d3 454d0: b681 cmpl %d1,%d3 454d2: 6608 bnes 454dc <_Event_Timeout+0x4c> _Event_Sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 454d4: 7202 moveq #2,%d1 454d6: 23c1 0005 e14a movel %d1,5e14a <_Event_Sync_state> } the_thread->Wait.return_code = RTEMS_TIMEOUT; 454dc: 7606 moveq #6,%d3 454de: 2040 moveal %d0,%a0 454e0: 2143 0034 movel %d3,%a0@(52) _ISR_Enable( level ); 454e4: 46c2 movew %d2,%sr 454e6: 2f3c 1003 fff8 movel #268697592,%sp@- 454ec: 2f00 movel %d0,%sp@- 454ee: 4eb9 0004 7314 jsr 47314 <_Thread_Clear_state> _Thread_Unblock( the_thread ); _Thread_Unnest_dispatch(); break; 454f4: 508f addql #8,%sp */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 454f6: 2039 0005 d90c movel 5d90c <_Thread_Dispatch_disable_level>,%d0 454fc: 5380 subql #1,%d0 454fe: 23c0 0005 d90c movel %d0,5d90c <_Thread_Dispatch_disable_level> case OBJECTS_REMOTE: /* impossible */ #endif case OBJECTS_ERROR: break; } } 45504: 242e fff4 movel %fp@(-12),%d2 45508: 262e fff8 movel %fp@(-8),%d3 4550c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004ab60 <_Heap_Allocate_aligned_with_boundary>: Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 4ab60: 4e56 ffbc linkw %fp,#-68 4ab64: 202e 000c movel %fp@(12),%d0 4ab68: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 4ab6c: 246e 0008 moveal %fp@(8),%a2 Heap_Statistics *const stats = &heap->stats; Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); Heap_Block *block = _Heap_Free_list_first( heap ); uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE 4ab70: 2e00 movel %d0,%d7 4ab72: 5887 addql #4,%d7 Heap_Control *heap, uintptr_t alloc_size, uintptr_t alignment, uintptr_t boundary ) { 4ab74: 222e 0010 movel %fp@(16),%d1 4ab78: 2a2e 0014 movel %fp@(20),%d5 if ( stats->max_search < search_count ) { stats->max_search = search_count; } return (void *) alloc_begin; } 4ab7c: 206a 0008 moveal %a2@(8),%a0 Heap_Statistics *const stats = &heap->stats; Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); Heap_Block *block = _Heap_Free_list_first( heap ); uintptr_t const block_size_floor = alloc_size + HEAP_BLOCK_HEADER_SIZE - HEAP_BLOCK_SIZE_OFFSET; uintptr_t const page_size = heap->page_size; 4ab80: 2c2a 0010 movel %a2@(16),%d6 uintptr_t alloc_begin = 0; uint32_t search_count = 0; if ( block_size_floor < alloc_size ) { 4ab84: b087 cmpl %d7,%d0 4ab86: 6200 013e bhiw 4acc6 <_Heap_Allocate_aligned_with_boundary+0x166> /* Integer overflow occured */ return NULL; } if ( boundary != 0 ) { 4ab8a: 4a85 tstl %d5 4ab8c: 670c beqs 4ab9a <_Heap_Allocate_aligned_with_boundary+0x3a> if ( boundary < alloc_size ) { 4ab8e: b085 cmpl %d5,%d0 4ab90: 6200 0134 bhiw 4acc6 <_Heap_Allocate_aligned_with_boundary+0x166> return NULL; } if ( alignment == 0 ) { 4ab94: 4a81 tstl %d1 4ab96: 6602 bnes 4ab9a <_Heap_Allocate_aligned_with_boundary+0x3a> alignment = page_size; 4ab98: 2206 movel %d6,%d1 uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size 4ab9a: 2406 movel %d6,%d2 + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; 4ab9c: 7804 moveq #4,%d4 uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size 4ab9e: 5e82 addql #7,%d2 + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; 4aba0: 9880 subl %d0,%d4 if ( boundary < alloc_size ) { return NULL; } if ( alignment == 0 ) { alignment = page_size; 4aba2: 4283 clrl %d3 uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size 4aba4: 2d42 fff8 movel %d2,%fp@(-8) + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; 4aba8: 2d44 fff4 movel %d4,%fp@(-12) 4abac: 2d47 ffe4 movel %d7,%fp@(-28) 4abb0: 2d46 ffec movel %d6,%fp@(-20) 4abb4: 6000 00fa braw 4acb0 <_Heap_Allocate_aligned_with_boundary+0x150> /* * The HEAP_PREV_BLOCK_USED flag is always set in the block size_and_flag * field. Thus the value is about one unit larger than the real block * size. The greater than operator takes this into account. */ if ( block->size_and_flag > block_size_floor ) { 4abb8: 2428 0004 movel %a0@(4),%d2 while ( block != free_list_tail ) { _HAssert( _Heap_Is_prev_used( block ) ); /* Statistics */ ++search_count; 4abbc: 5283 addql #1,%d3 /* * The HEAP_PREV_BLOCK_USED flag is always set in the block size_and_flag * field. Thus the value is about one unit larger than the real block * size. The greater than operator takes this into account. */ if ( block->size_and_flag > block_size_floor ) { 4abbe: b4ae ffe4 cmpl %fp@(-28),%d2 4abc2: 6300 00e8 blsw 4acac <_Heap_Allocate_aligned_with_boundary+0x14c> 4abc6: 43e8 0008 lea %a0@(8),%a1 if ( alignment == 0 ) { 4abca: 4a81 tstl %d1 4abcc: 6606 bnes 4abd4 <_Heap_Allocate_aligned_with_boundary+0x74> RTEMS_INLINE_ROUTINE uintptr_t _Heap_Alloc_area_of_block( const Heap_Block *block ) { return (uintptr_t) block + HEAP_BLOCK_HEADER_SIZE; 4abce: 2409 movel %a1,%d2 4abd0: 6000 00b6 braw 4ac88 <_Heap_Allocate_aligned_with_boundary+0x128> - 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; 4abd4: 7cfe moveq #-2,%d6 uintptr_t alignment, uintptr_t boundary ) { uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; 4abd6: 266a 0014 moveal %a2@(20),%a3 4abda: c486 andl %d6,%d2 uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size + HEAP_BLOCK_HEADER_SIZE + page_size - 1; 4abdc: 282e fff8 movel %fp@(-8),%d4 4abe0: 988b subl %a3,%d4 uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; uintptr_t const block_begin = (uintptr_t) block; uintptr_t const block_size = _Heap_Block_size( block ); uintptr_t const block_end = block_begin + block_size; 4abe2: d488 addl %a0,%d2 uintptr_t const alloc_begin_floor = _Heap_Alloc_area_of_block( block ); uintptr_t const alloc_begin_ceiling = block_end - min_block_size 4abe4: 2c04 movel %d4,%d6 4abe6: dc82 addl %d2,%d6 + HEAP_BLOCK_HEADER_SIZE + page_size - 1; uintptr_t alloc_end = block_end + HEAP_BLOCK_SIZE_OFFSET; uintptr_t alloc_begin = alloc_end - alloc_size; 4abe8: d4ae fff4 addl %fp@(-12),%d2 4abec: 2d42 fffc movel %d2,%fp@(-4) RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4abf0: 4c41 2007 remul %d1,%d7,%d2 4abf4: 242e fffc movel %fp@(-4),%d2 4abf8: 9487 subl %d7,%d2 alloc_begin = _Heap_Align_down( alloc_begin, alignment ); /* Ensure that the we have a valid new block at the end */ if ( alloc_begin > alloc_begin_ceiling ) { 4abfa: bc82 cmpl %d2,%d6 4abfc: 640a bccs 4ac08 <_Heap_Allocate_aligned_with_boundary+0xa8> 4abfe: 2806 movel %d6,%d4 4ac00: 4c41 4002 remul %d1,%d2,%d4 4ac04: 9c82 subl %d2,%d6 4ac06: 2406 movel %d6,%d2 } alloc_end = alloc_begin + alloc_size; /* Ensure boundary constaint */ if ( boundary != 0 ) { 4ac08: 4a85 tstl %d5 4ac0a: 675c beqs 4ac68 <_Heap_Allocate_aligned_with_boundary+0x108> /* Ensure that the we have a valid new block at the end */ if ( alloc_begin > alloc_begin_ceiling ) { alloc_begin = _Heap_Align_down( alloc_begin_ceiling, alignment ); } alloc_end = alloc_begin + alloc_size; 4ac0c: 2c02 movel %d2,%d6 4ac0e: dc80 addl %d0,%d6 /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; 4ac10: 49f1 0800 lea %a1@(00000000,%d0:l),%a4 /* Ensure that the we have a valid new block at the end */ if ( alloc_begin > alloc_begin_ceiling ) { alloc_begin = _Heap_Align_down( alloc_begin_ceiling, alignment ); } alloc_end = alloc_begin + alloc_size; 4ac14: 2d46 fff0 movel %d6,%fp@(-16) 4ac18: 2a6e fff0 moveal %fp@(-16),%a5 4ac1c: 4c45 6004 remul %d5,%d4,%d6 /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; 4ac20: 2d4c fffc movel %a4,%fp@(-4) 4ac24: 2e2e ffe4 movel %fp@(-28),%d7 4ac28: 9bc4 subal %d4,%a5 4ac2a: 284d moveal %a5,%a4 4ac2c: 2d43 ffe8 movel %d3,%fp@(-24) 4ac30: 282e fff0 movel %fp@(-16),%d4 4ac34: 6022 bras 4ac58 <_Heap_Allocate_aligned_with_boundary+0xf8> uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { if ( boundary_line < boundary_floor ) { 4ac36: b9ee fffc cmpal %fp@(-4),%a4 4ac3a: 6568 bcss 4aca4 <_Heap_Allocate_aligned_with_boundary+0x144> return 0; } alloc_begin = boundary_line - alloc_size; 4ac3c: 240c movel %a4,%d2 4ac3e: 9480 subl %d0,%d2 4ac40: 2802 movel %d2,%d4 4ac42: 4c41 4003 remul %d1,%d3,%d4 4ac46: 9483 subl %d3,%d2 alloc_begin = _Heap_Align_down( alloc_begin, alignment ); alloc_end = alloc_begin + alloc_size; 4ac48: 2802 movel %d2,%d4 4ac4a: d880 addl %d0,%d4 4ac4c: 2c04 movel %d4,%d6 4ac4e: 2a44 moveal %d4,%a5 4ac50: 4c45 6003 remul %d5,%d3,%d6 4ac54: 9bc3 subal %d3,%a5 4ac56: 284d moveal %a5,%a4 /* Ensure boundary constaint */ if ( boundary != 0 ) { uintptr_t const boundary_floor = alloc_begin_floor + alloc_size; uintptr_t boundary_line = _Heap_Align_down( alloc_end, boundary ); while ( alloc_begin < boundary_line && boundary_line < alloc_end ) { 4ac58: b9c2 cmpal %d2,%a4 4ac5a: 6304 blss 4ac60 <_Heap_Allocate_aligned_with_boundary+0x100> 4ac5c: b88c cmpl %a4,%d4 4ac5e: 62d6 bhis 4ac36 <_Heap_Allocate_aligned_with_boundary+0xd6> 4ac60: 262e ffe8 movel %fp@(-24),%d3 4ac64: 2d47 ffe4 movel %d7,%fp@(-28) boundary_line = _Heap_Align_down( alloc_end, boundary ); } } /* Ensure that the we have a valid new block at the beginning */ if ( alloc_begin >= alloc_begin_floor ) { 4ac68: b3c2 cmpal %d2,%a1 4ac6a: 6240 bhis 4acac <_Heap_Allocate_aligned_with_boundary+0x14c> 4ac6c: 2c2e ffec movel %fp@(-20),%d6 4ac70: 2802 movel %d2,%d4 4ac72: 327c fff8 moveaw #-8,%a1 4ac76: 93c8 subal %a0,%a1 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 4ac78: d3c2 addal %d2,%a1 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4ac7a: 4c46 4007 remul %d6,%d7,%d4 uintptr_t const alloc_block_begin = (uintptr_t) _Heap_Block_of_alloc_area( alloc_begin, page_size ); uintptr_t const free_size = alloc_block_begin - block_begin; 4ac7e: 93c7 subal %d7,%a1 if ( free_size >= min_block_size || free_size == 0 ) { 4ac80: b7c9 cmpal %a1,%a3 4ac82: 6304 blss 4ac88 <_Heap_Allocate_aligned_with_boundary+0x128> 4ac84: 4a89 tstl %a1 4ac86: 6624 bnes 4acac <_Heap_Allocate_aligned_with_boundary+0x14c> boundary ); } } if ( alloc_begin != 0 ) { 4ac88: 4a82 tstl %d2 4ac8a: 6720 beqs 4acac <_Heap_Allocate_aligned_with_boundary+0x14c><== NEVER TAKEN block = block->next; } if ( alloc_begin != 0 ) { /* Statistics */ stats->searches += search_count; 4ac8c: d7aa 004c addl %d3,%a2@(76) block = _Heap_Block_allocate( heap, block, alloc_begin, alloc_size ); 4ac90: 2f00 movel %d0,%sp@- 4ac92: 2f02 movel %d2,%sp@- 4ac94: 2f08 movel %a0,%sp@- 4ac96: 2f0a movel %a2,%sp@- 4ac98: 4eb9 0004 6858 jsr 46858 <_Heap_Block_allocate> 4ac9e: 4fef 0010 lea %sp@(16),%sp 4aca2: 6014 bras 4acb8 <_Heap_Allocate_aligned_with_boundary+0x158> 4aca4: 262e ffe8 movel %fp@(-24),%d3 4aca8: 2d47 ffe4 movel %d7,%fp@(-28) if ( alloc_begin != 0 ) { break; } block = block->next; 4acac: 2068 0008 moveal %a0@(8),%a0 if ( alignment == 0 ) { alignment = page_size; } } while ( block != free_list_tail ) { 4acb0: b5c8 cmpal %a0,%a2 4acb2: 6600 ff04 bnew 4abb8 <_Heap_Allocate_aligned_with_boundary+0x58> 4acb6: 4282 clrl %d2 boundary ); } /* Statistics */ if ( stats->max_search < search_count ) { 4acb8: b6aa 0044 cmpl %a2@(68),%d3 4acbc: 6304 blss 4acc2 <_Heap_Allocate_aligned_with_boundary+0x162> stats->max_search = search_count; 4acbe: 2543 0044 movel %d3,%a2@(68) } return (void *) alloc_begin; 4acc2: 2002 movel %d2,%d0 4acc4: 6002 bras 4acc8 <_Heap_Allocate_aligned_with_boundary+0x168> return NULL; } if ( boundary != 0 ) { if ( boundary < alloc_size ) { return NULL; 4acc6: 4280 clrl %d0 if ( stats->max_search < search_count ) { stats->max_search = search_count; } return (void *) alloc_begin; } 4acc8: 4cee 3cfc ffbc moveml %fp@(-68),%d2-%d7/%a2-%a5 4acce: 4e5e unlk %fp ... =============================================================================== 0004ee40 <_Heap_Extend>: Heap_Control *heap, void *extend_area_begin_ptr, uintptr_t extend_area_size, uintptr_t *extended_size_ptr ) { 4ee40: 4e56 ffcc linkw %fp,#-52 4ee44: 202e 0010 movel %fp@(16),%d0 4ee48: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 4ee4c: 246e 0008 moveal %fp@(8),%a2 4ee50: 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; 4ee54: 2403 movel %d3,%d2 4ee56: d480 addl %d0,%d2 uintptr_t const free_size = stats->free_size; 4ee58: 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; 4ee5c: 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; 4ee60: 2a2a 0010 movel %a2@(16),%d5 uintptr_t const min_block_size = heap->min_block_size; 4ee64: 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; 4ee68: 42ae fffc clrl %fp@(-4) Heap_Block *extend_last_block = NULL; 4ee6c: 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; 4ee70: 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 ) { 4ee74: b682 cmpl %d2,%d3 4ee76: 6200 01aa bhiw 4f022 <_Heap_Extend+0x1e2> return false; } extend_area_ok = _Heap_Get_first_and_last_block( 4ee7a: 486e fff8 pea %fp@(-8) 4ee7e: 486e fffc pea %fp@(-4) 4ee82: 2f01 movel %d1,%sp@- 4ee84: 2f05 movel %d5,%sp@- 4ee86: 2f00 movel %d0,%sp@- 4ee88: 2f03 movel %d3,%sp@- 4ee8a: 4eb9 0004 a22c jsr 4a22c <_Heap_Get_first_and_last_block> page_size, min_block_size, &extend_first_block, &extend_last_block ); if (!extend_area_ok ) { 4ee90: 4fef 0018 lea %sp@(24),%sp 4ee94: 4a00 tstb %d0 4ee96: 6700 018a beqw 4f022 <_Heap_Extend+0x1e2> 4ee9a: 2044 moveal %d4,%a0 4ee9c: 9bcd subal %a5,%a5 4ee9e: 4281 clrl %d1 4eea0: 97cb subal %a3,%a3 4eea2: 99cc subal %a4,%a4 return false; } do { uintptr_t const sub_area_begin = (start_block != first_block) ? (uintptr_t) start_block : heap->area_begin; 4eea4: b888 cmpl %a0,%d4 4eea6: 6704 beqs 4eeac <_Heap_Extend+0x6c> 4eea8: 2248 moveal %a0,%a1 4eeaa: 6004 bras 4eeb0 <_Heap_Extend+0x70> 4eeac: 226a 0018 moveal %a2@(24),%a1 uintptr_t const sub_area_end = start_block->prev_size; 4eeb0: 2010 movel %a0@,%d0 Heap_Block *const end_block = _Heap_Block_of_alloc_area( sub_area_end, page_size ); if ( 4eeb2: b680 cmpl %d0,%d3 4eeb4: 6406 bccs 4eebc <_Heap_Extend+0x7c> sub_area_end > extend_area_begin && extend_area_end > sub_area_begin 4eeb6: b3c2 cmpal %d2,%a1 4eeb8: 6500 0168 bcsw 4f022 <_Heap_Extend+0x1e2> ) { return false; } if ( extend_area_end == sub_area_begin ) { 4eebc: b3c2 cmpal %d2,%a1 4eebe: 6706 beqs 4eec6 <_Heap_Extend+0x86> merge_below_block = start_block; } else if ( extend_area_end < sub_area_end ) { 4eec0: b082 cmpl %d2,%d0 4eec2: 6206 bhis 4eeca <_Heap_Extend+0x8a> 4eec4: 6006 bras 4eecc <_Heap_Extend+0x8c> sub_area_end > extend_area_begin && extend_area_end > sub_area_begin ) { return false; } if ( extend_area_end == sub_area_begin ) { 4eec6: 2848 moveal %a0,%a4 4eec8: 6002 bras 4eecc <_Heap_Extend+0x8c> merge_below_block = start_block; } else if ( extend_area_end < sub_area_end ) { 4eeca: 2208 movel %a0,%d1 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4eecc: 2e00 movel %d0,%d7 4eece: 2240 moveal %d0,%a1 4eed0: 5189 subql #8,%a1 4eed2: 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); 4eed6: 93c6 subal %d6,%a1 link_below_block = start_block; } if ( sub_area_end == extend_area_begin ) { 4eed8: b680 cmpl %d0,%d3 4eeda: 6606 bnes 4eee2 <_Heap_Extend+0xa2> start_block->prev_size = extend_area_end; 4eedc: 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 ) 4eede: 2649 moveal %a1,%a3 4eee0: 6006 bras 4eee8 <_Heap_Extend+0xa8> merge_above_block = end_block; } else if ( sub_area_end < extend_area_begin ) { 4eee2: b680 cmpl %d0,%d3 4eee4: 6302 blss 4eee8 <_Heap_Extend+0xa8> 4eee6: 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; 4eee8: 70fe moveq #-2,%d0 4eeea: 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); 4eeee: 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 ); 4eef2: b888 cmpl %a0,%d4 4eef4: 66ae bnes 4eea4 <_Heap_Extend+0x64> if ( extend_area_begin < heap->area_begin ) { 4eef6: b6aa 0018 cmpl %a2@(24),%d3 4eefa: 6406 bccs 4ef02 <_Heap_Extend+0xc2> heap->area_begin = extend_area_begin; 4eefc: 2543 0018 movel %d3,%a2@(24) 4ef00: 600a bras 4ef0c <_Heap_Extend+0xcc> } else if ( heap->area_end < extend_area_end ) { 4ef02: b4aa 001c cmpl %a2@(28),%d2 4ef06: 6304 blss 4ef0c <_Heap_Extend+0xcc> heap->area_end = extend_area_end; 4ef08: 2542 001c movel %d2,%a2@(28) } extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; 4ef0c: 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 = 4ef10: 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; 4ef12: 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; 4ef14: 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 = 4ef18: 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; 4ef1a: 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; 4ef1c: 2282 movel %d2,%a1@ extend_first_block->size_and_flag = extend_first_block_size | HEAP_PREV_BLOCK_USED; 4ef1e: 2344 0004 movel %d4,%a1@(4) extend_last_block->prev_size = extend_first_block_size; 4ef22: 2080 movel %d0,%a0@ extend_last_block->size_and_flag = 0; 4ef24: 42a8 0004 clrl %a0@(4) if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) { 4ef28: b3ea 0020 cmpal %a2@(32),%a1 4ef2c: 6406 bccs 4ef34 <_Heap_Extend+0xf4> heap->first_block = extend_first_block; 4ef2e: 2549 0020 movel %a1,%a2@(32) 4ef32: 600a bras 4ef3e <_Heap_Extend+0xfe> } else if ( (uintptr_t) extend_last_block > (uintptr_t) heap->last_block ) { 4ef34: b1ea 0024 cmpal %a2@(36),%a0 4ef38: 6304 blss 4ef3e <_Heap_Extend+0xfe> heap->last_block = extend_last_block; 4ef3a: 2548 0024 movel %a0,%a2@(36) } if ( merge_below_block != NULL ) { 4ef3e: 4a8c tstl %a4 4ef40: 6732 beqs 4ef74 <_Heap_Extend+0x134> Heap_Control *heap, uintptr_t extend_area_begin, Heap_Block *first_block ) { uintptr_t const page_size = heap->page_size; 4ef42: 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 ); 4ef46: 5083 addql #8,%d3 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up( uintptr_t value, uintptr_t alignment ) { uintptr_t remainder = value % alignment; 4ef48: 2803 movel %d3,%d4 4ef4a: 4c40 4001 remul %d0,%d1,%d4 if ( remainder != 0 ) { 4ef4e: 4a81 tstl %d1 4ef50: 6704 beqs 4ef56 <_Heap_Extend+0x116> <== ALWAYS TAKEN return value - remainder + alignment; 4ef52: d680 addl %d0,%d3 <== NOT EXECUTED 4ef54: 9681 subl %d1,%d3 <== NOT EXECUTED uintptr_t const new_first_block_begin = 4ef56: 2043 moveal %d3,%a0 4ef58: 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 = 4ef5a: 200c movel %a4,%d0 4ef5c: 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; 4ef5e: 7201 moveq #1,%d1 4ef60: 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; 4ef62: 2094 movel %a4@,%a0@ new_first_block->size_and_flag = new_first_block_size | HEAP_PREV_BLOCK_USED; 4ef64: 2141 0004 movel %d1,%a0@(4) _Heap_Free_block( heap, new_first_block ); 4ef68: 2f08 movel %a0,%sp@- 4ef6a: 2f0a movel %a2,%sp@- 4ef6c: 4eba feb6 jsr %pc@(4ee24 <_Heap_Free_block>) 4ef70: 508f addql #8,%sp 4ef72: 6012 bras 4ef86 <_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 ) { 4ef74: 4a81 tstl %d1 4ef76: 670e beqs 4ef86 <_Heap_Extend+0x146> _Heap_Link_below( 4ef78: 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; 4ef7c: 7801 moveq #1,%d4 4ef7e: 9288 subl %a0,%d1 4ef80: 8881 orl %d1,%d4 4ef82: 2144 0004 movel %d4,%a0@(4) link_below_block, extend_last_block ); } if ( merge_above_block != NULL ) { 4ef86: 4a8b tstl %a3 4ef88: 6734 beqs 4efbe <_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, 4ef8a: 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( 4ef8c: 948b subl %a3,%d2 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4ef8e: 2202 movel %d2,%d1 4ef90: 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; 4ef96: 7201 moveq #1,%d1 4ef98: 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) 4ef9a: 202b 0004 movel %a3@(4),%d0 4ef9e: 9082 subl %d2,%d0 | HEAP_PREV_BLOCK_USED; 4efa0: 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; 4efa2: 7001 moveq #1,%d0 4efa4: 2781 2804 movel %d1,%a3@(00000004,%d2:l) 4efa8: c0ab 0004 andl %a3@(4),%d0 block->size_and_flag = size | flag; 4efac: 8480 orl %d0,%d2 4efae: 2742 0004 movel %d2,%a3@(4) _Heap_Block_set_size( last_block, last_block_new_size ); _Heap_Free_block( heap, last_block ); 4efb2: 2f0b movel %a3,%sp@- 4efb4: 2f0a movel %a2,%sp@- 4efb6: 4eba fe6c jsr %pc@(4ee24 <_Heap_Free_block>) 4efba: 508f addql #8,%sp 4efbc: 6020 bras 4efde <_Heap_Extend+0x19e> ); } if ( merge_above_block != NULL ) { _Heap_Merge_above( heap, merge_above_block, extend_area_end ); } else if ( link_above_block != NULL ) { 4efbe: 4a8d tstl %a5 4efc0: 671c beqs 4efde <_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; 4efc2: 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; 4efc4: 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 ); 4efc6: 222e fffc movel %fp@(-4),%d1 4efca: 928d subl %a5,%d1 4efcc: 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( 4efd0: 206e fff8 moveal %fp@(-8),%a0 block->size_and_flag = size | flag; 4efd4: 8280 orl %d0,%d1 4efd6: 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; 4efda: 89a8 0004 orl %d4,%a0@(4) extend_first_block, extend_last_block ); } if ( merge_below_block == NULL && merge_above_block == NULL ) { 4efde: 4a8c tstl %a4 4efe0: 6610 bnes 4eff2 <_Heap_Extend+0x1b2> 4efe2: 4a8b tstl %a3 4efe4: 660c bnes 4eff2 <_Heap_Extend+0x1b2> _Heap_Free_block( heap, extend_first_block ); 4efe6: 2f2e fffc movel %fp@(-4),%sp@- 4efea: 2f0a movel %a2,%sp@- 4efec: 4eba fe36 jsr %pc@(4ee24 <_Heap_Free_block>) 4eff0: 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 4eff2: 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; 4eff6: 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( 4eff8: 222a 0020 movel %a2@(32),%d1 4effc: 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; 4effe: c0a8 0004 andl %a0@(4),%d0 block->size_and_flag = size | flag; 4f002: 8280 orl %d0,%d1 } _Heap_Set_last_block_size( heap ); extended_size = stats->free_size - free_size; 4f004: 202a 0030 movel %a2@(48),%d0 4f008: 90ae fff4 subl %fp@(-12),%d0 4f00c: 2141 0004 movel %d1,%a0@(4) /* Statistics */ stats->size += extended_size; 4f010: d1aa 002c addl %d0,%a2@(44) if ( extended_size_ptr != NULL ) 4f014: 4aae 0014 tstl %fp@(20) 4f018: 670c beqs 4f026 <_Heap_Extend+0x1e6> <== NEVER TAKEN *extended_size_ptr = extended_size; 4f01a: 206e 0014 moveal %fp@(20),%a0 4f01e: 2080 movel %d0,%a0@ 4f020: 6004 bras 4f026 <_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; 4f022: 4200 clrb %d0 4f024: 6002 bras 4f028 <_Heap_Extend+0x1e8> stats->size += extended_size; if ( extended_size_ptr != NULL ) *extended_size_ptr = extended_size; return true; 4f026: 7001 moveq #1,%d0 } 4f028: 4cee 3cfc ffcc moveml %fp@(-52),%d2-%d7/%a2-%a5 4f02e: 4e5e unlk %fp ... =============================================================================== 0004acd4 <_Heap_Free>: #include #include #include bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { 4acd4: 4e56 ffe8 linkw %fp,#-24 4acd8: 202e 000c movel %fp@(12),%d0 4acdc: 2240 moveal %d0,%a1 4acde: 5189 subql #8,%a1 4ace0: 206e 0008 moveal %fp@(8),%a0 4ace4: 4c68 0001 0010 remul %a0@(16),%d1,%d0 4acea: 48d7 0c3c moveml %d2-%d5/%a2-%a3,%sp@ RTEMS_INLINE_ROUTINE bool _Heap_Is_block_in_heap( const Heap_Control *heap, const Heap_Block *block ) { return (uintptr_t) block >= (uintptr_t) heap->first_block 4acee: 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); 4acf2: 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; 4acf4: b889 cmpl %a1,%d4 4acf6: 620c bhis 4ad04 <_Heap_Free+0x30> 4acf8: b3e8 0024 cmpal %a0@(36),%a1 4acfc: 53c0 sls %d0 4acfe: 49c0 extbl %d0 4ad00: 4480 negl %d0 4ad02: 6002 bras 4ad06 <_Heap_Free+0x32> 4ad04: 4280 clrl %d0 Heap_Block *next_block = NULL; uintptr_t block_size = 0; uintptr_t next_block_size = 0; bool next_is_free = false; if ( !_Heap_Is_block_in_heap( heap, block ) ) { 4ad06: 4a00 tstb %d0 4ad08: 6700 012c beqw 4ae36 <_Heap_Free+0x162> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 4ad0c: 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; 4ad10: 70fe moveq #-2,%d0 4ad12: 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); 4ad14: 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; 4ad18: b88a cmpl %a2,%d4 4ad1a: 620c bhis 4ad28 <_Heap_Free+0x54> <== NEVER TAKEN 4ad1c: b5e8 0024 cmpal %a0@(36),%a2 4ad20: 53c1 sls %d1 4ad22: 49c1 extbl %d1 4ad24: 4481 negl %d1 4ad26: 6002 bras 4ad2a <_Heap_Free+0x56> 4ad28: 4281 clrl %d1 <== NOT EXECUTED } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 4ad2a: 4a01 tstb %d1 4ad2c: 6700 0108 beqw 4ae36 <_Heap_Free+0x162> --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 4ad30: 242a 0004 movel %a2@(4),%d2 if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { _HAssert( false ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 4ad34: 0802 0000 btst #0,%d2 4ad38: 6700 00fc beqw 4ae36 <_Heap_Free+0x162> - 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; 4ad3c: 72fe moveq #-2,%d1 _HAssert( false ); return false; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block 4ad3e: 2668 0024 moveal %a0@(36),%a3 4ad42: c481 andl %d1,%d2 && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); 4ad44: b7ca cmpal %a2,%a3 4ad46: 670c beqs 4ad54 <_Heap_Free+0x80> 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; 4ad48: 7201 moveq #1,%d1 4ad4a: c2b2 2804 andl %a2@(00000004,%d2:l),%d1 #include #include #include bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) 4ad4e: 5381 subql #1,%d1 4ad50: 4481 negl %d1 4ad52: 6002 bras 4ad56 <_Heap_Free+0x82> return false; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); 4ad54: 4281 clrl %d1 _HAssert( false ); return false; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block 4ad56: 1a01 moveb %d1,%d5 && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); if ( !_Heap_Is_prev_used( block ) ) { 4ad58: 0803 0000 btst #0,%d3 4ad5c: 6662 bnes 4adc0 <_Heap_Free+0xec> uintptr_t const prev_size = block->prev_size; 4ad5e: 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); 4ad60: 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; 4ad62: b889 cmpl %a1,%d4 4ad64: 620a bhis 4ad70 <_Heap_Free+0x9c> <== NEVER TAKEN 4ad66: b3cb cmpal %a3,%a1 4ad68: 53c1 sls %d1 4ad6a: 49c1 extbl %d1 4ad6c: 4481 negl %d1 4ad6e: 6002 bras 4ad72 <_Heap_Free+0x9e> 4ad70: 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 ) ) { 4ad72: 4a01 tstb %d1 4ad74: 6700 00c0 beqw 4ae36 <_Heap_Free+0x162> 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; 4ad78: 7201 moveq #1,%d1 4ad7a: 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) ) { 4ad7e: 6700 00b6 beqw 4ae36 <_Heap_Free+0x162> _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ 4ad82: 4a05 tstb %d5 4ad84: 6726 beqs 4adac <_Heap_Free+0xd8> return _Heap_Free_list_tail(heap)->prev; } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; 4ad86: 266a 0008 moveal %a2@(8),%a3 uintptr_t const size = block_size + prev_size + next_block_size; 4ad8a: d480 addl %d0,%d2 4ad8c: d682 addl %d2,%d3 _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4ad8e: 7401 moveq #1,%d2 Heap_Block *prev = block->prev; 4ad90: 246a 000c moveal %a2@(12),%a2 prev->next = next; 4ad94: 254b 0008 movel %a3,%a2@(8) 4ad98: 8483 orl %d3,%d2 next->prev = prev; 4ad9a: 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; 4ad9e: 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; 4ada2: 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; 4ada6: 2342 0004 movel %d2,%a1@(4) 4adaa: 607a bras 4ae26 <_Heap_Free+0x152> 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; 4adac: d680 addl %d0,%d3 prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4adae: 7201 moveq #1,%d1 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4adb0: 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; 4adb2: 8283 orl %d3,%d1 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = size; 4adb4: 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; 4adb6: 2341 0004 movel %d1,%a1@(4) next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4adba: c5aa 0004 andl %d2,%a2@(4) 4adbe: 6066 bras 4ae26 <_Heap_Free+0x152> next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ 4adc0: 4a01 tstb %d1 4adc2: 672a beqs 4adee <_Heap_Free+0x11a> RTEMS_INLINE_ROUTINE void _Heap_Free_list_replace( Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; 4adc4: 266a 0008 moveal %a2@(8),%a3 uintptr_t const size = block_size + next_block_size; 4adc8: 2202 movel %d2,%d1 4adca: d280 addl %d0,%d1 _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4adcc: 7401 moveq #1,%d2 Heap_Block *prev = old_block->prev; 4adce: 246a 000c moveal %a2@(12),%a2 new_block->next = next; 4add2: 234b 0008 movel %a3,%a1@(8) 4add6: 8481 orl %d1,%d2 new_block->prev = prev; 4add8: 234a 000c movel %a2,%a1@(12) next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; 4addc: 2381 1800 movel %d1,%a1@(00000000,%d1:l) next->prev = new_block; 4ade0: 2749 000c movel %a1,%a3@(12) prev->next = new_block; 4ade4: 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; 4ade8: 2342 0004 movel %d2,%a1@(4) 4adec: 6038 bras 4ae26 <_Heap_Free+0x152> 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; 4adee: 7201 moveq #1,%d1 next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4adf0: 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; 4adf2: 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; 4adf4: 2668 0008 moveal %a0@(8),%a3 new_block->next = next; new_block->prev = block_before; 4adf8: 2348 000c movel %a0,%a1@(12) 4adfc: 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; 4ae00: 2228 0038 movel %a0@(56),%d1 4ae04: 5281 addql #1,%d1 Heap_Block *new_block ) { Heap_Block *next = block_before->next; new_block->next = next; 4ae06: 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; 4ae0a: c5aa 0004 andl %d2,%a2@(4) new_block->prev = block_before; block_before->next = new_block; next->prev = new_block; 4ae0e: 2749 000c movel %a1,%a3@(12) next_block->prev_size = block_size; 4ae12: 2480 movel %d0,%a2@ { Heap_Block *next = block_before->next; new_block->next = next; new_block->prev = block_before; block_before->next = new_block; 4ae14: 2149 0008 movel %a1,%a0@(8) /* Statistics */ ++stats->free_blocks; 4ae18: 2141 0038 movel %d1,%a0@(56) if ( stats->max_free_blocks < stats->free_blocks ) { 4ae1c: b2a8 003c cmpl %a0@(60),%d1 4ae20: 6304 blss 4ae26 <_Heap_Free+0x152> stats->max_free_blocks = stats->free_blocks; 4ae22: 2141 003c movel %d1,%a0@(60) } /* Statistics */ --stats->used_blocks; ++stats->frees; stats->free_size += block_size; 4ae26: d1a8 0030 addl %d0,%a0@(48) stats->max_free_blocks = stats->free_blocks; } } /* Statistics */ --stats->used_blocks; 4ae2a: 53a8 0040 subql #1,%a0@(64) ++stats->frees; 4ae2e: 52a8 0050 addql #1,%a0@(80) stats->free_size += block_size; return( true ); 4ae32: 7001 moveq #1,%d0 4ae34: 6002 bras 4ae38 <_Heap_Free+0x164> /* 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 ); 4ae36: 4200 clrb %d0 --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 4ae38: 4cd7 0c3c moveml %sp@,%d2-%d5/%a2-%a3 4ae3c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0005a564 <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { 5a564: 4e56 0000 linkw %fp,#0 5a568: 202e 000c movel %fp@(12),%d0 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 5a56c: 2040 moveal %d0,%a0 5a56e: 5188 subql #8,%a0 5a570: 226e 0008 moveal %fp@(8),%a1 5a574: 2f02 movel %d2,%sp@- 5a576: 2400 movel %d0,%d2 5a578: 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 5a57e: 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); 5a582: 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; 5a584: b488 cmpl %a0,%d2 5a586: 620c bhis 5a594 <_Heap_Size_of_alloc_area+0x30> 5a588: b1e9 0024 cmpal %a1@(36),%a0 5a58c: 53c1 sls %d1 5a58e: 49c1 extbl %d1 5a590: 4481 negl %d1 5a592: 6002 bras 5a596 <_Heap_Size_of_alloc_area+0x32> 5a594: 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 ) ) { 5a596: 4a01 tstb %d1 5a598: 6738 beqs 5a5d2 <_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; 5a59a: 72fe moveq #-2,%d1 5a59c: 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); 5a5a0: 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; 5a5a2: b488 cmpl %a0,%d2 5a5a4: 620c bhis 5a5b2 <_Heap_Size_of_alloc_area+0x4e> <== NEVER TAKEN 5a5a6: b1e9 0024 cmpal %a1@(36),%a0 5a5aa: 53c1 sls %d1 5a5ac: 49c1 extbl %d1 5a5ae: 4481 negl %d1 5a5b0: 6002 bras 5a5b4 <_Heap_Size_of_alloc_area+0x50> 5a5b2: 4281 clrl %d1 <== NOT EXECUTED } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( 5a5b4: 4a01 tstb %d1 5a5b6: 671a beqs 5a5d2 <_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; 5a5b8: 7201 moveq #1,%d1 5a5ba: c2a8 0004 andl %a0@(4),%d1 !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) 5a5be: 6712 beqs 5a5d2 <_Heap_Size_of_alloc_area+0x6e> <== NEVER TAKEN ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_BLOCK_SIZE_OFFSET - alloc_begin; 5a5c0: 7204 moveq #4,%d1 5a5c2: 9280 subl %d0,%d1 5a5c4: 2001 movel %d1,%d0 5a5c6: d088 addl %a0,%d0 5a5c8: 226e 0010 moveal %fp@(16),%a1 5a5cc: 2280 movel %d0,%a1@ return true; 5a5ce: 7001 moveq #1,%d0 5a5d0: 6002 bras 5a5d4 <_Heap_Size_of_alloc_area+0x70> if ( !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) ) { return false; 5a5d2: 4200 clrb %d0 } *alloc_size = (uintptr_t) next_block + HEAP_BLOCK_SIZE_OFFSET - alloc_begin; return true; } 5a5d4: 241f movel %sp@+,%d2 5a5d6: 4e5e unlk %fp ... =============================================================================== 0004732e <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 4732e: 4e56 ffd0 linkw %fp,#-48 47332: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 47336: 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; 4733a: 45fa ffac lea %pc@(472e8 <_Heap_Walk_print_nothing>),%a2 bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 4733e: 242e 000c movel %fp@(12),%d2 uintptr_t const page_size = heap->page_size; 47342: 282b 0010 movel %a3@(16),%d4 uintptr_t const min_block_size = heap->min_block_size; 47346: 2a2b 0014 movel %a3@(20),%d5 Heap_Block *const first_block = heap->first_block; 4734a: 2c2b 0020 movel %a3@(32),%d6 Heap_Block *const last_block = heap->last_block; 4734e: 2e2b 0024 movel %a3@(36),%d7 Heap_Block *block = first_block; Heap_Walk_printer printer = dump ? _Heap_Walk_print : _Heap_Walk_print_nothing; 47352: 4a2e 0013 tstb %fp@(19) 47356: 6704 beqs 4735c <_Heap_Walk+0x2e> 47358: 45fa ff96 lea %pc@(472f0 <_Heap_Walk_print>),%a2 if ( !_System_state_Is_up( _System_state_Get() ) ) { 4735c: 7003 moveq #3,%d0 4735e: b0b9 0005 fdd2 cmpl 5fdd2 <_System_state_Current>,%d0 47364: 6600 02fc bnew 47662 <_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)( 47368: 2f2b 000c movel %a3@(12),%sp@- 4736c: 2f2b 0008 movel %a3@(8),%sp@- 47370: 2f07 movel %d7,%sp@- 47372: 2f06 movel %d6,%sp@- 47374: 2f2b 001c movel %a3@(28),%sp@- 47378: 2f2b 0018 movel %a3@(24),%sp@- 4737c: 2f05 movel %d5,%sp@- 4737e: 2f04 movel %d4,%sp@- 47380: 4879 0005 c1a5 pea 5c1a5 47386: 42a7 clrl %sp@- 47388: 2f02 movel %d2,%sp@- 4738a: 4e92 jsr %a2@ heap->area_begin, heap->area_end, first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { 4738c: 4fef 002c lea %sp@(44),%sp 47390: 4a84 tstl %d4 47392: 6608 bnes 4739c <_Heap_Walk+0x6e> (*printer)( source, true, "page size is zero\n" ); 47394: 4879 0005 c236 pea 5c236 4739a: 6050 bras 473ec <_Heap_Walk+0xbe> ) { #if (CPU_ALIGNMENT == 0) return true; #else return (((uintptr_t)address % CPU_ALIGNMENT) == 0); 4739c: 7003 moveq #3,%d0 4739e: c084 andl %d4,%d0 return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 473a0: 670c beqs 473ae <_Heap_Walk+0x80> (*printer)( 473a2: 2f04 movel %d4,%sp@- 473a4: 4879 0005 c249 pea 5c249 473aa: 6000 02ca braw 47676 <_Heap_Walk+0x348> RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 473ae: 2205 movel %d5,%d1 473b0: 4c44 1000 remul %d4,%d0,%d1 ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 473b4: 4a80 tstl %d0 473b6: 670c beqs 473c4 <_Heap_Walk+0x96> (*printer)( 473b8: 2f05 movel %d5,%sp@- 473ba: 4879 0005 c267 pea 5c267 473c0: 6000 02b4 braw 47676 <_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; 473c4: 2006 movel %d6,%d0 473c6: 5080 addql #8,%d0 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 473c8: 4c44 0001 remul %d4,%d1,%d0 ); return false; } if ( 473cc: 4a81 tstl %d1 473ce: 670c beqs 473dc <_Heap_Walk+0xae> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 473d0: 2f06 movel %d6,%sp@- 473d2: 4879 0005 c28b pea 5c28b 473d8: 6000 029c braw 47676 <_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; 473dc: 7001 moveq #1,%d0 473de: 2046 moveal %d6,%a0 473e0: c0a8 0004 andl %a0@(4),%d0 ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 473e4: 6616 bnes 473fc <_Heap_Walk+0xce> (*printer)( 473e6: 4879 0005 c2bc pea 5c2bc 473ec: 4878 0001 pea 1 473f0: 2f02 movel %d2,%sp@- 473f2: 4e92 jsr %a2@ 473f4: 4fef 000c lea %sp@(12),%sp 473f8: 6000 00ba braw 474b4 <_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; 473fc: 70fe moveq #-2,%d0 473fe: 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); 47400: 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; 47402: 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); 47406: 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; 47408: 7001 moveq #1,%d0 4740a: c0ac 0004 andl %a4@(4),%d0 ); return false; } if ( _Heap_Is_free( last_block ) ) { 4740e: 6608 bnes 47418 <_Heap_Walk+0xea> (*printer)( 47410: 4879 0005 c2ea pea 5c2ea 47416: 60d4 bras 473ec <_Heap_Walk+0xbe> ); return false; } if ( 47418: bc8c cmpl %a4,%d6 4741a: 6708 beqs 47424 <_Heap_Walk+0xf6> <== ALWAYS TAKEN _Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block ) { (*printer)( 4741c: 4879 0005 c2ff pea 5c2ff <== NOT EXECUTED 47422: 60c8 bras 473ec <_Heap_Walk+0xbe> <== NOT EXECUTED int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 47424: 262b 0010 movel %a3@(16),%d3 const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); 47428: 220b movel %a3,%d1 block = next_block; } while ( block != first_block ); return true; } 4742a: 206b 0008 moveal %a3@(8),%a0 4742e: 2d44 fff8 movel %d4,%fp@(-8) 47432: 2d43 fffc movel %d3,%fp@(-4) 47436: 6000 0088 braw 474c0 <_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; 4743a: b1eb 0020 cmpal %a3@(32),%a0 4743e: 650c bcss 4744c <_Heap_Walk+0x11e> 47440: b1eb 0024 cmpal %a3@(36),%a0 47444: 53c0 sls %d0 47446: 49c0 extbl %d0 47448: 4480 negl %d0 4744a: 6002 bras 4744e <_Heap_Walk+0x120> 4744c: 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 ) ) { 4744e: 4a00 tstb %d0 47450: 660c bnes 4745e <_Heap_Walk+0x130> (*printer)( 47452: 2f08 movel %a0,%sp@- 47454: 4879 0005 c32e pea 5c32e 4745a: 6000 021a braw 47676 <_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; 4745e: 4be8 0008 lea %a0@(8),%a5 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 47462: 200d movel %a5,%d0 47464: 262e fffc movel %fp@(-4),%d3 47468: 4c43 0004 remul %d3,%d4,%d0 ); return false; } if ( 4746c: 4a84 tstl %d4 4746e: 670c beqs 4747c <_Heap_Walk+0x14e> !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 47470: 2f08 movel %a0,%sp@- 47472: 4879 0005 c34e pea 5c34e 47478: 6000 01fc braw 47676 <_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; 4747c: 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; 4747e: 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; 47480: 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; 47484: c6b0 0804 andl %a0@(00000004,%d0:l),%d3 ); return false; } if ( _Heap_Is_used( free_block ) ) { 47488: 670c beqs 47496 <_Heap_Walk+0x168> (*printer)( 4748a: 2f08 movel %a0,%sp@- 4748c: 4879 0005 c37e pea 5c37e 47492: 6000 01e2 braw 47676 <_Heap_Walk+0x348> ); return false; } if ( free_block->prev != prev_block ) { 47496: 2028 000c movel %a0@(12),%d0 4749a: b280 cmpl %d0,%d1 4749c: 671c beqs 474ba <_Heap_Walk+0x18c> (*printer)( 4749e: 2f00 movel %d0,%sp@- 474a0: 2f08 movel %a0,%sp@- 474a2: 4879 0005 c39a pea 5c39a 474a8: 4878 0001 pea 1 474ac: 2f02 movel %d2,%sp@- 474ae: 4e92 jsr %a2@ 474b0: 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; 474b4: 4200 clrb %d0 474b6: 6000 01ac braw 47664 <_Heap_Walk+0x336> return false; } prev_block = free_block; free_block = free_block->next; 474ba: 2208 movel %a0,%d1 474bc: 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 ) { 474c0: b7c8 cmpal %a0,%a3 474c2: 6600 ff76 bnew 4743a <_Heap_Walk+0x10c> 474c6: 282e fff8 movel %fp@(-8),%d4 474ca: 6002 bras 474ce <_Heap_Walk+0x1a0> block->prev_size ); } block = next_block; } while ( block != first_block ); 474cc: 284d moveal %a5,%a4 return true; } 474ce: 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; 474d2: 76fe moveq #-2,%d3 474d4: c680 andl %d0,%d3 474d6: 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); 474da: 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; 474de: bbeb 0020 cmpal %a3@(32),%a5 474e2: 650c bcss 474f0 <_Heap_Walk+0x1c2> <== NEVER TAKEN 474e4: bbeb 0024 cmpal %a3@(36),%a5 474e8: 53c0 sls %d0 474ea: 49c0 extbl %d0 474ec: 4480 negl %d0 474ee: 6002 bras 474f2 <_Heap_Walk+0x1c4> 474f0: 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 ) ) { 474f2: 4a00 tstb %d0 474f4: 660c bnes 47502 <_Heap_Walk+0x1d4> (*printer)( 474f6: 2f0d movel %a5,%sp@- 474f8: 2f0c movel %a4,%sp@- 474fa: 4879 0005 c3cc pea 5c3cc 47500: 60a6 bras 474a8 <_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; 47502: be8c cmpl %a4,%d7 47504: 56c0 sne %d0 47506: 2200 movel %d0,%d1 47508: 4481 negl %d1 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 4750a: 2003 movel %d3,%d0 4750c: 1d41 fffb moveb %d1,%fp@(-5) 47510: 4c44 0001 remul %d4,%d1,%d0 ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { 47514: 4a81 tstl %d1 47516: 6714 beqs 4752c <_Heap_Walk+0x1fe> 47518: 4a2e fffb tstb %fp@(-5) 4751c: 670e beqs 4752c <_Heap_Walk+0x1fe> (*printer)( 4751e: 2f03 movel %d3,%sp@- 47520: 2f0c movel %a4,%sp@- 47522: 4879 0005 c3f9 pea 5c3f9 47528: 6000 ff7e braw 474a8 <_Heap_Walk+0x17a> ); return false; } if ( block_size < min_block_size && is_not_last_block ) { 4752c: ba83 cmpl %d3,%d5 4752e: 6322 blss 47552 <_Heap_Walk+0x224> 47530: 4a2e fffb tstb %fp@(-5) 47534: 671c beqs 47552 <_Heap_Walk+0x224> <== NEVER TAKEN (*printer)( 47536: 2f05 movel %d5,%sp@- 47538: 2f03 movel %d3,%sp@- 4753a: 2f0c movel %a4,%sp@- 4753c: 4879 0005 c427 pea 5c427 47542: 4878 0001 pea 1 47546: 2f02 movel %d2,%sp@- 47548: 4e92 jsr %a2@ block, block_size, min_block_size ); return false; 4754a: 4fef 0018 lea %sp@(24),%sp 4754e: 6000 ff64 braw 474b4 <_Heap_Walk+0x186> } if ( next_block_begin <= block_begin && is_not_last_block ) { 47552: b9cd cmpal %a5,%a4 47554: 6514 bcss 4756a <_Heap_Walk+0x23c> 47556: 4a2e fffb tstb %fp@(-5) 4755a: 670e beqs 4756a <_Heap_Walk+0x23c> (*printer)( 4755c: 2f0d movel %a5,%sp@- 4755e: 2f0c movel %a4,%sp@- 47560: 4879 0005 c452 pea 5c452 47566: 6000 ff40 braw 474a8 <_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; 4756a: 7001 moveq #1,%d0 4756c: c0ae fffc andl %fp@(-4),%d0 47570: 2d40 fffc movel %d0,%fp@(-4) 47574: 7001 moveq #1,%d0 47576: c0ad 0004 andl %a5@(4),%d0 ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 4757a: 6600 00ae bnew 4762a <_Heap_Walk+0x2fc> block = next_block; } while ( block != first_block ); return true; } 4757e: 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)( 47582: 43f9 0005 c172 lea 5c172 ,%a1 block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? 47588: 206c 0008 moveal %a4@(8),%a0 block = next_block; } while ( block != first_block ); return true; } 4758c: 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)( 47590: b1eb 000c cmpal %a3@(12),%a0 47594: 6710 beqs 475a6 <_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)" : "") 47596: 43f9 0005 c0ac lea 5c0ac ,%a1 4759c: b7c8 cmpal %a0,%a3 4759e: 6606 bnes 475a6 <_Heap_Walk+0x278> 475a0: 43f9 0005 c181 lea 5c181 ,%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 ? 475a6: 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)( 475aa: 223c 0005 c18b movel #377227,%d1 475b0: b0ae fff8 cmpl %fp@(-8),%d0 475b4: 6710 beqs 475c6 <_Heap_Walk+0x298> block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 475b6: 223c 0005 c0ac movel #377004,%d1 475bc: b7c0 cmpal %d0,%a3 475be: 6606 bnes 475c6 <_Heap_Walk+0x298> 475c0: 223c 0005 c19b movel #377243,%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)( 475c6: 2f09 movel %a1,%sp@- 475c8: 2f08 movel %a0,%sp@- 475ca: 2f01 movel %d1,%sp@- 475cc: 2f00 movel %d0,%sp@- 475ce: 2f03 movel %d3,%sp@- 475d0: 2f0c movel %a4,%sp@- 475d2: 4879 0005 c486 pea 5c486 475d8: 42a7 clrl %sp@- 475da: 2f02 movel %d2,%sp@- 475dc: 4e92 jsr %a2@ block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { 475de: 2015 movel %a5@,%d0 475e0: 4fef 0024 lea %sp@(36),%sp 475e4: b083 cmpl %d3,%d0 475e6: 671e beqs 47606 <_Heap_Walk+0x2d8> (*printer)( 475e8: 2f0d movel %a5,%sp@- 475ea: 2f00 movel %d0,%sp@- 475ec: 2f03 movel %d3,%sp@- 475ee: 2f0c movel %a4,%sp@- 475f0: 4879 0005 c4bb pea 5c4bb 475f6: 4878 0001 pea 1 475fa: 2f02 movel %d2,%sp@- 475fc: 4e92 jsr %a2@ 475fe: 4fef 001c lea %sp@(28),%sp 47602: 6000 feb0 braw 474b4 <_Heap_Walk+0x186> ); return false; } if ( !prev_used ) { 47606: 4aae fffc tstl %fp@(-4) 4760a: 660a bnes 47616 <_Heap_Walk+0x2e8> (*printer)( 4760c: 2f0c movel %a4,%sp@- 4760e: 4879 0005 c4f4 pea 5c4f4 47614: 6060 bras 47676 <_Heap_Walk+0x348> block = next_block; } while ( block != first_block ); return true; } 47616: 206b 0008 moveal %a3@(8),%a0 4761a: 6008 bras 47624 <_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 ) { 4761c: b9c8 cmpal %a0,%a4 4761e: 673c beqs 4765c <_Heap_Walk+0x32e> return true; } free_block = free_block->next; 47620: 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 ) { 47624: b7c8 cmpal %a0,%a3 47626: 66f4 bnes 4761c <_Heap_Walk+0x2ee> 47628: 6044 bras 4766e <_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) { 4762a: 4aae fffc tstl %fp@(-4) 4762e: 6716 beqs 47646 <_Heap_Walk+0x318> (*printer)( 47630: 2f03 movel %d3,%sp@- 47632: 2f0c movel %a4,%sp@- 47634: 4879 0005 c523 pea 5c523 4763a: 42a7 clrl %sp@- 4763c: 2f02 movel %d2,%sp@- 4763e: 4e92 jsr %a2@ 47640: 4fef 0014 lea %sp@(20),%sp 47644: 6016 bras 4765c <_Heap_Walk+0x32e> "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 47646: 2f14 movel %a4@,%sp@- 47648: 2f03 movel %d3,%sp@- 4764a: 2f0c movel %a4,%sp@- 4764c: 4879 0005 c53a pea 5c53a 47652: 42a7 clrl %sp@- 47654: 2f02 movel %d2,%sp@- 47656: 4e92 jsr %a2@ 47658: 4fef 0018 lea %sp@(24),%sp block->prev_size ); } block = next_block; } while ( block != first_block ); 4765c: bc8d cmpl %a5,%d6 4765e: 6600 fe6c bnew 474cc <_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; 47662: 7001 moveq #1,%d0 block = next_block; } while ( block != first_block ); return true; } 47664: 4cee 3cfc ffd0 moveml %fp@(-48),%d2-%d7/%a2-%a5 4766a: 4e5e unlk %fp 4766c: 4e75 rts return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 4766e: 2f0c movel %a4,%sp@- 47670: 4879 0005 c55f pea 5c55f 47676: 4878 0001 pea 1 4767a: 2f02 movel %d2,%sp@- 4767c: 4e92 jsr %a2@ 4767e: 4fef 0010 lea %sp@(16),%sp 47682: 6000 fe30 braw 474b4 <_Heap_Walk+0x186> ... =============================================================================== 0004694c <_Internal_error_Occurred>: void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 4694c: 4e56 0000 linkw %fp,#0 46950: 222e 000c movel %fp@(12),%d1 46954: 2f02 movel %d2,%sp@- 46956: 242e 0010 movel %fp@(16),%d2 _Internal_errors_What_happened.the_source = the_source; _Internal_errors_What_happened.is_internal = is_internal; 4695a: 13c1 0005 d9a6 moveb %d1,5d9a6 <_Internal_errors_What_happened+0x4> _Internal_errors_What_happened.the_error = the_error; _User_extensions_Fatal( the_source, is_internal, the_error ); 46960: 2f02 movel %d2,%sp@- void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 46962: 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 ); 46966: 0281 0000 00ff andil #255,%d1 bool is_internal, Internal_errors_t the_error ) { _Internal_errors_What_happened.the_source = the_source; 4696c: 23c0 0005 d9a2 movel %d0,5d9a2 <_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 ); 46972: 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; 46974: 23c2 0005 d9a8 movel %d2,5d9a8 <_Internal_errors_What_happened+0x6> _User_extensions_Fatal( the_source, is_internal, the_error ); 4697a: 2f00 movel %d0,%sp@- 4697c: 4eb9 0004 84ee jsr 484ee <_User_extensions_Fatal> RTEMS_INLINE_ROUTINE void _System_state_Set ( System_state_Codes state ) { _System_state_Current = state; 46982: 7005 moveq #5,%d0 _System_state_Set( SYSTEM_STATE_FAILED ); _CPU_Fatal_halt( the_error ); 46984: 2042 moveal %d2,%a0 46986: 243c 0000 0700 movel #1792,%d2 4698c: 23c0 0005 da7a movel %d0,5da7a <_System_state_Current> 46992: 40c0 movew %sr,%d0 46994: 8082 orl %d2,%d0 46996: 46c0 movew %d0,%sr 46998: 2008 movel %a0,%d0 <== NOT EXECUTED 4699a: 223c dead beef movel #-559038737,%d1 <== NOT EXECUTED 469a0: 4ac8 halt <== NOT EXECUTED 469a2: 4fef 000c lea %sp@(12),%sp 469a6: 60fe bras 469a6 <_Internal_error_Occurred+0x5a> =============================================================================== 00046a08 <_Objects_Allocate>: */ Objects_Control *_Objects_Allocate( Objects_Information *information ) { 46a08: 4e56 fff0 linkw %fp,#-16 46a0c: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ 46a10: 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 ) 46a14: 4aaa 0014 tstl %a2@(20) 46a18: 675e beqs 46a78 <_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 ); 46a1a: 240a movel %a2,%d2 46a1c: 0682 0000 001c addil #28,%d2 46a22: 47f9 0004 618c lea 4618c <_Chain_Get>,%a3 46a28: 2f02 movel %d2,%sp@- 46a2a: 4e93 jsr %a3@ if ( information->auto_extend ) { 46a2c: 588f addql #4,%sp 46a2e: 4a2a 0010 tstb %a2@(16) 46a32: 6746 beqs 46a7a <_Objects_Allocate+0x72> /* * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { 46a34: 4a80 tstl %d0 46a36: 6612 bnes 46a4a <_Objects_Allocate+0x42> _Objects_Extend_information( information ); 46a38: 2f0a movel %a2,%sp@- 46a3a: 4eb9 0004 6ab0 jsr 46ab0 <_Objects_Extend_information> the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 46a40: 2f02 movel %d2,%sp@- 46a42: 4e93 jsr %a3@ } if ( the_object ) { 46a44: 508f addql #8,%sp 46a46: 4a80 tstl %d0 46a48: 6730 beqs 46a7a <_Objects_Allocate+0x72> uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 46a4a: 2040 moveal %d0,%a0 46a4c: 4281 clrl %d1 46a4e: 4282 clrl %d2 46a50: 3228 000a movew %a0@(10),%d1 46a54: 342a 0008 movew %a2@(8),%d2 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 46a58: 206a 002a moveal %a2@(42),%a0 } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 46a5c: 9282 subl %d2,%d1 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; 46a5e: 342a 0012 movew %a2@(18),%d2 46a62: 4c42 1001 remul %d2,%d1,%d1 information->inactive_per_block[ block ]--; 46a66: e589 lsll #2,%d1 46a68: d1c1 addal %d1,%a0 46a6a: 5390 subql #1,%a0@ information->inactive--; 46a6c: 322a 0028 movew %a2@(40),%d1 46a70: 5381 subql #1,%d1 46a72: 3541 0028 movew %d1,%a2@(40) 46a76: 6002 bras 46a7a <_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; 46a78: 4280 clrl %d0 <== NOT EXECUTED ); } #endif return the_object; } 46a7a: 4cee 0c0c fff0 moveml %fp@(-16),%d2-%d3/%a2-%a3 46a80: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00046a84 <_Objects_Close>: RTEMS_INLINE_ROUTINE void _Objects_Invalidate_Id( Objects_Information *information, Objects_Control *the_object ) { _Objects_Set_local_object( 46a84: 4280 clrl %d0 void _Objects_Close( Objects_Information *information, Objects_Control *the_object ) { 46a86: 4e56 0000 linkw %fp,#0 46a8a: 226e 000c moveal %fp@(12),%a1 46a8e: 206e 0008 moveal %fp@(8),%a0 46a92: 2f0a movel %a2,%sp@- #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 46a94: 2468 0018 moveal %a0@(24),%a2 RTEMS_INLINE_ROUTINE void _Objects_Invalidate_Id( Objects_Information *information, Objects_Control *the_object ) { _Objects_Set_local_object( 46a98: 3029 000a movew %a1@(10),%d0 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 46a9c: 42b2 0c00 clrl %a2@(00000000,%d0:l:4) _Objects_Invalidate_Id( information, the_object ); _Objects_Namespace_remove( information, the_object ); } 46aa0: 245f moveal %sp@+,%a2 Objects_Control *the_object ) { _Objects_Invalidate_Id( information, the_object ); _Objects_Namespace_remove( information, the_object ); 46aa2: 2d49 000c movel %a1,%fp@(12) } 46aa6: 4e5e unlk %fp Objects_Control *the_object ) { _Objects_Invalidate_Id( information, the_object ); _Objects_Namespace_remove( information, the_object ); 46aa8: 4ef9 0004 6fb0 jmp 46fb0 <_Objects_Namespace_remove> ... =============================================================================== 00046dac <_Objects_Get_information>: Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint32_t the_class ) { 46dac: 4e56 0000 linkw %fp,#0 46db0: 2f03 movel %d3,%sp@- 46db2: 262e 0008 movel %fp@(8),%d3 46db6: 2f02 movel %d2,%sp@- 46db8: 242e 000c movel %fp@(12),%d2 Objects_Information *info; int the_class_api_maximum; if ( !the_class ) 46dbc: 6734 beqs 46df2 <_Objects_Get_information+0x46> <== NEVER TAKEN /* * 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 ); 46dbe: 2f03 movel %d3,%sp@- 46dc0: 4eb9 0004 ae40 jsr 4ae40 <_Objects_API_maximum_class> if ( the_class_api_maximum == 0 ) 46dc6: 588f addql #4,%sp 46dc8: 4a80 tstl %d0 46dca: 6726 beqs 46df2 <_Objects_Get_information+0x46> return NULL; if ( the_class > (uint32_t) the_class_api_maximum ) 46dcc: b082 cmpl %d2,%d0 46dce: 6522 bcss 46df2 <_Objects_Get_information+0x46> return NULL; if ( !_Objects_Information_table[ the_api ] ) 46dd0: 41f9 0005 d8c8 lea 5d8c8 <_Objects_Information_table>,%a0 46dd6: 2070 3c00 moveal %a0@(00000000,%d3:l:4),%a0 46dda: 4a88 tstl %a0 46ddc: 6714 beqs 46df2 <_Objects_Get_information+0x46> <== NEVER TAKEN return NULL; info = _Objects_Information_table[ the_api ][ the_class ]; 46dde: 2030 2c00 movel %a0@(00000000,%d2:l:4),%d0 if ( !info ) 46de2: 6710 beqs 46df4 <_Objects_Get_information+0x48> <== 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; 46de4: 2040 moveal %d0,%a0 46de6: 4a68 000e tstw %a0@(14) 46dea: 56c1 sne %d1 46dec: 49c1 extbl %d1 46dee: c081 andl %d1,%d0 46df0: 6002 bras 46df4 <_Objects_Get_information+0x48> if ( the_class > (uint32_t) the_class_api_maximum ) return NULL; if ( !_Objects_Information_table[ the_api ] ) return NULL; 46df2: 4280 clrl %d0 if ( info->maximum == 0 ) return NULL; #endif return info; } 46df4: 242e fff8 movel %fp@(-8),%d2 46df8: 262e fffc movel %fp@(-4),%d3 46dfc: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000545f4 <_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; 545f4: 7001 moveq #1,%d0 if ( information->maximum >= index ) { 545f6: 4281 clrl %d1 Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 545f8: 4e56 0000 linkw %fp,#0 545fc: 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; 54600: 90a8 0006 subl %a0@(6),%d0 54604: d0ae 000c addl %fp@(12),%d0 if ( information->maximum >= index ) { 54608: 3228 000e movew %a0@(14),%d1 Objects_Control *_Objects_Get_no_protection( Objects_Information *information, Objects_Id id, Objects_Locations *location ) { 5460c: 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 ) { 54610: b081 cmpl %d1,%d0 54612: 620e bhis 54622 <_Objects_Get_no_protection+0x2e> if ( (the_object = information->local_table[ index ]) != NULL ) { 54614: 2068 0018 moveal %a0@(24),%a0 54618: 2030 0c00 movel %a0@(00000000,%d0:l:4),%d0 5461c: 6704 beqs 54622 <_Objects_Get_no_protection+0x2e><== NEVER TAKEN *location = OBJECTS_LOCAL; 5461e: 4291 clrl %a1@ return the_object; 54620: 6006 bras 54628 <_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; 54622: 7001 moveq #1,%d0 54624: 2280 movel %d0,%a1@ return NULL; 54626: 4280 clrl %d0 } 54628: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00047d84 <_Objects_Id_to_name>: */ Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { 47d84: 4e56 fffc linkw %fp,#-4 47d88: 222e 0008 movel %fp@(8),%d1 47d8c: 2f02 movel %d2,%sp@- /* * Caller is trusted for name != NULL. */ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 47d8e: 4a81 tstl %d1 47d90: 660a bnes 47d9c <_Objects_Id_to_name+0x18> 47d92: 2079 0005 f264 moveal 5f264 <_Per_CPU_Information+0xc>,%a0 47d98: 2228 0008 movel %a0@(8),%d1 47d9c: 7418 moveq #24,%d2 47d9e: 2001 movel %d1,%d0 47da0: e4a8 lsrl %d2,%d0 47da2: 143c 0007 moveb #7,%d2 47da6: c082 andl %d2,%d0 */ RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid( uint32_t the_api ) { if ( !the_api || the_api > OBJECTS_APIS_LAST ) 47da8: 143c 0002 moveb #2,%d2 47dac: 2040 moveal %d0,%a0 47dae: 5388 subql #1,%a0 47db0: b488 cmpl %a0,%d2 47db2: 6540 bcss 47df4 <_Objects_Id_to_name+0x70> 47db4: 6048 bras 47dfe <_Objects_Id_to_name+0x7a> */ RTEMS_INLINE_ROUTINE uint32_t _Objects_Get_class( Objects_Id id ) { return (uint32_t) 47db6: 2001 movel %d1,%d0 47db8: 741b moveq #27,%d2 47dba: 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 ]; 47dbc: 2070 0c00 moveal %a0@(00000000,%d0:l:4),%a0 if ( !information ) 47dc0: 4a88 tstl %a0 47dc2: 6730 beqs 47df4 <_Objects_Id_to_name+0x70> <== NEVER TAKEN return OBJECTS_INVALID_ID; #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) 47dc4: 4a28 0032 tstb %a0@(50) 47dc8: 662a bnes 47df4 <_Objects_Id_to_name+0x70> <== NEVER TAKEN return OBJECTS_INVALID_ID; #endif the_object = _Objects_Get( information, tmpId, &ignored_location ); 47dca: 486e fffc pea %fp@(-4) 47dce: 2f01 movel %d1,%sp@- 47dd0: 2f08 movel %a0,%sp@- 47dd2: 4eb9 0004 7d24 jsr 47d24 <_Objects_Get> if ( !the_object ) 47dd8: 4fef 000c lea %sp@(12),%sp 47ddc: 4a80 tstl %d0 47dde: 6714 beqs 47df4 <_Objects_Id_to_name+0x70> return OBJECTS_INVALID_ID; *name = the_object->name; 47de0: 206e 000c moveal %fp@(12),%a0 47de4: 2240 moveal %d0,%a1 47de6: 20a9 000c movel %a1@(12),%a0@ _Thread_Enable_dispatch(); 47dea: 4eb9 0004 8612 jsr 48612 <_Thread_Enable_dispatch> return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; 47df0: 4280 clrl %d0 47df2: 6002 bras 47df6 <_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; 47df4: 7003 moveq #3,%d0 return OBJECTS_INVALID_ID; *name = the_object->name; _Thread_Enable_dispatch(); return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; } 47df6: 242e fff8 movel %fp@(-8),%d2 47dfa: 4e5e unlk %fp 47dfc: 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 ] ) 47dfe: 41f9 0005 ed90 lea 5ed90 <_Objects_Information_table>,%a0 47e04: 2070 0c00 moveal %a0@(00000000,%d0:l:4),%a0 47e08: 4a88 tstl %a0 47e0a: 66aa bnes 47db6 <_Objects_Id_to_name+0x32> <== ALWAYS TAKEN 47e0c: 60e6 bras 47df4 <_Objects_Id_to_name+0x70> <== NOT EXECUTED ... =============================================================================== 00046fe0 <_Objects_Name_to_id_u32>: Objects_Information *information, uint32_t name, uint32_t node, Objects_Id *id ) { 46fe0: 4e56 fff4 linkw %fp,#-12 46fe4: 226e 0008 moveal %fp@(8),%a1 46fe8: 48d7 040c moveml %d2-%d3/%a2,%sp@ 46fec: 242e 000c movel %fp@(12),%d2 46ff0: 202e 0010 movel %fp@(16),%d0 46ff4: 246e 0014 moveal %fp@(20),%a2 Objects_Name name_for_mp; #endif /* ASSERT: information->is_string == false */ if ( !id ) 46ff8: 4a8a tstl %a2 46ffa: 674a beqs 47046 <_Objects_Name_to_id_u32+0x66> return OBJECTS_INVALID_ADDRESS; if ( name == 0 ) 46ffc: 4a82 tstl %d2 46ffe: 674a beqs 4704a <_Objects_Name_to_id_u32+0x6a> <== NEVER TAKEN return OBJECTS_INVALID_NAME; search_local_node = false; if ( information->maximum != 0 && 47000: 3229 000e movew %a1@(14),%d1 47004: 6744 beqs 4704a <_Objects_Name_to_id_u32+0x6a> 47006: 4a80 tstl %d0 47008: 672e beqs 47038 <_Objects_Name_to_id_u32+0x58> (node == OBJECTS_SEARCH_ALL_NODES || 4700a: 0c80 7fff ffff cmpil #2147483647,%d0 47010: 6726 beqs 47038 <_Objects_Name_to_id_u32+0x58> node == OBJECTS_SEARCH_LOCAL_NODE || 47012: 7601 moveq #1,%d3 47014: b680 cmpl %d0,%d3 47016: 6632 bnes 4704a <_Objects_Name_to_id_u32+0x6a> <== NEVER TAKEN 47018: 601e bras 47038 <_Objects_Name_to_id_u32+0x58> if ( search_local_node ) { name_length = information->name_length; for ( index = 1; index <= information->maximum; index++ ) { the_object = information->local_table[ index ]; 4701a: 2069 0018 moveal %a1@(24),%a0 4701e: 2070 0c00 moveal %a0@(00000000,%d0:l:4),%a0 if ( !the_object ) 47022: 4a88 tstl %a0 47024: 670e beqs 47034 <_Objects_Name_to_id_u32+0x54> continue; if ( name == the_object->name.name_u32 ) { 47026: b4a8 000c cmpl %a0@(12),%d2 4702a: 6608 bnes 47034 <_Objects_Name_to_id_u32+0x54> *id = the_object->id; 4702c: 24a8 0008 movel %a0@(8),%a2@ return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; 47030: 4280 clrl %d0 47032: 6018 bras 4704c <_Objects_Name_to_id_u32+0x6c> search_local_node = true; if ( search_local_node ) { name_length = information->name_length; for ( index = 1; index <= information->maximum; index++ ) { 47034: 5280 addql #1,%d0 47036: 6008 bras 47040 <_Objects_Name_to_id_u32+0x60> search_local_node = false; if ( information->maximum != 0 && (node == OBJECTS_SEARCH_ALL_NODES || node == OBJECTS_SEARCH_LOCAL_NODE || 47038: 7001 moveq #1,%d0 search_local_node = true; if ( search_local_node ) { name_length = information->name_length; for ( index = 1; index <= information->maximum; index++ ) { 4703a: 0281 0000 ffff andil #65535,%d1 47040: b280 cmpl %d0,%d1 47042: 64d6 bccs 4701a <_Objects_Name_to_id_u32+0x3a> 47044: 6004 bras 4704a <_Objects_Name_to_id_u32+0x6a> #endif /* ASSERT: information->is_string == false */ if ( !id ) return OBJECTS_INVALID_ADDRESS; 47046: 7002 moveq #2,%d0 47048: 6002 bras 4704c <_Objects_Name_to_id_u32+0x6c> return OBJECTS_INVALID_NAME; name_for_mp.name_u32 = name; return _Objects_MP_Global_name_search( information, name_for_mp, node, id ); #else return OBJECTS_INVALID_NAME; 4704a: 7001 moveq #1,%d0 #endif } 4704c: 4cd7 040c moveml %sp@,%d2-%d3/%a2 47050: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000473cc <_Objects_Set_name>: { size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 473cc: 4280 clrl %d0 bool _Objects_Set_name( Objects_Information *information, Objects_Control *the_object, const char *name ) { 473ce: 4e56 ffec linkw %fp,#-20 473d2: 48d7 3c04 moveml %d2/%a2-%a5,%sp@ 473d6: 2a6e 0008 moveal %fp@(8),%a5 size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 473da: 302d 0034 movew %a5@(52),%d0 bool _Objects_Set_name( Objects_Information *information, Objects_Control *the_object, const char *name ) { 473de: 246e 0010 moveal %fp@(16),%a2 size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 473e2: 2f00 movel %d0,%sp@- bool _Objects_Set_name( Objects_Information *information, Objects_Control *the_object, const char *name ) { 473e4: 286e 000c moveal %fp@(12),%a4 size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 473e8: 2f0a movel %a2,%sp@- 473ea: 4eb9 0004 e604 jsr 4e604 #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) { 473f0: 508f addql #8,%sp { size_t length; const char *s; s = name; length = strnlen( name, information->name_length ); 473f2: 2640 moveal %d0,%a3 #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) { 473f4: 4a2d 0032 tstb %a5@(50) 473f8: 6744 beqs 4743e <_Objects_Set_name+0x72> char *d; d = _Workspace_Allocate( length + 1 ); 473fa: 486b 0001 pea %a3@(1) 473fe: 4eb9 0004 8cf4 jsr 48cf4 <_Workspace_Allocate> if ( !d ) 47404: 588f addql #4,%sp #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) { char *d; d = _Workspace_Allocate( length + 1 ); 47406: 2a40 moveal %d0,%a5 if ( !d ) 47408: 4a80 tstl %d0 4740a: 6700 0082 beqw 4748e <_Objects_Set_name+0xc2> return false; if ( the_object->name.name_p ) { 4740e: 202c 000c movel %a4@(12),%d0 47412: 670e beqs 47422 <_Objects_Set_name+0x56> _Workspace_Free( (void *)the_object->name.name_p ); 47414: 2f00 movel %d0,%sp@- 47416: 4eb9 0004 8d10 jsr 48d10 <_Workspace_Free> the_object->name.name_p = NULL; 4741c: 588f addql #4,%sp 4741e: 42ac 000c clrl %a4@(12) } strncpy( d, name, length ); 47422: 2f0b movel %a3,%sp@- 47424: 2f0a movel %a2,%sp@- 47426: 2f0d movel %a5,%sp@- 47428: 4eb9 0004 e580 jsr 4e580 d[length] = '\0'; the_object->name.name_p = d; 4742e: 4fef 000c lea %sp@(12),%sp _Workspace_Free( (void *)the_object->name.name_p ); the_object->name.name_p = NULL; } strncpy( d, name, length ); d[length] = '\0'; 47432: 4200 clrb %d0 47434: 1b80 b800 moveb %d0,%a5@(00000000,%a3:l) the_object->name.name_p = d; 47438: 294d 000c movel %a5,%a4@(12) 4743c: 604c bras 4748a <_Objects_Set_name+0xbe> } else #endif { the_object->name.name_u32 = _Objects_Build_name( 4743e: 7418 moveq #24,%d2 47440: 1212 moveb %a2@,%d1 47442: 7020 moveq #32,%d0 47444: 4840 swap %d0 47446: 49c1 extbl %d1 47448: e5a9 lsll %d2,%d1 4744a: 143c 0001 moveb #1,%d2 4744e: b48b cmpl %a3,%d2 47450: 640a bccs 4745c <_Objects_Set_name+0x90> 47452: 102a 0001 moveb %a2@(1),%d0 47456: 49c0 extbl %d0 47458: 4840 swap %d0 4745a: 4240 clrw %d0 4745c: 7402 moveq #2,%d2 4745e: 8280 orl %d0,%d1 47460: 203c 0000 2000 movel #8192,%d0 47466: b48b cmpl %a3,%d2 47468: 6408 bccs 47472 <_Objects_Set_name+0xa6> 4746a: 102a 0002 moveb %a2@(2),%d0 4746e: 49c0 extbl %d0 47470: e188 lsll #8,%d0 47472: 8081 orl %d1,%d0 47474: 7203 moveq #3,%d1 47476: b28b cmpl %a3,%d1 47478: 6408 bccs 47482 <_Objects_Set_name+0xb6> 4747a: 142a 0003 moveb %a2@(3),%d2 4747e: 49c2 extbl %d2 47480: 6002 bras 47484 <_Objects_Set_name+0xb8> 47482: 7420 moveq #32,%d2 47484: 8082 orl %d2,%d0 47486: 2940 000c movel %d0,%a4@(12) ((3 < length) ? s[ 3 ] : ' ') ); } return true; 4748a: 7001 moveq #1,%d0 4748c: 6002 bras 47490 <_Objects_Set_name+0xc4> if ( information->is_string ) { char *d; d = _Workspace_Allocate( length + 1 ); if ( !d ) return false; 4748e: 4200 clrb %d0 <== NOT EXECUTED ); } return true; } 47490: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 47496: 4e5e unlk %fp ... =============================================================================== 00046400 <_POSIX_Condition_variables_Wait_support>: pthread_cond_t *cond, pthread_mutex_t *mutex, Watchdog_Interval timeout, bool already_timedout ) { 46400: 4e56 ffe4 linkw %fp,#-28 46404: 48d7 3c0c moveml %d2-%d3/%a2-%a5,%sp@ register POSIX_Condition_variables_Control *the_cond; Objects_Locations location; int status; int mutex_status; if ( !_POSIX_Mutex_Get( mutex, &location ) ) { 46408: 240e movel %fp,%d2 4640a: 5982 subql #4,%d2 pthread_cond_t *cond, pthread_mutex_t *mutex, Watchdog_Interval timeout, bool already_timedout ) { 4640c: 246e 000c moveal %fp@(12),%a2 register POSIX_Condition_variables_Control *the_cond; Objects_Locations location; int status; int mutex_status; if ( !_POSIX_Mutex_Get( mutex, &location ) ) { 46410: 2f02 movel %d2,%sp@- pthread_cond_t *cond, pthread_mutex_t *mutex, Watchdog_Interval timeout, bool already_timedout ) { 46412: 286e 0008 moveal %fp@(8),%a4 register POSIX_Condition_variables_Control *the_cond; Objects_Locations location; int status; int mutex_status; if ( !_POSIX_Mutex_Get( mutex, &location ) ) { 46416: 2f0a movel %a2,%sp@- pthread_cond_t *cond, pthread_mutex_t *mutex, Watchdog_Interval timeout, bool already_timedout ) { 46418: 162e 0017 moveb %fp@(23),%d3 register POSIX_Condition_variables_Control *the_cond; Objects_Locations location; int status; int mutex_status; if ( !_POSIX_Mutex_Get( mutex, &location ) ) { 4641c: 4eb9 0004 6558 jsr 46558 <_POSIX_Mutex_Get> 46422: 508f addql #8,%sp 46424: 4a80 tstl %d0 46426: 6700 00aa beqw 464d2 <_POSIX_Condition_variables_Wait_support+0xd2> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 4642a: 2039 0005 fe0c movel 5fe0c <_Thread_Dispatch_disable_level>,%d0 46430: 5380 subql #1,%d0 return EINVAL; } _Thread_Unnest_dispatch(); the_cond = _POSIX_Condition_variables_Get( cond, &location ); 46432: 2f02 movel %d2,%sp@- 46434: 23c0 0005 fe0c movel %d0,5fe0c <_Thread_Dispatch_disable_level> 4643a: 2f0c movel %a4,%sp@- 4643c: 4eb9 0004 6234 jsr 46234 <_POSIX_Condition_variables_Get> switch ( location ) { 46442: 508f addql #8,%sp return EINVAL; } _Thread_Unnest_dispatch(); the_cond = _POSIX_Condition_variables_Get( cond, &location ); 46444: 2640 moveal %d0,%a3 switch ( location ) { 46446: 4aae fffc tstl %fp@(-4) 4644a: 6600 0086 bnew 464d2 <_POSIX_Condition_variables_Wait_support+0xd2> case OBJECTS_LOCAL: if ( the_cond->Mutex && ( the_cond->Mutex != *mutex ) ) { 4644e: 202b 0014 movel %a3@(20),%d0 46452: 670c beqs 46460 <_POSIX_Condition_variables_Wait_support+0x60> 46454: b092 cmpl %a2@,%d0 46456: 6708 beqs 46460 <_POSIX_Condition_variables_Wait_support+0x60> _Thread_Enable_dispatch(); 46458: 4eb9 0004 92f2 jsr 492f2 <_Thread_Enable_dispatch> 4645e: 6072 bras 464d2 <_POSIX_Condition_variables_Wait_support+0xd2> return EINVAL; } (void) pthread_mutex_unlock( mutex ); 46460: 2f0a movel %a2,%sp@- 46462: 4bf9 0004 92f2 lea 492f2 <_Thread_Enable_dispatch>,%a5 46468: 4eb9 0004 67b0 jsr 467b0 _Thread_Enable_dispatch(); return EINVAL; } */ if ( !already_timedout ) { 4646e: 588f addql #4,%sp 46470: 4a03 tstb %d3 46472: 664c bnes 464c0 <_POSIX_Condition_variables_Wait_support+0xc0> the_cond->Mutex = *mutex; 46474: 2752 0014 movel %a2@,%a3@(20) RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section ( Thread_queue_Control *the_thread_queue ) { the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 46478: 7001 moveq #1,%d0 _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); _Thread_Executing->Wait.return_code = 0; 4647a: 2079 0006 029c moveal 6029c <_Per_CPU_Information+0xc>,%a0 46480: 2740 0048 movel %d0,%a3@(72) _Thread_Executing->Wait.queue = &the_cond->Wait_queue; 46484: 47eb 0018 lea %a3@(24),%a3 if ( !already_timedout ) { the_cond->Mutex = *mutex; _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); _Thread_Executing->Wait.return_code = 0; 46488: 42a8 0034 clrl %a0@(52) _Thread_Executing->Wait.queue = &the_cond->Wait_queue; _Thread_Executing->Wait.id = *cond; 4648c: 2154 0020 movel %a4@,%a0@(32) if ( !already_timedout ) { the_cond->Mutex = *mutex; _Thread_queue_Enter_critical_section( &the_cond->Wait_queue ); _Thread_Executing->Wait.return_code = 0; _Thread_Executing->Wait.queue = &the_cond->Wait_queue; 46490: 214b 0044 movel %a3,%a0@(68) _Thread_Executing->Wait.id = *cond; _Thread_queue_Enqueue( &the_cond->Wait_queue, timeout ); 46494: 4879 0004 9ae8 pea 49ae8 <_Thread_queue_Timeout> 4649a: 2f2e 0010 movel %fp@(16),%sp@- 4649e: 2f0b movel %a3,%sp@- 464a0: 4eb9 0004 9778 jsr 49778 <_Thread_queue_Enqueue_with_handler> _Thread_Enable_dispatch(); 464a6: 4e95 jsr %a5@ /* * Switch ourself out because we blocked as a result of the * _Thread_queue_Enqueue. */ status = _Thread_Executing->Wait.return_code; 464a8: 2079 0006 029c moveal 6029c <_Per_CPU_Information+0xc>,%a0 if ( status && status != ETIMEDOUT ) 464ae: 4fef 000c lea %sp@(12),%sp /* * Switch ourself out because we blocked as a result of the * _Thread_queue_Enqueue. */ status = _Thread_Executing->Wait.return_code; 464b2: 2428 0034 movel %a0@(52),%d2 if ( status && status != ETIMEDOUT ) 464b6: 670c beqs 464c4 <_POSIX_Condition_variables_Wait_support+0xc4> 464b8: 7074 moveq #116,%d0 464ba: b082 cmpl %d2,%d0 464bc: 6616 bnes 464d4 <_POSIX_Condition_variables_Wait_support+0xd4><== NEVER TAKEN 464be: 6004 bras 464c4 <_POSIX_Condition_variables_Wait_support+0xc4> return status; } else { _Thread_Enable_dispatch(); 464c0: 4e95 jsr %a5@ status = ETIMEDOUT; 464c2: 7474 moveq #116,%d2 /* * When we get here the dispatch disable level is 0. */ mutex_status = pthread_mutex_lock( mutex ); 464c4: 2f0a movel %a2,%sp@- 464c6: 4eb9 0004 6718 jsr 46718 if ( mutex_status ) 464cc: 588f addql #4,%sp 464ce: 4a80 tstl %d0 464d0: 6702 beqs 464d4 <_POSIX_Condition_variables_Wait_support+0xd4> #endif case OBJECTS_ERROR: break; } return EINVAL; 464d2: 7416 moveq #22,%d2 } 464d4: 2002 movel %d2,%d0 464d6: 4cee 3c0c ffe4 moveml %fp@(-28),%d2-%d3/%a2-%a5 464dc: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00049db0 <_POSIX_Message_queue_Receive_support>: size_t msg_len, unsigned int *msg_prio, bool wait, Watchdog_Interval timeout ) { 49db0: 4e56 ffe4 linkw %fp,#-28 49db4: 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( 49db8: 486e fffc pea %fp@(-4) 49dbc: 242e 0008 movel %fp@(8),%d2 49dc0: 2f02 movel %d2,%sp@- 49dc2: 4879 0006 5e26 pea 65e26 <_POSIX_Message_queue_Information_fds> 49dc8: 162e 001b moveb %fp@(27),%d3 49dcc: 4eb9 0004 cb18 jsr 4cb18 <_Objects_Get> Objects_Locations location; size_t length_out; bool do_wait; the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); switch ( location ) { 49dd2: 4fef 000c lea %sp@(12),%sp 49dd6: 4aae fffc tstl %fp@(-4) 49dda: 6600 00c0 bnew 49e9c <_POSIX_Message_queue_Receive_support+0xec> case OBJECTS_LOCAL: if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) { 49dde: 2040 moveal %d0,%a0 49de0: 7803 moveq #3,%d4 49de2: 7a01 moveq #1,%d5 49de4: 2228 0014 movel %a0@(20),%d1 49de8: c881 andl %d1,%d4 49dea: ba84 cmpl %d4,%d5 49dec: 660a bnes 49df8 <_POSIX_Message_queue_Receive_support+0x48> _Thread_Enable_dispatch(); 49dee: 4eb9 0004 d356 jsr 4d356 <_Thread_Enable_dispatch> 49df4: 6000 00a6 braw 49e9c <_POSIX_Message_queue_Receive_support+0xec> rtems_set_errno_and_return_minus_one( EBADF ); } the_mq = the_mq_fd->Queue; 49df8: 2240 moveal %d0,%a1 49dfa: 2069 0010 moveal %a1@(16),%a0 if ( msg_len < the_mq->Message_queue.maximum_message_size ) { 49dfe: 2028 0066 movel %a0@(102),%d0 49e02: b0ae 0010 cmpl %fp@(16),%d0 49e06: 6316 blss 49e1e <_POSIX_Message_queue_Receive_support+0x6e> _Thread_Enable_dispatch(); 49e08: 4eb9 0004 d356 jsr 4d356 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EMSGSIZE ); 49e0e: 4eb9 0005 2d64 jsr 52d64 <__errno> 49e14: 727a moveq #122,%d1 49e16: 2040 moveal %d0,%a0 49e18: 2081 movel %d1,%a0@ 49e1a: 6000 008c braw 49ea8 <_POSIX_Message_queue_Receive_support+0xf8> /* * Now if something goes wrong, we return a "length" of -1 * to indicate an error. */ length_out = -1; 49e1e: 70ff moveq #-1,%d0 49e20: 2d40 fff8 movel %d0,%fp@(-8) /* * A timed receive with a bad time will do a poll regardless. */ if ( wait ) 49e24: 4a03 tstb %d3 49e26: 670a beqs 49e32 <_POSIX_Message_queue_Receive_support+0x82><== NEVER TAKEN do_wait = (the_mq_fd->oflag & O_NONBLOCK) ? false : true; 49e28: 0801 000e btst #14,%d1 49e2c: 57c0 seq %d0 49e2e: 4480 negl %d0 49e30: 6002 bras 49e34 <_POSIX_Message_queue_Receive_support+0x84> length_out = -1; /* * A timed receive with a bad time will do a poll regardless. */ if ( wait ) 49e32: 4200 clrb %d0 <== NOT EXECUTED do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 49e34: 2f2e 001c movel %fp@(28),%sp@- 49e38: 0280 0000 00ff andil #255,%d0 49e3e: 2f00 movel %d0,%sp@- 49e40: 486e fff8 pea %fp@(-8) 49e44: 2f2e 000c movel %fp@(12),%sp@- 49e48: 2f02 movel %d2,%sp@- 49e4a: 4868 001a pea %a0@(26) 49e4e: 4eb9 0004 bc18 jsr 4bc18 <_CORE_message_queue_Seize> &length_out, do_wait, timeout ); _Thread_Enable_dispatch(); 49e54: 4eb9 0004 d356 jsr 4d356 <_Thread_Enable_dispatch> *msg_prio = _POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count); 49e5a: 2079 0006 5e98 moveal 65e98 <_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); 49e60: 2028 0024 movel %a0@(36),%d0 49e64: 6c02 bges 49e68 <_POSIX_Message_queue_Receive_support+0xb8> 49e66: 4480 negl %d0 do_wait, timeout ); _Thread_Enable_dispatch(); *msg_prio = 49e68: 226e 0014 moveal %fp@(20),%a1 _POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count); if ( !_Thread_Executing->Wait.return_code ) 49e6c: 4fef 0018 lea %sp@(24),%sp do_wait, timeout ); _Thread_Enable_dispatch(); *msg_prio = 49e70: 2280 movel %d0,%a1@ _POSIX_Message_queue_Priority_from_core(_Thread_Executing->Wait.count); if ( !_Thread_Executing->Wait.return_code ) 49e72: 4aa8 0034 tstl %a0@(52) 49e76: 6606 bnes 49e7e <_POSIX_Message_queue_Receive_support+0xce> return length_out; 49e78: 202e fff8 movel %fp@(-8),%d0 49e7c: 602c bras 49eaa <_POSIX_Message_queue_Receive_support+0xfa> rtems_set_errno_and_return_minus_one( 49e7e: 4eb9 0005 2d64 jsr 52d64 <__errno> 49e84: 2079 0006 5e98 moveal 65e98 <_Per_CPU_Information+0xc>,%a0 49e8a: 2440 moveal %d0,%a2 49e8c: 2f28 0034 movel %a0@(52),%sp@- 49e90: 4eb9 0004 a0c4 jsr 4a0c4 <_POSIX_Message_queue_Translate_core_message_queue_return_code> 49e96: 588f addql #4,%sp 49e98: 2480 movel %d0,%a2@ 49e9a: 600c bras 49ea8 <_POSIX_Message_queue_Receive_support+0xf8> #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); 49e9c: 4eb9 0005 2d64 jsr 52d64 <__errno> 49ea2: 2040 moveal %d0,%a0 49ea4: 7009 moveq #9,%d0 49ea6: 2080 movel %d0,%a0@ 49ea8: 70ff moveq #-1,%d0 } 49eaa: 4cee 043c ffe4 moveml %fp@(-28),%d2-%d5/%a2 49eb0: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004df74 <_POSIX_Semaphore_Wait_support>: int _POSIX_Semaphore_Wait_support( sem_t *sem, bool blocking, Watchdog_Interval timeout ) { 4df74: 4e56 fffc linkw %fp,#-4 sem_t *id, Objects_Locations *location ) { return (POSIX_Semaphore_Control *) _Objects_Get( &_POSIX_Semaphore_Information, (Objects_Id)*id, location ); 4df78: 206e 0008 moveal %fp@(8),%a0 4df7c: 2f0a movel %a2,%sp@- 4df7e: 2f02 movel %d2,%sp@- 4df80: 486e fffc pea %fp@(-4) 4df84: 2f10 movel %a0@,%sp@- 4df86: 4879 0006 29a4 pea 629a4 <_POSIX_Semaphore_Information> 4df8c: 142e 000f moveb %fp@(15),%d2 4df90: 4eb9 0004 a410 jsr 4a410 <_Objects_Get> POSIX_Semaphore_Control *the_semaphore; Objects_Locations location; the_semaphore = _POSIX_Semaphore_Get( sem, &location ); switch ( location ) { 4df96: 4fef 000c lea %sp@(12),%sp 4df9a: 4aae fffc tstl %fp@(-4) 4df9e: 6650 bnes 4dff0 <_POSIX_Semaphore_Wait_support+0x7c> case OBJECTS_LOCAL: _CORE_semaphore_Seize( 4dfa0: 2f2e 0010 movel %fp@(16),%sp@- 4dfa4: 2040 moveal %d0,%a0 4dfa6: 0282 0000 00ff andil #255,%d2 4dfac: 2f02 movel %d2,%sp@- 4dfae: 2f28 0008 movel %a0@(8),%sp@- 4dfb2: 4868 001a pea %a0@(26) 4dfb6: 4eb9 0004 e5c4 jsr 4e5c4 <_CORE_semaphore_Seize> &the_semaphore->Semaphore, the_semaphore->Object.id, blocking, timeout ); _Thread_Enable_dispatch(); 4dfbc: 4eb9 0004 ac4e jsr 4ac4e <_Thread_Enable_dispatch> if ( !_Thread_Executing->Wait.return_code ) 4dfc2: 2079 0006 2bf8 moveal 62bf8 <_Per_CPU_Information+0xc>,%a0 4dfc8: 4fef 0010 lea %sp@(16),%sp 4dfcc: 4aa8 0034 tstl %a0@(52) 4dfd0: 672e beqs 4e000 <_POSIX_Semaphore_Wait_support+0x8c><== NEVER TAKEN return 0; rtems_set_errno_and_return_minus_one( 4dfd2: 4eb9 0005 07a4 jsr 507a4 <__errno> 4dfd8: 2079 0006 2bf8 moveal 62bf8 <_Per_CPU_Information+0xc>,%a0 4dfde: 2440 moveal %d0,%a2 4dfe0: 2f28 0034 movel %a0@(52),%sp@- 4dfe4: 4eb9 0005 0304 jsr 50304 <_POSIX_Semaphore_Translate_core_semaphore_return_code> 4dfea: 588f addql #4,%sp 4dfec: 2480 movel %d0,%a2@ 4dfee: 600c bras 4dffc <_POSIX_Semaphore_Wait_support+0x88> #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EINVAL ); 4dff0: 4eb9 0005 07a4 jsr 507a4 <__errno> 4dff6: 2040 moveal %d0,%a0 4dff8: 7016 moveq #22,%d0 4dffa: 2080 movel %d0,%a0@ 4dffc: 70ff moveq #-1,%d0 4dffe: 6002 bras 4e002 <_POSIX_Semaphore_Wait_support+0x8e> timeout ); _Thread_Enable_dispatch(); if ( !_Thread_Executing->Wait.return_code ) return 0; 4e000: 4280 clrl %d0 case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EINVAL ); } 4e002: 242e fff4 movel %fp@(-12),%d2 4e006: 246e fff8 moveal %fp@(-8),%a2 4e00a: 4e5e unlk %fp ... =============================================================================== 0004a03c <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch>: #include void _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch( Thread_Control *the_thread ) { 4a03c: 4e56 0000 linkw %fp,#0 4a040: 226e 0008 moveal %fp@(8),%a1 POSIX_API_Control *thread_support; thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4a044: 2069 010e moveal %a1@(270),%a0 if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 4a048: 4aa8 00d4 tstl %a0@(212) 4a04c: 662e bnes 4a07c <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x40><== NEVER TAKEN 4a04e: 7001 moveq #1,%d0 4a050: b0a8 00d8 cmpl %a0@(216),%d0 4a054: 6626 bnes 4a07c <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x40> thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS && 4a056: 4aa8 00dc tstl %a0@(220) 4a05a: 6720 beqs 4a07c <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x40> thread_support->cancelation_requested ) { _Thread_Unnest_dispatch(); _POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED ); 4a05c: 4878 ffff pea ffffffff */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 4a060: 2039 0005 df80 movel 5df80 <_Thread_Dispatch_disable_level>,%d0 4a066: 5380 subql #1,%d0 4a068: 2f09 movel %a1,%sp@- 4a06a: 23c0 0005 df80 movel %d0,5df80 <_Thread_Dispatch_disable_level> 4a070: 4eb9 0004 a810 jsr 4a810 <_POSIX_Thread_Exit> 4a076: 508f addql #8,%sp } else _Thread_Enable_dispatch(); } 4a078: 4e5e unlk %fp 4a07a: 4e75 rts 4a07c: 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(); 4a07e: 4ef9 0004 79de jmp 479de <_Thread_Enable_dispatch> =============================================================================== 0004b27c <_POSIX_Thread_Translate_sched_param>: int policy, struct sched_param *param, Thread_CPU_budget_algorithms *budget_algorithm, Thread_CPU_budget_algorithm_callout *budget_callout ) { 4b27c: 4e56 ffec linkw %fp,#-20 4b280: 48d7 3c04 moveml %d2/%a2-%a5,%sp@ 4b284: 246e 000c moveal %fp@(12),%a2 if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) 4b288: 2f12 movel %a2@,%sp@- int policy, struct sched_param *param, Thread_CPU_budget_algorithms *budget_algorithm, Thread_CPU_budget_algorithm_callout *budget_callout ) { 4b28a: 242e 0008 movel %fp@(8),%d2 4b28e: 266e 0010 moveal %fp@(16),%a3 4b292: 286e 0014 moveal %fp@(20),%a4 if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) 4b296: 4eb9 0004 b258 jsr 4b258 <_POSIX_Priority_Is_valid> 4b29c: 588f addql #4,%sp 4b29e: 4a00 tstb %d0 4b2a0: 6778 beqs 4b31a <_POSIX_Thread_Translate_sched_param+0x9e><== NEVER TAKEN return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 4b2a2: 4293 clrl %a3@ *budget_callout = NULL; 4b2a4: 4294 clrl %a4@ if ( policy == SCHED_OTHER ) { 4b2a6: 4a82 tstl %d2 4b2a8: 6606 bnes 4b2b0 <_POSIX_Thread_Translate_sched_param+0x34> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 4b2aa: 7201 moveq #1,%d1 4b2ac: 2681 movel %d1,%a3@ 4b2ae: 6066 bras 4b316 <_POSIX_Thread_Translate_sched_param+0x9a> return 0; } if ( policy == SCHED_FIFO ) { 4b2b0: 7001 moveq #1,%d0 4b2b2: b082 cmpl %d2,%d0 4b2b4: 6760 beqs 4b316 <_POSIX_Thread_Translate_sched_param+0x9a> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; return 0; } if ( policy == SCHED_RR ) { 4b2b6: 103c 0002 moveb #2,%d0 4b2ba: b082 cmpl %d2,%d0 4b2bc: 6606 bnes 4b2c4 <_POSIX_Thread_Translate_sched_param+0x48> *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; 4b2be: 2680 movel %d0,%a3@ return 0; 4b2c0: 4200 clrb %d0 4b2c2: 6058 bras 4b31c <_POSIX_Thread_Translate_sched_param+0xa0> } if ( policy == SCHED_SPORADIC ) { 4b2c4: 7004 moveq #4,%d0 4b2c6: b082 cmpl %d2,%d0 4b2c8: 6650 bnes 4b31a <_POSIX_Thread_Translate_sched_param+0x9e> if ( (param->sched_ss_repl_period.tv_sec == 0) && 4b2ca: 4aaa 0008 tstl %a2@(8) 4b2ce: 6606 bnes 4b2d6 <_POSIX_Thread_Translate_sched_param+0x5a> 4b2d0: 4aaa 000c tstl %a2@(12) 4b2d4: 6744 beqs 4b31a <_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) && 4b2d6: 4aaa 0010 tstl %a2@(16) 4b2da: 6606 bnes 4b2e2 <_POSIX_Thread_Translate_sched_param+0x66> 4b2dc: 4aaa 0014 tstl %a2@(20) 4b2e0: 6738 beqs 4b31a <_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 ) < 4b2e2: 486a 0008 pea %a2@(8) 4b2e6: 4bf9 0004 929c lea 4929c <_Timespec_To_ticks>,%a5 4b2ec: 4e95 jsr %a5@ _Timespec_To_ticks( ¶m->sched_ss_init_budget ) ) 4b2ee: 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 ) < 4b2f2: 2400 movel %d0,%d2 _Timespec_To_ticks( ¶m->sched_ss_init_budget ) ) 4b2f4: 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 ) < 4b2f6: 508f addql #8,%sp 4b2f8: b082 cmpl %d2,%d0 4b2fa: 621e bhis 4b31a <_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 ) ) 4b2fc: 2f2a 0004 movel %a2@(4),%sp@- 4b300: 4eb9 0004 b258 jsr 4b258 <_POSIX_Priority_Is_valid> 4b306: 588f addql #4,%sp 4b308: 4a00 tstb %d0 4b30a: 670e beqs 4b31a <_POSIX_Thread_Translate_sched_param+0x9e> return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; 4b30c: 7003 moveq #3,%d0 4b30e: 2680 movel %d0,%a3@ *budget_callout = _POSIX_Threads_Sporadic_budget_callout; 4b310: 28bc 0004 5dfc movel #286204,%a4@ return 0; } if ( policy == SCHED_FIFO ) { *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; return 0; 4b316: 4280 clrl %d0 4b318: 6002 bras 4b31c <_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; 4b31a: 7016 moveq #22,%d0 *budget_callout = _POSIX_Threads_Sporadic_budget_callout; return 0; } return EINVAL; } 4b31c: 4cee 3c04 ffec moveml %fp@(-20),%d2/%a2-%a5 4b322: 4e5e unlk %fp ... =============================================================================== 00045b2c <_POSIX_Threads_Initialize_user_threads_body>: * * Output parameters: NONE */ void _POSIX_Threads_Initialize_user_threads_body(void) { 45b2c: 4e56 ff9c linkw %fp,#-100 45b30: 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; 45b34: 2479 0005 d21e moveal 5d21e ,%a2 maximum = Configuration_POSIX_API.number_of_initialization_threads; 45b3a: 2839 0005 d21a movel 5d21a ,%d4 if ( !user_threads || maximum == 0 ) 45b40: 4a8a tstl %a2 45b42: 676a beqs 45bae <_POSIX_Threads_Initialize_user_threads_body+0x82><== NEVER TAKEN 45b44: 4a84 tstl %d4 45b46: 6766 beqs 45bae <_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 ); 45b48: 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( 45b4a: 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 ) 45b4c: 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 ); 45b4e: 0682 ffff ffc0 addil #-64,%d2 45b54: 2c3c 0004 b328 movel #308008,%d6 (void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); 45b5a: 4bf9 0004 b354 lea 4b354 ,%a5 (void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size); 45b60: 49f9 0004 b38c lea 4b38c ,%a4 status = pthread_create( 45b66: 5985 subql #4,%d5 45b68: 47f9 0004 5880 lea 45880 ,%a3 for ( index=0 ; index < maximum ; index++ ) { /* * There is no way for these calls to fail in this situation. */ (void) pthread_attr_init( &attr ); 45b6e: 2f02 movel %d2,%sp@- 45b70: 2046 moveal %d6,%a0 45b72: 4e90 jsr %a0@ (void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); 45b74: 4878 0002 pea 2 45b78: 2f02 movel %d2,%sp@- 45b7a: 4e95 jsr %a5@ (void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size); 45b7c: 2f2a 0004 movel %a2@(4),%sp@- 45b80: 2f02 movel %d2,%sp@- 45b82: 4e94 jsr %a4@ status = pthread_create( 45b84: 42a7 clrl %sp@- 45b86: 2f12 movel %a2@,%sp@- 45b88: 2f02 movel %d2,%sp@- 45b8a: 2f05 movel %d5,%sp@- 45b8c: 4e93 jsr %a3@ &thread_id, &attr, user_threads[ index ].thread_entry, NULL ); if ( status ) 45b8e: 4fef 0024 lea %sp@(36),%sp 45b92: 4a80 tstl %d0 45b94: 6710 beqs 45ba6 <_POSIX_Threads_Initialize_user_threads_body+0x7a> _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status ); 45b96: 2f00 movel %d0,%sp@- 45b98: 4878 0001 pea 1 45b9c: 4878 0002 pea 2 45ba0: 4eb9 0004 7858 jsr 47858 <_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++ ) { 45ba6: 5283 addql #1,%d3 45ba8: 508a addql #8,%a2 45baa: b883 cmpl %d3,%d4 45bac: 62c0 bhis 45b6e <_POSIX_Threads_Initialize_user_threads_body+0x42><== NEVER TAKEN NULL ); if ( status ) _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status ); } } 45bae: 4cee 3c7c ff9c moveml %fp@(-100),%d2-%d6/%a2-%a5 45bb4: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004a3c8 <_POSIX_Threads_Sporadic_budget_TSR>: */ void _POSIX_Threads_Sporadic_budget_TSR( Objects_Id id __attribute__((unused)), void *argument ) { 4a3c8: 4e56 0000 linkw %fp,#0 4a3cc: 2f0b movel %a3,%sp@- 4a3ce: 2f0a movel %a2,%sp@- 4a3d0: 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 ]; 4a3d4: 266a 010e moveal %a2@(270),%a3 /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_init_budget ); 4a3d8: 486b 0094 pea %a3@(148) 4a3dc: 4eb9 0004 b1b8 jsr 4b1b8 <_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 ) { 4a3e2: 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; 4a3e4: 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); 4a3e8: 4280 clrl %d0 4a3ea: 1039 0005 c152 moveb 5c152 ,%d0 4a3f0: 90ab 0084 subl %a3@(132),%d0 new_priority = _POSIX_Priority_To_core( api->schedparam.sched_priority ); the_thread->real_priority = new_priority; 4a3f4: 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 ) { 4a3f8: 4aaa 001c tstl %a2@(28) 4a3fc: 6618 bnes 4a416 <_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 ) { 4a3fe: b0aa 0014 cmpl %a2@(20),%d0 4a402: 6412 bccs 4a416 <_POSIX_Threads_Sporadic_budget_TSR+0x4e> _Thread_Change_priority( the_thread, new_priority, true ); 4a404: 4878 0001 pea 1 4a408: 2f00 movel %d0,%sp@- 4a40a: 2f0a movel %a2,%sp@- 4a40c: 4eb9 0004 71d4 jsr 471d4 <_Thread_Change_priority> 4a412: 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 ); 4a416: 486b 008c pea %a3@(140) 4a41a: 4eb9 0004 b1b8 jsr 4b1b8 <_Timespec_To_ticks> _Watchdog_Insert_ticks( &api->Sporadic_timer, ticks ); } 4a420: 246e fff8 moveal %fp@(-8),%a2 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 4a424: 588f addql #4,%sp Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 4a426: 2740 00b0 movel %d0,%a3@(176) } /* 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 ); 4a42a: 47eb 00a4 lea %a3@(164),%a3 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 4a42e: 203c 0005 d9ce movel #383438,%d0 4a434: 2d4b 000c movel %a3,%fp@(12) } 4a438: 266e fffc moveal %fp@(-4),%a3 4a43c: 2d40 0008 movel %d0,%fp@(8) 4a440: 4e5e unlk %fp 4a442: 4ef9 0004 8638 jmp 48638 <_Watchdog_Insert> =============================================================================== 0004a448 <_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 */ 4a448: 70ff moveq #-1,%d0 * _POSIX_Threads_Sporadic_budget_callout */ void _POSIX_Threads_Sporadic_budget_callout( Thread_Control *the_thread ) { 4a44a: 4e56 0000 linkw %fp,#0 4a44e: 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 */ 4a452: 2140 0076 movel %d0,%a0@(118) 4a456: 4280 clrl %d0 4a458: 1039 0005 c152 moveb 5c152 ,%d0 ) { POSIX_API_Control *api; uint32_t new_priority; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4a45e: 2268 010e moveal %a0@(270),%a1 4a462: 90a9 0088 subl %a1@(136),%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; 4a466: 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 ) { 4a46a: 4aa8 001c tstl %a0@(28) 4a46e: 6618 bnes 4a488 <_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 ) { 4a470: b0a8 0014 cmpl %a0@(20),%d0 4a474: 6312 blss 4a488 <_POSIX_Threads_Sporadic_budget_callout+0x40><== NEVER TAKEN _Thread_Change_priority( the_thread, new_priority, true ); 4a476: 4878 0001 pea 1 4a47a: 2f00 movel %d0,%sp@- 4a47c: 2f08 movel %a0,%sp@- 4a47e: 4eb9 0004 71d4 jsr 471d4 <_Thread_Change_priority> 4a484: 4fef 000c lea %sp@(12),%sp #if 0 printk( "lower priority\n" ); #endif } } } 4a488: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000456c8 <_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) { 456c8: 4e56 0000 linkw %fp,#0 456cc: 2f0a movel %a2,%sp@- 456ce: 246e 000c moveal %fp@(12),%a2 bool activated; ptimer = (POSIX_Timer_Control *)data; /* Increment the number of expirations. */ ptimer->overrun = ptimer->overrun + 1; 456d2: 52aa 0066 addql #1,%a2@(102) /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || 456d6: 4aaa 0052 tstl %a2@(82) 456da: 6606 bnes 456e2 <_POSIX_Timer_TSR+0x1a> 456dc: 4aaa 0056 tstl %a2@(86) 456e0: 6736 beqs 45718 <_POSIX_Timer_TSR+0x50> <== NEVER TAKEN ( ptimer->timer_data.it_interval.tv_nsec != 0 ) ) { activated = _POSIX_Timer_Insert_helper( 456e2: 2f0a movel %a2,%sp@- 456e4: 4879 0004 56c8 pea 456c8 <_POSIX_Timer_TSR> 456ea: 2f2a 0008 movel %a2@(8),%sp@- 456ee: 2f2a 0062 movel %a2@(98),%sp@- 456f2: 486a 0010 pea %a2@(16) 456f6: 4eb9 0004 ad3c jsr 4ad3c <_POSIX_Timer_Insert_helper> ptimer->ticks, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) 456fc: 4fef 0014 lea %sp@(20),%sp 45700: 4a00 tstb %d0 45702: 672e beqs 45732 <_POSIX_Timer_TSR+0x6a> <== NEVER TAKEN return; /* Store the time when the timer was started again */ _TOD_Get( &ptimer->time ); 45704: 486a 006a pea %a2@(106) 45708: 4eb9 0004 6bf4 jsr 46bf4 <_TOD_Get> /* The state really did not change but just to be safe */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; 4570e: 588f addql #4,%sp 45710: 7003 moveq #3,%d0 45712: 1540 003c moveb %d0,%a2@(60) 45716: 6006 bras 4571e <_POSIX_Timer_TSR+0x56> } else { /* Indicates that the timer is stopped */ ptimer->state = POSIX_TIMER_STATE_CREATE_STOP; 45718: 7004 moveq #4,%d0 <== NOT EXECUTED 4571a: 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 ) ) { 4571e: 2f2a 0042 movel %a2@(66),%sp@- 45722: 2f2a 0038 movel %a2@(56),%sp@- 45726: 4eb9 0004 a924 jsr 4a924 } /* After the signal handler returns, the count of expirations of the * timer must be set to 0. */ ptimer->overrun = 0; 4572c: 508f addql #8,%sp 4572e: 42aa 0066 clrl %a2@(102) } 45732: 246e fffc moveal %fp@(-4),%a2 45736: 4e5e unlk %fp ... =============================================================================== 0004c38c <_POSIX_signals_Check_signal>: ) { siginfo_t siginfo_struct; sigset_t saved_signals_blocked; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 4c38c: 4280 clrl %d0 bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 4c38e: 4e56 ffe4 linkw %fp,#-28 siginfo_t siginfo_struct; sigset_t saved_signals_blocked; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 4c392: 102e 0013 moveb %fp@(19),%d0 bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 4c396: 48d7 041c moveml %d2-%d4/%a2,%sp@ siginfo_t siginfo_struct; sigset_t saved_signals_blocked; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 4c39a: 4878 0001 pea 1 4c39e: 260e movel %fp,%d3 4c3a0: 0683 ffff fff4 addil #-12,%d3 4c3a6: 2f00 movel %d0,%sp@- bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 4c3a8: 242e 000c movel %fp@(12),%d2 siginfo_t siginfo_struct; sigset_t saved_signals_blocked; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 4c3ac: 2f03 movel %d3,%sp@- bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 4c3ae: 246e 0008 moveal %fp@(8),%a2 siginfo_t siginfo_struct; sigset_t saved_signals_blocked; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 4c3b2: 2f02 movel %d2,%sp@- 4c3b4: 2f0a movel %a2,%sp@- 4c3b6: 4eb9 0004 c424 jsr 4c424 <_POSIX_signals_Clear_signals> 4c3bc: 4fef 0014 lea %sp@(20),%sp 4c3c0: 4a00 tstb %d0 4c3c2: 6754 beqs 4c418 <_POSIX_signals_Check_signal+0x8c> #endif /* * Just to prevent sending a signal which is currently being ignored. */ if ( _POSIX_signals_Vectors[ signo ].sa_handler == SIG_IGN ) 4c3c4: 2202 movel %d2,%d1 4c3c6: 2002 movel %d2,%d0 4c3c8: e589 lsll #2,%d1 4c3ca: e988 lsll #4,%d0 4c3cc: 9081 subl %d1,%d0 4c3ce: 2240 moveal %d0,%a1 4c3d0: d3fc 0005 ddaa addal #384426,%a1 4c3d6: 7201 moveq #1,%d1 4c3d8: 2069 0008 moveal %a1@(8),%a0 4c3dc: b288 cmpl %a0,%d1 4c3de: 6738 beqs 4c418 <_POSIX_signals_Check_signal+0x8c><== NEVER TAKEN /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; 4c3e0: 2229 0004 movel %a1@(4),%d1 /* * Here, the signal handler function executes */ switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) { 4c3e4: 43f9 0005 ddaa lea 5ddaa <_POSIX_signals_Vectors>,%a1 return false; /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; 4c3ea: 282a 00cc movel %a2@(204),%d4 api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; 4c3ee: 8284 orl %d4,%d1 4c3f0: 2541 00cc movel %d1,%a2@(204) /* * Here, the signal handler function executes */ switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) { 4c3f4: 7202 moveq #2,%d1 4c3f6: b2b1 0800 cmpl %a1@(00000000,%d0:l),%d1 4c3fa: 660e bnes 4c40a <_POSIX_signals_Check_signal+0x7e> case SA_SIGINFO: (*_POSIX_signals_Vectors[ signo ].sa_sigaction)( 4c3fc: 42a7 clrl %sp@- 4c3fe: 2f03 movel %d3,%sp@- 4c400: 2f02 movel %d2,%sp@- 4c402: 4e90 jsr %a0@ signo, &siginfo_struct, NULL /* context is undefined per 1003.1b-1993, p. 66 */ ); break; 4c404: 4fef 000c lea %sp@(12),%sp 4c408: 6006 bras 4c410 <_POSIX_signals_Check_signal+0x84> default: (*_POSIX_signals_Vectors[ signo ].sa_handler)( signo ); 4c40a: 2f02 movel %d2,%sp@- 4c40c: 4e90 jsr %a0@ break; 4c40e: 588f addql #4,%sp } /* * Restore the previous set of blocked signals */ api->signals_blocked = saved_signals_blocked; 4c410: 2544 00cc movel %d4,%a2@(204) return true; 4c414: 7001 moveq #1,%d0 4c416: 6002 bras 4c41a <_POSIX_signals_Check_signal+0x8e> /* * Just to prevent sending a signal which is currently being ignored. */ if ( _POSIX_signals_Vectors[ signo ].sa_handler == SIG_IGN ) return false; 4c418: 4200 clrb %d0 * Restore the previous set of blocked signals */ api->signals_blocked = saved_signals_blocked; return true; } 4c41a: 4cee 041c ffe4 moveml %fp@(-28),%d2-%d4/%a2 4c420: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004c9a4 <_POSIX_signals_Clear_process_signals>: clear_signal = true; mask = signo_to_mask( signo ); ISR_Level level; _ISR_Disable( level ); 4c9a4: 203c 0000 0700 movel #1792,%d0 */ void _POSIX_signals_Clear_process_signals( int signo ) { 4c9aa: 4e56 0000 linkw %fp,#0 4c9ae: 222e 0008 movel %fp@(8),%d1 4c9b2: 2f03 movel %d3,%sp@- 4c9b4: 2f02 movel %d2,%sp@- clear_signal = true; mask = signo_to_mask( signo ); ISR_Level level; _ISR_Disable( level ); 4c9b6: 40c2 movew %sr,%d2 4c9b8: 8082 orl %d2,%d0 4c9ba: 46c0 movew %d0,%sr if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { 4c9bc: 2601 movel %d1,%d3 4c9be: 2001 movel %d1,%d0 4c9c0: 41f9 0005 ddaa lea 5ddaa <_POSIX_signals_Vectors>,%a0 4c9c6: e58b lsll #2,%d3 4c9c8: e988 lsll #4,%d0 4c9ca: 9083 subl %d3,%d0 4c9cc: 7602 moveq #2,%d3 4c9ce: b6b0 0800 cmpl %a0@(00000000,%d0:l),%d3 4c9d2: 6614 bnes 4c9e8 <_POSIX_signals_Clear_process_signals+0x44> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4c9d4: 2040 moveal %d0,%a0 4c9d6: d1fc 0005 dfa6 addal #384934,%a0 if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) 4c9dc: 43f9 0005 dfa2 lea 5dfa2 <_POSIX_signals_Siginfo>,%a1 4c9e2: b1f1 0800 cmpal %a1@(00000000,%d0:l),%a0 4c9e6: 660e bnes 4c9f6 <_POSIX_signals_Clear_process_signals+0x52><== NEVER TAKEN 4c9e8: 5381 subql #1,%d1 4c9ea: 7001 moveq #1,%d0 4c9ec: e3a8 lsll %d1,%d0 clear_signal = false; } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; 4c9ee: 4680 notl %d0 4c9f0: c1b9 0005 df9e andl %d0,5df9e <_POSIX_signals_Pending> } _ISR_Enable( level ); 4c9f6: 46c2 movew %d2,%sr } 4c9f8: 241f movel %sp@+,%d2 4c9fa: 261f movel %sp@+,%d3 4c9fc: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000461c4 <_POSIX_signals_Get_highest>: sigset_t set ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 461c4: 701b moveq #27,%d0 #include int _POSIX_signals_Get_highest( sigset_t set ) { 461c6: 4e56 fff4 linkw %fp,#-12 461ca: 48d7 001c moveml %d2-%d4,%sp@ 461ce: 242e 0008 movel %fp@(8),%d2 461d2: 7601 moveq #1,%d3 #include #include #include #include int _POSIX_signals_Get_highest( 461d4: 2200 movel %d0,%d1 461d6: 5381 subql #1,%d1 461d8: 2803 movel %d3,%d4 461da: e3ac lsll %d1,%d4 461dc: 2204 movel %d4,%d1 ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { if ( set & signo_to_mask( signo ) ) { 461de: c282 andl %d2,%d1 461e0: 6626 bnes 46208 <_POSIX_signals_Get_highest+0x44><== NEVER TAKEN sigset_t set ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 461e2: 5280 addql #1,%d0 461e4: 123c 0020 moveb #32,%d1 461e8: b280 cmpl %d0,%d1 461ea: 66e8 bnes 461d4 <_POSIX_signals_Get_highest+0x10> 461ec: 7001 moveq #1,%d0 461ee: 7601 moveq #1,%d3 #include #include #include #include int _POSIX_signals_Get_highest( 461f0: 2200 movel %d0,%d1 461f2: 5381 subql #1,%d1 461f4: 2803 movel %d3,%d4 461f6: e3ac lsll %d1,%d4 461f8: 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 ) ) { 461fa: c282 andl %d2,%d1 461fc: 660a bnes 46208 <_POSIX_signals_Get_highest+0x44> */ #if (SIGHUP != 1) #error "Assumption that SIGHUP==1 violated!!" #endif for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { 461fe: 5280 addql #1,%d0 46200: 123c 001b moveb #27,%d1 46204: b280 cmpl %d0,%d1 46206: 66e8 bnes 461f0 <_POSIX_signals_Get_highest+0x2c><== ALWAYS TAKEN * a return 0. This routine will NOT be called unless a signal * is pending in the set passed in. */ found_it: return signo; } 46208: 4cd7 001c moveml %sp@,%d2-%d4 4620c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0005a248 <_POSIX_signals_Unblock_thread>: 5a248: 7001 moveq #1,%d0 bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, siginfo_t *info ) { 5a24a: 4e56 fff4 linkw %fp,#-12 5a24e: 226e 0010 moveal %fp@(16),%a1 5a252: 48d7 040c moveml %d2-%d3/%a2,%sp@ 5a256: 242e 000c movel %fp@(12),%d2 5a25a: 2202 movel %d2,%d1 5a25c: 5381 subql #1,%d1 5a25e: 246e 0008 moveal %fp@(8),%a2 5a262: e3a8 lsll %d1,%d0 /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 5a264: 222a 0010 movel %a2@(16),%d1 5a268: 2601 movel %d1,%d3 5a26a: 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 ]; 5a270: 206a 010e moveal %a2@(270),%a0 /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 5a274: 0c83 1000 8000 cmpil #268468224,%d3 5a27a: 6652 bnes 5a2ce <_POSIX_signals_Unblock_thread+0x86> if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { 5a27c: 2200 movel %d0,%d1 5a27e: c2aa 0030 andl %a2@(48),%d1 5a282: 660c bnes 5a290 <_POSIX_signals_Unblock_thread+0x48> 5a284: 2228 00cc movel %a0@(204),%d1 5a288: 4681 notl %d1 5a28a: c081 andl %d1,%d0 5a28c: 6700 009e beqw 5a32c <_POSIX_signals_Unblock_thread+0xe4> the_thread->Wait.return_code = EINTR; 5a290: 7004 moveq #4,%d0 the_info = (siginfo_t *) the_thread->Wait.return_argument; 5a292: 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; 5a296: 2540 0034 movel %d0,%a2@(52) the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { 5a29a: 4a89 tstl %a1 5a29c: 6610 bnes 5a2ae <_POSIX_signals_Unblock_thread+0x66> the_info->si_signo = signo; the_info->si_code = SI_USER; 5a29e: 103c 0001 moveb #1,%d0 the_thread->Wait.return_code = EINTR; the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { the_info->si_signo = signo; 5a2a2: 2082 movel %d2,%a0@ the_info->si_code = SI_USER; 5a2a4: 2140 0004 movel %d0,%a0@(4) the_info->si_value.sival_int = 0; 5a2a8: 42a8 0008 clrl %a0@(8) 5a2ac: 6012 bras 5a2c0 <_POSIX_signals_Unblock_thread+0x78> } else { *the_info = *info; 5a2ae: 4878 000c pea c 5a2b2: 2f09 movel %a1,%sp@- 5a2b4: 2f08 movel %a0,%sp@- 5a2b6: 4eb9 0004 d2dc jsr 4d2dc 5a2bc: 4fef 000c lea %sp@(12),%sp } _Thread_queue_Extract_with_proxy( the_thread ); 5a2c0: 2f0a movel %a2,%sp@- 5a2c2: 4eb9 0004 7d20 jsr 47d20 <_Thread_queue_Extract_with_proxy> return true; 5a2c8: 588f addql #4,%sp 5a2ca: 7001 moveq #1,%d0 5a2cc: 6060 bras 5a32e <_POSIX_signals_Unblock_thread+0xe6> } /* * Thread is not waiting due to a sigwait. */ if ( ~api->signals_blocked & mask ) { 5a2ce: 2428 00cc movel %a0@(204),%d2 5a2d2: 4682 notl %d2 5a2d4: c082 andl %d2,%d0 5a2d6: 6754 beqs 5a32c <_POSIX_signals_Unblock_thread+0xe4> * it is not blocked, THEN * we need to dispatch at the end of this ISR. * + Any other combination, do nothing. */ if ( the_thread->current_state & STATES_INTERRUPTIBLE_BY_SIGNAL ) { 5a2d8: 0801 001c btst #28,%d1 5a2dc: 6732 beqs 5a310 <_POSIX_signals_Unblock_thread+0xc8> the_thread->Wait.return_code = EINTR; 5a2de: 7004 moveq #4,%d0 5a2e0: 2540 0034 movel %d0,%a2@(52) #if 0 if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) ) _Thread_queue_Extract_with_proxy( the_thread ); else #endif if ( _States_Is_delaying(the_thread->current_state) ){ 5a2e4: 44c1 movew %d1,%ccr 5a2e6: 6a44 bpls 5a32c <_POSIX_signals_Unblock_thread+0xe4><== NEVER TAKEN if ( _Watchdog_Is_active( &the_thread->Timer ) ) 5a2e8: 103c 0002 moveb #2,%d0 5a2ec: b0aa 0050 cmpl %a2@(80),%d0 5a2f0: 660c bnes 5a2fe <_POSIX_signals_Unblock_thread+0xb6><== NEVER TAKEN (void) _Watchdog_Remove( &the_thread->Timer ); 5a2f2: 486a 0048 pea %a2@(72) 5a2f6: 4eb9 0004 8754 jsr 48754 <_Watchdog_Remove> 5a2fc: 588f addql #4,%sp RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 5a2fe: 2f3c 1003 fff8 movel #268697592,%sp@- 5a304: 2f0a movel %a2,%sp@- 5a306: 4eb9 0004 7314 jsr 47314 <_Thread_Clear_state> 5a30c: 508f addql #8,%sp 5a30e: 601c bras 5a32c <_POSIX_signals_Unblock_thread+0xe4> _Thread_Unblock( the_thread ); } } else if ( the_thread->current_state == STATES_READY ) { 5a310: 4a81 tstl %d1 5a312: 6618 bnes 5a32c <_POSIX_signals_Unblock_thread+0xe4><== NEVER TAKEN if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 5a314: 4ab9 0005 dd98 tstl 5dd98 <_Per_CPU_Information+0x8> 5a31a: 6710 beqs 5a32c <_POSIX_signals_Unblock_thread+0xe4> 5a31c: b5f9 0005 dd9c cmpal 5dd9c <_Per_CPU_Information+0xc>,%a2 5a322: 6608 bnes 5a32c <_POSIX_signals_Unblock_thread+0xe4><== NEVER TAKEN _Context_Switch_necessary = true; 5a324: 7001 moveq #1,%d0 5a326: 13c0 0005 dda8 moveb %d0,5dda8 <_Per_CPU_Information+0x18> } } return false; 5a32c: 4200 clrb %d0 } 5a32e: 4cee 040c fff4 moveml %fp@(-12),%d2-%d3/%a2 5a334: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004a76c <_RTEMS_tasks_Post_switch_extension>: */ void _RTEMS_tasks_Post_switch_extension( Thread_Control *executing ) { 4a76c: 4e56 ffec linkw %fp,#-20 RTEMS_API_Control *api; ASR_Information *asr; rtems_signal_set signal_set; Modes_Control prev_mode; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 4a770: 206e 0008 moveal %fp@(8),%a0 */ void _RTEMS_tasks_Post_switch_extension( Thread_Control *executing ) { 4a774: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ RTEMS_API_Control *api; ASR_Information *asr; rtems_signal_set signal_set; Modes_Control prev_mode; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 4a778: 2468 010a moveal %a0@(266),%a2 if ( !api ) 4a77c: 4a8a tstl %a2 4a77e: 6754 beqs 4a7d4 <_RTEMS_tasks_Post_switch_extension+0x68><== NEVER TAKEN * Signal Processing */ asr = &api->Signal; _ISR_Disable( level ); 4a780: 203c 0000 0700 movel #1792,%d0 4a786: 40c1 movew %sr,%d1 4a788: 8081 orl %d1,%d0 4a78a: 46c0 movew %d0,%sr signal_set = asr->signals_posted; 4a78c: 262a 0012 movel %a2@(18),%d3 asr->signals_posted = 0; 4a790: 42aa 0012 clrl %a2@(18) _ISR_Enable( level ); 4a794: 46c1 movew %d1,%sr if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ 4a796: 4a83 tstl %d3 4a798: 673a beqs 4a7d4 <_RTEMS_tasks_Post_switch_extension+0x68> return; asr->nest_level += 1; 4a79a: 52aa 001a addql #1,%a2@(26) rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 4a79e: 240e movel %fp,%d2 4a7a0: 5982 subql #4,%d2 4a7a2: 47f9 0004 c5a8 lea 4c5a8 ,%a3 4a7a8: 2f02 movel %d2,%sp@- 4a7aa: 2f3c 0000 ffff movel #65535,%sp@- 4a7b0: 2f2a 000e movel %a2@(14),%sp@- 4a7b4: 4e93 jsr %a3@ (*asr->handler)( signal_set ); 4a7b6: 2f03 movel %d3,%sp@- 4a7b8: 206a 000a moveal %a2@(10),%a0 4a7bc: 4e90 jsr %a0@ asr->nest_level -= 1; 4a7be: 53aa 001a subql #1,%a2@(26) rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 4a7c2: 2f02 movel %d2,%sp@- 4a7c4: 2f3c 0000 ffff movel #65535,%sp@- 4a7ca: 2f2e fffc movel %fp@(-4),%sp@- 4a7ce: 4e93 jsr %a3@ 4a7d0: 4fef 001c lea %sp@(28),%sp } 4a7d4: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3 4a7da: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00058158 <_Region_Process_queue>: */ void _Region_Process_queue( Region_Control *the_region ) { 58158: 4e56 ffe4 linkw %fp,#-28 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 5815c: 2039 0007 64d0 movel 764d0 <_Thread_Dispatch_disable_level>,%d0 58162: 5280 addql #1,%d0 58164: 48d7 3c1c moveml %d2-%d4/%a2-%a5,%sp@ 58168: 266e 0008 moveal %fp@(8),%a3 5816c: 23c0 0007 64d0 movel %d0,764d0 <_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(); 58172: 2f39 0007 6572 movel 76572 <_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 ); 58178: 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 ); 5817a: 260b movel %a3,%d3 5817c: 0682 0000 0010 addil #16,%d2 58182: 0683 0000 0068 addil #104,%d3 58188: 4bf9 0005 36cc lea 536cc <_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 ); 5818e: 49f9 0005 87c0 lea 587c0 <_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(); 58194: 4eb9 0005 2c48 jsr 52c48 <_API_Mutex_Unlock> 5819a: 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 ); 5819c: 283c 0005 88c0 movel #362688,%d4 581a2: 2f02 movel %d2,%sp@- 581a4: 2044 moveal %d4,%a0 581a6: 4e90 jsr %a0@ if ( the_thread == NULL ) 581a8: 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 ); 581aa: 2440 moveal %d0,%a2 if ( the_thread == NULL ) 581ac: 4a80 tstl %d0 581ae: 672c beqs 581dc <_Region_Process_queue+0x84> 581b0: 42a7 clrl %sp@- 581b2: 42a7 clrl %sp@- 581b4: 2f2a 0024 movel %a2@(36),%sp@- 581b8: 2f03 movel %d3,%sp@- 581ba: 4e95 jsr %a5@ the_segment = (void **) _Region_Allocate_segment( the_region, the_thread->Wait.count ); if ( the_segment == NULL ) 581bc: 4fef 0010 lea %sp@(16),%sp 581c0: 4a80 tstl %d0 581c2: 6718 beqs 581dc <_Region_Process_queue+0x84> break; *(void **)the_thread->Wait.return_argument = the_segment; 581c4: 206a 0028 moveal %a2@(40),%a0 581c8: 2080 movel %d0,%a0@ the_region->number_of_used_blocks += 1; 581ca: 52ab 0064 addql #1,%a3@(100) _Thread_queue_Extract( &the_region->Wait_queue, the_thread ); 581ce: 2f0a movel %a2,%sp@- 581d0: 2f02 movel %d2,%sp@- 581d2: 4e94 jsr %a4@ the_thread->Wait.return_code = RTEMS_SUCCESSFUL; } 581d4: 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; 581d6: 42aa 0034 clrl %a2@(52) } 581da: 60c6 bras 581a2 <_Region_Process_queue+0x4a> _Thread_Enable_dispatch(); } 581dc: 4cee 3c1c ffe4 moveml %fp@(-28),%d2-%d4/%a2-%a5 581e2: 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(); 581e4: 4ef9 0005 4e8e jmp 54e8e <_Thread_Enable_dispatch> ... =============================================================================== 00046190 <_TOD_Validate>: */ bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 46190: 4e56 0000 linkw %fp,#0 46194: 206e 0008 moveal %fp@(8),%a0 46198: 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(); 4619a: 2039 0005 e310 movel 5e310 ,%d0 */ bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 461a0: 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) || 461a2: 4a88 tstl %a0 461a4: 6762 beqs 46208 <_TOD_Validate+0x78> <== NEVER TAKEN ) { uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / 461a6: 243c 000f 4240 movel #1000000,%d2 461ac: 4c40 2002 remul %d0,%d2,%d2 rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 461b0: b4a8 0018 cmpl %a0@(24),%d2 461b4: 6352 blss 46208 <_TOD_Validate+0x78> (the_tod->ticks >= ticks_per_second) || 461b6: 763b moveq #59,%d3 461b8: b6a8 0014 cmpl %a0@(20),%d3 461bc: 654a bcss 46208 <_TOD_Validate+0x78> (the_tod->second >= TOD_SECONDS_PER_MINUTE) || 461be: b6a8 0010 cmpl %a0@(16),%d3 461c2: 6544 bcss 46208 <_TOD_Validate+0x78> (the_tod->minute >= TOD_MINUTES_PER_HOUR) || 461c4: 7017 moveq #23,%d0 461c6: b0a8 000c cmpl %a0@(12),%d0 461ca: 653c bcss 46208 <_TOD_Validate+0x78> (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || 461cc: 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) || 461d0: 6736 beqs 46208 <_TOD_Validate+0x78> <== NEVER TAKEN (the_tod->month == 0) || 461d2: 720c moveq #12,%d1 461d4: b280 cmpl %d0,%d1 461d6: 6530 bcss 46208 <_TOD_Validate+0x78> (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || 461d8: 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) || 461da: 0c82 0000 07c3 cmpil #1987,%d2 461e0: 6326 blss 46208 <_TOD_Validate+0x78> (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) 461e2: 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) || 461e6: 6720 beqs 46208 <_TOD_Validate+0x78> <== NEVER TAKEN (the_tod->day == 0) ) return false; if ( (the_tod->year % 4) == 0 ) 461e8: 163c 0003 moveb #3,%d3 461ec: 41f9 0005 d2f2 lea 5d2f2 <_TOD_Days_per_month>,%a0 461f2: c483 andl %d3,%d2 461f4: 6606 bnes 461fc <_TOD_Validate+0x6c> days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; 461f6: 2030 0c34 movel %a0@(00000034,%d0:l:4),%d0 461fa: 6004 bras 46200 <_TOD_Validate+0x70> else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; 461fc: 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( 46200: b081 cmpl %d1,%d0 46202: 54c0 scc %d0 46204: 4480 negl %d0 46206: 6002 bras 4620a <_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; 46208: 4200 clrb %d0 if ( the_tod->day > days_in_month ) return false; return true; } 4620a: 241f movel %sp@+,%d2 4620c: 261f movel %sp@+,%d3 4620e: 4e5e unlk %fp ... =============================================================================== 000471d4 <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 471d4: 4e56 fff0 linkw %fp,#-16 471d8: 48d7 041c moveml %d2-%d4/%a2,%sp@ 471dc: 246e 0008 moveal %fp@(8),%a2 */ /* * Save original state */ original_state = the_thread->current_state; 471e0: 242a 0010 movel %a2@(16),%d2 void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 471e4: 262e 000c movel %fp@(12),%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 ); 471e8: 2f0a movel %a2,%sp@- void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 471ea: 182e 0013 moveb %fp@(19),%d4 /* * Set a transient state for the thread so it is pulled off the Ready chains. * This will prevent it from being scheduled no matter what happens in an * ISR. */ _Thread_Set_transient( the_thread ); 471ee: 4eb9 0004 7fe0 jsr 47fe0 <_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 ) 471f4: 588f addql #4,%sp 471f6: b6aa 0014 cmpl %a2@(20),%d3 471fa: 670c beqs 47208 <_Thread_Change_priority+0x34> _Thread_Set_priority( the_thread, new_priority ); 471fc: 2f03 movel %d3,%sp@- 471fe: 2f0a movel %a2,%sp@- 47200: 4eb9 0004 7e88 jsr 47e88 <_Thread_Set_priority> 47206: 508f addql #8,%sp _ISR_Disable( level ); 47208: 223c 0000 0700 movel #1792,%d1 4720e: 40c0 movew %sr,%d0 47210: 8280 orl %d0,%d1 47212: 46c1 movew %d1,%sr 47214: 7604 moveq #4,%d3 /* * If the thread has more than STATES_TRANSIENT set, then it is blocked, * If it is blocked on a thread queue, then we need to requeue it. */ state = the_thread->current_state; 47216: 222a 0010 movel %a2@(16),%d1 4721a: c483 andl %d3,%d2 if ( state != STATES_TRANSIENT ) { 4721c: b681 cmpl %d1,%d3 4721e: 6730 beqs 47250 <_Thread_Change_priority+0x7c> /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) 47220: 4a82 tstl %d2 47222: 6608 bnes 4722c <_Thread_Change_priority+0x58> <== NEVER TAKEN RTEMS_INLINE_ROUTINE States_Control _States_Clear ( States_Control states_to_clear, States_Control current_state ) { return (current_state & ~states_to_clear); 47224: 74fb moveq #-5,%d2 47226: c481 andl %d1,%d2 47228: 2542 0010 movel %d2,%a2@(16) the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); _ISR_Enable( level ); 4722c: 46c0 movew %d0,%sr */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue ( States_Control the_states ) { return (the_states & STATES_WAITING_ON_THREAD_QUEUE); 4722e: 0281 0003 bee0 andil #245472,%d1 if ( _States_Is_waiting_on_thread_queue( state ) ) { 47234: 6700 00d2 beqw 47308 <_Thread_Change_priority+0x134> _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); 47238: 2d4a 000c movel %a2,%fp@(12) 4723c: 2d6a 0044 0008 movel %a2@(68),%fp@(8) if ( !_Thread_Is_executing_also_the_heir() && _Thread_Executing->is_preemptible ) _Context_Switch_necessary = true; _ISR_Enable( level ); } 47242: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 47248: 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 ); 4724a: 4ef9 0004 7dec jmp 47dec <_Thread_queue_Requeue> } return; } /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) { 47250: 4a82 tstl %d2 47252: 6650 bnes 472a4 <_Thread_Change_priority+0xd0> <== NEVER TAKEN RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 47254: 206a 008e moveal %a2@(142),%a0 47258: 322a 0094 movew %a2@(148),%d1 4725c: 3410 movew %a0@,%d2 * Interrupts are STILL disabled. * We now know the thread will be in the READY state when we remove * the TRANSIENT state. So we have to place it on the appropriate * Ready Queue with interrupts off. */ the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); 4725e: 42aa 0010 clrl %a2@(16) 47262: 8282 orl %d2,%d1 47264: 3081 movew %d1,%a0@ 47266: 206a 008a moveal %a2@(138),%a0 _Priority_Major_bit_map |= the_priority_map->ready_major; 4726a: 3239 0005 d9ac movew 5d9ac <_Priority_Major_bit_map>,%d1 47270: 342a 0092 movew %a2@(146),%d2 47274: 8282 orl %d2,%d1 47276: 33c1 0005 d9ac movew %d1,5d9ac <_Priority_Major_bit_map> _Priority_Add_to_bit_map( &the_thread->Priority_map ); if ( prepend_it ) 4727c: 4a04 tstb %d4 4727e: 6710 beqs 47290 <_Thread_Change_priority+0xbc> ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 47280: 2250 moveal %a0@,%a1 Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 47282: 2548 0004 movel %a0,%a2@(4) before_node = after_node->next; after_node->next = the_node; 47286: 208a movel %a2,%a0@ the_node->next = before_node; before_node->previous = the_node; 47288: 234a 0004 movel %a2,%a1@(4) Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; after_node->next = the_node; the_node->next = before_node; 4728c: 2489 movel %a1,%a2@ 4728e: 6014 bras 472a4 <_Thread_Change_priority+0xd0> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 47290: 2608 movel %a0,%d3 47292: 5883 addql #4,%d3 ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; 47294: 2268 0008 moveal %a0@(8),%a1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 47298: 2483 movel %d3,%a2@ { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; the_chain->last = the_node; 4729a: 214a 0008 movel %a2,%a0@(8) old_last_node->next = the_node; 4729e: 228a movel %a2,%a1@ the_node->previous = old_last_node; 472a0: 2549 0004 movel %a1,%a2@(4) _Chain_Prepend_unprotected( the_thread->ready, &the_thread->Object.Node ); else _Chain_Append_unprotected( the_thread->ready, &the_thread->Object.Node ); } _ISR_Flash( level ); 472a4: 223c 0000 0700 movel #1792,%d1 472aa: 46c0 movew %d0,%sr 472ac: 8280 orl %d0,%d1 472ae: 46c1 movew %d1,%sr RTEMS_INLINE_ROUTINE Priority_Control _Priority_Get_highest( void ) { Priority_Bit_map_control minor; Priority_Bit_map_control major; _Bitfield_Find_first_bit( _Priority_Major_bit_map, major ); 472b0: 3239 0005 d9ac movew 5d9ac <_Priority_Major_bit_map>,%d1 472b6: 4841 swap %d1 472b8: 04c1 ff1 %d1 _Bitfield_Find_first_bit( _Priority_Bit_map[major], minor ); 472ba: 4282 clrl %d2 472bc: 41f9 0005 da14 lea 5da14 <_Priority_Bit_map>,%a0 472c2: 3401 movew %d1,%d2 472c4: 3230 2a00 movew %a0@(00000000,%d2:l:2),%d1 472c8: 4841 swap %d1 472ca: 04c1 ff1 %d1 return (_Priority_Bits_index( major ) << 4) + 472cc: 4283 clrl %d3 472ce: e98a lsll #4,%d2 472d0: 3601 movew %d1,%d3 */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) _Thread_Ready_chain[ _Priority_Get_highest() ].first; 472d2: 2079 0005 d8c0 moveal 5d8c0 <_Thread_Ready_chain>,%a0 472d8: 2202 movel %d2,%d1 472da: d283 addl %d3,%d1 472dc: 2401 movel %d1,%d2 472de: e58a lsll #2,%d2 472e0: e989 lsll #4,%d1 472e2: 91c2 subal %d2,%a0 * ready thread. */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) 472e4: 2230 1800 movel %a0@(00000000,%d1:l),%d1 * is also the heir thread, and false otherwise. */ RTEMS_INLINE_ROUTINE bool _Thread_Is_executing_also_the_heir( void ) { return ( _Thread_Executing == _Thread_Heir ); 472e8: 2079 0005 dd9c moveal 5dd9c <_Per_CPU_Information+0xc>,%a0 * ready thread. */ RTEMS_INLINE_ROUTINE void _Thread_Calculate_heir( void ) { _Thread_Heir = (Thread_Control *) 472ee: 23c1 0005 dda0 movel %d1,5dda0 <_Per_CPU_Information+0x10> * We altered the set of thread priorities. So let's figure out * who is the heir and if we need to switch to them. */ _Thread_Calculate_heir(); if ( !_Thread_Is_executing_also_the_heir() && 472f4: b288 cmpl %a0,%d1 472f6: 670e beqs 47306 <_Thread_Change_priority+0x132> 472f8: 4a28 0074 tstb %a0@(116) 472fc: 6708 beqs 47306 <_Thread_Change_priority+0x132> _Thread_Executing->is_preemptible ) _Context_Switch_necessary = true; 472fe: 7201 moveq #1,%d1 47300: 13c1 0005 dda8 moveb %d1,5dda8 <_Per_CPU_Information+0x18> _ISR_Enable( level ); 47306: 46c0 movew %d0,%sr } 47308: 4cee 041c fff0 moveml %fp@(-16),%d2-%d4/%a2 4730e: 4e5e unlk %fp ... =============================================================================== 00047314 <_Thread_Clear_state>: void _Thread_Clear_state( Thread_Control *the_thread, States_Control state ) { 47314: 4e56 fff0 linkw %fp,#-16 47318: 206e 0008 moveal %fp@(8),%a0 4731c: 48d7 041c moveml %d2-%d4/%a2,%sp@ ISR_Level level; States_Control current_state; _ISR_Disable( level ); 47320: 263c 0000 0700 movel #1792,%d3 47326: 2203 movel %d3,%d1 void _Thread_Clear_state( Thread_Control *the_thread, States_Control state ) { 47328: 202e 000c movel %fp@(12),%d0 ISR_Level level; States_Control current_state; _ISR_Disable( level ); 4732c: 40c2 movew %sr,%d2 4732e: 8282 orl %d2,%d1 47330: 46c1 movew %d1,%sr current_state = the_thread->current_state; 47332: 2228 0010 movel %a0@(16),%d1 if ( current_state & state ) { 47336: 2800 movel %d0,%d4 47338: c881 andl %d1,%d4 4733a: 6778 beqs 473b4 <_Thread_Clear_state+0xa0> RTEMS_INLINE_ROUTINE States_Control _States_Clear ( States_Control states_to_clear, States_Control current_state ) { return (current_state & ~states_to_clear); 4733c: 4680 notl %d0 4733e: c081 andl %d1,%d0 current_state = the_thread->current_state = _States_Clear( state, current_state ); 47340: 2140 0010 movel %d0,%a0@(16) if ( _States_Is_ready( current_state ) ) { 47344: 666e bnes 473b4 <_Thread_Clear_state+0xa0> RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 47346: 2268 008e moveal %a0@(142),%a1 4734a: 3028 0094 movew %a0@(148),%d0 4734e: 3211 movew %a1@,%d1 47350: 8081 orl %d1,%d0 47352: 3280 movew %d0,%a1@ _Priority_Add_to_bit_map( &the_thread->Priority_map ); _Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node); 47354: 2268 008a moveal %a0@(138),%a1 _Priority_Major_bit_map |= the_priority_map->ready_major; 47358: 3039 0005 d9ac movew 5d9ac <_Priority_Major_bit_map>,%d0 4735e: 3228 0092 movew %a0@(146),%d1 ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; 47362: 2469 0008 moveal %a1@(8),%a2 47366: 8081 orl %d1,%d0 47368: 33c0 0005 d9ac movew %d0,5d9ac <_Priority_Major_bit_map> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4736e: 2009 movel %a1,%d0 47370: 5880 addql #4,%d0 47372: 2080 movel %d0,%a0@ { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; the_chain->last = the_node; 47374: 2348 0008 movel %a0,%a1@(8) old_last_node->next = the_node; 47378: 2488 movel %a0,%a2@ the_node->previous = old_last_node; 4737a: 214a 0004 movel %a2,%a0@(4) _ISR_Flash( level ); 4737e: 2003 movel %d3,%d0 47380: 46c2 movew %d2,%sr 47382: 8082 orl %d2,%d0 47384: 46c0 movew %d0,%sr * a context switch. * Pseudo-ISR case: * Even if the thread isn't preemptible, if the new heir is * a pseudo-ISR system task, we need to do a context switch. */ if ( the_thread->current_priority < _Thread_Heir->current_priority ) { 47386: 2028 0014 movel %a0@(20),%d0 4738a: 2279 0005 dda0 moveal 5dda0 <_Per_CPU_Information+0x10>,%a1 47390: b0a9 0014 cmpl %a1@(20),%d0 47394: 641e bccs 473b4 <_Thread_Clear_state+0xa0> _Thread_Heir = the_thread; 47396: 23c8 0005 dda0 movel %a0,5dda0 <_Per_CPU_Information+0x10> if ( _Thread_Executing->is_preemptible || 4739c: 2079 0005 dd9c moveal 5dd9c <_Per_CPU_Information+0xc>,%a0 473a2: 4a28 0074 tstb %a0@(116) 473a6: 6604 bnes 473ac <_Thread_Clear_state+0x98> 473a8: 4a80 tstl %d0 473aa: 6608 bnes 473b4 <_Thread_Clear_state+0xa0> <== ALWAYS TAKEN the_thread->current_priority == 0 ) _Context_Switch_necessary = true; 473ac: 7001 moveq #1,%d0 473ae: 13c0 0005 dda8 moveb %d0,5dda8 <_Per_CPU_Information+0x18> } } } _ISR_Enable( level ); 473b4: 46c2 movew %d2,%sr } 473b6: 4cd7 041c moveml %sp@,%d2-%d4/%a2 473ba: 4e5e unlk %fp ... =============================================================================== 00047540 <_Thread_Delay_ended>: void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { 47540: 4e56 fffc linkw %fp,#-4 Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 47544: 486e fffc pea %fp@(-4) 47548: 2f2e 0008 movel %fp@(8),%sp@- 4754c: 4eb9 0004 76e0 jsr 476e0 <_Thread_Get> switch ( location ) { 47552: 508f addql #8,%sp 47554: 4aae fffc tstl %fp@(-4) 47558: 661e bnes 47578 <_Thread_Delay_ended+0x38> <== NEVER TAKEN #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_Clear_state( 4755a: 2f3c 1000 0018 movel #268435480,%sp@- 47560: 2f00 movel %d0,%sp@- 47562: 4eb9 0004 7314 jsr 47314 <_Thread_Clear_state> 47568: 508f addql #8,%sp 4756a: 2039 0005 d90c movel 5d90c <_Thread_Dispatch_disable_level>,%d0 47570: 5380 subql #1,%d0 47572: 23c0 0005 d90c movel %d0,5d90c <_Thread_Dispatch_disable_level> | STATES_INTERRUPTIBLE_BY_SIGNAL ); _Thread_Unnest_dispatch(); break; } } 47578: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004757c <_Thread_Dispatch>: * dispatch thread * no dispatch thread */ void _Thread_Dispatch( void ) { 4757c: 4e56 ffc8 linkw %fp,#-56 47580: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ Thread_Control *executing; Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); 47584: 283c 0000 0700 movel #1792,%d4 4758a: 2204 movel %d4,%d1 { Thread_Control *executing; Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; 4758c: 2479 0005 dd9c moveal 5dd9c <_Per_CPU_Information+0xc>,%a2 _ISR_Disable( level ); 47592: 40c0 movew %sr,%d0 47594: 8280 orl %d0,%d1 47596: 46c1 movew %d1,%sr _ISR_Enable( level ); #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 47598: 260e movel %fp,%d3 _Timestamp_Subtract( 4759a: 240e movel %fp,%d2 _ISR_Enable( level ); #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 4759c: 5183 subql #8,%d3 _Timestamp_Subtract( 4759e: 0682 ffff fff0 addil #-16,%d2 &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); 475a4: 2e3c 0004 834c movel #295756,%d7 if ( _Thread_libc_reent ) { executing->libc_reent = *_Thread_libc_reent; *_Thread_libc_reent = heir->libc_reent; } _User_extensions_Thread_switch( executing, heir ); 475aa: 2c3c 0004 8600 movel #296448,%d6 if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 475b0: 2a3c 0004 8914 movel #297236,%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 ); 475b6: 4bf9 0004 8a7c lea 48a7c <_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 ); 475bc: 49f9 0004 8a5a lea 48a5a <_CPU_Context_save_fp>,%a4 Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { 475c2: 6000 00d4 braw 47698 <_Thread_Dispatch+0x11c> heir = _Thread_Heir; _Thread_Dispatch_disable_level = 1; 475c6: 7201 moveq #1,%d1 475c8: 23c1 0005 d90c movel %d1,5d90c <_Thread_Dispatch_disable_level> ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { heir = _Thread_Heir; 475ce: 2679 0005 dda0 moveal 5dda0 <_Per_CPU_Information+0x10>,%a3 _Thread_Dispatch_disable_level = 1; _Context_Switch_necessary = false; 475d4: 4201 clrb %d1 _Thread_Executing = heir; 475d6: 23cb 0005 dd9c movel %a3,5dd9c <_Per_CPU_Information+0xc> executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { heir = _Thread_Heir; _Thread_Dispatch_disable_level = 1; _Context_Switch_necessary = false; 475dc: 13c1 0005 dda8 moveb %d1,5dda8 <_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 ) 475e2: b5cb cmpal %a3,%a2 475e4: 6700 00bc beqw 476a2 <_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 ) 475e8: 7201 moveq #1,%d1 475ea: b2ab 007a cmpl %a3@(122),%d1 475ee: 660a bnes 475fa <_Thread_Dispatch+0x7e> heir->cpu_time_budget = _Thread_Ticks_per_timeslice; 475f0: 41f9 0005 d8c4 lea 5d8c4 <_Thread_Ticks_per_timeslice>,%a0 475f6: 2750 0076 movel %a0@,%a3@(118) _ISR_Enable( level ); 475fa: 46c0 movew %d0,%sr #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); 475fc: 2f03 movel %d3,%sp@- 475fe: 4eb9 0004 aaf4 jsr 4aaf4 <_TOD_Get_uptime> _Timestamp_Subtract( 47604: 2f02 movel %d2,%sp@- 47606: 2f03 movel %d3,%sp@- 47608: 4879 0005 d9ba pea 5d9ba <_Thread_Time_of_last_context_switch> 4760e: 4eb9 0004 8384 jsr 48384 <_Timespec_Subtract> &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); 47614: 2047 moveal %d7,%a0 47616: 2f02 movel %d2,%sp@- 47618: 486a 0082 pea %a2@(130) 4761c: 4e90 jsr %a0@ #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 4761e: 2079 0005 d992 moveal 5d992 <_Thread_libc_reent>,%a0 47624: 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; 47628: 202e fff8 movel %fp@(-8),%d0 4762c: 222e fffc movel %fp@(-4),%d1 47630: 23c0 0005 d9ba movel %d0,5d9ba <_Thread_Time_of_last_context_switch> 47636: 23c1 0005 d9be movel %d1,5d9be <_Thread_Time_of_last_context_switch+0x4> #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 4763c: 4a88 tstl %a0 4763e: 6708 beqs 47648 <_Thread_Dispatch+0xcc> <== NEVER TAKEN executing->libc_reent = *_Thread_libc_reent; 47640: 2550 0106 movel %a0@,%a2@(262) *_Thread_libc_reent = heir->libc_reent; 47644: 20ab 0106 movel %a3@(262),%a0@ } _User_extensions_Thread_switch( executing, heir ); 47648: 2f0b movel %a3,%sp@- 4764a: 2046 moveal %d6,%a0 4764c: 2f0a movel %a2,%sp@- 4764e: 4e90 jsr %a0@ if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 47650: 486b 00ce pea %a3@(206) 47654: 2045 moveal %d5,%a0 47656: 486a 00ce pea %a2@(206) 4765a: 4e90 jsr %a0@ #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && 4765c: 4fef 0010 lea %sp@(16),%sp 47660: 4aaa 0102 tstl %a2@(258) 47664: 6724 beqs 4768a <_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 ); 47666: 2079 0005 d98e moveal 5d98e <_Thread_Allocated_fp>,%a0 4766c: b1ca cmpal %a2,%a0 4766e: 671a beqs 4768a <_Thread_Dispatch+0x10e> !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) 47670: 4a88 tstl %a0 47672: 6708 beqs 4767c <_Thread_Dispatch+0x100> _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 47674: 4868 0102 pea %a0@(258) 47678: 4e94 jsr %a4@ 4767a: 588f addql #4,%sp _Context_Restore_fp( &executing->fp_context ); 4767c: 486a 0102 pea %a2@(258) 47680: 4e95 jsr %a5@ _Thread_Allocated_fp = executing; 47682: 588f addql #4,%sp 47684: 23ca 0005 d98e movel %a2,5d98e <_Thread_Allocated_fp> if ( executing->fp_context != NULL ) _Context_Restore_fp( &executing->fp_context ); #endif #endif executing = _Thread_Executing; 4768a: 2479 0005 dd9c moveal 5dd9c <_Per_CPU_Information+0xc>,%a2 _ISR_Disable( level ); 47690: 2204 movel %d4,%d1 47692: 40c0 movew %sr,%d0 47694: 8280 orl %d0,%d1 47696: 46c1 movew %d1,%sr Thread_Control *heir; ISR_Level level; executing = _Thread_Executing; _ISR_Disable( level ); while ( _Context_Switch_necessary == true ) { 47698: 1239 0005 dda8 moveb 5dda8 <_Per_CPU_Information+0x18>,%d1 4769e: 6600 ff26 bnew 475c6 <_Thread_Dispatch+0x4a> _ISR_Disable( level ); } post_switch: _Thread_Dispatch_disable_level = 0; 476a2: 42b9 0005 d90c clrl 5d90c <_Thread_Dispatch_disable_level> _ISR_Enable( level ); 476a8: 46c0 movew %d0,%sr _API_extensions_Run_postswitch(); 476aa: 4eb9 0004 5ffc jsr 45ffc <_API_extensions_Run_postswitch> } 476b0: 4cee 3cfc ffc8 moveml %fp@(-56),%d2-%d7/%a2-%a5 476b6: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000476e0 <_Thread_Get>: Thread_Control *_Thread_Get ( Objects_Id id, Objects_Locations *location ) { 476e0: 4e56 0000 linkw %fp,#0 476e4: 202e 0008 movel %fp@(8),%d0 476e8: 2f03 movel %d3,%sp@- 476ea: 206e 000c moveal %fp@(12),%a0 476ee: 2f02 movel %d2,%sp@- uint32_t the_class; Objects_Information **api_information; Objects_Information *information; Thread_Control *tp = (Thread_Control *) 0; if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) ) { 476f0: 4a80 tstl %d0 476f2: 6618 bnes 4770c <_Thread_Get+0x2c> rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 476f4: 2039 0005 d90c movel 5d90c <_Thread_Dispatch_disable_level>,%d0 476fa: 5280 addql #1,%d0 476fc: 23c0 0005 d90c movel %d0,5d90c <_Thread_Dispatch_disable_level> _Thread_Disable_dispatch(); *location = OBJECTS_LOCAL; 47702: 4290 clrl %a0@ tp = _Thread_Executing; 47704: 2039 0005 dd9c movel 5dd9c <_Per_CPU_Information+0xc>,%d0 goto done; 4770a: 6044 bras 47750 <_Thread_Get+0x70> */ RTEMS_INLINE_ROUTINE Objects_APIs _Objects_Get_API( Objects_Id id ) { return (Objects_APIs) ((id >> OBJECTS_API_START_BIT) & OBJECTS_API_VALID_BITS); 4770c: 7418 moveq #24,%d2 4770e: 2200 movel %d0,%d1 47710: e4a9 lsrl %d2,%d1 47712: 7607 moveq #7,%d3 */ RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid( uint32_t the_api ) { if ( !the_api || the_api > OBJECTS_APIS_LAST ) 47714: 143c 0002 moveb #2,%d2 */ RTEMS_INLINE_ROUTINE Objects_APIs _Objects_Get_API( Objects_Id id ) { return (Objects_APIs) ((id >> OBJECTS_API_START_BIT) & OBJECTS_API_VALID_BITS); 47718: c283 andl %d3,%d1 */ RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid( uint32_t the_api ) { if ( !the_api || the_api > OBJECTS_APIS_LAST ) 4771a: 2241 moveal %d1,%a1 4771c: 5389 subql #1,%a1 4771e: b489 cmpl %a1,%d2 47720: 643a bccs 4775c <_Thread_Get+0x7c> 47722: 6014 bras 47738 <_Thread_Get+0x58> if ( the_class != 1 ) { /* threads are always first class :) */ *location = OBJECTS_ERROR; goto done; } api_information = _Objects_Information_table[ the_api ]; 47724: 43f9 0005 d8c8 lea 5d8c8 <_Objects_Information_table>,%a1 4772a: 2271 1c00 moveal %a1@(00000000,%d1:l:4),%a1 if ( !api_information ) { 4772e: 4a89 tstl %a1 47730: 6706 beqs 47738 <_Thread_Get+0x58> <== NEVER TAKEN *location = OBJECTS_ERROR; goto done; } information = api_information[ the_class ]; 47732: 2229 0004 movel %a1@(4),%d1 if ( !information ) { 47736: 6608 bnes 47740 <_Thread_Get+0x60> *location = OBJECTS_ERROR; 47738: 7001 moveq #1,%d0 4773a: 2080 movel %d0,%a0@ { uint32_t the_api; uint32_t the_class; Objects_Information **api_information; Objects_Information *information; Thread_Control *tp = (Thread_Control *) 0; 4773c: 4280 clrl %d0 } information = api_information[ the_class ]; if ( !information ) { *location = OBJECTS_ERROR; goto done; 4773e: 6010 bras 47750 <_Thread_Get+0x70> } tp = (Thread_Control *) _Objects_Get( information, id, location ); 47740: 2f08 movel %a0,%sp@- 47742: 2f00 movel %d0,%sp@- 47744: 2f01 movel %d1,%sp@- 47746: 4eb9 0004 6e58 jsr 46e58 <_Objects_Get> 4774c: 4fef 000c lea %sp@(12),%sp done: return tp; } 47750: 242e fff8 movel %fp@(-8),%d2 47754: 262e fffc movel %fp@(-4),%d3 47758: 4e5e unlk %fp 4775a: 4e75 rts */ RTEMS_INLINE_ROUTINE uint32_t _Objects_Get_class( Objects_Id id ) { return (uint32_t) 4775c: 761b moveq #27,%d3 4775e: 2400 movel %d0,%d2 47760: e6aa lsrl %d3,%d2 *location = OBJECTS_ERROR; goto done; } the_class = _Objects_Get_class( id ); if ( the_class != 1 ) { /* threads are always first class :) */ 47762: 163c 0001 moveb #1,%d3 47766: b682 cmpl %d2,%d3 47768: 67ba beqs 47724 <_Thread_Get+0x44> 4776a: 60cc bras 47738 <_Thread_Get+0x58> =============================================================================== 0004c848 <_Thread_Handler>: * * Output parameters: NONE */ void _Thread_Handler( void ) { 4c848: 4e56 0000 linkw %fp,#0 4c84c: 2f0a movel %a2,%sp@- #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static char doneConstructors; char doneCons; #endif executing = _Thread_Executing; 4c84e: 2479 0005 dd9c moveal 5dd9c <_Per_CPU_Information+0xc>,%a2 * * Output parameters: NONE */ void _Thread_Handler( void ) { 4c854: 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; 4c856: 222a 00b4 movel %a2@(180),%d1 _ISR_Set_level(level); 4c85a: 40c0 movew %sr,%d0 4c85c: e189 lsll #8,%d1 4c85e: 0280 0000 f8ff andil #63743,%d0 4c864: 8081 orl %d1,%d0 4c866: 46c0 movew %d0,%sr #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) doneCons = doneConstructors; doneConstructors = 1; 4c868: 7001 moveq #1,%d0 level = executing->Start.isr_level; _ISR_Set_level(level); #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) doneCons = doneConstructors; 4c86a: 1439 0005 d0c8 moveb 5d0c8 ,%d2 doneConstructors = 1; 4c870: 13c0 0005 d0c8 moveb %d0,5d0c8 #endif #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) #if ( CPU_USE_DEFERRED_FP_SWITCH == TRUE ) if ( (executing->fp_context != NULL) && 4c876: 4aaa 0102 tstl %a2@(258) 4c87a: 6720 beqs 4c89c <_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 ); 4c87c: 2079 0005 d98e moveal 5d98e <_Thread_Allocated_fp>,%a0 4c882: b1ca cmpal %a2,%a0 4c884: 6716 beqs 4c89c <_Thread_Handler+0x54> !_Thread_Is_allocated_fp( executing ) ) { if ( _Thread_Allocated_fp != NULL ) 4c886: 4a88 tstl %a0 4c888: 670c beqs 4c896 <_Thread_Handler+0x4e> _Context_Save_fp( &_Thread_Allocated_fp->fp_context ); 4c88a: 4868 0102 pea %a0@(258) 4c88e: 4eb9 0004 8a5a jsr 48a5a <_CPU_Context_save_fp> 4c894: 588f addql #4,%sp _Thread_Allocated_fp = executing; 4c896: 23ca 0005 d98e movel %a2,5d98e <_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 ); 4c89c: 2f0a movel %a2,%sp@- 4c89e: 4eb9 0004 847c jsr 4847c <_User_extensions_Thread_begin> /* * At this point, the dispatch disable level BETTER be 1. */ _Thread_Enable_dispatch(); 4c8a4: 4eb9 0004 76ba jsr 476ba <_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) */ { 4c8aa: 588f addql #4,%sp 4c8ac: 4a02 tstb %d2 4c8ae: 6606 bnes 4c8b6 <_Thread_Handler+0x6e> INIT_NAME (); 4c8b0: 4eb9 0005 a670 jsr 5a670 <_init> } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 4c8b6: 202a 009e movel %a2@(158),%d0 4c8ba: 6606 bnes 4c8c2 <_Thread_Handler+0x7a> executing->Wait.return_argument = (*(Thread_Entry_numeric) executing->Start.entry_point)( 4c8bc: 2f2a 00a6 movel %a2@(166),%sp@- 4c8c0: 600a bras 4c8cc <_Thread_Handler+0x84> executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { 4c8c2: 7201 moveq #1,%d1 4c8c4: b280 cmpl %d0,%d1 4c8c6: 6610 bnes 4c8d8 <_Thread_Handler+0x90> <== NEVER TAKEN executing->Wait.return_argument = (*(Thread_Entry_pointer) executing->Start.entry_point)( 4c8c8: 2f2a 00a2 movel %a2@(162),%sp@- 4c8cc: 206a 009a moveal %a2@(154),%a0 4c8d0: 4e90 jsr %a0@ executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { executing->Wait.return_argument = 4c8d2: 588f addql #4,%sp 4c8d4: 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 ); 4c8d8: 2f0a movel %a2,%sp@- 4c8da: 4eb9 0004 84b4 jsr 484b4 <_User_extensions_Thread_exitted> _Internal_error_Occurred( 4c8e0: 4878 0006 pea 6 4c8e4: 4878 0001 pea 1 4c8e8: 42a7 clrl %sp@- 4c8ea: 4eb9 0004 694c jsr 4694c <_Internal_error_Occurred> =============================================================================== 00048640 <_Thread_Restart>: */ RTEMS_INLINE_ROUTINE bool _States_Is_dormant ( States_Control the_states ) { return (the_states & STATES_DORMANT); 48640: 7001 moveq #1,%d0 bool _Thread_Restart( Thread_Control *the_thread, void *pointer_argument, Thread_Entry_numeric_type numeric_argument ) { 48642: 4e56 0000 linkw %fp,#0 48646: 2f0a movel %a2,%sp@- 48648: 246e 0008 moveal %fp@(8),%a2 4864c: c0aa 0010 andl %a2@(16),%d0 if ( !_States_Is_dormant( the_thread->current_state ) ) { 48650: 6664 bnes 486b6 <_Thread_Restart+0x76> _Thread_Set_transient( the_thread ); 48652: 2f0a movel %a2,%sp@- 48654: 4eb9 0004 881c jsr 4881c <_Thread_Set_transient> _Thread_Reset( the_thread, pointer_argument, numeric_argument ); 4865a: 2f2e 0010 movel %fp@(16),%sp@- 4865e: 2f2e 000c movel %fp@(12),%sp@- 48662: 2f0a movel %a2,%sp@- 48664: 4eb9 0004 ba34 jsr 4ba34 <_Thread_Reset> _Thread_Load_environment( the_thread ); 4866a: 2f0a movel %a2,%sp@- 4866c: 4eb9 0004 b6e0 jsr 4b6e0 <_Thread_Load_environment> _Thread_Ready( the_thread ); 48672: 2f0a movel %a2,%sp@- 48674: 4eb9 0004 b974 jsr 4b974 <_Thread_Ready> _User_extensions_Thread_restart( the_thread ); 4867a: 2f0a movel %a2,%sp@- 4867c: 4eb9 0004 8dfc jsr 48dfc <_User_extensions_Thread_restart> if ( _Thread_Is_executing ( the_thread ) ) 48682: 4fef 001c lea %sp@(28),%sp 48686: b5f9 0005 e8d4 cmpal 5e8d4 <_Per_CPU_Information+0xc>,%a2 4868c: 662c bnes 486ba <_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 ) 4868e: 4aaa 0102 tstl %a2@(258) 48692: 670c beqs 486a0 <_Thread_Restart+0x60> _Context_Restore_fp( &_Thread_Executing->fp_context ); 48694: 486a 0102 pea %a2@(258) 48698: 4eb9 0004 92f8 jsr 492f8 <_CPU_Context_restore_fp> 4869e: 588f addql #4,%sp #endif _CPU_Context_Restart_self( &_Thread_Executing->Registers ); 486a0: 2079 0005 e8d4 moveal 5e8d4 <_Per_CPU_Information+0xc>,%a0 486a6: 41e8 00ce lea %a0@(206),%a0 486aa: 2f08 movel %a0,%sp@- 486ac: 4eb9 0004 91a6 jsr 491a6 <_CPU_Context_Restart_self> 486b2: 588f addql #4,%sp <== NOT EXECUTED 486b4: 6004 bras 486ba <_Thread_Restart+0x7a> <== NOT EXECUTED _Thread_Restart_self(); return true; } return false; 486b6: 4200 clrb %d0 486b8: 6002 bras 486bc <_Thread_Restart+0x7c> _User_extensions_Thread_restart( the_thread ); if ( _Thread_Is_executing ( the_thread ) ) _Thread_Restart_self(); return true; 486ba: 7001 moveq #1,%d0 } return false; } 486bc: 246e fffc moveal %fp@(-4),%a2 486c0: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004acb8 <_Thread_Resume>: void _Thread_Resume( Thread_Control *the_thread, bool force ) { 4acb8: 4e56 fff4 linkw %fp,#-12 4acbc: 206e 0008 moveal %fp@(8),%a0 4acc0: 48d7 040c moveml %d2-%d3/%a2,%sp@ ISR_Level level; States_Control current_state; _ISR_Disable( level ); 4acc4: 243c 0000 0700 movel #1792,%d2 4acca: 2002 movel %d2,%d0 4accc: 40c1 movew %sr,%d1 4acce: 8081 orl %d1,%d0 4acd0: 46c0 movew %d0,%sr current_state = the_thread->current_state; 4acd2: 2028 0010 movel %a0@(16),%d0 if ( current_state & STATES_SUSPENDED ) { 4acd6: 0800 0001 btst #1,%d0 4acda: 6778 beqs 4ad54 <_Thread_Resume+0x9c> <== NEVER TAKEN RTEMS_INLINE_ROUTINE States_Control _States_Clear ( States_Control states_to_clear, States_Control current_state ) { return (current_state & ~states_to_clear); 4acdc: 76fd moveq #-3,%d3 4acde: c083 andl %d3,%d0 current_state = the_thread->current_state = _States_Clear(STATES_SUSPENDED, current_state); 4ace0: 2140 0010 movel %d0,%a0@(16) if ( _States_Is_ready( current_state ) ) { 4ace4: 666e bnes 4ad54 <_Thread_Resume+0x9c> RTEMS_INLINE_ROUTINE void _Priority_Add_to_bit_map ( Priority_Information *the_priority_map ) { *the_priority_map->minor |= the_priority_map->ready_minor; 4ace6: 2268 008e moveal %a0@(142),%a1 4acea: 3028 0094 movew %a0@(148),%d0 4acee: 3611 movew %a1@,%d3 4acf0: 8083 orl %d3,%d0 4acf2: 3280 movew %d0,%a1@ _Priority_Add_to_bit_map( &the_thread->Priority_map ); _Chain_Append_unprotected(the_thread->ready, &the_thread->Object.Node); 4acf4: 2268 008a moveal %a0@(138),%a1 _Priority_Major_bit_map |= the_priority_map->ready_major; 4acf8: 3039 0006 0df4 movew 60df4 <_Priority_Major_bit_map>,%d0 4acfe: 3628 0092 movew %a0@(146),%d3 ) { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; 4ad02: 2469 0008 moveal %a1@(8),%a2 4ad06: 8083 orl %d3,%d0 4ad08: 33c0 0006 0df4 movew %d0,60df4 <_Priority_Major_bit_map> */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 4ad0e: 2009 movel %a1,%d0 4ad10: 5880 addql #4,%d0 4ad12: 2080 movel %d0,%a0@ { Chain_Node *old_last_node; the_node->next = _Chain_Tail(the_chain); old_last_node = the_chain->last; the_chain->last = the_node; 4ad14: 2348 0008 movel %a0,%a1@(8) old_last_node->next = the_node; 4ad18: 2488 movel %a0,%a2@ the_node->previous = old_last_node; 4ad1a: 214a 0004 movel %a2,%a0@(4) _ISR_Flash( level ); 4ad1e: 2002 movel %d2,%d0 4ad20: 46c1 movew %d1,%sr 4ad22: 8081 orl %d1,%d0 4ad24: 46c0 movew %d0,%sr if ( the_thread->current_priority < _Thread_Heir->current_priority ) { 4ad26: 2028 0014 movel %a0@(20),%d0 4ad2a: 2279 0006 11e8 moveal 611e8 <_Per_CPU_Information+0x10>,%a1 4ad30: b0a9 0014 cmpl %a1@(20),%d0 4ad34: 641e bccs 4ad54 <_Thread_Resume+0x9c> _Thread_Heir = the_thread; 4ad36: 23c8 0006 11e8 movel %a0,611e8 <_Per_CPU_Information+0x10> if ( _Thread_Executing->is_preemptible || 4ad3c: 2079 0006 11e4 moveal 611e4 <_Per_CPU_Information+0xc>,%a0 4ad42: 4a28 0074 tstb %a0@(116) 4ad46: 6604 bnes 4ad4c <_Thread_Resume+0x94> 4ad48: 4a80 tstl %d0 4ad4a: 6608 bnes 4ad54 <_Thread_Resume+0x9c> <== ALWAYS TAKEN the_thread->current_priority == 0 ) _Context_Switch_necessary = true; 4ad4c: 7601 moveq #1,%d3 4ad4e: 13c3 0006 11f0 moveb %d3,611f0 <_Per_CPU_Information+0x18> } } } _ISR_Enable( level ); 4ad54: 46c1 movew %d1,%sr } 4ad56: 4cd7 040c moveml %sp@,%d2-%d3/%a2 4ad5a: 4e5e unlk %fp ... =============================================================================== 00048264 <_Thread_Tickle_timeslice>: * * Output parameters: NONE */ void _Thread_Tickle_timeslice( void ) { 48264: 4e56 0000 linkw %fp,#0 48268: 2f0a movel %a2,%sp@- Thread_Control *executing; executing = _Thread_Executing; 4826a: 2479 0005 dd9c moveal 5dd9c <_Per_CPU_Information+0xc>,%a2 /* * If the thread is not preemptible or is not ready, then * just return. */ if ( !executing->is_preemptible ) 48270: 4a2a 0074 tstb %a2@(116) 48274: 6756 beqs 482cc <_Thread_Tickle_timeslice+0x68> return; if ( !_States_Is_ready( executing->current_state ) ) 48276: 4aaa 0010 tstl %a2@(16) 4827a: 6650 bnes 482cc <_Thread_Tickle_timeslice+0x68> /* * The cpu budget algorithm determines what happens next. */ switch ( executing->budget_algorithm ) { 4827c: 202a 007a movel %a2@(122),%d0 48280: 7201 moveq #1,%d1 48282: b280 cmpl %d0,%d1 48284: 6246 bhis 482cc <_Thread_Tickle_timeslice+0x68> 48286: 123c 0002 moveb #2,%d1 4828a: b280 cmpl %d0,%d1 4828c: 640a bccs 48298 <_Thread_Tickle_timeslice+0x34> 4828e: 123c 0003 moveb #3,%d1 48292: b280 cmpl %d0,%d1 48294: 6636 bnes 482cc <_Thread_Tickle_timeslice+0x68> <== NEVER TAKEN 48296: 601e bras 482b6 <_Thread_Tickle_timeslice+0x52> case THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE: #if defined(RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE) case THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE: #endif if ( (int)(--executing->cpu_time_budget) <= 0 ) { 48298: 202a 0076 movel %a2@(118),%d0 4829c: 5380 subql #1,%d0 4829e: 2540 0076 movel %d0,%a2@(118) 482a2: 6e28 bgts 482cc <_Thread_Tickle_timeslice+0x68> * at the priority of the currently executing thread, then the * 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. */ _Thread_Yield_processor(); 482a4: 4eb9 0004 82d4 jsr 482d4 <_Thread_Yield_processor> executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 482aa: 41f9 0005 d8c4 lea 5d8c4 <_Thread_Ticks_per_timeslice>,%a0 482b0: 2550 0076 movel %a0@,%a2@(118) 482b4: 6016 bras 482cc <_Thread_Tickle_timeslice+0x68> } break; #if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT) case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: if ( --executing->cpu_time_budget == 0 ) 482b6: 202a 0076 movel %a2@(118),%d0 482ba: 5380 subql #1,%d0 482bc: 2540 0076 movel %d0,%a2@(118) 482c0: 660a bnes 482cc <_Thread_Tickle_timeslice+0x68> (*executing->budget_callout)( executing ); 482c2: 2f0a movel %a2,%sp@- 482c4: 206a 007e moveal %a2@(126),%a0 482c8: 4e90 jsr %a0@ 482ca: 588f addql #4,%sp break; #endif } } 482cc: 246e fffc moveal %fp@(-4),%a2 482d0: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00047184 <_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 ) ) { 47184: 7202 moveq #2,%d1 Thread_blocking_operation_States sync_state __attribute__((unused)), #endif Thread_Control *the_thread, ISR_Level level ) { 47186: 4e56 0000 linkw %fp,#0 4718a: 202e 0010 movel %fp@(16),%d0 4718e: 2f0a movel %a2,%sp@- 47190: 246e 000c moveal %fp@(12),%a2 #endif /* * The thread is not waiting on anything after this completes. */ the_thread->Wait.queue = NULL; 47194: 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 ) ) { 47198: b2aa 0050 cmpl %a2@(80),%d1 4719c: 6618 bnes 471b6 <_Thread_blocking_operation_Cancel+0x32> RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 4719e: 123c 0003 moveb #3,%d1 471a2: 2541 0050 movel %d1,%a2@(80) _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 471a6: 46c0 movew %d0,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 471a8: 486a 0048 pea %a2@(72) 471ac: 4eb9 0004 8754 jsr 48754 <_Watchdog_Remove> 471b2: 588f addql #4,%sp 471b4: 6002 bras 471b8 <_Thread_blocking_operation_Cancel+0x34> } else _ISR_Enable( level ); 471b6: 46c0 movew %d0,%sr RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 471b8: 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 } 471bc: 246e fffc moveal %fp@(-4),%a2 471c0: 203c 1003 fff8 movel #268697592,%d0 471c6: 2d40 000c movel %d0,%fp@(12) 471ca: 4e5e unlk %fp 471cc: 4ef9 0004 7314 jmp 47314 <_Thread_Clear_state> ... =============================================================================== 00047bd8 <_Thread_queue_Enqueue_priority>: Thread_blocking_operation_States _Thread_queue_Enqueue_priority ( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, ISR_Level *level_p ) { 47bd8: 4e56 ffe0 linkw %fp,#-32 47bdc: 206e 000c moveal %fp@(12),%a0 47be0: 43e8 003c lea %a0@(60),%a1 Priority_Control priority; States_Control block_state; _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; 47be4: 2028 0014 movel %a0@(20),%d0 RTEMS_INLINE_ROUTINE uint32_t _Thread_queue_Header_number ( Priority_Control the_priority ) { return (the_priority / TASK_QUEUE_DATA_PRIORITIES_PER_HEADER); 47be8: 2200 movel %d0,%d1 47bea: ec89 lsrl #6,%d1 Thread_blocking_operation_States _Thread_queue_Enqueue_priority ( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, ISR_Level *level_p ) { 47bec: 48d7 1c7c moveml %d2-%d6/%a2-%a4,%sp@ _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; 47bf0: 2401 movel %d1,%d2 47bf2: e989 lsll #4,%d1 47bf4: e58a lsll #2,%d2 Thread_blocking_operation_States _Thread_queue_Enqueue_priority ( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread, ISR_Level *level_p ) { 47bf6: 246e 0008 moveal %fp@(8),%a2 _Chain_Initialize_empty( &the_thread->Wait.Block2n ); priority = the_thread->current_priority; header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; 47bfa: 9282 subl %d2,%d1 47bfc: 47f2 1800 lea %a2@(00000000,%d1:l),%a3 47c00: 2149 0038 movel %a1,%a0@(56) Chain_Node *previous_node; Chain_Node *search_node; Priority_Control priority; States_Control block_state; _Chain_Initialize_empty( &the_thread->Wait.Block2n ); 47c04: 43e8 0038 lea %a0@(56),%a1 priority = the_thread->current_priority; header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; block_state = the_thread_queue->state; 47c08: 282a 0038 movel %a2@(56),%d4 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); the_chain->permanent_null = NULL; 47c0c: 42a8 003c clrl %a0@(60) Chain_Node *previous_node; Chain_Node *search_node; Priority_Control priority; States_Control block_state; _Chain_Initialize_empty( &the_thread->Wait.Block2n ); 47c10: 2149 0040 movel %a1,%a0@(64) priority = the_thread->current_priority; header_index = _Thread_queue_Header_number( priority ); header = &the_thread_queue->Queues.Priority[ header_index ]; block_state = the_thread_queue->state; if ( _Thread_queue_Is_reverse_search( priority ) ) 47c14: 0800 0005 btst #5,%d0 47c18: 666a bnes 47c84 <_Thread_queue_Enqueue_priority+0xac> goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); 47c1a: 367c 0700 moveaw #1792,%a3 search_thread = (Thread_Control *) header->first; 47c1e: 2a01 movel %d1,%d5 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 47c20: 49f2 1804 lea %a2@(00000004,%d1:l),%a4 if ( _Thread_queue_Is_reverse_search( priority ) ) goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); 47c24: 240b movel %a3,%d2 47c26: 40c1 movew %sr,%d1 47c28: 8481 orl %d1,%d2 47c2a: 46c2 movew %d2,%sr 47c2c: 2401 movel %d1,%d2 search_thread = (Thread_Control *) header->first; 47c2e: 2272 5800 moveal %a2@(00000000,%d5:l),%a1 if ( _Thread_queue_Is_reverse_search( priority ) ) goto restart_reverse_search; restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; 47c32: 76ff moveq #-1,%d3 _ISR_Disable( level ); search_thread = (Thread_Control *) header->first; while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 47c34: 601e bras 47c54 <_Thread_queue_Enqueue_priority+0x7c> search_priority = search_thread->current_priority; 47c36: 2629 0014 movel %a1@(20),%d3 if ( priority <= search_priority ) 47c3a: b680 cmpl %d0,%d3 47c3c: 641a bccs 47c58 <_Thread_queue_Enqueue_priority+0x80> break; search_priority = search_thread->current_priority; if ( priority <= search_priority ) break; #endif _ISR_Flash( level ); 47c3e: 2c0b movel %a3,%d6 47c40: 46c1 movew %d1,%sr 47c42: 8c81 orl %d1,%d6 47c44: 46c6 movew %d6,%sr RTEMS_INLINE_ROUTINE bool _States_Are_set ( States_Control the_states, States_Control mask ) { return ( (the_states & mask) != STATES_READY); 47c46: 2c04 movel %d4,%d6 47c48: cca9 0010 andl %a1@(16),%d6 if ( !_States_Are_set( search_thread->current_state, block_state) ) { 47c4c: 6604 bnes 47c52 <_Thread_queue_Enqueue_priority+0x7a><== ALWAYS TAKEN _ISR_Enable( level ); 47c4e: 46c1 movew %d1,%sr <== NOT EXECUTED goto restart_forward_search; 47c50: 60d2 bras 47c24 <_Thread_queue_Enqueue_priority+0x4c><== NOT EXECUTED } search_thread = (Thread_Control *)search_thread->Object.Node.next; 47c52: 2251 moveal %a1@,%a1 restart_forward_search: search_priority = PRIORITY_MINIMUM - 1; _ISR_Disable( level ); search_thread = (Thread_Control *) header->first; while ( !_Chain_Is_tail( header, (Chain_Node *)search_thread ) ) { 47c54: b9c9 cmpal %a1,%a4 47c56: 66de bnes 47c36 <_Thread_queue_Enqueue_priority+0x5e> } search_thread = (Thread_Control *)search_thread->Object.Node.next; } if ( the_thread_queue->sync_state != 47c58: 7801 moveq #1,%d4 47c5a: b8aa 0030 cmpl %a2@(48),%d4 47c5e: 6600 00ae bnew 47d0e <_Thread_queue_Enqueue_priority+0x136> THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 47c62: 42aa 0030 clrl %a2@(48) if ( priority == search_priority ) 47c66: b680 cmpl %d0,%d3 47c68: 6700 0088 beqw 47cf2 <_Thread_queue_Enqueue_priority+0x11a> goto equal_priority; search_node = (Chain_Node *) search_thread; previous_node = search_node->previous; 47c6c: 2669 0004 moveal %a1@(4),%a3 the_node = (Chain_Node *) the_thread; the_node->next = search_node; 47c70: 2089 movel %a1,%a0@ the_node->previous = previous_node; 47c72: 214b 0004 movel %a3,%a0@(4) previous_node->next = the_node; 47c76: 2688 movel %a0,%a3@ search_node->previous = the_node; 47c78: 2348 0004 movel %a0,%a1@(4) the_thread->Wait.queue = the_thread_queue; 47c7c: 214a 0044 movel %a2,%a0@(68) _ISR_Enable( level ); 47c80: 46c1 movew %d1,%sr 47c82: 606a bras 47cee <_Thread_queue_Enqueue_priority+0x116> return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); 47c84: 2a3c 0000 0700 movel #1792,%d5 search_thread = (Thread_Control *) header->last; 47c8a: 49eb 0008 lea %a3@(8),%a4 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 47c8e: 4283 clrl %d3 47c90: 1639 0005 c152 moveb 5c152 ,%d3 _ISR_Disable( level ); 47c96: 2405 movel %d5,%d2 the_thread->Wait.queue = the_thread_queue; _ISR_Enable( level ); return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; 47c98: 5283 addql #1,%d3 _ISR_Disable( level ); 47c9a: 40c1 movew %sr,%d1 47c9c: 8481 orl %d1,%d2 47c9e: 46c2 movew %d2,%sr 47ca0: 2401 movel %d1,%d2 search_thread = (Thread_Control *) header->last; 47ca2: 2254 moveal %a4@,%a1 while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 47ca4: 6020 bras 47cc6 <_Thread_queue_Enqueue_priority+0xee> search_priority = search_thread->current_priority; 47ca6: 2629 0014 movel %a1@(20),%d3 if ( priority >= search_priority ) 47caa: b680 cmpl %d0,%d3 47cac: 631c blss 47cca <_Thread_queue_Enqueue_priority+0xf2> break; search_priority = search_thread->current_priority; if ( priority >= search_priority ) break; #endif _ISR_Flash( level ); 47cae: 2c05 movel %d5,%d6 47cb0: 46c1 movew %d1,%sr 47cb2: 8c81 orl %d1,%d6 47cb4: 46c6 movew %d6,%sr 47cb6: 2c04 movel %d4,%d6 47cb8: cca9 0010 andl %a1@(16),%d6 if ( !_States_Are_set( search_thread->current_state, block_state) ) { 47cbc: 6604 bnes 47cc2 <_Thread_queue_Enqueue_priority+0xea> _ISR_Enable( level ); 47cbe: 46c1 movew %d1,%sr goto restart_reverse_search; 47cc0: 60cc bras 47c8e <_Thread_queue_Enqueue_priority+0xb6> } search_thread = (Thread_Control *) search_thread->Object.Node.previous; 47cc2: 2269 0004 moveal %a1@(4),%a1 restart_reverse_search: search_priority = PRIORITY_MAXIMUM + 1; _ISR_Disable( level ); search_thread = (Thread_Control *) header->last; while ( !_Chain_Is_head( header, (Chain_Node *)search_thread ) ) { 47cc6: b7c9 cmpal %a1,%a3 47cc8: 66dc bnes 47ca6 <_Thread_queue_Enqueue_priority+0xce> } search_thread = (Thread_Control *) search_thread->Object.Node.previous; } if ( the_thread_queue->sync_state != 47cca: 7801 moveq #1,%d4 47ccc: b8aa 0030 cmpl %a2@(48),%d4 47cd0: 663c bnes 47d0e <_Thread_queue_Enqueue_priority+0x136> THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) goto synchronize; the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_SYNCHRONIZED; 47cd2: 42aa 0030 clrl %a2@(48) if ( priority == search_priority ) 47cd6: b680 cmpl %d0,%d3 47cd8: 6718 beqs 47cf2 <_Thread_queue_Enqueue_priority+0x11a> goto equal_priority; search_node = (Chain_Node *) search_thread; next_node = search_node->next; 47cda: 2651 moveal %a1@,%a3 the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; 47cdc: 2149 0004 movel %a1,%a0@(4) search_node = (Chain_Node *) search_thread; next_node = search_node->next; the_node = (Chain_Node *) the_thread; the_node->next = next_node; 47ce0: 208b movel %a3,%a0@ the_node->previous = search_node; search_node->next = the_node; next_node->previous = the_node; 47ce2: 2748 0004 movel %a0,%a3@(4) next_node = search_node->next; the_node = (Chain_Node *) the_thread; the_node->next = next_node; the_node->previous = search_node; search_node->next = the_node; 47ce6: 2288 movel %a0,%a1@ next_node->previous = the_node; the_thread->Wait.queue = the_thread_queue; 47ce8: 214a 0044 movel %a2,%a0@(68) _ISR_Enable( level ); 47cec: 46c1 movew %d1,%sr return THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 47cee: 7001 moveq #1,%d0 47cf0: 6026 bras 47d18 <_Thread_queue_Enqueue_priority+0x140> 47cf2: 43e9 003c lea %a1@(60),%a1 equal_priority: /* add at end of priority group */ search_node = _Chain_Tail( &search_thread->Wait.Block2n ); previous_node = search_node->previous; 47cf6: 2669 0004 moveal %a1@(4),%a3 the_node = (Chain_Node *) the_thread; the_node->next = search_node; 47cfa: 2089 movel %a1,%a0@ the_node->previous = previous_node; 47cfc: 214b 0004 movel %a3,%a0@(4) previous_node->next = the_node; 47d00: 2688 movel %a0,%a3@ search_node->previous = the_node; 47d02: 2348 0004 movel %a0,%a1@(4) the_thread->Wait.queue = the_thread_queue; 47d06: 214a 0044 movel %a2,%a0@(68) _ISR_Enable( level ); 47d0a: 46c2 movew %d2,%sr 47d0c: 60e0 bras 47cee <_Thread_queue_Enqueue_priority+0x116> * For example, the blocking thread could have been given * the mutex by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ *level_p = level; 47d0e: 206e 0010 moveal %fp@(16),%a0 return the_thread_queue->sync_state; 47d12: 202a 0030 movel %a2@(48),%d0 * For example, the blocking thread could have been given * the mutex by an ISR or timed out. * * WARNING! Returning with interrupts disabled! */ *level_p = level; 47d16: 2082 movel %d2,%a0@ return the_thread_queue->sync_state; } 47d18: 4cd7 1c7c moveml %sp@,%d2-%d6/%a2-%a4 47d1c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004c8f0 <_Thread_queue_Extract_fifo>: Thread_Control *the_thread ) { ISR_Level level; _ISR_Disable( level ); 4c8f0: 223c 0000 0700 movel #1792,%d1 void _Thread_queue_Extract_fifo( Thread_queue_Control *the_thread_queue __attribute__((unused)), Thread_Control *the_thread ) { 4c8f6: 4e56 0000 linkw %fp,#0 4c8fa: 2f0a movel %a2,%sp@- 4c8fc: 246e 000c moveal %fp@(12),%a2 ISR_Level level; _ISR_Disable( level ); 4c900: 40c0 movew %sr,%d0 4c902: 8280 orl %d0,%d1 4c904: 46c1 movew %d1,%sr 4c906: 222a 0010 movel %a2@(16),%d1 4c90a: 0281 0003 bee0 andil #245472,%d1 if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 4c910: 660a bnes 4c91c <_Thread_queue_Extract_fifo+0x2c> _ISR_Enable( level ); 4c912: 46c0 movew %d0,%sr #if defined(RTEMS_MULTIPROCESSING) if ( !_Objects_Is_local_id( the_thread->Object.id ) ) _Thread_MP_Free_proxy( the_thread ); #endif } 4c914: 246e fffc moveal %fp@(-4),%a2 4c918: 4e5e unlk %fp 4c91a: 4e75 rts ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 4c91c: 2252 moveal %a2@,%a1 _Chain_Extract_unprotected( &the_thread->Object.Node ); the_thread->Wait.queue = NULL; if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 4c91e: 7202 moveq #2,%d1 previous = the_node->previous; 4c920: 206a 0004 moveal %a2@(4),%a0 next->previous = previous; 4c924: 2348 0004 movel %a0,%a1@(4) previous->next = next; 4c928: 2089 movel %a1,%a0@ return; } _Chain_Extract_unprotected( &the_thread->Object.Node ); the_thread->Wait.queue = NULL; 4c92a: 42aa 0044 clrl %a2@(68) if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 4c92e: b2aa 0050 cmpl %a2@(80),%d1 4c932: 6704 beqs 4c938 <_Thread_queue_Extract_fifo+0x48> _ISR_Enable( level ); 4c934: 46c0 movew %d0,%sr 4c936: 6014 bras 4c94c <_Thread_queue_Extract_fifo+0x5c> 4c938: 7203 moveq #3,%d1 4c93a: 2541 0050 movel %d1,%a2@(80) } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 4c93e: 46c0 movew %d0,%sr (void) _Watchdog_Remove( &the_thread->Timer ); 4c940: 486a 0048 pea %a2@(72) 4c944: 4eb9 0004 8754 jsr 48754 <_Watchdog_Remove> 4c94a: 588f addql #4,%sp RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 4c94c: 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 } 4c950: 246e fffc moveal %fp@(-4),%a2 4c954: 203c 1003 fff8 movel #268697592,%d0 4c95a: 2d40 000c movel %d0,%fp@(12) 4c95e: 4e5e unlk %fp 4c960: 4ef9 0004 7314 jmp 47314 <_Thread_Clear_state> ... =============================================================================== 0004b0b4 <_Thread_queue_Process_timeout>: #include void _Thread_queue_Process_timeout( Thread_Control *the_thread ) { 4b0b4: 4e56 0000 linkw %fp,#0 4b0b8: 226e 0008 moveal %fp@(8),%a1 Thread_queue_Control *the_thread_queue = the_thread->Wait.queue; 4b0bc: 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 && 4b0c0: 2028 0030 movel %a0@(48),%d0 4b0c4: 671c beqs 4b0e2 <_Thread_queue_Process_timeout+0x2e> 4b0c6: b3f9 0005 dd9c cmpal 5dd9c <_Per_CPU_Information+0xc>,%a1 4b0cc: 6614 bnes 4b0e2 <_Thread_queue_Process_timeout+0x2e><== NEVER TAKEN _Thread_Is_executing( the_thread ) ) { if ( the_thread_queue->sync_state != THREAD_BLOCKING_OPERATION_SATISFIED ) { 4b0ce: 7203 moveq #3,%d1 4b0d0: b280 cmpl %d0,%d1 4b0d2: 6720 beqs 4b0f4 <_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; 4b0d4: 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; 4b0d6: 2368 003c 0034 movel %a0@(60),%a1@(52) the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 4b0dc: 2140 0030 movel %d0,%a0@(48) 4b0e0: 6012 bras 4b0f4 <_Thread_queue_Process_timeout+0x40> } } else { the_thread->Wait.return_code = the_thread->Wait.queue->timeout_status; 4b0e2: 2368 003c 0034 movel %a0@(60),%a1@(52) _Thread_queue_Extract( the_thread->Wait.queue, the_thread ); 4b0e8: 2f09 movel %a1,%sp@- 4b0ea: 2f08 movel %a0,%sp@- 4b0ec: 4eb9 0004 afb4 jsr 4afb4 <_Thread_queue_Extract> 4b0f2: 508f addql #8,%sp } } 4b0f4: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00047dec <_Thread_queue_Requeue>: void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { 47dec: 4e56 fff0 linkw %fp,#-16 47df0: 48d7 0c04 moveml %d2/%a2-%a3,%sp@ 47df4: 246e 0008 moveal %fp@(8),%a2 47df8: 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 ) 47dfc: 4a8a tstl %a2 47dfe: 6746 beqs 47e46 <_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 ) { 47e00: 7001 moveq #1,%d0 47e02: b0aa 0034 cmpl %a2@(52),%d0 47e06: 663e bnes 47e46 <_Thread_queue_Requeue+0x5a> <== NEVER TAKEN Thread_queue_Control *tq = the_thread_queue; ISR_Level level; ISR_Level level_ignored; _ISR_Disable( level ); 47e08: 303c 0700 movew #1792,%d0 47e0c: 40c2 movew %sr,%d2 47e0e: 8082 orl %d2,%d0 47e10: 46c0 movew %d0,%sr 47e12: 202b 0010 movel %a3@(16),%d0 47e16: 0280 0003 bee0 andil #245472,%d0 if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 47e1c: 6726 beqs 47e44 <_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; 47e1e: 7001 moveq #1,%d0 47e20: 2540 0030 movel %d0,%a2@(48) _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); 47e24: 4878 0001 pea 1 47e28: 2f0b movel %a3,%sp@- 47e2a: 2f0a movel %a2,%sp@- 47e2c: 4eb9 0004 afec jsr 4afec <_Thread_queue_Extract_priority_helper> (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); 47e32: 486e fffc pea %fp@(-4) 47e36: 2f0b movel %a3,%sp@- 47e38: 2f0a movel %a2,%sp@- 47e3a: 4eb9 0004 7bd8 jsr 47bd8 <_Thread_queue_Enqueue_priority> 47e40: 4fef 0018 lea %sp@(24),%sp } _ISR_Enable( level ); 47e44: 46c2 movew %d2,%sr } } 47e46: 4cee 0c04 fff0 moveml %fp@(-16),%d2/%a2-%a3 47e4c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00047e50 <_Thread_queue_Timeout>: void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { 47e50: 4e56 fffc linkw %fp,#-4 Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 47e54: 486e fffc pea %fp@(-4) 47e58: 2f2e 0008 movel %fp@(8),%sp@- 47e5c: 4eb9 0004 76e0 jsr 476e0 <_Thread_Get> switch ( location ) { 47e62: 508f addql #8,%sp 47e64: 4aae fffc tstl %fp@(-4) 47e68: 6618 bnes 47e82 <_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 ); 47e6a: 2f00 movel %d0,%sp@- 47e6c: 4eb9 0004 b0b4 jsr 4b0b4 <_Thread_queue_Process_timeout> */ RTEMS_INLINE_ROUTINE void _Thread_Unnest_dispatch( void ) { RTEMS_COMPILER_MEMORY_BARRIER(); _Thread_Dispatch_disable_level -= 1; 47e72: 588f addql #4,%sp 47e74: 2039 0005 d90c movel 5d90c <_Thread_Dispatch_disable_level>,%d0 47e7a: 5380 subql #1,%d0 47e7c: 23c0 0005 d90c movel %d0,5d90c <_Thread_Dispatch_disable_level> _Thread_Unnest_dispatch(); break; } } 47e82: 4e5e unlk %fp ... =============================================================================== 000521ea <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 521ea: 4e56 ffb4 linkw %fp,#-76 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 521ee: 200e movel %fp,%d0 521f0: 0680 ffff fff4 addil #-12,%d0 521f6: 48d7 3cfc moveml %d2-%d7/%a2-%a5,%sp@ 521fa: 246e 0008 moveal %fp@(8),%a2 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 521fe: 41ea 0008 lea %a2@(8),%a0 52202: 2e0e movel %fp,%d7 52204: 260e movel %fp,%d3 52206: 280e movel %fp,%d4 52208: 5187 subql #8,%d7 5220a: 0683 ffff ffe8 addil #-24,%d3 52210: 0684 ffff ffec addil #-20,%d4 */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 52216: 2c0a movel %a2,%d6 /* * 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 ); 52218: 240a movel %a2,%d2 */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 5221a: 0686 0000 0030 addil #48,%d6 52220: 49f9 0005 6058 lea 56058 <_Watchdog_Adjust_to_chain>,%a4 /* * 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 ); 52226: 0682 0000 0068 addil #104,%d2 } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 5222c: 4bf9 0005 2cdc lea 52cdc <_Chain_Get>,%a5 ) { 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 ); 52232: 47f9 0005 60e8 lea 560e8 <_Watchdog_Insert>,%a3 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 52238: 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 ); 5223c: 41ea 0040 lea %a2@(64),%a0 */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 52240: 2d47 fff4 movel %d7,%fp@(-12) the_chain->permanent_null = NULL; 52244: 42ae fff8 clrl %fp@(-8) { Timer_server_Control *ts = (Timer_server_Control *) arg; Chain_Control insert_chain; Chain_Control fire_chain; _Chain_Initialize_empty( &insert_chain ); 52248: 2d40 fffc movel %d0,%fp@(-4) */ RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { the_chain->first = _Chain_Tail(the_chain); 5224c: 2d44 ffe8 movel %d4,%fp@(-24) the_chain->permanent_null = NULL; 52250: 42ae ffec clrl %fp@(-20) the_chain->last = _Chain_Head(the_chain); 52254: 2d43 fff0 movel %d3,%fp@(-16) static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 52258: 2d48 ffe0 movel %a0,%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; 5225c: 41ee fff4 lea %fp@(-12),%a0 52260: 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; 52264: 2039 0007 65fc movel 765fc <_Watchdog_Ticks_since_boot>,%d0 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 5226a: 222a 003c movel %a2@(60),%d1 watchdogs->last_snapshot = snapshot; 5226e: 2540 003c movel %d0,%a2@(60) _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 52272: 486e ffe8 pea %fp@(-24) 52276: 9081 subl %d1,%d0 52278: 2f00 movel %d0,%sp@- 5227a: 2f06 movel %d6,%sp@- 5227c: 4e94 jsr %a4@ static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 5227e: 2039 0007 655a movel 7655a <_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 ) { 52284: 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; 52288: 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 ) { 5228c: b280 cmpl %d0,%d1 5228e: 6414 bccs 522a4 <_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 ); 52290: 486e ffe8 pea %fp@(-24) 52294: 2a00 movel %d0,%d5 52296: 9a81 subl %d1,%d5 52298: 2f05 movel %d5,%sp@- 5229a: 2d40 ffdc movel %d0,%fp@(-36) 5229e: 2f02 movel %d2,%sp@- 522a0: 4e94 jsr %a4@ 522a2: 6018 bras 522bc <_Timer_server_Body+0xd2> } else if ( snapshot < last_snapshot ) { 522a4: b280 cmpl %d0,%d1 522a6: 631c blss 522c4 <_Timer_server_Body+0xda> /* * 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 ); 522a8: 9280 subl %d0,%d1 522aa: 2f01 movel %d1,%sp@- 522ac: 4878 0001 pea 1 522b0: 2d40 ffdc movel %d0,%fp@(-36) 522b4: 2f02 movel %d2,%sp@- 522b6: 4eb9 0005 5fd8 jsr 55fd8 <_Watchdog_Adjust> 522bc: 202e ffdc movel %fp@(-36),%d0 522c0: 4fef 000c lea %sp@(12),%sp } watchdogs->last_snapshot = snapshot; 522c4: 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 ); 522c8: 202a 0078 movel %a2@(120),%d0 522cc: 2f00 movel %d0,%sp@- 522ce: 4e95 jsr %a5@ if ( timer == NULL ) { 522d0: 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 ); 522d2: 2040 moveal %d0,%a0 if ( timer == NULL ) { 522d4: 4a80 tstl %d0 522d6: 6724 beqs 522fc <_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 ) { 522d8: 2028 0038 movel %a0@(56),%d0 522dc: 7201 moveq #1,%d1 522de: b280 cmpl %d0,%d1 522e0: 6608 bnes 522ea <_Timer_server_Body+0x100> _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 522e2: 4868 0010 pea %a0@(16) 522e6: 2f06 movel %d6,%sp@- 522e8: 600c bras 522f6 <_Timer_server_Body+0x10c> } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 522ea: 7a03 moveq #3,%d5 522ec: ba80 cmpl %d0,%d5 522ee: 66d8 bnes 522c8 <_Timer_server_Body+0xde> <== NEVER TAKEN _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 522f0: 4868 0010 pea %a0@(16) 522f4: 2f02 movel %d2,%sp@- 522f6: 4e93 jsr %a3@ 522f8: 508f addql #8,%sp 522fa: 60cc bras 522c8 <_Timer_server_Body+0xde> * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); 522fc: 203c 0000 0700 movel #1792,%d0 52302: 40c1 movew %sr,%d1 52304: 8081 orl %d1,%d0 52306: 46c0 movew %d0,%sr if ( _Chain_Is_empty( insert_chain ) ) { 52308: beae fff4 cmpl %fp@(-12),%d7 5230c: 6614 bnes 52322 <_Timer_server_Body+0x138> <== NEVER TAKEN ts->insert_chain = NULL; 5230e: 42aa 0078 clrl %a2@(120) _ISR_Enable( level ); 52312: 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 ); 52314: 2a3c 0000 0700 movel #1792,%d5 _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 ) ) { 5231a: b8ae ffe8 cmpl %fp@(-24),%d4 5231e: 6608 bnes 52328 <_Timer_server_Body+0x13e> 52320: 6042 bras 52364 <_Timer_server_Body+0x17a> ts->insert_chain = NULL; _ISR_Enable( level ); break; } else { _ISR_Enable( level ); 52322: 46c1 movew %d1,%sr <== NOT EXECUTED 52324: 6000 ff3e braw 52264 <_Timer_server_Body+0x7a> <== 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 ); 52328: 2205 movel %d5,%d1 5232a: 40c0 movew %sr,%d0 5232c: 8280 orl %d0,%d1 5232e: 46c1 movew %d1,%sr */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 52330: 206e ffe8 moveal %fp@(-24),%a0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 52334: b888 cmpl %a0,%d4 52336: 6726 beqs 5235e <_Timer_server_Body+0x174> { Chain_Node *return_node; Chain_Node *new_first; return_node = the_chain->first; new_first = return_node->next; 52338: 2250 moveal %a0@,%a1 the_chain->first = new_first; 5233a: 2d49 ffe8 movel %a1,%fp@(-24) new_first->previous = _Chain_Head(the_chain); 5233e: 2343 0004 movel %d3,%a1@(4) watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { 52342: 4a88 tstl %a0 52344: 6718 beqs 5235e <_Timer_server_Body+0x174> <== NEVER TAKEN watchdog->state = WATCHDOG_INACTIVE; 52346: 42a8 0008 clrl %a0@(8) _ISR_Enable( level ); 5234a: 46c0 movew %d0,%sr /* * The timer server may block here and wait for resources or time. * The system watchdogs are inactive and will remain inactive since * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); 5234c: 2f28 0024 movel %a0@(36),%sp@- 52350: 2f28 0020 movel %a0@(32),%sp@- 52354: 2068 001c moveal %a0@(28),%a0 52358: 4e90 jsr %a0@ } 5235a: 508f addql #8,%sp 5235c: 60ca bras 52328 <_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 ); 5235e: 46c0 movew %d0,%sr 52360: 6000 fefa braw 5225c <_Timer_server_Body+0x72> * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); } } else { ts->active = false; 52364: 4200 clrb %d0 52366: 1540 007c moveb %d0,%a2@(124) /* * Block until there is something to do. */ _Thread_Disable_dispatch(); 5236a: 4eba fda4 jsr %pc@(52110 <_Thread_Disable_dispatch>) _Thread_Set_state( ts->thread, STATES_DELAYING ); 5236e: 4878 0008 pea 8 52372: 2f12 movel %a2@,%sp@- 52374: 4eb9 0005 57f8 jsr 557f8 <_Thread_Set_state> _Timer_server_Reset_interval_system_watchdog( ts ); 5237a: 2f0a movel %a2,%sp@- 5237c: 4eba fda8 jsr %pc@(52126 <_Timer_server_Reset_interval_system_watchdog>) _Timer_server_Reset_tod_system_watchdog( ts ); 52380: 2f0a movel %a2,%sp@- 52382: 4eba fe02 jsr %pc@(52186 <_Timer_server_Reset_tod_system_watchdog>) _Thread_Enable_dispatch(); 52386: 4eb9 0005 4e8e jsr 54e8e <_Thread_Enable_dispatch> ts->active = true; 5238c: 7201 moveq #1,%d1 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 5238e: 41f9 0005 6204 lea 56204 <_Watchdog_Remove>,%a0 _Thread_Set_state( ts->thread, STATES_DELAYING ); _Timer_server_Reset_interval_system_watchdog( ts ); _Timer_server_Reset_tod_system_watchdog( ts ); _Thread_Enable_dispatch(); ts->active = true; 52394: 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 ); 52398: 2f2e ffe4 movel %fp@(-28),%sp@- 5239c: 2d48 ffdc movel %a0,%fp@(-36) 523a0: 4e90 jsr %a0@ static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 523a2: 2f2e ffe0 movel %fp@(-32),%sp@- 523a6: 206e ffdc moveal %fp@(-36),%a0 523aa: 4e90 jsr %a0@ 523ac: 4fef 0018 lea %sp@(24),%sp 523b0: 6000 feaa braw 5225c <_Timer_server_Body+0x72> =============================================================================== 000523b4 <_Timer_server_Schedule_operation_method>: static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 523b4: 4e56 fff0 linkw %fp,#-16 523b8: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ 523bc: 246e 0008 moveal %fp@(8),%a2 523c0: 266e 000c moveal %fp@(12),%a3 if ( ts->insert_chain == NULL ) { 523c4: 202a 0078 movel %a2@(120),%d0 523c8: 6600 00ea bnew 524b4 <_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(); 523cc: 4eba fd42 jsr %pc@(52110 <_Thread_Disable_dispatch>) if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 523d0: 202b 0038 movel %a3@(56),%d0 523d4: 7201 moveq #1,%d1 523d6: b280 cmpl %d0,%d1 523d8: 665c bnes 52436 <_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 ); 523da: 203c 0000 0700 movel #1792,%d0 523e0: 40c2 movew %sr,%d2 523e2: 8082 orl %d2,%d0 523e4: 46c0 movew %d0,%sr snapshot = _Watchdog_Ticks_since_boot; 523e6: 2039 0007 65fc movel 765fc <_Watchdog_Ticks_since_boot>,%d0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 523ec: 43ea 0034 lea %a2@(52),%a1 last_snapshot = ts->Interval_watchdogs.last_snapshot; 523f0: 222a 003c movel %a2@(60),%d1 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 523f4: 206a 0030 moveal %a2@(48),%a0 if ( !_Chain_Is_empty( &ts->Interval_watchdogs.Chain ) ) { 523f8: b3c8 cmpal %a0,%a1 523fa: 6716 beqs 52412 <_Timer_server_Schedule_operation_method+0x5e> first_watchdog = _Watchdog_First( &ts->Interval_watchdogs.Chain ); /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; 523fc: 2240 moveal %d0,%a1 523fe: 93c1 subal %d1,%a1 delta_interval = first_watchdog->delta_interval; 52400: 2228 0010 movel %a0@(16),%d1 if (delta_interval > delta) { 52404: b3c1 cmpal %d1,%a1 52406: 6404 bccs 5240c <_Timer_server_Schedule_operation_method+0x58> delta_interval -= delta; 52408: 9289 subl %a1,%d1 5240a: 6002 bras 5240e <_Timer_server_Schedule_operation_method+0x5a> } else { delta_interval = 0; 5240c: 4281 clrl %d1 } first_watchdog->delta_interval = delta_interval; 5240e: 2141 0010 movel %d1,%a0@(16) } ts->Interval_watchdogs.last_snapshot = snapshot; 52412: 2540 003c movel %d0,%a2@(60) _ISR_Enable( level ); 52416: 46c2 movew %d2,%sr _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 52418: 486b 0010 pea %a3@(16) 5241c: 486a 0030 pea %a2@(48) 52420: 4eb9 0005 60e8 jsr 560e8 <_Watchdog_Insert> if ( !ts->active ) { 52426: 508f addql #8,%sp 52428: 102a 007c moveb %a2@(124),%d0 5242c: 6678 bnes 524a6 <_Timer_server_Schedule_operation_method+0xf2> _Timer_server_Reset_interval_system_watchdog( ts ); 5242e: 2f0a movel %a2,%sp@- 52430: 4eba fcf4 jsr %pc@(52126 <_Timer_server_Reset_interval_system_watchdog>) 52434: 606e bras 524a4 <_Timer_server_Schedule_operation_method+0xf0> } } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 52436: 7203 moveq #3,%d1 52438: b280 cmpl %d0,%d1 5243a: 666a bnes 524a6 <_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 ); 5243c: 203c 0000 0700 movel #1792,%d0 52442: 40c2 movew %sr,%d2 52444: 8082 orl %d2,%d0 52446: 46c0 movew %d0,%sr */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Tail( Chain_Control *the_chain ) { return (Chain_Node *) &the_chain->permanent_null; 52448: 200a movel %a2,%d0 5244a: 0680 0000 006c addil #108,%d0 snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 52450: 2239 0007 655a movel 7655a <_TOD_Now>,%d1 last_snapshot = ts->TOD_watchdogs.last_snapshot; 52456: 226a 0074 moveal %a2@(116),%a1 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 5245a: 206a 0068 moveal %a2@(104),%a0 if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { 5245e: b088 cmpl %a0,%d0 52460: 6720 beqs 52482 <_Timer_server_Schedule_operation_method+0xce> first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; 52462: 2028 0010 movel %a0@(16),%d0 if ( snapshot > last_snapshot ) { 52466: b3c1 cmpal %d1,%a1 52468: 640c bccs 52476 <_Timer_server_Schedule_operation_method+0xc2> /* * We advanced in time. */ delta = snapshot - last_snapshot; 5246a: 2841 moveal %d1,%a4 5246c: 99c9 subal %a1,%a4 if (delta_interval > delta) { 5246e: b9c0 cmpal %d0,%a4 52470: 640a bccs 5247c <_Timer_server_Schedule_operation_method+0xc8><== NEVER TAKEN delta_interval -= delta; 52472: 908c subl %a4,%d0 52474: 6008 bras 5247e <_Timer_server_Schedule_operation_method+0xca> } } else { /* * Someone put us in the past. */ delta = last_snapshot - snapshot; 52476: d089 addl %a1,%d0 delta_interval += delta; 52478: 9081 subl %d1,%d0 5247a: 6002 bras 5247e <_Timer_server_Schedule_operation_method+0xca> */ delta = snapshot - last_snapshot; if (delta_interval > delta) { delta_interval -= delta; } else { delta_interval = 0; 5247c: 4280 clrl %d0 <== NOT EXECUTED * Someone put us in the past. */ delta = last_snapshot - snapshot; delta_interval += delta; } first_watchdog->delta_interval = delta_interval; 5247e: 2140 0010 movel %d0,%a0@(16) } ts->TOD_watchdogs.last_snapshot = snapshot; 52482: 2541 0074 movel %d1,%a2@(116) _ISR_Enable( level ); 52486: 46c2 movew %d2,%sr _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 52488: 486b 0010 pea %a3@(16) 5248c: 486a 0068 pea %a2@(104) 52490: 4eb9 0005 60e8 jsr 560e8 <_Watchdog_Insert> if ( !ts->active ) { 52496: 508f addql #8,%sp 52498: 102a 007c moveb %a2@(124),%d0 5249c: 6608 bnes 524a6 <_Timer_server_Schedule_operation_method+0xf2><== NEVER TAKEN _Timer_server_Reset_tod_system_watchdog( ts ); 5249e: 2f0a movel %a2,%sp@- 524a0: 4eba fce4 jsr %pc@(52186 <_Timer_server_Reset_tod_system_watchdog>) 524a4: 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 ); } } 524a6: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 524ac: 4e5e unlk %fp if ( !ts->active ) { _Timer_server_Reset_tod_system_watchdog( ts ); } } _Thread_Enable_dispatch(); 524ae: 4ef9 0005 4e8e jmp 54e8e <_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 ); 524b4: 202a 0078 movel %a2@(120),%d0 524b8: 2d4b 000c movel %a3,%fp@(12) } } 524bc: 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 ); 524c2: 2d40 0008 movel %d0,%fp@(8) } } 524c6: 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 ); 524c8: 4ef9 0005 2c7c jmp 52c7c <_Chain_Append> =============================================================================== 00049bb4 <_Watchdog_Adjust>: Watchdog_Interval units ) { ISR_Level level; _ISR_Disable( level ); 49bb4: 327c 0700 moveaw #1792,%a1 49bb8: 2209 movel %a1,%d1 void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 49bba: 4e56 ffe8 linkw %fp,#-24 49bbe: 48d7 1c1c moveml %d2-%d4/%a2-%a4,%sp@ 49bc2: 266e 0008 moveal %fp@(8),%a3 49bc6: 262e 000c movel %fp@(12),%d3 49bca: 242e 0010 movel %fp@(16),%d2 ISR_Level level; _ISR_Disable( level ); 49bce: 40c0 movew %sr,%d0 49bd0: 8280 orl %d0,%d1 49bd2: 46c1 movew %d1,%sr */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 49bd4: 244b moveal %a3,%a2 49bd6: 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 ) ) { 49bd8: b5c8 cmpal %a0,%a2 49bda: 674c beqs 49c28 <_Watchdog_Adjust+0x74> switch ( direction ) { 49bdc: 4a83 tstl %d3 49bde: 673c beqs 49c1c <_Watchdog_Adjust+0x68> 49be0: 7201 moveq #1,%d1 49be2: b283 cmpl %d3,%d1 49be4: 6642 bnes 49c28 <_Watchdog_Adjust+0x74> <== NEVER TAKEN case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; 49be6: d5a8 0010 addl %d2,%a0@(16) break; 49bea: 603c bras 49c28 <_Watchdog_Adjust+0x74> RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_First( Chain_Control *header ) { return ( (Watchdog_Control *) header->first ); 49bec: 2053 moveal %a3@,%a0 case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { 49bee: 2628 0010 movel %a0@(16),%d3 49bf2: b682 cmpl %d2,%d3 49bf4: 6308 blss 49bfe <_Watchdog_Adjust+0x4a> _Watchdog_First( header )->delta_interval -= units; 49bf6: 9682 subl %d2,%d3 49bf8: 2143 0010 movel %d3,%a0@(16) break; 49bfc: 602a bras 49c28 <_Watchdog_Adjust+0x74> } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; 49bfe: 7201 moveq #1,%d1 49c00: 2141 0010 movel %d1,%a0@(16) _ISR_Enable( level ); 49c04: 46c0 movew %d0,%sr _Watchdog_Tickle( header ); 49c06: 2f0b movel %a3,%sp@- 49c08: 4e94 jsr %a4@ _ISR_Disable( level ); 49c0a: 2204 movel %d4,%d1 49c0c: 40c0 movew %sr,%d0 49c0e: 8280 orl %d0,%d1 49c10: 46c1 movew %d1,%sr if ( _Chain_Is_empty( header ) ) 49c12: 588f addql #4,%sp 49c14: b5d3 cmpal %a3@,%a2 49c16: 6710 beqs 49c28 <_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; 49c18: 9483 subl %d3,%d2 49c1a: 6008 bras 49c24 <_Watchdog_Adjust+0x70> _Watchdog_First( header )->delta_interval = 1; _ISR_Enable( level ); _Watchdog_Tickle( header ); 49c1c: 49f9 0004 9dcc lea 49dcc <_Watchdog_Tickle>,%a4 _ISR_Disable( level ); 49c22: 2809 movel %a1,%d4 switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 49c24: 4a82 tstl %d2 49c26: 66c4 bnes 49bec <_Watchdog_Adjust+0x38> <== ALWAYS TAKEN } break; } } _ISR_Enable( level ); 49c28: 46c0 movew %d0,%sr } 49c2a: 4cee 1c1c ffe8 moveml %fp@(-24),%d2-%d4/%a2-%a4 49c30: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00048754 <_Watchdog_Remove>: { ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 48754: 203c 0000 0700 movel #1792,%d0 */ Watchdog_States _Watchdog_Remove( Watchdog_Control *the_watchdog ) { 4875a: 4e56 0000 linkw %fp,#0 4875e: 206e 0008 moveal %fp@(8),%a0 48762: 2f0a movel %a2,%sp@- 48764: 2f02 movel %d2,%sp@- ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 48766: 40c1 movew %sr,%d1 48768: 8081 orl %d1,%d0 4876a: 46c0 movew %d0,%sr previous_state = the_watchdog->state; 4876c: 2028 0008 movel %a0@(8),%d0 switch ( previous_state ) { 48770: 7401 moveq #1,%d2 48772: b480 cmpl %d0,%d2 48774: 670c beqs 48782 <_Watchdog_Remove+0x2e> 48776: 6242 bhis 487ba <_Watchdog_Remove+0x66> 48778: 143c 0003 moveb #3,%d2 4877c: b480 cmpl %d0,%d2 4877e: 653a bcss 487ba <_Watchdog_Remove+0x66> <== NEVER TAKEN 48780: 6006 bras 48788 <_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; 48782: 42a8 0008 clrl %a0@(8) break; 48786: 6032 bras 487ba <_Watchdog_Remove+0x66> } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; _ISR_Enable( level ); return( previous_state ); } 48788: 2250 moveal %a0@,%a1 break; case WATCHDOG_ACTIVE: case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; 4878a: 42a8 0008 clrl %a0@(8) next_watchdog = _Watchdog_Next( the_watchdog ); if ( _Watchdog_Next(next_watchdog) ) 4878e: 4a91 tstl %a1@ 48790: 6708 beqs 4879a <_Watchdog_Remove+0x46> next_watchdog->delta_interval += the_watchdog->delta_interval; 48792: 2428 0010 movel %a0@(16),%d2 48796: d5a9 0010 addl %d2,%a1@(16) if ( _Watchdog_Sync_count ) 4879a: 2479 0005 da34 moveal 5da34 <_Watchdog_Sync_count>,%a2 487a0: 4a8a tstl %a2 487a2: 670c beqs 487b0 <_Watchdog_Remove+0x5c> _Watchdog_Sync_level = _ISR_Nest_level; 487a4: 45f9 0005 dd98 lea 5dd98 <_Per_CPU_Information+0x8>,%a2 487aa: 23d2 0005 d9b2 movel %a2@,5d9b2 <_Watchdog_Sync_level> { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 487b0: 2468 0004 moveal %a0@(4),%a2 next->previous = previous; 487b4: 234a 0004 movel %a2,%a1@(4) previous->next = next; 487b8: 2489 movel %a1,%a2@ _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 487ba: 2279 0005 da38 moveal 5da38 <_Watchdog_Ticks_since_boot>,%a1 487c0: 2149 0018 movel %a1,%a0@(24) _ISR_Enable( level ); 487c4: 46c1 movew %d1,%sr return( previous_state ); } 487c6: 241f movel %sp@+,%d2 487c8: 245f moveal %sp@+,%a2 487ca: 4e5e unlk %fp ... =============================================================================== 000497ac <_Watchdog_Report_chain>: ) { ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 497ac: 203c 0000 0700 movel #1792,%d0 void _Watchdog_Report_chain( const char *name, Chain_Control *header ) { 497b2: 4e56 ffec linkw %fp,#-20 497b6: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@ 497ba: 242e 0008 movel %fp@(8),%d2 497be: 266e 000c moveal %fp@(12),%a3 ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 497c2: 40c3 movew %sr,%d3 497c4: 8083 orl %d3,%d0 497c6: 46c0 movew %d0,%sr printk( "Watchdog Chain: %s %p\n", name, header ); 497c8: 2f0b movel %a3,%sp@- 497ca: 49f9 0004 3e90 lea 43e90 ,%a4 497d0: 2f02 movel %d2,%sp@- 497d2: 4879 0005 ce92 pea 5ce92 497d8: 4e94 jsr %a4@ */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 497da: 245b moveal %a3@+,%a2 if ( !_Chain_Is_empty( header ) ) { 497dc: 4fef 000c lea %sp@(12),%sp 497e0: b7ca cmpal %a2,%a3 497e2: 6726 beqs 4980a <_Watchdog_Report_chain+0x5e> <== NEVER TAKEN node != _Chain_Tail(header) ; node = node->next ) { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); 497e4: 49f9 0004 9820 lea 49820 <_Watchdog_Report>,%a4 497ea: 2f0a movel %a2,%sp@- 497ec: 42a7 clrl %sp@- 497ee: 4e94 jsr %a4@ _ISR_Disable( level ); printk( "Watchdog Chain: %s %p\n", name, header ); if ( !_Chain_Is_empty( header ) ) { for ( node = header->first ; node != _Chain_Tail(header) ; node = node->next ) 497f0: 2452 moveal %a2@,%a2 Chain_Node *node; _ISR_Disable( level ); printk( "Watchdog Chain: %s %p\n", name, header ); if ( !_Chain_Is_empty( header ) ) { for ( node = header->first ; 497f2: 508f addql #8,%sp 497f4: b7ca cmpal %a2,%a3 497f6: 66f2 bnes 497ea <_Watchdog_Report_chain+0x3e> <== NEVER TAKEN { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); 497f8: 2f02 movel %d2,%sp@- 497fa: 4879 0005 cea9 pea 5cea9 49800: 4eb9 0004 3e90 jsr 43e90 49806: 508f addql #8,%sp 49808: 600a bras 49814 <_Watchdog_Report_chain+0x68> } else { printk( "Chain is empty\n" ); 4980a: 4879 0005 ceb8 pea 5ceb8 49810: 4e94 jsr %a4@ 49812: 588f addql #4,%sp } _ISR_Enable( level ); 49814: 46c3 movew %d3,%sr } 49816: 4cee 1c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a4 4981c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000487d0 <_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 ); 487d0: 203c 0000 0700 movel #1792,%d0 */ void _Watchdog_Tickle( Chain_Control *header ) { 487d6: 4e56 ffe8 linkw %fp,#-24 487da: 48d7 3c0c moveml %d2-%d3/%a2-%a5,%sp@ 487de: 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 ); 487e2: 40c2 movew %sr,%d2 487e4: 8082 orl %d2,%d0 487e6: 46c0 movew %d0,%sr */ RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( Chain_Control *the_chain ) { return (the_chain->first == _Chain_Tail(the_chain)); 487e8: 264c moveal %a4,%a3 487ea: 245b moveal %a3@+,%a2 if ( _Chain_Is_empty( header ) ) 487ec: b7ca cmpal %a2,%a3 487ee: 674c beqs 4883c <_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) { 487f0: 202a 0010 movel %a2@(16),%d0 487f4: 6708 beqs 487fe <_Watchdog_Tickle+0x2e> the_watchdog->delta_interval--; 487f6: 5380 subql #1,%d0 487f8: 2540 0010 movel %d0,%a2@(16) if ( the_watchdog->delta_interval != 0 ) 487fc: 663e bnes 4883c <_Watchdog_Tickle+0x6c> goto leave; } do { watchdog_state = _Watchdog_Remove( the_watchdog ); 487fe: 4bf9 0004 8754 lea 48754 <_Watchdog_Remove>,%a5 case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 48804: 263c 0000 0700 movel #1792,%d3 if ( the_watchdog->delta_interval != 0 ) goto leave; } do { watchdog_state = _Watchdog_Remove( the_watchdog ); 4880a: 2f0a movel %a2,%sp@- 4880c: 4e95 jsr %a5@ _ISR_Enable( level ); 4880e: 46c2 movew %d2,%sr switch( watchdog_state ) { 48810: 7202 moveq #2,%d1 48812: 588f addql #4,%sp 48814: b280 cmpl %d0,%d1 48816: 6610 bnes 48828 <_Watchdog_Tickle+0x58> <== NEVER TAKEN case WATCHDOG_ACTIVE: (*the_watchdog->routine)( 48818: 2f2a 0024 movel %a2@(36),%sp@- 4881c: 2f2a 0020 movel %a2@(32),%sp@- 48820: 206a 001c moveal %a2@(28),%a0 48824: 4e90 jsr %a0@ the_watchdog->id, the_watchdog->user_data ); break; 48826: 508f addql #8,%sp case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 48828: 2003 movel %d3,%d0 4882a: 40c2 movew %sr,%d2 4882c: 8082 orl %d2,%d0 4882e: 46c0 movew %d0,%sr } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); } 48830: 2454 moveal %a4@,%a2 _ISR_Disable( level ); the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); 48832: b7ca cmpal %a2,%a3 48834: 6706 beqs 4883c <_Watchdog_Tickle+0x6c> } _ISR_Disable( level ); the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && 48836: 4aaa 0010 tstl %a2@(16) 4883a: 67ce beqs 4880a <_Watchdog_Tickle+0x3a> (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); 4883c: 46c2 movew %d2,%sr } 4883e: 4cee 3c0c ffe8 moveml %fp@(-24),%d2-%d3/%a2-%a5 48844: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00045600 : int clock_gettime( clockid_t clock_id, struct timespec *tp ) { 45600: 4e56 0000 linkw %fp,#0 45604: 222e 0008 movel %fp@(8),%d1 45608: 202e 000c movel %fp@(12),%d0 4560c: 2f02 movel %d2,%sp@- if ( !tp ) 4560e: 4a80 tstl %d0 45610: 6608 bnes 4561a rtems_set_errno_and_return_minus_one( EINVAL ); 45612: 4eb9 0004 d8a8 jsr 4d8a8 <__errno> 45618: 6042 bras 4565c if ( clock_id == CLOCK_REALTIME ) { 4561a: 7401 moveq #1,%d2 4561c: b481 cmpl %d1,%d2 4561e: 660a bnes 4562a _TOD_Get(tp); 45620: 2f00 movel %d0,%sp@- 45622: 4eb9 0004 726c jsr 4726c <_TOD_Get> 45628: 6014 bras 4563e return 0; } #ifdef CLOCK_MONOTONIC if ( clock_id == CLOCK_MONOTONIC ) { 4562a: 7404 moveq #4,%d2 4562c: b481 cmpl %d1,%d2 4562e: 6706 beqs 45636 <== NEVER TAKEN return 0; } #endif #ifdef _POSIX_CPUTIME if ( clock_id == CLOCK_PROCESS_CPUTIME ) { 45630: 7402 moveq #2,%d2 45632: b481 cmpl %d1,%d2 45634: 660e bnes 45644 _TOD_Get_uptime_as_timespec( tp ); 45636: 2f00 movel %d0,%sp@- 45638: 4eb9 0004 72d8 jsr 472d8 <_TOD_Get_uptime_as_timespec> return 0; 4563e: 588f addql #4,%sp 45640: 4280 clrl %d0 45642: 6020 bras 45664 45644: 41f9 0004 d8a8 lea 4d8a8 <__errno>,%a0 } #endif #ifdef _POSIX_THREAD_CPUTIME if ( clock_id == CLOCK_THREAD_CPUTIME ) 4564a: 7003 moveq #3,%d0 4564c: b081 cmpl %d1,%d0 4564e: 660a bnes 4565a rtems_set_errno_and_return_minus_one( ENOSYS ); 45650: 4e90 jsr %a0@ 45652: 7258 moveq #88,%d1 45654: 2040 moveal %d0,%a0 45656: 2081 movel %d1,%a0@ 45658: 6008 bras 45662 #endif rtems_set_errno_and_return_minus_one( EINVAL ); 4565a: 4e90 jsr %a0@ 4565c: 2040 moveal %d0,%a0 4565e: 7016 moveq #22,%d0 45660: 2080 movel %d0,%a0@ 45662: 70ff moveq #-1,%d0 return 0; } 45664: 242e fffc movel %fp@(-4),%d2 45668: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004566c : int clock_settime( clockid_t clock_id, const struct timespec *tp ) { 4566c: 4e56 0000 linkw %fp,#0 45670: 222e 0008 movel %fp@(8),%d1 45674: 206e 000c moveal %fp@(12),%a0 if ( !tp ) 45678: 4a88 tstl %a0 4567a: 6710 beqs 4568c <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { 4567c: 7001 moveq #1,%d0 4567e: b081 cmpl %d1,%d0 45680: 6634 bnes 456b6 if ( tp->tv_sec < TOD_SECONDS_1970_THROUGH_1988 ) 45682: 203c 21da e4ff movel #567993599,%d0 45688: b090 cmpl %a0@,%d0 4568a: 6508 bcss 45694 rtems_set_errno_and_return_minus_one( EINVAL ); 4568c: 4eb9 0004 d8a8 jsr 4d8a8 <__errno> 45692: 6048 bras 456dc rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 45694: 2039 0005 f5cc movel 5f5cc <_Thread_Dispatch_disable_level>,%d0 4569a: 5280 addql #1,%d0 4569c: 23c0 0005 f5cc movel %d0,5f5cc <_Thread_Dispatch_disable_level> _Thread_Disable_dispatch(); _TOD_Set( tp ); 456a2: 2f08 movel %a0,%sp@- 456a4: 4eb9 0004 7330 jsr 47330 <_TOD_Set> _Thread_Enable_dispatch(); 456aa: 4eb9 0004 843a jsr 4843a <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( ENOSYS ); #endif else rtems_set_errno_and_return_minus_one( EINVAL ); return 0; 456b0: 588f addql #4,%sp 456b2: 4280 clrl %d0 456b4: 602e bras 456e4 _Thread_Disable_dispatch(); _TOD_Set( tp ); _Thread_Enable_dispatch(); } #ifdef _POSIX_CPUTIME else if ( clock_id == CLOCK_PROCESS_CPUTIME ) 456b6: 7002 moveq #2,%d0 456b8: b081 cmpl %d1,%d0 456ba: 6608 bnes 456c4 rtems_set_errno_and_return_minus_one( ENOSYS ); 456bc: 4eb9 0004 d8a8 jsr 4d8a8 <__errno> 456c2: 600e bras 456d2 456c4: 41f9 0004 d8a8 lea 4d8a8 <__errno>,%a0 #endif #ifdef _POSIX_THREAD_CPUTIME else if ( clock_id == CLOCK_THREAD_CPUTIME ) 456ca: 7003 moveq #3,%d0 456cc: b081 cmpl %d1,%d0 456ce: 660a bnes 456da rtems_set_errno_and_return_minus_one( ENOSYS ); 456d0: 4e90 jsr %a0@ 456d2: 2040 moveal %d0,%a0 456d4: 7258 moveq #88,%d1 456d6: 2081 movel %d1,%a0@ 456d8: 6008 bras 456e2 #endif else rtems_set_errno_and_return_minus_one( EINVAL ); 456da: 4e90 jsr %a0@ 456dc: 2040 moveal %d0,%a0 456de: 7016 moveq #22,%d0 456e0: 2080 movel %d0,%a0@ 456e2: 70ff moveq #-1,%d0 return 0; } 456e4: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0005a018 : int killinfo( pid_t pid, int sig, const union sigval *value ) { 5a018: 4e56 ffd0 linkw %fp,#-48 5a01c: 48d7 1cfc moveml %d2-%d7/%a2-%a4,%sp@ 5a020: 242e 000c movel %fp@(12),%d2 5a024: 246e 0010 moveal %fp@(16),%a2 POSIX_signals_Siginfo_node *psiginfo; /* * Only supported for the "calling process" (i.e. this node). */ if ( pid != getpid() ) 5a028: 4eb9 0005 9c54 jsr 59c54 5a02e: b0ae 0008 cmpl %fp@(8),%d0 5a032: 6710 beqs 5a044 rtems_set_errno_and_return_minus_one( ESRCH ); 5a034: 4eb9 0004 ca30 jsr 4ca30 <__errno> 5a03a: 7403 moveq #3,%d2 5a03c: 2040 moveal %d0,%a0 5a03e: 2082 movel %d2,%a0@ 5a040: 6000 01aa braw 5a1ec /* * Validate the signal passed. */ if ( !sig ) 5a044: 4a82 tstl %d2 5a046: 670a beqs 5a052 static inline bool is_valid_signo( int signo ) { return ((signo) >= 1 && (signo) <= 32 ); 5a048: 2202 movel %d2,%d1 5a04a: 5381 subql #1,%d1 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 5a04c: 701f moveq #31,%d0 5a04e: b081 cmpl %d1,%d0 5a050: 6410 bccs 5a062 rtems_set_errno_and_return_minus_one( EINVAL ); 5a052: 4eb9 0004 ca30 jsr 4ca30 <__errno> 5a058: 7216 moveq #22,%d1 5a05a: 2040 moveal %d0,%a0 5a05c: 2081 movel %d1,%a0@ 5a05e: 6000 018c braw 5a1ec /* * If the signal is being ignored, then we are out of here. */ if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) 5a062: 2602 movel %d2,%d3 5a064: 2002 movel %d2,%d0 5a066: e58b lsll #2,%d3 5a068: e988 lsll #4,%d0 5a06a: 9083 subl %d3,%d0 5a06c: 0680 0005 ddb2 addil #384434,%d0 5a072: 7601 moveq #1,%d3 5a074: 2040 moveal %d0,%a0 5a076: b690 cmpl %a0@,%d3 5a078: 6700 01a2 beqw 5a21c /* * 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 ) ) 5a07c: 7008 moveq #8,%d0 5a07e: b082 cmpl %d2,%d0 5a080: 6710 beqs 5a092 5a082: 163c 0004 moveb #4,%d3 5a086: b682 cmpl %d2,%d3 5a088: 6708 beqs 5a092 5a08a: 103c 000b moveb #11,%d0 5a08e: b082 cmpl %d2,%d0 5a090: 6616 bnes 5a0a8 return pthread_kill( pthread_self(), sig ); 5a092: 4eb9 0005 a3f0 jsr 5a3f0 5a098: 2f02 movel %d2,%sp@- 5a09a: 2f00 movel %d0,%sp@- 5a09c: 4eb9 0005 a338 jsr 5a338 5a0a2: 508f addql #8,%sp 5a0a4: 6000 0178 braw 5a21e static inline sigset_t signo_to_mask( uint32_t sig ) { return 1u << (sig - 1); 5a0a8: 7601 moveq #1,%d3 /* * Build up a siginfo structure */ siginfo = &siginfo_struct; siginfo->si_signo = sig; siginfo->si_code = SI_USER; 5a0aa: 7001 moveq #1,%d0 5a0ac: e3ab lsll %d1,%d3 /* * Build up a siginfo structure */ siginfo = &siginfo_struct; siginfo->si_signo = sig; 5a0ae: 2d42 fff4 movel %d2,%fp@(-12) siginfo->si_code = SI_USER; 5a0b2: 2d40 fff8 movel %d0,%fp@(-8) if ( !value ) { 5a0b6: 4a8a tstl %a2 5a0b8: 6606 bnes 5a0c0 siginfo->si_value.sival_int = 0; 5a0ba: 42ae fffc clrl %fp@(-4) 5a0be: 6004 bras 5a0c4 } else { siginfo->si_value = *value; 5a0c0: 2d52 fffc movel %a2@,%fp@(-4) 5a0c4: 2039 0005 d90c movel 5d90c <_Thread_Dispatch_disable_level>,%d0 5a0ca: 5280 addql #1,%d0 5a0cc: 23c0 0005 d90c movel %d0,5d90c <_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; 5a0d2: 2279 0005 dd9c moveal 5dd9c <_Per_CPU_Information+0xc>,%a1 api = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( _POSIX_signals_Is_interested( api, mask ) ) { 5a0d8: 2069 010e moveal %a1@(270),%a0 5a0dc: 2028 00cc movel %a0@(204),%d0 5a0e0: 4680 notl %d0 5a0e2: c083 andl %d3,%d0 5a0e4: 6600 00aa bnew 5a190 /* XXX violation of visibility -- need to define thread queue support */ the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = the_chain->first ; 5a0e8: 2079 0005 df36 moveal 5df36 <_POSIX_signals_Wait_queue>,%a0 5a0ee: 601e bras 5a10e #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 5a0f0: 2003 movel %d3,%d0 for ( the_node = the_chain->first ; !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { the_thread = (Thread_Control *)the_node; 5a0f2: 2248 moveal %a0,%a1 #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 5a0f4: c0a8 0030 andl %a0@(48),%d0 for ( the_node = the_chain->first ; !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { the_thread = (Thread_Control *)the_node; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 5a0f8: 2468 010e moveal %a0@(270),%a2 #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 5a0fc: 6600 0092 bnew 5a190 /* * Is this thread is blocked waiting for another signal but has * not blocked this one? */ if (~api->signals_blocked & mask) 5a100: 202a 00cc movel %a2@(204),%d0 5a104: 4680 notl %d0 5a106: c083 andl %d3,%d0 5a108: 6600 0086 bnew 5a190 the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = the_chain->first ; !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { 5a10c: 2050 moveal %a0@,%a0 /* XXX violation of visibility -- need to define thread queue support */ the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = the_chain->first ; 5a10e: b1fc 0005 df3a cmpal #384826,%a0 5a114: 66da bnes 5a0f0 * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 5a116: 4280 clrl %d0 5a118: 1039 0005 c152 moveb 5c152 ,%d0 5a11e: 45f9 0005 d8d0 lea 5d8d0 <_Objects_Information_table+0x8>,%a2 5a124: 5280 addql #1,%d0 * * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; 5a126: 93c9 subal %a1,%a1 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 ] ) 5a128: 205a moveal %a2@+,%a0 5a12a: 4a88 tstl %a0 5a12c: 6756 beqs 5a184 <== NEVER TAKEN continue; the_info = _Objects_Information_table[ the_api ][ 1 ]; 5a12e: 2068 0004 moveal %a0@(4),%a0 */ if ( !the_info ) continue; #endif maximum = the_info->maximum; 5a132: 4287 clrl %d7 object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 5a134: 7801 moveq #1,%d4 */ #define _POSIX_signals_Is_interested( _api, _mask ) \ ( ~(_api)->signals_blocked & (_mask) ) int killinfo( 5a136: 2668 0018 moveal %a0@(24),%a3 5a13a: 588b addql #4,%a3 */ if ( !the_info ) continue; #endif maximum = the_info->maximum; 5a13c: 3e28 000e movew %a0@(14),%d7 object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 5a140: 603e bras 5a180 the_thread = (Thread_Control *) object_table[ index ]; 5a142: 205b moveal %a3@+,%a0 if ( !the_thread ) 5a144: 4a88 tstl %a0 5a146: 6736 beqs 5a17e /* * If this thread is of lower priority than the interested thread, * go on to the next thread. */ if ( the_thread->current_priority > interested_priority ) 5a148: 2228 0014 movel %a0@(20),%d1 5a14c: b081 cmpl %d1,%d0 5a14e: 652e bcss 5a17e #if defined(RTEMS_DEBUG) if ( !api ) continue; #endif if ( !_POSIX_signals_Is_interested( api, mask ) ) 5a150: 2868 010e moveal %a0@(270),%a4 5a154: 2a2c 00cc movel %a4@(204),%d5 5a158: 4685 notl %d5 5a15a: ca83 andl %d3,%d5 5a15c: 6720 beqs 5a17e * * 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 ) { 5a15e: b081 cmpl %d1,%d0 5a160: 6218 bhis 5a17a * and blocking interruptibutable by signal. * * If the interested thread is ready, don't think about changing. */ if ( !_States_Is_ready( interested->current_state ) ) { 5a162: 2c29 0010 movel %a1@(16),%d6 5a166: 6716 beqs 5a17e <== NEVER TAKEN /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 5a168: 2a28 0010 movel %a0@(16),%d5 5a16c: 670c beqs 5a17a continue; } DEBUG_STEP("6"); /* prefer blocked/interruptible over blocked/not interruptible */ if ( !_States_Is_interruptible_by_signal(interested->current_state) ) { 5a16e: 0806 001c btst #28,%d6 5a172: 660a bnes 5a17e DEBUG_STEP("7"); if ( _States_Is_interruptible_by_signal(the_thread->current_state) ) { 5a174: 0805 001c btst #28,%d5 5a178: 6704 beqs 5a17e */ if ( !_States_Is_ready( interested->current_state ) ) { /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 5a17a: 2001 movel %d1,%d0 5a17c: 2248 moveal %a0,%a1 #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 5a17e: 5284 addql #1,%d4 5a180: be84 cmpl %d4,%d7 5a182: 64be bccs 5a142 * + 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++) { 5a184: b5fc 0005 d8d8 cmpal #383192,%a2 5a18a: 669c bnes 5a128 } } } } if ( interested ) { 5a18c: 4a89 tstl %a1 5a18e: 6716 beqs 5a1a6 /* * 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 ) ) { 5a190: 486e fff4 pea %fp@(-12) 5a194: 2f02 movel %d2,%sp@- 5a196: 2f09 movel %a1,%sp@- 5a198: 4eb9 0005 a248 jsr 5a248 <_POSIX_signals_Unblock_thread> 5a19e: 4fef 000c lea %sp@(12),%sp 5a1a2: 4a00 tstb %d0 5a1a4: 6670 bnes 5a216 /* * 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 ); 5a1a6: 2f03 movel %d3,%sp@- if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { 5a1a8: 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 ); 5a1aa: 4eb9 0005 a228 jsr 5a228 <_POSIX_signals_Set_process_signals> if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { 5a1b0: 588f addql #4,%sp 5a1b2: 2002 movel %d2,%d0 5a1b4: 41f9 0005 ddaa lea 5ddaa <_POSIX_signals_Vectors>,%a0 5a1ba: e588 lsll #2,%d0 5a1bc: e98a lsll #4,%d2 5a1be: 9480 subl %d0,%d2 5a1c0: b6b0 2800 cmpl %a0@(00000000,%d2:l),%d3 5a1c4: 6650 bnes 5a216 psiginfo = (POSIX_signals_Siginfo_node *) _Chain_Get( &_POSIX_signals_Inactive_siginfo ); 5a1c6: 4879 0005 df2a pea 5df2a <_POSIX_signals_Inactive_siginfo> 5a1cc: 4eb9 0004 618c jsr 4618c <_Chain_Get> if ( !psiginfo ) { 5a1d2: 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 ); 5a1d4: 2440 moveal %d0,%a2 if ( !psiginfo ) { 5a1d6: 4a80 tstl %d0 5a1d8: 6616 bnes 5a1f0 _Thread_Enable_dispatch(); 5a1da: 4eb9 0004 76ba jsr 476ba <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EAGAIN ); 5a1e0: 4eb9 0004 ca30 jsr 4ca30 <__errno> 5a1e6: 2040 moveal %d0,%a0 5a1e8: 700b moveq #11,%d0 5a1ea: 2080 movel %d0,%a0@ 5a1ec: 70ff moveq #-1,%d0 5a1ee: 602e bras 5a21e } psiginfo->Info = *siginfo; 5a1f0: 4878 000c pea c _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 5a1f4: 0682 0005 dfa2 addil #384930,%d2 if ( !psiginfo ) { _Thread_Enable_dispatch(); rtems_set_errno_and_return_minus_one( EAGAIN ); } psiginfo->Info = *siginfo; 5a1fa: 486e fff4 pea %fp@(-12) 5a1fe: 486a 0008 pea %a2@(8) 5a202: 4eb9 0004 d2dc jsr 4d2dc _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 5a208: 2f0a movel %a2,%sp@- 5a20a: 2f02 movel %d2,%sp@- 5a20c: 4eb9 0004 612c jsr 4612c <_Chain_Append> 5a212: 4fef 0014 lea %sp@(20),%sp } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); 5a216: 4eb9 0004 76ba jsr 476ba <_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; 5a21c: 4280 clrl %d0 } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); return 0; } 5a21e: 4cee 1cfc ffd0 moveml %fp@(-48),%d2-%d7/%a2-%a4 5a224: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000497e4 : int pthread_attr_getinheritsched( const pthread_attr_t *attr, int *inheritsched ) { 497e4: 4e56 0000 linkw %fp,#0 497e8: 206e 0008 moveal %fp@(8),%a0 497ec: 226e 000c moveal %fp@(12),%a1 if ( !attr || !attr->is_initialized || !inheritsched ) 497f0: 4a88 tstl %a0 497f2: 6710 beqs 49804 <== NEVER TAKEN 497f4: 4a90 tstl %a0@ 497f6: 670c beqs 49804 <== NEVER TAKEN 497f8: 4a89 tstl %a1 497fa: 6708 beqs 49804 <== NEVER TAKEN return EINVAL; *inheritsched = attr->inheritsched; 497fc: 22a8 0010 movel %a0@(16),%a1@ return 0; 49800: 4280 clrl %d0 49802: 6002 bras 49806 const pthread_attr_t *attr, int *inheritsched ) { if ( !attr || !attr->is_initialized || !inheritsched ) return EINVAL; 49804: 7016 moveq #22,%d0 *inheritsched = attr->inheritsched; return 0; } 49806: 4e5e unlk %fp ... =============================================================================== 000499a8 : int pthread_attr_setschedpolicy( pthread_attr_t *attr, int policy ) { 499a8: 4e56 0000 linkw %fp,#0 499ac: 206e 0008 moveal %fp@(8),%a0 499b0: 222e 000c movel %fp@(12),%d1 499b4: 2f02 movel %d2,%sp@- if ( !attr || !attr->is_initialized ) 499b6: 4a88 tstl %a0 499b8: 671e beqs 499d8 499ba: 4a90 tstl %a0@ 499bc: 671a beqs 499d8 return EINVAL; switch ( policy ) { 499be: 7004 moveq #4,%d0 499c0: b081 cmpl %d1,%d0 499c2: 6518 bcss 499dc 499c4: 103c 0001 moveb #1,%d0 499c8: 7417 moveq #23,%d2 499ca: e3a8 lsll %d1,%d0 499cc: c082 andl %d2,%d0 499ce: 670c beqs 499dc <== NEVER TAKEN case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: case SCHED_SPORADIC: attr->schedpolicy = policy; 499d0: 2141 0014 movel %d1,%a0@(20) return 0; 499d4: 4280 clrl %d0 499d6: 600a bras 499e2 pthread_attr_t *attr, int policy ) { if ( !attr || !attr->is_initialized ) return EINVAL; 499d8: 7016 moveq #22,%d0 499da: 6006 bras 499e2 case SCHED_SPORADIC: attr->schedpolicy = policy; return 0; default: return ENOTSUP; 499dc: 203c 0000 0086 movel #134,%d0 } } 499e2: 241f movel %sp@+,%d2 499e4: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00045b40 : int pthread_barrier_init( pthread_barrier_t *barrier, const pthread_barrierattr_t *attr, unsigned int count ) { 45b40: 4e56 ffdc linkw %fp,#-36 45b44: 206e 000c moveal %fp@(12),%a0 45b48: 48d7 1c0c moveml %d2-%d3/%a2-%a4,%sp@ 45b4c: 246e 0008 moveal %fp@(8),%a2 45b50: 242e 0010 movel %fp@(16),%d2 const pthread_barrierattr_t *the_attr; /* * Error check parameters */ if ( !barrier ) 45b54: 4a8a tstl %a2 45b56: 6700 008e beqw 45be6 return EINVAL; if ( count == 0 ) 45b5a: 4a82 tstl %d2 45b5c: 6700 0088 beqw 45be6 return EINVAL; /* * If the user passed in NULL, use the default attributes */ if ( attr ) { 45b60: 4a88 tstl %a0 45b62: 6614 bnes 45b78 the_attr = attr; } else { (void) pthread_barrierattr_init( &my_attr ); 45b64: 260e movel %fp,%d3 45b66: 0683 ffff fff0 addil #-16,%d3 45b6c: 2f03 movel %d3,%sp@- 45b6e: 4eb9 0004 5a84 jsr 45a84 45b74: 588f addql #4,%sp the_attr = &my_attr; 45b76: 2043 moveal %d3,%a0 } /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) 45b78: 4a90 tstl %a0@ 45b7a: 676a beqs 45be6 return EINVAL; switch ( the_attr->process_shared ) { 45b7c: 4aa8 0004 tstl %a0@(4) 45b80: 6664 bnes 45be6 <== NEVER TAKEN rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 45b82: 2039 0005 eef0 movel 5eef0 <_Thread_Dispatch_disable_level>,%d0 45b88: 5280 addql #1,%d0 } /* * Convert from POSIX attributes to Core Barrier attributes */ the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE; 45b8a: 42ae fff8 clrl %fp@(-8) the_attributes.maximum_count = count; 45b8e: 2d42 fffc movel %d2,%fp@(-4) 45b92: 23c0 0005 eef0 movel %d0,5eef0 <_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 ); 45b98: 4879 0005 f214 pea 5f214 <_POSIX_Barrier_Information> 45b9e: 49f9 0004 86aa lea 486aa <_Thread_Enable_dispatch>,%a4 45ba4: 4eb9 0004 7a6c jsr 47a6c <_Objects_Allocate> */ _Thread_Disable_dispatch(); /* prevents deletion */ the_barrier = _POSIX_Barrier_Allocate(); if ( !the_barrier ) { 45baa: 588f addql #4,%sp 45bac: 2640 moveal %d0,%a3 45bae: 4a80 tstl %d0 45bb0: 6606 bnes 45bb8 _Thread_Enable_dispatch(); 45bb2: 4e94 jsr %a4@ return EAGAIN; 45bb4: 700b moveq #11,%d0 45bb6: 6030 bras 45be8 } _CORE_barrier_Initialize( &the_barrier->Barrier, &the_attributes ); 45bb8: 486e fff8 pea %fp@(-8) 45bbc: 486b 0010 pea %a3@(16) 45bc0: 4eb9 0004 7154 jsr 47154 <_CORE_barrier_Initialize> uint32_t name ) { _Objects_Set_local_object( information, _Objects_Get_index( the_object->id ), 45bc6: 202b 0008 movel %a3@(8),%d0 Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 45bca: 4281 clrl %d1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 45bcc: 2079 0005 f22c moveal 5f22c <_POSIX_Barrier_Information+0x18>,%a0 Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 45bd2: 3200 movew %d0,%d1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 45bd4: 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; 45bd8: 42ab 000c clrl %a3@(12) ); /* * Exit the critical section and return the user an operational barrier */ *barrier = the_barrier->Object.id; 45bdc: 2480 movel %d0,%a2@ _Thread_Enable_dispatch(); 45bde: 4e94 jsr %a4@ return 0; 45be0: 508f addql #8,%sp 45be2: 4280 clrl %d0 45be4: 6002 bras 45be8 switch ( the_attr->process_shared ) { case PTHREAD_PROCESS_PRIVATE: /* only supported values */ break; case PTHREAD_PROCESS_SHARED: default: return EINVAL; 45be6: 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; } 45be8: 4cee 1c0c ffdc moveml %fp@(-36),%d2-%d3/%a2-%a4 45bee: 4e5e unlk %fp ... =============================================================================== 0004556c : void pthread_cleanup_push( void (*routine)( void * ), void *arg ) { 4556c: 4e56 0000 linkw %fp,#0 45570: 2f03 movel %d3,%sp@- 45572: 262e 000c movel %fp@(12),%d3 45576: 2f02 movel %d2,%sp@- 45578: 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 ) 4557c: 6754 beqs 455d2 <== NEVER TAKEN rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 4557e: 2039 0005 e838 movel 5e838 <_Thread_Dispatch_disable_level>,%d0 45584: 5280 addql #1,%d0 45586: 23c0 0005 e838 movel %d0,5e838 <_Thread_Dispatch_disable_level> return; _Thread_Disable_dispatch(); handler = _Workspace_Allocate( sizeof( POSIX_Cancel_Handler_control ) ); 4558c: 4878 0010 pea 10 45590: 4eb9 0004 939c jsr 4939c <_Workspace_Allocate> if ( handler ) { 45596: 588f addql #4,%sp 45598: 4a80 tstl %d0 4559a: 6726 beqs 455c2 <== NEVER TAKEN thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 4559c: 2079 0005 ecc8 moveal 5ecc8 <_Per_CPU_Information+0xc>,%a0 handler_stack = &thread_support->Cancellation_Handlers; 455a2: 2228 010e movel %a0@(270),%d1 handler->routine = routine; 455a6: 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; 455a8: 0681 0000 00e0 addil #224,%d1 handler->routine = routine; 455ae: 2142 0008 movel %d2,%a0@(8) handler->arg = arg; 455b2: 2143 000c movel %d3,%a0@(12) _Chain_Append( handler_stack, &handler->Node ); 455b6: 2f00 movel %d0,%sp@- 455b8: 2f01 movel %d1,%sp@- 455ba: 4eb9 0004 6bfc jsr 46bfc <_Chain_Append> 455c0: 508f addql #8,%sp } _Thread_Enable_dispatch(); } 455c2: 242e fff8 movel %fp@(-8),%d2 455c6: 262e fffc movel %fp@(-4),%d3 455ca: 4e5e unlk %fp handler->routine = routine; handler->arg = arg; _Chain_Append( handler_stack, &handler->Node ); } _Thread_Enable_dispatch(); 455cc: 4ef9 0004 8116 jmp 48116 <_Thread_Enable_dispatch> } 455d2: 242e fff8 movel %fp@(-8),%d2 455d6: 262e fffc movel %fp@(-4),%d3 455da: 4e5e unlk %fp ... =============================================================================== 00046288 : int pthread_cond_init( pthread_cond_t *cond, const pthread_condattr_t *attr ) { 46288: 4e56 fff4 linkw %fp,#-12 4628c: 48d7 1c00 moveml %a2-%a4,%sp@ 46290: 246e 000c moveal %fp@(12),%a2 POSIX_Condition_variables_Control *the_cond; const pthread_condattr_t *the_attr; if ( attr ) the_attr = attr; 46294: 4a8a tstl %a2 46296: 6606 bnes 4629e else the_attr = &_POSIX_Condition_variables_Default_attributes; 46298: 45f9 0005 d6fa lea 5d6fa <_POSIX_Condition_variables_Default_attributes>,%a2 /* * Be careful about attributes when global!!! */ if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) 4629e: 7001 moveq #1,%d0 462a0: b0aa 0004 cmpl %a2@(4),%d0 462a4: 6776 beqs 4631c <== NEVER TAKEN return EINVAL; if ( !the_attr->is_initialized ) 462a6: 4a92 tstl %a2@ 462a8: 6772 beqs 4631c rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 462aa: 2039 0005 fe0c movel 5fe0c <_Thread_Dispatch_disable_level>,%d0 462b0: 5280 addql #1,%d0 462b2: 23c0 0005 fe0c movel %d0,5fe0c <_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 ); 462b8: 4879 0006 01bc pea 601bc <_POSIX_Condition_variables_Information> 462be: 49f9 0004 92f2 lea 492f2 <_Thread_Enable_dispatch>,%a4 462c4: 4eb9 0004 86b4 jsr 486b4 <_Objects_Allocate> _Thread_Disable_dispatch(); the_cond = _POSIX_Condition_variables_Allocate(); if ( !the_cond ) { 462ca: 588f addql #4,%sp 462cc: 2640 moveal %d0,%a3 462ce: 4a80 tstl %d0 462d0: 6606 bnes 462d8 _Thread_Enable_dispatch(); 462d2: 4e94 jsr %a4@ return ENOMEM; 462d4: 700c moveq #12,%d0 462d6: 6046 bras 4631e } the_cond->process_shared = the_attr->process_shared; 462d8: 276a 0004 0010 movel %a2@(4),%a3@(16) the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX; 462de: 42ab 0014 clrl %a3@(20) /* XXX some more initialization might need to go here */ _Thread_queue_Initialize( 462e2: 4878 0074 pea 74 462e6: 4878 0800 pea 800 462ea: 42a7 clrl %sp@- 462ec: 486b 0018 pea %a3@(24) 462f0: 4eb9 0004 9a18 jsr 49a18 <_Thread_queue_Initialize> uint32_t name ) { _Objects_Set_local_object( information, _Objects_Get_index( the_object->id ), 462f6: 202b 0008 movel %a3@(8),%d0 Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 462fa: 4281 clrl %d1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 462fc: 2079 0006 01d4 moveal 601d4 <_POSIX_Condition_variables_Information+0x18>,%a0 Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 46302: 3200 movew %d0,%d1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 46304: 218b 1c00 movel %a3,%a0@(00000000,%d1:l:4) &_POSIX_Condition_variables_Information, &the_cond->Object, 0 ); *cond = the_cond->Object.id; 46308: 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; 4630c: 42ab 000c clrl %a3@(12) 46310: 2080 movel %d0,%a0@ _Thread_Enable_dispatch(); 46312: 4e94 jsr %a4@ return 0; 46314: 4fef 0010 lea %sp@(16),%sp 46318: 4280 clrl %d0 4631a: 6002 bras 4631e if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) return EINVAL; if ( !the_attr->is_initialized ) return EINVAL; 4631c: 7016 moveq #22,%d0 *cond = the_cond->Object.id; _Thread_Enable_dispatch(); return 0; } 4631e: 4cee 1c00 fff4 moveml %fp@(-12),%a2-%a4 46324: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00046124 : */ int pthread_condattr_destroy( pthread_condattr_t *attr ) { 46124: 4e56 0000 linkw %fp,#0 46128: 206e 0008 moveal %fp@(8),%a0 if ( !attr || attr->is_initialized == false ) 4612c: 4a88 tstl %a0 4612e: 670a beqs 4613a 46130: 4a90 tstl %a0@ 46132: 6706 beqs 4613a <== NEVER TAKEN return EINVAL; attr->is_initialized = false; 46134: 4290 clrl %a0@ return 0; 46136: 4280 clrl %d0 46138: 6002 bras 4613c int pthread_condattr_destroy( pthread_condattr_t *attr ) { if ( !attr || attr->is_initialized == false ) return EINVAL; 4613a: 7016 moveq #22,%d0 attr->is_initialized = false; return 0; } 4613c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004c58c : } void pthread_exit( void *value_ptr ) { 4c58c: 4e56 0000 linkw %fp,#0 _POSIX_Thread_Exit( _Thread_Executing, value_ptr ); 4c590: 2f2e 0008 movel %fp@(8),%sp@- 4c594: 2f39 0005 dd9c movel 5dd9c <_Per_CPU_Information+0xc>,%sp@- 4c59a: 4eb9 0004 c51c jsr 4c51c <_POSIX_Thread_Exit> 4c5a0: 508f addql #8,%sp <== NOT EXECUTED } 4c5a2: 4e5e unlk %fp <== NOT EXECUTED ... =============================================================================== 0004571c : int pthread_key_create( pthread_key_t *key, void (*destructor)( void * ) ) { 4571c: 4e56 ffe4 linkw %fp,#-28 45720: 2039 0005 f64c movel 5f64c <_Thread_Dispatch_disable_level>,%d0 45726: 5280 addql #1,%d0 45728: 48d7 3c1c moveml %d2-%d4/%a2-%a5,%sp@ 4572c: 23c0 0005 f64c movel %d0,5f64c <_Thread_Dispatch_disable_level> * the inactive chain of free keys control blocks. */ RTEMS_INLINE_ROUTINE POSIX_Keys_Control *_POSIX_Keys_Allocate( void ) { return (POSIX_Keys_Control *) _Objects_Allocate( &_POSIX_Keys_Information ); 45732: 4879 0005 f9c2 pea 5f9c2 <_POSIX_Keys_Information> 45738: 4eb9 0004 77ac jsr 477ac <_Objects_Allocate> _Thread_Disable_dispatch(); the_key = _POSIX_Keys_Allocate(); if ( !the_key ) { 4573e: 588f addql #4,%sp 45740: 2440 moveal %d0,%a2 45742: 4a80 tstl %d0 45744: 660c bnes 45752 _Thread_Enable_dispatch(); 45746: 4eb9 0004 83ea jsr 483ea <_Thread_Enable_dispatch> return EAGAIN; 4574c: 700b moveq #11,%d0 4574e: 6000 00b6 braw 45806 } the_key->destructor = destructor; 45752: 49f9 0005 f60c lea 5f60c <_Objects_Information_table+0x4>,%a4 int _EXFUN(pthread_once, (pthread_once_t *__once_control, void (*__init_routine)(void))); /* Thread-Specific Data Key Create, P1003.1c/Draft 10, p. 163 */ int _EXFUN(pthread_key_create, 45758: 47ea 0018 lea %a2@(24),%a3 * APIs are optional. * * NOTE: Currently RTEMS Classic API tasks are always enabled. */ for ( the_api = 1; 4575c: 7401 moveq #1,%d2 INTERNAL_ERROR_IMPLEMENTATION_KEY_CREATE_INCONSISTENCY ); #endif bytes_to_allocate = sizeof( void * ) * (_Objects_Information_table[ the_api ][ 1 ]->maximum + 1); table = _Workspace_Allocate( bytes_to_allocate ); 4575e: 283c 0004 96f0 movel #300784,%d4 _Thread_Enable_dispatch(); return ENOMEM; } the_key->Values[ the_api ] = table; memset( table, '\0', bytes_to_allocate ); 45764: 4bf9 0004 df04 lea 4df04 ,%a5 if ( !the_key ) { _Thread_Enable_dispatch(); return EAGAIN; } the_key->destructor = destructor; 4576a: 256e 000c 0010 movel %fp@(12),%a2@(16) for ( the_api = 1; the_api <= OBJECTS_APIS_LAST; the_api++ ) { if ( _Objects_Information_table[ the_api ] ) { 45770: 205c moveal %a4@+,%a0 45772: 4a88 tstl %a0 45774: 6760 beqs 457d6 <== NEVER TAKEN true, INTERNAL_ERROR_IMPLEMENTATION_KEY_CREATE_INCONSISTENCY ); #endif bytes_to_allocate = sizeof( void * ) * (_Objects_Information_table[ the_api ][ 1 ]->maximum + 1); 45776: 2068 0004 moveal %a0@(4),%a0 4577a: 4283 clrl %d3 4577c: 3628 000e movew %a0@(14),%d3 table = _Workspace_Allocate( bytes_to_allocate ); 45780: 2044 moveal %d4,%a0 true, INTERNAL_ERROR_IMPLEMENTATION_KEY_CREATE_INCONSISTENCY ); #endif bytes_to_allocate = sizeof( void * ) * (_Objects_Information_table[ the_api ][ 1 ]->maximum + 1); 45782: 5283 addql #1,%d3 INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_IMPLEMENTATION_KEY_CREATE_INCONSISTENCY ); #endif bytes_to_allocate = sizeof( void * ) * 45784: e58b lsll #2,%d3 (_Objects_Information_table[ the_api ][ 1 ]->maximum + 1); table = _Workspace_Allocate( bytes_to_allocate ); 45786: 2f03 movel %d3,%sp@- 45788: 4e90 jsr %a0@ if ( !table ) { 4578a: 588f addql #4,%sp 4578c: 4a80 tstl %d0 4578e: 6636 bnes 457c6 for ( --the_api; 45790: 2602 movel %d2,%d3 45792: 5383 subql #1,%d3 the_api >= 1; the_api-- ) _Workspace_Free( the_key->Values[ the_api ] ); 45794: 49f9 0004 970c lea 4970c <_Workspace_Free>,%a4 4579a: 47f2 2c14 lea %a2@(00000014,%d2:l:4),%a3 #endif bytes_to_allocate = sizeof( void * ) * (_Objects_Information_table[ the_api ][ 1 ]->maximum + 1); table = _Workspace_Allocate( bytes_to_allocate ); if ( !table ) { for ( --the_api; 4579e: 6008 bras 457a8 the_api >= 1; the_api-- ) _Workspace_Free( the_key->Values[ the_api ] ); 457a0: 2f23 movel %a3@-,%sp@- (_Objects_Information_table[ the_api ][ 1 ]->maximum + 1); table = _Workspace_Allocate( bytes_to_allocate ); if ( !table ) { for ( --the_api; the_api >= 1; the_api-- ) 457a2: 5383 subql #1,%d3 _Workspace_Free( the_key->Values[ the_api ] ); 457a4: 4e94 jsr %a4@ (_Objects_Information_table[ the_api ][ 1 ]->maximum + 1); table = _Workspace_Allocate( bytes_to_allocate ); if ( !table ) { for ( --the_api; the_api >= 1; the_api-- ) 457a6: 588f addql #4,%sp #endif bytes_to_allocate = sizeof( void * ) * (_Objects_Information_table[ the_api ][ 1 ]->maximum + 1); table = _Workspace_Allocate( bytes_to_allocate ); if ( !table ) { for ( --the_api; 457a8: 4a83 tstl %d3 457aa: 66f4 bnes 457a0 */ RTEMS_INLINE_ROUTINE void _POSIX_Keys_Free ( POSIX_Keys_Control *the_key ) { _Objects_Free( &_POSIX_Keys_Information, &the_key->Object ); 457ac: 2f0a movel %a2,%sp@- 457ae: 4879 0005 f9c2 pea 5f9c2 <_POSIX_Keys_Information> 457b4: 4eb9 0004 7aa0 jsr 47aa0 <_Objects_Free> the_api >= 1; the_api-- ) _Workspace_Free( the_key->Values[ the_api ] ); _POSIX_Keys_Free( the_key ); _Thread_Enable_dispatch(); 457ba: 4eb9 0004 83ea jsr 483ea <_Thread_Enable_dispatch> return ENOMEM; 457c0: 508f addql #8,%sp 457c2: 700c moveq #12,%d0 457c4: 6040 bras 45806 } the_key->Values[ the_api ] = table; 457c6: 2680 movel %d0,%a3@ memset( table, '\0', bytes_to_allocate ); 457c8: 2f03 movel %d3,%sp@- 457ca: 42a7 clrl %sp@- 457cc: 2f00 movel %d0,%sp@- 457ce: 4e95 jsr %a5@ 457d0: 4fef 000c lea %sp@(12),%sp 457d4: 6002 bras 457d8 } else { the_key->Values[ the_api ] = NULL; 457d6: 4293 clrl %a3@ <== NOT EXECUTED * NOTE: Currently RTEMS Classic API tasks are always enabled. */ for ( the_api = 1; the_api <= OBJECTS_APIS_LAST; the_api++ ) { 457d8: 5282 addql #1,%d2 457da: 588b addql #4,%a3 * APIs are optional. * * NOTE: Currently RTEMS Classic API tasks are always enabled. */ for ( the_api = 1; 457dc: 7004 moveq #4,%d0 457de: b082 cmpl %d2,%d0 457e0: 668e bnes 45770 uint32_t name ) { _Objects_Set_local_object( information, _Objects_Get_index( the_object->id ), 457e2: 202a 0008 movel %a2@(8),%d0 Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 457e6: 4281 clrl %d1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 457e8: 2079 0005 f9da moveal 5f9da <_POSIX_Keys_Information+0x18>,%a0 Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 457ee: 3200 movew %d0,%d1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 457f0: 218a 1c00 movel %a2,%a0@(00000000,%d1:l:4) } _Objects_Open_u32( &_POSIX_Keys_Information, &the_key->Object, 0 ); *key = the_key->Object.id; 457f4: 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; 457f8: 42aa 000c clrl %a2@(12) 457fc: 2080 movel %d0,%a0@ _Thread_Enable_dispatch(); 457fe: 4eb9 0004 83ea jsr 483ea <_Thread_Enable_dispatch> return 0; 45804: 4280 clrl %d0 } 45806: 4cee 3c1c ffe4 moveml %fp@(-28),%d2-%d4/%a2-%a5 4580c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00045810 : */ int pthread_key_delete( pthread_key_t key ) { 45810: 4e56 ffec linkw %fp,#-20 45814: 48d7 0c0c moveml %d2-%d3/%a2-%a3,%sp@ pthread_key_t id, Objects_Locations *location ) { return (POSIX_Keys_Control *) _Objects_Get( &_POSIX_Keys_Information, (Objects_Id) id, location ); 45818: 486e fffc pea %fp@(-4) 4581c: 2f2e 0008 movel %fp@(8),%sp@- 45820: 4879 0005 f9c2 pea 5f9c2 <_POSIX_Keys_Information> 45826: 4eb9 0004 7bfc jsr 47bfc <_Objects_Get> register POSIX_Keys_Control *the_key; Objects_Locations location; uint32_t the_api; the_key = _POSIX_Keys_Get( key, &location ); switch ( location ) { 4582c: 4fef 000c lea %sp@(12),%sp 45830: 2400 movel %d0,%d2 45832: 4aae fffc tstl %fp@(-4) 45836: 6646 bnes 4587e case OBJECTS_LOCAL: _Objects_Close( &_POSIX_Keys_Information, &the_key->Object ); 45838: 2f00 movel %d0,%sp@- 4583a: 4879 0005 f9c2 pea 5f9c2 <_POSIX_Keys_Information> (pthread_key_t __key, _CONST void *__value)); void * _EXFUN(pthread_getspecific, (pthread_key_t __key)); /* Thread-Specific Data Key Deletion, P1003.1c/Draft 10, p. 167 */ int _EXFUN(pthread_key_delete, (pthread_key_t __key)); 45840: 2442 moveal %d2,%a2 45842: 45ea 0018 lea %a2@(24),%a2 45846: 7603 moveq #3,%d3 for ( the_api = 1; the_api <= OBJECTS_APIS_LAST; the_api++ ) if ( the_key->Values[ the_api ] ) _Workspace_Free( the_key->Values[ the_api ] ); 45848: 47f9 0004 970c lea 4970c <_Workspace_Free>,%a3 the_key = _POSIX_Keys_Get( key, &location ); switch ( location ) { case OBJECTS_LOCAL: _Objects_Close( &_POSIX_Keys_Information, &the_key->Object ); 4584e: 4eb9 0004 7828 jsr 47828 <_Objects_Close> 45854: 508f addql #8,%sp for ( the_api = 1; the_api <= OBJECTS_APIS_LAST; the_api++ ) if ( the_key->Values[ the_api ] ) 45856: 201a movel %a2@+,%d0 45858: 6706 beqs 45860 <== NEVER TAKEN _Workspace_Free( the_key->Values[ the_api ] ); 4585a: 2f00 movel %d0,%sp@- 4585c: 4e93 jsr %a3@ 4585e: 588f addql #4,%sp 45860: 5383 subql #1,%d3 switch ( location ) { case OBJECTS_LOCAL: _Objects_Close( &_POSIX_Keys_Information, &the_key->Object ); for ( the_api = 1; the_api <= OBJECTS_APIS_LAST; the_api++ ) 45862: 66f2 bnes 45856 */ RTEMS_INLINE_ROUTINE void _POSIX_Keys_Free ( POSIX_Keys_Control *the_key ) { _Objects_Free( &_POSIX_Keys_Information, &the_key->Object ); 45864: 2f02 movel %d2,%sp@- 45866: 4879 0005 f9c2 pea 5f9c2 <_POSIX_Keys_Information> 4586c: 4eb9 0004 7aa0 jsr 47aa0 <_Objects_Free> * NOTE: The destructor is not called and it is the responsibility * of the application to free the memory. */ _POSIX_Keys_Free( the_key ); _Thread_Enable_dispatch(); 45872: 4eb9 0004 83ea jsr 483ea <_Thread_Enable_dispatch> return 0; 45878: 508f addql #8,%sp 4587a: 4280 clrl %d0 4587c: 6002 bras 45880 #endif case OBJECTS_ERROR: break; } return EINVAL; 4587e: 7016 moveq #22,%d0 } 45880: 4cee 0c0c ffec moveml %fp@(-20),%d2-%d3/%a2-%a3 45886: 4e5e unlk %fp ... =============================================================================== 000453b0 : #if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES) int pthread_mutexattr_gettype( const pthread_mutexattr_t *attr, int *type ) { 453b0: 4e56 0000 linkw %fp,#0 453b4: 206e 0008 moveal %fp@(8),%a0 453b8: 226e 000c moveal %fp@(12),%a1 if ( !attr ) 453bc: 4a88 tstl %a0 453be: 6710 beqs 453d0 return EINVAL; if ( !attr->is_initialized ) 453c0: 4a90 tstl %a0@ 453c2: 670c beqs 453d0 return EINVAL; if ( !type ) 453c4: 4a89 tstl %a1 453c6: 6708 beqs 453d0 <== NEVER TAKEN return EINVAL; *type = attr->type; 453c8: 22a8 0010 movel %a0@(16),%a1@ return 0; 453cc: 4280 clrl %d0 453ce: 6002 bras 453d2 if ( !attr->is_initialized ) return EINVAL; if ( !type ) return EINVAL; 453d0: 7016 moveq #22,%d0 *type = attr->type; return 0; } 453d2: 4e5e unlk %fp ... =============================================================================== 00047140 : int pthread_mutexattr_setpshared( pthread_mutexattr_t *attr, int pshared ) { 47140: 4e56 0000 linkw %fp,#0 47144: 206e 0008 moveal %fp@(8),%a0 47148: 202e 000c movel %fp@(12),%d0 if ( !attr || !attr->is_initialized ) 4714c: 4a88 tstl %a0 4714e: 6712 beqs 47162 47150: 4a90 tstl %a0@ 47152: 670e beqs 47162 return EINVAL; switch ( pshared ) { 47154: 7201 moveq #1,%d1 47156: b280 cmpl %d0,%d1 47158: 6508 bcss 47162 <== NEVER TAKEN case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; 4715a: 2140 0004 movel %d0,%a0@(4) return 0; 4715e: 4280 clrl %d0 47160: 6002 bras 47164 default: return EINVAL; 47162: 7016 moveq #22,%d0 } } 47164: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00045404 : #if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES) int pthread_mutexattr_settype( pthread_mutexattr_t *attr, int type ) { 45404: 4e56 0000 linkw %fp,#0 45408: 206e 0008 moveal %fp@(8),%a0 4540c: 202e 000c movel %fp@(12),%d0 if ( !attr || !attr->is_initialized ) 45410: 4a88 tstl %a0 45412: 6712 beqs 45426 45414: 4a90 tstl %a0@ 45416: 670e beqs 45426 <== NEVER TAKEN return EINVAL; switch ( type ) { 45418: 7203 moveq #3,%d1 4541a: b280 cmpl %d0,%d1 4541c: 6508 bcss 45426 case PTHREAD_MUTEX_NORMAL: case PTHREAD_MUTEX_RECURSIVE: case PTHREAD_MUTEX_ERRORCHECK: case PTHREAD_MUTEX_DEFAULT: attr->type = type; 4541e: 2140 0010 movel %d0,%a0@(16) return 0; 45422: 4280 clrl %d0 45424: 6002 bras 45428 default: return EINVAL; 45426: 7016 moveq #22,%d0 } } 45428: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00045e8c : int pthread_once( pthread_once_t *once_control, void (*init_routine)(void) ) { 45e8c: 4e56 fffc linkw %fp,#-4 45e90: 2f0b movel %a3,%sp@- 45e92: 266e 000c moveal %fp@(12),%a3 45e96: 2f0a movel %a2,%sp@- 45e98: 246e 0008 moveal %fp@(8),%a2 if ( !once_control || !init_routine ) 45e9c: 4a8a tstl %a2 45e9e: 674a beqs 45eea 45ea0: 4a8b tstl %a3 45ea2: 6746 beqs 45eea return EINVAL; if ( !once_control->init_executed ) { 45ea4: 4aaa 0004 tstl %a2@(4) 45ea8: 6644 bnes 45eee rtems_mode saveMode; rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode); 45eaa: 486e fffc pea %fp@(-4) 45eae: 4878 0100 pea 100 45eb2: 4878 0100 pea 100 45eb6: 4eb9 0004 6994 jsr 46994 if ( !once_control->init_executed ) { 45ebc: 4fef 000c lea %sp@(12),%sp 45ec0: 4aaa 0004 tstl %a2@(4) 45ec4: 660c bnes 45ed2 <== NEVER TAKEN once_control->is_initialized = true; 45ec6: 7001 moveq #1,%d0 45ec8: 2480 movel %d0,%a2@ once_control->init_executed = true; 45eca: 7001 moveq #1,%d0 45ecc: 2540 0004 movel %d0,%a2@(4) (*init_routine)(); 45ed0: 4e93 jsr %a3@ } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); 45ed2: 486e fffc pea %fp@(-4) 45ed6: 4878 0100 pea 100 45eda: 2f2e fffc movel %fp@(-4),%sp@- 45ede: 4eb9 0004 6994 jsr 46994 45ee4: 4fef 000c lea %sp@(12),%sp 45ee8: 6004 bras 45eee pthread_once_t *once_control, void (*init_routine)(void) ) { if ( !once_control || !init_routine ) return EINVAL; 45eea: 7016 moveq #22,%d0 45eec: 6002 bras 45ef0 once_control->init_executed = true; (*init_routine)(); } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); } return 0; 45eee: 4280 clrl %d0 } 45ef0: 246e fff4 moveal %fp@(-12),%a2 45ef4: 266e fff8 moveal %fp@(-8),%a3 45ef8: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000464c8 : int pthread_rwlock_init( pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr ) { 464c8: 4e56 ffe4 linkw %fp,#-28 464cc: 206e 000c moveal %fp@(12),%a0 464d0: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ 464d4: 246e 0008 moveal %fp@(8),%a2 const pthread_rwlockattr_t *the_attr; /* * Error check parameters */ if ( !rwlock ) 464d8: 4a8a tstl %a2 464da: 677e beqs 4655a return EINVAL; /* * If the user passed in NULL, use the default attributes */ if ( attr ) { 464dc: 4a88 tstl %a0 464de: 6614 bnes 464f4 the_attr = attr; } else { (void) pthread_rwlockattr_init( &default_attr ); 464e0: 240e movel %fp,%d2 464e2: 0682 ffff fff4 addil #-12,%d2 464e8: 2f02 movel %d2,%sp@- 464ea: 4eb9 0004 6dd8 jsr 46dd8 464f0: 588f addql #4,%sp the_attr = &default_attr; 464f2: 2042 moveal %d2,%a0 } /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) 464f4: 4a90 tstl %a0@ 464f6: 6762 beqs 4655a <== NEVER TAKEN return EINVAL; switch ( the_attr->process_shared ) { 464f8: 4aa8 0004 tstl %a0@(4) 464fc: 665c bnes 4655a <== NEVER TAKEN rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 464fe: 2039 0006 0310 movel 60310 <_Thread_Dispatch_disable_level>,%d0 46504: 5280 addql #1,%d0 46506: 23c0 0006 0310 movel %d0,60310 <_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 ); 4650c: 4879 0006 049e pea 6049e <_POSIX_RWLock_Information> 46512: 49f9 0004 954a lea 4954a <_Thread_Enable_dispatch>,%a4 46518: 4eb9 0004 890c jsr 4890c <_Objects_Allocate> */ _Thread_Disable_dispatch(); /* prevents deletion */ the_rwlock = _POSIX_RWLock_Allocate(); if ( !the_rwlock ) { 4651e: 588f addql #4,%sp 46520: 2640 moveal %d0,%a3 46522: 4a80 tstl %d0 46524: 6606 bnes 4652c _Thread_Enable_dispatch(); 46526: 4e94 jsr %a4@ return EAGAIN; 46528: 700b moveq #11,%d0 4652a: 6030 bras 4655c } _CORE_RWLock_Initialize( &the_rwlock->RWLock, &the_attributes ); 4652c: 486e fffc pea %fp@(-4) 46530: 486b 0010 pea %a3@(16) 46534: 4eb9 0004 80ec jsr 480ec <_CORE_RWLock_Initialize> uint32_t name ) { _Objects_Set_local_object( information, _Objects_Get_index( the_object->id ), 4653a: 202b 0008 movel %a3@(8),%d0 Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 4653e: 4281 clrl %d1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 46540: 2079 0006 04b6 moveal 604b6 <_POSIX_RWLock_Information+0x18>,%a0 Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 46546: 3200 movew %d0,%d1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 46548: 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; 4654c: 42ab 000c clrl %a3@(12) &_POSIX_RWLock_Information, &the_rwlock->Object, 0 ); *rwlock = the_rwlock->Object.id; 46550: 2480 movel %d0,%a2@ _Thread_Enable_dispatch(); 46552: 4e94 jsr %a4@ return 0; 46554: 508f addql #8,%sp 46556: 4280 clrl %d0 46558: 6002 bras 4655c switch ( the_attr->process_shared ) { case PTHREAD_PROCESS_PRIVATE: /* only supported values */ break; case PTHREAD_PROCESS_SHARED: default: return EINVAL; 4655a: 7016 moveq #22,%d0 *rwlock = the_rwlock->Object.id; _Thread_Enable_dispatch(); return 0; } 4655c: 4cee 1c04 ffe4 moveml %fp@(-28),%d2/%a2-%a4 46562: 4e5e unlk %fp ... =============================================================================== 000465d0 : int pthread_rwlock_timedrdlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { 465d0: 4e56 ffec linkw %fp,#-20 465d4: 48d7 040c moveml %d2-%d3/%a2,%sp@ 465d8: 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 ) 465dc: 4a8a tstl %a2 465de: 6700 0088 beqw 46668 * * 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 ); 465e2: 486e fff8 pea %fp@(-8) 465e6: 2f2e 000c movel %fp@(12),%sp@- 465ea: 4eb9 0004 c028 jsr 4c028 <_POSIX_Absolute_timeout_to_ticks> 465f0: 486e fffc pea %fp@(-4) 465f4: 2400 movel %d0,%d2 465f6: 2f12 movel %a2@,%sp@- 465f8: 4879 0006 049e pea 6049e <_POSIX_RWLock_Information> 465fe: 4eb9 0004 8d5c jsr 48d5c <_Objects_Get> if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { 46604: 4fef 0014 lea %sp@(20),%sp 46608: 4aae fffc tstl %fp@(-4) 4660c: 665a bnes 46668 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, 4660e: 7203 moveq #3,%d1 46610: b282 cmpl %d2,%d1 46612: 57c3 seq %d3 case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_reading( 46614: 42a7 clrl %sp@- 46616: 2f2e fff8 movel %fp@(-8),%sp@- 4661a: 4483 negl %d3 4661c: 4281 clrl %d1 4661e: 1203 moveb %d3,%d1 46620: 2040 moveal %d0,%a0 46622: 2f01 movel %d1,%sp@- 46624: 2f12 movel %a2@,%sp@- 46626: 4868 0010 pea %a0@(16) 4662a: 4eb9 0004 8120 jsr 48120 <_CORE_RWLock_Obtain_for_reading> do_wait, ticks, NULL ); _Thread_Enable_dispatch(); 46630: 4eb9 0004 954a jsr 4954a <_Thread_Enable_dispatch> if ( !do_wait ) { 46636: 4fef 0014 lea %sp@(20),%sp 4663a: 4a03 tstb %d3 4663c: 6616 bnes 46654 if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) { 4663e: 2079 0006 07a0 moveal 607a0 <_Per_CPU_Information+0xc>,%a0 46644: 7002 moveq #2,%d0 46646: b0a8 0034 cmpl %a0@(52),%d0 4664a: 6608 bnes 46654 switch (status) { 4664c: 4a82 tstl %d2 4664e: 6718 beqs 46668 <== NEVER TAKEN 46650: b082 cmpl %d2,%d0 46652: 6418 bccs 4666c <== ALWAYS TAKEN } } } return _POSIX_RWLock_Translate_core_RWLock_return_code( (CORE_RWLock_Status) _Thread_Executing->Wait.return_code 46654: 2079 0006 07a0 moveal 607a0 <_Per_CPU_Information+0xc>,%a0 break; } } } return _POSIX_RWLock_Translate_core_RWLock_return_code( 4665a: 2f28 0034 movel %a0@(52),%sp@- 4665e: 4eb9 0004 6720 jsr 46720 <_POSIX_RWLock_Translate_core_RWLock_return_code> 46664: 588f addql #4,%sp 46666: 6006 bras 4666e #endif case OBJECTS_ERROR: break; } return EINVAL; 46668: 7016 moveq #22,%d0 4666a: 6002 bras 4666e switch (status) { case POSIX_ABSOLUTE_TIMEOUT_INVALID: return EINVAL; case POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST: case POSIX_ABSOLUTE_TIMEOUT_IS_NOW: return ETIMEDOUT; 4666c: 7074 moveq #116,%d0 case OBJECTS_ERROR: break; } return EINVAL; } 4666e: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 46674: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00046678 : int pthread_rwlock_timedwrlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { 46678: 4e56 ffec linkw %fp,#-20 4667c: 48d7 040c moveml %d2-%d3/%a2,%sp@ 46680: 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 ) 46684: 4a8a tstl %a2 46686: 6700 0088 beqw 46710 * * 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 ); 4668a: 486e fff8 pea %fp@(-8) 4668e: 2f2e 000c movel %fp@(12),%sp@- 46692: 4eb9 0004 c028 jsr 4c028 <_POSIX_Absolute_timeout_to_ticks> 46698: 486e fffc pea %fp@(-4) 4669c: 2400 movel %d0,%d2 4669e: 2f12 movel %a2@,%sp@- 466a0: 4879 0006 049e pea 6049e <_POSIX_RWLock_Information> 466a6: 4eb9 0004 8d5c jsr 48d5c <_Objects_Get> if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { 466ac: 4fef 0014 lea %sp@(20),%sp 466b0: 4aae fffc tstl %fp@(-4) 466b4: 665a bnes 46710 (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, 466b6: 7203 moveq #3,%d1 466b8: b282 cmpl %d2,%d1 466ba: 57c3 seq %d3 case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_writing( 466bc: 42a7 clrl %sp@- 466be: 2f2e fff8 movel %fp@(-8),%sp@- 466c2: 4483 negl %d3 466c4: 4281 clrl %d1 466c6: 1203 moveb %d3,%d1 466c8: 2040 moveal %d0,%a0 466ca: 2f01 movel %d1,%sp@- 466cc: 2f12 movel %a2@,%sp@- 466ce: 4868 0010 pea %a0@(16) 466d2: 4eb9 0004 81d0 jsr 481d0 <_CORE_RWLock_Obtain_for_writing> do_wait, ticks, NULL ); _Thread_Enable_dispatch(); 466d8: 4eb9 0004 954a jsr 4954a <_Thread_Enable_dispatch> if ( !do_wait && 466de: 4fef 0014 lea %sp@(20),%sp 466e2: 4a03 tstb %d3 466e4: 6616 bnes 466fc (_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) { 466e6: 2079 0006 07a0 moveal 607a0 <_Per_CPU_Information+0xc>,%a0 ticks, NULL ); _Thread_Enable_dispatch(); if ( !do_wait && 466ec: 7002 moveq #2,%d0 466ee: b0a8 0034 cmpl %a0@(52),%d0 466f2: 6608 bnes 466fc (_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) { switch (status) { 466f4: 4a82 tstl %d2 466f6: 6718 beqs 46710 <== NEVER TAKEN 466f8: b082 cmpl %d2,%d0 466fa: 6418 bccs 46714 <== ALWAYS TAKEN break; } } return _POSIX_RWLock_Translate_core_RWLock_return_code( (CORE_RWLock_Status) _Thread_Executing->Wait.return_code 466fc: 2079 0006 07a0 moveal 607a0 <_Per_CPU_Information+0xc>,%a0 case POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE: break; } } return _POSIX_RWLock_Translate_core_RWLock_return_code( 46702: 2f28 0034 movel %a0@(52),%sp@- 46706: 4eb9 0004 6720 jsr 46720 <_POSIX_RWLock_Translate_core_RWLock_return_code> 4670c: 588f addql #4,%sp 4670e: 6006 bras 46716 #endif case OBJECTS_ERROR: break; } return EINVAL; 46710: 7016 moveq #22,%d0 46712: 6002 bras 46716 switch (status) { case POSIX_ABSOLUTE_TIMEOUT_INVALID: return EINVAL; case POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST: case POSIX_ABSOLUTE_TIMEOUT_IS_NOW: return ETIMEDOUT; 46714: 7074 moveq #116,%d0 case OBJECTS_ERROR: break; } return EINVAL; } 46716: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 4671c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00046df8 : int pthread_rwlockattr_setpshared( pthread_rwlockattr_t *attr, int pshared ) { 46df8: 4e56 0000 linkw %fp,#0 46dfc: 206e 0008 moveal %fp@(8),%a0 46e00: 202e 000c movel %fp@(12),%d0 if ( !attr ) 46e04: 4a88 tstl %a0 46e06: 6712 beqs 46e1a return EINVAL; if ( !attr->is_initialized ) 46e08: 4a90 tstl %a0@ 46e0a: 670e beqs 46e1a return EINVAL; switch ( pshared ) { 46e0c: 7201 moveq #1,%d1 46e0e: b280 cmpl %d0,%d1 46e10: 6508 bcss 46e1a <== NEVER TAKEN case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; 46e12: 2140 0004 movel %d0,%a0@(4) return 0; 46e16: 4280 clrl %d0 46e18: 6002 bras 46e1c default: return EINVAL; 46e1a: 7016 moveq #22,%d0 } } 46e1c: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000453c8 : int pthread_setcancelstate( int state, int *oldstate ) { 453c8: 4e56 0000 linkw %fp,#0 453cc: 202e 0008 movel %fp@(8),%d0 453d0: 226e 000c moveal %fp@(12),%a1 * Don't even think about deleting a resource from an ISR. * Besides this request is supposed to be for _Thread_Executing * and the ISR context is not a thread. */ if ( _ISR_Is_in_progress() ) 453d4: 4ab9 0005 e40c tstl 5e40c <_Per_CPU_Information+0x8> 453da: 663c bnes 45418 <== NEVER TAKEN return EPROTO; if ( !oldstate ) 453dc: 4a89 tstl %a1 453de: 673c beqs 4541c <== NEVER TAKEN return EINVAL; if ( state != PTHREAD_CANCEL_ENABLE && state != PTHREAD_CANCEL_DISABLE ) 453e0: 7201 moveq #1,%d1 453e2: b280 cmpl %d0,%d1 453e4: 6536 bcss 4541c <== NEVER TAKEN return EINVAL; thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 453e6: 2079 0005 e410 moveal 5e410 <_Per_CPU_Information+0xc>,%a0 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 453ec: 2239 0005 df80 movel 5df80 <_Thread_Dispatch_disable_level>,%d1 453f2: 5281 addql #1,%d1 453f4: 2068 010e moveal %a0@(270),%a0 453f8: 23c1 0005 df80 movel %d1,5df80 <_Thread_Dispatch_disable_level> _Thread_Disable_dispatch(); *oldstate = thread_support->cancelability_state; 453fe: 22a8 00d4 movel %a0@(212),%a1@ thread_support->cancelability_state = state; 45402: 2140 00d4 movel %d0,%a0@(212) _POSIX_Thread_Evaluate_cancellation_and_enable_dispatch(_Thread_Executing); 45406: 2f39 0005 e410 movel 5e410 <_Per_CPU_Information+0xc>,%sp@- 4540c: 4eb9 0004 a03c jsr 4a03c <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch> /* * _Thread_Enable_dispatch is invoked by above call. */ return 0; 45412: 588f addql #4,%sp 45414: 4280 clrl %d0 45416: 6006 bras 4541e * Besides this request is supposed to be for _Thread_Executing * and the ISR context is not a thread. */ if ( _ISR_Is_in_progress() ) return EPROTO; 45418: 7047 moveq #71,%d0 4541a: 6002 bras 4541e if ( !oldstate ) return EINVAL; if ( state != PTHREAD_CANCEL_ENABLE && state != PTHREAD_CANCEL_DISABLE ) return EINVAL; 4541c: 7016 moveq #22,%d0 /* * _Thread_Enable_dispatch is invoked by above call. */ return 0; } 4541e: 4e5e unlk %fp ... =============================================================================== 00047ccc : int pthread_setschedparam( pthread_t thread, int policy, struct sched_param *param ) { 47ccc: 4e56 ffe0 linkw %fp,#-32 47cd0: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 47cd4: 242e 000c movel %fp@(12),%d2 47cd8: 282e 0010 movel %fp@(16),%d4 int rc; /* * Check all the parameters */ if ( !param ) 47cdc: 6700 00e0 beqw 47dbe return EINVAL; rc = _POSIX_Thread_Translate_sched_param( 47ce0: 486e fff8 pea %fp@(-8) 47ce4: 486e fffc pea %fp@(-4) 47ce8: 2f04 movel %d4,%sp@- 47cea: 2f02 movel %d2,%sp@- 47cec: 4eb9 0004 d034 jsr 4d034 <_POSIX_Thread_Translate_sched_param> policy, param, &budget_algorithm, &budget_callout ); if ( rc ) 47cf2: 4fef 0010 lea %sp@(16),%sp * Check all the parameters */ if ( !param ) return EINVAL; rc = _POSIX_Thread_Translate_sched_param( 47cf6: 2600 movel %d0,%d3 policy, param, &budget_algorithm, &budget_callout ); if ( rc ) 47cf8: 6600 00ca bnew 47dc4 47cfc: 486e fff4 pea %fp@(-12) 47d00: 2f2e 0008 movel %fp@(8),%sp@- 47d04: 4879 0006 2614 pea 62614 <_POSIX_Threads_Information> 47d0a: 4eb9 0004 9aa4 jsr 49aa4 <_Objects_Get> /* * Actually change the scheduling policy and parameters */ the_thread = _POSIX_Threads_Get( thread, &location ); switch ( location ) { 47d10: 4fef 000c lea %sp@(12),%sp 47d14: 2640 moveal %d0,%a3 47d16: 4aae fff4 tstl %fp@(-12) 47d1a: 6600 00a6 bnew 47dc2 case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 47d1e: 246b 010e moveal %a3@(270),%a2 if ( api->schedpolicy == SCHED_SPORADIC ) 47d22: 7004 moveq #4,%d0 47d24: b0aa 0080 cmpl %a2@(128),%d0 47d28: 660c bnes 47d36 (void) _Watchdog_Remove( &api->Sporadic_timer ); 47d2a: 486a 00a4 pea %a2@(164) 47d2e: 4eb9 0004 b498 jsr 4b498 <_Watchdog_Remove> 47d34: 588f addql #4,%sp api->schedpolicy = policy; 47d36: 2542 0080 movel %d2,%a2@(128) api->schedparam = *param; 47d3a: 4878 001c pea 1c 47d3e: 2f04 movel %d4,%sp@- 47d40: 486a 0084 pea %a2@(132) 47d44: 4eb9 0004 fd70 jsr 4fd70 the_thread->budget_algorithm = budget_algorithm; 47d4a: 276e fffc 007a movel %fp@(-4),%a3@(122) the_thread->budget_callout = budget_callout; switch ( api->schedpolicy ) { 47d50: 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; 47d54: 276e fff8 007e movel %fp@(-8),%a3@(126) switch ( api->schedpolicy ) { 47d5a: 4a82 tstl %d2 47d5c: 6d58 blts 47db6 <== NEVER TAKEN 47d5e: 7002 moveq #2,%d0 47d60: b082 cmpl %d2,%d0 47d62: 6c0a bges 47d6e 47d64: 103c 0004 moveb #4,%d0 47d68: b082 cmpl %d2,%d0 47d6a: 664a bnes 47db6 <== NEVER TAKEN 47d6c: 602a bras 47d98 47d6e: 4280 clrl %d0 47d70: 1039 0006 0c66 moveb 60c66 ,%d0 case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; 47d76: 41f9 0006 2404 lea 62404 <_Thread_Ticks_per_timeslice>,%a0 47d7c: 90aa 0084 subl %a2@(132),%d0 47d80: 2750 0076 movel %a0@,%a3@(118) the_thread->real_priority = 47d84: 2740 0018 movel %d0,%a3@(24) _POSIX_Priority_To_core( api->schedparam.sched_priority ); _Thread_Change_priority( 47d88: 4878 0001 pea 1 47d8c: 2f00 movel %d0,%sp@- 47d8e: 2f0b movel %a3,%sp@- 47d90: 4eb9 0004 9dac jsr 49dac <_Thread_Change_priority> 47d96: 601a bras 47db2 true ); break; case SCHED_SPORADIC: api->ss_high_priority = api->schedparam.sched_priority; 47d98: 256a 0084 00a0 movel %a2@(132),%a2@(160) _Watchdog_Remove( &api->Sporadic_timer ); 47d9e: 486a 00a4 pea %a2@(164) 47da2: 4eb9 0004 b498 jsr 4b498 <_Watchdog_Remove> _POSIX_Threads_Sporadic_budget_TSR( 0, the_thread ); 47da8: 2f0b movel %a3,%sp@- 47daa: 42a7 clrl %sp@- 47dac: 4eb9 0004 7ba8 jsr 47ba8 <_POSIX_Threads_Sporadic_budget_TSR> break; 47db2: 4fef 000c lea %sp@(12),%sp } _Thread_Enable_dispatch(); 47db6: 4eb9 0004 a292 jsr 4a292 <_Thread_Enable_dispatch> return 0; 47dbc: 6006 bras 47dc4 /* * Check all the parameters */ if ( !param ) return EINVAL; 47dbe: 7616 moveq #22,%d3 47dc0: 6002 bras 47dc4 #endif case OBJECTS_ERROR: break; } return ESRCH; 47dc2: 7603 moveq #3,%d3 } 47dc4: 2003 movel %d3,%d0 47dc6: 4cee 0c1c ffe0 moveml %fp@(-32),%d2-%d4/%a2-%a3 47dcc: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00045c98 : * * 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183 */ void pthread_testcancel( void ) { 45c98: 4e56 0000 linkw %fp,#0 45c9c: 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() ) 45c9e: 4ab9 0005 ecc4 tstl 5ecc4 <_Per_CPU_Information+0x8> 45ca4: 6646 bnes 45cec <== NEVER TAKEN return; thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 45ca6: 2079 0005 ecc8 moveal 5ecc8 <_Per_CPU_Information+0xc>,%a0 45cac: 2039 0005 e838 movel 5e838 <_Thread_Dispatch_disable_level>,%d0 45cb2: 5280 addql #1,%d0 45cb4: 2068 010e moveal %a0@(270),%a0 45cb8: 23c0 0005 e838 movel %d0,5e838 <_Thread_Dispatch_disable_level> _Thread_Disable_dispatch(); if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 45cbe: 4aa8 00d4 tstl %a0@(212) 45cc2: 660a bnes 45cce <== 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)); 45cc4: 4aa8 00dc tstl %a0@(220) 45cc8: 56c2 sne %d2 45cca: 4482 negl %d2 45ccc: 6002 bras 45cd0 */ void pthread_testcancel( void ) { POSIX_API_Control *thread_support; bool cancel = false; 45cce: 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(); 45cd0: 4eb9 0004 8116 jsr 48116 <_Thread_Enable_dispatch> if ( cancel ) 45cd6: 4a02 tstb %d2 45cd8: 6712 beqs 45cec _POSIX_Thread_Exit( _Thread_Executing, PTHREAD_CANCELED ); 45cda: 4878 ffff pea ffffffff 45cde: 2f39 0005 ecc8 movel 5ecc8 <_Per_CPU_Information+0xc>,%sp@- 45ce4: 4eb9 0004 af90 jsr 4af90 <_POSIX_Thread_Exit> 45cea: 508f addql #8,%sp <== NOT EXECUTED } 45cec: 242e fffc movel %fp@(-4),%d2 45cf0: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00045fd0 : rtems_status_code rtems_barrier_wait( rtems_id id, rtems_interval timeout ) { 45fd0: 4e56 fffc linkw %fp,#-4 45fd4: 2f02 movel %d2,%sp@- 45fd6: 486e fffc pea %fp@(-4) 45fda: 242e 0008 movel %fp@(8),%d2 45fde: 2f02 movel %d2,%sp@- 45fe0: 4879 0005 edb8 pea 5edb8 <_Barrier_Information> 45fe6: 4eb9 0004 7df0 jsr 47df0 <_Objects_Get> Barrier_Control *the_barrier; Objects_Locations location; the_barrier = _Barrier_Get( id, &location ); switch ( location ) { 45fec: 4fef 000c lea %sp@(12),%sp 45ff0: 4aae fffc tstl %fp@(-4) 45ff4: 6634 bnes 4602a <== NEVER TAKEN case OBJECTS_LOCAL: _CORE_barrier_Wait( 45ff6: 42a7 clrl %sp@- 45ff8: 2f2e 000c movel %fp@(12),%sp@- 45ffc: 2040 moveal %d0,%a0 45ffe: 4878 0001 pea 1 46002: 2f02 movel %d2,%sp@- 46004: 4868 0014 pea %a0@(20) 46008: 4eb9 0004 70c4 jsr 470c4 <_CORE_barrier_Wait> id, true, timeout, NULL ); _Thread_Enable_dispatch(); 4600e: 4eb9 0004 8652 jsr 48652 <_Thread_Enable_dispatch> return _Barrier_Translate_core_barrier_return_code( _Thread_Executing->Wait.return_code ); 46014: 2079 0005 f344 moveal 5f344 <_Per_CPU_Information+0xc>,%a0 true, timeout, NULL ); _Thread_Enable_dispatch(); return _Barrier_Translate_core_barrier_return_code( 4601a: 2f28 0034 movel %a0@(52),%sp@- 4601e: 4eb9 0004 b52c jsr 4b52c <_Barrier_Translate_core_barrier_return_code> 46024: 4fef 0018 lea %sp@(24),%sp 46028: 6002 bras 4602c #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 4602a: 7004 moveq #4,%d0 } 4602c: 242e fff8 movel %fp@(-8),%d2 46030: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00046040 : */ rtems_status_code rtems_clock_set( rtems_time_of_day *time_buffer ) { 46040: 4e56 fff8 linkw %fp,#-8 46044: 2f0a movel %a2,%sp@- 46046: 246e 0008 moveal %fp@(8),%a2 struct timespec newtime; if ( !time_buffer ) 4604a: 4a8a tstl %a2 4604c: 675a beqs 460a8 <== NEVER TAKEN return RTEMS_INVALID_ADDRESS; if ( _TOD_Validate( time_buffer ) ) { 4604e: 2f0a movel %a2,%sp@- 46050: 4eb9 0004 6190 jsr 46190 <_TOD_Validate> 46056: 588f addql #4,%sp 46058: 4a00 tstb %d0 4605a: 6750 beqs 460ac <== NEVER TAKEN newtime.tv_sec = _TOD_To_seconds( time_buffer ); 4605c: 2f0a movel %a2,%sp@- 4605e: 4eb9 0004 60f4 jsr 460f4 <_TOD_To_seconds> newtime.tv_nsec = time_buffer->ticks * 46064: 41f9 0005 e310 lea 5e310 ,%a0 4606a: 223c 0000 03e8 movel #1000,%d1 if ( !time_buffer ) return RTEMS_INVALID_ADDRESS; if ( _TOD_Validate( time_buffer ) ) { newtime.tv_sec = _TOD_To_seconds( time_buffer ); 46070: 2d40 fff8 movel %d0,%fp@(-8) newtime.tv_nsec = time_buffer->ticks * 46074: 202a 0018 movel %a2@(24),%d0 46078: 4c10 0800 mulsl %a0@,%d0 4607c: 4c00 1800 mulsl %d0,%d1 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 46080: 2039 0006 787c movel 6787c <_Thread_Dispatch_disable_level>,%d0 46086: 5280 addql #1,%d0 46088: 2d41 fffc movel %d1,%fp@(-4) 4608c: 23c0 0006 787c movel %d0,6787c <_Thread_Dispatch_disable_level> rtems_configuration_get_nanoseconds_per_tick(); _Thread_Disable_dispatch(); _TOD_Set( &newtime ); 46092: 486e fff8 pea %fp@(-8) 46096: 4eb9 0004 7828 jsr 47828 <_TOD_Set> _Thread_Enable_dispatch(); 4609c: 4eb9 0004 8a72 jsr 48a72 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 460a2: 508f addql #8,%sp 460a4: 4280 clrl %d0 460a6: 6006 bras 460ae ) { struct timespec newtime; if ( !time_buffer ) return RTEMS_INVALID_ADDRESS; 460a8: 7009 moveq #9,%d0 460aa: 6002 bras 460ae _Thread_Disable_dispatch(); _TOD_Set( &newtime ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } return RTEMS_INVALID_CLOCK; 460ac: 7014 moveq #20,%d0 } 460ae: 246e fff4 moveal %fp@(-12),%a2 460b2: 4e5e unlk %fp ... =============================================================================== 00045da6 : 45da6: 7002 moveq #2,%d0 } void rtems_initialize_start_multitasking(void) { 45da8: 4e56 0000 linkw %fp,#0 ****** APPLICATION RUNS HERE ****** ****** RETURNS WHEN SYSTEM IS SHUT DOWN ****** ******************************************************************* ******************************************************************* *******************************************************************/ } 45dac: 4e5e unlk %fp 45dae: 23c0 0005 da7a movel %d0,5da7a <_System_state_Current> void rtems_initialize_start_multitasking(void) { _System_state_Set( SYSTEM_STATE_BEGIN_MULTITASKING ); _Thread_Start_multitasking(); 45db4: 4ef9 0004 80d8 jmp 480d8 <_Thread_Start_multitasking> ... =============================================================================== 0004c6dc : rtems_status_code rtems_io_close( rtems_device_major_number major, rtems_device_minor_number minor, void *argument ) { 4c6dc: 4e56 0000 linkw %fp,#0 4c6e0: 202e 0008 movel %fp@(8),%d0 4c6e4: 2f03 movel %d3,%sp@- 4c6e6: 2f02 movel %d2,%sp@- rtems_device_driver_entry callout; if ( major >= _IO_Number_of_drivers ) 4c6e8: b0b9 0005 e188 cmpl 5e188 <_IO_Number_of_drivers>,%d0 4c6ee: 6420 bccs 4c710 <== NEVER TAKEN return RTEMS_INVALID_NUMBER; callout = _IO_Driver_address_table[major].close_entry; 4c6f0: 2600 movel %d0,%d3 4c6f2: 2200 movel %d0,%d1 4c6f4: e78b lsll #3,%d3 4c6f6: eb89 lsll #5,%d1 4c6f8: 2279 0005 e18c moveal 5e18c <_IO_Driver_address_table>,%a1 4c6fe: 9283 subl %d3,%d1 4c700: 2271 1808 moveal %a1@(00000008,%d1:l),%a1 return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL; 4c704: 4a89 tstl %a1 4c706: 670c beqs 4c714 } 4c708: 241f movel %sp@+,%d2 4c70a: 261f movel %sp@+,%d3 4c70c: 4e5e unlk %fp if ( major >= _IO_Number_of_drivers ) return RTEMS_INVALID_NUMBER; callout = _IO_Driver_address_table[major].close_entry; return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL; 4c70e: 4ed1 jmp %a1@ ) { rtems_device_driver_entry callout; if ( major >= _IO_Number_of_drivers ) return RTEMS_INVALID_NUMBER; 4c710: 700a moveq #10,%d0 4c712: 6002 bras 4c716 callout = _IO_Driver_address_table[major].close_entry; return callout ? callout(major, minor, argument) : RTEMS_SUCCESSFUL; 4c714: 4280 clrl %d0 } 4c716: 241f movel %sp@+,%d2 4c718: 261f movel %sp@+,%d3 4c71a: 4e5e unlk %fp ... =============================================================================== 00047cf4 : #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) { 47cf4: 4e56 fff0 linkw %fp,#-16 47cf8: 48d7 1c04 moveml %d2/%a2-%a4,%sp@ 47cfc: 286e 0008 moveal %fp@(8),%a4 uint32_t i; uint32_t api_index; Thread_Control *the_thread; Objects_Information *information; if ( !routine ) 47d00: 4a8c tstl %a4 47d02: 673c beqs 47d40 <== NEVER TAKEN 47d04: 45f9 0006 783c lea 6783c <_Objects_Information_table+0x4>,%a2 return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { if ( !_Objects_Information_table[ api_index ] ) 47d0a: 205a moveal %a2@+,%a0 47d0c: 4a88 tstl %a0 47d0e: 6728 beqs 47d38 <== NEVER TAKEN continue; information = _Objects_Information_table[ api_index ][ 1 ]; 47d10: 2668 0004 moveal %a0@(4),%a3 if ( !information ) 47d14: 4a8b tstl %a3 47d16: 6720 beqs 47d38 47d18: 7401 moveq #1,%d2 47d1a: 6012 bras 47d2e continue; for ( i=1 ; i <= information->maximum ; i++ ) { the_thread = (Thread_Control *)information->local_table[ i ]; 47d1c: 206b 0018 moveal %a3@(24),%a0 47d20: 2030 2c00 movel %a0@(00000000,%d2:l:4),%d0 if ( !the_thread ) 47d24: 6706 beqs 47d2c <== NEVER TAKEN continue; (*routine)(the_thread); 47d26: 2f00 movel %d0,%sp@- 47d28: 4e94 jsr %a4@ 47d2a: 588f addql #4,%sp information = _Objects_Information_table[ api_index ][ 1 ]; if ( !information ) continue; for ( i=1 ; i <= information->maximum ; i++ ) { 47d2c: 5282 addql #1,%d2 47d2e: 4280 clrl %d0 47d30: 302b 000e movew %a3@(14),%d0 47d34: b082 cmpl %d2,%d0 47d36: 64e4 bccs 47d1c Objects_Information *information; if ( !routine ) return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { 47d38: b5fc 0006 7848 cmpal #424008,%a2 47d3e: 66ca bnes 47d0a (*routine)(the_thread); } } } 47d40: 4cee 1c04 fff0 moveml %fp@(-16),%d2/%a2-%a4 47d46: 4e5e unlk %fp ... =============================================================================== 0004ffcc : */ rtems_status_code rtems_partition_delete( rtems_id id ) { 4ffcc: 4e56 fffc linkw %fp,#-4 4ffd0: 2f0b movel %a3,%sp@- 4ffd2: 2f0a movel %a2,%sp@- Objects_Id id, Objects_Locations *location ) { return (Partition_Control *) _Objects_Get( &_Partition_Information, id, location ); 4ffd4: 486e fffc pea %fp@(-4) 4ffd8: 2f2e 0008 movel %fp@(8),%sp@- 4ffdc: 4879 0007 6362 pea 76362 <_Partition_Information> 4ffe2: 4eb9 0005 462c jsr 5462c <_Objects_Get> register Partition_Control *the_partition; Objects_Locations location; the_partition = _Partition_Get( id, &location ); switch ( location ) { 4ffe8: 4fef 000c lea %sp@(12),%sp 4ffec: 2440 moveal %d0,%a2 4ffee: 4aae fffc tstl %fp@(-4) 4fff2: 6638 bnes 5002c <== NEVER TAKEN 4fff4: 47f9 0005 4e8e lea 54e8e <_Thread_Enable_dispatch>,%a3 case OBJECTS_LOCAL: if ( the_partition->number_of_used_blocks == 0 ) { 4fffa: 4aaa 0020 tstl %a2@(32) 4fffe: 6626 bnes 50026 _Objects_Close( &_Partition_Information, &the_partition->Object ); 50000: 2f00 movel %d0,%sp@- 50002: 4879 0007 6362 pea 76362 <_Partition_Information> 50008: 4eb9 0005 4220 jsr 54220 <_Objects_Close> */ RTEMS_INLINE_ROUTINE void _Partition_Free ( Partition_Control *the_partition ) { _Objects_Free( &_Partition_Information, &the_partition->Object ); 5000e: 2f0a movel %a2,%sp@- 50010: 4879 0007 6362 pea 76362 <_Partition_Information> 50016: 4eb9 0005 4498 jsr 54498 <_Objects_Free> 0 /* Not used */ ); } #endif _Thread_Enable_dispatch(); 5001c: 4e93 jsr %a3@ return RTEMS_SUCCESSFUL; 5001e: 4fef 0010 lea %sp@(16),%sp 50022: 4280 clrl %d0 50024: 6008 bras 5002e } _Thread_Enable_dispatch(); 50026: 4e93 jsr %a3@ return RTEMS_RESOURCE_IN_USE; 50028: 700c moveq #12,%d0 5002a: 6002 bras 5002e case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 5002c: 7004 moveq #4,%d0 } 5002e: 246e fff4 moveal %fp@(-12),%a2 50032: 266e fff8 moveal %fp@(-8),%a3 50036: 4e5e unlk %fp ... =============================================================================== 000500d0 : rtems_status_code rtems_partition_return_buffer( rtems_id id, void *buffer ) { 500d0: 4e56 fffc linkw %fp,#-4 500d4: 2f0a movel %a2,%sp@- 500d6: 2f02 movel %d2,%sp@- Objects_Id id, Objects_Locations *location ) { return (Partition_Control *) _Objects_Get( &_Partition_Information, id, location ); 500d8: 486e fffc pea %fp@(-4) 500dc: 2f2e 0008 movel %fp@(8),%sp@- 500e0: 4879 0007 6362 pea 76362 <_Partition_Information> 500e6: 242e 000c movel %fp@(12),%d2 500ea: 4eb9 0005 462c jsr 5462c <_Objects_Get> register Partition_Control *the_partition; Objects_Locations location; the_partition = _Partition_Get( id, &location ); switch ( location ) { 500f0: 4fef 000c lea %sp@(12),%sp 500f4: 2440 moveal %d0,%a2 500f6: 4aae fffc tstl %fp@(-4) 500fa: 663e bnes 5013a ) { void *starting; void *ending; starting = the_partition->starting_address; 500fc: 202a 0010 movel %a2@(16),%d0 ending = _Addresses_Add_offset( starting, the_partition->length ); 50100: 222a 0014 movel %a2@(20),%d1 const void *address, const void *base, const void *limit ) { return (address >= base && address <= limit); 50104: b082 cmpl %d2,%d0 50106: 6240 bhis 50148 RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset ( const void *base, uintptr_t offset ) { return (void *)((uintptr_t)base + offset); 50108: d280 addl %d0,%d1 const void *address, const void *base, const void *limit ) { return (address >= base && address <= limit); 5010a: b282 cmpl %d2,%d1 5010c: 653a bcss 50148 <== NEVER TAKEN RTEMS_INLINE_ROUTINE int32_t _Addresses_Subtract ( const void *left, const void *right ) { return (int32_t) ((const char *) left - (const char *) right); 5010e: 2202 movel %d2,%d1 50110: 9280 subl %d0,%d1 50112: 2001 movel %d1,%d0 offset = (uint32_t) _Addresses_Subtract( the_buffer, the_partition->starting_address ); return ((offset % the_partition->buffer_size) == 0); 50114: 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 ) && 5011a: 4a81 tstl %d1 5011c: 662a bnes 50148 RTEMS_INLINE_ROUTINE void _Partition_Free_buffer ( Partition_Control *the_partition, Chain_Node *the_buffer ) { _Chain_Append( &the_partition->Memory, the_buffer ); 5011e: 2f02 movel %d2,%sp@- 50120: 486a 0024 pea %a2@(36) 50124: 4eb9 0005 2c7c jsr 52c7c <_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; 5012a: 53aa 0020 subql #1,%a2@(32) _Thread_Enable_dispatch(); 5012e: 4eb9 0005 4e8e jsr 54e8e <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 50134: 508f addql #8,%sp 50136: 4280 clrl %d0 50138: 6002 bras 5013c case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 5013a: 7004 moveq #4,%d0 } 5013c: 242e fff4 movel %fp@(-12),%d2 50140: 246e fff8 moveal %fp@(-8),%a2 50144: 4e5e unlk %fp 50146: 4e75 rts _Partition_Free_buffer( the_partition, buffer ); the_partition->number_of_used_blocks -= 1; _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } _Thread_Enable_dispatch(); 50148: 4eb9 0005 4e8e jsr 54e8e <_Thread_Enable_dispatch> return RTEMS_INVALID_ADDRESS; 5014e: 7009 moveq #9,%d0 50150: 60ea bras 5013c ... =============================================================================== 0004be30 : rtems_status_code rtems_rate_monotonic_get_status( rtems_id id, rtems_rate_monotonic_period_status *status ) { 4be30: 4e56 ffec linkw %fp,#-20 4be34: 2f0a movel %a2,%sp@- 4be36: 246e 000c moveal %fp@(12),%a2 Objects_Locations location; Rate_monotonic_Period_time_t since_last_period; Rate_monotonic_Control *the_period; bool valid_status; if ( !status ) 4be3a: 4a8a tstl %a2 4be3c: 6700 0092 beqw 4bed0 4be40: 486e fffc pea %fp@(-4) 4be44: 2f2e 0008 movel %fp@(8),%sp@- 4be48: 4879 0005 f49c pea 5f49c <_Rate_monotonic_Information> 4be4e: 4eb9 0004 8498 jsr 48498 <_Objects_Get> return RTEMS_INVALID_ADDRESS; the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 4be54: 4fef 000c lea %sp@(12),%sp 4be58: 2040 moveal %d0,%a0 4be5a: 4aae fffc tstl %fp@(-4) 4be5e: 6674 bnes 4bed4 <== NEVER TAKEN case OBJECTS_LOCAL: status->owner = the_period->owner->Object.id; 4be60: 2268 0040 moveal %a0@(64),%a1 4be64: 24a9 0008 movel %a1@(8),%a2@ status->state = the_period->state; 4be68: 2028 0038 movel %a0@(56),%d0 4be6c: 2540 0004 movel %d0,%a2@(4) /* * If the period is inactive, there is no information. */ if ( status->state == RATE_MONOTONIC_INACTIVE ) { 4be70: 6612 bnes 4be84 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timespec_Set_to_zero( &status->since_last_period ); 4be72: 42aa 0008 clrl %a2@(8) 4be76: 42aa 000c clrl %a2@(12) _Timespec_Set_to_zero( &status->executed_since_last_period ); 4be7a: 42aa 0010 clrl %a2@(16) 4be7e: 42aa 0014 clrl %a2@(20) 4be82: 6042 bras 4bec6 } else { /* * Grab the current status. */ valid_status = 4be84: 486e fff4 pea %fp@(-12) 4be88: 486e ffec pea %fp@(-20) 4be8c: 2f08 movel %a0,%sp@- 4be8e: 4eb9 0004 62b0 jsr 462b0 <_Rate_monotonic_Get_status> _Rate_monotonic_Get_status( the_period, &since_last_period, &executed ); if (!valid_status) { 4be94: 4fef 000c lea %sp@(12),%sp 4be98: 4a00 tstb %d0 4be9a: 660a bnes 4bea6 _Thread_Enable_dispatch(); 4be9c: 4eb9 0004 8cfa jsr 48cfa <_Thread_Enable_dispatch> return RTEMS_NOT_DEFINED; 4bea2: 700b moveq #11,%d0 4bea4: 6030 bras 4bed6 } #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_To_timespec( 4bea6: 202e ffec movel %fp@(-20),%d0 4beaa: 222e fff0 movel %fp@(-16),%d1 4beae: 2540 0008 movel %d0,%a2@(8) 4beb2: 2541 000c movel %d1,%a2@(12) &since_last_period, &status->since_last_period ); _Timestamp_To_timespec( 4beb6: 202e fff4 movel %fp@(-12),%d0 4beba: 222e fff8 movel %fp@(-8),%d1 4bebe: 2540 0010 movel %d0,%a2@(16) 4bec2: 2541 0014 movel %d1,%a2@(20) status->since_last_period = since_last_period; status->executed_since_last_period = executed; #endif } _Thread_Enable_dispatch(); 4bec6: 4eb9 0004 8cfa jsr 48cfa <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 4becc: 4280 clrl %d0 4bece: 6006 bras 4bed6 Rate_monotonic_Period_time_t since_last_period; Rate_monotonic_Control *the_period; bool valid_status; if ( !status ) return RTEMS_INVALID_ADDRESS; 4bed0: 7009 moveq #9,%d0 4bed2: 6002 bras 4bed6 #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 4bed4: 7004 moveq #4,%d0 } 4bed6: 246e ffe8 moveal %fp@(-24),%a2 4beda: 4e5e unlk %fp ... =============================================================================== 000464ba : rtems_status_code rtems_rate_monotonic_period( rtems_id id, rtems_interval length ) { 464ba: 4e56 ffec linkw %fp,#-20 464be: 48d7 041c moveml %d2-%d4/%a2,%sp@ Objects_Id id, Objects_Locations *location ) { return (Rate_monotonic_Control *) _Objects_Get( &_Rate_monotonic_Information, id, location ); 464c2: 486e fffc pea %fp@(-4) 464c6: 262e 0008 movel %fp@(8),%d3 464ca: 2f03 movel %d3,%sp@- 464cc: 4879 0005 f49c pea 5f49c <_Rate_monotonic_Information> 464d2: 242e 000c movel %fp@(12),%d2 464d6: 4eb9 0004 8498 jsr 48498 <_Objects_Get> rtems_rate_monotonic_period_states local_state; ISR_Level level; the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 464dc: 4fef 000c lea %sp@(12),%sp 464e0: 2440 moveal %d0,%a2 464e2: 4aae fffc tstl %fp@(-4) 464e6: 6600 0150 bnew 46638 case OBJECTS_LOCAL: if ( !_Thread_Is_executing( the_period->owner ) ) { 464ea: 2039 0005 fa28 movel 5fa28 <_Per_CPU_Information+0xc>,%d0 464f0: b0aa 0040 cmpl %a2@(64),%d0 464f4: 670c beqs 46502 _Thread_Enable_dispatch(); 464f6: 4eb9 0004 8cfa jsr 48cfa <_Thread_Enable_dispatch> return RTEMS_NOT_OWNER_OF_RESOURCE; 464fc: 7417 moveq #23,%d2 464fe: 6000 013a braw 4663a } if ( length == RTEMS_PERIOD_STATUS ) { 46502: 4a82 tstl %d2 46504: 6622 bnes 46528 switch ( the_period->state ) { 46506: 202a 0038 movel %a2@(56),%d0 4650a: 7204 moveq #4,%d1 4650c: b280 cmpl %d0,%d1 4650e: 650c bcss 4651c <== NEVER TAKEN 46510: 41f9 0005 cc62 lea 5cc62 ,%a0 46516: 2430 0c00 movel %a0@(00000000,%d0:l:4),%d2 4651a: 6002 bras 4651e 4651c: 4282 clrl %d2 <== NOT EXECUTED case RATE_MONOTONIC_ACTIVE: default: /* unreached -- only to remove warnings */ return_value = RTEMS_SUCCESSFUL; break; } _Thread_Enable_dispatch(); 4651e: 4eb9 0004 8cfa jsr 48cfa <_Thread_Enable_dispatch> return( return_value ); 46524: 6000 0114 braw 4663a } _ISR_Disable( level ); 46528: 203c 0000 0700 movel #1792,%d0 4652e: 40c4 movew %sr,%d4 46530: 8084 orl %d4,%d0 46532: 46c0 movew %d0,%sr switch ( the_period->state ) { 46534: 202a 0038 movel %a2@(56),%d0 46538: 7202 moveq #2,%d1 4653a: b280 cmpl %d0,%d1 4653c: 675a beqs 46598 4653e: 123c 0004 moveb #4,%d1 46542: b280 cmpl %d0,%d1 46544: 6700 00bc beqw 46602 46548: 4a80 tstl %d0 4654a: 6600 00ec bnew 46638 case RATE_MONOTONIC_INACTIVE: { _ISR_Enable( level ); 4654e: 46c4 movew %d4,%sr /* * Baseline statistics information for the beginning of a period. */ _Rate_monotonic_Initiate_statistics( the_period ); 46550: 2f0a movel %a2,%sp@- 46552: 4eb9 0004 634e jsr 4634e <_Rate_monotonic_Initiate_statistics> the_period->state = RATE_MONOTONIC_ACTIVE; 46558: 7002 moveq #2,%d0 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 4655a: 223c 0004 6884 movel #288900,%d1 46560: 2540 0038 movel %d0,%a2@(56) 46564: 2541 002c movel %d1,%a2@(44) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 46568: 42aa 0018 clrl %a2@(24) the_watchdog->routine = routine; the_watchdog->id = id; 4656c: 2543 0030 movel %d3,%a2@(48) the_watchdog->user_data = user_data; 46570: 42aa 0034 clrl %a2@(52) _Rate_monotonic_Timeout, id, NULL ); the_period->next_length = length; 46574: 2542 003c movel %d2,%a2@(60) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 46578: 2542 001c movel %d2,%a2@(28) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 4657c: 486a 0010 pea %a2@(16) 46580: 4879 0005 f65a pea 5f65a <_Watchdog_Ticks_chain> 46586: 4eb9 0004 9d68 jsr 49d68 <_Watchdog_Insert> _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 4658c: 4eb9 0004 8cfa jsr 48cfa <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 46592: 4fef 000c lea %sp@(12),%sp 46596: 6066 bras 465fe case RATE_MONOTONIC_ACTIVE: /* * Update statistics from the concluding period. */ _Rate_monotonic_Update_statistics( the_period ); 46598: 2f0a movel %a2,%sp@- 4659a: 4eb9 0004 63c6 jsr 463c6 <_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; 465a0: 7001 moveq #1,%d0 the_period->next_length = length; 465a2: 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; 465a6: 2540 0038 movel %d0,%a2@(56) the_period->next_length = length; _ISR_Enable( level ); 465aa: 46c4 movew %d4,%sr _Thread_Executing->Wait.id = the_period->Object.id; 465ac: 2079 0005 fa28 moveal 5fa28 <_Per_CPU_Information+0xc>,%a0 465b2: 216a 0008 0020 movel %a2@(8),%a0@(32) _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 465b8: 4878 4000 pea 4000 465bc: 2f08 movel %a0,%sp@- 465be: 4eb9 0004 9538 jsr 49538 <_Thread_Set_state> /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); 465c4: 203c 0000 0700 movel #1792,%d0 465ca: 40c1 movew %sr,%d1 465cc: 8081 orl %d1,%d0 465ce: 46c0 movew %d0,%sr local_state = the_period->state; the_period->state = RATE_MONOTONIC_ACTIVE; 465d0: 7402 moveq #2,%d2 /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); local_state = the_period->state; 465d2: 202a 0038 movel %a2@(56),%d0 the_period->state = RATE_MONOTONIC_ACTIVE; 465d6: 2542 0038 movel %d2,%a2@(56) _ISR_Enable( level ); 465da: 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 ) 465dc: 7203 moveq #3,%d1 465de: 4fef 000c lea %sp@(12),%sp 465e2: b280 cmpl %d0,%d1 465e4: 6612 bnes 465f8 _Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 465e6: 4878 4000 pea 4000 465ea: 2f39 0005 fa28 movel 5fa28 <_Per_CPU_Information+0xc>,%sp@- 465f0: 4eb9 0004 8954 jsr 48954 <_Thread_Clear_state> 465f6: 508f addql #8,%sp _Thread_Enable_dispatch(); 465f8: 4eb9 0004 8cfa jsr 48cfa <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 465fe: 4282 clrl %d2 46600: 6038 bras 4663a case RATE_MONOTONIC_EXPIRED: /* * Update statistics from the concluding period */ _Rate_monotonic_Update_statistics( the_period ); 46602: 2f0a movel %a2,%sp@- 46604: 4eb9 0004 63c6 jsr 463c6 <_Rate_monotonic_Update_statistics> _ISR_Enable( level ); 4660a: 46c4 movew %d4,%sr the_period->state = RATE_MONOTONIC_ACTIVE; 4660c: 7002 moveq #2,%d0 the_period->next_length = length; 4660e: 2542 003c movel %d2,%a2@(60) */ _Rate_monotonic_Update_statistics( the_period ); _ISR_Enable( level ); the_period->state = RATE_MONOTONIC_ACTIVE; 46612: 2540 0038 movel %d0,%a2@(56) Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 46616: 2542 001c movel %d2,%a2@(28) _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 4661a: 486a 0010 pea %a2@(16) the_period->next_length = length; _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); return RTEMS_TIMEOUT; 4661e: 7406 moveq #6,%d2 46620: 4879 0005 f65a pea 5f65a <_Watchdog_Ticks_chain> 46626: 4eb9 0004 9d68 jsr 49d68 <_Watchdog_Insert> the_period->state = RATE_MONOTONIC_ACTIVE; the_period->next_length = length; _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); 4662c: 4eb9 0004 8cfa jsr 48cfa <_Thread_Enable_dispatch> return RTEMS_TIMEOUT; 46632: 4fef 000c lea %sp@(12),%sp 46636: 6002 bras 4663a #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 46638: 7404 moveq #4,%d2 } 4663a: 2002 movel %d2,%d0 4663c: 4cee 041c ffec moveml %fp@(-20),%d2-%d4/%a2 46642: 4e5e unlk %fp ... =============================================================================== 00050cc8 : rtems_status_code rtems_region_get_segment_size( rtems_id id, void *segment, uintptr_t *size ) { 50cc8: 4e56 fffc linkw %fp,#-4 50ccc: 2f03 movel %d3,%sp@- 50cce: 262e 0010 movel %fp@(16),%d3 50cd2: 2f02 movel %d2,%sp@- 50cd4: 242e 000c movel %fp@(12),%d2 Objects_Locations location; rtems_status_code return_status = RTEMS_SUCCESSFUL; register Region_Control *the_region; if ( !segment ) 50cd8: 6768 beqs 50d42 return RTEMS_INVALID_ADDRESS; if ( !size ) 50cda: 4a83 tstl %d3 50cdc: 6764 beqs 50d42 return RTEMS_INVALID_ADDRESS; _RTEMS_Lock_allocator(); 50cde: 2f39 0007 6572 movel 76572 <_RTEMS_Allocator_Mutex>,%sp@- 50ce4: 4eb9 0005 2be8 jsr 52be8 <_API_Mutex_Lock> 50cea: 486e fffc pea %fp@(-4) 50cee: 2f2e 0008 movel %fp@(8),%sp@- 50cf2: 4879 0007 63d6 pea 763d6 <_Region_Information> 50cf8: 4eb9 0005 45f4 jsr 545f4 <_Objects_Get_no_protection> the_region = _Region_Get( id, &location ); switch ( location ) { 50cfe: 222e fffc movel %fp@(-4),%d1 50d02: 4fef 0010 lea %sp@(16),%sp 50d06: 6708 beqs 50d10 50d08: 7001 moveq #1,%d0 50d0a: b081 cmpl %d1,%d0 50d0c: 661a bnes 50d28 <== NEVER TAKEN 50d0e: 601c bras 50d2c case OBJECTS_LOCAL: if ( !_Heap_Size_of_alloc_area( &the_region->Memory, segment, size ) ) 50d10: 2f03 movel %d3,%sp@- 50d12: 2040 moveal %d0,%a0 50d14: 2f02 movel %d2,%sp@- 50d16: 4868 0068 pea %a0@(104) 50d1a: 4eb9 0005 4070 jsr 54070 <_Heap_Size_of_alloc_area> 50d20: 4fef 000c lea %sp@(12),%sp 50d24: 4a00 tstb %d0 50d26: 6708 beqs 50d30 <== NEVER TAKEN void *segment, uintptr_t *size ) { Objects_Locations location; rtems_status_code return_status = RTEMS_SUCCESSFUL; 50d28: 4282 clrl %d2 50d2a: 6006 bras 50d32 case OBJECTS_REMOTE: /* this error cannot be returned */ break; #endif case OBJECTS_ERROR: return_status = RTEMS_INVALID_ID; 50d2c: 7404 moveq #4,%d2 50d2e: 6002 bras 50d32 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; 50d30: 7409 moveq #9,%d2 <== NOT EXECUTED case OBJECTS_ERROR: return_status = RTEMS_INVALID_ID; break; } _RTEMS_Unlock_allocator(); 50d32: 2f39 0007 6572 movel 76572 <_RTEMS_Allocator_Mutex>,%sp@- 50d38: 4eb9 0005 2c48 jsr 52c48 <_API_Mutex_Unlock> return return_status; 50d3e: 588f addql #4,%sp 50d40: 6002 bras 50d44 if ( !segment ) return RTEMS_INVALID_ADDRESS; if ( !size ) return RTEMS_INVALID_ADDRESS; 50d42: 7409 moveq #9,%d2 break; } _RTEMS_Unlock_allocator(); return return_status; } 50d44: 2002 movel %d2,%d0 50d46: 242e fff4 movel %fp@(-12),%d2 50d4a: 262e fff8 movel %fp@(-8),%d3 50d4e: 4e5e unlk %fp ... =============================================================================== 00051328 : rtems_status_code rtems_signal_send( rtems_id id, rtems_signal_set signal_set ) { 51328: 4e56 fffc linkw %fp,#-4 5132c: 2f03 movel %d3,%sp@- 5132e: 2f02 movel %d2,%sp@- 51330: 242e 000c movel %fp@(12),%d2 register Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; ASR_Information *asr; if ( !signal_set ) 51334: 677a beqs 513b0 return RTEMS_INVALID_NUMBER; the_thread = _Thread_Get( id, &location ); 51336: 486e fffc pea %fp@(-4) 5133a: 2f2e 0008 movel %fp@(8),%sp@- 5133e: 4eb9 0005 4eb4 jsr 54eb4 <_Thread_Get> switch ( location ) { 51344: 508f addql #8,%sp 51346: 4aae fffc tstl %fp@(-4) 5134a: 6668 bnes 513b4 case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; 5134c: 2240 moveal %d0,%a1 5134e: 2069 010a moveal %a1@(266),%a0 asr = &api->Signal; if ( ! _ASR_Is_null_handler( asr->handler ) ) { 51352: 4aa8 000a tstl %a0@(10) 51356: 674e beqs 513a6 if ( asr->is_enabled ) { 51358: 4a28 0008 tstb %a0@(8) 5135c: 672c beqs 5138a rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 5135e: 223c 0000 0700 movel #1792,%d1 51364: 40c3 movew %sr,%d3 51366: 8283 orl %d3,%d1 51368: 46c1 movew %d1,%sr *signal_set |= signals; 5136a: 85a8 0012 orl %d2,%a0@(18) _ISR_Enable( _level ); 5136e: 46c3 movew %d3,%sr _ASR_Post_signals( signal_set, &asr->signals_posted ); if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 51370: 4ab9 0007 6964 tstl 76964 <_Per_CPU_Information+0x8> 51376: 6724 beqs 5139c 51378: b0b9 0007 6968 cmpl 76968 <_Per_CPU_Information+0xc>,%d0 5137e: 661c bnes 5139c <== NEVER TAKEN _Context_Switch_necessary = true; 51380: 7001 moveq #1,%d0 51382: 13c0 0007 6974 moveb %d0,76974 <_Per_CPU_Information+0x18> 51388: 6012 bras 5139c rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 5138a: 203c 0000 0700 movel #1792,%d0 51390: 40c1 movew %sr,%d1 51392: 8081 orl %d1,%d0 51394: 46c0 movew %d0,%sr *signal_set |= signals; 51396: 85a8 0016 orl %d2,%a0@(22) _ISR_Enable( _level ); 5139a: 46c1 movew %d1,%sr } else { _ASR_Post_signals( signal_set, &asr->signals_pending ); } _Thread_Enable_dispatch(); 5139c: 4eb9 0005 4e8e jsr 54e8e <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 513a2: 4280 clrl %d0 513a4: 6010 bras 513b6 } _Thread_Enable_dispatch(); 513a6: 4eb9 0005 4e8e jsr 54e8e <_Thread_Enable_dispatch> return RTEMS_NOT_DEFINED; 513ac: 700b moveq #11,%d0 513ae: 6006 bras 513b6 Objects_Locations location; RTEMS_API_Control *api; ASR_Information *asr; if ( !signal_set ) return RTEMS_INVALID_NUMBER; 513b0: 700a moveq #10,%d0 513b2: 6002 bras 513b6 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 513b4: 7004 moveq #4,%d0 } 513b6: 242e fff4 movel %fp@(-12),%d2 513ba: 262e fff8 movel %fp@(-8),%d3 513be: 4e5e unlk %fp ... =============================================================================== 00045940 : size_t stack_size, rtems_mode initial_modes, rtems_attribute attribute_set, rtems_id *id ) { 45940: 4e56 ffe8 linkw %fp,#-24 45944: 48d7 1c1c moveml %d2-%d4/%a2-%a4,%sp@ 45948: 266e 0008 moveal %fp@(8),%a3 4594c: 262e 000c movel %fp@(12),%d3 45950: 242e 0014 movel %fp@(20),%d2 45954: 282e 0018 movel %fp@(24),%d4 45958: 286e 001c moveal %fp@(28),%a4 Priority_Control core_priority; RTEMS_API_Control *api; ASR_Information *asr; if ( !id ) 4595c: 4a8c tstl %a4 4595e: 6700 00f0 beqw 45a50 return RTEMS_INVALID_ADDRESS; if ( !rtems_is_name_valid( name ) ) 45962: 4a8b tstl %a3 45964: 6700 00ee beqw 45a54 /* * Validate the RTEMS API priority and convert it to the core priority range. */ if ( !_Attributes_Is_system_task( the_attribute_set ) ) { 45968: 4a44 tstw %d4 4596a: 6d1e blts 4598a */ RTEMS_INLINE_ROUTINE bool _RTEMS_tasks_Priority_is_valid ( rtems_task_priority the_priority ) { return ( ( the_priority >= RTEMS_MINIMUM_PRIORITY ) && 4596c: 4a83 tstl %d3 4596e: 6712 beqs 45982 <== NEVER TAKEN ( the_priority <= RTEMS_MAXIMUM_PRIORITY ) ); 45970: 4280 clrl %d0 45972: 1039 0005 c152 moveb 5c152 ,%d0 */ RTEMS_INLINE_ROUTINE bool _RTEMS_tasks_Priority_is_valid ( rtems_task_priority the_priority ) { return ( ( the_priority >= RTEMS_MINIMUM_PRIORITY ) && 45978: b083 cmpl %d3,%d0 4597a: 54c0 scc %d0 4597c: 49c0 extbl %d0 4597e: 4480 negl %d0 45980: 6002 bras 45984 45982: 4280 clrl %d0 if ( !_RTEMS_tasks_Priority_is_valid( initial_priority ) ) 45984: 4a00 tstb %d0 45986: 6700 00d0 beqw 45a58 */ /* * Lock the allocator mutex for protection */ _RTEMS_Lock_allocator(); 4598a: 2f39 0005 d9ae movel 5d9ae <_RTEMS_Allocator_Mutex>,%sp@- 45990: 4eb9 0004 6098 jsr 46098 <_API_Mutex_Lock> * This function allocates a task control block from * the inactive chain of free task control blocks. */ RTEMS_INLINE_ROUTINE Thread_Control *_RTEMS_tasks_Allocate( void ) { return (Thread_Control *) _Objects_Allocate( &_RTEMS_tasks_Information ); 45996: 4879 0005 d886 pea 5d886 <_RTEMS_tasks_Information> 4599c: 4eb9 0004 6a08 jsr 46a08 <_Objects_Allocate> * the event of an error. */ the_thread = _RTEMS_tasks_Allocate(); if ( !the_thread ) { 459a2: 508f addql #8,%sp 459a4: 2440 moveal %d0,%a2 459a6: 4a80 tstl %d0 459a8: 6614 bnes 459be _RTEMS_Unlock_allocator(); 459aa: 2f39 0005 d9ae movel 5d9ae <_RTEMS_Allocator_Mutex>,%sp@- 459b0: 4eb9 0004 60f8 jsr 460f8 <_API_Mutex_Unlock> return RTEMS_TOO_MANY; 459b6: 588f addql #4,%sp 459b8: 7005 moveq #5,%d0 459ba: 6000 009e braw 45a5a /* * Initialize the core thread for this task. */ status = _Thread_Initialize( 459be: 7007 moveq #7,%d0 459c0: 2f0b movel %a3,%sp@- 459c2: 47f9 0004 60f8 lea 460f8 <_API_Mutex_Unlock>,%a3 459c8: c082 andl %d2,%d0 459ca: 2f00 movel %d0,%sp@- 459cc: 0802 0009 btst #9,%d2 459d0: 56c0 sne %d0 459d2: 42a7 clrl %sp@- 459d4: 49c0 extbl %d0 459d6: 4480 negl %d0 459d8: 2f00 movel %d0,%sp@- 459da: 0802 0008 btst #8,%d2 459de: 57c0 seq %d0 459e0: 49c0 extbl %d0 459e2: 4480 negl %d0 459e4: 2f00 movel %d0,%sp@- 459e6: 7001 moveq #1,%d0 459e8: 2f03 movel %d3,%sp@- 459ea: c084 andl %d4,%d0 459ec: 2f00 movel %d0,%sp@- 459ee: 2f2e 0010 movel %fp@(16),%sp@- 459f2: 42a7 clrl %sp@- 459f4: 2f0a movel %a2,%sp@- 459f6: 4879 0005 d886 pea 5d886 <_RTEMS_tasks_Information> 459fc: 4eb9 0004 776c jsr 4776c <_Thread_Initialize> NULL, /* no budget algorithm callout */ _Modes_Get_interrupt_level(initial_modes), (Objects_Name) name ); if ( !status ) { 45a02: 4fef 002c lea %sp@(44),%sp 45a06: 4a00 tstb %d0 45a08: 6624 bnes 45a2e */ RTEMS_INLINE_ROUTINE void _RTEMS_tasks_Free ( Thread_Control *the_task ) { _Objects_Free( 45a0a: 2f2a 0008 movel %a2@(8),%sp@- 45a0e: 4eb9 0004 6d80 jsr 46d80 <_Objects_Get_information_id> 45a14: 2f0a movel %a2,%sp@- 45a16: 2f00 movel %d0,%sp@- 45a18: 4eb9 0004 6cfc jsr 46cfc <_Objects_Free> #if defined(RTEMS_MULTIPROCESSING) if ( is_global ) _Objects_MP_Free_global_object( the_global_object ); #endif _RTEMS_tasks_Free( the_thread ); _RTEMS_Unlock_allocator(); 45a1e: 2f39 0005 d9ae movel 5d9ae <_RTEMS_Allocator_Mutex>,%sp@- 45a24: 4e93 jsr %a3@ return RTEMS_UNSATISFIED; 45a26: 4fef 0010 lea %sp@(16),%sp 45a2a: 700d moveq #13,%d0 45a2c: 602c bras 45a5a } api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; 45a2e: 206a 010a moveal %a2@(266),%a0 * id - thread id * RTEMS_SUCCESSFUL - if successful * error code - if unsuccessful */ rtems_status_code rtems_task_create( 45a32: 0802 000a btst #10,%d2 45a36: 57c0 seq %d0 45a38: 4480 negl %d0 } api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; asr->is_enabled = _Modes_Is_asr_disabled(initial_modes) ? false : true; 45a3a: 1140 0008 moveb %d0,%a0@(8) *id = the_thread->Object.id; 45a3e: 28aa 0008 movel %a2@(8),%a4@ ); } #endif _RTEMS_Unlock_allocator(); 45a42: 2f39 0005 d9ae movel 5d9ae <_RTEMS_Allocator_Mutex>,%sp@- 45a48: 4e93 jsr %a3@ return RTEMS_SUCCESSFUL; 45a4a: 588f addql #4,%sp 45a4c: 4280 clrl %d0 45a4e: 600a bras 45a5a RTEMS_API_Control *api; ASR_Information *asr; if ( !id ) return RTEMS_INVALID_ADDRESS; 45a50: 7009 moveq #9,%d0 45a52: 6006 bras 45a5a if ( !rtems_is_name_valid( name ) ) return RTEMS_INVALID_NAME; 45a54: 7003 moveq #3,%d0 45a56: 6002 bras 45a5a * Validate the RTEMS API priority and convert it to the core priority range. */ if ( !_Attributes_Is_system_task( the_attribute_set ) ) { if ( !_RTEMS_tasks_Priority_is_valid( initial_priority ) ) return RTEMS_INVALID_PRIORITY; 45a58: 7013 moveq #19,%d0 } #endif _RTEMS_Unlock_allocator(); return RTEMS_SUCCESSFUL; } 45a5a: 4cee 1c1c ffe8 moveml %fp@(-24),%d2-%d4/%a2-%a4 45a60: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004725c : rtems_status_code rtems_task_get_note( rtems_id id, uint32_t notepad, uint32_t *note ) { 4725c: 4e56 fffc linkw %fp,#-4 47260: 202e 0008 movel %fp@(8),%d0 47264: 2f0a movel %a2,%sp@- 47266: 246e 0010 moveal %fp@(16),%a2 4726a: 2f02 movel %d2,%sp@- 4726c: 242e 000c movel %fp@(12),%d2 register Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; if ( !rtems_configuration_get_notepads_enabled() ) 47270: 4a39 0005 e8c4 tstb 5e8c4 47276: 6752 beqs 472ca <== NEVER TAKEN return RTEMS_NOT_CONFIGURED; if ( !note ) 47278: 4a8a tstl %a2 4727a: 6752 beqs 472ce /* * NOTE: There is no check for < RTEMS_NOTEPAD_FIRST because that would * be checking an unsigned number for being negative. */ if ( notepad > RTEMS_NOTEPAD_LAST ) 4727c: 720f moveq #15,%d1 4727e: b282 cmpl %d2,%d1 47280: 6550 bcss 472d2 /* * Optimize the most likely case to avoid the Thread_Dispatch. */ if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) || 47282: 4a80 tstl %d0 47284: 670c beqs 47292 _Objects_Are_ids_equal( id, _Thread_Executing->Object.id ) ) { 47286: 2079 0006 07e6 moveal 607e6 <_Per_CPU_Information+0xc>,%a0 /* * Optimize the most likely case to avoid the Thread_Dispatch. */ if ( _Objects_Are_ids_equal( id, OBJECTS_ID_OF_SELF ) || 4728c: b0a8 0008 cmpl %a0@(8),%d0 47290: 6610 bnes 472a2 _Objects_Are_ids_equal( id, _Thread_Executing->Object.id ) ) { api = _Thread_Executing->API_Extensions[ THREAD_API_RTEMS ]; 47292: 2079 0006 07e6 moveal 607e6 <_Per_CPU_Information+0xc>,%a0 *note = api->Notepads[ notepad ]; 47298: 2068 010a moveal %a0@(266),%a0 4729c: 24b0 2c1e movel %a0@(0000001e,%d2:l:4),%a2@ 472a0: 6024 bras 472c6 return RTEMS_SUCCESSFUL; } the_thread = _Thread_Get( id, &location ); 472a2: 486e fffc pea %fp@(-4) 472a6: 2f00 movel %d0,%sp@- 472a8: 4eb9 0004 9110 jsr 49110 <_Thread_Get> switch ( location ) { 472ae: 508f addql #8,%sp 472b0: 4aae fffc tstl %fp@(-4) 472b4: 6620 bnes 472d6 case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; *note = api->Notepads[ notepad ]; 472b6: 2240 moveal %d0,%a1 472b8: 2069 010a moveal %a1@(266),%a0 472bc: 24b0 2c1e movel %a0@(0000001e,%d2:l:4),%a2@ _Thread_Enable_dispatch(); 472c0: 4eb9 0004 90ea jsr 490ea <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 472c6: 4280 clrl %d0 472c8: 600e bras 472d8 register Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; if ( !rtems_configuration_get_notepads_enabled() ) return RTEMS_NOT_CONFIGURED; 472ca: 7016 moveq #22,%d0 472cc: 600a bras 472d8 if ( !note ) return RTEMS_INVALID_ADDRESS; 472ce: 7009 moveq #9,%d0 472d0: 6006 bras 472d8 * NOTE: There is no check for < RTEMS_NOTEPAD_FIRST because that would * be checking an unsigned number for being negative. */ if ( notepad > RTEMS_NOTEPAD_LAST ) return RTEMS_INVALID_NUMBER; 472d2: 700a moveq #10,%d0 472d4: 6002 bras 472d8 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 472d6: 7004 moveq #4,%d0 } 472d8: 242e fff4 movel %fp@(-12),%d2 472dc: 246e fff8 moveal %fp@(-8),%a2 472e0: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0004c5a8 : rtems_status_code rtems_task_mode( rtems_mode mode_set, rtems_mode mask, rtems_mode *previous_mode_set ) { 4c5a8: 4e56 ffe4 linkw %fp,#-28 4c5ac: 48d7 1c3c moveml %d2-%d5/%a2-%a4,%sp@ 4c5b0: 262e 0008 movel %fp@(8),%d3 4c5b4: 282e 000c movel %fp@(12),%d4 4c5b8: 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 ) 4c5bc: 4a8c tstl %a4 4c5be: 6700 010c beqw 4c6cc return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; 4c5c2: 2679 0005 dd9c moveal 5dd9c <_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; 4c5c8: 4a2b 0074 tstb %a3@(116) 4c5cc: 57c2 seq %d2 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 4c5ce: 246b 010a moveal %a3@(266),%a2 asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 4c5d2: 49c2 extbl %d2 4c5d4: 0282 0000 0100 andil #256,%d2 if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) 4c5da: 4aab 007a tstl %a3@(122) 4c5de: 6704 beqs 4c5e4 old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; 4c5e0: 08c2 0009 bset #9,%d2 old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; 4c5e4: 4a2a 0008 tstb %a2@(8) 4c5e8: 57c5 seq %d5 old_mode |= _ISR_Get_level(); 4c5ea: 4eb9 0004 89d0 jsr 489d0 <_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; 4c5f0: 49c5 extbl %d5 4c5f2: 0285 0000 0400 andil #1024,%d5 4c5f8: 8085 orl %d5,%d0 old_mode |= _ISR_Get_level(); 4c5fa: 8082 orl %d2,%d0 4c5fc: 2880 movel %d0,%a4@ /* * These are generic thread scheduling characteristics. */ if ( mask & RTEMS_PREEMPT_MASK ) 4c5fe: 0804 0008 btst #8,%d4 4c602: 670c beqs 4c610 executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; 4c604: 0803 0008 btst #8,%d3 4c608: 57c0 seq %d0 4c60a: 4480 negl %d0 4c60c: 1740 0074 moveb %d0,%a3@(116) if ( mask & RTEMS_TIMESLICE_MASK ) { 4c610: 0804 0009 btst #9,%d4 4c614: 671c beqs 4c632 if ( _Modes_Is_timeslice(mode_set) ) { 4c616: 0803 0009 btst #9,%d3 4c61a: 6712 beqs 4c62e executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 4c61c: 41f9 0005 d8c4 lea 5d8c4 <_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; 4c622: 7001 moveq #1,%d0 executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 4c624: 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; 4c628: 2740 007a movel %d0,%a3@(122) 4c62c: 6004 bras 4c632 executing->cpu_time_budget = _Thread_Ticks_per_timeslice; } else executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; 4c62e: 42ab 007a clrl %a3@(122) /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) 4c632: 7007 moveq #7,%d0 4c634: c084 andl %d4,%d0 4c636: 6712 beqs 4c64a */ RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level ( Modes_Control mode_set ) { _ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) ); 4c638: 40c0 movew %sr,%d0 */ RTEMS_INLINE_ROUTINE ISR_Level _Modes_Get_interrupt_level ( Modes_Control mode_set ) { return ( mode_set & RTEMS_INTERRUPT_MASK ); 4c63a: 7207 moveq #7,%d1 4c63c: 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 ) ); 4c63e: 0280 0000 f8ff andil #63743,%d0 4c644: e189 lsll #8,%d1 4c646: 8081 orl %d1,%d0 4c648: 46c0 movew %d0,%sr */ is_asr_enabled = false; needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { 4c64a: 0804 000a btst #10,%d4 4c64e: 6740 beqs 4c690 is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true; if ( is_asr_enabled != asr->is_enabled ) { 4c650: 4281 clrl %d1 4c652: 122a 0008 moveb %a2@(8),%d1 4c656: 4282 clrl %d2 * Output: * *previous_mode_set - previous mode set * always return RTEMS_SUCCESSFUL; */ rtems_status_code rtems_task_mode( 4c658: 0803 000a btst #10,%d3 4c65c: 57c0 seq %d0 4c65e: 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 ) { 4c660: 1400 moveb %d0,%d2 4c662: b282 cmpl %d2,%d1 4c664: 672a beqs 4c690 asr->is_enabled = is_asr_enabled; 4c666: 1540 0008 moveb %d0,%a2@(8) ) { rtems_signal_set _signals; ISR_Level _level; _ISR_Disable( _level ); 4c66a: 203c 0000 0700 movel #1792,%d0 4c670: 40c1 movew %sr,%d1 4c672: 8081 orl %d1,%d0 4c674: 46c0 movew %d0,%sr _signals = information->signals_pending; 4c676: 202a 0016 movel %a2@(22),%d0 information->signals_pending = information->signals_posted; 4c67a: 256a 0012 0016 movel %a2@(18),%a2@(22) information->signals_posted = _signals; 4c680: 2540 0012 movel %d0,%a2@(18) _ISR_Enable( _level ); 4c684: 46c1 movew %d1,%sr /* * This is specific to the RTEMS API */ is_asr_enabled = false; needs_asr_dispatching = false; 4c686: 4aaa 0012 tstl %a2@(18) 4c68a: 56c0 sne %d0 4c68c: 4480 negl %d0 4c68e: 6002 bras 4c692 4c690: 4200 clrb %d0 needs_asr_dispatching = true; } } } if ( _System_state_Is_up( _System_state_Get() ) ) 4c692: 7203 moveq #3,%d1 4c694: b2b9 0005 da7a cmpl 5da7a <_System_state_Current>,%d1 4c69a: 6634 bnes 4c6d0 <== NEVER TAKEN */ RTEMS_INLINE_ROUTINE bool _Thread_Evaluate_mode( void ) { Thread_Control *executing; executing = _Thread_Executing; 4c69c: 2079 0005 dd9c moveal 5dd9c <_Per_CPU_Information+0xc>,%a0 if ( !_States_Is_ready( executing->current_state ) || 4c6a2: 4aa8 0010 tstl %a0@(16) 4c6a6: 660e bnes 4c6b6 <== NEVER TAKEN 4c6a8: b1f9 0005 dda0 cmpal 5dda0 <_Per_CPU_Information+0x10>,%a0 4c6ae: 6710 beqs 4c6c0 ( !_Thread_Is_heir( executing ) && executing->is_preemptible ) ) { 4c6b0: 4a28 0074 tstb %a0@(116) 4c6b4: 670a beqs 4c6c0 <== NEVER TAKEN _Context_Switch_necessary = true; 4c6b6: 7001 moveq #1,%d0 4c6b8: 13c0 0005 dda8 moveb %d0,5dda8 <_Per_CPU_Information+0x18> 4c6be: 6004 bras 4c6c4 if ( _Thread_Evaluate_mode() || needs_asr_dispatching ) 4c6c0: 4a00 tstb %d0 4c6c2: 670c beqs 4c6d0 _Thread_Dispatch(); 4c6c4: 4eb9 0004 757c jsr 4757c <_Thread_Dispatch> 4c6ca: 6004 bras 4c6d0 bool is_asr_enabled = false; bool needs_asr_dispatching = false; rtems_mode old_mode; if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; 4c6cc: 7009 moveq #9,%d0 4c6ce: 6002 bras 4c6d2 if ( _System_state_Is_up( _System_state_Get() ) ) if ( _Thread_Evaluate_mode() || needs_asr_dispatching ) _Thread_Dispatch(); return RTEMS_SUCCESSFUL; 4c6d0: 4280 clrl %d0 } 4c6d2: 4cee 1c3c ffe4 moveml %fp@(-28),%d2-%d5/%a2-%a4 4c6d8: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00049480 : rtems_status_code rtems_task_set_priority( rtems_id id, rtems_task_priority new_priority, rtems_task_priority *old_priority ) { 49480: 4e56 fffc linkw %fp,#-4 49484: 2f0a movel %a2,%sp@- 49486: 246e 0010 moveal %fp@(16),%a2 4948a: 2f02 movel %d2,%sp@- 4948c: 242e 000c movel %fp@(12),%d2 register Thread_Control *the_thread; Objects_Locations location; if ( new_priority != RTEMS_CURRENT_PRIORITY && 49490: 670c beqs 4949e 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 ) ); 49492: 4280 clrl %d0 49494: 1039 0005 faf2 moveb 5faf2 ,%d0 4949a: b082 cmpl %d2,%d0 4949c: 654e bcss 494ec !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; if ( !old_priority ) 4949e: 4a8a tstl %a2 494a0: 674e beqs 494f0 return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); 494a2: 486e fffc pea %fp@(-4) 494a6: 2f2e 0008 movel %fp@(8),%sp@- 494aa: 4eb9 0004 b198 jsr 4b198 <_Thread_Get> switch ( location ) { 494b0: 508f addql #8,%sp return RTEMS_INVALID_PRIORITY; if ( !old_priority ) return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); 494b2: 2040 moveal %d0,%a0 switch ( location ) { 494b4: 4aae fffc tstl %fp@(-4) 494b8: 663a bnes 494f4 case OBJECTS_LOCAL: /* XXX need helper to "convert" from core priority */ *old_priority = the_thread->current_priority; 494ba: 24a8 0014 movel %a0@(20),%a2@ if ( new_priority != RTEMS_CURRENT_PRIORITY ) { 494be: 4a82 tstl %d2 494c0: 6720 beqs 494e2 the_thread->real_priority = new_priority; 494c2: 2142 0018 movel %d2,%a0@(24) if ( the_thread->resource_count == 0 || 494c6: 4aa8 001c tstl %a0@(28) 494ca: 6706 beqs 494d2 494cc: b4a8 0014 cmpl %a0@(20),%d2 494d0: 6410 bccs 494e2 <== ALWAYS TAKEN the_thread->current_priority > new_priority ) _Thread_Change_priority( the_thread, new_priority, false ); 494d2: 42a7 clrl %sp@- 494d4: 2f02 movel %d2,%sp@- 494d6: 2f08 movel %a0,%sp@- 494d8: 4eb9 0004 ac8c jsr 4ac8c <_Thread_Change_priority> 494de: 4fef 000c lea %sp@(12),%sp } _Thread_Enable_dispatch(); 494e2: 4eb9 0004 b172 jsr 4b172 <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 494e8: 4280 clrl %d0 494ea: 600a bras 494f6 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; 494ec: 7013 moveq #19,%d0 494ee: 6006 bras 494f6 if ( !old_priority ) return RTEMS_INVALID_ADDRESS; 494f0: 7009 moveq #9,%d0 494f2: 6002 bras 494f6 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 494f4: 7004 moveq #4,%d0 } 494f6: 242e fff4 movel %fp@(-12),%d2 494fa: 246e fff8 moveal %fp@(-8),%a2 494fe: 4e5e unlk %fp ... =============================================================================== 00051bb4 : */ rtems_status_code rtems_timer_cancel( rtems_id id ) { 51bb4: 4e56 fffc linkw %fp,#-4 Objects_Id id, Objects_Locations *location ) { return (Timer_Control *) _Objects_Get( &_Timer_Information, id, location ); 51bb8: 486e fffc pea %fp@(-4) 51bbc: 2f2e 0008 movel %fp@(8),%sp@- 51bc0: 4879 0007 6d54 pea 76d54 <_Timer_Information> 51bc6: 4eb9 0005 462c jsr 5462c <_Objects_Get> Timer_Control *the_timer; Objects_Locations location; the_timer = _Timer_Get( id, &location ); switch ( location ) { 51bcc: 4fef 000c lea %sp@(12),%sp 51bd0: 4aae fffc tstl %fp@(-4) 51bd4: 6620 bnes 51bf6 case OBJECTS_LOCAL: if ( !_Timer_Is_dormant_class( the_timer->the_class ) ) 51bd6: 7204 moveq #4,%d1 51bd8: 2040 moveal %d0,%a0 51bda: b2a8 0038 cmpl %a0@(56),%d1 51bde: 670c beqs 51bec <== NEVER TAKEN (void) _Watchdog_Remove( &the_timer->Ticker ); 51be0: 4868 0010 pea %a0@(16) 51be4: 4eb9 0005 6204 jsr 56204 <_Watchdog_Remove> 51bea: 588f addql #4,%sp _Thread_Enable_dispatch(); 51bec: 4eb9 0005 4e8e jsr 54e8e <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 51bf2: 4280 clrl %d0 51bf4: 6002 bras 51bf8 #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 51bf6: 7004 moveq #4,%d0 } 51bf8: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00051f80 : rtems_id id, rtems_interval ticks, rtems_timer_service_routine_entry routine, void *user_data ) { 51f80: 4e56 ffe4 linkw %fp,#-28 51f84: 48d7 1c1c moveml %d2-%d4/%a2-%a4,%sp@ 51f88: 262e 0008 movel %fp@(8),%d3 51f8c: 242e 000c movel %fp@(12),%d2 51f90: 282e 0010 movel %fp@(16),%d4 Timer_Control *the_timer; Objects_Locations location; ISR_Level level; Timer_server_Control *timer_server = _Timer_server; 51f94: 2679 0007 6d8e moveal 76d8e <_Timer_server>,%a3 if ( !timer_server ) 51f9a: 4a8b tstl %a3 51f9c: 6700 0086 beqw 52024 return RTEMS_INCORRECT_STATE; if ( !routine ) 51fa0: 4a84 tstl %d4 51fa2: 6700 0084 beqw 52028 return RTEMS_INVALID_ADDRESS; if ( ticks == 0 ) 51fa6: 4a82 tstl %d2 51fa8: 6700 0082 beqw 5202c 51fac: 486e fffc pea %fp@(-4) 51fb0: 2f03 movel %d3,%sp@- 51fb2: 4879 0007 6d54 pea 76d54 <_Timer_Information> 51fb8: 4eb9 0005 462c jsr 5462c <_Objects_Get> return RTEMS_INVALID_NUMBER; the_timer = _Timer_Get( id, &location ); switch ( location ) { 51fbe: 4fef 000c lea %sp@(12),%sp 51fc2: 2440 moveal %d0,%a2 51fc4: 4aae fffc tstl %fp@(-4) 51fc8: 6666 bnes 52030 <== NEVER TAKEN case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); 51fca: 486a 0010 pea %a2@(16) 51fce: 4eb9 0005 6204 jsr 56204 <_Watchdog_Remove> _ISR_Disable( level ); 51fd4: 203c 0000 0700 movel #1792,%d0 51fda: 40c1 movew %sr,%d1 51fdc: 8081 orl %d1,%d0 51fde: 46c0 movew %d0,%sr 51fe0: 49f9 0005 4e8e lea 54e8e <_Thread_Enable_dispatch>,%a4 /* * Check to see if the watchdog has just been inserted by a * higher priority interrupt. If so, abandon this insert. */ if ( the_timer->Ticker.state != WATCHDOG_INACTIVE ) { 51fe6: 588f addql #4,%sp 51fe8: 4aaa 0018 tstl %a2@(24) 51fec: 6706 beqs 51ff4 _ISR_Enable( level ); 51fee: 46c1 movew %d1,%sr _Thread_Enable_dispatch(); 51ff0: 4e94 jsr %a4@ 51ff2: 602c bras 52020 /* * OK. Now we now the timer was not rescheduled by an interrupt * so we can atomically initialize it as in use. */ the_timer->the_class = TIMER_INTERVAL_ON_TASK; 51ff4: 7001 moveq #1,%d0 ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; the_watchdog->id = id; the_watchdog->user_data = user_data; 51ff6: 256e 0014 0034 movel %fp@(20),%a2@(52) 51ffc: 2540 0038 movel %d0,%a2@(56) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 52000: 42aa 0018 clrl %a2@(24) the_watchdog->routine = routine; 52004: 2544 002c movel %d4,%a2@(44) the_watchdog->id = id; 52008: 2543 0030 movel %d3,%a2@(48) _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = ticks; 5200c: 2542 001c movel %d2,%a2@(28) _ISR_Enable( level ); 52010: 46c1 movew %d1,%sr (*timer_server->schedule_operation)( timer_server, the_timer ); 52012: 2f0a movel %a2,%sp@- 52014: 2f0b movel %a3,%sp@- 52016: 206b 0004 moveal %a3@(4),%a0 5201a: 4e90 jsr %a0@ _Thread_Enable_dispatch(); 5201c: 4e94 jsr %a4@ return RTEMS_SUCCESSFUL; 5201e: 508f addql #8,%sp 52020: 4280 clrl %d0 52022: 600e bras 52032 Objects_Locations location; ISR_Level level; Timer_server_Control *timer_server = _Timer_server; if ( !timer_server ) return RTEMS_INCORRECT_STATE; 52024: 700e moveq #14,%d0 52026: 600a bras 52032 if ( !routine ) return RTEMS_INVALID_ADDRESS; 52028: 7009 moveq #9,%d0 5202a: 6006 bras 52032 if ( ticks == 0 ) return RTEMS_INVALID_NUMBER; 5202c: 700a moveq #10,%d0 5202e: 6002 bras 52032 #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 52030: 7004 moveq #4,%d0 } 52032: 4cee 1c1c ffe4 moveml %fp@(-28),%d2-%d4/%a2-%a4 52038: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 0005203c : rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ) { 5203c: 4e56 ffe8 linkw %fp,#-24 52040: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 52044: 262e 0008 movel %fp@(8),%d3 52048: 242e 000c movel %fp@(12),%d2 5204c: 282e 0010 movel %fp@(16),%d4 Timer_Control *the_timer; Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; 52050: 2679 0007 6d8e moveal 76d8e <_Timer_server>,%a3 if ( !timer_server ) 52056: 4a8b tstl %a3 52058: 6700 0098 beqw 520f2 return RTEMS_INCORRECT_STATE; if ( !_TOD_Is_set ) 5205c: 4a39 0007 64e0 tstb 764e0 <_TOD_Is_set> 52062: 6700 0092 beqw 520f6 return RTEMS_NOT_DEFINED; if ( !routine ) 52066: 4a84 tstl %d4 52068: 6700 0090 beqw 520fa return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) 5206c: 2f02 movel %d2,%sp@- 5206e: 4eb9 0004 f4ec jsr 4f4ec <_TOD_Validate> 52074: 588f addql #4,%sp 52076: 4a00 tstb %d0 52078: 6700 0084 beqw 520fe return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 5207c: 2f02 movel %d2,%sp@- 5207e: 4eb9 0004 f450 jsr 4f450 <_TOD_To_seconds> if ( seconds <= _TOD_Seconds_since_epoch() ) 52084: 588f addql #4,%sp return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 52086: 2400 movel %d0,%d2 if ( seconds <= _TOD_Seconds_since_epoch() ) 52088: b0b9 0007 655a cmpl 7655a <_TOD_Now>,%d0 5208e: 636e blss 520fe 52090: 486e fffc pea %fp@(-4) 52094: 2f03 movel %d3,%sp@- 52096: 4879 0007 6d54 pea 76d54 <_Timer_Information> 5209c: 4eb9 0005 462c jsr 5462c <_Objects_Get> return RTEMS_INVALID_CLOCK; the_timer = _Timer_Get( id, &location ); switch ( location ) { 520a2: 4fef 000c lea %sp@(12),%sp 520a6: 2440 moveal %d0,%a2 520a8: 4aae fffc tstl %fp@(-4) 520ac: 6654 bnes 52102 case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); 520ae: 486a 0010 pea %a2@(16) 520b2: 4eb9 0005 6204 jsr 56204 <_Watchdog_Remove> the_watchdog->user_data = user_data; 520b8: 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(); 520be: 94b9 0007 655a subl 7655a <_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; 520c4: 7003 moveq #3,%d0 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 520c6: 42aa 0018 clrl %a2@(24) 520ca: 2540 0038 movel %d0,%a2@(56) the_watchdog->routine = routine; 520ce: 2544 002c movel %d4,%a2@(44) the_watchdog->id = id; 520d2: 2543 0030 movel %d3,%a2@(48) _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); 520d6: 2542 001c movel %d2,%a2@(28) (*timer_server->schedule_operation)( timer_server, the_timer ); 520da: 2f0a movel %a2,%sp@- 520dc: 2f0b movel %a3,%sp@- 520de: 206b 0004 moveal %a3@(4),%a0 520e2: 4e90 jsr %a0@ _Thread_Enable_dispatch(); 520e4: 4eb9 0005 4e8e jsr 54e8e <_Thread_Enable_dispatch> return RTEMS_SUCCESSFUL; 520ea: 4fef 000c lea %sp@(12),%sp 520ee: 4280 clrl %d0 520f0: 6012 bras 52104 Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; if ( !timer_server ) return RTEMS_INCORRECT_STATE; 520f2: 700e moveq #14,%d0 520f4: 600e bras 52104 if ( !_TOD_Is_set ) return RTEMS_NOT_DEFINED; 520f6: 700b moveq #11,%d0 <== NOT EXECUTED 520f8: 600a bras 52104 <== NOT EXECUTED if ( !routine ) return RTEMS_INVALID_ADDRESS; 520fa: 7009 moveq #9,%d0 520fc: 6006 bras 52104 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; 520fe: 7014 moveq #20,%d0 52100: 6002 bras 52104 #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 52102: 7004 moveq #4,%d0 } 52104: 4cee 0c1c ffe8 moveml %fp@(-24),%d2-%d4/%a2-%a3 5210a: 4e5e unlk %fp ... =============================================================================== 00045f10 : int sched_get_priority_max( int policy ) { switch ( policy ) { 45f10: 7004 moveq #4,%d0 #include int sched_get_priority_max( int policy ) { 45f12: 4e56 0000 linkw %fp,#0 45f16: 222e 0008 movel %fp@(8),%d1 switch ( policy ) { 45f1a: b081 cmpl %d1,%d0 45f1c: 650c bcss 45f2a 45f1e: 103c 0001 moveb #1,%d0 45f22: e3a8 lsll %d1,%d0 45f24: 7217 moveq #23,%d1 45f26: c081 andl %d1,%d0 45f28: 6610 bnes 45f3a <== ALWAYS TAKEN case SCHED_RR: case SCHED_SPORADIC: break; default: rtems_set_errno_and_return_minus_one( EINVAL ); 45f2a: 4eb9 0004 d5d8 jsr 4d5d8 <__errno> 45f30: 2040 moveal %d0,%a0 45f32: 7016 moveq #22,%d0 45f34: 2080 movel %d0,%a0@ 45f36: 70ff moveq #-1,%d0 45f38: 600a bras 45f44 } return POSIX_SCHEDULER_MAXIMUM_PRIORITY; 45f3a: 4280 clrl %d0 45f3c: 1039 0005 d226 moveb 5d226 ,%d0 45f42: 5380 subql #1,%d0 } 45f44: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00045f48 : int sched_get_priority_min( int policy ) { switch ( policy ) { 45f48: 7004 moveq #4,%d0 #include int sched_get_priority_min( int policy ) { 45f4a: 4e56 0000 linkw %fp,#0 45f4e: 222e 0008 movel %fp@(8),%d1 switch ( policy ) { 45f52: b081 cmpl %d1,%d0 45f54: 650c bcss 45f62 45f56: 103c 0001 moveb #1,%d0 45f5a: e3a8 lsll %d1,%d0 45f5c: 7217 moveq #23,%d1 45f5e: c081 andl %d1,%d0 45f60: 6610 bnes 45f72 <== ALWAYS TAKEN case SCHED_RR: case SCHED_SPORADIC: break; default: rtems_set_errno_and_return_minus_one( EINVAL ); 45f62: 4eb9 0004 d5d8 jsr 4d5d8 <__errno> 45f68: 2040 moveal %d0,%a0 45f6a: 7016 moveq #22,%d0 45f6c: 2080 movel %d0,%a0@ 45f6e: 70ff moveq #-1,%d0 45f70: 6002 bras 45f74 } return POSIX_SCHEDULER_MINIMUM_PRIORITY; 45f72: 7001 moveq #1,%d0 } 45f74: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00045f78 : int sched_rr_get_interval( pid_t pid, struct timespec *interval ) { 45f78: 4e56 0000 linkw %fp,#0 45f7c: 2f03 movel %d3,%sp@- 45f7e: 262e 0008 movel %fp@(8),%d3 45f82: 2f02 movel %d2,%sp@- 45f84: 242e 000c movel %fp@(12),%d2 /* * Only supported for the "calling process" (i.e. this node). */ if ( pid && pid != getpid() ) 45f88: 4a83 tstl %d3 45f8a: 6718 beqs 45fa4 <== NEVER TAKEN 45f8c: 4eb9 0004 2f68 jsr 42f68 45f92: b083 cmpl %d3,%d0 45f94: 670e beqs 45fa4 rtems_set_errno_and_return_minus_one( ESRCH ); 45f96: 4eb9 0004 d5d8 jsr 4d5d8 <__errno> 45f9c: 7203 moveq #3,%d1 45f9e: 2040 moveal %d0,%a0 45fa0: 2081 movel %d1,%a0@ 45fa2: 6010 bras 45fb4 if ( !interval ) 45fa4: 4a82 tstl %d2 45fa6: 6610 bnes 45fb8 rtems_set_errno_and_return_minus_one( EINVAL ); 45fa8: 4eb9 0004 d5d8 jsr 4d5d8 <__errno> 45fae: 2040 moveal %d0,%a0 45fb0: 7016 moveq #22,%d0 45fb2: 2080 movel %d0,%a0@ 45fb4: 70ff moveq #-1,%d0 45fb6: 6012 bras 45fca _Timespec_From_ticks( _Thread_Ticks_per_timeslice, interval ); 45fb8: 2f02 movel %d2,%sp@- 45fba: 2f39 0005 e964 movel 5e964 <_Thread_Ticks_per_timeslice>,%sp@- 45fc0: 4eb9 0004 921c jsr 4921c <_Timespec_From_ticks> return 0; 45fc6: 508f addql #8,%sp 45fc8: 4280 clrl %d0 } 45fca: 242e fff8 movel %fp@(-8),%d2 45fce: 262e fffc movel %fp@(-4),%d3 45fd2: 4e5e unlk %fp ... =============================================================================== 00048544 : int oflag, ... /* mode_t mode, */ /* unsigned int value */ ) { 48544: 4e56 ffe0 linkw %fp,#-32 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 48548: 2039 0006 2768 movel 62768 <_Thread_Dispatch_disable_level>,%d0 4854e: 5280 addql #1,%d0 48550: 48d7 043c moveml %d2-%d5/%a2,%sp@ 48554: 242e 0008 movel %fp@(8),%d2 48558: 282e 000c movel %fp@(12),%d4 4855c: 23c0 0006 2768 movel %d0,62768 <_Thread_Dispatch_disable_level> POSIX_Semaphore_Control *the_semaphore; Objects_Locations location; _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { 48562: 2a04 movel %d4,%d5 48564: 0285 0000 0200 andil #512,%d5 4856a: 6706 beqs 48572 va_start(arg, oflag); mode = (mode_t) va_arg( arg, unsigned int ); value = va_arg( arg, unsigned int ); 4856c: 262e 0014 movel %fp@(20),%d3 48570: 6002 bras 48574 /* unsigned int value */ ) { va_list arg; mode_t mode; unsigned int value = 0; 48572: 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 ); 48574: 486e fffc pea %fp@(-4) 48578: 2f02 movel %d2,%sp@- 4857a: 4eb9 0004 df00 jsr 4df00 <_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 ) { 48580: 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 ); 48582: 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 ) { 48584: 4a80 tstl %d0 48586: 671c beqs 485a4 /* * 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) ) ) { 48588: 7002 moveq #2,%d0 4858a: b08a cmpl %a2,%d0 4858c: 6604 bnes 48592 <== NEVER TAKEN 4858e: 4a85 tstl %d5 48590: 665e bnes 485f0 _Thread_Enable_dispatch(); 48592: 4eb9 0004 ac4e jsr 4ac4e <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one_cast( status, sem_t * ); 48598: 4eb9 0005 07a4 jsr 507a4 <__errno> 4859e: 2040 moveal %d0,%a0 485a0: 208a movel %a2,%a0@ 485a2: 6076 bras 4861a 485a4: 45f9 0004 ac4e lea 4ac4e <_Thread_Enable_dispatch>,%a2 /* * Check for existence with creation. */ if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { 485aa: 0284 0000 0a00 andil #2560,%d4 485b0: 0c84 0000 0a00 cmpil #2560,%d4 485b6: 6610 bnes 485c8 _Thread_Enable_dispatch(); 485b8: 4e92 jsr %a2@ rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * ); 485ba: 4eb9 0005 07a4 jsr 507a4 <__errno> 485c0: 2040 moveal %d0,%a0 485c2: 7011 moveq #17,%d0 485c4: 2080 movel %d0,%a0@ 485c6: 6052 bras 4861a 485c8: 486e fff4 pea %fp@(-12) 485cc: 2f2e fffc movel %fp@(-4),%sp@- 485d0: 4879 0006 29a4 pea 629a4 <_POSIX_Semaphore_Information> 485d6: 4eb9 0004 a410 jsr 4a410 <_Objects_Get> } the_semaphore = _POSIX_Semaphore_Get( &the_semaphore_id, &location ); the_semaphore->open_count += 1; 485dc: 2040 moveal %d0,%a0 485de: 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 ); 485e2: 2d40 fff8 movel %d0,%fp@(-8) the_semaphore->open_count += 1; _Thread_Enable_dispatch(); 485e6: 4e92 jsr %a2@ _Thread_Enable_dispatch(); 485e8: 4e92 jsr %a2@ goto return_id; 485ea: 4fef 000c lea %sp@(12),%sp 485ee: 6022 bras 48612 /* * 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( 485f0: 486e fff8 pea %fp@(-8) 485f4: 2f03 movel %d3,%sp@- 485f6: 42a7 clrl %sp@- 485f8: 2f02 movel %d2,%sp@- 485fa: 4eb9 0004 ddbc jsr 4ddbc <_POSIX_Semaphore_Create_support> 48600: 2400 movel %d0,%d2 /* * errno was set by Create_support, so don't set it again. */ _Thread_Enable_dispatch(); 48602: 4eb9 0004 ac4e jsr 4ac4e <_Thread_Enable_dispatch> if ( status == -1 ) 48608: 4fef 0010 lea %sp@(16),%sp 4860c: 70ff moveq #-1,%d0 4860e: b082 cmpl %d2,%d0 48610: 6708 beqs 4861a 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; 48612: 202e fff8 movel %fp@(-8),%d0 48616: 5080 addql #8,%d0 #endif return id; 48618: 6002 bras 4861c */ _Thread_Enable_dispatch(); if ( status == -1 ) return SEM_FAILED; 4861a: 70ff moveq #-1,%d0 id = &the_semaphore->Semaphore_id; #else id = (sem_t *)&the_semaphore->Object.id; #endif return id; } 4861c: 4cee 043c ffe0 moveml %fp@(-32),%d2-%d5/%a2 48622: 4e5e unlk %fp ... =============================================================================== 00045e20 : int sigaction( int sig, const struct sigaction *act, struct sigaction *oact ) { 45e20: 4e56 ffec linkw %fp,#-20 45e24: 222e 0010 movel %fp@(16),%d1 45e28: 48d7 0c1c moveml %d2-%d4/%a2-%a3,%sp@ 45e2c: 242e 0008 movel %fp@(8),%d2 45e30: 246e 000c moveal %fp@(12),%a2 ISR_Level level; if ( oact ) 45e34: 4a81 tstl %d1 45e36: 6722 beqs 45e5a *oact = _POSIX_signals_Vectors[ sig ]; 45e38: 2602 movel %d2,%d3 45e3a: 2002 movel %d2,%d0 45e3c: 4878 000c pea c 45e40: e58b lsll #2,%d3 45e42: e988 lsll #4,%d0 45e44: 9083 subl %d3,%d0 45e46: 0680 0005 fa6a addil #391786,%d0 45e4c: 2f00 movel %d0,%sp@- 45e4e: 2f01 movel %d1,%sp@- 45e50: 4eb9 0004 e16c jsr 4e16c 45e56: 4fef 000c lea %sp@(12),%sp if ( !sig ) 45e5a: 4a82 tstl %d2 45e5c: 6710 beqs 45e6e static inline bool is_valid_signo( int signo ) { return ((signo) >= 1 && (signo) <= 32 ); 45e5e: 2002 movel %d2,%d0 45e60: 5380 subql #1,%d0 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 45e62: 721f moveq #31,%d1 45e64: b280 cmpl %d0,%d1 45e66: 6506 bcss 45e6e * * NOTE: Solaris documentation claims to "silently enforce" this which * contradicts the POSIX specification. */ if ( sig == SIGKILL ) 45e68: 7009 moveq #9,%d0 45e6a: b082 cmpl %d2,%d0 45e6c: 6610 bnes 45e7e rtems_set_errno_and_return_minus_one( EINVAL ); 45e6e: 4eb9 0004 d8a8 jsr 4d8a8 <__errno> 45e74: 2040 moveal %d0,%a0 45e76: 7016 moveq #22,%d0 45e78: 2080 movel %d0,%a0@ 45e7a: 70ff moveq #-1,%d0 45e7c: 6060 bras 45ede /* * Evaluate the new action structure and set the global signal vector * appropriately. */ if ( act ) { 45e7e: 4a8a tstl %a2 45e80: 675a beqs 45edc <== 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 ); 45e82: 203c 0000 0700 movel #1792,%d0 45e88: 40c3 movew %sr,%d3 45e8a: 8083 orl %d3,%d0 45e8c: 46c0 movew %d0,%sr 45e8e: 780c moveq #12,%d4 45e90: 4c02 4800 mulsl %d2,%d4 45e94: 47f9 0004 e16c lea 4e16c ,%a3 if ( act->sa_handler == SIG_DFL ) { 45e9a: 4aaa 0008 tstl %a2@(8) 45e9e: 661e bnes 45ebe _POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ]; 45ea0: 4878 000c pea c 45ea4: 2004 movel %d4,%d0 45ea6: 0680 0005 d0f0 addil #381168,%d0 45eac: 2f00 movel %d0,%sp@- 45eae: 0684 0005 fa6a addil #391786,%d4 45eb4: 2f04 movel %d4,%sp@- 45eb6: 4e93 jsr %a3@ 45eb8: 4fef 000c lea %sp@(12),%sp 45ebc: 601c bras 45eda } else { _POSIX_signals_Clear_process_signals( sig ); 45ebe: 2f02 movel %d2,%sp@- _POSIX_signals_Vectors[ sig ] = *act; 45ec0: 0684 0005 fa6a addil #391786,%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 ); 45ec6: 4eb9 0004 ae8c jsr 4ae8c <_POSIX_signals_Clear_process_signals> _POSIX_signals_Vectors[ sig ] = *act; 45ecc: 4878 000c pea c 45ed0: 2f0a movel %a2,%sp@- 45ed2: 2f04 movel %d4,%sp@- 45ed4: 4e93 jsr %a3@ 45ed6: 4fef 0010 lea %sp@(16),%sp } _ISR_Enable( level ); 45eda: 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; 45edc: 4280 clrl %d0 } 45ede: 4cee 0c1c ffec moveml %fp@(-20),%d2-%d4/%a2-%a3 45ee4: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00047d30 : #include int sigsuspend( const sigset_t *sigmask ) { 47d30: 4e56 ffec linkw %fp,#-20 47d34: 48d7 040c moveml %d2-%d3/%a2,%sp@ int status; POSIX_API_Control *api; api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; status = sigprocmask( SIG_BLOCK, sigmask, &saved_signals_blocked ); 47d38: 240e movel %fp,%d2 47d3a: 5982 subql #4,%d2 47d3c: 45f9 0004 7d08 lea 47d08 ,%a2 (void) sigfillset( &all_signals ); 47d42: 260e movel %fp,%d3 47d44: 5183 subql #8,%d3 int status; POSIX_API_Control *api; api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; status = sigprocmask( SIG_BLOCK, sigmask, &saved_signals_blocked ); 47d46: 2f02 movel %d2,%sp@- 47d48: 2f2e 0008 movel %fp@(8),%sp@- 47d4c: 4878 0001 pea 1 47d50: 4e92 jsr %a2@ (void) sigfillset( &all_signals ); 47d52: 2f03 movel %d3,%sp@- 47d54: 4eb9 0004 7c68 jsr 47c68 status = sigtimedwait( &all_signals, NULL, NULL ); 47d5a: 42a7 clrl %sp@- 47d5c: 42a7 clrl %sp@- 47d5e: 2f03 movel %d3,%sp@- 47d60: 4eb9 0004 7de0 jsr 47de0 47d66: 2600 movel %d0,%d3 (void) sigprocmask( SIG_SETMASK, &saved_signals_blocked, NULL ); 47d68: 42a7 clrl %sp@- 47d6a: 2f02 movel %d2,%sp@- 47d6c: 42a7 clrl %sp@- 47d6e: 4e92 jsr %a2@ /* * sigtimedwait() returns the signal number while sigsuspend() * is supposed to return -1 and EINTR when a signal is caught. */ if ( status != -1 ) 47d70: 4fef 0028 lea %sp@(40),%sp 47d74: 70ff moveq #-1,%d0 47d76: b083 cmpl %d3,%d0 47d78: 670c beqs 47d86 <== NEVER TAKEN rtems_set_errno_and_return_minus_one( EINTR ); 47d7a: 4eb9 0004 f628 jsr 4f628 <__errno> 47d80: 2040 moveal %d0,%a0 47d82: 7004 moveq #4,%d0 47d84: 2080 movel %d0,%a0@ return status; } 47d86: 70ff moveq #-1,%d0 47d88: 4cee 040c ffec moveml %fp@(-20),%d2-%d3/%a2 47d8e: 4e5e unlk %fp ... =============================================================================== 00046210 : int sigtimedwait( const sigset_t *set, siginfo_t *info, const struct timespec *timeout ) { 46210: 4e56 ffd8 linkw %fp,#-40 46214: 48d7 3c1c moveml %d2-%d4/%a2-%a5,%sp@ 46218: 286e 0008 moveal %fp@(8),%a4 4621c: 246e 000c moveal %fp@(12),%a2 46220: 242e 0010 movel %fp@(16),%d2 ISR_Level level; /* * Error check parameters before disabling interrupts. */ if ( !set ) 46224: 4a8c tstl %a4 46226: 6732 beqs 4625a /* NOTE: This is very specifically a RELATIVE not ABSOLUTE time * in the Open Group specification. */ interval = 0; if ( timeout ) { 46228: 4a82 tstl %d2 4622a: 673c beqs 46268 if ( !_Timespec_Is_valid( timeout ) ) 4622c: 2f02 movel %d2,%sp@- 4622e: 4eb9 0004 94f8 jsr 494f8 <_Timespec_Is_valid> 46234: 588f addql #4,%sp 46236: 4a00 tstb %d0 46238: 6612 bnes 4624c rtems_set_errno_and_return_minus_one( EINVAL ); 4623a: 4eb9 0004 de04 jsr 4de04 <__errno> 46240: 7616 moveq #22,%d3 46242: 2240 moveal %d0,%a1 46244: 2283 movel %d3,%a1@ 46246: 74ff moveq #-1,%d2 46248: 6000 0124 braw 4636e interval = _Timespec_To_ticks( timeout ); 4624c: 2f02 movel %d2,%sp@- 4624e: 4eb9 0004 9564 jsr 49564 <_Timespec_To_ticks> if ( !interval ) 46254: 588f addql #4,%sp 46256: 4a80 tstl %d0 46258: 6610 bnes 4626a <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); 4625a: 4eb9 0004 de04 jsr 4de04 <__errno> 46260: 7416 moveq #22,%d2 46262: 2040 moveal %d0,%a0 46264: 2082 movel %d2,%a0@ 46266: 60de bras 46246 /* NOTE: This is very specifically a RELATIVE not ABSOLUTE time * in the Open Group specification. */ interval = 0; 46268: 4280 clrl %d0 /* * Initialize local variables. */ the_info = ( info ) ? info : &signal_information; 4626a: 4a8a tstl %a2 4626c: 6604 bnes 46272 4626e: 45ee fff4 lea %fp@(-12),%a2 the_thread = _Thread_Executing; 46272: 2079 0005 fe0c moveal 5fe0c <_Per_CPU_Information+0xc>,%a0 * What if they are already pending? */ /* API signals pending? */ _ISR_Disable( level ); 46278: 223c 0000 0700 movel #1792,%d1 the_info = ( info ) ? info : &signal_information; the_thread = _Thread_Executing; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4627e: 2668 010e moveal %a0@(270),%a3 * What if they are already pending? */ /* API signals pending? */ _ISR_Disable( level ); 46282: 40c3 movew %sr,%d3 46284: 8283 orl %d3,%d1 46286: 46c1 movew %d1,%sr if ( *set & api->signals_pending ) { 46288: 2414 movel %a4@,%d2 4628a: 2802 movel %d2,%d4 4628c: 222b 00d0 movel %a3@(208),%d1 46290: c881 andl %d1,%d4 46292: 672a beqs 462be /* XXX real info later */ the_info->si_signo = _POSIX_signals_Get_highest( api->signals_pending ); 46294: 2f01 movel %d1,%sp@- 46296: 4eb9 0004 61c4 jsr 461c4 <_POSIX_signals_Get_highest> 4629c: 2480 movel %d0,%a2@ _POSIX_signals_Clear_signals( 4629e: 4297 clrl %sp@ 462a0: 42a7 clrl %sp@- 462a2: 2f0a movel %a2,%sp@- 462a4: 2f00 movel %d0,%sp@- 462a6: 2f0b movel %a3,%sp@- 462a8: 4eb9 0004 b4b0 jsr 4b4b0 <_POSIX_signals_Clear_signals> the_info->si_signo, the_info, false, false ); _ISR_Enable( level ); 462ae: 46c3 movew %d3,%sr the_info->si_code = SI_USER; 462b0: 7001 moveq #1,%d0 the_info->si_value.sival_int = 0; 462b2: 42aa 0008 clrl %a2@(8) return the_info->si_signo; 462b6: 2412 movel %a2@,%d2 false, false ); _ISR_Enable( level ); the_info->si_code = SI_USER; 462b8: 2540 0004 movel %d0,%a2@(4) 462bc: 6036 bras 462f4 return the_info->si_signo; } /* Process pending signals? */ if ( *set & _POSIX_signals_Pending ) { 462be: 2239 0006 000e movel 6000e <_POSIX_signals_Pending>,%d1 462c4: 4bf9 0004 b4b0 lea 4b4b0 <_POSIX_signals_Clear_signals>,%a5 462ca: c481 andl %d1,%d2 462cc: 672c beqs 462fa signo = _POSIX_signals_Get_highest( _POSIX_signals_Pending ); 462ce: 2f01 movel %d1,%sp@- 462d0: 4eb9 0004 61c4 jsr 461c4 <_POSIX_signals_Get_highest> 462d6: 2400 movel %d0,%d2 _POSIX_signals_Clear_signals( api, signo, the_info, true, false ); 462d8: 4297 clrl %sp@ 462da: 4878 0001 pea 1 462de: 2f0a movel %a2,%sp@- 462e0: 2f00 movel %d0,%sp@- 462e2: 2f0b movel %a3,%sp@- 462e4: 4e95 jsr %a5@ _ISR_Enable( level ); 462e6: 46c3 movew %d3,%sr the_info->si_signo = signo; the_info->si_code = SI_USER; 462e8: 7201 moveq #1,%d1 if ( *set & _POSIX_signals_Pending ) { signo = _POSIX_signals_Get_highest( _POSIX_signals_Pending ); _POSIX_signals_Clear_signals( api, signo, the_info, true, false ); _ISR_Enable( level ); the_info->si_signo = signo; 462ea: 2482 movel %d2,%a2@ the_info->si_code = SI_USER; 462ec: 2541 0004 movel %d1,%a2@(4) the_info->si_value.sival_int = 0; 462f0: 42aa 0008 clrl %a2@(8) return signo; 462f4: 4fef 0014 lea %sp@(20),%sp 462f8: 6074 bras 4636e } the_info->si_signo = -1; 462fa: 72ff moveq #-1,%d1 462fc: 2481 movel %d1,%a2@ 462fe: 2239 0005 f97c movel 5f97c <_Thread_Dispatch_disable_level>,%d1 46304: 5281 addql #1,%d1 46306: 23c1 0005 f97c movel %d1,5f97c <_Thread_Dispatch_disable_level> _Thread_Disable_dispatch(); the_thread->Wait.queue = &_POSIX_signals_Wait_queue; the_thread->Wait.return_code = EINTR; 4630c: 7204 moveq #4,%d1 } the_info->si_signo = -1; _Thread_Disable_dispatch(); the_thread->Wait.queue = &_POSIX_signals_Wait_queue; 4630e: 43f9 0005 ffa6 lea 5ffa6 <_POSIX_signals_Wait_queue>,%a1 the_thread->Wait.return_code = EINTR; 46314: 2141 0034 movel %d1,%a0@(52) the_thread->Wait.option = *set; 46318: 2154 0030 movel %a4@,%a0@(48) RTEMS_INLINE_ROUTINE void _Thread_queue_Enter_critical_section ( Thread_queue_Control *the_thread_queue ) { the_thread_queue->sync_state = THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED; 4631c: 123c 0001 moveb #1,%d1 the_thread->Wait.return_argument = the_info; 46320: 214a 0028 movel %a2,%a0@(40) } the_info->si_signo = -1; _Thread_Disable_dispatch(); the_thread->Wait.queue = &_POSIX_signals_Wait_queue; 46324: 2149 0044 movel %a1,%a0@(68) 46328: 23c1 0005 ffd6 movel %d1,5ffd6 <_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 ); 4632e: 46c3 movew %d3,%sr _Thread_queue_Enqueue( &_POSIX_signals_Wait_queue, interval ); 46330: 4879 0004 8fc4 pea 48fc4 <_Thread_queue_Timeout> 46336: 2f00 movel %d0,%sp@- 46338: 4879 0005 ffa6 pea 5ffa6 <_POSIX_signals_Wait_queue> 4633e: 4eb9 0004 8cb4 jsr 48cb4 <_Thread_queue_Enqueue_with_handler> _Thread_Enable_dispatch(); 46344: 4eb9 0004 882e jsr 4882e <_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 ); 4634a: 42a7 clrl %sp@- 4634c: 42a7 clrl %sp@- 4634e: 2f0a movel %a2,%sp@- 46350: 2f12 movel %a2@,%sp@- 46352: 2f0b movel %a3,%sp@- 46354: 4e95 jsr %a5@ errno = _Thread_Executing->Wait.return_code; 46356: 4fef 0020 lea %sp@(32),%sp 4635a: 4eb9 0004 de04 jsr 4de04 <__errno> 46360: 2079 0005 fe0c moveal 5fe0c <_Per_CPU_Information+0xc>,%a0 46366: 2240 moveal %d0,%a1 46368: 22a8 0034 movel %a0@(52),%a1@ return the_info->si_signo; 4636c: 2412 movel %a2@,%d2 } 4636e: 2002 movel %d2,%d0 46370: 4cee 3c1c ffd8 moveml %fp@(-40),%d2-%d4/%a2-%a5 46376: 4e5e unlk %fp ... =============================================================================== 00047f64 : int sigwait( const sigset_t *set, int *sig ) { 47f64: 4e56 0000 linkw %fp,#0 47f68: 2f0a movel %a2,%sp@- 47f6a: 246e 000c moveal %fp@(12),%a2 int status; status = sigtimedwait( set, NULL, NULL ); 47f6e: 42a7 clrl %sp@- 47f70: 42a7 clrl %sp@- 47f72: 2f2e 0008 movel %fp@(8),%sp@- 47f76: 4eb9 0004 7de0 jsr 47de0 if ( status != -1 ) { 47f7c: 4fef 000c lea %sp@(12),%sp 47f80: 72ff moveq #-1,%d1 47f82: b280 cmpl %d0,%d1 47f84: 6708 beqs 47f8e if ( sig ) 47f86: 4a8a tstl %a2 47f88: 6710 beqs 47f9a <== NEVER TAKEN *sig = status; 47f8a: 2480 movel %d0,%a2@ 47f8c: 600c bras 47f9a return 0; } return errno; 47f8e: 4eb9 0004 f628 jsr 4f628 <__errno> 47f94: 2040 moveal %d0,%a0 47f96: 2010 movel %a0@,%d0 47f98: 6002 bras 47f9c status = sigtimedwait( set, NULL, NULL ); if ( status != -1 ) { if ( sig ) *sig = status; return 0; 47f9a: 4280 clrl %d0 } return errno; } 47f9c: 246e fffc moveal %fp@(-4),%a2 47fa0: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 00045428 : timer_t *timerid ) { POSIX_Timer_Control *ptimer; if ( clock_id != CLOCK_REALTIME ) 45428: 7001 moveq #1,%d0 int timer_create( clockid_t clock_id, struct sigevent *evp, timer_t *timerid ) { 4542a: 4e56 0000 linkw %fp,#0 4542e: 2f0b movel %a3,%sp@- 45430: 266e 0010 moveal %fp@(16),%a3 45434: 2f0a movel %a2,%sp@- 45436: 246e 000c moveal %fp@(12),%a2 POSIX_Timer_Control *ptimer; if ( clock_id != CLOCK_REALTIME ) 4543a: b0ae 0008 cmpl %fp@(8),%d0 4543e: 6620 bnes 45460 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !timerid ) 45440: 4a8b tstl %a3 45442: 671c beqs 45460 /* * The data of the structure evp are checked in order to verify if they * are coherent. */ if (evp != NULL) { 45444: 4a8a tstl %a2 45446: 6726 beqs 4546e /* The structure has data */ if ( ( evp->sigev_notify != SIGEV_NONE ) && 45448: 2012 movel %a2@,%d0 4544a: 7201 moveq #1,%d1 4544c: 5380 subql #1,%d0 4544e: b280 cmpl %d0,%d1 45450: 650e bcss 45460 <== 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 ) 45452: 202a 0004 movel %a2@(4),%d0 45456: 6708 beqs 45460 <== NEVER TAKEN static inline bool is_valid_signo( int signo ) { return ((signo) >= 1 && (signo) <= 32 ); 45458: 5380 subql #1,%d0 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(evp->sigev_signo) ) 4545a: 721f moveq #31,%d1 4545c: b280 cmpl %d0,%d1 4545e: 640e bccs 4546e <== ALWAYS TAKEN rtems_set_errno_and_return_minus_one( EINVAL ); 45460: 4eb9 0004 d314 jsr 4d314 <__errno> 45466: 7216 moveq #22,%d1 45468: 2040 moveal %d0,%a0 4546a: 2081 movel %d1,%a0@ 4546c: 6034 bras 454a2 rtems_fatal_error_occurred( 99 ); } } #endif _Thread_Dispatch_disable_level += 1; 4546e: 2039 0005 e48c movel 5e48c <_Thread_Dispatch_disable_level>,%d0 45474: 5280 addql #1,%d0 45476: 23c0 0005 e48c movel %d0,5e48c <_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 ); 4547c: 4879 0005 e702 pea 5e702 <_POSIX_Timer_Information> 45482: 4eb9 0004 70f4 jsr 470f4 <_Objects_Allocate> /* * Allocate a timer */ ptimer = _POSIX_Timer_Allocate(); if ( !ptimer ) { 45488: 588f addql #4,%sp 4548a: 2040 moveal %d0,%a0 4548c: 4a80 tstl %d0 4548e: 6616 bnes 454a6 _Thread_Enable_dispatch(); 45490: 4eb9 0004 7d32 jsr 47d32 <_Thread_Enable_dispatch> rtems_set_errno_and_return_minus_one( EAGAIN ); 45496: 4eb9 0004 d314 jsr 4d314 <__errno> 4549c: 2040 moveal %d0,%a0 4549e: 700b moveq #11,%d0 454a0: 2080 movel %d0,%a0@ 454a2: 70ff moveq #-1,%d0 454a4: 606a bras 45510 } /* The data of the created timer are stored to use them later */ ptimer->state = POSIX_TIMER_STATE_CREATE_NEW; 454a6: 7002 moveq #2,%d0 454a8: 1140 003c moveb %d0,%a0@(60) ptimer->thread_id = _Thread_Executing->Object.id; 454ac: 2279 0005 e91c moveal 5e91c <_Per_CPU_Information+0xc>,%a1 454b2: 2169 0008 0038 movel %a1@(8),%a0@(56) if ( evp != NULL ) { 454b8: 4a8a tstl %a2 454ba: 6710 beqs 454cc ptimer->inf.sigev_notify = evp->sigev_notify; 454bc: 2152 003e movel %a2@,%a0@(62) ptimer->inf.sigev_signo = evp->sigev_signo; 454c0: 216a 0004 0042 movel %a2@(4),%a0@(66) ptimer->inf.sigev_value = evp->sigev_value; 454c6: 216a 0008 0046 movel %a2@(8),%a0@(70) uint32_t name ) { _Objects_Set_local_object( information, _Objects_Get_index( the_object->id ), 454cc: 2028 0008 movel %a0@(8),%d0 Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 454d0: 4281 clrl %d1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 454d2: 2279 0005 e71a moveal 5e71a <_POSIX_Timer_Information+0x18>,%a1 Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 454d8: 3200 movew %d0,%d1 } ptimer->overrun = 0; 454da: 42a8 0066 clrl %a0@(102) ptimer->timer_data.it_value.tv_sec = 0; 454de: 42a8 005a clrl %a0@(90) ptimer->timer_data.it_value.tv_nsec = 0; 454e2: 42a8 005e clrl %a0@(94) ptimer->timer_data.it_interval.tv_sec = 0; 454e6: 42a8 0052 clrl %a0@(82) ptimer->timer_data.it_interval.tv_nsec = 0; 454ea: 42a8 0056 clrl %a0@(86) Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 454ee: 42a8 0018 clrl %a0@(24) the_watchdog->routine = routine; 454f2: 42a8 002c clrl %a0@(44) the_watchdog->id = id; 454f6: 42a8 0030 clrl %a0@(48) the_watchdog->user_data = user_data; 454fa: 42a8 0034 clrl %a0@(52) #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 454fe: 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; 45502: 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; 45506: 2680 movel %d0,%a3@ _Thread_Enable_dispatch(); 45508: 4eb9 0004 7d32 jsr 47d32 <_Thread_Enable_dispatch> return 0; 4550e: 4280 clrl %d0 } 45510: 246e fff8 moveal %fp@(-8),%a2 45514: 266e fffc moveal %fp@(-4),%a3 45518: 4e5e unlk %fp <== NOT EXECUTED =============================================================================== 000455ee : useconds_t ualarm( useconds_t useconds, useconds_t interval ) { 455ee: 4e56 ffe8 linkw %fp,#-24 455f2: 48d7 041c moveml %d2-%d4/%a2,%sp@ 455f6: 262e 0008 movel %fp@(8),%d3 /* * Initialize the timer used to implement alarm(). */ if ( !the_timer->routine ) { 455fa: 4ab9 0005 f91e tstl 5f91e <_POSIX_signals_Ualarm_timer+0x1c> 45600: 6620 bnes 45622 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 45602: 42b9 0005 f90a clrl 5f90a <_POSIX_signals_Ualarm_timer+0x8> the_watchdog->routine = routine; 45608: 203c 0004 55ac movel #284076,%d0 the_watchdog->id = id; 4560e: 42b9 0005 f922 clrl 5f922 <_POSIX_signals_Ualarm_timer+0x20> Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 45614: 23c0 0005 f91e movel %d0,5f91e <_POSIX_signals_Ualarm_timer+0x1c> the_watchdog->id = id; the_watchdog->user_data = user_data; 4561a: 42b9 0005 f926 clrl 5f926 <_POSIX_signals_Ualarm_timer+0x24> 45620: 6056 bras 45678 _Watchdog_Initialize( the_timer, _POSIX_signals_Ualarm_TSR, 0, NULL ); } else { Watchdog_States state; state = _Watchdog_Remove( the_timer ); 45622: 4879 0005 f902 pea 5f902 <_POSIX_signals_Ualarm_timer> 45628: 4eb9 0004 8d08 jsr 48d08 <_Watchdog_Remove> if ( (state == WATCHDOG_ACTIVE) || (state == WATCHDOG_REMOVE_IT) ) { 4562e: 588f addql #4,%sp 45630: 7201 moveq #1,%d1 45632: 5580 subql #2,%d0 45634: b280 cmpl %d0,%d1 45636: 6540 bcss 45678 <== 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); 45638: 2039 0005 f916 movel 5f916 <_POSIX_signals_Ualarm_timer+0x14>,%d0 4563e: d0b9 0005 f90e addl 5f90e <_POSIX_signals_Ualarm_timer+0xc>,%d0 /* remaining is now in ticks */ _Timespec_From_ticks( ticks, &tp ); 45644: 486e fff8 pea %fp@(-8) 45648: 90b9 0005 f91a subl 5f91a <_POSIX_signals_Ualarm_timer+0x18>,%d0 remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND; 4564e: 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 ); 45654: 2f00 movel %d0,%sp@- 45656: 4eb9 0004 882c jsr 4882c <_Timespec_From_ticks> remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND; 4565c: 202e fff8 movel %fp@(-8),%d0 45660: 4c04 0800 mulsl %d4,%d0 remaining += tp.tv_nsec / 1000; 45664: 283c 0000 03e8 movel #1000,%d4 4566a: 508f addql #8,%sp 4566c: 242e fffc movel %fp@(-4),%d2 45670: 4c44 2802 remsl %d4,%d2,%d2 45674: d480 addl %d0,%d2 45676: 6002 bras 4567a useconds_t ualarm( useconds_t useconds, useconds_t interval ) { useconds_t remaining = 0; 45678: 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 ) { 4567a: 4a83 tstl %d3 4567c: 674e beqs 456cc Watchdog_Interval ticks; tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND; tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; 4567e: 283c 0000 03e8 movel #1000,%d4 ticks = _Timespec_To_ticks( &tp ); 45684: 45f9 0004 88ac lea 488ac <_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; 4568a: 223c 000f 4240 movel #1000000,%d1 45690: 4c41 3000 remul %d1,%d0,%d3 45694: 4c41 3003 remul %d1,%d3,%d3 45698: 2d43 fff8 movel %d3,%fp@(-8) tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; 4569c: 4c00 4800 mulsl %d0,%d4 ticks = _Timespec_To_ticks( &tp ); 456a0: 260e movel %fp,%d3 456a2: 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; 456a4: 2d44 fffc movel %d4,%fp@(-4) ticks = _Timespec_To_ticks( &tp ); 456a8: 2f03 movel %d3,%sp@- 456aa: 4e92 jsr %a2@ if ( ticks == 0 ) ticks = 1; _Watchdog_Insert_ticks( the_timer, _Timespec_To_ticks( &tp ) ); 456ac: 2f03 movel %d3,%sp@- 456ae: 4e92 jsr %a2@ ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 456b0: 4879 0005 f902 pea 5f902 <_POSIX_signals_Ualarm_timer> 456b6: 4879 0005 f1ae pea 5f1ae <_Watchdog_Ticks_chain> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 456bc: 23c0 0005 f90e movel %d0,5f90e <_POSIX_signals_Ualarm_timer+0xc> _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 456c2: 4eb9 0004 8bec jsr 48bec <_Watchdog_Insert> 456c8: 4fef 0010 lea %sp@(16),%sp } return remaining; } 456cc: 2002 movel %d2,%d0 456ce: 4cee 041c ffe8 moveml %fp@(-24),%d2-%d4/%a2 456d4: 4e5e unlk %fp <== NOT EXECUTED