=============================================================================== 4000ad6c <_CORE_RWLock_Release>: #include CORE_RWLock_Status _CORE_RWLock_Release( CORE_RWLock_Control *the_rwlock ) { 4000ad6c: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; Thread_Control *executing = _Thread_Executing; 4000ad70: 03 10 00 6d sethi %hi(0x4001b400), %g1 * 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 ); 4000ad74: 7f ff e2 fc call 40003964 4000ad78: fa 00 60 20 ld [ %g1 + 0x20 ], %i5 ! 4001b420 <_Per_CPU_Information+0x10> 4000ad7c: 84 10 00 08 mov %o0, %g2 if ( the_rwlock->current_state == CORE_RWLOCK_UNLOCKED){ 4000ad80: c2 06 20 44 ld [ %i0 + 0x44 ], %g1 4000ad84: 80 a0 60 00 cmp %g1, 0 4000ad88: 12 80 00 08 bne 4000ada8 <_CORE_RWLock_Release+0x3c> 4000ad8c: 80 a0 60 01 cmp %g1, 1 _ISR_Enable( level ); 4000ad90: 7f ff e2 f9 call 40003974 4000ad94: b0 10 20 00 clr %i0 executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; 4000ad98: 82 10 20 02 mov 2, %g1 4000ad9c: c2 27 60 34 st %g1, [ %i5 + 0x34 ] 4000ada0: 81 c7 e0 08 ret 4000ada4: 81 e8 00 00 restore return CORE_RWLOCK_SUCCESSFUL; } if ( the_rwlock->current_state == CORE_RWLOCK_LOCKED_FOR_READING ) { 4000ada8: 32 80 00 0b bne,a 4000add4 <_CORE_RWLock_Release+0x68> 4000adac: c0 27 60 34 clr [ %i5 + 0x34 ] the_rwlock->number_of_readers -= 1; 4000adb0: c2 06 20 48 ld [ %i0 + 0x48 ], %g1 4000adb4: 82 00 7f ff add %g1, -1, %g1 if ( the_rwlock->number_of_readers != 0 ) { 4000adb8: 80 a0 60 00 cmp %g1, 0 4000adbc: 02 80 00 05 be 4000add0 <_CORE_RWLock_Release+0x64> 4000adc0: c2 26 20 48 st %g1, [ %i0 + 0x48 ] /* must be unlocked again */ _ISR_Enable( level ); 4000adc4: 7f ff e2 ec call 40003974 4000adc8: b0 10 20 00 clr %i0 return CORE_RWLOCK_SUCCESSFUL; 4000adcc: 30 80 00 24 b,a 4000ae5c <_CORE_RWLock_Release+0xf0> } } /* CORE_RWLOCK_LOCKED_FOR_WRITING or READING with readers */ executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 4000add0: c0 27 60 34 clr [ %i5 + 0x34 ] /* * Implicitly transition to "unlocked" and find another thread interested * in obtaining this rwlock. */ the_rwlock->current_state = CORE_RWLOCK_UNLOCKED; 4000add4: c0 26 20 44 clr [ %i0 + 0x44 ] _ISR_Enable( level ); 4000add8: 7f ff e2 e7 call 40003974 4000addc: 90 10 00 02 mov %g2, %o0 next = _Thread_queue_Dequeue( &the_rwlock->Wait_queue ); 4000ade0: 40 00 07 6d call 4000cb94 <_Thread_queue_Dequeue> 4000ade4: 90 10 00 18 mov %i0, %o0 if ( next ) { 4000ade8: 80 a2 20 00 cmp %o0, 0 4000adec: 22 80 00 1c be,a 4000ae5c <_CORE_RWLock_Release+0xf0> 4000adf0: b0 10 20 00 clr %i0 if ( next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) { 4000adf4: c2 02 20 30 ld [ %o0 + 0x30 ], %g1 4000adf8: 80 a0 60 01 cmp %g1, 1 4000adfc: 32 80 00 05 bne,a 4000ae10 <_CORE_RWLock_Release+0xa4> 4000ae00: c2 06 20 48 ld [ %i0 + 0x48 ], %g1 the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_WRITING; 4000ae04: 82 10 20 02 mov 2, %g1 return CORE_RWLOCK_SUCCESSFUL; 4000ae08: 10 80 00 14 b 4000ae58 <_CORE_RWLock_Release+0xec> 4000ae0c: c2 26 20 44 st %g1, [ %i0 + 0x44 ] } /* * Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING */ the_rwlock->number_of_readers += 1; 4000ae10: 82 00 60 01 inc %g1 4000ae14: c2 26 20 48 st %g1, [ %i0 + 0x48 ] the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING; 4000ae18: 82 10 20 01 mov 1, %g1 4000ae1c: c2 26 20 44 st %g1, [ %i0 + 0x44 ] /* * Now see if more readers can be let go. */ while ( 1 ) { next = _Thread_queue_First( &the_rwlock->Wait_queue ); 4000ae20: 40 00 08 99 call 4000d084 <_Thread_queue_First> 4000ae24: 90 10 00 18 mov %i0, %o0 if ( !next || 4000ae28: 92 92 20 00 orcc %o0, 0, %o1 4000ae2c: 22 80 00 0c be,a 4000ae5c <_CORE_RWLock_Release+0xf0> 4000ae30: b0 10 20 00 clr %i0 4000ae34: c2 02 60 30 ld [ %o1 + 0x30 ], %g1 4000ae38: 80 a0 60 01 cmp %g1, 1 4000ae3c: 02 80 00 07 be 4000ae58 <_CORE_RWLock_Release+0xec> <== NEVER TAKEN 4000ae40: 90 10 00 18 mov %i0, %o0 next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) return CORE_RWLOCK_SUCCESSFUL; the_rwlock->number_of_readers += 1; 4000ae44: c2 06 20 48 ld [ %i0 + 0x48 ], %g1 4000ae48: 82 00 60 01 inc %g1 _Thread_queue_Extract( &the_rwlock->Wait_queue, next ); 4000ae4c: 40 00 08 3f call 4000cf48 <_Thread_queue_Extract> 4000ae50: c2 26 20 48 st %g1, [ %i0 + 0x48 ] } 4000ae54: 30 bf ff f3 b,a 4000ae20 <_CORE_RWLock_Release+0xb4> } /* indentation is to match _ISR_Disable at top */ return CORE_RWLOCK_SUCCESSFUL; } 4000ae58: b0 10 20 00 clr %i0 4000ae5c: 81 c7 e0 08 ret 4000ae60: 81 e8 00 00 restore =============================================================================== 4000ae64 <_CORE_RWLock_Timeout>: void _CORE_RWLock_Timeout( Objects_Id id, void *ignored ) { 4000ae64: 9d e3 bf 98 save %sp, -104, %sp Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 4000ae68: 90 10 00 18 mov %i0, %o0 4000ae6c: 40 00 06 7e call 4000c864 <_Thread_Get> 4000ae70: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 4000ae74: c2 07 bf fc ld [ %fp + -4 ], %g1 4000ae78: 80 a0 60 00 cmp %g1, 0 4000ae7c: 12 80 00 08 bne 4000ae9c <_CORE_RWLock_Timeout+0x38> <== NEVER TAKEN 4000ae80: 01 00 00 00 nop #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 4000ae84: 40 00 08 bd call 4000d178 <_Thread_queue_Process_timeout> 4000ae88: 01 00 00 00 nop * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 4000ae8c: 03 10 00 6b sethi %hi(0x4001ac00), %g1 4000ae90: c4 00 63 00 ld [ %g1 + 0x300 ], %g2 ! 4001af00 <_Thread_Dispatch_disable_level> --level; 4000ae94: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = level; 4000ae98: c4 20 63 00 st %g2, [ %g1 + 0x300 ] 4000ae9c: 81 c7 e0 08 ret 4000aea0: 81 e8 00 00 restore =============================================================================== 40008efc <_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 ) { 40008efc: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; if ( (the_thread = _Thread_queue_Dequeue(&the_semaphore->Wait_queue)) ) { 40008f00: 90 10 00 18 mov %i0, %o0 40008f04: 40 00 07 3d call 4000abf8 <_Thread_queue_Dequeue> 40008f08: ba 10 00 18 mov %i0, %i5 40008f0c: 80 a2 20 00 cmp %o0, 0 40008f10: 12 80 00 0e bne 40008f48 <_CORE_semaphore_Surrender+0x4c> 40008f14: b0 10 20 00 clr %i0 if ( !_Objects_Is_local_id( the_thread->Object.id ) ) (*api_semaphore_mp_support) ( the_thread, id ); #endif } else { _ISR_Disable( level ); 40008f18: 7f ff e5 4c call 40002448 40008f1c: 01 00 00 00 nop if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 40008f20: c2 07 60 48 ld [ %i5 + 0x48 ], %g1 40008f24: c4 07 60 40 ld [ %i5 + 0x40 ], %g2 40008f28: 80 a0 40 02 cmp %g1, %g2 40008f2c: 1a 80 00 05 bcc 40008f40 <_CORE_semaphore_Surrender+0x44> <== NEVER TAKEN 40008f30: b0 10 20 04 mov 4, %i0 the_semaphore->count += 1; 40008f34: 82 00 60 01 inc %g1 { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 40008f38: b0 10 20 00 clr %i0 #endif } else { _ISR_Disable( level ); if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) the_semaphore->count += 1; 40008f3c: c2 27 60 48 st %g1, [ %i5 + 0x48 ] else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); 40008f40: 7f ff e5 46 call 40002458 40008f44: 01 00 00 00 nop } return status; } 40008f48: 81 c7 e0 08 ret 40008f4c: 81 e8 00 00 restore =============================================================================== 40007b84 <_Event_Surrender>: rtems_event_set event_in, Event_Control *event, Thread_blocking_operation_States *sync_state, States_Control wait_state ) { 40007b84: 9d e3 bf a0 save %sp, -96, %sp rtems_event_set pending_events; rtems_event_set event_condition; rtems_event_set seized_events; rtems_option option_set; option_set = the_thread->Wait.option; 40007b88: e0 06 20 30 ld [ %i0 + 0x30 ], %l0 _ISR_Disable( level ); 40007b8c: 7f ff ea 2f call 40002448 40007b90: ba 10 00 18 mov %i0, %i5 40007b94: b0 10 00 08 mov %o0, %i0 RTEMS_INLINE_ROUTINE void _Event_sets_Post( rtems_event_set the_new_events, rtems_event_set *the_event_set ) { *the_event_set |= the_new_events; 40007b98: c2 06 80 00 ld [ %i2 ], %g1 40007b9c: b2 16 40 01 or %i1, %g1, %i1 40007ba0: f2 26 80 00 st %i1, [ %i2 ] _Event_sets_Post( event_in, &event->pending_events ); pending_events = event->pending_events; event_condition = the_thread->Wait.count; 40007ba4: c4 07 60 24 ld [ %i5 + 0x24 ], %g2 seized_events = _Event_sets_Get( pending_events, event_condition ); /* * No events were seized in this operation */ if ( _Event_sets_Is_empty( seized_events ) ) { 40007ba8: 82 8e 40 02 andcc %i1, %g2, %g1 40007bac: 02 80 00 3d be 40007ca0 <_Event_Surrender+0x11c> 40007bb0: 07 10 00 7e sethi %hi(0x4001f800), %g3 /* * 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() && 40007bb4: 86 10 e1 90 or %g3, 0x190, %g3 ! 4001f990 <_Per_CPU_Information> 40007bb8: c8 00 e0 08 ld [ %g3 + 8 ], %g4 40007bbc: 80 a1 20 00 cmp %g4, 0 40007bc0: 22 80 00 18 be,a 40007c20 <_Event_Surrender+0x9c> 40007bc4: c6 07 60 10 ld [ %i5 + 0x10 ], %g3 40007bc8: c6 00 e0 10 ld [ %g3 + 0x10 ], %g3 40007bcc: 80 a7 40 03 cmp %i5, %g3 40007bd0: 32 80 00 14 bne,a 40007c20 <_Event_Surrender+0x9c> 40007bd4: c6 07 60 10 ld [ %i5 + 0x10 ], %g3 _Thread_Is_executing( the_thread ) && ((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || 40007bd8: c6 06 c0 00 ld [ %i3 ], %g3 40007bdc: 86 00 ff ff add %g3, -1, %g3 /* * 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 ) && 40007be0: 80 a0 e0 01 cmp %g3, 1 40007be4: 38 80 00 0f bgu,a 40007c20 <_Event_Surrender+0x9c> 40007be8: c6 07 60 10 ld [ %i5 + 0x10 ], %g3 ((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (*sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { 40007bec: 80 a0 40 02 cmp %g1, %g2 40007bf0: 02 80 00 04 be 40007c00 <_Event_Surrender+0x7c> 40007bf4: 80 8c 20 02 btst 2, %l0 40007bf8: 02 80 00 2a be 40007ca0 <_Event_Surrender+0x11c> <== NEVER TAKEN 40007bfc: 01 00 00 00 nop 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) ); 40007c00: b2 2e 40 01 andn %i1, %g1, %i1 event->pending_events = _Event_sets_Clear( pending_events, seized_events ); the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 40007c04: c4 07 60 28 ld [ %i5 + 0x28 ], %g2 if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) && ((*sync_state == THREAD_BLOCKING_OPERATION_TIMEOUT) || (*sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED)) ) { if ( seized_events == event_condition || _Options_Is_any(option_set) ) { event->pending_events = _Event_sets_Clear( 40007c08: f2 26 80 00 st %i1, [ %i2 ] pending_events, seized_events ); the_thread->Wait.count = 0; 40007c0c: c0 27 60 24 clr [ %i5 + 0x24 ] *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 40007c10: c2 20 80 00 st %g1, [ %g2 ] *sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 40007c14: 82 10 20 03 mov 3, %g1 40007c18: 10 80 00 22 b 40007ca0 <_Event_Surrender+0x11c> 40007c1c: c2 26 c0 00 st %g1, [ %i3 ] } /* * Otherwise, this is a normal send to another thread */ if ( _States_Are_set( the_thread->current_state, wait_state ) ) { 40007c20: 80 8f 00 03 btst %i4, %g3 40007c24: 02 80 00 1f be 40007ca0 <_Event_Surrender+0x11c> 40007c28: 80 a0 40 02 cmp %g1, %g2 if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { 40007c2c: 02 80 00 04 be 40007c3c <_Event_Surrender+0xb8> 40007c30: 80 8c 20 02 btst 2, %l0 40007c34: 02 80 00 1b be 40007ca0 <_Event_Surrender+0x11c> <== NEVER TAKEN 40007c38: 01 00 00 00 nop event->pending_events = _Event_sets_Clear( pending_events, seized_events ); the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 40007c3c: c4 07 60 28 ld [ %i5 + 0x28 ], %g2 40007c40: b2 2e 40 01 andn %i1, %g1, %i1 /* * Otherwise, this is a normal send to another thread */ if ( _States_Are_set( the_thread->current_state, wait_state ) ) { if ( seized_events == event_condition || _Options_Is_any( option_set ) ) { event->pending_events = _Event_sets_Clear( 40007c44: f2 26 80 00 st %i1, [ %i2 ] pending_events, seized_events ); the_thread->Wait.count = 0; 40007c48: c0 27 60 24 clr [ %i5 + 0x24 ] *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 40007c4c: c2 20 80 00 st %g1, [ %g2 ] _ISR_Flash( level ); 40007c50: 7f ff ea 02 call 40002458 40007c54: 90 10 00 18 mov %i0, %o0 40007c58: 7f ff e9 fc call 40002448 40007c5c: 01 00 00 00 nop if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 40007c60: c2 07 60 50 ld [ %i5 + 0x50 ], %g1 40007c64: 80 a0 60 02 cmp %g1, 2 40007c68: 02 80 00 06 be 40007c80 <_Event_Surrender+0xfc> 40007c6c: 82 10 20 03 mov 3, %g1 _ISR_Enable( level ); 40007c70: 7f ff e9 fa call 40002458 40007c74: 33 04 01 ff sethi %hi(0x1007fc00), %i1 RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 40007c78: 10 80 00 08 b 40007c98 <_Event_Surrender+0x114> 40007c7c: b2 16 63 f8 or %i1, 0x3f8, %i1 ! 1007fff8 RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 40007c80: c2 27 60 50 st %g1, [ %i5 + 0x50 ] _Thread_Unblock( the_thread ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 40007c84: 7f ff e9 f5 call 40002458 40007c88: 33 04 01 ff sethi %hi(0x1007fc00), %i1 (void) _Watchdog_Remove( &the_thread->Timer ); 40007c8c: 40 00 0e 6a call 4000b634 <_Watchdog_Remove> 40007c90: 90 07 60 48 add %i5, 0x48, %o0 40007c94: b2 16 63 f8 or %i1, 0x3f8, %i1 40007c98: 40 00 0a 2a call 4000a540 <_Thread_Clear_state> 40007c9c: 91 e8 00 1d restore %g0, %i5, %o0 _Thread_Unblock( the_thread ); } return; } } _ISR_Enable( level ); 40007ca0: 7f ff e9 ee call 40002458 40007ca4: 81 e8 00 00 restore =============================================================================== 40007ca8 <_Event_Timeout>: void _Event_Timeout( Objects_Id id, void *arg ) { 40007ca8: 9d e3 bf 98 save %sp, -104, %sp ISR_Level level; Thread_blocking_operation_States *sync_state; sync_state = arg; the_thread = _Thread_Get( id, &location ); 40007cac: 90 10 00 18 mov %i0, %o0 40007cb0: 40 00 0b 06 call 4000a8c8 <_Thread_Get> 40007cb4: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 40007cb8: c2 07 bf fc ld [ %fp + -4 ], %g1 40007cbc: 80 a0 60 00 cmp %g1, 0 40007cc0: 12 80 00 1b bne 40007d2c <_Event_Timeout+0x84> <== NEVER TAKEN 40007cc4: ba 10 00 08 mov %o0, %i5 * * 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 ); 40007cc8: 7f ff e9 e0 call 40002448 40007ccc: 01 00 00 00 nop RTEMS_INLINE_ROUTINE bool _Thread_Is_executing ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Executing ); 40007cd0: 03 10 00 7e sethi %hi(0x4001f800), %g1 return; } #endif the_thread->Wait.count = 0; if ( _Thread_Is_executing( the_thread ) ) { 40007cd4: c2 00 61 a0 ld [ %g1 + 0x1a0 ], %g1 ! 4001f9a0 <_Per_CPU_Information+0x10> 40007cd8: 80 a7 40 01 cmp %i5, %g1 40007cdc: 12 80 00 08 bne 40007cfc <_Event_Timeout+0x54> 40007ce0: c0 27 60 24 clr [ %i5 + 0x24 ] if ( *sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 40007ce4: c2 06 40 00 ld [ %i1 ], %g1 40007ce8: 80 a0 60 01 cmp %g1, 1 40007cec: 12 80 00 05 bne 40007d00 <_Event_Timeout+0x58> 40007cf0: 82 10 20 06 mov 6, %g1 *sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 40007cf4: 82 10 20 02 mov 2, %g1 40007cf8: c2 26 40 00 st %g1, [ %i1 ] } the_thread->Wait.return_code = RTEMS_TIMEOUT; 40007cfc: 82 10 20 06 mov 6, %g1 40007d00: c2 27 60 34 st %g1, [ %i5 + 0x34 ] _ISR_Enable( level ); 40007d04: 7f ff e9 d5 call 40002458 40007d08: 01 00 00 00 nop RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 40007d0c: 90 10 00 1d mov %i5, %o0 40007d10: 13 04 01 ff sethi %hi(0x1007fc00), %o1 40007d14: 40 00 0a 0b call 4000a540 <_Thread_Clear_state> 40007d18: 92 12 63 f8 or %o1, 0x3f8, %o1 ! 1007fff8 * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 40007d1c: 03 10 00 7d sethi %hi(0x4001f400), %g1 40007d20: c4 00 60 80 ld [ %g1 + 0x80 ], %g2 ! 4001f480 <_Thread_Dispatch_disable_level> --level; 40007d24: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = level; 40007d28: c4 20 60 80 st %g2, [ %g1 + 0x80 ] 40007d2c: 81 c7 e0 08 ret 40007d30: 81 e8 00 00 restore =============================================================================== 4000dcb0 <_Heap_Free>: return do_free; } #endif bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { 4000dcb0: 9d e3 bf a0 save %sp, -96, %sp /* * If NULL return true so a free on NULL is considered a valid release. This * is a special case that could be handled by the in heap check how-ever that * would result in false being returned which is wrong. */ if ( alloc_begin_ptr == NULL ) { 4000dcb4: 80 a6 60 00 cmp %i1, 0 4000dcb8: 02 80 00 7a be 4000dea0 <_Heap_Free+0x1f0> 4000dcbc: 88 10 20 01 mov 1, %g4 4000dcc0: d2 06 20 10 ld [ %i0 + 0x10 ], %o1 4000dcc4: 40 00 2c a3 call 40018f50 <.urem> 4000dcc8: 90 10 00 19 mov %i1, %o0 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 4000dccc: f6 06 20 20 ld [ %i0 + 0x20 ], %i3 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4000dcd0: ba 06 7f f8 add %i1, -8, %i5 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 4000dcd4: 90 27 40 08 sub %i5, %o0, %o0 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; 4000dcd8: 80 a2 00 1b cmp %o0, %i3 4000dcdc: 0a 80 00 05 bcs 4000dcf0 <_Heap_Free+0x40> 4000dce0: 82 10 20 00 clr %g1 4000dce4: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 4000dce8: 80 a0 40 08 cmp %g1, %o0 4000dcec: 82 60 3f ff subx %g0, -1, %g1 } alloc_begin = (uintptr_t) alloc_begin_ptr; block = _Heap_Block_of_alloc_area( alloc_begin, heap->page_size ); if ( !_Heap_Is_block_in_heap( heap, block ) ) { 4000dcf0: 80 a0 60 00 cmp %g1, 0 4000dcf4: 02 80 00 6b be 4000dea0 <_Heap_Free+0x1f0> 4000dcf8: 88 10 20 00 clr %g4 - 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; 4000dcfc: f8 02 20 04 ld [ %o0 + 4 ], %i4 4000dd00: 84 0f 3f fe and %i4, -2, %g2 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4000dd04: 82 02 00 02 add %o0, %g2, %g1 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; 4000dd08: 80 a0 40 1b cmp %g1, %i3 4000dd0c: 0a 80 00 05 bcs 4000dd20 <_Heap_Free+0x70> <== NEVER TAKEN 4000dd10: 86 10 20 00 clr %g3 4000dd14: c6 06 20 24 ld [ %i0 + 0x24 ], %g3 4000dd18: 80 a0 c0 01 cmp %g3, %g1 4000dd1c: 86 60 3f ff subx %g0, -1, %g3 _Heap_Protection_block_check( heap, block ); block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 4000dd20: 80 a0 e0 00 cmp %g3, 0 4000dd24: 02 80 00 5f be 4000dea0 <_Heap_Free+0x1f0> <== NEVER TAKEN 4000dd28: 88 10 20 00 clr %g4 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; 4000dd2c: fa 00 60 04 ld [ %g1 + 4 ], %i5 return false; } _Heap_Protection_block_check( heap, next_block ); if ( !_Heap_Is_prev_used( next_block ) ) { 4000dd30: 80 8f 60 01 btst 1, %i5 4000dd34: 22 80 00 5c be,a 4000dea4 <_Heap_Free+0x1f4> <== NEVER TAKEN 4000dd38: b0 09 20 01 and %g4, 1, %i0 <== NOT EXECUTED if ( !_Heap_Protection_determine_block_free( heap, block ) ) { return true; } next_block_size = _Heap_Block_size( next_block ); next_is_free = next_block != heap->last_block 4000dd3c: c8 06 20 24 ld [ %i0 + 0x24 ], %g4 && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); 4000dd40: 80 a0 40 04 cmp %g1, %g4 4000dd44: 02 80 00 07 be 4000dd60 <_Heap_Free+0xb0> 4000dd48: ba 0f 7f fe and %i5, -2, %i5 4000dd4c: 86 00 40 1d add %g1, %i5, %g3 4000dd50: f4 00 e0 04 ld [ %g3 + 4 ], %i2 4000dd54: b4 1e a0 01 xor %i2, 1, %i2 4000dd58: 10 80 00 03 b 4000dd64 <_Heap_Free+0xb4> 4000dd5c: b4 0e a0 01 and %i2, 1, %i2 4000dd60: b4 10 20 00 clr %i2 if ( !_Heap_Is_prev_used( block ) ) { 4000dd64: 80 8f 20 01 btst 1, %i4 4000dd68: 12 80 00 26 bne 4000de00 <_Heap_Free+0x150> 4000dd6c: 80 8e a0 ff btst 0xff, %i2 uintptr_t const prev_size = block->prev_size; 4000dd70: f8 02 00 00 ld [ %o0 ], %i4 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4000dd74: 86 22 00 1c sub %o0, %i4, %g3 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; 4000dd78: 80 a0 c0 1b cmp %g3, %i3 4000dd7c: 0a 80 00 04 bcs 4000dd8c <_Heap_Free+0xdc> <== NEVER TAKEN 4000dd80: b2 10 20 00 clr %i1 4000dd84: 80 a1 00 03 cmp %g4, %g3 4000dd88: b2 60 3f ff subx %g0, -1, %i1 Heap_Block * const prev_block = _Heap_Block_at( block, -prev_size ); if ( !_Heap_Is_block_in_heap( heap, prev_block ) ) { 4000dd8c: 80 a6 60 00 cmp %i1, 0 4000dd90: 02 80 00 44 be 4000dea0 <_Heap_Free+0x1f0> <== NEVER TAKEN 4000dd94: 88 10 20 00 clr %g4 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; 4000dd98: f6 00 e0 04 ld [ %g3 + 4 ], %i3 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) ) { 4000dd9c: 80 8e e0 01 btst 1, %i3 4000dda0: 02 80 00 40 be 4000dea0 <_Heap_Free+0x1f0> <== NEVER TAKEN 4000dda4: 80 8e a0 ff btst 0xff, %i2 _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ 4000dda8: 22 80 00 0f be,a 4000dde4 <_Heap_Free+0x134> 4000ddac: b8 00 80 1c add %g2, %i4, %i4 return _Heap_Free_list_tail(heap)->prev; } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; 4000ddb0: c8 00 60 08 ld [ %g1 + 8 ], %g4 Heap_Block *prev = block->prev; 4000ddb4: c2 00 60 0c ld [ %g1 + 0xc ], %g1 uintptr_t const size = block_size + prev_size + next_block_size; 4000ddb8: ba 00 80 1d add %g2, %i5, %i5 prev->next = next; 4000ddbc: c8 20 60 08 st %g4, [ %g1 + 8 ] next->prev = prev; 4000ddc0: c2 21 20 0c st %g1, [ %g4 + 0xc ] _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 4000ddc4: c2 06 20 38 ld [ %i0 + 0x38 ], %g1 _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ uintptr_t const size = block_size + prev_size + next_block_size; 4000ddc8: b8 07 40 1c add %i5, %i4, %i4 _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 4000ddcc: 82 00 7f ff add %g1, -1, %g1 4000ddd0: c2 26 20 38 st %g1, [ %i0 + 0x38 ] 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; 4000ddd4: f8 20 c0 1c st %i4, [ %g3 + %i4 ] 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; 4000ddd8: 82 17 20 01 or %i4, 1, %g1 4000dddc: 10 80 00 27 b 4000de78 <_Heap_Free+0x1c8> 4000dde0: c2 20 e0 04 st %g1, [ %g3 + 4 ] 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; 4000dde4: 88 17 20 01 or %i4, 1, %g4 4000dde8: c8 20 e0 04 st %g4, [ %g3 + 4 ] next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4000ddec: c6 00 60 04 ld [ %g1 + 4 ], %g3 next_block->prev_size = size; 4000ddf0: f8 22 00 02 st %i4, [ %o0 + %g2 ] _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; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4000ddf4: 86 08 ff fe and %g3, -2, %g3 4000ddf8: 10 80 00 20 b 4000de78 <_Heap_Free+0x1c8> 4000ddfc: c6 20 60 04 st %g3, [ %g1 + 4 ] next_block->prev_size = size; } } else if ( next_is_free ) { /* coalesce next */ 4000de00: 22 80 00 0d be,a 4000de34 <_Heap_Free+0x184> 4000de04: c6 06 20 08 ld [ %i0 + 8 ], %g3 RTEMS_INLINE_ROUTINE void _Heap_Free_list_replace( Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; 4000de08: c8 00 60 08 ld [ %g1 + 8 ], %g4 Heap_Block *prev = old_block->prev; 4000de0c: c2 00 60 0c ld [ %g1 + 0xc ], %g1 new_block->next = next; 4000de10: c8 22 20 08 st %g4, [ %o0 + 8 ] new_block->prev = prev; 4000de14: c2 22 20 0c st %g1, [ %o0 + 0xc ] uintptr_t const size = block_size + next_block_size; 4000de18: 86 07 40 02 add %i5, %g2, %g3 next->prev = new_block; prev->next = new_block; 4000de1c: d0 20 60 08 st %o0, [ %g1 + 8 ] Heap_Block *prev = old_block->prev; new_block->next = next; new_block->prev = prev; next->prev = new_block; 4000de20: d0 21 20 0c st %o0, [ %g4 + 0xc ] _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4000de24: 82 10 e0 01 or %g3, 1, %g1 next_block = _Heap_Block_at( block, size ); next_block->prev_size = size; 4000de28: c6 22 00 03 st %g3, [ %o0 + %g3 ] 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; 4000de2c: 10 80 00 13 b 4000de78 <_Heap_Free+0x1c8> 4000de30: c2 22 20 04 st %g1, [ %o0 + 4 ] ) { Heap_Block *next = block_before->next; new_block->next = next; new_block->prev = block_before; 4000de34: f0 22 20 0c st %i0, [ %o0 + 0xc ] Heap_Block *new_block ) { Heap_Block *next = block_before->next; new_block->next = next; 4000de38: c6 22 20 08 st %g3, [ %o0 + 8 ] new_block->prev = block_before; block_before->next = new_block; next->prev = new_block; 4000de3c: d0 20 e0 0c st %o0, [ %g3 + 0xc ] 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; 4000de40: 86 10 a0 01 or %g2, 1, %g3 4000de44: c6 22 20 04 st %g3, [ %o0 + 4 ] next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4000de48: c6 00 60 04 ld [ %g1 + 4 ], %g3 next_block->prev_size = block_size; 4000de4c: c4 22 00 02 st %g2, [ %o0 + %g2 ] } 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; 4000de50: 86 08 ff fe and %g3, -2, %g3 4000de54: c6 20 60 04 st %g3, [ %g1 + 4 ] next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; 4000de58: c2 06 20 38 ld [ %i0 + 0x38 ], %g1 if ( stats->max_free_blocks < stats->free_blocks ) { 4000de5c: c6 06 20 3c ld [ %i0 + 0x3c ], %g3 block->size_and_flag = block_size | HEAP_PREV_BLOCK_USED; next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; 4000de60: 82 00 60 01 inc %g1 { Heap_Block *next = block_before->next; new_block->next = next; new_block->prev = block_before; block_before->next = new_block; 4000de64: d0 26 20 08 st %o0, [ %i0 + 8 ] if ( stats->max_free_blocks < stats->free_blocks ) { 4000de68: 80 a0 c0 01 cmp %g3, %g1 4000de6c: 1a 80 00 03 bcc 4000de78 <_Heap_Free+0x1c8> 4000de70: c2 26 20 38 st %g1, [ %i0 + 0x38 ] stats->max_free_blocks = stats->free_blocks; 4000de74: c2 26 20 3c st %g1, [ %i0 + 0x3c ] } } /* Statistics */ --stats->used_blocks; 4000de78: c2 06 20 40 ld [ %i0 + 0x40 ], %g1 4000de7c: 82 00 7f ff add %g1, -1, %g1 4000de80: c2 26 20 40 st %g1, [ %i0 + 0x40 ] ++stats->frees; 4000de84: c2 06 20 50 ld [ %i0 + 0x50 ], %g1 4000de88: 82 00 60 01 inc %g1 4000de8c: c2 26 20 50 st %g1, [ %i0 + 0x50 ] stats->free_size += block_size; 4000de90: c2 06 20 30 ld [ %i0 + 0x30 ], %g1 4000de94: 84 00 40 02 add %g1, %g2, %g2 4000de98: c4 26 20 30 st %g2, [ %i0 + 0x30 ] * If NULL return true so a free on NULL is considered a valid release. This * is a special case that could be handled by the in heap check how-ever that * would result in false being returned which is wrong. */ if ( alloc_begin_ptr == NULL ) { return true; 4000de9c: 88 10 20 01 mov 1, %g4 --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 4000dea0: b0 09 20 01 and %g4, 1, %i0 4000dea4: 81 c7 e0 08 ret 4000dea8: 81 e8 00 00 restore =============================================================================== 4000b0ec <_Heap_Greedy_allocate>: Heap_Block *_Heap_Greedy_allocate( Heap_Control *heap, const uintptr_t *block_sizes, size_t block_count ) { 4000b0ec: 9d e3 bf a0 save %sp, -96, %sp Heap_Block *allocated_blocks = NULL; Heap_Block *blocks = NULL; Heap_Block *current; size_t i; for (i = 0; i < block_count; ++i) { 4000b0f0: b6 10 20 00 clr %i3 Heap_Block *_Heap_Greedy_allocate( Heap_Control *heap, const uintptr_t *block_sizes, size_t block_count ) { 4000b0f4: ba 10 00 18 mov %i0, %i5 Heap_Block *allocated_blocks = NULL; Heap_Block *blocks = NULL; Heap_Block *current; size_t i; for (i = 0; i < block_count; ++i) { 4000b0f8: 10 80 00 11 b 4000b13c <_Heap_Greedy_allocate+0x50> 4000b0fc: b8 10 20 00 clr %i4 * @brief See _Heap_Allocate_aligned_with_boundary() with alignment and * boundary equals zero. */ RTEMS_INLINE_ROUTINE void *_Heap_Allocate( Heap_Control *heap, uintptr_t size ) { return _Heap_Allocate_aligned_with_boundary( heap, size, 0, 0 ); 4000b100: d2 06 40 01 ld [ %i1 + %g1 ], %o1 4000b104: 90 10 00 1d mov %i5, %o0 4000b108: 94 10 20 00 clr %o2 4000b10c: 40 00 1d 80 call 4001270c <_Heap_Allocate_aligned_with_boundary> 4000b110: 96 10 20 00 clr %o3 void *next = _Heap_Allocate( heap, block_sizes [i] ); if ( next != NULL ) { 4000b114: 82 92 20 00 orcc %o0, 0, %g1 4000b118: 22 80 00 09 be,a 4000b13c <_Heap_Greedy_allocate+0x50> <== NEVER TAKEN 4000b11c: b6 06 e0 01 inc %i3 <== NOT EXECUTED RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4000b120: d2 07 60 10 ld [ %i5 + 0x10 ], %o1 4000b124: 40 00 34 71 call 400182e8 <.urem> 4000b128: b0 00 7f f8 add %g1, -8, %i0 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 4000b12c: 90 26 00 08 sub %i0, %o0, %o0 Heap_Block *next_block = _Heap_Block_of_alloc_area( (uintptr_t) next, heap->page_size ); next_block->next = allocated_blocks; 4000b130: f8 22 20 08 st %i4, [ %o0 + 8 ] 4000b134: b8 10 00 08 mov %o0, %i4 Heap_Block *allocated_blocks = NULL; Heap_Block *blocks = NULL; Heap_Block *current; size_t i; for (i = 0; i < block_count; ++i) { 4000b138: b6 06 e0 01 inc %i3 4000b13c: 80 a6 c0 1a cmp %i3, %i2 4000b140: 12 bf ff f0 bne 4000b100 <_Heap_Greedy_allocate+0x14> 4000b144: 83 2e e0 02 sll %i3, 2, %g1 4000b148: 10 80 00 0a b 4000b170 <_Heap_Greedy_allocate+0x84> 4000b14c: b0 10 20 00 clr %i0 allocated_blocks = next_block; } } while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) { _Heap_Block_allocate( 4000b150: 90 10 00 1d mov %i5, %o0 } RTEMS_INLINE_ROUTINE uintptr_t _Heap_Block_size( const Heap_Block *block ) { return block->size_and_flag & ~HEAP_PREV_BLOCK_USED; 4000b154: 96 0a ff fe and %o3, -2, %o3 4000b158: 92 10 00 1b mov %i3, %o1 4000b15c: 94 06 e0 08 add %i3, 8, %o2 4000b160: 40 00 00 cb call 4000b48c <_Heap_Block_allocate> 4000b164: 96 02 ff f8 add %o3, -8, %o3 current, _Heap_Alloc_area_of_block( current ), _Heap_Block_size( current ) - HEAP_BLOCK_HEADER_SIZE ); current->next = blocks; 4000b168: f0 26 e0 08 st %i0, [ %i3 + 8 ] 4000b16c: b0 10 00 1b mov %i3, %i0 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 4000b170: f6 07 60 08 ld [ %i5 + 8 ], %i3 next_block->next = allocated_blocks; allocated_blocks = next_block; } } while ( (current = _Heap_Free_list_first( heap )) != free_list_tail ) { 4000b174: 80 a6 c0 1d cmp %i3, %i5 4000b178: 32 bf ff f6 bne,a 4000b150 <_Heap_Greedy_allocate+0x64> 4000b17c: d6 06 e0 04 ld [ %i3 + 4 ], %o3 current->next = blocks; blocks = current; } while ( allocated_blocks != NULL ) { 4000b180: 10 80 00 07 b 4000b19c <_Heap_Greedy_allocate+0xb0> 4000b184: 80 a7 20 00 cmp %i4, 0 current = allocated_blocks; allocated_blocks = allocated_blocks->next; _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); 4000b188: 92 07 20 08 add %i4, 8, %o1 4000b18c: 90 10 00 1d mov %i5, %o0 4000b190: 40 00 1d d0 call 400128d0 <_Heap_Free> 4000b194: b8 10 00 1b mov %i3, %i4 current->next = blocks; blocks = current; } while ( allocated_blocks != NULL ) { 4000b198: 80 a7 20 00 cmp %i4, 0 4000b19c: 32 bf ff fb bne,a 4000b188 <_Heap_Greedy_allocate+0x9c> 4000b1a0: f6 07 20 08 ld [ %i4 + 8 ], %i3 allocated_blocks = allocated_blocks->next; _Heap_Free( heap, (void *) _Heap_Alloc_area_of_block( current ) ); } return blocks; } 4000b1a4: 81 c7 e0 08 ret 4000b1a8: 81 e8 00 00 restore =============================================================================== 40013714 <_Heap_Iterate>: void _Heap_Iterate( Heap_Control *heap, Heap_Block_visitor visitor, void *visitor_arg ) { 40013714: 9d e3 bf a0 save %sp, -96, %sp <== NOT EXECUTED Heap_Block *current = heap->first_block; Heap_Block *end = heap->last_block; bool stop = false; 40013718: 90 10 20 00 clr %o0 <== NOT EXECUTED Heap_Control *heap, Heap_Block_visitor visitor, void *visitor_arg ) { Heap_Block *current = heap->first_block; 4001371c: c2 06 20 20 ld [ %i0 + 0x20 ], %g1 <== NOT EXECUTED Heap_Block *end = heap->last_block; bool stop = false; while ( !stop && current != end ) { 40013720: 10 80 00 0a b 40013748 <_Heap_Iterate+0x34> <== NOT EXECUTED 40013724: f8 06 20 24 ld [ %i0 + 0x24 ], %i4 <== NOT EXECUTED uintptr_t size = _Heap_Block_size( current ); Heap_Block *next = _Heap_Block_at( current, size ); bool used = _Heap_Is_prev_used( next ); stop = (*visitor)( current, size, used, visitor_arg ); 40013728: 90 10 00 01 mov %g1, %o0 <== NOT EXECUTED 4001372c: 92 0a 7f fe and %o1, -2, %o1 <== NOT EXECUTED RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 40013730: ba 00 40 09 add %g1, %o1, %i5 <== NOT EXECUTED 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; 40013734: d4 07 60 04 ld [ %i5 + 4 ], %o2 <== NOT EXECUTED 40013738: 96 10 00 1a mov %i2, %o3 <== NOT EXECUTED 4001373c: 9f c6 40 00 call %i1 <== NOT EXECUTED 40013740: 94 0a a0 01 and %o2, 1, %o2 <== NOT EXECUTED 40013744: 82 10 00 1d mov %i5, %g1 <== NOT EXECUTED { Heap_Block *current = heap->first_block; Heap_Block *end = heap->last_block; bool stop = false; while ( !stop && current != end ) { 40013748: 80 a0 40 1c cmp %g1, %i4 <== NOT EXECUTED 4001374c: 02 80 00 05 be 40013760 <_Heap_Iterate+0x4c> <== NOT EXECUTED 40013750: 90 1a 20 01 xor %o0, 1, %o0 <== NOT EXECUTED 40013754: 80 8a 20 ff btst 0xff, %o0 <== NOT EXECUTED 40013758: 32 bf ff f4 bne,a 40013728 <_Heap_Iterate+0x14> <== NOT EXECUTED 4001375c: d2 00 60 04 ld [ %g1 + 4 ], %o1 <== NOT EXECUTED 40013760: 81 c7 e0 08 ret <== NOT EXECUTED 40013764: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 4001c4b8 <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { 4001c4b8: 9d e3 bf a0 save %sp, -96, %sp RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4001c4bc: d2 06 20 10 ld [ %i0 + 0x10 ], %o1 4001c4c0: 7f ff f2 a4 call 40018f50 <.urem> 4001c4c4: 90 10 00 19 mov %i1, %o0 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 4001c4c8: c8 06 20 20 ld [ %i0 + 0x20 ], %g4 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4001c4cc: ba 06 7f f8 add %i1, -8, %i5 uintptr_t alloc_begin, uintptr_t page_size ) { return (Heap_Block *) (_Heap_Align_down( alloc_begin, page_size ) - HEAP_BLOCK_HEADER_SIZE); 4001c4d0: 90 27 40 08 sub %i5, %o0, %o0 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; 4001c4d4: 80 a2 00 04 cmp %o0, %g4 4001c4d8: 0a 80 00 05 bcs 4001c4ec <_Heap_Size_of_alloc_area+0x34> 4001c4dc: 82 10 20 00 clr %g1 4001c4e0: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 4001c4e4: 80 a0 40 08 cmp %g1, %o0 4001c4e8: 82 60 3f ff subx %g0, -1, %g1 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 ) ) { 4001c4ec: 80 a0 60 00 cmp %g1, 0 4001c4f0: 02 80 00 15 be 4001c544 <_Heap_Size_of_alloc_area+0x8c> 4001c4f4: 86 10 20 00 clr %g3 - 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; 4001c4f8: c2 02 20 04 ld [ %o0 + 4 ], %g1 4001c4fc: 82 08 7f fe and %g1, -2, %g1 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4001c500: 82 02 00 01 add %o0, %g1, %g1 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; 4001c504: 80 a0 40 04 cmp %g1, %g4 4001c508: 0a 80 00 05 bcs 4001c51c <_Heap_Size_of_alloc_area+0x64> <== NEVER TAKEN 4001c50c: 84 10 20 00 clr %g2 4001c510: c4 06 20 24 ld [ %i0 + 0x24 ], %g2 4001c514: 80 a0 80 01 cmp %g2, %g1 4001c518: 84 60 3f ff subx %g0, -1, %g2 } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( 4001c51c: 80 a0 a0 00 cmp %g2, 0 4001c520: 02 80 00 09 be 4001c544 <_Heap_Size_of_alloc_area+0x8c> <== NEVER TAKEN 4001c524: 86 10 20 00 clr %g3 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; 4001c528: c4 00 60 04 ld [ %g1 + 4 ], %g2 !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) 4001c52c: 80 88 a0 01 btst 1, %g2 4001c530: 02 80 00 05 be 4001c544 <_Heap_Size_of_alloc_area+0x8c> <== NEVER TAKEN 4001c534: 82 20 40 19 sub %g1, %i1, %g1 return false; } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; return true; 4001c538: 86 10 20 01 mov 1, %g3 || !_Heap_Is_prev_used( next_block ) ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; 4001c53c: 82 00 60 04 add %g1, 4, %g1 4001c540: c2 26 80 00 st %g1, [ %i2 ] return true; } 4001c544: b0 08 e0 01 and %g3, 1, %i0 4001c548: 81 c7 e0 08 ret 4001c54c: 81 e8 00 00 restore =============================================================================== 40009ce4 <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 40009ce4: 9d e3 bf 80 save %sp, -128, %sp 40009ce8: ac 10 00 19 mov %i1, %l6 uintptr_t const page_size = heap->page_size; 40009cec: f8 06 20 10 ld [ %i0 + 0x10 ], %i4 uintptr_t const min_block_size = heap->min_block_size; 40009cf0: f6 06 20 14 ld [ %i0 + 0x14 ], %i3 Heap_Block *const first_block = heap->first_block; 40009cf4: f2 06 20 20 ld [ %i0 + 0x20 ], %i1 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; 40009cf8: 80 a6 a0 00 cmp %i2, 0 40009cfc: 02 80 00 05 be 40009d10 <_Heap_Walk+0x2c> 40009d00: e0 06 20 24 ld [ %i0 + 0x24 ], %l0 40009d04: 3b 10 00 27 sethi %hi(0x40009c00), %i5 40009d08: 10 80 00 04 b 40009d18 <_Heap_Walk+0x34> 40009d0c: ba 17 60 94 or %i5, 0x94, %i5 ! 40009c94 <_Heap_Walk_print> 40009d10: 3b 10 00 27 sethi %hi(0x40009c00), %i5 40009d14: ba 17 60 8c or %i5, 0x8c, %i5 ! 40009c8c <_Heap_Walk_print_nothing> if ( !_System_state_Is_up( _System_state_Get() ) ) { 40009d18: 05 10 00 66 sethi %hi(0x40019800), %g2 40009d1c: c4 00 a1 e8 ld [ %g2 + 0x1e8 ], %g2 ! 400199e8 <_System_state_Current> 40009d20: 80 a0 a0 03 cmp %g2, 3 40009d24: 22 80 00 04 be,a 40009d34 <_Heap_Walk+0x50> 40009d28: c4 06 20 1c ld [ %i0 + 0x1c ], %g2 return true; 40009d2c: 10 80 01 2a b 4000a1d4 <_Heap_Walk+0x4f0> 40009d30: b0 10 20 01 mov 1, %i0 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)( 40009d34: da 06 20 18 ld [ %i0 + 0x18 ], %o5 40009d38: c4 23 a0 5c st %g2, [ %sp + 0x5c ] 40009d3c: f2 23 a0 60 st %i1, [ %sp + 0x60 ] 40009d40: e0 23 a0 64 st %l0, [ %sp + 0x64 ] 40009d44: c4 06 20 08 ld [ %i0 + 8 ], %g2 40009d48: 90 10 00 16 mov %l6, %o0 40009d4c: c4 23 a0 68 st %g2, [ %sp + 0x68 ] 40009d50: c4 06 20 0c ld [ %i0 + 0xc ], %g2 40009d54: 92 10 20 00 clr %o1 40009d58: c4 23 a0 6c st %g2, [ %sp + 0x6c ] 40009d5c: 15 10 00 5a sethi %hi(0x40016800), %o2 40009d60: 96 10 00 1c mov %i4, %o3 40009d64: 94 12 a1 90 or %o2, 0x190, %o2 40009d68: 9f c7 40 00 call %i5 40009d6c: 98 10 00 1b mov %i3, %o4 heap->area_begin, heap->area_end, first_block, last_block, first_free_block, last_free_block ); if ( page_size == 0 ) { 40009d70: 80 a7 20 00 cmp %i4, 0 40009d74: 12 80 00 07 bne 40009d90 <_Heap_Walk+0xac> 40009d78: 80 8f 20 07 btst 7, %i4 (*printer)( source, true, "page size is zero\n" ); 40009d7c: 15 10 00 5a sethi %hi(0x40016800), %o2 40009d80: 90 10 00 16 mov %l6, %o0 40009d84: 92 10 20 01 mov 1, %o1 40009d88: 10 80 00 37 b 40009e64 <_Heap_Walk+0x180> 40009d8c: 94 12 a2 28 or %o2, 0x228, %o2 return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 40009d90: 22 80 00 08 be,a 40009db0 <_Heap_Walk+0xcc> 40009d94: 90 10 00 1b mov %i3, %o0 (*printer)( 40009d98: 15 10 00 5a sethi %hi(0x40016800), %o2 40009d9c: 90 10 00 16 mov %l6, %o0 40009da0: 92 10 20 01 mov 1, %o1 40009da4: 94 12 a2 40 or %o2, 0x240, %o2 40009da8: 10 80 01 12 b 4000a1f0 <_Heap_Walk+0x50c> 40009dac: 96 10 00 1c mov %i4, %o3 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 40009db0: 7f ff df 75 call 40001b84 <.urem> 40009db4: 92 10 00 1c mov %i4, %o1 ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 40009db8: 80 a2 20 00 cmp %o0, 0 40009dbc: 22 80 00 08 be,a 40009ddc <_Heap_Walk+0xf8> 40009dc0: 90 06 60 08 add %i1, 8, %o0 (*printer)( 40009dc4: 15 10 00 5a sethi %hi(0x40016800), %o2 40009dc8: 90 10 00 16 mov %l6, %o0 40009dcc: 92 10 20 01 mov 1, %o1 40009dd0: 94 12 a2 60 or %o2, 0x260, %o2 40009dd4: 10 80 01 07 b 4000a1f0 <_Heap_Walk+0x50c> 40009dd8: 96 10 00 1b mov %i3, %o3 40009ddc: 7f ff df 6a call 40001b84 <.urem> 40009de0: 92 10 00 1c mov %i4, %o1 ); return false; } if ( 40009de4: 80 a2 20 00 cmp %o0, 0 40009de8: 22 80 00 07 be,a 40009e04 <_Heap_Walk+0x120> 40009dec: c4 06 60 04 ld [ %i1 + 4 ], %g2 !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 40009df0: 15 10 00 5a sethi %hi(0x40016800), %o2 40009df4: 90 10 00 16 mov %l6, %o0 40009df8: 92 10 20 01 mov 1, %o1 40009dfc: 10 80 00 fc b 4000a1ec <_Heap_Walk+0x508> 40009e00: 94 12 a2 88 or %o2, 0x288, %o2 ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 40009e04: 80 88 a0 01 btst 1, %g2 40009e08: 32 80 00 07 bne,a 40009e24 <_Heap_Walk+0x140> 40009e0c: f4 04 20 04 ld [ %l0 + 4 ], %i2 (*printer)( 40009e10: 15 10 00 5a sethi %hi(0x40016800), %o2 40009e14: 90 10 00 16 mov %l6, %o0 40009e18: 92 10 20 01 mov 1, %o1 40009e1c: 10 80 00 12 b 40009e64 <_Heap_Walk+0x180> 40009e20: 94 12 a2 c0 or %o2, 0x2c0, %o2 - 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; 40009e24: b4 0e bf fe and %i2, -2, %i2 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 40009e28: b4 04 00 1a add %l0, %i2, %i2 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; 40009e2c: c4 06 a0 04 ld [ %i2 + 4 ], %g2 ); return false; } if ( _Heap_Is_free( last_block ) ) { 40009e30: 80 88 a0 01 btst 1, %g2 40009e34: 12 80 00 07 bne 40009e50 <_Heap_Walk+0x16c> 40009e38: 80 a6 80 19 cmp %i2, %i1 (*printer)( 40009e3c: 15 10 00 5a sethi %hi(0x40016800), %o2 40009e40: 90 10 00 16 mov %l6, %o0 40009e44: 92 10 20 01 mov 1, %o1 40009e48: 10 80 00 07 b 40009e64 <_Heap_Walk+0x180> 40009e4c: 94 12 a2 f0 or %o2, 0x2f0, %o2 ); return false; } if ( 40009e50: 02 80 00 0a be 40009e78 <_Heap_Walk+0x194> 40009e54: 15 10 00 5a sethi %hi(0x40016800), %o2 _Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block ) { (*printer)( 40009e58: 90 10 00 16 mov %l6, %o0 40009e5c: 92 10 20 01 mov 1, %o1 40009e60: 94 12 a3 08 or %o2, 0x308, %o2 40009e64: 9f c7 40 00 call %i5 40009e68: b0 10 20 00 clr %i0 40009e6c: b0 0e 20 ff and %i0, 0xff, %i0 40009e70: 81 c7 e0 08 ret 40009e74: 81 e8 00 00 restore int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 40009e78: e2 06 20 10 ld [ %i0 + 0x10 ], %l1 return &heap->free_list; } RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Free_list_first( Heap_Control *heap ) { return _Heap_Free_list_head(heap)->next; 40009e7c: d6 06 20 08 ld [ %i0 + 8 ], %o3 const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); 40009e80: 10 80 00 30 b 40009f40 <_Heap_Walk+0x25c> 40009e84: b2 10 00 18 mov %i0, %i1 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; 40009e88: 80 a0 c0 0b cmp %g3, %o3 40009e8c: 18 80 00 05 bgu 40009ea0 <_Heap_Walk+0x1bc> 40009e90: 84 10 20 00 clr %g2 40009e94: c4 06 20 24 ld [ %i0 + 0x24 ], %g2 40009e98: 80 a0 80 0b cmp %g2, %o3 40009e9c: 84 60 3f ff subx %g0, -1, %g2 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 ) ) { 40009ea0: 80 a0 a0 00 cmp %g2, 0 40009ea4: 32 80 00 07 bne,a 40009ec0 <_Heap_Walk+0x1dc> 40009ea8: 90 02 e0 08 add %o3, 8, %o0 (*printer)( 40009eac: 15 10 00 5a sethi %hi(0x40016800), %o2 40009eb0: 90 10 00 16 mov %l6, %o0 40009eb4: 92 10 20 01 mov 1, %o1 40009eb8: 10 80 00 ce b 4000a1f0 <_Heap_Walk+0x50c> 40009ebc: 94 12 a3 38 or %o2, 0x338, %o2 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 40009ec0: d6 27 bf fc st %o3, [ %fp + -4 ] 40009ec4: 7f ff df 30 call 40001b84 <.urem> 40009ec8: 92 10 00 11 mov %l1, %o1 ); return false; } if ( 40009ecc: 80 a2 20 00 cmp %o0, 0 40009ed0: 02 80 00 07 be 40009eec <_Heap_Walk+0x208> 40009ed4: d6 07 bf fc ld [ %fp + -4 ], %o3 !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 40009ed8: 15 10 00 5a sethi %hi(0x40016800), %o2 40009edc: 90 10 00 16 mov %l6, %o0 40009ee0: 92 10 20 01 mov 1, %o1 40009ee4: 10 80 00 c3 b 4000a1f0 <_Heap_Walk+0x50c> 40009ee8: 94 12 a3 58 or %o2, 0x358, %o2 - 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; 40009eec: c4 02 e0 04 ld [ %o3 + 4 ], %g2 40009ef0: 84 08 bf fe and %g2, -2, %g2 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; 40009ef4: 84 02 c0 02 add %o3, %g2, %g2 40009ef8: c4 00 a0 04 ld [ %g2 + 4 ], %g2 ); return false; } if ( _Heap_Is_used( free_block ) ) { 40009efc: 80 88 a0 01 btst 1, %g2 40009f00: 22 80 00 07 be,a 40009f1c <_Heap_Walk+0x238> 40009f04: d8 02 e0 0c ld [ %o3 + 0xc ], %o4 (*printer)( 40009f08: 15 10 00 5a sethi %hi(0x40016800), %o2 40009f0c: 90 10 00 16 mov %l6, %o0 40009f10: 92 10 20 01 mov 1, %o1 40009f14: 10 80 00 b7 b 4000a1f0 <_Heap_Walk+0x50c> 40009f18: 94 12 a3 88 or %o2, 0x388, %o2 ); return false; } if ( free_block->prev != prev_block ) { 40009f1c: 80 a3 00 19 cmp %o4, %i1 40009f20: 02 80 00 07 be 40009f3c <_Heap_Walk+0x258> 40009f24: b2 10 00 0b mov %o3, %i1 (*printer)( 40009f28: 15 10 00 5a sethi %hi(0x40016800), %o2 40009f2c: 90 10 00 16 mov %l6, %o0 40009f30: 92 10 20 01 mov 1, %o1 40009f34: 10 80 00 4d b 4000a068 <_Heap_Walk+0x384> 40009f38: 94 12 a3 a8 or %o2, 0x3a8, %o2 return false; } prev_block = free_block; free_block = free_block->next; 40009f3c: d6 02 e0 08 ld [ %o3 + 8 ], %o3 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 ) { 40009f40: 80 a2 c0 18 cmp %o3, %i0 40009f44: 32 bf ff d1 bne,a 40009e88 <_Heap_Walk+0x1a4> 40009f48: c6 06 20 20 ld [ %i0 + 0x20 ], %g3 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)( 40009f4c: 2b 10 00 5b sethi %hi(0x40016c00), %l5 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 ) { 40009f50: b2 10 00 1a mov %i2, %i1 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)( 40009f54: aa 15 60 a8 or %l5, 0xa8, %l5 " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 40009f58: 23 10 00 5b sethi %hi(0x40016c00), %l1 40009f5c: 2f 10 00 5a sethi %hi(0x40016800), %l7 - 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; 40009f60: e4 06 60 04 ld [ %i1 + 4 ], %l2 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; 40009f64: d8 06 20 20 ld [ %i0 + 0x20 ], %o4 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; 40009f68: 9e 1e 40 10 xor %i1, %l0, %o7 40009f6c: 80 a0 00 0f cmp %g0, %o7 - 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; 40009f70: a8 0c bf fe and %l2, -2, %l4 40009f74: 9a 40 20 00 addx %g0, 0, %o5 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 40009f78: a6 06 40 14 add %i1, %l4, %l3 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; 40009f7c: a4 0c a0 01 and %l2, 1, %l2 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; 40009f80: 80 a3 00 13 cmp %o4, %l3 40009f84: 18 80 00 05 bgu 40009f98 <_Heap_Walk+0x2b4> <== NEVER TAKEN 40009f88: 9e 10 20 00 clr %o7 40009f8c: de 06 20 24 ld [ %i0 + 0x24 ], %o7 40009f90: 80 a3 c0 13 cmp %o7, %l3 40009f94: 9e 60 3f ff subx %g0, -1, %o7 if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 40009f98: 80 a3 e0 00 cmp %o7, 0 40009f9c: 32 80 00 07 bne,a 40009fb8 <_Heap_Walk+0x2d4> 40009fa0: da 27 bf f8 st %o5, [ %fp + -8 ] (*printer)( 40009fa4: 15 10 00 5a sethi %hi(0x40016800), %o2 40009fa8: 90 10 00 16 mov %l6, %o0 40009fac: 92 10 20 01 mov 1, %o1 40009fb0: 10 80 00 2c b 4000a060 <_Heap_Walk+0x37c> 40009fb4: 94 12 a3 e0 or %o2, 0x3e0, %o2 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 40009fb8: 90 10 00 14 mov %l4, %o0 40009fbc: 7f ff de f2 call 40001b84 <.urem> 40009fc0: 92 10 00 1c mov %i4, %o1 40009fc4: da 07 bf f8 ld [ %fp + -8 ], %o5 ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { 40009fc8: 80 a2 20 00 cmp %o0, 0 40009fcc: 02 80 00 0c be 40009ffc <_Heap_Walk+0x318> 40009fd0: 9e 0b 60 ff and %o5, 0xff, %o7 40009fd4: 80 a3 e0 00 cmp %o7, 0 40009fd8: 02 80 00 19 be 4000a03c <_Heap_Walk+0x358> 40009fdc: 80 a6 40 13 cmp %i1, %l3 (*printer)( 40009fe0: 15 10 00 5b sethi %hi(0x40016c00), %o2 40009fe4: 90 10 00 16 mov %l6, %o0 40009fe8: 92 10 20 01 mov 1, %o1 40009fec: 94 12 a0 10 or %o2, 0x10, %o2 40009ff0: 96 10 00 19 mov %i1, %o3 40009ff4: 10 80 00 1d b 4000a068 <_Heap_Walk+0x384> 40009ff8: 98 10 00 14 mov %l4, %o4 ); return false; } if ( block_size < min_block_size && is_not_last_block ) { 40009ffc: 80 a3 e0 00 cmp %o7, 0 4000a000: 02 80 00 0f be 4000a03c <_Heap_Walk+0x358> 4000a004: 80 a6 40 13 cmp %i1, %l3 4000a008: 80 a5 00 1b cmp %l4, %i3 4000a00c: 1a 80 00 0c bcc 4000a03c <_Heap_Walk+0x358> 4000a010: 80 a6 40 13 cmp %i1, %l3 (*printer)( 4000a014: 90 10 00 16 mov %l6, %o0 4000a018: 92 10 20 01 mov 1, %o1 4000a01c: 15 10 00 5b sethi %hi(0x40016c00), %o2 4000a020: 96 10 00 19 mov %i1, %o3 4000a024: 94 12 a0 40 or %o2, 0x40, %o2 4000a028: 98 10 00 14 mov %l4, %o4 4000a02c: 9f c7 40 00 call %i5 4000a030: 9a 10 00 1b mov %i3, %o5 "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 4000a034: 10 80 00 68 b 4000a1d4 <_Heap_Walk+0x4f0> 4000a038: b0 10 20 00 clr %i0 ); return false; } if ( next_block_begin <= block_begin && is_not_last_block ) { 4000a03c: 2a 80 00 10 bcs,a 4000a07c <_Heap_Walk+0x398> 4000a040: de 04 e0 04 ld [ %l3 + 4 ], %o7 4000a044: 80 8b 60 ff btst 0xff, %o5 4000a048: 22 80 00 0d be,a 4000a07c <_Heap_Walk+0x398> 4000a04c: de 04 e0 04 ld [ %l3 + 4 ], %o7 (*printer)( 4000a050: 15 10 00 5b sethi %hi(0x40016c00), %o2 4000a054: 90 10 00 16 mov %l6, %o0 4000a058: 92 10 20 01 mov 1, %o1 4000a05c: 94 12 a0 70 or %o2, 0x70, %o2 4000a060: 96 10 00 19 mov %i1, %o3 4000a064: 98 10 00 13 mov %l3, %o4 4000a068: 9f c7 40 00 call %i5 4000a06c: b0 10 20 00 clr %i0 4000a070: b0 0e 20 ff and %i0, 0xff, %i0 4000a074: 81 c7 e0 08 ret 4000a078: 81 e8 00 00 restore ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 4000a07c: 80 8b e0 01 btst 1, %o7 4000a080: 12 80 00 3f bne 4000a17c <_Heap_Walk+0x498> 4000a084: 90 10 00 16 mov %l6, %o0 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 ? 4000a088: da 06 60 0c ld [ %i1 + 0xc ], %o5 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)( 4000a08c: d8 06 20 08 ld [ %i0 + 8 ], %o4 4000a090: 80 a3 40 0c cmp %o5, %o4 4000a094: 02 80 00 08 be 4000a0b4 <_Heap_Walk+0x3d0> 4000a098: de 06 20 0c ld [ %i0 + 0xc ], %o7 block, block_size, block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), 4000a09c: 80 a3 40 18 cmp %o5, %i0 4000a0a0: 12 80 00 07 bne 4000a0bc <_Heap_Walk+0x3d8> 4000a0a4: 96 14 61 18 or %l1, 0x118, %o3 4000a0a8: 17 10 00 5a sethi %hi(0x40016800), %o3 4000a0ac: 10 80 00 04 b 4000a0bc <_Heap_Walk+0x3d8> 4000a0b0: 96 12 e1 60 or %o3, 0x160, %o3 ! 40016960 <__log2table+0x130> 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)( 4000a0b4: 03 10 00 5a sethi %hi(0x40016800), %g1 4000a0b8: 96 10 61 50 or %g1, 0x150, %o3 ! 40016950 <__log2table+0x120> block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? 4000a0bc: d8 06 60 08 ld [ %i1 + 8 ], %o4 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)( 4000a0c0: 80 a3 00 0f cmp %o4, %o7 4000a0c4: 02 80 00 06 be 4000a0dc <_Heap_Walk+0x3f8> 4000a0c8: 80 a3 00 18 cmp %o4, %i0 " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 4000a0cc: 12 80 00 06 bne 4000a0e4 <_Heap_Walk+0x400> 4000a0d0: 9e 14 61 18 or %l1, 0x118, %o7 4000a0d4: 10 80 00 04 b 4000a0e4 <_Heap_Walk+0x400> 4000a0d8: 9e 15 e1 80 or %l7, 0x180, %o7 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)( 4000a0dc: 03 10 00 5a sethi %hi(0x40016800), %g1 4000a0e0: 9e 10 61 70 or %g1, 0x170, %o7 ! 40016970 <__log2table+0x140> 4000a0e4: d6 23 a0 5c st %o3, [ %sp + 0x5c ] 4000a0e8: d8 23 a0 60 st %o4, [ %sp + 0x60 ] 4000a0ec: de 23 a0 64 st %o7, [ %sp + 0x64 ] 4000a0f0: 90 10 00 16 mov %l6, %o0 4000a0f4: 92 10 20 00 clr %o1 4000a0f8: 94 10 00 15 mov %l5, %o2 4000a0fc: 96 10 00 19 mov %i1, %o3 4000a100: 9f c7 40 00 call %i5 4000a104: 98 10 00 14 mov %l4, %o4 block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { 4000a108: da 04 c0 00 ld [ %l3 ], %o5 4000a10c: 80 a5 00 0d cmp %l4, %o5 4000a110: 02 80 00 0c be 4000a140 <_Heap_Walk+0x45c> 4000a114: 80 a4 a0 00 cmp %l2, 0 (*printer)( 4000a118: e6 23 a0 5c st %l3, [ %sp + 0x5c ] 4000a11c: 90 10 00 16 mov %l6, %o0 4000a120: 92 10 20 01 mov 1, %o1 4000a124: 15 10 00 5b sethi %hi(0x40016c00), %o2 4000a128: 96 10 00 19 mov %i1, %o3 4000a12c: 94 12 a0 e0 or %o2, 0xe0, %o2 4000a130: 9f c7 40 00 call %i5 4000a134: 98 10 00 14 mov %l4, %o4 "block 0x%08x: next block 0x%08x is not a successor\n", block, next_block ); return false; 4000a138: 10 bf ff ce b 4000a070 <_Heap_Walk+0x38c> 4000a13c: b0 10 20 00 clr %i0 ); return false; } if ( !prev_used ) { 4000a140: 32 80 00 0a bne,a 4000a168 <_Heap_Walk+0x484> 4000a144: c6 06 20 08 ld [ %i0 + 8 ], %g3 (*printer)( 4000a148: 15 10 00 5b sethi %hi(0x40016c00), %o2 4000a14c: 90 10 00 16 mov %l6, %o0 4000a150: 92 10 20 01 mov 1, %o1 4000a154: 10 80 00 26 b 4000a1ec <_Heap_Walk+0x508> 4000a158: 94 12 a1 20 or %o2, 0x120, %o2 { 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 ) { 4000a15c: 22 80 00 19 be,a 4000a1c0 <_Heap_Walk+0x4dc> 4000a160: b2 10 00 13 mov %l3, %i1 return true; } free_block = free_block->next; 4000a164: c6 00 e0 08 ld [ %g3 + 8 ], %g3 ) { 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 ) { 4000a168: 80 a0 c0 18 cmp %g3, %i0 4000a16c: 12 bf ff fc bne 4000a15c <_Heap_Walk+0x478> 4000a170: 80 a0 c0 19 cmp %g3, %i1 return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 4000a174: 10 80 00 1b b 4000a1e0 <_Heap_Walk+0x4fc> 4000a178: 15 10 00 5b sethi %hi(0x40016c00), %o2 if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { 4000a17c: 80 a4 a0 00 cmp %l2, 0 4000a180: 02 80 00 09 be 4000a1a4 <_Heap_Walk+0x4c0> 4000a184: 92 10 20 00 clr %o1 (*printer)( 4000a188: 15 10 00 5b sethi %hi(0x40016c00), %o2 4000a18c: 96 10 00 19 mov %i1, %o3 4000a190: 94 12 a1 50 or %o2, 0x150, %o2 4000a194: 9f c7 40 00 call %i5 4000a198: 98 10 00 14 mov %l4, %o4 4000a19c: 10 80 00 09 b 4000a1c0 <_Heap_Walk+0x4dc> 4000a1a0: b2 10 00 13 mov %l3, %i1 "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 4000a1a4: da 06 40 00 ld [ %i1 ], %o5 4000a1a8: 15 10 00 5b sethi %hi(0x40016c00), %o2 4000a1ac: 96 10 00 19 mov %i1, %o3 4000a1b0: 94 12 a1 68 or %o2, 0x168, %o2 4000a1b4: 9f c7 40 00 call %i5 4000a1b8: 98 10 00 14 mov %l4, %o4 4000a1bc: b2 10 00 13 mov %l3, %i1 block->prev_size ); } block = next_block; } while ( block != first_block ); 4000a1c0: 80 a4 c0 1a cmp %l3, %i2 4000a1c4: 32 bf ff 68 bne,a 40009f64 <_Heap_Walk+0x280> 4000a1c8: e4 06 60 04 ld [ %i1 + 4 ], %l2 4000a1cc: 10 80 00 02 b 4000a1d4 <_Heap_Walk+0x4f0> 4000a1d0: b0 10 20 01 mov 1, %i0 4000a1d4: b0 0e 20 ff and %i0, 0xff, %i0 4000a1d8: 81 c7 e0 08 ret 4000a1dc: 81 e8 00 00 restore return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 4000a1e0: 90 10 00 16 mov %l6, %o0 4000a1e4: 92 10 20 01 mov 1, %o1 4000a1e8: 94 12 a1 90 or %o2, 0x190, %o2 4000a1ec: 96 10 00 19 mov %i1, %o3 4000a1f0: 9f c7 40 00 call %i5 4000a1f4: b0 10 20 00 clr %i0 4000a1f8: b0 0e 20 ff and %i0, 0xff, %i0 4000a1fc: 81 c7 e0 08 ret 4000a200: 81 e8 00 00 restore =============================================================================== 40009420 <_Internal_error_Occurred>: void _Internal_error_Occurred( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 40009420: 9d e3 bf 90 save %sp, -112, %sp Internal_errors_t error ) { User_extensions_Fatal_context ctx = { source, is_internal, error }; _User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor ); 40009424: 13 10 00 2c sethi %hi(0x4000b000), %o1 40009428: 90 07 bf f4 add %fp, -12, %o0 4000942c: 92 12 63 a8 or %o1, 0x3a8, %o1 Internal_errors_Source source, bool is_internal, Internal_errors_t error ) { User_extensions_Fatal_context ctx = { source, is_internal, error }; 40009430: f0 27 bf f4 st %i0, [ %fp + -12 ] 40009434: f2 2f bf f8 stb %i1, [ %fp + -8 ] _User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor ); 40009438: 40 00 07 e7 call 4000b3d4 <_User_extensions_Iterate> 4000943c: f4 27 bf fc st %i2, [ %fp + -4 ] _User_extensions_Fatal( the_source, is_internal, the_error ); _Internal_errors_What_happened.the_source = the_source; 40009440: 05 10 00 7e sethi %hi(0x4001f800), %g2 <== NOT EXECUTED 40009444: 82 10 a1 7c or %g2, 0x17c, %g1 ! 4001f97c <_Internal_errors_What_happened><== NOT EXECUTED 40009448: f0 20 a1 7c st %i0, [ %g2 + 0x17c ] <== NOT EXECUTED _Internal_errors_What_happened.is_internal = is_internal; 4000944c: f2 28 60 04 stb %i1, [ %g1 + 4 ] <== NOT EXECUTED _Internal_errors_What_happened.the_error = the_error; 40009450: f4 20 60 08 st %i2, [ %g1 + 8 ] <== NOT EXECUTED RTEMS_INLINE_ROUTINE void _System_state_Set ( System_state_Codes state ) { _System_state_Current = state; 40009454: 84 10 20 05 mov 5, %g2 <== NOT EXECUTED 40009458: 03 10 00 7e sethi %hi(0x4001f800), %g1 <== NOT EXECUTED _System_state_Set( SYSTEM_STATE_FAILED ); _CPU_Fatal_halt( the_error ); 4000945c: 7f ff e3 fb call 40002448 <== NOT EXECUTED 40009460: c4 20 61 88 st %g2, [ %g1 + 0x188 ] ! 4001f988 <_System_state_Current><== NOT EXECUTED 40009464: 82 10 00 08 mov %o0, %g1 <== NOT EXECUTED 40009468: 30 80 00 00 b,a 40009468 <_Internal_error_Occurred+0x48> <== NOT EXECUTED =============================================================================== 400094d4 <_Objects_Allocate>: #endif Objects_Control *_Objects_Allocate( Objects_Information *information ) { 400094d4: 9d e3 bf a0 save %sp, -96, %sp * 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 ) 400094d8: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 400094dc: 80 a0 60 00 cmp %g1, 0 400094e0: 12 80 00 04 bne 400094f0 <_Objects_Allocate+0x1c> <== ALWAYS TAKEN 400094e4: ba 10 00 18 mov %i0, %i5 return NULL; 400094e8: 81 c7 e0 08 ret 400094ec: 91 e8 20 00 restore %g0, 0, %o0 /* * 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 ); 400094f0: b8 06 20 20 add %i0, 0x20, %i4 400094f4: 7f ff fd 85 call 40008b08 <_Chain_Get> 400094f8: 90 10 00 1c mov %i4, %o0 if ( information->auto_extend ) { 400094fc: c2 0f 60 12 ldub [ %i5 + 0x12 ], %g1 40009500: 80 a0 60 00 cmp %g1, 0 40009504: 02 80 00 1d be 40009578 <_Objects_Allocate+0xa4> 40009508: b0 10 00 08 mov %o0, %i0 /* * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { 4000950c: 80 a2 20 00 cmp %o0, 0 40009510: 32 80 00 0a bne,a 40009538 <_Objects_Allocate+0x64> 40009514: c4 07 60 08 ld [ %i5 + 8 ], %g2 _Objects_Extend_information( information ); 40009518: 40 00 00 21 call 4000959c <_Objects_Extend_information> 4000951c: 90 10 00 1d mov %i5, %o0 the_object = (Objects_Control *) _Chain_Get( &information->Inactive ); 40009520: 7f ff fd 7a call 40008b08 <_Chain_Get> 40009524: 90 10 00 1c mov %i4, %o0 } if ( the_object ) { 40009528: b0 92 20 00 orcc %o0, 0, %i0 4000952c: 02 bf ff ef be 400094e8 <_Objects_Allocate+0x14> 40009530: 01 00 00 00 nop uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 40009534: c4 07 60 08 ld [ %i5 + 8 ], %g2 40009538: d0 06 20 08 ld [ %i0 + 8 ], %o0 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; 4000953c: d2 17 60 14 lduh [ %i5 + 0x14 ], %o1 } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 40009540: 03 00 00 3f sethi %hi(0xfc00), %g1 40009544: 82 10 63 ff or %g1, 0x3ff, %g1 ! ffff 40009548: 90 0a 00 01 and %o0, %g1, %o0 4000954c: 82 08 80 01 and %g2, %g1, %g1 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; 40009550: 40 00 3d d4 call 40018ca0 <.udiv> 40009554: 90 22 00 01 sub %o0, %g1, %o0 information->inactive_per_block[ block ]--; 40009558: c2 07 60 30 ld [ %i5 + 0x30 ], %g1 4000955c: 91 2a 20 02 sll %o0, 2, %o0 40009560: c4 00 40 08 ld [ %g1 + %o0 ], %g2 40009564: 84 00 bf ff add %g2, -1, %g2 40009568: c4 20 40 08 st %g2, [ %g1 + %o0 ] information->inactive--; 4000956c: c2 17 60 2c lduh [ %i5 + 0x2c ], %g1 40009570: 82 00 7f ff add %g1, -1, %g1 40009574: c2 37 60 2c sth %g1, [ %i5 + 0x2c ] ); } #endif return the_object; } 40009578: 81 c7 e0 08 ret 4000957c: 81 e8 00 00 restore =============================================================================== 40009904 <_Objects_Get_information>: Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint16_t the_class ) { 40009904: 9d e3 bf a0 save %sp, -96, %sp Objects_Information *info; int the_class_api_maximum; if ( !the_class ) 40009908: 80 a6 60 00 cmp %i1, 0 4000990c: 12 80 00 04 bne 4000991c <_Objects_Get_information+0x18> 40009910: 01 00 00 00 nop return NULL; 40009914: 81 c7 e0 08 ret 40009918: 91 e8 20 00 restore %g0, 0, %o0 /* * 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 ); 4000991c: 40 00 11 64 call 4000deac <_Objects_API_maximum_class> 40009920: 90 10 00 18 mov %i0, %o0 if ( the_class_api_maximum == 0 ) 40009924: 80 a2 20 00 cmp %o0, 0 40009928: 02 bf ff fb be 40009914 <_Objects_Get_information+0x10> 4000992c: 80 a6 40 08 cmp %i1, %o0 return NULL; if ( the_class > (uint32_t) the_class_api_maximum ) 40009930: 18 bf ff f9 bgu 40009914 <_Objects_Get_information+0x10> 40009934: 03 10 00 7c sethi %hi(0x4001f000), %g1 return NULL; if ( !_Objects_Information_table[ the_api ] ) 40009938: b1 2e 20 02 sll %i0, 2, %i0 4000993c: 82 10 63 e4 or %g1, 0x3e4, %g1 40009940: c2 00 40 18 ld [ %g1 + %i0 ], %g1 40009944: 80 a0 60 00 cmp %g1, 0 40009948: 02 bf ff f3 be 40009914 <_Objects_Get_information+0x10> <== NEVER TAKEN 4000994c: b3 2e 60 02 sll %i1, 2, %i1 return NULL; info = _Objects_Information_table[ the_api ][ the_class ]; 40009950: f0 00 40 19 ld [ %g1 + %i1 ], %i0 if ( !info ) 40009954: 80 a6 20 00 cmp %i0, 0 40009958: 02 bf ff ef be 40009914 <_Objects_Get_information+0x10> <== NEVER TAKEN 4000995c: 01 00 00 00 nop * In a multprocessing configuration, we may access remote objects. * Thus we may have 0 local instances and still have a valid object * pointer. */ #if !defined(RTEMS_MULTIPROCESSING) if ( info->maximum == 0 ) 40009960: c2 16 20 10 lduh [ %i0 + 0x10 ], %g1 40009964: 80 a0 60 00 cmp %g1, 0 40009968: 02 bf ff eb be 40009914 <_Objects_Get_information+0x10> 4000996c: 01 00 00 00 nop return NULL; #endif return info; } 40009970: 81 c7 e0 08 ret 40009974: 81 e8 00 00 restore =============================================================================== 4001bcfc <_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; 4001bcfc: c2 02 20 08 ld [ %o0 + 8 ], %g1 4001bd00: 92 22 40 01 sub %o1, %g1, %o1 if ( information->maximum >= index ) { 4001bd04: c2 12 20 10 lduh [ %o0 + 0x10 ], %g1 /* * 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; 4001bd08: 92 02 60 01 inc %o1 if ( information->maximum >= index ) { 4001bd0c: 80 a0 40 09 cmp %g1, %o1 4001bd10: 0a 80 00 09 bcs 4001bd34 <_Objects_Get_no_protection+0x38> 4001bd14: 93 2a 60 02 sll %o1, 2, %o1 if ( (the_object = information->local_table[ index ]) != NULL ) { 4001bd18: c2 02 20 1c ld [ %o0 + 0x1c ], %g1 4001bd1c: d0 00 40 09 ld [ %g1 + %o1 ], %o0 4001bd20: 80 a2 20 00 cmp %o0, 0 4001bd24: 02 80 00 05 be 4001bd38 <_Objects_Get_no_protection+0x3c> <== NEVER TAKEN 4001bd28: 82 10 20 01 mov 1, %g1 *location = OBJECTS_LOCAL; return the_object; 4001bd2c: 81 c3 e0 08 retl 4001bd30: c0 22 80 00 clr [ %o2 ] /* * This isn't supported or required yet for Global objects so * if it isn't local, we don't find it. */ *location = OBJECTS_ERROR; 4001bd34: 82 10 20 01 mov 1, %g1 return NULL; 4001bd38: 90 10 20 00 clr %o0 } 4001bd3c: 81 c3 e0 08 retl 4001bd40: c2 22 80 00 st %g1, [ %o2 ] =============================================================================== 4000da28 <_Objects_Id_to_name>: Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { 4000da28: 9d e3 bf 98 save %sp, -104, %sp /* * Caller is trusted for name != NULL. */ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id; 4000da2c: 80 a6 20 00 cmp %i0, 0 4000da30: 12 80 00 06 bne 4000da48 <_Objects_Id_to_name+0x20> 4000da34: 83 36 20 18 srl %i0, 0x18, %g1 4000da38: 03 10 00 bf sethi %hi(0x4002fc00), %g1 4000da3c: c2 00 62 b0 ld [ %g1 + 0x2b0 ], %g1 ! 4002feb0 <_Per_CPU_Information+0x10> 4000da40: f0 00 60 08 ld [ %g1 + 8 ], %i0 4000da44: 83 36 20 18 srl %i0, 0x18, %g1 4000da48: 82 08 60 07 and %g1, 7, %g1 */ RTEMS_INLINE_ROUTINE bool _Objects_Is_api_valid( uint32_t the_api ) { if ( !the_api || the_api > OBJECTS_APIS_LAST ) 4000da4c: 84 00 7f ff add %g1, -1, %g2 4000da50: 80 a0 a0 02 cmp %g2, 2 4000da54: 08 80 00 18 bleu 4000dab4 <_Objects_Id_to_name+0x8c> 4000da58: 83 28 60 02 sll %g1, 2, %g1 the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; 4000da5c: 81 c7 e0 08 ret 4000da60: 91 e8 20 03 restore %g0, 3, %o0 if ( !_Objects_Information_table[ the_api ] ) return OBJECTS_INVALID_ID; the_class = _Objects_Get_class( tmpId ); information = _Objects_Information_table[ the_api ][ the_class ]; 4000da64: 85 28 a0 02 sll %g2, 2, %g2 4000da68: d0 00 40 02 ld [ %g1 + %g2 ], %o0 if ( !information ) 4000da6c: 80 a2 20 00 cmp %o0, 0 4000da70: 02 bf ff fb be 4000da5c <_Objects_Id_to_name+0x34> <== NEVER TAKEN 4000da74: 01 00 00 00 nop return OBJECTS_INVALID_ID; #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) 4000da78: c2 0a 20 38 ldub [ %o0 + 0x38 ], %g1 4000da7c: 80 a0 60 00 cmp %g1, 0 4000da80: 12 bf ff f7 bne 4000da5c <_Objects_Id_to_name+0x34> <== NEVER TAKEN 4000da84: 92 10 00 18 mov %i0, %o1 return OBJECTS_INVALID_ID; #endif the_object = _Objects_Get( information, tmpId, &ignored_location ); 4000da88: 7f ff ff cb call 4000d9b4 <_Objects_Get> 4000da8c: 94 07 bf fc add %fp, -4, %o2 if ( !the_object ) 4000da90: 80 a2 20 00 cmp %o0, 0 4000da94: 02 bf ff f2 be 4000da5c <_Objects_Id_to_name+0x34> 4000da98: 01 00 00 00 nop return OBJECTS_INVALID_ID; *name = the_object->name; 4000da9c: c2 02 20 0c ld [ %o0 + 0xc ], %g1 _Thread_Enable_dispatch(); return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; 4000daa0: b0 10 20 00 clr %i0 the_object = _Objects_Get( information, tmpId, &ignored_location ); if ( !the_object ) return OBJECTS_INVALID_ID; *name = the_object->name; _Thread_Enable_dispatch(); 4000daa4: 40 00 03 99 call 4000e908 <_Thread_Enable_dispatch> 4000daa8: c2 26 40 00 st %g1, [ %i1 ] 4000daac: 81 c7 e0 08 ret 4000dab0: 81 e8 00 00 restore the_api = _Objects_Get_API( tmpId ); if ( !_Objects_Is_api_valid( the_api ) ) return OBJECTS_INVALID_ID; if ( !_Objects_Information_table[ the_api ] ) 4000dab4: 05 10 00 be sethi %hi(0x4002f800), %g2 4000dab8: 84 10 a0 b4 or %g2, 0xb4, %g2 ! 4002f8b4 <_Objects_Information_table> 4000dabc: c2 00 80 01 ld [ %g2 + %g1 ], %g1 4000dac0: 80 a0 60 00 cmp %g1, 0 4000dac4: 12 bf ff e8 bne 4000da64 <_Objects_Id_to_name+0x3c> 4000dac8: 85 36 20 1b srl %i0, 0x1b, %g2 4000dacc: 30 bf ff e4 b,a 4000da5c <_Objects_Id_to_name+0x34> =============================================================================== 4000f338 <_POSIX_Keys_Run_destructors>: */ void _POSIX_Keys_Run_destructors( Thread_Control *thread ) { 4000f338: 9d e3 bf a0 save %sp, -96, %sp Objects_Maximum thread_index = _Objects_Get_index( thread->Object.id ); 4000f33c: c2 06 20 08 ld [ %i0 + 8 ], %g1 for ( index = 1 ; index <= max ; ++index ) { POSIX_Keys_Control *key = (POSIX_Keys_Control *) _POSIX_Keys_Information.local_table [ index ]; if ( key != NULL && key->destructor != NULL ) { void *value = key->Values [ thread_api ][ thread_index ]; 4000f340: 39 00 00 3f sethi %hi(0xfc00), %i4 4000f344: b5 30 60 18 srl %g1, 0x18, %i2 4000f348: b8 17 23 ff or %i4, 0x3ff, %i4 4000f34c: b4 0e a0 07 and %i2, 7, %i2 4000f350: b8 08 40 1c and %g1, %i4, %i4 4000f354: b4 06 a0 04 add %i2, 4, %i2 4000f358: b9 2f 20 02 sll %i4, 2, %i4 * * Reference: 17.1.1.2 P1003.1c/Draft 10, p. 163, line 99. */ while ( !done ) { Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; 4000f35c: 37 10 00 7e sethi %hi(0x4001f800), %i3 for ( index = 1 ; index <= max ; ++index ) { POSIX_Keys_Control *key = (POSIX_Keys_Control *) _POSIX_Keys_Information.local_table [ index ]; if ( key != NULL && key->destructor != NULL ) { void *value = key->Values [ thread_api ][ thread_index ]; 4000f360: b5 2e a0 02 sll %i2, 2, %i2 * * Reference: 17.1.1.2 P1003.1c/Draft 10, p. 163, line 99. */ while ( !done ) { Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; 4000f364: 82 16 e0 5c or %i3, 0x5c, %g1 done = true; for ( index = 1 ; index <= max ; ++index ) { 4000f368: ba 10 20 01 mov 1, %i5 */ while ( !done ) { Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; done = true; 4000f36c: 84 10 20 01 mov 1, %g2 for ( index = 1 ; index <= max ; ++index ) { 4000f370: 10 80 00 18 b 4000f3d0 <_POSIX_Keys_Run_destructors+0x98> 4000f374: f2 10 60 10 lduh [ %g1 + 0x10 ], %i1 POSIX_Keys_Control *key = (POSIX_Keys_Control *) _POSIX_Keys_Information.local_table [ index ]; 4000f378: 86 16 e0 5c or %i3, 0x5c, %g3 Objects_Maximum max = _POSIX_Keys_Information.maximum; done = true; for ( index = 1 ; index <= max ; ++index ) { POSIX_Keys_Control *key = (POSIX_Keys_Control *) 4000f37c: c6 00 e0 1c ld [ %g3 + 0x1c ], %g3 4000f380: 83 28 60 02 sll %g1, 2, %g1 4000f384: c2 00 c0 01 ld [ %g3 + %g1 ], %g1 _POSIX_Keys_Information.local_table [ index ]; if ( key != NULL && key->destructor != NULL ) { 4000f388: 80 a0 60 00 cmp %g1, 0 4000f38c: 22 80 00 11 be,a 4000f3d0 <_POSIX_Keys_Run_destructors+0x98> 4000f390: ba 07 60 01 inc %i5 4000f394: c6 00 60 10 ld [ %g1 + 0x10 ], %g3 4000f398: 80 a0 e0 00 cmp %g3, 0 4000f39c: 02 80 00 0c be 4000f3cc <_POSIX_Keys_Run_destructors+0x94> 4000f3a0: 86 00 40 1a add %g1, %i2, %g3 void *value = key->Values [ thread_api ][ thread_index ]; 4000f3a4: c6 00 e0 04 ld [ %g3 + 4 ], %g3 4000f3a8: d0 00 c0 1c ld [ %g3 + %i4 ], %o0 if ( value != NULL ) { 4000f3ac: 80 a2 20 00 cmp %o0, 0 4000f3b0: 22 80 00 08 be,a 4000f3d0 <_POSIX_Keys_Run_destructors+0x98><== ALWAYS TAKEN 4000f3b4: ba 07 60 01 inc %i5 key->Values [ thread_api ][ thread_index ] = NULL; 4000f3b8: c0 20 c0 1c clr [ %g3 + %i4 ] <== NOT EXECUTED (*key->destructor)( value ); 4000f3bc: c2 00 60 10 ld [ %g1 + 0x10 ], %g1 <== NOT EXECUTED 4000f3c0: 9f c0 40 00 call %g1 <== NOT EXECUTED 4000f3c4: 01 00 00 00 nop <== NOT EXECUTED done = false; 4000f3c8: 84 10 20 00 clr %g2 ! 0 <== NOT EXECUTED Objects_Maximum index = 0; Objects_Maximum max = _POSIX_Keys_Information.maximum; done = true; for ( index = 1 ; index <= max ; ++index ) { 4000f3cc: ba 07 60 01 inc %i5 4000f3d0: 83 2f 60 10 sll %i5, 0x10, %g1 4000f3d4: 83 30 60 10 srl %g1, 0x10, %g1 4000f3d8: 80 a0 40 19 cmp %g1, %i1 4000f3dc: 08 bf ff e7 bleu 4000f378 <_POSIX_Keys_Run_destructors+0x40> 4000f3e0: 80 88 a0 ff btst 0xff, %g2 * number of iterations. An infinite loop may happen if destructors set * thread specific data. This can be considered dubious. * * Reference: 17.1.1.2 P1003.1c/Draft 10, p. 163, line 99. */ while ( !done ) { 4000f3e4: 02 bf ff e1 be 4000f368 <_POSIX_Keys_Run_destructors+0x30><== NEVER TAKEN 4000f3e8: 82 16 e0 5c or %i3, 0x5c, %g1 done = false; } } } } } 4000f3ec: 81 c7 e0 08 ret 4000f3f0: 81 e8 00 00 restore =============================================================================== 4000ce74 <_POSIX_Message_queue_Receive_support>: size_t msg_len, unsigned int *msg_prio, bool wait, Watchdog_Interval timeout ) { 4000ce74: 9d e3 bf 98 save %sp, -104, %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( 4000ce78: 11 10 00 a5 sethi %hi(0x40029400), %o0 4000ce7c: 92 10 00 18 mov %i0, %o1 4000ce80: 90 12 20 30 or %o0, 0x30, %o0 4000ce84: 40 00 0c c3 call 40010190 <_Objects_Get> 4000ce88: 94 07 bf f8 add %fp, -8, %o2 Objects_Locations location; size_t length_out; bool do_wait; the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); switch ( location ) { 4000ce8c: c2 07 bf f8 ld [ %fp + -8 ], %g1 4000ce90: 80 a0 60 00 cmp %g1, 0 4000ce94: 12 80 00 40 bne 4000cf94 <_POSIX_Message_queue_Receive_support+0x120> 4000ce98: 01 00 00 00 nop case OBJECTS_LOCAL: if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) { 4000ce9c: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 4000cea0: 84 08 60 03 and %g1, 3, %g2 4000cea4: 80 a0 a0 01 cmp %g2, 1 4000cea8: 32 80 00 05 bne,a 4000cebc <_POSIX_Message_queue_Receive_support+0x48> 4000ceac: d0 02 20 10 ld [ %o0 + 0x10 ], %o0 _Thread_Enable_dispatch(); 4000ceb0: 40 00 10 5f call 4001102c <_Thread_Enable_dispatch> 4000ceb4: 01 00 00 00 nop 4000ceb8: 30 80 00 37 b,a 4000cf94 <_POSIX_Message_queue_Receive_support+0x120> rtems_set_errno_and_return_minus_one( EBADF ); } the_mq = the_mq_fd->Queue; if ( msg_len < the_mq->Message_queue.maximum_message_size ) { 4000cebc: c4 02 20 68 ld [ %o0 + 0x68 ], %g2 4000cec0: 80 a6 80 02 cmp %i2, %g2 4000cec4: 1a 80 00 08 bcc 4000cee4 <_POSIX_Message_queue_Receive_support+0x70> 4000cec8: 84 10 3f ff mov -1, %g2 _Thread_Enable_dispatch(); 4000cecc: 40 00 10 58 call 4001102c <_Thread_Enable_dispatch> 4000ced0: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( EMSGSIZE ); 4000ced4: 40 00 26 b4 call 400169a4 <__errno> 4000ced8: 01 00 00 00 nop 4000cedc: 10 80 00 31 b 4000cfa0 <_POSIX_Message_queue_Receive_support+0x12c> 4000cee0: 82 10 20 7a mov 0x7a, %g1 ! 7a /* * Now if something goes wrong, we return a "length" of -1 * to indicate an error. */ length_out = -1; 4000cee4: c4 27 bf fc st %g2, [ %fp + -4 ] /* * A timed receive with a bad time will do a poll regardless. */ if ( wait ) 4000cee8: 80 a7 20 00 cmp %i4, 0 4000ceec: 02 80 00 05 be 4000cf00 <_POSIX_Message_queue_Receive_support+0x8c> 4000cef0: 98 10 20 00 clr %o4 do_wait = (the_mq_fd->oflag & O_NONBLOCK) ? false : true; 4000cef4: 99 30 60 0e srl %g1, 0xe, %o4 4000cef8: 98 1b 20 01 xor %o4, 1, %o4 4000cefc: 98 0b 20 01 and %o4, 1, %o4 do_wait = wait; /* * Now perform the actual message receive */ _CORE_message_queue_Seize( 4000cf00: 90 02 20 1c add %o0, 0x1c, %o0 4000cf04: 92 10 00 18 mov %i0, %o1 4000cf08: 94 10 00 19 mov %i1, %o2 4000cf0c: 96 07 bf fc add %fp, -4, %o3 4000cf10: 98 0b 20 01 and %o4, 1, %o4 4000cf14: 40 00 08 6c call 4000f0c4 <_CORE_message_queue_Seize> 4000cf18: 9a 10 00 1d mov %i5, %o5 &length_out, do_wait, timeout ); _Thread_Enable_dispatch(); 4000cf1c: 40 00 10 44 call 4001102c <_Thread_Enable_dispatch> 4000cf20: 01 00 00 00 nop if (msg_prio) { 4000cf24: 80 a6 e0 00 cmp %i3, 0 4000cf28: 02 80 00 08 be 4000cf48 <_POSIX_Message_queue_Receive_support+0xd4><== NEVER TAKEN 4000cf2c: 03 10 00 a5 sethi %hi(0x40029400), %g1 *msg_prio = _POSIX_Message_queue_Priority_from_core( _Thread_Executing->Wait.count 4000cf30: c2 00 60 c0 ld [ %g1 + 0xc0 ], %g1 ! 400294c0 <_Per_CPU_Information+0x10> RTEMS_INLINE_ROUTINE unsigned int _POSIX_Message_queue_Priority_from_core( CORE_message_queue_Submit_types priority ) { /* absolute value without a library dependency */ return (unsigned int) ((priority >= 0) ? priority : -priority); 4000cf34: c4 00 60 24 ld [ %g1 + 0x24 ], %g2 4000cf38: 83 38 a0 1f sra %g2, 0x1f, %g1 4000cf3c: 84 18 40 02 xor %g1, %g2, %g2 4000cf40: 82 20 80 01 sub %g2, %g1, %g1 timeout ); _Thread_Enable_dispatch(); if (msg_prio) { *msg_prio = _POSIX_Message_queue_Priority_from_core( 4000cf44: c2 26 c0 00 st %g1, [ %i3 ] _Thread_Executing->Wait.count ); } if ( !_Thread_Executing->Wait.return_code ) 4000cf48: 3b 10 00 a5 sethi %hi(0x40029400), %i5 4000cf4c: ba 17 60 b0 or %i5, 0xb0, %i5 ! 400294b0 <_Per_CPU_Information> 4000cf50: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 4000cf54: c2 00 60 34 ld [ %g1 + 0x34 ], %g1 4000cf58: 80 a0 60 00 cmp %g1, 0 4000cf5c: 12 80 00 05 bne 4000cf70 <_POSIX_Message_queue_Receive_support+0xfc> 4000cf60: 01 00 00 00 nop return length_out; 4000cf64: f0 07 bf fc ld [ %fp + -4 ], %i0 4000cf68: 81 c7 e0 08 ret 4000cf6c: 81 e8 00 00 restore rtems_set_errno_and_return_minus_one( 4000cf70: 40 00 26 8d call 400169a4 <__errno> 4000cf74: b0 10 3f ff mov -1, %i0 4000cf78: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 4000cf7c: b8 10 00 08 mov %o0, %i4 4000cf80: 40 00 00 96 call 4000d1d8 <_POSIX_Message_queue_Translate_core_message_queue_return_code> 4000cf84: d0 00 60 34 ld [ %g1 + 0x34 ], %o0 4000cf88: d0 27 00 00 st %o0, [ %i4 ] 4000cf8c: 81 c7 e0 08 ret 4000cf90: 81 e8 00 00 restore #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); 4000cf94: 40 00 26 84 call 400169a4 <__errno> 4000cf98: 01 00 00 00 nop 4000cf9c: 82 10 20 09 mov 9, %g1 ! 9 4000cfa0: c2 22 00 00 st %g1, [ %o0 ] 4000cfa4: b0 10 3f ff mov -1, %i0 } 4000cfa8: 81 c7 e0 08 ret 4000cfac: 81 e8 00 00 restore =============================================================================== 4000f3d8 <_POSIX_Semaphore_Create_support>: size_t name_len, int pshared, unsigned int value, POSIX_Semaphore_Control **the_sem ) { 4000f3d8: 9d e3 bf a0 save %sp, -96, %sp POSIX_Semaphore_Control *the_semaphore; CORE_semaphore_Attributes *the_sem_attr; char *name; /* Sharing semaphores among processes is not currently supported */ if (pshared != 0) 4000f3dc: 80 a6 a0 00 cmp %i2, 0 4000f3e0: 22 80 00 06 be,a 4000f3f8 <_POSIX_Semaphore_Create_support+0x20> 4000f3e4: 03 10 00 8f sethi %hi(0x40023c00), %g1 rtems_set_errno_and_return_minus_one( ENOSYS ); 4000f3e8: 40 00 09 88 call 40011a08 <__errno> 4000f3ec: 01 00 00 00 nop 4000f3f0: 10 80 00 10 b 4000f430 <_POSIX_Semaphore_Create_support+0x58> 4000f3f4: 82 10 20 58 mov 0x58, %g1 ! 58 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 4000f3f8: c4 00 62 80 ld [ %g1 + 0x280 ], %g2 ++level; 4000f3fc: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 4000f400: c4 20 62 80 st %g2, [ %g1 + 0x280 ] * _POSIX_Semaphore_Allocate */ RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Allocate( void ) { return (POSIX_Semaphore_Control *) 4000f404: 21 10 00 90 sethi %hi(0x40024000), %l0 4000f408: 7f ff ef 4a call 4000b130 <_Objects_Allocate> 4000f40c: 90 14 21 44 or %l0, 0x144, %o0 ! 40024144 <_POSIX_Semaphore_Information> _Thread_Disable_dispatch(); the_semaphore = _POSIX_Semaphore_Allocate(); if ( !the_semaphore ) { 4000f410: ba 92 20 00 orcc %o0, 0, %i5 4000f414: 12 80 00 0a bne 4000f43c <_POSIX_Semaphore_Create_support+0x64> 4000f418: 80 a6 20 00 cmp %i0, 0 _Thread_Enable_dispatch(); 4000f41c: 7f ff f4 45 call 4000c530 <_Thread_Enable_dispatch> 4000f420: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( ENOSPC ); 4000f424: 40 00 09 79 call 40011a08 <__errno> 4000f428: 01 00 00 00 nop 4000f42c: 82 10 20 1c mov 0x1c, %g1 ! 1c 4000f430: c2 22 00 00 st %g1, [ %o0 ] 4000f434: 81 c7 e0 08 ret 4000f438: 91 e8 3f ff restore %g0, -1, %o0 /* * Make a copy of the user's string for name just in case it was * dynamically constructed. */ if ( name_arg != NULL ) { 4000f43c: 02 80 00 10 be 4000f47c <_POSIX_Semaphore_Create_support+0xa4> 4000f440: 90 10 00 18 mov %i0, %o0 name = _Workspace_String_duplicate( name_arg, name_len ); 4000f444: 40 00 03 ca call 4001036c <_Workspace_String_duplicate> 4000f448: 92 10 00 19 mov %i1, %o1 if ( !name ) { 4000f44c: b4 92 20 00 orcc %o0, 0, %i2 4000f450: 12 80 00 0d bne 4000f484 <_POSIX_Semaphore_Create_support+0xac><== ALWAYS TAKEN 4000f454: 80 a6 a0 00 cmp %i2, 0 RTEMS_INLINE_ROUTINE void _POSIX_Semaphore_Free ( POSIX_Semaphore_Control *the_semaphore ) { _Objects_Free( &_POSIX_Semaphore_Information, &the_semaphore->Object ); 4000f458: 90 14 21 44 or %l0, 0x144, %o0 <== NOT EXECUTED 4000f45c: 7f ff f0 14 call 4000b4ac <_Objects_Free> <== NOT EXECUTED 4000f460: 92 10 00 1d mov %i5, %o1 <== NOT EXECUTED _POSIX_Semaphore_Free( the_semaphore ); _Thread_Enable_dispatch(); 4000f464: 7f ff f4 33 call 4000c530 <_Thread_Enable_dispatch> <== NOT EXECUTED 4000f468: 01 00 00 00 nop <== NOT EXECUTED rtems_set_errno_and_return_minus_one( ENOMEM ); 4000f46c: 40 00 09 67 call 40011a08 <__errno> <== NOT EXECUTED 4000f470: 01 00 00 00 nop <== NOT EXECUTED 4000f474: 10 bf ff ef b 4000f430 <_POSIX_Semaphore_Create_support+0x58><== NOT EXECUTED 4000f478: 82 10 20 0c mov 0xc, %g1 ! c <== NOT EXECUTED } } else { name = NULL; 4000f47c: b4 10 20 00 clr %i2 } the_semaphore->process_shared = pshared; if ( name ) { 4000f480: 80 a6 a0 00 cmp %i2, 0 4000f484: 02 80 00 08 be 4000f4a4 <_POSIX_Semaphore_Create_support+0xcc> 4000f488: c0 27 60 10 clr [ %i5 + 0x10 ] the_semaphore->named = true; 4000f48c: 82 10 20 01 mov 1, %g1 4000f490: c2 2f 60 14 stb %g1, [ %i5 + 0x14 ] the_semaphore->open_count = 1; 4000f494: 82 10 20 01 mov 1, %g1 4000f498: c2 27 60 18 st %g1, [ %i5 + 0x18 ] the_semaphore->linked = true; 4000f49c: 10 80 00 05 b 4000f4b0 <_POSIX_Semaphore_Create_support+0xd8> 4000f4a0: c2 2f 60 15 stb %g1, [ %i5 + 0x15 ] } else { the_semaphore->named = false; 4000f4a4: c0 2f 60 14 clrb [ %i5 + 0x14 ] the_semaphore->open_count = 0; 4000f4a8: c0 27 60 18 clr [ %i5 + 0x18 ] the_semaphore->linked = false; 4000f4ac: c0 2f 60 15 clrb [ %i5 + 0x15 ] the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO; /* * This effectively disables limit checking. */ the_sem_attr->maximum_count = 0xFFFFFFFF; 4000f4b0: 82 10 3f ff mov -1, %g1 _CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value ); 4000f4b4: 90 07 60 1c add %i5, 0x1c, %o0 the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO; /* * This effectively disables limit checking. */ the_sem_attr->maximum_count = 0xFFFFFFFF; 4000f4b8: c2 27 60 5c st %g1, [ %i5 + 0x5c ] _CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value ); 4000f4bc: 92 07 60 5c add %i5, 0x5c, %o1 4000f4c0: 94 10 00 1b mov %i3, %o2 4000f4c4: 7f ff ed 90 call 4000ab04 <_CORE_semaphore_Initialize> 4000f4c8: c0 27 60 60 clr [ %i5 + 0x60 ] Objects_Information *information, Objects_Control *the_object, const char *name ) { _Objects_Set_local_object( 4000f4cc: c2 17 60 0a lduh [ %i5 + 0xa ], %g1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4000f4d0: 05 10 00 90 sethi %hi(0x40024000), %g2 4000f4d4: c4 00 a1 60 ld [ %g2 + 0x160 ], %g2 ! 40024160 <_POSIX_Semaphore_Information+0x1c> 4000f4d8: 83 28 60 02 sll %g1, 2, %g1 4000f4dc: fa 20 80 01 st %i5, [ %g2 + %g1 ] the_object ); #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) /* ASSERT: information->is_string */ the_object->name.name_p = name; 4000f4e0: f4 27 60 0c st %i2, [ %i5 + 0xc ] &_POSIX_Semaphore_Information, &the_semaphore->Object, name ); *the_sem = the_semaphore; 4000f4e4: fa 27 00 00 st %i5, [ %i4 ] _Thread_Enable_dispatch(); 4000f4e8: 7f ff f4 12 call 4000c530 <_Thread_Enable_dispatch> 4000f4ec: b0 10 20 00 clr %i0 return 0; } 4000f4f0: 81 c7 e0 08 ret 4000f4f4: 81 e8 00 00 restore =============================================================================== 4000cae0 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch>: Thread_Control *the_thread ) { POSIX_API_Control *thread_support; thread_support = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4000cae0: c2 02 21 50 ld [ %o0 + 0x150 ], %g1 if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 4000cae4: c4 00 60 d8 ld [ %g1 + 0xd8 ], %g2 4000cae8: 80 a0 a0 00 cmp %g2, 0 4000caec: 12 80 00 12 bne 4000cb34 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x54><== NEVER TAKEN 4000caf0: 01 00 00 00 nop 4000caf4: c4 00 60 dc ld [ %g1 + 0xdc ], %g2 4000caf8: 80 a0 a0 01 cmp %g2, 1 4000cafc: 12 80 00 0e bne 4000cb34 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x54> 4000cb00: 01 00 00 00 nop thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS && 4000cb04: c2 00 60 e0 ld [ %g1 + 0xe0 ], %g1 4000cb08: 80 a0 60 00 cmp %g1, 0 4000cb0c: 02 80 00 0a be 4000cb34 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x54> 4000cb10: 01 00 00 00 nop * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 4000cb14: 03 10 00 60 sethi %hi(0x40018000), %g1 4000cb18: c4 00 62 50 ld [ %g1 + 0x250 ], %g2 ! 40018250 <_Thread_Dispatch_disable_level> thread_support->cancelation_requested ) { _Thread_Unnest_dispatch(); _POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED ); 4000cb1c: 92 10 3f ff mov -1, %o1 --level; 4000cb20: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = level; 4000cb24: c4 20 62 50 st %g2, [ %g1 + 0x250 ] 4000cb28: 82 13 c0 00 mov %o7, %g1 4000cb2c: 40 00 01 b5 call 4000d200 <_POSIX_Thread_Exit> 4000cb30: 9e 10 40 00 mov %g1, %o7 } else _Thread_Enable_dispatch(); 4000cb34: 82 13 c0 00 mov %o7, %g1 4000cb38: 7f ff f6 b3 call 4000a604 <_Thread_Enable_dispatch> 4000cb3c: 9e 10 40 00 mov %g1, %o7 =============================================================================== 4000de90 <_POSIX_Thread_Translate_sched_param>: int policy, struct sched_param *param, Thread_CPU_budget_algorithms *budget_algorithm, Thread_CPU_budget_algorithm_callout *budget_callout ) { 4000de90: 9d e3 bf a0 save %sp, -96, %sp if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) 4000de94: 7f ff ff f4 call 4000de64 <_POSIX_Priority_Is_valid> 4000de98: d0 06 40 00 ld [ %i1 ], %o0 4000de9c: 80 8a 20 ff btst 0xff, %o0 4000dea0: 32 80 00 04 bne,a 4000deb0 <_POSIX_Thread_Translate_sched_param+0x20><== ALWAYS TAKEN 4000dea4: c0 26 80 00 clr [ %i2 ] return EINVAL; 4000dea8: 81 c7 e0 08 ret 4000deac: 91 e8 20 16 restore %g0, 0x16, %o0 *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; *budget_callout = NULL; if ( policy == SCHED_OTHER ) { 4000deb0: 80 a6 20 00 cmp %i0, 0 4000deb4: 12 80 00 06 bne 4000decc <_POSIX_Thread_Translate_sched_param+0x3c> 4000deb8: c0 26 c0 00 clr [ %i3 ] *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 4000debc: 82 10 20 01 mov 1, %g1 4000dec0: c2 26 80 00 st %g1, [ %i2 ] return 0; 4000dec4: 81 c7 e0 08 ret 4000dec8: 81 e8 00 00 restore } if ( policy == SCHED_FIFO ) { 4000decc: 80 a6 20 01 cmp %i0, 1 4000ded0: 02 80 00 29 be 4000df74 <_POSIX_Thread_Translate_sched_param+0xe4> 4000ded4: 80 a6 20 02 cmp %i0, 2 *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; return 0; } if ( policy == SCHED_RR ) { 4000ded8: 12 80 00 04 bne 4000dee8 <_POSIX_Thread_Translate_sched_param+0x58> 4000dedc: 80 a6 20 04 cmp %i0, 4 *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; 4000dee0: 10 80 00 25 b 4000df74 <_POSIX_Thread_Translate_sched_param+0xe4> 4000dee4: f0 26 80 00 st %i0, [ %i2 ] return 0; } if ( policy == SCHED_SPORADIC ) { 4000dee8: 12 bf ff f0 bne 4000dea8 <_POSIX_Thread_Translate_sched_param+0x18> 4000deec: 01 00 00 00 nop if ( (param->sched_ss_repl_period.tv_sec == 0) && 4000def0: c2 06 60 08 ld [ %i1 + 8 ], %g1 4000def4: 80 a0 60 00 cmp %g1, 0 4000def8: 32 80 00 07 bne,a 4000df14 <_POSIX_Thread_Translate_sched_param+0x84> 4000defc: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 4000df00: c2 06 60 0c ld [ %i1 + 0xc ], %g1 4000df04: 80 a0 60 00 cmp %g1, 0 4000df08: 02 bf ff e8 be 4000dea8 <_POSIX_Thread_Translate_sched_param+0x18> 4000df0c: 01 00 00 00 nop (param->sched_ss_repl_period.tv_nsec == 0) ) return EINVAL; if ( (param->sched_ss_init_budget.tv_sec == 0) && 4000df10: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 4000df14: 80 a0 60 00 cmp %g1, 0 4000df18: 12 80 00 06 bne 4000df30 <_POSIX_Thread_Translate_sched_param+0xa0> 4000df1c: 01 00 00 00 nop 4000df20: c2 06 60 14 ld [ %i1 + 0x14 ], %g1 4000df24: 80 a0 60 00 cmp %g1, 0 4000df28: 02 bf ff e0 be 4000dea8 <_POSIX_Thread_Translate_sched_param+0x18> 4000df2c: 01 00 00 00 nop (param->sched_ss_init_budget.tv_nsec == 0) ) return EINVAL; if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) < 4000df30: 7f ff f7 b4 call 4000be00 <_Timespec_To_ticks> 4000df34: 90 06 60 08 add %i1, 8, %o0 4000df38: ba 10 00 08 mov %o0, %i5 _Timespec_To_ticks( ¶m->sched_ss_init_budget ) ) 4000df3c: 7f ff f7 b1 call 4000be00 <_Timespec_To_ticks> 4000df40: 90 06 60 10 add %i1, 0x10, %o0 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 ) < 4000df44: 80 a7 40 08 cmp %i5, %o0 4000df48: 0a bf ff d8 bcs 4000dea8 <_POSIX_Thread_Translate_sched_param+0x18> 4000df4c: 01 00 00 00 nop _Timespec_To_ticks( ¶m->sched_ss_init_budget ) ) return EINVAL; if ( !_POSIX_Priority_Is_valid( param->sched_ss_low_priority ) ) 4000df50: 7f ff ff c5 call 4000de64 <_POSIX_Priority_Is_valid> 4000df54: d0 06 60 04 ld [ %i1 + 4 ], %o0 4000df58: 80 8a 20 ff btst 0xff, %o0 4000df5c: 02 bf ff d3 be 4000dea8 <_POSIX_Thread_Translate_sched_param+0x18> 4000df60: 82 10 20 03 mov 3, %g1 return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; 4000df64: c2 26 80 00 st %g1, [ %i2 ] *budget_callout = _POSIX_Threads_Sporadic_budget_callout; 4000df68: 03 10 00 20 sethi %hi(0x40008000), %g1 4000df6c: 82 10 62 18 or %g1, 0x218, %g1 ! 40008218 <_POSIX_Threads_Sporadic_budget_callout> 4000df70: c2 26 c0 00 st %g1, [ %i3 ] return 0; } return EINVAL; } 4000df74: 81 c7 e0 08 ret 4000df78: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 4000d228 <_POSIX_Threads_Delete_extension>: */ static void _POSIX_Threads_Delete_extension( Thread_Control *executing __attribute__((unused)), Thread_Control *deleted ) { 4000d228: 9d e3 bf a0 save %sp, -96, %sp Thread_Control *the_thread; POSIX_API_Control *api; void **value_ptr; api = deleted->API_Extensions[ THREAD_API_POSIX ]; 4000d22c: f0 06 61 50 ld [ %i1 + 0x150 ], %i0 /* * Run the POSIX cancellation handlers */ _POSIX_Threads_cancel_run( deleted ); 4000d230: 40 00 08 28 call 4000f2d0 <_POSIX_Threads_cancel_run> 4000d234: 90 10 00 19 mov %i1, %o0 /* * Run all the key destructors */ _POSIX_Keys_Run_destructors( deleted ); 4000d238: 90 10 00 19 mov %i1, %o0 4000d23c: 40 00 08 3f call 4000f338 <_POSIX_Keys_Run_destructors> 4000d240: ba 06 20 44 add %i0, 0x44, %i5 /* * Wakeup all the tasks which joined with this one */ value_ptr = (void **) deleted->Wait.return_argument; while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) ) 4000d244: 10 80 00 03 b 4000d250 <_POSIX_Threads_Delete_extension+0x28> 4000d248: f8 06 60 28 ld [ %i1 + 0x28 ], %i4 *(void **)the_thread->Wait.return_argument = value_ptr; 4000d24c: f8 20 40 00 st %i4, [ %g1 ] <== NOT EXECUTED /* * Wakeup all the tasks which joined with this one */ value_ptr = (void **) deleted->Wait.return_argument; while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) ) 4000d250: 7f ff f6 6a call 4000abf8 <_Thread_queue_Dequeue> 4000d254: 90 10 00 1d mov %i5, %o0 4000d258: 80 a2 20 00 cmp %o0, 0 4000d25c: 32 bf ff fc bne,a 4000d24c <_POSIX_Threads_Delete_extension+0x24><== NEVER TAKEN 4000d260: c2 02 20 28 ld [ %o0 + 0x28 ], %g1 <== NOT EXECUTED *(void **)the_thread->Wait.return_argument = value_ptr; if ( api->schedpolicy == SCHED_SPORADIC ) 4000d264: c2 06 20 84 ld [ %i0 + 0x84 ], %g1 4000d268: 80 a0 60 04 cmp %g1, 4 4000d26c: 32 80 00 05 bne,a 4000d280 <_POSIX_Threads_Delete_extension+0x58> 4000d270: c0 26 61 50 clr [ %i1 + 0x150 ] (void) _Watchdog_Remove( &api->Sporadic_timer ); 4000d274: 7f ff f8 f0 call 4000b634 <_Watchdog_Remove> 4000d278: 90 06 20 a8 add %i0, 0xa8, %o0 deleted->API_Extensions[ THREAD_API_POSIX ] = NULL; 4000d27c: c0 26 61 50 clr [ %i1 + 0x150 ] _Workspace_Free( api ); 4000d280: 7f ff f9 8e call 4000b8b8 <_Workspace_Free> 4000d284: 81 e8 00 00 restore =============================================================================== 40007f74 <_POSIX_Threads_Initialize_user_threads_body>: #include #include #include void _POSIX_Threads_Initialize_user_threads_body(void) { 40007f74: 9d e3 bf 58 save %sp, -168, %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; 40007f78: 03 10 00 7c sethi %hi(0x4001f000), %g1 40007f7c: 82 10 61 34 or %g1, 0x134, %g1 ! 4001f134 maximum = Configuration_POSIX_API.number_of_initialization_threads; 40007f80: f6 00 60 30 ld [ %g1 + 0x30 ], %i3 if ( !user_threads || maximum == 0 ) 40007f84: 80 a6 e0 00 cmp %i3, 0 40007f88: 02 80 00 1d be 40007ffc <_POSIX_Threads_Initialize_user_threads_body+0x88><== NEVER TAKEN 40007f8c: fa 00 60 34 ld [ %g1 + 0x34 ], %i5 40007f90: 80 a7 60 00 cmp %i5, 0 40007f94: 02 80 00 1a be 40007ffc <_POSIX_Threads_Initialize_user_threads_body+0x88><== NEVER TAKEN 40007f98: b8 10 20 00 clr %i4 for ( index=0 ; index < maximum ; index++ ) { /* * There is no way for these calls to fail in this situation. */ (void) pthread_attr_init( &attr ); 40007f9c: 40 00 17 f8 call 4000df7c 40007fa0: 90 07 bf c0 add %fp, -64, %o0 (void) pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); 40007fa4: 92 10 20 02 mov 2, %o1 40007fa8: 40 00 18 01 call 4000dfac 40007fac: 90 07 bf c0 add %fp, -64, %o0 (void) pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size); 40007fb0: d2 07 60 04 ld [ %i5 + 4 ], %o1 40007fb4: 40 00 18 0d call 4000dfe8 40007fb8: 90 07 bf c0 add %fp, -64, %o0 status = pthread_create( 40007fbc: d4 07 40 00 ld [ %i5 ], %o2 40007fc0: 90 07 bf bc add %fp, -68, %o0 40007fc4: 92 07 bf c0 add %fp, -64, %o1 40007fc8: 96 10 20 00 clr %o3 40007fcc: 7f ff ff 18 call 40007c2c 40007fd0: ba 07 60 08 add %i5, 8, %i5 &thread_id, &attr, user_threads[ index ].thread_entry, NULL ); if ( status ) 40007fd4: 80 a2 20 00 cmp %o0, 0 40007fd8: 02 80 00 05 be 40007fec <_POSIX_Threads_Initialize_user_threads_body+0x78> 40007fdc: 94 10 00 08 mov %o0, %o2 _Internal_error_Occurred( INTERNAL_ERROR_POSIX_API, true, status ); 40007fe0: 90 10 20 02 mov 2, %o0 40007fe4: 40 00 07 f8 call 40009fc4 <_Internal_error_Occurred> 40007fe8: 92 10 20 01 mov 1, %o1 * * Setting the attributes explicitly is critical, since we don't want * to inherit the idle tasks attributes. */ for ( index=0 ; index < maximum ; index++ ) { 40007fec: b8 07 20 01 inc %i4 40007ff0: 80 a7 00 1b cmp %i4, %i3 40007ff4: 12 bf ff ea bne 40007f9c <_POSIX_Threads_Initialize_user_threads_body+0x28><== NEVER TAKEN 40007ff8: 01 00 00 00 nop 40007ffc: 81 c7 e0 08 ret 40008000: 81 e8 00 00 restore =============================================================================== 4000d37c <_POSIX_Threads_Sporadic_budget_TSR>: */ void _POSIX_Threads_Sporadic_budget_TSR( Objects_Id id __attribute__((unused)), void *argument ) { 4000d37c: 9d e3 bf a0 save %sp, -96, %sp Thread_Control *the_thread; POSIX_API_Control *api; the_thread = argument; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4000d380: fa 06 61 50 ld [ %i1 + 0x150 ], %i5 /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_init_budget ); 4000d384: 40 00 03 82 call 4000e18c <_Timespec_To_ticks> 4000d388: 90 07 60 98 add %i5, 0x98, %o0 RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( int priority ) { return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1); 4000d38c: 03 10 00 79 sethi %hi(0x4001e400), %g1 4000d390: d2 08 62 ac ldub [ %g1 + 0x2ac ], %o1 ! 4001e6ac 4000d394: c2 07 60 88 ld [ %i5 + 0x88 ], %g1 the_thread->cpu_time_budget = ticks; 4000d398: d0 26 60 74 st %o0, [ %i1 + 0x74 ] 4000d39c: 92 22 40 01 sub %o1, %g1, %o1 */ #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 ) { 4000d3a0: c2 06 60 1c ld [ %i1 + 0x1c ], %g1 4000d3a4: 80 a0 60 00 cmp %g1, 0 4000d3a8: 12 80 00 09 bne 4000d3cc <_POSIX_Threads_Sporadic_budget_TSR+0x50><== NEVER TAKEN 4000d3ac: d2 26 60 18 st %o1, [ %i1 + 0x18 ] /* * If this would make them less important, then do not change it. */ if ( the_thread->current_priority > new_priority ) { 4000d3b0: c2 06 60 14 ld [ %i1 + 0x14 ], %g1 4000d3b4: 80 a0 40 09 cmp %g1, %o1 4000d3b8: 08 80 00 06 bleu 4000d3d0 <_POSIX_Threads_Sporadic_budget_TSR+0x54> 4000d3bc: 90 07 60 90 add %i5, 0x90, %o0 _Thread_Change_priority( the_thread, new_priority, true ); 4000d3c0: 90 10 00 19 mov %i1, %o0 4000d3c4: 7f ff f4 1b call 4000a430 <_Thread_Change_priority> 4000d3c8: 94 10 20 01 mov 1, %o2 #endif } } /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_repl_period ); 4000d3cc: 90 07 60 90 add %i5, 0x90, %o0 4000d3d0: 40 00 03 6f call 4000e18c <_Timespec_To_ticks> 4000d3d4: 31 10 00 7d sethi %hi(0x4001f400), %i0 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 4000d3d8: b0 16 21 18 or %i0, 0x118, %i0 ! 4001f518 <_Watchdog_Ticks_chain> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 4000d3dc: d0 27 60 b4 st %o0, [ %i5 + 0xb4 ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 4000d3e0: 7f ff f8 3d call 4000b4d4 <_Watchdog_Insert> 4000d3e4: 93 ef 60 a8 restore %i5, 0xa8, %o1 =============================================================================== 4000d3e8 <_POSIX_Threads_Sporadic_budget_callout>: ) { POSIX_API_Control *api; uint32_t new_priority; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4000d3e8: c4 02 21 50 ld [ %o0 + 0x150 ], %g2 /* * 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 */ 4000d3ec: 86 10 3f ff mov -1, %g3 4000d3f0: c4 00 a0 8c ld [ %g2 + 0x8c ], %g2 4000d3f4: c6 22 20 74 st %g3, [ %o0 + 0x74 ] 4000d3f8: 07 10 00 79 sethi %hi(0x4001e400), %g3 4000d3fc: d2 08 e2 ac ldub [ %g3 + 0x2ac ], %o1 ! 4001e6ac 4000d400: 92 22 40 02 sub %o1, %g2, %o1 */ #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 ) { 4000d404: c4 02 20 1c ld [ %o0 + 0x1c ], %g2 4000d408: 80 a0 a0 00 cmp %g2, 0 4000d40c: 12 80 00 09 bne 4000d430 <_POSIX_Threads_Sporadic_budget_callout+0x48><== NEVER TAKEN 4000d410: d2 22 20 18 st %o1, [ %o0 + 0x18 ] /* * 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 ) { 4000d414: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 4000d418: 80 a0 40 09 cmp %g1, %o1 4000d41c: 1a 80 00 05 bcc 4000d430 <_POSIX_Threads_Sporadic_budget_callout+0x48><== NEVER TAKEN 4000d420: 94 10 20 01 mov 1, %o2 _Thread_Change_priority( the_thread, new_priority, true ); 4000d424: 82 13 c0 00 mov %o7, %g1 4000d428: 7f ff f4 02 call 4000a430 <_Thread_Change_priority> 4000d42c: 9e 10 40 00 mov %g1, %o7 4000d430: 81 c3 e0 08 retl <== NOT EXECUTED =============================================================================== 40007d2c <_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) { 40007d2c: 9d e3 bf 98 save %sp, -104, %sp bool activated; ptimer = (POSIX_Timer_Control *)data; /* Increment the number of expirations. */ ptimer->overrun = ptimer->overrun + 1; 40007d30: c2 06 60 68 ld [ %i1 + 0x68 ], %g1 40007d34: 82 00 60 01 inc %g1 40007d38: c2 26 60 68 st %g1, [ %i1 + 0x68 ] /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || 40007d3c: c2 06 60 54 ld [ %i1 + 0x54 ], %g1 40007d40: 80 a0 60 00 cmp %g1, 0 40007d44: 32 80 00 07 bne,a 40007d60 <_POSIX_Timer_TSR+0x34> 40007d48: d2 06 60 64 ld [ %i1 + 0x64 ], %o1 40007d4c: c2 06 60 58 ld [ %i1 + 0x58 ], %g1 40007d50: 80 a0 60 00 cmp %g1, 0 40007d54: 02 80 00 1f be 40007dd0 <_POSIX_Timer_TSR+0xa4> <== NEVER TAKEN 40007d58: 82 10 20 04 mov 4, %g1 ( ptimer->timer_data.it_interval.tv_nsec != 0 ) ) { activated = _POSIX_Timer_Insert_helper( 40007d5c: d2 06 60 64 ld [ %i1 + 0x64 ], %o1 40007d60: d4 06 60 08 ld [ %i1 + 8 ], %o2 40007d64: 90 06 60 10 add %i1, 0x10, %o0 40007d68: 17 10 00 1f sethi %hi(0x40007c00), %o3 40007d6c: 98 10 00 19 mov %i1, %o4 40007d70: 40 00 17 ca call 4000dc98 <_POSIX_Timer_Insert_helper> 40007d74: 96 12 e1 2c or %o3, 0x12c, %o3 ptimer->ticks, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) 40007d78: 80 8a 20 ff btst 0xff, %o0 40007d7c: 02 80 00 1a be 40007de4 <_POSIX_Timer_TSR+0xb8> <== NEVER TAKEN 40007d80: 90 07 bf f8 add %fp, -8, %o0 40007d84: 13 10 00 7f sethi %hi(0x4001fc00), %o1 40007d88: 40 00 05 ed call 4000953c <_TOD_Get_with_nanoseconds> 40007d8c: 92 12 62 28 or %o1, 0x228, %o1 ! 4001fe28 <_TOD> /* After the signal handler returns, the count of expirations of the * timer must be set to 0. */ ptimer->overrun = 0; } 40007d90: f8 1a 00 00 ldd [ %o0 ], %i4 static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); 40007d94: 94 10 20 00 clr %o2 40007d98: 90 10 00 1c mov %i4, %o0 40007d9c: 92 10 00 1d mov %i5, %o1 40007da0: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 40007da4: 40 00 48 0b call 40019dd0 <__divdi3> 40007da8: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 40007dac: 90 10 00 1c mov %i4, %o0 static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); 40007db0: d2 26 60 6c st %o1, [ %i1 + 0x6c ] _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 40007db4: 94 10 20 00 clr %o2 40007db8: 92 10 00 1d mov %i5, %o1 40007dbc: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 40007dc0: 40 00 48 ef call 4001a17c <__moddi3> 40007dc4: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 /* Store the time when the timer was started again */ _TOD_Get( &ptimer->time ); /* The state really did not change but just to be safe */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; 40007dc8: 82 10 20 03 mov 3, %g1 40007dcc: d2 26 60 70 st %o1, [ %i1 + 0x70 ] /* * 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 ) ) { 40007dd0: d0 06 60 38 ld [ %i1 + 0x38 ], %o0 40007dd4: d2 06 60 44 ld [ %i1 + 0x44 ], %o1 40007dd8: 40 00 16 9f call 4000d854 40007ddc: c2 2e 60 3c stb %g1, [ %i1 + 0x3c ] } /* After the signal handler returns, the count of expirations of the * timer must be set to 0. */ ptimer->overrun = 0; 40007de0: c0 26 60 68 clr [ %i1 + 0x68 ] 40007de4: 81 c7 e0 08 ret 40007de8: 81 e8 00 00 restore =============================================================================== 4000f3f4 <_POSIX_signals_Check_signal>: bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 4000f3f4: 9d e3 bf 68 save %sp, -152, %sp siginfo_t siginfo_struct; sigset_t saved_signals_blocked; Thread_Wait_information stored_thread_wait_information; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 4000f3f8: 98 10 20 01 mov 1, %o4 4000f3fc: 90 10 00 18 mov %i0, %o0 4000f400: 92 10 00 19 mov %i1, %o1 4000f404: 94 07 bf cc add %fp, -52, %o2 4000f408: 40 00 00 2e call 4000f4c0 <_POSIX_signals_Clear_signals> 4000f40c: 96 10 00 1a mov %i2, %o3 4000f410: 80 8a 20 ff btst 0xff, %o0 4000f414: 02 80 00 28 be 4000f4b4 <_POSIX_signals_Check_signal+0xc0> 4000f418: 82 10 20 00 clr %g1 #endif /* * Just to prevent sending a signal which is currently being ignored. */ if ( _POSIX_signals_Vectors[ signo ].sa_handler == SIG_IGN ) 4000f41c: 85 2e 60 02 sll %i1, 2, %g2 4000f420: 35 10 00 7e sethi %hi(0x4001f800), %i2 4000f424: b7 2e 60 04 sll %i1, 4, %i3 4000f428: b4 16 a1 f0 or %i2, 0x1f0, %i2 4000f42c: b6 26 c0 02 sub %i3, %g2, %i3 4000f430: 84 06 80 1b add %i2, %i3, %g2 4000f434: fa 00 a0 08 ld [ %g2 + 8 ], %i5 4000f438: 80 a7 60 01 cmp %i5, 1 4000f43c: 02 80 00 1e be 4000f4b4 <_POSIX_signals_Check_signal+0xc0><== NEVER TAKEN 4000f440: 90 07 bf d8 add %fp, -40, %o0 return false; /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; 4000f444: f8 06 20 d0 ld [ %i0 + 0xd0 ], %i4 api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; 4000f448: c2 00 a0 04 ld [ %g2 + 4 ], %g1 4000f44c: 82 10 40 1c or %g1, %i4, %g1 4000f450: c2 26 20 d0 st %g1, [ %i0 + 0xd0 ] /* * We have to save the blocking information of the current wait queue * because the signal handler may subsequently go on and put the thread * on a wait queue, for its own purposes. */ memcpy( &stored_thread_wait_information, &_Thread_Executing->Wait, 4000f454: 03 10 00 7e sethi %hi(0x4001f800), %g1 4000f458: d2 00 61 a0 ld [ %g1 + 0x1a0 ], %o1 ! 4001f9a0 <_Per_CPU_Information+0x10> 4000f45c: 94 10 20 28 mov 0x28, %o2 4000f460: 40 00 03 f2 call 40010428 4000f464: 92 02 60 20 add %o1, 0x20, %o1 sizeof( Thread_Wait_information )); /* * Here, the signal handler function executes */ switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) { 4000f468: c2 06 80 1b ld [ %i2 + %i3 ], %g1 4000f46c: 80 a0 60 02 cmp %g1, 2 4000f470: 12 80 00 07 bne 4000f48c <_POSIX_signals_Check_signal+0x98> 4000f474: 90 10 00 19 mov %i1, %o0 case SA_SIGINFO: (*_POSIX_signals_Vectors[ signo ].sa_sigaction)( 4000f478: 92 07 bf cc add %fp, -52, %o1 4000f47c: 9f c7 40 00 call %i5 4000f480: 94 10 20 00 clr %o2 signo, &siginfo_struct, NULL /* context is undefined per 1003.1b-1993, p. 66 */ ); break; 4000f484: 10 80 00 05 b 4000f498 <_POSIX_signals_Check_signal+0xa4> 4000f488: 03 10 00 7e sethi %hi(0x4001f800), %g1 default: (*_POSIX_signals_Vectors[ signo ].sa_handler)( signo ); 4000f48c: 9f c7 40 00 call %i5 4000f490: 01 00 00 00 nop } /* * Restore the blocking information */ memcpy( &_Thread_Executing->Wait, &stored_thread_wait_information, 4000f494: 03 10 00 7e sethi %hi(0x4001f800), %g1 4000f498: d0 00 61 a0 ld [ %g1 + 0x1a0 ], %o0 ! 4001f9a0 <_Per_CPU_Information+0x10> 4000f49c: 92 07 bf d8 add %fp, -40, %o1 4000f4a0: 90 02 20 20 add %o0, 0x20, %o0 4000f4a4: 40 00 03 e1 call 40010428 4000f4a8: 94 10 20 28 mov 0x28, %o2 /* * Restore the previous set of blocked signals */ api->signals_blocked = saved_signals_blocked; return true; 4000f4ac: 82 10 20 01 mov 1, %g1 sizeof( Thread_Wait_information )); /* * Restore the previous set of blocked signals */ api->signals_blocked = saved_signals_blocked; 4000f4b0: f8 26 20 d0 st %i4, [ %i0 + 0xd0 ] return true; } 4000f4b4: b0 08 60 01 and %g1, 1, %i0 4000f4b8: 81 c7 e0 08 ret 4000f4bc: 81 e8 00 00 restore =============================================================================== 4000fa40 <_POSIX_signals_Clear_process_signals>: */ void _POSIX_signals_Clear_process_signals( int signo ) { 4000fa40: 9d e3 bf a0 save %sp, -96, %sp 4000fa44: 82 06 3f ff add %i0, -1, %g1 4000fa48: ba 10 20 01 mov 1, %i5 clear_signal = true; mask = signo_to_mask( signo ); ISR_Level level; _ISR_Disable( level ); 4000fa4c: 7f ff ca 7f call 40002448 4000fa50: bb 2f 40 01 sll %i5, %g1, %i5 if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { 4000fa54: 05 10 00 7e sethi %hi(0x4001f800), %g2 4000fa58: 83 2e 20 02 sll %i0, 2, %g1 4000fa5c: 84 10 a1 f0 or %g2, 0x1f0, %g2 4000fa60: b1 2e 20 04 sll %i0, 4, %i0 4000fa64: 82 26 00 01 sub %i0, %g1, %g1 4000fa68: c4 00 80 01 ld [ %g2 + %g1 ], %g2 4000fa6c: 80 a0 a0 02 cmp %g2, 2 4000fa70: 32 80 00 0c bne,a 4000faa0 <_POSIX_signals_Clear_process_signals+0x60> 4000fa74: 03 10 00 7e sethi %hi(0x4001f800), %g1 if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) 4000fa78: 05 10 00 7e sethi %hi(0x4001f800), %g2 4000fa7c: 84 10 a3 e8 or %g2, 0x3e8, %g2 ! 4001fbe8 <_POSIX_signals_Siginfo> 4000fa80: 86 00 40 02 add %g1, %g2, %g3 4000fa84: c2 00 40 02 ld [ %g1 + %g2 ], %g1 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 4000fa88: 86 00 e0 04 add %g3, 4, %g3 4000fa8c: 80 a0 40 03 cmp %g1, %g3 4000fa90: 02 80 00 04 be 4000faa0 <_POSIX_signals_Clear_process_signals+0x60><== ALWAYS TAKEN 4000fa94: 03 10 00 7e sethi %hi(0x4001f800), %g1 clear_signal = false; } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; } _ISR_Enable( level ); 4000fa98: 7f ff ca 70 call 40002458 4000fa9c: 91 e8 00 08 restore %g0, %o0, %o0 if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) clear_signal = false; } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; 4000faa0: c4 00 63 e4 ld [ %g1 + 0x3e4 ], %g2 4000faa4: ba 28 80 1d andn %g2, %i5, %i5 4000faa8: 10 bf ff fc b 4000fa98 <_POSIX_signals_Clear_process_signals+0x58> 4000faac: fa 20 63 e4 st %i5, [ %g1 + 0x3e4 ] =============================================================================== 40008824 <_POSIX_signals_Get_lowest>: sigset_t set ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 40008824: 82 10 20 1b mov 0x1b, %g1 40008828: 84 10 20 01 mov 1, %g2 #include #include #include #include static int _POSIX_signals_Get_lowest( 4000882c: 86 00 7f ff add %g1, -1, %g3 40008830: 87 28 80 03 sll %g2, %g3, %g3 ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { if ( set & signo_to_mask( signo ) ) { 40008834: 80 88 c0 08 btst %g3, %o0 40008838: 12 80 00 11 bne 4000887c <_POSIX_signals_Get_lowest+0x58> <== NEVER TAKEN 4000883c: 01 00 00 00 nop sigset_t set ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 40008840: 82 00 60 01 inc %g1 40008844: 80 a0 60 20 cmp %g1, 0x20 40008848: 12 bf ff fa bne 40008830 <_POSIX_signals_Get_lowest+0xc> 4000884c: 86 00 7f ff add %g1, -1, %g3 40008850: 82 10 20 01 mov 1, %g1 40008854: 84 10 20 01 mov 1, %g2 #include #include #include #include static int _POSIX_signals_Get_lowest( 40008858: 86 00 7f ff add %g1, -1, %g3 4000885c: 87 28 80 03 sll %g2, %g3, %g3 #if (SIGHUP != 1) #error "Assumption that SIGHUP==1 violated!!" #endif for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { if ( set & signo_to_mask( signo ) ) { 40008860: 80 88 c0 08 btst %g3, %o0 40008864: 12 80 00 06 bne 4000887c <_POSIX_signals_Get_lowest+0x58> 40008868: 01 00 00 00 nop */ #if (SIGHUP != 1) #error "Assumption that SIGHUP==1 violated!!" #endif for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { 4000886c: 82 00 60 01 inc %g1 40008870: 80 a0 60 1b cmp %g1, 0x1b 40008874: 12 bf ff fa bne 4000885c <_POSIX_signals_Get_lowest+0x38> <== ALWAYS TAKEN 40008878: 86 00 7f ff add %g1, -1, %g3 * a return 0. This routine will NOT be called unless a signal * is pending in the set passed in. */ found_it: return signo; } 4000887c: 81 c3 e0 08 retl 40008880: 90 10 00 01 mov %g1, %o0 =============================================================================== 4000cfb4 <_POSIX_signals_Post_switch_hook>: */ static void _POSIX_signals_Post_switch_hook( Thread_Control *the_thread ) { 4000cfb4: 9d e3 bf a0 save %sp, -96, %sp /* * We need to ensure that if the signal handler executes a call * which overwrites the unblocking status, we restore it. */ hold_errno = _Thread_Executing->Wait.return_code; 4000cfb8: 03 10 00 7e sethi %hi(0x4001f800), %g1 POSIX_API_Control *api; int signo; ISR_Level level; int hold_errno; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4000cfbc: fa 06 21 50 ld [ %i0 + 0x150 ], %i5 /* * We need to ensure that if the signal handler executes a call * which overwrites the unblocking status, we restore it. */ hold_errno = _Thread_Executing->Wait.return_code; 4000cfc0: c2 00 61 a0 ld [ %g1 + 0x1a0 ], %g1 /* * api may be NULL in case of a thread close in progress */ if ( !api ) 4000cfc4: 80 a7 60 00 cmp %i5, 0 4000cfc8: 02 80 00 11 be 4000d00c <_POSIX_signals_Post_switch_hook+0x58><== NEVER TAKEN 4000cfcc: f6 00 60 34 ld [ %g1 + 0x34 ], %i3 * processed at all. No point in doing this loop otherwise. */ while (1) { _ISR_Disable( level ); if ( !(~api->signals_blocked & (api->signals_pending | _POSIX_signals_Pending)) ) { 4000cfd0: 35 10 00 7e sethi %hi(0x4001f800), %i2 * * The first thing done is to check there are any signals to be * processed at all. No point in doing this loop otherwise. */ while (1) { _ISR_Disable( level ); 4000cfd4: 7f ff d5 1d call 40002448 4000cfd8: 01 00 00 00 nop if ( !(~api->signals_blocked & (api->signals_pending | _POSIX_signals_Pending)) ) { 4000cfdc: c4 06 a3 e4 ld [ %i2 + 0x3e4 ], %g2 4000cfe0: c2 07 60 d4 ld [ %i5 + 0xd4 ], %g1 4000cfe4: 82 10 80 01 or %g2, %g1, %g1 * The first thing done is to check there are any signals to be * processed at all. No point in doing this loop otherwise. */ while (1) { _ISR_Disable( level ); if ( !(~api->signals_blocked & 4000cfe8: c4 07 60 d0 ld [ %i5 + 0xd0 ], %g2 4000cfec: 80 a8 40 02 andncc %g1, %g2, %g0 4000cff0: 12 80 00 09 bne 4000d014 <_POSIX_signals_Post_switch_hook+0x60> 4000cff4: 01 00 00 00 nop (api->signals_pending | _POSIX_signals_Pending)) ) { _ISR_Enable( level ); 4000cff8: 7f ff d5 18 call 40002458 4000cffc: 01 00 00 00 nop _POSIX_signals_Check_signal( api, signo, false ); _POSIX_signals_Check_signal( api, signo, true ); } } _Thread_Executing->Wait.return_code = hold_errno; 4000d000: 03 10 00 7e sethi %hi(0x4001f800), %g1 4000d004: c2 00 61 a0 ld [ %g1 + 0x1a0 ], %g1 ! 4001f9a0 <_Per_CPU_Information+0x10> 4000d008: f6 20 60 34 st %i3, [ %g1 + 0x34 ] 4000d00c: 81 c7 e0 08 ret 4000d010: 81 e8 00 00 restore if ( !(~api->signals_blocked & (api->signals_pending | _POSIX_signals_Pending)) ) { _ISR_Enable( level ); break; } _ISR_Enable( level ); 4000d014: 7f ff d5 11 call 40002458 4000d018: b8 10 20 1b mov 0x1b, %i4 for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { _POSIX_signals_Check_signal( api, signo, false ); 4000d01c: 92 10 00 1c mov %i4, %o1 4000d020: 94 10 20 00 clr %o2 4000d024: 40 00 08 f4 call 4000f3f4 <_POSIX_signals_Check_signal> 4000d028: 90 10 00 1d mov %i5, %o0 _POSIX_signals_Check_signal( api, signo, true ); 4000d02c: 92 10 00 1c mov %i4, %o1 4000d030: 90 10 00 1d mov %i5, %o0 4000d034: 40 00 08 f0 call 4000f3f4 <_POSIX_signals_Check_signal> 4000d038: 94 10 20 01 mov 1, %o2 _ISR_Enable( level ); break; } _ISR_Enable( level ); for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 4000d03c: b8 07 20 01 inc %i4 4000d040: 80 a7 20 20 cmp %i4, 0x20 4000d044: 12 bf ff f7 bne 4000d020 <_POSIX_signals_Post_switch_hook+0x6c> 4000d048: 92 10 00 1c mov %i4, %o1 4000d04c: b8 10 20 01 mov 1, %i4 _POSIX_signals_Check_signal( api, signo, true ); } /* Unfortunately - nothing like __SIGFIRSTNOTRT in newlib signal .h */ for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { _POSIX_signals_Check_signal( api, signo, false ); 4000d050: 92 10 00 1c mov %i4, %o1 4000d054: 94 10 20 00 clr %o2 4000d058: 40 00 08 e7 call 4000f3f4 <_POSIX_signals_Check_signal> 4000d05c: 90 10 00 1d mov %i5, %o0 _POSIX_signals_Check_signal( api, signo, true ); 4000d060: 92 10 00 1c mov %i4, %o1 4000d064: 90 10 00 1d mov %i5, %o0 4000d068: 40 00 08 e3 call 4000f3f4 <_POSIX_signals_Check_signal> 4000d06c: 94 10 20 01 mov 1, %o2 _POSIX_signals_Check_signal( api, signo, false ); _POSIX_signals_Check_signal( api, signo, true ); } /* Unfortunately - nothing like __SIGFIRSTNOTRT in newlib signal .h */ for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { 4000d070: b8 07 20 01 inc %i4 4000d074: 80 a7 20 1b cmp %i4, 0x1b 4000d078: 12 bf ff f7 bne 4000d054 <_POSIX_signals_Post_switch_hook+0xa0> 4000d07c: 92 10 00 1c mov %i4, %o1 4000d080: 30 bf ff d5 b,a 4000cfd4 <_POSIX_signals_Post_switch_hook+0x20> =============================================================================== 4001c0c8 <_POSIX_signals_Unblock_thread>: bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, siginfo_t *info ) { 4001c0c8: 9d e3 bf a0 save %sp, -96, %sp /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 4001c0cc: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 4001c0d0: 3b 04 00 20 sethi %hi(0x10008000), %i5 4001c0d4: 84 06 7f ff add %i1, -1, %g2 4001c0d8: 86 10 20 01 mov 1, %g3 4001c0dc: b8 08 40 1d and %g1, %i5, %i4 { POSIX_API_Control *api; sigset_t mask; siginfo_t *the_info = NULL; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4001c0e0: c8 06 21 50 ld [ %i0 + 0x150 ], %g4 /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 4001c0e4: 80 a7 00 1d cmp %i4, %i5 4001c0e8: 12 80 00 1e bne 4001c160 <_POSIX_signals_Unblock_thread+0x98> 4001c0ec: 85 28 c0 02 sll %g3, %g2, %g2 if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { 4001c0f0: c2 06 20 30 ld [ %i0 + 0x30 ], %g1 4001c0f4: 80 88 80 01 btst %g2, %g1 4001c0f8: 12 80 00 08 bne 4001c118 <_POSIX_signals_Unblock_thread+0x50> 4001c0fc: 82 10 20 04 mov 4, %g1 4001c100: c2 01 20 d0 ld [ %g4 + 0xd0 ], %g1 4001c104: 80 a8 80 01 andncc %g2, %g1, %g0 4001c108: 32 80 00 04 bne,a 4001c118 <_POSIX_signals_Unblock_thread+0x50> 4001c10c: 82 10 20 04 mov 4, %g1 } else if ( the_thread->current_state == STATES_READY ) { if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; } } return false; 4001c110: 10 80 00 3d b 4001c204 <_POSIX_signals_Unblock_thread+0x13c> 4001c114: b0 10 20 00 clr %i0 */ 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; 4001c118: c2 26 20 34 st %g1, [ %i0 + 0x34 ] the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { 4001c11c: 80 a6 a0 00 cmp %i2, 0 4001c120: 12 80 00 07 bne 4001c13c <_POSIX_signals_Unblock_thread+0x74> 4001c124: d0 06 20 28 ld [ %i0 + 0x28 ], %o0 the_info->si_signo = signo; the_info->si_code = SI_USER; 4001c128: 82 10 20 01 mov 1, %g1 the_thread->Wait.return_code = EINTR; the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { the_info->si_signo = signo; 4001c12c: f2 22 00 00 st %i1, [ %o0 ] the_info->si_code = SI_USER; 4001c130: c2 22 20 04 st %g1, [ %o0 + 4 ] the_info->si_value.sival_int = 0; 4001c134: 10 80 00 05 b 4001c148 <_POSIX_signals_Unblock_thread+0x80> 4001c138: c0 22 20 08 clr [ %o0 + 8 ] } else { *the_info = *info; 4001c13c: 92 10 00 1a mov %i2, %o1 4001c140: 7f ff d0 ba call 40010428 4001c144: 94 10 20 0c mov 0xc, %o2 } _Thread_queue_Extract_with_proxy( the_thread ); 4001c148: 90 10 00 18 mov %i0, %o0 4001c14c: 7f ff bb 98 call 4000afac <_Thread_queue_Extract_with_proxy> 4001c150: b0 10 20 01 mov 1, %i0 4001c154: b0 0e 20 01 and %i0, 1, %i0 4001c158: 81 c7 e0 08 ret 4001c15c: 81 e8 00 00 restore } /* * Thread is not waiting due to a sigwait. */ if ( ~api->signals_blocked & mask ) { 4001c160: c8 01 20 d0 ld [ %g4 + 0xd0 ], %g4 4001c164: 80 a8 80 04 andncc %g2, %g4, %g0 4001c168: 02 80 00 26 be 4001c200 <_POSIX_signals_Unblock_thread+0x138> 4001c16c: 05 04 00 00 sethi %hi(0x10000000), %g2 * it is not blocked, THEN * we need to dispatch at the end of this ISR. * + Any other combination, do nothing. */ if ( _States_Is_interruptible_by_signal( the_thread->current_state ) ) { 4001c170: 80 88 40 02 btst %g1, %g2 4001c174: 02 80 00 17 be 4001c1d0 <_POSIX_signals_Unblock_thread+0x108> 4001c178: 80 a0 60 00 cmp %g1, 0 the_thread->Wait.return_code = EINTR; 4001c17c: 84 10 20 04 mov 4, %g2 4001c180: c4 26 20 34 st %g2, [ %i0 + 0x34 ] /* * In pthread_cond_wait, a thread will be blocking on a thread * queue, but is also interruptible by a POSIX signal. */ if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) ) 4001c184: 05 00 00 ef sethi %hi(0x3bc00), %g2 4001c188: 84 10 a2 e0 or %g2, 0x2e0, %g2 ! 3bee0 4001c18c: 80 88 40 02 btst %g1, %g2 4001c190: 02 80 00 06 be 4001c1a8 <_POSIX_signals_Unblock_thread+0xe0> 4001c194: 80 88 60 08 btst 8, %g1 _Thread_queue_Extract_with_proxy( the_thread ); 4001c198: 7f ff bb 85 call 4000afac <_Thread_queue_Extract_with_proxy> 4001c19c: 90 10 00 18 mov %i0, %o0 } else if ( the_thread->current_state == STATES_READY ) { if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; } } return false; 4001c1a0: 10 80 00 19 b 4001c204 <_POSIX_signals_Unblock_thread+0x13c> 4001c1a4: b0 10 20 00 clr %i0 * In pthread_cond_wait, a thread will be blocking on a thread * queue, but is also interruptible by a POSIX signal. */ if ( _States_Is_waiting_on_thread_queue(the_thread->current_state) ) _Thread_queue_Extract_with_proxy( the_thread ); else if ( _States_Is_delaying(the_thread->current_state) ) { 4001c1a8: 22 80 00 17 be,a 4001c204 <_POSIX_signals_Unblock_thread+0x13c><== NEVER TAKEN 4001c1ac: b0 10 20 00 clr %i0 <== NOT EXECUTED (void) _Watchdog_Remove( &the_thread->Timer ); 4001c1b0: 7f ff bd 21 call 4000b634 <_Watchdog_Remove> 4001c1b4: 90 06 20 48 add %i0, 0x48, %o0 RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 4001c1b8: 90 10 00 18 mov %i0, %o0 4001c1bc: 13 04 01 ff sethi %hi(0x1007fc00), %o1 4001c1c0: 7f ff b8 e0 call 4000a540 <_Thread_Clear_state> 4001c1c4: 92 12 63 f8 or %o1, 0x3f8, %o1 ! 1007fff8 } else if ( the_thread->current_state == STATES_READY ) { if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) _Thread_Dispatch_necessary = true; } } return false; 4001c1c8: 10 80 00 0f b 4001c204 <_POSIX_signals_Unblock_thread+0x13c> 4001c1cc: b0 10 20 00 clr %i0 else if ( _States_Is_delaying(the_thread->current_state) ) { (void) _Watchdog_Remove( &the_thread->Timer ); _Thread_Unblock( the_thread ); } } else if ( the_thread->current_state == STATES_READY ) { 4001c1d0: 32 80 00 0d bne,a 4001c204 <_POSIX_signals_Unblock_thread+0x13c><== NEVER TAKEN 4001c1d4: b0 10 20 00 clr %i0 <== NOT EXECUTED if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 4001c1d8: 03 10 00 7e sethi %hi(0x4001f800), %g1 4001c1dc: 82 10 61 90 or %g1, 0x190, %g1 ! 4001f990 <_Per_CPU_Information> 4001c1e0: c4 00 60 08 ld [ %g1 + 8 ], %g2 4001c1e4: 80 a0 a0 00 cmp %g2, 0 4001c1e8: 22 80 00 07 be,a 4001c204 <_POSIX_signals_Unblock_thread+0x13c> 4001c1ec: b0 10 20 00 clr %i0 4001c1f0: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 4001c1f4: 80 a6 00 02 cmp %i0, %g2 4001c1f8: 22 80 00 02 be,a 4001c200 <_POSIX_signals_Unblock_thread+0x138><== ALWAYS TAKEN 4001c1fc: c6 28 60 0c stb %g3, [ %g1 + 0xc ] _Thread_Dispatch_necessary = true; } } return false; 4001c200: b0 10 20 00 clr %i0 } 4001c204: b0 0e 20 01 and %i0, 1, %i0 4001c208: 81 c7 e0 08 ret 4001c20c: 81 e8 00 00 restore =============================================================================== 4000a750 <_RBTree_Extract_unprotected>: */ void _RBTree_Extract_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { 4000a750: 9d e3 bf a0 save %sp, -96, %sp RBTree_Node *leaf, *target; RBTree_Color victim_color; RBTree_Direction dir; if (!the_node) return; 4000a754: 80 a6 60 00 cmp %i1, 0 4000a758: 02 80 00 69 be 4000a8fc <_RBTree_Extract_unprotected+0x1ac> 4000a75c: 01 00 00 00 nop /* check if min needs to be updated */ if (the_node == the_rbtree->first[RBT_LEFT]) { 4000a760: c2 06 20 08 ld [ %i0 + 8 ], %g1 4000a764: 80 a6 40 01 cmp %i1, %g1 4000a768: 32 80 00 07 bne,a 4000a784 <_RBTree_Extract_unprotected+0x34> 4000a76c: c2 06 20 0c ld [ %i0 + 0xc ], %g1 */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Successor_unprotected( const RBTree_Node *node ) { return _RBTree_Next_unprotected( node, RBT_RIGHT ); 4000a770: 90 10 00 19 mov %i1, %o0 4000a774: 40 00 01 31 call 4000ac38 <_RBTree_Next_unprotected> 4000a778: 92 10 20 01 mov 1, %o1 RBTree_Node *next; next = _RBTree_Successor_unprotected(the_node); the_rbtree->first[RBT_LEFT] = next; 4000a77c: d0 26 20 08 st %o0, [ %i0 + 8 ] } /* Check if max needs to be updated. min=max for 1 element trees so * do not use else if here. */ if (the_node == the_rbtree->first[RBT_RIGHT]) { 4000a780: c2 06 20 0c ld [ %i0 + 0xc ], %g1 4000a784: 80 a6 40 01 cmp %i1, %g1 4000a788: 32 80 00 07 bne,a 4000a7a4 <_RBTree_Extract_unprotected+0x54> 4000a78c: fa 06 60 04 ld [ %i1 + 4 ], %i5 */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Predecessor_unprotected( const RBTree_Node *node ) { return _RBTree_Next_unprotected( node, RBT_LEFT ); 4000a790: 90 10 00 19 mov %i1, %o0 4000a794: 40 00 01 29 call 4000ac38 <_RBTree_Next_unprotected> 4000a798: 92 10 20 00 clr %o1 RBTree_Node *previous; previous = _RBTree_Predecessor_unprotected(the_node); the_rbtree->first[RBT_RIGHT] = previous; 4000a79c: d0 26 20 0c st %o0, [ %i0 + 0xc ] * either max in node->child[RBT_LEFT] or min in node->child[RBT_RIGHT], * and replace the_node with the target node. This maintains the binary * search tree property, but may violate the red-black properties. */ if (the_node->child[RBT_LEFT] && the_node->child[RBT_RIGHT]) { 4000a7a0: fa 06 60 04 ld [ %i1 + 4 ], %i5 4000a7a4: 80 a7 60 00 cmp %i5, 0 4000a7a8: 02 80 00 36 be 4000a880 <_RBTree_Extract_unprotected+0x130> 4000a7ac: f8 06 60 08 ld [ %i1 + 8 ], %i4 4000a7b0: 80 a7 20 00 cmp %i4, 0 4000a7b4: 32 80 00 05 bne,a 4000a7c8 <_RBTree_Extract_unprotected+0x78> 4000a7b8: c2 07 60 08 ld [ %i5 + 8 ], %g1 4000a7bc: 10 80 00 35 b 4000a890 <_RBTree_Extract_unprotected+0x140> 4000a7c0: b8 10 00 1d mov %i5, %i4 target = the_node->child[RBT_LEFT]; /* find max in node->child[RBT_LEFT] */ while (target->child[RBT_RIGHT]) target = target->child[RBT_RIGHT]; 4000a7c4: c2 07 60 08 ld [ %i5 + 8 ], %g1 4000a7c8: 80 a0 60 00 cmp %g1, 0 4000a7cc: 32 bf ff fe bne,a 4000a7c4 <_RBTree_Extract_unprotected+0x74> 4000a7d0: ba 10 00 01 mov %g1, %i5 * target's position (target is the right child of target->parent) * when target vacates it. if there is no child, then target->parent * should become NULL. This may cause the coloring to be violated. * For now we store the color of the node being deleted in victim_color. */ leaf = target->child[RBT_LEFT]; 4000a7d4: f8 07 60 04 ld [ %i5 + 4 ], %i4 if(leaf) { 4000a7d8: 80 a7 20 00 cmp %i4, 0 4000a7dc: 02 80 00 05 be 4000a7f0 <_RBTree_Extract_unprotected+0xa0> 4000a7e0: 01 00 00 00 nop leaf->parent = target->parent; 4000a7e4: c2 07 40 00 ld [ %i5 ], %g1 4000a7e8: 10 80 00 04 b 4000a7f8 <_RBTree_Extract_unprotected+0xa8> 4000a7ec: c2 27 00 00 st %g1, [ %i4 ] } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(target); 4000a7f0: 7f ff ff 73 call 4000a5bc <_RBTree_Extract_validate_unprotected> 4000a7f4: 90 10 00 1d mov %i5, %o0 } victim_color = target->color; dir = target != target->parent->child[0]; 4000a7f8: c4 07 40 00 ld [ %i5 ], %g2 leaf->parent = target->parent; } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(target); } victim_color = target->color; 4000a7fc: c2 07 60 0c ld [ %i5 + 0xc ], %g1 dir = target != target->parent->child[0]; 4000a800: c6 00 a0 04 ld [ %g2 + 4 ], %g3 4000a804: 86 1f 40 03 xor %i5, %g3, %g3 4000a808: 80 a0 00 03 cmp %g0, %g3 4000a80c: 86 40 20 00 addx %g0, 0, %g3 target->parent->child[dir] = leaf; 4000a810: 87 28 e0 02 sll %g3, 2, %g3 4000a814: 84 00 80 03 add %g2, %g3, %g2 4000a818: f8 20 a0 04 st %i4, [ %g2 + 4 ] /* now replace the_node with target */ dir = the_node != the_node->parent->child[0]; 4000a81c: c4 06 40 00 ld [ %i1 ], %g2 4000a820: c6 00 a0 04 ld [ %g2 + 4 ], %g3 4000a824: 86 1e 40 03 xor %i1, %g3, %g3 4000a828: 80 a0 00 03 cmp %g0, %g3 4000a82c: 86 40 20 00 addx %g0, 0, %g3 the_node->parent->child[dir] = target; 4000a830: 87 28 e0 02 sll %g3, 2, %g3 4000a834: 84 00 80 03 add %g2, %g3, %g2 4000a838: fa 20 a0 04 st %i5, [ %g2 + 4 ] /* set target's new children to the original node's children */ target->child[RBT_RIGHT] = the_node->child[RBT_RIGHT]; 4000a83c: c4 06 60 08 ld [ %i1 + 8 ], %g2 4000a840: c4 27 60 08 st %g2, [ %i5 + 8 ] if (the_node->child[RBT_RIGHT]) 4000a844: c4 06 60 08 ld [ %i1 + 8 ], %g2 4000a848: 80 a0 a0 00 cmp %g2, 0 4000a84c: 32 80 00 02 bne,a 4000a854 <_RBTree_Extract_unprotected+0x104><== ALWAYS TAKEN 4000a850: fa 20 80 00 st %i5, [ %g2 ] the_node->child[RBT_RIGHT]->parent = target; target->child[RBT_LEFT] = the_node->child[RBT_LEFT]; 4000a854: c4 06 60 04 ld [ %i1 + 4 ], %g2 4000a858: c4 27 60 04 st %g2, [ %i5 + 4 ] if (the_node->child[RBT_LEFT]) 4000a85c: c4 06 60 04 ld [ %i1 + 4 ], %g2 4000a860: 80 a0 a0 00 cmp %g2, 0 4000a864: 32 80 00 02 bne,a 4000a86c <_RBTree_Extract_unprotected+0x11c> 4000a868: fa 20 80 00 st %i5, [ %g2 ] /* finally, update the parent node and recolor. target has completely * replaced the_node, and target's child has moved up the tree if needed. * the_node is no longer part of the tree, although it has valid pointers * still. */ target->parent = the_node->parent; 4000a86c: c4 06 40 00 ld [ %i1 ], %g2 4000a870: c4 27 40 00 st %g2, [ %i5 ] target->color = the_node->color; 4000a874: c4 06 60 0c ld [ %i1 + 0xc ], %g2 4000a878: 10 80 00 14 b 4000a8c8 <_RBTree_Extract_unprotected+0x178> 4000a87c: c4 27 60 0c st %g2, [ %i5 + 0xc ] * violated. We will fix it later. * For now we store the color of the node being deleted in victim_color. */ leaf = the_node->child[RBT_LEFT] ? the_node->child[RBT_LEFT] : the_node->child[RBT_RIGHT]; if( leaf ) { 4000a880: 80 a7 20 00 cmp %i4, 0 4000a884: 32 80 00 04 bne,a 4000a894 <_RBTree_Extract_unprotected+0x144> 4000a888: c2 06 40 00 ld [ %i1 ], %g1 4000a88c: 30 80 00 04 b,a 4000a89c <_RBTree_Extract_unprotected+0x14c> leaf->parent = the_node->parent; 4000a890: c2 06 40 00 ld [ %i1 ], %g1 4000a894: 10 80 00 04 b 4000a8a4 <_RBTree_Extract_unprotected+0x154> 4000a898: c2 27 00 00 st %g1, [ %i4 ] } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(the_node); 4000a89c: 7f ff ff 48 call 4000a5bc <_RBTree_Extract_validate_unprotected> 4000a8a0: 90 10 00 19 mov %i1, %o0 } victim_color = the_node->color; /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; 4000a8a4: c4 06 40 00 ld [ %i1 ], %g2 leaf->parent = the_node->parent; } else { /* fix the tree here if the child is a null leaf. */ _RBTree_Extract_validate_unprotected(the_node); } victim_color = the_node->color; 4000a8a8: c2 06 60 0c ld [ %i1 + 0xc ], %g1 /* remove the_node from the tree */ dir = the_node != the_node->parent->child[0]; 4000a8ac: c6 00 a0 04 ld [ %g2 + 4 ], %g3 4000a8b0: 86 1e 40 03 xor %i1, %g3, %g3 4000a8b4: 80 a0 00 03 cmp %g0, %g3 4000a8b8: 86 40 20 00 addx %g0, 0, %g3 the_node->parent->child[dir] = leaf; 4000a8bc: 87 28 e0 02 sll %g3, 2, %g3 4000a8c0: 84 00 80 03 add %g2, %g3, %g2 4000a8c4: f8 20 a0 04 st %i4, [ %g2 + 4 ] /* fix coloring. leaf has moved up the tree. The color of the deleted * node is in victim_color. There are two cases: * 1. Deleted a red node, its child must be black. Nothing must be done. * 2. Deleted a black node, its child must be red. Paint child black. */ if (victim_color == RBT_BLACK) { /* eliminate case 1 */ 4000a8c8: 80 a0 60 00 cmp %g1, 0 4000a8cc: 32 80 00 06 bne,a 4000a8e4 <_RBTree_Extract_unprotected+0x194> 4000a8d0: c2 06 20 04 ld [ %i0 + 4 ], %g1 if (leaf) { 4000a8d4: 80 a7 20 00 cmp %i4, 0 4000a8d8: 32 80 00 02 bne,a 4000a8e0 <_RBTree_Extract_unprotected+0x190> 4000a8dc: c0 27 20 0c clr [ %i4 + 0xc ] /* Wipe the_node */ _RBTree_Set_off_rbtree(the_node); /* set root to black, if it exists */ if (the_rbtree->root) the_rbtree->root->color = RBT_BLACK; 4000a8e0: c2 06 20 04 ld [ %i0 + 4 ], %g1 */ RTEMS_INLINE_ROUTINE void _RBTree_Set_off_rbtree( RBTree_Node *node ) { node->parent = node->child[RBT_LEFT] = node->child[RBT_RIGHT] = NULL; 4000a8e4: c0 26 60 08 clr [ %i1 + 8 ] 4000a8e8: c0 26 60 04 clr [ %i1 + 4 ] 4000a8ec: 80 a0 60 00 cmp %g1, 0 4000a8f0: 02 80 00 03 be 4000a8fc <_RBTree_Extract_unprotected+0x1ac> 4000a8f4: c0 26 40 00 clr [ %i1 ] 4000a8f8: c0 20 60 0c clr [ %g1 + 0xc ] 4000a8fc: 81 c7 e0 08 ret 4000a900: 81 e8 00 00 restore =============================================================================== 4000bbd0 <_RBTree_Initialize>: void *starting_address, size_t number_nodes, size_t node_size, bool is_unique ) { 4000bbd0: 9d e3 bf a0 save %sp, -96, %sp size_t count; RBTree_Node *next; /* TODO: Error message? */ if (!the_rbtree) return; 4000bbd4: 80 a6 20 00 cmp %i0, 0 4000bbd8: 02 80 00 10 be 4000bc18 <_RBTree_Initialize+0x48> <== NEVER TAKEN 4000bbdc: 01 00 00 00 nop RBTree_Control *the_rbtree, RBTree_Compare_function compare_function, bool is_unique ) { the_rbtree->permanent_null = NULL; 4000bbe0: c0 26 00 00 clr [ %i0 ] the_rbtree->root = NULL; 4000bbe4: c0 26 20 04 clr [ %i0 + 4 ] the_rbtree->first[0] = NULL; 4000bbe8: c0 26 20 08 clr [ %i0 + 8 ] the_rbtree->first[1] = NULL; 4000bbec: c0 26 20 0c clr [ %i0 + 0xc ] the_rbtree->compare_function = compare_function; 4000bbf0: f2 26 20 10 st %i1, [ %i0 + 0x10 ] /* could do sanity checks here */ _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique); count = number_nodes; next = starting_address; while ( count-- ) { 4000bbf4: 10 80 00 06 b 4000bc0c <_RBTree_Initialize+0x3c> 4000bbf8: fa 2e 20 14 stb %i5, [ %i0 + 0x14 ] _RBTree_Insert_unprotected(the_rbtree, next); 4000bbfc: 90 10 00 18 mov %i0, %o0 4000bc00: 7f ff ff 2e call 4000b8b8 <_RBTree_Insert_unprotected> 4000bc04: b4 06 80 1c add %i2, %i4, %i2 4000bc08: b6 06 ff ff add %i3, -1, %i3 /* could do sanity checks here */ _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique); count = number_nodes; next = starting_address; while ( count-- ) { 4000bc0c: 80 a6 e0 00 cmp %i3, 0 4000bc10: 12 bf ff fb bne 4000bbfc <_RBTree_Initialize+0x2c> 4000bc14: 92 10 00 1a mov %i2, %o1 4000bc18: 81 c7 e0 08 ret 4000bc1c: 81 e8 00 00 restore =============================================================================== 4000a9a4 <_RBTree_Insert_unprotected>: */ RBTree_Node *_RBTree_Insert_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { 4000a9a4: 9d e3 bf a0 save %sp, -96, %sp if(!the_node) return (RBTree_Node*)-1; 4000a9a8: 80 a6 60 00 cmp %i1, 0 4000a9ac: 02 80 00 7c be 4000ab9c <_RBTree_Insert_unprotected+0x1f8> 4000a9b0: ba 10 00 18 mov %i0, %i5 RBTree_Node *iter_node = the_rbtree->root; 4000a9b4: f0 06 20 04 ld [ %i0 + 4 ], %i0 int compare_result; if (!iter_node) { /* special case: first node inserted */ 4000a9b8: b6 96 20 00 orcc %i0, 0, %i3 4000a9bc: 32 80 00 0c bne,a 4000a9ec <_RBTree_Insert_unprotected+0x48> 4000a9c0: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 the_node->color = RBT_BLACK; 4000a9c4: c0 26 60 0c clr [ %i1 + 0xc ] the_rbtree->root = the_node; 4000a9c8: f2 27 60 04 st %i1, [ %i5 + 4 ] the_rbtree->first[0] = the_rbtree->first[1] = the_node; 4000a9cc: f2 27 60 0c st %i1, [ %i5 + 0xc ] 4000a9d0: f2 27 60 08 st %i1, [ %i5 + 8 ] the_node->parent = (RBTree_Node *) the_rbtree; 4000a9d4: fa 26 40 00 st %i5, [ %i1 ] the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; 4000a9d8: c0 26 60 08 clr [ %i1 + 8 ] 4000a9dc: c0 26 60 04 clr [ %i1 + 4 ] 4000a9e0: 81 c7 e0 08 ret 4000a9e4: 81 e8 00 00 restore } else { /* typical binary search tree insert, descend tree to leaf and insert */ while (iter_node) { compare_result = the_rbtree->compare_function(the_node, iter_node); 4000a9e8: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 4000a9ec: 90 10 00 19 mov %i1, %o0 4000a9f0: 9f c0 40 00 call %g1 4000a9f4: 92 10 00 18 mov %i0, %o1 if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) 4000a9f8: c2 0f 60 14 ldub [ %i5 + 0x14 ], %g1 4000a9fc: 80 a0 60 00 cmp %g1, 0 4000aa00: 02 80 00 05 be 4000aa14 <_RBTree_Insert_unprotected+0x70> 4000aa04: b8 38 00 08 xnor %g0, %o0, %i4 4000aa08: 80 a2 20 00 cmp %o0, 0 4000aa0c: 02 80 00 65 be 4000aba0 <_RBTree_Insert_unprotected+0x1fc> 4000aa10: 01 00 00 00 nop return iter_node; RBTree_Direction dir = !_RBTree_Is_lesser( compare_result ); 4000aa14: b9 37 20 1f srl %i4, 0x1f, %i4 if (!iter_node->child[dir]) { 4000aa18: 83 2f 20 02 sll %i4, 2, %g1 4000aa1c: 82 06 00 01 add %i0, %g1, %g1 4000aa20: f0 00 60 04 ld [ %g1 + 4 ], %i0 4000aa24: 80 a6 20 00 cmp %i0, 0 4000aa28: 32 bf ff f0 bne,a 4000a9e8 <_RBTree_Insert_unprotected+0x44> 4000aa2c: b6 10 00 18 mov %i0, %i3 the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; 4000aa30: c0 26 60 08 clr [ %i1 + 8 ] 4000aa34: c0 26 60 04 clr [ %i1 + 4 ] the_node->color = RBT_RED; 4000aa38: 84 10 20 01 mov 1, %g2 iter_node->child[dir] = the_node; 4000aa3c: f2 20 60 04 st %i1, [ %g1 + 4 ] if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) return iter_node; RBTree_Direction dir = !_RBTree_Is_lesser( compare_result ); if (!iter_node->child[dir]) { the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; the_node->color = RBT_RED; 4000aa40: c4 26 60 0c st %g2, [ %i1 + 0xc ] iter_node->child[dir] = the_node; the_node->parent = iter_node; 4000aa44: f6 26 40 00 st %i3, [ %i1 ] /* update min/max */ compare_result = the_rbtree->compare_function( 4000aa48: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First( const RBTree_Control *the_rbtree, RBTree_Direction dir ) { return the_rbtree->first[dir]; 4000aa4c: b6 07 20 02 add %i4, 2, %i3 4000aa50: 85 2e e0 02 sll %i3, 2, %g2 4000aa54: d2 07 40 02 ld [ %i5 + %g2 ], %o1 4000aa58: 9f c0 40 00 call %g1 4000aa5c: 90 10 00 19 mov %i1, %o0 the_node, _RBTree_First(the_rbtree, dir) ); if ( (!dir && _RBTree_Is_lesser(compare_result)) || 4000aa60: 80 a7 20 00 cmp %i4, 0 4000aa64: 12 80 00 06 bne 4000aa7c <_RBTree_Insert_unprotected+0xd8> 4000aa68: 80 a2 20 00 cmp %o0, 0 4000aa6c: 36 80 00 3c bge,a 4000ab5c <_RBTree_Insert_unprotected+0x1b8> 4000aa70: d0 06 40 00 ld [ %i1 ], %o0 (dir && _RBTree_Is_greater(compare_result)) ) { the_rbtree->first[dir] = the_node; 4000aa74: 10 80 00 04 b 4000aa84 <_RBTree_Insert_unprotected+0xe0> 4000aa78: b7 2e e0 02 sll %i3, 2, %i3 compare_result = the_rbtree->compare_function( the_node, _RBTree_First(the_rbtree, dir) ); if ( (!dir && _RBTree_Is_lesser(compare_result)) || (dir && _RBTree_Is_greater(compare_result)) ) { 4000aa7c: 04 80 00 37 ble 4000ab58 <_RBTree_Insert_unprotected+0x1b4> 4000aa80: b7 2e e0 02 sll %i3, 2, %i3 the_rbtree->first[dir] = the_node; 4000aa84: 10 80 00 35 b 4000ab58 <_RBTree_Insert_unprotected+0x1b4> 4000aa88: f2 27 40 1b st %i1, [ %i5 + %i3 ] const RBTree_Node *the_node ) { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; if(!(the_node->parent->parent)) return NULL; 4000aa8c: 02 80 00 13 be 4000aad8 <_RBTree_Insert_unprotected+0x134><== NEVER TAKEN 4000aa90: 82 10 20 00 clr %g1 if(!(the_node->parent->parent->parent)) return NULL; 4000aa94: c2 07 40 00 ld [ %i5 ], %g1 4000aa98: 80 a0 60 00 cmp %g1, 0 4000aa9c: 02 80 00 0f be 4000aad8 <_RBTree_Insert_unprotected+0x134><== NEVER TAKEN 4000aaa0: 82 10 20 00 clr %g1 { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; if(!(the_node->parent->parent)) return NULL; if(the_node == the_node->parent->child[RBT_LEFT]) 4000aaa4: c2 07 60 04 ld [ %i5 + 4 ], %g1 4000aaa8: 80 a2 00 01 cmp %o0, %g1 4000aaac: 22 80 00 02 be,a 4000aab4 <_RBTree_Insert_unprotected+0x110> 4000aab0: c2 07 60 08 ld [ %i5 + 8 ], %g1 */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 4000aab4: 80 a0 60 00 cmp %g1, 0 4000aab8: 02 80 00 09 be 4000aadc <_RBTree_Insert_unprotected+0x138> 4000aabc: 84 10 20 00 clr %g2 4000aac0: c4 00 60 0c ld [ %g1 + 0xc ], %g2 4000aac4: 80 a0 a0 01 cmp %g2, 1 4000aac8: 32 80 00 05 bne,a 4000aadc <_RBTree_Insert_unprotected+0x138> 4000aacc: 84 10 20 00 clr %g2 4000aad0: 10 80 00 03 b 4000aadc <_RBTree_Insert_unprotected+0x138> 4000aad4: 84 10 20 01 mov 1, %g2 4000aad8: 84 10 20 00 clr %g2 <== NOT EXECUTED while (_RBTree_Is_red(_RBTree_Parent(the_node))) { u = _RBTree_Parent_sibling(the_node); g = the_node->parent->parent; /* if uncle is red, repaint uncle/parent black and grandparent red */ if(_RBTree_Is_red(u)) { 4000aadc: 80 a0 a0 00 cmp %g2, 0 4000aae0: 22 80 00 08 be,a 4000ab00 <_RBTree_Insert_unprotected+0x15c> 4000aae4: c2 07 60 04 ld [ %i5 + 4 ], %g1 the_node->parent->color = RBT_BLACK; 4000aae8: c0 22 20 0c clr [ %o0 + 0xc ] u->color = RBT_BLACK; 4000aaec: c0 20 60 0c clr [ %g1 + 0xc ] g->color = RBT_RED; 4000aaf0: b2 10 00 1d mov %i5, %i1 4000aaf4: 82 10 20 01 mov 1, %g1 4000aaf8: 10 80 00 18 b 4000ab58 <_RBTree_Insert_unprotected+0x1b4> 4000aafc: c2 27 60 0c st %g1, [ %i5 + 0xc ] the_node = g; } else { /* if uncle is black */ RBTree_Direction dir = the_node != the_node->parent->child[0]; RBTree_Direction pdir = the_node->parent != g->child[0]; 4000ab00: 82 1a 00 01 xor %o0, %g1, %g1 4000ab04: 80 a0 00 01 cmp %g0, %g1 the_node->parent->color = RBT_BLACK; u->color = RBT_BLACK; g->color = RBT_RED; the_node = g; } else { /* if uncle is black */ RBTree_Direction dir = the_node != the_node->parent->child[0]; 4000ab08: c2 02 20 04 ld [ %o0 + 4 ], %g1 RBTree_Direction pdir = the_node->parent != g->child[0]; 4000ab0c: b8 40 20 00 addx %g0, 0, %i4 the_node->parent->color = RBT_BLACK; u->color = RBT_BLACK; g->color = RBT_RED; the_node = g; } else { /* if uncle is black */ RBTree_Direction dir = the_node != the_node->parent->child[0]; 4000ab10: 82 1e 40 01 xor %i1, %g1, %g1 4000ab14: 80 a0 00 01 cmp %g0, %g1 4000ab18: 82 40 20 00 addx %g0, 0, %g1 RBTree_Direction pdir = the_node->parent != g->child[0]; /* ensure node is on the same branch direction as parent */ if (dir != pdir) { 4000ab1c: 80 a0 40 1c cmp %g1, %i4 4000ab20: 22 80 00 08 be,a 4000ab40 <_RBTree_Insert_unprotected+0x19c> 4000ab24: c2 06 40 00 ld [ %i1 ], %g1 _RBTree_Rotate(the_node->parent, pdir); 4000ab28: 7f ff ff 80 call 4000a928 <_RBTree_Rotate> 4000ab2c: 92 10 00 1c mov %i4, %o1 the_node = the_node->child[pdir]; 4000ab30: 83 2f 20 02 sll %i4, 2, %g1 4000ab34: b2 06 40 01 add %i1, %g1, %i1 4000ab38: f2 06 60 04 ld [ %i1 + 4 ], %i1 } the_node->parent->color = RBT_BLACK; 4000ab3c: c2 06 40 00 ld [ %i1 ], %g1 g->color = RBT_RED; 4000ab40: 92 10 20 01 mov 1, %o1 /* ensure node is on the same branch direction as parent */ if (dir != pdir) { _RBTree_Rotate(the_node->parent, pdir); the_node = the_node->child[pdir]; } the_node->parent->color = RBT_BLACK; 4000ab44: c0 20 60 0c clr [ %g1 + 0xc ] g->color = RBT_RED; 4000ab48: d2 27 60 0c st %o1, [ %i5 + 0xc ] /* now rotate grandparent in the other branch direction (toward uncle) */ _RBTree_Rotate(g, (1-pdir)); 4000ab4c: 90 10 00 1d mov %i5, %o0 4000ab50: 7f ff ff 76 call 4000a928 <_RBTree_Rotate> 4000ab54: 92 22 40 1c sub %o1, %i4, %o1 */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Parent( const RBTree_Node *the_node ) { if (!the_node->parent->parent) return NULL; 4000ab58: d0 06 40 00 ld [ %i1 ], %o0 4000ab5c: fa 02 00 00 ld [ %o0 ], %i5 4000ab60: 80 a7 60 00 cmp %i5, 0 4000ab64: 22 80 00 06 be,a 4000ab7c <_RBTree_Insert_unprotected+0x1d8> 4000ab68: 82 10 20 00 clr %g1 */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 4000ab6c: c2 02 20 0c ld [ %o0 + 0xc ], %g1 4000ab70: 82 18 60 01 xor %g1, 1, %g1 4000ab74: 80 a0 00 01 cmp %g0, %g1 4000ab78: 82 60 3f ff subx %g0, -1, %g1 RBTree_Node *u,*g; /* note: the insert root case is handled already */ /* if the parent is black, nothing needs to be done * otherwise may need to loop a few times */ while (_RBTree_Is_red(_RBTree_Parent(the_node))) { 4000ab7c: 80 a0 60 00 cmp %g1, 0 4000ab80: 12 bf ff c3 bne 4000aa8c <_RBTree_Insert_unprotected+0xe8> 4000ab84: 80 a7 60 00 cmp %i5, 0 /* now rotate grandparent in the other branch direction (toward uncle) */ _RBTree_Rotate(g, (1-pdir)); } } if(!the_node->parent->parent) the_node->color = RBT_BLACK; 4000ab88: 12 80 00 06 bne 4000aba0 <_RBTree_Insert_unprotected+0x1fc> 4000ab8c: 01 00 00 00 nop 4000ab90: c0 26 60 0c clr [ %i1 + 0xc ] 4000ab94: 81 c7 e0 08 ret 4000ab98: 81 e8 00 00 restore RBTree_Node *_RBTree_Insert_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { if(!the_node) return (RBTree_Node*)-1; 4000ab9c: b0 10 3f ff mov -1, %i0 /* verify red-black properties */ _RBTree_Validate_insert_unprotected(the_node); } return (RBTree_Node*)0; } 4000aba0: 81 c7 e0 08 ret 4000aba4: 81 e8 00 00 restore =============================================================================== 4000abd8 <_RBTree_Iterate_unprotected>: const RBTree_Control *rbtree, RBTree_Direction dir, RBTree_Visitor visitor, void *visitor_arg ) { 4000abd8: 9d e3 bf a0 save %sp, -96, %sp RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir ); const RBTree_Node *current = _RBTree_First( rbtree, opp_dir ); bool stop = false; 4000abdc: b8 10 20 00 clr %i4 */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 4000abe0: 80 a0 00 19 cmp %g0, %i1 4000abe4: 82 60 3f ff subx %g0, -1, %g1 RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First( const RBTree_Control *the_rbtree, RBTree_Direction dir ) { return the_rbtree->first[dir]; 4000abe8: 82 00 60 02 add %g1, 2, %g1 4000abec: 83 28 60 02 sll %g1, 2, %g1 while ( !stop && current != NULL ) { 4000abf0: 10 80 00 0a b 4000ac18 <_RBTree_Iterate_unprotected+0x40> 4000abf4: fa 06 00 01 ld [ %i0 + %g1 ], %i5 stop = (*visitor)( current, dir, visitor_arg ); 4000abf8: 92 10 00 19 mov %i1, %o1 4000abfc: 9f c6 80 00 call %i2 4000ac00: 94 10 00 1b mov %i3, %o2 current = _RBTree_Next_unprotected( current, dir ); 4000ac04: 92 10 00 19 mov %i1, %o1 RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir ); const RBTree_Node *current = _RBTree_First( rbtree, opp_dir ); bool stop = false; while ( !stop && current != NULL ) { stop = (*visitor)( current, dir, visitor_arg ); 4000ac08: b8 10 00 08 mov %o0, %i4 current = _RBTree_Next_unprotected( current, dir ); 4000ac0c: 40 00 00 0b call 4000ac38 <_RBTree_Next_unprotected> 4000ac10: 90 10 00 1d mov %i5, %o0 4000ac14: ba 10 00 08 mov %o0, %i5 { RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir ); const RBTree_Node *current = _RBTree_First( rbtree, opp_dir ); bool stop = false; while ( !stop && current != NULL ) { 4000ac18: 80 a7 60 00 cmp %i5, 0 4000ac1c: 02 80 00 05 be 4000ac30 <_RBTree_Iterate_unprotected+0x58> 4000ac20: b8 1f 20 01 xor %i4, 1, %i4 4000ac24: 80 8f 20 ff btst 0xff, %i4 4000ac28: 12 bf ff f4 bne 4000abf8 <_RBTree_Iterate_unprotected+0x20><== ALWAYS TAKEN 4000ac2c: 90 10 00 1d mov %i5, %o0 4000ac30: 81 c7 e0 08 ret 4000ac34: 81 e8 00 00 restore =============================================================================== 4000a540 <_RBTree_Rotate>: RBTree_Node *the_node, RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; 4000a540: 80 a2 20 00 cmp %o0, 0 4000a544: 02 80 00 1c be 4000a5b4 <_RBTree_Rotate+0x74> <== NEVER TAKEN 4000a548: 80 a0 00 09 cmp %g0, %o1 */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 4000a54c: 86 60 3f ff subx %g0, -1, %g3 RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; 4000a550: 87 28 e0 02 sll %g3, 2, %g3 4000a554: 86 02 00 03 add %o0, %g3, %g3 4000a558: c2 00 e0 04 ld [ %g3 + 4 ], %g1 4000a55c: 80 a0 60 00 cmp %g1, 0 4000a560: 02 80 00 15 be 4000a5b4 <_RBTree_Rotate+0x74> <== NEVER TAKEN 4000a564: 93 2a 60 02 sll %o1, 2, %o1 c = the_node->child[_RBTree_Opposite_direction(dir)]; the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; 4000a568: 84 00 40 09 add %g1, %o1, %g2 4000a56c: c8 00 a0 04 ld [ %g2 + 4 ], %g4 4000a570: c8 20 e0 04 st %g4, [ %g3 + 4 ] if (c->child[dir]) 4000a574: c4 00 a0 04 ld [ %g2 + 4 ], %g2 4000a578: 80 a0 a0 00 cmp %g2, 0 4000a57c: 32 80 00 02 bne,a 4000a584 <_RBTree_Rotate+0x44> 4000a580: d0 20 80 00 st %o0, [ %g2 ] c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 4000a584: c4 02 00 00 ld [ %o0 ], %g2 the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; 4000a588: 92 00 40 09 add %g1, %o1, %o1 4000a58c: d0 22 60 04 st %o0, [ %o1 + 4 ] the_node->parent->child[the_node != the_node->parent->child[0]] = c; 4000a590: c6 00 a0 04 ld [ %g2 + 4 ], %g3 c->parent = the_node->parent; 4000a594: c4 20 40 00 st %g2, [ %g1 ] if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 4000a598: 86 1a 00 03 xor %o0, %g3, %g3 c->parent = the_node->parent; the_node->parent = c; 4000a59c: c2 22 00 00 st %g1, [ %o0 ] if (c->child[dir]) c->child[dir]->parent = the_node; c->child[dir] = the_node; the_node->parent->child[the_node != the_node->parent->child[0]] = c; 4000a5a0: 80 a0 00 03 cmp %g0, %g3 4000a5a4: 86 40 20 00 addx %g0, 0, %g3 4000a5a8: 87 28 e0 02 sll %g3, 2, %g3 4000a5ac: 86 00 80 03 add %g2, %g3, %g3 4000a5b0: c2 20 e0 04 st %g1, [ %g3 + 4 ] 4000a5b4: 81 c3 e0 08 retl =============================================================================== 4000a4f0 <_RBTree_Sibling>: */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( const RBTree_Node *the_node ) { if(!the_node) return NULL; 4000a4f0: 80 a2 20 00 cmp %o0, 0 4000a4f4: 02 80 00 10 be 4000a534 <_RBTree_Sibling+0x44> <== NEVER TAKEN 4000a4f8: 82 10 20 00 clr %g1 if(!(the_node->parent)) return NULL; 4000a4fc: c4 02 00 00 ld [ %o0 ], %g2 4000a500: 80 a0 a0 00 cmp %g2, 0 4000a504: 22 80 00 0d be,a 4000a538 <_RBTree_Sibling+0x48> <== NEVER TAKEN 4000a508: 90 10 00 01 mov %g1, %o0 <== NOT EXECUTED if(!(the_node->parent->parent)) return NULL; 4000a50c: c2 00 80 00 ld [ %g2 ], %g1 4000a510: 80 a0 60 00 cmp %g1, 0 4000a514: 02 80 00 08 be 4000a534 <_RBTree_Sibling+0x44> 4000a518: 82 10 20 00 clr %g1 if(the_node == the_node->parent->child[RBT_LEFT]) 4000a51c: c2 00 a0 04 ld [ %g2 + 4 ], %g1 4000a520: 80 a2 00 01 cmp %o0, %g1 4000a524: 22 80 00 04 be,a 4000a534 <_RBTree_Sibling+0x44> 4000a528: c2 00 a0 08 ld [ %g2 + 8 ], %g1 return the_node->parent->child[RBT_RIGHT]; 4000a52c: 81 c3 e0 08 retl 4000a530: 90 10 00 01 mov %g1, %o0 else return the_node->parent->child[RBT_LEFT]; } 4000a534: 90 10 00 01 mov %g1, %o0 4000a538: 81 c3 e0 08 retl =============================================================================== 40009144 <_RTEMS_signal_Post_switch_hook>: #include #include #include static void _RTEMS_signal_Post_switch_hook( Thread_Control *executing ) { 40009144: 9d e3 bf 98 save %sp, -104, %sp RTEMS_API_Control *api; ASR_Information *asr; rtems_signal_set signal_set; Modes_Control prev_mode; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 40009148: fa 06 21 4c ld [ %i0 + 0x14c ], %i5 if ( !api ) 4000914c: 80 a7 60 00 cmp %i5, 0 40009150: 02 80 00 1c be 400091c0 <_RTEMS_signal_Post_switch_hook+0x7c><== NEVER TAKEN 40009154: 01 00 00 00 nop * Signal Processing */ asr = &api->Signal; _ISR_Disable( level ); 40009158: 7f ff e8 9d call 400033cc 4000915c: 01 00 00 00 nop signal_set = asr->signals_posted; 40009160: f8 07 60 14 ld [ %i5 + 0x14 ], %i4 asr->signals_posted = 0; 40009164: c0 27 60 14 clr [ %i5 + 0x14 ] _ISR_Enable( level ); 40009168: 7f ff e8 9d call 400033dc 4000916c: 01 00 00 00 nop if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ 40009170: 80 a7 20 00 cmp %i4, 0 40009174: 02 80 00 13 be 400091c0 <_RTEMS_signal_Post_switch_hook+0x7c> 40009178: 94 07 bf fc add %fp, -4, %o2 return; asr->nest_level += 1; 4000917c: c2 07 60 1c ld [ %i5 + 0x1c ], %g1 rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 40009180: d0 07 60 10 ld [ %i5 + 0x10 ], %o0 if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ return; asr->nest_level += 1; 40009184: 82 00 60 01 inc %g1 40009188: c2 27 60 1c st %g1, [ %i5 + 0x1c ] rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 4000918c: 37 00 00 3f sethi %hi(0xfc00), %i3 40009190: 40 00 01 03 call 4000959c 40009194: 92 16 e3 ff or %i3, 0x3ff, %o1 ! ffff (*asr->handler)( signal_set ); 40009198: c2 07 60 0c ld [ %i5 + 0xc ], %g1 4000919c: 9f c0 40 00 call %g1 400091a0: 90 10 00 1c mov %i4, %o0 asr->nest_level -= 1; 400091a4: c2 07 60 1c ld [ %i5 + 0x1c ], %g1 rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 400091a8: d0 07 bf fc ld [ %fp + -4 ], %o0 asr->nest_level += 1; rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); (*asr->handler)( signal_set ); asr->nest_level -= 1; 400091ac: 82 00 7f ff add %g1, -1, %g1 rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 400091b0: 92 16 e3 ff or %i3, 0x3ff, %o1 asr->nest_level += 1; rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); (*asr->handler)( signal_set ); asr->nest_level -= 1; 400091b4: c2 27 60 1c st %g1, [ %i5 + 0x1c ] rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 400091b8: 40 00 00 f9 call 4000959c 400091bc: 94 07 bf fc add %fp, -4, %o2 400091c0: 81 c7 e0 08 ret 400091c4: 81 e8 00 00 restore =============================================================================== 40033688 <_Rate_monotonic_Get_status>: bool _Rate_monotonic_Get_status( Rate_monotonic_Control *the_period, Rate_monotonic_Period_time_t *wall_since_last_period, Thread_CPU_usage_t *cpu_since_last_period ) { 40033688: 9d e3 bf 98 save %sp, -104, %sp */ static inline void _TOD_Get_uptime( Timestamp_Control *time ) { _TOD_Get_with_nanoseconds( time, &_TOD.uptime ); 4003368c: 13 10 01 90 sethi %hi(0x40064000), %o1 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ Timestamp_Control uptime; #endif Thread_Control *owning_thread = the_period->owner; 40033690: f6 06 20 40 ld [ %i0 + 0x40 ], %i3 40033694: 90 07 bf f8 add %fp, -8, %o0 40033698: 7f ff 54 a7 call 40008934 <_TOD_Get_with_nanoseconds> 4003369c: 92 12 63 80 or %o1, 0x380, %o1 /* * Determine elapsed wall time since period initiated. */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _TOD_Get_uptime( &uptime ); _Timestamp_Subtract( 400336a0: c4 1f bf f8 ldd [ %fp + -8 ], %g2 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 400336a4: f8 1e 20 50 ldd [ %i0 + 0x50 ], %i4 * Determine cpu usage since period initiated. */ used = owning_thread->cpu_time_used; #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ if (owning_thread == _Thread_Executing) { 400336a8: 09 10 01 92 sethi %hi(0x40064800), %g4 400336ac: ba a0 c0 1d subcc %g3, %i5, %i5 400336b0: 88 11 21 40 or %g4, 0x140, %g4 400336b4: b8 60 80 1c subx %g2, %i4, %i4 400336b8: f8 3e 40 00 std %i4, [ %i1 ] 400336bc: fa 01 20 10 ld [ %g4 + 0x10 ], %i5 #endif /* * Determine cpu usage since period initiated. */ used = owning_thread->cpu_time_used; 400336c0: d8 1e e0 80 ldd [ %i3 + 0x80 ], %o4 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ if (owning_thread == _Thread_Executing) { 400336c4: 80 a6 c0 1d cmp %i3, %i5 400336c8: 12 80 00 15 bne 4003371c <_Rate_monotonic_Get_status+0x94> 400336cc: 82 10 20 01 mov 1, %g1 400336d0: f8 19 20 20 ldd [ %g4 + 0x20 ], %i4 400336d4: 86 a0 c0 1d subcc %g3, %i5, %g3 400336d8: 84 60 80 1c subx %g2, %i4, %g2 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 400336dc: ba 83 40 03 addcc %o5, %g3, %i5 400336e0: b8 43 00 02 addx %o4, %g2, %i4 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 400336e4: c4 1e 20 48 ldd [ %i0 + 0x48 ], %g2 /* * The cpu usage info was reset while executing. Can't * determine a status. */ if (_Timestamp_Less_than(&used, &the_period->cpu_usage_period_initiated)) 400336e8: 80 a0 80 1c cmp %g2, %i4 400336ec: 34 80 00 0c bg,a 4003371c <_Rate_monotonic_Get_status+0x94><== NEVER TAKEN 400336f0: 82 10 20 00 clr %g1 <== NOT EXECUTED 400336f4: 32 80 00 06 bne,a 4003370c <_Rate_monotonic_Get_status+0x84> 400336f8: 86 a7 40 03 subcc %i5, %g3, %g3 400336fc: 80 a0 c0 1d cmp %g3, %i5 40033700: 18 80 00 06 bgu 40033718 <_Rate_monotonic_Get_status+0x90> 40033704: 86 a7 40 03 subcc %i5, %g3, %g3 if (used < the_period->cpu_usage_period_initiated) return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; 40033708: 82 10 20 01 mov 1, %g1 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 4003370c: 84 67 00 02 subx %i4, %g2, %g2 40033710: 10 80 00 03 b 4003371c <_Rate_monotonic_Get_status+0x94> 40033714: c4 3e 80 00 std %g2, [ %i2 ] /* * The cpu usage info was reset while executing. Can't * determine a status. */ if (_Timestamp_Less_than(&used, &the_period->cpu_usage_period_initiated)) return false; 40033718: 82 10 20 00 clr %g1 return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; } 4003371c: b0 08 60 01 and %g1, 1, %i0 40033720: 81 c7 e0 08 ret 40033724: 81 e8 00 00 restore =============================================================================== 40033a90 <_Rate_monotonic_Timeout>: void _Rate_monotonic_Timeout( Objects_Id id, void *ignored ) { 40033a90: 9d e3 bf 98 save %sp, -104, %sp 40033a94: 11 10 01 93 sethi %hi(0x40064c00), %o0 40033a98: 92 10 00 18 mov %i0, %o1 40033a9c: 90 12 23 08 or %o0, 0x308, %o0 40033aa0: 7f ff 56 4c call 400093d0 <_Objects_Get> 40033aa4: 94 07 bf fc add %fp, -4, %o2 /* * When we get here, the Timer is already off the chain so we do not * have to worry about that -- hence no _Watchdog_Remove(). */ the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 40033aa8: c2 07 bf fc ld [ %fp + -4 ], %g1 40033aac: 80 a0 60 00 cmp %g1, 0 40033ab0: 12 80 00 24 bne 40033b40 <_Rate_monotonic_Timeout+0xb0> <== NEVER TAKEN 40033ab4: ba 10 00 08 mov %o0, %i5 case OBJECTS_LOCAL: the_thread = the_period->owner; 40033ab8: d0 02 20 40 ld [ %o0 + 0x40 ], %o0 if ( _States_Is_waiting_for_period( the_thread->current_state ) && 40033abc: 03 00 00 10 sethi %hi(0x4000), %g1 */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_for_period ( States_Control the_states ) { return (the_states & STATES_WAITING_FOR_PERIOD); 40033ac0: c4 02 20 10 ld [ %o0 + 0x10 ], %g2 40033ac4: 80 88 80 01 btst %g2, %g1 40033ac8: 22 80 00 0b be,a 40033af4 <_Rate_monotonic_Timeout+0x64> 40033acc: c2 07 60 38 ld [ %i5 + 0x38 ], %g1 40033ad0: c4 02 20 20 ld [ %o0 + 0x20 ], %g2 40033ad4: c2 07 60 08 ld [ %i5 + 8 ], %g1 40033ad8: 80 a0 80 01 cmp %g2, %g1 40033adc: 32 80 00 06 bne,a 40033af4 <_Rate_monotonic_Timeout+0x64> 40033ae0: c2 07 60 38 ld [ %i5 + 0x38 ], %g1 RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 40033ae4: 13 04 01 ff sethi %hi(0x1007fc00), %o1 40033ae8: 7f ff 58 e5 call 40009e7c <_Thread_Clear_state> 40033aec: 92 12 63 f8 or %o1, 0x3f8, %o1 ! 1007fff8 40033af0: 30 80 00 06 b,a 40033b08 <_Rate_monotonic_Timeout+0x78> _Thread_Unblock( the_thread ); _Rate_monotonic_Initiate_statistics( the_period ); _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else if ( the_period->state == RATE_MONOTONIC_OWNER_IS_BLOCKING ) { 40033af4: 80 a0 60 01 cmp %g1, 1 40033af8: 12 80 00 0d bne 40033b2c <_Rate_monotonic_Timeout+0x9c> 40033afc: 82 10 20 04 mov 4, %g1 the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING; 40033b00: 82 10 20 03 mov 3, %g1 40033b04: c2 27 60 38 st %g1, [ %i5 + 0x38 ] _Rate_monotonic_Initiate_statistics( the_period ); 40033b08: 7f ff ff 51 call 4003384c <_Rate_monotonic_Initiate_statistics> 40033b0c: 90 10 00 1d mov %i5, %o0 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 40033b10: c2 07 60 3c ld [ %i5 + 0x3c ], %g1 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 40033b14: 11 10 01 91 sethi %hi(0x40064400), %o0 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 40033b18: c2 27 60 1c st %g1, [ %i5 + 0x1c ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 40033b1c: 90 12 20 c8 or %o0, 0xc8, %o0 40033b20: 7f ff 5c bc call 4000ae10 <_Watchdog_Insert> 40033b24: 92 07 60 10 add %i5, 0x10, %o1 40033b28: 30 80 00 02 b,a 40033b30 <_Rate_monotonic_Timeout+0xa0> _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else the_period->state = RATE_MONOTONIC_EXPIRED; 40033b2c: c2 27 60 38 st %g1, [ %i5 + 0x38 ] * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 40033b30: 03 10 01 91 sethi %hi(0x40064400), %g1 40033b34: c4 00 60 30 ld [ %g1 + 0x30 ], %g2 ! 40064430 <_Thread_Dispatch_disable_level> --level; 40033b38: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = level; 40033b3c: c4 20 60 30 st %g2, [ %g1 + 0x30 ] 40033b40: 81 c7 e0 08 ret 40033b44: 81 e8 00 00 restore =============================================================================== 40033728 <_Rate_monotonic_Update_statistics>: } static void _Rate_monotonic_Update_statistics( Rate_monotonic_Control *the_period ) { 40033728: 9d e3 bf 90 save %sp, -112, %sp /* * Update the counts. */ stats = &the_period->Statistics; stats->count++; 4003372c: c2 06 20 58 ld [ %i0 + 0x58 ], %g1 40033730: 82 00 60 01 inc %g1 40033734: c2 26 20 58 st %g1, [ %i0 + 0x58 ] if ( the_period->state == RATE_MONOTONIC_EXPIRED ) 40033738: c2 06 20 38 ld [ %i0 + 0x38 ], %g1 4003373c: 80 a0 60 04 cmp %g1, 4 40033740: 12 80 00 05 bne 40033754 <_Rate_monotonic_Update_statistics+0x2c> 40033744: 90 10 00 18 mov %i0, %o0 stats->missed_count++; 40033748: c2 06 20 5c ld [ %i0 + 0x5c ], %g1 4003374c: 82 00 60 01 inc %g1 40033750: c2 26 20 5c st %g1, [ %i0 + 0x5c ] /* * Grab status for time statistics. */ valid_status = 40033754: 92 07 bf f8 add %fp, -8, %o1 40033758: 7f ff ff cc call 40033688 <_Rate_monotonic_Get_status> 4003375c: 94 07 bf f0 add %fp, -16, %o2 _Rate_monotonic_Get_status( the_period, &since_last_period, &executed ); if (!valid_status) 40033760: 80 8a 20 ff btst 0xff, %o0 40033764: 02 80 00 38 be 40033844 <_Rate_monotonic_Update_statistics+0x11c> 40033768: c4 1f bf f0 ldd [ %fp + -16 ], %g2 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 4003376c: f8 1e 20 70 ldd [ %i0 + 0x70 ], %i4 * Update CPU time */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_cpu_time, &executed ); if ( _Timestamp_Less_than( &executed, &stats->min_cpu_time ) ) 40033770: c2 06 20 60 ld [ %i0 + 0x60 ], %g1 40033774: b6 87 40 03 addcc %i5, %g3, %i3 40033778: b4 47 00 02 addx %i4, %g2, %i2 4003377c: 80 a0 40 02 cmp %g1, %g2 40033780: 14 80 00 09 bg 400337a4 <_Rate_monotonic_Update_statistics+0x7c> 40033784: f4 3e 20 70 std %i2, [ %i0 + 0x70 ] 40033788: 80 a0 40 02 cmp %g1, %g2 4003378c: 32 80 00 08 bne,a 400337ac <_Rate_monotonic_Update_statistics+0x84><== NEVER TAKEN 40033790: c2 06 20 68 ld [ %i0 + 0x68 ], %g1 <== NOT EXECUTED 40033794: c2 06 20 64 ld [ %i0 + 0x64 ], %g1 40033798: 80 a0 40 03 cmp %g1, %g3 4003379c: 28 80 00 04 bleu,a 400337ac <_Rate_monotonic_Update_statistics+0x84> 400337a0: c2 06 20 68 ld [ %i0 + 0x68 ], %g1 stats->min_cpu_time = executed; 400337a4: c4 3e 20 60 std %g2, [ %i0 + 0x60 ] if ( _Timestamp_Greater_than( &executed, &stats->max_cpu_time ) ) 400337a8: c2 06 20 68 ld [ %i0 + 0x68 ], %g1 400337ac: 80 a0 40 02 cmp %g1, %g2 400337b0: 26 80 00 0a bl,a 400337d8 <_Rate_monotonic_Update_statistics+0xb0><== NEVER TAKEN 400337b4: c4 3e 20 68 std %g2, [ %i0 + 0x68 ] <== NOT EXECUTED 400337b8: 80 a0 40 02 cmp %g1, %g2 400337bc: 32 80 00 08 bne,a 400337dc <_Rate_monotonic_Update_statistics+0xb4><== NEVER TAKEN 400337c0: c4 1f bf f8 ldd [ %fp + -8 ], %g2 <== NOT EXECUTED 400337c4: c2 06 20 6c ld [ %i0 + 0x6c ], %g1 400337c8: 80 a0 40 03 cmp %g1, %g3 400337cc: 3a 80 00 04 bcc,a 400337dc <_Rate_monotonic_Update_statistics+0xb4> 400337d0: c4 1f bf f8 ldd [ %fp + -8 ], %g2 stats->max_cpu_time = executed; 400337d4: c4 3e 20 68 std %g2, [ %i0 + 0x68 ] /* * Update Wall time */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _Timestamp_Add_to( &stats->total_wall_time, &since_last_period ); 400337d8: c4 1f bf f8 ldd [ %fp + -8 ], %g2 400337dc: f8 1e 20 88 ldd [ %i0 + 0x88 ], %i4 if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) ) 400337e0: c2 06 20 78 ld [ %i0 + 0x78 ], %g1 400337e4: b6 87 40 03 addcc %i5, %g3, %i3 400337e8: b4 47 00 02 addx %i4, %g2, %i2 400337ec: 80 a0 40 02 cmp %g1, %g2 400337f0: 14 80 00 09 bg 40033814 <_Rate_monotonic_Update_statistics+0xec> 400337f4: f4 3e 20 88 std %i2, [ %i0 + 0x88 ] 400337f8: 80 a0 40 02 cmp %g1, %g2 400337fc: 32 80 00 08 bne,a 4003381c <_Rate_monotonic_Update_statistics+0xf4><== NEVER TAKEN 40033800: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 <== NOT EXECUTED 40033804: c2 06 20 7c ld [ %i0 + 0x7c ], %g1 40033808: 80 a0 40 03 cmp %g1, %g3 4003380c: 28 80 00 04 bleu,a 4003381c <_Rate_monotonic_Update_statistics+0xf4> 40033810: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 stats->min_wall_time = since_last_period; 40033814: c4 3e 20 78 std %g2, [ %i0 + 0x78 ] if ( _Timestamp_Greater_than( &since_last_period, &stats->max_wall_time ) ) 40033818: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 4003381c: 80 a0 40 02 cmp %g1, %g2 40033820: 26 80 00 09 bl,a 40033844 <_Rate_monotonic_Update_statistics+0x11c><== NEVER TAKEN 40033824: c4 3e 20 80 std %g2, [ %i0 + 0x80 ] <== NOT EXECUTED 40033828: 80 a0 40 02 cmp %g1, %g2 4003382c: 12 80 00 06 bne 40033844 <_Rate_monotonic_Update_statistics+0x11c><== NEVER TAKEN 40033830: 01 00 00 00 nop 40033834: c2 06 20 84 ld [ %i0 + 0x84 ], %g1 40033838: 80 a0 40 03 cmp %g1, %g3 4003383c: 2a 80 00 02 bcs,a 40033844 <_Rate_monotonic_Update_statistics+0x11c> 40033840: c4 3e 20 80 std %g2, [ %i0 + 0x80 ] 40033844: 81 c7 e0 08 ret 40033848: 81 e8 00 00 restore =============================================================================== 4000a8a0 <_Scheduler_CBS_Allocate>: #include void *_Scheduler_CBS_Allocate( Thread_Control *the_thread ) { 4000a8a0: 9d e3 bf a0 save %sp, -96, %sp void *sched; Scheduler_CBS_Per_thread *schinfo; sched = _Workspace_Allocate(sizeof(Scheduler_CBS_Per_thread)); 4000a8a4: 40 00 06 8d call 4000c2d8 <_Workspace_Allocate> 4000a8a8: 90 10 20 1c mov 0x1c, %o0 if ( sched ) { 4000a8ac: 80 a2 20 00 cmp %o0, 0 4000a8b0: 02 80 00 06 be 4000a8c8 <_Scheduler_CBS_Allocate+0x28> <== NEVER TAKEN 4000a8b4: 82 10 20 02 mov 2, %g1 the_thread->scheduler_info = sched; 4000a8b8: d0 26 20 88 st %o0, [ %i0 + 0x88 ] schinfo = (Scheduler_CBS_Per_thread *)(the_thread->scheduler_info); schinfo->edf_per_thread.thread = the_thread; 4000a8bc: f0 22 00 00 st %i0, [ %o0 ] schinfo->edf_per_thread.queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 4000a8c0: c2 22 20 14 st %g1, [ %o0 + 0x14 ] schinfo->cbs_server = NULL; 4000a8c4: c0 22 20 18 clr [ %o0 + 0x18 ] } return sched; } 4000a8c8: 81 c7 e0 08 ret 4000a8cc: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 4000bbe0 <_Scheduler_CBS_Budget_callout>: Scheduler_CBS_Server **_Scheduler_CBS_Server_list; void _Scheduler_CBS_Budget_callout( Thread_Control *the_thread ) { 4000bbe0: 9d e3 bf 98 save %sp, -104, %sp Priority_Control new_priority; Scheduler_CBS_Per_thread *sched_info; Scheduler_CBS_Server_id server_id; /* Put violating task to background until the end of period. */ new_priority = the_thread->Start.initial_priority; 4000bbe4: d2 06 20 ac ld [ %i0 + 0xac ], %o1 if ( the_thread->real_priority != new_priority ) 4000bbe8: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 4000bbec: 80 a0 40 09 cmp %g1, %o1 4000bbf0: 32 80 00 02 bne,a 4000bbf8 <_Scheduler_CBS_Budget_callout+0x18><== ALWAYS TAKEN 4000bbf4: d2 26 20 18 st %o1, [ %i0 + 0x18 ] the_thread->real_priority = new_priority; if ( the_thread->current_priority != new_priority ) 4000bbf8: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 4000bbfc: 80 a0 40 09 cmp %g1, %o1 4000bc00: 02 80 00 04 be 4000bc10 <_Scheduler_CBS_Budget_callout+0x30><== NEVER TAKEN 4000bc04: 90 10 00 18 mov %i0, %o0 _Thread_Change_priority(the_thread, new_priority, true); 4000bc08: 40 00 01 83 call 4000c214 <_Thread_Change_priority> 4000bc0c: 94 10 20 01 mov 1, %o2 /* Invoke callback function if any. */ sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; 4000bc10: fa 06 20 88 ld [ %i0 + 0x88 ], %i5 if ( sched_info->cbs_server->cbs_budget_overrun ) { 4000bc14: c2 07 60 18 ld [ %i5 + 0x18 ], %g1 4000bc18: c4 00 60 0c ld [ %g1 + 0xc ], %g2 4000bc1c: 80 a0 a0 00 cmp %g2, 0 4000bc20: 02 80 00 09 be 4000bc44 <_Scheduler_CBS_Budget_callout+0x64><== NEVER TAKEN 4000bc24: 01 00 00 00 nop _Scheduler_CBS_Get_server_id( 4000bc28: d0 00 40 00 ld [ %g1 ], %o0 4000bc2c: 7f ff ff d7 call 4000bb88 <_Scheduler_CBS_Get_server_id> 4000bc30: 92 07 bf fc add %fp, -4, %o1 sched_info->cbs_server->task_id, &server_id ); sched_info->cbs_server->cbs_budget_overrun( server_id ); 4000bc34: c2 07 60 18 ld [ %i5 + 0x18 ], %g1 4000bc38: c2 00 60 0c ld [ %g1 + 0xc ], %g1 4000bc3c: 9f c0 40 00 call %g1 4000bc40: d0 07 bf fc ld [ %fp + -4 ], %o0 4000bc44: 81 c7 e0 08 ret 4000bc48: 81 e8 00 00 restore =============================================================================== 4000b7e8 <_Scheduler_CBS_Create_server>: int _Scheduler_CBS_Create_server ( Scheduler_CBS_Parameters *params, Scheduler_CBS_Budget_overrun budget_overrun_callback, rtems_id *server_id ) { 4000b7e8: 9d e3 bf a0 save %sp, -96, %sp unsigned int i; Scheduler_CBS_Server *the_server; if ( params->budget <= 0 || 4000b7ec: c2 06 20 04 ld [ %i0 + 4 ], %g1 4000b7f0: 80 a0 60 00 cmp %g1, 0 4000b7f4: 04 80 00 1d ble 4000b868 <_Scheduler_CBS_Create_server+0x80> 4000b7f8: 01 00 00 00 nop 4000b7fc: c2 06 00 00 ld [ %i0 ], %g1 4000b800: 80 a0 60 00 cmp %g1, 0 4000b804: 04 80 00 19 ble 4000b868 <_Scheduler_CBS_Create_server+0x80> 4000b808: 03 10 00 87 sethi %hi(0x40021c00), %g1 params->deadline <= 0 || params->budget >= SCHEDULER_EDF_PRIO_MSB || params->deadline >= SCHEDULER_EDF_PRIO_MSB ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 4000b80c: c4 00 62 00 ld [ %g1 + 0x200 ], %g2 ! 40021e00 <_Scheduler_CBS_Maximum_servers> if ( !_Scheduler_CBS_Server_list[i] ) 4000b810: 03 10 00 8c sethi %hi(0x40023000), %g1 4000b814: c6 00 61 08 ld [ %g1 + 0x108 ], %g3 ! 40023108 <_Scheduler_CBS_Server_list> 4000b818: 10 80 00 07 b 4000b834 <_Scheduler_CBS_Create_server+0x4c> 4000b81c: 82 10 20 00 clr %g1 4000b820: c8 00 c0 1c ld [ %g3 + %i4 ], %g4 4000b824: 80 a1 20 00 cmp %g4, 0 4000b828: 02 80 00 14 be 4000b878 <_Scheduler_CBS_Create_server+0x90> 4000b82c: 3b 10 00 8c sethi %hi(0x40023000), %i5 params->deadline <= 0 || params->budget >= SCHEDULER_EDF_PRIO_MSB || params->deadline >= SCHEDULER_EDF_PRIO_MSB ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; for ( i = 0; i<_Scheduler_CBS_Maximum_servers; i++ ) { 4000b830: 82 00 60 01 inc %g1 4000b834: 80 a0 40 02 cmp %g1, %g2 4000b838: 12 bf ff fa bne 4000b820 <_Scheduler_CBS_Create_server+0x38> 4000b83c: b9 28 60 02 sll %g1, 2, %i4 if ( !_Scheduler_CBS_Server_list[i] ) break; } if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; 4000b840: 81 c7 e0 08 ret 4000b844: 91 e8 3f e6 restore %g0, -26, %o0 _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; if ( !the_server ) return SCHEDULER_CBS_ERROR_NO_MEMORY; the_server->parameters = *params; 4000b848: c4 20 60 04 st %g2, [ %g1 + 4 ] 4000b84c: c4 06 20 04 ld [ %i0 + 4 ], %g2 the_server->task_id = -1; the_server->cbs_budget_overrun = budget_overrun_callback; 4000b850: f2 20 60 0c st %i1, [ %g1 + 0xc ] _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; if ( !the_server ) return SCHEDULER_CBS_ERROR_NO_MEMORY; the_server->parameters = *params; 4000b854: c4 20 60 08 st %g2, [ %g1 + 8 ] the_server->task_id = -1; 4000b858: 84 10 3f ff mov -1, %g2 4000b85c: c4 20 40 00 st %g2, [ %g1 ] the_server->cbs_budget_overrun = budget_overrun_callback; return SCHEDULER_CBS_OK; 4000b860: 81 c7 e0 08 ret 4000b864: 91 e8 20 00 restore %g0, 0, %o0 if ( params->budget <= 0 || params->deadline <= 0 || params->budget >= SCHEDULER_EDF_PRIO_MSB || params->deadline >= SCHEDULER_EDF_PRIO_MSB ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; 4000b868: 81 c7 e0 08 ret 4000b86c: 91 e8 3f ee restore %g0, -18, %o0 *server_id = i; _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; if ( !the_server ) return SCHEDULER_CBS_ERROR_NO_MEMORY; 4000b870: 81 c7 e0 08 ret <== NOT EXECUTED 4000b874: 91 e8 3f ef restore %g0, -17, %o0 <== NOT EXECUTED if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) 4000b878: f6 07 61 08 ld [ %i5 + 0x108 ], %i3 } if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; 4000b87c: c2 26 80 00 st %g1, [ %i2 ] _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); 4000b880: 40 00 07 7f call 4000d67c <_Workspace_Allocate> 4000b884: 90 10 20 10 mov 0x10, %o0 the_server = _Scheduler_CBS_Server_list[*server_id]; 4000b888: c2 06 80 00 ld [ %i2 ], %g1 if ( i == _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_FULL; *server_id = i; _Scheduler_CBS_Server_list[*server_id] = (Scheduler_CBS_Server *) 4000b88c: d0 26 c0 1c st %o0, [ %i3 + %i4 ] _Workspace_Allocate( sizeof(Scheduler_CBS_Server) ); the_server = _Scheduler_CBS_Server_list[*server_id]; 4000b890: c4 07 61 08 ld [ %i5 + 0x108 ], %g2 4000b894: 83 28 60 02 sll %g1, 2, %g1 4000b898: c2 00 80 01 ld [ %g2 + %g1 ], %g1 if ( !the_server ) 4000b89c: 80 a0 60 00 cmp %g1, 0 4000b8a0: 32 bf ff ea bne,a 4000b848 <_Scheduler_CBS_Create_server+0x60><== ALWAYS TAKEN 4000b8a4: c4 06 00 00 ld [ %i0 ], %g2 4000b8a8: 30 bf ff f2 b,a 4000b870 <_Scheduler_CBS_Create_server+0x88><== NOT EXECUTED =============================================================================== 4000b920 <_Scheduler_CBS_Detach_thread>: int _Scheduler_CBS_Detach_thread ( Scheduler_CBS_Server_id server_id, rtems_id task_id ) { 4000b920: 9d e3 bf 98 save %sp, -104, %sp Objects_Locations location; Thread_Control *the_thread; Scheduler_CBS_Per_thread *sched_info; the_thread = _Thread_Get(task_id, &location); 4000b924: 90 10 00 19 mov %i1, %o0 4000b928: 40 00 03 61 call 4000c6ac <_Thread_Get> 4000b92c: 92 07 bf fc add %fp, -4, %o1 /* The routine _Thread_Get may disable dispatch and not enable again. */ if ( the_thread ) { 4000b930: ba 92 20 00 orcc %o0, 0, %i5 4000b934: 02 80 00 05 be 4000b948 <_Scheduler_CBS_Detach_thread+0x28> 4000b938: 03 10 00 87 sethi %hi(0x40021c00), %g1 _Thread_Enable_dispatch(); 4000b93c: 40 00 03 50 call 4000c67c <_Thread_Enable_dispatch> 4000b940: 01 00 00 00 nop } if ( server_id >= _Scheduler_CBS_Maximum_servers ) 4000b944: 03 10 00 87 sethi %hi(0x40021c00), %g1 4000b948: c2 00 62 00 ld [ %g1 + 0x200 ], %g1 ! 40021e00 <_Scheduler_CBS_Maximum_servers> 4000b94c: 80 a6 00 01 cmp %i0, %g1 4000b950: 1a 80 00 1b bcc 4000b9bc <_Scheduler_CBS_Detach_thread+0x9c> 4000b954: 80 a7 60 00 cmp %i5, 0 return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; if ( !the_thread ) 4000b958: 02 80 00 19 be 4000b9bc <_Scheduler_CBS_Detach_thread+0x9c> 4000b95c: 03 10 00 8c sethi %hi(0x40023000), %g1 return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; /* Server is not valid. */ if ( !_Scheduler_CBS_Server_list[server_id] ) 4000b960: c2 00 61 08 ld [ %g1 + 0x108 ], %g1 ! 40023108 <_Scheduler_CBS_Server_list> 4000b964: b1 2e 20 02 sll %i0, 2, %i0 4000b968: c2 00 40 18 ld [ %g1 + %i0 ], %g1 4000b96c: 80 a0 60 00 cmp %g1, 0 4000b970: 02 80 00 11 be 4000b9b4 <_Scheduler_CBS_Detach_thread+0x94> 4000b974: 01 00 00 00 nop return SCHEDULER_CBS_ERROR_NOSERVER; /* Thread and server are not attached. */ if ( _Scheduler_CBS_Server_list[server_id]->task_id != task_id ) 4000b978: c4 00 40 00 ld [ %g1 ], %g2 4000b97c: 80 a0 80 19 cmp %g2, %i1 4000b980: 12 80 00 0f bne 4000b9bc <_Scheduler_CBS_Detach_thread+0x9c><== NEVER TAKEN 4000b984: 84 10 3f ff mov -1, %g2 return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; _Scheduler_CBS_Server_list[server_id]->task_id = -1; 4000b988: c4 20 40 00 st %g2, [ %g1 ] sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; sched_info->cbs_server = NULL; 4000b98c: c2 07 60 88 ld [ %i5 + 0x88 ], %g1 4000b990: c0 20 60 18 clr [ %g1 + 0x18 ] the_thread->budget_algorithm = the_thread->Start.budget_algorithm; 4000b994: c2 07 60 a0 ld [ %i5 + 0xa0 ], %g1 4000b998: c2 27 60 78 st %g1, [ %i5 + 0x78 ] the_thread->budget_callout = the_thread->Start.budget_callout; 4000b99c: c2 07 60 a4 ld [ %i5 + 0xa4 ], %g1 4000b9a0: c2 27 60 7c st %g1, [ %i5 + 0x7c ] the_thread->is_preemptible = the_thread->Start.is_preemptible; 4000b9a4: c2 0f 60 9c ldub [ %i5 + 0x9c ], %g1 4000b9a8: c2 2f 60 70 stb %g1, [ %i5 + 0x70 ] return SCHEDULER_CBS_OK; 4000b9ac: 81 c7 e0 08 ret 4000b9b0: 91 e8 20 00 restore %g0, 0, %o0 return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; if ( !the_thread ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; /* Server is not valid. */ if ( !_Scheduler_CBS_Server_list[server_id] ) return SCHEDULER_CBS_ERROR_NOSERVER; 4000b9b4: 81 c7 e0 08 ret 4000b9b8: 91 e8 3f e7 restore %g0, -25, %o0 the_thread->budget_algorithm = the_thread->Start.budget_algorithm; the_thread->budget_callout = the_thread->Start.budget_callout; the_thread->is_preemptible = the_thread->Start.is_preemptible; return SCHEDULER_CBS_OK; } 4000b9bc: 81 c7 e0 08 ret 4000b9c0: 91 e8 3f ee restore %g0, -18, %o0 =============================================================================== 4000bc4c <_Scheduler_CBS_Initialize>: } } int _Scheduler_CBS_Initialize(void) { 4000bc4c: 9d e3 bf a0 save %sp, -96, %sp unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); 4000bc50: 3b 10 00 87 sethi %hi(0x40021c00), %i5 4000bc54: d0 07 62 00 ld [ %i5 + 0x200 ], %o0 ! 40021e00 <_Scheduler_CBS_Maximum_servers> } int _Scheduler_CBS_Initialize(void) { unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( 4000bc58: 40 00 06 89 call 4000d67c <_Workspace_Allocate> 4000bc5c: 91 2a 20 02 sll %o0, 2, %o0 4000bc60: 05 10 00 8c sethi %hi(0x40023000), %g2 _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) 4000bc64: 80 a2 20 00 cmp %o0, 0 4000bc68: 02 80 00 0d be 4000bc9c <_Scheduler_CBS_Initialize+0x50> <== NEVER TAKEN 4000bc6c: d0 20 a1 08 st %o0, [ %g2 + 0x108 ] return SCHEDULER_CBS_ERROR_NO_MEMORY; for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) { 4000bc70: c6 07 62 00 ld [ %i5 + 0x200 ], %g3 4000bc74: 10 80 00 05 b 4000bc88 <_Scheduler_CBS_Initialize+0x3c> 4000bc78: 82 10 20 00 clr %g1 _Scheduler_CBS_Server_list[i] = NULL; 4000bc7c: 89 28 60 02 sll %g1, 2, %g4 unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) return SCHEDULER_CBS_ERROR_NO_MEMORY; for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) { 4000bc80: 82 00 60 01 inc %g1 _Scheduler_CBS_Server_list[i] = NULL; 4000bc84: c0 27 40 04 clr [ %i5 + %g4 ] unsigned int i; _Scheduler_CBS_Server_list = (Scheduler_CBS_Server **) _Workspace_Allocate( _Scheduler_CBS_Maximum_servers * sizeof(Scheduler_CBS_Server*) ); if ( !_Scheduler_CBS_Server_list ) return SCHEDULER_CBS_ERROR_NO_MEMORY; for (i = 0; i<_Scheduler_CBS_Maximum_servers; i++) { 4000bc88: 80 a0 40 03 cmp %g1, %g3 4000bc8c: 12 bf ff fc bne 4000bc7c <_Scheduler_CBS_Initialize+0x30> 4000bc90: fa 00 a1 08 ld [ %g2 + 0x108 ], %i5 _Scheduler_CBS_Server_list[i] = NULL; } return SCHEDULER_CBS_OK; 4000bc94: 81 c7 e0 08 ret 4000bc98: 91 e8 20 00 restore %g0, 0, %o0 } 4000bc9c: 81 c7 e0 08 ret <== NOT EXECUTED 4000bca0: 91 e8 3f ef restore %g0, -17, %o0 <== NOT EXECUTED =============================================================================== 4000a8d0 <_Scheduler_CBS_Release_job>: { Priority_Control new_priority; Scheduler_CBS_Per_thread *sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; Scheduler_CBS_Server *serv_info = (Scheduler_CBS_Server *) sched_info->cbs_server; 4000a8d0: c2 02 20 88 ld [ %o0 + 0x88 ], %g1 if (deadline) { 4000a8d4: 80 a2 60 00 cmp %o1, 0 4000a8d8: 02 80 00 10 be 4000a918 <_Scheduler_CBS_Release_job+0x48> 4000a8dc: c2 00 60 18 ld [ %g1 + 0x18 ], %g1 /* Initializing or shifting deadline. */ if (serv_info) 4000a8e0: 80 a0 60 00 cmp %g1, 0 4000a8e4: 02 80 00 08 be 4000a904 <_Scheduler_CBS_Release_job+0x34> 4000a8e8: 05 10 00 84 sethi %hi(0x40021000), %g2 new_priority = (_Watchdog_Ticks_since_boot + serv_info->parameters.deadline) 4000a8ec: d2 00 a1 68 ld [ %g2 + 0x168 ], %o1 ! 40021168 <_Watchdog_Ticks_since_boot> 4000a8f0: c4 00 60 04 ld [ %g1 + 4 ], %g2 4000a8f4: 92 02 40 02 add %o1, %g2, %o1 4000a8f8: 05 20 00 00 sethi %hi(0x80000000), %g2 4000a8fc: 10 80 00 0a b 4000a924 <_Scheduler_CBS_Release_job+0x54> 4000a900: 92 2a 40 02 andn %o1, %g2, %o1 & ~SCHEDULER_EDF_PRIO_MSB; else new_priority = (_Watchdog_Ticks_since_boot + deadline) 4000a904: c2 00 a1 68 ld [ %g2 + 0x168 ], %g1 4000a908: 92 02 40 01 add %o1, %g1, %o1 4000a90c: 03 20 00 00 sethi %hi(0x80000000), %g1 4000a910: 10 80 00 07 b 4000a92c <_Scheduler_CBS_Release_job+0x5c> 4000a914: 92 2a 40 01 andn %o1, %g1, %o1 /* Switch back to background priority. */ new_priority = the_thread->Start.initial_priority; } /* Budget replenishment for the next job. */ if (serv_info) 4000a918: 80 a0 60 00 cmp %g1, 0 4000a91c: 02 80 00 04 be 4000a92c <_Scheduler_CBS_Release_job+0x5c> <== NEVER TAKEN 4000a920: d2 02 20 ac ld [ %o0 + 0xac ], %o1 the_thread->cpu_time_budget = serv_info->parameters.budget; 4000a924: c2 00 60 08 ld [ %g1 + 8 ], %g1 4000a928: c2 22 20 74 st %g1, [ %o0 + 0x74 ] the_thread->real_priority = new_priority; 4000a92c: d2 22 20 18 st %o1, [ %o0 + 0x18 ] _Thread_Change_priority(the_thread, new_priority, true); 4000a930: 94 10 20 01 mov 1, %o2 4000a934: 82 13 c0 00 mov %o7, %g1 4000a938: 40 00 01 26 call 4000add0 <_Thread_Change_priority> 4000a93c: 9e 10 40 00 mov %g1, %o7 =============================================================================== 4000a940 <_Scheduler_CBS_Unblock>: #include void _Scheduler_CBS_Unblock( Thread_Control *the_thread ) { 4000a940: 9d e3 bf a0 save %sp, -96, %sp Scheduler_CBS_Per_thread *sched_info; Scheduler_CBS_Server *serv_info; Priority_Control new_priority; _Scheduler_EDF_Enqueue(the_thread); 4000a944: 40 00 00 4c call 4000aa74 <_Scheduler_EDF_Enqueue> 4000a948: 90 10 00 18 mov %i0, %o0 /* TODO: flash critical section? */ sched_info = (Scheduler_CBS_Per_thread *) the_thread->scheduler_info; serv_info = (Scheduler_CBS_Server *) sched_info->cbs_server; 4000a94c: c2 06 20 88 ld [ %i0 + 0x88 ], %g1 4000a950: fa 00 60 18 ld [ %g1 + 0x18 ], %i5 * Late unblock rule for deadline-driven tasks. The remaining time to * deadline must be sufficient to serve the remaining computation time * without increased utilization of this task. It might cause a deadline * miss of another task. */ if (serv_info) { 4000a954: 80 a7 60 00 cmp %i5, 0 4000a958: 02 80 00 18 be 4000a9b8 <_Scheduler_CBS_Unblock+0x78> 4000a95c: 03 10 00 84 sethi %hi(0x40021000), %g1 time_t budget = serv_info->parameters.budget; time_t deadline_left = the_thread->cpu_time_budget; time_t budget_left = the_thread->real_priority - _Watchdog_Ticks_since_boot; if ( deadline*budget_left > budget*deadline_left ) { 4000a960: d2 07 60 04 ld [ %i5 + 4 ], %o1 */ if (serv_info) { time_t deadline = serv_info->parameters.deadline; time_t budget = serv_info->parameters.budget; time_t deadline_left = the_thread->cpu_time_budget; time_t budget_left = the_thread->real_priority - 4000a964: d0 00 61 68 ld [ %g1 + 0x168 ], %o0 4000a968: f8 06 20 18 ld [ %i0 + 0x18 ], %i4 _Watchdog_Ticks_since_boot; if ( deadline*budget_left > budget*deadline_left ) { 4000a96c: 40 00 3e fa call 4001a554 <.umul> 4000a970: 90 27 00 08 sub %i4, %o0, %o0 4000a974: d2 06 20 74 ld [ %i0 + 0x74 ], %o1 4000a978: b6 10 00 08 mov %o0, %i3 4000a97c: 40 00 3e f6 call 4001a554 <.umul> 4000a980: d0 07 60 08 ld [ %i5 + 8 ], %o0 4000a984: 80 a6 c0 08 cmp %i3, %o0 4000a988: 24 80 00 0d ble,a 4000a9bc <_Scheduler_CBS_Unblock+0x7c> 4000a98c: 3b 10 00 85 sethi %hi(0x40021400), %i5 /* Put late unblocked task to background until the end of period. */ new_priority = the_thread->Start.initial_priority; 4000a990: d2 06 20 ac ld [ %i0 + 0xac ], %o1 if ( the_thread->real_priority != new_priority ) 4000a994: 80 a7 00 09 cmp %i4, %o1 4000a998: 32 80 00 02 bne,a 4000a9a0 <_Scheduler_CBS_Unblock+0x60> 4000a99c: d2 26 20 18 st %o1, [ %i0 + 0x18 ] the_thread->real_priority = new_priority; if ( the_thread->current_priority != new_priority ) 4000a9a0: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 4000a9a4: 80 a0 40 09 cmp %g1, %o1 4000a9a8: 02 80 00 04 be 4000a9b8 <_Scheduler_CBS_Unblock+0x78> 4000a9ac: 90 10 00 18 mov %i0, %o0 _Thread_Change_priority(the_thread, new_priority, true); 4000a9b0: 40 00 01 08 call 4000add0 <_Thread_Change_priority> 4000a9b4: 94 10 20 01 mov 1, %o2 * a context switch. * Pseudo-ISR case: * Even if the thread isn't preemptible, if the new heir is * a pseudo-ISR system task, we need to do a context switch. */ if ( _Scheduler_Is_priority_higher_than( the_thread->current_priority, 4000a9b8: 3b 10 00 85 sethi %hi(0x40021400), %i5 4000a9bc: ba 17 61 90 or %i5, 0x190, %i5 ! 40021590 <_Per_CPU_Information> 4000a9c0: c4 07 60 14 ld [ %i5 + 0x14 ], %g2 4000a9c4: 03 10 00 80 sethi %hi(0x40020000), %g1 4000a9c8: d0 06 20 14 ld [ %i0 + 0x14 ], %o0 4000a9cc: c2 00 62 e4 ld [ %g1 + 0x2e4 ], %g1 4000a9d0: 9f c0 40 00 call %g1 4000a9d4: d2 00 a0 14 ld [ %g2 + 0x14 ], %o1 4000a9d8: 80 a2 20 00 cmp %o0, 0 4000a9dc: 04 80 00 0f ble 4000aa18 <_Scheduler_CBS_Unblock+0xd8> 4000a9e0: 01 00 00 00 nop _Thread_Heir->current_priority)) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 4000a9e4: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 * Even if the thread isn't preemptible, if the new heir is * a pseudo-ISR system task, we need to do a context switch. */ if ( _Scheduler_Is_priority_higher_than( the_thread->current_priority, _Thread_Heir->current_priority)) { _Thread_Heir = the_thread; 4000a9e8: f0 27 60 14 st %i0, [ %i5 + 0x14 ] if ( _Thread_Executing->is_preemptible || 4000a9ec: c2 08 60 70 ldub [ %g1 + 0x70 ], %g1 4000a9f0: 80 a0 60 00 cmp %g1, 0 4000a9f4: 12 80 00 06 bne 4000aa0c <_Scheduler_CBS_Unblock+0xcc> 4000a9f8: 84 10 20 01 mov 1, %g2 4000a9fc: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 4000aa00: 80 a0 60 00 cmp %g1, 0 4000aa04: 12 80 00 05 bne 4000aa18 <_Scheduler_CBS_Unblock+0xd8> <== ALWAYS TAKEN 4000aa08: 01 00 00 00 nop the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 4000aa0c: 03 10 00 85 sethi %hi(0x40021400), %g1 4000aa10: 82 10 61 90 or %g1, 0x190, %g1 ! 40021590 <_Per_CPU_Information> 4000aa14: c4 28 60 0c stb %g2, [ %g1 + 0xc ] 4000aa18: 81 c7 e0 08 ret 4000aa1c: 81 e8 00 00 restore =============================================================================== 4000a8a0 <_Scheduler_EDF_Allocate>: #include void *_Scheduler_EDF_Allocate( Thread_Control *the_thread ) { 4000a8a0: 9d e3 bf a0 save %sp, -96, %sp void *sched; Scheduler_EDF_Per_thread *schinfo; sched = _Workspace_Allocate( sizeof(Scheduler_EDF_Per_thread) ); 4000a8a4: 40 00 06 62 call 4000c22c <_Workspace_Allocate> 4000a8a8: 90 10 20 18 mov 0x18, %o0 if ( sched ) { 4000a8ac: 80 a2 20 00 cmp %o0, 0 4000a8b0: 02 80 00 05 be 4000a8c4 <_Scheduler_EDF_Allocate+0x24> <== NEVER TAKEN 4000a8b4: 82 10 20 02 mov 2, %g1 the_thread->scheduler_info = sched; 4000a8b8: d0 26 20 88 st %o0, [ %i0 + 0x88 ] schinfo = (Scheduler_EDF_Per_thread *)(the_thread->scheduler_info); schinfo->thread = the_thread; 4000a8bc: f0 22 00 00 st %i0, [ %o0 ] schinfo->queue_state = SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN; 4000a8c0: c2 22 20 14 st %g1, [ %o0 + 0x14 ] } return sched; } 4000a8c4: 81 c7 e0 08 ret 4000a8c8: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 4000aa68 <_Scheduler_EDF_Unblock>: #include void _Scheduler_EDF_Unblock( Thread_Control *the_thread ) { 4000aa68: 9d e3 bf a0 save %sp, -96, %sp _Scheduler_EDF_Enqueue(the_thread); 4000aa6c: 7f ff ff ad call 4000a920 <_Scheduler_EDF_Enqueue> 4000aa70: 90 10 00 18 mov %i0, %o0 * a context switch. * Pseudo-ISR case: * Even if the thread isn't preemptible, if the new heir is * a pseudo-ISR system task, we need to do a context switch. */ if ( _Scheduler_Is_priority_lower_than( 4000aa74: 3b 10 00 85 sethi %hi(0x40021400), %i5 4000aa78: ba 17 60 e0 or %i5, 0xe0, %i5 ! 400214e0 <_Per_CPU_Information> 4000aa7c: c4 07 60 14 ld [ %i5 + 0x14 ], %g2 4000aa80: 03 10 00 80 sethi %hi(0x40020000), %g1 4000aa84: d0 00 a0 14 ld [ %g2 + 0x14 ], %o0 4000aa88: c2 00 62 34 ld [ %g1 + 0x234 ], %g1 4000aa8c: 9f c0 40 00 call %g1 4000aa90: d2 06 20 14 ld [ %i0 + 0x14 ], %o1 4000aa94: 80 a2 20 00 cmp %o0, 0 4000aa98: 16 80 00 0f bge 4000aad4 <_Scheduler_EDF_Unblock+0x6c> 4000aa9c: 01 00 00 00 nop _Thread_Heir->current_priority, the_thread->current_priority )) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 4000aaa0: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 * a pseudo-ISR system task, we need to do a context switch. */ if ( _Scheduler_Is_priority_lower_than( _Thread_Heir->current_priority, the_thread->current_priority )) { _Thread_Heir = the_thread; 4000aaa4: f0 27 60 14 st %i0, [ %i5 + 0x14 ] if ( _Thread_Executing->is_preemptible || 4000aaa8: c2 08 60 70 ldub [ %g1 + 0x70 ], %g1 4000aaac: 80 a0 60 00 cmp %g1, 0 4000aab0: 12 80 00 06 bne 4000aac8 <_Scheduler_EDF_Unblock+0x60> 4000aab4: 84 10 20 01 mov 1, %g2 4000aab8: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 4000aabc: 80 a0 60 00 cmp %g1, 0 4000aac0: 12 80 00 05 bne 4000aad4 <_Scheduler_EDF_Unblock+0x6c> <== ALWAYS TAKEN 4000aac4: 01 00 00 00 nop the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 4000aac8: 03 10 00 85 sethi %hi(0x40021400), %g1 4000aacc: 82 10 60 e0 or %g1, 0xe0, %g1 ! 400214e0 <_Per_CPU_Information> 4000aad0: c4 28 60 0c stb %g2, [ %g1 + 0xc ] 4000aad4: 81 c7 e0 08 ret 4000aad8: 81 e8 00 00 restore =============================================================================== 4000a174 <_Scheduler_priority_Tick>: #include #include void _Scheduler_priority_Tick( void ) { 4000a174: 9d e3 bf a0 save %sp, -96, %sp Thread_Control *executing; executing = _Thread_Executing; 4000a178: 03 10 00 7e sethi %hi(0x4001f800), %g1 4000a17c: fa 00 61 a0 ld [ %g1 + 0x1a0 ], %i5 ! 4001f9a0 <_Per_CPU_Information+0x10> /* * If the thread is not preemptible or is not ready, then * just return. */ if ( !executing->is_preemptible ) 4000a180: c2 0f 60 70 ldub [ %i5 + 0x70 ], %g1 4000a184: 80 a0 60 00 cmp %g1, 0 4000a188: 02 80 00 25 be 4000a21c <_Scheduler_priority_Tick+0xa8> 4000a18c: 01 00 00 00 nop return; if ( !_States_Is_ready( executing->current_state ) ) 4000a190: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 4000a194: 80 a0 60 00 cmp %g1, 0 4000a198: 12 80 00 21 bne 4000a21c <_Scheduler_priority_Tick+0xa8> 4000a19c: 01 00 00 00 nop /* * The cpu budget algorithm determines what happens next. */ switch ( executing->budget_algorithm ) { 4000a1a0: c2 07 60 78 ld [ %i5 + 0x78 ], %g1 4000a1a4: 80 a0 60 01 cmp %g1, 1 4000a1a8: 0a 80 00 14 bcs 4000a1f8 <_Scheduler_priority_Tick+0x84> 4000a1ac: 80 a0 60 02 cmp %g1, 2 4000a1b0: 28 80 00 07 bleu,a 4000a1cc <_Scheduler_priority_Tick+0x58> 4000a1b4: c2 07 60 74 ld [ %i5 + 0x74 ], %g1 4000a1b8: 80 a0 60 03 cmp %g1, 3 4000a1bc: 12 80 00 18 bne 4000a21c <_Scheduler_priority_Tick+0xa8> <== NEVER TAKEN 4000a1c0: 01 00 00 00 nop } break; #if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT) case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: if ( --executing->cpu_time_budget == 0 ) 4000a1c4: 10 80 00 0f b 4000a200 <_Scheduler_priority_Tick+0x8c> 4000a1c8: c2 07 60 74 ld [ %i5 + 0x74 ], %g1 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 ) { 4000a1cc: 82 00 7f ff add %g1, -1, %g1 4000a1d0: 80 a0 60 00 cmp %g1, 0 4000a1d4: 14 80 00 09 bg 4000a1f8 <_Scheduler_priority_Tick+0x84> 4000a1d8: c2 27 60 74 st %g1, [ %i5 + 0x74 ] * always operates on the scheduler that 'owns' the currently executing * thread. */ RTEMS_INLINE_ROUTINE void _Scheduler_Yield( void ) { _Scheduler.Operations.yield(); 4000a1dc: 03 10 00 79 sethi %hi(0x4001e400), %g1 4000a1e0: c2 00 63 40 ld [ %g1 + 0x340 ], %g1 ! 4001e740 <_Scheduler+0xc> 4000a1e4: 9f c0 40 00 call %g1 4000a1e8: 01 00 00 00 nop * executing thread's timeslice is reset. Otherwise, the * currently executing thread is placed at the rear of the * FIFO for this priority and a new heir is selected. */ _Scheduler_Yield(); executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 4000a1ec: 03 10 00 7c sethi %hi(0x4001f000), %g1 4000a1f0: c2 00 63 e0 ld [ %g1 + 0x3e0 ], %g1 ! 4001f3e0 <_Thread_Ticks_per_timeslice> 4000a1f4: c2 27 60 74 st %g1, [ %i5 + 0x74 ] 4000a1f8: 81 c7 e0 08 ret 4000a1fc: 81 e8 00 00 restore } break; #if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT) case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: if ( --executing->cpu_time_budget == 0 ) 4000a200: 82 00 7f ff add %g1, -1, %g1 4000a204: 80 a0 60 00 cmp %g1, 0 4000a208: 12 bf ff fc bne 4000a1f8 <_Scheduler_priority_Tick+0x84> 4000a20c: c2 27 60 74 st %g1, [ %i5 + 0x74 ] (*executing->budget_callout)( executing ); 4000a210: c2 07 60 7c ld [ %i5 + 0x7c ], %g1 4000a214: 9f c0 40 00 call %g1 4000a218: 90 10 00 1d mov %i5, %o0 4000a21c: 81 c7 e0 08 ret 4000a220: 81 e8 00 00 restore =============================================================================== 40008db4 <_TOD_Validate>: }; bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 40008db4: 9d e3 bf a0 save %sp, -96, %sp uint32_t days_in_month; uint32_t ticks_per_second; ticks_per_second = TOD_MICROSECONDS_PER_SECOND / 40008db8: 03 10 00 7a sethi %hi(0x4001e800), %g1 40008dbc: d2 00 62 5c ld [ %g1 + 0x25c ], %o1 ! 4001ea5c 40008dc0: 11 00 03 d0 sethi %hi(0xf4000), %o0 40008dc4: 40 00 48 2b call 4001ae70 <.udiv> 40008dc8: 90 12 22 40 or %o0, 0x240, %o0 ! f4240 rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 40008dcc: 80 a6 20 00 cmp %i0, 0 40008dd0: 02 80 00 28 be 40008e70 <_TOD_Validate+0xbc> <== NEVER TAKEN 40008dd4: 84 10 20 00 clr %g2 40008dd8: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 40008ddc: 80 a0 40 08 cmp %g1, %o0 40008de0: 3a 80 00 25 bcc,a 40008e74 <_TOD_Validate+0xc0> 40008de4: b0 08 a0 01 and %g2, 1, %i0 (the_tod->ticks >= ticks_per_second) || 40008de8: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 40008dec: 80 a0 60 3b cmp %g1, 0x3b 40008df0: 38 80 00 21 bgu,a 40008e74 <_TOD_Validate+0xc0> 40008df4: b0 08 a0 01 and %g2, 1, %i0 (the_tod->second >= TOD_SECONDS_PER_MINUTE) || 40008df8: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 40008dfc: 80 a0 60 3b cmp %g1, 0x3b 40008e00: 38 80 00 1d bgu,a 40008e74 <_TOD_Validate+0xc0> 40008e04: b0 08 a0 01 and %g2, 1, %i0 (the_tod->minute >= TOD_MINUTES_PER_HOUR) || 40008e08: c2 06 20 0c ld [ %i0 + 0xc ], %g1 40008e0c: 80 a0 60 17 cmp %g1, 0x17 40008e10: 38 80 00 19 bgu,a 40008e74 <_TOD_Validate+0xc0> 40008e14: b0 08 a0 01 and %g2, 1, %i0 (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || 40008e18: c2 06 20 04 ld [ %i0 + 4 ], %g1 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) || 40008e1c: 80 a0 60 00 cmp %g1, 0 40008e20: 02 80 00 14 be 40008e70 <_TOD_Validate+0xbc> <== NEVER TAKEN 40008e24: 80 a0 60 0c cmp %g1, 0xc (the_tod->month == 0) || 40008e28: 38 80 00 13 bgu,a 40008e74 <_TOD_Validate+0xc0> 40008e2c: b0 08 a0 01 and %g2, 1, %i0 (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || 40008e30: c8 06 00 00 ld [ %i0 ], %g4 (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) || 40008e34: 80 a1 27 c3 cmp %g4, 0x7c3 40008e38: 28 80 00 0f bleu,a 40008e74 <_TOD_Validate+0xc0> 40008e3c: b0 08 a0 01 and %g2, 1, %i0 (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) 40008e40: c6 06 20 08 ld [ %i0 + 8 ], %g3 (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) || 40008e44: 80 a0 e0 00 cmp %g3, 0 40008e48: 02 80 00 0a be 40008e70 <_TOD_Validate+0xbc> <== NEVER TAKEN 40008e4c: 80 89 20 03 btst 3, %g4 40008e50: 05 10 00 7e sethi %hi(0x4001f800), %g2 (the_tod->day == 0) ) return false; if ( (the_tod->year % 4) == 0 ) 40008e54: 12 80 00 03 bne 40008e60 <_TOD_Validate+0xac> 40008e58: 84 10 a3 58 or %g2, 0x358, %g2 ! 4001fb58 <_TOD_Days_per_month> days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; 40008e5c: 82 00 60 0d add %g1, 0xd, %g1 else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; 40008e60: 83 28 60 02 sll %g1, 2, %g1 40008e64: c2 00 80 01 ld [ %g2 + %g1 ], %g1 if ( the_tod->day > days_in_month ) 40008e68: 80 a0 40 03 cmp %g1, %g3 40008e6c: 84 60 3f ff subx %g0, -1, %g2 return false; return true; } 40008e70: b0 08 a0 01 and %g2, 1, %i0 40008e74: 81 c7 e0 08 ret 40008e78: 81 e8 00 00 restore =============================================================================== 4000a430 <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 4000a430: 9d e3 bf a0 save %sp, -96, %sp 4000a434: ba 10 00 18 mov %i0, %i5 States_Control state, original_state; /* * Save original state */ original_state = the_thread->current_state; 4000a438: f0 06 20 10 ld [ %i0 + 0x10 ], %i0 /* * 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 ); 4000a43c: 40 00 03 51 call 4000b180 <_Thread_Set_transient> 4000a440: 90 10 00 1d mov %i5, %o0 /* * Do not bother recomputing all the priority related information if * we are not REALLY changing priority. */ if ( the_thread->current_priority != new_priority ) 4000a444: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 4000a448: 80 a0 40 19 cmp %g1, %i1 4000a44c: 02 80 00 04 be 4000a45c <_Thread_Change_priority+0x2c> 4000a450: 90 10 00 1d mov %i5, %o0 _Thread_Set_priority( the_thread, new_priority ); 4000a454: 40 00 03 32 call 4000b11c <_Thread_Set_priority> 4000a458: 92 10 00 19 mov %i1, %o1 _ISR_Disable( level ); 4000a45c: 7f ff df fb call 40002448 4000a460: 01 00 00 00 nop 4000a464: b6 10 00 08 mov %o0, %i3 /* * 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; 4000a468: f8 07 60 10 ld [ %i5 + 0x10 ], %i4 if ( state != STATES_TRANSIENT ) { 4000a46c: 80 a7 20 04 cmp %i4, 4 4000a470: 02 80 00 10 be 4000a4b0 <_Thread_Change_priority+0x80> 4000a474: 82 0e 20 04 and %i0, 4, %g1 /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) 4000a478: 80 a0 60 00 cmp %g1, 0 4000a47c: 12 80 00 03 bne 4000a488 <_Thread_Change_priority+0x58> <== NEVER TAKEN 4000a480: 82 0f 3f fb and %i4, -5, %g1 the_thread->current_state = _States_Clear( STATES_TRANSIENT, state ); 4000a484: c2 27 60 10 st %g1, [ %i5 + 0x10 ] _ISR_Enable( level ); 4000a488: 7f ff df f4 call 40002458 4000a48c: 90 10 00 1b mov %i3, %o0 if ( _States_Is_waiting_on_thread_queue( state ) ) { 4000a490: 03 00 00 ef sethi %hi(0x3bc00), %g1 4000a494: 82 10 62 e0 or %g1, 0x2e0, %g1 ! 3bee0 4000a498: 80 8f 00 01 btst %i4, %g1 4000a49c: 02 80 00 27 be 4000a538 <_Thread_Change_priority+0x108> 4000a4a0: 01 00 00 00 nop _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); 4000a4a4: f0 07 60 44 ld [ %i5 + 0x44 ], %i0 4000a4a8: 40 00 02 f0 call 4000b068 <_Thread_queue_Requeue> 4000a4ac: 93 e8 00 1d restore %g0, %i5, %o1 } return; } /* Only clear the transient state if it wasn't set already */ if ( ! _States_Is_transient( original_state ) ) { 4000a4b0: 80 a0 60 00 cmp %g1, 0 4000a4b4: 12 80 00 0b bne 4000a4e0 <_Thread_Change_priority+0xb0> <== NEVER TAKEN 4000a4b8: 03 10 00 79 sethi %hi(0x4001e400), %g1 * 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 ); 4000a4bc: c0 27 60 10 clr [ %i5 + 0x10 ] if ( prepend_it ) 4000a4c0: 80 a6 a0 00 cmp %i2, 0 4000a4c4: 02 80 00 04 be 4000a4d4 <_Thread_Change_priority+0xa4> 4000a4c8: 82 10 63 34 or %g1, 0x334, %g1 */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue_first( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue_first( the_thread ); 4000a4cc: 10 80 00 03 b 4000a4d8 <_Thread_Change_priority+0xa8> 4000a4d0: c2 00 60 28 ld [ %g1 + 0x28 ], %g1 */ RTEMS_INLINE_ROUTINE void _Scheduler_Enqueue( Thread_Control *the_thread ) { _Scheduler.Operations.enqueue( the_thread ); 4000a4d4: c2 00 60 24 ld [ %g1 + 0x24 ], %g1 4000a4d8: 9f c0 40 00 call %g1 4000a4dc: 90 10 00 1d mov %i5, %o0 _Scheduler_Enqueue_first( the_thread ); else _Scheduler_Enqueue( the_thread ); } _ISR_Flash( level ); 4000a4e0: 7f ff df de call 40002458 4000a4e4: 90 10 00 1b mov %i3, %o0 4000a4e8: 7f ff df d8 call 40002448 4000a4ec: 01 00 00 00 nop 4000a4f0: b0 10 00 08 mov %o0, %i0 * This kernel routine implements the scheduling decision logic for * the scheduler. It does NOT dispatch. */ RTEMS_INLINE_ROUTINE void _Scheduler_Schedule( void ) { _Scheduler.Operations.schedule(); 4000a4f4: 03 10 00 79 sethi %hi(0x4001e400), %g1 4000a4f8: c2 00 63 3c ld [ %g1 + 0x33c ], %g1 ! 4001e73c <_Scheduler+0x8> 4000a4fc: 9f c0 40 00 call %g1 4000a500: 01 00 00 00 nop * is also the heir thread, and false otherwise. */ RTEMS_INLINE_ROUTINE bool _Thread_Is_executing_also_the_heir( void ) { return ( _Thread_Executing == _Thread_Heir ); 4000a504: 03 10 00 7e sethi %hi(0x4001f800), %g1 4000a508: 82 10 61 90 or %g1, 0x190, %g1 ! 4001f990 <_Per_CPU_Information> * We altered the set of thread priorities. So let's figure out * who is the heir and if we need to switch to them. */ _Scheduler_Schedule(); if ( !_Thread_Is_executing_also_the_heir() && 4000a50c: c4 18 60 10 ldd [ %g1 + 0x10 ], %g2 4000a510: 80 a0 80 03 cmp %g2, %g3 4000a514: 02 80 00 07 be 4000a530 <_Thread_Change_priority+0x100> 4000a518: 01 00 00 00 nop 4000a51c: c4 08 a0 70 ldub [ %g2 + 0x70 ], %g2 4000a520: 80 a0 a0 00 cmp %g2, 0 4000a524: 02 80 00 03 be 4000a530 <_Thread_Change_priority+0x100> 4000a528: 84 10 20 01 mov 1, %g2 _Thread_Executing->is_preemptible ) _Thread_Dispatch_necessary = true; 4000a52c: c4 28 60 0c stb %g2, [ %g1 + 0xc ] _ISR_Enable( level ); 4000a530: 7f ff df ca call 40002458 4000a534: 81 e8 00 00 restore 4000a538: 81 c7 e0 08 ret 4000a53c: 81 e8 00 00 restore =============================================================================== 4000a700 <_Thread_Delay_ended>: void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { 4000a700: 9d e3 bf 98 save %sp, -104, %sp Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 4000a704: 90 10 00 18 mov %i0, %o0 4000a708: 40 00 00 70 call 4000a8c8 <_Thread_Get> 4000a70c: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 4000a710: c2 07 bf fc ld [ %fp + -4 ], %g1 4000a714: 80 a0 60 00 cmp %g1, 0 4000a718: 12 80 00 08 bne 4000a738 <_Thread_Delay_ended+0x38> <== NEVER TAKEN 4000a71c: 13 04 00 00 sethi %hi(0x10000000), %o1 #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_Clear_state( 4000a720: 7f ff ff 88 call 4000a540 <_Thread_Clear_state> 4000a724: 92 12 60 18 or %o1, 0x18, %o1 ! 10000018 * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 4000a728: 03 10 00 7d sethi %hi(0x4001f400), %g1 4000a72c: c4 00 60 80 ld [ %g1 + 0x80 ], %g2 ! 4001f480 <_Thread_Dispatch_disable_level> --level; 4000a730: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = level; 4000a734: c4 20 60 80 st %g2, [ %g1 + 0x80 ] 4000a738: 81 c7 e0 08 ret 4000a73c: 81 e8 00 00 restore =============================================================================== 4000a740 <_Thread_Dispatch>: #if defined(RTEMS_SMP) #include #endif void _Thread_Dispatch( void ) { 4000a740: 9d e3 bf 98 save %sp, -104, %sp #endif /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; 4000a744: 35 10 00 7e sethi %hi(0x4001f800), %i2 4000a748: 82 16 a1 90 or %i2, 0x190, %g1 ! 4001f990 <_Per_CPU_Information> _ISR_Disable( level ); 4000a74c: 7f ff df 3f call 40002448 4000a750: f6 00 60 10 ld [ %g1 + 0x10 ], %i3 */ static inline void _TOD_Get_uptime( Timestamp_Control *time ) { _TOD_Get_with_nanoseconds( time, &_TOD.uptime ); 4000a754: 21 10 00 7c sethi %hi(0x4001f000), %l0 { const Chain_Control *chain = &_User_extensions_Switches_list; const Chain_Node *tail = _Chain_Immutable_tail( chain ); const Chain_Node *node = _Chain_Immutable_first( chain ); while ( node != tail ) { 4000a758: 27 10 00 7a sethi %hi(0x4001e800), %l3 * This routine sets thread dispatch level to the * value passed in. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_set_disable_level(uint32_t value) { _Thread_Dispatch_disable_level = value; 4000a75c: 33 10 00 7d sethi %hi(0x4001f400), %i1 #if __RTEMS_ADA__ executing->rtems_ada_self = rtems_ada_self; rtems_ada_self = heir->rtems_ada_self; #endif if ( heir->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE ) heir->cpu_time_budget = _Thread_Ticks_per_timeslice; 4000a760: 31 10 00 7c sethi %hi(0x4001f000), %i0 4000a764: a0 14 23 d0 or %l0, 0x3d0, %l0 #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 4000a768: 23 10 00 7d sethi %hi(0x4001f400), %l1 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 4000a76c: 25 10 00 7a sethi %hi(0x4001e800), %l2 /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; _ISR_Disable( level ); while ( _Thread_Dispatch_necessary == true ) { 4000a770: 10 80 00 3b b 4000a85c <_Thread_Dispatch+0x11c> 4000a774: a6 14 e0 64 or %l3, 0x64, %l3 4000a778: 84 10 20 01 mov 1, %g2 4000a77c: c4 26 60 80 st %g2, [ %i1 + 0x80 ] heir = _Thread_Heir; #ifndef RTEMS_SMP _Thread_Dispatch_set_disable_level( 1 ); #endif _Thread_Dispatch_necessary = false; 4000a780: c0 28 60 0c clrb [ %g1 + 0xc ] /* * 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 ) 4000a784: 80 a5 00 1b cmp %l4, %i3 4000a788: 12 80 00 0a bne 4000a7b0 <_Thread_Dispatch+0x70> 4000a78c: e8 20 60 10 st %l4, [ %g1 + 0x10 ] 4000a790: 03 10 00 7d sethi %hi(0x4001f400), %g1 4000a794: c0 20 60 80 clr [ %g1 + 0x80 ] ! 4001f480 <_Thread_Dispatch_disable_level> post_switch: #ifndef RTEMS_SMP _Thread_Dispatch_set_disable_level( 0 ); #endif _ISR_Enable( level ); 4000a798: 7f ff df 30 call 40002458 4000a79c: 39 10 00 7d sethi %hi(0x4001f400), %i4 4000a7a0: 03 10 00 7d sethi %hi(0x4001f400), %g1 4000a7a4: fa 00 60 f0 ld [ %g1 + 0xf0 ], %i5 ! 4001f4f0 <_API_extensions_Post_switch_list> { const Chain_Control *chain = &_API_extensions_Post_switch_list; const Chain_Node *tail = _Chain_Immutable_tail( chain ); const Chain_Node *node = _Chain_Immutable_first( chain ); while ( node != tail ) { 4000a7a8: 10 80 00 37 b 4000a884 <_Thread_Dispatch+0x144> 4000a7ac: b8 17 20 f4 or %i4, 0xf4, %i4 */ #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 ) 4000a7b0: c2 05 20 78 ld [ %l4 + 0x78 ], %g1 4000a7b4: 80 a0 60 01 cmp %g1, 1 4000a7b8: 12 80 00 03 bne 4000a7c4 <_Thread_Dispatch+0x84> 4000a7bc: c2 06 23 e0 ld [ %i0 + 0x3e0 ], %g1 heir->cpu_time_budget = _Thread_Ticks_per_timeslice; 4000a7c0: c2 25 20 74 st %g1, [ %l4 + 0x74 ] _ISR_Enable( level ); 4000a7c4: 7f ff df 25 call 40002458 4000a7c8: 01 00 00 00 nop 4000a7cc: 90 07 bf f8 add %fp, -8, %o0 4000a7d0: 7f ff f9 e0 call 40008f50 <_TOD_Get_with_nanoseconds> 4000a7d4: 92 10 00 10 mov %l0, %o1 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ { Timestamp_Control uptime, ran; _TOD_Get_uptime( &uptime ); _Timestamp_Subtract( 4000a7d8: c4 1f bf f8 ldd [ %fp + -8 ], %g2 4000a7dc: 82 16 a1 90 or %i2, 0x190, %g1 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 4000a7e0: f8 18 60 20 ldd [ %g1 + 0x20 ], %i4 4000a7e4: 96 a0 c0 1d subcc %g3, %i5, %o3 4000a7e8: 94 60 80 1c subx %g2, %i4, %o2 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 4000a7ec: f8 1e e0 80 ldd [ %i3 + 0x80 ], %i4 4000a7f0: 9a 87 40 0b addcc %i5, %o3, %o5 4000a7f4: 98 47 00 0a addx %i4, %o2, %o4 4000a7f8: d8 3e e0 80 std %o4, [ %i3 + 0x80 ] &_Thread_Time_of_last_context_switch, &uptime, &ran ); _Timestamp_Add_to( &executing->cpu_time_used, &ran ); _Thread_Time_of_last_context_switch = uptime; 4000a7fc: c4 38 60 20 std %g2, [ %g1 + 0x20 ] #endif /* * Switch libc's task specific data. */ if ( _Thread_libc_reent ) { 4000a800: c2 04 60 ec ld [ %l1 + 0xec ], %g1 4000a804: 80 a0 60 00 cmp %g1, 0 4000a808: 22 80 00 0c be,a 4000a838 <_Thread_Dispatch+0xf8> <== NEVER TAKEN 4000a80c: fa 04 a0 60 ld [ %l2 + 0x60 ], %i5 <== NOT EXECUTED executing->libc_reent = *_Thread_libc_reent; 4000a810: c4 00 40 00 ld [ %g1 ], %g2 4000a814: c4 26 e1 48 st %g2, [ %i3 + 0x148 ] *_Thread_libc_reent = heir->libc_reent; 4000a818: c4 05 21 48 ld [ %l4 + 0x148 ], %g2 4000a81c: c4 20 40 00 st %g2, [ %g1 ] 4000a820: 10 80 00 06 b 4000a838 <_Thread_Dispatch+0xf8> 4000a824: fa 04 a0 60 ld [ %l2 + 0x60 ], %i5 const User_extensions_Switch_control *extension = (const User_extensions_Switch_control *) node; (*extension->thread_switch)( executing, heir ); 4000a828: 90 10 00 1b mov %i3, %o0 4000a82c: 9f c0 40 00 call %g1 4000a830: 92 10 00 14 mov %l4, %o1 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_next( const Chain_Node *the_node ) { return the_node->next; 4000a834: fa 07 40 00 ld [ %i5 ], %i5 { const Chain_Control *chain = &_User_extensions_Switches_list; const Chain_Node *tail = _Chain_Immutable_tail( chain ); const Chain_Node *node = _Chain_Immutable_first( chain ); while ( node != tail ) { 4000a838: 80 a7 40 13 cmp %i5, %l3 4000a83c: 32 bf ff fb bne,a 4000a828 <_Thread_Dispatch+0xe8> 4000a840: c2 07 60 08 ld [ %i5 + 8 ], %g1 if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 4000a844: 90 06 e0 c0 add %i3, 0xc0, %o0 4000a848: 40 00 04 30 call 4000b908 <_CPU_Context_switch> 4000a84c: 92 05 20 c0 add %l4, 0xc0, %o1 if ( executing->fp_context != NULL ) _Context_Restore_fp( &executing->fp_context ); #endif #endif executing = _Thread_Executing; 4000a850: 82 16 a1 90 or %i2, 0x190, %g1 _ISR_Disable( level ); 4000a854: 7f ff de fd call 40002448 4000a858: f6 00 60 10 ld [ %g1 + 0x10 ], %i3 /* * Now determine if we need to perform a dispatch on the current CPU. */ executing = _Thread_Executing; _ISR_Disable( level ); while ( _Thread_Dispatch_necessary == true ) { 4000a85c: 82 16 a1 90 or %i2, 0x190, %g1 4000a860: c4 08 60 0c ldub [ %g1 + 0xc ], %g2 4000a864: 80 a0 a0 00 cmp %g2, 0 4000a868: 32 bf ff c4 bne,a 4000a778 <_Thread_Dispatch+0x38> 4000a86c: e8 00 60 14 ld [ %g1 + 0x14 ], %l4 4000a870: 10 bf ff c9 b 4000a794 <_Thread_Dispatch+0x54> 4000a874: 03 10 00 7d sethi %hi(0x4001f400), %g1 const API_extensions_Post_switch_control *post_switch = (const API_extensions_Post_switch_control *) node; (*post_switch->hook)( executing ); 4000a878: 9f c0 40 00 call %g1 4000a87c: 90 10 00 1b mov %i3, %o0 4000a880: fa 07 40 00 ld [ %i5 ], %i5 { const Chain_Control *chain = &_API_extensions_Post_switch_list; const Chain_Node *tail = _Chain_Immutable_tail( chain ); const Chain_Node *node = _Chain_Immutable_first( chain ); while ( node != tail ) { 4000a884: 80 a7 40 1c cmp %i5, %i4 4000a888: 32 bf ff fc bne,a 4000a878 <_Thread_Dispatch+0x138> 4000a88c: c2 07 60 08 ld [ %i5 + 8 ], %g1 #ifdef RTEMS_SMP _Thread_Unnest_dispatch(); #endif _API_extensions_Run_post_switch( executing ); } 4000a890: 81 c7 e0 08 ret 4000a894: 81 e8 00 00 restore =============================================================================== 4000f8c0 <_Thread_Handler>: #define INIT_NAME __main #define EXECUTE_GLOBAL_CONSTRUCTORS #endif void _Thread_Handler( void ) { 4000f8c0: 9d e3 bf a0 save %sp, -96, %sp #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) static bool doneConstructors; bool doCons; #endif executing = _Thread_Executing; 4000f8c4: 03 10 00 7e sethi %hi(0x4001f800), %g1 4000f8c8: fa 00 61 a0 ld [ %g1 + 0x1a0 ], %i5 ! 4001f9a0 <_Per_CPU_Information+0x10> /* * Some CPUs need to tinker with the call frame or registers when the * thread actually begins to execute for the first time. This is a * hook point where the port gets a shot at doing whatever it requires. */ _Context_Initialization_at_thread_begin(); 4000f8cc: 3f 10 00 3e sethi %hi(0x4000f800), %i7 4000f8d0: be 17 e0 c0 or %i7, 0xc0, %i7 ! 4000f8c0 <_Thread_Handler> /* * have to put level into a register for those cpu's that use * inline asm here */ level = executing->Start.isr_level; 4000f8d4: d0 07 60 a8 ld [ %i5 + 0xa8 ], %o0 _ISR_Set_level(level); 4000f8d8: 7f ff ca e0 call 40002458 4000f8dc: 91 2a 20 08 sll %o0, 8, %o0 doCons = !doneConstructors && _Objects_Get_API( executing->Object.id ) != OBJECTS_INTERNAL_API; if (doCons) doneConstructors = true; #else doCons = !doneConstructors; 4000f8e0: 03 10 00 7c sethi %hi(0x4001f000), %g1 doneConstructors = true; 4000f8e4: 84 10 20 01 mov 1, %g2 doCons = !doneConstructors && _Objects_Get_API( executing->Object.id ) != OBJECTS_INTERNAL_API; if (doCons) doneConstructors = true; #else doCons = !doneConstructors; 4000f8e8: f8 08 60 10 ldub [ %g1 + 0x10 ], %i4 ); } static inline void _User_extensions_Thread_begin( Thread_Control *executing ) { _User_extensions_Iterate( 4000f8ec: 90 10 00 1d mov %i5, %o0 4000f8f0: 13 10 00 2c sethi %hi(0x4000b000), %o1 4000f8f4: 92 12 63 60 or %o1, 0x360, %o1 ! 4000b360 <_User_extensions_Thread_begin_visitor> 4000f8f8: 7f ff ee b7 call 4000b3d4 <_User_extensions_Iterate> 4000f8fc: c4 28 60 10 stb %g2, [ %g1 + 0x10 ] _User_extensions_Thread_begin( executing ); /* * At this point, the dispatch disable level BETTER be 1. */ _Thread_Enable_dispatch(); 4000f900: 7f ff eb e6 call 4000a898 <_Thread_Enable_dispatch> 4000f904: 01 00 00 00 nop /* * _init could be a weak symbol and we SHOULD test it but it isn't * in any configuration I know of and it generates a warning on every * RTEMS target configuration. --joel (12 May 2007) */ if (doCons) /* && (volatile void *)_init) */ { 4000f908: 80 8f 20 ff btst 0xff, %i4 4000f90c: 32 80 00 05 bne,a 4000f920 <_Thread_Handler+0x60> 4000f910: c2 07 60 90 ld [ %i5 + 0x90 ], %g1 INIT_NAME (); 4000f914: 40 00 3b 55 call 4001e668 <_init> 4000f918: 01 00 00 00 nop _Thread_Enable_dispatch(); #endif } #endif if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 4000f91c: c2 07 60 90 ld [ %i5 + 0x90 ], %g1 4000f920: 80 a0 60 00 cmp %g1, 0 4000f924: 12 80 00 05 bne 4000f938 <_Thread_Handler+0x78> 4000f928: 80 a0 60 01 cmp %g1, 1 executing->Wait.return_argument = (*(Thread_Entry_numeric) executing->Start.entry_point)( 4000f92c: c2 07 60 8c ld [ %i5 + 0x8c ], %g1 4000f930: 10 80 00 06 b 4000f948 <_Thread_Handler+0x88> 4000f934: d0 07 60 98 ld [ %i5 + 0x98 ], %o0 executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { 4000f938: 12 80 00 08 bne 4000f958 <_Thread_Handler+0x98> <== NEVER TAKEN 4000f93c: 90 10 00 1d mov %i5, %o0 executing->Wait.return_argument = (*(Thread_Entry_pointer) executing->Start.entry_point)( 4000f940: c2 07 60 8c ld [ %i5 + 0x8c ], %g1 4000f944: d0 07 60 94 ld [ %i5 + 0x94 ], %o0 4000f948: 9f c0 40 00 call %g1 4000f94c: 01 00 00 00 nop executing->Start.numeric_argument ); } #if defined(RTEMS_POSIX_API) else if ( executing->Start.prototype == THREAD_START_POINTER ) { executing->Wait.return_argument = 4000f950: d0 27 60 28 st %o0, [ %i5 + 0x28 ] } } static inline void _User_extensions_Thread_exitted( Thread_Control *executing ) { _User_extensions_Iterate( 4000f954: 90 10 00 1d mov %i5, %o0 4000f958: 13 10 00 2c sethi %hi(0x4000b000), %o1 4000f95c: 7f ff ee 9e call 4000b3d4 <_User_extensions_Iterate> 4000f960: 92 12 63 84 or %o1, 0x384, %o1 ! 4000b384 <_User_extensions_Thread_exitted_visitor> * able to fit in a (void *). */ _User_extensions_Thread_exitted( executing ); _Internal_error_Occurred( 4000f964: 90 10 20 00 clr %o0 4000f968: 92 10 20 01 mov 1, %o1 4000f96c: 7f ff e6 ad call 40009420 <_Internal_error_Occurred> 4000f970: 94 10 20 05 mov 5, %o2 =============================================================================== 4000ab50 <_Thread_Handler_initialization>: #if defined(RTEMS_SMP) #include #endif void _Thread_Handler_initialization(void) { 4000ab50: 9d e3 bf 98 save %sp, -104, %sp uint32_t ticks_per_timeslice = 4000ab54: 03 10 00 71 sethi %hi(0x4001c400), %g1 4000ab58: 82 10 63 d8 or %g1, 0x3d8, %g1 ! 4001c7d8 #if defined(RTEMS_MULTIPROCESSING) uint32_t maximum_proxies = _Configuration_MP_table->maximum_proxies; #endif if ( rtems_configuration_get_stack_allocate_hook() == NULL || 4000ab5c: c6 00 60 28 ld [ %g1 + 0x28 ], %g3 #include #endif void _Thread_Handler_initialization(void) { uint32_t ticks_per_timeslice = 4000ab60: fa 00 60 14 ld [ %g1 + 0x14 ], %i5 rtems_configuration_get_ticks_per_timeslice(); uint32_t maximum_extensions = 4000ab64: f8 00 60 08 ld [ %g1 + 8 ], %i4 #if defined(RTEMS_MULTIPROCESSING) uint32_t maximum_proxies = _Configuration_MP_table->maximum_proxies; #endif if ( rtems_configuration_get_stack_allocate_hook() == NULL || 4000ab68: 80 a0 e0 00 cmp %g3, 0 4000ab6c: 02 80 00 06 be 4000ab84 <_Thread_Handler_initialization+0x34><== NEVER TAKEN 4000ab70: c4 00 60 24 ld [ %g1 + 0x24 ], %g2 4000ab74: c6 00 60 2c ld [ %g1 + 0x2c ], %g3 4000ab78: 80 a0 e0 00 cmp %g3, 0 4000ab7c: 12 80 00 06 bne 4000ab94 <_Thread_Handler_initialization+0x44> 4000ab80: 80 a0 a0 00 cmp %g2, 0 rtems_configuration_get_stack_free_hook() == NULL) _Internal_error_Occurred( 4000ab84: 90 10 20 00 clr %o0 4000ab88: 92 10 20 01 mov 1, %o1 4000ab8c: 7f ff fa 25 call 40009420 <_Internal_error_Occurred> 4000ab90: 94 10 20 0e mov 0xe, %o2 INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_BAD_STACK_HOOK ); if ( stack_allocate_init_hook != NULL ) 4000ab94: 22 80 00 05 be,a 4000aba8 <_Thread_Handler_initialization+0x58> 4000ab98: 03 10 00 7e sethi %hi(0x4001f800), %g1 (*stack_allocate_init_hook)( rtems_configuration_get_stack_space_size() ); 4000ab9c: 9f c0 80 00 call %g2 4000aba0: d0 00 60 04 ld [ %g1 + 4 ], %o0 ! 4001f804 <_POSIX_Barrier_Information> _Thread_Dispatch_necessary = false; 4000aba4: 03 10 00 7e sethi %hi(0x4001f800), %g1 4000aba8: 82 10 61 90 or %g1, 0x190, %g1 ! 4001f990 <_Per_CPU_Information> 4000abac: c0 28 60 0c clrb [ %g1 + 0xc ] _Thread_Executing = NULL; 4000abb0: c0 20 60 10 clr [ %g1 + 0x10 ] _Thread_Heir = NULL; 4000abb4: c0 20 60 14 clr [ %g1 + 0x14 ] #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Thread_Allocated_fp = NULL; #endif _Thread_Maximum_extensions = maximum_extensions; 4000abb8: 03 10 00 7d sethi %hi(0x4001f400), %g1 4000abbc: f8 20 60 fc st %i4, [ %g1 + 0xfc ] ! 4001f4fc <_Thread_Maximum_extensions> _Thread_Ticks_per_timeslice = ticks_per_timeslice; 4000abc0: 03 10 00 7c sethi %hi(0x4001f000), %g1 4000abc4: fa 20 63 e0 st %i5, [ %g1 + 0x3e0 ] ! 4001f3e0 <_Thread_Ticks_per_timeslice> #if defined(RTEMS_MULTIPROCESSING) if ( _System_state_Is_multiprocessing ) maximum_internal_threads += 1; #endif _Objects_Initialize_information( 4000abc8: 82 10 20 08 mov 8, %g1 4000abcc: 11 10 00 7d sethi %hi(0x4001f400), %o0 4000abd0: c2 23 a0 5c st %g1, [ %sp + 0x5c ] 4000abd4: 90 12 21 70 or %o0, 0x170, %o0 4000abd8: 92 10 20 01 mov 1, %o1 4000abdc: 94 10 20 01 mov 1, %o2 4000abe0: 96 10 20 01 mov 1, %o3 4000abe4: 98 10 21 60 mov 0x160, %o4 4000abe8: 7f ff fb 9e call 40009a60 <_Objects_Initialize_information> 4000abec: 9a 10 20 00 clr %o5 4000abf0: 81 c7 e0 08 ret 4000abf4: 81 e8 00 00 restore =============================================================================== 4000a978 <_Thread_Initialize>: Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 4000a978: 9d e3 bf 98 save %sp, -104, %sp 4000a97c: c2 07 a0 6c ld [ %fp + 0x6c ], %g1 /* * Zero out all the allocated memory fields */ for ( i=0 ; i <= THREAD_API_LAST ; i++ ) the_thread->API_Extensions[i] = NULL; 4000a980: c0 26 61 4c clr [ %i1 + 0x14c ] 4000a984: c0 26 61 50 clr [ %i1 + 0x150 ] extensions_area = NULL; the_thread->libc_reent = NULL; 4000a988: c0 26 61 48 clr [ %i1 + 0x148 ] Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 4000a98c: e0 07 a0 60 ld [ %fp + 0x60 ], %l0 4000a990: e2 00 40 00 ld [ %g1 ], %l1 if ( !actual_stack_size || actual_stack_size < stack_size ) return false; /* stack allocation failed */ stack = the_thread->Start.stack; #else if ( !stack_area ) { 4000a994: 80 a6 a0 00 cmp %i2, 0 4000a998: 12 80 00 0d bne 4000a9cc <_Thread_Initialize+0x54> 4000a99c: e4 0f a0 5f ldub [ %fp + 0x5f ], %l2 actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); 4000a9a0: 90 10 00 19 mov %i1, %o0 4000a9a4: 40 00 02 06 call 4000b1bc <_Thread_Stack_Allocate> 4000a9a8: 92 10 00 1b mov %i3, %o1 if ( !actual_stack_size || actual_stack_size < stack_size ) 4000a9ac: 80 a2 00 1b cmp %o0, %i3 4000a9b0: 0a 80 00 64 bcs 4000ab40 <_Thread_Initialize+0x1c8> 4000a9b4: 80 a2 20 00 cmp %o0, 0 4000a9b8: 02 80 00 62 be 4000ab40 <_Thread_Initialize+0x1c8> <== NEVER TAKEN 4000a9bc: 82 10 20 01 mov 1, %g1 return false; /* stack allocation failed */ stack = the_thread->Start.stack; 4000a9c0: f4 06 60 bc ld [ %i1 + 0xbc ], %i2 the_thread->Start.core_allocated_stack = true; 4000a9c4: 10 80 00 04 b 4000a9d4 <_Thread_Initialize+0x5c> 4000a9c8: c2 2e 60 b0 stb %g1, [ %i1 + 0xb0 ] } else { stack = stack_area; actual_stack_size = stack_size; the_thread->Start.core_allocated_stack = false; 4000a9cc: c0 2e 60 b0 clrb [ %i1 + 0xb0 ] 4000a9d0: 90 10 00 1b mov %i3, %o0 void *starting_address, size_t size ) { the_stack->area = starting_address; the_stack->size = size; 4000a9d4: d0 26 60 b4 st %o0, [ %i1 + 0xb4 ] #endif /* * Allocate the extensions area for this thread */ if ( _Thread_Maximum_extensions ) { 4000a9d8: 03 10 00 7d sethi %hi(0x4001f400), %g1 4000a9dc: d0 00 60 fc ld [ %g1 + 0xfc ], %o0 ! 4001f4fc <_Thread_Maximum_extensions> Stack_Control *the_stack, void *starting_address, size_t size ) { the_stack->area = starting_address; 4000a9e0: f4 26 60 b8 st %i2, [ %i1 + 0xb8 ] Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 4000a9e4: c0 26 60 50 clr [ %i1 + 0x50 ] the_watchdog->routine = routine; 4000a9e8: c0 26 60 64 clr [ %i1 + 0x64 ] the_watchdog->id = id; 4000a9ec: c0 26 60 68 clr [ %i1 + 0x68 ] the_watchdog->user_data = user_data; 4000a9f0: c0 26 60 6c clr [ %i1 + 0x6c ] 4000a9f4: 80 a2 20 00 cmp %o0, 0 4000a9f8: 02 80 00 08 be 4000aa18 <_Thread_Initialize+0xa0> 4000a9fc: b8 10 20 00 clr %i4 extensions_area = _Workspace_Allocate( 4000aa00: 90 02 20 01 inc %o0 4000aa04: 40 00 03 a5 call 4000b898 <_Workspace_Allocate> 4000aa08: 91 2a 20 02 sll %o0, 2, %o0 (_Thread_Maximum_extensions + 1) * sizeof( void * ) ); if ( !extensions_area ) 4000aa0c: b8 92 20 00 orcc %o0, 0, %i4 4000aa10: 02 80 00 40 be 4000ab10 <_Thread_Initialize+0x198> 4000aa14: b6 10 20 00 clr %i3 * if they are linked to the thread. An extension user may * create the extension long after tasks have been created * so they cannot rely on the thread create user extension * call. */ if ( the_thread->extensions ) { 4000aa18: 80 a7 20 00 cmp %i4, 0 4000aa1c: 12 80 00 0a bne 4000aa44 <_Thread_Initialize+0xcc> 4000aa20: f8 26 61 54 st %i4, [ %i1 + 0x154 ] * General initialization */ the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; the_thread->Start.budget_callout = budget_callout; 4000aa24: c2 07 a0 64 ld [ %fp + 0x64 ], %g1 /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; 4000aa28: e4 2e 60 9c stb %l2, [ %i1 + 0x9c ] the_thread->Start.budget_algorithm = budget_algorithm; 4000aa2c: e0 26 60 a0 st %l0, [ %i1 + 0xa0 ] the_thread->Start.budget_callout = budget_callout; switch ( budget_algorithm ) { 4000aa30: 80 a4 20 02 cmp %l0, 2 4000aa34: 12 80 00 12 bne 4000aa7c <_Thread_Initialize+0x104> 4000aa38: c2 26 60 a4 st %g1, [ %i1 + 0xa4 ] case THREAD_CPU_BUDGET_ALGORITHM_NONE: case THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE: break; #if defined(RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE) case THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; 4000aa3c: 10 80 00 0e b 4000aa74 <_Thread_Initialize+0xfc> 4000aa40: 03 10 00 7c sethi %hi(0x4001f000), %g1 * create the extension long after tasks have been created * so they cannot rely on the thread create user extension * call. */ if ( the_thread->extensions ) { for ( i = 0; i <= _Thread_Maximum_extensions ; i++ ) 4000aa44: 03 10 00 7d sethi %hi(0x4001f400), %g1 4000aa48: c4 00 60 fc ld [ %g1 + 0xfc ], %g2 ! 4001f4fc <_Thread_Maximum_extensions> 4000aa4c: 10 80 00 05 b 4000aa60 <_Thread_Initialize+0xe8> 4000aa50: 82 10 20 00 clr %g1 the_thread->extensions[i] = NULL; 4000aa54: 87 28 60 02 sll %g1, 2, %g3 * create the extension long after tasks have been created * so they cannot rely on the thread create user extension * call. */ if ( the_thread->extensions ) { for ( i = 0; i <= _Thread_Maximum_extensions ; i++ ) 4000aa58: 82 00 60 01 inc %g1 the_thread->extensions[i] = NULL; 4000aa5c: c0 21 00 03 clr [ %g4 + %g3 ] * create the extension long after tasks have been created * so they cannot rely on the thread create user extension * call. */ if ( the_thread->extensions ) { for ( i = 0; i <= _Thread_Maximum_extensions ; i++ ) 4000aa60: 80 a0 40 02 cmp %g1, %g2 4000aa64: 28 bf ff fc bleu,a 4000aa54 <_Thread_Initialize+0xdc> 4000aa68: c8 06 61 54 ld [ %i1 + 0x154 ], %g4 * General initialization */ the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; the_thread->Start.budget_callout = budget_callout; 4000aa6c: 10 bf ff ef b 4000aa28 <_Thread_Initialize+0xb0> 4000aa70: c2 07 a0 64 ld [ %fp + 0x64 ], %g1 case THREAD_CPU_BUDGET_ALGORITHM_NONE: case THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE: break; #if defined(RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE) case THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; 4000aa74: c2 00 63 e0 ld [ %g1 + 0x3e0 ], %g1 4000aa78: c2 26 60 74 st %g1, [ %i1 + 0x74 ] case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; 4000aa7c: c2 07 a0 68 ld [ %fp + 0x68 ], %g1 the_thread->current_state = STATES_DORMANT; 4000aa80: b4 10 20 01 mov 1, %i2 case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; 4000aa84: c2 26 60 a8 st %g1, [ %i1 + 0xa8 ] */ RTEMS_INLINE_ROUTINE void* _Scheduler_Allocate( Thread_Control *the_thread ) { return _Scheduler.Operations.allocate( the_thread ); 4000aa88: 03 10 00 79 sethi %hi(0x4001e400), %g1 4000aa8c: c2 00 63 4c ld [ %g1 + 0x34c ], %g1 ! 4001e74c <_Scheduler+0x18> the_thread->current_state = STATES_DORMANT; 4000aa90: f4 26 60 10 st %i2, [ %i1 + 0x10 ] the_thread->Wait.queue = NULL; 4000aa94: c0 26 60 44 clr [ %i1 + 0x44 ] the_thread->resource_count = 0; 4000aa98: c0 26 60 1c clr [ %i1 + 0x1c ] the_thread->real_priority = priority; 4000aa9c: fa 26 60 18 st %i5, [ %i1 + 0x18 ] the_thread->Start.initial_priority = priority; 4000aaa0: fa 26 60 ac st %i5, [ %i1 + 0xac ] 4000aaa4: 9f c0 40 00 call %g1 4000aaa8: 90 10 00 19 mov %i1, %o0 sched =_Scheduler_Allocate( the_thread ); if ( !sched ) 4000aaac: b6 92 20 00 orcc %o0, 0, %i3 4000aab0: 02 80 00 18 be 4000ab10 <_Thread_Initialize+0x198> 4000aab4: 90 10 00 19 mov %i1, %o0 goto failed; _Thread_Set_priority( the_thread, priority ); 4000aab8: 40 00 01 99 call 4000b11c <_Thread_Set_priority> 4000aabc: 92 10 00 1d mov %i5, %o1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4000aac0: c4 06 20 1c ld [ %i0 + 0x1c ], %g2 Objects_Information *information, Objects_Control *the_object, Objects_Name name ) { _Objects_Set_local_object( 4000aac4: c2 16 60 0a lduh [ %i1 + 0xa ], %g1 static inline void _Timestamp64_implementation_Set_to_zero( Timestamp64_Control *_time ) { *_time = 0; 4000aac8: c0 26 60 80 clr [ %i1 + 0x80 ] 4000aacc: c0 26 60 84 clr [ %i1 + 0x84 ] #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4000aad0: 83 28 60 02 sll %g1, 2, %g1 4000aad4: f2 20 80 01 st %i1, [ %g2 + %g1 ] information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 4000aad8: e2 26 60 0c st %l1, [ %i1 + 0xc ] * @{ */ static inline bool _User_extensions_Thread_create( Thread_Control *created ) { User_extensions_Thread_create_context ctx = { created, true }; 4000aadc: f2 27 bf f8 st %i1, [ %fp + -8 ] 4000aae0: f4 2f bf fc stb %i2, [ %fp + -4 ] _User_extensions_Iterate( &ctx, _User_extensions_Thread_create_visitor ); 4000aae4: 90 07 bf f8 add %fp, -8, %o0 4000aae8: 13 10 00 2c sethi %hi(0x4000b000), %o1 4000aaec: 40 00 02 3a call 4000b3d4 <_User_extensions_Iterate> 4000aaf0: 92 12 62 b0 or %o1, 0x2b0, %o1 ! 4000b2b0 <_User_extensions_Thread_create_visitor> * user extensions with dispatching enabled. The Allocator * Mutex provides sufficient protection to let the user extensions * run safely. */ extension_status = _User_extensions_Thread_create( the_thread ); if ( extension_status ) 4000aaf4: c2 0f bf fc ldub [ %fp + -4 ], %g1 4000aaf8: 80 a0 60 00 cmp %g1, 0 4000aafc: 02 80 00 05 be 4000ab10 <_Thread_Initialize+0x198> 4000ab00: b0 10 20 01 mov 1, %i0 4000ab04: b0 0e 20 01 and %i0, 1, %i0 4000ab08: 81 c7 e0 08 ret 4000ab0c: 81 e8 00 00 restore return true; failed: _Workspace_Free( the_thread->libc_reent ); 4000ab10: 40 00 03 6a call 4000b8b8 <_Workspace_Free> 4000ab14: d0 06 61 48 ld [ %i1 + 0x148 ], %o0 for ( i=0 ; i <= THREAD_API_LAST ; i++ ) _Workspace_Free( the_thread->API_Extensions[i] ); 4000ab18: 40 00 03 68 call 4000b8b8 <_Workspace_Free> 4000ab1c: d0 06 61 4c ld [ %i1 + 0x14c ], %o0 4000ab20: 40 00 03 66 call 4000b8b8 <_Workspace_Free> 4000ab24: d0 06 61 50 ld [ %i1 + 0x150 ], %o0 _Workspace_Free( extensions_area ); 4000ab28: 40 00 03 64 call 4000b8b8 <_Workspace_Free> 4000ab2c: 90 10 00 1c mov %i4, %o0 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Workspace_Free( fp_area ); #endif _Workspace_Free( sched ); 4000ab30: 40 00 03 62 call 4000b8b8 <_Workspace_Free> 4000ab34: 90 10 00 1b mov %i3, %o0 _Thread_Stack_Free( the_thread ); 4000ab38: 40 00 01 b1 call 4000b1fc <_Thread_Stack_Free> 4000ab3c: 90 10 00 19 mov %i1, %o0 stack = the_thread->Start.stack; #else if ( !stack_area ) { actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); if ( !actual_stack_size || actual_stack_size < stack_size ) return false; /* stack allocation failed */ 4000ab40: b0 10 20 00 clr %i0 _Workspace_Free( sched ); _Thread_Stack_Free( the_thread ); return false; } 4000ab44: b0 0e 20 01 and %i0, 1, %i0 4000ab48: 81 c7 e0 08 ret 4000ab4c: 81 e8 00 00 restore =============================================================================== 4000b1fc <_Thread_Stack_Free>: #include void _Thread_Stack_Free( Thread_Control *the_thread ) { 4000b1fc: 9d e3 bf a0 save %sp, -96, %sp #if defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API) /* * If the API provided the stack space, then don't free it. */ if ( !the_thread->Start.core_allocated_stack ) 4000b200: c4 0e 20 b0 ldub [ %i0 + 0xb0 ], %g2 void _Thread_Stack_Free( Thread_Control *the_thread ) { rtems_stack_free_hook stack_free_hook = 4000b204: 03 10 00 72 sethi %hi(0x4001c800), %g1 #if defined(RTEMS_SCORE_THREAD_ENABLE_USER_PROVIDED_STACK_VIA_API) /* * If the API provided the stack space, then don't free it. */ if ( !the_thread->Start.core_allocated_stack ) 4000b208: 80 a0 a0 00 cmp %g2, 0 4000b20c: 02 80 00 04 be 4000b21c <_Thread_Stack_Free+0x20> <== NEVER TAKEN 4000b210: c2 00 60 04 ld [ %g1 + 4 ], %g1 * Call ONLY the CPU table stack free hook, or the * the RTEMS workspace free. This is so the free * routine properly matches the allocation of the stack. */ (*stack_free_hook)( the_thread->Start.Initial_stack.area ); 4000b214: 9f c0 40 00 call %g1 4000b218: d0 06 20 b8 ld [ %i0 + 0xb8 ], %o0 4000b21c: 81 c7 e0 08 ret 4000b220: 81 e8 00 00 restore =============================================================================== 4000f978 <_Thread_queue_Extract_fifo>: void _Thread_queue_Extract_fifo( Thread_queue_Control *the_thread_queue __attribute__((unused)), Thread_Control *the_thread ) { 4000f978: 9d e3 bf a0 save %sp, -96, %sp <== NOT EXECUTED ISR_Level level; _ISR_Disable( level ); 4000f97c: 7f ff ca b3 call 40002448 <== NOT EXECUTED 4000f980: 01 00 00 00 nop <== NOT EXECUTED 4000f984: b0 10 00 08 mov %o0, %i0 <== NOT EXECUTED 4000f988: c4 06 60 10 ld [ %i1 + 0x10 ], %g2 <== NOT EXECUTED if ( !_States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 4000f98c: 03 00 00 ef sethi %hi(0x3bc00), %g1 <== NOT EXECUTED 4000f990: 82 10 62 e0 or %g1, 0x2e0, %g1 ! 3bee0 <== NOT EXECUTED 4000f994: 80 88 80 01 btst %g2, %g1 <== NOT EXECUTED 4000f998: 32 80 00 04 bne,a 4000f9a8 <_Thread_queue_Extract_fifo+0x30><== NOT EXECUTED 4000f99c: c2 06 60 04 ld [ %i1 + 4 ], %g1 <== NOT EXECUTED _ISR_Enable( level ); 4000f9a0: 7f ff ca ae call 40002458 <== NOT EXECUTED 4000f9a4: 81 e8 00 00 restore <== NOT EXECUTED ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 4000f9a8: c4 06 40 00 ld [ %i1 ], %g2 <== NOT EXECUTED previous = the_node->previous; next->previous = previous; 4000f9ac: c2 20 a0 04 st %g1, [ %g2 + 4 ] <== NOT EXECUTED previous->next = next; 4000f9b0: c4 20 40 00 st %g2, [ %g1 ] <== NOT EXECUTED _Chain_Extract_unprotected( &the_thread->Object.Node ); the_thread->Wait.queue = NULL; if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 4000f9b4: c2 06 60 50 ld [ %i1 + 0x50 ], %g1 <== NOT EXECUTED 4000f9b8: 80 a0 60 02 cmp %g1, 2 <== NOT EXECUTED 4000f9bc: 02 80 00 06 be 4000f9d4 <_Thread_queue_Extract_fifo+0x5c> <== NOT EXECUTED 4000f9c0: c0 26 60 44 clr [ %i1 + 0x44 ] <== NOT EXECUTED _ISR_Enable( level ); 4000f9c4: 7f ff ca a5 call 40002458 <== NOT EXECUTED 4000f9c8: b0 10 00 19 mov %i1, %i0 <== NOT EXECUTED 4000f9cc: 10 80 00 09 b 4000f9f0 <_Thread_queue_Extract_fifo+0x78> <== NOT EXECUTED 4000f9d0: 33 04 01 ff sethi %hi(0x1007fc00), %i1 <== NOT EXECUTED 4000f9d4: 82 10 20 03 mov 3, %g1 <== NOT EXECUTED 4000f9d8: c2 26 60 50 st %g1, [ %i1 + 0x50 ] <== NOT EXECUTED } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 4000f9dc: 7f ff ca 9f call 40002458 <== NOT EXECUTED 4000f9e0: b0 10 00 19 mov %i1, %i0 <== NOT EXECUTED (void) _Watchdog_Remove( &the_thread->Timer ); 4000f9e4: 7f ff ef 14 call 4000b634 <_Watchdog_Remove> <== NOT EXECUTED 4000f9e8: 90 06 60 48 add %i1, 0x48, %o0 <== NOT EXECUTED 4000f9ec: 33 04 01 ff sethi %hi(0x1007fc00), %i1 <== NOT EXECUTED 4000f9f0: b2 16 63 f8 or %i1, 0x3f8, %i1 ! 1007fff8 <== NOT EXECUTED 4000f9f4: 7f ff ea d3 call 4000a540 <_Thread_Clear_state> <== NOT EXECUTED 4000f9f8: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 4000b068 <_Thread_queue_Requeue>: void _Thread_queue_Requeue( Thread_queue_Control *the_thread_queue, Thread_Control *the_thread ) { 4000b068: 9d e3 bf 98 save %sp, -104, %sp /* * Just in case the thread really wasn't blocked on a thread queue * when we get here. */ if ( !the_thread_queue ) 4000b06c: 80 a6 20 00 cmp %i0, 0 4000b070: 02 80 00 19 be 4000b0d4 <_Thread_queue_Requeue+0x6c> <== NEVER TAKEN 4000b074: 01 00 00 00 nop /* * 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 ) { 4000b078: fa 06 20 34 ld [ %i0 + 0x34 ], %i5 4000b07c: 80 a7 60 01 cmp %i5, 1 4000b080: 12 80 00 15 bne 4000b0d4 <_Thread_queue_Requeue+0x6c> <== NEVER TAKEN 4000b084: 01 00 00 00 nop Thread_queue_Control *tq = the_thread_queue; ISR_Level level; ISR_Level level_ignored; _ISR_Disable( level ); 4000b088: 7f ff dc f0 call 40002448 4000b08c: 01 00 00 00 nop 4000b090: b8 10 00 08 mov %o0, %i4 4000b094: c4 06 60 10 ld [ %i1 + 0x10 ], %g2 if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 4000b098: 03 00 00 ef sethi %hi(0x3bc00), %g1 4000b09c: 82 10 62 e0 or %g1, 0x2e0, %g1 ! 3bee0 4000b0a0: 80 88 80 01 btst %g2, %g1 4000b0a4: 02 80 00 0a be 4000b0cc <_Thread_queue_Requeue+0x64> <== NEVER TAKEN 4000b0a8: 90 10 00 18 mov %i0, %o0 _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( tq, the_thread, true ); 4000b0ac: 92 10 00 19 mov %i1, %o1 4000b0b0: 94 10 20 01 mov 1, %o2 4000b0b4: 40 00 0b db call 4000e020 <_Thread_queue_Extract_priority_helper> 4000b0b8: fa 26 20 30 st %i5, [ %i0 + 0x30 ] (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); 4000b0bc: 90 10 00 18 mov %i0, %o0 4000b0c0: 92 10 00 19 mov %i1, %o1 4000b0c4: 7f ff ff 50 call 4000ae04 <_Thread_queue_Enqueue_priority> 4000b0c8: 94 07 bf fc add %fp, -4, %o2 } _ISR_Enable( level ); 4000b0cc: 7f ff dc e3 call 40002458 4000b0d0: 90 10 00 1c mov %i4, %o0 4000b0d4: 81 c7 e0 08 ret 4000b0d8: 81 e8 00 00 restore =============================================================================== 4000b0dc <_Thread_queue_Timeout>: void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { 4000b0dc: 9d e3 bf 98 save %sp, -104, %sp Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 4000b0e0: 90 10 00 18 mov %i0, %o0 4000b0e4: 7f ff fd f9 call 4000a8c8 <_Thread_Get> 4000b0e8: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 4000b0ec: c2 07 bf fc ld [ %fp + -4 ], %g1 4000b0f0: 80 a0 60 00 cmp %g1, 0 4000b0f4: 12 80 00 08 bne 4000b114 <_Thread_queue_Timeout+0x38> <== NEVER TAKEN 4000b0f8: 01 00 00 00 nop #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 4000b0fc: 40 00 0c 00 call 4000e0fc <_Thread_queue_Process_timeout> 4000b100: 01 00 00 00 nop * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 4000b104: 03 10 00 7d sethi %hi(0x4001f400), %g1 4000b108: c4 00 60 80 ld [ %g1 + 0x80 ], %g2 ! 4001f480 <_Thread_Dispatch_disable_level> --level; 4000b10c: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = level; 4000b110: c4 20 60 80 st %g2, [ %g1 + 0x80 ] 4000b114: 81 c7 e0 08 ret 4000b118: 81 e8 00 00 restore =============================================================================== 40019300 <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 40019300: 9d e3 bf 88 save %sp, -120, %sp static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 40019304: 27 10 00 fa sethi %hi(0x4003e800), %l3 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 40019308: a4 07 bf e8 add %fp, -24, %l2 4001930c: aa 07 bf ec add %fp, -20, %l5 40019310: b8 07 bf f4 add %fp, -12, %i4 40019314: b2 07 bf f8 add %fp, -8, %i1 40019318: ea 27 bf e8 st %l5, [ %fp + -24 ] head->previous = NULL; 4001931c: c0 27 bf ec clr [ %fp + -20 ] tail->previous = head; 40019320: e4 27 bf f0 st %l2, [ %fp + -16 ] ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 40019324: f2 27 bf f4 st %i1, [ %fp + -12 ] head->previous = NULL; 40019328: c0 27 bf f8 clr [ %fp + -8 ] tail->previous = head; 4001932c: f8 27 bf fc st %i4, [ %fp + -4 ] */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 40019330: b4 06 20 30 add %i0, 0x30, %i2 static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 40019334: 29 10 00 f9 sethi %hi(0x4003e400), %l4 /* * 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 ); 40019338: b6 06 20 68 add %i0, 0x68, %i3 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 4001933c: a2 06 20 08 add %i0, 8, %l1 static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 40019340: a0 06 20 40 add %i0, 0x40, %l0 { /* * 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; 40019344: e4 26 20 78 st %l2, [ %i0 + 0x78 ] static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 40019348: c2 04 e0 f8 ld [ %l3 + 0xf8 ], %g1 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 4001934c: d2 06 20 3c ld [ %i0 + 0x3c ], %o1 watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 40019350: 90 10 00 1a mov %i2, %o0 40019354: 92 20 40 09 sub %g1, %o1, %o1 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; watchdogs->last_snapshot = snapshot; 40019358: c2 26 20 3c st %g1, [ %i0 + 0x3c ] _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 4001935c: 40 00 11 79 call 4001d940 <_Watchdog_Adjust_to_chain> 40019360: 94 10 00 1c mov %i4, %o2 40019364: d0 1d 23 58 ldd [ %l4 + 0x358 ], %o0 40019368: 94 10 20 00 clr %o2 4001936c: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 40019370: 40 00 4f 75 call 4002d144 <__divdi3> 40019374: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); Watchdog_Interval last_snapshot = watchdogs->last_snapshot; 40019378: d4 06 20 74 ld [ %i0 + 0x74 ], %o2 /* * 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 ) { 4001937c: 80 a2 40 0a cmp %o1, %o2 40019380: 08 80 00 07 bleu 4001939c <_Timer_server_Body+0x9c> 40019384: ba 10 00 09 mov %o1, %i5 /* * 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 ); 40019388: 92 22 40 0a sub %o1, %o2, %o1 4001938c: 90 10 00 1b mov %i3, %o0 40019390: 40 00 11 6c call 4001d940 <_Watchdog_Adjust_to_chain> 40019394: 94 10 00 1c mov %i4, %o2 40019398: 30 80 00 06 b,a 400193b0 <_Timer_server_Body+0xb0> } else if ( snapshot < last_snapshot ) { 4001939c: 1a 80 00 05 bcc 400193b0 <_Timer_server_Body+0xb0> 400193a0: 90 10 00 1b mov %i3, %o0 /* * 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 ); 400193a4: 92 10 20 01 mov 1, %o1 400193a8: 40 00 11 3e call 4001d8a0 <_Watchdog_Adjust> 400193ac: 94 22 80 1d sub %o2, %i5, %o2 } watchdogs->last_snapshot = snapshot; 400193b0: fa 26 20 74 st %i5, [ %i0 + 0x74 ] } static void _Timer_server_Process_insertions( Timer_server_Control *ts ) { while ( true ) { Timer_Control *timer = (Timer_Control *) _Chain_Get( ts->insert_chain ); 400193b4: d0 06 20 78 ld [ %i0 + 0x78 ], %o0 400193b8: 40 00 02 f4 call 40019f88 <_Chain_Get> 400193bc: 01 00 00 00 nop if ( timer == NULL ) { 400193c0: 92 92 20 00 orcc %o0, 0, %o1 400193c4: 02 80 00 0c be 400193f4 <_Timer_server_Body+0xf4> 400193c8: 01 00 00 00 nop static void _Timer_server_Insert_timer( Timer_server_Control *ts, Timer_Control *timer ) { if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 400193cc: c2 02 60 38 ld [ %o1 + 0x38 ], %g1 400193d0: 80 a0 60 01 cmp %g1, 1 400193d4: 02 80 00 05 be 400193e8 <_Timer_server_Body+0xe8> 400193d8: 90 10 00 1a mov %i2, %o0 _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 400193dc: 80 a0 60 03 cmp %g1, 3 400193e0: 12 bf ff f5 bne 400193b4 <_Timer_server_Body+0xb4> <== NEVER TAKEN 400193e4: 90 10 00 1b mov %i3, %o0 _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 400193e8: 40 00 11 80 call 4001d9e8 <_Watchdog_Insert> 400193ec: 92 02 60 10 add %o1, 0x10, %o1 400193f0: 30 bf ff f1 b,a 400193b4 <_Timer_server_Body+0xb4> * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); 400193f4: 7f ff dc 70 call 400105b4 400193f8: 01 00 00 00 nop if ( _Chain_Is_empty( insert_chain ) ) { 400193fc: c2 07 bf e8 ld [ %fp + -24 ], %g1 40019400: 80 a0 40 15 cmp %g1, %l5 40019404: 12 80 00 0a bne 4001942c <_Timer_server_Body+0x12c> <== NEVER TAKEN 40019408: 01 00 00 00 nop ts->insert_chain = NULL; 4001940c: c0 26 20 78 clr [ %i0 + 0x78 ] _ISR_Enable( level ); 40019410: 7f ff dc 6d call 400105c4 40019414: 01 00 00 00 nop _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 ) ) { 40019418: c2 07 bf f4 ld [ %fp + -12 ], %g1 4001941c: 80 a0 40 19 cmp %g1, %i1 40019420: 12 80 00 06 bne 40019438 <_Timer_server_Body+0x138> 40019424: 01 00 00 00 nop 40019428: 30 80 00 18 b,a 40019488 <_Timer_server_Body+0x188> ts->insert_chain = NULL; _ISR_Enable( level ); break; } else { _ISR_Enable( level ); 4001942c: 7f ff dc 66 call 400105c4 <== NOT EXECUTED 40019430: 01 00 00 00 nop <== NOT EXECUTED 40019434: 30 bf ff c5 b,a 40019348 <_Timer_server_Body+0x48> <== 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 ); 40019438: 7f ff dc 5f call 400105b4 4001943c: 01 00 00 00 nop */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 40019440: fa 07 bf f4 ld [ %fp + -12 ], %i5 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 40019444: 80 a7 40 19 cmp %i5, %i1 40019448: 02 80 00 0d be 4001947c <_Timer_server_Body+0x17c> 4001944c: 01 00 00 00 nop Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; 40019450: c2 07 40 00 ld [ %i5 ], %g1 head->next = new_first; new_first->previous = head; 40019454: f8 20 60 04 st %i4, [ %g1 + 4 ] { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; head->next = new_first; 40019458: c2 27 bf f4 st %g1, [ %fp + -12 ] watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; 4001945c: c0 27 60 08 clr [ %i5 + 8 ] _ISR_Enable( level ); 40019460: 7f ff dc 59 call 400105c4 40019464: 01 00 00 00 nop /* * 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 ); 40019468: c2 07 60 1c ld [ %i5 + 0x1c ], %g1 4001946c: d0 07 60 20 ld [ %i5 + 0x20 ], %o0 40019470: 9f c0 40 00 call %g1 40019474: d2 07 60 24 ld [ %i5 + 0x24 ], %o1 } 40019478: 30 bf ff f0 b,a 40019438 <_Timer_server_Body+0x138> watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; _ISR_Enable( level ); } else { _ISR_Enable( level ); 4001947c: 7f ff dc 52 call 400105c4 40019480: 01 00 00 00 nop 40019484: 30 bf ff b0 b,a 40019344 <_Timer_server_Body+0x44> * the active flag of the timer server is true. */ (*watchdog->routine)( watchdog->id, watchdog->user_data ); } } else { ts->active = false; 40019488: c0 2e 20 7c clrb [ %i0 + 0x7c ] * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 4001948c: 03 10 00 fa sethi %hi(0x4003e800), %g1 40019490: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 ! 4003e810 <_Thread_Dispatch_disable_level> ++level; 40019494: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 40019498: c4 20 60 10 st %g2, [ %g1 + 0x10 ] /* * Block until there is something to do. */ _Thread_Disable_dispatch(); _Thread_Set_state( ts->thread, STATES_DELAYING ); 4001949c: d0 06 00 00 ld [ %i0 ], %o0 400194a0: 40 00 10 1a call 4001d508 <_Thread_Set_state> 400194a4: 92 10 20 08 mov 8, %o1 _Timer_server_Reset_interval_system_watchdog( ts ); 400194a8: 7f ff ff 6e call 40019260 <_Timer_server_Reset_interval_system_watchdog> 400194ac: 90 10 00 18 mov %i0, %o0 _Timer_server_Reset_tod_system_watchdog( ts ); 400194b0: 7f ff ff 80 call 400192b0 <_Timer_server_Reset_tod_system_watchdog> 400194b4: 90 10 00 18 mov %i0, %o0 _Thread_Enable_dispatch(); 400194b8: 40 00 0d ce call 4001cbf0 <_Thread_Enable_dispatch> 400194bc: 01 00 00 00 nop ts->active = true; 400194c0: 82 10 20 01 mov 1, %g1 ! 1 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 400194c4: 90 10 00 11 mov %l1, %o0 _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; 400194c8: c2 2e 20 7c stb %g1, [ %i0 + 0x7c ] static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 400194cc: 40 00 11 9f call 4001db48 <_Watchdog_Remove> 400194d0: 01 00 00 00 nop static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 400194d4: 40 00 11 9d call 4001db48 <_Watchdog_Remove> 400194d8: 90 10 00 10 mov %l0, %o0 400194dc: 30 bf ff 9a b,a 40019344 <_Timer_server_Body+0x44> =============================================================================== 400194e0 <_Timer_server_Schedule_operation_method>: static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 400194e0: 9d e3 bf a0 save %sp, -96, %sp if ( ts->insert_chain == NULL ) { 400194e4: c2 06 20 78 ld [ %i0 + 0x78 ], %g1 400194e8: 80 a0 60 00 cmp %g1, 0 400194ec: 12 80 00 51 bne 40019630 <_Timer_server_Schedule_operation_method+0x150> 400194f0: ba 10 00 19 mov %i1, %i5 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 400194f4: 03 10 00 fa sethi %hi(0x4003e800), %g1 400194f8: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 ! 4003e810 <_Thread_Dispatch_disable_level> ++level; 400194fc: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 40019500: c4 20 60 10 st %g2, [ %g1 + 0x10 ] * being inserted. This could result in an integer overflow. */ _Thread_Disable_dispatch(); if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 40019504: c2 06 60 38 ld [ %i1 + 0x38 ], %g1 40019508: 80 a0 60 01 cmp %g1, 1 4001950c: 12 80 00 1f bne 40019588 <_Timer_server_Schedule_operation_method+0xa8> 40019510: 80 a0 60 03 cmp %g1, 3 /* * We have to advance the last known ticks value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 40019514: 7f ff dc 28 call 400105b4 40019518: 01 00 00 00 nop snapshot = _Watchdog_Ticks_since_boot; 4001951c: 03 10 00 fa sethi %hi(0x4003e800), %g1 40019520: c4 00 60 f8 ld [ %g1 + 0xf8 ], %g2 ! 4003e8f8 <_Watchdog_Ticks_since_boot> */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 40019524: c2 06 20 30 ld [ %i0 + 0x30 ], %g1 last_snapshot = ts->Interval_watchdogs.last_snapshot; 40019528: c8 06 20 3c ld [ %i0 + 0x3c ], %g4 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 4001952c: 86 06 20 34 add %i0, 0x34, %g3 if ( !_Chain_Is_empty( &ts->Interval_watchdogs.Chain ) ) { 40019530: 80 a0 40 03 cmp %g1, %g3 40019534: 02 80 00 08 be 40019554 <_Timer_server_Schedule_operation_method+0x74> 40019538: 88 20 80 04 sub %g2, %g4, %g4 /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; delta_interval = first_watchdog->delta_interval; 4001953c: f8 00 60 10 ld [ %g1 + 0x10 ], %i4 if (delta_interval > delta) { 40019540: 80 a7 00 04 cmp %i4, %g4 40019544: 08 80 00 03 bleu 40019550 <_Timer_server_Schedule_operation_method+0x70> 40019548: 86 10 20 00 clr %g3 delta_interval -= delta; 4001954c: 86 27 00 04 sub %i4, %g4, %g3 } else { delta_interval = 0; } first_watchdog->delta_interval = delta_interval; 40019550: c6 20 60 10 st %g3, [ %g1 + 0x10 ] } ts->Interval_watchdogs.last_snapshot = snapshot; 40019554: c4 26 20 3c st %g2, [ %i0 + 0x3c ] _ISR_Enable( level ); 40019558: 7f ff dc 1b call 400105c4 4001955c: 01 00 00 00 nop _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 40019560: 90 06 20 30 add %i0, 0x30, %o0 40019564: 40 00 11 21 call 4001d9e8 <_Watchdog_Insert> 40019568: 92 07 60 10 add %i5, 0x10, %o1 if ( !ts->active ) { 4001956c: c2 0e 20 7c ldub [ %i0 + 0x7c ], %g1 40019570: 80 a0 60 00 cmp %g1, 0 40019574: 12 80 00 2d bne 40019628 <_Timer_server_Schedule_operation_method+0x148> 40019578: 01 00 00 00 nop _Timer_server_Reset_interval_system_watchdog( ts ); 4001957c: 7f ff ff 39 call 40019260 <_Timer_server_Reset_interval_system_watchdog> 40019580: 90 10 00 18 mov %i0, %o0 40019584: 30 80 00 29 b,a 40019628 <_Timer_server_Schedule_operation_method+0x148> } } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 40019588: 12 80 00 28 bne 40019628 <_Timer_server_Schedule_operation_method+0x148> 4001958c: 01 00 00 00 nop /* * We have to advance the last known seconds value of the server and update * the watchdog chain accordingly. */ _ISR_Disable( level ); 40019590: 7f ff dc 09 call 400105b4 40019594: 01 00 00 00 nop 40019598: b8 10 00 08 mov %o0, %i4 4001959c: 03 10 00 f9 sethi %hi(0x4003e400), %g1 400195a0: d0 18 63 58 ldd [ %g1 + 0x358 ], %o0 ! 4003e758 <_TOD> 400195a4: 94 10 20 00 clr %o2 400195a8: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 400195ac: 40 00 4e e6 call 4002d144 <__divdi3> 400195b0: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 400195b4: c2 06 20 68 ld [ %i0 + 0x68 ], %g1 snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); last_snapshot = ts->TOD_watchdogs.last_snapshot; 400195b8: c4 06 20 74 ld [ %i0 + 0x74 ], %g2 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 400195bc: 86 06 20 6c add %i0, 0x6c, %g3 if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { 400195c0: 80 a0 40 03 cmp %g1, %g3 400195c4: 02 80 00 0d be 400195f8 <_Timer_server_Schedule_operation_method+0x118> 400195c8: 80 a2 40 02 cmp %o1, %g2 first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; if ( snapshot > last_snapshot ) { 400195cc: 08 80 00 08 bleu 400195ec <_Timer_server_Schedule_operation_method+0x10c> 400195d0: c6 00 60 10 ld [ %g1 + 0x10 ], %g3 /* * We advanced in time. */ delta = snapshot - last_snapshot; 400195d4: 88 22 40 02 sub %o1, %g2, %g4 if (delta_interval > delta) { 400195d8: 80 a0 c0 04 cmp %g3, %g4 400195dc: 08 80 00 06 bleu 400195f4 <_Timer_server_Schedule_operation_method+0x114><== NEVER TAKEN 400195e0: 84 10 20 00 clr %g2 delta_interval -= delta; 400195e4: 10 80 00 04 b 400195f4 <_Timer_server_Schedule_operation_method+0x114> 400195e8: 84 20 c0 04 sub %g3, %g4, %g2 } } else { /* * Someone put us in the past. */ delta = last_snapshot - snapshot; 400195ec: 84 00 c0 02 add %g3, %g2, %g2 delta_interval += delta; 400195f0: 84 20 80 09 sub %g2, %o1, %g2 } first_watchdog->delta_interval = delta_interval; 400195f4: c4 20 60 10 st %g2, [ %g1 + 0x10 ] } ts->TOD_watchdogs.last_snapshot = snapshot; 400195f8: d2 26 20 74 st %o1, [ %i0 + 0x74 ] _ISR_Enable( level ); 400195fc: 7f ff db f2 call 400105c4 40019600: 90 10 00 1c mov %i4, %o0 _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 40019604: 90 06 20 68 add %i0, 0x68, %o0 40019608: 40 00 10 f8 call 4001d9e8 <_Watchdog_Insert> 4001960c: 92 07 60 10 add %i5, 0x10, %o1 if ( !ts->active ) { 40019610: c2 0e 20 7c ldub [ %i0 + 0x7c ], %g1 40019614: 80 a0 60 00 cmp %g1, 0 40019618: 12 80 00 04 bne 40019628 <_Timer_server_Schedule_operation_method+0x148> 4001961c: 01 00 00 00 nop _Timer_server_Reset_tod_system_watchdog( ts ); 40019620: 7f ff ff 24 call 400192b0 <_Timer_server_Reset_tod_system_watchdog> 40019624: 90 10 00 18 mov %i0, %o0 } } _Thread_Enable_dispatch(); 40019628: 40 00 0d 72 call 4001cbf0 <_Thread_Enable_dispatch> 4001962c: 81 e8 00 00 restore * 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 ); 40019630: f0 06 20 78 ld [ %i0 + 0x78 ], %i0 40019634: 40 00 02 49 call 40019f58 <_Chain_Append> 40019638: 81 e8 00 00 restore =============================================================================== 4000cba4 <_Timestamp64_Divide>: const Timestamp64_Control *_lhs, const Timestamp64_Control *_rhs, uint32_t *_ival_percentage, uint32_t *_fval_percentage ) { 4000cba4: 9d e3 bf a0 save %sp, -96, %sp Timestamp64_Control answer; if ( *_rhs == 0 ) { 4000cba8: d4 1e 40 00 ldd [ %i1 ], %o2 4000cbac: 80 92 80 0b orcc %o2, %o3, %g0 4000cbb0: 32 80 00 06 bne,a 4000cbc8 <_Timestamp64_Divide+0x24> <== ALWAYS TAKEN 4000cbb4: d8 1e 00 00 ldd [ %i0 ], %o4 *_ival_percentage = 0; 4000cbb8: c0 26 80 00 clr [ %i2 ] <== NOT EXECUTED *_fval_percentage = 0; 4000cbbc: c0 26 c0 00 clr [ %i3 ] <== NOT EXECUTED return; 4000cbc0: 81 c7 e0 08 ret <== NOT EXECUTED 4000cbc4: 81 e8 00 00 restore <== NOT EXECUTED * This looks odd but gives the results the proper precision. * * TODO: Rounding on the last digit of the fval. */ answer = (*_lhs * 100000) / *_rhs; 4000cbc8: 83 2b 20 02 sll %o4, 2, %g1 4000cbcc: 87 2b 60 02 sll %o5, 2, %g3 4000cbd0: 89 33 60 1e srl %o5, 0x1e, %g4 4000cbd4: bb 28 e0 05 sll %g3, 5, %i5 4000cbd8: 84 11 00 01 or %g4, %g1, %g2 4000cbdc: 83 30 e0 1b srl %g3, 0x1b, %g1 4000cbe0: b9 28 a0 05 sll %g2, 5, %i4 4000cbe4: 86 a7 40 03 subcc %i5, %g3, %g3 4000cbe8: b8 10 40 1c or %g1, %i4, %i4 4000cbec: 84 67 00 02 subx %i4, %g2, %g2 4000cbf0: b2 80 c0 0d addcc %g3, %o5, %i1 4000cbf4: b0 40 80 0c addx %g2, %o4, %i0 4000cbf8: 83 36 60 1e srl %i1, 0x1e, %g1 4000cbfc: 87 2e 60 02 sll %i1, 2, %g3 4000cc00: 85 2e 20 02 sll %i0, 2, %g2 4000cc04: 84 10 40 02 or %g1, %g2, %g2 4000cc08: ba 86 40 03 addcc %i1, %g3, %i5 4000cc0c: b8 46 00 02 addx %i0, %g2, %i4 4000cc10: 83 37 60 1e srl %i5, 0x1e, %g1 4000cc14: 87 2f 60 02 sll %i5, 2, %g3 4000cc18: 85 2f 20 02 sll %i4, 2, %g2 4000cc1c: 84 10 40 02 or %g1, %g2, %g2 4000cc20: 92 87 40 03 addcc %i5, %g3, %o1 4000cc24: 90 47 00 02 addx %i4, %g2, %o0 4000cc28: 87 32 60 1b srl %o1, 0x1b, %g3 4000cc2c: 85 2a 20 05 sll %o0, 5, %g2 4000cc30: 83 2a 60 05 sll %o1, 5, %g1 4000cc34: 90 10 c0 02 or %g3, %g2, %o0 4000cc38: 40 00 39 e6 call 4001b3d0 <__divdi3> 4000cc3c: 92 10 00 01 mov %g1, %o1 *_ival_percentage = answer / 1000; 4000cc40: 94 10 20 00 clr %o2 * This looks odd but gives the results the proper precision. * * TODO: Rounding on the last digit of the fval. */ answer = (*_lhs * 100000) / *_rhs; 4000cc44: b8 10 00 08 mov %o0, %i4 4000cc48: ba 10 00 09 mov %o1, %i5 *_ival_percentage = answer / 1000; 4000cc4c: 40 00 39 e1 call 4001b3d0 <__divdi3> 4000cc50: 96 10 23 e8 mov 0x3e8, %o3 *_fval_percentage = answer % 1000; 4000cc54: 90 10 00 1c mov %i4, %o0 * TODO: Rounding on the last digit of the fval. */ answer = (*_lhs * 100000) / *_rhs; *_ival_percentage = answer / 1000; 4000cc58: d2 26 80 00 st %o1, [ %i2 ] *_fval_percentage = answer % 1000; 4000cc5c: 94 10 20 00 clr %o2 4000cc60: 92 10 00 1d mov %i5, %o1 4000cc64: 40 00 3a c6 call 4001b77c <__moddi3> 4000cc68: 96 10 23 e8 mov 0x3e8, %o3 4000cc6c: d2 26 c0 00 st %o1, [ %i3 ] 4000cc70: 81 c7 e0 08 ret 4000cc74: 81 e8 00 00 restore =============================================================================== 4000b494 <_User_extensions_Handler_initialization>: } } void _User_extensions_Handler_initialization(void) { 4000b494: 9d e3 bf 98 save %sp, -104, %sp uint32_t number_of_initial_extensions = 4000b498: 03 10 00 72 sethi %hi(0x4001c800), %g1 4000b49c: c2 00 60 18 ld [ %g1 + 0x18 ], %g1 ! 4001c818 rtems_configuration_get_number_of_initial_extensions(); if ( number_of_initial_extensions > 0 ) { 4000b4a0: 80 a0 60 00 cmp %g1, 0 4000b4a4: 02 80 00 0a be 4000b4cc <_User_extensions_Handler_initialization+0x38><== NEVER TAKEN 4000b4a8: 91 28 60 02 sll %g1, 2, %o0 User_extensions_Switch_control *initial_extension_switch_controls = _Workspace_Allocate_or_fatal_error( number_of_initial_extensions * sizeof( *initial_extension_switch_controls ) 4000b4ac: 83 28 60 04 sll %g1, 4, %g1 { uint32_t number_of_initial_extensions = rtems_configuration_get_number_of_initial_extensions(); if ( number_of_initial_extensions > 0 ) { User_extensions_Switch_control *initial_extension_switch_controls = 4000b4b0: 40 00 01 08 call 4000b8d0 <_Workspace_Allocate_or_fatal_error> 4000b4b4: 90 20 40 08 sub %g1, %o0, %o0 number_of_initial_extensions * sizeof( *initial_extension_switch_controls ) ); User_extensions_Switch_context ctx = { initial_extension_switch_controls }; _User_extensions_Iterate( &ctx, _User_extensions_Switch_visitor ); 4000b4b8: 13 10 00 2d sethi %hi(0x4000b400), %o1 User_extensions_Switch_control *initial_extension_switch_controls = _Workspace_Allocate_or_fatal_error( number_of_initial_extensions * sizeof( *initial_extension_switch_controls ) ); User_extensions_Switch_context ctx = { initial_extension_switch_controls }; 4000b4bc: d0 27 bf fc st %o0, [ %fp + -4 ] _User_extensions_Iterate( &ctx, _User_extensions_Switch_visitor ); 4000b4c0: 92 12 60 50 or %o1, 0x50, %o1 4000b4c4: 7f ff ff c4 call 4000b3d4 <_User_extensions_Iterate> 4000b4c8: 90 07 bf fc add %fp, -4, %o0 4000b4cc: 81 c7 e0 08 ret 4000b4d0: 81 e8 00 00 restore =============================================================================== 4000cedc <_Watchdog_Adjust>: void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 4000cedc: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; _ISR_Disable( level ); 4000cee0: 7f ff d8 ec call 40003290 4000cee4: 01 00 00 00 nop */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 4000cee8: c2 06 00 00 ld [ %i0 ], %g1 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 4000ceec: b8 06 20 04 add %i0, 4, %i4 * hence the compiler must not assume *header to remain * unmodified across that call. * * Till Straumann, 7/2003 */ if ( !_Chain_Is_empty( header ) ) { 4000cef0: 80 a0 40 1c cmp %g1, %i4 4000cef4: 02 80 00 20 be 4000cf74 <_Watchdog_Adjust+0x98> 4000cef8: 80 a6 60 00 cmp %i1, 0 switch ( direction ) { 4000cefc: 02 80 00 1b be 4000cf68 <_Watchdog_Adjust+0x8c> 4000cf00: b6 10 20 01 mov 1, %i3 4000cf04: 80 a6 60 01 cmp %i1, 1 4000cf08: 12 80 00 1b bne 4000cf74 <_Watchdog_Adjust+0x98> <== NEVER TAKEN 4000cf0c: 01 00 00 00 nop case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; 4000cf10: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 4000cf14: 10 80 00 07 b 4000cf30 <_Watchdog_Adjust+0x54> 4000cf18: b4 00 80 1a add %g2, %i2, %i2 break; case WATCHDOG_FORWARD: while ( units ) { if ( units < _Watchdog_First( header )->delta_interval ) { 4000cf1c: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 4000cf20: 80 a6 80 02 cmp %i2, %g2 4000cf24: 3a 80 00 05 bcc,a 4000cf38 <_Watchdog_Adjust+0x5c> 4000cf28: f6 20 60 10 st %i3, [ %g1 + 0x10 ] _Watchdog_First( header )->delta_interval -= units; 4000cf2c: b4 20 80 1a sub %g2, %i2, %i2 break; 4000cf30: 10 80 00 11 b 4000cf74 <_Watchdog_Adjust+0x98> 4000cf34: f4 20 60 10 st %i2, [ %g1 + 0x10 ] } else { units -= _Watchdog_First( header )->delta_interval; 4000cf38: b4 26 80 02 sub %i2, %g2, %i2 _Watchdog_First( header )->delta_interval = 1; _ISR_Enable( level ); 4000cf3c: 7f ff d8 d9 call 400032a0 4000cf40: 01 00 00 00 nop _Watchdog_Tickle( header ); 4000cf44: 40 00 00 90 call 4000d184 <_Watchdog_Tickle> 4000cf48: 90 10 00 18 mov %i0, %o0 _ISR_Disable( level ); 4000cf4c: 7f ff d8 d1 call 40003290 4000cf50: 01 00 00 00 nop if ( _Chain_Is_empty( header ) ) 4000cf54: c2 06 00 00 ld [ %i0 ], %g1 4000cf58: 80 a0 40 1c cmp %g1, %i4 4000cf5c: 12 80 00 04 bne 4000cf6c <_Watchdog_Adjust+0x90> 4000cf60: 80 a6 a0 00 cmp %i2, 0 4000cf64: 30 80 00 04 b,a 4000cf74 <_Watchdog_Adjust+0x98> switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 4000cf68: 80 a6 a0 00 cmp %i2, 0 4000cf6c: 32 bf ff ec bne,a 4000cf1c <_Watchdog_Adjust+0x40> <== ALWAYS TAKEN 4000cf70: c2 06 00 00 ld [ %i0 ], %g1 } break; } } _ISR_Enable( level ); 4000cf74: 7f ff d8 cb call 400032a0 4000cf78: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 4000b634 <_Watchdog_Remove>: #include Watchdog_States _Watchdog_Remove( Watchdog_Control *the_watchdog ) { 4000b634: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 4000b638: 7f ff db 84 call 40002448 4000b63c: ba 10 00 18 mov %i0, %i5 previous_state = the_watchdog->state; 4000b640: f0 06 20 08 ld [ %i0 + 8 ], %i0 switch ( previous_state ) { 4000b644: 80 a6 20 01 cmp %i0, 1 4000b648: 22 80 00 1e be,a 4000b6c0 <_Watchdog_Remove+0x8c> 4000b64c: c0 27 60 08 clr [ %i5 + 8 ] 4000b650: 0a 80 00 1d bcs 4000b6c4 <_Watchdog_Remove+0x90> 4000b654: 03 10 00 7d sethi %hi(0x4001f400), %g1 4000b658: 80 a6 20 03 cmp %i0, 3 4000b65c: 18 80 00 1a bgu 4000b6c4 <_Watchdog_Remove+0x90> <== NEVER TAKEN 4000b660: 01 00 00 00 nop RTEMS_INLINE_ROUTINE Watchdog_Control *_Watchdog_Next( Watchdog_Control *the_watchdog ) { return ( (Watchdog_Control *) the_watchdog->Node.next ); 4000b664: 10 80 00 02 b 4000b66c <_Watchdog_Remove+0x38> 4000b668: c2 07 40 00 ld [ %i5 ], %g1 break; case WATCHDOG_ACTIVE: case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; 4000b66c: c0 27 60 08 clr [ %i5 + 8 ] next_watchdog = _Watchdog_Next( the_watchdog ); if ( _Watchdog_Next(next_watchdog) ) 4000b670: c4 00 40 00 ld [ %g1 ], %g2 4000b674: 80 a0 a0 00 cmp %g2, 0 4000b678: 02 80 00 07 be 4000b694 <_Watchdog_Remove+0x60> 4000b67c: 05 10 00 7d sethi %hi(0x4001f400), %g2 next_watchdog->delta_interval += the_watchdog->delta_interval; 4000b680: c6 00 60 10 ld [ %g1 + 0x10 ], %g3 4000b684: c4 07 60 10 ld [ %i5 + 0x10 ], %g2 4000b688: 84 00 c0 02 add %g3, %g2, %g2 4000b68c: c4 20 60 10 st %g2, [ %g1 + 0x10 ] if ( _Watchdog_Sync_count ) 4000b690: 05 10 00 7d sethi %hi(0x4001f400), %g2 4000b694: c4 00 a1 64 ld [ %g2 + 0x164 ], %g2 ! 4001f564 <_Watchdog_Sync_count> 4000b698: 80 a0 a0 00 cmp %g2, 0 4000b69c: 22 80 00 07 be,a 4000b6b8 <_Watchdog_Remove+0x84> 4000b6a0: c4 07 60 04 ld [ %i5 + 4 ], %g2 _Watchdog_Sync_level = _ISR_Nest_level; 4000b6a4: 05 10 00 7e sethi %hi(0x4001f800), %g2 4000b6a8: c6 00 a1 98 ld [ %g2 + 0x198 ], %g3 ! 4001f998 <_Per_CPU_Information+0x8> 4000b6ac: 05 10 00 7d sethi %hi(0x4001f400), %g2 4000b6b0: c6 20 a1 04 st %g3, [ %g2 + 0x104 ] ! 4001f504 <_Watchdog_Sync_level> { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 4000b6b4: c4 07 60 04 ld [ %i5 + 4 ], %g2 next->previous = previous; 4000b6b8: c4 20 60 04 st %g2, [ %g1 + 4 ] previous->next = next; 4000b6bc: c2 20 80 00 st %g1, [ %g2 ] _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 4000b6c0: 03 10 00 7d sethi %hi(0x4001f400), %g1 4000b6c4: c2 00 61 68 ld [ %g1 + 0x168 ], %g1 ! 4001f568 <_Watchdog_Ticks_since_boot> 4000b6c8: c2 27 60 18 st %g1, [ %i5 + 0x18 ] _ISR_Enable( level ); 4000b6cc: 7f ff db 63 call 40002458 4000b6d0: 01 00 00 00 nop return( previous_state ); } 4000b6d4: 81 c7 e0 08 ret 4000b6d8: 81 e8 00 00 restore =============================================================================== 4000c888 <_Watchdog_Report_chain>: void _Watchdog_Report_chain( const char *name, Chain_Control *header ) { 4000c888: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; Chain_Node *node; _ISR_Disable( level ); 4000c88c: 7f ff d9 5e call 40002e04 4000c890: b8 10 00 18 mov %i0, %i4 4000c894: b0 10 00 08 mov %o0, %i0 printk( "Watchdog Chain: %s %p\n", name, header ); 4000c898: 11 10 00 7c sethi %hi(0x4001f000), %o0 4000c89c: 94 10 00 19 mov %i1, %o2 4000c8a0: 90 12 23 d8 or %o0, 0x3d8, %o0 4000c8a4: 7f ff e3 dd call 40005818 4000c8a8: 92 10 00 1c mov %i4, %o1 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 4000c8ac: fa 06 40 00 ld [ %i1 ], %i5 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 4000c8b0: b2 06 60 04 add %i1, 4, %i1 if ( !_Chain_Is_empty( header ) ) { 4000c8b4: 80 a7 40 19 cmp %i5, %i1 4000c8b8: 12 80 00 04 bne 4000c8c8 <_Watchdog_Report_chain+0x40> 4000c8bc: 92 10 00 1d mov %i5, %o1 _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); } else { printk( "Chain is empty\n" ); 4000c8c0: 10 80 00 0d b 4000c8f4 <_Watchdog_Report_chain+0x6c> 4000c8c4: 11 10 00 7d sethi %hi(0x4001f400), %o0 node != _Chain_Tail(header) ; node = node->next ) { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); 4000c8c8: 40 00 00 0f call 4000c904 <_Watchdog_Report> 4000c8cc: 90 10 20 00 clr %o0 _ISR_Disable( level ); printk( "Watchdog Chain: %s %p\n", name, header ); if ( !_Chain_Is_empty( header ) ) { for ( node = _Chain_First( header ) ; node != _Chain_Tail(header) ; node = node->next ) 4000c8d0: fa 07 40 00 ld [ %i5 ], %i5 Chain_Node *node; _ISR_Disable( level ); printk( "Watchdog Chain: %s %p\n", name, header ); if ( !_Chain_Is_empty( header ) ) { for ( node = _Chain_First( header ) ; 4000c8d4: 80 a7 40 19 cmp %i5, %i1 4000c8d8: 12 bf ff fc bne 4000c8c8 <_Watchdog_Report_chain+0x40> <== NEVER TAKEN 4000c8dc: 92 10 00 1d mov %i5, %o1 { Watchdog_Control *watch = (Watchdog_Control *) node; _Watchdog_Report( NULL, watch ); } printk( "== end of %s \n", name ); 4000c8e0: 11 10 00 7c sethi %hi(0x4001f000), %o0 4000c8e4: 92 10 00 1c mov %i4, %o1 4000c8e8: 7f ff e3 cc call 40005818 4000c8ec: 90 12 23 f0 or %o0, 0x3f0, %o0 4000c8f0: 30 80 00 03 b,a 4000c8fc <_Watchdog_Report_chain+0x74> } else { printk( "Chain is empty\n" ); 4000c8f4: 7f ff e3 c9 call 40005818 4000c8f8: 90 12 20 00 mov %o0, %o0 } _ISR_Enable( level ); 4000c8fc: 7f ff d9 46 call 40002e14 4000c900: 81 e8 00 00 restore =============================================================================== 4000b6dc <_Watchdog_Tickle>: #include void _Watchdog_Tickle( Chain_Control *header ) { 4000b6dc: 9d e3 bf a0 save %sp, -96, %sp * 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 ); 4000b6e0: 7f ff db 5a call 40002448 4000b6e4: b8 10 00 18 mov %i0, %i4 4000b6e8: b0 10 00 08 mov %o0, %i0 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 4000b6ec: fa 07 00 00 ld [ %i4 ], %i5 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 4000b6f0: b6 07 20 04 add %i4, 4, %i3 if ( _Chain_Is_empty( header ) ) 4000b6f4: 80 a7 40 1b cmp %i5, %i3 4000b6f8: 02 80 00 1f be 4000b774 <_Watchdog_Tickle+0x98> 4000b6fc: 01 00 00 00 nop * 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) { 4000b700: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 4000b704: 80 a0 60 00 cmp %g1, 0 4000b708: 02 80 00 06 be 4000b720 <_Watchdog_Tickle+0x44> <== NEVER TAKEN 4000b70c: 82 00 7f ff add %g1, -1, %g1 the_watchdog->delta_interval--; 4000b710: c2 27 60 10 st %g1, [ %i5 + 0x10 ] if ( the_watchdog->delta_interval != 0 ) 4000b714: 80 a0 60 00 cmp %g1, 0 4000b718: 12 80 00 17 bne 4000b774 <_Watchdog_Tickle+0x98> 4000b71c: 01 00 00 00 nop goto leave; } do { watchdog_state = _Watchdog_Remove( the_watchdog ); 4000b720: 7f ff ff c5 call 4000b634 <_Watchdog_Remove> 4000b724: 90 10 00 1d mov %i5, %o0 4000b728: b4 10 00 08 mov %o0, %i2 _ISR_Enable( level ); 4000b72c: 7f ff db 4b call 40002458 4000b730: 90 10 00 18 mov %i0, %o0 switch( watchdog_state ) { 4000b734: 80 a6 a0 02 cmp %i2, 2 4000b738: 12 80 00 06 bne 4000b750 <_Watchdog_Tickle+0x74> 4000b73c: 01 00 00 00 nop case WATCHDOG_ACTIVE: (*the_watchdog->routine)( 4000b740: c2 07 60 1c ld [ %i5 + 0x1c ], %g1 4000b744: d0 07 60 20 ld [ %i5 + 0x20 ], %o0 4000b748: 9f c0 40 00 call %g1 4000b74c: d2 07 60 24 ld [ %i5 + 0x24 ], %o1 case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 4000b750: 7f ff db 3e call 40002448 4000b754: 01 00 00 00 nop 4000b758: b0 10 00 08 mov %o0, %i0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 4000b75c: fa 07 00 00 ld [ %i4 ], %i5 the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); 4000b760: 80 a7 40 1b cmp %i5, %i3 4000b764: 02 80 00 04 be 4000b774 <_Watchdog_Tickle+0x98> 4000b768: 01 00 00 00 nop } _ISR_Disable( level ); the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && 4000b76c: 10 bf ff ea b 4000b714 <_Watchdog_Tickle+0x38> 4000b770: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); 4000b774: 7f ff db 39 call 40002458 4000b778: 81 e8 00 00 restore =============================================================================== 4000b77c <_Workspace_Handler_initialization>: void _Workspace_Handler_initialization( Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { 4000b77c: 9d e3 bf a0 save %sp, -96, %sp Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; uintptr_t remaining = rtems_configuration_get_work_space_size(); 4000b780: 05 10 00 71 sethi %hi(0x4001c400), %g2 4000b784: 82 10 a3 d8 or %g2, 0x3d8, %g1 ! 4001c7d8 4000b788: c6 08 60 32 ldub [ %g1 + 0x32 ], %g3 4000b78c: fa 00 a3 d8 ld [ %g2 + 0x3d8 ], %i5 4000b790: 80 a0 e0 00 cmp %g3, 0 4000b794: 12 80 00 03 bne 4000b7a0 <_Workspace_Handler_initialization+0x24> 4000b798: 84 10 20 00 clr %g2 4000b79c: c4 00 60 04 ld [ %g1 + 4 ], %g2 Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; 4000b7a0: 21 10 00 24 sethi %hi(0x40009000), %l0 } else { size = 0; } } space_available = (*init_or_extend)( 4000b7a4: 27 10 00 7d sethi %hi(0x4001f400), %l3 size_t area_count, Heap_Initialization_or_extend_handler extend ) { Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; uintptr_t remaining = rtems_configuration_get_work_space_size(); 4000b7a8: ba 00 80 1d add %g2, %i5, %i5 bool unified = rtems_configuration_get_unified_work_area(); uintptr_t page_size = CPU_HEAP_ALIGNMENT; uintptr_t overhead = _Heap_Area_overhead( page_size ); size_t i; for (i = 0; i < area_count; ++i) { 4000b7ac: b6 10 20 00 clr %i3 Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { Heap_Initialization_or_extend_handler init_or_extend = _Heap_Initialize; 4000b7b0: a0 14 21 d4 or %l0, 0x1d4, %l0 size_t i; for (i = 0; i < area_count; ++i) { Heap_Area *area = &areas [i]; if ( do_zero ) { 4000b7b4: e2 08 60 30 ldub [ %g1 + 0x30 ], %l1 if ( area->size > overhead ) { uintptr_t space_available; uintptr_t size; if ( unified ) { 4000b7b8: e4 08 60 31 ldub [ %g1 + 0x31 ], %l2 bool unified = rtems_configuration_get_unified_work_area(); uintptr_t page_size = CPU_HEAP_ALIGNMENT; uintptr_t overhead = _Heap_Area_overhead( page_size ); size_t i; for (i = 0; i < area_count; ++i) { 4000b7bc: 10 80 00 2c b 4000b86c <_Workspace_Handler_initialization+0xf0> 4000b7c0: a6 14 e0 90 or %l3, 0x90, %l3 Heap_Area *area = &areas [i]; if ( do_zero ) { 4000b7c4: 22 80 00 07 be,a 4000b7e0 <_Workspace_Handler_initialization+0x64> 4000b7c8: f8 06 20 04 ld [ %i0 + 4 ], %i4 memset( area->begin, 0, area->size ); 4000b7cc: d0 06 00 00 ld [ %i0 ], %o0 4000b7d0: d4 06 20 04 ld [ %i0 + 4 ], %o2 4000b7d4: 40 00 13 52 call 4001051c 4000b7d8: 92 10 20 00 clr %o1 } if ( area->size > overhead ) { 4000b7dc: f8 06 20 04 ld [ %i0 + 4 ], %i4 4000b7e0: 80 a7 20 16 cmp %i4, 0x16 4000b7e4: 28 80 00 21 bleu,a 4000b868 <_Workspace_Handler_initialization+0xec> 4000b7e8: b6 06 e0 01 inc %i3 uintptr_t space_available; uintptr_t size; if ( unified ) { 4000b7ec: 80 a4 a0 00 cmp %l2, 0 4000b7f0: 32 80 00 0c bne,a 4000b820 <_Workspace_Handler_initialization+0xa4> 4000b7f4: d2 06 00 00 ld [ %i0 ], %o1 size = area->size; } else { if ( remaining > 0 ) { 4000b7f8: 80 a7 60 00 cmp %i5, 0 4000b7fc: 22 80 00 08 be,a 4000b81c <_Workspace_Handler_initialization+0xa0><== NEVER TAKEN 4000b800: b8 10 20 00 clr %i4 <== NOT EXECUTED size = remaining < area->size - overhead ? 4000b804: 82 07 3f ea add %i4, -22, %g1 remaining + overhead : area->size; 4000b808: 80 a7 40 01 cmp %i5, %g1 4000b80c: 2a 80 00 04 bcs,a 4000b81c <_Workspace_Handler_initialization+0xa0><== ALWAYS TAKEN 4000b810: b8 07 60 16 add %i5, 0x16, %i4 } else { size = 0; } } space_available = (*init_or_extend)( 4000b814: 10 80 00 03 b 4000b820 <_Workspace_Handler_initialization+0xa4><== NOT EXECUTED 4000b818: d2 06 00 00 ld [ %i0 ], %o1 <== NOT EXECUTED 4000b81c: d2 06 00 00 ld [ %i0 ], %o1 4000b820: 94 10 00 1c mov %i4, %o2 4000b824: 90 10 00 13 mov %l3, %o0 4000b828: 9f c4 00 00 call %l0 4000b82c: 96 10 20 08 mov 8, %o3 area->begin, size, page_size ); area->begin = (char *) area->begin + size; 4000b830: c2 06 00 00 ld [ %i0 ], %g1 area->size -= size; if ( space_available < remaining ) { 4000b834: 80 a2 00 1d cmp %o0, %i5 area->begin, size, page_size ); area->begin = (char *) area->begin + size; 4000b838: 82 00 40 1c add %g1, %i4, %g1 4000b83c: c2 26 00 00 st %g1, [ %i0 ] area->size -= size; 4000b840: c2 06 20 04 ld [ %i0 + 4 ], %g1 4000b844: b8 20 40 1c sub %g1, %i4, %i4 if ( space_available < remaining ) { 4000b848: 1a 80 00 05 bcc 4000b85c <_Workspace_Handler_initialization+0xe0><== ALWAYS TAKEN 4000b84c: f8 26 20 04 st %i4, [ %i0 + 4 ] remaining -= space_available; 4000b850: ba 27 40 08 sub %i5, %o0, %i5 <== NOT EXECUTED } else { remaining = 0; } init_or_extend = extend; 4000b854: 10 80 00 04 b 4000b864 <_Workspace_Handler_initialization+0xe8><== NOT EXECUTED 4000b858: a0 10 00 1a mov %i2, %l0 <== NOT EXECUTED 4000b85c: a0 10 00 1a mov %i2, %l0 area->size -= size; if ( space_available < remaining ) { remaining -= space_available; } else { remaining = 0; 4000b860: ba 10 20 00 clr %i5 bool unified = rtems_configuration_get_unified_work_area(); uintptr_t page_size = CPU_HEAP_ALIGNMENT; uintptr_t overhead = _Heap_Area_overhead( page_size ); size_t i; for (i = 0; i < area_count; ++i) { 4000b864: b6 06 e0 01 inc %i3 4000b868: b0 06 20 08 add %i0, 8, %i0 4000b86c: 80 a6 c0 19 cmp %i3, %i1 4000b870: 12 bf ff d5 bne 4000b7c4 <_Workspace_Handler_initialization+0x48> 4000b874: 80 a4 60 00 cmp %l1, 0 init_or_extend = extend; } } if ( remaining > 0 ) { 4000b878: 80 a7 60 00 cmp %i5, 0 4000b87c: 02 80 00 05 be 4000b890 <_Workspace_Handler_initialization+0x114> 4000b880: 90 10 20 00 clr %o0 _Internal_error_Occurred( 4000b884: 92 10 20 01 mov 1, %o1 4000b888: 7f ff f6 e6 call 40009420 <_Internal_error_Occurred> 4000b88c: 94 10 20 02 mov 2, %o2 4000b890: 81 c7 e0 08 ret 4000b894: 81 e8 00 00 restore =============================================================================== 40007d74 : #include #include #include int aio_cancel(int fildes, struct aiocb *aiocbp) { 40007d74: 9d e3 bf a0 save %sp, -96, %sp rtems_aio_request_chain *r_chain; int result; pthread_mutex_lock (&aio_request_queue.mutex); 40007d78: 3b 10 00 65 sethi %hi(0x40019400), %i5 40007d7c: 40 00 04 68 call 40008f1c 40007d80: 90 17 60 cc or %i5, 0xcc, %o0 ! 400194cc if (fcntl (fildes, F_GETFD) < 0) { 40007d84: 90 10 00 18 mov %i0, %o0 40007d88: 40 00 1a 1d call 4000e5fc 40007d8c: 92 10 20 01 mov 1, %o1 40007d90: 80 a2 20 00 cmp %o0, 0 40007d94: 16 80 00 08 bge 40007db4 40007d98: 80 a6 60 00 cmp %i1, 0 pthread_mutex_unlock(&aio_request_queue.mutex); 40007d9c: 40 00 04 81 call 40008fa0 40007da0: 90 17 60 cc or %i5, 0xcc, %o0 rtems_set_errno_and_return_minus_one (EBADF); 40007da4: 40 00 27 4d call 40011ad8 <__errno> 40007da8: 01 00 00 00 nop 40007dac: 10 80 00 54 b 40007efc 40007db0: 82 10 20 09 mov 9, %g1 ! 9 } /* if aiocbp is NULL remove all request for given file descriptor */ if (aiocbp == NULL) { 40007db4: 32 80 00 35 bne,a 40007e88 40007db8: f8 06 40 00 ld [ %i1 ], %i4 AIO_printf ("Cancel all requests\n"); r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0); 40007dbc: 11 10 00 65 sethi %hi(0x40019400), %o0 40007dc0: 92 10 00 18 mov %i0, %o1 40007dc4: 90 12 21 14 or %o0, 0x114, %o0 40007dc8: 40 00 01 71 call 4000838c 40007dcc: 94 10 20 00 clr %o2 if (r_chain == NULL) { 40007dd0: b8 92 20 00 orcc %o0, 0, %i4 40007dd4: 12 80 00 20 bne 40007e54 40007dd8: b6 07 20 1c add %i4, 0x1c, %i3 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 40007ddc: ba 17 60 cc or %i5, 0xcc, %i5 AIO_printf ("Request chain not on [WQ]\n"); if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) { 40007de0: c4 07 60 54 ld [ %i5 + 0x54 ], %g2 40007de4: 82 07 60 58 add %i5, 0x58, %g1 40007de8: 80 a0 80 01 cmp %g2, %g1 40007dec: 02 80 00 08 be 40007e0c <== NEVER TAKEN 40007df0: 92 10 00 18 mov %i0, %o1 r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0); 40007df4: 90 07 60 54 add %i5, 0x54, %o0 40007df8: 40 00 01 65 call 4000838c 40007dfc: 94 10 20 00 clr %o2 if (r_chain == NULL) { 40007e00: b8 92 20 00 orcc %o0, 0, %i4 40007e04: 12 80 00 08 bne 40007e24 40007e08: 01 00 00 00 nop pthread_mutex_unlock(&aio_request_queue.mutex); 40007e0c: 11 10 00 65 sethi %hi(0x40019400), %o0 return AIO_ALLDONE; 40007e10: b0 10 20 02 mov 2, %i0 AIO_printf ("Request chain not on [WQ]\n"); if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) { r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0); if (r_chain == NULL) { pthread_mutex_unlock(&aio_request_queue.mutex); 40007e14: 40 00 04 63 call 40008fa0 40007e18: 90 12 20 cc or %o0, 0xcc, %o0 return AIO_ALLDONE; 40007e1c: 81 c7 e0 08 ret 40007e20: 81 e8 00 00 restore */ RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 40007e24: 40 00 0a cf call 4000a960 <_Chain_Extract> 40007e28: b6 07 20 1c add %i4, 0x1c, %i3 } AIO_printf ("Request chain on [IQ]\n"); rtems_chain_extract (&r_chain->next_fd); rtems_aio_remove_fd (r_chain); 40007e2c: 40 00 01 80 call 4000842c 40007e30: 90 10 00 1c mov %i4, %o0 pthread_mutex_destroy (&r_chain->mutex); 40007e34: 40 00 03 8d call 40008c68 40007e38: 90 10 00 1b mov %i3, %o0 pthread_cond_destroy (&r_chain->mutex); 40007e3c: 40 00 02 ae call 400088f4 40007e40: 90 10 00 1b mov %i3, %o0 free (r_chain); 40007e44: 7f ff f1 3d call 40004338 40007e48: 90 10 00 1c mov %i4, %o0 pthread_mutex_unlock (&aio_request_queue.mutex); 40007e4c: 10 80 00 0b b 40007e78 40007e50: 90 10 00 1d mov %i5, %o0 return AIO_ALLDONE; } AIO_printf ("Request chain on [WQ]\n"); pthread_mutex_lock (&r_chain->mutex); 40007e54: 40 00 04 32 call 40008f1c 40007e58: 90 10 00 1b mov %i3, %o0 40007e5c: 40 00 0a c1 call 4000a960 <_Chain_Extract> 40007e60: 90 10 00 1c mov %i4, %o0 rtems_chain_extract (&r_chain->next_fd); rtems_aio_remove_fd (r_chain); 40007e64: 40 00 01 72 call 4000842c 40007e68: 90 10 00 1c mov %i4, %o0 pthread_mutex_unlock (&r_chain->mutex); 40007e6c: 40 00 04 4d call 40008fa0 40007e70: 90 10 00 1b mov %i3, %o0 pthread_mutex_unlock (&aio_request_queue.mutex); 40007e74: 90 17 60 cc or %i5, 0xcc, %o0 40007e78: 40 00 04 4a call 40008fa0 40007e7c: b0 10 20 00 clr %i0 return AIO_CANCELED; 40007e80: 81 c7 e0 08 ret 40007e84: 81 e8 00 00 restore } else { AIO_printf ("Cancel request\n"); if (aiocbp->aio_fildes != fildes) { 40007e88: 80 a7 00 18 cmp %i4, %i0 40007e8c: 12 80 00 17 bne 40007ee8 40007e90: 90 17 60 cc or %i5, 0xcc, %o0 pthread_mutex_unlock (&aio_request_queue.mutex); rtems_set_errno_and_return_minus_one (EINVAL); } r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, fildes, 0); 40007e94: 11 10 00 65 sethi %hi(0x40019400), %o0 40007e98: 92 10 00 1c mov %i4, %o1 40007e9c: 90 12 21 14 or %o0, 0x114, %o0 40007ea0: 40 00 01 3b call 4000838c 40007ea4: 94 10 20 00 clr %o2 if (r_chain == NULL) { 40007ea8: b6 92 20 00 orcc %o0, 0, %i3 40007eac: 32 80 00 1c bne,a 40007f1c 40007eb0: b8 06 e0 1c add %i3, 0x1c, %i4 40007eb4: ba 17 60 cc or %i5, 0xcc, %i5 if (!rtems_chain_is_empty (&aio_request_queue.idle_req)) { 40007eb8: c4 07 60 54 ld [ %i5 + 0x54 ], %g2 40007ebc: 82 07 60 58 add %i5, 0x58, %g1 40007ec0: 80 a0 80 01 cmp %g2, %g1 40007ec4: 02 bf ff d2 be 40007e0c <== NEVER TAKEN 40007ec8: 92 10 00 1c mov %i4, %o1 r_chain = rtems_aio_search_fd (&aio_request_queue.idle_req, fildes, 0); 40007ecc: 90 07 60 54 add %i5, 0x54, %o0 40007ed0: 40 00 01 2f call 4000838c 40007ed4: 94 10 20 00 clr %o2 if (r_chain == NULL) { 40007ed8: 80 a2 20 00 cmp %o0, 0 40007edc: 12 80 00 0b bne 40007f08 40007ee0: 90 02 20 08 add %o0, 8, %o0 pthread_mutex_unlock (&aio_request_queue.mutex); 40007ee4: 90 10 00 1d mov %i5, %o0 40007ee8: 40 00 04 2e call 40008fa0 40007eec: 01 00 00 00 nop rtems_set_errno_and_return_minus_one (EINVAL); 40007ef0: 40 00 26 fa call 40011ad8 <__errno> 40007ef4: 01 00 00 00 nop 40007ef8: 82 10 20 16 mov 0x16, %g1 ! 16 40007efc: c2 22 00 00 st %g1, [ %o0 ] 40007f00: 81 c7 e0 08 ret 40007f04: 91 e8 3f ff restore %g0, -1, %o0 } AIO_printf ("Request on [IQ]\n"); result = rtems_aio_remove_req (&r_chain->perfd, aiocbp); 40007f08: 40 00 01 5d call 4000847c 40007f0c: 92 10 00 19 mov %i1, %o1 40007f10: b0 10 00 08 mov %o0, %i0 pthread_mutex_unlock (&aio_request_queue.mutex); 40007f14: 10 80 00 0b b 40007f40 40007f18: 90 10 00 1d mov %i5, %o0 return AIO_ALLDONE; } } AIO_printf ("Request on [WQ]\n"); pthread_mutex_lock (&r_chain->mutex); 40007f1c: 40 00 04 00 call 40008f1c 40007f20: 90 10 00 1c mov %i4, %o0 result = rtems_aio_remove_req (&r_chain->perfd, aiocbp); 40007f24: 92 10 00 19 mov %i1, %o1 40007f28: 40 00 01 55 call 4000847c 40007f2c: 90 06 e0 08 add %i3, 8, %o0 40007f30: b0 10 00 08 mov %o0, %i0 pthread_mutex_unlock (&r_chain->mutex); 40007f34: 40 00 04 1b call 40008fa0 40007f38: 90 10 00 1c mov %i4, %o0 pthread_mutex_unlock (&aio_request_queue.mutex); 40007f3c: 90 17 60 cc or %i5, 0xcc, %o0 40007f40: 40 00 04 18 call 40008fa0 40007f44: 01 00 00 00 nop return result; } return AIO_ALLDONE; } 40007f48: 81 c7 e0 08 ret 40007f4c: 81 e8 00 00 restore =============================================================================== 40007f58 : int aio_fsync( int op, struct aiocb *aiocbp ) { 40007f58: 9d e3 bf a0 save %sp, -96, %sp rtems_aio_request *req; int mode; if (op != O_SYNC) 40007f5c: 03 00 00 08 sethi %hi(0x2000), %g1 40007f60: 80 a6 00 01 cmp %i0, %g1 40007f64: 12 80 00 10 bne 40007fa4 40007f68: ba 10 20 16 mov 0x16, %i5 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); mode = fcntl (aiocbp->aio_fildes, F_GETFL); 40007f6c: d0 06 40 00 ld [ %i1 ], %o0 40007f70: 40 00 19 a3 call 4000e5fc 40007f74: 92 10 20 03 mov 3, %o1 if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) 40007f78: 90 0a 20 03 and %o0, 3, %o0 40007f7c: 90 02 3f ff add %o0, -1, %o0 40007f80: 80 a2 20 01 cmp %o0, 1 40007f84: 18 80 00 08 bgu 40007fa4 40007f88: ba 10 20 09 mov 9, %i5 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); req = malloc (sizeof (rtems_aio_request)); 40007f8c: 7f ff f2 0b call 400047b8 40007f90: 90 10 20 18 mov 0x18, %o0 if (req == NULL) 40007f94: b0 92 20 00 orcc %o0, 0, %i0 40007f98: 32 80 00 09 bne,a 40007fbc <== ALWAYS TAKEN 40007f9c: f2 26 20 14 st %i1, [ %i0 + 0x14 ] rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 40007fa0: ba 10 20 0b mov 0xb, %i5 <== NOT EXECUTED 40007fa4: 82 10 3f ff mov -1, %g1 40007fa8: fa 26 60 34 st %i5, [ %i1 + 0x34 ] 40007fac: 40 00 26 cb call 40011ad8 <__errno> 40007fb0: c2 26 60 38 st %g1, [ %i1 + 0x38 ] 40007fb4: 10 80 00 06 b 40007fcc 40007fb8: fa 22 00 00 st %i5, [ %o0 ] req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_SYNC; 40007fbc: 82 10 20 03 mov 3, %g1 40007fc0: c2 26 60 30 st %g1, [ %i1 + 0x30 ] return rtems_aio_enqueue (req); 40007fc4: 40 00 01 4e call 400084fc 40007fc8: 81 e8 00 00 restore } 40007fcc: 81 c7 e0 08 ret 40007fd0: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 40008714 : * 0 - otherwise */ int aio_read (struct aiocb *aiocbp) { 40008714: 9d e3 bf a0 save %sp, -96, %sp rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 40008718: d0 06 00 00 ld [ %i0 ], %o0 4000871c: 92 10 20 03 mov 3, %o1 40008720: 40 00 17 b7 call 4000e5fc 40008724: ba 10 00 18 mov %i0, %i5 if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR))) 40008728: 80 8a 20 01 btst 1, %o0 4000872c: 12 80 00 11 bne 40008770 40008730: b8 10 20 09 mov 9, %i4 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) 40008734: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 40008738: 80 a0 60 00 cmp %g1, 0 4000873c: 22 80 00 04 be,a 4000874c 40008740: c2 06 20 08 ld [ %i0 + 8 ], %g1 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 40008744: 10 80 00 0b b 40008770 40008748: b8 10 20 16 mov 0x16, %i4 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) 4000874c: 80 a0 60 00 cmp %g1, 0 40008750: 06 80 00 08 bl 40008770 40008754: b8 10 20 16 mov 0x16, %i4 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); req = malloc (sizeof (rtems_aio_request)); 40008758: 7f ff f0 18 call 400047b8 4000875c: 90 10 20 18 mov 0x18, %o0 if (req == NULL) 40008760: b0 92 20 00 orcc %o0, 0, %i0 40008764: 32 80 00 09 bne,a 40008788 <== ALWAYS TAKEN 40008768: fa 26 20 14 st %i5, [ %i0 + 0x14 ] rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 4000876c: b8 10 20 0b mov 0xb, %i4 <== NOT EXECUTED 40008770: 82 10 3f ff mov -1, %g1 40008774: f8 27 60 34 st %i4, [ %i5 + 0x34 ] 40008778: 40 00 24 d8 call 40011ad8 <__errno> 4000877c: c2 27 60 38 st %g1, [ %i5 + 0x38 ] 40008780: 10 80 00 06 b 40008798 40008784: f8 22 00 00 st %i4, [ %o0 ] req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_READ; 40008788: 82 10 20 01 mov 1, %g1 4000878c: c2 27 60 30 st %g1, [ %i5 + 0x30 ] return rtems_aio_enqueue (req); 40008790: 7f ff ff 5b call 400084fc 40008794: 81 e8 00 00 restore } 40008798: 81 c7 e0 08 ret 4000879c: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 400087a8 : * 0 - otherwise */ int aio_write (struct aiocb *aiocbp) { 400087a8: 9d e3 bf a0 save %sp, -96, %sp rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 400087ac: d0 06 00 00 ld [ %i0 ], %o0 400087b0: 40 00 17 93 call 4000e5fc 400087b4: 92 10 20 03 mov 3, %o1 * 0 - otherwise */ int aio_write (struct aiocb *aiocbp) { 400087b8: ba 10 00 18 mov %i0, %i5 rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) 400087bc: 90 0a 20 03 and %o0, 3, %o0 400087c0: 90 02 3f ff add %o0, -1, %o0 400087c4: 80 a2 20 01 cmp %o0, 1 400087c8: 18 80 00 11 bgu 4000880c 400087cc: b8 10 20 09 mov 9, %i4 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) 400087d0: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 400087d4: 80 a0 60 00 cmp %g1, 0 400087d8: 22 80 00 04 be,a 400087e8 400087dc: c2 06 20 08 ld [ %i0 + 8 ], %g1 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 400087e0: 10 80 00 0b b 4000880c 400087e4: b8 10 20 16 mov 0x16, %i4 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); if (aiocbp->aio_reqprio < 0 || aiocbp->aio_reqprio > AIO_PRIO_DELTA_MAX) rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); if (aiocbp->aio_offset < 0) 400087e8: 80 a0 60 00 cmp %g1, 0 400087ec: 06 80 00 08 bl 4000880c 400087f0: b8 10 20 16 mov 0x16, %i4 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); req = malloc (sizeof (rtems_aio_request)); 400087f4: 7f ff ef f1 call 400047b8 400087f8: 90 10 20 18 mov 0x18, %o0 if (req == NULL) 400087fc: b0 92 20 00 orcc %o0, 0, %i0 40008800: 32 80 00 09 bne,a 40008824 <== ALWAYS TAKEN 40008804: fa 26 20 14 st %i5, [ %i0 + 0x14 ] rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 40008808: b8 10 20 0b mov 0xb, %i4 <== NOT EXECUTED 4000880c: 82 10 3f ff mov -1, %g1 40008810: f8 27 60 34 st %i4, [ %i5 + 0x34 ] 40008814: 40 00 24 b1 call 40011ad8 <__errno> 40008818: c2 27 60 38 st %g1, [ %i5 + 0x38 ] 4000881c: 10 80 00 06 b 40008834 40008820: f8 22 00 00 st %i4, [ %o0 ] req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_WRITE; 40008824: 82 10 20 02 mov 2, %g1 40008828: c2 27 60 30 st %g1, [ %i5 + 0x30 ] return rtems_aio_enqueue (req); 4000882c: 7f ff ff 34 call 400084fc 40008830: 81 e8 00 00 restore } 40008834: 81 c7 e0 08 ret 40008838: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 40007990 : int clock_gettime( clockid_t clock_id, struct timespec *tp ) { 40007990: 9d e3 bf 98 save %sp, -104, %sp if ( !tp ) 40007994: 80 a6 60 00 cmp %i1, 0 40007998: 02 80 00 26 be 40007a30 4000799c: 80 a6 20 01 cmp %i0, 1 rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { 400079a0: 12 80 00 16 bne 400079f8 400079a4: 80 a6 20 04 cmp %i0, 4 ) { Timestamp_Control tod_as_timestamp; Timestamp_Control *tod_as_timestamp_ptr; tod_as_timestamp_ptr = 400079a8: 90 07 bf f8 add %fp, -8, %o0 400079ac: 13 10 00 6a sethi %hi(0x4001a800), %o1 400079b0: 40 00 08 1d call 40009a24 <_TOD_Get_with_nanoseconds> 400079b4: 92 12 60 48 or %o1, 0x48, %o1 ! 4001a848 <_TOD> #endif rtems_set_errno_and_return_minus_one( EINVAL ); return 0; } 400079b8: f8 1a 00 00 ldd [ %o0 ], %i4 static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); 400079bc: 94 10 20 00 clr %o2 400079c0: 90 10 00 1c mov %i4, %o0 400079c4: 92 10 00 1d mov %i5, %o1 400079c8: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 400079cc: 40 00 3c 14 call 40016a1c <__divdi3> 400079d0: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 400079d4: 90 10 00 1c mov %i4, %o0 static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); 400079d8: d2 26 40 00 st %o1, [ %i1 ] _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 400079dc: 94 10 20 00 clr %o2 400079e0: 92 10 00 1d mov %i5, %o1 400079e4: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 400079e8: 40 00 3c f8 call 40016dc8 <__moddi3> 400079ec: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 400079f0: 10 80 00 06 b 40007a08 400079f4: d2 26 60 04 st %o1, [ %i1 + 4 ] if ( clock_id == CLOCK_REALTIME ) { _TOD_Get(tp); return 0; } #ifdef CLOCK_MONOTONIC if ( clock_id == CLOCK_MONOTONIC ) { 400079f8: 12 80 00 06 bne 40007a10 <== ALWAYS TAKEN 400079fc: 80 a6 20 02 cmp %i0, 2 _TOD_Get_uptime_as_timespec( tp ); 40007a00: 40 00 08 1a call 40009a68 <_TOD_Get_uptime_as_timespec> 40007a04: 90 10 00 19 mov %i1, %o0 return 0; 40007a08: 81 c7 e0 08 ret 40007a0c: 91 e8 20 00 restore %g0, 0, %o0 } #endif #ifdef _POSIX_CPUTIME if ( clock_id == CLOCK_PROCESS_CPUTIME_ID ) { 40007a10: 02 bf ff fc be 40007a00 40007a14: 80 a6 20 03 cmp %i0, 3 return 0; } #endif #ifdef _POSIX_THREAD_CPUTIME if ( clock_id == CLOCK_THREAD_CPUTIME_ID ) 40007a18: 12 80 00 06 bne 40007a30 40007a1c: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( ENOSYS ); 40007a20: 40 00 23 6d call 400107d4 <__errno> 40007a24: 01 00 00 00 nop 40007a28: 10 80 00 05 b 40007a3c 40007a2c: 82 10 20 58 mov 0x58, %g1 ! 58 #endif rtems_set_errno_and_return_minus_one( EINVAL ); 40007a30: 40 00 23 69 call 400107d4 <__errno> 40007a34: 01 00 00 00 nop 40007a38: 82 10 20 16 mov 0x16, %g1 ! 16 40007a3c: c2 22 00 00 st %g1, [ %o0 ] return 0; } 40007a40: 81 c7 e0 08 ret 40007a44: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 40025ef4 : int clock_settime( clockid_t clock_id, const struct timespec *tp ) { 40025ef4: 9d e3 bf 98 save %sp, -104, %sp if ( !tp ) 40025ef8: 82 96 60 00 orcc %i1, 0, %g1 40025efc: 02 80 00 4b be 40026028 <== NEVER TAKEN 40025f00: 80 a6 20 01 cmp %i0, 1 rtems_set_errno_and_return_minus_one( EINVAL ); if ( clock_id == CLOCK_REALTIME ) { 40025f04: 12 80 00 41 bne 40026008 40025f08: 80 a6 20 02 cmp %i0, 2 if ( tp->tv_sec < TOD_SECONDS_1970_THROUGH_1988 ) 40025f0c: c6 00 40 00 ld [ %g1 ], %g3 40025f10: 05 08 76 b9 sethi %hi(0x21dae400), %g2 40025f14: 84 10 a0 ff or %g2, 0xff, %g2 ! 21dae4ff 40025f18: 80 a0 c0 02 cmp %g3, %g2 40025f1c: 08 80 00 43 bleu 40026028 40025f20: 05 10 01 91 sethi %hi(0x40064400), %g2 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 40025f24: c6 00 a0 30 ld [ %g2 + 0x30 ], %g3 ! 40064430 <_Thread_Dispatch_disable_level> ++level; 40025f28: 86 00 e0 01 inc %g3 _Thread_Dispatch_disable_level = level; 40025f2c: c6 20 a0 30 st %g3, [ %g2 + 0x30 ] const struct timespec *tod_as_timespec ) { Timestamp_Control tod_as_timestamp; _Timestamp_Set( 40025f30: c6 00 40 00 ld [ %g1 ], %g3 &tod_as_timestamp, tod_as_timespec->tv_sec, tod_as_timespec->tv_nsec ); _TOD_Set_with_timestamp( &tod_as_timestamp ); 40025f34: 90 07 bf f8 add %fp, -8, %o0 const struct timespec *tod_as_timespec ) { Timestamp_Control tod_as_timestamp; _Timestamp_Set( 40025f38: 85 38 e0 1f sra %g3, 0x1f, %g2 Timestamp64_Control *_time, Timestamp64_Control _seconds, Timestamp64_Control _nanoseconds ) { *_time = _seconds * 1000000000L + _nanoseconds; 40025f3c: 89 28 a0 03 sll %g2, 3, %g4 40025f40: bb 28 e0 03 sll %g3, 3, %i5 40025f44: b7 30 e0 1d srl %g3, 0x1d, %i3 40025f48: b8 16 c0 04 or %i3, %g4, %i4 40025f4c: 89 37 60 1b srl %i5, 0x1b, %g4 40025f50: b5 2f 20 05 sll %i4, 5, %i2 40025f54: b7 2f 60 05 sll %i5, 5, %i3 40025f58: b4 11 00 1a or %g4, %i2, %i2 40025f5c: ba a6 c0 1d subcc %i3, %i5, %i5 40025f60: 89 37 60 1a srl %i5, 0x1a, %g4 40025f64: b8 66 80 1c subx %i2, %i4, %i4 40025f68: b7 2f 60 06 sll %i5, 6, %i3 40025f6c: b5 2f 20 06 sll %i4, 6, %i2 40025f70: b6 a6 c0 1d subcc %i3, %i5, %i3 40025f74: b4 11 00 1a or %g4, %i2, %i2 40025f78: b4 66 80 1c subx %i2, %i4, %i2 40025f7c: b2 86 c0 03 addcc %i3, %g3, %i1 40025f80: b0 46 80 02 addx %i2, %g2, %i0 40025f84: 89 36 60 1e srl %i1, 0x1e, %g4 40025f88: 85 2e 20 02 sll %i0, 2, %g2 40025f8c: 84 11 00 02 or %g4, %g2, %g2 40025f90: 87 2e 60 02 sll %i1, 2, %g3 40025f94: ba 86 40 03 addcc %i1, %g3, %i5 40025f98: b8 46 00 02 addx %i0, %g2, %i4 40025f9c: 89 37 60 1e srl %i5, 0x1e, %g4 40025fa0: 85 2f 20 02 sll %i4, 2, %g2 40025fa4: 84 11 00 02 or %g4, %g2, %g2 40025fa8: 87 2f 60 02 sll %i5, 2, %g3 40025fac: b6 87 40 03 addcc %i5, %g3, %i3 40025fb0: b4 47 00 02 addx %i4, %g2, %i2 40025fb4: bb 2e e0 02 sll %i3, 2, %i5 40025fb8: 85 36 e0 1e srl %i3, 0x1e, %g2 40025fbc: 86 86 c0 1d addcc %i3, %i5, %g3 40025fc0: b9 2e a0 02 sll %i2, 2, %i4 40025fc4: b8 10 80 1c or %g2, %i4, %i4 40025fc8: 84 46 80 1c addx %i2, %i4, %g2 40025fcc: bb 28 a0 09 sll %g2, 9, %i5 40025fd0: b9 30 e0 17 srl %g3, 0x17, %i4 40025fd4: 84 17 00 1d or %i4, %i5, %g2 40025fd8: fa 00 60 04 ld [ %g1 + 4 ], %i5 40025fdc: 89 28 e0 09 sll %g3, 9, %g4 40025fe0: b6 81 00 1d addcc %g4, %i5, %i3 40025fe4: b9 3f 60 1f sra %i5, 0x1f, %i4 rtems_set_errno_and_return_minus_one( ENOSYS ); #endif else rtems_set_errno_and_return_minus_one( EINVAL ); return 0; 40025fe8: b0 10 20 00 clr %i0 40025fec: b4 40 80 1c addx %g2, %i4, %i2 &tod_as_timestamp, tod_as_timespec->tv_sec, tod_as_timespec->tv_nsec ); _TOD_Set_with_timestamp( &tod_as_timestamp ); 40025ff0: 40 00 04 4d call 40027124 <_TOD_Set_with_timestamp> 40025ff4: f4 3f bf f8 std %i2, [ %fp + -8 ] if ( tp->tv_sec < TOD_SECONDS_1970_THROUGH_1988 ) rtems_set_errno_and_return_minus_one( EINVAL ); _Thread_Disable_dispatch(); _TOD_Set( tp ); _Thread_Enable_dispatch(); 40025ff8: 7f ff 90 77 call 4000a1d4 <_Thread_Enable_dispatch> 40025ffc: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( ENOSYS ); #endif else rtems_set_errno_and_return_minus_one( EINVAL ); return 0; 40026000: 81 c7 e0 08 ret 40026004: 81 e8 00 00 restore _Thread_Disable_dispatch(); _TOD_Set( tp ); _Thread_Enable_dispatch(); } #ifdef _POSIX_CPUTIME else if ( clock_id == CLOCK_PROCESS_CPUTIME_ID ) 40026008: 02 80 00 04 be 40026018 4002600c: 80 a6 20 03 cmp %i0, 3 rtems_set_errno_and_return_minus_one( ENOSYS ); #endif #ifdef _POSIX_THREAD_CPUTIME else if ( clock_id == CLOCK_THREAD_CPUTIME_ID ) 40026010: 12 80 00 06 bne 40026028 40026014: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( ENOSYS ); 40026018: 40 00 44 a0 call 40037298 <__errno> 4002601c: 01 00 00 00 nop 40026020: 10 80 00 05 b 40026034 40026024: 82 10 20 58 mov 0x58, %g1 ! 58 #endif else rtems_set_errno_and_return_minus_one( EINVAL ); 40026028: 40 00 44 9c call 40037298 <__errno> 4002602c: 01 00 00 00 nop 40026030: 82 10 20 16 mov 0x16, %g1 ! 16 40026034: c2 22 00 00 st %g1, [ %o0 ] return 0; } 40026038: 81 c7 e0 08 ret 4002603c: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 4001bdac : int killinfo( pid_t pid, int sig, const union sigval *value ) { 4001bdac: 9d e3 bf 90 save %sp, -112, %sp POSIX_signals_Siginfo_node *psiginfo; /* * Only supported for the "calling process" (i.e. this node). */ if ( pid != getpid() ) 4001bdb0: 7f ff ff 1b call 4001ba1c 4001bdb4: 01 00 00 00 nop 4001bdb8: 80 a6 00 08 cmp %i0, %o0 4001bdbc: 02 80 00 06 be 4001bdd4 4001bdc0: 80 a6 60 00 cmp %i1, 0 rtems_set_errno_and_return_minus_one( ESRCH ); 4001bdc4: 7f ff cf 48 call 4000fae4 <__errno> 4001bdc8: 01 00 00 00 nop 4001bdcc: 10 80 00 a6 b 4001c064 4001bdd0: 82 10 20 03 mov 3, %g1 ! 3 /* * Validate the signal passed. */ if ( !sig ) 4001bdd4: 32 80 00 03 bne,a 4001bde0 4001bdd8: ba 06 7f ff add %i1, -1, %i5 4001bddc: 30 80 00 04 b,a 4001bdec rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 4001bde0: 80 a7 60 1f cmp %i5, 0x1f 4001bde4: 28 80 00 06 bleu,a 4001bdfc 4001bde8: 83 2e 60 02 sll %i1, 2, %g1 rtems_set_errno_and_return_minus_one( EINVAL ); 4001bdec: 7f ff cf 3e call 4000fae4 <__errno> 4001bdf0: 01 00 00 00 nop 4001bdf4: 10 80 00 9c b 4001c064 4001bdf8: 82 10 20 16 mov 0x16, %g1 ! 16 /* * If the signal is being ignored, then we are out of here. */ if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) 4001bdfc: 85 2e 60 04 sll %i1, 4, %g2 4001be00: 84 20 80 01 sub %g2, %g1, %g2 4001be04: 03 10 00 7e sethi %hi(0x4001f800), %g1 4001be08: 82 10 61 f0 or %g1, 0x1f0, %g1 ! 4001f9f0 <_POSIX_signals_Vectors> 4001be0c: 82 00 40 02 add %g1, %g2, %g1 4001be10: c2 00 60 08 ld [ %g1 + 8 ], %g1 4001be14: 80 a0 60 01 cmp %g1, 1 4001be18: 02 80 00 9f be 4001c094 4001be1c: 80 a6 60 04 cmp %i1, 4 /* * 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 ) ) 4001be20: 02 80 00 06 be 4001be38 4001be24: 80 a6 60 08 cmp %i1, 8 4001be28: 02 80 00 04 be 4001be38 4001be2c: 80 a6 60 0b cmp %i1, 0xb 4001be30: 12 80 00 08 bne 4001be50 4001be34: 82 10 20 01 mov 1, %g1 return pthread_kill( pthread_self(), sig ); 4001be38: 40 00 01 33 call 4001c304 4001be3c: 01 00 00 00 nop 4001be40: 40 00 00 f4 call 4001c210 4001be44: 92 10 00 19 mov %i1, %o1 4001be48: 81 c7 e0 08 ret 4001be4c: 91 e8 00 08 restore %g0, %o0, %o0 /* * Build up a siginfo structure */ siginfo = &siginfo_struct; siginfo->si_signo = sig; 4001be50: f2 27 bf f4 st %i1, [ %fp + -12 ] siginfo->si_code = SI_USER; 4001be54: c2 27 bf f8 st %g1, [ %fp + -8 ] if ( !value ) { 4001be58: 80 a6 a0 00 cmp %i2, 0 4001be5c: 12 80 00 04 bne 4001be6c 4001be60: bb 28 40 1d sll %g1, %i5, %i5 siginfo->si_value.sival_int = 0; 4001be64: 10 80 00 04 b 4001be74 4001be68: c0 27 bf fc clr [ %fp + -4 ] } else { siginfo->si_value = *value; 4001be6c: c2 06 80 00 ld [ %i2 ], %g1 4001be70: c2 27 bf fc st %g1, [ %fp + -4 ] * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 4001be74: 03 10 00 7d sethi %hi(0x4001f400), %g1 4001be78: c4 00 60 80 ld [ %g1 + 0x80 ], %g2 ! 4001f480 <_Thread_Dispatch_disable_level> ++level; 4001be7c: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 4001be80: c4 20 60 80 st %g2, [ %g1 + 0x80 ] */ void _POSIX_signals_Manager_Initialization(void); static inline void _POSIX_signals_Add_post_switch_extension(void) { _API_extensions_Add_post_switch( &_POSIX_signals_Post_switch ); 4001be84: 11 10 00 7a sethi %hi(0x4001e800), %o0 4001be88: 7f ff b2 bb call 40008974 <_API_extensions_Add_post_switch> 4001be8c: 90 12 20 7c or %o0, 0x7c, %o0 ! 4001e87c <_POSIX_signals_Post_switch> /* * 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; 4001be90: 03 10 00 7e sethi %hi(0x4001f800), %g1 4001be94: d0 00 61 a0 ld [ %g1 + 0x1a0 ], %o0 ! 4001f9a0 <_Per_CPU_Information+0x10> api = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( _POSIX_signals_Is_interested( api, mask ) ) { 4001be98: c4 02 21 50 ld [ %o0 + 0x150 ], %g2 4001be9c: c4 00 a0 d0 ld [ %g2 + 0xd0 ], %g2 4001bea0: 80 af 40 02 andncc %i5, %g2, %g0 4001bea4: 12 80 00 52 bne 4001bfec 4001bea8: 03 10 00 7e sethi %hi(0x4001f800), %g1 /* XXX violation of visibility -- need to define thread queue support */ the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = _Chain_First( the_chain ); 4001beac: 05 10 00 7e sethi %hi(0x4001f800), %g2 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 4001beb0: c2 00 63 7c ld [ %g1 + 0x37c ], %g1 4001beb4: 10 80 00 0a b 4001bedc 4001beb8: 84 10 a3 80 or %g2, 0x380, %g2 #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 4001bebc: 80 8f 40 04 btst %i5, %g4 4001bec0: 12 80 00 4a bne 4001bfe8 4001bec4: c6 00 61 50 ld [ %g1 + 0x150 ], %g3 /* * Is this thread is blocked waiting for another signal but has * not blocked this one? */ if (~api->signals_blocked & mask) 4001bec8: c6 00 e0 d0 ld [ %g3 + 0xd0 ], %g3 4001becc: 80 af 40 03 andncc %i5, %g3, %g0 4001bed0: 12 80 00 47 bne 4001bfec 4001bed4: 90 10 00 01 mov %g1, %o0 the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = _Chain_First( the_chain ); !_Chain_Is_tail( the_chain, the_node ) ; the_node = the_node->next ) { 4001bed8: c2 00 40 00 ld [ %g1 ], %g1 /* XXX violation of visibility -- need to define thread queue support */ the_chain = &_POSIX_signals_Wait_queue.Queues.Fifo; for ( the_node = _Chain_First( the_chain ); 4001bedc: 80 a0 40 02 cmp %g1, %g2 4001bee0: 32 bf ff f7 bne,a 4001bebc 4001bee4: c8 00 60 30 ld [ %g1 + 0x30 ], %g4 * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 4001bee8: 03 10 00 79 sethi %hi(0x4001e400), %g1 4001beec: c6 08 62 ac ldub [ %g1 + 0x2ac ], %g3 ! 4001e6ac for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) { 4001bef0: b8 10 20 02 mov 2, %i4 * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 4001bef4: 86 00 e0 01 inc %g3 * * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; 4001bef8: 82 10 20 00 clr %g1 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 ] ) 4001befc: 1b 10 00 7c sethi %hi(0x4001f000), %o5 */ RTEMS_INLINE_ROUTINE bool _States_Is_interruptible_by_signal ( States_Control the_states ) { return (the_states & STATES_INTERRUPTIBLE_BY_SIGNAL); 4001bf00: 35 04 00 00 sethi %hi(0x10000000), %i2 */ #define _POSIX_signals_Is_interested( _api, _mask ) \ ( ~(_api)->signals_blocked & (_mask) ) int killinfo( 4001bf04: 85 2f 20 02 sll %i4, 2, %g2 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 ] ) 4001bf08: 88 13 63 e4 or %o5, 0x3e4, %g4 4001bf0c: c4 01 00 02 ld [ %g4 + %g2 ], %g2 4001bf10: 80 a0 a0 00 cmp %g2, 0 4001bf14: 22 80 00 2f be,a 4001bfd0 <== NEVER TAKEN 4001bf18: b8 07 20 01 inc %i4 <== NOT EXECUTED continue; the_info = _Objects_Information_table[ the_api ][ 1 ]; 4001bf1c: c4 00 a0 04 ld [ %g2 + 4 ], %g2 #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 4001bf20: b6 10 20 01 mov 1, %i3 */ if ( !the_info ) continue; #endif maximum = the_info->maximum; 4001bf24: d8 10 a0 10 lduh [ %g2 + 0x10 ], %o4 object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 4001bf28: 10 80 00 26 b 4001bfc0 4001bf2c: d6 00 a0 1c ld [ %g2 + 0x1c ], %o3 the_thread = (Thread_Control *) object_table[ index ]; 4001bf30: c4 02 c0 02 ld [ %o3 + %g2 ], %g2 if ( !the_thread ) 4001bf34: 80 a0 a0 00 cmp %g2, 0 4001bf38: 22 80 00 22 be,a 4001bfc0 4001bf3c: b6 06 e0 01 inc %i3 /* * If this thread is of lower priority than the interested thread, * go on to the next thread. */ if ( the_thread->current_priority > interested_priority ) 4001bf40: c8 00 a0 14 ld [ %g2 + 0x14 ], %g4 4001bf44: 80 a1 00 03 cmp %g4, %g3 4001bf48: 38 80 00 1e bgu,a 4001bfc0 4001bf4c: b6 06 e0 01 inc %i3 #if defined(RTEMS_DEBUG) if ( !api ) continue; #endif if ( !_POSIX_signals_Is_interested( api, mask ) ) 4001bf50: f0 00 a1 50 ld [ %g2 + 0x150 ], %i0 4001bf54: f0 06 20 d0 ld [ %i0 + 0xd0 ], %i0 4001bf58: 80 af 40 18 andncc %i5, %i0, %g0 4001bf5c: 22 80 00 19 be,a 4001bfc0 4001bf60: b6 06 e0 01 inc %i3 * * 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 ) { 4001bf64: 80 a1 00 03 cmp %g4, %g3 4001bf68: 2a 80 00 14 bcs,a 4001bfb8 4001bf6c: 86 10 00 04 mov %g4, %g3 * and blocking interruptibutable by signal. * * If the interested thread is ready, don't think about changing. */ if ( interested && !_States_Is_ready( interested->current_state ) ) { 4001bf70: 80 a0 60 00 cmp %g1, 0 4001bf74: 22 80 00 13 be,a 4001bfc0 <== NEVER TAKEN 4001bf78: b6 06 e0 01 inc %i3 <== NOT EXECUTED 4001bf7c: de 00 60 10 ld [ %g1 + 0x10 ], %o7 4001bf80: 80 a3 e0 00 cmp %o7, 0 4001bf84: 22 80 00 0f be,a 4001bfc0 <== NEVER TAKEN 4001bf88: b6 06 e0 01 inc %i3 <== NOT EXECUTED /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 4001bf8c: f0 00 a0 10 ld [ %g2 + 0x10 ], %i0 4001bf90: 80 a6 20 00 cmp %i0, 0 4001bf94: 22 80 00 09 be,a 4001bfb8 4001bf98: 86 10 00 04 mov %g4, %g3 continue; } DEBUG_STEP("6"); /* prefer blocked/interruptible over blocked/not interruptible */ if ( !_States_Is_interruptible_by_signal(interested->current_state) ) { 4001bf9c: 80 8b c0 1a btst %o7, %i2 4001bfa0: 32 80 00 08 bne,a 4001bfc0 4001bfa4: b6 06 e0 01 inc %i3 DEBUG_STEP("7"); if ( _States_Is_interruptible_by_signal(the_thread->current_state) ) { 4001bfa8: 80 8e 00 1a btst %i0, %i2 4001bfac: 22 80 00 05 be,a 4001bfc0 4001bfb0: b6 06 e0 01 inc %i3 */ if ( interested && !_States_Is_ready( interested->current_state ) ) { /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 4001bfb4: 86 10 00 04 mov %g4, %g3 4001bfb8: 82 10 00 02 mov %g2, %g1 #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 4001bfbc: b6 06 e0 01 inc %i3 4001bfc0: 80 a6 c0 0c cmp %i3, %o4 4001bfc4: 08 bf ff db bleu 4001bf30 4001bfc8: 85 2e e0 02 sll %i3, 2, %g2 * + 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++) { 4001bfcc: b8 07 20 01 inc %i4 4001bfd0: 80 a7 20 04 cmp %i4, 4 4001bfd4: 12 bf ff cd bne 4001bf08 4001bfd8: 85 2f 20 02 sll %i4, 2, %g2 } } } } if ( interested ) { 4001bfdc: 80 a0 60 00 cmp %g1, 0 4001bfe0: 02 80 00 0c be 4001c010 4001bfe4: 01 00 00 00 nop /* * Is this thread is blocked waiting for another signal but has * not blocked this one? */ if (~api->signals_blocked & mask) 4001bfe8: 90 10 00 01 mov %g1, %o0 /* * 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 ) ) { 4001bfec: 92 10 00 19 mov %i1, %o1 4001bff0: 40 00 00 36 call 4001c0c8 <_POSIX_signals_Unblock_thread> 4001bff4: 94 07 bf f4 add %fp, -12, %o2 4001bff8: 80 8a 20 ff btst 0xff, %o0 4001bffc: 02 80 00 05 be 4001c010 4001c000: 01 00 00 00 nop _Thread_Enable_dispatch(); 4001c004: 7f ff ba 25 call 4000a898 <_Thread_Enable_dispatch> 4001c008: b0 10 20 00 clr %i0 ! 0 4001c00c: 30 80 00 23 b,a 4001c098 /* * 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 ); 4001c010: 40 00 00 24 call 4001c0a0 <_POSIX_signals_Set_process_signals> 4001c014: 90 10 00 1d mov %i5, %o0 if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { 4001c018: 83 2e 60 02 sll %i1, 2, %g1 4001c01c: b3 2e 60 04 sll %i1, 4, %i1 4001c020: b2 26 40 01 sub %i1, %g1, %i1 4001c024: 03 10 00 7e sethi %hi(0x4001f800), %g1 4001c028: 82 10 61 f0 or %g1, 0x1f0, %g1 ! 4001f9f0 <_POSIX_signals_Vectors> 4001c02c: c2 00 40 19 ld [ %g1 + %i1 ], %g1 4001c030: 80 a0 60 02 cmp %g1, 2 4001c034: 12 bf ff f4 bne 4001c004 4001c038: 11 10 00 7e sethi %hi(0x4001f800), %o0 psiginfo = (POSIX_signals_Siginfo_node *) 4001c03c: 7f ff b2 b3 call 40008b08 <_Chain_Get> 4001c040: 90 12 23 70 or %o0, 0x370, %o0 ! 4001fb70 <_POSIX_signals_Inactive_siginfo> _Chain_Get( &_POSIX_signals_Inactive_siginfo ); if ( !psiginfo ) { 4001c044: ba 92 20 00 orcc %o0, 0, %i5 4001c048: 12 80 00 0a bne 4001c070 4001c04c: 92 07 bf f4 add %fp, -12, %o1 _Thread_Enable_dispatch(); 4001c050: 7f ff ba 12 call 4000a898 <_Thread_Enable_dispatch> 4001c054: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( EAGAIN ); 4001c058: 7f ff ce a3 call 4000fae4 <__errno> 4001c05c: 01 00 00 00 nop 4001c060: 82 10 20 0b mov 0xb, %g1 ! b 4001c064: c2 22 00 00 st %g1, [ %o0 ] 4001c068: 81 c7 e0 08 ret 4001c06c: 91 e8 3f ff restore %g0, -1, %o0 } psiginfo->Info = *siginfo; 4001c070: 90 07 60 08 add %i5, 8, %o0 4001c074: 7f ff d0 ed call 40010428 4001c078: 94 10 20 0c mov 0xc, %o2 _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 4001c07c: 11 10 00 7e sethi %hi(0x4001f800), %o0 4001c080: 92 10 00 1d mov %i5, %o1 4001c084: 90 12 23 e8 or %o0, 0x3e8, %o0 4001c088: 7f ff b2 94 call 40008ad8 <_Chain_Append> 4001c08c: 90 02 00 19 add %o0, %i1, %o0 4001c090: 30 bf ff dd b,a 4001c004 /* * If the signal is being ignored, then we are out of here. */ if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) return 0; 4001c094: b0 10 20 00 clr %i0 } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); return 0; } 4001c098: 81 c7 e0 08 ret 4001c09c: 81 e8 00 00 restore =============================================================================== 4000cb0c : int pthread_attr_setschedpolicy( pthread_attr_t *attr, int policy ) { 4000cb0c: 82 10 00 08 mov %o0, %g1 if ( !attr || !attr->is_initialized ) 4000cb10: 80 a0 60 00 cmp %g1, 0 4000cb14: 02 80 00 0f be 4000cb50 4000cb18: 90 10 20 16 mov 0x16, %o0 4000cb1c: c4 00 40 00 ld [ %g1 ], %g2 4000cb20: 80 a0 a0 00 cmp %g2, 0 4000cb24: 02 80 00 0b be 4000cb50 4000cb28: 80 a2 60 04 cmp %o1, 4 return EINVAL; switch ( policy ) { 4000cb2c: 38 80 00 09 bgu,a 4000cb50 4000cb30: 90 10 20 86 mov 0x86, %o0 4000cb34: 84 10 20 01 mov 1, %g2 4000cb38: 85 28 80 09 sll %g2, %o1, %g2 4000cb3c: 80 88 a0 17 btst 0x17, %g2 4000cb40: 22 80 00 04 be,a 4000cb50 <== NEVER TAKEN 4000cb44: 90 10 20 86 mov 0x86, %o0 <== NOT EXECUTED case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: case SCHED_SPORADIC: attr->schedpolicy = policy; 4000cb48: d2 20 60 14 st %o1, [ %g1 + 0x14 ] 4000cb4c: 90 10 20 00 clr %o0 return 0; default: return ENOTSUP; } } 4000cb50: 81 c3 e0 08 retl =============================================================================== 40007f64 : int pthread_barrier_init( pthread_barrier_t *barrier, const pthread_barrierattr_t *attr, unsigned int count ) { 40007f64: 9d e3 bf 90 save %sp, -112, %sp const pthread_barrierattr_t *the_attr; /* * Error check parameters */ if ( !barrier ) 40007f68: 80 a6 20 00 cmp %i0, 0 40007f6c: 12 80 00 04 bne 40007f7c 40007f70: 80 a6 a0 00 cmp %i2, 0 switch ( the_attr->process_shared ) { case PTHREAD_PROCESS_PRIVATE: /* only supported values */ break; case PTHREAD_PROCESS_SHARED: default: return EINVAL; 40007f74: 81 c7 e0 08 ret 40007f78: 91 e8 20 16 restore %g0, 0x16, %o0 * Error check parameters */ if ( !barrier ) return EINVAL; if ( count == 0 ) 40007f7c: 22 80 00 1e be,a 40007ff4 40007f80: b0 10 20 16 mov 0x16, %i0 return EINVAL; /* * If the user passed in NULL, use the default attributes */ if ( attr ) { 40007f84: 80 a6 60 00 cmp %i1, 0 40007f88: 32 80 00 06 bne,a 40007fa0 40007f8c: c2 06 40 00 ld [ %i1 ], %g1 the_attr = attr; } else { (void) pthread_barrierattr_init( &my_attr ); 40007f90: 90 07 bf f8 add %fp, -8, %o0 40007f94: 7f ff ff bc call 40007e84 40007f98: b2 07 bf f8 add %fp, -8, %i1 } /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) 40007f9c: c2 06 40 00 ld [ %i1 ], %g1 40007fa0: 80 a0 60 00 cmp %g1, 0 40007fa4: 22 80 00 14 be,a 40007ff4 40007fa8: b0 10 20 16 mov 0x16, %i0 return EINVAL; switch ( the_attr->process_shared ) { 40007fac: c2 06 60 04 ld [ %i1 + 4 ], %g1 40007fb0: 80 a0 60 00 cmp %g1, 0 40007fb4: 32 80 00 10 bne,a 40007ff4 <== NEVER TAKEN 40007fb8: b0 10 20 16 mov 0x16, %i0 <== NOT EXECUTED * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 40007fbc: 03 10 00 61 sethi %hi(0x40018400), %g1 40007fc0: c4 00 62 e0 ld [ %g1 + 0x2e0 ], %g2 ! 400186e0 <_Thread_Dispatch_disable_level> } /* * Convert from POSIX attributes to Core Barrier attributes */ the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE; 40007fc4: c0 27 bf f0 clr [ %fp + -16 ] the_attributes.maximum_count = count; 40007fc8: f4 27 bf f4 st %i2, [ %fp + -12 ] ++level; 40007fcc: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 40007fd0: c4 20 62 e0 st %g2, [ %g1 + 0x2e0 ] * This function allocates a barrier control block from * the inactive chain of free barrier control blocks. */ RTEMS_INLINE_ROUTINE POSIX_Barrier_Control *_POSIX_Barrier_Allocate( void ) { return (POSIX_Barrier_Control *) 40007fd4: 39 10 00 62 sethi %hi(0x40018800), %i4 40007fd8: 40 00 08 68 call 4000a178 <_Objects_Allocate> 40007fdc: 90 17 22 64 or %i4, 0x264, %o0 ! 40018a64 <_POSIX_Barrier_Information> */ _Thread_Disable_dispatch(); /* prevents deletion */ the_barrier = _POSIX_Barrier_Allocate(); if ( !the_barrier ) { 40007fe0: ba 92 20 00 orcc %o0, 0, %i5 40007fe4: 12 80 00 06 bne 40007ffc 40007fe8: 90 07 60 10 add %i5, 0x10, %o0 _Thread_Enable_dispatch(); 40007fec: 40 00 0d 2a call 4000b494 <_Thread_Enable_dispatch> 40007ff0: b0 10 20 0b mov 0xb, %i0 40007ff4: 81 c7 e0 08 ret 40007ff8: 81 e8 00 00 restore return EAGAIN; } _CORE_barrier_Initialize( &the_barrier->Barrier, &the_attributes ); 40007ffc: 40 00 05 dc call 4000976c <_CORE_barrier_Initialize> 40008000: 92 07 bf f0 add %fp, -16, %o1 Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 40008004: c4 17 60 0a lduh [ %i5 + 0xa ], %g2 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 40008008: b8 17 22 64 or %i4, 0x264, %i4 4000800c: c6 07 20 1c ld [ %i4 + 0x1c ], %g3 Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 40008010: c2 07 60 08 ld [ %i5 + 8 ], %g1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 40008014: 85 28 a0 02 sll %g2, 2, %g2 40008018: fa 20 c0 02 st %i5, [ %g3 + %g2 ] _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 4000801c: c0 27 60 0c clr [ %i5 + 0xc ] ); /* * Exit the critical section and return the user an operational barrier */ *barrier = the_barrier->Object.id; 40008020: c2 26 00 00 st %g1, [ %i0 ] _Thread_Enable_dispatch(); 40008024: 40 00 0d 1c call 4000b494 <_Thread_Enable_dispatch> 40008028: b0 10 20 00 clr %i0 4000802c: 81 c7 e0 08 ret 40008030: 81 e8 00 00 restore =============================================================================== 40007854 : void pthread_cleanup_push( void (*routine)( void * ), void *arg ) { 40007854: 9d e3 bf a0 save %sp, -96, %sp /* * 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 ) 40007858: 80 a6 20 00 cmp %i0, 0 4000785c: 02 80 00 12 be 400078a4 40007860: 03 10 00 63 sethi %hi(0x40018c00), %g1 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 40007864: c4 00 60 40 ld [ %g1 + 0x40 ], %g2 ! 40018c40 <_Thread_Dispatch_disable_level> ++level; 40007868: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 4000786c: c4 20 60 40 st %g2, [ %g1 + 0x40 ] return; _Thread_Disable_dispatch(); handler = _Workspace_Allocate( sizeof( POSIX_Cancel_Handler_control ) ); 40007870: 40 00 11 99 call 4000bed4 <_Workspace_Allocate> 40007874: 90 10 20 10 mov 0x10, %o0 if ( handler ) { 40007878: 92 92 20 00 orcc %o0, 0, %o1 4000787c: 02 80 00 08 be 4000789c <== NEVER TAKEN 40007880: 03 10 00 64 sethi %hi(0x40019000), %g1 thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 40007884: c2 00 61 60 ld [ %g1 + 0x160 ], %g1 ! 40019160 <_Per_CPU_Information+0x10> handler_stack = &thread_support->Cancellation_Handlers; 40007888: d0 00 61 50 ld [ %g1 + 0x150 ], %o0 handler->routine = routine; 4000788c: f0 22 60 08 st %i0, [ %o1 + 8 ] handler->arg = arg; 40007890: f2 22 60 0c st %i1, [ %o1 + 0xc ] _Chain_Append( handler_stack, &handler->Node ); 40007894: 40 00 06 1e call 4000910c <_Chain_Append> 40007898: 90 02 20 e4 add %o0, 0xe4, %o0 } _Thread_Enable_dispatch(); 4000789c: 40 00 0d 62 call 4000ae24 <_Thread_Enable_dispatch> 400078a0: 81 e8 00 00 restore 400078a4: 81 c7 e0 08 ret 400078a8: 81 e8 00 00 restore =============================================================================== 40008834 : */ int pthread_cond_init( pthread_cond_t *cond, const pthread_condattr_t *attr ) { 40008834: 9d e3 bf a0 save %sp, -96, %sp POSIX_Condition_variables_Control *the_cond; const pthread_condattr_t *the_attr; if ( attr ) the_attr = attr; 40008838: 80 a6 60 00 cmp %i1, 0 4000883c: 32 80 00 05 bne,a 40008850 40008840: c4 06 60 04 ld [ %i1 + 4 ], %g2 else the_attr = &_POSIX_Condition_variables_Default_attributes; 40008844: 33 10 00 60 sethi %hi(0x40018000), %i1 40008848: b2 16 61 3c or %i1, 0x13c, %i1 ! 4001813c <_POSIX_Condition_variables_Default_attributes> /* * Be careful about attributes when global!!! */ if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) 4000884c: c4 06 60 04 ld [ %i1 + 4 ], %g2 40008850: 80 a0 a0 01 cmp %g2, 1 40008854: 02 80 00 25 be 400088e8 <== NEVER TAKEN 40008858: 82 10 20 16 mov 0x16, %g1 return EINVAL; if ( !the_attr->is_initialized ) 4000885c: c4 06 40 00 ld [ %i1 ], %g2 40008860: 80 a0 a0 00 cmp %g2, 0 40008864: 02 80 00 21 be 400088e8 40008868: 01 00 00 00 nop * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 4000886c: 03 10 00 66 sethi %hi(0x40019800), %g1 40008870: c4 00 61 80 ld [ %g1 + 0x180 ], %g2 ! 40019980 <_Thread_Dispatch_disable_level> ++level; 40008874: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 40008878: c4 20 61 80 st %g2, [ %g1 + 0x180 ] */ RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control *_POSIX_Condition_variables_Allocate( void ) { return (POSIX_Condition_variables_Control *) 4000887c: 39 10 00 67 sethi %hi(0x40019c00), %i4 40008880: 40 00 0a 11 call 4000b0c4 <_Objects_Allocate> 40008884: 90 17 21 9c or %i4, 0x19c, %o0 ! 40019d9c <_POSIX_Condition_variables_Information> _Thread_Disable_dispatch(); the_cond = _POSIX_Condition_variables_Allocate(); if ( !the_cond ) { 40008888: ba 92 20 00 orcc %o0, 0, %i5 4000888c: 32 80 00 06 bne,a 400088a4 40008890: c2 06 60 04 ld [ %i1 + 4 ], %g1 _Thread_Enable_dispatch(); 40008894: 40 00 0e d3 call 4000c3e0 <_Thread_Enable_dispatch> 40008898: 01 00 00 00 nop return ENOMEM; 4000889c: 10 80 00 13 b 400088e8 400088a0: 82 10 20 0c mov 0xc, %g1 ! c the_cond->process_shared = the_attr->process_shared; the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX; _Thread_queue_Initialize( 400088a4: 90 07 60 18 add %i5, 0x18, %o0 if ( !the_cond ) { _Thread_Enable_dispatch(); return ENOMEM; } the_cond->process_shared = the_attr->process_shared; 400088a8: c2 27 60 10 st %g1, [ %i5 + 0x10 ] the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX; _Thread_queue_Initialize( 400088ac: 92 10 20 00 clr %o1 400088b0: 15 04 00 02 sethi %hi(0x10000800), %o2 400088b4: 96 10 20 74 mov 0x74, %o3 400088b8: 40 00 10 c1 call 4000cbbc <_Thread_queue_Initialize> 400088bc: c0 27 60 14 clr [ %i5 + 0x14 ] Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 400088c0: c4 17 60 0a lduh [ %i5 + 0xa ], %g2 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 400088c4: b8 17 21 9c or %i4, 0x19c, %i4 400088c8: c6 07 20 1c ld [ %i4 + 0x1c ], %g3 Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 400088cc: c2 07 60 08 ld [ %i5 + 8 ], %g1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 400088d0: 85 28 a0 02 sll %g2, 2, %g2 400088d4: fa 20 c0 02 st %i5, [ %g3 + %g2 ] _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 400088d8: c0 27 60 0c clr [ %i5 + 0xc ] 0 ); *cond = the_cond->Object.id; _Thread_Enable_dispatch(); 400088dc: 40 00 0e c1 call 4000c3e0 <_Thread_Enable_dispatch> 400088e0: c2 26 00 00 st %g1, [ %i0 ] return 0; 400088e4: 82 10 20 00 clr %g1 } 400088e8: 81 c7 e0 08 ret 400088ec: 91 e8 00 01 restore %g0, %g1, %o0 =============================================================================== 40008694 : */ int pthread_condattr_destroy( pthread_condattr_t *attr ) { 40008694: 82 10 00 08 mov %o0, %g1 if ( !attr || attr->is_initialized == false ) 40008698: 80 a0 60 00 cmp %g1, 0 4000869c: 02 80 00 08 be 400086bc 400086a0: 90 10 20 16 mov 0x16, %o0 400086a4: c4 00 40 00 ld [ %g1 ], %g2 400086a8: 80 a0 a0 00 cmp %g2, 0 400086ac: 02 80 00 04 be 400086bc <== NEVER TAKEN 400086b0: 01 00 00 00 nop return EINVAL; attr->is_initialized = false; 400086b4: c0 20 40 00 clr [ %g1 ] return 0; 400086b8: 90 10 20 00 clr %o0 } 400086bc: 81 c3 e0 08 retl =============================================================================== 40007c2c : pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine)( void * ), void *arg ) { 40007c2c: 9d e3 bf 58 save %sp, -168, %sp int schedpolicy = SCHED_RR; struct sched_param schedparam; Objects_Name name; int rc; if ( !start_routine ) 40007c30: 80 a6 a0 00 cmp %i2, 0 40007c34: 02 80 00 8c be 40007e64 40007c38: ba 10 20 0e mov 0xe, %i5 return EFAULT; the_attr = (attr) ? attr : &_POSIX_Threads_Default_attributes; 40007c3c: 80 a6 60 00 cmp %i1, 0 40007c40: 32 80 00 05 bne,a 40007c54 40007c44: c2 06 40 00 ld [ %i1 ], %g1 40007c48: 33 10 00 79 sethi %hi(0x4001e400), %i1 40007c4c: b2 16 61 0c or %i1, 0x10c, %i1 ! 4001e50c <_POSIX_Threads_Default_attributes> if ( !the_attr->is_initialized ) 40007c50: c2 06 40 00 ld [ %i1 ], %g1 40007c54: 80 a0 60 00 cmp %g1, 0 40007c58: 02 80 00 83 be 40007e64 40007c5c: ba 10 20 16 mov 0x16, %i5 * stack space if it is allowed to allocate it itself. * * NOTE: If the user provides the stack we will let it drop below * twice the minimum. */ if ( the_attr->stackaddr && !_Stack_Is_enough(the_attr->stacksize) ) 40007c60: c2 06 60 04 ld [ %i1 + 4 ], %g1 40007c64: 80 a0 60 00 cmp %g1, 0 40007c68: 02 80 00 07 be 40007c84 40007c6c: 03 10 00 7c sethi %hi(0x4001f000), %g1 40007c70: c4 06 60 08 ld [ %i1 + 8 ], %g2 40007c74: c2 00 61 30 ld [ %g1 + 0x130 ], %g1 40007c78: 80 a0 80 01 cmp %g2, %g1 40007c7c: 2a 80 00 7b bcs,a 40007e68 40007c80: b0 10 00 1d mov %i5, %i0 * If inheritsched is set to PTHREAD_INHERIT_SCHED, then this thread * inherits scheduling attributes from the creating thread. If it is * PTHREAD_EXPLICIT_SCHED, then scheduling parameters come from the * attributes structure. */ switch ( the_attr->inheritsched ) { 40007c84: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 40007c88: 80 a0 60 01 cmp %g1, 1 40007c8c: 02 80 00 06 be 40007ca4 40007c90: 80 a0 60 02 cmp %g1, 2 40007c94: 32 80 00 74 bne,a 40007e64 40007c98: ba 10 20 16 mov 0x16, %i5 schedpolicy = api->schedpolicy; schedparam = api->schedparam; break; case PTHREAD_EXPLICIT_SCHED: schedpolicy = the_attr->schedpolicy; 40007c9c: 10 80 00 09 b 40007cc0 40007ca0: e2 06 60 14 ld [ %i1 + 0x14 ], %l1 * PTHREAD_EXPLICIT_SCHED, then scheduling parameters come from the * attributes structure. */ switch ( the_attr->inheritsched ) { case PTHREAD_INHERIT_SCHED: api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 40007ca4: 03 10 00 80 sethi %hi(0x40020000), %g1 40007ca8: c2 00 63 f0 ld [ %g1 + 0x3f0 ], %g1 ! 400203f0 <_Per_CPU_Information+0x10> schedpolicy = api->schedpolicy; schedparam = api->schedparam; 40007cac: 90 07 bf e4 add %fp, -28, %o0 * PTHREAD_EXPLICIT_SCHED, then scheduling parameters come from the * attributes structure. */ switch ( the_attr->inheritsched ) { case PTHREAD_INHERIT_SCHED: api = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 40007cb0: d2 00 61 50 ld [ %g1 + 0x150 ], %o1 schedpolicy = api->schedpolicy; 40007cb4: e2 02 60 84 ld [ %o1 + 0x84 ], %l1 schedparam = api->schedparam; 40007cb8: 10 80 00 04 b 40007cc8 40007cbc: 92 02 60 88 add %o1, 0x88, %o1 break; case PTHREAD_EXPLICIT_SCHED: schedpolicy = the_attr->schedpolicy; schedparam = the_attr->schedparam; 40007cc0: 90 07 bf e4 add %fp, -28, %o0 40007cc4: 92 06 60 18 add %i1, 0x18, %o1 40007cc8: 40 00 23 ed call 40010c7c 40007ccc: 94 10 20 1c mov 0x1c, %o2 /* * Check the contentionscope since rtems only supports PROCESS wide * contention (i.e. no system wide contention). */ if ( the_attr->contentionscope != PTHREAD_SCOPE_PROCESS ) 40007cd0: c2 06 60 0c ld [ %i1 + 0xc ], %g1 40007cd4: 80 a0 60 00 cmp %g1, 0 40007cd8: 12 80 00 63 bne 40007e64 40007cdc: ba 10 20 86 mov 0x86, %i5 return ENOTSUP; /* * Interpret the scheduling parameters. */ if ( !_POSIX_Priority_Is_valid( schedparam.sched_priority ) ) 40007ce0: 40 00 18 61 call 4000de64 <_POSIX_Priority_Is_valid> 40007ce4: d0 07 bf e4 ld [ %fp + -28 ], %o0 40007ce8: 80 8a 20 ff btst 0xff, %o0 40007cec: 02 80 00 5e be 40007e64 <== NEVER TAKEN 40007cf0: ba 10 20 16 mov 0x16, %i5 RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( int priority ) { return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1); 40007cf4: 03 10 00 7c sethi %hi(0x4001f000), %g1 return EINVAL; core_priority = _POSIX_Priority_To_core( schedparam.sched_priority ); 40007cf8: e4 07 bf e4 ld [ %fp + -28 ], %l2 40007cfc: e6 08 61 2c ldub [ %g1 + 0x12c ], %l3 /* * Set the core scheduling policy information. */ rc = _POSIX_Thread_Translate_sched_param( 40007d00: 90 10 00 11 mov %l1, %o0 40007d04: 92 07 bf e4 add %fp, -28, %o1 40007d08: 94 07 bf dc add %fp, -36, %o2 40007d0c: 40 00 18 61 call 4000de90 <_POSIX_Thread_Translate_sched_param> 40007d10: 96 07 bf e0 add %fp, -32, %o3 schedpolicy, &schedparam, &budget_algorithm, &budget_callout ); if ( rc ) 40007d14: ba 92 20 00 orcc %o0, 0, %i5 40007d18: 32 80 00 54 bne,a 40007e68 40007d1c: b0 10 00 1d mov %i5, %i0 #endif /* * Lock the allocator mutex for protection */ _RTEMS_Lock_allocator(); 40007d20: 39 10 00 7f sethi %hi(0x4001fc00), %i4 40007d24: 40 00 06 36 call 400095fc <_API_Mutex_Lock> 40007d28: d0 07 23 50 ld [ %i4 + 0x350 ], %o0 ! 4001ff50 <_RTEMS_Allocator_Mutex> * _POSIX_Threads_Allocate */ RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate( void ) { return (Thread_Control *) _Objects_Allocate( &_POSIX_Threads_Information ); 40007d2c: 11 10 00 80 sethi %hi(0x40020000), %o0 40007d30: 40 00 08 d2 call 4000a078 <_Objects_Allocate> 40007d34: 90 12 20 d4 or %o0, 0xd4, %o0 ! 400200d4 <_POSIX_Threads_Information> * Allocate the thread control block. * * NOTE: Global threads are not currently supported. */ the_thread = _POSIX_Threads_Allocate(); if ( !the_thread ) { 40007d38: a0 92 20 00 orcc %o0, 0, %l0 40007d3c: 32 80 00 04 bne,a 40007d4c 40007d40: c2 06 60 08 ld [ %i1 + 8 ], %g1 _RTEMS_Unlock_allocator(); 40007d44: 10 80 00 21 b 40007dc8 40007d48: d0 07 23 50 ld [ %i4 + 0x350 ], %o0 static inline size_t _POSIX_Threads_Ensure_minimum_stack ( size_t size ) { if ( size >= PTHREAD_MINIMUM_STACK_SIZE ) 40007d4c: 05 10 00 7c sethi %hi(0x4001f000), %g2 40007d50: d6 00 a1 30 ld [ %g2 + 0x130 ], %o3 ! 4001f130 /* * Initialize the core thread for this task. */ name.name_p = NULL; /* posix threads don't have a name by default */ status = _Thread_Initialize( 40007d54: c0 27 bf d4 clr [ %fp + -44 ] 40007d58: 97 2a e0 01 sll %o3, 1, %o3 40007d5c: 80 a2 c0 01 cmp %o3, %g1 40007d60: 1a 80 00 03 bcc 40007d6c 40007d64: d4 06 60 04 ld [ %i1 + 4 ], %o2 40007d68: 96 10 00 01 mov %g1, %o3 40007d6c: 82 10 20 01 mov 1, %g1 40007d70: c2 23 a0 5c st %g1, [ %sp + 0x5c ] 40007d74: c2 07 bf dc ld [ %fp + -36 ], %g1 40007d78: 9a 0c e0 ff and %l3, 0xff, %o5 40007d7c: c2 23 a0 60 st %g1, [ %sp + 0x60 ] 40007d80: c2 07 bf e0 ld [ %fp + -32 ], %g1 40007d84: c0 23 a0 68 clr [ %sp + 0x68 ] 40007d88: c2 23 a0 64 st %g1, [ %sp + 0x64 ] 40007d8c: 82 07 bf d4 add %fp, -44, %g1 40007d90: 39 10 00 80 sethi %hi(0x40020000), %i4 40007d94: c2 23 a0 6c st %g1, [ %sp + 0x6c ] 40007d98: 90 17 20 d4 or %i4, 0xd4, %o0 40007d9c: 92 10 00 10 mov %l0, %o1 40007da0: 98 10 20 00 clr %o4 40007da4: 40 00 0d b4 call 4000b474 <_Thread_Initialize> 40007da8: 9a 23 40 12 sub %o5, %l2, %o5 budget_callout, 0, /* isr level */ name /* posix threads don't have a name */ ); if ( !status ) { 40007dac: 80 8a 20 ff btst 0xff, %o0 40007db0: 12 80 00 0a bne 40007dd8 40007db4: 90 17 20 d4 or %i4, 0xd4, %o0 RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free ( Thread_Control *the_pthread ) { _Objects_Free( &_POSIX_Threads_Information, &the_pthread->Object ); 40007db8: 40 00 09 8f call 4000a3f4 <_Objects_Free> 40007dbc: 92 10 00 10 mov %l0, %o1 _POSIX_Threads_Free( the_thread ); _RTEMS_Unlock_allocator(); 40007dc0: 03 10 00 7f sethi %hi(0x4001fc00), %g1 40007dc4: d0 00 63 50 ld [ %g1 + 0x350 ], %o0 ! 4001ff50 <_RTEMS_Allocator_Mutex> 40007dc8: 40 00 06 22 call 40009650 <_API_Mutex_Unlock> 40007dcc: ba 10 20 0b mov 0xb, %i5 */ *thread = the_thread->Object.id; _RTEMS_Unlock_allocator(); return 0; } 40007dd0: 81 c7 e0 08 ret 40007dd4: 91 e8 00 1d restore %g0, %i5, %o0 } /* * finish initializing the per API structure */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 40007dd8: f8 04 21 50 ld [ %l0 + 0x150 ], %i4 api->Attributes = *the_attr; 40007ddc: 92 10 00 19 mov %i1, %o1 40007de0: 94 10 20 40 mov 0x40, %o2 40007de4: 40 00 23 a6 call 40010c7c 40007de8: 90 10 00 1c mov %i4, %o0 api->detachstate = the_attr->detachstate; 40007dec: c2 06 60 3c ld [ %i1 + 0x3c ], %g1 api->schedpolicy = schedpolicy; api->schedparam = schedparam; 40007df0: 92 07 bf e4 add %fp, -28, %o1 * finish initializing the per API structure */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; api->Attributes = *the_attr; api->detachstate = the_attr->detachstate; 40007df4: c2 27 20 40 st %g1, [ %i4 + 0x40 ] api->schedpolicy = schedpolicy; api->schedparam = schedparam; 40007df8: 94 10 20 1c mov 0x1c, %o2 */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; api->Attributes = *the_attr; api->detachstate = the_attr->detachstate; api->schedpolicy = schedpolicy; 40007dfc: e2 27 20 84 st %l1, [ %i4 + 0x84 ] api->schedparam = schedparam; 40007e00: 40 00 23 9f call 40010c7c 40007e04: 90 07 20 88 add %i4, 0x88, %o0 /* * POSIX threads are allocated and started in one operation. */ status = _Thread_Start( 40007e08: 90 10 00 10 mov %l0, %o0 40007e0c: 92 10 20 01 mov 1, %o1 40007e10: 94 10 00 1a mov %i2, %o2 40007e14: 96 10 00 1b mov %i3, %o3 40007e18: 40 00 0f d0 call 4000bd58 <_Thread_Start> 40007e1c: 98 10 20 00 clr %o4 _RTEMS_Unlock_allocator(); return EINVAL; } #endif if ( schedpolicy == SCHED_SPORADIC ) { 40007e20: 80 a4 60 04 cmp %l1, 4 40007e24: 32 80 00 0a bne,a 40007e4c 40007e28: c2 04 20 08 ld [ %l0 + 8 ], %g1 _Watchdog_Insert_ticks( 40007e2c: 40 00 0f f5 call 4000be00 <_Timespec_To_ticks> 40007e30: 90 07 20 90 add %i4, 0x90, %o0 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 40007e34: 92 07 20 a8 add %i4, 0xa8, %o1 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 40007e38: d0 27 20 b4 st %o0, [ %i4 + 0xb4 ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 40007e3c: 11 10 00 7f sethi %hi(0x4001fc00), %o0 40007e40: 40 00 10 a5 call 4000c0d4 <_Watchdog_Insert> 40007e44: 90 12 23 68 or %o0, 0x368, %o0 ! 4001ff68 <_Watchdog_Ticks_chain> } /* * Return the id and indicate we successfully created the thread */ *thread = the_thread->Object.id; 40007e48: c2 04 20 08 ld [ %l0 + 8 ], %g1 40007e4c: c2 26 00 00 st %g1, [ %i0 ] _RTEMS_Unlock_allocator(); 40007e50: 03 10 00 7f sethi %hi(0x4001fc00), %g1 40007e54: 40 00 05 ff call 40009650 <_API_Mutex_Unlock> 40007e58: d0 00 63 50 ld [ %g1 + 0x350 ], %o0 ! 4001ff50 <_RTEMS_Allocator_Mutex> return 0; } 40007e5c: 81 c7 e0 08 ret 40007e60: 91 e8 00 1d restore %g0, %i5, %o0 40007e64: b0 10 00 1d mov %i5, %i0 40007e68: 81 c7 e0 08 ret 40007e6c: 81 e8 00 00 restore =============================================================================== 4001c210 : int pthread_kill( pthread_t thread, int sig ) { 4001c210: 9d e3 bf 98 save %sp, -104, %sp POSIX_API_Control *api; Thread_Control *the_thread; Objects_Locations location; if ( !sig ) 4001c214: 80 a6 60 00 cmp %i1, 0 4001c218: 32 80 00 03 bne,a 4001c224 4001c21c: b8 06 7f ff add %i1, -1, %i4 4001c220: 30 80 00 04 b,a 4001c230 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 4001c224: 80 a7 20 1f cmp %i4, 0x1f 4001c228: 28 80 00 06 bleu,a 4001c240 4001c22c: 90 10 00 18 mov %i0, %o0 rtems_set_errno_and_return_minus_one( EINVAL ); 4001c230: 7f ff ce 2d call 4000fae4 <__errno> 4001c234: 01 00 00 00 nop 4001c238: 10 80 00 30 b 4001c2f8 4001c23c: 82 10 20 16 mov 0x16, %g1 ! 16 the_thread = _Thread_Get( thread, &location ); 4001c240: 7f ff b9 a2 call 4000a8c8 <_Thread_Get> 4001c244: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 4001c248: c2 07 bf fc ld [ %fp + -4 ], %g1 4001c24c: 80 a0 60 00 cmp %g1, 0 4001c250: 12 80 00 27 bne 4001c2ec <== NEVER TAKEN 4001c254: ba 10 00 08 mov %o0, %i5 4001c258: 11 10 00 7a sethi %hi(0x4001e800), %o0 4001c25c: 7f ff b1 c6 call 40008974 <_API_extensions_Add_post_switch> 4001c260: 90 12 20 7c or %o0, 0x7c, %o0 ! 4001e87c <_POSIX_signals_Post_switch> api = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( sig ) { if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) { 4001c264: 85 2e 60 02 sll %i1, 2, %g2 4001c268: 87 2e 60 04 sll %i1, 4, %g3 4001c26c: 86 20 c0 02 sub %g3, %g2, %g3 4001c270: 05 10 00 7e sethi %hi(0x4001f800), %g2 4001c274: 84 10 a1 f0 or %g2, 0x1f0, %g2 ! 4001f9f0 <_POSIX_signals_Vectors> 4001c278: 84 00 80 03 add %g2, %g3, %g2 4001c27c: c4 00 a0 08 ld [ %g2 + 8 ], %g2 4001c280: 80 a0 a0 01 cmp %g2, 1 4001c284: 12 80 00 06 bne 4001c29c 4001c288: c2 07 61 50 ld [ %i5 + 0x150 ], %g1 _Thread_Enable_dispatch(); 4001c28c: 7f ff b9 83 call 4000a898 <_Thread_Enable_dispatch> 4001c290: b0 10 20 00 clr %i0 4001c294: 81 c7 e0 08 ret 4001c298: 81 e8 00 00 restore return 0; } /* XXX critical section */ api->signals_pending |= signo_to_mask( sig ); 4001c29c: c4 00 60 d4 ld [ %g1 + 0xd4 ], %g2 4001c2a0: b6 10 20 01 mov 1, %i3 (void) _POSIX_signals_Unblock_thread( the_thread, sig, NULL ); 4001c2a4: 90 10 00 1d mov %i5, %o0 4001c2a8: b9 2e c0 1c sll %i3, %i4, %i4 4001c2ac: 92 10 00 19 mov %i1, %o1 return 0; } /* XXX critical section */ api->signals_pending |= signo_to_mask( sig ); 4001c2b0: b8 10 80 1c or %g2, %i4, %i4 (void) _POSIX_signals_Unblock_thread( the_thread, sig, NULL ); 4001c2b4: 94 10 20 00 clr %o2 4001c2b8: 7f ff ff 84 call 4001c0c8 <_POSIX_signals_Unblock_thread> 4001c2bc: f8 20 60 d4 st %i4, [ %g1 + 0xd4 ] if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 4001c2c0: 03 10 00 7e sethi %hi(0x4001f800), %g1 4001c2c4: 82 10 61 90 or %g1, 0x190, %g1 ! 4001f990 <_Per_CPU_Information> 4001c2c8: c4 00 60 08 ld [ %g1 + 8 ], %g2 4001c2cc: 80 a0 a0 00 cmp %g2, 0 4001c2d0: 02 bf ff ef be 4001c28c 4001c2d4: 01 00 00 00 nop 4001c2d8: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 4001c2dc: 80 a7 40 02 cmp %i5, %g2 4001c2e0: 22 bf ff eb be,a 4001c28c 4001c2e4: f6 28 60 0c stb %i3, [ %g1 + 0xc ] 4001c2e8: 30 bf ff e9 b,a 4001c28c #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( ESRCH ); 4001c2ec: 7f ff cd fe call 4000fae4 <__errno> <== NOT EXECUTED 4001c2f0: 01 00 00 00 nop <== NOT EXECUTED 4001c2f4: 82 10 20 03 mov 3, %g1 ! 3 <== NOT EXECUTED 4001c2f8: c2 22 00 00 st %g1, [ %o0 ] } 4001c2fc: 81 c7 e0 08 ret 4001c300: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 40009e08 : */ int pthread_mutex_timedlock( pthread_mutex_t *mutex, const struct timespec *abstime ) { 40009e08: 9d e3 bf 98 save %sp, -104, %sp * * If the status is POSIX_ABSOLUTE_TIMEOUT_INVALID, * POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST, or POSIX_ABSOLUTE_TIMEOUT_IS_NOW, * then we should not wait. */ status = _POSIX_Absolute_timeout_to_ticks( abstime, &ticks ); 40009e0c: 92 07 bf fc add %fp, -4, %o1 40009e10: 40 00 00 37 call 40009eec <_POSIX_Absolute_timeout_to_ticks> 40009e14: 90 10 00 19 mov %i1, %o0 if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; lock_status = _POSIX_Mutex_Lock_support( mutex, do_wait, ticks ); 40009e18: d4 07 bf fc ld [ %fp + -4 ], %o2 * 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 ); if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) 40009e1c: 82 1a 20 03 xor %o0, 3, %g1 40009e20: 80 a0 00 01 cmp %g0, %g1 * * 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 ); 40009e24: ba 10 00 08 mov %o0, %i5 if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) 40009e28: b8 60 3f ff subx %g0, -1, %i4 do_wait = false; lock_status = _POSIX_Mutex_Lock_support( mutex, do_wait, ticks ); 40009e2c: 90 10 00 18 mov %i0, %o0 40009e30: 7f ff ff b7 call 40009d0c <_POSIX_Mutex_Lock_support> 40009e34: 92 10 00 1c mov %i4, %o1 * This service only gives us the option to block. We used a polling * attempt to lock if the abstime was not in the future. If we did * not obtain the mutex, then not look at the status immediately, * make sure the right reason is returned. */ if ( !do_wait && (lock_status == EBUSY) ) { 40009e38: 80 a7 20 00 cmp %i4, 0 40009e3c: 12 80 00 0c bne 40009e6c 40009e40: b0 10 00 08 mov %o0, %i0 40009e44: 80 a2 20 10 cmp %o0, 0x10 40009e48: 12 80 00 09 bne 40009e6c 40009e4c: 80 a7 60 00 cmp %i5, 0 if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID ) 40009e50: 02 80 00 07 be 40009e6c <== NEVER TAKEN 40009e54: b0 10 20 16 mov 0x16, %i0 return EINVAL; if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST || 40009e58: ba 07 7f ff add %i5, -1, %i5 40009e5c: 80 a7 60 01 cmp %i5, 1 40009e60: 18 80 00 03 bgu 40009e6c <== NEVER TAKEN 40009e64: b0 10 20 10 mov 0x10, %i0 status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; 40009e68: b0 10 20 74 mov 0x74, %i0 } return lock_status; } 40009e6c: 81 c7 e0 08 ret 40009e70: 81 e8 00 00 restore =============================================================================== 40007698 : #if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES) int pthread_mutexattr_gettype( const pthread_mutexattr_t *attr, int *type ) { 40007698: 82 10 00 08 mov %o0, %g1 if ( !attr ) 4000769c: 80 a0 60 00 cmp %g1, 0 400076a0: 02 80 00 0b be 400076cc 400076a4: 90 10 20 16 mov 0x16, %o0 return EINVAL; if ( !attr->is_initialized ) 400076a8: c4 00 40 00 ld [ %g1 ], %g2 400076ac: 80 a0 a0 00 cmp %g2, 0 400076b0: 02 80 00 07 be 400076cc 400076b4: 80 a2 60 00 cmp %o1, 0 return EINVAL; if ( !type ) 400076b8: 02 80 00 05 be 400076cc <== NEVER TAKEN 400076bc: 01 00 00 00 nop return EINVAL; *type = attr->type; 400076c0: c2 00 60 10 ld [ %g1 + 0x10 ], %g1 return 0; 400076c4: 90 10 20 00 clr %o0 return EINVAL; if ( !type ) return EINVAL; *type = attr->type; 400076c8: c2 22 40 00 st %g1, [ %o1 ] return 0; } 400076cc: 81 c3 e0 08 retl =============================================================================== 400099c0 : int pthread_mutexattr_setpshared( pthread_mutexattr_t *attr, int pshared ) { 400099c0: 82 10 00 08 mov %o0, %g1 if ( !attr || !attr->is_initialized ) 400099c4: 80 a0 60 00 cmp %g1, 0 400099c8: 02 80 00 0a be 400099f0 400099cc: 90 10 20 16 mov 0x16, %o0 400099d0: c4 00 40 00 ld [ %g1 ], %g2 400099d4: 80 a0 a0 00 cmp %g2, 0 400099d8: 02 80 00 06 be 400099f0 400099dc: 80 a2 60 01 cmp %o1, 1 return EINVAL; switch ( pshared ) { 400099e0: 18 80 00 04 bgu 400099f0 <== NEVER TAKEN 400099e4: 01 00 00 00 nop case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; 400099e8: d2 20 60 04 st %o1, [ %g1 + 4 ] return 0; 400099ec: 90 10 20 00 clr %o0 default: return EINVAL; } } 400099f0: 81 c3 e0 08 retl =============================================================================== 40007704 : #if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES) int pthread_mutexattr_settype( pthread_mutexattr_t *attr, int type ) { 40007704: 82 10 00 08 mov %o0, %g1 if ( !attr || !attr->is_initialized ) 40007708: 80 a0 60 00 cmp %g1, 0 4000770c: 02 80 00 0a be 40007734 40007710: 90 10 20 16 mov 0x16, %o0 40007714: c4 00 40 00 ld [ %g1 ], %g2 40007718: 80 a0 a0 00 cmp %g2, 0 4000771c: 02 80 00 06 be 40007734 <== NEVER TAKEN 40007720: 80 a2 60 03 cmp %o1, 3 return EINVAL; switch ( type ) { 40007724: 18 80 00 04 bgu 40007734 40007728: 01 00 00 00 nop case PTHREAD_MUTEX_NORMAL: case PTHREAD_MUTEX_RECURSIVE: case PTHREAD_MUTEX_ERRORCHECK: case PTHREAD_MUTEX_DEFAULT: attr->type = type; 4000772c: d2 20 60 10 st %o1, [ %g1 + 0x10 ] return 0; 40007730: 90 10 20 00 clr %o0 default: return EINVAL; } } 40007734: 81 c3 e0 08 retl =============================================================================== 400082b4 : int pthread_once( pthread_once_t *once_control, void (*init_routine)(void) ) { 400082b4: 9d e3 bf 98 save %sp, -104, %sp if ( !once_control || !init_routine ) 400082b8: 80 a6 60 00 cmp %i1, 0 400082bc: 02 80 00 1c be 4000832c 400082c0: ba 10 00 18 mov %i0, %i5 400082c4: 80 a6 20 00 cmp %i0, 0 400082c8: 22 80 00 17 be,a 40008324 400082cc: b0 10 20 16 mov 0x16, %i0 return EINVAL; if ( !once_control->init_executed ) { 400082d0: c2 06 20 04 ld [ %i0 + 4 ], %g1 400082d4: 80 a0 60 00 cmp %g1, 0 400082d8: 12 80 00 13 bne 40008324 400082dc: b0 10 20 00 clr %i0 rtems_mode saveMode; rtems_task_mode(RTEMS_NO_PREEMPT, RTEMS_PREEMPT_MASK, &saveMode); 400082e0: 90 10 21 00 mov 0x100, %o0 400082e4: 92 10 21 00 mov 0x100, %o1 400082e8: 40 00 03 0d call 40008f1c 400082ec: 94 07 bf fc add %fp, -4, %o2 if ( !once_control->init_executed ) { 400082f0: c2 07 60 04 ld [ %i5 + 4 ], %g1 400082f4: 80 a0 60 00 cmp %g1, 0 400082f8: 12 80 00 07 bne 40008314 <== NEVER TAKEN 400082fc: d0 07 bf fc ld [ %fp + -4 ], %o0 once_control->is_initialized = true; 40008300: 82 10 20 01 mov 1, %g1 40008304: c2 27 40 00 st %g1, [ %i5 ] once_control->init_executed = true; (*init_routine)(); 40008308: 9f c6 40 00 call %i1 4000830c: c2 27 60 04 st %g1, [ %i5 + 4 ] } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); 40008310: d0 07 bf fc ld [ %fp + -4 ], %o0 40008314: 92 10 21 00 mov 0x100, %o1 40008318: 94 07 bf fc add %fp, -4, %o2 4000831c: 40 00 03 00 call 40008f1c 40008320: b0 10 20 00 clr %i0 40008324: 81 c7 e0 08 ret 40008328: 81 e8 00 00 restore pthread_once_t *once_control, void (*init_routine)(void) ) { if ( !once_control || !init_routine ) return EINVAL; 4000832c: b0 10 20 16 mov 0x16, %i0 (*init_routine)(); } rtems_task_mode(saveMode, RTEMS_PREEMPT_MASK, &saveMode); } return 0; } 40008330: 81 c7 e0 08 ret 40008334: 81 e8 00 00 restore =============================================================================== 400086d4 : int pthread_rwlock_init( pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr ) { 400086d4: 9d e3 bf 90 save %sp, -112, %sp const pthread_rwlockattr_t *the_attr; /* * Error check parameters */ if ( !rwlock ) 400086d8: 80 a6 20 00 cmp %i0, 0 400086dc: 12 80 00 04 bne 400086ec 400086e0: 80 a6 60 00 cmp %i1, 0 switch ( the_attr->process_shared ) { case PTHREAD_PROCESS_PRIVATE: /* only supported values */ break; case PTHREAD_PROCESS_SHARED: default: return EINVAL; 400086e4: 81 c7 e0 08 ret 400086e8: 91 e8 20 16 restore %g0, 0x16, %o0 return EINVAL; /* * If the user passed in NULL, use the default attributes */ if ( attr ) { 400086ec: 32 80 00 06 bne,a 40008704 400086f0: c2 06 40 00 ld [ %i1 ], %g1 the_attr = attr; } else { (void) pthread_rwlockattr_init( &default_attr ); 400086f4: 90 07 bf f8 add %fp, -8, %o0 400086f8: 40 00 01 b0 call 40008db8 400086fc: b2 07 bf f8 add %fp, -8, %i1 } /* * Now start error checking the attributes that we are going to use */ if ( !the_attr->is_initialized ) 40008700: c2 06 40 00 ld [ %i1 ], %g1 40008704: 80 a0 60 00 cmp %g1, 0 40008708: 22 80 00 13 be,a 40008754 <== NEVER TAKEN 4000870c: b0 10 20 16 mov 0x16, %i0 <== NOT EXECUTED return EINVAL; switch ( the_attr->process_shared ) { 40008710: c2 06 60 04 ld [ %i1 + 4 ], %g1 40008714: 80 a0 60 00 cmp %g1, 0 40008718: 32 80 00 0f bne,a 40008754 <== NEVER TAKEN 4000871c: b0 10 20 16 mov 0x16, %i0 <== NOT EXECUTED * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 40008720: 03 10 00 8f sethi %hi(0x40023c00), %g1 40008724: c4 00 62 80 ld [ %g1 + 0x280 ], %g2 ! 40023e80 <_Thread_Dispatch_disable_level> */ RTEMS_INLINE_ROUTINE void _CORE_RWLock_Initialize_attributes( CORE_RWLock_Attributes *the_attributes ) { the_attributes->XXX = 0; 40008728: c0 27 bf f4 clr [ %fp + -12 ] ++level; 4000872c: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 40008730: c4 20 62 80 st %g2, [ %g1 + 0x280 ] * This function allocates a RWLock control block from * the inactive chain of free RWLock control blocks. */ RTEMS_INLINE_ROUTINE POSIX_RWLock_Control *_POSIX_RWLock_Allocate( void ) { return (POSIX_RWLock_Control *) 40008734: 39 10 00 90 sethi %hi(0x40024000), %i4 40008738: 40 00 0a 7e call 4000b130 <_Objects_Allocate> 4000873c: 90 17 20 84 or %i4, 0x84, %o0 ! 40024084 <_POSIX_RWLock_Information> */ _Thread_Disable_dispatch(); /* prevents deletion */ the_rwlock = _POSIX_RWLock_Allocate(); if ( !the_rwlock ) { 40008740: ba 92 20 00 orcc %o0, 0, %i5 40008744: 12 80 00 06 bne 4000875c 40008748: 90 07 60 10 add %i5, 0x10, %o0 _Thread_Enable_dispatch(); 4000874c: 40 00 0f 79 call 4000c530 <_Thread_Enable_dispatch> 40008750: b0 10 20 0b mov 0xb, %i0 40008754: 81 c7 e0 08 ret 40008758: 81 e8 00 00 restore return EAGAIN; } _CORE_RWLock_Initialize( &the_rwlock->RWLock, &the_attributes ); 4000875c: 40 00 08 dd call 4000aad0 <_CORE_RWLock_Initialize> 40008760: 92 07 bf f4 add %fp, -12, %o1 Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 40008764: c4 17 60 0a lduh [ %i5 + 0xa ], %g2 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 40008768: b8 17 20 84 or %i4, 0x84, %i4 4000876c: c6 07 20 1c ld [ %i4 + 0x1c ], %g3 Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 40008770: c2 07 60 08 ld [ %i5 + 8 ], %g1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 40008774: 85 28 a0 02 sll %g2, 2, %g2 40008778: fa 20 c0 02 st %i5, [ %g3 + %g2 ] _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 4000877c: c0 27 60 0c clr [ %i5 + 0xc ] &_POSIX_RWLock_Information, &the_rwlock->Object, 0 ); *rwlock = the_rwlock->Object.id; 40008780: c2 26 00 00 st %g1, [ %i0 ] _Thread_Enable_dispatch(); 40008784: 40 00 0f 6b call 4000c530 <_Thread_Enable_dispatch> 40008788: b0 10 20 00 clr %i0 4000878c: 81 c7 e0 08 ret 40008790: 81 e8 00 00 restore =============================================================================== 40008d88 : int pthread_rwlock_timedrdlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { 40008d88: 9d e3 bf 98 save %sp, -104, %sp Objects_Locations location; Watchdog_Interval ticks; bool do_wait = true; POSIX_Absolute_timeout_conversion_results_t status; if ( !rwlock ) 40008d8c: 80 a6 20 00 cmp %i0, 0 40008d90: 12 80 00 04 bne 40008da0 40008d94: 92 07 bf fc add %fp, -4, %o1 #endif case OBJECTS_ERROR: break; } return EINVAL; 40008d98: 81 c7 e0 08 ret 40008d9c: 91 e8 20 16 restore %g0, 0x16, %o0 * * 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 ); 40008da0: 40 00 19 24 call 4000f230 <_POSIX_Absolute_timeout_to_ticks> 40008da4: 90 10 00 19 mov %i1, %o0 40008da8: d2 06 00 00 ld [ %i0 ], %o1 40008dac: ba 10 00 08 mov %o0, %i5 40008db0: 94 07 bf f8 add %fp, -8, %o2 40008db4: 11 10 00 6c sethi %hi(0x4001b000), %o0 40008db8: 40 00 0b 1e call 4000ba30 <_Objects_Get> 40008dbc: 90 12 20 c4 or %o0, 0xc4, %o0 ! 4001b0c4 <_POSIX_RWLock_Information> if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { 40008dc0: c2 07 bf f8 ld [ %fp + -8 ], %g1 40008dc4: 80 a0 60 00 cmp %g1, 0 40008dc8: 32 80 00 21 bne,a 40008e4c 40008dcc: b0 10 20 16 mov 0x16, %i0 case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_reading( 40008dd0: d2 06 00 00 ld [ %i0 ], %o1 40008dd4: d6 07 bf fc ld [ %fp + -4 ], %o3 * 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 ); if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) 40008dd8: 82 1f 60 03 xor %i5, 3, %g1 the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_reading( 40008ddc: 90 02 20 10 add %o0, 0x10, %o0 40008de0: 80 a0 00 01 cmp %g0, %g1 40008de4: 98 10 20 00 clr %o4 40008de8: b8 60 3f ff subx %g0, -1, %i4 40008dec: 40 00 07 8c call 4000ac1c <_CORE_RWLock_Obtain_for_reading> 40008df0: 94 10 00 1c mov %i4, %o2 do_wait, ticks, NULL ); _Thread_Enable_dispatch(); 40008df4: 40 00 0e 90 call 4000c834 <_Thread_Enable_dispatch> 40008df8: 01 00 00 00 nop if ( !do_wait ) { 40008dfc: 80 a7 20 00 cmp %i4, 0 40008e00: 12 80 00 0e bne 40008e38 40008e04: 03 10 00 6d sethi %hi(0x4001b400), %g1 if ( _Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) { 40008e08: c2 00 60 20 ld [ %g1 + 0x20 ], %g1 ! 4001b420 <_Per_CPU_Information+0x10> 40008e0c: c2 00 60 34 ld [ %g1 + 0x34 ], %g1 40008e10: 80 a0 60 02 cmp %g1, 2 40008e14: 32 80 00 0a bne,a 40008e3c 40008e18: 03 10 00 6d sethi %hi(0x4001b400), %g1 if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID ) 40008e1c: 80 a7 60 00 cmp %i5, 0 40008e20: 22 80 00 0b be,a 40008e4c <== NEVER TAKEN 40008e24: b0 10 20 16 mov 0x16, %i0 <== NOT EXECUTED return EINVAL; if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST || 40008e28: ba 07 7f ff add %i5, -1, %i5 40008e2c: 80 a7 60 01 cmp %i5, 1 40008e30: 08 80 00 07 bleu 40008e4c <== ALWAYS TAKEN 40008e34: b0 10 20 74 mov 0x74, %i0 return ETIMEDOUT; } } return _POSIX_RWLock_Translate_core_RWLock_return_code( (CORE_RWLock_Status) _Thread_Executing->Wait.return_code 40008e38: 03 10 00 6d sethi %hi(0x4001b400), %g1 40008e3c: c2 00 60 20 ld [ %g1 + 0x20 ], %g1 ! 4001b420 <_Per_CPU_Information+0x10> status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; } } return _POSIX_RWLock_Translate_core_RWLock_return_code( 40008e40: 40 00 00 38 call 40008f20 <_POSIX_RWLock_Translate_core_RWLock_return_code> 40008e44: d0 00 60 34 ld [ %g1 + 0x34 ], %o0 40008e48: b0 10 00 08 mov %o0, %i0 case OBJECTS_ERROR: break; } return EINVAL; } 40008e4c: 81 c7 e0 08 ret 40008e50: 81 e8 00 00 restore =============================================================================== 40008e54 : int pthread_rwlock_timedwrlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { 40008e54: 9d e3 bf 98 save %sp, -104, %sp Objects_Locations location; Watchdog_Interval ticks; bool do_wait = true; POSIX_Absolute_timeout_conversion_results_t status; if ( !rwlock ) 40008e58: 80 a6 20 00 cmp %i0, 0 40008e5c: 12 80 00 04 bne 40008e6c 40008e60: 92 07 bf fc add %fp, -4, %o1 #endif case OBJECTS_ERROR: break; } return EINVAL; 40008e64: 81 c7 e0 08 ret 40008e68: 91 e8 20 16 restore %g0, 0x16, %o0 * * 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 ); 40008e6c: 40 00 18 f1 call 4000f230 <_POSIX_Absolute_timeout_to_ticks> 40008e70: 90 10 00 19 mov %i1, %o0 40008e74: d2 06 00 00 ld [ %i0 ], %o1 40008e78: ba 10 00 08 mov %o0, %i5 40008e7c: 94 07 bf f8 add %fp, -8, %o2 40008e80: 11 10 00 6c sethi %hi(0x4001b000), %o0 40008e84: 40 00 0a eb call 4000ba30 <_Objects_Get> 40008e88: 90 12 20 c4 or %o0, 0xc4, %o0 ! 4001b0c4 <_POSIX_RWLock_Information> if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { 40008e8c: c2 07 bf f8 ld [ %fp + -8 ], %g1 40008e90: 80 a0 60 00 cmp %g1, 0 40008e94: 32 80 00 21 bne,a 40008f18 40008e98: b0 10 20 16 mov 0x16, %i0 case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_writing( 40008e9c: d2 06 00 00 ld [ %i0 ], %o1 40008ea0: d6 07 bf fc ld [ %fp + -4 ], %o3 * 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 ); if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) 40008ea4: 82 1f 60 03 xor %i5, 3, %g1 the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { case OBJECTS_LOCAL: _CORE_RWLock_Obtain_for_writing( 40008ea8: 90 02 20 10 add %o0, 0x10, %o0 40008eac: 80 a0 00 01 cmp %g0, %g1 40008eb0: 98 10 20 00 clr %o4 40008eb4: b8 60 3f ff subx %g0, -1, %i4 40008eb8: 40 00 07 8c call 4000ace8 <_CORE_RWLock_Obtain_for_writing> 40008ebc: 94 10 00 1c mov %i4, %o2 do_wait, ticks, NULL ); _Thread_Enable_dispatch(); 40008ec0: 40 00 0e 5d call 4000c834 <_Thread_Enable_dispatch> 40008ec4: 01 00 00 00 nop if ( !do_wait && 40008ec8: 80 a7 20 00 cmp %i4, 0 40008ecc: 12 80 00 0e bne 40008f04 40008ed0: 03 10 00 6d sethi %hi(0x4001b400), %g1 (_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) { 40008ed4: c2 00 60 20 ld [ %g1 + 0x20 ], %g1 ! 4001b420 <_Per_CPU_Information+0x10> ticks, NULL ); _Thread_Enable_dispatch(); if ( !do_wait && 40008ed8: c2 00 60 34 ld [ %g1 + 0x34 ], %g1 40008edc: 80 a0 60 02 cmp %g1, 2 40008ee0: 32 80 00 0a bne,a 40008f08 40008ee4: 03 10 00 6d sethi %hi(0x4001b400), %g1 (_Thread_Executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) { if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID ) 40008ee8: 80 a7 60 00 cmp %i5, 0 40008eec: 22 80 00 0b be,a 40008f18 <== NEVER TAKEN 40008ef0: b0 10 20 16 mov 0x16, %i0 <== NOT EXECUTED return EINVAL; if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST || 40008ef4: ba 07 7f ff add %i5, -1, %i5 40008ef8: 80 a7 60 01 cmp %i5, 1 40008efc: 08 80 00 07 bleu 40008f18 <== ALWAYS TAKEN 40008f00: b0 10 20 74 mov 0x74, %i0 status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; } return _POSIX_RWLock_Translate_core_RWLock_return_code( (CORE_RWLock_Status) _Thread_Executing->Wait.return_code 40008f04: 03 10 00 6d sethi %hi(0x4001b400), %g1 40008f08: c2 00 60 20 ld [ %g1 + 0x20 ], %g1 ! 4001b420 <_Per_CPU_Information+0x10> if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST || status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; } return _POSIX_RWLock_Translate_core_RWLock_return_code( 40008f0c: 40 00 00 05 call 40008f20 <_POSIX_RWLock_Translate_core_RWLock_return_code> 40008f10: d0 00 60 34 ld [ %g1 + 0x34 ], %o0 40008f14: b0 10 00 08 mov %o0, %i0 case OBJECTS_ERROR: break; } return EINVAL; } 40008f18: 81 c7 e0 08 ret 40008f1c: 81 e8 00 00 restore =============================================================================== 400096ac : int pthread_rwlockattr_setpshared( pthread_rwlockattr_t *attr, int pshared ) { 400096ac: 82 10 00 08 mov %o0, %g1 if ( !attr ) 400096b0: 80 a0 60 00 cmp %g1, 0 400096b4: 02 80 00 0a be 400096dc 400096b8: 90 10 20 16 mov 0x16, %o0 return EINVAL; if ( !attr->is_initialized ) 400096bc: c4 00 40 00 ld [ %g1 ], %g2 400096c0: 80 a0 a0 00 cmp %g2, 0 400096c4: 02 80 00 06 be 400096dc 400096c8: 80 a2 60 01 cmp %o1, 1 return EINVAL; switch ( pshared ) { 400096cc: 18 80 00 04 bgu 400096dc <== NEVER TAKEN 400096d0: 01 00 00 00 nop case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; 400096d4: d2 20 60 04 st %o1, [ %g1 + 4 ] return 0; 400096d8: 90 10 20 00 clr %o0 default: return EINVAL; } } 400096dc: 81 c3 e0 08 retl =============================================================================== 4000a6d4 : int pthread_setschedparam( pthread_t thread, int policy, struct sched_param *param ) { 4000a6d4: 9d e3 bf 90 save %sp, -112, %sp int rc; /* * Check all the parameters */ if ( !param ) 4000a6d8: 80 a6 a0 00 cmp %i2, 0 4000a6dc: 02 80 00 40 be 4000a7dc 4000a6e0: b6 10 20 16 mov 0x16, %i3 return EINVAL; rc = _POSIX_Thread_Translate_sched_param( 4000a6e4: 90 10 00 19 mov %i1, %o0 4000a6e8: 92 10 00 1a mov %i2, %o1 4000a6ec: 94 07 bf f4 add %fp, -12, %o2 4000a6f0: 40 00 16 e6 call 40010288 <_POSIX_Thread_Translate_sched_param> 4000a6f4: 96 07 bf f8 add %fp, -8, %o3 policy, param, &budget_algorithm, &budget_callout ); if ( rc ) 4000a6f8: b6 92 20 00 orcc %o0, 0, %i3 4000a6fc: 32 80 00 39 bne,a 4000a7e0 4000a700: b0 10 00 1b mov %i3, %i0 return rc; /* * Actually change the scheduling policy and parameters */ the_thread = _Thread_Get( thread, &location ); 4000a704: 90 10 00 18 mov %i0, %o0 4000a708: 40 00 0b f2 call 4000d6d0 <_Thread_Get> 4000a70c: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 4000a710: c2 07 bf fc ld [ %fp + -4 ], %g1 4000a714: 80 a0 60 00 cmp %g1, 0 4000a718: 12 80 00 30 bne 4000a7d8 4000a71c: b8 10 00 08 mov %o0, %i4 case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4000a720: fa 02 21 50 ld [ %o0 + 0x150 ], %i5 if ( api->schedpolicy == SCHED_SPORADIC ) 4000a724: c2 07 60 84 ld [ %i5 + 0x84 ], %g1 4000a728: 80 a0 60 04 cmp %g1, 4 4000a72c: 32 80 00 05 bne,a 4000a740 4000a730: f2 27 60 84 st %i1, [ %i5 + 0x84 ] (void) _Watchdog_Remove( &api->Sporadic_timer ); 4000a734: 40 00 0f c9 call 4000e658 <_Watchdog_Remove> 4000a738: 90 07 60 a8 add %i5, 0xa8, %o0 api->schedpolicy = policy; 4000a73c: f2 27 60 84 st %i1, [ %i5 + 0x84 ] api->schedparam = *param; 4000a740: 90 07 60 88 add %i5, 0x88, %o0 4000a744: 92 10 00 1a mov %i2, %o1 4000a748: 40 00 22 4b call 40013074 4000a74c: 94 10 20 1c mov 0x1c, %o2 the_thread->budget_algorithm = budget_algorithm; 4000a750: c2 07 bf f4 ld [ %fp + -12 ], %g1 the_thread->budget_callout = budget_callout; switch ( api->schedpolicy ) { 4000a754: 80 a6 60 00 cmp %i1, 0 if ( api->schedpolicy == SCHED_SPORADIC ) (void) _Watchdog_Remove( &api->Sporadic_timer ); api->schedpolicy = policy; api->schedparam = *param; the_thread->budget_algorithm = budget_algorithm; 4000a758: c2 27 20 78 st %g1, [ %i4 + 0x78 ] the_thread->budget_callout = budget_callout; 4000a75c: c2 07 bf f8 ld [ %fp + -8 ], %g1 switch ( api->schedpolicy ) { 4000a760: 06 80 00 1b bl 4000a7cc <== NEVER TAKEN 4000a764: c2 27 20 7c st %g1, [ %i4 + 0x7c ] 4000a768: 80 a6 60 02 cmp %i1, 2 4000a76c: 04 80 00 07 ble 4000a788 4000a770: 03 10 00 71 sethi %hi(0x4001c400), %g1 4000a774: 80 a6 60 04 cmp %i1, 4 4000a778: 12 80 00 15 bne 4000a7cc <== NEVER TAKEN 4000a77c: 01 00 00 00 nop true ); break; case SCHED_SPORADIC: api->ss_high_priority = api->schedparam.sched_priority; 4000a780: 10 80 00 0d b 4000a7b4 4000a784: c2 07 60 88 ld [ %i5 + 0x88 ], %g1 switch ( api->schedpolicy ) { case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; 4000a788: c2 00 62 30 ld [ %g1 + 0x230 ], %g1 the_thread->real_priority = _POSIX_Priority_To_core( api->schedparam.sched_priority ); _Thread_Change_priority( 4000a78c: 90 10 00 1c mov %i4, %o0 switch ( api->schedpolicy ) { case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice; 4000a790: c2 27 20 74 st %g1, [ %i4 + 0x74 ] 4000a794: 03 10 00 6e sethi %hi(0x4001b800), %g1 4000a798: d2 08 60 cc ldub [ %g1 + 0xcc ], %o1 ! 4001b8cc 4000a79c: c2 07 60 88 ld [ %i5 + 0x88 ], %g1 the_thread->real_priority = _POSIX_Priority_To_core( api->schedparam.sched_priority ); _Thread_Change_priority( 4000a7a0: 94 10 20 01 mov 1, %o2 4000a7a4: 92 22 40 01 sub %o1, %g1, %o1 4000a7a8: 40 00 0a a4 call 4000d238 <_Thread_Change_priority> 4000a7ac: d2 27 20 18 st %o1, [ %i4 + 0x18 ] the_thread, the_thread->real_priority, true ); break; 4000a7b0: 30 80 00 07 b,a 4000a7cc case SCHED_SPORADIC: api->ss_high_priority = api->schedparam.sched_priority; _Watchdog_Remove( &api->Sporadic_timer ); 4000a7b4: 90 07 60 a8 add %i5, 0xa8, %o0 4000a7b8: 40 00 0f a8 call 4000e658 <_Watchdog_Remove> 4000a7bc: c2 27 60 a4 st %g1, [ %i5 + 0xa4 ] _POSIX_Threads_Sporadic_budget_TSR( 0, the_thread ); 4000a7c0: 90 10 20 00 clr %o0 4000a7c4: 7f ff ff 7e call 4000a5bc <_POSIX_Threads_Sporadic_budget_TSR> 4000a7c8: 92 10 00 1c mov %i4, %o1 break; } _Thread_Enable_dispatch(); 4000a7cc: 40 00 0b b5 call 4000d6a0 <_Thread_Enable_dispatch> 4000a7d0: b0 10 00 1b mov %i3, %i0 4000a7d4: 30 80 00 03 b,a 4000a7e0 #endif case OBJECTS_ERROR: break; } return ESRCH; 4000a7d8: b6 10 20 03 mov 3, %i3 } 4000a7dc: b0 10 00 1b mov %i3, %i0 4000a7e0: 81 c7 e0 08 ret 4000a7e4: 81 e8 00 00 restore =============================================================================== 40007ff8 : /* * 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183 */ void pthread_testcancel( void ) { 40007ff8: 9d e3 bf a0 save %sp, -96, %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() ) 40007ffc: 03 10 00 64 sethi %hi(0x40019000), %g1 40008000: 82 10 61 50 or %g1, 0x150, %g1 ! 40019150 <_Per_CPU_Information> 40008004: c4 00 60 08 ld [ %g1 + 8 ], %g2 40008008: 80 a0 a0 00 cmp %g2, 0 4000800c: 12 80 00 16 bne 40008064 <== NEVER TAKEN 40008010: 05 10 00 63 sethi %hi(0x40018c00), %g2 return; thread_support = _Thread_Executing->API_Extensions[ THREAD_API_POSIX ]; 40008014: c2 00 60 10 ld [ %g1 + 0x10 ], %g1 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 40008018: c6 00 a0 40 ld [ %g2 + 0x40 ], %g3 4000801c: c2 00 61 50 ld [ %g1 + 0x150 ], %g1 ++level; 40008020: 86 00 e0 01 inc %g3 _Thread_Dispatch_disable_level = level; 40008024: c6 20 a0 40 st %g3, [ %g2 + 0x40 ] _Thread_Disable_dispatch(); if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 40008028: c4 00 60 d8 ld [ %g1 + 0xd8 ], %g2 4000802c: 80 a0 a0 00 cmp %g2, 0 40008030: 12 80 00 05 bne 40008044 <== NEVER TAKEN 40008034: ba 10 20 00 clr %i5 40008038: c2 00 60 e0 ld [ %g1 + 0xe0 ], %g1 4000803c: 80 a0 00 01 cmp %g0, %g1 40008040: ba 40 20 00 addx %g0, 0, %i5 thread_support->cancelation_requested ) cancel = true; _Thread_Enable_dispatch(); 40008044: 40 00 0b 78 call 4000ae24 <_Thread_Enable_dispatch> 40008048: 01 00 00 00 nop if ( cancel ) 4000804c: 80 8f 60 ff btst 0xff, %i5 40008050: 02 80 00 05 be 40008064 40008054: 03 10 00 64 sethi %hi(0x40019000), %g1 _POSIX_Thread_Exit( _Thread_Executing, PTHREAD_CANCELED ); 40008058: f0 00 61 60 ld [ %g1 + 0x160 ], %i0 ! 40019160 <_Per_CPU_Information+0x10> 4000805c: 40 00 16 9b call 4000dac8 <_POSIX_Thread_Exit> 40008060: 93 e8 3f ff restore %g0, -1, %o1 40008064: 81 c7 e0 08 ret 40008068: 81 e8 00 00 restore =============================================================================== 400084fc : * errno - otherwise */ int rtems_aio_enqueue (rtems_aio_request *req) { 400084fc: 9d e3 bf 78 save %sp, -136, %sp struct sched_param param; /* The queue should be initialized */ AIO_assert (aio_request_queue.initialized == AIO_QUEUE_INITIALIZED); result = pthread_mutex_lock (&aio_request_queue.mutex); 40008500: 37 10 00 65 sethi %hi(0x40019400), %i3 * errno - otherwise */ int rtems_aio_enqueue (rtems_aio_request *req) { 40008504: ba 10 00 18 mov %i0, %i5 struct sched_param param; /* The queue should be initialized */ AIO_assert (aio_request_queue.initialized == AIO_QUEUE_INITIALIZED); result = pthread_mutex_lock (&aio_request_queue.mutex); 40008508: 40 00 02 85 call 40008f1c 4000850c: 90 16 e0 cc or %i3, 0xcc, %o0 if (result != 0) { 40008510: b0 92 20 00 orcc %o0, 0, %i0 40008514: 02 80 00 06 be 4000852c <== ALWAYS TAKEN 40008518: 01 00 00 00 nop free (req); 4000851c: 7f ff ef 87 call 40004338 <== NOT EXECUTED 40008520: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED 40008524: 81 c7 e0 08 ret <== NOT EXECUTED 40008528: 81 e8 00 00 restore <== NOT EXECUTED return result; } /* _POSIX_PRIORITIZED_IO and _POSIX_PRIORITY_SCHEDULING are defined, we can use aio_reqprio to lower the priority of the request */ pthread_getschedparam (pthread_self(), &policy, ¶m); 4000852c: 40 00 04 90 call 4000976c 40008530: b6 16 e0 cc or %i3, 0xcc, %i3 40008534: 92 07 bf e0 add %fp, -32, %o1 40008538: 40 00 03 9d call 400093ac 4000853c: 94 07 bf e4 add %fp, -28, %o2 req->caller_thread = pthread_self (); 40008540: 40 00 04 8b call 4000976c 40008544: 01 00 00 00 nop req->priority = param.sched_priority - req->aiocbp->aio_reqprio; 40008548: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 4000854c: c6 07 bf e4 ld [ %fp + -28 ], %g3 40008550: c4 00 60 18 ld [ %g1 + 0x18 ], %g2 /* _POSIX_PRIORITIZED_IO and _POSIX_PRIORITY_SCHEDULING are defined, we can use aio_reqprio to lower the priority of the request */ pthread_getschedparam (pthread_self(), &policy, ¶m); req->caller_thread = pthread_self (); 40008554: d0 27 60 10 st %o0, [ %i5 + 0x10 ] req->priority = param.sched_priority - req->aiocbp->aio_reqprio; 40008558: 84 20 c0 02 sub %g3, %g2, %g2 4000855c: c4 27 60 0c st %g2, [ %i5 + 0xc ] req->policy = policy; 40008560: c4 07 bf e0 ld [ %fp + -32 ], %g2 40008564: c4 27 60 08 st %g2, [ %i5 + 8 ] req->aiocbp->error_code = EINPROGRESS; 40008568: 84 10 20 77 mov 0x77, %g2 4000856c: c4 20 60 34 st %g2, [ %g1 + 0x34 ] req->aiocbp->return_value = 0; if ((aio_request_queue.idle_threads == 0) && 40008570: c4 06 e0 68 ld [ %i3 + 0x68 ], %g2 req->caller_thread = pthread_self (); req->priority = param.sched_priority - req->aiocbp->aio_reqprio; req->policy = policy; req->aiocbp->error_code = EINPROGRESS; req->aiocbp->return_value = 0; 40008574: c0 20 60 38 clr [ %g1 + 0x38 ] if ((aio_request_queue.idle_threads == 0) && 40008578: 80 a0 a0 00 cmp %g2, 0 4000857c: 12 80 00 2e bne 40008634 <== NEVER TAKEN 40008580: d2 00 40 00 ld [ %g1 ], %o1 40008584: c2 06 e0 64 ld [ %i3 + 0x64 ], %g1 40008588: 80 a0 60 04 cmp %g1, 4 4000858c: 14 80 00 2b bg 40008638 40008590: 11 10 00 65 sethi %hi(0x40019400), %o0 aio_request_queue.active_threads < AIO_MAX_THREADS) /* we still have empty places on the active_threads chain */ { chain = &aio_request_queue.work_req; r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1); 40008594: 90 06 e0 48 add %i3, 0x48, %o0 40008598: 7f ff ff 7d call 4000838c 4000859c: 94 10 20 01 mov 1, %o2 if (r_chain->new_fd == 1) { 400085a0: c2 02 20 18 ld [ %o0 + 0x18 ], %g1 if ((aio_request_queue.idle_threads == 0) && aio_request_queue.active_threads < AIO_MAX_THREADS) /* we still have empty places on the active_threads chain */ { chain = &aio_request_queue.work_req; r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1); 400085a4: b8 10 00 08 mov %o0, %i4 if (r_chain->new_fd == 1) { 400085a8: 80 a0 60 01 cmp %g1, 1 400085ac: 12 80 00 1d bne 40008620 400085b0: b4 02 20 08 add %o0, 8, %i2 RTEMS_INLINE_ROUTINE void _Chain_Prepend( Chain_Control *the_chain, Chain_Node *the_node ) { _Chain_Insert(_Chain_Head(the_chain), the_node); 400085b4: 92 10 00 1d mov %i5, %o1 400085b8: 40 00 09 03 call 4000a9c4 <_Chain_Insert> 400085bc: 90 10 00 1a mov %i2, %o0 rtems_chain_prepend (&r_chain->perfd, &req->next_prio); r_chain->new_fd = 0; pthread_mutex_init (&r_chain->mutex, NULL); 400085c0: 92 10 20 00 clr %o1 chain = &aio_request_queue.work_req; r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1); if (r_chain->new_fd == 1) { rtems_chain_prepend (&r_chain->perfd, &req->next_prio); r_chain->new_fd = 0; 400085c4: c0 27 20 18 clr [ %i4 + 0x18 ] pthread_mutex_init (&r_chain->mutex, NULL); 400085c8: 40 00 01 fd call 40008dbc 400085cc: 90 07 20 1c add %i4, 0x1c, %o0 pthread_cond_init (&r_chain->cond, NULL); 400085d0: 92 10 20 00 clr %o1 400085d4: 40 00 00 ff call 400089d0 400085d8: 90 07 20 20 add %i4, 0x20, %o0 AIO_printf ("New thread \n"); result = pthread_create (&thid, &aio_request_queue.attr, 400085dc: 90 07 bf dc add %fp, -36, %o0 400085e0: 92 06 e0 08 add %i3, 8, %o1 400085e4: 15 10 00 1f sethi %hi(0x40007c00), %o2 400085e8: 96 10 00 1c mov %i4, %o3 400085ec: 40 00 02 df call 40009168 400085f0: 94 12 a3 d4 or %o2, 0x3d4, %o2 rtems_aio_handle, (void *) r_chain); if (result != 0) { 400085f4: ba 92 20 00 orcc %o0, 0, %i5 400085f8: 22 80 00 07 be,a 40008614 <== ALWAYS TAKEN 400085fc: c2 06 e0 64 ld [ %i3 + 0x64 ], %g1 pthread_mutex_unlock (&aio_request_queue.mutex); 40008600: 90 10 00 1b mov %i3, %o0 <== NOT EXECUTED 40008604: 40 00 02 67 call 40008fa0 <== NOT EXECUTED 40008608: b0 10 00 1d mov %i5, %i0 <== NOT EXECUTED 4000860c: 81 c7 e0 08 ret <== NOT EXECUTED 40008610: 81 e8 00 00 restore <== NOT EXECUTED return result; } ++aio_request_queue.active_threads; 40008614: 82 00 60 01 inc %g1 40008618: 10 80 00 3a b 40008700 4000861c: c2 26 e0 64 st %g1, [ %i3 + 0x64 ] } else { /* put request in the fd chain it belongs to */ pthread_mutex_lock (&r_chain->mutex); 40008620: b6 02 20 1c add %o0, 0x1c, %i3 40008624: 40 00 02 3e call 40008f1c 40008628: 90 10 00 1b mov %i3, %o0 rtems_aio_insert_prio (&r_chain->perfd, req); 4000862c: 10 80 00 0c b 4000865c 40008630: 90 10 00 1a mov %i2, %o0 else { /* the maximum number of threads has been already created even though some of them might be idle. The request belongs to one of the active fd chain */ r_chain = rtems_aio_search_fd (&aio_request_queue.work_req, 40008634: 11 10 00 65 sethi %hi(0x40019400), %o0 <== NOT EXECUTED 40008638: 94 10 20 00 clr %o2 4000863c: 7f ff ff 54 call 4000838c 40008640: 90 12 21 14 or %o0, 0x114, %o0 req->aiocbp->aio_fildes, 0); if (r_chain != NULL) 40008644: b8 92 20 00 orcc %o0, 0, %i4 40008648: 02 80 00 0d be 4000867c 4000864c: b6 07 20 1c add %i4, 0x1c, %i3 { pthread_mutex_lock (&r_chain->mutex); 40008650: 40 00 02 33 call 40008f1c 40008654: 90 10 00 1b mov %i3, %o0 rtems_aio_insert_prio (&r_chain->perfd, req); 40008658: 90 07 20 08 add %i4, 8, %o0 4000865c: 7f ff fe fc call 4000824c 40008660: 92 10 00 1d mov %i5, %o1 pthread_cond_signal (&r_chain->cond); 40008664: 40 00 01 0a call 40008a8c 40008668: 90 07 20 20 add %i4, 0x20, %o0 pthread_mutex_unlock (&r_chain->mutex); 4000866c: 40 00 02 4d call 40008fa0 40008670: 90 10 00 1b mov %i3, %o0 if (aio_request_queue.idle_threads > 0) pthread_cond_signal (&aio_request_queue.new_req); } } pthread_mutex_unlock (&aio_request_queue.mutex); 40008674: 10 80 00 24 b 40008704 40008678: 11 10 00 65 sethi %hi(0x40019400), %o0 } else { /* or to the idle chain */ chain = &aio_request_queue.idle_req; r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1); 4000867c: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 40008680: 11 10 00 65 sethi %hi(0x40019400), %o0 40008684: d2 00 40 00 ld [ %g1 ], %o1 40008688: 90 12 21 20 or %o0, 0x120, %o0 4000868c: 7f ff ff 40 call 4000838c 40008690: 94 10 20 01 mov 1, %o2 if (r_chain->new_fd == 1) { 40008694: c2 02 20 18 ld [ %o0 + 0x18 ], %g1 } else { /* or to the idle chain */ chain = &aio_request_queue.idle_req; r_chain = rtems_aio_search_fd (chain, req->aiocbp->aio_fildes, 1); 40008698: b8 10 00 08 mov %o0, %i4 4000869c: 92 10 00 1d mov %i5, %o1 if (r_chain->new_fd == 1) { 400086a0: 80 a0 60 01 cmp %g1, 1 400086a4: 12 80 00 0d bne 400086d8 400086a8: 90 02 20 08 add %o0, 8, %o0 400086ac: 40 00 08 c6 call 4000a9c4 <_Chain_Insert> 400086b0: 01 00 00 00 nop /* If this is a new fd chain we signal the idle threads that might be waiting for requests */ AIO_printf (" New chain on waiting queue \n "); rtems_chain_prepend (&r_chain->perfd, &req->next_prio); r_chain->new_fd = 0; pthread_mutex_init (&r_chain->mutex, NULL); 400086b4: 90 07 20 1c add %i4, 0x1c, %o0 if (r_chain->new_fd == 1) { /* If this is a new fd chain we signal the idle threads that might be waiting for requests */ AIO_printf (" New chain on waiting queue \n "); rtems_chain_prepend (&r_chain->perfd, &req->next_prio); r_chain->new_fd = 0; 400086b8: c0 27 20 18 clr [ %i4 + 0x18 ] pthread_mutex_init (&r_chain->mutex, NULL); 400086bc: 40 00 01 c0 call 40008dbc 400086c0: 92 10 20 00 clr %o1 pthread_cond_init (&r_chain->cond, NULL); 400086c4: 90 07 20 20 add %i4, 0x20, %o0 400086c8: 40 00 00 c2 call 400089d0 400086cc: 92 10 20 00 clr %o1 } else /* just insert the request in the existing fd chain */ rtems_aio_insert_prio (&r_chain->perfd, req); if (aio_request_queue.idle_threads > 0) 400086d0: 10 80 00 05 b 400086e4 400086d4: 11 10 00 65 sethi %hi(0x40019400), %o0 r_chain->new_fd = 0; pthread_mutex_init (&r_chain->mutex, NULL); pthread_cond_init (&r_chain->cond, NULL); } else /* just insert the request in the existing fd chain */ rtems_aio_insert_prio (&r_chain->perfd, req); 400086d8: 7f ff fe dd call 4000824c 400086dc: 01 00 00 00 nop if (aio_request_queue.idle_threads > 0) 400086e0: 11 10 00 65 sethi %hi(0x40019400), %o0 400086e4: 90 12 20 cc or %o0, 0xcc, %o0 ! 400194cc 400086e8: c2 02 20 68 ld [ %o0 + 0x68 ], %g1 400086ec: 80 a0 60 00 cmp %g1, 0 400086f0: 24 80 00 05 ble,a 40008704 <== ALWAYS TAKEN 400086f4: 11 10 00 65 sethi %hi(0x40019400), %o0 pthread_cond_signal (&aio_request_queue.new_req); 400086f8: 40 00 00 e5 call 40008a8c <== NOT EXECUTED 400086fc: 90 02 20 04 add %o0, 4, %o0 ! 40019404 <== NOT EXECUTED } } pthread_mutex_unlock (&aio_request_queue.mutex); 40008700: 11 10 00 65 sethi %hi(0x40019400), %o0 40008704: 40 00 02 27 call 40008fa0 40008708: 90 12 20 cc or %o0, 0xcc, %o0 ! 400194cc return 0; } 4000870c: 81 c7 e0 08 ret 40008710: 81 e8 00 00 restore =============================================================================== 40007fd4 : * NULL - if error */ static void * rtems_aio_handle (void *arg) { 40007fd4: 9d e3 bf 78 save %sp, -136, %sp struct timespec timeout; AIO_printf ("Chain is empty [WQ], wait for work\n"); pthread_mutex_unlock (&r_chain->mutex); pthread_mutex_lock (&aio_request_queue.mutex); 40007fd8: 3b 10 00 65 sethi %hi(0x40019400), %i5 40007fdc: ba 17 60 cc or %i5, 0xcc, %i5 ! 400194cc pthread_cond_destroy (&r_chain->cond); free (r_chain); /* If the idle chain is empty sleep for 3 seconds and wait for a signal. The thread now becomes idle. */ if (rtems_chain_is_empty (&aio_request_queue.idle_req)) { 40007fe0: b4 07 60 58 add %i5, 0x58, %i2 rtems_chain_node *node; node = rtems_chain_first (&aio_request_queue.work_req); temp = (rtems_aio_request_chain *) node; while (temp->fildes < r_chain->fildes && 40007fe4: b2 07 60 4c add %i5, 0x4c, %i1 --aio_request_queue.active_threads; clock_gettime (CLOCK_REALTIME, &timeout); timeout.tv_sec += 3; timeout.tv_nsec = 0; result = pthread_cond_timedwait (&aio_request_queue.new_req, 40007fe8: a0 07 60 04 add %i5, 4, %l0 /* acquire the mutex of the current fd chain. we don't need to lock the queue mutex since we can add requests to idle fd chains or even active ones if the working request has been extracted from the chain */ result = pthread_mutex_lock (&r_chain->mutex); 40007fec: b6 06 20 1c add %i0, 0x1c, %i3 40007ff0: 40 00 03 cb call 40008f1c 40007ff4: 90 10 00 1b mov %i3, %o0 if (result != 0) 40007ff8: 80 a2 20 00 cmp %o0, 0 40007ffc: 12 80 00 91 bne 40008240 <== NEVER TAKEN 40008000: 82 06 20 0c add %i0, 0xc, %g1 40008004: f8 06 20 08 ld [ %i0 + 8 ], %i4 /* If the locked chain is not empty, take the first request extract it, unlock the chain and process the request, in this way the user can supply more requests to this fd chain */ if (!rtems_chain_is_empty (chain)) { 40008008: 80 a7 00 01 cmp %i4, %g1 4000800c: 02 80 00 3b be 400080f8 40008010: 01 00 00 00 nop node = rtems_chain_first (chain); req = (rtems_aio_request *) node; /* See _POSIX_PRIORITIZE_IO and _POSIX_PRIORITY_SCHEDULING discussion in rtems_aio_enqueue () */ pthread_getschedparam (pthread_self(), &policy, ¶m); 40008014: 40 00 05 d6 call 4000976c 40008018: 01 00 00 00 nop 4000801c: 92 07 bf d8 add %fp, -40, %o1 40008020: 40 00 04 e3 call 400093ac 40008024: 94 07 bf e4 add %fp, -28, %o2 param.sched_priority = req->priority; 40008028: c2 07 20 0c ld [ %i4 + 0xc ], %g1 pthread_setschedparam (pthread_self(), req->policy, ¶m); 4000802c: 40 00 05 d0 call 4000976c 40008030: c2 27 bf e4 st %g1, [ %fp + -28 ] 40008034: d2 07 20 08 ld [ %i4 + 8 ], %o1 40008038: 40 00 05 d1 call 4000977c 4000803c: 94 07 bf e4 add %fp, -28, %o2 40008040: 40 00 0a 48 call 4000a960 <_Chain_Extract> 40008044: 90 10 00 1c mov %i4, %o0 rtems_chain_extract (node); pthread_mutex_unlock (&r_chain->mutex); 40008048: 40 00 03 d6 call 40008fa0 4000804c: 90 10 00 1b mov %i3, %o0 switch (req->aiocbp->aio_lio_opcode) { 40008050: c2 07 20 14 ld [ %i4 + 0x14 ], %g1 40008054: c4 00 60 30 ld [ %g1 + 0x30 ], %g2 40008058: 80 a0 a0 02 cmp %g2, 2 4000805c: 22 80 00 10 be,a 4000809c 40008060: c4 18 60 08 ldd [ %g1 + 8 ], %g2 40008064: 80 a0 a0 03 cmp %g2, 3 40008068: 02 80 00 15 be 400080bc <== NEVER TAKEN 4000806c: 80 a0 a0 01 cmp %g2, 1 40008070: 32 80 00 19 bne,a 400080d4 <== NEVER TAKEN 40008074: f8 07 20 14 ld [ %i4 + 0x14 ], %i4 <== NOT EXECUTED case LIO_READ: AIO_printf ("read\n"); result = pread (req->aiocbp->aio_fildes, 40008078: c4 18 60 08 ldd [ %g1 + 8 ], %g2 4000807c: d0 00 40 00 ld [ %g1 ], %o0 40008080: d2 00 60 10 ld [ %g1 + 0x10 ], %o1 40008084: d4 00 60 14 ld [ %g1 + 0x14 ], %o2 40008088: 96 10 00 02 mov %g2, %o3 4000808c: 40 00 29 7f call 40012688 40008090: 98 10 00 03 mov %g3, %o4 (void *) req->aiocbp->aio_buf, req->aiocbp->aio_nbytes, req->aiocbp->aio_offset); break; 40008094: 10 80 00 0d b 400080c8 40008098: 80 a2 3f ff cmp %o0, -1 case LIO_WRITE: AIO_printf ("write\n"); result = pwrite (req->aiocbp->aio_fildes, 4000809c: d0 00 40 00 ld [ %g1 ], %o0 400080a0: d2 00 60 10 ld [ %g1 + 0x10 ], %o1 400080a4: d4 00 60 14 ld [ %g1 + 0x14 ], %o2 400080a8: 96 10 00 02 mov %g2, %o3 400080ac: 40 00 29 b5 call 40012780 400080b0: 98 10 00 03 mov %g3, %o4 (void *) req->aiocbp->aio_buf, req->aiocbp->aio_nbytes, req->aiocbp->aio_offset); break; 400080b4: 10 80 00 05 b 400080c8 400080b8: 80 a2 3f ff cmp %o0, -1 case LIO_SYNC: AIO_printf ("sync\n"); result = fsync (req->aiocbp->aio_fildes); 400080bc: 40 00 19 ef call 4000e878 <== NOT EXECUTED 400080c0: d0 00 40 00 ld [ %g1 ], %o0 <== NOT EXECUTED break; default: result = -1; } if (result == -1) { 400080c4: 80 a2 3f ff cmp %o0, -1 <== NOT EXECUTED 400080c8: 32 80 00 09 bne,a 400080ec <== ALWAYS TAKEN 400080cc: c2 07 20 14 ld [ %i4 + 0x14 ], %g1 req->aiocbp->return_value = -1; 400080d0: f8 07 20 14 ld [ %i4 + 0x14 ], %i4 <== NOT EXECUTED 400080d4: 82 10 3f ff mov -1, %g1 <== NOT EXECUTED req->aiocbp->error_code = errno; 400080d8: 40 00 26 80 call 40011ad8 <__errno> <== NOT EXECUTED 400080dc: c2 27 20 38 st %g1, [ %i4 + 0x38 ] <== NOT EXECUTED 400080e0: c2 02 00 00 ld [ %o0 ], %g1 <== NOT EXECUTED 400080e4: 10 bf ff c2 b 40007fec <== NOT EXECUTED 400080e8: c2 27 20 34 st %g1, [ %i4 + 0x34 ] <== NOT EXECUTED } else { req->aiocbp->return_value = result; 400080ec: d0 20 60 38 st %o0, [ %g1 + 0x38 ] req->aiocbp->error_code = 0; 400080f0: 10 bf ff bf b 40007fec 400080f4: c0 20 60 34 clr [ %g1 + 0x34 ] struct timespec timeout; AIO_printf ("Chain is empty [WQ], wait for work\n"); pthread_mutex_unlock (&r_chain->mutex); 400080f8: 40 00 03 aa call 40008fa0 400080fc: 90 10 00 1b mov %i3, %o0 pthread_mutex_lock (&aio_request_queue.mutex); 40008100: 40 00 03 87 call 40008f1c 40008104: 90 10 00 1d mov %i5, %o0 if (rtems_chain_is_empty (chain)) 40008108: c2 06 20 08 ld [ %i0 + 8 ], %g1 4000810c: 80 a0 40 1c cmp %g1, %i4 40008110: 12 80 00 48 bne 40008230 <== NEVER TAKEN 40008114: 92 07 bf dc add %fp, -36, %o1 { clock_gettime (CLOCK_REALTIME, &timeout); 40008118: 40 00 01 c9 call 4000883c 4000811c: 90 10 20 01 mov 1, %o0 timeout.tv_sec += 3; 40008120: c2 07 bf dc ld [ %fp + -36 ], %g1 timeout.tv_nsec = 0; 40008124: c0 27 bf e0 clr [ %fp + -32 ] pthread_mutex_lock (&aio_request_queue.mutex); if (rtems_chain_is_empty (chain)) { clock_gettime (CLOCK_REALTIME, &timeout); timeout.tv_sec += 3; 40008128: 82 00 60 03 add %g1, 3, %g1 timeout.tv_nsec = 0; result = pthread_cond_timedwait (&r_chain->cond, 4000812c: b8 06 20 20 add %i0, 0x20, %i4 pthread_mutex_lock (&aio_request_queue.mutex); if (rtems_chain_is_empty (chain)) { clock_gettime (CLOCK_REALTIME, &timeout); timeout.tv_sec += 3; 40008130: c2 27 bf dc st %g1, [ %fp + -36 ] timeout.tv_nsec = 0; result = pthread_cond_timedwait (&r_chain->cond, 40008134: 90 10 00 1c mov %i4, %o0 40008138: 92 10 00 1d mov %i5, %o1 4000813c: 40 00 02 71 call 40008b00 40008140: 94 07 bf dc add %fp, -36, %o2 &aio_request_queue.mutex, &timeout); /* If no requests were added to the chain we delete the fd chain from the queue and start working with idle fd chains */ if (result == ETIMEDOUT) { 40008144: 80 a2 20 74 cmp %o0, 0x74 40008148: 12 80 00 3a bne 40008230 <== NEVER TAKEN 4000814c: 01 00 00 00 nop 40008150: 40 00 0a 04 call 4000a960 <_Chain_Extract> 40008154: 90 10 00 18 mov %i0, %o0 rtems_chain_extract (&r_chain->next_fd); pthread_mutex_destroy (&r_chain->mutex); 40008158: 40 00 02 c4 call 40008c68 4000815c: 90 10 00 1b mov %i3, %o0 pthread_cond_destroy (&r_chain->cond); 40008160: 40 00 01 e5 call 400088f4 40008164: 90 10 00 1c mov %i4, %o0 free (r_chain); 40008168: 7f ff f0 74 call 40004338 4000816c: 90 10 00 18 mov %i0, %o0 /* If the idle chain is empty sleep for 3 seconds and wait for a signal. The thread now becomes idle. */ if (rtems_chain_is_empty (&aio_request_queue.idle_req)) { 40008170: c2 07 60 54 ld [ %i5 + 0x54 ], %g1 40008174: 80 a0 40 1a cmp %g1, %i2 40008178: 12 80 00 1b bne 400081e4 4000817c: c2 07 60 68 ld [ %i5 + 0x68 ], %g1 AIO_printf ("Chain is empty [IQ], wait for work\n"); ++aio_request_queue.idle_threads; --aio_request_queue.active_threads; clock_gettime (CLOCK_REALTIME, &timeout); 40008180: 92 07 bf dc add %fp, -36, %o1 /* If the idle chain is empty sleep for 3 seconds and wait for a signal. The thread now becomes idle. */ if (rtems_chain_is_empty (&aio_request_queue.idle_req)) { AIO_printf ("Chain is empty [IQ], wait for work\n"); ++aio_request_queue.idle_threads; 40008184: 82 00 60 01 inc %g1 40008188: c2 27 60 68 st %g1, [ %i5 + 0x68 ] --aio_request_queue.active_threads; 4000818c: c2 07 60 64 ld [ %i5 + 0x64 ], %g1 clock_gettime (CLOCK_REALTIME, &timeout); 40008190: 90 10 20 01 mov 1, %o0 signal. The thread now becomes idle. */ if (rtems_chain_is_empty (&aio_request_queue.idle_req)) { AIO_printf ("Chain is empty [IQ], wait for work\n"); ++aio_request_queue.idle_threads; --aio_request_queue.active_threads; 40008194: 82 00 7f ff add %g1, -1, %g1 clock_gettime (CLOCK_REALTIME, &timeout); 40008198: 40 00 01 a9 call 4000883c 4000819c: c2 27 60 64 st %g1, [ %i5 + 0x64 ] timeout.tv_sec += 3; 400081a0: c2 07 bf dc ld [ %fp + -36 ], %g1 timeout.tv_nsec = 0; 400081a4: c0 27 bf e0 clr [ %fp + -32 ] AIO_printf ("Chain is empty [IQ], wait for work\n"); ++aio_request_queue.idle_threads; --aio_request_queue.active_threads; clock_gettime (CLOCK_REALTIME, &timeout); timeout.tv_sec += 3; 400081a8: 82 00 60 03 add %g1, 3, %g1 timeout.tv_nsec = 0; result = pthread_cond_timedwait (&aio_request_queue.new_req, 400081ac: 90 10 00 10 mov %l0, %o0 AIO_printf ("Chain is empty [IQ], wait for work\n"); ++aio_request_queue.idle_threads; --aio_request_queue.active_threads; clock_gettime (CLOCK_REALTIME, &timeout); timeout.tv_sec += 3; 400081b0: c2 27 bf dc st %g1, [ %fp + -36 ] timeout.tv_nsec = 0; result = pthread_cond_timedwait (&aio_request_queue.new_req, 400081b4: 92 10 00 1d mov %i5, %o1 400081b8: 40 00 02 52 call 40008b00 400081bc: 94 07 bf dc add %fp, -36, %o2 &aio_request_queue.mutex, &timeout); /* If no new fd chain was added in the idle requests then this thread is finished */ if (result == ETIMEDOUT) { 400081c0: 80 a2 20 74 cmp %o0, 0x74 400081c4: 12 80 00 08 bne 400081e4 <== NEVER TAKEN 400081c8: c2 07 60 68 ld [ %i5 + 0x68 ], %g1 AIO_printf ("Etimeout\n"); --aio_request_queue.idle_threads; pthread_mutex_unlock (&aio_request_queue.mutex); 400081cc: 90 10 00 1d mov %i5, %o0 /* If no new fd chain was added in the idle requests then this thread is finished */ if (result == ETIMEDOUT) { AIO_printf ("Etimeout\n"); --aio_request_queue.idle_threads; 400081d0: 82 00 7f ff add %g1, -1, %g1 pthread_mutex_unlock (&aio_request_queue.mutex); 400081d4: 40 00 03 73 call 40008fa0 400081d8: c2 27 60 68 st %g1, [ %i5 + 0x68 ] } } AIO_printf ("Thread finished\n"); return NULL; } 400081dc: 81 c7 e0 08 ret 400081e0: 91 e8 20 00 restore %g0, 0, %o0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 400081e4: f0 07 60 54 ld [ %i5 + 0x54 ], %i0 } } /* Otherwise move this chain to the working chain and start the loop all over again */ AIO_printf ("Work on idle\n"); --aio_request_queue.idle_threads; 400081e8: 82 00 7f ff add %g1, -1, %g1 400081ec: c2 27 60 68 st %g1, [ %i5 + 0x68 ] ++aio_request_queue.active_threads; 400081f0: c2 07 60 64 ld [ %i5 + 0x64 ], %g1 400081f4: 90 10 00 18 mov %i0, %o0 400081f8: 82 00 60 01 inc %g1 400081fc: 40 00 09 d9 call 4000a960 <_Chain_Extract> 40008200: c2 27 60 64 st %g1, [ %i5 + 0x64 ] 40008204: c2 07 60 48 ld [ %i5 + 0x48 ], %g1 40008208: c4 06 20 14 ld [ %i0 + 0x14 ], %g2 rtems_chain_node *node; node = rtems_chain_first (&aio_request_queue.work_req); temp = (rtems_aio_request_chain *) node; while (temp->fildes < r_chain->fildes && 4000820c: c6 00 60 14 ld [ %g1 + 0x14 ], %g3 40008210: 80 a0 c0 02 cmp %g3, %g2 40008214: 16 80 00 04 bge 40008224 40008218: 80 a0 40 19 cmp %g1, %i1 4000821c: 32 bf ff fc bne,a 4000820c <== ALWAYS TAKEN 40008220: c2 00 40 00 ld [ %g1 ], %g1 RTEMS_INLINE_ROUTINE void rtems_chain_insert( rtems_chain_node *after_node, rtems_chain_node *the_node ) { _Chain_Insert( after_node, the_node ); 40008224: d0 00 60 04 ld [ %g1 + 4 ], %o0 40008228: 40 00 09 e7 call 4000a9c4 <_Chain_Insert> 4000822c: 92 10 00 18 mov %i0, %o1 } } /* If there was a request added in the initial fd chain then release the mutex and process it */ pthread_mutex_unlock (&aio_request_queue.mutex); 40008230: 40 00 03 5c call 40008fa0 40008234: 90 10 00 1d mov %i5, %o0 /* acquire the mutex of the current fd chain. we don't need to lock the queue mutex since we can add requests to idle fd chains or even active ones if the working request has been extracted from the chain */ result = pthread_mutex_lock (&r_chain->mutex); 40008238: 10 bf ff 6e b 40007ff0 4000823c: b6 06 20 1c add %i0, 0x1c, %i3 } } AIO_printf ("Thread finished\n"); return NULL; } 40008240: b0 10 20 00 clr %i0 <== NOT EXECUTED 40008244: 81 c7 e0 08 ret <== NOT EXECUTED 40008248: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 400082ac : * 0 - if initialization succeeded */ int rtems_aio_init (void) { 400082ac: 9d e3 bf a0 save %sp, -96, %sp int result = 0; result = pthread_attr_init (&aio_request_queue.attr); 400082b0: 3b 10 00 65 sethi %hi(0x40019400), %i5 400082b4: 40 00 03 93 call 40009100 400082b8: 90 17 60 d4 or %i5, 0xd4, %o0 ! 400194d4 if (result != 0) 400082bc: b0 92 20 00 orcc %o0, 0, %i0 400082c0: 12 80 00 31 bne 40008384 <== NEVER TAKEN 400082c4: 90 17 60 d4 or %i5, 0xd4, %o0 return result; result = 400082c8: 40 00 03 9a call 40009130 400082cc: 92 10 20 00 clr %o1 pthread_attr_setdetachstate (&aio_request_queue.attr, PTHREAD_CREATE_DETACHED); if (result != 0) 400082d0: 80 a2 20 00 cmp %o0, 0 400082d4: 22 80 00 05 be,a 400082e8 <== ALWAYS TAKEN 400082d8: 11 10 00 65 sethi %hi(0x40019400), %o0 pthread_attr_destroy (&aio_request_queue.attr); 400082dc: 40 00 03 7d call 400090d0 <== NOT EXECUTED 400082e0: 90 17 60 d4 or %i5, 0xd4, %o0 <== NOT EXECUTED result = pthread_mutex_init (&aio_request_queue.mutex, NULL); 400082e4: 11 10 00 65 sethi %hi(0x40019400), %o0 <== NOT EXECUTED 400082e8: 92 10 20 00 clr %o1 400082ec: 40 00 02 b4 call 40008dbc 400082f0: 90 12 20 cc or %o0, 0xcc, %o0 if (result != 0) 400082f4: 80 a2 20 00 cmp %o0, 0 400082f8: 22 80 00 06 be,a 40008310 <== ALWAYS TAKEN 400082fc: 11 10 00 65 sethi %hi(0x40019400), %o0 pthread_attr_destroy (&aio_request_queue.attr); 40008300: 11 10 00 65 sethi %hi(0x40019400), %o0 <== NOT EXECUTED 40008304: 40 00 03 73 call 400090d0 <== NOT EXECUTED 40008308: 90 12 20 d4 or %o0, 0xd4, %o0 ! 400194d4 <== NOT EXECUTED result = pthread_cond_init (&aio_request_queue.new_req, NULL); 4000830c: 11 10 00 65 sethi %hi(0x40019400), %o0 <== NOT EXECUTED 40008310: 92 10 20 00 clr %o1 40008314: 40 00 01 af call 400089d0 40008318: 90 12 20 d0 or %o0, 0xd0, %o0 if (result != 0) { 4000831c: b0 92 20 00 orcc %o0, 0, %i0 40008320: 02 80 00 09 be 40008344 <== ALWAYS TAKEN 40008324: 03 10 00 65 sethi %hi(0x40019400), %g1 pthread_mutex_destroy (&aio_request_queue.mutex); 40008328: 11 10 00 65 sethi %hi(0x40019400), %o0 <== NOT EXECUTED 4000832c: 40 00 02 4f call 40008c68 <== NOT EXECUTED 40008330: 90 12 20 cc or %o0, 0xcc, %o0 ! 400194cc <== NOT EXECUTED pthread_attr_destroy (&aio_request_queue.attr); 40008334: 11 10 00 65 sethi %hi(0x40019400), %o0 <== NOT EXECUTED 40008338: 40 00 03 66 call 400090d0 <== NOT EXECUTED 4000833c: 90 12 20 d4 or %o0, 0xd4, %o0 ! 400194d4 <== NOT EXECUTED ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 40008340: 03 10 00 65 sethi %hi(0x40019400), %g1 <== NOT EXECUTED 40008344: 82 10 60 cc or %g1, 0xcc, %g1 ! 400194cc 40008348: 84 00 60 4c add %g1, 0x4c, %g2 4000834c: c4 20 60 48 st %g2, [ %g1 + 0x48 ] head->previous = NULL; tail->previous = head; 40008350: 84 00 60 48 add %g1, 0x48, %g2 40008354: c4 20 60 50 st %g2, [ %g1 + 0x50 ] ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 40008358: 84 00 60 58 add %g1, 0x58, %g2 4000835c: c4 20 60 54 st %g2, [ %g1 + 0x54 ] head->previous = NULL; tail->previous = head; 40008360: 84 00 60 54 add %g1, 0x54, %g2 { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; 40008364: c0 20 60 4c clr [ %g1 + 0x4c ] tail->previous = head; 40008368: c4 20 60 5c st %g2, [ %g1 + 0x5c ] { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; 4000836c: c0 20 60 58 clr [ %g1 + 0x58 ] rtems_chain_initialize_empty (&aio_request_queue.work_req); rtems_chain_initialize_empty (&aio_request_queue.idle_req); aio_request_queue.active_threads = 0; aio_request_queue.idle_threads = 0; aio_request_queue.initialized = AIO_QUEUE_INITIALIZED; 40008370: 05 00 00 2c sethi %hi(0xb000), %g2 } rtems_chain_initialize_empty (&aio_request_queue.work_req); rtems_chain_initialize_empty (&aio_request_queue.idle_req); aio_request_queue.active_threads = 0; 40008374: c0 20 60 64 clr [ %g1 + 0x64 ] aio_request_queue.idle_threads = 0; aio_request_queue.initialized = AIO_QUEUE_INITIALIZED; 40008378: 84 10 a0 0b or %g2, 0xb, %g2 rtems_chain_initialize_empty (&aio_request_queue.work_req); rtems_chain_initialize_empty (&aio_request_queue.idle_req); aio_request_queue.active_threads = 0; aio_request_queue.idle_threads = 0; 4000837c: c0 20 60 68 clr [ %g1 + 0x68 ] aio_request_queue.initialized = AIO_QUEUE_INITIALIZED; 40008380: c4 20 60 60 st %g2, [ %g1 + 0x60 ] return result; } 40008384: 81 c7 e0 08 ret 40008388: 81 e8 00 00 restore =============================================================================== 4000824c : 4000824c: c2 02 00 00 ld [ %o0 ], %g1 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 40008250: 86 02 20 04 add %o0, 4, %g3 rtems_chain_node *node; AIO_printf ("FD exists \n"); node = rtems_chain_first (chain); if (rtems_chain_is_empty (chain)) { 40008254: 80 a0 40 03 cmp %g1, %g3 40008258: 02 80 00 0e be 40008290 <== NEVER TAKEN 4000825c: 84 10 00 09 mov %o1, %g2 AIO_printf ("First in chain \n"); rtems_chain_prepend (chain, &req->next_prio); } else { AIO_printf ("Add by priority \n"); int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio; 40008260: c8 00 60 14 ld [ %g1 + 0x14 ], %g4 while (req->aiocbp->aio_reqprio > prio && 40008264: da 02 60 14 ld [ %o1 + 0x14 ], %o5 if (rtems_chain_is_empty (chain)) { AIO_printf ("First in chain \n"); rtems_chain_prepend (chain, &req->next_prio); } else { AIO_printf ("Add by priority \n"); int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio; 40008268: c8 01 20 18 ld [ %g4 + 0x18 ], %g4 while (req->aiocbp->aio_reqprio > prio && 4000826c: 10 80 00 04 b 4000827c 40008270: da 03 60 18 ld [ %o5 + 0x18 ], %o5 !rtems_chain_is_tail (chain, node)) { node = rtems_chain_next (node); prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio; 40008274: c8 00 60 14 ld [ %g1 + 0x14 ], %g4 <== NOT EXECUTED 40008278: c8 01 20 18 ld [ %g4 + 0x18 ], %g4 <== NOT EXECUTED rtems_chain_prepend (chain, &req->next_prio); } else { AIO_printf ("Add by priority \n"); int prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio; while (req->aiocbp->aio_reqprio > prio && 4000827c: 80 a3 40 04 cmp %o5, %g4 40008280: 14 80 00 07 bg 4000829c <== NEVER TAKEN 40008284: 80 a0 40 03 cmp %g1, %g3 40008288: d0 00 60 04 ld [ %g1 + 4 ], %o0 4000828c: 92 10 00 02 mov %g2, %o1 40008290: 82 13 c0 00 mov %o7, %g1 40008294: 40 00 09 cc call 4000a9c4 <_Chain_Insert> 40008298: 9e 10 40 00 mov %g1, %o7 4000829c: 32 bf ff f6 bne,a 40008274 <== NOT EXECUTED 400082a0: c2 00 40 00 ld [ %g1 ], %g1 <== NOT EXECUTED 400082a4: 10 bf ff fa b 4000828c <== NOT EXECUTED 400082a8: d0 00 60 04 ld [ %g1 + 4 ], %o0 <== NOT EXECUTED =============================================================================== 4000847c : * AIO_NOTCANCELED - if request was not canceled * AIO_CANCELED - if request was canceled */ int rtems_aio_remove_req (rtems_chain_control *chain, struct aiocb *aiocbp) { 4000847c: 9d e3 bf a0 save %sp, -96, %sp */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 40008480: fa 06 00 00 ld [ %i0 ], %i5 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 40008484: 82 06 20 04 add %i0, 4, %g1 if (rtems_chain_is_empty (chain)) 40008488: 80 a7 40 01 cmp %i5, %g1 4000848c: 12 80 00 09 bne 400084b0 40008490: b0 10 20 02 mov 2, %i0 40008494: 81 c7 e0 08 ret 40008498: 81 e8 00 00 restore rtems_chain_node *node = rtems_chain_first (chain); rtems_aio_request *current; current = (rtems_aio_request *) node; while (!rtems_chain_is_tail (chain, node) && current->aiocbp != aiocbp) { 4000849c: 80 a7 40 01 cmp %i5, %g1 <== NOT EXECUTED 400084a0: 32 80 00 05 bne,a 400084b4 <== NOT EXECUTED 400084a4: c4 07 60 14 ld [ %i5 + 0x14 ], %g2 <== NOT EXECUTED node = rtems_chain_next (node); current = (rtems_aio_request *) node; } if (rtems_chain_is_tail (chain, node)) return AIO_NOTCANCELED; 400084a8: 81 c7 e0 08 ret <== NOT EXECUTED 400084ac: 91 e8 20 01 restore %g0, 1, %o0 <== NOT EXECUTED rtems_chain_node *node = rtems_chain_first (chain); rtems_aio_request *current; current = (rtems_aio_request *) node; while (!rtems_chain_is_tail (chain, node) && current->aiocbp != aiocbp) { 400084b0: c4 07 60 14 ld [ %i5 + 0x14 ], %g2 400084b4: 80 a0 80 19 cmp %g2, %i1 400084b8: 32 bf ff f9 bne,a 4000849c <== NEVER TAKEN 400084bc: fa 07 40 00 ld [ %i5 ], %i5 <== NOT EXECUTED node = rtems_chain_next (node); current = (rtems_aio_request *) node; } if (rtems_chain_is_tail (chain, node)) 400084c0: 80 a7 40 01 cmp %i5, %g1 400084c4: 02 bf ff f4 be 40008494 <== NEVER TAKEN 400084c8: b0 10 20 01 mov 1, %i0 400084cc: 40 00 09 25 call 4000a960 <_Chain_Extract> 400084d0: 90 10 00 1d mov %i5, %o0 return AIO_NOTCANCELED; else { rtems_chain_extract (node); current->aiocbp->error_code = ECANCELED; 400084d4: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 400084d8: 84 10 20 8c mov 0x8c, %g2 400084dc: c4 20 60 34 st %g2, [ %g1 + 0x34 ] current->aiocbp->return_value = -1; 400084e0: 84 10 3f ff mov -1, %g2 free (current); 400084e4: 90 10 00 1d mov %i5, %o0 return AIO_NOTCANCELED; else { rtems_chain_extract (node); current->aiocbp->error_code = ECANCELED; current->aiocbp->return_value = -1; 400084e8: c4 20 60 38 st %g2, [ %g1 + 0x38 ] free (current); 400084ec: 7f ff ef 93 call 40004338 400084f0: b0 10 20 00 clr %i0 } return AIO_CANCELED; } 400084f4: 81 c7 e0 08 ret 400084f8: 81 e8 00 00 restore =============================================================================== 4000895c : rtems_chain_control *chain, rtems_event_set events, rtems_interval timeout, rtems_chain_node **node_ptr ) { 4000895c: 9d e3 bf 98 save %sp, -104, %sp 40008960: 30 80 00 08 b,a 40008980 while ( sc == RTEMS_SUCCESSFUL && (node = rtems_chain_get( chain )) == NULL ) { rtems_event_set out; sc = rtems_event_receive( 40008964: 92 10 20 00 clr %o1 40008968: 94 10 00 1a mov %i2, %o2 4000896c: 7f ff fc fb call 40007d58 40008970: 96 07 bf fc add %fp, -4, %o3 ) { rtems_status_code sc = RTEMS_SUCCESSFUL; rtems_chain_node *node = NULL; while ( 40008974: 80 a2 20 00 cmp %o0, 0 40008978: 32 80 00 09 bne,a 4000899c <== ALWAYS TAKEN 4000897c: fa 26 c0 00 st %i5, [ %i3 ] */ RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get( rtems_chain_control *the_chain ) { return _Chain_Get( the_chain ); 40008980: 40 00 01 83 call 40008f8c <_Chain_Get> 40008984: 90 10 00 18 mov %i0, %o0 sc == RTEMS_SUCCESSFUL && (node = rtems_chain_get( chain )) == NULL 40008988: ba 92 20 00 orcc %o0, 0, %i5 4000898c: 02 bf ff f6 be 40008964 40008990: 90 10 00 19 mov %i1, %o0 40008994: 90 10 20 00 clr %o0 timeout, &out ); } *node_ptr = node; 40008998: fa 26 c0 00 st %i5, [ %i3 ] return sc; } 4000899c: 81 c7 e0 08 ret 400089a0: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 400119d8 : rtems_event_set event_in, rtems_option option_set, rtems_interval ticks, rtems_event_set *event_out ) { 400119d8: 9d e3 bf 98 save %sp, -104, %sp rtems_status_code sc; if ( event_out != NULL ) { 400119dc: 80 a6 e0 00 cmp %i3, 0 400119e0: 02 80 00 1e be 40011a58 <== NEVER TAKEN 400119e4: 82 10 20 09 mov 9, %g1 Thread_Control *executing = _Thread_Executing; 400119e8: 03 10 00 6f sethi %hi(0x4001bc00), %g1 400119ec: fa 00 62 60 ld [ %g1 + 0x260 ], %i5 ! 4001be60 <_Per_CPU_Information+0x10> RTEMS_API_Control *api = executing->API_Extensions[ THREAD_API_RTEMS ]; Event_Control *event = &api->System_event; if ( !_Event_sets_Is_empty( event_in ) ) { 400119f0: 80 a6 20 00 cmp %i0, 0 400119f4: 02 80 00 16 be 40011a4c <== NEVER TAKEN 400119f8: da 07 61 4c ld [ %i5 + 0x14c ], %o5 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 400119fc: 03 10 00 6e sethi %hi(0x4001b800), %g1 40011a00: c4 00 61 40 ld [ %g1 + 0x140 ], %g2 ! 4001b940 <_Thread_Dispatch_disable_level> ++level; 40011a04: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 40011a08: c4 20 61 40 st %g2, [ %g1 + 0x140 ] _Thread_Disable_dispatch(); _Event_Seize( 40011a0c: 03 10 00 70 sethi %hi(0x4001c000), %g1 40011a10: 82 10 62 50 or %g1, 0x250, %g1 ! 4001c250 <_System_event_Sync_state> 40011a14: 90 10 00 18 mov %i0, %o0 40011a18: c2 23 a0 5c st %g1, [ %sp + 0x5c ] 40011a1c: 92 10 00 19 mov %i1, %o1 40011a20: 03 00 01 00 sethi %hi(0x40000), %g1 40011a24: 94 10 00 1a mov %i2, %o2 40011a28: 96 10 00 1b mov %i3, %o3 40011a2c: 98 10 00 1d mov %i5, %o4 40011a30: 9a 03 60 04 add %o5, 4, %o5 40011a34: 7f ff dd 1a call 40008e9c <_Event_Seize> 40011a38: c2 23 a0 60 st %g1, [ %sp + 0x60 ] executing, event, &_System_event_Sync_state, STATES_WAITING_FOR_SYSTEM_EVENT ); _Thread_Enable_dispatch(); 40011a3c: 7f ff e8 f9 call 4000be20 <_Thread_Enable_dispatch> 40011a40: 01 00 00 00 nop sc = executing->Wait.return_code; 40011a44: 10 80 00 05 b 40011a58 40011a48: c2 07 60 34 ld [ %i5 + 0x34 ], %g1 } else { *event_out = event->pending_events; 40011a4c: c2 03 60 04 ld [ %o5 + 4 ], %g1 <== NOT EXECUTED 40011a50: c2 26 c0 00 st %g1, [ %i3 ] <== NOT EXECUTED sc = RTEMS_SUCCESSFUL; 40011a54: 82 10 20 00 clr %g1 <== NOT EXECUTED } else { sc = RTEMS_INVALID_ADDRESS; } return sc; } 40011a58: 81 c7 e0 08 ret 40011a5c: 91 e8 00 01 restore %g0, %g1, %o0 =============================================================================== 400081c0 : rtems_status_code rtems_event_system_send( rtems_id id, rtems_event_set event_in ) { 400081c0: 9d e3 bf 98 save %sp, -104, %sp rtems_status_code sc; Thread_Control *thread; Objects_Locations location; RTEMS_API_Control *api; thread = _Thread_Get( id, &location ); 400081c4: 90 10 00 18 mov %i0, %o0 400081c8: 40 00 09 c0 call 4000a8c8 <_Thread_Get> 400081cc: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 400081d0: c4 07 bf fc ld [ %fp + -4 ], %g2 400081d4: 80 a0 a0 00 cmp %g2, 0 400081d8: 12 80 00 0d bne 4000820c <== NEVER TAKEN 400081dc: 92 10 00 19 mov %i1, %o1 case OBJECTS_LOCAL: api = thread->API_Extensions[ THREAD_API_RTEMS ]; _Event_Surrender( 400081e0: d4 02 21 4c ld [ %o0 + 0x14c ], %o2 400081e4: 94 02 a0 04 add %o2, 4, %o2 400081e8: 19 00 01 00 sethi %hi(0x40000), %o4 400081ec: 17 10 00 7f sethi %hi(0x4001fc00), %o3 400081f0: 96 12 e1 90 or %o3, 0x190, %o3 ! 4001fd90 <_System_event_Sync_state> 400081f4: 7f ff fe 64 call 40007b84 <_Event_Surrender> 400081f8: b0 10 20 00 clr %i0 event_in, &api->System_event, &_System_event_Sync_state, STATES_WAITING_FOR_SYSTEM_EVENT ); _Thread_Enable_dispatch(); 400081fc: 40 00 09 a7 call 4000a898 <_Thread_Enable_dispatch> 40008200: 01 00 00 00 nop sc = RTEMS_SUCCESSFUL; break; 40008204: 81 c7 e0 08 ret 40008208: 81 e8 00 00 restore sc = RTEMS_INVALID_ID; break; } return sc; } 4000820c: 81 c7 e0 08 ret <== NOT EXECUTED 40008210: 91 e8 20 04 restore %g0, 4, %o0 <== NOT EXECUTED =============================================================================== 4000acdc : #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) { 4000acdc: 9d e3 bf a0 save %sp, -96, %sp uint32_t i; uint32_t api_index; Thread_Control *the_thread; Objects_Information *information; if ( !routine ) 4000ace0: ba 10 20 01 mov 1, %i5 4000ace4: 80 a6 20 00 cmp %i0, 0 4000ace8: 02 80 00 0d be 4000ad1c <== NEVER TAKEN 4000acec: 35 10 00 88 sethi %hi(0x40022000), %i2 #endif #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) 4000acf0: 83 2f 60 02 sll %i5, 2, %g1 #if !defined(RTEMS_POSIX_API) || defined(RTEMS_DEBUG) if ( !_Objects_Information_table[ api_index ] ) continue; #endif information = _Objects_Information_table[ api_index ][ 1 ]; 4000acf4: 84 16 a0 34 or %i2, 0x34, %g2 4000acf8: c2 00 80 01 ld [ %g2 + %g1 ], %g1 4000acfc: f6 00 60 04 ld [ %g1 + 4 ], %i3 if ( !information ) 4000ad00: 80 a6 e0 00 cmp %i3, 0 4000ad04: 12 80 00 0f bne 4000ad40 4000ad08: b8 10 20 01 mov 1, %i4 Objects_Information *information; if ( !routine ) return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { 4000ad0c: ba 07 60 01 inc %i5 4000ad10: 80 a7 60 04 cmp %i5, 4 4000ad14: 12 bf ff f8 bne 4000acf4 4000ad18: 83 2f 60 02 sll %i5, 2, %g1 4000ad1c: 81 c7 e0 08 ret 4000ad20: 81 e8 00 00 restore information = _Objects_Information_table[ api_index ][ 1 ]; if ( !information ) continue; for ( i=1 ; i <= information->maximum ; i++ ) { the_thread = (Thread_Control *)information->local_table[ i ]; 4000ad24: 83 2f 20 02 sll %i4, 2, %g1 4000ad28: d0 00 80 01 ld [ %g2 + %g1 ], %o0 if ( !the_thread ) 4000ad2c: 80 a2 20 00 cmp %o0, 0 4000ad30: 02 80 00 04 be 4000ad40 <== NEVER TAKEN 4000ad34: b8 07 20 01 inc %i4 continue; (*routine)(the_thread); 4000ad38: 9f c6 00 00 call %i0 4000ad3c: 01 00 00 00 nop information = _Objects_Information_table[ api_index ][ 1 ]; if ( !information ) continue; for ( i=1 ; i <= information->maximum ; i++ ) { 4000ad40: c2 16 e0 10 lduh [ %i3 + 0x10 ], %g1 4000ad44: 80 a7 00 01 cmp %i4, %g1 4000ad48: 28 bf ff f7 bleu,a 4000ad24 4000ad4c: c4 06 e0 1c ld [ %i3 + 0x1c ], %g2 Objects_Information *information; if ( !routine ) return; for ( api_index = 1 ; api_index <= OBJECTS_APIS_LAST ; api_index++ ) { 4000ad50: 10 bf ff f0 b 4000ad10 4000ad54: ba 07 60 01 inc %i5 =============================================================================== 400094a8 : uint32_t length, uint32_t buffer_size, rtems_attribute attribute_set, rtems_id *id ) { 400094a8: 9d e3 bf a0 save %sp, -96, %sp register Partition_Control *the_partition; if ( !rtems_is_name_valid( name ) ) 400094ac: 80 a6 20 00 cmp %i0, 0 400094b0: 02 80 00 38 be 40009590 400094b4: 82 10 20 03 mov 3, %g1 return RTEMS_INVALID_NAME; if ( !starting_address ) 400094b8: 80 a6 60 00 cmp %i1, 0 400094bc: 02 80 00 35 be 40009590 400094c0: 82 10 20 09 mov 9, %g1 return RTEMS_INVALID_ADDRESS; if ( !id ) 400094c4: 80 a7 60 00 cmp %i5, 0 400094c8: 02 80 00 32 be 40009590 <== NEVER TAKEN 400094cc: 80 a6 e0 00 cmp %i3, 0 return RTEMS_INVALID_ADDRESS; if ( length == 0 || buffer_size == 0 || length < buffer_size || 400094d0: 02 80 00 30 be 40009590 400094d4: 82 10 20 08 mov 8, %g1 400094d8: 80 a6 a0 00 cmp %i2, 0 400094dc: 02 80 00 2d be 40009590 400094e0: 80 a6 80 1b cmp %i2, %i3 400094e4: 0a 80 00 2b bcs 40009590 400094e8: 80 8e e0 07 btst 7, %i3 400094ec: 12 80 00 29 bne 40009590 400094f0: 80 8e 60 07 btst 7, %i1 !_Partition_Is_buffer_size_aligned( buffer_size ) ) return RTEMS_INVALID_SIZE; if ( !_Addresses_Is_aligned( starting_address ) ) 400094f4: 12 80 00 27 bne 40009590 400094f8: 82 10 20 09 mov 9, %g1 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 400094fc: 03 10 00 8f sethi %hi(0x40023c00), %g1 40009500: c4 00 62 80 ld [ %g1 + 0x280 ], %g2 ! 40023e80 <_Thread_Dispatch_disable_level> ++level; 40009504: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 40009508: c4 20 62 80 st %g2, [ %g1 + 0x280 ] * This function allocates a partition control block from * the inactive chain of free partition control blocks. */ RTEMS_INLINE_ROUTINE Partition_Control *_Partition_Allocate ( void ) { return (Partition_Control *) _Objects_Allocate( &_Partition_Information ); 4000950c: 23 10 00 8f sethi %hi(0x40023c00), %l1 40009510: 40 00 07 08 call 4000b130 <_Objects_Allocate> 40009514: 90 14 60 7c or %l1, 0x7c, %o0 ! 40023c7c <_Partition_Information> _Thread_Disable_dispatch(); /* prevents deletion */ the_partition = _Partition_Allocate(); if ( !the_partition ) { 40009518: a0 92 20 00 orcc %o0, 0, %l0 4000951c: 32 80 00 06 bne,a 40009534 40009520: f8 24 20 1c st %i4, [ %l0 + 0x1c ] _Thread_Enable_dispatch(); 40009524: 40 00 0c 03 call 4000c530 <_Thread_Enable_dispatch> 40009528: 01 00 00 00 nop return RTEMS_TOO_MANY; 4000952c: 10 80 00 19 b 40009590 40009530: 82 10 20 05 mov 5, %g1 ! 5 the_partition->buffer_size = buffer_size; the_partition->attribute_set = attribute_set; the_partition->number_of_used_blocks = 0; _Chain_Initialize( &the_partition->Memory, starting_address, length / buffer_size, buffer_size ); 40009534: 92 10 00 1b mov %i3, %o1 _Thread_Enable_dispatch(); return RTEMS_TOO_MANY; } #endif the_partition->starting_address = starting_address; 40009538: f2 24 20 10 st %i1, [ %l0 + 0x10 ] the_partition->length = length; 4000953c: f4 24 20 14 st %i2, [ %l0 + 0x14 ] the_partition->buffer_size = buffer_size; 40009540: f6 24 20 18 st %i3, [ %l0 + 0x18 ] the_partition->attribute_set = attribute_set; the_partition->number_of_used_blocks = 0; 40009544: c0 24 20 20 clr [ %l0 + 0x20 ] _Chain_Initialize( &the_partition->Memory, starting_address, length / buffer_size, buffer_size ); 40009548: 40 00 45 b3 call 4001ac14 <.udiv> 4000954c: 90 10 00 1a mov %i2, %o0 the_partition->length = length; the_partition->buffer_size = buffer_size; the_partition->attribute_set = attribute_set; the_partition->number_of_used_blocks = 0; _Chain_Initialize( &the_partition->Memory, starting_address, 40009550: 92 10 00 19 mov %i1, %o1 length / buffer_size, buffer_size ); 40009554: 94 10 00 08 mov %o0, %o2 the_partition->length = length; the_partition->buffer_size = buffer_size; the_partition->attribute_set = attribute_set; the_partition->number_of_used_blocks = 0; _Chain_Initialize( &the_partition->Memory, starting_address, 40009558: 96 10 00 1b mov %i3, %o3 4000955c: b8 04 20 24 add %l0, 0x24, %i4 40009560: 40 00 04 74 call 4000a730 <_Chain_Initialize> 40009564: 90 10 00 1c mov %i4, %o0 Objects_Information *information, Objects_Control *the_object, Objects_Name name ) { _Objects_Set_local_object( 40009568: c4 14 20 0a lduh [ %l0 + 0xa ], %g2 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4000956c: a2 14 60 7c or %l1, 0x7c, %l1 40009570: c6 04 60 1c ld [ %l1 + 0x1c ], %g3 Objects_Information *information, Objects_Control *the_object, Objects_Name name ) { _Objects_Set_local_object( 40009574: c2 04 20 08 ld [ %l0 + 8 ], %g1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 40009578: 85 28 a0 02 sll %g2, 2, %g2 4000957c: e0 20 c0 02 st %l0, [ %g3 + %g2 ] information, _Objects_Get_index( the_object->id ), the_object ); the_object->name = name; 40009580: f0 24 20 0c st %i0, [ %l0 + 0xc ] name, 0 /* Not used */ ); #endif _Thread_Enable_dispatch(); 40009584: 40 00 0b eb call 4000c530 <_Thread_Enable_dispatch> 40009588: c2 27 40 00 st %g1, [ %i5 ] return RTEMS_SUCCESSFUL; 4000958c: 82 10 20 00 clr %g1 } 40009590: 81 c7 e0 08 ret 40009594: 91 e8 00 01 restore %g0, %g1, %o0 =============================================================================== 40016c88 : rtems_status_code rtems_partition_return_buffer( rtems_id id, void *buffer ) { 40016c88: 9d e3 bf 98 save %sp, -104, %sp RTEMS_INLINE_ROUTINE Partition_Control *_Partition_Get ( Objects_Id id, Objects_Locations *location ) { return (Partition_Control *) 40016c8c: 11 10 00 f9 sethi %hi(0x4003e400), %o0 40016c90: 92 10 00 18 mov %i0, %o1 40016c94: 90 12 22 0c or %o0, 0x20c, %o0 40016c98: 40 00 14 2b call 4001bd44 <_Objects_Get> 40016c9c: 94 07 bf fc add %fp, -4, %o2 register Partition_Control *the_partition; Objects_Locations location; the_partition = _Partition_Get( id, &location ); switch ( location ) { 40016ca0: c2 07 bf fc ld [ %fp + -4 ], %g1 40016ca4: 80 a0 60 00 cmp %g1, 0 40016ca8: 12 80 00 21 bne 40016d2c 40016cac: ba 10 00 08 mov %o0, %i5 ) { void *starting; void *ending; starting = the_partition->starting_address; 40016cb0: d0 02 20 10 ld [ %o0 + 0x10 ], %o0 40016cb4: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 40016cb8: 82 02 00 01 add %o0, %g1, %g1 ending = _Addresses_Add_offset( starting, the_partition->length ); return ( _Addresses_Is_in_range( the_buffer, starting, ending ) && 40016cbc: 80 a6 40 01 cmp %i1, %g1 40016cc0: 18 80 00 0b bgu 40016cec <== NEVER TAKEN 40016cc4: 82 10 20 00 clr %g1 40016cc8: 80 a6 40 08 cmp %i1, %o0 40016ccc: 0a 80 00 09 bcs 40016cf0 40016cd0: 80 a0 60 00 cmp %g1, 0 offset = (uint32_t) _Addresses_Subtract( the_buffer, the_partition->starting_address ); return ((offset % the_partition->buffer_size) == 0); 40016cd4: d2 07 60 18 ld [ %i5 + 0x18 ], %o1 40016cd8: 40 00 58 3d call 4002cdcc <.urem> 40016cdc: 90 26 40 08 sub %i1, %o0, %o0 starting = the_partition->starting_address; ending = _Addresses_Add_offset( starting, the_partition->length ); return ( _Addresses_Is_in_range( the_buffer, starting, ending ) && 40016ce0: 80 a0 00 08 cmp %g0, %o0 40016ce4: 10 80 00 02 b 40016cec 40016ce8: 82 60 3f ff subx %g0, -1, %g1 case OBJECTS_LOCAL: if ( _Partition_Is_buffer_valid( buffer, the_partition ) ) { 40016cec: 80 a0 60 00 cmp %g1, 0 40016cf0: 02 80 00 0b be 40016d1c 40016cf4: 90 07 60 24 add %i5, 0x24, %o0 RTEMS_INLINE_ROUTINE void _Partition_Free_buffer ( Partition_Control *the_partition, Chain_Node *the_buffer ) { _Chain_Append( &the_partition->Memory, the_buffer ); 40016cf8: 40 00 0c 98 call 40019f58 <_Chain_Append> 40016cfc: 92 10 00 19 mov %i1, %o1 _Partition_Free_buffer( the_partition, buffer ); the_partition->number_of_used_blocks -= 1; 40016d00: c2 07 60 20 ld [ %i5 + 0x20 ], %g1 _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; 40016d04: b0 10 20 00 clr %i0 switch ( location ) { case OBJECTS_LOCAL: if ( _Partition_Is_buffer_valid( buffer, the_partition ) ) { _Partition_Free_buffer( the_partition, buffer ); the_partition->number_of_used_blocks -= 1; 40016d08: 82 00 7f ff add %g1, -1, %g1 _Thread_Enable_dispatch(); 40016d0c: 40 00 17 b9 call 4001cbf0 <_Thread_Enable_dispatch> 40016d10: c2 27 60 20 st %g1, [ %i5 + 0x20 ] 40016d14: 81 c7 e0 08 ret 40016d18: 81 e8 00 00 restore return RTEMS_SUCCESSFUL; } _Thread_Enable_dispatch(); 40016d1c: 40 00 17 b5 call 4001cbf0 <_Thread_Enable_dispatch> 40016d20: b0 10 20 09 mov 9, %i0 40016d24: 81 c7 e0 08 ret 40016d28: 81 e8 00 00 restore case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 40016d2c: 81 c7 e0 08 ret 40016d30: 91 e8 20 04 restore %g0, 4, %o0 =============================================================================== 400338bc : rtems_status_code rtems_rate_monotonic_period( rtems_id id, rtems_interval length ) { 400338bc: 9d e3 bf 98 save %sp, -104, %sp 400338c0: 11 10 01 93 sethi %hi(0x40064c00), %o0 400338c4: 92 10 00 18 mov %i0, %o1 400338c8: 90 12 23 08 or %o0, 0x308, %o0 400338cc: 7f ff 56 c1 call 400093d0 <_Objects_Get> 400338d0: 94 07 bf fc add %fp, -4, %o2 rtems_rate_monotonic_period_states local_state; ISR_Level level; the_period = _Rate_monotonic_Get( id, &location ); switch ( location ) { 400338d4: c2 07 bf fc ld [ %fp + -4 ], %g1 400338d8: 80 a0 60 00 cmp %g1, 0 400338dc: 12 80 00 6a bne 40033a84 400338e0: ba 10 00 08 mov %o0, %i5 RTEMS_INLINE_ROUTINE bool _Thread_Is_executing ( const Thread_Control *the_thread ) { return ( the_thread == _Thread_Executing ); 400338e4: 37 10 01 92 sethi %hi(0x40064800), %i3 case OBJECTS_LOCAL: if ( !_Thread_Is_executing( the_period->owner ) ) { 400338e8: c4 02 20 40 ld [ %o0 + 0x40 ], %g2 400338ec: b6 16 e1 40 or %i3, 0x140, %i3 400338f0: c2 06 e0 10 ld [ %i3 + 0x10 ], %g1 400338f4: 80 a0 80 01 cmp %g2, %g1 400338f8: 02 80 00 06 be 40033910 400338fc: 80 a6 60 00 cmp %i1, 0 _Thread_Enable_dispatch(); 40033900: 7f ff 5a 35 call 4000a1d4 <_Thread_Enable_dispatch> 40033904: b0 10 20 17 mov 0x17, %i0 40033908: 81 c7 e0 08 ret 4003390c: 81 e8 00 00 restore return RTEMS_NOT_OWNER_OF_RESOURCE; } if ( length == RTEMS_PERIOD_STATUS ) { 40033910: 12 80 00 0d bne 40033944 40033914: 01 00 00 00 nop switch ( the_period->state ) { 40033918: c2 02 20 38 ld [ %o0 + 0x38 ], %g1 4003391c: 80 a0 60 04 cmp %g1, 4 40033920: 18 80 00 05 bgu 40033934 <== NEVER TAKEN 40033924: b0 10 20 00 clr %i0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 40033928: 05 10 01 78 sethi %hi(0x4005e000), %g2 4003392c: 84 10 a0 f8 or %g2, 0xf8, %g2 ! 4005e0f8 40033930: f0 08 80 01 ldub [ %g2 + %g1 ], %i0 case RATE_MONOTONIC_ACTIVE: default: /* unreached -- only to remove warnings */ return_value = RTEMS_SUCCESSFUL; break; } _Thread_Enable_dispatch(); 40033934: 7f ff 5a 28 call 4000a1d4 <_Thread_Enable_dispatch> 40033938: 01 00 00 00 nop 4003393c: 81 c7 e0 08 ret 40033940: 81 e8 00 00 restore return( return_value ); } _ISR_Disable( level ); 40033944: 7f ff 3a 24 call 400021d4 40033948: 01 00 00 00 nop 4003394c: b4 10 00 08 mov %o0, %i2 if ( the_period->state == RATE_MONOTONIC_INACTIVE ) { 40033950: f8 07 60 38 ld [ %i5 + 0x38 ], %i4 40033954: 80 a7 20 00 cmp %i4, 0 40033958: 12 80 00 15 bne 400339ac 4003395c: 80 a7 20 02 cmp %i4, 2 _ISR_Enable( level ); 40033960: 7f ff 3a 21 call 400021e4 40033964: 01 00 00 00 nop the_period->next_length = length; /* * Baseline statistics information for the beginning of a period. */ _Rate_monotonic_Initiate_statistics( the_period ); 40033968: 90 10 00 1d mov %i5, %o0 4003396c: 7f ff ff b8 call 4003384c <_Rate_monotonic_Initiate_statistics> 40033970: f2 27 60 3c st %i1, [ %i5 + 0x3c ] the_period->state = RATE_MONOTONIC_ACTIVE; 40033974: 82 10 20 02 mov 2, %g1 40033978: c2 27 60 38 st %g1, [ %i5 + 0x38 ] Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 4003397c: 03 10 00 ce sethi %hi(0x40033800), %g1 40033980: 82 10 62 90 or %g1, 0x290, %g1 ! 40033a90 <_Rate_monotonic_Timeout> Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 40033984: c0 27 60 18 clr [ %i5 + 0x18 ] the_watchdog->routine = routine; 40033988: c2 27 60 2c st %g1, [ %i5 + 0x2c ] the_watchdog->id = id; 4003398c: f0 27 60 30 st %i0, [ %i5 + 0x30 ] the_watchdog->user_data = user_data; 40033990: c0 27 60 34 clr [ %i5 + 0x34 ] Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 40033994: f2 27 60 1c st %i1, [ %i5 + 0x1c ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 40033998: 11 10 01 91 sethi %hi(0x40064400), %o0 4003399c: 92 07 60 10 add %i5, 0x10, %o1 400339a0: 7f ff 5d 1c call 4000ae10 <_Watchdog_Insert> 400339a4: 90 12 20 c8 or %o0, 0xc8, %o0 400339a8: 30 80 00 1b b,a 40033a14 _Watchdog_Insert_ticks( &the_period->Timer, length ); _Thread_Enable_dispatch(); return RTEMS_SUCCESSFUL; } if ( the_period->state == RATE_MONOTONIC_ACTIVE ) { 400339ac: 12 80 00 1e bne 40033a24 400339b0: 80 a7 20 04 cmp %i4, 4 /* * Update statistics from the concluding period. */ _Rate_monotonic_Update_statistics( the_period ); 400339b4: 7f ff ff 5d call 40033728 <_Rate_monotonic_Update_statistics> 400339b8: 90 10 00 1d mov %i5, %o0 /* * 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; 400339bc: 82 10 20 01 mov 1, %g1 the_period->next_length = length; 400339c0: f2 27 60 3c st %i1, [ %i5 + 0x3c ] /* * 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; 400339c4: c2 27 60 38 st %g1, [ %i5 + 0x38 ] the_period->next_length = length; _ISR_Enable( level ); 400339c8: 7f ff 3a 07 call 400021e4 400339cc: 90 10 00 1a mov %i2, %o0 _Thread_Executing->Wait.id = the_period->Object.id; 400339d0: d0 06 e0 10 ld [ %i3 + 0x10 ], %o0 400339d4: c2 07 60 08 ld [ %i5 + 8 ], %g1 _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 400339d8: 13 00 00 10 sethi %hi(0x4000), %o1 400339dc: 7f ff 5c 27 call 4000aa78 <_Thread_Set_state> 400339e0: c2 22 20 20 st %g1, [ %o0 + 0x20 ] /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); 400339e4: 7f ff 39 fc call 400021d4 400339e8: 01 00 00 00 nop local_state = the_period->state; 400339ec: f4 07 60 38 ld [ %i5 + 0x38 ], %i2 the_period->state = RATE_MONOTONIC_ACTIVE; 400339f0: f8 27 60 38 st %i4, [ %i5 + 0x38 ] _ISR_Enable( level ); 400339f4: 7f ff 39 fc call 400021e4 400339f8: 01 00 00 00 nop /* * 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 ) 400339fc: 80 a6 a0 03 cmp %i2, 3 40033a00: 12 80 00 05 bne 40033a14 40033a04: 01 00 00 00 nop _Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 40033a08: d0 06 e0 10 ld [ %i3 + 0x10 ], %o0 40033a0c: 7f ff 59 1c call 40009e7c <_Thread_Clear_state> 40033a10: 13 00 00 10 sethi %hi(0x4000), %o1 _Thread_Enable_dispatch(); 40033a14: 7f ff 59 f0 call 4000a1d4 <_Thread_Enable_dispatch> 40033a18: b0 10 20 00 clr %i0 40033a1c: 81 c7 e0 08 ret 40033a20: 81 e8 00 00 restore return RTEMS_SUCCESSFUL; } if ( the_period->state == RATE_MONOTONIC_EXPIRED ) { 40033a24: 12 bf ff b9 bne 40033908 <== NEVER TAKEN 40033a28: b0 10 20 04 mov 4, %i0 /* * Update statistics from the concluding period */ _Rate_monotonic_Update_statistics( the_period ); 40033a2c: 7f ff ff 3f call 40033728 <_Rate_monotonic_Update_statistics> 40033a30: 90 10 00 1d mov %i5, %o0 _ISR_Enable( level ); 40033a34: 7f ff 39 ec call 400021e4 40033a38: 90 10 00 1a mov %i2, %o0 the_period->state = RATE_MONOTONIC_ACTIVE; 40033a3c: 82 10 20 02 mov 2, %g1 40033a40: 92 07 60 10 add %i5, 0x10, %o1 40033a44: c2 27 60 38 st %g1, [ %i5 + 0x38 ] the_period->next_length = length; 40033a48: f2 27 60 3c st %i1, [ %i5 + 0x3c ] Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 40033a4c: f2 27 60 1c st %i1, [ %i5 + 0x1c ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 40033a50: 11 10 01 91 sethi %hi(0x40064400), %o0 40033a54: 7f ff 5c ef call 4000ae10 <_Watchdog_Insert> 40033a58: 90 12 20 c8 or %o0, 0xc8, %o0 ! 400644c8 <_Watchdog_Ticks_chain> 40033a5c: d0 07 60 40 ld [ %i5 + 0x40 ], %o0 40033a60: d2 07 60 3c ld [ %i5 + 0x3c ], %o1 40033a64: 03 10 01 7f sethi %hi(0x4005fc00), %g1 40033a68: c2 00 63 b4 ld [ %g1 + 0x3b4 ], %g1 ! 4005ffb4 <_Scheduler+0x34> 40033a6c: 9f c0 40 00 call %g1 40033a70: b0 10 20 06 mov 6, %i0 _Watchdog_Insert_ticks( &the_period->Timer, length ); _Scheduler_Release_job(the_period->owner, the_period->next_length); _Thread_Enable_dispatch(); 40033a74: 7f ff 59 d8 call 4000a1d4 <_Thread_Enable_dispatch> 40033a78: 01 00 00 00 nop 40033a7c: 81 c7 e0 08 ret 40033a80: 81 e8 00 00 restore #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 40033a84: b0 10 20 04 mov 4, %i0 } 40033a88: 81 c7 e0 08 ret 40033a8c: 81 e8 00 00 restore =============================================================================== 40026954 : void rtems_rate_monotonic_report_statistics_with_plugin( void *context, rtems_printk_plugin_t print ) { 40026954: 9d e3 bf 38 save %sp, -200, %sp rtems_id id; rtems_rate_monotonic_period_statistics the_stats; rtems_rate_monotonic_period_status the_status; char name[5]; if ( !print ) 40026958: 80 a6 60 00 cmp %i1, 0 4002695c: 02 80 00 75 be 40026b30 <== NEVER TAKEN 40026960: 90 10 00 18 mov %i0, %o0 return; (*print)( context, "Period information by period\n" ); 40026964: 13 10 01 6c sethi %hi(0x4005b000), %o1 40026968: 9f c6 40 00 call %i1 4002696c: 92 12 63 48 or %o1, 0x348, %o1 ! 4005b348 <_TOD_Days_per_month+0x68> #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ (*print)( context, "--- CPU times are in seconds ---\n" ); 40026970: 90 10 00 18 mov %i0, %o0 40026974: 13 10 01 6c sethi %hi(0x4005b000), %o1 40026978: 9f c6 40 00 call %i1 4002697c: 92 12 63 68 or %o1, 0x368, %o1 ! 4005b368 <_TOD_Days_per_month+0x88> (*print)( context, "--- Wall times are in seconds ---\n" ); 40026980: 90 10 00 18 mov %i0, %o0 40026984: 13 10 01 6c sethi %hi(0x4005b000), %o1 40026988: 9f c6 40 00 call %i1 4002698c: 92 12 63 90 or %o1, 0x390, %o1 ! 4005b390 <_TOD_Days_per_month+0xb0> Be sure to test the various cases. (*print)( context,"\ 1234567890123456789012345678901234567890123456789012345678901234567890123456789\ \n"); */ (*print)( context, " ID OWNER COUNT MISSED " 40026990: 90 10 00 18 mov %i0, %o0 40026994: 13 10 01 6c sethi %hi(0x4005b000), %o1 40026998: 9f c6 40 00 call %i1 4002699c: 92 12 63 b8 or %o1, 0x3b8, %o1 ! 4005b3b8 <_TOD_Days_per_month+0xd8> #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ " " #endif " WALL TIME\n" ); (*print)( context, " " 400269a0: 90 10 00 18 mov %i0, %o0 400269a4: 13 10 01 6d sethi %hi(0x4005b400), %o1 400269a8: 9f c6 40 00 call %i1 400269ac: 92 12 60 08 or %o1, 8, %o1 ! 4005b408 <_TOD_Days_per_month+0x128> /* * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 400269b0: 03 10 01 93 sethi %hi(0x40064c00), %g1 rtems_object_get_name( the_status.owner, sizeof(name), name ); /* * Print part of report line that is not dependent on granularity */ (*print)( context, 400269b4: 39 10 01 6d sethi %hi(0x4005b400), %i4 struct timespec *min_cpu = &the_stats.min_cpu_time; struct timespec *max_cpu = &the_stats.max_cpu_time; struct timespec *total_cpu = &the_stats.total_cpu_time; _Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average ); (*print)( context, 400269b8: 37 10 01 6d sethi %hi(0x4005b400), %i3 struct timespec *min_wall = &the_stats.min_wall_time; struct timespec *max_wall = &the_stats.max_wall_time; struct timespec *total_wall = &the_stats.total_wall_time; _Timespec_Divide_by_integer(total_wall, the_stats.count, &wall_average); (*print)( context, 400269bc: 35 10 01 6d sethi %hi(0x4005b400), %i2 /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { (*print)( context, "\n" ); 400269c0: 21 10 01 72 sethi %hi(0x4005c800), %l0 /* * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 400269c4: fa 00 63 10 ld [ %g1 + 0x310 ], %i5 rtems_object_get_name( the_status.owner, sizeof(name), name ); /* * Print part of report line that is not dependent on granularity */ (*print)( context, 400269c8: b8 17 20 58 or %i4, 0x58, %i4 struct timespec *min_cpu = &the_stats.min_cpu_time; struct timespec *max_cpu = &the_stats.max_cpu_time; struct timespec *total_cpu = &the_stats.total_cpu_time; _Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average ); (*print)( context, 400269cc: b6 16 e0 70 or %i3, 0x70, %i3 struct timespec *min_wall = &the_stats.min_wall_time; struct timespec *max_wall = &the_stats.max_wall_time; struct timespec *total_wall = &the_stats.total_wall_time; _Timespec_Divide_by_integer(total_wall, the_stats.count, &wall_average); (*print)( context, 400269d0: b4 16 a0 90 or %i2, 0x90, %i2 /* * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 400269d4: 10 80 00 52 b 40026b1c 400269d8: a0 14 21 20 or %l0, 0x120, %l0 id <= _Rate_monotonic_Information.maximum_id ; id++ ) { status = rtems_rate_monotonic_get_statistics( id, &the_stats ); 400269dc: 40 00 32 75 call 400333b0 400269e0: 92 07 bf c8 add %fp, -56, %o1 if ( status != RTEMS_SUCCESSFUL ) 400269e4: 80 a2 20 00 cmp %o0, 0 400269e8: 32 80 00 4d bne,a 40026b1c 400269ec: ba 07 60 01 inc %i5 #if defined(RTEMS_DEBUG) status = rtems_rate_monotonic_get_status( id, &the_status ); if ( status != RTEMS_SUCCESSFUL ) continue; #else (void) rtems_rate_monotonic_get_status( id, &the_status ); 400269f0: 92 07 bf b0 add %fp, -80, %o1 400269f4: 40 00 32 e0 call 40033574 400269f8: 90 10 00 1d mov %i5, %o0 #endif rtems_object_get_name( the_status.owner, sizeof(name), name ); 400269fc: d0 07 bf b0 ld [ %fp + -80 ], %o0 40026a00: 92 10 20 05 mov 5, %o1 40026a04: 7f ff a2 76 call 4000f3dc 40026a08: 94 07 bf a0 add %fp, -96, %o2 /* * Print part of report line that is not dependent on granularity */ (*print)( context, 40026a0c: d8 1f bf c8 ldd [ %fp + -56 ], %o4 40026a10: 92 10 00 1c mov %i4, %o1 40026a14: 90 10 00 18 mov %i0, %o0 40026a18: 94 10 00 1d mov %i5, %o2 40026a1c: 9f c6 40 00 call %i1 40026a20: 96 07 bf a0 add %fp, -96, %o3 ); /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { 40026a24: d2 07 bf c8 ld [ %fp + -56 ], %o1 40026a28: 80 a2 60 00 cmp %o1, 0 40026a2c: 12 80 00 07 bne 40026a48 40026a30: 94 07 bf a8 add %fp, -88, %o2 (*print)( context, "\n" ); 40026a34: 90 10 00 18 mov %i0, %o0 40026a38: 9f c6 40 00 call %i1 40026a3c: 92 10 00 10 mov %l0, %o1 continue; 40026a40: 10 80 00 37 b 40026b1c 40026a44: ba 07 60 01 inc %i5 struct timespec cpu_average; struct timespec *min_cpu = &the_stats.min_cpu_time; struct timespec *max_cpu = &the_stats.max_cpu_time; struct timespec *total_cpu = &the_stats.total_cpu_time; _Timespec_Divide_by_integer( total_cpu, the_stats.count, &cpu_average ); 40026a48: 40 00 03 2b call 400276f4 <_Timespec_Divide_by_integer> 40026a4c: 90 07 bf e0 add %fp, -32, %o0 (*print)( context, 40026a50: d0 07 bf d4 ld [ %fp + -44 ], %o0 40026a54: 40 00 a8 c8 call 40050d74 <.div> 40026a58: 92 10 23 e8 mov 0x3e8, %o1 40026a5c: a6 10 00 08 mov %o0, %l3 40026a60: d0 07 bf dc ld [ %fp + -36 ], %o0 40026a64: 40 00 a8 c4 call 40050d74 <.div> 40026a68: 92 10 23 e8 mov 0x3e8, %o1 40026a6c: c2 07 bf a8 ld [ %fp + -88 ], %g1 40026a70: a2 10 00 08 mov %o0, %l1 40026a74: d0 07 bf ac ld [ %fp + -84 ], %o0 40026a78: e8 07 bf d0 ld [ %fp + -48 ], %l4 40026a7c: e4 07 bf d8 ld [ %fp + -40 ], %l2 40026a80: c2 23 a0 5c st %g1, [ %sp + 0x5c ] 40026a84: 40 00 a8 bc call 40050d74 <.div> 40026a88: 92 10 23 e8 mov 0x3e8, %o1 40026a8c: 96 10 00 13 mov %l3, %o3 40026a90: 98 10 00 12 mov %l2, %o4 40026a94: 9a 10 00 11 mov %l1, %o5 40026a98: 94 10 00 14 mov %l4, %o2 40026a9c: d0 23 a0 60 st %o0, [ %sp + 0x60 ] 40026aa0: 92 10 00 1b mov %i3, %o1 40026aa4: 9f c6 40 00 call %i1 40026aa8: 90 10 00 18 mov %i0, %o0 struct timespec wall_average; struct timespec *min_wall = &the_stats.min_wall_time; struct timespec *max_wall = &the_stats.max_wall_time; struct timespec *total_wall = &the_stats.total_wall_time; _Timespec_Divide_by_integer(total_wall, the_stats.count, &wall_average); 40026aac: d2 07 bf c8 ld [ %fp + -56 ], %o1 40026ab0: 94 07 bf a8 add %fp, -88, %o2 40026ab4: 40 00 03 10 call 400276f4 <_Timespec_Divide_by_integer> 40026ab8: 90 07 bf f8 add %fp, -8, %o0 (*print)( context, 40026abc: d0 07 bf ec ld [ %fp + -20 ], %o0 40026ac0: 40 00 a8 ad call 40050d74 <.div> 40026ac4: 92 10 23 e8 mov 0x3e8, %o1 40026ac8: a6 10 00 08 mov %o0, %l3 40026acc: d0 07 bf f4 ld [ %fp + -12 ], %o0 40026ad0: 40 00 a8 a9 call 40050d74 <.div> 40026ad4: 92 10 23 e8 mov 0x3e8, %o1 40026ad8: c2 07 bf a8 ld [ %fp + -88 ], %g1 40026adc: a2 10 00 08 mov %o0, %l1 40026ae0: d0 07 bf ac ld [ %fp + -84 ], %o0 40026ae4: e8 07 bf e8 ld [ %fp + -24 ], %l4 40026ae8: e4 07 bf f0 ld [ %fp + -16 ], %l2 40026aec: 92 10 23 e8 mov 0x3e8, %o1 40026af0: 40 00 a8 a1 call 40050d74 <.div> 40026af4: c2 23 a0 5c st %g1, [ %sp + 0x5c ] 40026af8: 92 10 00 1a mov %i2, %o1 40026afc: d0 23 a0 60 st %o0, [ %sp + 0x60 ] 40026b00: 94 10 00 14 mov %l4, %o2 40026b04: 90 10 00 18 mov %i0, %o0 40026b08: 96 10 00 13 mov %l3, %o3 40026b0c: 98 10 00 12 mov %l2, %o4 40026b10: 9f c6 40 00 call %i1 40026b14: 9a 10 00 11 mov %l1, %o5 * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; id <= _Rate_monotonic_Information.maximum_id ; id++ ) { 40026b18: ba 07 60 01 inc %i5 /* * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; id <= _Rate_monotonic_Information.maximum_id ; 40026b1c: 03 10 01 93 sethi %hi(0x40064c00), %g1 /* * Cycle through all possible ids and try to report on each one. If it * is a period that is inactive, we just get an error back. No big deal. */ for ( id=_Rate_monotonic_Information.minimum_id ; 40026b20: c2 00 63 14 ld [ %g1 + 0x314 ], %g1 ! 40064f14 <_Rate_monotonic_Information+0xc> 40026b24: 80 a7 40 01 cmp %i5, %g1 40026b28: 08 bf ff ad bleu 400269dc 40026b2c: 90 10 00 1d mov %i5, %o0 40026b30: 81 c7 e0 08 ret 40026b34: 81 e8 00 00 restore =============================================================================== 40008e80 : return big_enough; } void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size) { 40008e80: 9d e3 bf a0 save %sp, -96, %sp void *ptr = NULL; rtems_chain_control *free_chain = &control->free_chunk_chain; rtems_rbtree_control *chunk_tree = &control->chunk_tree; uintptr_t alignment = control->alignment; 40008e84: fa 06 20 30 ld [ %i0 + 0x30 ], %i5 #include static uintptr_t align_up(uintptr_t alignment, uintptr_t value) { uintptr_t excess = value % alignment; 40008e88: 90 10 00 19 mov %i1, %o0 40008e8c: 92 10 00 1d mov %i5, %o1 40008e90: 40 00 2d 6b call 4001443c <.urem> 40008e94: b6 10 00 19 mov %i1, %i3 if (excess > 0) { 40008e98: 80 a2 20 00 cmp %o0, 0 40008e9c: 02 80 00 05 be 40008eb0 <== ALWAYS TAKEN 40008ea0: 80 a6 c0 19 cmp %i3, %i1 value += alignment - excess; 40008ea4: b6 06 40 1d add %i1, %i5, %i3 <== NOT EXECUTED 40008ea8: b6 26 c0 08 sub %i3, %o0, %i3 <== NOT EXECUTED rtems_chain_control *free_chain = &control->free_chunk_chain; rtems_rbtree_control *chunk_tree = &control->chunk_tree; uintptr_t alignment = control->alignment; uintptr_t aligned_size = align_up(alignment, size); if (size > 0 && size <= aligned_size) { 40008eac: 80 a6 c0 19 cmp %i3, %i1 <== NOT EXECUTED 40008eb0: 0a 80 00 04 bcs 40008ec0 <== NEVER TAKEN 40008eb4: 80 a6 60 00 cmp %i1, 0 40008eb8: 32 80 00 04 bne,a 40008ec8 40008ebc: c2 06 00 00 ld [ %i0 ], %g1 return big_enough; } void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size) { void *ptr = NULL; 40008ec0: 81 c7 e0 08 ret 40008ec4: 91 e8 20 00 restore %g0, 0, %o0 rtems_chain_control *free_chain, size_t size ) { rtems_chain_node *current = rtems_chain_first(free_chain); const rtems_chain_node *tail = rtems_chain_tail(free_chain); 40008ec8: 84 06 20 04 add %i0, 4, %g2 rtems_rbheap_chunk *big_enough = NULL; 40008ecc: 10 80 00 06 b 40008ee4 40008ed0: ba 10 20 00 clr %i5 while (current != tail && big_enough == NULL) { rtems_rbheap_chunk *free_chunk = (rtems_rbheap_chunk *) current; if (free_chunk->size >= size) { 40008ed4: 80 a0 c0 1b cmp %g3, %i3 40008ed8: ba 40 3f ff addx %g0, -1, %i5 40008edc: ba 08 40 1d and %g1, %i5, %i5 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Next( Chain_Node *the_node ) { return the_node->next; 40008ee0: c2 00 40 00 ld [ %g1 ], %g1 { rtems_chain_node *current = rtems_chain_first(free_chain); const rtems_chain_node *tail = rtems_chain_tail(free_chain); rtems_rbheap_chunk *big_enough = NULL; while (current != tail && big_enough == NULL) { 40008ee4: 80 a7 60 00 cmp %i5, 0 40008ee8: 12 80 00 04 bne 40008ef8 40008eec: 80 a0 40 02 cmp %g1, %g2 40008ef0: 32 bf ff f9 bne,a 40008ed4 40008ef4: c6 00 60 1c ld [ %g1 + 0x1c ], %g3 uintptr_t aligned_size = align_up(alignment, size); if (size > 0 && size <= aligned_size) { rtems_rbheap_chunk *free_chunk = search_free_chunk(free_chain, aligned_size); if (free_chunk != NULL) { 40008ef8: 80 a7 60 00 cmp %i5, 0 40008efc: 02 bf ff f1 be 40008ec0 40008f00: 01 00 00 00 nop uintptr_t free_size = free_chunk->size; 40008f04: f4 07 60 1c ld [ %i5 + 0x1c ], %i2 if (free_size > aligned_size) { 40008f08: 80 a6 80 1b cmp %i2, %i3 40008f0c: 28 80 00 14 bleu,a 40008f5c 40008f10: c4 07 40 00 ld [ %i5 ], %g2 rtems_rbheap_chunk *new_chunk = get_chunk(control); 40008f14: 7f ff ff 80 call 40008d14 40008f18: 90 10 00 18 mov %i0, %o0 if (new_chunk != NULL) { 40008f1c: b8 92 20 00 orcc %o0, 0, %i4 40008f20: 02 bf ff e8 be 40008ec0 <== NEVER TAKEN 40008f24: b4 26 80 1b sub %i2, %i3, %i2 uintptr_t new_free_size = free_size - aligned_size; free_chunk->size = new_free_size; new_chunk->begin = free_chunk->begin + new_free_size; 40008f28: c2 07 60 18 ld [ %i5 + 0x18 ], %g1 rtems_rbheap_chunk *new_chunk = get_chunk(control); if (new_chunk != NULL) { uintptr_t new_free_size = free_size - aligned_size; free_chunk->size = new_free_size; 40008f2c: f4 27 60 1c st %i2, [ %i5 + 0x1c ] new_chunk->begin = free_chunk->begin + new_free_size; new_chunk->size = aligned_size; 40008f30: f6 27 20 1c st %i3, [ %i4 + 0x1c ] if (new_chunk != NULL) { uintptr_t new_free_size = free_size - aligned_size; free_chunk->size = new_free_size; new_chunk->begin = free_chunk->begin + new_free_size; 40008f34: b4 06 80 01 add %i2, %g1, %i2 */ RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain( Chain_Node *node ) { node->next = node->previous = NULL; 40008f38: c0 27 20 04 clr [ %i4 + 4 ] 40008f3c: f4 27 20 18 st %i2, [ %i4 + 0x18 ] 40008f40: c0 27 00 00 clr [ %i4 ] static void insert_into_tree( rtems_rbtree_control *tree, rtems_rbheap_chunk *chunk ) { _RBTree_Insert_unprotected(tree, &chunk->tree_node); 40008f44: 90 06 20 18 add %i0, 0x18, %o0 40008f48: 40 00 06 97 call 4000a9a4 <_RBTree_Insert_unprotected> 40008f4c: 92 07 20 08 add %i4, 8, %o1 free_chunk->size = new_free_size; new_chunk->begin = free_chunk->begin + new_free_size; new_chunk->size = aligned_size; rtems_chain_set_off_chain(&new_chunk->chain_node); insert_into_tree(chunk_tree, new_chunk); ptr = (void *) new_chunk->begin; 40008f50: f0 07 20 18 ld [ %i4 + 0x18 ], %i0 40008f54: 81 c7 e0 08 ret 40008f58: 81 e8 00 00 restore { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 40008f5c: c2 07 60 04 ld [ %i5 + 4 ], %g1 } } else { rtems_chain_extract_unprotected(&free_chunk->chain_node); rtems_chain_set_off_chain(&free_chunk->chain_node); ptr = (void *) free_chunk->begin; 40008f60: f0 07 60 18 ld [ %i5 + 0x18 ], %i0 next->previous = previous; 40008f64: c2 20 a0 04 st %g1, [ %g2 + 4 ] previous->next = next; 40008f68: c4 20 40 00 st %g2, [ %g1 ] */ RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain( Chain_Node *node ) { node->next = node->previous = NULL; 40008f6c: c0 27 60 04 clr [ %i5 + 4 ] 40008f70: c0 27 40 00 clr [ %i5 ] } } } return ptr; } 40008f74: 81 c7 e0 08 ret 40008f78: 81 e8 00 00 restore =============================================================================== 400090ac : /* Do nothing */ } void rtems_rbheap_extend_descriptors_with_malloc(rtems_rbheap_control *control) { 400090ac: 9d e3 bf a0 save %sp, -96, %sp <== NOT EXECUTED rtems_rbheap_chunk *chunk = malloc(sizeof(*chunk)); 400090b0: 7f ff ed e7 call 4000484c <== NOT EXECUTED 400090b4: 90 10 20 20 mov 0x20, %o0 <== NOT EXECUTED if (chunk != NULL) { 400090b8: 80 a2 20 00 cmp %o0, 0 <== NOT EXECUTED 400090bc: 02 80 00 07 be 400090d8 <== NOT EXECUTED 400090c0: 82 06 20 0c add %i0, 0xc, %g1 <== NOT EXECUTED Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 400090c4: c2 22 20 04 st %g1, [ %o0 + 4 ] <== NOT EXECUTED before_node = after_node->next; 400090c8: c2 06 20 0c ld [ %i0 + 0xc ], %g1 <== NOT EXECUTED after_node->next = the_node; 400090cc: d0 26 20 0c st %o0, [ %i0 + 0xc ] <== NOT EXECUTED the_node->next = before_node; 400090d0: c2 22 00 00 st %g1, [ %o0 ] <== NOT EXECUTED before_node->previous = the_node; 400090d4: d0 20 60 04 st %o0, [ %g1 + 4 ] <== NOT EXECUTED 400090d8: 81 c7 e0 08 ret <== NOT EXECUTED 400090dc: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 40008f7c : _RBTree_Extract_unprotected(chunk_tree, &b->tree_node); } } rtems_status_code rtems_rbheap_free(rtems_rbheap_control *control, void *ptr) { 40008f7c: 9d e3 bf 80 save %sp, -128, %sp 40008f80: b6 10 00 18 mov %i0, %i3 rtems_status_code sc = RTEMS_SUCCESSFUL; if (ptr != NULL) { 40008f84: 80 a6 60 00 cmp %i1, 0 40008f88: 02 80 00 45 be 4000909c 40008f8c: b0 10 20 00 clr %i0 #define NULL_PAGE rtems_rbheap_chunk_of_node(NULL) static rtems_rbheap_chunk *find(rtems_rbtree_control *chunk_tree, uintptr_t key) { rtems_rbheap_chunk chunk = { .begin = key }; 40008f90: 90 07 bf e0 add %fp, -32, %o0 40008f94: 92 10 20 00 clr %o1 40008f98: 94 10 20 20 mov 0x20, %o2 40008f9c: 40 00 21 0b call 400113c8 40008fa0: b4 06 e0 18 add %i3, 0x18, %i2 RBTree_Control *the_rbtree, RBTree_Node *the_node ) { RBTree_Node* iter_node = the_rbtree->root; RBTree_Node* found = NULL; 40008fa4: ba 10 20 00 clr %i5 40008fa8: f2 27 bf f8 st %i1, [ %fp + -8 ] RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Find_unprotected( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { RBTree_Node* iter_node = the_rbtree->root; 40008fac: 10 80 00 12 b 40008ff4 40008fb0: f8 06 e0 1c ld [ %i3 + 0x1c ], %i4 RBTree_Node* found = NULL; int compare_result; while (iter_node) { compare_result = the_rbtree->compare_function(the_node, iter_node); 40008fb4: 90 07 bf e8 add %fp, -24, %o0 40008fb8: 9f c0 40 00 call %g1 40008fbc: 92 10 00 1c mov %i4, %o1 if ( _RBTree_Is_equal( compare_result ) ) { 40008fc0: 80 a2 20 00 cmp %o0, 0 40008fc4: 12 80 00 07 bne 40008fe0 40008fc8: 83 3a 20 1f sra %o0, 0x1f, %g1 found = iter_node; if ( the_rbtree->is_unique ) 40008fcc: c2 0e a0 14 ldub [ %i2 + 0x14 ], %g1 40008fd0: 80 a0 60 00 cmp %g1, 0 40008fd4: 12 80 00 0c bne 40009004 <== ALWAYS TAKEN 40008fd8: ba 10 00 1c mov %i4, %i5 RTEMS_INLINE_ROUTINE bool _RBTree_Is_greater( int compare_result ) { return compare_result > 0; 40008fdc: 83 3a 20 1f sra %o0, 0x1f, %g1 <== NOT EXECUTED 40008fe0: 90 20 40 08 sub %g1, %o0, %o0 40008fe4: 91 32 20 1f srl %o0, 0x1f, %o0 break; } RBTree_Direction dir = (RBTree_Direction) _RBTree_Is_greater( compare_result ); iter_node = iter_node->child[dir]; 40008fe8: 91 2a 20 02 sll %o0, 2, %o0 40008fec: b8 07 00 08 add %i4, %o0, %i4 40008ff0: f8 07 20 04 ld [ %i4 + 4 ], %i4 ) { RBTree_Node* iter_node = the_rbtree->root; RBTree_Node* found = NULL; int compare_result; while (iter_node) { 40008ff4: 80 a7 20 00 cmp %i4, 0 40008ff8: 32 bf ff ef bne,a 40008fb4 40008ffc: c2 06 a0 10 ld [ %i2 + 0x10 ], %g1 40009000: b8 10 00 1d mov %i5, %i4 return rtems_rbheap_chunk_of_node( 40009004: ba 07 3f f8 add %i4, -8, %i5 if (ptr != NULL) { rtems_chain_control *free_chain = &control->free_chunk_chain; rtems_rbtree_control *chunk_tree = &control->chunk_tree; rtems_rbheap_chunk *chunk = find(chunk_tree, (uintptr_t) ptr); if (chunk != NULL_PAGE) { 40009008: 80 a7 7f f8 cmp %i5, -8 4000900c: 02 80 00 24 be 4000909c 40009010: b0 10 20 04 mov 4, %i0 */ RTEMS_INLINE_ROUTINE bool _Chain_Is_node_off_chain( const Chain_Node *node ) { return (node->next == NULL) && (node->previous == NULL); 40009014: c4 07 3f f8 ld [ %i4 + -8 ], %g2 40009018: 80 a0 a0 00 cmp %g2, 0 4000901c: 12 80 00 05 bne 40009030 40009020: 82 10 20 00 clr %g1 40009024: c2 07 60 04 ld [ %i5 + 4 ], %g1 40009028: 80 a0 00 01 cmp %g0, %g1 4000902c: 82 60 3f ff subx %g0, -1, %g1 if (!rtems_rbheap_is_chunk_free(chunk)) { 40009030: 80 a0 60 00 cmp %g1, 0 40009034: 02 80 00 1a be 4000909c 40009038: b0 10 20 0e mov 0xe, %i0 static rtems_rbheap_chunk *get_next( const rtems_rbheap_chunk *chunk, RBTree_Direction dir ) { return rtems_rbheap_chunk_of_node( 4000903c: b8 07 60 08 add %i5, 8, %i4 40009040: 92 10 20 00 clr %o1 40009044: 40 00 06 fd call 4000ac38 <_RBTree_Next_unprotected> 40009048: 90 10 00 1c mov %i4, %o0 4000904c: 92 10 20 01 mov 1, %o1 40009050: b2 10 00 08 mov %o0, %i1 40009054: 40 00 06 f9 call 4000ac38 <_RBTree_Next_unprotected> 40009058: 90 10 00 1c mov %i4, %o0 if (chunk != NULL_PAGE) { if (!rtems_rbheap_is_chunk_free(chunk)) { rtems_rbheap_chunk *pred = get_next(chunk, RBT_LEFT); rtems_rbheap_chunk *succ = get_next(chunk, RBT_RIGHT); check_and_merge(free_chain, chunk_tree, chunk, succ); 4000905c: 92 10 00 1a mov %i2, %o1 static rtems_rbheap_chunk *get_next( const rtems_rbheap_chunk *chunk, RBTree_Direction dir ) { return rtems_rbheap_chunk_of_node( 40009060: 96 02 3f f8 add %o0, -8, %o3 if (chunk != NULL_PAGE) { if (!rtems_rbheap_is_chunk_free(chunk)) { rtems_rbheap_chunk *pred = get_next(chunk, RBT_LEFT); rtems_rbheap_chunk *succ = get_next(chunk, RBT_RIGHT); check_and_merge(free_chain, chunk_tree, chunk, succ); 40009064: 94 10 00 1d mov %i5, %o2 40009068: 7f ff ff 02 call 40008c70 4000906c: 90 10 00 1b mov %i3, %o0 ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 40009070: c2 06 c0 00 ld [ %i3 ], %g1 Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 40009074: f6 27 60 04 st %i3, [ %i5 + 4 ] before_node = after_node->next; after_node->next = the_node; 40009078: fa 26 c0 00 st %i5, [ %i3 ] the_node->next = before_node; 4000907c: c2 27 40 00 st %g1, [ %i5 ] before_node->previous = the_node; 40009080: fa 20 60 04 st %i5, [ %g1 + 4 ] add_to_chain(free_chain, chunk); check_and_merge(free_chain, chunk_tree, chunk, pred); 40009084: 90 10 00 1b mov %i3, %o0 40009088: 92 10 00 1a mov %i2, %o1 4000908c: 94 10 00 1d mov %i5, %o2 40009090: 96 06 7f f8 add %i1, -8, %o3 40009094: 7f ff fe f7 call 40008c70 40009098: b0 10 20 00 clr %i0 sc = RTEMS_INVALID_ID; } } return sc; } 4000909c: 81 c7 e0 08 ret 400090a0: 81 e8 00 00 restore =============================================================================== 400181c0 : rtems_status_code rtems_signal_send( rtems_id id, rtems_signal_set signal_set ) { 400181c0: 9d e3 bf 98 save %sp, -104, %sp register Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; ASR_Information *asr; if ( !signal_set ) 400181c4: 80 a6 60 00 cmp %i1, 0 400181c8: 02 80 00 35 be 4001829c 400181cc: 82 10 20 0a mov 0xa, %g1 return RTEMS_INVALID_NUMBER; the_thread = _Thread_Get( id, &location ); 400181d0: 90 10 00 18 mov %i0, %o0 400181d4: 40 00 12 93 call 4001cc20 <_Thread_Get> 400181d8: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 400181dc: c2 07 bf fc ld [ %fp + -4 ], %g1 400181e0: 80 a0 60 00 cmp %g1, 0 400181e4: 12 80 00 2d bne 40018298 400181e8: b8 10 00 08 mov %o0, %i4 case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; 400181ec: fa 02 21 4c ld [ %o0 + 0x14c ], %i5 asr = &api->Signal; if ( ! _ASR_Is_null_handler( asr->handler ) ) { 400181f0: c2 07 60 0c ld [ %i5 + 0xc ], %g1 400181f4: 80 a0 60 00 cmp %g1, 0 400181f8: 02 80 00 24 be 40018288 400181fc: 01 00 00 00 nop if ( asr->is_enabled ) { 40018200: c2 0f 60 08 ldub [ %i5 + 8 ], %g1 40018204: 80 a0 60 00 cmp %g1, 0 40018208: 02 80 00 15 be 4001825c 4001820c: 01 00 00 00 nop rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 40018210: 7f ff e0 e9 call 400105b4 40018214: 01 00 00 00 nop *signal_set |= signals; 40018218: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 4001821c: b2 10 40 19 or %g1, %i1, %i1 40018220: f2 27 60 14 st %i1, [ %i5 + 0x14 ] _ISR_Enable( _level ); 40018224: 7f ff e0 e8 call 400105c4 40018228: 01 00 00 00 nop _ASR_Post_signals( signal_set, &asr->signals_posted ); if ( _ISR_Is_in_progress() && _Thread_Is_executing( the_thread ) ) 4001822c: 03 10 00 fb sethi %hi(0x4003ec00), %g1 40018230: 82 10 61 30 or %g1, 0x130, %g1 ! 4003ed30 <_Per_CPU_Information> 40018234: c4 00 60 08 ld [ %g1 + 8 ], %g2 40018238: 80 a0 a0 00 cmp %g2, 0 4001823c: 02 80 00 0f be 40018278 40018240: 01 00 00 00 nop 40018244: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 40018248: 80 a7 00 02 cmp %i4, %g2 4001824c: 12 80 00 0b bne 40018278 <== NEVER TAKEN 40018250: 84 10 20 01 mov 1, %g2 _Thread_Dispatch_necessary = true; 40018254: c4 28 60 0c stb %g2, [ %g1 + 0xc ] 40018258: 30 80 00 08 b,a 40018278 rtems_signal_set *signal_set ) { ISR_Level _level; _ISR_Disable( _level ); 4001825c: 7f ff e0 d6 call 400105b4 40018260: 01 00 00 00 nop *signal_set |= signals; 40018264: c2 07 60 18 ld [ %i5 + 0x18 ], %g1 40018268: b2 10 40 19 or %g1, %i1, %i1 4001826c: f2 27 60 18 st %i1, [ %i5 + 0x18 ] _ISR_Enable( _level ); 40018270: 7f ff e0 d5 call 400105c4 40018274: 01 00 00 00 nop } else { _ASR_Post_signals( signal_set, &asr->signals_pending ); } _Thread_Enable_dispatch(); 40018278: 40 00 12 5e call 4001cbf0 <_Thread_Enable_dispatch> 4001827c: 01 00 00 00 nop return RTEMS_SUCCESSFUL; 40018280: 10 80 00 07 b 4001829c 40018284: 82 10 20 00 clr %g1 ! 0 } _Thread_Enable_dispatch(); 40018288: 40 00 12 5a call 4001cbf0 <_Thread_Enable_dispatch> 4001828c: 01 00 00 00 nop return RTEMS_NOT_DEFINED; 40018290: 10 80 00 03 b 4001829c 40018294: 82 10 20 0b mov 0xb, %g1 ! b case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 40018298: 82 10 20 04 mov 4, %g1 } 4001829c: 81 c7 e0 08 ret 400182a0: 91 e8 00 01 restore %g0, %g1, %o0 =============================================================================== 40011a60 : rtems_status_code rtems_task_mode( rtems_mode mode_set, rtems_mode mask, rtems_mode *previous_mode_set ) { 40011a60: 9d e3 bf a0 save %sp, -96, %sp ASR_Information *asr; bool is_asr_enabled = false; bool needs_asr_dispatching = false; rtems_mode old_mode; if ( !previous_mode_set ) 40011a64: 80 a6 a0 00 cmp %i2, 0 40011a68: 02 80 00 5a be 40011bd0 40011a6c: 82 10 20 09 mov 9, %g1 return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; 40011a70: 03 10 00 6f sethi %hi(0x4001bc00), %g1 40011a74: f8 00 62 60 ld [ %g1 + 0x260 ], %i4 ! 4001be60 <_Per_CPU_Information+0x10> api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 40011a78: c2 0f 20 70 ldub [ %i4 + 0x70 ], %g1 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; 40011a7c: fa 07 21 4c ld [ %i4 + 0x14c ], %i5 asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 40011a80: 80 a0 00 01 cmp %g0, %g1 if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) 40011a84: c2 07 20 78 ld [ %i4 + 0x78 ], %g1 executing = _Thread_Executing; api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 40011a88: b6 60 3f ff subx %g0, -1, %i3 if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) 40011a8c: 80 a0 60 00 cmp %g1, 0 40011a90: 02 80 00 03 be 40011a9c 40011a94: b7 2e e0 08 sll %i3, 8, %i3 old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; 40011a98: b6 16 e2 00 or %i3, 0x200, %i3 old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; 40011a9c: c2 0f 60 08 ldub [ %i5 + 8 ], %g1 40011aa0: 80 a0 00 01 cmp %g0, %g1 old_mode |= _ISR_Get_level(); 40011aa4: 7f ff ed 50 call 4000cfe4 <_CPU_ISR_Get_level> 40011aa8: a0 60 3f ff subx %g0, -1, %l0 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; 40011aac: a1 2c 20 0a sll %l0, 0xa, %l0 40011ab0: 90 14 00 08 or %l0, %o0, %o0 old_mode |= _ISR_Get_level(); 40011ab4: b6 12 00 1b or %o0, %i3, %i3 *previous_mode_set = old_mode; /* * These are generic thread scheduling characteristics. */ if ( mask & RTEMS_PREEMPT_MASK ) 40011ab8: 80 8e 61 00 btst 0x100, %i1 40011abc: 02 80 00 06 be 40011ad4 40011ac0: f6 26 80 00 st %i3, [ %i2 ] */ RTEMS_INLINE_ROUTINE bool _Modes_Is_preempt ( Modes_Control mode_set ) { return (mode_set & RTEMS_PREEMPT_MASK) == RTEMS_PREEMPT; 40011ac4: 83 36 20 08 srl %i0, 8, %g1 40011ac8: 82 18 60 01 xor %g1, 1, %g1 40011acc: 82 08 60 01 and %g1, 1, %g1 executing->is_preemptible = _Modes_Is_preempt(mode_set) ? true : false; 40011ad0: c2 2f 20 70 stb %g1, [ %i4 + 0x70 ] if ( mask & RTEMS_TIMESLICE_MASK ) { 40011ad4: 80 8e 62 00 btst 0x200, %i1 40011ad8: 02 80 00 0b be 40011b04 40011adc: 80 8e 60 0f btst 0xf, %i1 if ( _Modes_Is_timeslice(mode_set) ) { 40011ae0: 80 8e 22 00 btst 0x200, %i0 40011ae4: 22 80 00 07 be,a 40011b00 40011ae8: c0 27 20 78 clr [ %i4 + 0x78 ] executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 40011aec: 82 10 20 01 mov 1, %g1 40011af0: c2 27 20 78 st %g1, [ %i4 + 0x78 ] executing->cpu_time_budget = _Thread_Ticks_per_timeslice; 40011af4: 03 10 00 6e sethi %hi(0x4001b800), %g1 40011af8: c2 00 60 a0 ld [ %g1 + 0xa0 ], %g1 ! 4001b8a0 <_Thread_Ticks_per_timeslice> 40011afc: c2 27 20 74 st %g1, [ %i4 + 0x74 ] } /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) 40011b00: 80 8e 60 0f btst 0xf, %i1 40011b04: 02 80 00 06 be 40011b1c 40011b08: 80 8e 64 00 btst 0x400, %i1 */ RTEMS_INLINE_ROUTINE ISR_Level _Modes_Get_interrupt_level ( Modes_Control mode_set ) { return ( mode_set & RTEMS_INTERRUPT_MASK ); 40011b0c: 90 0e 20 0f and %i0, 0xf, %o0 */ RTEMS_INLINE_ROUTINE void _Modes_Set_interrupt_level ( Modes_Control mode_set ) { _ISR_Set_level( _Modes_Get_interrupt_level( mode_set ) ); 40011b10: 7f ff c4 55 call 40002c64 40011b14: 91 2a 20 08 sll %o0, 8, %o0 * This is specific to the RTEMS API */ is_asr_enabled = false; needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { 40011b18: 80 8e 64 00 btst 0x400, %i1 40011b1c: 02 80 00 14 be 40011b6c 40011b20: 88 10 20 00 clr %g4 is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true; if ( is_asr_enabled != asr->is_enabled ) { 40011b24: c2 0f 60 08 ldub [ %i5 + 8 ], %g1 */ is_asr_enabled = false; needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { is_asr_enabled = _Modes_Is_asr_disabled( mode_set ) ? false : true; 40011b28: b1 36 20 0a srl %i0, 0xa, %i0 40011b2c: b0 1e 20 01 xor %i0, 1, %i0 40011b30: b0 0e 20 01 and %i0, 1, %i0 if ( is_asr_enabled != asr->is_enabled ) { 40011b34: 80 a6 00 01 cmp %i0, %g1 40011b38: 22 80 00 0e be,a 40011b70 40011b3c: 03 10 00 6f sethi %hi(0x4001bc00), %g1 ) { rtems_signal_set _signals; ISR_Level _level; _ISR_Disable( _level ); 40011b40: 7f ff c4 45 call 40002c54 40011b44: f0 2f 60 08 stb %i0, [ %i5 + 8 ] _signals = information->signals_pending; 40011b48: c2 07 60 18 ld [ %i5 + 0x18 ], %g1 information->signals_pending = information->signals_posted; 40011b4c: c4 07 60 14 ld [ %i5 + 0x14 ], %g2 information->signals_posted = _signals; 40011b50: c2 27 60 14 st %g1, [ %i5 + 0x14 ] rtems_signal_set _signals; ISR_Level _level; _ISR_Disable( _level ); _signals = information->signals_pending; information->signals_pending = information->signals_posted; 40011b54: c4 27 60 18 st %g2, [ %i5 + 0x18 ] information->signals_posted = _signals; _ISR_Enable( _level ); 40011b58: 7f ff c4 43 call 40002c64 40011b5c: 01 00 00 00 nop asr->is_enabled = is_asr_enabled; _ASR_Swap_signals( asr ); if ( _ASR_Are_signals_pending( asr ) ) { 40011b60: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 40011b64: 80 a0 00 01 cmp %g0, %g1 40011b68: 88 40 20 00 addx %g0, 0, %g4 needs_asr_dispatching = true; } } } if ( _System_state_Is_up( _System_state_Get() ) ) { 40011b6c: 03 10 00 6f sethi %hi(0x4001bc00), %g1 40011b70: c4 00 62 48 ld [ %g1 + 0x248 ], %g2 ! 4001be48 <_System_state_Current> 40011b74: 80 a0 a0 03 cmp %g2, 3 40011b78: 12 80 00 16 bne 40011bd0 40011b7c: 82 10 20 00 clr %g1 bool are_signals_pending ) { Thread_Control *executing; executing = _Thread_Executing; 40011b80: 07 10 00 6f sethi %hi(0x4001bc00), %g3 if ( are_signals_pending || 40011b84: 80 89 20 ff btst 0xff, %g4 bool are_signals_pending ) { Thread_Control *executing; executing = _Thread_Executing; 40011b88: 86 10 e2 50 or %g3, 0x250, %g3 if ( are_signals_pending || 40011b8c: 12 80 00 0a bne 40011bb4 40011b90: c4 00 e0 10 ld [ %g3 + 0x10 ], %g2 40011b94: c6 00 e0 14 ld [ %g3 + 0x14 ], %g3 40011b98: 80 a0 80 03 cmp %g2, %g3 40011b9c: 02 80 00 0d be 40011bd0 40011ba0: 01 00 00 00 nop (!_Thread_Is_heir( executing ) && executing->is_preemptible) ) { 40011ba4: c4 08 a0 70 ldub [ %g2 + 0x70 ], %g2 40011ba8: 80 a0 a0 00 cmp %g2, 0 40011bac: 02 80 00 09 be 40011bd0 <== NEVER TAKEN 40011bb0: 01 00 00 00 nop _Thread_Dispatch_necessary = true; 40011bb4: 84 10 20 01 mov 1, %g2 ! 1 40011bb8: 03 10 00 6f sethi %hi(0x4001bc00), %g1 40011bbc: 82 10 62 50 or %g1, 0x250, %g1 ! 4001be50 <_Per_CPU_Information> 40011bc0: c4 28 60 0c stb %g2, [ %g1 + 0xc ] if (_Thread_Evaluate_is_dispatch_needed( needs_asr_dispatching ) ) _Thread_Dispatch(); 40011bc4: 7f ff e8 41 call 4000bcc8 <_Thread_Dispatch> 40011bc8: 01 00 00 00 nop } return RTEMS_SUCCESSFUL; 40011bcc: 82 10 20 00 clr %g1 ! 0 } 40011bd0: 81 c7 e0 08 ret 40011bd4: 91 e8 00 01 restore %g0, %g1, %o0 =============================================================================== 4000c548 : rtems_status_code rtems_task_set_priority( rtems_id id, rtems_task_priority new_priority, rtems_task_priority *old_priority ) { 4000c548: 9d e3 bf 98 save %sp, -104, %sp register Thread_Control *the_thread; Objects_Locations location; if ( new_priority != RTEMS_CURRENT_PRIORITY && 4000c54c: 80 a6 60 00 cmp %i1, 0 4000c550: 02 80 00 08 be 4000c570 4000c554: 80 a6 a0 00 cmp %i2, 0 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 ) ); 4000c558: 03 10 00 6a sethi %hi(0x4001a800), %g1 4000c55c: c4 08 61 8c ldub [ %g1 + 0x18c ], %g2 ! 4001a98c 4000c560: 80 a6 40 02 cmp %i1, %g2 4000c564: 18 80 00 1e bgu 4000c5dc 4000c568: 82 10 20 13 mov 0x13, %g1 !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; if ( !old_priority ) 4000c56c: 80 a6 a0 00 cmp %i2, 0 4000c570: 02 80 00 1b be 4000c5dc 4000c574: 82 10 20 09 mov 9, %g1 return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); 4000c578: 90 10 00 18 mov %i0, %o0 4000c57c: 40 00 09 7c call 4000eb6c <_Thread_Get> 4000c580: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 4000c584: c2 07 bf fc ld [ %fp + -4 ], %g1 4000c588: 80 a0 60 00 cmp %g1, 0 4000c58c: 12 80 00 14 bne 4000c5dc 4000c590: 82 10 20 04 mov 4, %g1 case OBJECTS_LOCAL: /* XXX need helper to "convert" from core priority */ *old_priority = the_thread->current_priority; 4000c594: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 if ( new_priority != RTEMS_CURRENT_PRIORITY ) { 4000c598: 80 a6 60 00 cmp %i1, 0 4000c59c: 02 80 00 0d be 4000c5d0 4000c5a0: c2 26 80 00 st %g1, [ %i2 ] the_thread->real_priority = new_priority; if ( the_thread->resource_count == 0 || 4000c5a4: c2 02 20 1c ld [ %o0 + 0x1c ], %g1 4000c5a8: 80 a0 60 00 cmp %g1, 0 4000c5ac: 02 80 00 06 be 4000c5c4 4000c5b0: f2 22 20 18 st %i1, [ %o0 + 0x18 ] 4000c5b4: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 4000c5b8: 80 a0 40 19 cmp %g1, %i1 4000c5bc: 08 80 00 05 bleu 4000c5d0 <== ALWAYS TAKEN 4000c5c0: 01 00 00 00 nop the_thread->current_priority > new_priority ) _Thread_Change_priority( the_thread, new_priority, false ); 4000c5c4: 92 10 00 19 mov %i1, %o1 4000c5c8: 40 00 08 43 call 4000e6d4 <_Thread_Change_priority> 4000c5cc: 94 10 20 00 clr %o2 } _Thread_Enable_dispatch(); 4000c5d0: 40 00 09 5b call 4000eb3c <_Thread_Enable_dispatch> 4000c5d4: 01 00 00 00 nop 4000c5d8: 82 10 20 00 clr %g1 ! 0 case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4000c5dc: 81 c7 e0 08 ret 4000c5e0: 91 e8 00 01 restore %g0, %g1, %o0 =============================================================================== 40018c48 : */ rtems_status_code rtems_timer_cancel( rtems_id id ) { 40018c48: 9d e3 bf 98 save %sp, -104, %sp RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Get ( Objects_Id id, Objects_Locations *location ) { return (Timer_Control *) 40018c4c: 11 10 00 fc sethi %hi(0x4003f000), %o0 40018c50: 92 10 00 18 mov %i0, %o1 40018c54: 90 12 21 78 or %o0, 0x178, %o0 40018c58: 40 00 0c 3b call 4001bd44 <_Objects_Get> 40018c5c: 94 07 bf fc add %fp, -4, %o2 Timer_Control *the_timer; Objects_Locations location; the_timer = _Timer_Get( id, &location ); switch ( location ) { 40018c60: c2 07 bf fc ld [ %fp + -4 ], %g1 40018c64: 80 a0 60 00 cmp %g1, 0 40018c68: 12 80 00 0c bne 40018c98 40018c6c: 01 00 00 00 nop case OBJECTS_LOCAL: if ( !_Timer_Is_dormant_class( the_timer->the_class ) ) 40018c70: c2 02 20 38 ld [ %o0 + 0x38 ], %g1 40018c74: 80 a0 60 04 cmp %g1, 4 40018c78: 02 80 00 04 be 40018c88 <== NEVER TAKEN 40018c7c: 01 00 00 00 nop (void) _Watchdog_Remove( &the_timer->Ticker ); 40018c80: 40 00 13 b2 call 4001db48 <_Watchdog_Remove> 40018c84: 90 02 20 10 add %o0, 0x10, %o0 _Thread_Enable_dispatch(); 40018c88: 40 00 0f da call 4001cbf0 <_Thread_Enable_dispatch> 40018c8c: b0 10 20 00 clr %i0 40018c90: 81 c7 e0 08 ret 40018c94: 81 e8 00 00 restore case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 40018c98: 81 c7 e0 08 ret 40018c9c: 91 e8 20 04 restore %g0, 4, %o0 =============================================================================== 40019158 : rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ) { 40019158: 9d e3 bf 98 save %sp, -104, %sp Timer_Control *the_timer; Objects_Locations location; rtems_interval seconds; Timer_server_Control *timer_server = _Timer_server; 4001915c: 03 10 00 fc sethi %hi(0x4003f000), %g1 40019160: f8 00 61 b8 ld [ %g1 + 0x1b8 ], %i4 ! 4003f1b8 <_Timer_server> if ( !timer_server ) 40019164: 80 a7 20 00 cmp %i4, 0 40019168: 02 80 00 3c be 40019258 4001916c: 82 10 20 0e mov 0xe, %g1 return RTEMS_INCORRECT_STATE; if ( !_TOD.is_set ) 40019170: 21 10 00 f9 sethi %hi(0x4003e400), %l0 40019174: 82 14 23 58 or %l0, 0x358, %g1 ! 4003e758 <_TOD> 40019178: c4 08 60 14 ldub [ %g1 + 0x14 ], %g2 4001917c: 80 a0 a0 00 cmp %g2, 0 40019180: 02 80 00 36 be 40019258 <== NEVER TAKEN 40019184: 82 10 20 0b mov 0xb, %g1 return RTEMS_NOT_DEFINED; if ( !routine ) 40019188: 80 a6 a0 00 cmp %i2, 0 4001918c: 02 80 00 33 be 40019258 40019190: 82 10 20 09 mov 9, %g1 return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) 40019194: 7f ff f3 7f call 40015f90 <_TOD_Validate> 40019198: 90 10 00 19 mov %i1, %o0 4001919c: 80 8a 20 ff btst 0xff, %o0 400191a0: 02 80 00 2e be 40019258 400191a4: 82 10 20 14 mov 0x14, %g1 return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 400191a8: 7f ff f3 40 call 40015ea8 <_TOD_To_seconds> 400191ac: 90 10 00 19 mov %i1, %o0 400191b0: b2 10 00 08 mov %o0, %i1 400191b4: d0 1c 23 58 ldd [ %l0 + 0x358 ], %o0 400191b8: 94 10 20 00 clr %o2 400191bc: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 400191c0: 40 00 4f e1 call 4002d144 <__divdi3> 400191c4: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 if ( seconds <= _TOD_Seconds_since_epoch() ) 400191c8: 80 a6 40 09 cmp %i1, %o1 400191cc: 08 80 00 23 bleu 40019258 400191d0: 82 10 20 14 mov 0x14, %g1 400191d4: 11 10 00 fc sethi %hi(0x4003f000), %o0 400191d8: 92 10 00 18 mov %i0, %o1 400191dc: 90 12 21 78 or %o0, 0x178, %o0 400191e0: 40 00 0a d9 call 4001bd44 <_Objects_Get> 400191e4: 94 07 bf fc add %fp, -4, %o2 return RTEMS_INVALID_CLOCK; the_timer = _Timer_Get( id, &location ); switch ( location ) { 400191e8: c2 07 bf fc ld [ %fp + -4 ], %g1 400191ec: 80 a0 60 00 cmp %g1, 0 400191f0: 12 80 00 19 bne 40019254 400191f4: ba 10 00 08 mov %o0, %i5 case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); 400191f8: 40 00 12 54 call 4001db48 <_Watchdog_Remove> 400191fc: 90 02 20 10 add %o0, 0x10, %o0 40019200: d0 1c 23 58 ldd [ %l0 + 0x358 ], %o0 the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK; 40019204: 82 10 20 03 mov 3, %g1 40019208: 94 10 20 00 clr %o2 4001920c: c2 27 60 38 st %g1, [ %i5 + 0x38 ] Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 40019210: c0 27 60 18 clr [ %i5 + 0x18 ] the_watchdog->routine = routine; 40019214: f4 27 60 2c st %i2, [ %i5 + 0x2c ] the_watchdog->id = id; 40019218: f0 27 60 30 st %i0, [ %i5 + 0x30 ] the_watchdog->user_data = user_data; 4001921c: f6 27 60 34 st %i3, [ %i5 + 0x34 ] 40019220: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 40019224: 40 00 4f c8 call 4002d144 <__divdi3> 40019228: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); (*timer_server->schedule_operation)( timer_server, the_timer ); 4001922c: c2 07 20 04 ld [ %i4 + 4 ], %g1 case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); 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(); 40019230: 92 26 40 09 sub %i1, %o1, %o1 (*timer_server->schedule_operation)( timer_server, the_timer ); 40019234: 90 10 00 1c mov %i4, %o0 case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); 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(); 40019238: d2 27 60 1c st %o1, [ %i5 + 0x1c ] (*timer_server->schedule_operation)( timer_server, the_timer ); 4001923c: 9f c0 40 00 call %g1 40019240: 92 10 00 1d mov %i5, %o1 _Thread_Enable_dispatch(); 40019244: 40 00 0e 6b call 4001cbf0 <_Thread_Enable_dispatch> 40019248: 01 00 00 00 nop return RTEMS_SUCCESSFUL; 4001924c: 10 80 00 03 b 40019258 40019250: 82 10 20 00 clr %g1 ! 0 #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 40019254: 82 10 20 04 mov 4, %g1 } 40019258: 81 c7 e0 08 ret 4001925c: 91 e8 00 01 restore %g0, %g1, %o0 =============================================================================== 40008348 : #include int sched_get_priority_max( int policy ) { 40008348: 9d e3 bf a0 save %sp, -96, %sp switch ( policy ) { 4000834c: 80 a6 20 04 cmp %i0, 4 40008350: 18 80 00 06 bgu 40008368 40008354: 82 10 20 01 mov 1, %g1 40008358: b1 28 40 18 sll %g1, %i0, %i0 4000835c: 80 8e 20 17 btst 0x17, %i0 40008360: 12 80 00 08 bne 40008380 <== ALWAYS TAKEN 40008364: 03 10 00 7c sethi %hi(0x4001f000), %g1 case SCHED_RR: case SCHED_SPORADIC: break; default: rtems_set_errno_and_return_minus_one( EINVAL ); 40008368: 40 00 20 0e call 400103a0 <__errno> 4000836c: b0 10 3f ff mov -1, %i0 40008370: 82 10 20 16 mov 0x16, %g1 40008374: c2 22 00 00 st %g1, [ %o0 ] 40008378: 81 c7 e0 08 ret 4000837c: 81 e8 00 00 restore } return POSIX_SCHEDULER_MAXIMUM_PRIORITY; 40008380: f0 08 61 2c ldub [ %g1 + 0x12c ], %i0 } 40008384: 81 c7 e0 08 ret 40008388: 91 ee 3f ff restore %i0, -1, %o0 =============================================================================== 4000838c : * 13.3.6 Get Scheduling Parameter Limits, P1003.1b-1993, p. 258 */ int sched_get_priority_min( int policy ) { 4000838c: 9d e3 bf a0 save %sp, -96, %sp switch ( policy ) { 40008390: 80 a6 20 04 cmp %i0, 4 40008394: 18 80 00 06 bgu 400083ac 40008398: 82 10 20 01 mov 1, %g1 4000839c: 83 28 40 18 sll %g1, %i0, %g1 400083a0: 80 88 60 17 btst 0x17, %g1 400083a4: 12 80 00 06 bne 400083bc <== ALWAYS TAKEN 400083a8: b0 10 20 01 mov 1, %i0 case SCHED_RR: case SCHED_SPORADIC: break; default: rtems_set_errno_and_return_minus_one( EINVAL ); 400083ac: 40 00 1f fd call 400103a0 <__errno> 400083b0: b0 10 3f ff mov -1, %i0 400083b4: 82 10 20 16 mov 0x16, %g1 400083b8: c2 22 00 00 st %g1, [ %o0 ] } return POSIX_SCHEDULER_MINIMUM_PRIORITY; } 400083bc: 81 c7 e0 08 ret 400083c0: 81 e8 00 00 restore =============================================================================== 400083c4 : int sched_rr_get_interval( pid_t pid, struct timespec *interval ) { 400083c4: 9d e3 bf a0 save %sp, -96, %sp /* * Only supported for the "calling process" (i.e. this node). */ if ( pid && pid != getpid() ) 400083c8: 80 a6 20 00 cmp %i0, 0 400083cc: 02 80 00 0b be 400083f8 <== NEVER TAKEN 400083d0: 80 a6 60 00 cmp %i1, 0 400083d4: 7f ff ef ff call 400043d0 400083d8: 01 00 00 00 nop 400083dc: 80 a6 00 08 cmp %i0, %o0 400083e0: 02 80 00 06 be 400083f8 400083e4: 80 a6 60 00 cmp %i1, 0 rtems_set_errno_and_return_minus_one( ESRCH ); 400083e8: 40 00 1f ee call 400103a0 <__errno> 400083ec: 01 00 00 00 nop 400083f0: 10 80 00 07 b 4000840c 400083f4: 82 10 20 03 mov 3, %g1 ! 3 if ( !interval ) 400083f8: 12 80 00 08 bne 40008418 400083fc: 03 10 00 7f sethi %hi(0x4001fc00), %g1 rtems_set_errno_and_return_minus_one( EINVAL ); 40008400: 40 00 1f e8 call 400103a0 <__errno> 40008404: 01 00 00 00 nop 40008408: 82 10 20 16 mov 0x16, %g1 ! 16 4000840c: c2 22 00 00 st %g1, [ %o0 ] 40008410: 81 c7 e0 08 ret 40008414: 91 e8 3f ff restore %g0, -1, %o0 _Timespec_From_ticks( _Thread_Ticks_per_timeslice, interval ); 40008418: d0 00 62 30 ld [ %g1 + 0x230 ], %o0 4000841c: 92 10 00 19 mov %i1, %o1 40008420: 40 00 0e 63 call 4000bdac <_Timespec_From_ticks> 40008424: b0 10 20 00 clr %i0 return 0; } 40008428: 81 c7 e0 08 ret 4000842c: 81 e8 00 00 restore =============================================================================== 40008de0 : int oflag, ... /* mode_t mode, */ /* unsigned int value */ ) { 40008de0: 9d e3 bf 88 save %sp, -120, %sp * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 40008de4: 03 10 00 8f sethi %hi(0x40023c00), %g1 40008de8: c4 00 62 80 ld [ %g1 + 0x280 ], %g2 ! 40023e80 <_Thread_Dispatch_disable_level> size_t name_len; _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { va_start(arg, oflag); 40008dec: f4 27 a0 4c st %i2, [ %fp + 0x4c ] ++level; 40008df0: 84 00 a0 01 inc %g2 40008df4: f6 27 a0 50 st %i3, [ %fp + 0x50 ] 40008df8: f8 27 a0 54 st %i4, [ %fp + 0x54 ] 40008dfc: fa 27 a0 58 st %i5, [ %fp + 0x58 ] _Thread_Dispatch_disable_level = level; 40008e00: c4 20 62 80 st %g2, [ %g1 + 0x280 ] Objects_Locations location; size_t name_len; _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { 40008e04: b4 8e 62 00 andcc %i1, 0x200, %i2 40008e08: 02 80 00 05 be 40008e1c 40008e0c: b8 10 20 00 clr %i4 va_start(arg, oflag); mode = va_arg( arg, mode_t ); value = va_arg( arg, unsigned int ); 40008e10: f8 07 a0 50 ld [ %fp + 0x50 ], %i4 size_t name_len; _Thread_Disable_dispatch(); if ( oflag & O_CREAT ) { va_start(arg, oflag); 40008e14: 82 07 a0 4c add %fp, 0x4c, %g1 40008e18: c2 27 bf ec st %g1, [ %fp + -20 ] const char *name, Objects_Id *id, size_t *len ) { return _POSIX_Name_to_id( &_POSIX_Semaphore_Information, name, id, len ); 40008e1c: 37 10 00 90 sethi %hi(0x40024000), %i3 40008e20: 92 10 00 18 mov %i0, %o1 40008e24: 90 16 e1 44 or %i3, 0x144, %o0 40008e28: 94 07 bf f0 add %fp, -16, %o2 40008e2c: 7f ff fe 7e call 40008824 <_POSIX_Name_to_id> 40008e30: 96 07 bf fc add %fp, -4, %o3 * 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 ) { 40008e34: ba 92 20 00 orcc %o0, 0, %i5 40008e38: 22 80 00 0e be,a 40008e70 40008e3c: b2 0e 6a 00 and %i1, 0xa00, %i1 /* * 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) ) ) { 40008e40: 80 a7 60 02 cmp %i5, 2 40008e44: 12 80 00 04 bne 40008e54 40008e48: 80 a6 a0 00 cmp %i2, 0 40008e4c: 12 80 00 20 bne 40008ecc 40008e50: d2 07 bf fc ld [ %fp + -4 ], %o1 _Thread_Enable_dispatch(); 40008e54: 40 00 0d b7 call 4000c530 <_Thread_Enable_dispatch> 40008e58: b0 10 3f ff mov -1, %i0 rtems_set_errno_and_return_minus_one_cast( status, sem_t * ); 40008e5c: 40 00 22 eb call 40011a08 <__errno> 40008e60: 01 00 00 00 nop 40008e64: fa 22 00 00 st %i5, [ %o0 ] 40008e68: 81 c7 e0 08 ret 40008e6c: 81 e8 00 00 restore /* * Check for existence with creation. */ if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { 40008e70: 80 a6 6a 00 cmp %i1, 0xa00 40008e74: 12 80 00 0a bne 40008e9c 40008e78: d2 07 bf f0 ld [ %fp + -16 ], %o1 _Thread_Enable_dispatch(); 40008e7c: 40 00 0d ad call 4000c530 <_Thread_Enable_dispatch> 40008e80: b0 10 3f ff mov -1, %i0 rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * ); 40008e84: 40 00 22 e1 call 40011a08 <__errno> 40008e88: 01 00 00 00 nop 40008e8c: 82 10 20 11 mov 0x11, %g1 ! 11 40008e90: c2 22 00 00 st %g1, [ %o0 ] 40008e94: 81 c7 e0 08 ret 40008e98: 81 e8 00 00 restore RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Get ( sem_t *id, Objects_Locations *location ) { return (POSIX_Semaphore_Control *) 40008e9c: 94 07 bf f8 add %fp, -8, %o2 40008ea0: 40 00 09 ea call 4000b648 <_Objects_Get> 40008ea4: 90 16 e1 44 or %i3, 0x144, %o0 } the_semaphore = _POSIX_Semaphore_Get( (sem_t *) &the_semaphore_id, &location ); the_semaphore->open_count += 1; 40008ea8: c2 02 20 18 ld [ %o0 + 0x18 ], %g1 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( (sem_t *) &the_semaphore_id, &location ); 40008eac: d0 27 bf f4 st %o0, [ %fp + -12 ] the_semaphore->open_count += 1; 40008eb0: 82 00 60 01 inc %g1 _Thread_Enable_dispatch(); 40008eb4: 40 00 0d 9f call 4000c530 <_Thread_Enable_dispatch> 40008eb8: c2 22 20 18 st %g1, [ %o0 + 0x18 ] _Thread_Enable_dispatch(); 40008ebc: 40 00 0d 9d call 4000c530 <_Thread_Enable_dispatch> 40008ec0: 01 00 00 00 nop goto return_id; 40008ec4: 10 80 00 0d b 40008ef8 40008ec8: f0 07 bf f4 ld [ %fp + -12 ], %i0 /* * 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( 40008ecc: 94 10 20 00 clr %o2 40008ed0: 96 10 00 1c mov %i4, %o3 40008ed4: 98 07 bf f4 add %fp, -12, %o4 40008ed8: 40 00 19 40 call 4000f3d8 <_POSIX_Semaphore_Create_support> 40008edc: 90 10 00 18 mov %i0, %o0 /* * errno was set by Create_support, so don't set it again. */ _Thread_Enable_dispatch(); 40008ee0: 40 00 0d 94 call 4000c530 <_Thread_Enable_dispatch> 40008ee4: ba 10 00 08 mov %o0, %i5 if ( status == -1 ) 40008ee8: 80 a7 7f ff cmp %i5, -1 40008eec: 22 80 00 04 be,a 40008efc <== NEVER TAKEN 40008ef0: b0 10 3f ff mov -1, %i0 <== NOT EXECUTED return_id: #if defined(RTEMS_USE_16_BIT_OBJECT) the_semaphore->Semaphore_id = the_semaphore->Object.id; return &the_semaphore->Semaphore_id; #else return (sem_t *)&the_semaphore->Object.id; 40008ef4: f0 07 bf f4 ld [ %fp + -12 ], %i0 40008ef8: b0 06 20 08 add %i0, 8, %i0 #endif } 40008efc: 81 c7 e0 08 ret 40008f00: 81 e8 00 00 restore =============================================================================== 40008340 : int sigaction( int sig, const struct sigaction *act, struct sigaction *oact ) { 40008340: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; if ( oact ) 40008344: 80 a6 a0 00 cmp %i2, 0 40008348: 02 80 00 0a be 40008370 4000834c: 83 2e 20 02 sll %i0, 2, %g1 *oact = _POSIX_signals_Vectors[ sig ]; 40008350: 85 2e 20 04 sll %i0, 4, %g2 40008354: 82 20 80 01 sub %g2, %g1, %g1 40008358: 13 10 00 6b sethi %hi(0x4001ac00), %o1 4000835c: 90 10 00 1a mov %i2, %o0 40008360: 92 12 62 70 or %o1, 0x270, %o1 40008364: 94 10 20 0c mov 0xc, %o2 40008368: 40 00 23 56 call 400110c0 4000836c: 92 02 40 01 add %o1, %g1, %o1 if ( !sig ) 40008370: 80 a6 20 00 cmp %i0, 0 40008374: 32 80 00 03 bne,a 40008380 40008378: 82 06 3f ff add %i0, -1, %g1 4000837c: 30 80 00 06 b,a 40008394 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(sig) ) 40008380: 80 a0 60 1f cmp %g1, 0x1f 40008384: 18 80 00 04 bgu 40008394 40008388: 80 a6 20 09 cmp %i0, 9 * * NOTE: Solaris documentation claims to "silently enforce" this which * contradicts the POSIX specification. */ if ( sig == SIGKILL ) 4000838c: 12 80 00 08 bne 400083ac 40008390: 80 a6 60 00 cmp %i1, 0 rtems_set_errno_and_return_minus_one( EINVAL ); 40008394: 40 00 21 10 call 400107d4 <__errno> 40008398: 01 00 00 00 nop 4000839c: 82 10 20 16 mov 0x16, %g1 ! 16 400083a0: c2 22 00 00 st %g1, [ %o0 ] 400083a4: 10 80 00 20 b 40008424 400083a8: 82 10 3f ff mov -1, %g1 /* * Evaluate the new action structure and set the global signal vector * appropriately. */ if ( act ) { 400083ac: 02 80 00 1e be 40008424 <== NEVER TAKEN 400083b0: 82 10 20 00 clr %g1 /* * Unless the user is installing the default signal actions, then * we can just copy the provided sigaction structure into the vectors. */ _ISR_Disable( level ); 400083b4: 7f ff e9 09 call 400027d8 400083b8: 01 00 00 00 nop 400083bc: b8 10 00 08 mov %o0, %i4 if ( act->sa_handler == SIG_DFL ) { 400083c0: c2 06 60 08 ld [ %i1 + 8 ], %g1 400083c4: 3b 10 00 6b sethi %hi(0x4001ac00), %i5 400083c8: 80 a0 60 00 cmp %g1, 0 400083cc: 12 80 00 0a bne 400083f4 400083d0: ba 17 62 70 or %i5, 0x270, %i5 _POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ]; 400083d4: 83 2e 20 02 sll %i0, 2, %g1 400083d8: 13 10 00 64 sethi %hi(0x40019000), %o1 400083dc: b1 2e 20 04 sll %i0, 4, %i0 400083e0: 92 12 63 6c or %o1, 0x36c, %o1 400083e4: b0 26 00 01 sub %i0, %g1, %i0 400083e8: 90 07 40 18 add %i5, %i0, %o0 400083ec: 10 80 00 09 b 40008410 400083f0: 92 02 40 18 add %o1, %i0, %o1 } else { _POSIX_signals_Clear_process_signals( sig ); 400083f4: 40 00 16 5f call 4000dd70 <_POSIX_signals_Clear_process_signals> 400083f8: 90 10 00 18 mov %i0, %o0 _POSIX_signals_Vectors[ sig ] = *act; 400083fc: 83 2e 20 02 sll %i0, 2, %g1 40008400: 92 10 00 19 mov %i1, %o1 40008404: b1 2e 20 04 sll %i0, 4, %i0 40008408: 90 26 00 01 sub %i0, %g1, %o0 4000840c: 90 07 40 08 add %i5, %o0, %o0 40008410: 40 00 23 2c call 400110c0 40008414: 94 10 20 0c mov 0xc, %o2 } _ISR_Enable( level ); 40008418: 7f ff e8 f4 call 400027e8 4000841c: 90 10 00 1c mov %i4, %o0 * 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; 40008420: 82 10 20 00 clr %g1 } 40008424: 81 c7 e0 08 ret 40008428: 91 e8 00 01 restore %g0, %g1, %o0 =============================================================================== 40008884 : int sigtimedwait( const sigset_t *set, siginfo_t *info, const struct timespec *timeout ) { 40008884: 9d e3 bf 90 save %sp, -112, %sp ISR_Level level; /* * Error check parameters before disabling interrupts. */ if ( !set ) 40008888: 80 a6 20 00 cmp %i0, 0 4000888c: 02 80 00 0e be 400088c4 40008890: 80 a6 a0 00 cmp %i2, 0 /* NOTE: This is very specifically a RELATIVE not ABSOLUTE time * in the Open Group specification. */ interval = 0; if ( timeout ) { 40008894: 02 80 00 10 be 400088d4 40008898: b6 10 20 00 clr %i3 if ( !_Timespec_Is_valid( timeout ) ) 4000889c: 40 00 0e ac call 4000c34c <_Timespec_Is_valid> 400088a0: 90 10 00 1a mov %i2, %o0 400088a4: 80 8a 20 ff btst 0xff, %o0 400088a8: 02 80 00 07 be 400088c4 400088ac: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( EINVAL ); interval = _Timespec_To_ticks( timeout ); 400088b0: 40 00 0e b9 call 4000c394 <_Timespec_To_ticks> 400088b4: 90 10 00 1a mov %i2, %o0 if ( !interval ) 400088b8: b6 92 20 00 orcc %o0, 0, %i3 400088bc: 12 80 00 07 bne 400088d8 <== ALWAYS TAKEN 400088c0: 80 a6 60 00 cmp %i1, 0 rtems_set_errno_and_return_minus_one( EINVAL ); 400088c4: 40 00 21 90 call 40010f04 <__errno> 400088c8: 01 00 00 00 nop 400088cc: 10 80 00 63 b 40008a58 400088d0: 82 10 20 16 mov 0x16, %g1 ! 16 /* * Initialize local variables. */ the_info = ( info ) ? info : &signal_information; 400088d4: 80 a6 60 00 cmp %i1, 0 400088d8: 22 80 00 02 be,a 400088e0 400088dc: b2 07 bf f4 add %fp, -12, %i1 the_thread = _Thread_Executing; 400088e0: 21 10 00 6d sethi %hi(0x4001b400), %l0 400088e4: a0 14 22 20 or %l0, 0x220, %l0 ! 4001b620 <_Per_CPU_Information> 400088e8: fa 04 20 10 ld [ %l0 + 0x10 ], %i5 * What if they are already pending? */ /* API signals pending? */ _ISR_Disable( level ); 400088ec: 7f ff e8 98 call 40002b4c 400088f0: f8 07 61 50 ld [ %i5 + 0x150 ], %i4 400088f4: b4 10 00 08 mov %o0, %i2 if ( *set & api->signals_pending ) { 400088f8: c4 06 00 00 ld [ %i0 ], %g2 400088fc: c2 07 20 d4 ld [ %i4 + 0xd4 ], %g1 40008900: 80 88 80 01 btst %g2, %g1 40008904: 22 80 00 12 be,a 4000894c 40008908: 03 10 00 6e sethi %hi(0x4001b800), %g1 /* XXX real info later */ the_info->si_signo = _POSIX_signals_Get_lowest( api->signals_pending ); 4000890c: 7f ff ff c6 call 40008824 <_POSIX_signals_Get_lowest> 40008910: 90 10 00 01 mov %g1, %o0 _POSIX_signals_Clear_signals( 40008914: 94 10 00 19 mov %i1, %o2 /* API signals pending? */ _ISR_Disable( level ); if ( *set & api->signals_pending ) { /* XXX real info later */ the_info->si_signo = _POSIX_signals_Get_lowest( api->signals_pending ); 40008918: 92 10 00 08 mov %o0, %o1 4000891c: d0 26 40 00 st %o0, [ %i1 ] _POSIX_signals_Clear_signals( 40008920: 96 10 20 00 clr %o3 40008924: 90 10 00 1c mov %i4, %o0 40008928: 40 00 17 2d call 4000e5dc <_POSIX_signals_Clear_signals> 4000892c: 98 10 20 00 clr %o4 the_info->si_signo, the_info, false, false ); _ISR_Enable( level ); 40008930: 7f ff e8 8b call 40002b5c 40008934: 90 10 00 1a mov %i2, %o0 the_info->si_code = SI_USER; 40008938: 82 10 20 01 mov 1, %g1 the_info->si_value.sival_int = 0; 4000893c: c0 26 60 08 clr [ %i1 + 8 ] false, false ); _ISR_Enable( level ); the_info->si_code = SI_USER; 40008940: c2 26 60 04 st %g1, [ %i1 + 4 ] the_info->si_value.sival_int = 0; return the_info->si_signo; 40008944: 10 80 00 47 b 40008a60 40008948: fa 06 40 00 ld [ %i1 ], %i5 } /* Process pending signals? */ if ( *set & _POSIX_signals_Pending ) { 4000894c: c2 00 60 74 ld [ %g1 + 0x74 ], %g1 40008950: 80 88 80 01 btst %g2, %g1 40008954: 22 80 00 12 be,a 4000899c 40008958: 82 10 3f ff mov -1, %g1 signo = _POSIX_signals_Get_lowest( _POSIX_signals_Pending ); 4000895c: 7f ff ff b2 call 40008824 <_POSIX_signals_Get_lowest> 40008960: 90 10 00 01 mov %g1, %o0 _POSIX_signals_Clear_signals( api, signo, the_info, true, false ); 40008964: 94 10 00 19 mov %i1, %o2 } /* Process pending signals? */ if ( *set & _POSIX_signals_Pending ) { signo = _POSIX_signals_Get_lowest( _POSIX_signals_Pending ); 40008968: ba 10 00 08 mov %o0, %i5 _POSIX_signals_Clear_signals( api, signo, the_info, true, false ); 4000896c: 96 10 20 01 mov 1, %o3 40008970: 90 10 00 1c mov %i4, %o0 40008974: 92 10 00 1d mov %i5, %o1 40008978: 40 00 17 19 call 4000e5dc <_POSIX_signals_Clear_signals> 4000897c: 98 10 20 00 clr %o4 _ISR_Enable( level ); 40008980: 7f ff e8 77 call 40002b5c 40008984: 90 10 00 1a mov %i2, %o0 the_info->si_signo = signo; the_info->si_code = SI_USER; 40008988: 82 10 20 01 mov 1, %g1 if ( *set & _POSIX_signals_Pending ) { signo = _POSIX_signals_Get_lowest( _POSIX_signals_Pending ); _POSIX_signals_Clear_signals( api, signo, the_info, true, false ); _ISR_Enable( level ); the_info->si_signo = signo; 4000898c: fa 26 40 00 st %i5, [ %i1 ] the_info->si_code = SI_USER; 40008990: c2 26 60 04 st %g1, [ %i1 + 4 ] the_info->si_value.sival_int = 0; 40008994: 10 80 00 33 b 40008a60 40008998: c0 26 60 08 clr [ %i1 + 8 ] return signo; } the_info->si_signo = -1; 4000899c: c2 26 40 00 st %g1, [ %i1 ] * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 400089a0: 03 10 00 6c sethi %hi(0x4001b000), %g1 400089a4: c4 00 61 10 ld [ %g1 + 0x110 ], %g2 ! 4001b110 <_Thread_Dispatch_disable_level> ++level; 400089a8: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 400089ac: c4 20 61 10 st %g2, [ %g1 + 0x110 ] _Thread_Disable_dispatch(); the_thread->Wait.queue = &_POSIX_signals_Wait_queue; the_thread->Wait.return_code = EINTR; 400089b0: 82 10 20 04 mov 4, %g1 400089b4: c2 27 60 34 st %g1, [ %i5 + 0x34 ] the_thread->Wait.option = *set; 400089b8: c2 06 00 00 ld [ %i0 ], %g1 the_thread->Wait.return_argument = the_info; 400089bc: f2 27 60 28 st %i1, [ %i5 + 0x28 ] the_info->si_signo = -1; _Thread_Disable_dispatch(); the_thread->Wait.queue = &_POSIX_signals_Wait_queue; the_thread->Wait.return_code = EINTR; the_thread->Wait.option = *set; 400089c0: c2 27 60 30 st %g1, [ %i5 + 0x30 ] 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; 400089c4: a2 10 20 01 mov 1, %l1 } the_info->si_signo = -1; _Thread_Disable_dispatch(); the_thread->Wait.queue = &_POSIX_signals_Wait_queue; 400089c8: 35 10 00 6e sethi %hi(0x4001b800), %i2 400089cc: b4 16 a0 0c or %i2, 0xc, %i2 ! 4001b80c <_POSIX_signals_Wait_queue> 400089d0: f4 27 60 44 st %i2, [ %i5 + 0x44 ] 400089d4: e2 26 a0 30 st %l1, [ %i2 + 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 ); 400089d8: 7f ff e8 61 call 40002b5c 400089dc: 01 00 00 00 nop _Thread_queue_Enqueue( &_POSIX_signals_Wait_queue, interval ); 400089e0: 90 10 00 1a mov %i2, %o0 400089e4: 92 10 00 1b mov %i3, %o1 400089e8: 15 10 00 30 sethi %hi(0x4000c000), %o2 400089ec: 40 00 0d 08 call 4000be0c <_Thread_queue_Enqueue_with_handler> 400089f0: 94 12 a1 78 or %o2, 0x178, %o2 ! 4000c178 <_Thread_queue_Timeout> _Thread_Enable_dispatch(); 400089f4: 40 00 0b d0 call 4000b934 <_Thread_Enable_dispatch> 400089f8: 01 00 00 00 nop /* * 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 ); 400089fc: d2 06 40 00 ld [ %i1 ], %o1 40008a00: 90 10 00 1c mov %i4, %o0 40008a04: 94 10 00 19 mov %i1, %o2 40008a08: 96 10 20 00 clr %o3 40008a0c: 40 00 16 f4 call 4000e5dc <_POSIX_signals_Clear_signals> 40008a10: 98 10 20 00 clr %o4 /* Set errno only if return code is not EINTR or * if EINTR was caused by a signal being caught, which * was not in our set. */ if ( (_Thread_Executing->Wait.return_code != EINTR) 40008a14: c2 04 20 10 ld [ %l0 + 0x10 ], %g1 40008a18: c2 00 60 34 ld [ %g1 + 0x34 ], %g1 40008a1c: 80 a0 60 04 cmp %g1, 4 40008a20: 12 80 00 09 bne 40008a44 40008a24: 01 00 00 00 nop || !(*set & signo_to_mask( the_info->si_signo )) ) { 40008a28: fa 06 40 00 ld [ %i1 ], %i5 40008a2c: 82 07 7f ff add %i5, -1, %g1 40008a30: a3 2c 40 01 sll %l1, %g1, %l1 40008a34: c2 06 00 00 ld [ %i0 ], %g1 40008a38: 80 8c 40 01 btst %l1, %g1 40008a3c: 12 80 00 09 bne 40008a60 40008a40: 01 00 00 00 nop errno = _Thread_Executing->Wait.return_code; 40008a44: 40 00 21 30 call 40010f04 <__errno> 40008a48: 01 00 00 00 nop 40008a4c: 03 10 00 6d sethi %hi(0x4001b400), %g1 40008a50: c2 00 62 30 ld [ %g1 + 0x230 ], %g1 ! 4001b630 <_Per_CPU_Information+0x10> 40008a54: c2 00 60 34 ld [ %g1 + 0x34 ], %g1 40008a58: c2 22 00 00 st %g1, [ %o0 ] return -1; 40008a5c: ba 10 3f ff mov -1, %i5 } return the_info->si_signo; } 40008a60: 81 c7 e0 08 ret 40008a64: 91 e8 00 1d restore %g0, %i5, %o0 =============================================================================== 4000a79c : int sigwait( const sigset_t *set, int *sig ) { 4000a79c: 9d e3 bf a0 save %sp, -96, %sp int status; status = sigtimedwait( set, NULL, NULL ); 4000a7a0: 92 10 20 00 clr %o1 4000a7a4: 90 10 00 18 mov %i0, %o0 4000a7a8: 7f ff ff 80 call 4000a5a8 4000a7ac: 94 10 20 00 clr %o2 if ( status != -1 ) { 4000a7b0: 80 a2 3f ff cmp %o0, -1 4000a7b4: 02 80 00 06 be 4000a7cc 4000a7b8: 80 a6 60 00 cmp %i1, 0 if ( sig ) 4000a7bc: 32 80 00 09 bne,a 4000a7e0 <== ALWAYS TAKEN 4000a7c0: d0 26 40 00 st %o0, [ %i1 ] *sig = status; return 0; 4000a7c4: 81 c7 e0 08 ret <== NOT EXECUTED 4000a7c8: 91 e8 20 00 restore %g0, 0, %o0 <== NOT EXECUTED } return errno; 4000a7cc: 40 00 20 60 call 4001294c <__errno> 4000a7d0: 01 00 00 00 nop 4000a7d4: f0 02 00 00 ld [ %o0 ], %i0 4000a7d8: 81 c7 e0 08 ret 4000a7dc: 81 e8 00 00 restore status = sigtimedwait( set, NULL, NULL ); if ( status != -1 ) { if ( sig ) *sig = status; return 0; 4000a7e0: b0 10 20 00 clr %i0 } return errno; } 4000a7e4: 81 c7 e0 08 ret 4000a7e8: 81 e8 00 00 restore =============================================================================== 40007618 : */ long sysconf( int name ) { 40007618: 9d e3 bf a0 save %sp, -96, %sp if ( name == _SC_CLK_TCK ) 4000761c: 80 a6 20 02 cmp %i0, 2 40007620: 12 80 00 09 bne 40007644 40007624: 03 10 00 5d sethi %hi(0x40017400), %g1 return (TOD_MICROSECONDS_PER_SECOND / 40007628: 03 10 00 57 sethi %hi(0x40015c00), %g1 4000762c: d2 00 60 44 ld [ %g1 + 0x44 ], %o1 ! 40015c44 40007630: 11 00 03 d0 sethi %hi(0xf4000), %o0 40007634: 40 00 30 64 call 400137c4 <.udiv> 40007638: 90 12 22 40 or %o0, 0x240, %o0 ! f4240 4000763c: 81 c7 e0 08 ret 40007640: 91 e8 00 08 restore %g0, %o0, %o0 rtems_configuration_get_microseconds_per_tick()); if ( name == _SC_OPEN_MAX ) 40007644: 80 a6 20 04 cmp %i0, 4 40007648: 02 80 00 13 be 40007694 4000764c: d0 00 60 88 ld [ %g1 + 0x88 ], %o0 return rtems_libio_number_iops; if ( name == _SC_GETPW_R_SIZE_MAX ) 40007650: 80 a6 20 33 cmp %i0, 0x33 40007654: 02 80 00 10 be 40007694 40007658: 90 10 24 00 mov 0x400, %o0 return 1024; if ( name == _SC_PAGESIZE ) 4000765c: 80 a6 20 08 cmp %i0, 8 40007660: 02 80 00 0d be 40007694 40007664: 11 00 00 04 sethi %hi(0x1000), %o0 return PAGE_SIZE; if ( name == _SC_SYMLOOP_MAX ) 40007668: 80 a6 20 4f cmp %i0, 0x4f 4000766c: 02 80 00 0a be 40007694 <== NEVER TAKEN 40007670: 90 10 20 20 mov 0x20, %o0 return RTEMS_FILESYSTEM_SYMLOOP_MAX; #if defined(__sparc__) if ( name == 515 ) /* Solaris _SC_STACK_PROT */ 40007674: 80 a6 22 03 cmp %i0, 0x203 40007678: 02 80 00 07 be 40007694 <== NEVER TAKEN 4000767c: 90 10 20 00 clr %o0 return 0; #endif rtems_set_errno_and_return_minus_one( EINVAL ); 40007680: 40 00 20 de call 4000f9f8 <__errno> 40007684: 01 00 00 00 nop 40007688: 82 10 20 16 mov 0x16, %g1 ! 16 4000768c: c2 22 00 00 st %g1, [ %o0 ] 40007690: 90 10 3f ff mov -1, %o0 } 40007694: b0 10 00 08 mov %o0, %i0 40007698: 81 c7 e0 08 ret 4000769c: 81 e8 00 00 restore =============================================================================== 40008f04 : int timer_create( clockid_t clock_id, struct sigevent *evp, timer_t *timerid ) { 40008f04: 9d e3 bf a0 save %sp, -96, %sp POSIX_Timer_Control *ptimer; if ( clock_id != CLOCK_REALTIME ) 40008f08: 80 a6 20 01 cmp %i0, 1 40008f0c: 12 80 00 13 bne 40008f58 40008f10: 80 a6 a0 00 cmp %i2, 0 rtems_set_errno_and_return_minus_one( EINVAL ); if ( !timerid ) 40008f14: 02 80 00 11 be 40008f58 40008f18: 80 a6 60 00 cmp %i1, 0 /* * The data of the structure evp are checked in order to verify if they * are coherent. */ if (evp != NULL) { 40008f1c: 02 80 00 13 be 40008f68 40008f20: 03 10 00 8f sethi %hi(0x40023c00), %g1 /* The structure has data */ if ( ( evp->sigev_notify != SIGEV_NONE ) && 40008f24: c2 06 40 00 ld [ %i1 ], %g1 40008f28: 82 00 7f ff add %g1, -1, %g1 40008f2c: 80 a0 60 01 cmp %g1, 1 40008f30: 28 80 00 03 bleu,a 40008f3c <== ALWAYS TAKEN 40008f34: c2 06 60 04 ld [ %i1 + 4 ], %g1 40008f38: 30 80 00 08 b,a 40008f58 <== NOT EXECUTED ( 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 ) 40008f3c: 80 a0 60 00 cmp %g1, 0 40008f40: 32 80 00 03 bne,a 40008f4c <== ALWAYS TAKEN 40008f44: 82 00 7f ff add %g1, -1, %g1 40008f48: 30 80 00 04 b,a 40008f58 <== NOT EXECUTED rtems_set_errno_and_return_minus_one( EINVAL ); if ( !is_valid_signo(evp->sigev_signo) ) 40008f4c: 80 a0 60 1f cmp %g1, 0x1f 40008f50: 28 80 00 06 bleu,a 40008f68 <== ALWAYS TAKEN 40008f54: 03 10 00 8f sethi %hi(0x40023c00), %g1 rtems_set_errno_and_return_minus_one( EINVAL ); 40008f58: 40 00 22 ac call 40011a08 <__errno> 40008f5c: 01 00 00 00 nop 40008f60: 10 80 00 10 b 40008fa0 40008f64: 82 10 20 16 mov 0x16, %g1 ! 16 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t level = _Thread_Dispatch_disable_level; 40008f68: c4 00 62 80 ld [ %g1 + 0x280 ], %g2 ++level; 40008f6c: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = level; 40008f70: c4 20 62 80 st %g2, [ %g1 + 0x280 ] * 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 ); 40008f74: 11 10 00 90 sethi %hi(0x40024000), %o0 40008f78: 40 00 08 6e call 4000b130 <_Objects_Allocate> 40008f7c: 90 12 21 84 or %o0, 0x184, %o0 ! 40024184 <_POSIX_Timer_Information> /* * Allocate a timer */ ptimer = _POSIX_Timer_Allocate(); if ( !ptimer ) { 40008f80: 80 a2 20 00 cmp %o0, 0 40008f84: 12 80 00 0a bne 40008fac 40008f88: 82 10 20 02 mov 2, %g1 _Thread_Enable_dispatch(); 40008f8c: 40 00 0d 69 call 4000c530 <_Thread_Enable_dispatch> 40008f90: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( EAGAIN ); 40008f94: 40 00 22 9d call 40011a08 <__errno> 40008f98: 01 00 00 00 nop 40008f9c: 82 10 20 0b mov 0xb, %g1 ! b 40008fa0: c2 22 00 00 st %g1, [ %o0 ] 40008fa4: 81 c7 e0 08 ret 40008fa8: 91 e8 3f ff restore %g0, -1, %o0 } /* The data of the created timer are stored to use them later */ ptimer->state = POSIX_TIMER_STATE_CREATE_NEW; 40008fac: c2 2a 20 3c stb %g1, [ %o0 + 0x3c ] ptimer->thread_id = _Thread_Executing->Object.id; 40008fb0: 03 10 00 90 sethi %hi(0x40024000), %g1 40008fb4: c2 00 63 e0 ld [ %g1 + 0x3e0 ], %g1 ! 400243e0 <_Per_CPU_Information+0x10> if ( evp != NULL ) { 40008fb8: 80 a6 60 00 cmp %i1, 0 } /* The data of the created timer are stored to use them later */ ptimer->state = POSIX_TIMER_STATE_CREATE_NEW; ptimer->thread_id = _Thread_Executing->Object.id; 40008fbc: c2 00 60 08 ld [ %g1 + 8 ], %g1 if ( evp != NULL ) { 40008fc0: 02 80 00 08 be 40008fe0 40008fc4: c2 22 20 38 st %g1, [ %o0 + 0x38 ] ptimer->inf.sigev_notify = evp->sigev_notify; 40008fc8: c2 06 40 00 ld [ %i1 ], %g1 40008fcc: c2 22 20 40 st %g1, [ %o0 + 0x40 ] ptimer->inf.sigev_signo = evp->sigev_signo; 40008fd0: c2 06 60 04 ld [ %i1 + 4 ], %g1 40008fd4: c2 22 20 44 st %g1, [ %o0 + 0x44 ] ptimer->inf.sigev_value = evp->sigev_value; 40008fd8: c2 06 60 08 ld [ %i1 + 8 ], %g1 40008fdc: c2 22 20 48 st %g1, [ %o0 + 0x48 ] Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 40008fe0: c4 12 20 0a lduh [ %o0 + 0xa ], %g2 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 40008fe4: 07 10 00 90 sethi %hi(0x40024000), %g3 40008fe8: c6 00 e1 a0 ld [ %g3 + 0x1a0 ], %g3 ! 400241a0 <_POSIX_Timer_Information+0x1c> } ptimer->overrun = 0; 40008fec: c0 22 20 68 clr [ %o0 + 0x68 ] ptimer->timer_data.it_value.tv_sec = 0; 40008ff0: c0 22 20 5c clr [ %o0 + 0x5c ] ptimer->timer_data.it_value.tv_nsec = 0; 40008ff4: c0 22 20 60 clr [ %o0 + 0x60 ] ptimer->timer_data.it_interval.tv_sec = 0; 40008ff8: c0 22 20 54 clr [ %o0 + 0x54 ] ptimer->timer_data.it_interval.tv_nsec = 0; 40008ffc: c0 22 20 58 clr [ %o0 + 0x58 ] Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 40009000: c0 22 20 18 clr [ %o0 + 0x18 ] the_watchdog->routine = routine; 40009004: c0 22 20 2c clr [ %o0 + 0x2c ] the_watchdog->id = id; 40009008: c0 22 20 30 clr [ %o0 + 0x30 ] the_watchdog->user_data = user_data; 4000900c: c0 22 20 34 clr [ %o0 + 0x34 ] Objects_Information *information, Objects_Control *the_object, uint32_t name ) { _Objects_Set_local_object( 40009010: c2 02 20 08 ld [ %o0 + 8 ], %g1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 40009014: 85 28 a0 02 sll %g2, 2, %g2 40009018: d0 20 c0 02 st %o0, [ %g3 + %g2 ] _Objects_Get_index( the_object->id ), the_object ); /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 4000901c: c0 22 20 0c clr [ %o0 + 0xc ] _Watchdog_Initialize( &ptimer->Timer, NULL, 0, NULL ); _Objects_Open_u32(&_POSIX_Timer_Information, &ptimer->Object, 0); *timerid = ptimer->Object.id; 40009020: c2 26 80 00 st %g1, [ %i2 ] _Thread_Enable_dispatch(); 40009024: 40 00 0d 43 call 4000c530 <_Thread_Enable_dispatch> 40009028: b0 10 20 00 clr %i0 return 0; } 4000902c: 81 c7 e0 08 ret 40009030: 81 e8 00 00 restore =============================================================================== 40007b0c : timer_t timerid, int flags, const struct itimerspec *value, struct itimerspec *ovalue ) { 40007b0c: 9d e3 bf 78 save %sp, -136, %sp Objects_Locations location; bool activated; uint32_t initial_period; struct itimerspec normalize; if ( !value ) 40007b10: 80 a6 a0 00 cmp %i2, 0 40007b14: 02 80 00 80 be 40007d14 <== NEVER TAKEN 40007b18: 01 00 00 00 nop /* * First, it verifies if the structure "value" is correct * if the number of nanoseconds is not correct return EINVAL */ if ( !_Timespec_Is_valid( &(value->it_value) ) ) { 40007b1c: 40 00 0f 36 call 4000b7f4 <_Timespec_Is_valid> 40007b20: 90 06 a0 08 add %i2, 8, %o0 40007b24: 80 8a 20 ff btst 0xff, %o0 40007b28: 02 80 00 7b be 40007d14 40007b2c: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( EINVAL ); } if ( !_Timespec_Is_valid( &(value->it_interval) ) ) { 40007b30: 40 00 0f 31 call 4000b7f4 <_Timespec_Is_valid> 40007b34: 90 10 00 1a mov %i2, %o0 40007b38: 80 8a 20 ff btst 0xff, %o0 40007b3c: 02 80 00 76 be 40007d14 <== NEVER TAKEN 40007b40: 80 8e 7f fb btst -5, %i1 rtems_set_errno_and_return_minus_one( EINVAL ); } if ( flags != TIMER_ABSTIME && flags != POSIX_TIMER_RELATIVE ) { 40007b44: 12 80 00 74 bne 40007d14 40007b48: 90 07 bf f0 add %fp, -16, %o0 rtems_set_errno_and_return_minus_one( EINVAL ); } normalize = *value; 40007b4c: 92 10 00 1a mov %i2, %o1 40007b50: 40 00 24 66 call 40010ce8 40007b54: 94 10 20 10 mov 0x10, %o2 /* Convert absolute to relative time */ if (flags == TIMER_ABSTIME) { 40007b58: 80 a6 60 04 cmp %i1, 4 40007b5c: 12 80 00 1f bne 40007bd8 40007b60: 11 10 00 80 sethi %hi(0x40020000), %o0 ) { Timestamp_Control tod_as_timestamp; Timestamp_Control *tod_as_timestamp_ptr; tod_as_timestamp_ptr = 40007b64: 90 07 bf e0 add %fp, -32, %o0 40007b68: 13 10 00 7f sethi %hi(0x4001fc00), %o1 40007b6c: 40 00 06 74 call 4000953c <_TOD_Get_with_nanoseconds> 40007b70: 92 12 62 28 or %o1, 0x228, %o1 ! 4001fe28 <_TOD> case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EINVAL ); } 40007b74: f8 1a 00 00 ldd [ %o0 ], %i4 static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); 40007b78: 94 10 20 00 clr %o2 40007b7c: 90 10 00 1c mov %i4, %o0 40007b80: 92 10 00 1d mov %i5, %o1 40007b84: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 40007b88: 40 00 48 92 call 40019dd0 <__divdi3> 40007b8c: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 40007b90: 94 10 20 00 clr %o2 static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); 40007b94: d2 27 bf e8 st %o1, [ %fp + -24 ] _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 40007b98: 90 10 00 1c mov %i4, %o0 40007b9c: 92 10 00 1d mov %i5, %o1 40007ba0: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 40007ba4: 40 00 49 76 call 4001a17c <__moddi3> 40007ba8: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 /* Convert absolute to relative time */ if (flags == TIMER_ABSTIME) { struct timespec now; _TOD_Get( &now ); /* Check for seconds in the past */ if ( _Timespec_Greater_than( &now, &normalize.it_value ) ) 40007bac: 90 07 bf f8 add %fp, -8, %o0 40007bb0: d2 27 bf ec st %o1, [ %fp + -20 ] 40007bb4: 40 00 0f 22 call 4000b83c <_Timespec_Less_than> 40007bb8: 92 07 bf e8 add %fp, -24, %o1 40007bbc: 80 8a 20 ff btst 0xff, %o0 40007bc0: 12 80 00 55 bne 40007d14 40007bc4: 92 07 bf f8 add %fp, -8, %o1 rtems_set_errno_and_return_minus_one( EINVAL ); _Timespec_Subtract( &now, &normalize.it_value, &normalize.it_value ); 40007bc8: 90 07 bf e8 add %fp, -24, %o0 40007bcc: 40 00 0f 2c call 4000b87c <_Timespec_Subtract> 40007bd0: 94 10 00 09 mov %o1, %o2 RTEMS_INLINE_ROUTINE POSIX_Timer_Control *_POSIX_Timer_Get ( timer_t id, Objects_Locations *location ) { return (POSIX_Timer_Control *) 40007bd4: 11 10 00 80 sethi %hi(0x40020000), %o0 40007bd8: 92 10 00 18 mov %i0, %o1 40007bdc: 90 12 21 a4 or %o0, 0x1a4, %o0 40007be0: 40 00 08 fe call 40009fd8 <_Objects_Get> 40007be4: 94 07 bf dc add %fp, -36, %o2 * something with the structure of times of the timer: to stop, start * or start it again */ ptimer = _POSIX_Timer_Get( timerid, &location ); switch ( location ) { 40007be8: c2 07 bf dc ld [ %fp + -36 ], %g1 40007bec: 80 a0 60 00 cmp %g1, 0 40007bf0: 12 80 00 49 bne 40007d14 40007bf4: b2 10 00 08 mov %o0, %i1 case OBJECTS_LOCAL: /* First, it verifies if the timer must be stopped */ if ( normalize.it_value.tv_sec == 0 && normalize.it_value.tv_nsec == 0 ) { 40007bf8: c2 07 bf f8 ld [ %fp + -8 ], %g1 40007bfc: 80 a0 60 00 cmp %g1, 0 40007c00: 12 80 00 14 bne 40007c50 40007c04: c2 07 bf fc ld [ %fp + -4 ], %g1 40007c08: 80 a0 60 00 cmp %g1, 0 40007c0c: 12 80 00 11 bne 40007c50 40007c10: 01 00 00 00 nop /* Stop the timer */ (void) _Watchdog_Remove( &ptimer->Timer ); 40007c14: 40 00 10 28 call 4000bcb4 <_Watchdog_Remove> 40007c18: 90 02 20 10 add %o0, 0x10, %o0 /* The old data of the timer are returned */ if ( ovalue ) 40007c1c: 80 a6 e0 00 cmp %i3, 0 40007c20: 02 80 00 05 be 40007c34 40007c24: 90 10 00 1b mov %i3, %o0 *ovalue = ptimer->timer_data; 40007c28: 92 06 60 54 add %i1, 0x54, %o1 40007c2c: 40 00 24 2f call 40010ce8 40007c30: 94 10 20 10 mov 0x10, %o2 /* The new data are set */ ptimer->timer_data = normalize; 40007c34: 90 06 60 54 add %i1, 0x54, %o0 40007c38: 92 07 bf f0 add %fp, -16, %o1 40007c3c: 40 00 24 2b call 40010ce8 40007c40: 94 10 20 10 mov 0x10, %o2 /* Indicates that the timer is created and stopped */ ptimer->state = POSIX_TIMER_STATE_CREATE_STOP; 40007c44: 82 10 20 04 mov 4, %g1 40007c48: 10 80 00 2f b 40007d04 40007c4c: c2 2e 60 3c stb %g1, [ %i1 + 0x3c ] _Thread_Enable_dispatch(); return 0; } /* Convert from seconds and nanoseconds to ticks */ ptimer->ticks = _Timespec_To_ticks( &value->it_interval ); 40007c50: 40 00 0f 1c call 4000b8c0 <_Timespec_To_ticks> 40007c54: 90 10 00 1a mov %i2, %o0 40007c58: d0 26 60 64 st %o0, [ %i1 + 0x64 ] initial_period = _Timespec_To_ticks( &normalize.it_value ); 40007c5c: 40 00 0f 19 call 4000b8c0 <_Timespec_To_ticks> 40007c60: 90 07 bf f8 add %fp, -8, %o0 activated = _POSIX_Timer_Insert_helper( 40007c64: d4 06 60 08 ld [ %i1 + 8 ], %o2 return 0; } /* Convert from seconds and nanoseconds to ticks */ ptimer->ticks = _Timespec_To_ticks( &value->it_interval ); initial_period = _Timespec_To_ticks( &normalize.it_value ); 40007c68: 92 10 00 08 mov %o0, %o1 activated = _POSIX_Timer_Insert_helper( 40007c6c: 17 10 00 1f sethi %hi(0x40007c00), %o3 40007c70: 90 06 60 10 add %i1, 0x10, %o0 40007c74: 96 12 e1 2c or %o3, 0x12c, %o3 40007c78: 40 00 18 08 call 4000dc98 <_POSIX_Timer_Insert_helper> 40007c7c: 98 10 00 19 mov %i1, %o4 initial_period, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) { 40007c80: 80 8a 20 ff btst 0xff, %o0 40007c84: 02 80 00 20 be 40007d04 40007c88: 80 a6 e0 00 cmp %i3, 0 /* * The timer has been started and is running. So we return the * old ones in "ovalue" */ if ( ovalue ) 40007c8c: 02 80 00 05 be 40007ca0 40007c90: 90 10 00 1b mov %i3, %o0 *ovalue = ptimer->timer_data; 40007c94: 92 06 60 54 add %i1, 0x54, %o1 40007c98: 40 00 24 14 call 40010ce8 40007c9c: 94 10 20 10 mov 0x10, %o2 ptimer->timer_data = normalize; 40007ca0: 94 10 20 10 mov 0x10, %o2 40007ca4: 92 07 bf f0 add %fp, -16, %o1 40007ca8: 40 00 24 10 call 40010ce8 40007cac: 90 06 60 54 add %i1, 0x54, %o0 /* Indicate that the time is running */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; 40007cb0: 82 10 20 03 mov 3, %g1 40007cb4: 90 07 bf e0 add %fp, -32, %o0 40007cb8: c2 2e 60 3c stb %g1, [ %i1 + 0x3c ] 40007cbc: 13 10 00 7f sethi %hi(0x4001fc00), %o1 40007cc0: 40 00 06 1f call 4000953c <_TOD_Get_with_nanoseconds> 40007cc4: 92 12 62 28 or %o1, 0x228, %o1 ! 4001fe28 <_TOD> case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EINVAL ); } 40007cc8: f8 1a 00 00 ldd [ %o0 ], %i4 static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); 40007ccc: 94 10 20 00 clr %o2 40007cd0: 90 10 00 1c mov %i4, %o0 40007cd4: 92 10 00 1d mov %i5, %o1 40007cd8: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 40007cdc: 40 00 48 3d call 40019dd0 <__divdi3> 40007ce0: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 40007ce4: 90 10 00 1c mov %i4, %o0 static inline void _Timestamp64_implementation_To_timespec( const Timestamp64_Control *_timestamp, struct timespec *_timespec ) { _timespec->tv_sec = (time_t) (*_timestamp / 1000000000L); 40007ce8: d2 26 60 6c st %o1, [ %i1 + 0x6c ] _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 40007cec: 94 10 20 00 clr %o2 40007cf0: 92 10 00 1d mov %i5, %o1 40007cf4: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 40007cf8: 40 00 49 21 call 4001a17c <__moddi3> 40007cfc: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 40007d00: d2 26 60 70 st %o1, [ %i1 + 0x70 ] ptimer->timer_data = normalize; /* Indicate that the time is running */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; _TOD_Get( &ptimer->time ); _Thread_Enable_dispatch(); 40007d04: 40 00 0c 36 call 4000addc <_Thread_Enable_dispatch> 40007d08: b0 10 20 00 clr %i0 40007d0c: 81 c7 e0 08 ret 40007d10: 81 e8 00 00 restore #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EINVAL ); 40007d14: 40 00 21 a4 call 400103a4 <__errno> 40007d18: b0 10 3f ff mov -1, %i0 40007d1c: 82 10 20 16 mov 0x16, %g1 40007d20: c2 22 00 00 st %g1, [ %o0 ] } 40007d24: 81 c7 e0 08 ret 40007d28: 81 e8 00 00 restore =============================================================================== 400079dc : useconds_t ualarm( useconds_t useconds, useconds_t interval ) { 400079dc: 9d e3 bf 98 save %sp, -104, %sp /* * Initialize the timer used to implement alarm(). */ if ( !the_timer->routine ) { 400079e0: 3b 10 00 66 sethi %hi(0x40019800), %i5 400079e4: ba 17 62 f8 or %i5, 0x2f8, %i5 ! 40019af8 <_POSIX_signals_Ualarm_timer> 400079e8: c2 07 60 1c ld [ %i5 + 0x1c ], %g1 400079ec: 80 a0 60 00 cmp %g1, 0 400079f0: 12 80 00 0a bne 40007a18 400079f4: b8 10 00 18 mov %i0, %i4 Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 400079f8: 03 10 00 1e sethi %hi(0x40007800), %g1 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 400079fc: c0 27 60 08 clr [ %i5 + 8 ] the_watchdog->routine = routine; 40007a00: 82 10 61 b0 or %g1, 0x1b0, %g1 the_watchdog->id = id; 40007a04: c0 27 60 20 clr [ %i5 + 0x20 ] Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 40007a08: c2 27 60 1c st %g1, [ %i5 + 0x1c ] the_watchdog->id = id; the_watchdog->user_data = user_data; 40007a0c: c0 27 60 24 clr [ %i5 + 0x24 ] useconds_t ualarm( useconds_t useconds, useconds_t interval ) { useconds_t remaining = 0; 40007a10: 10 80 00 1b b 40007a7c 40007a14: b0 10 20 00 clr %i0 if ( !the_timer->routine ) { _Watchdog_Initialize( the_timer, _POSIX_signals_Ualarm_TSR, 0, NULL ); } else { Watchdog_States state; state = _Watchdog_Remove( the_timer ); 40007a18: 40 00 0f 92 call 4000b860 <_Watchdog_Remove> 40007a1c: 90 10 00 1d mov %i5, %o0 if ( (state == WATCHDOG_ACTIVE) || (state == WATCHDOG_REMOVE_IT) ) { 40007a20: 90 02 3f fe add %o0, -2, %o0 40007a24: 80 a2 20 01 cmp %o0, 1 40007a28: 18 80 00 15 bgu 40007a7c <== NEVER TAKEN 40007a2c: b0 10 20 00 clr %i0 * 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); 40007a30: c2 07 60 0c ld [ %i5 + 0xc ], %g1 40007a34: d0 07 60 14 ld [ %i5 + 0x14 ], %o0 /* remaining is now in ticks */ _Timespec_From_ticks( ticks, &tp ); 40007a38: 92 07 bf f8 add %fp, -8, %o1 * 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); 40007a3c: 90 02 00 01 add %o0, %g1, %o0 40007a40: c2 07 60 18 ld [ %i5 + 0x18 ], %g1 /* remaining is now in ticks */ _Timespec_From_ticks( ticks, &tp ); 40007a44: 40 00 0e 4d call 4000b378 <_Timespec_From_ticks> 40007a48: 90 22 00 01 sub %o0, %g1, %o0 remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND; 40007a4c: c2 07 bf f8 ld [ %fp + -8 ], %g1 remaining += tp.tv_nsec / 1000; 40007a50: d0 07 bf fc ld [ %fp + -4 ], %o0 ticks = the_timer->initial; ticks -= (the_timer->stop_time - the_timer->start_time); /* remaining is now in ticks */ _Timespec_From_ticks( ticks, &tp ); remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND; 40007a54: 85 28 60 03 sll %g1, 3, %g2 40007a58: 87 28 60 08 sll %g1, 8, %g3 40007a5c: 84 20 c0 02 sub %g3, %g2, %g2 remaining += tp.tv_nsec / 1000; 40007a60: 92 10 23 e8 mov 0x3e8, %o1 ticks = the_timer->initial; ticks -= (the_timer->stop_time - the_timer->start_time); /* remaining is now in ticks */ _Timespec_From_ticks( ticks, &tp ); remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND; 40007a64: b1 28 a0 06 sll %g2, 6, %i0 40007a68: b0 26 00 02 sub %i0, %g2, %i0 remaining += tp.tv_nsec / 1000; 40007a6c: 40 00 34 d5 call 40014dc0 <.div> 40007a70: b0 06 00 01 add %i0, %g1, %i0 ticks = the_timer->initial; ticks -= (the_timer->stop_time - the_timer->start_time); /* remaining is now in ticks */ _Timespec_From_ticks( ticks, &tp ); remaining = tp.tv_sec * TOD_MICROSECONDS_PER_SECOND; 40007a74: b1 2e 20 06 sll %i0, 6, %i0 remaining += tp.tv_nsec / 1000; 40007a78: b0 02 00 18 add %o0, %i0, %i0 /* * 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 ) { 40007a7c: 80 a7 20 00 cmp %i4, 0 40007a80: 02 80 00 19 be 40007ae4 40007a84: 3b 00 03 d0 sethi %hi(0xf4000), %i5 Watchdog_Interval ticks; tp.tv_sec = useconds / TOD_MICROSECONDS_PER_SECOND; 40007a88: 90 10 00 1c mov %i4, %o0 40007a8c: 40 00 34 cb call 40014db8 <.udiv> 40007a90: 92 17 62 40 or %i5, 0x240, %o1 tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; 40007a94: 92 17 62 40 or %i5, 0x240, %o1 * 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; 40007a98: d0 27 bf f8 st %o0, [ %fp + -8 ] tp.tv_nsec = (useconds % TOD_MICROSECONDS_PER_SECOND) * 1000; 40007a9c: 40 00 35 73 call 40015068 <.urem> 40007aa0: 90 10 00 1c mov %i4, %o0 40007aa4: 85 2a 20 07 sll %o0, 7, %g2 40007aa8: 83 2a 20 02 sll %o0, 2, %g1 40007aac: 82 20 80 01 sub %g2, %g1, %g1 40007ab0: 90 00 40 08 add %g1, %o0, %o0 40007ab4: 91 2a 20 03 sll %o0, 3, %o0 40007ab8: d0 27 bf fc st %o0, [ %fp + -4 ] ticks = _Timespec_To_ticks( &tp ); 40007abc: 40 00 0e 44 call 4000b3cc <_Timespec_To_ticks> 40007ac0: 90 07 bf f8 add %fp, -8, %o0 if ( ticks == 0 ) ticks = 1; _Watchdog_Insert_ticks( the_timer, _Timespec_To_ticks( &tp ) ); 40007ac4: 40 00 0e 42 call 4000b3cc <_Timespec_To_ticks> 40007ac8: 90 07 bf f8 add %fp, -8, %o0 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 40007acc: 13 10 00 66 sethi %hi(0x40019800), %o1 40007ad0: 92 12 62 f8 or %o1, 0x2f8, %o1 ! 40019af8 <_POSIX_signals_Ualarm_timer> 40007ad4: d0 22 60 0c st %o0, [ %o1 + 0xc ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 40007ad8: 11 10 00 64 sethi %hi(0x40019000), %o0 40007adc: 40 00 0f 09 call 4000b700 <_Watchdog_Insert> 40007ae0: 90 12 22 a8 or %o0, 0x2a8, %o0 ! 400192a8 <_Watchdog_Ticks_chain> } return remaining; } 40007ae4: 81 c7 e0 08 ret 40007ae8: 81 e8 00 00 restore