=============================================================================== 4000aa38 <_CORE_RWLock_Release>: CORE_RWLock_Status _CORE_RWLock_Release( CORE_RWLock_Control *the_rwlock, Thread_Control *executing ) { 4000aa38: 9d e3 bf a0 save %sp, -96, %sp * 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 ); 4000aa3c: 7f ff e4 ce call 40003d74 4000aa40: 01 00 00 00 nop if ( the_rwlock->current_state == CORE_RWLOCK_UNLOCKED){ 4000aa44: c2 06 20 44 ld [ %i0 + 0x44 ], %g1 4000aa48: 80 a0 60 00 cmp %g1, 0 4000aa4c: 12 80 00 08 bne 4000aa6c <_CORE_RWLock_Release+0x34> 4000aa50: 80 a0 60 01 cmp %g1, 1 _ISR_Enable( level ); 4000aa54: 7f ff e4 cb call 40003d80 4000aa58: b0 10 20 00 clr %i0 executing->Wait.return_code = CORE_RWLOCK_UNAVAILABLE; 4000aa5c: 82 10 20 02 mov 2, %g1 4000aa60: c2 26 60 34 st %g1, [ %i1 + 0x34 ] 4000aa64: 81 c7 e0 08 ret 4000aa68: 81 e8 00 00 restore return CORE_RWLOCK_SUCCESSFUL; } if ( the_rwlock->current_state == CORE_RWLOCK_LOCKED_FOR_READING ) { 4000aa6c: 32 80 00 0b bne,a 4000aa98 <_CORE_RWLock_Release+0x60> 4000aa70: c0 26 60 34 clr [ %i1 + 0x34 ] the_rwlock->number_of_readers -= 1; 4000aa74: c2 06 20 48 ld [ %i0 + 0x48 ], %g1 4000aa78: 82 00 7f ff add %g1, -1, %g1 if ( the_rwlock->number_of_readers != 0 ) { 4000aa7c: 80 a0 60 00 cmp %g1, 0 4000aa80: 02 80 00 05 be 4000aa94 <_CORE_RWLock_Release+0x5c> 4000aa84: c2 26 20 48 st %g1, [ %i0 + 0x48 ] /* must be unlocked again */ _ISR_Enable( level ); 4000aa88: 7f ff e4 be call 40003d80 4000aa8c: b0 10 20 00 clr %i0 return CORE_RWLOCK_SUCCESSFUL; 4000aa90: 30 80 00 24 b,a 4000ab20 <_CORE_RWLock_Release+0xe8> } } /* CORE_RWLOCK_LOCKED_FOR_WRITING or READING with readers */ executing->Wait.return_code = CORE_RWLOCK_SUCCESSFUL; 4000aa94: c0 26 60 34 clr [ %i1 + 0x34 ] /* * Implicitly transition to "unlocked" and find another thread interested * in obtaining this rwlock. */ the_rwlock->current_state = CORE_RWLOCK_UNLOCKED; 4000aa98: c0 26 20 44 clr [ %i0 + 0x44 ] _ISR_Enable( level ); 4000aa9c: 7f ff e4 b9 call 40003d80 4000aaa0: 01 00 00 00 nop next = _Thread_queue_Dequeue( &the_rwlock->Wait_queue ); 4000aaa4: 40 00 07 7e call 4000c89c <_Thread_queue_Dequeue> 4000aaa8: 90 10 00 18 mov %i0, %o0 if ( next ) { 4000aaac: 80 a2 20 00 cmp %o0, 0 4000aab0: 22 80 00 1c be,a 4000ab20 <_CORE_RWLock_Release+0xe8> 4000aab4: b0 10 20 00 clr %i0 if ( next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE ) { 4000aab8: c2 02 20 30 ld [ %o0 + 0x30 ], %g1 4000aabc: 80 a0 60 01 cmp %g1, 1 4000aac0: 32 80 00 05 bne,a 4000aad4 <_CORE_RWLock_Release+0x9c> 4000aac4: c2 06 20 48 ld [ %i0 + 0x48 ], %g1 the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_WRITING; 4000aac8: 82 10 20 02 mov 2, %g1 return CORE_RWLOCK_SUCCESSFUL; 4000aacc: 10 80 00 14 b 4000ab1c <_CORE_RWLock_Release+0xe4> 4000aad0: c2 26 20 44 st %g1, [ %i0 + 0x44 ] } /* * Must be CORE_RWLOCK_THREAD_WAITING_FOR_READING */ the_rwlock->number_of_readers += 1; 4000aad4: 82 00 60 01 inc %g1 4000aad8: c2 26 20 48 st %g1, [ %i0 + 0x48 ] the_rwlock->current_state = CORE_RWLOCK_LOCKED_FOR_READING; 4000aadc: 82 10 20 01 mov 1, %g1 4000aae0: 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 ); 4000aae4: 40 00 08 96 call 4000cd3c <_Thread_queue_First> 4000aae8: 90 10 00 18 mov %i0, %o0 if ( !next || 4000aaec: 92 92 20 00 orcc %o0, 0, %o1 4000aaf0: 22 80 00 0c be,a 4000ab20 <_CORE_RWLock_Release+0xe8> 4000aaf4: b0 10 20 00 clr %i0 4000aaf8: c2 02 60 30 ld [ %o1 + 0x30 ], %g1 4000aafc: 80 a0 60 01 cmp %g1, 1 4000ab00: 02 80 00 07 be 4000ab1c <_CORE_RWLock_Release+0xe4> <== NEVER TAKEN 4000ab04: 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; 4000ab08: c2 06 20 48 ld [ %i0 + 0x48 ], %g1 4000ab0c: 82 00 60 01 inc %g1 _Thread_queue_Extract( &the_rwlock->Wait_queue, next ); 4000ab10: 40 00 08 50 call 4000cc50 <_Thread_queue_Extract> 4000ab14: c2 26 20 48 st %g1, [ %i0 + 0x48 ] } 4000ab18: 30 bf ff f3 b,a 4000aae4 <_CORE_RWLock_Release+0xac> } /* indentation is to match _ISR_Disable at top */ return CORE_RWLOCK_SUCCESSFUL; } 4000ab1c: b0 10 20 00 clr %i0 4000ab20: 81 c7 e0 08 ret 4000ab24: 81 e8 00 00 restore =============================================================================== 4000ab28 <_CORE_RWLock_Timeout>: void _CORE_RWLock_Timeout( Objects_Id id, void *ignored ) { 4000ab28: 9d e3 bf 98 save %sp, -104, %sp Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 4000ab2c: 90 10 00 18 mov %i0, %o0 4000ab30: 40 00 06 85 call 4000c544 <_Thread_Get> 4000ab34: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 4000ab38: c2 07 bf fc ld [ %fp + -4 ], %g1 4000ab3c: 80 a0 60 00 cmp %g1, 0 4000ab40: 12 80 00 07 bne 4000ab5c <_CORE_RWLock_Timeout+0x34> <== NEVER TAKEN 4000ab44: 01 00 00 00 nop #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 4000ab48: 40 00 08 be call 4000ce40 <_Thread_queue_Process_timeout> 4000ab4c: 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 disable_level = _Thread_Dispatch_disable_level; 4000ab50: c4 01 a0 10 ld [ %g6 + 0x10 ], %g2 ISR_Level level; _ISR_Disable( level ); #endif --disable_level; 4000ab54: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = disable_level; 4000ab58: c4 21 a0 10 st %g2, [ %g6 + 0x10 ] 4000ab5c: 81 c7 e0 08 ret 4000ab60: 81 e8 00 00 restore =============================================================================== 4000846c <_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 ) { 4000846c: 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)) ) { 40008470: 90 10 00 18 mov %i0, %o0 40008474: 40 00 07 4a call 4000a19c <_Thread_queue_Dequeue> 40008478: ba 10 00 18 mov %i0, %i5 4000847c: 80 a2 20 00 cmp %o0, 0 40008480: 12 80 00 0e bne 400084b8 <_CORE_semaphore_Surrender+0x4c> 40008484: 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 ); 40008488: 7f ff e7 eb call 40002434 4000848c: 01 00 00 00 nop if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) 40008490: c2 07 60 48 ld [ %i5 + 0x48 ], %g1 40008494: c4 07 60 40 ld [ %i5 + 0x40 ], %g2 40008498: 80 a0 40 02 cmp %g1, %g2 4000849c: 1a 80 00 05 bcc 400084b0 <_CORE_semaphore_Surrender+0x44> <== NEVER TAKEN 400084a0: b0 10 20 04 mov 4, %i0 the_semaphore->count += 1; 400084a4: 82 00 60 01 inc %g1 { Thread_Control *the_thread; ISR_Level level; CORE_semaphore_Status status; status = CORE_SEMAPHORE_STATUS_SUCCESSFUL; 400084a8: b0 10 20 00 clr %i0 #endif } else { _ISR_Disable( level ); if ( the_semaphore->count < the_semaphore->Attributes.maximum_count ) the_semaphore->count += 1; 400084ac: c2 27 60 48 st %g1, [ %i5 + 0x48 ] else status = CORE_SEMAPHORE_MAXIMUM_COUNT_EXCEEDED; _ISR_Enable( level ); 400084b0: 7f ff e7 e4 call 40002440 400084b4: 01 00 00 00 nop } return status; } 400084b8: 81 c7 e0 08 ret 400084bc: 81 e8 00 00 restore =============================================================================== 400071cc <_Event_Surrender>: rtems_event_set event_in, Event_Control *event, Thread_blocking_operation_States *sync_state, States_Control wait_state ) { 400071cc: 9d e3 bf a0 save %sp, -96, %sp rtems_event_set seized_events; rtems_option option_set; option_set = the_thread->Wait.option; _ISR_Disable( level ); 400071d0: 7f ff ec 99 call 40002434 400071d4: fa 06 20 30 ld [ %i0 + 0x30 ], %i5 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; 400071d8: c2 06 80 00 ld [ %i2 ], %g1 400071dc: b2 16 40 01 or %i1, %g1, %i1 400071e0: f2 26 80 00 st %i1, [ %i2 ] /* * At this point the event condition is a speculative quantity. Later state * checks will show if the thread actually waits for an event. */ event_condition = the_thread->Wait.count; 400071e4: c4 06 20 24 ld [ %i0 + 0x24 ], %g2 seized_events = _Event_sets_Get( pending_events, event_condition ); if ( 400071e8: 82 8e 40 02 andcc %i1, %g2, %g1 400071ec: 02 80 00 31 be 400072b0 <_Event_Surrender+0xe4> 400071f0: 80 a0 40 02 cmp %g1, %g2 !_Event_sets_Is_empty( seized_events ) && ( seized_events == event_condition || _Options_Is_any( option_set ) ) 400071f4: 02 80 00 04 be 40007204 <_Event_Surrender+0x38> 400071f8: 80 8f 60 02 btst 2, %i5 400071fc: 02 80 00 2d be 400072b0 <_Event_Surrender+0xe4> 40007200: 01 00 00 00 nop * section issue to deal with. The entity sending to the executing thread * can be either the executing thread or an ISR. In case it is the * executing thread, then the blocking operation state is not equal to * THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED. */ if ( _Thread_Is_executing( the_thread ) && 40007204: c4 01 a0 18 ld [ %g6 + 0x18 ], %g2 40007208: 80 a6 00 02 cmp %i0, %g2 4000720c: 32 80 00 0e bne,a 40007244 <_Event_Surrender+0x78> 40007210: c4 06 20 10 ld [ %i0 + 0x10 ], %g2 40007214: c4 06 c0 00 ld [ %i3 ], %g2 40007218: 80 a0 a0 01 cmp %g2, 1 4000721c: 32 80 00 0a bne,a 40007244 <_Event_Surrender+0x78> 40007220: c4 06 20 10 ld [ %i0 + 0x10 ], %g2 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) ); 40007224: 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; 40007228: c4 06 20 28 ld [ %i0 + 0x28 ], %g2 * executing thread, then the blocking operation state is not equal to * THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED. */ if ( _Thread_Is_executing( the_thread ) && *sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) { event->pending_events = _Event_sets_Clear( 4000722c: f2 26 80 00 st %i1, [ %i2 ] pending_events, seized_events ); the_thread->Wait.count = 0; 40007230: c0 26 20 24 clr [ %i0 + 0x24 ] *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 40007234: c2 20 80 00 st %g1, [ %g2 ] *sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; 40007238: 82 10 20 03 mov 3, %g1 4000723c: 10 80 00 1d b 400072b0 <_Event_Surrender+0xe4> 40007240: c2 26 c0 00 st %g1, [ %i3 ] } else if ( _States_Are_set( the_thread->current_state, wait_state ) ) { 40007244: 80 8f 00 02 btst %i4, %g2 40007248: 02 80 00 1a be 400072b0 <_Event_Surrender+0xe4> <== NEVER TAKEN 4000724c: 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; 40007250: c4 06 20 28 ld [ %i0 + 0x28 ], %g2 ); the_thread->Wait.count = 0; *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; *sync_state = THREAD_BLOCKING_OPERATION_SATISFIED; } else if ( _States_Are_set( the_thread->current_state, wait_state ) ) { event->pending_events = _Event_sets_Clear( 40007254: f2 26 80 00 st %i1, [ %i2 ] pending_events, seized_events ); the_thread->Wait.count = 0; 40007258: c0 26 20 24 clr [ %i0 + 0x24 ] *(rtems_event_set *)the_thread->Wait.return_argument = seized_events; 4000725c: c2 20 80 00 st %g1, [ %g2 ] _ISR_Flash( level ); 40007260: 7f ff ec 78 call 40002440 40007264: 01 00 00 00 nop 40007268: 7f ff ec 73 call 40002434 4000726c: 01 00 00 00 nop if ( !_Watchdog_Is_active( &the_thread->Timer ) ) { 40007270: c2 06 20 50 ld [ %i0 + 0x50 ], %g1 40007274: 80 a0 60 02 cmp %g1, 2 40007278: 02 80 00 06 be 40007290 <_Event_Surrender+0xc4> 4000727c: 82 10 20 03 mov 3, %g1 _ISR_Enable( level ); 40007280: 7f ff ec 70 call 40002440 40007284: 33 04 03 ff sethi %hi(0x100ffc00), %i1 RTEMS_INLINE_ROUTINE void _Thread_Unblock ( Thread_Control *the_thread ) { _Thread_Clear_state( the_thread, STATES_BLOCKED ); 40007288: 10 80 00 08 b 400072a8 <_Event_Surrender+0xdc> 4000728c: b2 16 63 f8 or %i1, 0x3f8, %i1 ! 100ffff8 RTEMS_INLINE_ROUTINE void _Watchdog_Deactivate( Watchdog_Control *the_watchdog ) { the_watchdog->state = WATCHDOG_REMOVE_IT; 40007290: c2 26 20 50 st %g1, [ %i0 + 0x50 ] _Thread_Unblock( the_thread ); } else { _Watchdog_Deactivate( &the_thread->Timer ); _ISR_Enable( level ); 40007294: 7f ff ec 6b call 40002440 40007298: 33 04 03 ff sethi %hi(0x100ffc00), %i1 (void) _Watchdog_Remove( &the_thread->Timer ); 4000729c: 40 00 0f 7f call 4000b098 <_Watchdog_Remove> 400072a0: 90 06 20 48 add %i0, 0x48, %o0 400072a4: b2 16 63 f8 or %i1, 0x3f8, %i1 400072a8: 40 00 0a 31 call 40009b6c <_Thread_Clear_state> 400072ac: 81 e8 00 00 restore _Thread_Unblock( the_thread ); } return; } } _ISR_Enable( level ); 400072b0: 7f ff ec 64 call 40002440 400072b4: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 400072b8 <_Event_Timeout>: void _Event_Timeout( Objects_Id id, void *arg ) { 400072b8: 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 ); 400072bc: 90 10 00 18 mov %i0, %o0 400072c0: 40 00 0a e1 call 40009e44 <_Thread_Get> 400072c4: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 400072c8: c2 07 bf fc ld [ %fp + -4 ], %g1 400072cc: 80 a0 60 00 cmp %g1, 0 400072d0: 12 80 00 1f bne 4000734c <_Event_Timeout+0x94> <== NEVER TAKEN 400072d4: 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 ); 400072d8: 7f ff ec 57 call 40002434 400072dc: 01 00 00 00 nop * This test is necessary to avoid state corruption if the timeout * happens after the event condition is satisfied in * _Event_Surrender(). A satisfied event condition is indicated with * count set to zero. */ if ( !the_thread->Wait.count ) { 400072e0: c2 07 60 24 ld [ %i5 + 0x24 ], %g1 400072e4: 80 a0 60 00 cmp %g1, 0 400072e8: 32 80 00 05 bne,a 400072fc <_Event_Timeout+0x44> 400072ec: c2 01 a0 18 ld [ %g6 + 0x18 ], %g1 _ISR_Enable( level ); 400072f0: 7f ff ec 54 call 40002440 400072f4: 01 00 00 00 nop 400072f8: 30 80 00 12 b,a 40007340 <_Event_Timeout+0x88> _Objects_Put_without_thread_dispatch( &the_thread->Object ); return; } the_thread->Wait.count = 0; if ( _Thread_Is_executing( the_thread ) ) { 400072fc: 80 a7 40 01 cmp %i5, %g1 40007300: 12 80 00 08 bne 40007320 <_Event_Timeout+0x68> 40007304: c0 27 60 24 clr [ %i5 + 0x24 ] if ( *sync_state == THREAD_BLOCKING_OPERATION_NOTHING_HAPPENED ) 40007308: c2 06 40 00 ld [ %i1 ], %g1 4000730c: 80 a0 60 01 cmp %g1, 1 40007310: 12 80 00 05 bne 40007324 <_Event_Timeout+0x6c> <== NEVER TAKEN 40007314: 82 10 20 06 mov 6, %g1 *sync_state = THREAD_BLOCKING_OPERATION_TIMEOUT; 40007318: 82 10 20 02 mov 2, %g1 4000731c: c2 26 40 00 st %g1, [ %i1 ] } the_thread->Wait.return_code = RTEMS_TIMEOUT; 40007320: 82 10 20 06 mov 6, %g1 40007324: c2 27 60 34 st %g1, [ %i5 + 0x34 ] _ISR_Enable( level ); 40007328: 7f ff ec 46 call 40002440 4000732c: 01 00 00 00 nop 40007330: 13 04 03 ff sethi %hi(0x100ffc00), %o1 40007334: 90 10 00 1d mov %i5, %o0 40007338: 40 00 0a 0d call 40009b6c <_Thread_Clear_state> 4000733c: 92 12 63 f8 or %o1, 0x3f8, %o1 * * This routine decrements the thread dispatch level. */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_decrement_disable_level(void) { uint32_t disable_level = _Thread_Dispatch_disable_level; 40007340: c4 01 a0 10 ld [ %g6 + 0x10 ], %g2 ISR_Level level; _ISR_Disable( level ); #endif --disable_level; 40007344: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = disable_level; 40007348: c4 21 a0 10 st %g2, [ %g6 + 0x10 ] 4000734c: 81 c7 e0 08 ret 40007350: 81 e8 00 00 restore =============================================================================== 4000712c <_Freechain_Get>: } void *_Freechain_Get(Freechain_Control *freechain) { 4000712c: 9d e3 bf a0 save %sp, -96, %sp if ( _Chain_Is_empty( &freechain->Freechain ) ) { 40007130: c4 06 00 00 ld [ %i0 ], %g2 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 40007134: 82 06 20 04 add %i0, 4, %g1 40007138: 80 a0 80 01 cmp %g2, %g1 4000713c: 22 80 00 08 be,a 4000715c <_Freechain_Get+0x30> 40007140: c2 06 20 0c ld [ %i0 + 0xc ], %g1 RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_first_unprotected( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; 40007144: c2 06 00 00 ld [ %i0 ], %g1 Chain_Node *new_first = old_first->next; 40007148: c4 00 40 00 ld [ %g1 ], %g2 head->next = new_first; 4000714c: c4 26 00 00 st %g2, [ %i0 ] new_first->previous = head; 40007150: f0 20 a0 04 st %i0, [ %g2 + 4 ] if ( !( *freechain->extend )( freechain ) ) { return NULL; } } return _Chain_Get_first_unprotected( &freechain->Freechain ); 40007154: 81 c7 e0 08 ret 40007158: 91 e8 00 01 restore %g0, %g1, %o0 } void *_Freechain_Get(Freechain_Control *freechain) { if ( _Chain_Is_empty( &freechain->Freechain ) ) { if ( !( *freechain->extend )( freechain ) ) { 4000715c: 9f c0 40 00 call %g1 40007160: 90 10 00 18 mov %i0, %o0 40007164: 80 a2 20 00 cmp %o0, 0 40007168: 32 bf ff f8 bne,a 40007148 <_Freechain_Get+0x1c> <== ALWAYS TAKEN 4000716c: c2 06 00 00 ld [ %i0 ], %g1 return NULL; } } return _Chain_Get_first_unprotected( &freechain->Freechain ); } 40007170: 81 c7 e0 08 ret <== NOT EXECUTED 40007174: 91 e8 20 00 restore %g0, 0, %o0 <== NOT EXECUTED =============================================================================== 4000d8c8 <_Heap_Extend>: Heap_Control *heap, void *extend_area_begin_ptr, uintptr_t extend_area_size, uintptr_t unused __attribute__((unused)) ) { 4000d8c8: 9d e3 bf 98 save %sp, -104, %sp Heap_Block *start_block = first_block; Heap_Block *merge_below_block = NULL; Heap_Block *merge_above_block = NULL; Heap_Block *link_below_block = NULL; Heap_Block *link_above_block = NULL; Heap_Block *extend_first_block = NULL; 4000d8cc: c0 27 bf f8 clr [ %fp + -8 ] Heap_Block *extend_last_block = NULL; 4000d8d0: c0 27 bf fc clr [ %fp + -4 ] uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; uintptr_t const extend_area_begin = (uintptr_t) extend_area_begin_ptr; uintptr_t const extend_area_end = extend_area_begin + extend_area_size; 4000d8d4: ba 06 40 1a add %i1, %i2, %i5 uintptr_t extend_area_size, uintptr_t unused __attribute__((unused)) ) { Heap_Statistics *const stats = &heap->stats; Heap_Block *const first_block = heap->first_block; 4000d8d8: e4 06 20 20 ld [ %i0 + 0x20 ], %l2 Heap_Block *merge_above_block = NULL; Heap_Block *link_below_block = NULL; Heap_Block *link_above_block = NULL; Heap_Block *extend_first_block = NULL; Heap_Block *extend_last_block = NULL; uintptr_t const page_size = heap->page_size; 4000d8dc: ec 06 20 10 ld [ %i0 + 0x10 ], %l6 uintptr_t const min_block_size = heap->min_block_size; 4000d8e0: d6 06 20 14 ld [ %i0 + 0x14 ], %o3 uintptr_t const free_size = stats->free_size; uintptr_t extend_first_block_size = 0; uintptr_t extended_size = 0; bool extend_area_ok = false; if ( extend_area_end < extend_area_begin ) { 4000d8e4: 80 a7 40 19 cmp %i5, %i1 4000d8e8: 1a 80 00 04 bcc 4000d8f8 <_Heap_Extend+0x30> 4000d8ec: e6 06 20 30 ld [ %i0 + 0x30 ], %l3 return 0; 4000d8f0: 81 c7 e0 08 ret 4000d8f4: 91 e8 20 00 restore %g0, 0, %o0 } extend_area_ok = _Heap_Get_first_and_last_block( 4000d8f8: 90 10 00 19 mov %i1, %o0 4000d8fc: 92 10 00 1a mov %i2, %o1 4000d900: 94 10 00 16 mov %l6, %o2 4000d904: 98 07 bf f8 add %fp, -8, %o4 4000d908: 7f ff ec 3f call 40008a04 <_Heap_Get_first_and_last_block> 4000d90c: 9a 07 bf fc add %fp, -4, %o5 page_size, min_block_size, &extend_first_block, &extend_last_block ); if (!extend_area_ok ) { 4000d910: 80 a2 20 00 cmp %o0, 0 4000d914: 02 bf ff f7 be 4000d8f0 <_Heap_Extend+0x28> 4000d918: b6 10 00 12 mov %l2, %i3 4000d91c: a2 10 20 00 clr %l1 4000d920: a8 10 20 00 clr %l4 4000d924: b8 10 20 00 clr %i4 4000d928: a0 10 20 00 clr %l0 return 0; } do { uintptr_t const sub_area_begin = (start_block != first_block) ? (uintptr_t) start_block : heap->area_begin; 4000d92c: 80 a6 c0 12 cmp %i3, %l2 4000d930: 12 80 00 03 bne 4000d93c <_Heap_Extend+0x74> <== NEVER TAKEN 4000d934: aa 10 00 1b mov %i3, %l5 4000d938: ea 06 20 18 ld [ %i0 + 0x18 ], %l5 uintptr_t const sub_area_end = start_block->prev_size; 4000d93c: f4 06 c0 00 ld [ %i3 ], %i2 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4000d940: 92 10 00 16 mov %l6, %o1 4000d944: 40 00 18 f8 call 40013d24 <.urem> 4000d948: 90 10 00 1a mov %i2, %o0 4000d94c: ae 06 bf f8 add %i2, -8, %l7 Heap_Block *const end_block = _Heap_Block_of_alloc_area( sub_area_end, page_size ); if ( 4000d950: 80 a5 40 1d cmp %l5, %i5 4000d954: 1a 80 00 05 bcc 4000d968 <_Heap_Extend+0xa0> 4000d958: 90 25 c0 08 sub %l7, %o0, %o0 4000d95c: 80 a6 40 1a cmp %i1, %i2 4000d960: 0a bf ff e4 bcs 4000d8f0 <_Heap_Extend+0x28> 4000d964: 01 00 00 00 nop sub_area_end > extend_area_begin && extend_area_end > sub_area_begin ) { return 0; } if ( extend_area_end == sub_area_begin ) { 4000d968: 80 a7 40 15 cmp %i5, %l5 4000d96c: 02 80 00 06 be 4000d984 <_Heap_Extend+0xbc> 4000d970: 80 a7 40 1a cmp %i5, %i2 merge_below_block = start_block; } else if ( extend_area_end < sub_area_end ) { 4000d974: 2a 80 00 05 bcs,a 4000d988 <_Heap_Extend+0xc0> 4000d978: a8 10 00 1b mov %i3, %l4 link_below_block = start_block; } if ( sub_area_end == extend_area_begin ) { 4000d97c: 10 80 00 04 b 4000d98c <_Heap_Extend+0xc4> 4000d980: 80 a6 80 19 cmp %i2, %i1 4000d984: a0 10 00 1b mov %i3, %l0 4000d988: 80 a6 80 19 cmp %i2, %i1 4000d98c: 12 80 00 05 bne 4000d9a0 <_Heap_Extend+0xd8> 4000d990: 80 a6 80 19 cmp %i2, %i1 start_block->prev_size = extend_area_end; 4000d994: fa 26 c0 00 st %i5, [ %i3 ] 4000d998: 10 80 00 04 b 4000d9a8 <_Heap_Extend+0xe0> 4000d99c: b8 10 00 08 mov %o0, %i4 merge_above_block = end_block; } else if ( sub_area_end < extend_area_begin ) { 4000d9a0: 2a 80 00 02 bcs,a 4000d9a8 <_Heap_Extend+0xe0> 4000d9a4: a2 10 00 08 mov %o0, %l1 - 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; 4000d9a8: f6 02 20 04 ld [ %o0 + 4 ], %i3 4000d9ac: b6 0e ff fe and %i3, -2, %i3 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4000d9b0: b6 06 c0 08 add %i3, %o0, %i3 link_above_block = end_block; } start_block = _Heap_Block_at( end_block, _Heap_Block_size( end_block ) ); } while ( start_block != first_block ); 4000d9b4: 80 a6 c0 12 cmp %i3, %l2 4000d9b8: 12 bf ff e1 bne 4000d93c <_Heap_Extend+0x74> 4000d9bc: aa 10 00 1b mov %i3, %l5 if ( extend_area_begin < heap->area_begin ) { 4000d9c0: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 4000d9c4: 80 a6 40 01 cmp %i1, %g1 4000d9c8: 3a 80 00 04 bcc,a 4000d9d8 <_Heap_Extend+0x110> 4000d9cc: c2 06 20 1c ld [ %i0 + 0x1c ], %g1 4000d9d0: 10 80 00 05 b 4000d9e4 <_Heap_Extend+0x11c> 4000d9d4: f2 26 20 18 st %i1, [ %i0 + 0x18 ] heap->area_begin = extend_area_begin; } else if ( heap->area_end < extend_area_end ) { 4000d9d8: 80 a0 40 1d cmp %g1, %i5 4000d9dc: 2a 80 00 02 bcs,a 4000d9e4 <_Heap_Extend+0x11c> 4000d9e0: fa 26 20 1c st %i5, [ %i0 + 0x1c ] heap->area_end = extend_area_end; } extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; 4000d9e4: c4 07 bf f8 ld [ %fp + -8 ], %g2 4000d9e8: c2 07 bf fc ld [ %fp + -4 ], %g1 extend_first_block->prev_size = extend_area_end; 4000d9ec: fa 20 80 00 st %i5, [ %g2 ] heap->area_begin = extend_area_begin; } else if ( heap->area_end < extend_area_end ) { heap->area_end = extend_area_end; } extend_first_block_size = 4000d9f0: 86 20 40 02 sub %g1, %g2, %g3 (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; extend_first_block->prev_size = extend_area_end; extend_first_block->size_and_flag = extend_first_block_size | HEAP_PREV_BLOCK_USED; 4000d9f4: 88 10 e0 01 or %g3, 1, %g4 extend_first_block_size = (uintptr_t) extend_last_block - (uintptr_t) extend_first_block; extend_first_block->prev_size = extend_area_end; extend_first_block->size_and_flag = 4000d9f8: c8 20 a0 04 st %g4, [ %g2 + 4 ] extend_first_block_size | HEAP_PREV_BLOCK_USED; _Heap_Protection_block_initialize( heap, extend_first_block ); extend_last_block->prev_size = extend_first_block_size; 4000d9fc: c6 20 40 00 st %g3, [ %g1 ] extend_last_block->size_and_flag = 0; _Heap_Protection_block_initialize( heap, extend_last_block ); if ( (uintptr_t) extend_first_block < (uintptr_t) heap->first_block ) { 4000da00: c6 06 20 20 ld [ %i0 + 0x20 ], %g3 4000da04: 80 a0 c0 02 cmp %g3, %g2 4000da08: 08 80 00 04 bleu 4000da18 <_Heap_Extend+0x150> 4000da0c: c0 20 60 04 clr [ %g1 + 4 ] 4000da10: 10 80 00 06 b 4000da28 <_Heap_Extend+0x160> 4000da14: c4 26 20 20 st %g2, [ %i0 + 0x20 ] heap->first_block = extend_first_block; } else if ( (uintptr_t) extend_last_block > (uintptr_t) heap->last_block ) { 4000da18: c4 06 20 24 ld [ %i0 + 0x24 ], %g2 4000da1c: 80 a0 80 01 cmp %g2, %g1 4000da20: 2a 80 00 02 bcs,a 4000da28 <_Heap_Extend+0x160> 4000da24: c2 26 20 24 st %g1, [ %i0 + 0x24 ] heap->last_block = extend_last_block; } if ( merge_below_block != NULL ) { 4000da28: 80 a4 20 00 cmp %l0, 0 4000da2c: 02 80 00 14 be 4000da7c <_Heap_Extend+0x1b4> 4000da30: b2 06 60 08 add %i1, 8, %i1 Heap_Control *heap, uintptr_t extend_area_begin, Heap_Block *first_block ) { uintptr_t const page_size = heap->page_size; 4000da34: f6 06 20 10 ld [ %i0 + 0x10 ], %i3 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_up( uintptr_t value, uintptr_t alignment ) { uintptr_t remainder = value % alignment; 4000da38: 92 10 00 1b mov %i3, %o1 4000da3c: 40 00 18 ba call 40013d24 <.urem> 4000da40: 90 10 00 19 mov %i1, %o0 if ( remainder != 0 ) { 4000da44: 80 a2 20 00 cmp %o0, 0 4000da48: 02 80 00 04 be 4000da58 <_Heap_Extend+0x190> 4000da4c: c2 04 00 00 ld [ %l0 ], %g1 return value - remainder + alignment; 4000da50: b2 06 40 1b add %i1, %i3, %i1 4000da54: b2 26 40 08 sub %i1, %o0, %i1 uintptr_t const new_first_block_alloc_begin = _Heap_Align_up( extend_area_begin + HEAP_BLOCK_HEADER_SIZE, page_size ); uintptr_t const new_first_block_begin = 4000da58: 92 06 7f f8 add %i1, -8, %o1 uintptr_t const first_block_begin = (uintptr_t) first_block; uintptr_t const new_first_block_size = first_block_begin - new_first_block_begin; Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin; new_first_block->prev_size = first_block->prev_size; 4000da5c: c2 26 7f f8 st %g1, [ %i1 + -8 ] uintptr_t const new_first_block_alloc_begin = _Heap_Align_up( extend_area_begin + HEAP_BLOCK_HEADER_SIZE, page_size ); uintptr_t const new_first_block_begin = new_first_block_alloc_begin - HEAP_BLOCK_HEADER_SIZE; uintptr_t const first_block_begin = (uintptr_t) first_block; uintptr_t const new_first_block_size = 4000da60: 82 24 00 09 sub %l0, %o1, %g1 first_block_begin - new_first_block_begin; Heap_Block *const new_first_block = (Heap_Block *) new_first_block_begin; new_first_block->prev_size = first_block->prev_size; new_first_block->size_and_flag = new_first_block_size | HEAP_PREV_BLOCK_USED; 4000da64: 82 10 60 01 or %g1, 1, %g1 _Heap_Free_block( heap, new_first_block ); 4000da68: 90 10 00 18 mov %i0, %o0 4000da6c: 7f ff ff 81 call 4000d870 <_Heap_Free_block> 4000da70: c2 22 60 04 st %g1, [ %o1 + 4 ] link_below_block, extend_last_block ); } if ( merge_above_block != NULL ) { 4000da74: 10 80 00 08 b 4000da94 <_Heap_Extend+0x1cc> 4000da78: 80 a7 20 00 cmp %i4, 0 heap->last_block = extend_last_block; } if ( merge_below_block != NULL ) { _Heap_Merge_below( heap, extend_area_begin, merge_below_block ); } else if ( link_below_block != NULL ) { 4000da7c: 80 a5 20 00 cmp %l4, 0 4000da80: 02 80 00 04 be 4000da90 <_Heap_Extend+0x1c8> 4000da84: a8 25 00 01 sub %l4, %g1, %l4 { uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const link_begin = (uintptr_t) link; last_block->size_and_flag = (link_begin - last_block_begin) | HEAP_PREV_BLOCK_USED; 4000da88: a8 15 20 01 or %l4, 1, %l4 ) { uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const link_begin = (uintptr_t) link; last_block->size_and_flag = 4000da8c: e8 20 60 04 st %l4, [ %g1 + 4 ] link_below_block, extend_last_block ); } if ( merge_above_block != NULL ) { 4000da90: 80 a7 20 00 cmp %i4, 0 4000da94: 02 80 00 15 be 4000dae8 <_Heap_Extend+0x220> 4000da98: ba 07 7f f8 add %i5, -8, %i5 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4000da9c: d2 06 20 10 ld [ %i0 + 0x10 ], %o1 uintptr_t extend_area_end ) { uintptr_t const page_size = heap->page_size; uintptr_t const last_block_begin = (uintptr_t) last_block; uintptr_t const last_block_new_size = _Heap_Align_down( 4000daa0: ba 27 40 1c sub %i5, %i4, %i5 4000daa4: 40 00 18 a0 call 40013d24 <.urem> 4000daa8: 90 10 00 1d mov %i5, %o0 ); Heap_Block *const new_last_block = _Heap_Block_at( last_block, last_block_new_size ); new_last_block->size_and_flag = (last_block->size_and_flag - last_block_new_size) 4000daac: c4 07 20 04 ld [ %i4 + 4 ], %g2 4000dab0: 90 27 40 08 sub %i5, %o0, %o0 page_size ); Heap_Block *const new_last_block = _Heap_Block_at( last_block, last_block_new_size ); new_last_block->size_and_flag = 4000dab4: 82 02 00 1c add %o0, %i4, %g1 (last_block->size_and_flag - last_block_new_size) 4000dab8: 84 20 80 08 sub %g2, %o0, %g2 | HEAP_PREV_BLOCK_USED; 4000dabc: 84 10 a0 01 or %g2, 1, %g2 page_size ); Heap_Block *const new_last_block = _Heap_Block_at( last_block, last_block_new_size ); new_last_block->size_and_flag = 4000dac0: c4 20 60 04 st %g2, [ %g1 + 4 ] RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 4000dac4: c2 07 20 04 ld [ %i4 + 4 ], %g1 (last_block->size_and_flag - last_block_new_size) | HEAP_PREV_BLOCK_USED; _Heap_Block_set_size( last_block, last_block_new_size ); _Heap_Free_block( heap, last_block ); 4000dac8: 92 10 00 1c mov %i4, %o1 4000dacc: 82 08 60 01 and %g1, 1, %g1 block->size_and_flag = size | flag; 4000dad0: 90 12 00 01 or %o0, %g1, %o0 4000dad4: d0 27 20 04 st %o0, [ %i4 + 4 ] 4000dad8: 7f ff ff 66 call 4000d870 <_Heap_Free_block> 4000dadc: 90 10 00 18 mov %i0, %o0 extend_first_block, extend_last_block ); } if ( merge_below_block == NULL && merge_above_block == NULL ) { 4000dae0: 10 80 00 0f b 4000db1c <_Heap_Extend+0x254> 4000dae4: 80 a7 20 00 cmp %i4, 0 ); } if ( merge_above_block != NULL ) { _Heap_Merge_above( heap, merge_above_block, extend_area_end ); } else if ( link_above_block != NULL ) { 4000dae8: 80 a4 60 00 cmp %l1, 0 4000daec: 02 80 00 0b be 4000db18 <_Heap_Extend+0x250> 4000daf0: c4 07 bf f8 ld [ %fp + -8 ], %g2 RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 4000daf4: c6 04 60 04 ld [ %l1 + 4 ], %g3 _Heap_Link_above( 4000daf8: c2 07 bf fc ld [ %fp + -4 ], %g1 4000dafc: 86 08 e0 01 and %g3, 1, %g3 ) { uintptr_t const link_begin = (uintptr_t) link; uintptr_t const first_block_begin = (uintptr_t) first_block; _Heap_Block_set_size( link, first_block_begin - link_begin ); 4000db00: 84 20 80 11 sub %g2, %l1, %g2 block->size_and_flag = size | flag; 4000db04: 84 10 c0 02 or %g3, %g2, %g2 4000db08: c4 24 60 04 st %g2, [ %l1 + 4 ] last_block->size_and_flag |= HEAP_PREV_BLOCK_USED; 4000db0c: c4 00 60 04 ld [ %g1 + 4 ], %g2 4000db10: 84 10 a0 01 or %g2, 1, %g2 4000db14: c4 20 60 04 st %g2, [ %g1 + 4 ] extend_first_block, extend_last_block ); } if ( merge_below_block == NULL && merge_above_block == NULL ) { 4000db18: 80 a7 20 00 cmp %i4, 0 4000db1c: 32 80 00 09 bne,a 4000db40 <_Heap_Extend+0x278> 4000db20: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 4000db24: 80 a4 20 00 cmp %l0, 0 4000db28: 32 80 00 06 bne,a 4000db40 <_Heap_Extend+0x278> 4000db2c: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 _Heap_Free_block( heap, extend_first_block ); 4000db30: d2 07 bf f8 ld [ %fp + -8 ], %o1 4000db34: 7f ff ff 4f call 4000d870 <_Heap_Free_block> 4000db38: 90 10 00 18 mov %i0, %o0 */ RTEMS_INLINE_ROUTINE void _Heap_Set_last_block_size( Heap_Control *heap ) { _Heap_Block_set_size( heap->last_block, (uintptr_t) heap->first_block - (uintptr_t) heap->last_block 4000db3c: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 * This feature will be used to terminate the scattered heap area list. See * also _Heap_Extend(). */ RTEMS_INLINE_ROUTINE void _Heap_Set_last_block_size( Heap_Control *heap ) { _Heap_Block_set_size( 4000db40: c4 06 20 20 ld [ %i0 + 0x20 ], %g2 RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 4000db44: c6 00 60 04 ld [ %g1 + 4 ], %g3 * This feature will be used to terminate the scattered heap area list. See * also _Heap_Extend(). */ RTEMS_INLINE_ROUTINE void _Heap_Set_last_block_size( Heap_Control *heap ) { _Heap_Block_set_size( 4000db48: 84 20 80 01 sub %g2, %g1, %g2 RTEMS_INLINE_ROUTINE void _Heap_Block_set_size( Heap_Block *block, uintptr_t size ) { uintptr_t flag = block->size_and_flag & HEAP_PREV_BLOCK_USED; 4000db4c: 86 08 e0 01 and %g3, 1, %g3 block->size_and_flag = size | flag; 4000db50: 84 10 c0 02 or %g3, %g2, %g2 4000db54: c4 20 60 04 st %g2, [ %g1 + 4 ] } _Heap_Set_last_block_size( heap ); extended_size = stats->free_size - free_size; 4000db58: c2 06 20 30 ld [ %i0 + 0x30 ], %g1 4000db5c: a6 20 40 13 sub %g1, %l3, %l3 /* Statistics */ stats->size += extended_size; 4000db60: c2 06 20 2c ld [ %i0 + 0x2c ], %g1 4000db64: 82 00 40 13 add %g1, %l3, %g1 4000db68: c2 26 20 2c st %g1, [ %i0 + 0x2c ] return extended_size; } 4000db6c: 81 c7 e0 08 ret 4000db70: 91 e8 00 13 restore %g0, %l3, %o0 =============================================================================== 4000d61c <_Heap_Free>: return do_free; } #endif bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { 4000d61c: 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 ) { 4000d620: 80 a6 60 00 cmp %i1, 0 4000d624: 02 80 00 7d be 4000d818 <_Heap_Free+0x1fc> 4000d628: 86 10 20 01 mov 1, %g3 4000d62c: d2 06 20 10 ld [ %i0 + 0x10 ], %o1 4000d630: 40 00 18 56 call 40013788 <.urem> 4000d634: 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 4000d638: f4 06 20 20 ld [ %i0 + 0x20 ], %i2 RTEMS_INLINE_ROUTINE uintptr_t _Heap_Align_down( uintptr_t value, uintptr_t alignment ) { return value - (value % alignment); 4000d63c: 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); 4000d640: 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; 4000d644: 80 a2 00 1a cmp %o0, %i2 4000d648: 0a 80 00 05 bcs 4000d65c <_Heap_Free+0x40> 4000d64c: 82 10 20 00 clr %g1 4000d650: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 4000d654: 80 a0 40 08 cmp %g1, %o0 4000d658: 82 60 3f ff subx %g0, -1, %g1 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 4000d65c: 82 08 60 01 and %g1, 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 ) ) { 4000d660: 80 a0 60 00 cmp %g1, 0 4000d664: 02 80 00 6d be 4000d818 <_Heap_Free+0x1fc> 4000d668: 86 10 00 01 mov %g1, %g3 bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { Heap_Statistics *const stats = &heap->stats; uintptr_t alloc_begin; Heap_Block *block; 4000d66c: f8 02 20 04 ld [ %o0 + 4 ], %i4 - 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; 4000d670: 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); 4000d674: 82 00 80 08 add %g2, %o0, %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; 4000d678: 80 a0 40 1a cmp %g1, %i2 4000d67c: 0a 80 00 05 bcs 4000d690 <_Heap_Free+0x74> <== NEVER TAKEN 4000d680: 88 10 20 00 clr %g4 4000d684: c6 06 20 24 ld [ %i0 + 0x24 ], %g3 4000d688: 80 a0 c0 01 cmp %g3, %g1 4000d68c: 88 60 3f ff subx %g0, -1, %g4 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 4000d690: 88 09 20 01 and %g4, 1, %g4 _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 ) ) { 4000d694: 80 a1 20 00 cmp %g4, 0 4000d698: 02 80 00 60 be 4000d818 <_Heap_Free+0x1fc> 4000d69c: 86 10 00 04 mov %g4, %g3 bool _Heap_Free( Heap_Control *heap, void *alloc_begin_ptr ) { Heap_Statistics *const stats = &heap->stats; uintptr_t alloc_begin; Heap_Block *block; Heap_Block *next_block = NULL; 4000d6a0: fa 00 60 04 ld [ %g1 + 4 ], %i5 return false; } _Heap_Protection_block_check( heap, next_block ); if ( !_Heap_Is_prev_used( next_block ) ) { 4000d6a4: 80 8f 60 01 btst 1, %i5 4000d6a8: 22 80 00 5c be,a 4000d818 <_Heap_Free+0x1fc> <== NEVER TAKEN 4000d6ac: 86 10 20 00 clr %g3 <== 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 4000d6b0: de 06 20 24 ld [ %i0 + 0x24 ], %o7 && !_Heap_Is_prev_used( _Heap_Block_at( next_block, next_block_size )); 4000d6b4: 80 a0 40 0f cmp %g1, %o7 4000d6b8: 02 80 00 07 be 4000d6d4 <_Heap_Free+0xb8> 4000d6bc: ba 0f 7f fe and %i5, -2, %i5 4000d6c0: 88 00 40 1d add %g1, %i5, %g4 4000d6c4: f2 01 20 04 ld [ %g4 + 4 ], %i1 4000d6c8: b2 1e 60 01 xor %i1, 1, %i1 4000d6cc: 10 80 00 03 b 4000d6d8 <_Heap_Free+0xbc> 4000d6d0: b2 0e 60 01 and %i1, 1, %i1 4000d6d4: b2 10 20 00 clr %i1 if ( !_Heap_Is_prev_used( block ) ) { 4000d6d8: 80 8f 20 01 btst 1, %i4 4000d6dc: 12 80 00 25 bne 4000d770 <_Heap_Free+0x154> 4000d6e0: b2 0e 60 01 and %i1, 1, %i1 uintptr_t const prev_size = block->prev_size; 4000d6e4: 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); 4000d6e8: 88 22 00 1c sub %o0, %i4, %g4 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; 4000d6ec: 80 a1 00 1a cmp %g4, %i2 4000d6f0: 0a 80 00 04 bcs 4000d700 <_Heap_Free+0xe4> <== NEVER TAKEN 4000d6f4: b6 10 20 00 clr %i3 4000d6f8: 80 a3 c0 04 cmp %o7, %g4 4000d6fc: b6 60 3f ff subx %g0, -1, %i3 Heap_Block * const prev_block = _Heap_Block_at( block, -prev_size ); if ( !_Heap_Is_block_in_heap( heap, prev_block ) ) { 4000d700: b6 8e e0 01 andcc %i3, 1, %i3 4000d704: 22 80 00 45 be,a 4000d818 <_Heap_Free+0x1fc> <== NEVER TAKEN 4000d708: 86 10 00 1b mov %i3, %g3 <== 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; 4000d70c: f6 01 20 04 ld [ %g4 + 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) ) { 4000d710: 80 8e e0 01 btst 1, %i3 4000d714: 02 80 00 40 be 4000d814 <_Heap_Free+0x1f8> <== NEVER TAKEN 4000d718: 80 a6 60 00 cmp %i1, 0 _HAssert( false ); return( false ); } if ( next_is_free ) { /* coalesce both */ 4000d71c: 02 80 00 0e be 4000d754 <_Heap_Free+0x138> 4000d720: b8 00 80 1c add %g2, %i4, %i4 uintptr_t const size = block_size + prev_size + next_block_size; 4000d724: ba 07 00 1d add %i4, %i5, %i5 return _Heap_Free_list_tail(heap)->prev; } RTEMS_INLINE_ROUTINE void _Heap_Free_list_remove( Heap_Block *block ) { Heap_Block *next = block->next; 4000d728: f8 00 60 08 ld [ %g1 + 8 ], %i4 Heap_Block *prev = block->prev; 4000d72c: c2 00 60 0c ld [ %g1 + 0xc ], %g1 prev->next = next; 4000d730: f8 20 60 08 st %i4, [ %g1 + 8 ] next->prev = prev; 4000d734: c2 27 20 0c st %g1, [ %i4 + 0xc ] _Heap_Free_list_remove( next_block ); stats->free_blocks -= 1; 4000d738: c2 06 20 38 ld [ %i0 + 0x38 ], %g1 4000d73c: 82 00 7f ff add %g1, -1, %g1 4000d740: c2 26 20 38 st %g1, [ %i0 + 0x38 ] prev_block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4000d744: 82 17 60 01 or %i5, 1, %g1 4000d748: c2 21 20 04 st %g1, [ %g4 + 4 ] 4000d74c: 10 80 00 28 b 4000d7ec <_Heap_Free+0x1d0> 4000d750: fa 27 40 04 st %i5, [ %i5 + %g4 ] 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; 4000d754: ba 17 20 01 or %i4, 1, %i5 4000d758: fa 21 20 04 st %i5, [ %g4 + 4 ] next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4000d75c: c8 00 60 04 ld [ %g1 + 4 ], %g4 4000d760: 88 09 3f fe and %g4, -2, %g4 4000d764: c8 20 60 04 st %g4, [ %g1 + 4 ] next_block->prev_size = size; 4000d768: 10 80 00 21 b 4000d7ec <_Heap_Free+0x1d0> 4000d76c: f8 20 80 08 st %i4, [ %g2 + %o0 ] } } else if ( next_is_free ) { /* coalesce next */ 4000d770: 80 a6 60 00 cmp %i1, 0 4000d774: 22 80 00 0d be,a 4000d7a8 <_Heap_Free+0x18c> 4000d778: c8 06 20 08 ld [ %i0 + 8 ], %g4 uintptr_t const size = block_size + next_block_size; 4000d77c: 88 07 40 02 add %i5, %g2, %g4 RTEMS_INLINE_ROUTINE void _Heap_Free_list_replace( Heap_Block *old_block, Heap_Block *new_block ) { Heap_Block *next = old_block->next; 4000d780: fa 00 60 08 ld [ %g1 + 8 ], %i5 Heap_Block *prev = old_block->prev; 4000d784: c2 00 60 0c ld [ %g1 + 0xc ], %g1 new_block->next = next; 4000d788: fa 22 20 08 st %i5, [ %o0 + 8 ] new_block->prev = prev; 4000d78c: c2 22 20 0c st %g1, [ %o0 + 0xc ] next->prev = new_block; 4000d790: d0 27 60 0c st %o0, [ %i5 + 0xc ] prev->next = new_block; 4000d794: d0 20 60 08 st %o0, [ %g1 + 8 ] _Heap_Free_list_replace( next_block, block ); block->size_and_flag = size | HEAP_PREV_BLOCK_USED; 4000d798: 82 11 20 01 or %g4, 1, %g1 4000d79c: c2 22 20 04 st %g1, [ %o0 + 4 ] 4000d7a0: 10 80 00 13 b 4000d7ec <_Heap_Free+0x1d0> 4000d7a4: c8 21 00 08 st %g4, [ %g4 + %o0 ] ) { Heap_Block *next = block_before->next; new_block->next = next; new_block->prev = block_before; 4000d7a8: f0 22 20 0c st %i0, [ %o0 + 0xc ] Heap_Block *new_block ) { Heap_Block *next = block_before->next; new_block->next = next; 4000d7ac: c8 22 20 08 st %g4, [ %o0 + 8 ] new_block->prev = block_before; block_before->next = new_block; 4000d7b0: d0 26 20 08 st %o0, [ %i0 + 8 ] next->prev = new_block; 4000d7b4: d0 21 20 0c st %o0, [ %g4 + 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; 4000d7b8: 88 10 a0 01 or %g2, 1, %g4 4000d7bc: c8 22 20 04 st %g4, [ %o0 + 4 ] next_block->size_and_flag &= ~HEAP_PREV_BLOCK_USED; 4000d7c0: c8 00 60 04 ld [ %g1 + 4 ], %g4 4000d7c4: 88 09 3f fe and %g4, -2, %g4 4000d7c8: c8 20 60 04 st %g4, [ %g1 + 4 ] next_block->prev_size = block_size; /* Statistics */ ++stats->free_blocks; 4000d7cc: c2 06 20 38 ld [ %i0 + 0x38 ], %g1 /* 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; next_block->prev_size = block_size; 4000d7d0: c4 20 80 08 st %g2, [ %g2 + %o0 ] /* Statistics */ ++stats->free_blocks; if ( stats->max_free_blocks < stats->free_blocks ) { 4000d7d4: c8 06 20 3c ld [ %i0 + 0x3c ], %g4 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; 4000d7d8: 82 00 60 01 inc %g1 if ( stats->max_free_blocks < stats->free_blocks ) { 4000d7dc: 80 a1 00 01 cmp %g4, %g1 4000d7e0: 1a 80 00 03 bcc 4000d7ec <_Heap_Free+0x1d0> 4000d7e4: c2 26 20 38 st %g1, [ %i0 + 0x38 ] stats->max_free_blocks = stats->free_blocks; 4000d7e8: c2 26 20 3c st %g1, [ %i0 + 0x3c ] } } /* Statistics */ --stats->used_blocks; 4000d7ec: c2 06 20 40 ld [ %i0 + 0x40 ], %g1 4000d7f0: 82 00 7f ff add %g1, -1, %g1 4000d7f4: c2 26 20 40 st %g1, [ %i0 + 0x40 ] ++stats->frees; 4000d7f8: c2 06 20 50 ld [ %i0 + 0x50 ], %g1 4000d7fc: 82 00 60 01 inc %g1 4000d800: c2 26 20 50 st %g1, [ %i0 + 0x50 ] stats->free_size += block_size; 4000d804: c2 06 20 30 ld [ %i0 + 0x30 ], %g1 4000d808: 84 00 40 02 add %g1, %g2, %g2 return( true ); 4000d80c: 10 80 00 03 b 4000d818 <_Heap_Free+0x1fc> 4000d810: c4 26 20 30 st %g2, [ %i0 + 0x30 ] 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 ) ) { return false; 4000d814: 86 10 20 00 clr %g3 <== NOT EXECUTED --stats->used_blocks; ++stats->frees; stats->free_size += block_size; return( true ); } 4000d818: b0 08 e0 01 and %g3, 1, %i0 4000d81c: 81 c7 e0 08 ret 4000d820: 81 e8 00 00 restore =============================================================================== 400084d4 <_Heap_Greedy_allocate_all_except_largest>: Heap_Block *_Heap_Greedy_allocate_all_except_largest( Heap_Control *heap, uintptr_t *allocatable_size ) { 400084d4: 9d e3 bf 90 save %sp, -112, %sp Heap_Information info; _Heap_Get_free_information( heap, &info ); 400084d8: 90 10 00 18 mov %i0, %o0 400084dc: 40 00 14 6a call 4000d684 <_Heap_Get_free_information> 400084e0: 92 07 bf f4 add %fp, -12, %o1 if ( info.largest > 0 ) { 400084e4: c2 07 bf f8 ld [ %fp + -8 ], %g1 400084e8: 80 a0 60 00 cmp %g1, 0 400084ec: 22 80 00 04 be,a 400084fc <_Heap_Greedy_allocate_all_except_largest+0x28><== NEVER TAKEN 400084f0: c0 26 40 00 clr [ %i1 ] <== NOT EXECUTED *allocatable_size = info.largest - HEAP_BLOCK_HEADER_SIZE + HEAP_ALLOC_BONUS; 400084f4: 82 00 7f fc add %g1, -4, %g1 400084f8: c2 26 40 00 st %g1, [ %i1 ] } else { *allocatable_size = 0; } return _Heap_Greedy_allocate( heap, allocatable_size, 1 ); 400084fc: 90 10 00 18 mov %i0, %o0 40008500: 92 10 00 19 mov %i1, %o1 40008504: 7f ff ff c4 call 40008414 <_Heap_Greedy_allocate> 40008508: 94 10 20 01 mov 1, %o2 } 4000850c: 81 c7 e0 08 ret 40008510: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 4000b840 <_Heap_Iterate>: void _Heap_Iterate( Heap_Control *heap, Heap_Block_visitor visitor, void *visitor_arg ) { 4000b840: 9d e3 bf a0 save %sp, -96, %sp Heap_Block *current = heap->first_block; 4000b844: c2 06 20 20 ld [ %i0 + 0x20 ], %g1 Heap_Block *end = heap->last_block; 4000b848: f8 06 20 24 ld [ %i0 + 0x24 ], %i4 bool stop = false; 4000b84c: 90 10 20 00 clr %o0 while ( !stop && current != end ) { 4000b850: 80 a0 40 1c cmp %g1, %i4 4000b854: 02 80 00 0e be 4000b88c <_Heap_Iterate+0x4c> 4000b858: 90 1a 20 01 xor %o0, 1, %o0 4000b85c: 80 8a 20 ff btst 0xff, %o0 4000b860: 02 80 00 0b be 4000b88c <_Heap_Iterate+0x4c> <== NEVER TAKEN 4000b864: 90 10 00 01 mov %g1, %o0 - 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; 4000b868: d2 00 60 04 ld [ %g1 + 4 ], %o1 4000b86c: 92 0a 7f fe and %o1, -2, %o1 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 4000b870: ba 00 40 09 add %g1, %o1, %i5 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; 4000b874: d4 07 60 04 ld [ %i5 + 4 ], %o2 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 ); 4000b878: 96 10 00 1a mov %i2, %o3 4000b87c: 9f c6 40 00 call %i1 4000b880: 94 0a a0 01 and %o2, 1, %o2 current = next; 4000b884: 10 bf ff f3 b 4000b850 <_Heap_Iterate+0x10> 4000b888: 82 10 00 1d mov %i5, %g1 4000b88c: 81 c7 e0 08 ret 4000b890: 81 e8 00 00 restore =============================================================================== 40015260 <_Heap_Size_of_alloc_area>: bool _Heap_Size_of_alloc_area( Heap_Control *heap, void *alloc_begin_ptr, uintptr_t *alloc_size ) { 40015260: 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); 40015264: d2 06 20 10 ld [ %i0 + 0x10 ], %o1 40015268: 7f ff f9 48 call 40013788 <.urem> 4001526c: 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 40015270: 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); 40015274: 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); 40015278: 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; 4001527c: 80 a2 00 04 cmp %o0, %g4 40015280: 0a 80 00 05 bcs 40015294 <_Heap_Size_of_alloc_area+0x34> 40015284: 82 10 20 00 clr %g1 40015288: c2 06 20 24 ld [ %i0 + 0x24 ], %g1 4001528c: 80 a0 40 08 cmp %g1, %o0 40015290: 82 60 3f ff subx %g0, -1, %g1 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 40015294: 82 08 60 01 and %g1, 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 ) ) { 40015298: 80 a0 60 00 cmp %g1, 0 4001529c: 02 80 00 17 be 400152f8 <_Heap_Size_of_alloc_area+0x98> 400152a0: 86 10 00 01 mov %g1, %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; 400152a4: c2 02 20 04 ld [ %o0 + 4 ], %g1 400152a8: 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); 400152ac: 82 00 40 08 add %g1, %o0, %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; 400152b0: 80 a0 40 04 cmp %g1, %g4 400152b4: 0a 80 00 05 bcs 400152c8 <_Heap_Size_of_alloc_area+0x68> <== NEVER TAKEN 400152b8: 84 10 20 00 clr %g2 400152bc: c4 06 20 24 ld [ %i0 + 0x24 ], %g2 400152c0: 80 a0 80 01 cmp %g2, %g1 400152c4: 84 60 3f ff subx %g0, -1, %g2 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 400152c8: 84 08 a0 01 and %g2, 1, %g2 } block_size = _Heap_Block_size( block ); next_block = _Heap_Block_at( block, block_size ); if ( 400152cc: 80 a0 a0 00 cmp %g2, 0 400152d0: 02 80 00 0a be 400152f8 <_Heap_Size_of_alloc_area+0x98> <== NEVER TAKEN 400152d4: 86 10 00 02 mov %g2, %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; 400152d8: c4 00 60 04 ld [ %g1 + 4 ], %g2 !_Heap_Is_block_in_heap( heap, next_block ) || !_Heap_Is_prev_used( next_block ) 400152dc: 80 88 a0 01 btst 1, %g2 400152e0: 02 80 00 05 be 400152f4 <_Heap_Size_of_alloc_area+0x94> <== NEVER TAKEN 400152e4: 82 20 40 19 sub %g1, %i1, %g1 ) { return false; } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; 400152e8: 82 00 60 04 add %g1, 4, %g1 return true; 400152ec: 10 80 00 03 b 400152f8 <_Heap_Size_of_alloc_area+0x98> 400152f0: c2 26 80 00 st %g1, [ %i2 ] 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 ) ) { return false; 400152f4: 86 10 20 00 clr %g3 <== NOT EXECUTED } *alloc_size = (uintptr_t) next_block + HEAP_ALLOC_BONUS - alloc_begin; return true; } 400152f8: b0 08 e0 01 and %g3, 1, %i0 400152fc: 81 c7 e0 08 ret 40015300: 81 e8 00 00 restore =============================================================================== 4000962c <_Heap_Walk>: bool _Heap_Walk( Heap_Control *heap, int source, bool dump ) { 4000962c: 9d e3 bf 80 save %sp, -128, %sp 40009630: ac 10 00 19 mov %i1, %l6 uintptr_t const page_size = heap->page_size; 40009634: f8 06 20 10 ld [ %i0 + 0x10 ], %i4 uintptr_t const min_block_size = heap->min_block_size; 40009638: f6 06 20 14 ld [ %i0 + 0x14 ], %i3 Heap_Block *const first_block = heap->first_block; 4000963c: 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; 40009640: 80 a6 a0 00 cmp %i2, 0 40009644: 02 80 00 05 be 40009658 <_Heap_Walk+0x2c> 40009648: e0 06 20 24 ld [ %i0 + 0x24 ], %l0 4000964c: 3b 10 00 25 sethi %hi(0x40009400), %i5 40009650: 10 80 00 04 b 40009660 <_Heap_Walk+0x34> 40009654: ba 17 61 dc or %i5, 0x1dc, %i5 ! 400095dc <_Heap_Walk_print> 40009658: 3b 10 00 25 sethi %hi(0x40009400), %i5 4000965c: ba 17 61 d4 or %i5, 0x1d4, %i5 ! 400095d4 <_Heap_Walk_print_nothing> 40009660: 05 10 00 6a sethi %hi(0x4001a800), %g2 if ( !_System_state_Is_up( _System_state_Get() ) ) { 40009664: c4 00 a1 d4 ld [ %g2 + 0x1d4 ], %g2 ! 4001a9d4 <_System_state_Current> 40009668: 80 a0 a0 02 cmp %g2, 2 4000966c: 22 80 00 04 be,a 4000967c <_Heap_Walk+0x50> 40009670: c4 06 20 1c ld [ %i0 + 0x1c ], %g2 return true; 40009674: 10 80 01 30 b 40009b34 <_Heap_Walk+0x508> 40009678: a6 10 20 01 mov 1, %l3 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)( 4000967c: da 06 20 18 ld [ %i0 + 0x18 ], %o5 40009680: c4 23 a0 5c st %g2, [ %sp + 0x5c ] 40009684: f2 23 a0 60 st %i1, [ %sp + 0x60 ] 40009688: e0 23 a0 64 st %l0, [ %sp + 0x64 ] 4000968c: c4 06 20 08 ld [ %i0 + 8 ], %g2 40009690: 90 10 00 16 mov %l6, %o0 40009694: c4 23 a0 68 st %g2, [ %sp + 0x68 ] 40009698: c4 06 20 0c ld [ %i0 + 0xc ], %g2 4000969c: 92 10 20 00 clr %o1 400096a0: c4 23 a0 6c st %g2, [ %sp + 0x6c ] 400096a4: 15 10 00 5b sethi %hi(0x40016c00), %o2 400096a8: 96 10 00 1c mov %i4, %o3 400096ac: 94 12 a0 f0 or %o2, 0xf0, %o2 400096b0: 9f c7 40 00 call %i5 400096b4: 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 ) { 400096b8: 80 a7 20 00 cmp %i4, 0 400096bc: 12 80 00 07 bne 400096d8 <_Heap_Walk+0xac> 400096c0: 80 8f 20 07 btst 7, %i4 (*printer)( source, true, "page size is zero\n" ); 400096c4: 15 10 00 5b sethi %hi(0x40016c00), %o2 400096c8: 90 10 00 16 mov %l6, %o0 400096cc: 92 10 20 01 mov 1, %o1 400096d0: 10 80 00 37 b 400097ac <_Heap_Walk+0x180> 400096d4: 94 12 a1 88 or %o2, 0x188, %o2 return false; } if ( !_Addresses_Is_aligned( (void *) page_size ) ) { 400096d8: 22 80 00 08 be,a 400096f8 <_Heap_Walk+0xcc> 400096dc: 90 10 00 1b mov %i3, %o0 (*printer)( 400096e0: 15 10 00 5b sethi %hi(0x40016c00), %o2 400096e4: 90 10 00 16 mov %l6, %o0 400096e8: 92 10 20 01 mov 1, %o1 400096ec: 94 12 a1 a0 or %o2, 0x1a0, %o2 400096f0: 10 80 00 4a b 40009818 <_Heap_Walk+0x1ec> 400096f4: 96 10 00 1c mov %i4, %o3 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 400096f8: 7f ff e1 3d call 40001bec <.urem> 400096fc: 92 10 00 1c mov %i4, %o1 ); return false; } if ( !_Heap_Is_aligned( min_block_size, page_size ) ) { 40009700: 80 a2 20 00 cmp %o0, 0 40009704: 22 80 00 08 be,a 40009724 <_Heap_Walk+0xf8> 40009708: 90 06 60 08 add %i1, 8, %o0 (*printer)( 4000970c: 15 10 00 5b sethi %hi(0x40016c00), %o2 40009710: 90 10 00 16 mov %l6, %o0 40009714: 92 10 20 01 mov 1, %o1 40009718: 94 12 a1 c0 or %o2, 0x1c0, %o2 4000971c: 10 80 00 3f b 40009818 <_Heap_Walk+0x1ec> 40009720: 96 10 00 1b mov %i3, %o3 40009724: 7f ff e1 32 call 40001bec <.urem> 40009728: 92 10 00 1c mov %i4, %o1 ); return false; } if ( 4000972c: 80 a2 20 00 cmp %o0, 0 40009730: 22 80 00 07 be,a 4000974c <_Heap_Walk+0x120> 40009734: c4 06 60 04 ld [ %i1 + 4 ], %g2 !_Heap_Is_aligned( _Heap_Alloc_area_of_block( first_block ), page_size ) ) { (*printer)( 40009738: 15 10 00 5b sethi %hi(0x40016c00), %o2 4000973c: 90 10 00 16 mov %l6, %o0 40009740: 92 10 20 01 mov 1, %o1 40009744: 10 80 01 03 b 40009b50 <_Heap_Walk+0x524> 40009748: 94 12 a1 e8 or %o2, 0x1e8, %o2 ); return false; } if ( !_Heap_Is_prev_used( first_block ) ) { 4000974c: 80 88 a0 01 btst 1, %g2 40009750: 32 80 00 07 bne,a 4000976c <_Heap_Walk+0x140> 40009754: f4 04 20 04 ld [ %l0 + 4 ], %i2 (*printer)( 40009758: 15 10 00 5b sethi %hi(0x40016c00), %o2 4000975c: 90 10 00 16 mov %l6, %o0 40009760: 92 10 20 01 mov 1, %o1 40009764: 10 80 00 12 b 400097ac <_Heap_Walk+0x180> 40009768: 94 12 a2 20 or %o2, 0x220, %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; 4000976c: 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); 40009770: 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; 40009774: c4 06 a0 04 ld [ %i2 + 4 ], %g2 ); return false; } if ( _Heap_Is_free( last_block ) ) { 40009778: 80 88 a0 01 btst 1, %g2 4000977c: 12 80 00 07 bne 40009798 <_Heap_Walk+0x16c> 40009780: 80 a6 80 19 cmp %i2, %i1 (*printer)( 40009784: 15 10 00 5b sethi %hi(0x40016c00), %o2 40009788: 90 10 00 16 mov %l6, %o0 4000978c: 92 10 20 01 mov 1, %o1 40009790: 10 80 00 07 b 400097ac <_Heap_Walk+0x180> 40009794: 94 12 a2 50 or %o2, 0x250, %o2 ); return false; } if ( 40009798: 02 80 00 0a be 400097c0 <_Heap_Walk+0x194> 4000979c: 15 10 00 5b sethi %hi(0x40016c00), %o2 _Heap_Block_at( last_block, _Heap_Block_size( last_block ) ) != first_block ) { (*printer)( 400097a0: 90 10 00 16 mov %l6, %o0 400097a4: 92 10 20 01 mov 1, %o1 400097a8: 94 12 a2 68 or %o2, 0x268, %o2 400097ac: 9f c7 40 00 call %i5 400097b0: a6 10 20 00 clr %l3 400097b4: b0 0c e0 ff and %l3, 0xff, %i0 400097b8: 81 c7 e0 08 ret 400097bc: 81 e8 00 00 restore int source, Heap_Walk_printer printer, Heap_Control *heap ) { uintptr_t const page_size = heap->page_size; 400097c0: 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; 400097c4: d6 06 20 08 ld [ %i0 + 8 ], %o3 const Heap_Block *const free_list_tail = _Heap_Free_list_tail( heap ); 400097c8: 10 80 00 03 b 400097d4 <_Heap_Walk+0x1a8> 400097cc: b2 10 00 18 mov %i0, %i1 return false; } prev_block = free_block; free_block = free_block->next; 400097d0: 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 ) { 400097d4: 80 a2 c0 18 cmp %o3, %i0 400097d8: 22 80 00 34 be,a 400098a8 <_Heap_Walk+0x27c> 400097dc: b2 10 00 1a mov %i2, %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; 400097e0: c6 06 20 20 ld [ %i0 + 0x20 ], %g3 400097e4: 80 a0 c0 0b cmp %g3, %o3 400097e8: 18 80 00 05 bgu 400097fc <_Heap_Walk+0x1d0> 400097ec: 84 10 20 00 clr %g2 400097f0: c4 06 20 24 ld [ %i0 + 0x24 ], %g2 400097f4: 80 a0 80 0b cmp %g2, %o3 400097f8: 84 60 3f ff subx %g0, -1, %g2 if ( !_Heap_Is_block_in_heap( heap, free_block ) ) { 400097fc: 80 a0 a0 00 cmp %g2, 0 40009800: 12 80 00 0b bne 4000982c <_Heap_Walk+0x200> 40009804: 90 02 e0 08 add %o3, 8, %o0 (*printer)( 40009808: 15 10 00 5b sethi %hi(0x40016c00), %o2 4000980c: 90 10 00 16 mov %l6, %o0 40009810: 92 10 20 01 mov 1, %o1 40009814: 94 12 a2 98 or %o2, 0x298, %o2 return false; } if ( _Heap_Is_used( free_block ) ) { (*printer)( 40009818: 9f c7 40 00 call %i5 4000981c: a6 10 20 00 clr %l3 40009820: b0 0c e0 ff and %l3, 0xff, %i0 40009824: 81 c7 e0 08 ret 40009828: 81 e8 00 00 restore RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 4000982c: d6 27 bf fc st %o3, [ %fp + -4 ] 40009830: 7f ff e0 ef call 40001bec <.urem> 40009834: 92 10 00 11 mov %l1, %o1 ); return false; } if ( 40009838: 80 a2 20 00 cmp %o0, 0 4000983c: 02 80 00 07 be 40009858 <_Heap_Walk+0x22c> 40009840: d6 07 bf fc ld [ %fp + -4 ], %o3 !_Heap_Is_aligned( _Heap_Alloc_area_of_block( free_block ), page_size ) ) { (*printer)( 40009844: 15 10 00 5b sethi %hi(0x40016c00), %o2 40009848: 90 10 00 16 mov %l6, %o0 4000984c: 92 10 20 01 mov 1, %o1 40009850: 10 bf ff f2 b 40009818 <_Heap_Walk+0x1ec> 40009854: 94 12 a2 b8 or %o2, 0x2b8, %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; 40009858: c4 02 e0 04 ld [ %o3 + 4 ], %g2 4000985c: 84 08 bf fe and %g2, -2, %g2 RTEMS_INLINE_ROUTINE bool _Heap_Is_used( const Heap_Block *block ) { const Heap_Block *const next_block = 40009860: 84 02 c0 02 add %o3, %g2, %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; 40009864: c4 00 a0 04 ld [ %g2 + 4 ], %g2 ); return false; } if ( _Heap_Is_used( free_block ) ) { 40009868: 80 88 a0 01 btst 1, %g2 4000986c: 22 80 00 07 be,a 40009888 <_Heap_Walk+0x25c> 40009870: d8 02 e0 0c ld [ %o3 + 0xc ], %o4 (*printer)( 40009874: 15 10 00 5b sethi %hi(0x40016c00), %o2 40009878: 90 10 00 16 mov %l6, %o0 4000987c: 92 10 20 01 mov 1, %o1 40009880: 10 bf ff e6 b 40009818 <_Heap_Walk+0x1ec> 40009884: 94 12 a2 e8 or %o2, 0x2e8, %o2 ); return false; } if ( free_block->prev != prev_block ) { 40009888: 80 a3 00 19 cmp %o4, %i1 4000988c: 02 bf ff d1 be 400097d0 <_Heap_Walk+0x1a4> 40009890: b2 10 00 0b mov %o3, %i1 (*printer)( 40009894: 15 10 00 5b sethi %hi(0x40016c00), %o2 40009898: 90 10 00 16 mov %l6, %o0 4000989c: 92 10 20 01 mov 1, %o1 400098a0: 10 80 00 2b b 4000994c <_Heap_Walk+0x320> 400098a4: 94 12 a3 08 or %o2, 0x308, %o2 " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") 400098a8: 23 10 00 5c sethi %hi(0x40017000), %l1 400098ac: 2f 10 00 5b sethi %hi(0x40016c00), %l7 { uintptr_t const page_size = heap->page_size; uintptr_t const min_block_size = heap->min_block_size; Heap_Block *const first_block = heap->first_block; Heap_Block *const last_block = heap->last_block; Heap_Block *block = first_block; 400098b0: 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; 400098b4: da 06 20 20 ld [ %i0 + 0x20 ], %o5 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; 400098b8: 9e 1e 40 10 xor %i1, %l0, %o7 400098bc: 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; 400098c0: aa 0c bf fe and %l2, -2, %l5 400098c4: 98 40 20 00 addx %g0, 0, %o4 RTEMS_INLINE_ROUTINE Heap_Block *_Heap_Block_at( const Heap_Block *block, uintptr_t offset ) { return (Heap_Block *) ((uintptr_t) block + offset); 400098c8: a8 05 40 19 add %l5, %i1, %l4 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; 400098cc: 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; 400098d0: 80 a3 40 14 cmp %o5, %l4 400098d4: 18 80 00 05 bgu 400098e8 <_Heap_Walk+0x2bc> <== NEVER TAKEN 400098d8: 9e 10 20 00 clr %o7 400098dc: de 06 20 24 ld [ %i0 + 0x24 ], %o7 400098e0: 80 a3 c0 14 cmp %o7, %l4 400098e4: 9e 60 3f ff subx %g0, -1, %o7 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 400098e8: 9e 0b e0 01 and %o7, 1, %o7 if ( !_Heap_Is_block_in_heap( heap, next_block ) ) { 400098ec: 80 a3 e0 00 cmp %o7, 0 400098f0: 12 80 00 07 bne 4000990c <_Heap_Walk+0x2e0> 400098f4: a6 10 00 0f mov %o7, %l3 (*printer)( 400098f8: 15 10 00 5b sethi %hi(0x40016c00), %o2 400098fc: 90 10 00 16 mov %l6, %o0 40009900: 92 10 20 01 mov 1, %o1 40009904: 10 80 00 31 b 400099c8 <_Heap_Walk+0x39c> 40009908: 94 12 a3 40 or %o2, 0x340, %o2 RTEMS_INLINE_ROUTINE bool _Heap_Is_aligned( uintptr_t value, uintptr_t alignment ) { return (value % alignment) == 0; 4000990c: d8 27 bf f8 st %o4, [ %fp + -8 ] 40009910: 90 10 00 15 mov %l5, %o0 40009914: 7f ff e0 b6 call 40001bec <.urem> 40009918: 92 10 00 1c mov %i4, %o1 ); return false; } if ( !_Heap_Is_aligned( block_size, page_size ) && is_not_last_block ) { 4000991c: 80 a2 20 00 cmp %o0, 0 40009920: 02 80 00 10 be 40009960 <_Heap_Walk+0x334> 40009924: d8 07 bf f8 ld [ %fp + -8 ], %o4 40009928: 80 a3 20 00 cmp %o4, 0 4000992c: 02 80 00 0e be 40009964 <_Heap_Walk+0x338> 40009930: 80 a5 40 1b cmp %l5, %i3 (*printer)( 40009934: 15 10 00 5b sethi %hi(0x40016c00), %o2 40009938: 90 10 00 16 mov %l6, %o0 4000993c: 92 10 20 01 mov 1, %o1 40009940: 94 12 a3 70 or %o2, 0x370, %o2 40009944: 96 10 00 19 mov %i1, %o3 40009948: 98 10 00 15 mov %l5, %o4 4000994c: 9f c7 40 00 call %i5 40009950: a6 10 20 00 clr %l3 40009954: b0 0c e0 ff and %l3, 0xff, %i0 40009958: 81 c7 e0 08 ret 4000995c: 81 e8 00 00 restore ); return false; } if ( block_size < min_block_size && is_not_last_block ) { 40009960: 80 a5 40 1b cmp %l5, %i3 40009964: 9e 40 20 00 addx %g0, 0, %o7 40009968: 9e 0b 00 0f and %o4, %o7, %o7 4000996c: 80 a3 e0 00 cmp %o7, 0 40009970: 02 80 00 0c be 400099a0 <_Heap_Walk+0x374> 40009974: a6 10 00 0f mov %o7, %l3 (*printer)( 40009978: 90 10 00 16 mov %l6, %o0 4000997c: 92 10 20 01 mov 1, %o1 40009980: 15 10 00 5b sethi %hi(0x40016c00), %o2 40009984: 96 10 00 19 mov %i1, %o3 40009988: 94 12 a3 a0 or %o2, 0x3a0, %o2 4000998c: 98 10 00 15 mov %l5, %o4 40009990: 9f c7 40 00 call %i5 40009994: 9a 10 00 1b mov %i3, %o5 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 40009998: 10 80 00 67 b 40009b34 <_Heap_Walk+0x508> 4000999c: a6 10 20 00 clr %l3 ); return false; } if ( next_block_begin <= block_begin && is_not_last_block ) { 400099a0: 80 a6 40 14 cmp %i1, %l4 400099a4: 2a 80 00 0f bcs,a 400099e0 <_Heap_Walk+0x3b4> 400099a8: de 05 20 04 ld [ %l4 + 4 ], %o7 400099ac: 80 a3 20 00 cmp %o4, 0 400099b0: 22 80 00 0c be,a 400099e0 <_Heap_Walk+0x3b4> 400099b4: de 05 20 04 ld [ %l4 + 4 ], %o7 (*printer)( 400099b8: 15 10 00 5b sethi %hi(0x40016c00), %o2 400099bc: 90 10 00 16 mov %l6, %o0 400099c0: 92 10 20 01 mov 1, %o1 400099c4: 94 12 a3 d0 or %o2, 0x3d0, %o2 400099c8: 96 10 00 19 mov %i1, %o3 400099cc: 9f c7 40 00 call %i5 400099d0: 98 10 00 14 mov %l4, %o4 400099d4: b0 0c e0 ff and %l3, 0xff, %i0 400099d8: 81 c7 e0 08 ret 400099dc: 81 e8 00 00 restore ); return false; } if ( !_Heap_Is_prev_used( next_block ) ) { 400099e0: 80 8b e0 01 btst 1, %o7 400099e4: 12 80 00 3f bne 40009ae0 <_Heap_Walk+0x4b4> 400099e8: 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 ? 400099ec: 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)( 400099f0: d8 06 20 08 ld [ %i0 + 8 ], %o4 400099f4: 80 a3 40 0c cmp %o5, %o4 400099f8: 02 80 00 08 be 40009a18 <_Heap_Walk+0x3ec> 400099fc: 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)" : ""), 40009a00: 80 a3 40 18 cmp %o5, %i0 40009a04: 12 80 00 07 bne 40009a20 <_Heap_Walk+0x3f4> 40009a08: 96 14 60 78 or %l1, 0x78, %o3 40009a0c: 17 10 00 5b sethi %hi(0x40016c00), %o3 40009a10: 10 80 00 04 b 40009a20 <_Heap_Walk+0x3f4> 40009a14: 96 12 e0 c0 or %o3, 0xc0, %o3 ! 40016cc0 <_Semaphore_Translate_core_mutex_return_code_+0x88> 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)( 40009a18: 03 10 00 5b sethi %hi(0x40016c00), %g1 40009a1c: 96 10 60 b0 or %g1, 0xb0, %o3 ! 40016cb0 <_Semaphore_Translate_core_mutex_return_code_+0x78> block->prev, block->prev == first_free_block ? " (= first free)" : (block->prev == free_list_head ? " (= head)" : ""), block->next, block->next == last_free_block ? 40009a20: 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)( 40009a24: 80 a3 00 0f cmp %o4, %o7 40009a28: 02 80 00 06 be 40009a40 <_Heap_Walk+0x414> 40009a2c: 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)" : "") 40009a30: 12 80 00 06 bne 40009a48 <_Heap_Walk+0x41c> 40009a34: 9e 14 60 78 or %l1, 0x78, %o7 40009a38: 10 80 00 04 b 40009a48 <_Heap_Walk+0x41c> 40009a3c: 9e 15 e0 e0 or %l7, 0xe0, %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)( 40009a40: 03 10 00 5b sethi %hi(0x40016c00), %g1 40009a44: 9e 10 60 d0 or %g1, 0xd0, %o7 ! 40016cd0 <_Semaphore_Translate_core_mutex_return_code_+0x98> 40009a48: d6 23 a0 5c st %o3, [ %sp + 0x5c ] 40009a4c: d8 23 a0 60 st %o4, [ %sp + 0x60 ] 40009a50: de 23 a0 64 st %o7, [ %sp + 0x64 ] 40009a54: 90 10 00 16 mov %l6, %o0 40009a58: 92 10 20 00 clr %o1 40009a5c: 15 10 00 5c sethi %hi(0x40017000), %o2 40009a60: 96 10 00 19 mov %i1, %o3 40009a64: 94 12 a0 08 or %o2, 8, %o2 40009a68: 9f c7 40 00 call %i5 40009a6c: 98 10 00 15 mov %l5, %o4 block->next == last_free_block ? " (= last free)" : (block->next == free_list_tail ? " (= tail)" : "") ); if ( block_size != next_block->prev_size ) { 40009a70: da 05 00 00 ld [ %l4 ], %o5 40009a74: 80 a5 40 0d cmp %l5, %o5 40009a78: 02 80 00 0c be 40009aa8 <_Heap_Walk+0x47c> 40009a7c: 80 a4 a0 00 cmp %l2, 0 (*printer)( 40009a80: e8 23 a0 5c st %l4, [ %sp + 0x5c ] 40009a84: 90 10 00 16 mov %l6, %o0 40009a88: 92 10 20 01 mov 1, %o1 40009a8c: 15 10 00 5c sethi %hi(0x40017000), %o2 40009a90: 96 10 00 19 mov %i1, %o3 40009a94: 94 12 a0 40 or %o2, 0x40, %o2 40009a98: 9f c7 40 00 call %i5 40009a9c: 98 10 00 15 mov %l5, %o4 if ( !_System_state_Is_up( _System_state_Get() ) ) { return true; } if ( !_Heap_Walk_check_control( source, printer, heap ) ) { return false; 40009aa0: 10 80 00 25 b 40009b34 <_Heap_Walk+0x508> 40009aa4: a6 10 20 00 clr %l3 ); return false; } if ( !prev_used ) { 40009aa8: 32 80 00 07 bne,a 40009ac4 <_Heap_Walk+0x498> 40009aac: c8 06 20 08 ld [ %i0 + 8 ], %g4 (*printer)( 40009ab0: 15 10 00 5c sethi %hi(0x40017000), %o2 40009ab4: 90 10 00 16 mov %l6, %o0 40009ab8: 92 10 20 01 mov 1, %o1 40009abc: 10 80 00 25 b 40009b50 <_Heap_Walk+0x524> 40009ac0: 94 12 a0 80 or %o2, 0x80, %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 ) { 40009ac4: 80 a1 00 18 cmp %g4, %i0 40009ac8: 02 80 00 1e be 40009b40 <_Heap_Walk+0x514> 40009acc: 80 a1 00 19 cmp %g4, %i1 if ( free_block == block ) { 40009ad0: 02 80 00 15 be 40009b24 <_Heap_Walk+0x4f8> 40009ad4: 80 a5 00 1a cmp %l4, %i2 return true; } free_block = free_block->next; 40009ad8: 10 bf ff fb b 40009ac4 <_Heap_Walk+0x498> 40009adc: c8 01 20 08 ld [ %g4 + 8 ], %g4 if ( !_Heap_Is_prev_used( next_block ) ) { if ( !_Heap_Walk_check_free_block( source, printer, heap, block ) ) { return false; } } else if (prev_used) { 40009ae0: 80 a4 a0 00 cmp %l2, 0 40009ae4: 02 80 00 09 be 40009b08 <_Heap_Walk+0x4dc> 40009ae8: 92 10 20 00 clr %o1 (*printer)( 40009aec: 15 10 00 5c sethi %hi(0x40017000), %o2 40009af0: 96 10 00 19 mov %i1, %o3 40009af4: 94 12 a0 b0 or %o2, 0xb0, %o2 40009af8: 9f c7 40 00 call %i5 40009afc: 98 10 00 15 mov %l5, %o4 40009b00: 10 80 00 09 b 40009b24 <_Heap_Walk+0x4f8> 40009b04: 80 a5 00 1a cmp %l4, %i2 "block 0x%08x: size %u\n", block, block_size ); } else { (*printer)( 40009b08: da 06 40 00 ld [ %i1 ], %o5 40009b0c: 15 10 00 5c sethi %hi(0x40017000), %o2 40009b10: 96 10 00 19 mov %i1, %o3 40009b14: 94 12 a0 c8 or %o2, 0xc8, %o2 40009b18: 9f c7 40 00 call %i5 40009b1c: 98 10 00 15 mov %l5, %o4 block->prev_size ); } block = next_block; } while ( block != first_block ); 40009b20: 80 a5 00 1a cmp %l4, %i2 40009b24: 02 80 00 04 be 40009b34 <_Heap_Walk+0x508> 40009b28: a6 10 20 01 mov 1, %l3 40009b2c: 10 bf ff 61 b 400098b0 <_Heap_Walk+0x284> 40009b30: b2 10 00 14 mov %l4, %i1 40009b34: b0 0c e0 ff and %l3, 0xff, %i0 40009b38: 81 c7 e0 08 ret 40009b3c: 81 e8 00 00 restore return false; } if ( !_Heap_Walk_is_in_free_list( heap, block ) ) { (*printer)( 40009b40: 15 10 00 5c sethi %hi(0x40017000), %o2 40009b44: 90 10 00 16 mov %l6, %o0 40009b48: 92 10 20 01 mov 1, %o1 40009b4c: 94 12 a0 f0 or %o2, 0xf0, %o2 40009b50: 10 bf ff 32 b 40009818 <_Heap_Walk+0x1ec> 40009b54: 96 10 00 19 mov %i1, %o3 =============================================================================== 40008ab4 <_Objects_Allocate_unprotected>: } Objects_Control *_Objects_Allocate_unprotected( Objects_Information *information ) { 40008ab4: 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 ) 40008ab8: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 40008abc: 80 a0 60 00 cmp %g1, 0 40008ac0: 12 80 00 04 bne 40008ad0 <_Objects_Allocate_unprotected+0x1c><== ALWAYS TAKEN 40008ac4: ba 10 00 18 mov %i0, %i5 return NULL; 40008ac8: 81 c7 e0 08 ret 40008acc: 91 e8 20 00 restore %g0, 0, %o0 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 40008ad0: f8 06 20 20 ld [ %i0 + 0x20 ], %i4 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 40008ad4: b4 06 20 24 add %i0, 0x24, %i2 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 40008ad8: 80 a7 00 1a cmp %i4, %i2 40008adc: 02 80 00 06 be 40008af4 <_Objects_Allocate_unprotected+0x40> 40008ae0: b6 06 20 20 add %i0, 0x20, %i3 Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; 40008ae4: c2 07 00 00 ld [ %i4 ], %g1 head->next = new_first; 40008ae8: c2 26 20 20 st %g1, [ %i0 + 0x20 ] new_first->previous = head; 40008aec: 10 80 00 03 b 40008af8 <_Objects_Allocate_unprotected+0x44> 40008af0: f6 20 60 04 st %i3, [ %g1 + 4 ] ) { if ( !_Chain_Is_empty(the_chain)) return _Chain_Get_first_unprotected(the_chain); else return NULL; 40008af4: b8 10 20 00 clr %i4 * 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_Get_inactive( information ); if ( information->auto_extend ) { 40008af8: c2 0f 60 12 ldub [ %i5 + 0x12 ], %g1 40008afc: 80 a0 60 00 cmp %g1, 0 40008b00: 02 80 00 20 be 40008b80 <_Objects_Allocate_unprotected+0xcc> 40008b04: b0 10 00 1c mov %i4, %i0 /* * If the list is empty then we are out of objects and need to * extend information base. */ if ( !the_object ) { 40008b08: 80 a7 20 00 cmp %i4, 0 40008b0c: 32 80 00 0c bne,a 40008b3c <_Objects_Allocate_unprotected+0x88> 40008b10: c4 07 60 08 ld [ %i5 + 8 ], %g2 _Objects_Extend_information( information ); 40008b14: 40 00 00 2a call 40008bbc <_Objects_Extend_information> 40008b18: 90 10 00 1d mov %i5, %o0 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 40008b1c: f8 07 60 20 ld [ %i5 + 0x20 ], %i4 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 40008b20: 80 a7 00 1a cmp %i4, %i2 40008b24: 02 bf ff e9 be 40008ac8 <_Objects_Allocate_unprotected+0x14> 40008b28: 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; 40008b2c: c2 07 00 00 ld [ %i4 ], %g1 head->next = new_first; 40008b30: c2 27 60 20 st %g1, [ %i5 + 0x20 ] new_first->previous = head; 40008b34: f6 20 60 04 st %i3, [ %g1 + 4 ] } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 40008b38: c4 07 60 08 ld [ %i5 + 8 ], %g2 40008b3c: d0 07 20 08 ld [ %i4 + 8 ], %o0 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; 40008b40: d2 17 60 14 lduh [ %i5 + 0x14 ], %o1 } if ( the_object ) { uint32_t block; block = (uint32_t) _Objects_Get_index( the_object->id ) - 40008b44: 03 00 00 3f sethi %hi(0xfc00), %g1 40008b48: 82 10 63 ff or %g1, 0x3ff, %g1 ! ffff <_TLS_Alignment+0xfffe> 40008b4c: 90 0a 00 01 and %o0, %g1, %o0 40008b50: 82 08 80 01 and %g2, %g1, %g1 _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; 40008b54: 40 00 2a 61 call 400134d8 <.udiv> 40008b58: 90 22 00 01 sub %o0, %g1, %o0 information->inactive_per_block[ block ]--; 40008b5c: c2 07 60 30 ld [ %i5 + 0x30 ], %g1 40008b60: 91 2a 20 02 sll %o0, 2, %o0 40008b64: c4 00 40 08 ld [ %g1 + %o0 ], %g2 information->inactive--; 40008b68: b0 10 00 1c mov %i4, %i0 block = (uint32_t) _Objects_Get_index( the_object->id ) - _Objects_Get_index( information->minimum_id ); block /= information->allocation_size; information->inactive_per_block[ block ]--; 40008b6c: 84 00 bf ff add %g2, -1, %g2 40008b70: c4 20 40 08 st %g2, [ %g1 + %o0 ] information->inactive--; 40008b74: c2 17 60 2c lduh [ %i5 + 0x2c ], %g1 40008b78: 82 00 7f ff add %g1, -1, %g1 40008b7c: c2 37 60 2c sth %g1, [ %i5 + 0x2c ] ); } #endif return the_object; } 40008b80: 81 c7 e0 08 ret 40008b84: 81 e8 00 00 restore =============================================================================== 40008bbc <_Objects_Extend_information>: */ void _Objects_Extend_information( Objects_Information *information ) { 40008bbc: 9d e3 bf a0 save %sp, -96, %sp minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 40008bc0: f2 06 20 34 ld [ %i0 + 0x34 ], %i1 */ void _Objects_Extend_information( Objects_Information *information ) { 40008bc4: ba 10 00 18 mov %i0, %i5 /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); 40008bc8: f4 16 20 0a lduh [ %i0 + 0xa ], %i2 index_base = minimum_index; block = 0; /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) 40008bcc: 80 a6 60 00 cmp %i1, 0 40008bd0: e8 16 20 14 lduh [ %i0 + 0x14 ], %l4 40008bd4: 02 80 00 18 be 40008c34 <_Objects_Extend_information+0x78> 40008bd8: e0 16 20 10 lduh [ %i0 + 0x10 ], %l0 block_count = 0; else { block_count = information->maximum / information->allocation_size; 40008bdc: 91 2c 20 10 sll %l0, 0x10, %o0 40008be0: b1 2d 20 10 sll %l4, 0x10, %i0 40008be4: 91 32 20 10 srl %o0, 0x10, %o0 40008be8: b1 36 20 10 srl %i0, 0x10, %i0 /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); 40008bec: b8 10 00 1a mov %i2, %i4 /* if ( information->maximum < minimum_index ) */ if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; 40008bf0: 92 10 00 18 mov %i0, %o1 40008bf4: 40 00 2a 39 call 400134d8 <.udiv> 40008bf8: b6 10 20 00 clr %i3 40008bfc: 91 2a 20 10 sll %o0, 0x10, %o0 40008c00: a7 32 20 10 srl %o0, 0x10, %l3 for ( ; block < block_count; block++ ) { 40008c04: 80 a6 c0 13 cmp %i3, %l3 40008c08: 1a 80 00 09 bcc 40008c2c <_Objects_Extend_information+0x70> 40008c0c: 83 2e e0 02 sll %i3, 2, %g1 if ( information->object_blocks[ block ] == NULL ) { 40008c10: c2 06 40 01 ld [ %i1 + %g1 ], %g1 40008c14: 80 a0 60 00 cmp %g1, 0 40008c18: 22 80 00 0b be,a 40008c44 <_Objects_Extend_information+0x88> 40008c1c: b2 10 20 00 clr %i1 do_extend = false; break; } else index_base += information->allocation_size; 40008c20: b8 07 00 18 add %i4, %i0, %i4 if ( information->object_blocks == NULL ) block_count = 0; else { block_count = information->maximum / information->allocation_size; for ( ; block < block_count; block++ ) { 40008c24: 10 bf ff f8 b 40008c04 <_Objects_Extend_information+0x48> 40008c28: b6 06 e0 01 inc %i3 40008c2c: 10 80 00 06 b 40008c44 <_Objects_Extend_information+0x88> 40008c30: b2 10 20 01 mov 1, %i1 /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; minimum_index = _Objects_Get_index( information->minimum_id ); 40008c34: b8 10 00 1a mov %i2, %i4 /* * Search for a free block of indexes. If we do NOT need to allocate or * extend the block table, then we will change do_extend. */ do_extend = true; 40008c38: b2 10 20 01 mov 1, %i1 minimum_index = _Objects_Get_index( information->minimum_id ); index_base = minimum_index; block = 0; 40008c3c: b6 10 20 00 clr %i3 40008c40: a6 10 20 00 clr %l3 break; } else index_base += information->allocation_size; } } index_end = index_base + information->allocation_size; 40008c44: a9 2d 20 10 sll %l4, 0x10, %l4 maximum = (uint32_t) information->maximum + information->allocation_size; 40008c48: a1 2c 20 10 sll %l0, 0x10, %l0 break; } else index_base += information->allocation_size; } } index_end = index_base + information->allocation_size; 40008c4c: a9 35 20 10 srl %l4, 0x10, %l4 maximum = (uint32_t) information->maximum + information->allocation_size; 40008c50: a1 34 20 10 srl %l0, 0x10, %l0 /* * We need to limit the number of objects to the maximum number * representable in the index portion of the object Id. In the * case of 16-bit Ids, this is only 256 object instances. */ if ( maximum > OBJECTS_ID_FINAL_INDEX ) { 40008c54: 03 00 00 3f sethi %hi(0xfc00), %g1 index_base += information->allocation_size; } } index_end = index_base + information->allocation_size; maximum = (uint32_t) information->maximum + information->allocation_size; 40008c58: a0 04 00 14 add %l0, %l4, %l0 /* * We need to limit the number of objects to the maximum number * representable in the index portion of the object Id. In the * case of 16-bit Ids, this is only 256 object instances. */ if ( maximum > OBJECTS_ID_FINAL_INDEX ) { 40008c5c: 82 10 63 ff or %g1, 0x3ff, %g1 40008c60: 80 a4 00 01 cmp %l0, %g1 40008c64: 18 80 00 8d bgu 40008e98 <_Objects_Extend_information+0x2dc> 40008c68: 01 00 00 00 nop /* * Allocate the name table, and the objects and if it fails either return or * generate a fatal error depending on auto-extending being active. */ block_size = information->allocation_size * information->size; 40008c6c: d2 07 60 18 ld [ %i5 + 0x18 ], %o1 40008c70: 40 00 29 e0 call 400133f0 <.umul> 40008c74: 90 10 00 14 mov %l4, %o0 if ( information->auto_extend ) { 40008c78: c2 0f 60 12 ldub [ %i5 + 0x12 ], %g1 40008c7c: 80 a0 60 00 cmp %g1, 0 40008c80: 02 80 00 09 be 40008ca4 <_Objects_Extend_information+0xe8> 40008c84: 01 00 00 00 nop new_object_block = _Workspace_Allocate( block_size ); 40008c88: 40 00 09 bc call 4000b378 <_Workspace_Allocate> 40008c8c: 01 00 00 00 nop if ( !new_object_block ) 40008c90: b0 92 20 00 orcc %o0, 0, %i0 40008c94: 12 80 00 08 bne 40008cb4 <_Objects_Extend_information+0xf8><== ALWAYS TAKEN 40008c98: 80 8e 60 ff btst 0xff, %i1 40008c9c: 81 c7 e0 08 ret <== NOT EXECUTED 40008ca0: 81 e8 00 00 restore <== NOT EXECUTED return; } else { new_object_block = _Workspace_Allocate_or_fatal_error( block_size ); 40008ca4: 40 00 09 cc call 4000b3d4 <_Workspace_Allocate_or_fatal_error> 40008ca8: 01 00 00 00 nop 40008cac: b0 10 00 08 mov %o0, %i0 } /* * Do we need to grow the tables? */ if ( do_extend ) { 40008cb0: 80 8e 60 ff btst 0xff, %i1 40008cb4: 02 80 00 59 be 40008e18 <_Objects_Extend_information+0x25c> 40008cb8: a8 07 00 14 add %i4, %l4, %l4 */ /* * Up the block count and maximum */ block_count++; 40008cbc: a6 04 e0 01 inc %l3 * 1. object_blocks : void* * 2. inactive_per_blocks : uint32_t * 3. local_table : Objects_Name* */ object_blocks_size = (uintptr_t)_Addresses_Align_up( (void*)(block_count * sizeof(void*)), 40008cc0: a7 2c e0 02 sll %l3, 2, %l3 void *address, size_t alignment ) { uintptr_t mask = alignment - (uintptr_t)1; return (void*)(((uintptr_t)address + mask) & ~mask); 40008cc4: a2 04 e0 07 add %l3, 7, %l1 40008cc8: a2 0c 7f f8 and %l1, -8, %l1 inactive_per_block_size = (uintptr_t)_Addresses_Align_up( (void*)(block_count * sizeof(uint32_t)), CPU_ALIGNMENT ); block_size = object_blocks_size + inactive_per_block_size + 40008ccc: 83 2c 60 01 sll %l1, 1, %g1 ((maximum + minimum_index) * sizeof(Objects_Control *)); 40008cd0: 90 04 00 1a add %l0, %i2, %o0 40008cd4: 91 2a 20 02 sll %o0, 2, %o0 inactive_per_block_size = (uintptr_t)_Addresses_Align_up( (void*)(block_count * sizeof(uint32_t)), CPU_ALIGNMENT ); block_size = object_blocks_size + inactive_per_block_size + 40008cd8: 90 00 40 08 add %g1, %o0, %o0 ((maximum + minimum_index) * sizeof(Objects_Control *)); if ( information->auto_extend ) { 40008cdc: c2 0f 60 12 ldub [ %i5 + 0x12 ], %g1 40008ce0: 80 a0 60 00 cmp %g1, 0 40008ce4: 02 80 00 09 be 40008d08 <_Objects_Extend_information+0x14c> 40008ce8: 01 00 00 00 nop object_blocks = _Workspace_Allocate( block_size ); 40008cec: 40 00 09 a3 call 4000b378 <_Workspace_Allocate> 40008cf0: 01 00 00 00 nop if ( !object_blocks ) { 40008cf4: b2 92 20 00 orcc %o0, 0, %i1 40008cf8: 32 80 00 08 bne,a 40008d18 <_Objects_Extend_information+0x15c><== ALWAYS TAKEN 40008cfc: c2 17 60 10 lduh [ %i5 + 0x10 ], %g1 _Workspace_Free( new_object_block ); 40008d00: 40 00 09 af call 4000b3bc <_Workspace_Free> <== NOT EXECUTED 40008d04: 81 e8 00 00 restore <== NOT EXECUTED return; } } else { object_blocks = _Workspace_Allocate_or_fatal_error( block_size ); 40008d08: 40 00 09 b3 call 4000b3d4 <_Workspace_Allocate_or_fatal_error> 40008d0c: 01 00 00 00 nop 40008d10: b2 10 00 08 mov %o0, %i1 * Take the block count down. Saves all the (block_count - 1) * in the copies. */ block_count--; if ( information->maximum > minimum_index ) { 40008d14: c2 17 60 10 lduh [ %i5 + 0x10 ], %g1 RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset ( const void *base, uintptr_t offset ) { return (void *)((uintptr_t)base + offset); 40008d18: a4 06 40 11 add %i1, %l1, %l2 40008d1c: 80 a0 40 1a cmp %g1, %i2 40008d20: 18 80 00 04 bgu 40008d30 <_Objects_Extend_information+0x174> 40008d24: a2 04 80 11 add %l2, %l1, %l1 40008d28: 10 80 00 13 b 40008d74 <_Objects_Extend_information+0x1b8> 40008d2c: 82 10 20 00 clr %g1 /* * Copy each section of the table over. This has to be performed as * separate parts as size of each block has changed. */ memcpy( object_blocks, 40008d30: d2 07 60 34 ld [ %i5 + 0x34 ], %o1 information->object_blocks, block_count * sizeof(void*) ); 40008d34: aa 04 ff fc add %l3, -4, %l5 /* * Copy each section of the table over. This has to be performed as * separate parts as size of each block has changed. */ memcpy( object_blocks, 40008d38: 90 10 00 19 mov %i1, %o0 40008d3c: 40 00 1d 1f call 400101b8 40008d40: 94 10 00 15 mov %l5, %o2 information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, 40008d44: d2 07 60 30 ld [ %i5 + 0x30 ], %o1 40008d48: 94 10 00 15 mov %l5, %o2 40008d4c: 40 00 1d 1b call 400101b8 40008d50: 90 10 00 12 mov %l2, %o0 information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, information->local_table, (information->maximum + minimum_index) * sizeof(Objects_Control *) ); 40008d54: c2 17 60 10 lduh [ %i5 + 0x10 ], %g1 information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, 40008d58: d2 07 60 1c ld [ %i5 + 0x1c ], %o1 information->local_table, (information->maximum + minimum_index) * sizeof(Objects_Control *) ); 40008d5c: 94 00 40 1a add %g1, %i2, %o2 information->object_blocks, block_count * sizeof(void*) ); memcpy( inactive_per_block, information->inactive_per_block, block_count * sizeof(uint32_t) ); memcpy( local_table, 40008d60: 90 10 00 11 mov %l1, %o0 40008d64: 40 00 1d 15 call 400101b8 40008d68: 95 2a a0 02 sll %o2, 2, %o2 40008d6c: 10 80 00 09 b 40008d90 <_Objects_Extend_information+0x1d4> 40008d70: a6 04 ff fc add %l3, -4, %l3 } else { /* * Deal with the special case of the 0 to minimum_index */ for ( index = 0; index < minimum_index; index++ ) { 40008d74: 80 a0 40 1a cmp %g1, %i2 40008d78: 02 80 00 05 be 40008d8c <_Objects_Extend_information+0x1d0> 40008d7c: 85 28 60 02 sll %g1, 2, %g2 40008d80: 82 00 60 01 inc %g1 local_table[ index ] = NULL; 40008d84: 10 bf ff fc b 40008d74 <_Objects_Extend_information+0x1b8> 40008d88: c0 20 80 11 clr [ %g2 + %l1 ] } /* * Initialise the new entries in the table. */ object_blocks[block_count] = NULL; 40008d8c: a6 04 ff fc add %l3, -4, %l3 40008d90: c0 26 40 13 clr [ %i1 + %l3 ] inactive_per_block[block_count] = 0; 40008d94: c0 24 80 13 clr [ %l2 + %l3 ] for ( index = index_base ; index < index_end ; ++index ) { 40008d98: 82 10 00 1c mov %i4, %g1 40008d9c: 80 a0 40 14 cmp %g1, %l4 40008da0: 1a 80 00 05 bcc 40008db4 <_Objects_Extend_information+0x1f8> 40008da4: 85 28 60 02 sll %g1, 2, %g2 40008da8: 82 00 60 01 inc %g1 local_table[ index ] = NULL; 40008dac: 10 bf ff fc b 40008d9c <_Objects_Extend_information+0x1e0> 40008db0: c0 20 80 11 clr [ %g2 + %l1 ] * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t disable_level = _Thread_Dispatch_disable_level; 40008db4: c4 01 a0 10 ld [ %g6 + 0x10 ], %g2 _ISR_Disable( level ); _Profiling_Thread_dispatch_disable( _Per_CPU_Get(), disable_level ); #endif ++disable_level; 40008db8: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = disable_level; 40008dbc: c4 21 a0 10 st %g2, [ %g6 + 0x10 ] } _Thread_Disable_dispatch(); _ISR_Disable( level ); 40008dc0: 7f ff e5 9d call 40002434 40008dc4: 01 00 00 00 nop uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 40008dc8: c2 07 40 00 ld [ %i5 ], %g1 40008dcc: 05 00 00 40 sethi %hi(0x10000), %g2 40008dd0: 83 28 60 18 sll %g1, 0x18, %g1 40008dd4: 82 10 40 02 or %g1, %g2, %g1 old_tables = information->object_blocks; information->object_blocks = object_blocks; information->inactive_per_block = inactive_per_block; information->local_table = local_table; information->maximum = (Objects_Maximum) maximum; 40008dd8: e0 37 60 10 sth %l0, [ %i5 + 0x10 ] (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 40008ddc: a0 10 40 10 or %g1, %l0, %l0 information->maximum_id = _Objects_Build_id( 40008de0: c2 17 60 04 lduh [ %i5 + 4 ], %g1 } _Thread_Disable_dispatch(); _ISR_Disable( level ); old_tables = information->object_blocks; 40008de4: f4 07 60 34 ld [ %i5 + 0x34 ], %i2 40008de8: 83 28 60 1b sll %g1, 0x1b, %g1 information->object_blocks = object_blocks; 40008dec: f2 27 60 34 st %i1, [ %i5 + 0x34 ] uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 40008df0: a0 14 00 01 or %l0, %g1, %l0 information->inactive_per_block = inactive_per_block; 40008df4: e4 27 60 30 st %l2, [ %i5 + 0x30 ] information->local_table = local_table; 40008df8: e2 27 60 1c st %l1, [ %i5 + 0x1c ] information->maximum = (Objects_Maximum) maximum; information->maximum_id = _Objects_Build_id( 40008dfc: e0 27 60 0c st %l0, [ %i5 + 0xc ] information->the_class, _Objects_Local_node, information->maximum ); _ISR_Enable( level ); 40008e00: 7f ff e5 90 call 40002440 40008e04: 01 00 00 00 nop _Thread_Enable_dispatch(); 40008e08: 40 00 04 04 call 40009e18 <_Thread_Enable_dispatch> 40008e0c: 01 00 00 00 nop _Workspace_Free( old_tables ); 40008e10: 40 00 09 6b call 4000b3bc <_Workspace_Free> 40008e14: 90 10 00 1a mov %i2, %o0 } /* * Assign the new object block to the object block table. */ information->object_blocks[ block ] = new_object_block; 40008e18: c2 07 60 34 ld [ %i5 + 0x34 ], %g1 40008e1c: b7 2e e0 02 sll %i3, 2, %i3 40008e20: f0 20 40 1b st %i0, [ %g1 + %i3 ] /* * Append to inactive chain. */ the_object = information->object_blocks[ block ]; 40008e24: c2 07 60 34 ld [ %i5 + 0x34 ], %g1 40008e28: 07 00 00 40 sethi %hi(0x10000), %g3 40008e2c: c2 00 40 1b ld [ %g1 + %i3 ], %g1 RTEMS_INLINE_ROUTINE void _Chain_Append_unprotected( Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); 40008e30: 88 07 60 24 add %i5, 0x24, %g4 for ( index = index_base ; index < index_end ; ++index ) { 40008e34: 80 a7 00 14 cmp %i4, %l4 40008e38: 3a 80 00 13 bcc,a 40008e84 <_Objects_Extend_information+0x2c8> 40008e3c: c4 07 60 30 ld [ %i5 + 0x30 ], %g2 40008e40: f4 07 40 00 ld [ %i5 ], %i2 the_object->id = _Objects_Build_id( 40008e44: c4 17 60 04 lduh [ %i5 + 4 ], %g2 40008e48: b5 2e a0 18 sll %i2, 0x18, %i2 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 40008e4c: 85 28 a0 1b sll %g2, 0x1b, %g2 uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 40008e50: b4 16 80 03 or %i2, %g3, %i2 (( (Objects_Id) the_class ) << OBJECTS_CLASS_START_BIT) | 40008e54: 84 16 80 02 or %i2, %g2, %g2 uint32_t the_class, uint32_t node, uint32_t index ) { return (( (Objects_Id) the_api ) << OBJECTS_API_START_BIT) | 40008e58: 84 10 80 1c or %g2, %i4, %g2 40008e5c: c4 20 60 08 st %g2, [ %g1 + 8 ] Chain_Node *old_last = tail->previous; 40008e60: c4 07 60 28 ld [ %i5 + 0x28 ], %g2 the_node->next = tail; 40008e64: c8 20 40 00 st %g4, [ %g1 ] tail->previous = the_node; 40008e68: c2 27 60 28 st %g1, [ %i5 + 0x28 ] old_last->next = the_node; 40008e6c: c2 20 80 00 st %g1, [ %g2 ] the_node->previous = old_last; 40008e70: c4 20 60 04 st %g2, [ %g1 + 4 ] index ); _Chain_Append_unprotected( &information->Inactive, &the_object->Node ); the_object = (Objects_Control *) 40008e74: c4 07 60 18 ld [ %i5 + 0x18 ], %g2 /* * Append to inactive chain. */ the_object = information->object_blocks[ block ]; for ( index = index_base ; index < index_end ; ++index ) { 40008e78: b8 07 20 01 inc %i4 index ); _Chain_Append_unprotected( &information->Inactive, &the_object->Node ); the_object = (Objects_Control *) 40008e7c: 10 bf ff ee b 40008e34 <_Objects_Extend_information+0x278> 40008e80: 82 00 40 02 add %g1, %g2, %g1 ( (char *) the_object + information->size ); } information->inactive_per_block[ block ] = information->allocation_size; 40008e84: c2 17 60 14 lduh [ %i5 + 0x14 ], %g1 40008e88: c2 20 80 1b st %g1, [ %g2 + %i3 ] information->inactive = (Objects_Maximum)(information->inactive + information->allocation_size); 40008e8c: c4 17 60 2c lduh [ %i5 + 0x2c ], %g2 40008e90: 82 00 80 01 add %g2, %g1, %g1 the_object = (Objects_Control *) ( (char *) the_object + information->size ); } information->inactive_per_block[ block ] = information->allocation_size; information->inactive = 40008e94: c2 37 60 2c sth %g1, [ %i5 + 0x2c ] 40008e98: 81 c7 e0 08 ret 40008e9c: 81 e8 00 00 restore =============================================================================== 40008f60 <_Objects_Get_information>: Objects_Information *_Objects_Get_information( Objects_APIs the_api, uint16_t the_class ) { 40008f60: 9d e3 bf a0 save %sp, -96, %sp Objects_Information *info; int the_class_api_maximum; if ( !the_class ) 40008f64: 80 a6 60 00 cmp %i1, 0 40008f68: 12 80 00 04 bne 40008f78 <_Objects_Get_information+0x18> 40008f6c: 01 00 00 00 nop return NULL; 40008f70: 81 c7 e0 08 ret 40008f74: 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 ); 40008f78: 40 00 12 2b call 4000d824 <_Objects_API_maximum_class> 40008f7c: 90 10 00 18 mov %i0, %o0 if ( the_class_api_maximum == 0 ) 40008f80: 80 a2 20 00 cmp %o0, 0 40008f84: 02 bf ff fb be 40008f70 <_Objects_Get_information+0x10> 40008f88: 80 a6 40 08 cmp %i1, %o0 return NULL; if ( the_class > (uint32_t) the_class_api_maximum ) 40008f8c: 18 bf ff f9 bgu 40008f70 <_Objects_Get_information+0x10> 40008f90: 03 10 00 61 sethi %hi(0x40018400), %g1 return NULL; if ( !_Objects_Information_table[ the_api ] ) 40008f94: b1 2e 20 02 sll %i0, 2, %i0 40008f98: 82 10 60 20 or %g1, 0x20, %g1 40008f9c: c2 00 40 18 ld [ %g1 + %i0 ], %g1 40008fa0: 80 a0 60 00 cmp %g1, 0 40008fa4: 02 bf ff f3 be 40008f70 <_Objects_Get_information+0x10> <== NEVER TAKEN 40008fa8: b3 2e 60 02 sll %i1, 2, %i1 return NULL; info = _Objects_Information_table[ the_api ][ the_class ]; 40008fac: f0 00 40 19 ld [ %g1 + %i1 ], %i0 if ( !info ) 40008fb0: 80 a6 20 00 cmp %i0, 0 40008fb4: 02 bf ff ef be 40008f70 <_Objects_Get_information+0x10> <== NEVER TAKEN 40008fb8: 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 ) 40008fbc: c2 16 20 10 lduh [ %i0 + 0x10 ], %g1 40008fc0: 80 a0 60 00 cmp %g1, 0 40008fc4: 02 bf ff eb be 40008f70 <_Objects_Get_information+0x10> 40008fc8: 01 00 00 00 nop return NULL; #endif return info; } 40008fcc: 81 c7 e0 08 ret 40008fd0: 81 e8 00 00 restore =============================================================================== 4000cc1c <_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; 4000cc1c: c2 02 20 08 ld [ %o0 + 8 ], %g1 4000cc20: 92 22 40 01 sub %o1, %g1, %o1 if ( information->maximum >= index ) { 4000cc24: 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; 4000cc28: 92 02 60 01 inc %o1 if ( information->maximum >= index ) { 4000cc2c: 80 a0 40 09 cmp %g1, %o1 4000cc30: 0a 80 00 09 bcs 4000cc54 <_Objects_Get_no_protection+0x38> 4000cc34: 93 2a 60 02 sll %o1, 2, %o1 if ( (the_object = information->local_table[ index ]) != NULL ) { 4000cc38: c2 02 20 1c ld [ %o0 + 0x1c ], %g1 4000cc3c: d0 00 40 09 ld [ %g1 + %o1 ], %o0 4000cc40: 80 a2 20 00 cmp %o0, 0 4000cc44: 02 80 00 05 be 4000cc58 <_Objects_Get_no_protection+0x3c> <== NEVER TAKEN 4000cc48: 82 10 20 01 mov 1, %g1 *location = OBJECTS_LOCAL; return the_object; 4000cc4c: 81 c3 e0 08 retl 4000cc50: 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; 4000cc54: 82 10 20 01 mov 1, %g1 return NULL; 4000cc58: 90 10 20 00 clr %o0 } 4000cc5c: 81 c3 e0 08 retl 4000cc60: c2 22 80 00 st %g1, [ %o2 ] =============================================================================== 4000d3b0 <_Objects_Id_to_name>: Objects_Name_or_id_lookup_errors _Objects_Id_to_name ( Objects_Id id, Objects_Name *name ) { 4000d3b0: 9d e3 bf 98 save %sp, -104, %sp /* * Caller is trusted for name != NULL. */ tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Get_executing()->Object.id : id; 4000d3b4: 80 a6 20 00 cmp %i0, 0 4000d3b8: 12 80 00 05 bne 4000d3cc <_Objects_Id_to_name+0x1c> 4000d3bc: 83 36 20 18 srl %i0, 0x18, %g1 4000d3c0: c2 01 a0 18 ld [ %g6 + 0x18 ], %g1 4000d3c4: f0 00 60 08 ld [ %g1 + 8 ], %i0 4000d3c8: 83 36 20 18 srl %i0, 0x18, %g1 4000d3cc: 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 ) 4000d3d0: 84 00 7f ff add %g1, -1, %g2 4000d3d4: 80 a0 a0 02 cmp %g2, 2 4000d3d8: 08 80 00 04 bleu 4000d3e8 <_Objects_Id_to_name+0x38> 4000d3dc: 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; 4000d3e0: 81 c7 e0 08 ret 4000d3e4: 91 e8 20 03 restore %g0, 3, %o0 if ( !_Objects_Information_table[ the_api ] ) 4000d3e8: 05 10 00 c0 sethi %hi(0x40030000), %g2 4000d3ec: 84 10 a3 60 or %g2, 0x360, %g2 ! 40030360 <_Objects_Information_table> 4000d3f0: c2 00 80 01 ld [ %g2 + %g1 ], %g1 4000d3f4: 80 a0 60 00 cmp %g1, 0 4000d3f8: 02 bf ff fa be 4000d3e0 <_Objects_Id_to_name+0x30> 4000d3fc: 85 36 20 1b srl %i0, 0x1b, %g2 return OBJECTS_INVALID_ID; the_class = _Objects_Get_class( tmpId ); information = _Objects_Information_table[ the_api ][ the_class ]; 4000d400: 85 28 a0 02 sll %g2, 2, %g2 4000d404: d0 00 40 02 ld [ %g1 + %g2 ], %o0 if ( !information ) 4000d408: 80 a2 20 00 cmp %o0, 0 4000d40c: 02 bf ff f5 be 4000d3e0 <_Objects_Id_to_name+0x30> <== NEVER TAKEN 4000d410: 01 00 00 00 nop return OBJECTS_INVALID_ID; #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) if ( information->is_string ) 4000d414: c2 0a 20 38 ldub [ %o0 + 0x38 ], %g1 4000d418: 80 a0 60 00 cmp %g1, 0 4000d41c: 12 bf ff f1 bne 4000d3e0 <_Objects_Id_to_name+0x30> <== NEVER TAKEN 4000d420: 92 10 00 18 mov %i0, %o1 return OBJECTS_INVALID_ID; #endif the_object = _Objects_Get( information, tmpId, &ignored_location ); 4000d424: 7f ff ff c8 call 4000d344 <_Objects_Get> 4000d428: 94 07 bf fc add %fp, -4, %o2 if ( !the_object ) 4000d42c: 80 a2 20 00 cmp %o0, 0 4000d430: 02 bf ff ec be 4000d3e0 <_Objects_Id_to_name+0x30> 4000d434: 01 00 00 00 nop return OBJECTS_INVALID_ID; *name = the_object->name; 4000d438: c2 02 20 0c ld [ %o0 + 0xc ], %g1 _Objects_Put( the_object ); return OBJECTS_NAME_OR_ID_LOOKUP_SUCCESSFUL; 4000d43c: b0 10 20 00 clr %i0 RTEMS_INLINE_ROUTINE void _Objects_Put( Objects_Control *the_object ) { (void) the_object; _Thread_Enable_dispatch(); 4000d440: 40 00 03 5f call 4000e1bc <_Thread_Enable_dispatch> 4000d444: c2 26 40 00 st %g1, [ %i1 ] 4000d448: 81 c7 e0 08 ret 4000d44c: 81 e8 00 00 restore =============================================================================== 4000792c <_POSIX_Keys_Free_memory>: #include void _POSIX_Keys_Free_memory( POSIX_Keys_Control *the_key ) { 4000792c: 9d e3 bf 78 save %sp, -136, %sp POSIX_Keys_Key_value_pair search_node; POSIX_Keys_Key_value_pair *p; RBTree_Node *iter, *next; Objects_Id key_id; key_id = the_key->Object.id; 40007930: f6 06 20 08 ld [ %i0 + 8 ], %i3 search_node.key = key_id; search_node.thread_id = 0; iter = _RBTree_Find( &_POSIX_Keys_Key_value_lookup_tree, &search_node.Key_value_lookup_node ); 40007934: 39 10 00 65 sethi %hi(0x40019400), %i4 POSIX_Keys_Key_value_pair *p; RBTree_Node *iter, *next; Objects_Id key_id; key_id = the_key->Object.id; search_node.key = key_id; 40007938: f6 27 bf f4 st %i3, [ %fp + -12 ] search_node.thread_id = 0; 4000793c: c0 27 bf f8 clr [ %fp + -8 ] iter = _RBTree_Find( &_POSIX_Keys_Key_value_lookup_tree, &search_node.Key_value_lookup_node ); 40007940: 90 17 22 a8 or %i4, 0x2a8, %o0 40007944: 92 07 bf e4 add %fp, -28, %o1 40007948: 40 00 0a 7e call 4000a340 <_RBTree_Find> 4000794c: b2 10 00 1c mov %i4, %i1 if ( !iter ) 40007950: ba 92 20 00 orcc %o0, 0, %i5 40007954: 02 80 00 2d be 40007a08 <_POSIX_Keys_Free_memory+0xdc> 40007958: 01 00 00 00 nop return; /** * find the smallest thread_id node in the rbtree. */ next = _RBTree_Next( iter, RBT_LEFT ); 4000795c: 40 00 0b 38 call 4000a63c <_RBTree_Next> 40007960: 92 10 20 00 clr %o1 ! 0 <_TLS_BSS_size> 40007964: b8 10 00 08 mov %o0, %i4 p = _RBTree_Container_of( next, POSIX_Keys_Key_value_pair, Key_value_lookup_node ); 40007968: 82 02 3f f8 add %o0, -8, %g1 while ( next != NULL && p->key == key_id) { 4000796c: 80 a7 20 00 cmp %i4, 0 40007970: 32 80 00 07 bne,a 4000798c <_POSIX_Keys_Free_memory+0x60> 40007974: c2 00 60 18 ld [ %g1 + 0x18 ], %g1 RTEMS_INLINE_ROUTINE void _POSIX_Keys_Key_value_pair_free( POSIX_Keys_Key_value_pair *key_value_pair ) { _Freechain_Put( &_POSIX_Keys_Keypool, key_value_pair ); 40007978: 31 10 00 65 sethi %hi(0x40019400), %i0 } /** * delete all nodes belongs to the_key from the rbtree and chain. */ p = _RBTree_Container_of( iter, POSIX_Keys_Key_value_pair, Key_value_lookup_node ); 4000797c: b8 07 7f f8 add %i5, -8, %i4 while ( iter != NULL && p->key == key_id ) { next = _RBTree_Next( iter, RBT_RIGHT ); _RBTree_Extract( &_POSIX_Keys_Key_value_lookup_tree, iter ); 40007980: b2 16 62 a8 or %i1, 0x2a8, %i1 40007984: 10 80 00 1d b 400079f8 <_POSIX_Keys_Free_memory+0xcc> 40007988: b0 16 22 64 or %i0, 0x264, %i0 /** * find the smallest thread_id node in the rbtree. */ next = _RBTree_Next( iter, RBT_LEFT ); p = _RBTree_Container_of( next, POSIX_Keys_Key_value_pair, Key_value_lookup_node ); while ( next != NULL && p->key == key_id) { 4000798c: 80 a0 40 1b cmp %g1, %i3 40007990: 12 bf ff fb bne 4000797c <_POSIX_Keys_Free_memory+0x50> <== NEVER TAKEN 40007994: 31 10 00 65 sethi %hi(0x40019400), %i0 iter = next; next = _RBTree_Next( iter, RBT_LEFT ); 40007998: 90 10 00 1c mov %i4, %o0 4000799c: 92 10 20 00 clr %o1 400079a0: 40 00 0b 27 call 4000a63c <_RBTree_Next> 400079a4: ba 10 00 1c mov %i4, %i5 p = _RBTree_Container_of( next, POSIX_Keys_Key_value_pair, Key_value_lookup_node ); 400079a8: 82 02 3f f8 add %o0, -8, %g1 */ next = _RBTree_Next( iter, RBT_LEFT ); p = _RBTree_Container_of( next, POSIX_Keys_Key_value_pair, Key_value_lookup_node ); while ( next != NULL && p->key == key_id) { iter = next; next = _RBTree_Next( iter, RBT_LEFT ); 400079ac: 10 bf ff f0 b 4000796c <_POSIX_Keys_Free_memory+0x40> 400079b0: b8 10 00 08 mov %o0, %i4 /** * delete all nodes belongs to the_key from the rbtree and chain. */ p = _RBTree_Container_of( iter, POSIX_Keys_Key_value_pair, Key_value_lookup_node ); while ( iter != NULL && p->key == key_id ) { next = _RBTree_Next( iter, RBT_RIGHT ); 400079b4: 40 00 0b 22 call 4000a63c <_RBTree_Next> 400079b8: 90 10 00 1d mov %i5, %o0 _RBTree_Extract( &_POSIX_Keys_Key_value_lookup_tree, iter ); 400079bc: 92 10 00 1d mov %i5, %o1 /** * delete all nodes belongs to the_key from the rbtree and chain. */ p = _RBTree_Container_of( iter, POSIX_Keys_Key_value_pair, Key_value_lookup_node ); while ( iter != NULL && p->key == key_id ) { next = _RBTree_Next( iter, RBT_RIGHT ); 400079c0: b4 10 00 08 mov %o0, %i2 _RBTree_Extract( &_POSIX_Keys_Key_value_lookup_tree, iter ); 400079c4: 40 00 09 f3 call 4000a190 <_RBTree_Extract> 400079c8: 90 10 00 19 mov %i1, %o0 ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 400079cc: c4 07 00 00 ld [ %i4 ], %g2 previous = the_node->previous; 400079d0: c2 07 20 04 ld [ %i4 + 4 ], %g1 400079d4: 92 10 00 1c mov %i4, %o1 next->previous = previous; 400079d8: c2 20 a0 04 st %g1, [ %g2 + 4 ] previous->next = next; 400079dc: c4 20 40 00 st %g2, [ %g1 ] 400079e0: 40 00 05 fa call 400091c8 <_Freechain_Put> 400079e4: 90 10 00 18 mov %i0, %o0 /** * delete all nodes belongs to the_key from the rbtree and chain. */ p = _RBTree_Container_of( iter, POSIX_Keys_Key_value_pair, Key_value_lookup_node ); while ( iter != NULL && p->key == key_id ) { 400079e8: 80 a6 a0 00 cmp %i2, 0 400079ec: 02 80 00 07 be 40007a08 <_POSIX_Keys_Free_memory+0xdc> 400079f0: b8 06 bf f8 add %i2, -8, %i4 next = _RBTree_Next( iter, RBT_RIGHT ); _RBTree_Extract( &_POSIX_Keys_Key_value_lookup_tree, iter ); _Chain_Extract_unprotected( &p->Key_values_per_thread_node ); _POSIX_Keys_Key_value_pair_free( p ); iter = next; 400079f4: ba 10 00 1a mov %i2, %i5 /** * delete all nodes belongs to the_key from the rbtree and chain. */ p = _RBTree_Container_of( iter, POSIX_Keys_Key_value_pair, Key_value_lookup_node ); while ( iter != NULL && p->key == key_id ) { 400079f8: c2 07 20 18 ld [ %i4 + 0x18 ], %g1 400079fc: 80 a0 40 1b cmp %g1, %i3 40007a00: 02 bf ff ed be 400079b4 <_POSIX_Keys_Free_memory+0x88> 40007a04: 92 10 20 01 mov 1, %o1 40007a08: 81 c7 e0 08 ret 40007a0c: 81 e8 00 00 restore =============================================================================== 4000c774 <_POSIX_Keys_Key_value_lookup_tree_compare_function>: int diff; n1 = _RBTree_Container_of( node1, POSIX_Keys_Key_value_pair, Key_value_lookup_node ); n2 = _RBTree_Container_of( node2, POSIX_Keys_Key_value_pair, Key_value_lookup_node ); diff = n1->key - n2->key; 4000c774: c4 02 60 10 ld [ %o1 + 0x10 ], %g2 POSIX_Keys_Key_value_pair *n1; POSIX_Keys_Key_value_pair *n2; Objects_Id thread_id1, thread_id2; int diff; n1 = _RBTree_Container_of( node1, POSIX_Keys_Key_value_pair, Key_value_lookup_node ); 4000c778: 82 02 3f f8 add %o0, -8, %g1 n2 = _RBTree_Container_of( node2, POSIX_Keys_Key_value_pair, Key_value_lookup_node ); diff = n1->key - n2->key; 4000c77c: d0 02 20 10 ld [ %o0 + 0x10 ], %o0 if ( diff ) 4000c780: 90 a2 00 02 subcc %o0, %g2, %o0 4000c784: 12 80 00 0c bne 4000c7b4 <_POSIX_Keys_Key_value_lookup_tree_compare_function+0x40> 4000c788: 92 02 7f f8 add %o1, -8, %o1 return diff; thread_id1 = n1->thread_id; 4000c78c: d0 00 60 1c ld [ %g1 + 0x1c ], %o0 thread_id2 = n2->thread_id; 4000c790: c2 02 60 1c ld [ %o1 + 0x1c ], %g1 /** * if thread_id1 or thread_id2 equals to 0, only key1 and key2 is valued. * it enables us search node only by pthread_key_t type key. */ if ( thread_id1 && thread_id2 ) 4000c794: 80 a0 60 00 cmp %g1, 0 4000c798: 02 80 00 06 be 4000c7b0 <_POSIX_Keys_Key_value_lookup_tree_compare_function+0x3c><== NEVER TAKEN 4000c79c: 80 a2 20 00 cmp %o0, 0 4000c7a0: 22 80 00 05 be,a 4000c7b4 <_POSIX_Keys_Key_value_lookup_tree_compare_function+0x40> 4000c7a4: 90 10 20 00 clr %o0 return thread_id1 - thread_id2; 4000c7a8: 81 c3 e0 08 retl 4000c7ac: 90 22 00 01 sub %o0, %g1, %o0 return 0; 4000c7b0: 90 10 20 00 clr %o0 <== NOT EXECUTED } 4000c7b4: 81 c3 e0 08 retl =============================================================================== 4000c7bc <_POSIX_Keys_Keypool_extend>: return _Objects_Maximum_per_allocation( max ); } static bool _POSIX_Keys_Keypool_extend( Freechain_Control *keypool ) { 4000c7bc: 9d e3 bf a0 save %sp, -96, %sp return 0; } static uint32_t _POSIX_Keys_Get_keypool_bump_count( void ) { uint32_t max = Configuration.maximum_key_value_pairs; 4000c7c0: 03 10 00 55 sethi %hi(0x40015400), %g1 4000c7c4: c2 00 61 98 ld [ %g1 + 0x198 ], %g1 ! 40015598 return _Objects_Is_unlimited( max ) ? 4000c7c8: 80 a0 60 00 cmp %g1, 0 4000c7cc: 36 80 00 14 bge,a 4000c81c <_POSIX_Keys_Keypool_extend+0x60><== NEVER TAKEN 4000c7d0: b0 10 20 00 clr %i0 <== NOT EXECUTED 4000c7d4: 3b 00 00 3f sethi %hi(0xfc00), %i5 4000c7d8: ba 17 63 ff or %i5, 0x3ff, %i5 ! ffff <_TLS_Alignment+0xfffe> static bool _POSIX_Keys_Keypool_extend( Freechain_Control *keypool ) { size_t bump_count = _POSIX_Keys_Get_keypool_bump_count(); bool ok = bump_count > 0; if ( ok ) { 4000c7dc: ba 88 40 1d andcc %g1, %i5, %i5 4000c7e0: 12 80 00 04 bne 4000c7f0 <_POSIX_Keys_Keypool_extend+0x34><== ALWAYS TAKEN 4000c7e4: 83 2f 60 05 sll %i5, 5, %g1 return _Objects_Maximum_per_allocation( max ); } static bool _POSIX_Keys_Keypool_extend( Freechain_Control *keypool ) { 4000c7e8: 10 80 00 0d b 4000c81c <_POSIX_Keys_Keypool_extend+0x60> <== NOT EXECUTED 4000c7ec: b0 10 20 00 clr %i0 <== NOT EXECUTED size_t bump_count = _POSIX_Keys_Get_keypool_bump_count(); bool ok = bump_count > 0; if ( ok ) { size_t size = bump_count * sizeof( POSIX_Keys_Key_value_pair ); 4000c7f0: 91 2f 60 02 sll %i5, 2, %o0 POSIX_Keys_Key_value_pair *nodes = _Workspace_Allocate( size ); 4000c7f4: 7f ff fa e1 call 4000b378 <_Workspace_Allocate> 4000c7f8: 90 02 00 01 add %o0, %g1, %o0 ok = nodes != NULL; if ( ok ) { 4000c7fc: 92 92 20 00 orcc %o0, 0, %o1 4000c800: 22 80 00 07 be,a 4000c81c <_POSIX_Keys_Keypool_extend+0x60><== NEVER TAKEN 4000c804: b0 10 20 00 clr %i0 <== NOT EXECUTED _Chain_Initialize( 4000c808: 90 10 00 18 mov %i0, %o0 4000c80c: 94 10 00 1d mov %i5, %o2 4000c810: 96 10 20 24 mov 0x24, %o3 4000c814: 7f ff ee 3d call 40008108 <_Chain_Initialize> 4000c818: b0 10 20 01 mov 1, %i0 ); } } return ok; } 4000c81c: b0 0e 20 01 and %i0, 1, %i0 4000c820: 81 c7 e0 08 ret 4000c824: 81 e8 00 00 restore =============================================================================== 4000c9c8 <_POSIX_Message_queue_Receive_support>: size_t msg_len, unsigned int *msg_prio, bool wait, Watchdog_Interval timeout ) { 4000c9c8: 9d e3 bf 90 save %sp, -112, %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( 4000c9cc: 11 10 00 a8 sethi %hi(0x4002a000), %o0 4000c9d0: 92 10 00 18 mov %i0, %o1 4000c9d4: 90 12 23 40 or %o0, 0x340, %o0 4000c9d8: 40 00 0c c8 call 4000fcf8 <_Objects_Get> 4000c9dc: 94 07 bf f8 add %fp, -8, %o2 size_t length_out; bool do_wait; Thread_Control *executing; the_mq_fd = _POSIX_Message_queue_Get_fd( mqdes, &location ); switch ( location ) { 4000c9e0: c2 07 bf f8 ld [ %fp + -8 ], %g1 4000c9e4: 80 a0 60 00 cmp %g1, 0 4000c9e8: 12 80 00 3c bne 4000cad8 <_POSIX_Message_queue_Receive_support+0x110> 4000c9ec: 01 00 00 00 nop case OBJECTS_LOCAL: if ( (the_mq_fd->oflag & O_ACCMODE) == O_WRONLY ) { 4000c9f0: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 4000c9f4: 84 08 60 03 and %g1, 3, %g2 4000c9f8: 80 a0 a0 01 cmp %g2, 1 4000c9fc: 32 80 00 05 bne,a 4000ca10 <_POSIX_Message_queue_Receive_support+0x48> 4000ca00: d0 02 20 10 ld [ %o0 + 0x10 ], %o0 RTEMS_INLINE_ROUTINE void _Objects_Put( Objects_Control *the_object ) { (void) the_object; _Thread_Enable_dispatch(); 4000ca04: 40 00 10 33 call 40010ad0 <_Thread_Enable_dispatch> 4000ca08: 01 00 00 00 nop 4000ca0c: 30 80 00 33 b,a 4000cad8 <_POSIX_Message_queue_Receive_support+0x110> rtems_set_errno_and_return_minus_one( EBADF ); } the_mq = the_mq_fd->Queue; if ( msg_len < the_mq->Message_queue.maximum_message_size ) { 4000ca10: c4 02 20 68 ld [ %o0 + 0x68 ], %g2 4000ca14: 80 a6 80 02 cmp %i2, %g2 4000ca18: 1a 80 00 08 bcc 4000ca38 <_POSIX_Message_queue_Receive_support+0x70> 4000ca1c: 84 10 3f ff mov -1, %g2 4000ca20: 40 00 10 2c call 40010ad0 <_Thread_Enable_dispatch> 4000ca24: 01 00 00 00 nop _Objects_Put( &the_mq_fd->Object ); rtems_set_errno_and_return_minus_one( EMSGSIZE ); 4000ca28: 40 00 29 30 call 40016ee8 <__errno> 4000ca2c: 01 00 00 00 nop 4000ca30: 10 80 00 2d b 4000cae4 <_POSIX_Message_queue_Receive_support+0x11c> 4000ca34: 82 10 20 7a mov 0x7a, %g1 ! 7a <_TLS_Alignment+0x79> length_out = -1; /* * A timed receive with a bad time will do a poll regardless. */ if ( wait ) 4000ca38: 80 a7 20 00 cmp %i4, 0 4000ca3c: 02 80 00 05 be 4000ca50 <_POSIX_Message_queue_Receive_support+0x88> 4000ca40: c4 27 bf fc st %g2, [ %fp + -4 ] do_wait = (the_mq_fd->oflag & O_NONBLOCK) ? false : true; 4000ca44: b9 30 60 0e srl %g1, 0xe, %i4 4000ca48: b8 1f 20 01 xor %i4, 1, %i4 4000ca4c: b8 0f 20 01 and %i4, 1, %i4 do_wait = wait; /* * Now perform the actual message receive */ executing = _Thread_Executing; 4000ca50: f4 01 a0 18 ld [ %g6 + 0x18 ], %i2 _CORE_message_queue_Seize( 4000ca54: 90 02 20 1c add %o0, 0x1c, %o0 4000ca58: 92 10 00 1a mov %i2, %o1 4000ca5c: 94 10 00 18 mov %i0, %o2 4000ca60: 96 10 00 19 mov %i1, %o3 4000ca64: 98 07 bf fc add %fp, -4, %o4 4000ca68: 9a 10 00 1c mov %i4, %o5 4000ca6c: 40 00 08 4e call 4000eba4 <_CORE_message_queue_Seize> 4000ca70: fa 23 a0 5c st %i5, [ %sp + 0x5c ] 4000ca74: 40 00 10 17 call 40010ad0 <_Thread_Enable_dispatch> 4000ca78: 01 00 00 00 nop do_wait, timeout ); _Objects_Put( &the_mq_fd->Object ); if (msg_prio) { 4000ca7c: 80 a6 e0 00 cmp %i3, 0 4000ca80: 22 80 00 08 be,a 4000caa0 <_POSIX_Message_queue_Receive_support+0xd8><== NEVER TAKEN 4000ca84: c2 06 a0 34 ld [ %i2 + 0x34 ], %g1 <== NOT EXECUTED 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); 4000ca88: c4 06 a0 24 ld [ %i2 + 0x24 ], %g2 4000ca8c: 83 38 a0 1f sra %g2, 0x1f, %g1 4000ca90: 84 18 40 02 xor %g1, %g2, %g2 4000ca94: 82 20 80 01 sub %g2, %g1, %g1 *msg_prio = _POSIX_Message_queue_Priority_from_core( 4000ca98: c2 26 c0 00 st %g1, [ %i3 ] executing->Wait.count ); } if ( !executing->Wait.return_code ) 4000ca9c: c2 06 a0 34 ld [ %i2 + 0x34 ], %g1 4000caa0: 80 a0 60 00 cmp %g1, 0 4000caa4: 12 80 00 05 bne 4000cab8 <_POSIX_Message_queue_Receive_support+0xf0> 4000caa8: 01 00 00 00 nop return length_out; 4000caac: f0 07 bf fc ld [ %fp + -4 ], %i0 4000cab0: 81 c7 e0 08 ret 4000cab4: 81 e8 00 00 restore rtems_set_errno_and_return_minus_one( 4000cab8: 40 00 29 0c call 40016ee8 <__errno> 4000cabc: b0 10 3f ff mov -1, %i0 4000cac0: ba 10 00 08 mov %o0, %i5 4000cac4: 40 00 00 94 call 4000cd14 <_POSIX_Message_queue_Translate_core_message_queue_return_code> 4000cac8: d0 06 a0 34 ld [ %i2 + 0x34 ], %o0 4000cacc: d0 27 40 00 st %o0, [ %i5 ] 4000cad0: 81 c7 e0 08 ret 4000cad4: 81 e8 00 00 restore #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EBADF ); 4000cad8: 40 00 29 04 call 40016ee8 <__errno> 4000cadc: 01 00 00 00 nop 4000cae0: 82 10 20 09 mov 9, %g1 ! 9 <_TLS_Alignment+0x8> 4000cae4: c2 22 00 00 st %g1, [ %o0 ] 4000cae8: b0 10 3f ff mov -1, %i0 } 4000caec: 81 c7 e0 08 ret 4000caf0: 81 e8 00 00 restore =============================================================================== 4000f6fc <_POSIX_Semaphore_Create_support>: size_t name_len, int pshared, unsigned int value, POSIX_Semaphore_Control **the_sem ) { 4000f6fc: 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) 4000f700: 80 a6 a0 00 cmp %i2, 0 4000f704: 22 80 00 06 be,a 4000f71c <_POSIX_Semaphore_Create_support+0x20> 4000f708: 21 10 00 78 sethi %hi(0x4001e000), %l0 rtems_set_errno_and_return_minus_one( ENOSYS ); 4000f70c: 40 00 0a c3 call 40012218 <__errno> 4000f710: 01 00 00 00 nop 4000f714: 10 80 00 0b b 4000f740 <_POSIX_Semaphore_Create_support+0x44> 4000f718: 82 10 20 58 mov 0x58, %g1 ! 58 <_TLS_Alignment+0x57> void _POSIX_Semaphore_Manager_initialization(void); RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control * _POSIX_Semaphore_Allocate_unprotected( void ) { return (POSIX_Semaphore_Control *) 4000f71c: 90 14 22 e4 or %l0, 0x2e4, %o0 4000f720: 7f ff ee 77 call 4000b0fc <_Objects_Allocate_unprotected> 4000f724: a2 10 00 10 mov %l0, %l1 the_semaphore = _POSIX_Semaphore_Allocate_unprotected(); if ( !the_semaphore ) { 4000f728: ba 92 20 00 orcc %o0, 0, %i5 4000f72c: 12 80 00 08 bne 4000f74c <_POSIX_Semaphore_Create_support+0x50> 4000f730: 80 a6 20 00 cmp %i0, 0 rtems_set_errno_and_return_minus_one( ENOSPC ); 4000f734: 40 00 0a b9 call 40012218 <__errno> 4000f738: 01 00 00 00 nop 4000f73c: 82 10 20 1c mov 0x1c, %g1 ! 1c <_TLS_Alignment+0x1b> 4000f740: c2 22 00 00 st %g1, [ %o0 ] 4000f744: 81 c7 e0 08 ret 4000f748: 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 ) { 4000f74c: 02 80 00 0e be 4000f784 <_POSIX_Semaphore_Create_support+0x88> 4000f750: 90 10 00 18 mov %i0, %o0 name = _Workspace_String_duplicate( name_arg, name_len ); 4000f754: 40 00 03 1f call 400103d0 <_Workspace_String_duplicate> 4000f758: 92 10 00 19 mov %i1, %o1 if ( !name ) { 4000f75c: b4 92 20 00 orcc %o0, 0, %i2 4000f760: 12 80 00 0b bne 4000f78c <_POSIX_Semaphore_Create_support+0x90><== ALWAYS TAKEN 4000f764: 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 ); 4000f768: 90 14 22 e4 or %l0, 0x2e4, %o0 <== NOT EXECUTED 4000f76c: 7f ff ef 5f call 4000b4e8 <_Objects_Free> <== NOT EXECUTED 4000f770: 92 10 00 1d mov %i5, %o1 <== NOT EXECUTED _POSIX_Semaphore_Free( the_semaphore ); rtems_set_errno_and_return_minus_one( ENOMEM ); 4000f774: 40 00 0a a9 call 40012218 <__errno> <== NOT EXECUTED 4000f778: 01 00 00 00 nop <== NOT EXECUTED 4000f77c: 10 bf ff f1 b 4000f740 <_POSIX_Semaphore_Create_support+0x44><== NOT EXECUTED 4000f780: 82 10 20 0c mov 0xc, %g1 ! c <_TLS_Alignment+0xb> <== NOT EXECUTED } } else { name = NULL; 4000f784: b4 10 20 00 clr %i2 } the_semaphore->process_shared = pshared; if ( name ) { 4000f788: 80 a6 a0 00 cmp %i2, 0 4000f78c: 02 80 00 08 be 4000f7ac <_POSIX_Semaphore_Create_support+0xb0> 4000f790: c0 27 60 10 clr [ %i5 + 0x10 ] the_semaphore->named = true; 4000f794: 82 10 20 01 mov 1, %g1 4000f798: c2 2f 60 14 stb %g1, [ %i5 + 0x14 ] the_semaphore->open_count = 1; 4000f79c: 82 10 20 01 mov 1, %g1 4000f7a0: c2 27 60 18 st %g1, [ %i5 + 0x18 ] 4000f7a4: 10 80 00 05 b 4000f7b8 <_POSIX_Semaphore_Create_support+0xbc> 4000f7a8: c2 2f 60 15 stb %g1, [ %i5 + 0x15 ] the_semaphore->linked = true; } else { the_semaphore->named = false; 4000f7ac: c0 2f 60 14 clrb [ %i5 + 0x14 ] the_semaphore->open_count = 0; 4000f7b0: c0 27 60 18 clr [ %i5 + 0x18 ] the_semaphore->linked = false; 4000f7b4: 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; 4000f7b8: 82 10 3f ff mov -1, %g1 * blocking tasks on this semaphore should be. It could somehow * be derived from the current scheduling policy. One * thing is certain, no matter what we decide, it won't be * the same as all other POSIX implementations. :) */ the_sem_attr->discipline = CORE_SEMAPHORE_DISCIPLINES_FIFO; 4000f7bc: c0 27 60 60 clr [ %i5 + 0x60 ] /* * This effectively disables limit checking. */ the_sem_attr->maximum_count = 0xFFFFFFFF; 4000f7c0: c2 27 60 5c st %g1, [ %i5 + 0x5c ] _CORE_semaphore_Initialize( &the_semaphore->Semaphore, the_sem_attr, value ); 4000f7c4: 90 07 60 1c add %i5, 0x1c, %o0 4000f7c8: 92 07 60 5c add %i5, 0x5c, %o1 4000f7cc: 7f ff ec 6f call 4000a988 <_CORE_semaphore_Initialize> 4000f7d0: 94 10 00 1b mov %i3, %o2 #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) /* ASSERT: information->is_string */ the_object->name.name_p = name; #endif _Objects_Set_local_object( 4000f7d4: c2 17 60 0a lduh [ %i5 + 0xa ], %g1 const char *name ) { #if defined(RTEMS_SCORE_OBJECT_ENABLE_STRING_NAMES) /* ASSERT: information->is_string */ the_object->name.name_p = name; 4000f7d8: f4 27 60 0c st %i2, [ %i5 + 0xc ] * @param[in] information points to an Object Information Table * @param[in] the_object is a pointer to an object * @param[in] name is the name of the object to make accessible */ RTEMS_INLINE_ROUTINE void _Objects_Open_string( Objects_Information *information, 4000f7dc: a2 14 62 e4 or %l1, 0x2e4, %l1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4000f7e0: c4 04 60 1c ld [ %l1 + 0x1c ], %g2 4000f7e4: 83 28 60 02 sll %g1, 2, %g1 4000f7e8: fa 20 80 01 st %i5, [ %g2 + %g1 ] &_POSIX_Semaphore_Information, &the_semaphore->Object, name ); *the_sem = the_semaphore; 4000f7ec: fa 27 00 00 st %i5, [ %i4 ] return 0; } 4000f7f0: 81 c7 e0 08 ret 4000f7f4: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 4000c7b8 <_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 ]; 4000c7b8: c2 02 21 30 ld [ %o0 + 0x130 ], %g1 if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 4000c7bc: c4 00 60 f0 ld [ %g1 + 0xf0 ], %g2 4000c7c0: 80 a0 a0 00 cmp %g2, 0 4000c7c4: 12 80 00 11 bne 4000c808 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x50><== NEVER TAKEN 4000c7c8: 01 00 00 00 nop 4000c7cc: c4 00 60 f4 ld [ %g1 + 0xf4 ], %g2 4000c7d0: 80 a0 a0 01 cmp %g2, 1 4000c7d4: 12 80 00 0d bne 4000c808 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x50> 4000c7d8: 01 00 00 00 nop thread_support->cancelability_type == PTHREAD_CANCEL_ASYNCHRONOUS && 4000c7dc: c2 00 60 f8 ld [ %g1 + 0xf8 ], %g1 4000c7e0: 80 a0 60 00 cmp %g1, 0 4000c7e4: 02 80 00 09 be 4000c808 <_POSIX_Thread_Evaluate_cancellation_and_enable_dispatch+0x50> 4000c7e8: 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 disable_level = _Thread_Dispatch_disable_level; 4000c7ec: c4 01 a0 10 ld [ %g6 + 0x10 ], %g2 thread_support->cancelation_requested ) { /* FIXME: This path is broken on SMP */ _Thread_Unnest_dispatch(); /* FIXME: Cancelability state may change here */ _POSIX_Thread_Exit( the_thread, PTHREAD_CANCELED ); 4000c7f0: 92 10 3f ff mov -1, %o1 ISR_Level level; _ISR_Disable( level ); #endif --disable_level; 4000c7f4: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = disable_level; 4000c7f8: c4 21 a0 10 st %g2, [ %g6 + 0x10 ] 4000c7fc: 82 13 c0 00 mov %o7, %g1 4000c800: 40 00 01 f5 call 4000cfd4 <_POSIX_Thread_Exit> 4000c804: 9e 10 40 00 mov %g1, %o7 4000c808: 82 13 c0 00 mov %o7, %g1 4000c80c: 7f ff f5 a2 call 40009e94 <_Thread_Enable_dispatch> 4000c810: 9e 10 40 00 mov %g1, %o7 =============================================================================== 4000d958 <_POSIX_Thread_Translate_sched_param>: int policy, struct sched_param *param, Thread_CPU_budget_algorithms *budget_algorithm, Thread_CPU_budget_algorithm_callout *budget_callout ) { 4000d958: 9d e3 bf a0 save %sp, -96, %sp if ( !_POSIX_Priority_Is_valid( param->sched_priority ) ) 4000d95c: 7f ff ff f4 call 4000d92c <_POSIX_Priority_Is_valid> 4000d960: d0 06 40 00 ld [ %i1 ], %o0 4000d964: 80 a2 20 00 cmp %o0, 0 4000d968: 32 80 00 04 bne,a 4000d978 <_POSIX_Thread_Translate_sched_param+0x20><== ALWAYS TAKEN 4000d96c: c0 26 80 00 clr [ %i2 ] return EINVAL; 4000d970: 81 c7 e0 08 ret 4000d974: 91 e8 20 16 restore %g0, 0x16, %o0 *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; *budget_callout = NULL; if ( policy == SCHED_OTHER ) { 4000d978: 80 a6 20 00 cmp %i0, 0 4000d97c: 12 80 00 06 bne 4000d994 <_POSIX_Thread_Translate_sched_param+0x3c> 4000d980: c0 26 c0 00 clr [ %i3 ] *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 4000d984: 82 10 20 01 mov 1, %g1 4000d988: c2 26 80 00 st %g1, [ %i2 ] return 0; 4000d98c: 81 c7 e0 08 ret 4000d990: 81 e8 00 00 restore } if ( policy == SCHED_FIFO ) { 4000d994: 80 a6 20 01 cmp %i0, 1 4000d998: 02 80 00 29 be 4000da3c <_POSIX_Thread_Translate_sched_param+0xe4> 4000d99c: 80 a6 20 02 cmp %i0, 2 *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE; return 0; } if ( policy == SCHED_RR ) { 4000d9a0: 12 80 00 04 bne 4000d9b0 <_POSIX_Thread_Translate_sched_param+0x58> 4000d9a4: 80 a6 20 04 cmp %i0, 4 *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE; 4000d9a8: 10 80 00 25 b 4000da3c <_POSIX_Thread_Translate_sched_param+0xe4> 4000d9ac: f0 26 80 00 st %i0, [ %i2 ] return 0; } if ( policy == SCHED_SPORADIC ) { 4000d9b0: 12 bf ff f0 bne 4000d970 <_POSIX_Thread_Translate_sched_param+0x18> 4000d9b4: 01 00 00 00 nop if ( (param->sched_ss_repl_period.tv_sec == 0) && 4000d9b8: c2 06 60 08 ld [ %i1 + 8 ], %g1 4000d9bc: 80 a0 60 00 cmp %g1, 0 4000d9c0: 32 80 00 07 bne,a 4000d9dc <_POSIX_Thread_Translate_sched_param+0x84> 4000d9c4: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 4000d9c8: c2 06 60 0c ld [ %i1 + 0xc ], %g1 4000d9cc: 80 a0 60 00 cmp %g1, 0 4000d9d0: 02 bf ff e8 be 4000d970 <_POSIX_Thread_Translate_sched_param+0x18> 4000d9d4: 01 00 00 00 nop (param->sched_ss_repl_period.tv_nsec == 0) ) return EINVAL; if ( (param->sched_ss_init_budget.tv_sec == 0) && 4000d9d8: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 4000d9dc: 80 a0 60 00 cmp %g1, 0 4000d9e0: 12 80 00 06 bne 4000d9f8 <_POSIX_Thread_Translate_sched_param+0xa0> 4000d9e4: 01 00 00 00 nop 4000d9e8: c2 06 60 14 ld [ %i1 + 0x14 ], %g1 4000d9ec: 80 a0 60 00 cmp %g1, 0 4000d9f0: 02 bf ff e0 be 4000d970 <_POSIX_Thread_Translate_sched_param+0x18> 4000d9f4: 01 00 00 00 nop (param->sched_ss_init_budget.tv_nsec == 0) ) return EINVAL; if ( _Timespec_To_ticks( ¶m->sched_ss_repl_period ) < 4000d9f8: 7f ff f7 c8 call 4000b918 <_Timespec_To_ticks> 4000d9fc: 90 06 60 08 add %i1, 8, %o0 4000da00: ba 10 00 08 mov %o0, %i5 _Timespec_To_ticks( ¶m->sched_ss_init_budget ) ) 4000da04: 7f ff f7 c5 call 4000b918 <_Timespec_To_ticks> 4000da08: 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 ) < 4000da0c: 80 a7 40 08 cmp %i5, %o0 4000da10: 0a bf ff d8 bcs 4000d970 <_POSIX_Thread_Translate_sched_param+0x18> 4000da14: 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 ) ) 4000da18: 7f ff ff c5 call 4000d92c <_POSIX_Priority_Is_valid> 4000da1c: d0 06 60 04 ld [ %i1 + 4 ], %o0 4000da20: 80 a2 20 00 cmp %o0, 0 4000da24: 02 bf ff d3 be 4000d970 <_POSIX_Thread_Translate_sched_param+0x18> 4000da28: 82 10 20 03 mov 3, %g1 return EINVAL; *budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; 4000da2c: c2 26 80 00 st %g1, [ %i2 ] *budget_callout = _POSIX_Threads_Sporadic_budget_callout; 4000da30: 03 10 00 1e sethi %hi(0x40007800), %g1 4000da34: 82 10 62 d0 or %g1, 0x2d0, %g1 ! 40007ad0 <_POSIX_Threads_Sporadic_budget_callout> 4000da38: c2 26 c0 00 st %g1, [ %i3 ] return 0; } return EINVAL; } 4000da3c: 81 c7 e0 08 ret 4000da40: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 40007840 <_POSIX_Threads_Initialize_user_threads_body>: #include #include #include void _POSIX_Threads_Initialize_user_threads_body(void) { 40007840: 9d e3 bf 50 save %sp, -176, %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; 40007844: 03 10 00 7c sethi %hi(0x4001f000), %g1 40007848: 82 10 61 1c or %g1, 0x11c, %g1 ! 4001f11c maximum = Configuration_POSIX_API.number_of_initialization_threads; 4000784c: f6 00 60 2c ld [ %g1 + 0x2c ], %i3 if ( !user_threads || maximum == 0 ) 40007850: 80 a6 e0 00 cmp %i3, 0 40007854: 02 80 00 1b be 400078c0 <_POSIX_Threads_Initialize_user_threads_body+0x80><== NEVER TAKEN 40007858: fa 00 60 30 ld [ %g1 + 0x30 ], %i5 4000785c: 80 a7 60 00 cmp %i5, 0 40007860: 02 80 00 18 be 400078c0 <_POSIX_Threads_Initialize_user_threads_body+0x80><== NEVER TAKEN 40007864: b8 10 20 00 clr %i4 for ( index=0 ; index < maximum ; index++ ) { /* * There is no way for these calls to fail in this situation. */ eno = pthread_attr_init( &attr ); 40007868: 40 00 18 77 call 4000da44 4000786c: 90 07 bf b4 add %fp, -76, %o0 _Assert( eno == 0 ); eno = pthread_attr_setinheritsched( &attr, PTHREAD_EXPLICIT_SCHED ); 40007870: 92 10 20 02 mov 2, %o1 40007874: 40 00 18 80 call 4000da74 40007878: 90 07 bf b4 add %fp, -76, %o0 _Assert( eno == 0 ); eno = pthread_attr_setstacksize(&attr, user_threads[ index ].stack_size); 4000787c: d2 07 60 04 ld [ %i5 + 4 ], %o1 40007880: 40 00 18 8c call 4000dab0 40007884: 90 07 bf b4 add %fp, -76, %o0 _Assert( eno == 0 ); eno = pthread_create( 40007888: d4 07 40 00 ld [ %i5 ], %o2 4000788c: 92 07 bf b4 add %fp, -76, %o1 40007890: 90 07 bf b0 add %fp, -80, %o0 40007894: 7f ff ff 1f call 40007510 40007898: 96 10 20 00 clr %o3 &thread_id, &attr, user_threads[ index ].thread_entry, NULL ); if ( eno ) 4000789c: 92 92 20 00 orcc %o0, 0, %o1 400078a0: 22 80 00 05 be,a 400078b4 <_POSIX_Threads_Initialize_user_threads_body+0x74> 400078a4: b8 07 20 01 inc %i4 _POSIX_Fatal_error( POSIX_FD_PTHREAD, eno ); 400078a8: 40 00 04 5f call 40008a24 <_POSIX_Fatal_error> 400078ac: 90 10 20 00 clr %o0 * * Setting the attributes explicitly is critical, since we don't want * to inherit the idle tasks attributes. */ for ( index=0 ; index < maximum ; index++ ) { 400078b0: b8 07 20 01 inc %i4 <== NOT EXECUTED 400078b4: 80 a7 00 1b cmp %i4, %i3 400078b8: 12 bf ff ec bne 40007868 <_POSIX_Threads_Initialize_user_threads_body+0x28><== NEVER TAKEN 400078bc: ba 07 60 08 add %i5, 8, %i5 400078c0: 81 c7 e0 08 ret 400078c4: 81 e8 00 00 restore =============================================================================== 4000cc10 <_POSIX_Threads_Sporadic_budget_TSR>: */ void _POSIX_Threads_Sporadic_budget_TSR( Objects_Id id __attribute__((unused)), void *argument ) { 4000cc10: 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 ]; 4000cc14: fa 06 61 30 ld [ %i1 + 0x130 ], %i5 /* ticks is guaranteed to be at least one */ ticks = _Timespec_To_ticks( &api->schedparam.sched_ss_init_budget ); 4000cc18: 40 00 03 8c call 4000da48 <_Timespec_To_ticks> 4000cc1c: 90 07 60 a4 add %i5, 0xa4, %o0 */ RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( int priority ) { return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1); 4000cc20: 03 10 00 5a sethi %hi(0x40016800), %g1 4000cc24: d2 08 62 a4 ldub [ %g1 + 0x2a4 ], %o1 ! 40016aa4 4000cc28: c2 07 60 94 ld [ %i5 + 0x94 ], %g1 the_thread->cpu_time_budget = ticks; 4000cc2c: d0 26 60 74 st %o0, [ %i1 + 0x74 ] 4000cc30: 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 ( !_Thread_Owns_resources( the_thread ) ) { 4000cc34: c2 06 60 1c ld [ %i1 + 0x1c ], %g1 4000cc38: 80 a0 60 00 cmp %g1, 0 4000cc3c: 12 80 00 09 bne 4000cc60 <_POSIX_Threads_Sporadic_budget_TSR+0x50><== NEVER TAKEN 4000cc40: 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 ) { 4000cc44: c2 06 60 14 ld [ %i1 + 0x14 ], %g1 4000cc48: 80 a0 40 09 cmp %g1, %o1 4000cc4c: 08 80 00 06 bleu 4000cc64 <_POSIX_Threads_Sporadic_budget_TSR+0x54> 4000cc50: 90 07 60 9c add %i5, 0x9c, %o0 _Thread_Change_priority( the_thread, new_priority, true ); 4000cc54: 90 10 00 19 mov %i1, %o0 4000cc58: 7f ff f3 83 call 40009a64 <_Thread_Change_priority> 4000cc5c: 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 ); 4000cc60: 90 07 60 9c add %i5, 0x9c, %o0 4000cc64: 40 00 03 79 call 4000da48 <_Timespec_To_ticks> 4000cc68: 31 10 00 61 sethi %hi(0x40018400), %i0 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 4000cc6c: b0 16 20 b0 or %i0, 0xb0, %i0 ! 400184b0 <_Watchdog_Ticks_chain> Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 4000cc70: d0 27 60 c0 st %o0, [ %i5 + 0xc0 ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 4000cc74: 7f ff f8 b4 call 4000af44 <_Watchdog_Insert> 4000cc78: 93 ef 60 b4 restore %i5, 0xb4, %o1 =============================================================================== 40007ad0 <_POSIX_Threads_Sporadic_budget_callout>: ) { POSIX_API_Control *api; uint32_t new_priority; api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 40007ad0: c4 02 21 30 ld [ %o0 + 0x130 ], %g2 /* * This will prevent the thread from consuming its entire "budget" * while at low priority. */ the_thread->cpu_time_budget = UINT32_MAX; 40007ad4: 86 10 3f ff mov -1, %g3 */ RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( int priority ) { return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1); 40007ad8: c4 00 a0 98 ld [ %g2 + 0x98 ], %g2 40007adc: c6 22 20 74 st %g3, [ %o0 + 0x74 ] 40007ae0: 07 10 00 7c sethi %hi(0x4001f000), %g3 40007ae4: d2 08 e1 14 ldub [ %g3 + 0x114 ], %o1 ! 4001f114 40007ae8: 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 ( !_Thread_Owns_resources( the_thread ) ) { 40007aec: c4 02 20 1c ld [ %o0 + 0x1c ], %g2 40007af0: 80 a0 a0 00 cmp %g2, 0 40007af4: 12 80 00 09 bne 40007b18 <_POSIX_Threads_Sporadic_budget_callout+0x48><== NEVER TAKEN 40007af8: 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 ) { 40007afc: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 40007b00: 80 a0 40 09 cmp %g1, %o1 40007b04: 1a 80 00 05 bcc 40007b18 <_POSIX_Threads_Sporadic_budget_callout+0x48><== NEVER TAKEN 40007b08: 94 10 20 01 mov 1, %o2 _Thread_Change_priority( the_thread, new_priority, true ); 40007b0c: 82 13 c0 00 mov %o7, %g1 40007b10: 40 00 0a c8 call 4000a630 <_Thread_Change_priority> 40007b14: 9e 10 40 00 mov %g1, %o7 40007b18: 81 c3 e0 08 retl <== NOT EXECUTED =============================================================================== 4000cc8c <_POSIX_Threads_Terminate_extension>: } static void _POSIX_Threads_Terminate_extension( Thread_Control *executing ) { 4000cc8c: 9d e3 bf a0 save %sp, -96, %sp Thread_Control *the_thread; POSIX_API_Control *api; void **value_ptr; api = executing->API_Extensions[ THREAD_API_POSIX ]; 4000cc90: fa 06 21 30 ld [ %i0 + 0x130 ], %i5 /* * Run the POSIX cancellation handlers */ _POSIX_Threads_cancel_run( executing ); 4000cc94: 40 00 07 c0 call 4000eb94 <_POSIX_Threads_cancel_run> 4000cc98: 90 10 00 18 mov %i0, %o0 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t disable_level = _Thread_Dispatch_disable_level; 4000cc9c: c4 01 a0 10 ld [ %g6 + 0x10 ], %g2 _ISR_Disable( level ); _Profiling_Thread_dispatch_disable( _Per_CPU_Get(), disable_level ); #endif ++disable_level; 4000cca0: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = disable_level; 4000cca4: c4 21 a0 10 st %g2, [ %g6 + 0x10 ] _Thread_Disable_dispatch(); /* * Wakeup all the tasks which joined with this one */ value_ptr = (void **) executing->Wait.return_argument; 4000cca8: f6 06 20 28 ld [ %i0 + 0x28 ], %i3 while ( (the_thread = _Thread_queue_Dequeue( &api->Join_List )) ) 4000ccac: b8 07 60 50 add %i5, 0x50, %i4 4000ccb0: 7f ff f5 3b call 4000a19c <_Thread_queue_Dequeue> 4000ccb4: 90 10 00 1c mov %i4, %o0 4000ccb8: 80 a2 20 00 cmp %o0, 0 4000ccbc: 22 80 00 05 be,a 4000ccd0 <_POSIX_Threads_Terminate_extension+0x44><== ALWAYS TAKEN 4000ccc0: c2 07 60 90 ld [ %i5 + 0x90 ], %g1 *(void **)the_thread->Wait.return_argument = value_ptr; 4000ccc4: c2 02 20 28 ld [ %o0 + 0x28 ], %g1 <== NOT EXECUTED 4000ccc8: 10 bf ff fa b 4000ccb0 <_POSIX_Threads_Terminate_extension+0x24><== NOT EXECUTED 4000cccc: f6 20 40 00 st %i3, [ %g1 ] <== NOT EXECUTED if ( api->schedpolicy == SCHED_SPORADIC ) 4000ccd0: 80 a0 60 04 cmp %g1, 4 4000ccd4: 12 80 00 04 bne 4000cce4 <_POSIX_Threads_Terminate_extension+0x58> 4000ccd8: 01 00 00 00 nop (void) _Watchdog_Remove( &api->Sporadic_timer ); 4000ccdc: 7f ff f8 ef call 4000b098 <_Watchdog_Remove> 4000cce0: 90 07 60 b4 add %i5, 0xb4, %o0 _Thread_Enable_dispatch(); 4000cce4: 7f ff f4 4d call 40009e18 <_Thread_Enable_dispatch> 4000cce8: 81 e8 00 00 restore =============================================================================== 40007348 <_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) { 40007348: 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; 4000734c: c2 06 60 68 ld [ %i1 + 0x68 ], %g1 40007350: 82 00 60 01 inc %g1 40007354: c2 26 60 68 st %g1, [ %i1 + 0x68 ] /* The timer must be reprogrammed */ if ( ( ptimer->timer_data.it_interval.tv_sec != 0 ) || 40007358: c2 06 60 54 ld [ %i1 + 0x54 ], %g1 4000735c: 80 a0 60 00 cmp %g1, 0 40007360: 32 80 00 07 bne,a 4000737c <_POSIX_Timer_TSR+0x34> 40007364: d2 06 60 64 ld [ %i1 + 0x64 ], %o1 40007368: c2 06 60 58 ld [ %i1 + 0x58 ], %g1 4000736c: 80 a0 60 00 cmp %g1, 0 40007370: 02 80 00 1f be 400073ec <_POSIX_Timer_TSR+0xa4> <== NEVER TAKEN 40007374: 82 10 20 04 mov 4, %g1 ( ptimer->timer_data.it_interval.tv_nsec != 0 ) ) { activated = _POSIX_Timer_Insert_helper( 40007378: d2 06 60 64 ld [ %i1 + 0x64 ], %o1 4000737c: d4 06 60 08 ld [ %i1 + 8 ], %o2 40007380: 90 06 60 10 add %i1, 0x10, %o0 40007384: 17 10 00 1c sethi %hi(0x40007000), %o3 40007388: 98 10 00 19 mov %i1, %o4 4000738c: 40 00 18 9c call 4000d5fc <_POSIX_Timer_Insert_helper> 40007390: 96 12 e3 48 or %o3, 0x348, %o3 ptimer->ticks, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) 40007394: 80 a2 20 00 cmp %o0, 0 40007398: 02 80 00 1a be 40007400 <_POSIX_Timer_TSR+0xb8> <== NEVER TAKEN 4000739c: 90 07 bf f8 add %fp, -8, %o0 tod_as_timestamp_ptr = 400073a0: 13 10 00 67 sethi %hi(0x40019c00), %o1 400073a4: 40 00 05 b7 call 40008a80 <_TOD_Get_with_nanoseconds> 400073a8: 92 12 61 40 or %o1, 0x140, %o1 ! 40019d40 <_TOD> static inline void _TOD_Get( struct timespec *tod_as_timespec ) { Timestamp_Control tod_as_timestamp; Timestamp_Control *tod_as_timestamp_ptr; 400073ac: 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); 400073b0: 94 10 20 00 clr %o2 400073b4: 90 10 00 1c mov %i4, %o0 400073b8: 92 10 00 1d mov %i5, %o1 400073bc: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 400073c0: 40 00 36 0e call 40014bf8 <__divdi3> 400073c4: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 400073c8: 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); 400073cc: d2 26 60 6c st %o1, [ %i1 + 0x6c ] _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 400073d0: 94 10 20 00 clr %o2 400073d4: 92 10 00 1d mov %i5, %o1 400073d8: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 400073dc: 40 00 36 f9 call 40014fc0 <__moddi3> 400073e0: 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; 400073e4: 82 10 20 03 mov 3, %g1 400073e8: 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 ) ) { 400073ec: d0 06 60 38 ld [ %i1 + 0x38 ], %o0 400073f0: d2 06 60 44 ld [ %i1 + 0x44 ], %o1 400073f4: 40 00 17 97 call 4000d250 400073f8: 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; 400073fc: c0 26 60 68 clr [ %i1 + 0x68 ] 40007400: 81 c7 e0 08 ret 40007404: 81 e8 00 00 restore =============================================================================== 4000ca1c <_POSIX_signals_Action_handler>: Thread_Control *executing, Thread_Action *action, Per_CPU_Control *cpu, ISR_Level level ) { 4000ca1c: 9d e3 bf a0 save %sp, -96, %sp RTEMS_INLINE_ROUTINE void _Thread_Action_release_and_ISR_enable( Per_CPU_Control *cpu, ISR_Level level ) { _Per_CPU_Release_and_ISR_enable( cpu, level ); 4000ca20: 7f ff d6 88 call 40002440 4000ca24: 90 10 00 1b mov %i3, %o0 int hold_errno; (void) action; _Thread_Action_release_and_ISR_enable( cpu, level ); api = executing->API_Extensions[ THREAD_API_POSIX ]; 4000ca28: fa 06 21 30 ld [ %i0 + 0x130 ], %i5 hold_errno = executing->Wait.return_code; /* * api may be NULL in case of a thread close in progress */ if ( !api ) 4000ca2c: 80 a7 60 00 cmp %i5, 0 4000ca30: 02 80 00 0f be 4000ca6c <_POSIX_signals_Action_handler+0x50><== NEVER TAKEN 4000ca34: f6 06 20 34 ld [ %i0 + 0x34 ], %i3 * processed at all. No point in doing this loop otherwise. */ while (1) { _POSIX_signals_Acquire( &lock_context ); if ( !(~api->signals_blocked & (api->signals_pending | _POSIX_signals_Pending)) ) { 4000ca38: 35 10 00 63 sethi %hi(0x40018c00), %i2 { #if defined( RTEMS_SMP ) _SMP_lock_ISR_disable_and_acquire( &lock->lock, &context->lock_context ); #else (void) lock; _ISR_Disable( context->isr_level ); 4000ca3c: 7f ff d6 7e call 40002434 4000ca40: 01 00 00 00 nop 4000ca44: c4 06 a2 f4 ld [ %i2 + 0x2f4 ], %g2 4000ca48: c2 07 60 e0 ld [ %i5 + 0xe0 ], %g1 4000ca4c: 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) { _POSIX_signals_Acquire( &lock_context ); if ( !(~api->signals_blocked & 4000ca50: c4 07 60 dc ld [ %i5 + 0xdc ], %g2 4000ca54: 80 a8 40 02 andncc %g1, %g2, %g0 4000ca58: 12 80 00 07 bne 4000ca74 <_POSIX_signals_Action_handler+0x58> 4000ca5c: 01 00 00 00 nop { #if defined( RTEMS_SMP ) _SMP_lock_Release_and_ISR_enable( &lock->lock, &context->lock_context ); #else (void) lock; _ISR_Enable( context->isr_level ); 4000ca60: 7f ff d6 78 call 40002440 4000ca64: 01 00 00 00 nop _POSIX_signals_Check_signal( api, signo, false ); _POSIX_signals_Check_signal( api, signo, true ); } } executing->Wait.return_code = hold_errno; 4000ca68: f6 26 20 34 st %i3, [ %i0 + 0x34 ] 4000ca6c: 81 c7 e0 08 ret 4000ca70: 81 e8 00 00 restore 4000ca74: 7f ff d6 73 call 40002440 4000ca78: b8 10 20 1b mov 0x1b, %i4 break; } _POSIX_signals_Release( &lock_context ); for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { _POSIX_signals_Check_signal( api, signo, false ); 4000ca7c: 92 10 00 1c mov %i4, %o1 4000ca80: 94 10 20 00 clr %o2 4000ca84: 40 00 08 83 call 4000ec90 <_POSIX_signals_Check_signal> 4000ca88: 90 10 00 1d mov %i5, %o0 _POSIX_signals_Check_signal( api, signo, true ); 4000ca8c: 92 10 00 1c mov %i4, %o1 4000ca90: 90 10 00 1d mov %i5, %o0 4000ca94: 40 00 08 7f call 4000ec90 <_POSIX_signals_Check_signal> 4000ca98: 94 10 20 01 mov 1, %o2 _POSIX_signals_Release( &lock_context ); break; } _POSIX_signals_Release( &lock_context ); for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 4000ca9c: b8 07 20 01 inc %i4 4000caa0: 80 a7 20 20 cmp %i4, 0x20 4000caa4: 12 bf ff f7 bne 4000ca80 <_POSIX_signals_Action_handler+0x64> 4000caa8: 92 10 00 1c mov %i4, %o1 4000caac: 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 ); 4000cab0: 92 10 00 1c mov %i4, %o1 4000cab4: 94 10 20 00 clr %o2 4000cab8: 40 00 08 76 call 4000ec90 <_POSIX_signals_Check_signal> 4000cabc: 90 10 00 1d mov %i5, %o0 _POSIX_signals_Check_signal( api, signo, true ); 4000cac0: 92 10 00 1c mov %i4, %o1 4000cac4: 90 10 00 1d mov %i5, %o0 4000cac8: 40 00 08 72 call 4000ec90 <_POSIX_signals_Check_signal> 4000cacc: 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++ ) { 4000cad0: b8 07 20 01 inc %i4 4000cad4: 80 a7 20 1b cmp %i4, 0x1b 4000cad8: 12 bf ff f7 bne 4000cab4 <_POSIX_signals_Action_handler+0x98> 4000cadc: 92 10 00 1c mov %i4, %o1 4000cae0: 30 bf ff d7 b,a 4000ca3c <_POSIX_signals_Action_handler+0x20> =============================================================================== 4000ec90 <_POSIX_signals_Check_signal>: bool _POSIX_signals_Check_signal( POSIX_API_Control *api, int signo, bool is_global ) { 4000ec90: 9d e3 bf 68 save %sp, -152, %sp siginfo_t siginfo_struct; sigset_t saved_signals_blocked; Thread_Wait_information stored_thread_wait_information; Thread_Control *executing; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, 4000ec94: 98 10 20 01 mov 1, %o4 4000ec98: 90 10 00 18 mov %i0, %o0 4000ec9c: 92 10 00 19 mov %i1, %o1 4000eca0: 94 07 bf cc add %fp, -52, %o2 4000eca4: 96 10 00 1a mov %i2, %o3 4000eca8: 40 00 00 2d call 4000ed5c <_POSIX_signals_Clear_signals> 4000ecac: 9a 10 20 01 mov 1, %o5 4000ecb0: 80 a2 20 00 cmp %o0, 0 4000ecb4: 02 80 00 27 be 4000ed50 <_POSIX_signals_Check_signal+0xc0> 4000ecb8: b8 10 00 08 mov %o0, %i4 #endif /* * Just to prevent sending a signal which is currently being ignored. */ if ( _POSIX_signals_Vectors[ signo ].sa_handler == SIG_IGN ) 4000ecbc: 83 2e 60 04 sll %i1, 4, %g1 4000ecc0: 23 10 00 63 sethi %hi(0x40018c00), %l1 4000ecc4: a1 2e 60 02 sll %i1, 2, %l0 4000ecc8: a2 14 61 28 or %l1, 0x128, %l1 4000eccc: a0 20 40 10 sub %g1, %l0, %l0 4000ecd0: 82 04 40 10 add %l1, %l0, %g1 4000ecd4: fa 00 60 08 ld [ %g1 + 8 ], %i5 4000ecd8: 80 a7 60 01 cmp %i5, 1 4000ecdc: 02 80 00 1c be 4000ed4c <_POSIX_signals_Check_signal+0xbc><== NEVER TAKEN 4000ece0: 90 07 bf d8 add %fp, -40, %o0 return false; /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; 4000ece4: f6 06 20 dc ld [ %i0 + 0xdc ], %i3 api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; 4000ece8: c2 00 60 04 ld [ %g1 + 4 ], %g1 /* * 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, &executing->Wait, 4000ecec: f4 01 a0 18 ld [ %g6 + 0x18 ], %i2 /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; 4000ecf0: 82 10 40 1b or %g1, %i3, %g1 /* * 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, &executing->Wait, 4000ecf4: b4 06 a0 20 add %i2, 0x20, %i2 /* * Block the signals requested in sa_mask */ saved_signals_blocked = api->signals_blocked; api->signals_blocked |= _POSIX_signals_Vectors[ signo ].sa_mask; 4000ecf8: c2 26 20 dc st %g1, [ %i0 + 0xdc ] /* * 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, &executing->Wait, 4000ecfc: 92 10 00 1a mov %i2, %o1 4000ed00: 40 00 05 2e call 400101b8 4000ed04: 94 10 20 28 mov 0x28, %o2 sizeof( stored_thread_wait_information )); /* * Here, the signal handler function executes */ switch ( _POSIX_signals_Vectors[ signo ].sa_flags ) { 4000ed08: c2 04 40 10 ld [ %l1 + %l0 ], %g1 4000ed0c: 80 a0 60 02 cmp %g1, 2 4000ed10: 12 80 00 07 bne 4000ed2c <_POSIX_signals_Check_signal+0x9c> 4000ed14: 90 10 00 19 mov %i1, %o0 case SA_SIGINFO: (*_POSIX_signals_Vectors[ signo ].sa_sigaction)( 4000ed18: 92 07 bf cc add %fp, -52, %o1 4000ed1c: 9f c7 40 00 call %i5 4000ed20: 94 10 20 00 clr %o2 signo, &siginfo_struct, NULL /* context is undefined per 1003.1b-1993, p. 66 */ ); break; 4000ed24: 10 80 00 05 b 4000ed38 <_POSIX_signals_Check_signal+0xa8> 4000ed28: 90 10 00 1a mov %i2, %o0 default: (*_POSIX_signals_Vectors[ signo ].sa_handler)( signo ); 4000ed2c: 9f c7 40 00 call %i5 4000ed30: 01 00 00 00 nop } /* * Restore the blocking information */ memcpy( &executing->Wait, &stored_thread_wait_information, 4000ed34: 90 10 00 1a mov %i2, %o0 4000ed38: 92 07 bf d8 add %fp, -40, %o1 4000ed3c: 40 00 05 1f call 400101b8 4000ed40: 94 10 20 28 mov 0x28, %o2 /* * Restore the previous set of blocked signals */ api->signals_blocked = saved_signals_blocked; return true; 4000ed44: 10 80 00 03 b 4000ed50 <_POSIX_signals_Check_signal+0xc0> 4000ed48: f6 26 20 dc st %i3, [ %i0 + 0xdc ] Thread_Wait_information stored_thread_wait_information; Thread_Control *executing; if ( ! _POSIX_signals_Clear_signals( api, signo, &siginfo_struct, is_global, true, true ) ) return false; 4000ed4c: b8 10 20 00 clr %i4 <== NOT EXECUTED * Restore the previous set of blocked signals */ api->signals_blocked = saved_signals_blocked; return true; } 4000ed50: b0 0f 20 ff and %i4, 0xff, %i0 4000ed54: 81 c7 e0 08 ret 4000ed58: 81 e8 00 00 restore =============================================================================== 4000f920 <_POSIX_signals_Clear_process_signals>: 4000f920: 82 02 3f ff add %o0, -1, %g1 4000f924: 84 10 20 01 mov 1, %g2 4000f928: 85 28 80 01 sll %g2, %g1, %g2 _Assert( _ISR_Get_level() != 0 ); clear_signal = true; mask = signo_to_mask( signo ); if ( _POSIX_signals_Vectors[ signo ].sa_flags == SA_SIGINFO ) { 4000f92c: 83 2a 20 02 sll %o0, 2, %g1 4000f930: 91 2a 20 04 sll %o0, 4, %o0 4000f934: 90 22 00 01 sub %o0, %g1, %o0 4000f938: 03 10 00 63 sethi %hi(0x40018c00), %g1 4000f93c: 82 10 61 28 or %g1, 0x128, %g1 ! 40018d28 <_POSIX_signals_Vectors> 4000f940: c2 00 40 08 ld [ %g1 + %o0 ], %g1 4000f944: 80 a0 60 02 cmp %g1, 2 4000f948: 12 80 00 0a bne 4000f970 <_POSIX_signals_Clear_process_signals+0x50> 4000f94c: 03 10 00 63 sethi %hi(0x40018c00), %g1 if ( !_Chain_Is_empty( &_POSIX_signals_Siginfo[ signo ] ) ) 4000f950: 03 10 00 63 sethi %hi(0x40018c00), %g1 4000f954: 82 10 62 f8 or %g1, 0x2f8, %g1 ! 40018ef8 <_POSIX_signals_Siginfo> 4000f958: 86 02 00 01 add %o0, %g1, %g3 4000f95c: c2 02 00 01 ld [ %o0 + %g1 ], %g1 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 4000f960: 86 00 e0 04 add %g3, 4, %g3 4000f964: 80 a0 40 03 cmp %g1, %g3 4000f968: 12 80 00 05 bne 4000f97c <_POSIX_signals_Clear_process_signals+0x5c><== NEVER TAKEN 4000f96c: 03 10 00 63 sethi %hi(0x40018c00), %g1 clear_signal = false; } if ( clear_signal ) { _POSIX_signals_Pending &= ~mask; 4000f970: c6 00 62 f4 ld [ %g1 + 0x2f4 ], %g3 ! 40018ef4 <_POSIX_signals_Pending> 4000f974: 84 28 c0 02 andn %g3, %g2, %g2 4000f978: c4 20 62 f4 st %g2, [ %g1 + 0x2f4 ] 4000f97c: 81 c3 e0 08 retl =============================================================================== 4000818c <_POSIX_signals_Get_lowest>: sigset_t set ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 4000818c: 82 10 20 1b mov 0x1b, %g1 40008190: 84 10 20 01 mov 1, %g2 40008194: 86 00 7f ff add %g1, -1, %g3 40008198: 87 28 80 03 sll %g2, %g3, %g3 if ( set & signo_to_mask( signo ) ) { 4000819c: 80 88 c0 08 btst %g3, %o0 400081a0: 12 80 00 11 bne 400081e4 <_POSIX_signals_Get_lowest+0x58> <== NEVER TAKEN 400081a4: 01 00 00 00 nop sigset_t set ) { int signo; for ( signo = SIGRTMIN ; signo <= SIGRTMAX ; signo++ ) { 400081a8: 82 00 60 01 inc %g1 400081ac: 80 a0 60 20 cmp %g1, 0x20 400081b0: 12 bf ff fa bne 40008198 <_POSIX_signals_Get_lowest+0xc> 400081b4: 86 00 7f ff add %g1, -1, %g3 400081b8: 82 10 20 01 mov 1, %g1 400081bc: 84 10 20 01 mov 1, %g2 400081c0: 86 00 7f ff add %g1, -1, %g3 400081c4: 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 ) ) { 400081c8: 80 88 c0 08 btst %g3, %o0 400081cc: 12 80 00 06 bne 400081e4 <_POSIX_signals_Get_lowest+0x58> 400081d0: 01 00 00 00 nop */ #if (SIGHUP != 1) #error "Assumption that SIGHUP==1 violated!!" #endif for ( signo = SIGHUP ; signo <= __SIGLASTNOTRT ; signo++ ) { 400081d4: 82 00 60 01 inc %g1 400081d8: 80 a0 60 1b cmp %g1, 0x1b 400081dc: 12 bf ff fa bne 400081c4 <_POSIX_signals_Get_lowest+0x38> <== ALWAYS TAKEN 400081e0: 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; } 400081e4: 81 c3 e0 08 retl 400081e8: 90 10 00 01 mov %g1, %o0 =============================================================================== 4002985c <_POSIX_signals_Unblock_thread>: bool _POSIX_signals_Unblock_thread( Thread_Control *the_thread, int signo, siginfo_t *info ) { 4002985c: 9d e3 bf a0 save %sp, -96, %sp ISR_Level *level ) { Per_CPU_Control *cpu; _ISR_Disable_without_giant( *level ); 40029860: 7f ff 64 3d call 40002954 40029864: fa 06 21 30 ld [ %i0 + 0x130 ], %i5 RTEMS_INLINE_ROUTINE void _Chain_Append_if_is_off_chain_unprotected( Chain_Control *the_chain, Chain_Node *the_node ) { if ( _Chain_Is_node_off_chain( the_node ) ) { 40029868: c2 07 60 e4 ld [ %i5 + 0xe4 ], %g1 4002986c: 80 a0 60 00 cmp %g1, 0 40029870: 12 80 00 08 bne 40029890 <_POSIX_signals_Unblock_thread+0x34> 40029874: 86 06 20 c8 add %i0, 0xc8, %g3 Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; 40029878: c2 06 20 cc ld [ %i0 + 0xcc ], %g1 the_node->next = tail; 4002987c: c6 27 60 e4 st %g3, [ %i5 + 0xe4 ] { Per_CPU_Control *cpu; ISR_Level level; cpu = _Thread_Action_ISR_disable_and_acquire( thread, &level ); _Chain_Append_if_is_off_chain_unprotected( 40029880: 84 07 60 e4 add %i5, 0xe4, %g2 tail->previous = the_node; 40029884: c4 26 20 cc st %g2, [ %i0 + 0xcc ] old_last->next = the_node; 40029888: c4 20 40 00 st %g2, [ %g1 ] the_node->previous = old_last; 4002988c: c2 27 60 e8 st %g1, [ %i5 + 0xe8 ] RTEMS_INLINE_ROUTINE void _Thread_Action_release_and_ISR_enable( Per_CPU_Control *cpu, ISR_Level level ) { _Per_CPU_Release_and_ISR_enable( cpu, level ); 40029890: 7f ff 64 34 call 40002960 40029894: 01 00 00 00 nop /* * Is the thread is specifically waiting for a signal? */ if ( _States_Is_interruptible_signal( the_thread->current_state ) ) { 40029898: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 4002989c: 09 04 00 20 sethi %hi(0x10008000), %g4 400298a0: 84 06 7f ff add %i1, -1, %g2 400298a4: 86 10 20 01 mov 1, %g3 400298a8: b8 08 40 04 and %g1, %g4, %i4 400298ac: 80 a7 00 04 cmp %i4, %g4 400298b0: 12 80 00 1c bne 40029920 <_POSIX_signals_Unblock_thread+0xc4> 400298b4: 85 28 c0 02 sll %g3, %g2, %g2 if ( (the_thread->Wait.option & mask) || (~api->signals_blocked & mask) ) { 400298b8: c2 06 20 30 ld [ %i0 + 0x30 ], %g1 400298bc: 80 88 80 01 btst %g2, %g1 400298c0: 12 80 00 06 bne 400298d8 <_POSIX_signals_Unblock_thread+0x7c> 400298c4: 82 10 20 04 mov 4, %g1 400298c8: c2 07 60 dc ld [ %i5 + 0xdc ], %g1 400298cc: 80 a8 80 01 andncc %g2, %g1, %g0 400298d0: 02 80 00 3a be 400299b8 <_POSIX_signals_Unblock_thread+0x15c> 400298d4: 82 10 20 04 mov 4, %g1 the_thread->Wait.return_code = EINTR; 400298d8: c2 26 20 34 st %g1, [ %i0 + 0x34 ] the_info = (siginfo_t *) the_thread->Wait.return_argument; if ( !info ) { 400298dc: 80 a6 a0 00 cmp %i2, 0 400298e0: 12 80 00 07 bne 400298fc <_POSIX_signals_Unblock_thread+0xa0> 400298e4: d0 06 20 28 ld [ %i0 + 0x28 ], %o0 the_info->si_signo = signo; the_info->si_code = SI_USER; 400298e8: 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; 400298ec: f2 22 00 00 st %i1, [ %o0 ] the_info->si_code = SI_USER; 400298f0: c2 22 20 04 st %g1, [ %o0 + 4 ] 400298f4: 10 80 00 05 b 40029908 <_POSIX_signals_Unblock_thread+0xac> 400298f8: c0 22 20 08 clr [ %o0 + 8 ] the_info->si_value.sival_int = 0; } else { *the_info = *info; 400298fc: 92 10 00 1a mov %i2, %o1 40029900: 7f ff bf 39 call 400195e4 40029904: 94 10 20 0c mov 0xc, %o2 } _Thread_queue_Extract_with_proxy( the_thread ); 40029908: 90 10 00 18 mov %i0, %o0 4002990c: 7f ff ac bf call 40014c08 <_Thread_queue_Extract_with_proxy> 40029910: b0 10 20 01 mov 1, %i0 40029914: b0 0e 20 01 and %i0, 1, %i0 40029918: 81 c7 e0 08 ret 4002991c: 81 e8 00 00 restore } /* * Thread is not waiting due to a sigwait. */ if ( ~api->signals_blocked & mask ) { 40029920: c8 07 60 dc ld [ %i5 + 0xdc ], %g4 40029924: 80 a8 80 04 andncc %g2, %g4, %g0 40029928: 02 80 00 24 be 400299b8 <_POSIX_signals_Unblock_thread+0x15c> 4002992c: 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 ) ) { 40029930: 80 88 40 02 btst %g1, %g2 40029934: 02 80 00 17 be 40029990 <_POSIX_signals_Unblock_thread+0x134> 40029938: 80 a0 60 00 cmp %g1, 0 the_thread->Wait.return_code = EINTR; 4002993c: 84 10 20 04 mov 4, %g2 40029940: 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) ) 40029944: 05 00 02 ef sethi %hi(0xbbc00), %g2 40029948: 84 10 a2 e0 or %g2, 0x2e0, %g2 ! bbee0 <_TLS_Alignment+0xbbedf> 4002994c: 80 88 40 02 btst %g1, %g2 40029950: 02 80 00 06 be 40029968 <_POSIX_signals_Unblock_thread+0x10c> 40029954: 80 88 60 08 btst 8, %g1 _Thread_queue_Extract_with_proxy( the_thread ); 40029958: 7f ff ac ac call 40014c08 <_Thread_queue_Extract_with_proxy> 4002995c: 90 10 00 18 mov %i0, %o0 } else if ( the_thread->current_state == STATES_READY ) { _Thread_Signal_notification( the_thread ); } } return false; 40029960: 10 80 00 17 b 400299bc <_POSIX_signals_Unblock_thread+0x160> 40029964: 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) ) { 40029968: 22 80 00 15 be,a 400299bc <_POSIX_signals_Unblock_thread+0x160><== NEVER TAKEN 4002996c: b0 10 20 00 clr %i0 <== NOT EXECUTED (void) _Watchdog_Remove( &the_thread->Timer ); 40029970: 7f ff 96 de call 4000f4e8 <_Watchdog_Remove> 40029974: 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 ); 40029978: 90 10 00 18 mov %i0, %o0 4002997c: 13 04 03 ff sethi %hi(0x100ffc00), %o1 40029980: 7f ff 91 64 call 4000df10 <_Thread_Clear_state> 40029984: 92 12 63 f8 or %o1, 0x3f8, %o1 ! 100ffff8 } else if ( the_thread->current_state == STATES_READY ) { _Thread_Signal_notification( the_thread ); } } return false; 40029988: 10 80 00 0d b 400299bc <_POSIX_signals_Unblock_thread+0x160> 4002998c: 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 ) { 40029990: 32 80 00 0b bne,a 400299bc <_POSIX_signals_Unblock_thread+0x160><== NEVER TAKEN 40029994: b0 10 20 00 clr %i0 <== NOT EXECUTED #endif } RTEMS_INLINE_ROUTINE void _Thread_Signal_notification( Thread_Control *thread ) { if ( _ISR_Is_in_progress() && _Thread_Is_executing( thread ) ) { 40029998: c4 01 a0 0c ld [ %g6 + 0xc ], %g2 4002999c: 80 a0 a0 00 cmp %g2, 0 400299a0: 22 80 00 07 be,a 400299bc <_POSIX_signals_Unblock_thread+0x160> 400299a4: b0 10 20 00 clr %i0 400299a8: c4 01 a0 18 ld [ %g6 + 0x18 ], %g2 400299ac: 80 a6 00 02 cmp %i0, %g2 400299b0: 22 80 00 02 be,a 400299b8 <_POSIX_signals_Unblock_thread+0x15c><== ALWAYS TAKEN 400299b4: c6 29 a0 14 stb %g3, [ %g6 + 0x14 ] _Thread_Signal_notification( the_thread ); } } return false; 400299b8: b0 10 20 00 clr %i0 } 400299bc: b0 0e 20 01 and %i0, 1, %i0 400299c0: 81 c7 e0 08 ret 400299c4: 81 e8 00 00 restore =============================================================================== 4000b010 <_RBTree_Initialize>: void *starting_address, size_t number_nodes, size_t node_size, bool is_unique ) { 4000b010: 9d e3 bf a0 save %sp, -96, %sp size_t count; RBTree_Node *next; /* TODO: Error message? */ if (!the_rbtree) return; 4000b014: 80 a6 20 00 cmp %i0, 0 4000b018: 02 80 00 10 be 4000b058 <_RBTree_Initialize+0x48> <== NEVER TAKEN 4000b01c: 01 00 00 00 nop RBTree_Control *the_rbtree, RBTree_Compare_function compare_function, bool is_unique ) { the_rbtree->permanent_null = NULL; 4000b020: c0 26 00 00 clr [ %i0 ] the_rbtree->root = NULL; 4000b024: c0 26 20 04 clr [ %i0 + 4 ] the_rbtree->first[0] = NULL; 4000b028: c0 26 20 08 clr [ %i0 + 8 ] the_rbtree->first[1] = NULL; 4000b02c: c0 26 20 0c clr [ %i0 + 0xc ] the_rbtree->compare_function = compare_function; 4000b030: f2 26 20 10 st %i1, [ %i0 + 0x10 ] the_rbtree->is_unique = is_unique; 4000b034: fa 2e 20 14 stb %i5, [ %i0 + 0x14 ] /* could do sanity checks here */ _RBTree_Initialize_empty(the_rbtree, compare_function, is_unique); count = number_nodes; next = starting_address; while ( count-- ) { 4000b038: 80 a6 e0 00 cmp %i3, 0 4000b03c: 02 80 00 07 be 4000b058 <_RBTree_Initialize+0x48> 4000b040: 92 10 00 1a mov %i2, %o1 _RBTree_Insert(the_rbtree, next); 4000b044: 90 10 00 18 mov %i0, %o0 4000b048: 7f ff ff 44 call 4000ad58 <_RBTree_Insert> 4000b04c: b4 06 80 1c add %i2, %i4, %i2 4000b050: 10 bf ff fa b 4000b038 <_RBTree_Initialize+0x28> 4000b054: b6 06 ff ff add %i3, -1, %i3 4000b058: 81 c7 e0 08 ret 4000b05c: 81 e8 00 00 restore =============================================================================== 40007e74 <_RBTree_Insert>: */ RBTree_Node *_RBTree_Insert( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { 40007e74: 9d e3 bf a0 save %sp, -96, %sp if(!the_node) return (RBTree_Node*)-1; 40007e78: 80 a6 60 00 cmp %i1, 0 40007e7c: 02 80 00 80 be 4000807c <_RBTree_Insert+0x208> 40007e80: 01 00 00 00 nop RBTree_Node *iter_node = the_rbtree->root; 40007e84: fa 06 20 04 ld [ %i0 + 4 ], %i5 int compare_result; if (!iter_node) { /* special case: first node inserted */ 40007e88: 80 a7 60 00 cmp %i5, 0 40007e8c: 32 80 00 16 bne,a 40007ee4 <_RBTree_Insert+0x70> 40007e90: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 the_node->color = RBT_BLACK; 40007e94: c0 26 60 0c clr [ %i1 + 0xc ] the_rbtree->root = the_node; 40007e98: f2 26 20 04 st %i1, [ %i0 + 4 ] the_rbtree->first[0] = the_rbtree->first[1] = the_node; 40007e9c: f2 26 20 0c st %i1, [ %i0 + 0xc ] 40007ea0: f2 26 20 08 st %i1, [ %i0 + 8 ] the_node->parent = (RBTree_Node *) the_rbtree; 40007ea4: f0 26 40 00 st %i0, [ %i1 ] the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; 40007ea8: c0 26 60 08 clr [ %i1 + 8 ] 40007eac: c0 26 60 04 clr [ %i1 + 4 ] 40007eb0: 81 c7 e0 08 ret 40007eb4: 91 e8 20 00 restore %g0, 0, %o0 } 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); if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) 40007eb8: 02 80 00 73 be 40008084 <_RBTree_Insert+0x210> 40007ebc: b8 38 00 08 xnor %g0, %o0, %i4 return iter_node; RBTree_Direction dir = !_RBTree_Is_lesser( compare_result ); 40007ec0: b9 37 20 1f srl %i4, 0x1f, %i4 if (!iter_node->child[dir]) { 40007ec4: 83 2f 20 02 sll %i4, 2, %g1 40007ec8: 84 07 40 01 add %i5, %g1, %g2 40007ecc: c6 00 a0 04 ld [ %g2 + 4 ], %g3 40007ed0: 80 a0 e0 00 cmp %g3, 0 40007ed4: 22 80 00 0d be,a 40007f08 <_RBTree_Insert+0x94> 40007ed8: c0 26 60 08 clr [ %i1 + 8 ] (dir && _RBTree_Is_greater(compare_result)) ) { the_rbtree->first[dir] = the_node; } break; } else { iter_node = iter_node->child[dir]; 40007edc: ba 10 00 03 mov %g3, %i5 the_node->parent = (RBTree_Node *) the_rbtree; the_node->child[RBT_LEFT] = the_node->child[RBT_RIGHT] = NULL; } 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); 40007ee0: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 40007ee4: 90 10 00 19 mov %i1, %o0 40007ee8: 9f c0 40 00 call %g1 40007eec: 92 10 00 1d mov %i5, %o1 if ( the_rbtree->is_unique && _RBTree_Is_equal( compare_result ) ) 40007ef0: c2 0e 20 14 ldub [ %i0 + 0x14 ], %g1 40007ef4: 80 a0 60 00 cmp %g1, 0 40007ef8: 22 bf ff f2 be,a 40007ec0 <_RBTree_Insert+0x4c> 40007efc: b8 38 00 08 xnor %g0, %o0, %i4 40007f00: 10 bf ff ee b 40007eb8 <_RBTree_Insert+0x44> 40007f04: 80 a2 20 00 cmp %o0, 0 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; 40007f08: c0 26 60 04 clr [ %i1 + 4 ] the_node->color = RBT_RED; 40007f0c: 86 10 20 01 mov 1, %g3 40007f10: c6 26 60 0c st %g3, [ %i1 + 0xc ] iter_node->child[dir] = the_node; 40007f14: f2 20 a0 04 st %i1, [ %g2 + 4 ] the_node->parent = iter_node; 40007f18: fa 26 40 00 st %i5, [ %i1 ] 40007f1c: ba 06 00 01 add %i0, %g1, %i5 /* update min/max */ compare_result = the_rbtree->compare_function( 40007f20: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 40007f24: d2 07 60 08 ld [ %i5 + 8 ], %o1 40007f28: 9f c0 40 00 call %g1 40007f2c: 90 10 00 19 mov %i1, %o0 the_node, _RBTree_First(the_rbtree, dir) ); if ( (!dir && _RBTree_Is_lesser(compare_result)) || 40007f30: 80 a7 20 00 cmp %i4, 0 40007f34: 12 80 00 06 bne 40007f4c <_RBTree_Insert+0xd8> 40007f38: 80 a2 20 00 cmp %o0, 0 40007f3c: 36 80 00 1e bge,a 40007fb4 <_RBTree_Insert+0x140> 40007f40: d0 06 40 00 ld [ %i1 ], %o0 (dir && _RBTree_Is_greater(compare_result)) ) { the_rbtree->first[dir] = the_node; 40007f44: 10 80 00 1b b 40007fb0 <_RBTree_Insert+0x13c> 40007f48: f2 27 60 08 st %i1, [ %i5 + 8 ] 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)) ) { 40007f4c: 34 80 00 19 bg,a 40007fb0 <_RBTree_Insert+0x13c> 40007f50: f2 27 60 08 st %i1, [ %i5 + 8 ] * * @note It does NOT disable interrupts to ensure the atomicity of the * append operation. */ static void _RBTree_Validate_insert( RBTree_Node *the_node 40007f54: 10 80 00 18 b 40007fb4 <_RBTree_Insert+0x140> 40007f58: d0 06 40 00 ld [ %i1 ], %o0 */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 40007f5c: 82 18 60 01 xor %g1, 1, %g1 40007f60: 80 a0 00 01 cmp %g0, %g1 40007f64: 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))) { 40007f68: 80 a0 60 00 cmp %g1, 0 40007f6c: 02 80 00 3f be 40008068 <_RBTree_Insert+0x1f4> 40007f70: 80 a7 60 00 cmp %i5, 0 const RBTree_Node *the_node ) { if(!the_node) return NULL; if(!(the_node->parent)) return NULL; if(!(the_node->parent->parent)) return NULL; 40007f74: 02 80 00 06 be 40007f8c <_RBTree_Insert+0x118> <== NEVER TAKEN 40007f78: 82 10 20 00 clr %g1 if(!(the_node->parent->parent->parent)) return NULL; 40007f7c: c2 07 40 00 ld [ %i5 ], %g1 40007f80: 80 a0 60 00 cmp %g1, 0 40007f84: 32 80 00 12 bne,a 40007fcc <_RBTree_Insert+0x158> <== ALWAYS TAKEN 40007f88: c2 07 60 04 ld [ %i5 + 4 ], %g1 */ RTEMS_INLINE_ROUTINE bool _RBTree_Is_red( const RBTree_Node *the_node ) { return (the_node && the_node->color == RBT_RED); 40007f8c: 84 10 20 00 clr %g2 <== NOT EXECUTED 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)) { 40007f90: 80 a0 a0 00 cmp %g2, 0 40007f94: 22 80 00 1c be,a 40008004 <_RBTree_Insert+0x190> 40007f98: c2 07 60 04 ld [ %i5 + 4 ], %g1 the_node->parent->color = RBT_BLACK; 40007f9c: c0 22 20 0c clr [ %o0 + 0xc ] u->color = RBT_BLACK; 40007fa0: c0 20 60 0c clr [ %g1 + 0xc ] g->color = RBT_RED; 40007fa4: 82 10 20 01 mov 1, %g1 40007fa8: c2 27 60 0c st %g1, [ %i5 + 0xc ] } the_node->parent->color = RBT_BLACK; g->color = RBT_RED; /* now rotate grandparent in the other branch direction (toward uncle) */ _RBTree_Rotate(g, (1-pdir)); 40007fac: b2 10 00 1d mov %i5, %i1 * * @note It does NOT disable interrupts to ensure the atomicity of the * append operation. */ static void _RBTree_Validate_insert( RBTree_Node *the_node 40007fb0: d0 06 40 00 ld [ %i1 ], %o0 */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Parent( const RBTree_Node *the_node ) { if (!the_node->parent->parent) return NULL; 40007fb4: fa 02 00 00 ld [ %o0 ], %i5 40007fb8: 80 a7 60 00 cmp %i5, 0 40007fbc: 32 bf ff e8 bne,a 40007f5c <_RBTree_Insert+0xe8> 40007fc0: c2 02 20 0c ld [ %o0 + 0xc ], %g1 40007fc4: 10 bf ff e9 b 40007f68 <_RBTree_Insert+0xf4> 40007fc8: 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]) 40007fcc: 80 a2 00 01 cmp %o0, %g1 40007fd0: 22 80 00 02 be,a 40007fd8 <_RBTree_Insert+0x164> 40007fd4: 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); 40007fd8: 80 a0 60 00 cmp %g1, 0 40007fdc: 02 bf ff ed be 40007f90 <_RBTree_Insert+0x11c> 40007fe0: 84 10 20 00 clr %g2 40007fe4: c4 00 60 0c ld [ %g1 + 0xc ], %g2 40007fe8: 80 a0 a0 01 cmp %g2, 1 40007fec: 32 bf ff e9 bne,a 40007f90 <_RBTree_Insert+0x11c> 40007ff0: 84 10 20 00 clr %g2 40007ff4: 10 80 00 02 b 40007ffc <_RBTree_Insert+0x188> 40007ff8: 84 10 20 01 mov 1, %g2 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)) { 40007ffc: 10 bf ff e6 b 40007f94 <_RBTree_Insert+0x120> 40008000: 80 a0 a0 00 cmp %g2, 0 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]; RBTree_Direction pdir = the_node->parent != g->child[0]; 40008004: 82 1a 00 01 xor %o0, %g1, %g1 40008008: 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]; 4000800c: c2 02 20 04 ld [ %o0 + 4 ], %g1 RBTree_Direction pdir = the_node->parent != g->child[0]; 40008010: 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]; 40008014: 82 1e 40 01 xor %i1, %g1, %g1 40008018: 80 a0 00 01 cmp %g0, %g1 4000801c: 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) { 40008020: 80 a0 40 1c cmp %g1, %i4 40008024: 22 80 00 08 be,a 40008044 <_RBTree_Insert+0x1d0> 40008028: c2 06 40 00 ld [ %i1 ], %g1 _RBTree_Rotate(the_node->parent, pdir); 4000802c: 7f ff ff 74 call 40007dfc <_RBTree_Rotate> 40008030: 92 10 00 1c mov %i4, %o1 the_node = the_node->child[pdir]; 40008034: 83 2f 20 02 sll %i4, 2, %g1 40008038: b2 06 40 01 add %i1, %g1, %i1 4000803c: f2 06 60 04 ld [ %i1 + 4 ], %i1 } the_node->parent->color = RBT_BLACK; 40008040: c2 06 40 00 ld [ %i1 ], %g1 g->color = RBT_RED; 40008044: 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; 40008048: c0 20 60 0c clr [ %g1 + 0xc ] g->color = RBT_RED; 4000804c: d2 27 60 0c st %o1, [ %i5 + 0xc ] /* now rotate grandparent in the other branch direction (toward uncle) */ _RBTree_Rotate(g, (1-pdir)); 40008050: 90 10 00 1d mov %i5, %o0 40008054: 92 22 40 1c sub %o1, %i4, %o1 40008058: 7f ff ff 69 call 40007dfc <_RBTree_Rotate> 4000805c: ba 10 00 19 mov %i1, %i5 40008060: 10 bf ff d4 b 40007fb0 <_RBTree_Insert+0x13c> 40008064: b2 10 00 1d mov %i5, %i1 } } if(!the_node->parent->parent) the_node->color = RBT_BLACK; 40008068: 12 80 00 03 bne 40008074 <_RBTree_Insert+0x200> 4000806c: b0 10 20 00 clr %i0 40008070: c0 26 60 0c clr [ %i1 + 0xc ] 40008074: 81 c7 e0 08 ret 40008078: 81 e8 00 00 restore RBTree_Node *_RBTree_Insert( RBTree_Control *the_rbtree, RBTree_Node *the_node ) { if(!the_node) return (RBTree_Node*)-1; 4000807c: 81 c7 e0 08 ret 40008080: 91 e8 3f ff restore %g0, -1, %o0 40008084: b0 10 00 1d mov %i5, %i0 /* verify red-black properties */ _RBTree_Validate_insert(the_node); } return (RBTree_Node*)0; } 40008088: 81 c7 e0 08 ret 4000808c: 81 e8 00 00 restore =============================================================================== 4000a70c <_RBTree_Iterate>: const RBTree_Control *rbtree, RBTree_Direction dir, RBTree_Visitor visitor, void *visitor_arg ) { 4000a70c: 9d e3 bf a0 save %sp, -96, %sp */ RTEMS_INLINE_ROUTINE RBTree_Direction _RBTree_Opposite_direction( RBTree_Direction the_dir ) { return (RBTree_Direction) !((int) the_dir); 4000a710: 80 a0 00 19 cmp %g0, %i1 4000a714: 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]; 4000a718: 82 00 60 02 add %g1, 2, %g1 4000a71c: 83 28 60 02 sll %g1, 2, %g1 4000a720: fa 06 00 01 ld [ %i0 + %g1 ], %i5 RBTree_Direction opp_dir = _RBTree_Opposite_direction( dir ); const RBTree_Node *current = _RBTree_First( rbtree, opp_dir ); bool stop = false; 4000a724: b8 10 20 00 clr %i4 while ( !stop && current != NULL ) { 4000a728: 80 a7 60 00 cmp %i5, 0 4000a72c: 02 80 00 0e be 4000a764 <_RBTree_Iterate+0x58> 4000a730: b8 1f 20 01 xor %i4, 1, %i4 4000a734: 80 8f 20 ff btst 0xff, %i4 4000a738: 02 80 00 0b be 4000a764 <_RBTree_Iterate+0x58> <== NEVER TAKEN 4000a73c: 90 10 00 1d mov %i5, %o0 stop = (*visitor)( current, dir, visitor_arg ); 4000a740: 92 10 00 19 mov %i1, %o1 4000a744: 9f c6 80 00 call %i2 4000a748: 94 10 00 1b mov %i3, %o2 current = _RBTree_Next( current, dir ); 4000a74c: 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 ); 4000a750: b8 10 00 08 mov %o0, %i4 current = _RBTree_Next( current, dir ); 4000a754: 40 00 00 06 call 4000a76c <_RBTree_Next> 4000a758: 90 10 00 1d mov %i5, %o0 4000a75c: 10 bf ff f3 b 4000a728 <_RBTree_Iterate+0x1c> 4000a760: ba 10 00 08 mov %o0, %i5 4000a764: 81 c7 e0 08 ret 4000a768: 81 e8 00 00 restore =============================================================================== 4000f3dc <_RBTree_Rotate>: RBTree_Node *the_node, RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; 4000f3dc: 80 a2 20 00 cmp %o0, 0 4000f3e0: 02 80 00 1b be 4000f44c <_RBTree_Rotate+0x70> <== NEVER TAKEN 4000f3e4: 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); 4000f3e8: 84 60 3f ff subx %g0, -1, %g2 4000f3ec: 85 28 a0 02 sll %g2, 2, %g2 4000f3f0: 84 02 00 02 add %o0, %g2, %g2 RBTree_Direction dir ) { RBTree_Node *c; if (the_node == NULL) return; if (the_node->child[_RBTree_Opposite_direction(dir)] == NULL) return; 4000f3f4: c2 00 a0 04 ld [ %g2 + 4 ], %g1 4000f3f8: 80 a0 60 00 cmp %g1, 0 4000f3fc: 02 80 00 14 be 4000f44c <_RBTree_Rotate+0x70> <== NEVER TAKEN 4000f400: 93 2a 60 02 sll %o1, 2, %o1 4000f404: 92 00 40 09 add %g1, %o1, %o1 c = the_node->child[_RBTree_Opposite_direction(dir)]; the_node->child[_RBTree_Opposite_direction(dir)] = c->child[dir]; 4000f408: c6 02 60 04 ld [ %o1 + 4 ], %g3 4000f40c: c6 20 a0 04 st %g3, [ %g2 + 4 ] if (c->child[dir]) 4000f410: c4 02 60 04 ld [ %o1 + 4 ], %g2 4000f414: 80 a0 a0 00 cmp %g2, 0 4000f418: 32 80 00 02 bne,a 4000f420 <_RBTree_Rotate+0x44> 4000f41c: d0 20 80 00 st %o0, [ %g2 ] c->child[dir]->parent = the_node; c->child[dir] = the_node; 4000f420: d0 22 60 04 st %o0, [ %o1 + 4 ] the_node->parent->child[the_node != the_node->parent->child[0]] = c; 4000f424: c4 02 00 00 ld [ %o0 ], %g2 4000f428: c6 00 a0 04 ld [ %g2 + 4 ], %g3 4000f42c: 86 1a 00 03 xor %o0, %g3, %g3 4000f430: 80 a0 00 03 cmp %g0, %g3 4000f434: 86 40 20 00 addx %g0, 0, %g3 4000f438: 87 28 e0 02 sll %g3, 2, %g3 4000f43c: 86 00 80 03 add %g2, %g3, %g3 4000f440: c2 20 e0 04 st %g1, [ %g3 + 4 ] c->parent = the_node->parent; 4000f444: c4 20 40 00 st %g2, [ %g1 ] the_node->parent = c; 4000f448: c2 22 00 00 st %g1, [ %o0 ] 4000f44c: 81 c3 e0 08 retl =============================================================================== 4000f394 <_RBTree_Sibling>: */ RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_Sibling( const RBTree_Node *the_node ) { if(!the_node) return NULL; 4000f394: 80 a2 20 00 cmp %o0, 0 4000f398: 02 80 00 0f be 4000f3d4 <_RBTree_Sibling+0x40> <== NEVER TAKEN 4000f39c: 82 10 20 00 clr %g1 if(!(the_node->parent)) return NULL; 4000f3a0: c2 02 00 00 ld [ %o0 ], %g1 4000f3a4: 80 a0 60 00 cmp %g1, 0 4000f3a8: 02 80 00 0b be 4000f3d4 <_RBTree_Sibling+0x40> <== NEVER TAKEN 4000f3ac: 01 00 00 00 nop if(!(the_node->parent->parent)) return NULL; 4000f3b0: c4 00 40 00 ld [ %g1 ], %g2 4000f3b4: 80 a0 a0 00 cmp %g2, 0 4000f3b8: 22 80 00 07 be,a 4000f3d4 <_RBTree_Sibling+0x40> 4000f3bc: 82 10 20 00 clr %g1 if(the_node == the_node->parent->child[RBT_LEFT]) 4000f3c0: c4 00 60 04 ld [ %g1 + 4 ], %g2 4000f3c4: 80 a2 00 02 cmp %o0, %g2 4000f3c8: 32 80 00 03 bne,a 4000f3d4 <_RBTree_Sibling+0x40> 4000f3cc: 82 10 00 02 mov %g2, %g1 4000f3d0: c2 00 60 08 ld [ %g1 + 8 ], %g1 return the_node->parent->child[RBT_RIGHT]; else return the_node->parent->child[RBT_LEFT]; } 4000f3d4: 81 c3 e0 08 retl 4000f3d8: 90 10 00 01 mov %g1, %o0 =============================================================================== 4000d290 <_RTEMS_Tasks_Invoke_task_variable_dtor>: void _RTEMS_Tasks_Invoke_task_variable_dtor( Thread_Control *the_thread, rtems_task_variable_t *tvp ) { 4000d290: 9d e3 bf a0 save %sp, -96, %sp <== NOT EXECUTED void (*dtor)(void *); void *value; dtor = tvp->dtor; if (_Thread_Get_executing() == the_thread) { 4000d294: c4 01 a0 18 ld [ %g6 + 0x18 ], %g2 <== NOT EXECUTED 4000d298: 80 a0 80 18 cmp %g2, %i0 <== NOT EXECUTED 4000d29c: 12 80 00 07 bne 4000d2b8 <_RTEMS_Tasks_Invoke_task_variable_dtor+0x28><== NOT EXECUTED 4000d2a0: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 <== NOT EXECUTED value = *tvp->ptr; 4000d2a4: c4 06 60 04 ld [ %i1 + 4 ], %g2 <== NOT EXECUTED *tvp->ptr = tvp->gval; 4000d2a8: c6 06 60 08 ld [ %i1 + 8 ], %g3 <== NOT EXECUTED void (*dtor)(void *); void *value; dtor = tvp->dtor; if (_Thread_Get_executing() == the_thread) { value = *tvp->ptr; 4000d2ac: d0 00 80 00 ld [ %g2 ], %o0 <== NOT EXECUTED 4000d2b0: 10 80 00 03 b 4000d2bc <_RTEMS_Tasks_Invoke_task_variable_dtor+0x2c><== NOT EXECUTED 4000d2b4: c6 20 80 00 st %g3, [ %g2 ] <== NOT EXECUTED *tvp->ptr = tvp->gval; } else { value = tvp->tval; 4000d2b8: d0 06 60 0c ld [ %i1 + 0xc ], %o0 <== NOT EXECUTED } if ( dtor ) 4000d2bc: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED 4000d2c0: 02 80 00 04 be 4000d2d0 <_RTEMS_Tasks_Invoke_task_variable_dtor+0x40><== NOT EXECUTED 4000d2c4: 01 00 00 00 nop <== NOT EXECUTED (*dtor)(value); 4000d2c8: 9f c0 40 00 call %g1 <== NOT EXECUTED 4000d2cc: 01 00 00 00 nop <== NOT EXECUTED _Workspace_Free(tvp); 4000d2d0: 7f ff f8 3b call 4000b3bc <_Workspace_Free> <== NOT EXECUTED 4000d2d4: 91 e8 00 19 restore %g0, %i1, %o0 <== NOT EXECUTED =============================================================================== 4000d188 <_RTEMS_tasks_Switch_extension>: /* * Per Task Variables are only enabled in uniprocessor configurations */ tvp = executing->task_variables; 4000d188: c2 02 21 34 ld [ %o0 + 0x134 ], %g1 while (tvp) { 4000d18c: 80 a0 60 00 cmp %g1, 0 4000d190: 22 80 00 09 be,a 4000d1b4 <_RTEMS_tasks_Switch_extension+0x2c><== ALWAYS TAKEN 4000d194: c2 02 61 34 ld [ %o1 + 0x134 ], %g1 tvp->tval = *tvp->ptr; 4000d198: c4 00 60 04 ld [ %g1 + 4 ], %g2 <== NOT EXECUTED 4000d19c: c6 00 80 00 ld [ %g2 ], %g3 <== NOT EXECUTED 4000d1a0: c6 20 60 0c st %g3, [ %g1 + 0xc ] <== NOT EXECUTED *tvp->ptr = tvp->gval; 4000d1a4: c6 00 60 08 ld [ %g1 + 8 ], %g3 <== NOT EXECUTED 4000d1a8: c6 20 80 00 st %g3, [ %g2 ] <== NOT EXECUTED tvp = (rtems_task_variable_t *)tvp->next; 4000d1ac: 10 bf ff f8 b 4000d18c <_RTEMS_tasks_Switch_extension+0x4><== NOT EXECUTED 4000d1b0: c2 00 40 00 ld [ %g1 ], %g1 <== NOT EXECUTED } tvp = heir->task_variables; while (tvp) { 4000d1b4: 80 a0 60 00 cmp %g1, 0 4000d1b8: 02 80 00 09 be 4000d1dc <_RTEMS_tasks_Switch_extension+0x54><== ALWAYS TAKEN 4000d1bc: 01 00 00 00 nop tvp->gval = *tvp->ptr; 4000d1c0: c4 00 60 04 ld [ %g1 + 4 ], %g2 <== NOT EXECUTED 4000d1c4: c6 00 80 00 ld [ %g2 ], %g3 <== NOT EXECUTED 4000d1c8: c6 20 60 08 st %g3, [ %g1 + 8 ] <== NOT EXECUTED *tvp->ptr = tvp->tval; 4000d1cc: c6 00 60 0c ld [ %g1 + 0xc ], %g3 <== NOT EXECUTED 4000d1d0: c6 20 80 00 st %g3, [ %g2 ] <== NOT EXECUTED tvp = (rtems_task_variable_t *)tvp->next; 4000d1d4: 10 bf ff f8 b 4000d1b4 <_RTEMS_tasks_Switch_extension+0x2c><== NOT EXECUTED 4000d1d8: c2 00 40 00 ld [ %g1 ], %g1 <== NOT EXECUTED } } 4000d1dc: 81 c3 e0 08 retl =============================================================================== 4000d20c <_RTEMS_tasks_Terminate_extension>: } static void _RTEMS_tasks_Terminate_extension( Thread_Control *executing ) { 4000d20c: 9d e3 bf a0 save %sp, -96, %sp */ #if !defined(RTEMS_SMP) do { rtems_task_variable_t *tvp, *next; tvp = executing->task_variables; 4000d210: d2 06 21 34 ld [ %i0 + 0x134 ], %o1 executing->task_variables = NULL; 4000d214: c0 26 21 34 clr [ %i0 + 0x134 ] while (tvp) { 4000d218: 80 a2 60 00 cmp %o1, 0 4000d21c: 02 80 00 07 be 4000d238 <_RTEMS_tasks_Terminate_extension+0x2c><== ALWAYS TAKEN 4000d220: 01 00 00 00 nop next = (rtems_task_variable_t *)tvp->next; 4000d224: fa 02 40 00 ld [ %o1 ], %i5 <== NOT EXECUTED _RTEMS_Tasks_Invoke_task_variable_dtor( executing, tvp ); 4000d228: 40 00 00 1a call 4000d290 <_RTEMS_Tasks_Invoke_task_variable_dtor><== NOT EXECUTED 4000d22c: 90 10 00 18 mov %i0, %o0 <== NOT EXECUTED tvp = next; 4000d230: 10 bf ff fa b 4000d218 <_RTEMS_tasks_Terminate_extension+0xc><== NOT EXECUTED 4000d234: 92 10 00 1d mov %i5, %o1 <== NOT EXECUTED #endif /* * Run all the key destructors */ _POSIX_Keys_Run_destructors( executing ); 4000d238: 40 00 06 6b call 4000ebe4 <_POSIX_Keys_Run_destructors> 4000d23c: 81 e8 00 00 restore =============================================================================== 40008148 <_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 ) { 40008148: 9d e3 bf 98 save %sp, -104, %sp */ static inline void _TOD_Get_uptime( Timestamp_Control *time ) { _TOD_Get_with_nanoseconds( time, &_TOD.uptime ); 4000814c: 13 10 00 68 sethi %hi(0x4001a000), %o1 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ Timestamp_Control uptime; #endif Thread_Control *owning_thread = the_period->owner; 40008150: f6 06 20 40 ld [ %i0 + 0x40 ], %i3 40008154: 90 07 bf f8 add %fp, -8, %o0 40008158: 40 00 06 9f call 40009bd4 <_TOD_Get_with_nanoseconds> 4000815c: 92 12 63 68 or %o1, 0x368, %o1 /* * Determine elapsed wall time since period initiated. */ #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ _TOD_Get_uptime( &uptime ); _Timestamp_Subtract( 40008160: c4 1f bf f8 ldd [ %fp + -8 ], %g2 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 40008164: f8 1e 20 50 ldd [ %i0 + 0x50 ], %i4 if (used < the_period->cpu_usage_period_initiated) return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; 40008168: 82 10 20 01 mov 1, %g1 4000816c: ba a0 c0 1d subcc %g3, %i5, %i5 40008170: b8 60 80 1c subx %g2, %i4, %i4 40008174: f8 3e 40 00 std %i4, [ %i1 ] * Determine cpu usage since period initiated. */ used = owning_thread->cpu_time_used; #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ if (owning_thread == _Thread_Executing) { 40008178: fa 01 a0 18 ld [ %g6 + 0x18 ], %i5 4000817c: 80 a6 c0 1d cmp %i3, %i5 40008180: 12 80 00 15 bne 400081d4 <_Rate_monotonic_Get_status+0x8c> 40008184: d8 1e e0 80 ldd [ %i3 + 0x80 ], %o4 40008188: f8 19 a0 20 ldd [ %g6 + 0x20 ], %i4 4000818c: 86 a0 c0 1d subcc %g3, %i5, %g3 40008190: 84 60 80 1c subx %g2, %i4, %g2 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 40008194: ba 83 40 03 addcc %o5, %g3, %i5 40008198: b8 43 00 02 addx %o4, %g2, %i4 /* * The cpu usage info was reset while executing. Can't * determine a status. */ if (_Timestamp_Less_than(&used, &the_period->cpu_usage_period_initiated)) 4000819c: c4 1e 20 48 ldd [ %i0 + 0x48 ], %g2 400081a0: 80 a0 80 1c cmp %g2, %i4 400081a4: 34 80 00 0c bg,a 400081d4 <_Rate_monotonic_Get_status+0x8c><== NEVER TAKEN 400081a8: 82 10 20 00 clr %g1 <== NOT EXECUTED 400081ac: 32 80 00 06 bne,a 400081c4 <_Rate_monotonic_Get_status+0x7c> 400081b0: 86 a7 40 03 subcc %i5, %g3, %g3 400081b4: 80 a0 c0 1d cmp %g3, %i5 400081b8: 18 80 00 06 bgu 400081d0 <_Rate_monotonic_Get_status+0x88> 400081bc: 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; 400081c0: 82 10 20 01 mov 1, %g1 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 400081c4: 84 67 00 02 subx %i4, %g2, %g2 400081c8: 10 80 00 03 b 400081d4 <_Rate_monotonic_Get_status+0x8c> 400081cc: 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; 400081d0: 82 10 20 00 clr %g1 return false; *cpu_since_last_period = used - the_period->cpu_usage_period_initiated; #endif return true; } 400081d4: b0 08 60 01 and %g1, 1, %i0 400081d8: 81 c7 e0 08 ret 400081dc: 81 e8 00 00 restore =============================================================================== 400087fc <_Rate_monotonic_Timeout>: void _Rate_monotonic_Timeout( Objects_Id id, void *ignored ) { 400087fc: 9d e3 bf 98 save %sp, -104, %sp 40008800: 11 10 00 68 sethi %hi(0x4001a000), %o0 40008804: 92 10 00 18 mov %i0, %o1 40008808: 90 12 22 a0 or %o0, 0x2a0, %o0 4000880c: 40 00 08 15 call 4000a860 <_Objects_Get> 40008810: 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 ) { 40008814: c2 07 bf fc ld [ %fp + -4 ], %g1 40008818: 80 a0 60 00 cmp %g1, 0 4000881c: 12 80 00 23 bne 400088a8 <_Rate_monotonic_Timeout+0xac> <== NEVER TAKEN 40008820: ba 10 00 08 mov %o0, %i5 case OBJECTS_LOCAL: the_thread = the_period->owner; 40008824: d0 02 20 40 ld [ %o0 + 0x40 ], %o0 if ( _States_Is_waiting_for_period( the_thread->current_state ) && 40008828: 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); 4000882c: c4 02 20 10 ld [ %o0 + 0x10 ], %g2 40008830: 80 88 80 01 btst %g2, %g1 40008834: 22 80 00 0b be,a 40008860 <_Rate_monotonic_Timeout+0x64> 40008838: c2 07 60 38 ld [ %i5 + 0x38 ], %g1 4000883c: c4 02 20 20 ld [ %o0 + 0x20 ], %g2 40008840: c2 07 60 08 ld [ %i5 + 8 ], %g1 40008844: 80 a0 80 01 cmp %g2, %g1 40008848: 32 80 00 06 bne,a 40008860 <_Rate_monotonic_Timeout+0x64> 4000884c: c2 07 60 38 ld [ %i5 + 0x38 ], %g1 40008850: 13 04 03 ff sethi %hi(0x100ffc00), %o1 40008854: 40 00 0a ce call 4000b38c <_Thread_Clear_state> 40008858: 92 12 63 f8 or %o1, 0x3f8, %o1 ! 100ffff8 4000885c: 30 80 00 06 b,a 40008874 <_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 ) { 40008860: 80 a0 60 01 cmp %g1, 1 40008864: 12 80 00 0d bne 40008898 <_Rate_monotonic_Timeout+0x9c> 40008868: 82 10 20 04 mov 4, %g1 the_period->state = RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING; 4000886c: 82 10 20 03 mov 3, %g1 40008870: c2 27 60 38 st %g1, [ %i5 + 0x38 ] _Rate_monotonic_Initiate_statistics( the_period ); 40008874: 7f ff fe a4 call 40008304 <_Rate_monotonic_Initiate_statistics> 40008878: 90 10 00 1d mov %i5, %o0 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 4000887c: c2 07 60 3c ld [ %i5 + 0x3c ], %g1 _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 40008880: 11 10 00 69 sethi %hi(0x4001a400), %o0 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 40008884: c2 27 60 1c st %g1, [ %i5 + 0x1c ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 40008888: 90 12 20 10 or %o0, 0x10, %o0 4000888c: 40 00 0f fc call 4000c87c <_Watchdog_Insert> 40008890: 92 07 60 10 add %i5, 0x10, %o1 40008894: 30 80 00 02 b,a 4000889c <_Rate_monotonic_Timeout+0xa0> _Watchdog_Insert_ticks( &the_period->Timer, the_period->next_length ); } else the_period->state = RATE_MONOTONIC_EXPIRED; 40008898: 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 disable_level = _Thread_Dispatch_disable_level; 4000889c: c4 01 a0 10 ld [ %g6 + 0x10 ], %g2 ISR_Level level; _ISR_Disable( level ); #endif --disable_level; 400088a0: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = disable_level; 400088a4: c4 21 a0 10 st %g2, [ %g6 + 0x10 ] 400088a8: 81 c7 e0 08 ret 400088ac: 81 e8 00 00 restore =============================================================================== 400081e0 <_Rate_monotonic_Update_statistics>: } static void _Rate_monotonic_Update_statistics( Rate_monotonic_Control *the_period ) { 400081e0: 9d e3 bf 90 save %sp, -112, %sp /* * Update the counts. */ stats = &the_period->Statistics; stats->count++; 400081e4: c2 06 20 58 ld [ %i0 + 0x58 ], %g1 400081e8: 82 00 60 01 inc %g1 400081ec: c2 26 20 58 st %g1, [ %i0 + 0x58 ] if ( the_period->state == RATE_MONOTONIC_EXPIRED ) 400081f0: c2 06 20 38 ld [ %i0 + 0x38 ], %g1 400081f4: 80 a0 60 04 cmp %g1, 4 400081f8: 12 80 00 05 bne 4000820c <_Rate_monotonic_Update_statistics+0x2c> 400081fc: 90 10 00 18 mov %i0, %o0 stats->missed_count++; 40008200: c2 06 20 5c ld [ %i0 + 0x5c ], %g1 40008204: 82 00 60 01 inc %g1 40008208: c2 26 20 5c st %g1, [ %i0 + 0x5c ] /* * Grab status for time statistics. */ valid_status = 4000820c: 92 07 bf f8 add %fp, -8, %o1 40008210: 7f ff ff ce call 40008148 <_Rate_monotonic_Get_status> 40008214: 94 07 bf f0 add %fp, -16, %o2 _Rate_monotonic_Get_status( the_period, &since_last_period, &executed ); if (!valid_status) 40008218: 80 a2 20 00 cmp %o0, 0 4000821c: 02 80 00 38 be 400082fc <_Rate_monotonic_Update_statistics+0x11c> 40008220: c4 1f bf f0 ldd [ %fp + -16 ], %g2 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 40008224: 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 ) ) 40008228: c2 06 20 60 ld [ %i0 + 0x60 ], %g1 4000822c: b6 87 40 03 addcc %i5, %g3, %i3 40008230: b4 47 00 02 addx %i4, %g2, %i2 40008234: 80 a0 40 02 cmp %g1, %g2 40008238: 14 80 00 09 bg 4000825c <_Rate_monotonic_Update_statistics+0x7c> 4000823c: f4 3e 20 70 std %i2, [ %i0 + 0x70 ] 40008240: 80 a0 40 02 cmp %g1, %g2 40008244: 32 80 00 08 bne,a 40008264 <_Rate_monotonic_Update_statistics+0x84><== NEVER TAKEN 40008248: c2 06 20 68 ld [ %i0 + 0x68 ], %g1 <== NOT EXECUTED 4000824c: c2 06 20 64 ld [ %i0 + 0x64 ], %g1 40008250: 80 a0 40 03 cmp %g1, %g3 40008254: 28 80 00 04 bleu,a 40008264 <_Rate_monotonic_Update_statistics+0x84> 40008258: c2 06 20 68 ld [ %i0 + 0x68 ], %g1 stats->min_cpu_time = executed; 4000825c: c4 3e 20 60 std %g2, [ %i0 + 0x60 ] if ( _Timestamp_Greater_than( &executed, &stats->max_cpu_time ) ) 40008260: c2 06 20 68 ld [ %i0 + 0x68 ], %g1 40008264: 80 a0 40 02 cmp %g1, %g2 40008268: 26 80 00 0a bl,a 40008290 <_Rate_monotonic_Update_statistics+0xb0><== NEVER TAKEN 4000826c: c4 3e 20 68 std %g2, [ %i0 + 0x68 ] <== NOT EXECUTED 40008270: 80 a0 40 02 cmp %g1, %g2 40008274: 32 80 00 08 bne,a 40008294 <_Rate_monotonic_Update_statistics+0xb4><== NEVER TAKEN 40008278: c4 1f bf f8 ldd [ %fp + -8 ], %g2 <== NOT EXECUTED 4000827c: c2 06 20 6c ld [ %i0 + 0x6c ], %g1 40008280: 80 a0 40 03 cmp %g1, %g3 40008284: 3a 80 00 04 bcc,a 40008294 <_Rate_monotonic_Update_statistics+0xb4> 40008288: c4 1f bf f8 ldd [ %fp + -8 ], %g2 stats->max_cpu_time = executed; 4000828c: 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 ); 40008290: c4 1f bf f8 ldd [ %fp + -8 ], %g2 40008294: f8 1e 20 88 ldd [ %i0 + 0x88 ], %i4 if ( _Timestamp_Less_than( &since_last_period, &stats->min_wall_time ) ) 40008298: c2 06 20 78 ld [ %i0 + 0x78 ], %g1 4000829c: b6 87 40 03 addcc %i5, %g3, %i3 400082a0: b4 47 00 02 addx %i4, %g2, %i2 400082a4: 80 a0 40 02 cmp %g1, %g2 400082a8: 14 80 00 09 bg 400082cc <_Rate_monotonic_Update_statistics+0xec> 400082ac: f4 3e 20 88 std %i2, [ %i0 + 0x88 ] 400082b0: 80 a0 40 02 cmp %g1, %g2 400082b4: 32 80 00 08 bne,a 400082d4 <_Rate_monotonic_Update_statistics+0xf4><== NEVER TAKEN 400082b8: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 <== NOT EXECUTED 400082bc: c2 06 20 7c ld [ %i0 + 0x7c ], %g1 400082c0: 80 a0 40 03 cmp %g1, %g3 400082c4: 28 80 00 04 bleu,a 400082d4 <_Rate_monotonic_Update_statistics+0xf4> 400082c8: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 stats->min_wall_time = since_last_period; 400082cc: c4 3e 20 78 std %g2, [ %i0 + 0x78 ] if ( _Timestamp_Greater_than( &since_last_period, &stats->max_wall_time ) ) 400082d0: c2 06 20 80 ld [ %i0 + 0x80 ], %g1 400082d4: 80 a0 40 02 cmp %g1, %g2 400082d8: 26 80 00 09 bl,a 400082fc <_Rate_monotonic_Update_statistics+0x11c><== NEVER TAKEN 400082dc: c4 3e 20 80 std %g2, [ %i0 + 0x80 ] <== NOT EXECUTED 400082e0: 80 a0 40 02 cmp %g1, %g2 400082e4: 12 80 00 06 bne 400082fc <_Rate_monotonic_Update_statistics+0x11c><== NEVER TAKEN 400082e8: 01 00 00 00 nop 400082ec: c2 06 20 84 ld [ %i0 + 0x84 ], %g1 400082f0: 80 a0 40 03 cmp %g1, %g3 400082f4: 2a 80 00 02 bcs,a 400082fc <_Rate_monotonic_Update_statistics+0x11c> 400082f8: c4 3e 20 80 std %g2, [ %i0 + 0x80 ] 400082fc: 81 c7 e0 08 ret 40008300: 81 e8 00 00 restore =============================================================================== 4000b24c <_Scheduler_CBS_Attach_thread>: int _Scheduler_CBS_Attach_thread ( Scheduler_CBS_Server_id server_id, rtems_id task_id ) { 4000b24c: 9d e3 bf 98 save %sp, -104, %sp Objects_Locations location; Thread_Control *the_thread; if ( server_id >= _Scheduler_CBS_Maximum_servers ) 4000b250: 03 10 00 5f sethi %hi(0x40017c00), %g1 4000b254: c2 00 62 a0 ld [ %g1 + 0x2a0 ], %g1 ! 40017ea0 <_Scheduler_CBS_Maximum_servers> 4000b258: 80 a6 00 01 cmp %i0, %g1 4000b25c: 0a 80 00 04 bcs 4000b26c <_Scheduler_CBS_Attach_thread+0x20> 4000b260: 83 2e 20 02 sll %i0, 2, %g1 return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; 4000b264: 81 c7 e0 08 ret 4000b268: 91 e8 3f ee restore %g0, -18, %o0 /* Server is not valid. */ if ( !_Scheduler_CBS_Server_list[server_id].initialized ) 4000b26c: 3b 10 00 67 sethi %hi(0x40019c00), %i5 4000b270: b1 2e 20 04 sll %i0, 4, %i0 4000b274: ba 17 63 20 or %i5, 0x320, %i5 4000b278: b0 00 40 18 add %g1, %i0, %i0 4000b27c: b8 07 40 18 add %i5, %i0, %i4 4000b280: c2 0f 20 10 ldub [ %i4 + 0x10 ], %g1 4000b284: 80 a0 60 00 cmp %g1, 0 4000b288: 02 80 00 1f be 4000b304 <_Scheduler_CBS_Attach_thread+0xb8> 4000b28c: 01 00 00 00 nop return SCHEDULER_CBS_ERROR_NOSERVER; /* Server is already attached to a thread. */ if ( _Scheduler_CBS_Server_list[server_id].task_id != -1 ) 4000b290: c2 07 40 18 ld [ %i5 + %i0 ], %g1 4000b294: 80 a0 7f ff cmp %g1, -1 4000b298: 12 80 00 1d bne 4000b30c <_Scheduler_CBS_Attach_thread+0xc0> 4000b29c: 90 10 00 19 mov %i1, %o0 return SCHEDULER_CBS_ERROR_FULL; the_thread = _Thread_Get(task_id, &location); 4000b2a0: 40 00 03 95 call 4000c0f4 <_Thread_Get> 4000b2a4: 92 07 bf fc add %fp, -4, %o1 /* The routine _Thread_Get may disable dispatch and not enable again. */ if ( the_thread ) { 4000b2a8: 80 a2 20 00 cmp %o0, 0 4000b2ac: 02 bf ff ee be 4000b264 <_Scheduler_CBS_Attach_thread+0x18> 4000b2b0: 01 00 00 00 nop * * @{ */ RTEMS_INLINE_ROUTINE Scheduler_CBS_Node *_Scheduler_CBS_Node_get( Thread_Control *the_thread 4000b2b4: c2 02 20 88 ld [ %o0 + 0x88 ], %g1 Scheduler_CBS_Node *node = _Scheduler_CBS_Node_get( the_thread ); /* Thread is already attached to a server. */ if ( node->cbs_server ) { 4000b2b8: c4 00 60 18 ld [ %g1 + 0x18 ], %g2 4000b2bc: 80 a0 a0 00 cmp %g2, 0 4000b2c0: 22 80 00 05 be,a 4000b2d4 <_Scheduler_CBS_Attach_thread+0x88><== ALWAYS TAKEN 4000b2c4: f2 27 40 18 st %i1, [ %i5 + %i0 ] RTEMS_INLINE_ROUTINE void _Objects_Put( Objects_Control *the_object ) { (void) the_object; _Thread_Enable_dispatch(); 4000b2c8: 40 00 03 80 call 4000c0c8 <_Thread_Enable_dispatch> <== NOT EXECUTED 4000b2cc: b0 10 3f e6 mov -26, %i0 <== NOT EXECUTED 4000b2d0: 30 80 00 10 b,a 4000b310 <_Scheduler_CBS_Attach_thread+0xc4><== NOT EXECUTED _Objects_Put( &the_thread->Object ); return SCHEDULER_CBS_ERROR_FULL; } _Scheduler_CBS_Server_list[server_id].task_id = task_id; node->cbs_server = &_Scheduler_CBS_Server_list[server_id]; 4000b2d4: f8 20 60 18 st %i4, [ %g1 + 0x18 ] the_thread->budget_callout = _Scheduler_CBS_Budget_callout; 4000b2d8: 03 10 00 2d sethi %hi(0x4000b400), %g1 4000b2dc: 82 10 63 84 or %g1, 0x384, %g1 ! 4000b784 <_Scheduler_CBS_Budget_callout> 4000b2e0: c2 22 20 7c st %g1, [ %o0 + 0x7c ] the_thread->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_CALLOUT; 4000b2e4: 82 10 20 03 mov 3, %g1 4000b2e8: c2 22 20 78 st %g1, [ %o0 + 0x78 ] the_thread->is_preemptible = true; 4000b2ec: 82 10 20 01 mov 1, %g1 _Objects_Put( &the_thread->Object ); } else { return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; } return SCHEDULER_CBS_OK; 4000b2f0: b0 10 20 00 clr %i0 4000b2f4: 40 00 03 75 call 4000c0c8 <_Thread_Enable_dispatch> 4000b2f8: c2 2a 20 70 stb %g1, [ %o0 + 0x70 ] 4000b2fc: 81 c7 e0 08 ret 4000b300: 81 e8 00 00 restore if ( server_id >= _Scheduler_CBS_Maximum_servers ) return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; /* Server is not valid. */ if ( !_Scheduler_CBS_Server_list[server_id].initialized ) return SCHEDULER_CBS_ERROR_NOSERVER; 4000b304: 81 c7 e0 08 ret 4000b308: 91 e8 3f e7 restore %g0, -25, %o0 /* Server is already attached to a thread. */ if ( _Scheduler_CBS_Server_list[server_id].task_id != -1 ) return SCHEDULER_CBS_ERROR_FULL; 4000b30c: b0 10 3f e6 mov -26, %i0 } else { return SCHEDULER_CBS_ERROR_INVALID_PARAMETER; } return SCHEDULER_CBS_OK; } 4000b310: 81 c7 e0 08 ret 4000b314: 81 e8 00 00 restore =============================================================================== 4000b784 <_Scheduler_CBS_Budget_callout>: #include void _Scheduler_CBS_Budget_callout( Thread_Control *the_thread ) { 4000b784: 9d e3 bf 98 save %sp, -104, %sp Priority_Control new_priority; Scheduler_CBS_Node *node; Scheduler_CBS_Server_id server_id; /* Put violating task to background until the end of period. */ new_priority = the_thread->Start.initial_priority; 4000b788: d2 06 20 ac ld [ %i0 + 0xac ], %o1 if ( the_thread->real_priority != new_priority ) 4000b78c: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 4000b790: 80 a0 40 09 cmp %g1, %o1 4000b794: 32 80 00 02 bne,a 4000b79c <_Scheduler_CBS_Budget_callout+0x18><== ALWAYS TAKEN 4000b798: d2 26 20 18 st %o1, [ %i0 + 0x18 ] the_thread->real_priority = new_priority; if ( the_thread->current_priority != new_priority ) 4000b79c: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 4000b7a0: 80 a0 40 09 cmp %g1, %o1 4000b7a4: 02 80 00 04 be 4000b7b4 <_Scheduler_CBS_Budget_callout+0x30><== NEVER TAKEN 4000b7a8: 90 10 00 18 mov %i0, %o0 _Thread_Change_priority(the_thread, new_priority, true); 4000b7ac: 40 00 01 5a call 4000bd14 <_Thread_Change_priority> 4000b7b0: 94 10 20 01 mov 1, %o2 4000b7b4: fa 06 20 88 ld [ %i0 + 0x88 ], %i5 /* Invoke callback function if any. */ node = _Scheduler_CBS_Node_get( the_thread ); if ( node->cbs_server->cbs_budget_overrun ) { 4000b7b8: c2 07 60 18 ld [ %i5 + 0x18 ], %g1 4000b7bc: c4 00 60 0c ld [ %g1 + 0xc ], %g2 4000b7c0: 80 a0 a0 00 cmp %g2, 0 4000b7c4: 02 80 00 09 be 4000b7e8 <_Scheduler_CBS_Budget_callout+0x64><== NEVER TAKEN 4000b7c8: 01 00 00 00 nop _Scheduler_CBS_Get_server_id( 4000b7cc: d0 00 40 00 ld [ %g1 ], %o0 4000b7d0: 7f ff ff d0 call 4000b710 <_Scheduler_CBS_Get_server_id> 4000b7d4: 92 07 bf fc add %fp, -4, %o1 node->cbs_server->task_id, &server_id ); node->cbs_server->cbs_budget_overrun( server_id ); 4000b7d8: c2 07 60 18 ld [ %i5 + 0x18 ], %g1 4000b7dc: c2 00 60 0c ld [ %g1 + 0xc ], %g1 4000b7e0: 9f c0 40 00 call %g1 4000b7e4: d0 07 bf fc ld [ %fp + -4 ], %o0 4000b7e8: 81 c7 e0 08 ret 4000b7ec: 81 e8 00 00 restore =============================================================================== 4000a58c <_Scheduler_CBS_Release_job>: Thread_Control *the_thread, uint32_t deadline ) { Scheduler_CBS_Node *node = _Scheduler_CBS_Node_get( the_thread ); Scheduler_CBS_Server *serv_info = node->cbs_server; 4000a58c: c2 02 60 88 ld [ %o1 + 0x88 ], %g1 void _Scheduler_CBS_Release_job( const Scheduler_Control *scheduler, Thread_Control *the_thread, uint32_t deadline ) { 4000a590: 90 10 00 09 mov %o1, %o0 Scheduler_CBS_Node *node = _Scheduler_CBS_Node_get( the_thread ); Scheduler_CBS_Server *serv_info = node->cbs_server; Priority_Control new_priority; if (deadline) { 4000a594: 80 a2 a0 00 cmp %o2, 0 4000a598: 02 80 00 0f be 4000a5d4 <_Scheduler_CBS_Release_job+0x48> 4000a59c: c2 00 60 18 ld [ %g1 + 0x18 ], %g1 4000a5a0: 05 10 00 61 sethi %hi(0x40018400), %g2 /* Initializing or shifting deadline. */ if (serv_info) new_priority = (_Watchdog_Ticks_since_boot + serv_info->parameters.deadline) 4000a5a4: d2 00 a3 80 ld [ %g2 + 0x380 ], %o1 ! 40018780 <_Watchdog_Ticks_since_boot> Scheduler_CBS_Server *serv_info = node->cbs_server; Priority_Control new_priority; if (deadline) { /* Initializing or shifting deadline. */ if (serv_info) 4000a5a8: 80 a0 60 00 cmp %g1, 0 4000a5ac: 02 80 00 07 be 4000a5c8 <_Scheduler_CBS_Release_job+0x3c> 4000a5b0: 94 02 80 09 add %o2, %o1, %o2 new_priority = (_Watchdog_Ticks_since_boot + serv_info->parameters.deadline) 4000a5b4: c4 00 60 04 ld [ %g1 + 4 ], %g2 4000a5b8: 92 02 40 02 add %o1, %g2, %o1 4000a5bc: 05 20 00 00 sethi %hi(0x80000000), %g2 4000a5c0: 10 80 00 08 b 4000a5e0 <_Scheduler_CBS_Release_job+0x54> 4000a5c4: 92 2a 40 02 andn %o1, %g2, %o1 & ~SCHEDULER_EDF_PRIO_MSB; else new_priority = (_Watchdog_Ticks_since_boot + deadline) 4000a5c8: 13 20 00 00 sethi %hi(0x80000000), %o1 4000a5cc: 10 80 00 07 b 4000a5e8 <_Scheduler_CBS_Release_job+0x5c> 4000a5d0: 92 2a 80 09 andn %o2, %o1, %o1 /* Switch back to background priority. */ new_priority = the_thread->Start.initial_priority; } /* Budget replenishment for the next job. */ if (serv_info) 4000a5d4: 80 a0 60 00 cmp %g1, 0 4000a5d8: 02 80 00 04 be 4000a5e8 <_Scheduler_CBS_Release_job+0x5c> <== NEVER TAKEN 4000a5dc: d2 02 60 ac ld [ %o1 + 0xac ], %o1 the_thread->cpu_time_budget = serv_info->parameters.budget; 4000a5e0: c2 00 60 08 ld [ %g1 + 8 ], %g1 4000a5e4: c2 22 20 74 st %g1, [ %o0 + 0x74 ] the_thread->real_priority = new_priority; 4000a5e8: d2 22 20 18 st %o1, [ %o0 + 0x18 ] _Thread_Change_priority(the_thread, new_priority, true); 4000a5ec: 94 10 20 01 mov 1, %o2 4000a5f0: 82 13 c0 00 mov %o7, %g1 4000a5f4: 40 00 01 0e call 4000aa2c <_Thread_Change_priority> 4000a5f8: 9e 10 40 00 mov %g1, %o7 =============================================================================== 4000a5fc <_Scheduler_CBS_Unblock>: void _Scheduler_CBS_Unblock( const Scheduler_Control *scheduler, Thread_Control *the_thread ) { 4000a5fc: 9d e3 bf a0 save %sp, -96, %sp 4000a600: f8 06 60 88 ld [ %i1 + 0x88 ], %i4 { Scheduler_EDF_Context *context = _Scheduler_EDF_Get_context( scheduler ); Scheduler_EDF_Node *node = _Scheduler_EDF_Node_get( the_thread ); _RBTree_Insert( &context->Ready, &node->Node ); 4000a604: d0 06 00 00 ld [ %i0 ], %o0 Scheduler_CBS_Node *node = _Scheduler_CBS_Node_get( the_thread ); Scheduler_CBS_Server *serv_info = node->cbs_server; 4000a608: fa 07 20 18 ld [ %i4 + 0x18 ], %i5 4000a60c: 7f ff ff 53 call 4000a358 <_RBTree_Insert> 4000a610: 92 07 20 04 add %i4, 4, %o1 node->queue_state = SCHEDULER_EDF_QUEUE_STATE_YES; 4000a614: 82 10 20 01 mov 1, %g1 * 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) { 4000a618: 80 a7 60 00 cmp %i5, 0 4000a61c: 02 80 00 19 be 4000a680 <_Scheduler_CBS_Unblock+0x84> 4000a620: c2 27 20 14 st %g1, [ %i4 + 0x14 ] 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 - 4000a624: 03 10 00 61 sethi %hi(0x40018400), %g1 _Watchdog_Ticks_since_boot; if ( deadline*budget_left > budget*deadline_left ) { 4000a628: 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 - 4000a62c: d0 00 63 80 ld [ %g1 + 0x380 ], %o0 4000a630: f8 06 60 18 ld [ %i1 + 0x18 ], %i4 _Watchdog_Ticks_since_boot; if ( deadline*budget_left > budget*deadline_left ) { 4000a634: 40 00 27 98 call 40014494 <.umul> 4000a638: 90 27 00 08 sub %i4, %o0, %o0 4000a63c: d2 06 60 74 ld [ %i1 + 0x74 ], %o1 4000a640: b6 10 00 08 mov %o0, %i3 4000a644: 40 00 27 94 call 40014494 <.umul> 4000a648: d0 07 60 08 ld [ %i5 + 8 ], %o0 4000a64c: 80 a6 c0 08 cmp %i3, %o0 4000a650: 24 80 00 0d ble,a 4000a684 <_Scheduler_CBS_Unblock+0x88> 4000a654: c4 01 a0 1c ld [ %g6 + 0x1c ], %g2 /* Put late unblocked task to background until the end of period. */ new_priority = the_thread->Start.initial_priority; 4000a658: d2 06 60 ac ld [ %i1 + 0xac ], %o1 if ( the_thread->real_priority != new_priority ) 4000a65c: 80 a7 00 09 cmp %i4, %o1 4000a660: 32 80 00 02 bne,a 4000a668 <_Scheduler_CBS_Unblock+0x6c> 4000a664: d2 26 60 18 st %o1, [ %i1 + 0x18 ] the_thread->real_priority = new_priority; if ( the_thread->current_priority != new_priority ) 4000a668: c2 06 60 14 ld [ %i1 + 0x14 ], %g1 4000a66c: 80 a0 40 09 cmp %g1, %o1 4000a670: 02 80 00 04 be 4000a680 <_Scheduler_CBS_Unblock+0x84> 4000a674: 90 10 00 19 mov %i1, %o0 _Thread_Change_priority(the_thread, new_priority, true); 4000a678: 40 00 00 ed call 4000aa2c <_Thread_Change_priority> 4000a67c: 94 10 20 01 mov 1, %o2 * 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( 4000a680: c4 01 a0 1c ld [ %g6 + 0x1c ], %g2 const Scheduler_Control *scheduler, Priority_Control p1, Priority_Control p2 ) { return ( *scheduler->Operations.priority_compare )( p1, p2 ); 4000a684: c2 06 20 28 ld [ %i0 + 0x28 ], %g1 4000a688: d0 06 60 14 ld [ %i1 + 0x14 ], %o0 4000a68c: 9f c0 40 00 call %g1 4000a690: d2 00 a0 14 ld [ %g2 + 0x14 ], %o1 * 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 ( 4000a694: 80 a2 20 00 cmp %o0, 0 4000a698: 04 80 00 0e ble 4000a6d0 <_Scheduler_CBS_Unblock+0xd4> 4000a69c: 01 00 00 00 nop the_thread->current_priority, _Thread_Heir->current_priority ) ) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 4000a6a0: c4 01 a0 18 ld [ %g6 + 0x18 ], %g2 scheduler, the_thread->current_priority, _Thread_Heir->current_priority ) ) { _Thread_Heir = the_thread; 4000a6a4: f2 21 a0 1c st %i1, [ %g6 + 0x1c ] if ( _Thread_Executing->is_preemptible || 4000a6a8: c4 08 a0 70 ldub [ %g2 + 0x70 ], %g2 4000a6ac: 80 a0 a0 00 cmp %g2, 0 4000a6b0: 12 80 00 06 bne 4000a6c8 <_Scheduler_CBS_Unblock+0xcc> 4000a6b4: 82 10 00 06 mov %g6, %g1 4000a6b8: c4 06 60 14 ld [ %i1 + 0x14 ], %g2 4000a6bc: 80 a0 a0 00 cmp %g2, 0 4000a6c0: 12 80 00 04 bne 4000a6d0 <_Scheduler_CBS_Unblock+0xd4> <== ALWAYS TAKEN 4000a6c4: 01 00 00 00 nop the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 4000a6c8: 84 10 20 01 mov 1, %g2 ! 1 <_TLS_Alignment> 4000a6cc: c4 28 60 14 stb %g2, [ %g1 + 0x14 ] 4000a6d0: 81 c7 e0 08 ret 4000a6d4: 81 e8 00 00 restore =============================================================================== 4000a7f8 <_Scheduler_EDF_Block>: void _Scheduler_EDF_Block( const Scheduler_Control *scheduler, Thread_Control *the_thread ) { 4000a7f8: 9d e3 bf a0 save %sp, -96, %sp const Scheduler_Control *, Thread_Control *, bool ) ) { ( *extract )( scheduler, the_thread ); 4000a7fc: 90 10 00 18 mov %i0, %o0 4000a800: 7f ff ff f8 call 4000a7e0 <_Scheduler_EDF_Extract> 4000a804: 92 10 00 19 mov %i1, %o1 /* TODO: flash critical section? */ if ( _Thread_Is_executing( the_thread ) || _Thread_Is_heir( the_thread ) ) { 4000a808: c4 01 a0 18 ld [ %g6 + 0x18 ], %g2 4000a80c: 80 a6 40 02 cmp %i1, %g2 4000a810: 02 80 00 06 be 4000a828 <_Scheduler_EDF_Block+0x30> 4000a814: 01 00 00 00 nop 4000a818: c2 01 a0 1c ld [ %g6 + 0x1c ], %g1 4000a81c: 80 a6 40 01 cmp %i1, %g1 4000a820: 12 80 00 04 bne 4000a830 <_Scheduler_EDF_Block+0x38> <== ALWAYS TAKEN 4000a824: 01 00 00 00 nop ( *schedule )( scheduler, the_thread, true ); 4000a828: 7f ff ff dd call 4000a79c <_Scheduler_EDF_Schedule_body> 4000a82c: 95 e8 20 01 restore %g0, 1, %o2 4000a830: 81 c7 e0 08 ret 4000a834: 81 e8 00 00 restore =============================================================================== 4000a8f0 <_Scheduler_EDF_Schedule>: RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First( const RBTree_Control *the_rbtree, RBTree_Direction dir ) { return the_rbtree->first[dir]; 4000a8f0: c2 02 00 00 ld [ %o0 ], %g1 Scheduler_EDF_Context *context = _Scheduler_EDF_Get_context( scheduler ); RBTree_Node *first = _RBTree_First( &context->Ready, RBT_LEFT ); Scheduler_EDF_Node *node = _RBTree_Container_of(first, Scheduler_EDF_Node, Node); Thread_Control *heir = node->thread; 4000a8f4: c2 00 60 08 ld [ %g1 + 8 ], %g1 4000a8f8: c4 00 7f fc ld [ %g1 + -4 ], %g2 RTEMS_INLINE_ROUTINE void _Scheduler_Update_heir( Thread_Control *heir, bool force_dispatch ) { Thread_Control *executing = _Thread_Executing; 4000a8fc: c2 01 a0 18 ld [ %g6 + 0x18 ], %g1 _Thread_Heir = heir; if ( executing != heir && ( force_dispatch || executing->is_preemptible ) ) 4000a900: 80 a0 40 02 cmp %g1, %g2 4000a904: 02 80 00 07 be 4000a920 <_Scheduler_EDF_Schedule+0x30> 4000a908: c4 21 a0 1c st %g2, [ %g6 + 0x1c ] 4000a90c: c2 08 60 70 ldub [ %g1 + 0x70 ], %g1 4000a910: 80 a0 60 00 cmp %g1, 0 4000a914: 02 80 00 03 be 4000a920 <_Scheduler_EDF_Schedule+0x30> <== NEVER TAKEN 4000a918: 84 10 20 01 mov 1, %g2 _Thread_Dispatch_necessary = true; 4000a91c: c4 29 a0 14 stb %g2, [ %g6 + 0x14 ] 4000a920: 81 c3 e0 08 retl =============================================================================== 4000a79c <_Scheduler_EDF_Schedule_body>: RTEMS_INLINE_ROUTINE RBTree_Node *_RBTree_First( const RBTree_Control *the_rbtree, RBTree_Direction dir ) { return the_rbtree->first[dir]; 4000a79c: c2 02 00 00 ld [ %o0 ], %g1 Scheduler_EDF_Context *context = _Scheduler_EDF_Get_context( scheduler ); RBTree_Node *first = _RBTree_First( &context->Ready, RBT_LEFT ); Scheduler_EDF_Node *node = _RBTree_Container_of(first, Scheduler_EDF_Node, Node); Thread_Control *heir = node->thread; 4000a7a0: c2 00 60 08 ld [ %g1 + 8 ], %g1 4000a7a4: c4 00 7f fc ld [ %g1 + -4 ], %g2 RTEMS_INLINE_ROUTINE void _Scheduler_Update_heir( Thread_Control *heir, bool force_dispatch ) { Thread_Control *executing = _Thread_Executing; 4000a7a8: c2 01 a0 18 ld [ %g6 + 0x18 ], %g1 _Thread_Heir = heir; if ( executing != heir && ( force_dispatch || executing->is_preemptible ) ) 4000a7ac: 80 a0 40 02 cmp %g1, %g2 4000a7b0: 02 80 00 0a be 4000a7d8 <_Scheduler_EDF_Schedule_body+0x3c><== NEVER TAKEN 4000a7b4: c4 21 a0 1c st %g2, [ %g6 + 0x1c ] 4000a7b8: 80 a2 a0 00 cmp %o2, 0 4000a7bc: 12 80 00 06 bne 4000a7d4 <_Scheduler_EDF_Schedule_body+0x38><== ALWAYS TAKEN 4000a7c0: 84 10 20 01 mov 1, %g2 4000a7c4: c2 08 60 70 ldub [ %g1 + 0x70 ], %g1 <== NOT EXECUTED 4000a7c8: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED 4000a7cc: 02 80 00 03 be 4000a7d8 <_Scheduler_EDF_Schedule_body+0x3c><== NOT EXECUTED 4000a7d0: 01 00 00 00 nop <== NOT EXECUTED _Thread_Dispatch_necessary = true; 4000a7d4: c4 29 a0 14 stb %g2, [ %g6 + 0x14 ] 4000a7d8: 81 c3 e0 08 retl =============================================================================== 4000a814 <_Scheduler_EDF_Unblock>: void _Scheduler_EDF_Unblock( const Scheduler_Control *scheduler, Thread_Control *the_thread ) { 4000a814: 9d e3 bf a0 save %sp, -96, %sp { return (Scheduler_EDF_Context *) _Scheduler_Get_context( scheduler ); } RTEMS_INLINE_ROUTINE Scheduler_EDF_Node *_Scheduler_EDF_Node_get( Thread_Control *the_thread 4000a818: fa 06 60 88 ld [ %i1 + 0x88 ], %i5 { Scheduler_EDF_Context *context = _Scheduler_EDF_Get_context( scheduler ); Scheduler_EDF_Node *node = _Scheduler_EDF_Node_get( the_thread ); _RBTree_Insert( &context->Ready, &node->Node ); 4000a81c: d0 06 00 00 ld [ %i0 ], %o0 4000a820: 7f ff fe ce call 4000a358 <_RBTree_Insert> 4000a824: 92 07 60 04 add %i5, 4, %o1 * 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( 4000a828: c4 01 a0 1c ld [ %g6 + 0x1c ], %g2 node->queue_state = SCHEDULER_EDF_QUEUE_STATE_YES; 4000a82c: 82 10 20 01 mov 1, %g1 const Scheduler_Control *scheduler, Priority_Control p1, Priority_Control p2 ) { return ( *scheduler->Operations.priority_compare )( p1, p2 ); 4000a830: d0 00 a0 14 ld [ %g2 + 0x14 ], %o0 4000a834: c2 27 60 14 st %g1, [ %i5 + 0x14 ] 4000a838: c2 06 20 28 ld [ %i0 + 0x28 ], %g1 4000a83c: 9f c0 40 00 call %g1 4000a840: d2 06 60 14 ld [ %i1 + 0x14 ], %o1 4000a844: 80 a2 20 00 cmp %o0, 0 4000a848: 16 80 00 0e bge 4000a880 <_Scheduler_EDF_Unblock+0x6c> 4000a84c: 01 00 00 00 nop scheduler, _Thread_Heir->current_priority, the_thread->current_priority )) { _Thread_Heir = the_thread; if ( _Thread_Executing->is_preemptible || 4000a850: c4 01 a0 18 ld [ %g6 + 0x18 ], %g2 */ if ( _Scheduler_Is_priority_lower_than( scheduler, _Thread_Heir->current_priority, the_thread->current_priority )) { _Thread_Heir = the_thread; 4000a854: f2 21 a0 1c st %i1, [ %g6 + 0x1c ] if ( _Thread_Executing->is_preemptible || 4000a858: c4 08 a0 70 ldub [ %g2 + 0x70 ], %g2 4000a85c: 80 a0 a0 00 cmp %g2, 0 4000a860: 12 80 00 06 bne 4000a878 <_Scheduler_EDF_Unblock+0x64> 4000a864: 82 10 00 06 mov %g6, %g1 4000a868: c4 06 60 14 ld [ %i1 + 0x14 ], %g2 4000a86c: 80 a0 a0 00 cmp %g2, 0 4000a870: 12 80 00 04 bne 4000a880 <_Scheduler_EDF_Unblock+0x6c> <== ALWAYS TAKEN 4000a874: 01 00 00 00 nop the_thread->current_priority == 0 ) _Thread_Dispatch_necessary = true; 4000a878: 84 10 20 01 mov 1, %g2 ! 1 <_TLS_Alignment> 4000a87c: c4 28 60 14 stb %g2, [ %g1 + 0x14 ] 4000a880: 81 c7 e0 08 ret 4000a884: 81 e8 00 00 restore =============================================================================== 4000a928 <_Scheduler_EDF_Update_priority>: { return (Scheduler_EDF_Context *) _Scheduler_Get_context( scheduler ); } RTEMS_INLINE_ROUTINE Scheduler_EDF_Node *_Scheduler_EDF_Node_get( Thread_Control *the_thread 4000a928: c4 02 60 88 ld [ %o1 + 0x88 ], %g2 Scheduler_EDF_Node *node = _Scheduler_EDF_Node_get( the_thread ); (void) scheduler; (void) new_priority; if (node->queue_state == SCHEDULER_EDF_QUEUE_STATE_NEVER_HAS_BEEN) { 4000a92c: c2 00 a0 14 ld [ %g2 + 0x14 ], %g1 4000a930: 80 a0 60 02 cmp %g1, 2 4000a934: 12 80 00 08 bne 4000a954 <_Scheduler_EDF_Update_priority+0x2c><== NEVER TAKEN 4000a938: 03 20 00 00 sethi %hi(0x80000000), %g1 /* Shifts the priority to the region of background tasks. */ the_thread->Start.initial_priority |= (SCHEDULER_EDF_PRIO_MSB); 4000a93c: c6 02 60 ac ld [ %o1 + 0xac ], %g3 4000a940: 82 10 c0 01 or %g3, %g1, %g1 4000a944: c2 22 60 ac st %g1, [ %o1 + 0xac ] the_thread->real_priority = the_thread->Start.initial_priority; 4000a948: c2 22 60 18 st %g1, [ %o1 + 0x18 ] the_thread->current_priority = the_thread->Start.initial_priority; 4000a94c: c2 22 60 14 st %g1, [ %o1 + 0x14 ] node->queue_state = SCHEDULER_EDF_QUEUE_STATE_NOT_PRESENTLY; 4000a950: c0 20 a0 14 clr [ %g2 + 0x14 ] 4000a954: 81 c3 e0 08 retl =============================================================================== 4000a95c <_Scheduler_EDF_Yield>: void _Scheduler_EDF_Yield( const Scheduler_Control *scheduler, Thread_Control *the_thread ) { 4000a95c: 9d e3 bf a0 save %sp, -96, %sp /* * The RBTree has more than one node, enqueue behind the tasks * with the same priority in case there are such ones. */ _RBTree_Extract( &context->Ready, &node->Node ); 4000a960: fa 06 00 00 ld [ %i0 ], %i5 4000a964: f8 06 60 88 ld [ %i1 + 0x88 ], %i4 4000a968: 90 10 00 1d mov %i5, %o0 4000a96c: b8 07 20 04 add %i4, 4, %i4 4000a970: 40 00 10 7b call 4000eb5c <_RBTree_Extract> 4000a974: 92 10 00 1c mov %i4, %o1 _RBTree_Insert( &context->Ready, &node->Node ); 4000a978: 90 10 00 1d mov %i5, %o0 4000a97c: 7f ff fe 77 call 4000a358 <_RBTree_Insert> 4000a980: 92 10 00 1c mov %i4, %o1 4000a984: c2 06 00 00 ld [ %i0 ], %g1 Scheduler_EDF_Context *context = _Scheduler_EDF_Get_context( scheduler ); RBTree_Node *first = _RBTree_First( &context->Ready, RBT_LEFT ); Scheduler_EDF_Node *node = _RBTree_Container_of(first, Scheduler_EDF_Node, Node); Thread_Control *heir = node->thread; 4000a988: c2 00 60 08 ld [ %g1 + 8 ], %g1 4000a98c: c4 00 7f fc ld [ %g1 + -4 ], %g2 RTEMS_INLINE_ROUTINE void _Scheduler_Update_heir( Thread_Control *heir, bool force_dispatch ) { Thread_Control *executing = _Thread_Executing; 4000a990: c2 01 a0 18 ld [ %g6 + 0x18 ], %g1 _Thread_Heir = heir; if ( executing != heir && ( force_dispatch || executing->is_preemptible ) ) 4000a994: 80 a0 40 02 cmp %g1, %g2 4000a998: 02 80 00 07 be 4000a9b4 <_Scheduler_EDF_Yield+0x58> <== NEVER TAKEN 4000a99c: c4 21 a0 1c st %g2, [ %g6 + 0x1c ] 4000a9a0: c2 08 60 70 ldub [ %g1 + 0x70 ], %g1 4000a9a4: 80 a0 60 00 cmp %g1, 0 4000a9a8: 02 80 00 03 be 4000a9b4 <_Scheduler_EDF_Yield+0x58> <== ALWAYS TAKEN 4000a9ac: 84 10 20 01 mov 1, %g2 _Thread_Dispatch_necessary = true; 4000a9b0: c4 29 a0 14 stb %g2, [ %g6 + 0x14 ] <== NOT EXECUTED 4000a9b4: 81 c7 e0 08 ret 4000a9b8: 81 e8 00 00 restore =============================================================================== 40009418 <_Scheduler_default_Tick>: void _Scheduler_default_Tick( const Scheduler_Control *scheduler, Thread_Control *executing ) { 40009418: 9d e3 bf a0 save %sp, -96, %sp /* * If the thread is not preemptible or is not ready, then * just return. */ if ( !executing->is_preemptible ) 4000941c: c2 0e 60 70 ldub [ %i1 + 0x70 ], %g1 40009420: 80 a0 60 00 cmp %g1, 0 40009424: 02 80 00 23 be 400094b0 <_Scheduler_default_Tick+0x98> 40009428: 01 00 00 00 nop return; if ( !_States_Is_ready( executing->current_state ) ) 4000942c: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 40009430: 80 a0 60 00 cmp %g1, 0 40009434: 12 80 00 1f bne 400094b0 <_Scheduler_default_Tick+0x98> 40009438: 01 00 00 00 nop /* * The cpu budget algorithm determines what happens next. */ switch ( executing->budget_algorithm ) { 4000943c: c2 06 60 78 ld [ %i1 + 0x78 ], %g1 40009440: 80 a0 60 01 cmp %g1, 1 40009444: 0a 80 00 06 bcs 4000945c <_Scheduler_default_Tick+0x44> 40009448: 80 a0 60 02 cmp %g1, 2 4000944c: 08 80 00 06 bleu 40009464 <_Scheduler_default_Tick+0x4c> 40009450: 80 a0 60 03 cmp %g1, 3 40009454: 22 80 00 10 be,a 40009494 <_Scheduler_default_Tick+0x7c> <== ALWAYS TAKEN 40009458: c2 06 60 74 ld [ %i1 + 0x74 ], %g1 4000945c: 81 c7 e0 08 ret 40009460: 81 e8 00 00 restore 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 ) { 40009464: c2 06 60 74 ld [ %i1 + 0x74 ], %g1 40009468: 82 00 7f ff add %g1, -1, %g1 4000946c: 80 a0 60 00 cmp %g1, 0 40009470: 14 bf ff fb bg 4000945c <_Scheduler_default_Tick+0x44> 40009474: c2 26 60 74 st %g1, [ %i1 + 0x74 ] * at the priority of the currently executing thread, then the * executing thread's timeslice is reset. Otherwise, the * currently executing thread is placed at the rear of the * FIFO for this priority and a new heir is selected. */ _Thread_Yield( executing ); 40009478: 40 00 06 12 call 4000acc0 <_Thread_Yield> 4000947c: 90 10 00 19 mov %i1, %o0 executing->cpu_time_budget = rtems_configuration_get_ticks_per_timeslice(); 40009480: 03 10 00 55 sethi %hi(0x40015400), %g1 * executing thread's timeslice is reset. Otherwise, the * currently executing thread is placed at the rear of the * FIFO for this priority and a new heir is selected. */ _Thread_Yield( executing ); executing->cpu_time_budget = 40009484: c2 00 61 a4 ld [ %g1 + 0x1a4 ], %g1 ! 400155a4 40009488: c2 26 60 74 st %g1, [ %i1 + 0x74 ] 4000948c: 81 c7 e0 08 ret 40009490: 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 ) 40009494: 82 00 7f ff add %g1, -1, %g1 40009498: 80 a0 60 00 cmp %g1, 0 4000949c: 12 bf ff f0 bne 4000945c <_Scheduler_default_Tick+0x44> 400094a0: c2 26 60 74 st %g1, [ %i1 + 0x74 ] (*executing->budget_callout)( executing ); 400094a4: c2 06 60 7c ld [ %i1 + 0x7c ], %g1 400094a8: 9f c0 40 00 call %g1 400094ac: 90 10 00 19 mov %i1, %o0 400094b0: 81 c7 e0 08 ret 400094b4: 81 e8 00 00 restore =============================================================================== 400094d8 <_Scheduler_priority_Schedule_body>: * @addtogroup ScoreSchedulerDPS */ /**@{**/ RTEMS_INLINE_ROUTINE Scheduler_priority_Context * _Scheduler_priority_Get_context( const Scheduler_Control *scheduler ) 400094d8: c4 02 00 00 ld [ %o0 ], %g2 400094dc: 03 10 00 59 sethi %hi(0x40016400), %g1 /* Avoid problems with some inline ASM statements */ Priority_bit_map_Word tmp; tmp = bit_map->major_bit_map; _Bitfield_Find_first_bit( tmp, major ); 400094e0: c6 10 80 00 lduh [ %g2 ], %g3 bool force_dispatch ) { Scheduler_priority_Context *context = _Scheduler_priority_Get_context( scheduler ); Thread_Control *heir = _Scheduler_priority_Ready_queue_first( 400094e4: 9a 00 a0 24 add %g2, 0x24, %o5 400094e8: 87 28 e0 10 sll %g3, 0x10, %g3 400094ec: 89 30 e0 10 srl %g3, 0x10, %g4 400094f0: 80 a1 20 ff cmp %g4, 0xff 400094f4: 18 80 00 05 bgu 40009508 <_Scheduler_priority_Schedule_body+0x30> 400094f8: 82 10 61 48 or %g1, 0x148, %g1 400094fc: c6 08 40 04 ldub [ %g1 + %g4 ], %g3 40009500: 10 80 00 04 b 40009510 <_Scheduler_priority_Schedule_body+0x38> 40009504: 86 00 e0 08 add %g3, 8, %g3 40009508: 87 30 e0 18 srl %g3, 0x18, %g3 4000950c: c6 08 40 03 ldub [ %g1 + %g3 ], %g3 tmp = bit_map->bit_map[ major ]; 40009510: 87 28 e0 10 sll %g3, 0x10, %g3 40009514: 89 30 e0 0f srl %g3, 0xf, %g4 40009518: 84 00 80 04 add %g2, %g4, %g2 _Bitfield_Find_first_bit( tmp, minor ); 4000951c: c4 10 a0 02 lduh [ %g2 + 2 ], %g2 40009520: 85 28 a0 10 sll %g2, 0x10, %g2 40009524: 89 30 a0 10 srl %g2, 0x10, %g4 40009528: 80 a1 20 ff cmp %g4, 0xff 4000952c: 18 80 00 05 bgu 40009540 <_Scheduler_priority_Schedule_body+0x68> 40009530: 85 30 a0 18 srl %g2, 0x18, %g2 40009534: c2 08 40 04 ldub [ %g1 + %g4 ], %g1 40009538: 10 80 00 03 b 40009544 <_Scheduler_priority_Schedule_body+0x6c> 4000953c: 82 00 60 08 add %g1, 8, %g1 40009540: c2 08 40 02 ldub [ %g1 + %g2 ], %g1 return (_Priority_Bits_index( major ) << 4) + _Priority_Bits_index( minor ); 40009544: 83 28 60 10 sll %g1, 0x10, %g1 _Bitfield_Find_first_bit( tmp, major ); tmp = bit_map->bit_map[ major ]; _Bitfield_Find_first_bit( tmp, minor ); return (_Priority_Bits_index( major ) << 4) + 40009548: 87 30 e0 0c srl %g3, 0xc, %g3 _Priority_Bits_index( minor ); 4000954c: 83 30 60 10 srl %g1, 0x10, %g1 Chain_Control *ready_queues ) { Priority_Control index = _Priority_bit_map_Get_highest( bit_map ); return (Thread_Control *) _Chain_First( &ready_queues[ index ] ); 40009550: 82 00 40 03 add %g1, %g3, %g1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 40009554: 85 28 60 02 sll %g1, 2, %g2 40009558: 83 28 60 04 sll %g1, 4, %g1 4000955c: 82 20 40 02 sub %g1, %g2, %g1 40009560: c4 03 40 01 ld [ %o5 + %g1 ], %g2 RTEMS_INLINE_ROUTINE void _Scheduler_Update_heir( Thread_Control *heir, bool force_dispatch ) { Thread_Control *executing = _Thread_Executing; 40009564: c2 01 a0 18 ld [ %g6 + 0x18 ], %g1 _Thread_Heir = heir; if ( executing != heir && ( force_dispatch || executing->is_preemptible ) ) 40009568: 80 a0 40 02 cmp %g1, %g2 4000956c: 02 80 00 0a be 40009594 <_Scheduler_priority_Schedule_body+0xbc> 40009570: c4 21 a0 1c st %g2, [ %g6 + 0x1c ] 40009574: 80 a2 a0 00 cmp %o2, 0 40009578: 12 80 00 06 bne 40009590 <_Scheduler_priority_Schedule_body+0xb8><== ALWAYS TAKEN 4000957c: 84 10 20 01 mov 1, %g2 40009580: c2 08 60 70 ldub [ %g1 + 0x70 ], %g1 <== NOT EXECUTED 40009584: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED 40009588: 02 80 00 03 be 40009594 <_Scheduler_priority_Schedule_body+0xbc><== NOT EXECUTED 4000958c: 01 00 00 00 nop <== NOT EXECUTED _Thread_Dispatch_necessary = true; 40009590: c4 29 a0 14 stb %g2, [ %g6 + 0x14 ] 40009594: 81 c3 e0 08 retl =============================================================================== 4000a1b0 <_Scheduler_simple_Block>: ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 4000a1b0: c4 02 40 00 ld [ %o1 ], %g2 previous = the_node->previous; 4000a1b4: c2 02 60 04 ld [ %o1 + 4 ], %g1 next->previous = previous; 4000a1b8: c2 20 a0 04 st %g1, [ %g2 + 4 ] previous->next = next; 4000a1bc: c4 20 40 00 st %g2, [ %g1 ] { ( *extract )( scheduler, the_thread ); /* TODO: flash critical section? */ if ( _Thread_Is_executing( the_thread ) || _Thread_Is_heir( the_thread ) ) { 4000a1c0: c4 01 a0 18 ld [ %g6 + 0x18 ], %g2 4000a1c4: 80 a2 40 02 cmp %o1, %g2 4000a1c8: 02 80 00 06 be 4000a1e0 <_Scheduler_simple_Block+0x30> 4000a1cc: 94 10 20 01 mov 1, %o2 4000a1d0: c2 01 a0 1c ld [ %g6 + 0x1c ], %g1 4000a1d4: 80 a2 40 01 cmp %o1, %g1 4000a1d8: 12 80 00 05 bne 4000a1ec <_Scheduler_simple_Block+0x3c> <== ALWAYS TAKEN 4000a1dc: 01 00 00 00 nop ( *schedule )( scheduler, the_thread, true ); 4000a1e0: 82 13 c0 00 mov %o7, %g1 4000a1e4: 7f ff ff e3 call 4000a170 <_Scheduler_simple_Schedule_body> 4000a1e8: 9e 10 40 00 mov %g1, %o7 4000a1ec: 81 c3 e0 08 retl =============================================================================== 4000a2c4 <_Scheduler_simple_Schedule>: */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 4000a2c4: c2 02 00 00 ld [ %o0 ], %g1 4000a2c8: c4 00 40 00 ld [ %g1 ], %g2 RTEMS_INLINE_ROUTINE void _Scheduler_Update_heir( Thread_Control *heir, bool force_dispatch ) { Thread_Control *executing = _Thread_Executing; 4000a2cc: c2 01 a0 18 ld [ %g6 + 0x18 ], %g1 _Thread_Heir = heir; if ( executing != heir && ( force_dispatch || executing->is_preemptible ) ) 4000a2d0: 80 a0 40 02 cmp %g1, %g2 4000a2d4: 02 80 00 07 be 4000a2f0 <_Scheduler_simple_Schedule+0x2c> 4000a2d8: c4 21 a0 1c st %g2, [ %g6 + 0x1c ] 4000a2dc: c2 08 60 70 ldub [ %g1 + 0x70 ], %g1 4000a2e0: 80 a0 60 00 cmp %g1, 0 4000a2e4: 02 80 00 03 be 4000a2f0 <_Scheduler_simple_Schedule+0x2c> <== ALWAYS TAKEN 4000a2e8: 84 10 20 01 mov 1, %g2 _Thread_Dispatch_necessary = true; 4000a2ec: c4 29 a0 14 stb %g2, [ %g6 + 0x14 ] <== NOT EXECUTED 4000a2f0: 81 c3 e0 08 retl =============================================================================== 4000a170 <_Scheduler_simple_Schedule_body>: */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 4000a170: c2 02 00 00 ld [ %o0 ], %g1 4000a174: c4 00 40 00 ld [ %g1 ], %g2 RTEMS_INLINE_ROUTINE void _Scheduler_Update_heir( Thread_Control *heir, bool force_dispatch ) { Thread_Control *executing = _Thread_Executing; 4000a178: c2 01 a0 18 ld [ %g6 + 0x18 ], %g1 _Thread_Heir = heir; if ( executing != heir && ( force_dispatch || executing->is_preemptible ) ) 4000a17c: 80 a0 40 02 cmp %g1, %g2 4000a180: 02 80 00 0a be 4000a1a8 <_Scheduler_simple_Schedule_body+0x38><== NEVER TAKEN 4000a184: c4 21 a0 1c st %g2, [ %g6 + 0x1c ] 4000a188: 80 a2 a0 00 cmp %o2, 0 4000a18c: 12 80 00 06 bne 4000a1a4 <_Scheduler_simple_Schedule_body+0x34><== ALWAYS TAKEN 4000a190: 84 10 20 01 mov 1, %g2 4000a194: c2 08 60 70 ldub [ %g1 + 0x70 ], %g1 <== NOT EXECUTED 4000a198: 80 a0 60 00 cmp %g1, 0 <== NOT EXECUTED 4000a19c: 02 80 00 03 be 4000a1a8 <_Scheduler_simple_Schedule_body+0x38><== NOT EXECUTED 4000a1a0: 01 00 00 00 nop <== NOT EXECUTED _Thread_Dispatch_necessary = true; 4000a1a4: c4 29 a0 14 stb %g2, [ %g6 + 0x14 ] 4000a1a8: 81 c3 e0 08 retl =============================================================================== 4000a390 <_Scheduler_simple_Yield>: { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 4000a390: c2 02 60 04 ld [ %o1 + 4 ], %g1 ) { Chain_Node *next; Chain_Node *previous; next = the_node->next; 4000a394: c6 02 40 00 ld [ %o1 ], %g3 4000a398: c4 02 00 00 ld [ %o0 ], %g2 previous = the_node->previous; next->previous = previous; 4000a39c: c2 20 e0 04 st %g1, [ %g3 + 4 ] previous->next = next; 4000a3a0: c6 20 40 00 st %g3, [ %g1 ] */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 4000a3a4: c2 00 80 00 ld [ %g2 ], %g1 Chain_Control *chain, Chain_Node *to_insert, Chain_Node_order order ) { const Chain_Node *tail = _Chain_Immutable_tail( chain ); 4000a3a8: 9a 00 a0 04 add %g2, 4, %o5 Chain_Node *next = _Chain_First( chain ); while ( next != tail && !( *order )( to_insert, next ) ) { 4000a3ac: 80 a0 40 0d cmp %g1, %o5 4000a3b0: 32 80 00 0f bne,a 4000a3ec <_Scheduler_simple_Yield+0x5c><== ALWAYS TAKEN 4000a3b4: c8 02 60 14 ld [ %o1 + 0x14 ], %g4 Chain_Node *to_insert, Chain_Node_order order ) { const Chain_Node *tail = _Chain_Immutable_tail( chain ); Chain_Node *next = _Chain_First( chain ); 4000a3b8: c2 00 60 04 ld [ %g1 + 4 ], %g1 <== NOT EXECUTED ) { Chain_Node *before_node; the_node->previous = after_node; before_node = after_node->next; 4000a3bc: c6 00 40 00 ld [ %g1 ], %g3 Chain_Node *the_node ) { Chain_Node *before_node; the_node->previous = after_node; 4000a3c0: c2 22 60 04 st %g1, [ %o1 + 4 ] before_node = after_node->next; after_node->next = the_node; 4000a3c4: d2 20 40 00 st %o1, [ %g1 ] the_node->next = before_node; 4000a3c8: c6 22 40 00 st %g3, [ %o1 ] */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 4000a3cc: c4 00 80 00 ld [ %g2 ], %g2 the_node->previous = after_node; before_node = after_node->next; after_node->next = the_node; the_node->next = before_node; before_node->previous = the_node; 4000a3d0: d2 20 e0 04 st %o1, [ %g3 + 4 ] RTEMS_INLINE_ROUTINE void _Scheduler_Update_heir( Thread_Control *heir, bool force_dispatch ) { Thread_Control *executing = _Thread_Executing; 4000a3d4: c2 01 a0 18 ld [ %g6 + 0x18 ], %g1 _Thread_Heir = heir; if ( executing != heir && ( force_dispatch || executing->is_preemptible ) ) 4000a3d8: 80 a0 40 02 cmp %g1, %g2 4000a3dc: 12 80 00 0a bne 4000a404 <_Scheduler_simple_Yield+0x74> 4000a3e0: c4 21 a0 1c st %g2, [ %g6 + 0x1c ] 4000a3e4: 81 c3 e0 08 retl 4000a3e8: 01 00 00 00 nop ) { const Chain_Node *tail = _Chain_Immutable_tail( chain ); Chain_Node *next = _Chain_First( chain ); while ( next != tail && !( *order )( to_insert, next ) ) { 4000a3ec: c6 00 60 14 ld [ %g1 + 0x14 ], %g3 4000a3f0: 80 a1 00 03 cmp %g4, %g3 4000a3f4: 2a bf ff f2 bcs,a 4000a3bc <_Scheduler_simple_Yield+0x2c> 4000a3f8: c2 00 60 04 ld [ %g1 + 4 ], %g1 Chain_Node *to_insert, Chain_Node_order order ) { const Chain_Node *tail = _Chain_Immutable_tail( chain ); Chain_Node *next = _Chain_First( chain ); 4000a3fc: 10 bf ff ec b 4000a3ac <_Scheduler_simple_Yield+0x1c> 4000a400: c2 00 40 00 ld [ %g1 ], %g1 4000a404: c2 08 60 70 ldub [ %g1 + 0x70 ], %g1 4000a408: 80 a0 60 00 cmp %g1, 0 4000a40c: 02 bf ff f6 be 4000a3e4 <_Scheduler_simple_Yield+0x54> <== ALWAYS TAKEN 4000a410: 84 10 20 01 mov 1, %g2 _Thread_Dispatch_necessary = true; 4000a414: c4 29 a0 14 stb %g2, [ %g6 + 0x14 ] <== NOT EXECUTED 4000a418: 81 c3 e0 08 retl <== NOT EXECUTED =============================================================================== 4000ef50 <_Signal_Action_handler>: Thread_Control *executing, Thread_Action *action, Per_CPU_Control *cpu, ISR_Level level ) { 4000ef50: 9d e3 bf 98 save %sp, -104, %sp RTEMS_INLINE_ROUTINE void _Thread_Action_release_and_ISR_enable( Per_CPU_Control *cpu, ISR_Level level ) { _Per_CPU_Release_and_ISR_enable( cpu, level ); 4000ef54: 7f ff cd 3b call 40002440 4000ef58: 90 10 00 1b mov %i3, %o0 Modes_Control prev_mode; (void) action; _Thread_Action_release_and_ISR_enable( cpu, level ); api = executing->API_Extensions[ THREAD_API_RTEMS ]; 4000ef5c: fa 06 21 2c ld [ %i0 + 0x12c ], %i5 if ( !api ) 4000ef60: 80 a7 60 00 cmp %i5, 0 4000ef64: 02 80 00 1c be 4000efd4 <_Signal_Action_handler+0x84> <== NEVER TAKEN 4000ef68: 01 00 00 00 nop { #if defined( RTEMS_SMP ) _SMP_lock_ISR_disable_and_acquire( &lock->lock, &context->lock_context ); #else (void) lock; _ISR_Disable( context->isr_level ); 4000ef6c: 7f ff cd 32 call 40002434 4000ef70: 01 00 00 00 nop { rtems_signal_set signal_set; ISR_lock_Context lock_context; _ISR_lock_ISR_disable_and_acquire( &asr->Lock, &lock_context ); signal_set = asr->signals_posted; 4000ef74: f8 07 60 14 ld [ %i5 + 0x14 ], %i4 asr->signals_posted = 0; 4000ef78: c0 27 60 14 clr [ %i5 + 0x14 ] { #if defined( RTEMS_SMP ) _SMP_lock_Release_and_ISR_enable( &lock->lock, &context->lock_context ); #else (void) lock; _ISR_Enable( context->isr_level ); 4000ef7c: 7f ff cd 31 call 40002440 4000ef80: 01 00 00 00 nop */ asr = &api->Signal; signal_set = _ASR_Get_posted_signals( asr ); if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ 4000ef84: 80 a7 20 00 cmp %i4, 0 4000ef88: 02 80 00 13 be 4000efd4 <_Signal_Action_handler+0x84> <== NEVER TAKEN 4000ef8c: 94 07 bf fc add %fp, -4, %o2 return; asr->nest_level += 1; 4000ef90: c2 07 60 1c ld [ %i5 + 0x1c ], %g1 rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 4000ef94: d0 07 60 10 ld [ %i5 + 0x10 ], %o0 signal_set = _ASR_Get_posted_signals( asr ); if ( !signal_set ) /* similar to _ASR_Are_signals_pending( asr ) */ return; asr->nest_level += 1; 4000ef98: 82 00 60 01 inc %g1 4000ef9c: c2 27 60 1c st %g1, [ %i5 + 0x1c ] rtems_task_mode( asr->mode_set, RTEMS_ALL_MODE_MASKS, &prev_mode ); 4000efa0: 37 00 00 3f sethi %hi(0xfc00), %i3 4000efa4: 40 00 00 0e call 4000efdc 4000efa8: 92 16 e3 ff or %i3, 0x3ff, %o1 ! ffff <_TLS_Alignment+0xfffe> (*asr->handler)( signal_set ); 4000efac: c2 07 60 0c ld [ %i5 + 0xc ], %g1 4000efb0: 9f c0 40 00 call %g1 4000efb4: 90 10 00 1c mov %i4, %o0 asr->nest_level -= 1; 4000efb8: c2 07 60 1c ld [ %i5 + 0x1c ], %g1 rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 4000efbc: 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; 4000efc0: 82 00 7f ff add %g1, -1, %g1 rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 4000efc4: 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; 4000efc8: c2 27 60 1c st %g1, [ %i5 + 0x1c ] rtems_task_mode( prev_mode, RTEMS_ALL_MODE_MASKS, &prev_mode ); 4000efcc: 40 00 00 04 call 4000efdc 4000efd0: 94 07 bf fc add %fp, -4, %o2 4000efd4: 81 c7 e0 08 ret 4000efd8: 81 e8 00 00 restore =============================================================================== 40008598 <_TOD_Validate>: }; bool _TOD_Validate( const rtems_time_of_day *the_tod ) { 40008598: 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 / 4000859c: 03 10 00 5c sethi %hi(0x40017000), %g1 400085a0: d2 00 61 34 ld [ %g1 + 0x134 ], %o1 ! 40017134 400085a4: 11 00 03 d0 sethi %hi(0xf4000), %o0 400085a8: 40 00 32 8f call 40014fe4 <.udiv> 400085ac: 90 12 22 40 or %o0, 0x240, %o0 ! f4240 <_TLS_Alignment+0xf423f> rtems_configuration_get_microseconds_per_tick(); if ((!the_tod) || 400085b0: 80 a6 20 00 cmp %i0, 0 400085b4: 02 80 00 33 be 40008680 <_TOD_Validate+0xe8> <== NEVER TAKEN 400085b8: 82 10 20 00 clr %g1 400085bc: c4 06 20 18 ld [ %i0 + 0x18 ], %g2 400085c0: 80 a0 80 08 cmp %g2, %o0 400085c4: 3a 80 00 30 bcc,a 40008684 <_TOD_Validate+0xec> 400085c8: b0 08 60 01 and %g1, 1, %i0 (the_tod->ticks >= ticks_per_second) || 400085cc: c4 06 20 14 ld [ %i0 + 0x14 ], %g2 400085d0: 80 a0 a0 3b cmp %g2, 0x3b 400085d4: 38 80 00 2c bgu,a 40008684 <_TOD_Validate+0xec> 400085d8: b0 08 60 01 and %g1, 1, %i0 (the_tod->second >= TOD_SECONDS_PER_MINUTE) || 400085dc: c4 06 20 10 ld [ %i0 + 0x10 ], %g2 400085e0: 80 a0 a0 3b cmp %g2, 0x3b 400085e4: 38 80 00 28 bgu,a 40008684 <_TOD_Validate+0xec> 400085e8: b0 08 60 01 and %g1, 1, %i0 (the_tod->minute >= TOD_MINUTES_PER_HOUR) || 400085ec: c4 06 20 0c ld [ %i0 + 0xc ], %g2 400085f0: 80 a0 a0 17 cmp %g2, 0x17 400085f4: 38 80 00 24 bgu,a 40008684 <_TOD_Validate+0xec> 400085f8: b0 08 60 01 and %g1, 1, %i0 (the_tod->hour >= TOD_HOURS_PER_DAY) || (the_tod->month == 0) || 400085fc: f8 06 20 04 ld [ %i0 + 4 ], %i4 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) || 40008600: 84 07 3f ff add %i4, -1, %g2 40008604: 80 a0 a0 0b cmp %g2, 0xb 40008608: 38 80 00 1f bgu,a 40008684 <_TOD_Validate+0xec> 4000860c: b0 08 60 01 and %g1, 1, %i0 (the_tod->month == 0) || (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || 40008610: fa 06 00 00 ld [ %i0 ], %i5 (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) || 40008614: 80 a7 67 c3 cmp %i5, 0x7c3 40008618: 28 80 00 1b bleu,a 40008684 <_TOD_Validate+0xec> 4000861c: b0 08 60 01 and %g1, 1, %i0 (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) 40008620: f6 06 20 08 ld [ %i0 + 8 ], %i3 (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) || 40008624: 80 a6 e0 00 cmp %i3, 0 40008628: 02 80 00 16 be 40008680 <_TOD_Validate+0xe8> <== NEVER TAKEN 4000862c: 35 10 00 5f sethi %hi(0x40017c00), %i2 (the_tod->day == 0) ) return false; if (((the_tod->year % 4) == 0 && (the_tod->year % 100 != 0)) || 40008630: 80 8f 60 03 btst 3, %i5 40008634: 12 80 00 08 bne 40008654 <_TOD_Validate+0xbc> 40008638: b4 16 a1 d8 or %i2, 0x1d8, %i2 4000863c: 90 10 00 1d mov %i5, %o0 40008640: 40 00 33 15 call 40015294 <.urem> 40008644: 92 10 20 64 mov 0x64, %o1 40008648: 80 a2 20 00 cmp %o0, 0 4000864c: 32 80 00 09 bne,a 40008670 <_TOD_Validate+0xd8> 40008650: b8 07 20 0d add %i4, 0xd, %i4 (the_tod->year % 400 == 0)) 40008654: 90 10 00 1d mov %i5, %o0 40008658: 40 00 33 0f call 40015294 <.urem> 4000865c: 92 10 21 90 mov 0x190, %o1 (the_tod->month > TOD_MONTHS_PER_YEAR) || (the_tod->year < TOD_BASE_YEAR) || (the_tod->day == 0) ) return false; if (((the_tod->year % 4) == 0 && (the_tod->year % 100 != 0)) || 40008660: 80 a2 20 00 cmp %o0, 0 40008664: 32 80 00 04 bne,a 40008674 <_TOD_Validate+0xdc> 40008668: b9 2f 20 02 sll %i4, 2, %i4 (the_tod->year % 400 == 0)) days_in_month = _TOD_Days_per_month[ 1 ][ the_tod->month ]; 4000866c: b8 07 20 0d add %i4, 0xd, %i4 else days_in_month = _TOD_Days_per_month[ 0 ][ the_tod->month ]; 40008670: b9 2f 20 02 sll %i4, 2, %i4 40008674: c2 06 80 1c ld [ %i2 + %i4 ], %g1 if ( the_tod->day > days_in_month ) 40008678: 80 a0 40 1b cmp %g1, %i3 4000867c: 82 60 3f ff subx %g0, -1, %g1 return false; return true; } 40008680: b0 08 60 01 and %g1, 1, %i0 40008684: 81 c7 e0 08 ret 40008688: 81 e8 00 00 restore =============================================================================== 40008a08 <_Terminate>: void _Terminate( Internal_errors_Source the_source, bool is_internal, Internal_errors_t the_error ) { 40008a08: 9d e3 bf 90 save %sp, -112, %sp ISR_Level level; _ISR_Disable_without_giant( level ); 40008a0c: 7f ff e6 8a call 40002434 40008a10: 01 00 00 00 nop Internal_errors_t error ) { User_extensions_Fatal_context ctx = { source, is_internal, error }; _User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor ); 40008a14: 13 10 00 2b sethi %hi(0x4000ac00), %o1 40008a18: 90 07 bf f4 add %fp, -12, %o0 40008a1c: 92 12 61 ec or %o1, 0x1ec, %o1 Internal_errors_Source source, bool is_internal, Internal_errors_t error ) { User_extensions_Fatal_context ctx = { source, is_internal, error }; 40008a20: f0 27 bf f4 st %i0, [ %fp + -12 ] 40008a24: f2 2f bf f8 stb %i1, [ %fp + -8 ] _User_extensions_Iterate( &ctx, _User_extensions_Fatal_visitor ); 40008a28: 40 00 09 05 call 4000ae3c <_User_extensions_Iterate> 40008a2c: f4 27 bf fc st %i2, [ %fp + -4 ] _SMP_Request_shutdown(); _User_extensions_Fatal( the_source, is_internal, the_error ); _Internal_errors_What_happened.the_source = the_source; 40008a30: 05 10 00 62 sethi %hi(0x40018800), %g2 <== NOT EXECUTED 40008a34: 82 10 a0 e8 or %g2, 0xe8, %g1 ! 400188e8 <_Internal_errors_What_happened><== NOT EXECUTED 40008a38: f0 20 a0 e8 st %i0, [ %g2 + 0xe8 ] <== NOT EXECUTED _Internal_errors_What_happened.is_internal = is_internal; 40008a3c: f2 28 60 04 stb %i1, [ %g1 + 4 ] <== NOT EXECUTED _Internal_errors_What_happened.the_error = the_error; 40008a40: 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; 40008a44: 84 10 20 03 mov 3, %g2 <== NOT EXECUTED 40008a48: 03 10 00 62 sethi %hi(0x40018800), %g1 <== NOT EXECUTED _System_state_Set( SYSTEM_STATE_TERMINATED ); _CPU_Fatal_halt( the_error ); 40008a4c: 7f ff e6 7a call 40002434 <== NOT EXECUTED 40008a50: c4 20 60 f4 st %g2, [ %g1 + 0xf4 ] ! 400188f4 <_System_state_Current><== NOT EXECUTED 40008a54: 82 10 00 08 mov %o0, %g1 <== NOT EXECUTED 40008a58: 30 80 00 00 b,a 40008a58 <_Terminate+0x50> <== NOT EXECUTED =============================================================================== 40009a64 <_Thread_Change_priority>: void _Thread_Change_priority( Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { 40009a64: 9d e3 bf 98 save %sp, -104, %sp /* * Do not bother recomputing all the priority related information if * we are not REALLY changing priority. */ if ( the_thread->current_priority != new_priority ) { 40009a68: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 40009a6c: 80 a0 40 19 cmp %g1, %i1 40009a70: 02 80 00 3d be 40009b64 <_Thread_Change_priority+0x100> 40009a74: 01 00 00 00 nop ISR_Level level; const Scheduler_Control *scheduler; _ISR_Disable( level ); 40009a78: 7f ff e2 6f call 40002434 40009a7c: 01 00 00 00 nop 40009a80: ba 10 00 08 mov %o0, %i5 scheduler = _Scheduler_Get( the_thread ); the_thread->current_priority = new_priority; if ( _States_Is_ready( the_thread->current_state ) ) { 40009a84: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 const Scheduler_Control *scheduler; _ISR_Disable( level ); scheduler = _Scheduler_Get( the_thread ); the_thread->current_priority = new_priority; 40009a88: f2 26 20 14 st %i1, [ %i0 + 0x14 ] if ( _States_Is_ready( the_thread->current_state ) ) { 40009a8c: 80 a0 60 00 cmp %g1, 0 40009a90: 03 10 00 55 sethi %hi(0x40015400), %g1 40009a94: 12 80 00 12 bne 40009adc <_Thread_Change_priority+0x78> 40009a98: 90 10 62 6c or %g1, 0x26c, %o0 ! 4001566c <_Scheduler_Table> Thread_Control *the_thread, Priority_Control new_priority, bool prepend_it ) { ( *scheduler->Operations.change_priority )( 40009a9c: c4 02 20 18 ld [ %o0 + 0x18 ], %g2 40009aa0: 92 10 00 18 mov %i0, %o1 40009aa4: 94 10 00 19 mov %i1, %o2 40009aa8: 9f c0 80 00 call %g2 40009aac: 96 10 00 1a mov %i2, %o3 the_thread, new_priority, prepend_it ); _ISR_Flash( level ); 40009ab0: 7f ff e2 64 call 40002440 40009ab4: 90 10 00 1d mov %i5, %o0 40009ab8: 7f ff e2 5f call 40002434 40009abc: 01 00 00 00 nop 40009ac0: ba 10 00 08 mov %o0, %i5 RTEMS_INLINE_ROUTINE void _Scheduler_Schedule( const Scheduler_Control *scheduler, Thread_Control *the_thread ) { ( *scheduler->Operations.schedule )( scheduler, the_thread ); 40009ac4: 11 10 00 55 sethi %hi(0x40015400), %o0 40009ac8: 90 12 22 6c or %o0, 0x26c, %o0 ! 4001566c <_Scheduler_Table> 40009acc: c2 02 20 08 ld [ %o0 + 8 ], %g1 40009ad0: 9f c0 40 00 call %g1 40009ad4: 92 10 00 18 mov %i0, %o1 40009ad8: 30 80 00 05 b,a 40009aec <_Thread_Change_priority+0x88> const Scheduler_Control *scheduler, Thread_Control *the_thread, Priority_Control new_priority ) { ( *scheduler->Operations.update_priority )( 40009adc: c4 02 20 24 ld [ %o0 + 0x24 ], %g2 40009ae0: 92 10 00 18 mov %i0, %o1 40009ae4: 9f c0 80 00 call %g2 40009ae8: 94 10 00 19 mov %i1, %o2 scheduler = _Scheduler_Get( the_thread ); _Scheduler_Schedule( scheduler, the_thread ); } else { _Scheduler_Update_priority( scheduler, the_thread, new_priority ); } _ISR_Enable( level ); 40009aec: 7f ff e2 55 call 40002440 40009af0: 90 10 00 1d mov %i5, %o0 _Thread_queue_Requeue( the_thread->Wait.queue, the_thread ); 40009af4: fa 06 20 44 ld [ %i0 + 0x44 ], %i5 { /* * Just in case the thread really wasn't blocked on a thread queue * when we get here. */ if ( !the_thread_queue ) 40009af8: 80 a7 60 00 cmp %i5, 0 40009afc: 02 80 00 1a be 40009b64 <_Thread_Change_priority+0x100> 40009b00: 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 ) { 40009b04: c2 07 60 34 ld [ %i5 + 0x34 ], %g1 40009b08: 80 a0 60 01 cmp %g1, 1 40009b0c: 12 80 00 16 bne 40009b64 <_Thread_Change_priority+0x100> 40009b10: 01 00 00 00 nop Thread_queue_Control *tq = the_thread_queue; ISR_Level level; ISR_Level level_ignored; _ISR_Disable( level ); 40009b14: 7f ff e2 48 call 40002434 40009b18: 01 00 00 00 nop 40009b1c: b8 10 00 08 mov %o0, %i4 */ RTEMS_INLINE_ROUTINE bool _States_Is_waiting_on_thread_queue ( States_Control the_states ) { return (the_states & STATES_WAITING_ON_THREAD_QUEUE); 40009b20: c4 06 20 10 ld [ %i0 + 0x10 ], %g2 if ( _States_Is_waiting_on_thread_queue( the_thread->current_state ) ) { 40009b24: 03 00 02 ef sethi %hi(0xbbc00), %g1 40009b28: 82 10 62 e0 or %g1, 0x2e0, %g1 ! bbee0 <_TLS_Alignment+0xbbedf> 40009b2c: 80 88 80 01 btst %g2, %g1 40009b30: 02 80 00 0b be 40009b5c <_Thread_Change_priority+0xf8> <== NEVER TAKEN 40009b34: 82 10 20 01 mov 1, %g1 _Thread_queue_Enter_critical_section( tq ); _Thread_queue_Extract_priority_helper( 40009b38: d2 06 20 34 ld [ %i0 + 0x34 ], %o1 40009b3c: 90 10 00 18 mov %i0, %o0 40009b40: 94 10 20 01 mov 1, %o2 40009b44: 40 00 02 76 call 4000a51c <_Thread_queue_Extract_priority_helper> 40009b48: c2 27 60 30 st %g1, [ %i5 + 0x30 ] the_thread, the_thread->Wait.return_code, true ); (void) _Thread_queue_Enqueue_priority( tq, the_thread, &level_ignored ); 40009b4c: 90 10 00 1d mov %i5, %o0 40009b50: 92 10 00 18 mov %i0, %o1 40009b54: 40 00 02 0f call 4000a390 <_Thread_queue_Enqueue_priority> 40009b58: 94 07 bf fc add %fp, -4, %o2 } _ISR_Enable( level ); 40009b5c: 7f ff e2 39 call 40002440 40009b60: 90 10 00 1c mov %i4, %o0 40009b64: 81 c7 e0 08 ret 40009b68: 81 e8 00 00 restore =============================================================================== 4000aa78 <_Thread_Close>: } } } void _Thread_Close( Thread_Control *the_thread, Thread_Control *executing ) { 4000aa78: 9d e3 bf a0 save %sp, -96, %sp _Assert( _Thread_Is_life_protected( executing->Life.state ) ); _Objects_Close( 4000aa7c: d0 06 20 08 ld [ %i0 + 8 ], %o0 4000aa80: 7f ff f9 31 call 40008f44 <_Objects_Get_information_id> 4000aa84: ba 10 00 18 mov %i0, %i5 4000aa88: 7f ff f8 46 call 40008ba0 <_Objects_Close> 4000aa8c: 92 10 00 18 mov %i0, %o1 */ RTEMS_INLINE_ROUTINE bool _States_Is_dormant ( States_Control the_states ) { return (the_states & STATES_DORMANT); 4000aa90: c2 06 20 10 ld [ %i0 + 0x10 ], %g1 _Objects_Get_information_id( the_thread->Object.id ), &the_thread->Object ); if ( _States_Is_dormant( the_thread->current_state ) ) { 4000aa94: 80 88 60 01 btst 1, %g1 4000aa98: 02 80 00 04 be 4000aaa8 <_Thread_Close+0x30> 4000aa9c: 80 a6 00 19 cmp %i0, %i1 _Thread_Make_zombie( the_thread ); 4000aaa0: 7f ff ff 0c call 4000a6d0 <_Thread_Make_zombie> 4000aaa4: 81 e8 00 00 restore } else { if ( 4000aaa8: 22 80 00 0b be,a 4000aad4 <_Thread_Close+0x5c> 4000aaac: f4 06 60 14 ld [ %i1 + 0x14 ], %i2 RTEMS_INLINE_ROUTINE bool _Thread_Is_life_terminating( Thread_Life_state life_state ) { return ( life_state & THREAD_LIFE_TERMINATING ) != 0; 4000aab0: c2 06 61 50 ld [ %i1 + 0x150 ], %g1 the_thread != executing && !_Thread_Is_life_terminating( executing->Life.state ) 4000aab4: 80 88 60 04 btst 4, %g1 4000aab8: 32 80 00 07 bne,a 4000aad4 <_Thread_Close+0x5c> <== NEVER TAKEN 4000aabc: f4 06 60 14 ld [ %i1 + 0x14 ], %i2 <== NOT EXECUTED /* * Wait for termination of victim thread. If the executing thread is * also terminated, then do not wait. This avoids potential cyclic * dependencies and thus dead lock. */ the_thread->Life.terminator = executing; 4000aac0: f2 26 21 54 st %i1, [ %i0 + 0x154 ] _Thread_Set_state( executing, STATES_WAITING_FOR_TERMINATION ); 4000aac4: 90 10 00 19 mov %i1, %o0 4000aac8: 40 00 00 2b call 4000ab74 <_Thread_Set_state> 4000aacc: 13 00 04 00 sethi %hi(0x100000), %o1 } _Thread_Request_life_change( 4000aad0: f4 06 60 14 ld [ %i1 + 0x14 ], %i2 4000aad4: b0 10 00 1d mov %i5, %i0 4000aad8: 7f ff ff 36 call 4000a7b0 <_Thread_Request_life_change> 4000aadc: 97 e8 20 04 restore %g0, 4, %o3 =============================================================================== 40009c68 <_Thread_Delay_ended>: void _Thread_Delay_ended( Objects_Id id, void *ignored __attribute__((unused)) ) { 40009c68: 9d e3 bf 98 save %sp, -104, %sp Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 40009c6c: 90 10 00 18 mov %i0, %o0 40009c70: 40 00 00 75 call 40009e44 <_Thread_Get> 40009c74: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 40009c78: c2 07 bf fc ld [ %fp + -4 ], %g1 40009c7c: 80 a0 60 00 cmp %g1, 0 40009c80: 12 80 00 07 bne 40009c9c <_Thread_Delay_ended+0x34> <== NEVER TAKEN 40009c84: 13 04 00 00 sethi %hi(0x10000000), %o1 #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_Clear_state( 40009c88: 7f ff ff b9 call 40009b6c <_Thread_Clear_state> 40009c8c: 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 disable_level = _Thread_Dispatch_disable_level; 40009c90: c4 01 a0 10 ld [ %g6 + 0x10 ], %g2 ISR_Level level; _ISR_Disable( level ); #endif --disable_level; 40009c94: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = disable_level; 40009c98: c4 21 a0 10 st %g2, [ %g6 + 0x10 ] 40009c9c: 81 c7 e0 08 ret 40009ca0: 81 e8 00 00 restore =============================================================================== 40009ca4 <_Thread_Dispatch>: _Thread_Action_release_and_ISR_enable( cpu_self, level ); } void _Thread_Dispatch( void ) { 40009ca4: 9d e3 bf 98 save %sp, -104, %sp #endif cpu_self = _Per_CPU_Get(); _Assert( cpu_self->thread_dispatch_disable_level == 0 ); _Profiling_Thread_dispatch_disable( cpu_self, 0 ); cpu_self->thread_dispatch_disable_level = 1; 40009ca8: 82 10 20 01 mov 1, %g1 * to this function. */ _ISR_Disable_without_giant( level ); #endif cpu_self = _Per_CPU_Get(); 40009cac: b6 10 00 06 mov %g6, %i3 _Assert( cpu_self->thread_dispatch_disable_level == 0 ); _Profiling_Thread_dispatch_disable( cpu_self, 0 ); cpu_self->thread_dispatch_disable_level = 1; 40009cb0: c2 21 a0 10 st %g1, [ %g6 + 0x10 ] * Now determine if we need to perform a dispatch on the current CPU. */ executing = cpu_self->executing; #if !defined( RTEMS_SMP ) _ISR_Disable( level ); 40009cb4: 7f ff e1 e0 call 40002434 40009cb8: e6 01 a0 18 ld [ %g6 + 0x18 ], %l3 */ static inline void _TOD_Get_uptime( Timestamp_Control *time ) { _TOD_Get_with_nanoseconds( time, &_TOD.uptime ); 40009cbc: 23 10 00 61 sethi %hi(0x40018400), %l1 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 40009cc0: 33 10 00 5b sethi %hi(0x40016c00), %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 = rtems_configuration_get_ticks_per_timeslice(); 40009cc4: 21 10 00 55 sethi %hi(0x40015400), %l0 40009cc8: b2 16 60 18 or %i1, 0x18, %i1 40009ccc: a2 14 60 08 or %l1, 8, %l1 { const Chain_Control *chain = &_User_extensions_Switches_list; const Chain_Node *tail = _Chain_Immutable_tail( chain ); const Chain_Node *node = _Chain_Immutable_first( chain ); if ( node != tail ) { 40009cd0: b0 06 60 04 add %i1, 4, %i0 if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 40009cd4: a4 04 e0 d0 add %l3, 0xd0, %l2 #endif #if defined( RTEMS_SMP ) if ( cpu_self->dispatch_necessary ) { #else while ( cpu_self->dispatch_necessary ) { 40009cd8: c2 0e e0 14 ldub [ %i3 + 0x14 ], %g1 40009cdc: 80 a0 60 00 cmp %g1, 0 40009ce0: 02 80 00 07 be 40009cfc <_Thread_Dispatch+0x58> 40009ce4: 01 00 00 00 nop * _Scheduler_SMP_Update_heir(). */ _Atomic_Fence( ATOMIC_ORDER_SEQ_CST ); #endif heir = cpu_self->heir; 40009ce8: e8 06 e0 1c ld [ %i3 + 0x1c ], %l4 Per_CPU_Control *cpu_self ) { Thread_Control *heir; cpu_self->dispatch_necessary = false; 40009cec: c0 2e e0 14 clrb [ %i3 + 0x14 ] /* * 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 ) 40009cf0: 80 a5 00 13 cmp %l4, %l3 40009cf4: 12 80 00 10 bne 40009d34 <_Thread_Dispatch+0x90> 40009cf8: e8 26 e0 18 st %l4, [ %i3 + 0x18 ] #endif } post_switch: _Assert( cpu_self->thread_dispatch_disable_level == 1 ); cpu_self->thread_dispatch_disable_level = 0; 40009cfc: c0 26 e0 10 clr [ %i3 + 0x10 ] _Profiling_Thread_dispatch_enable( cpu_self, 0 ); _ISR_Enable_without_giant( level ); 40009d00: 7f ff e1 d0 call 40002440 40009d04: 01 00 00 00 nop ISR_Level *level ) { Per_CPU_Control *cpu; _ISR_Disable_without_giant( *level ); 40009d08: 7f ff e1 cb call 40002434 40009d0c: 01 00 00 00 nop 40009d10: 96 10 00 08 mov %o0, %o3 40009d14: d2 04 e0 c4 ld [ %l3 + 0xc4 ], %o1 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 40009d18: ba 04 e0 c8 add %l3, 0xc8, %i5 #if defined(RTEMS_SMP) return thread->cpu; #else (void) thread; return _Per_CPU_Get(); 40009d1c: 94 10 00 06 mov %g6, %o2 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 40009d20: 80 a2 40 1d cmp %o1, %i5 40009d24: 12 80 00 35 bne 40009df8 <_Thread_Dispatch+0x154> 40009d28: b8 04 e0 c4 add %l3, 0xc4, %i4 return _Chain_Get_first_unprotected(the_chain); else return NULL; 40009d2c: 10 80 00 25 b 40009dc0 <_Thread_Dispatch+0x11c> 40009d30: 92 10 20 00 clr %o1 */ #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 ) 40009d34: c2 05 20 78 ld [ %l4 + 0x78 ], %g1 40009d38: 80 a0 60 01 cmp %g1, 1 40009d3c: 12 80 00 04 bne 40009d4c <_Thread_Dispatch+0xa8> 40009d40: 82 14 21 88 or %l0, 0x188, %g1 heir->cpu_time_budget = rtems_configuration_get_ticks_per_timeslice(); 40009d44: c2 00 60 1c ld [ %g1 + 0x1c ], %g1 40009d48: c2 25 20 74 st %g1, [ %l4 + 0x74 ] #if !defined( RTEMS_SMP ) _ISR_Enable( level ); 40009d4c: 7f ff e1 bd call 40002440 40009d50: 01 00 00 00 nop 40009d54: 90 07 bf f8 add %fp, -8, %o0 40009d58: 7f ff f9 da call 400084c0 <_TOD_Get_with_nanoseconds> 40009d5c: 92 10 00 11 mov %l1, %o1 { Timestamp_Control uptime; Timestamp_Control ran; _TOD_Get_uptime( &uptime ); _Timestamp_Subtract( 40009d60: c4 1f bf f8 ldd [ %fp + -8 ], %g2 const Timestamp64_Control *_start, const Timestamp64_Control *_end, Timestamp64_Control *_result ) { *_result = *_end - *_start; 40009d64: f8 1e e0 20 ldd [ %i3 + 0x20 ], %i4 time_of_last_context_switch, &uptime, &ran ); *time_of_last_context_switch = uptime; 40009d68: c4 3e e0 20 std %g2, [ %i3 + 0x20 ] 40009d6c: ba a0 c0 1d subcc %g3, %i5, %i5 40009d70: b8 60 80 1c subx %g2, %i4, %i4 static inline void _Timestamp64_implementation_Add_to( Timestamp64_Control *_time, const Timestamp64_Control *_add ) { *_time += *_add; 40009d74: c4 1c e0 80 ldd [ %l3 + 0x80 ], %g2 40009d78: b6 80 c0 1d addcc %g3, %i5, %i3 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 40009d7c: fa 06 40 00 ld [ %i1 ], %i5 40009d80: b4 40 80 1c addx %g2, %i4, %i2 40009d84: f4 3c e0 80 std %i2, [ %l3 + 0x80 ] 40009d88: 80 a7 40 18 cmp %i5, %i0 40009d8c: 02 80 00 08 be 40009dac <_Thread_Dispatch+0x108> 40009d90: 90 10 00 12 mov %l2, %o0 while ( node != tail ) { const User_extensions_Switch_control *extension = (const User_extensions_Switch_control *) node; (*extension->thread_switch)( executing, heir ); 40009d94: c2 07 60 08 ld [ %i5 + 8 ], %g1 40009d98: 90 10 00 13 mov %l3, %o0 40009d9c: 9f c0 40 00 call %g1 40009da0: 92 10 00 14 mov %l4, %o1 Thread_Control *heir ) { const Chain_Control *chain = &_User_extensions_Switches_list; const Chain_Node *tail = _Chain_Immutable_tail( chain ); const Chain_Node *node = _Chain_Immutable_first( chain ); 40009da4: 10 bf ff f9 b 40009d88 <_Thread_Dispatch+0xe4> 40009da8: fa 07 40 00 ld [ %i5 ], %i5 if ( executing->fp_context != NULL ) _Context_Save_fp( &executing->fp_context ); #endif #endif _Context_Switch( &executing->Registers, &heir->Registers ); 40009dac: 40 00 2a c7 call 400148c8 <_CPU_Context_switch> 40009db0: 92 05 20 d0 add %l4, 0xd0, %o1 cpu_self = _Per_CPU_Get(); _Thread_Debug_set_real_processor( executing, cpu_self ); #if !defined( RTEMS_SMP ) _ISR_Disable( level ); 40009db4: 7f ff e1 a0 call 40002434 40009db8: b6 10 00 06 mov %g6, %i3 40009dbc: 30 bf ff c7 b,a 40009cd8 <_Thread_Dispatch+0x34> Thread_Action *action; cpu_self = _Thread_Action_ISR_disable_and_acquire( executing, &level ); action = _Thread_Get_post_switch_action( executing ); while ( action != NULL ) { 40009dc0: 80 a2 60 00 cmp %o1, 0 40009dc4: 02 80 00 11 be 40009e08 <_Thread_Dispatch+0x164> 40009dc8: 01 00 00 00 nop _Chain_Set_off_chain( &action->Node ); ( *action->handler )( executing, action, cpu_self, level ); 40009dcc: c2 02 60 08 ld [ %o1 + 8 ], %g1 */ RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain( Chain_Node *node ) { node->next = NULL; 40009dd0: c0 22 40 00 clr [ %o1 ] 40009dd4: 9f c0 40 00 call %g1 40009dd8: 90 10 00 13 mov %l3, %o0 ISR_Level *level ) { Per_CPU_Control *cpu; _ISR_Disable_without_giant( *level ); 40009ddc: 7f ff e1 96 call 40002434 40009de0: 01 00 00 00 nop 40009de4: 96 10 00 08 mov %o0, %o3 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 40009de8: d2 04 e0 c4 ld [ %l3 + 0xc4 ], %o1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_Get_unprotected( Chain_Control *the_chain ) { if ( !_Chain_Is_empty(the_chain)) 40009dec: 80 a2 40 1d cmp %o1, %i5 40009df0: 02 80 00 06 be 40009e08 <_Thread_Dispatch+0x164> <== ALWAYS TAKEN 40009df4: 94 10 00 06 mov %g6, %o2 Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *old_first = head->next; Chain_Node *new_first = old_first->next; 40009df8: c2 02 40 00 ld [ %o1 ], %g1 head->next = new_first; 40009dfc: c2 24 e0 c4 st %g1, [ %l3 + 0xc4 ] new_first->previous = head; 40009e00: 10 bf ff f0 b 40009dc0 <_Thread_Dispatch+0x11c> 40009e04: f8 20 60 04 st %i4, [ %g1 + 4 ] RTEMS_INLINE_ROUTINE void _Thread_Action_release_and_ISR_enable( Per_CPU_Control *cpu, ISR_Level level ) { _Per_CPU_Release_and_ISR_enable( cpu, level ); 40009e08: 7f ff e1 8e call 40002440 40009e0c: 90 10 00 0b mov %o3, %o0 40009e10: 81 c7 e0 08 ret 40009e14: 81 e8 00 00 restore =============================================================================== 4000f828 <_Thread_Handler>: return doCons; } #endif void _Thread_Handler( void ) { 4000f828: 9d e3 bf a0 save %sp, -96, %sp Thread_Control *executing; #if defined(EXECUTE_GLOBAL_CONSTRUCTORS) bool doCons; #endif executing = _Thread_Executing; 4000f82c: fa 01 a0 18 ld [ %g6 + 0x18 ], %i5 /* * 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(); 4000f830: 3f 10 00 3e sethi %hi(0x4000f800), %i7 4000f834: be 17 e0 28 or %i7, 0x28, %i7 ! 4000f828 <_Thread_Handler> #if !defined(RTEMS_SMP) /* * have to put level into a register for those cpu's that use * inline asm here */ level = executing->Start.isr_level; 4000f838: d0 07 60 a8 ld [ %i5 + 0xa8 ], %o0 _ISR_Set_level( level ); 4000f83c: 7f ff cb 01 call 40002440 4000f840: 91 2a 20 08 sll %o0, 8, %o0 && _Objects_Get_API( executing->Object.id ) != OBJECTS_INTERNAL_API; if (doCons) doneConstructors = true; #else (void) executing; doCons = !doneConstructors; 4000f844: 03 10 00 5f sethi %hi(0x40017c00), %g1 doneConstructors = true; 4000f848: 84 10 20 01 mov 1, %g2 && _Objects_Get_API( executing->Object.id ) != OBJECTS_INTERNAL_API; if (doCons) doneConstructors = true; #else (void) executing; doCons = !doneConstructors; 4000f84c: f8 08 62 c8 ldub [ %g1 + 0x2c8 ], %i4 ); } static inline void _User_extensions_Thread_begin( Thread_Control *executing ) { _User_extensions_Iterate( 4000f850: 90 10 00 1d mov %i5, %o0 4000f854: 13 10 00 2b sethi %hi(0x4000ac00), %o1 4000f858: 92 12 61 a4 or %o1, 0x1a4, %o1 ! 4000ada4 <_User_extensions_Thread_begin_visitor> 4000f85c: 7f ff ed 78 call 4000ae3c <_User_extensions_Iterate> 4000f860: c4 28 62 c8 stb %g2, [ %g1 + 0x2c8 ] * no thread dispatch necessary update. */ _Thread_Dispatch(); } #else _Thread_Enable_dispatch(); 4000f864: 7f ff e9 6d call 40009e18 <_Thread_Enable_dispatch> 4000f868: 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) */ { 4000f86c: 80 8f 20 ff btst 0xff, %i4 4000f870: 32 80 00 05 bne,a 4000f884 <_Thread_Handler+0x5c> 4000f874: c2 07 60 90 ld [ %i5 + 0x90 ], %g1 INIT_NAME (); 4000f878: 40 00 1c 7c call 40016a68 <_init> 4000f87c: 01 00 00 00 nop /* * RTEMS supports multiple APIs and each API can define a different * thread/task prototype. The following code supports invoking the * user thread entry point using the prototype expected. */ if ( executing->Start.prototype == THREAD_START_NUMERIC ) { 4000f880: c2 07 60 90 ld [ %i5 + 0x90 ], %g1 4000f884: 80 a0 60 00 cmp %g1, 0 4000f888: 12 80 00 05 bne 4000f89c <_Thread_Handler+0x74> 4000f88c: 80 a0 60 01 cmp %g1, 1 executing->Wait.return_argument = (*(Thread_Entry_numeric) executing->Start.entry_point)( 4000f890: c2 07 60 8c ld [ %i5 + 0x8c ], %g1 4000f894: 10 80 00 06 b 4000f8ac <_Thread_Handler+0x84> 4000f898: 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 ) { 4000f89c: 12 80 00 08 bne 4000f8bc <_Thread_Handler+0x94> <== NEVER TAKEN 4000f8a0: 90 10 00 1d mov %i5, %o0 executing->Wait.return_argument = (*(Thread_Entry_pointer) executing->Start.entry_point)( 4000f8a4: c2 07 60 8c ld [ %i5 + 0x8c ], %g1 4000f8a8: d0 07 60 94 ld [ %i5 + 0x94 ], %o0 4000f8ac: 9f c0 40 00 call %g1 4000f8b0: 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 = 4000f8b4: d0 27 60 28 st %o0, [ %i5 + 0x28 ] } } static inline void _User_extensions_Thread_exitted( Thread_Control *executing ) { _User_extensions_Iterate( 4000f8b8: 90 10 00 1d mov %i5, %o0 4000f8bc: 13 10 00 2b sethi %hi(0x4000ac00), %o1 4000f8c0: 7f ff ed 5f call 4000ae3c <_User_extensions_Iterate> 4000f8c4: 92 12 61 c8 or %o1, 0x1c8, %o1 ! 4000adc8 <_User_extensions_Thread_exitted_visitor> * able to fit in a (void *). */ _User_extensions_Thread_exitted( executing ); _Terminate( 4000f8c8: 90 10 20 00 clr %o0 4000f8cc: 92 10 20 01 mov 1, %o1 4000f8d0: 7f ff e4 4e call 40008a08 <_Terminate> 4000f8d4: 94 10 20 05 mov 5, %o2 =============================================================================== 4000a11c <_Thread_Handler_initialization>: #include #include void _Thread_Handler_initialization(void) { 4000a11c: 9d e3 bf 98 save %sp, -104, %sp rtems_stack_allocate_init_hook stack_allocate_init_hook = 4000a120: 03 10 00 55 sethi %hi(0x40015400), %g1 4000a124: 82 10 61 88 or %g1, 0x188, %g1 ! 40015588 #if defined(RTEMS_MULTIPROCESSING) uint32_t maximum_proxies = _Configuration_MP_table->maximum_proxies; #endif if ( rtems_configuration_get_stack_allocate_hook() == NULL || 4000a128: c6 00 60 30 ld [ %g1 + 0x30 ], %g3 4000a12c: 80 a0 e0 00 cmp %g3, 0 4000a130: 02 80 00 06 be 4000a148 <_Thread_Handler_initialization+0x2c><== NEVER TAKEN 4000a134: c4 00 60 2c ld [ %g1 + 0x2c ], %g2 4000a138: c6 00 60 34 ld [ %g1 + 0x34 ], %g3 4000a13c: 80 a0 e0 00 cmp %g3, 0 4000a140: 12 80 00 06 bne 4000a158 <_Thread_Handler_initialization+0x3c> 4000a144: 80 a0 a0 00 cmp %g2, 0 rtems_configuration_get_stack_free_hook() == NULL) _Terminate( 4000a148: 90 10 20 00 clr %o0 4000a14c: 92 10 20 01 mov 1, %o1 4000a150: 7f ff fa 2e call 40008a08 <_Terminate> 4000a154: 94 10 20 0e mov 0xe, %o2 INTERNAL_ERROR_CORE, true, INTERNAL_ERROR_BAD_STACK_HOOK ); if ( stack_allocate_init_hook != NULL ) 4000a158: 22 80 00 05 be,a 4000a16c <_Thread_Handler_initialization+0x50> 4000a15c: 03 10 00 55 sethi %hi(0x40015400), %g1 (*stack_allocate_init_hook)( rtems_configuration_get_stack_space_size() ); 4000a160: 9f c0 80 00 call %g2 4000a164: d0 00 60 04 ld [ %g1 + 4 ], %o0 ! 40015404 <__EH_FRAME_BEGIN__+0x44> /* * Initialize the internal class of threads. We need an IDLE thread * per CPU in an SMP system. In addition, if this is a loosely * coupled multiprocessing system, account for the MPCI Server Thread. */ _Objects_Initialize_information( 4000a168: 03 10 00 55 sethi %hi(0x40015400), %g1 4000a16c: d8 10 61 f2 lduh [ %g1 + 0x1f2 ], %o4 ! 400155f2 <_Thread_Control_size+0x2> 4000a170: 82 10 20 08 mov 8, %g1 4000a174: 11 10 00 61 sethi %hi(0x40018400), %o0 4000a178: c2 23 a0 5c st %g1, [ %sp + 0x5c ] 4000a17c: 90 12 20 c8 or %o0, 0xc8, %o0 4000a180: 92 10 20 01 mov 1, %o1 4000a184: 94 10 20 01 mov 1, %o2 4000a188: 96 10 20 01 mov 1, %o3 4000a18c: 7f ff fb c8 call 400090ac <_Objects_Initialize_information> 4000a190: 9a 10 20 00 clr %o5 4000a194: 81 c7 e0 08 ret 4000a198: 81 e8 00 00 restore =============================================================================== 40009ed4 <_Thread_Initialize>: Thread_CPU_budget_algorithms budget_algorithm, Thread_CPU_budget_algorithm_callout budget_callout, uint32_t isr_level, Objects_Name name ) { 40009ed4: 9d e3 bf 98 save %sp, -104, %sp 40009ed8: c2 07 a0 70 ld [ %fp + 0x70 ], %g1 40009edc: fa 07 a0 5c ld [ %fp + 0x5c ], %i5 40009ee0: e2 00 40 00 ld [ %g1 ], %l1 40009ee4: e0 07 a0 64 ld [ %fp + 0x64 ], %l0 { /* * Do not use _TLS_Size here since this will lead GCC to assume that this * symbol is not 0 and the tests for 0 will be optimized away. */ return (uintptr_t) _TLS_BSS_end - (uintptr_t) _TLS_Data_begin; 40009ee8: 03 10 00 5a sethi %hi(0x40016800), %g1 40009eec: e4 0f a0 63 ldub [ %fp + 0x63 ], %l2 40009ef0: 82 10 62 a0 or %g1, 0x2a0, %g1 40009ef4: 27 10 00 5a sethi %hi(0x40016800), %l3 40009ef8: a6 14 e2 a0 or %l3, 0x2a0, %l3 ! 40016aa0 <_RTEMS_tasks_Initialize_user_tasks_p> 40009efc: a6 24 c0 01 sub %l3, %g1, %l3 if ( rtems_configuration_is_smp_enabled() && !is_preemptible ) { return false; } #endif for ( i = 0 ; i < _Thread_Control_add_on_count ; ++i ) { 40009f00: 03 10 00 55 sethi %hi(0x40015400), %g1 40009f04: 84 10 20 00 clr %g2 40009f08: c6 00 61 cc ld [ %g1 + 0x1cc ], %g3 40009f0c: 03 10 00 55 sethi %hi(0x40015400), %g1 40009f10: 82 10 61 d0 or %g1, 0x1d0, %g1 ! 400155d0 <_Thread_Control_add_ons> 40009f14: 80 a0 80 03 cmp %g2, %g3 40009f18: 02 80 00 08 be 40009f38 <_Thread_Initialize+0x64> 40009f1c: 84 00 a0 01 inc %g2 const Thread_Control_add_on *add_on = &_Thread_Control_add_ons[ i ]; *(void **) ( (char *) the_thread + add_on->destination_offset ) = (char *) the_thread + add_on->source_offset; 40009f20: de 00 60 04 ld [ %g1 + 4 ], %o7 #endif for ( i = 0 ; i < _Thread_Control_add_on_count ; ++i ) { const Thread_Control_add_on *add_on = &_Thread_Control_add_ons[ i ]; *(void **) ( (char *) the_thread + add_on->destination_offset ) = 40009f24: c8 00 40 00 ld [ %g1 ], %g4 (char *) the_thread + add_on->source_offset; 40009f28: 9e 06 40 0f add %i1, %o7, %o7 #endif for ( i = 0 ; i < _Thread_Control_add_on_count ; ++i ) { const Thread_Control_add_on *add_on = &_Thread_Control_add_ons[ i ]; *(void **) ( (char *) the_thread + add_on->destination_offset ) = 40009f2c: de 26 40 04 st %o7, [ %i1 + %g4 ] 40009f30: 10 bf ff f9 b 40009f14 <_Thread_Initialize+0x40> 40009f34: 82 00 60 08 add %g1, 8, %g1 if ( !actual_stack_size || actual_stack_size < stack_size ) return false; /* stack allocation failed */ stack = the_thread->Start.stack; #else if ( !stack_area ) { 40009f38: 80 a6 e0 00 cmp %i3, 0 40009f3c: 12 80 00 0e bne 40009f74 <_Thread_Initialize+0xa0> 40009f40: c0 26 60 c0 clr [ %i1 + 0xc0 ] actual_stack_size = _Thread_Stack_Allocate( the_thread, stack_size ); 40009f44: 90 10 00 19 mov %i1, %o0 40009f48: 40 00 03 1d call 4000abbc <_Thread_Stack_Allocate> 40009f4c: 92 10 00 1c mov %i4, %o1 if ( !actual_stack_size || actual_stack_size < stack_size ) 40009f50: 80 a2 00 1c cmp %o0, %i4 40009f54: 0a 80 00 6e bcs 4000a10c <_Thread_Initialize+0x238> 40009f58: 80 a2 20 00 cmp %o0, 0 40009f5c: 02 80 00 6c be 4000a10c <_Thread_Initialize+0x238> <== NEVER TAKEN 40009f60: 82 10 20 01 mov 1, %g1 return false; /* stack allocation failed */ stack = the_thread->Start.stack; 40009f64: f6 06 60 bc ld [ %i1 + 0xbc ], %i3 the_thread->Start.core_allocated_stack = true; 40009f68: c2 2e 60 b0 stb %g1, [ %i1 + 0xb0 ] 40009f6c: 10 80 00 03 b 40009f78 <_Thread_Initialize+0xa4> 40009f70: b8 10 00 08 mov %o0, %i4 } else { stack = stack_area; actual_stack_size = stack_size; the_thread->Start.core_allocated_stack = false; 40009f74: c0 2e 60 b0 clrb [ %i1 + 0xb0 ] Stack_Control *the_stack, void *starting_address, size_t size ) { the_stack->area = starting_address; 40009f78: f6 26 60 b8 st %i3, [ %i1 + 0xb8 ] stack, actual_stack_size ); /* Thread-local storage (TLS) area allocation */ if ( tls_size > 0 ) { 40009f7c: 80 a4 e0 00 cmp %l3, 0 40009f80: 12 80 00 0b bne 40009fac <_Thread_Initialize+0xd8> 40009f84: f8 26 60 b4 st %i4, [ %i1 + 0xb4 ] * create the extension long after tasks have been created * so they cannot rely on the thread create user extension * call. The object index starts with one, so the first extension context is * unused. */ for ( i = 1 ; i <= rtems_configuration_get_maximum_extensions() ; ++i ) 40009f88: 05 10 00 55 sethi %hi(0x40015400), %g2 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 40009f8c: c0 26 60 50 clr [ %i1 + 0x50 ] 40009f90: 84 10 a1 88 or %g2, 0x188, %g2 the_watchdog->routine = routine; 40009f94: c0 26 60 64 clr [ %i1 + 0x64 ] the_watchdog->id = id; 40009f98: c0 26 60 68 clr [ %i1 + 0x68 ] the_watchdog->user_data = user_data; 40009f9c: c0 26 60 6c clr [ %i1 + 0x6c ] 40009fa0: c6 00 a0 08 ld [ %g2 + 8 ], %g3 40009fa4: 10 80 00 13 b 40009ff0 <_Thread_Initialize+0x11c> 40009fa8: 82 10 20 01 mov 1, %g1 static inline uintptr_t _TLS_Heap_align_up( uintptr_t val ) { uintptr_t msk = CPU_HEAP_ALIGNMENT - 1; return (val + msk) & ~msk; 40009fac: 13 00 00 00 sethi %hi(0), %o1 40009fb0: a6 04 e0 07 add %l3, 7, %l3 40009fb4: 92 12 60 01 or %o1, 1, %o1 40009fb8: a6 0c ff f8 and %l3, -8, %l3 40009fbc: 92 02 60 07 add %o1, 7, %o1 40009fc0: 92 0a 7f f8 and %o1, -8, %o1 static inline uintptr_t _TLS_Get_thread_control_block_area_size( uintptr_t alignment ) { return alignment <= sizeof(TLS_Thread_control_block) ? 40009fc4: 80 a2 60 08 cmp %o1, 8 40009fc8: 1a 80 00 03 bcc 40009fd4 <_Thread_Initialize+0x100> <== ALWAYS TAKEN 40009fcc: 82 10 00 09 mov %o1, %g1 40009fd0: 82 10 20 08 mov 8, %g1 <== NOT EXECUTED ) { uintptr_t aligned_size = _TLS_Heap_align_up( size ); return _TLS_Get_thread_control_block_area_size( alignment ) + aligned_size + sizeof(TLS_Dynamic_thread_vector); 40009fd4: 90 04 c0 01 add %l3, %g1, %o0 if ( tls_size > 0 ) { uintptr_t tls_align = _TLS_Heap_align_up( (uintptr_t) _TLS_Alignment ); uintptr_t tls_alloc = _TLS_Get_allocation_size( tls_size, tls_align ); the_thread->Start.tls_area = _Workspace_Allocate_aligned( tls_alloc, tls_align ); 40009fd8: 40 00 04 f0 call 4000b398 <_Workspace_Allocate_aligned> 40009fdc: 90 02 20 08 add %o0, 8, %o0 if ( the_thread->Start.tls_area == NULL ) { 40009fe0: 80 a2 20 00 cmp %o0, 0 40009fe4: 12 bf ff e9 bne 40009f88 <_Thread_Initialize+0xb4> <== ALWAYS TAKEN 40009fe8: d0 26 60 c0 st %o0, [ %i1 + 0xc0 ] 40009fec: 30 80 00 44 b,a 4000a0fc <_Thread_Initialize+0x228> <== NOT EXECUTED * create the extension long after tasks have been created * so they cannot rely on the thread create user extension * call. The object index starts with one, so the first extension context is * unused. */ for ( i = 1 ; i <= rtems_configuration_get_maximum_extensions() ; ++i ) 40009ff0: 80 a0 40 03 cmp %g1, %g3 40009ff4: 18 80 00 06 bgu 4000a00c <_Thread_Initialize+0x138> 40009ff8: 89 28 60 02 sll %g1, 2, %g4 40009ffc: 82 00 60 01 inc %g1 4000a000: 88 06 40 04 add %i1, %g4, %g4 the_thread->extensions[ i ] = NULL; 4000a004: 10 bf ff fb b 40009ff0 <_Thread_Initialize+0x11c> 4000a008: c0 21 21 58 clr [ %g4 + 0x158 ] * General initialization */ the_thread->Start.is_preemptible = is_preemptible; the_thread->Start.budget_algorithm = budget_algorithm; the_thread->Start.budget_callout = budget_callout; 4000a00c: c2 07 a0 68 ld [ %fp + 0x68 ], %g1 /* * General initialization */ the_thread->Start.is_preemptible = is_preemptible; 4000a010: e4 2e 60 9c stb %l2, [ %i1 + 0x9c ] the_thread->Start.budget_algorithm = budget_algorithm; 4000a014: e0 26 60 a0 st %l0, [ %i1 + 0xa0 ] the_thread->Start.budget_callout = budget_callout; switch ( budget_algorithm ) { 4000a018: 80 a4 20 02 cmp %l0, 2 4000a01c: 12 80 00 04 bne 4000a02c <_Thread_Initialize+0x158> 4000a020: 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 = 4000a024: c2 00 a0 1c ld [ %g2 + 0x1c ], %g1 4000a028: c2 26 60 74 st %g1, [ %i1 + 0x74 ] case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; 4000a02c: c2 07 a0 6c ld [ %fp + 0x6c ], %g1 _Thread_Debug_set_real_processor( the_thread, cpu ); /* Initialize the CPU for the non-SMP schedulers */ _Thread_Set_CPU( the_thread, cpu ); the_thread->current_state = STATES_DORMANT; 4000a030: b8 10 20 01 mov 1, %i4 case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT: break; #endif } the_thread->Start.isr_level = isr_level; 4000a034: c2 26 60 a8 st %g1, [ %i1 + 0xa8 ] RTEMS_INLINE_ROUTINE void _Scheduler_Node_initialize( const Scheduler_Control *scheduler, Thread_Control *the_thread ) { return ( *scheduler->Operations.node_initialize )( scheduler, the_thread ); 4000a038: c2 06 a0 1c ld [ %i2 + 0x1c ], %g1 4000a03c: 90 10 00 1a mov %i2, %o0 4000a040: 92 10 00 19 mov %i1, %o1 _Thread_Debug_set_real_processor( the_thread, cpu ); /* Initialize the CPU for the non-SMP schedulers */ _Thread_Set_CPU( the_thread, cpu ); the_thread->current_state = STATES_DORMANT; 4000a044: f8 26 60 10 st %i4, [ %i1 + 0x10 ] the_thread->Wait.queue = NULL; 4000a048: c0 26 60 44 clr [ %i1 + 0x44 ] the_thread->resource_count = 0; 4000a04c: c0 26 60 1c clr [ %i1 + 0x1c ] the_thread->real_priority = priority; 4000a050: fa 26 60 18 st %i5, [ %i1 + 0x18 ] 4000a054: 9f c0 40 00 call %g1 4000a058: fa 26 60 ac st %i5, [ %i1 + 0xac ] the_thread->Start.initial_priority = priority; _Scheduler_Node_initialize( scheduler, the_thread ); scheduler_node_initialized = true; _Thread_Set_priority( the_thread, priority ); 4000a05c: 90 10 00 19 mov %i1, %o0 4000a060: 40 00 02 bb call 4000ab4c <_Thread_Set_priority> 4000a064: 92 10 00 1d mov %i5, %o1 RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 4000a068: 82 06 61 38 add %i1, 0x138, %g1 4000a06c: 84 06 61 3c add %i1, 0x13c, %g2 head->next = tail; head->previous = NULL; tail->previous = head; 4000a070: c2 26 61 40 st %g1, [ %i1 + 0x140 ] RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 4000a074: 82 06 60 c4 add %i1, 0xc4, %g1 head->next = tail; 4000a078: c4 26 61 38 st %g2, [ %i1 + 0x138 ] head->previous = NULL; tail->previous = head; 4000a07c: c2 26 60 cc st %g1, [ %i1 + 0xcc ] RTEMS_INLINE_ROUTINE void _Chain_Initialize_empty( Chain_Control *the_chain ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); 4000a080: 84 06 60 c8 add %i1, 0xc8, %g2 RTEMS_INLINE_ROUTINE void _Thread_Action_initialize( Thread_Action *action, Thread_Action_handler handler ) { action->handler = handler; 4000a084: 03 10 00 2a sethi %hi(0x4000a800), %g1 4000a088: 82 10 61 d0 or %g1, 0x1d0, %g1 ! 4000a9d0 <_Thread_Life_action_handler> head->next = tail; head->previous = NULL; 4000a08c: c0 26 61 3c clr [ %i1 + 0x13c ] ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 4000a090: c4 26 60 c4 st %g2, [ %i1 + 0xc4 ] head->previous = NULL; 4000a094: c0 26 60 c8 clr [ %i1 + 0xc8 ] 4000a098: c2 26 61 4c st %g1, [ %i1 + 0x14c ] */ RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain( Chain_Node *node ) { node->next = NULL; 4000a09c: c0 26 61 44 clr [ %i1 + 0x144 ] Objects_Name name ) { the_object->name = name; _Objects_Set_local_object( 4000a0a0: c2 16 60 0a lduh [ %i1 + 0xa ], %g1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4000a0a4: c4 06 20 1c ld [ %i0 + 0x1c ], %g2 static inline void _Timestamp64_implementation_Set_to_zero( Timestamp64_Control *_time ) { *_time = 0; 4000a0a8: c0 26 60 80 clr [ %i1 + 0x80 ] 4000a0ac: c0 26 60 84 clr [ %i1 + 0x84 ] _Thread_Action_initialize( &the_thread->Life.Action, _Thread_Life_action_handler ); the_thread->Life.state = THREAD_LIFE_NORMAL; 4000a0b0: c0 26 61 50 clr [ %i1 + 0x150 ] the_thread->Life.terminator = NULL; 4000a0b4: c0 26 61 54 clr [ %i1 + 0x154 ] Objects_Information *information, Objects_Control *the_object, Objects_Name name ) { the_object->name = name; 4000a0b8: e2 26 60 0c st %l1, [ %i1 + 0xc ] #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 4000a0bc: 83 28 60 02 sll %g1, 2, %g1 4000a0c0: f2 20 80 01 st %i1, [ %g2 + %g1 ] */ /**@{**/ static inline bool _User_extensions_Thread_create( Thread_Control *created ) { User_extensions_Thread_create_context ctx = { created, true }; 4000a0c4: f2 27 bf f8 st %i1, [ %fp + -8 ] 4000a0c8: f8 2f bf fc stb %i4, [ %fp + -4 ] _User_extensions_Iterate( &ctx, _User_extensions_Thread_create_visitor ); 4000a0cc: 90 07 bf f8 add %fp, -8, %o0 4000a0d0: 13 10 00 2b sethi %hi(0x4000ac00), %o1 4000a0d4: 40 00 03 5a call 4000ae3c <_User_extensions_Iterate> 4000a0d8: 92 12 60 f8 or %o1, 0xf8, %o1 ! 4000acf8 <_User_extensions_Thread_create_visitor> return ctx.ok; 4000a0dc: f0 0f bf fc ldub [ %fp + -4 ], %i0 * 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 ) 4000a0e0: 80 8e 20 ff btst 0xff, %i0 4000a0e4: 32 80 00 0c bne,a 4000a114 <_Thread_Initialize+0x240> 4000a0e8: b0 0e 20 ff and %i0, 0xff, %i0 RTEMS_INLINE_ROUTINE void _Scheduler_Node_destroy( const Scheduler_Control *scheduler, Thread_Control *the_thread ) { ( *scheduler->Operations.node_destroy )( scheduler, the_thread ); 4000a0ec: c2 06 a0 20 ld [ %i2 + 0x20 ], %g1 4000a0f0: 90 10 00 1a mov %i2, %o0 4000a0f4: 9f c0 40 00 call %g1 4000a0f8: 92 10 00 19 mov %i1, %o1 if ( scheduler_node_initialized ) { _Scheduler_Node_destroy( scheduler, the_thread ); } _Workspace_Free( the_thread->Start.tls_area ); 4000a0fc: 40 00 04 b0 call 4000b3bc <_Workspace_Free> 4000a100: d0 06 60 c0 ld [ %i1 + 0xc0 ], %o0 #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) _Workspace_Free( fp_area ); #endif _Thread_Stack_Free( the_thread ); 4000a104: 40 00 02 be call 4000abfc <_Thread_Stack_Free> 4000a108: 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 */ 4000a10c: b0 10 20 00 clr %i0 4000a110: b0 0e 20 ff and %i0, 0xff, %i0 4000a114: 81 c7 e0 08 ret 4000a118: 81 e8 00 00 restore =============================================================================== 4000a9d0 <_Thread_Life_action_handler>: Thread_Control *executing, Thread_Action *action, Per_CPU_Control *cpu, ISR_Level level ) { 4000a9d0: 9d e3 bf a0 save %sp, -96, %sp Thread_Life_state previous_life_state; (void) action; previous_life_state = executing->Life.state; executing->Life.state = THREAD_LIFE_PROTECTED; 4000a9d4: 82 10 20 01 mov 1, %g1 { Thread_Life_state previous_life_state; (void) action; previous_life_state = executing->Life.state; 4000a9d8: fa 06 21 50 ld [ %i0 + 0x150 ], %i5 executing->Life.state = THREAD_LIFE_PROTECTED; 4000a9dc: c2 26 21 50 st %g1, [ %i0 + 0x150 ] 4000a9e0: 7f ff de 98 call 40002440 4000a9e4: 90 10 00 1b mov %i3, %o0 _Thread_Action_release_and_ISR_enable( cpu, level ); if ( _Thread_Is_life_terminating( previous_life_state ) ) { 4000a9e8: ba 8f 60 04 andcc %i5, 4, %i5 4000a9ec: 02 80 00 05 be 4000aa00 <_Thread_Life_action_handler+0x30> 4000a9f0: 90 10 00 18 mov %i0, %o0 static inline void _User_extensions_Thread_terminate( Thread_Control *executing ) { _User_extensions_Iterate( 4000a9f4: 13 10 00 2b sethi %hi(0x4000ac00), %o1 4000a9f8: 10 80 00 04 b 4000aa08 <_Thread_Life_action_handler+0x38> 4000a9fc: 92 12 62 18 or %o1, 0x218, %o1 ! 4000ae18 <_User_extensions_Thread_terminate_visitor> ); } static inline void _User_extensions_Thread_restart( Thread_Control *restarted ) { _User_extensions_Iterate( 4000aa00: 13 10 00 2b sethi %hi(0x4000ac00), %o1 4000aa04: 92 12 61 80 or %o1, 0x180, %o1 ! 4000ad80 <_User_extensions_Thread_restart_visitor> 4000aa08: 40 00 01 0d call 4000ae3c <_User_extensions_Iterate> 4000aa0c: 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 disable_level = _Thread_Dispatch_disable_level; 4000aa10: c4 01 a0 10 ld [ %g6 + 0x10 ], %g2 _ISR_Disable( level ); _Profiling_Thread_dispatch_disable( _Per_CPU_Get(), disable_level ); #endif ++disable_level; 4000aa14: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = disable_level; 4000aa18: c4 21 a0 10 st %g2, [ %g6 + 0x10 ] _User_extensions_Thread_restart( executing ); } _Thread_Disable_dispatch(); if ( _Thread_Is_life_terminating( previous_life_state ) ) { 4000aa1c: 80 a7 60 00 cmp %i5, 0 4000aa20: 22 80 00 0c be,a 4000aa50 <_Thread_Life_action_handler+0x80> 4000aa24: c2 06 21 50 ld [ %i0 + 0x150 ], %g1 _Thread_Make_zombie( executing ); 4000aa28: 7f ff ff 2a call 4000a6d0 <_Thread_Make_zombie> 4000aa2c: 90 10 00 18 mov %i0, %o0 if ( executing->Life.terminator != NULL ) { 4000aa30: d0 06 21 54 ld [ %i0 + 0x154 ], %o0 4000aa34: 80 a2 20 00 cmp %o0, 0 4000aa38: 02 80 00 04 be 4000aa48 <_Thread_Life_action_handler+0x78> 4000aa3c: 01 00 00 00 nop _Thread_Clear_state( 4000aa40: 7f ff fc 4b call 40009b6c <_Thread_Clear_state> 4000aa44: 13 00 04 00 sethi %hi(0x100000), %o1 executing->Life.terminator, STATES_WAITING_FOR_TERMINATION ); } _Thread_Enable_dispatch(); 4000aa48: 7f ff fc f4 call 40009e18 <_Thread_Enable_dispatch> 4000aa4c: 81 e8 00 00 restore _Assert_Not_reached(); } else { _Assert( _Thread_Is_life_restarting( previous_life_state ) ); if ( _Thread_Is_life_terminating( executing->Life.state ) ) { 4000aa50: 80 88 60 04 btst 4, %g1 4000aa54: 22 80 00 04 be,a 4000aa64 <_Thread_Life_action_handler+0x94><== ALWAYS TAKEN 4000aa58: 90 10 00 18 mov %i0, %o0 /* Someone deleted us in the mean-time */ _Thread_Start_life_change_for_executing( executing ); 4000aa5c: 7f ff ff 45 call 4000a770 <_Thread_Start_life_change_for_executing><== NOT EXECUTED 4000aa60: 81 e8 00 00 restore <== NOT EXECUTED || executing->current_state == STATES_SUSPENDED ); executing->Life.state = THREAD_LIFE_NORMAL; _Thread_Load_environment( executing ); 4000aa64: 40 00 0b 79 call 4000d848 <_Thread_Load_environment> 4000aa68: c0 26 21 50 clr [ %i0 + 0x150 ] #if ( CPU_HARDWARE_FP == TRUE ) || ( CPU_SOFTWARE_FP == TRUE ) if ( executing->fp_context != NULL ) _Context_Restore_fp( &executing->fp_context ); #endif _CPU_Context_Restart_self( &executing->Registers ); 4000aa6c: 40 00 27 d8 call 400149cc <_CPU_Context_restore> 4000aa70: 90 06 20 d0 add %i0, 0xd0, %o0 =============================================================================== 4000a7b0 <_Thread_Request_life_change>: Thread_Control *the_thread, Thread_Control *executing, Priority_Control priority, Thread_Life_state additional_life_state ) { 4000a7b0: 9d e3 bf a0 save %sp, -96, %sp ISR_Level *level ) { Per_CPU_Control *cpu; _ISR_Disable_without_giant( *level ); 4000a7b4: 7f ff df 20 call 40002434 4000a7b8: 01 00 00 00 nop Per_CPU_Control *cpu; ISR_Level level; const Scheduler_Control *scheduler; cpu = _Thread_Action_ISR_disable_and_acquire( the_thread, &level ); previous_life_state = the_thread->Life.state; 4000a7bc: fa 06 21 50 ld [ %i0 + 0x150 ], %i5 the_thread->Life.state = previous_life_state | additional_life_state; 4000a7c0: 82 16 c0 1d or %i3, %i5, %g1 4000a7c4: c2 26 21 50 st %g1, [ %i0 + 0x150 ] RTEMS_INLINE_ROUTINE void _Thread_Action_release_and_ISR_enable( Per_CPU_Control *cpu, ISR_Level level ) { _Per_CPU_Release_and_ISR_enable( cpu, level ); 4000a7c8: 7f ff df 1e call 40002440 4000a7cc: 01 00 00 00 nop _Thread_Action_release_and_ISR_enable( cpu, level ); scheduler = _Scheduler_Get( the_thread ); if ( the_thread == executing ) { 4000a7d0: 80 a6 00 19 cmp %i0, %i1 4000a7d4: 12 80 00 0d bne 4000a808 <_Thread_Request_life_change+0x58> 4000a7d8: 80 a7 60 00 cmp %i5, 0 Priority_Control priority ) { Priority_Control current = the_thread->current_priority; if ( _Scheduler_Is_priority_higher_than( scheduler, priority, current ) ) { 4000a7dc: d2 06 20 14 ld [ %i0 + 0x14 ], %o1 executing->real_priority = priority; 4000a7e0: f4 26 20 18 st %i2, [ %i0 + 0x18 ] 4000a7e4: 7f ff ff d8 call 4000a744 <_Scheduler_Is_priority_higher_than.constprop.19> 4000a7e8: 90 10 00 1a mov %i2, %o0 4000a7ec: 80 a2 20 00 cmp %o0, 0 4000a7f0: 02 80 00 04 be 4000a800 <_Thread_Request_life_change+0x50><== ALWAYS TAKEN 4000a7f4: 90 10 00 18 mov %i0, %o0 _Thread_Set_priority( the_thread, priority ); 4000a7f8: 40 00 00 d5 call 4000ab4c <_Thread_Set_priority> <== NOT EXECUTED 4000a7fc: 92 10 00 1a mov %i2, %o1 <== NOT EXECUTED _Scheduler_Set_priority_if_higher( scheduler, the_thread, priority ); _Thread_Start_life_change_for_executing( executing ); 4000a800: 7f ff ff dc call 4000a770 <_Thread_Start_life_change_for_executing> 4000a804: 81 e8 00 00 restore } else if ( previous_life_state == THREAD_LIFE_NORMAL ) { 4000a808: 12 80 00 27 bne 4000a8a4 <_Thread_Request_life_change+0xf4> 4000a80c: 90 10 00 18 mov %i0, %o0 Thread_Control *the_thread, const Scheduler_Control *scheduler, Priority_Control priority ) { the_thread->is_preemptible = the_thread->Start.is_preemptible; 4000a810: c2 0e 20 9c ldub [ %i0 + 0x9c ], %g1 the_thread->budget_algorithm = the_thread->Start.budget_algorithm; the_thread->budget_callout = the_thread->Start.budget_callout; the_thread->real_priority = priority; _Thread_Set_state( the_thread, STATES_RESTARTING ); 4000a814: 13 00 20 00 sethi %hi(0x800000), %o1 Thread_Control *the_thread, const Scheduler_Control *scheduler, Priority_Control priority ) { the_thread->is_preemptible = the_thread->Start.is_preemptible; 4000a818: c2 2e 20 70 stb %g1, [ %i0 + 0x70 ] the_thread->budget_algorithm = the_thread->Start.budget_algorithm; 4000a81c: c2 06 20 a0 ld [ %i0 + 0xa0 ], %g1 4000a820: c2 26 20 78 st %g1, [ %i0 + 0x78 ] the_thread->budget_callout = the_thread->Start.budget_callout; 4000a824: c2 06 20 a4 ld [ %i0 + 0xa4 ], %g1 the_thread->real_priority = priority; 4000a828: f4 26 20 18 st %i2, [ %i0 + 0x18 ] _Thread_Set_state( the_thread, STATES_RESTARTING ); 4000a82c: 40 00 00 d2 call 4000ab74 <_Thread_Set_state> 4000a830: c2 26 20 7c st %g1, [ %i0 + 0x7c ] _Thread_queue_Extract_with_proxy( the_thread ); 4000a834: 40 00 0c 51 call 4000d978 <_Thread_queue_Extract_with_proxy> 4000a838: 90 10 00 18 mov %i0, %o0 _Watchdog_Remove( &the_thread->Timer ); 4000a83c: 40 00 02 17 call 4000b098 <_Watchdog_Remove> 4000a840: 90 06 20 48 add %i0, 0x48, %o0 Priority_Control priority ) { Priority_Control current = the_thread->current_priority; if ( _Scheduler_Is_priority_higher_than( scheduler, priority, current ) ) { 4000a844: d2 06 20 14 ld [ %i0 + 0x14 ], %o1 4000a848: 7f ff ff bf call 4000a744 <_Scheduler_Is_priority_higher_than.constprop.19> 4000a84c: 90 10 00 1a mov %i2, %o0 4000a850: 80 a2 20 00 cmp %o0, 0 4000a854: 02 80 00 04 be 4000a864 <_Thread_Request_life_change+0xb4> 4000a858: 90 10 00 18 mov %i0, %o0 _Thread_Set_priority( the_thread, priority ); 4000a85c: 40 00 00 bc call 4000ab4c <_Thread_Set_priority> 4000a860: 92 10 00 1a mov %i2, %o1 ISR_Level *level ) { Per_CPU_Control *cpu; _ISR_Disable_without_giant( *level ); 4000a864: 7f ff de f4 call 40002434 4000a868: 01 00 00 00 nop RTEMS_INLINE_ROUTINE void _Chain_Append_if_is_off_chain_unprotected( Chain_Control *the_chain, Chain_Node *the_node ) { if ( _Chain_Is_node_off_chain( the_node ) ) { 4000a86c: c2 06 21 44 ld [ %i0 + 0x144 ], %g1 4000a870: 80 a0 60 00 cmp %g1, 0 4000a874: 12 80 00 08 bne 4000a894 <_Thread_Request_life_change+0xe4><== NEVER TAKEN 4000a878: 84 06 21 44 add %i0, 0x144, %g2 Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; 4000a87c: c2 06 20 cc ld [ %i0 + 0xcc ], %g1 RTEMS_INLINE_ROUTINE void _Chain_Append_unprotected( Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); 4000a880: 86 06 20 c8 add %i0, 0xc8, %g3 Chain_Node *old_last = tail->previous; the_node->next = tail; tail->previous = the_node; 4000a884: c4 26 20 cc st %g2, [ %i0 + 0xcc ] ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; the_node->next = tail; 4000a888: c6 26 21 44 st %g3, [ %i0 + 0x144 ] tail->previous = the_node; old_last->next = the_node; 4000a88c: c4 20 40 00 st %g2, [ %g1 ] the_node->previous = old_last; 4000a890: c2 26 21 48 st %g1, [ %i0 + 0x148 ] RTEMS_INLINE_ROUTINE void _Thread_Action_release_and_ISR_enable( Per_CPU_Control *cpu, ISR_Level level ) { _Per_CPU_Release_and_ISR_enable( cpu, level ); 4000a894: 7f ff de eb call 40002440 4000a898: 01 00 00 00 nop _Scheduler_Set_priority_if_higher( scheduler, the_thread, priority ); _Thread_Add_post_switch_action( the_thread, &the_thread->Life.Action ); _Thread_Ready( the_thread ); 4000a89c: 40 00 0c 5f call 4000da18 <_Thread_Ready> 4000a8a0: 81 e8 00 00 restore _Scheduler_Set_priority_if_higher( scheduler, the_thread, priority ); _Thread_Start_life_change_for_executing( executing ); } else if ( previous_life_state == THREAD_LIFE_NORMAL ) { _Thread_Start_life_change( the_thread, scheduler, priority ); } else { _Thread_Clear_state( the_thread, STATES_SUSPENDED ); 4000a8a4: 7f ff fc b2 call 40009b6c <_Thread_Clear_state> 4000a8a8: 92 10 20 02 mov 2, %o1 if ( _Thread_Is_life_terminating( additional_life_state ) ) { 4000a8ac: 80 8e e0 04 btst 4, %i3 4000a8b0: 02 80 00 12 be 4000a8f8 <_Thread_Request_life_change+0x148><== NEVER TAKEN 4000a8b4: 92 10 00 1a mov %i2, %o1 the_thread->real_priority = _Scheduler_Highest_priority_of_two( 4000a8b8: fa 06 20 18 ld [ %i0 + 0x18 ], %i5 const Scheduler_Control *scheduler, Priority_Control p1, Priority_Control p2 ) { return _Scheduler_Is_priority_higher_than( scheduler, p1, p2 ) ? p1 : p2; 4000a8bc: 7f ff ff a2 call 4000a744 <_Scheduler_Is_priority_higher_than.constprop.19> 4000a8c0: 90 10 00 1d mov %i5, %o0 4000a8c4: 80 a2 20 00 cmp %o0, 0 4000a8c8: 02 80 00 03 be 4000a8d4 <_Thread_Request_life_change+0x124><== ALWAYS TAKEN 4000a8cc: 82 10 00 1a mov %i2, %g1 4000a8d0: 82 10 00 1d mov %i5, %g1 <== NOT EXECUTED bool prepend_it ) { Priority_Control current = the_thread->current_priority; if ( _Scheduler_Is_priority_higher_than( scheduler, priority, current ) ) { 4000a8d4: d2 06 20 14 ld [ %i0 + 0x14 ], %o1 4000a8d8: c2 26 20 18 st %g1, [ %i0 + 0x18 ] 4000a8dc: 7f ff ff 9a call 4000a744 <_Scheduler_Is_priority_higher_than.constprop.19> 4000a8e0: 90 10 00 1a mov %i2, %o0 4000a8e4: 80 a2 20 00 cmp %o0, 0 4000a8e8: 02 80 00 04 be 4000a8f8 <_Thread_Request_life_change+0x148><== NEVER TAKEN 4000a8ec: b2 10 00 1a mov %i2, %i1 _Thread_Change_priority( the_thread, priority, prepend_it ); 4000a8f0: 7f ff fc 5d call 40009a64 <_Thread_Change_priority> 4000a8f4: 95 e8 20 00 restore %g0, 0, %o2 4000a8f8: 81 c7 e0 08 ret <== NOT EXECUTED 4000a8fc: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 4000abfc <_Thread_Stack_Free>: #include void _Thread_Stack_Free( Thread_Control *the_thread ) { 4000abfc: 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 ) 4000ac00: c4 0e 20 b0 ldub [ %i0 + 0xb0 ], %g2 void _Thread_Stack_Free( Thread_Control *the_thread ) { rtems_stack_free_hook stack_free_hook = 4000ac04: 03 10 00 55 sethi %hi(0x40015400), %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 ) 4000ac08: 80 a0 a0 00 cmp %g2, 0 4000ac0c: 02 80 00 04 be 4000ac1c <_Thread_Stack_Free+0x20> <== NEVER TAKEN 4000ac10: c2 00 61 bc ld [ %g1 + 0x1bc ], %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 ); 4000ac14: 9f c0 40 00 call %g1 4000ac18: d0 06 20 b8 ld [ %i0 + 0xb8 ], %o0 4000ac1c: 81 c7 e0 08 ret 4000ac20: 81 e8 00 00 restore =============================================================================== 4000a770 <_Thread_Start_life_change_for_executing>: } static void _Thread_Start_life_change_for_executing( Thread_Control *executing ) { 4000a770: 9d e3 bf a0 save %sp, -96, %sp ISR_Level *level ) { Per_CPU_Control *cpu; _ISR_Disable_without_giant( *level ); 4000a774: 7f ff df 30 call 40002434 4000a778: ba 10 00 18 mov %i0, %i5 4000a77c: b0 10 00 08 mov %o0, %i0 RTEMS_INLINE_ROUTINE void _Chain_Append_if_is_off_chain_unprotected( Chain_Control *the_chain, Chain_Node *the_node ) { if ( _Chain_Is_node_off_chain( the_node ) ) { 4000a780: c2 07 61 44 ld [ %i5 + 0x144 ], %g1 4000a784: 80 a0 60 00 cmp %g1, 0 4000a788: 12 80 00 08 bne 4000a7a8 <_Thread_Start_life_change_for_executing+0x38><== NEVER TAKEN 4000a78c: 84 07 61 44 add %i5, 0x144, %g2 Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; 4000a790: c2 07 60 cc ld [ %i5 + 0xcc ], %g1 RTEMS_INLINE_ROUTINE void _Chain_Append_unprotected( Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); 4000a794: 86 07 60 c8 add %i5, 0xc8, %g3 Chain_Node *old_last = tail->previous; the_node->next = tail; tail->previous = the_node; 4000a798: c4 27 60 cc st %g2, [ %i5 + 0xcc ] ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; the_node->next = tail; 4000a79c: c6 27 61 44 st %g3, [ %i5 + 0x144 ] tail->previous = the_node; old_last->next = the_node; 4000a7a0: c4 20 40 00 st %g2, [ %g1 ] the_node->previous = old_last; 4000a7a4: c2 27 61 48 st %g1, [ %i5 + 0x148 ] RTEMS_INLINE_ROUTINE void _Thread_Action_release_and_ISR_enable( Per_CPU_Control *cpu, ISR_Level level ) { _Per_CPU_Release_and_ISR_enable( cpu, level ); 4000a7a8: 7f ff df 26 call 40002440 4000a7ac: 81 e8 00 00 restore =============================================================================== 4000acc0 <_Thread_Yield>: #include #include void _Thread_Yield( Thread_Control *executing ) { 4000acc0: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; _ISR_Disable( level ); 4000acc4: 7f ff dd dc call 40002434 4000acc8: ba 10 00 18 mov %i0, %i5 4000accc: b0 10 00 08 mov %o0, %i0 if ( _States_Is_ready( executing->current_state ) ) { 4000acd0: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 4000acd4: 80 a0 60 00 cmp %g1, 0 4000acd8: 12 80 00 06 bne 4000acf0 <_Thread_Yield+0x30> <== NEVER TAKEN 4000acdc: 11 10 00 55 sethi %hi(0x40015400), %o0 RTEMS_INLINE_ROUTINE void _Scheduler_Yield( const Scheduler_Control *scheduler, Thread_Control *the_thread ) { ( *scheduler->Operations.yield )( scheduler, the_thread ); 4000ace0: 90 12 22 6c or %o0, 0x26c, %o0 ! 4001566c <_Scheduler_Table> 4000ace4: c2 02 20 0c ld [ %o0 + 0xc ], %g1 4000ace8: 9f c0 40 00 call %g1 4000acec: 92 10 00 1d mov %i5, %o1 _Scheduler_Yield( _Scheduler_Get( executing ), executing ); } _ISR_Enable( level ); 4000acf0: 7f ff dd d4 call 40002440 4000acf4: 81 e8 00 00 restore =============================================================================== 400143f4 <_Thread_queue_First_fifo>: */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 400143f4: c2 02 00 00 ld [ %o0 ], %g1 <== NOT EXECUTED RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 400143f8: 90 02 20 04 add %o0, 4, %o0 <== NOT EXECUTED ) { if ( !_Chain_Is_empty( &the_thread_queue->Queues.Fifo ) ) return (Thread_Control *) _Chain_First( &the_thread_queue->Queues.Fifo ); return NULL; 400143fc: 90 18 40 08 xor %g1, %o0, %o0 <== NOT EXECUTED 40014400: 80 a0 00 08 cmp %g0, %o0 <== NOT EXECUTED 40014404: 90 60 20 00 subx %g0, 0, %o0 <== NOT EXECUTED } 40014408: 81 c3 e0 08 retl <== NOT EXECUTED 4001440c: 90 08 40 08 and %g1, %o0, %o0 <== NOT EXECUTED =============================================================================== 4000a694 <_Thread_queue_Timeout>: void _Thread_queue_Timeout( Objects_Id id, void *ignored __attribute__((unused)) ) { 4000a694: 9d e3 bf 98 save %sp, -104, %sp Thread_Control *the_thread; Objects_Locations location; the_thread = _Thread_Get( id, &location ); 4000a698: 90 10 00 18 mov %i0, %o0 4000a69c: 7f ff fd ea call 40009e44 <_Thread_Get> 4000a6a0: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 4000a6a4: c2 07 bf fc ld [ %fp + -4 ], %g1 4000a6a8: 80 a0 60 00 cmp %g1, 0 4000a6ac: 12 80 00 07 bne 4000a6c8 <_Thread_queue_Timeout+0x34> <== NEVER TAKEN 4000a6b0: 01 00 00 00 nop #if defined(RTEMS_MULTIPROCESSING) case OBJECTS_REMOTE: /* impossible */ #endif break; case OBJECTS_LOCAL: _Thread_queue_Process_timeout( the_thread ); 4000a6b4: 40 00 0c bb call 4000d9a0 <_Thread_queue_Process_timeout> 4000a6b8: 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 disable_level = _Thread_Dispatch_disable_level; 4000a6bc: c4 01 a0 10 ld [ %g6 + 0x10 ], %g2 ISR_Level level; _ISR_Disable( level ); #endif --disable_level; 4000a6c0: 84 00 bf ff add %g2, -1, %g2 _Thread_Dispatch_disable_level = disable_level; 4000a6c4: c4 21 a0 10 st %g2, [ %g6 + 0x10 ] 4000a6c8: 81 c7 e0 08 ret 4000a6cc: 81 e8 00 00 restore =============================================================================== 40008d4c <_Timer_server_Body>: * @a arg points to the corresponding timer server control block. */ static rtems_task _Timer_server_Body( rtems_task_argument arg ) { 40008d4c: 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; 40008d50: 2b 10 00 67 sethi %hi(0x40019c00), %l5 ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 40008d54: b2 07 bf e8 add %fp, -24, %i1 40008d58: a0 07 bf ec add %fp, -20, %l0 40008d5c: b8 07 bf f4 add %fp, -12, %i4 40008d60: b6 07 bf f8 add %fp, -8, %i3 40008d64: e0 27 bf e8 st %l0, [ %fp + -24 ] head->previous = NULL; 40008d68: c0 27 bf ec clr [ %fp + -20 ] tail->previous = head; 40008d6c: f2 27 bf f0 st %i1, [ %fp + -16 ] ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 40008d70: f6 27 bf f4 st %i3, [ %fp + -12 ] head->previous = NULL; 40008d74: c0 27 bf f8 clr [ %fp + -8 ] tail->previous = head; 40008d78: 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 ); 40008d7c: a2 06 20 30 add %i0, 0x30, %l1 /* * 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 ); 40008d80: b4 06 20 68 add %i0, 0x68, %i2 #endif _Timer_server_SMP_lock_release(); _Timer_server_SMP_lock_aquire(); ts->active = true; 40008d84: a8 10 20 01 mov 1, %l4 static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 40008d88: a6 06 20 08 add %i0, 8, %l3 static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 40008d8c: a4 06 20 40 add %i0, 0x40, %l2 { /* * 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; 40008d90: f2 26 20 78 st %i1, [ %i0 + 0x78 ] static void _Timer_server_Process_interval_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = _Watchdog_Ticks_since_boot; 40008d94: c2 05 63 60 ld [ %l5 + 0x360 ], %g1 /* * We assume adequate unsigned arithmetic here. */ Watchdog_Interval delta = snapshot - watchdogs->last_snapshot; 40008d98: d2 06 20 3c ld [ %i0 + 0x3c ], %o1 watchdogs->last_snapshot = snapshot; _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 40008d9c: 94 10 00 1c mov %i4, %o2 40008da0: 90 10 00 11 mov %l1, %o0 40008da4: 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; 40008da8: c2 26 20 3c st %g1, [ %i0 + 0x3c ] _Watchdog_Adjust_to_chain( &watchdogs->Chain, delta, fire_chain ); 40008dac: 40 00 0e 41 call 4000c6b0 <_Watchdog_Adjust_to_chain> 40008db0: 01 00 00 00 nop static void _Timer_server_Process_tod_watchdogs( Timer_server_Watchdogs *watchdogs, Chain_Control *fire_chain ) { Watchdog_Interval snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 40008db4: 40 00 03 58 call 40009b14 <_TOD_Seconds_since_epoch> 40008db8: 01 00 00 00 nop Watchdog_Interval last_snapshot = watchdogs->last_snapshot; 40008dbc: 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 ) { 40008dc0: 80 a2 00 0a cmp %o0, %o2 40008dc4: 08 80 00 07 bleu 40008de0 <_Timer_server_Body+0x94> 40008dc8: ba 10 00 08 mov %o0, %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 ); 40008dcc: 92 27 40 0a sub %i5, %o2, %o1 40008dd0: 90 10 00 1a mov %i2, %o0 40008dd4: 40 00 0e 37 call 4000c6b0 <_Watchdog_Adjust_to_chain> 40008dd8: 94 10 00 1c mov %i4, %o2 40008ddc: 30 80 00 06 b,a 40008df4 <_Timer_server_Body+0xa8> } else if ( snapshot < last_snapshot ) { 40008de0: 1a 80 00 05 bcc 40008df4 <_Timer_server_Body+0xa8> 40008de4: 90 10 00 1a mov %i2, %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 ); 40008de8: 92 10 20 01 mov 1, %o1 40008dec: 40 00 0e 09 call 4000c610 <_Watchdog_Adjust> 40008df0: 94 22 80 1d sub %o2, %i5, %o2 } watchdogs->last_snapshot = snapshot; 40008df4: 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 ); 40008df8: d0 06 20 78 ld [ %i0 + 0x78 ], %o0 40008dfc: 40 00 02 29 call 400096a0 <_Chain_Get> 40008e00: 01 00 00 00 nop if ( timer == NULL ) { 40008e04: 92 92 20 00 orcc %o0, 0, %o1 40008e08: 02 80 00 0c be 40008e38 <_Timer_server_Body+0xec> 40008e0c: 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 ) { 40008e10: c2 02 60 38 ld [ %o1 + 0x38 ], %g1 40008e14: 80 a0 60 01 cmp %g1, 1 40008e18: 02 80 00 05 be 40008e2c <_Timer_server_Body+0xe0> 40008e1c: 90 10 00 11 mov %l1, %o0 _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 40008e20: 80 a0 60 03 cmp %g1, 3 40008e24: 12 bf ff f5 bne 40008df8 <_Timer_server_Body+0xac> <== NEVER TAKEN 40008e28: 90 10 00 1a mov %i2, %o0 _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 40008e2c: 40 00 0e 4b call 4000c758 <_Watchdog_Insert> 40008e30: 92 02 60 10 add %o1, 0x10, %o1 40008e34: 30 bf ff f1 b,a 40008df8 <_Timer_server_Body+0xac> * of zero it will be processed in the next iteration of the timer server * body loop. */ _Timer_server_Process_insertions( ts ); _ISR_Disable( level ); 40008e38: 7f ff e7 df call 40002db4 40008e3c: 01 00 00 00 nop if ( _Chain_Is_empty( insert_chain ) ) { 40008e40: c2 07 bf e8 ld [ %fp + -24 ], %g1 40008e44: 80 a0 40 10 cmp %g1, %l0 40008e48: 12 80 00 0a bne 40008e70 <_Timer_server_Body+0x124> <== NEVER TAKEN 40008e4c: 01 00 00 00 nop ts->insert_chain = NULL; 40008e50: c0 26 20 78 clr [ %i0 + 0x78 ] _ISR_Enable( level ); 40008e54: 7f ff e7 db call 40002dc0 40008e58: 01 00 00 00 nop _Timer_server_SMP_lock_aquire(); while ( true ) { _Timer_server_Get_watchdogs_that_fire_now( ts, &insert_chain, &fire_chain ); if ( !_Chain_Is_empty( &fire_chain ) ) { 40008e5c: c2 07 bf f4 ld [ %fp + -12 ], %g1 40008e60: 80 a0 40 1b cmp %g1, %i3 40008e64: 12 80 00 06 bne 40008e7c <_Timer_server_Body+0x130> 40008e68: 01 00 00 00 nop 40008e6c: 30 80 00 18 b,a 40008ecc <_Timer_server_Body+0x180> ts->insert_chain = NULL; _ISR_Enable( level ); break; } else { _ISR_Enable( level ); 40008e70: 7f ff e7 d4 call 40002dc0 <== NOT EXECUTED 40008e74: 01 00 00 00 nop <== NOT EXECUTED 40008e78: 30 bf ff c7 b,a 40008d94 <_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 ); 40008e7c: 7f ff e7 ce call 40002db4 40008e80: 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; 40008e84: 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)) 40008e88: 80 a7 40 1b cmp %i5, %i3 40008e8c: 02 80 00 0d be 40008ec0 <_Timer_server_Body+0x174> 40008e90: 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; 40008e94: c2 07 40 00 ld [ %i5 ], %g1 head->next = new_first; new_first->previous = head; 40008e98: 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; 40008e9c: c2 27 bf f4 st %g1, [ %fp + -12 ] watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; 40008ea0: c0 27 60 08 clr [ %i5 + 8 ] _ISR_Enable( level ); 40008ea4: 7f ff e7 c7 call 40002dc0 40008ea8: 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 ); 40008eac: c2 07 60 1c ld [ %i5 + 0x1c ], %g1 40008eb0: d0 07 60 20 ld [ %i5 + 0x20 ], %o0 40008eb4: 9f c0 40 00 call %g1 40008eb8: d2 07 60 24 ld [ %i5 + 0x24 ], %o1 40008ebc: 30 bf ff f0 b,a 40008e7c <_Timer_server_Body+0x130> watchdog = (Watchdog_Control *) _Chain_Get_unprotected( &fire_chain ); if ( watchdog != NULL ) { watchdog->state = WATCHDOG_INACTIVE; _ISR_Enable( level ); } else { _ISR_Enable( level ); 40008ec0: 7f ff e7 c0 call 40002dc0 40008ec4: 01 00 00 00 nop 40008ec8: 30 bf ff b2 b,a 40008d90 <_Timer_server_Body+0x44> (*watchdog->routine)( watchdog->id, watchdog->user_data ); _Timer_server_SMP_lock_aquire(); } } else { ts->active = false; 40008ecc: c0 2e 20 7c clrb [ %i0 + 0x7c ] #if defined ( __THREAD_DO_NOT_INLINE_DISABLE_DISPATCH__ ) void _Thread_Disable_dispatch( void ); #else RTEMS_INLINE_ROUTINE void _Thread_Disable_dispatch( void ) { _Thread_Dispatch_increment_disable_level(); 40008ed0: 7f ff ff 72 call 40008c98 <_Thread_Dispatch_increment_disable_level> 40008ed4: 01 00 00 00 nop * Block until there is something to do. */ #if !defined( RTEMS_SMP ) _Thread_Disable_dispatch(); #endif _Thread_Set_state( ts->thread, STATES_DELAYING ); 40008ed8: d0 06 00 00 ld [ %i0 ], %o0 40008edc: 40 00 0c d9 call 4000c240 <_Thread_Set_state> 40008ee0: 92 10 20 08 mov 8, %o1 _Timer_server_Reset_interval_system_watchdog( ts ); 40008ee4: 7f ff ff 72 call 40008cac <_Timer_server_Reset_interval_system_watchdog> 40008ee8: 90 10 00 18 mov %i0, %o0 _Timer_server_Reset_tod_system_watchdog( ts ); 40008eec: 7f ff ff 84 call 40008cfc <_Timer_server_Reset_tod_system_watchdog> 40008ef0: 90 10 00 18 mov %i0, %o0 #if !defined( RTEMS_SMP ) _Thread_Enable_dispatch(); 40008ef4: 40 00 09 7c call 4000b4e4 <_Thread_Enable_dispatch> 40008ef8: 01 00 00 00 nop static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 40008efc: 90 10 00 13 mov %l3, %o0 #endif _Timer_server_SMP_lock_release(); _Timer_server_SMP_lock_aquire(); ts->active = true; 40008f00: e8 2e 20 7c stb %l4, [ %i0 + 0x7c ] static void _Timer_server_Stop_interval_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->Interval_watchdogs.System_watchdog ); 40008f04: 40 00 0e 6a call 4000c8ac <_Watchdog_Remove> 40008f08: 01 00 00 00 nop static void _Timer_server_Stop_tod_system_watchdog( Timer_server_Control *ts ) { _Watchdog_Remove( &ts->TOD_watchdogs.System_watchdog ); 40008f0c: 40 00 0e 68 call 4000c8ac <_Watchdog_Remove> 40008f10: 90 10 00 12 mov %l2, %o0 40008f14: 30 bf ff 9f b,a 40008d90 <_Timer_server_Body+0x44> =============================================================================== 40008f18 <_Timer_server_Schedule_operation_method>: static void _Timer_server_Schedule_operation_method( Timer_server_Control *ts, Timer_Control *timer ) { 40008f18: 9d e3 bf a0 save %sp, -96, %sp if ( ts->insert_chain == NULL ) { 40008f1c: c2 06 20 78 ld [ %i0 + 0x78 ], %g1 40008f20: 80 a0 60 00 cmp %g1, 0 40008f24: 12 80 00 4b bne 40009050 <_Timer_server_Schedule_operation_method+0x138> 40008f28: ba 10 00 19 mov %i1, %i5 40008f2c: 7f ff ff 5b call 40008c98 <_Thread_Dispatch_increment_disable_level> 40008f30: 01 00 00 00 nop * being inserted. This could result in an integer overflow. */ _Thread_Disable_dispatch(); if ( timer->the_class == TIMER_INTERVAL_ON_TASK ) { 40008f34: c2 06 60 38 ld [ %i1 + 0x38 ], %g1 40008f38: 80 a0 60 01 cmp %g1, 1 40008f3c: 12 80 00 1f bne 40008fb8 <_Timer_server_Schedule_operation_method+0xa0> 40008f40: 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 ); 40008f44: 7f ff e7 9c call 40002db4 40008f48: 01 00 00 00 nop snapshot = _Watchdog_Ticks_since_boot; 40008f4c: 03 10 00 67 sethi %hi(0x40019c00), %g1 40008f50: c4 00 63 60 ld [ %g1 + 0x360 ], %g2 ! 40019f60 <_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; 40008f54: c2 06 20 30 ld [ %i0 + 0x30 ], %g1 last_snapshot = ts->Interval_watchdogs.last_snapshot; 40008f58: 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 ); 40008f5c: 86 06 20 34 add %i0, 0x34, %g3 if ( !_Chain_Is_empty( &ts->Interval_watchdogs.Chain ) ) { 40008f60: 80 a0 40 03 cmp %g1, %g3 40008f64: 02 80 00 08 be 40008f84 <_Timer_server_Schedule_operation_method+0x6c> 40008f68: 88 20 80 04 sub %g2, %g4, %g4 /* * We assume adequate unsigned arithmetic here. */ delta = snapshot - last_snapshot; delta_interval = first_watchdog->delta_interval; 40008f6c: f8 00 60 10 ld [ %g1 + 0x10 ], %i4 if (delta_interval > delta) { 40008f70: 80 a7 00 04 cmp %i4, %g4 40008f74: 08 80 00 03 bleu 40008f80 <_Timer_server_Schedule_operation_method+0x68> 40008f78: 86 10 20 00 clr %g3 delta_interval -= delta; 40008f7c: 86 27 00 04 sub %i4, %g4, %g3 } else { delta_interval = 0; } first_watchdog->delta_interval = delta_interval; 40008f80: c6 20 60 10 st %g3, [ %g1 + 0x10 ] } ts->Interval_watchdogs.last_snapshot = snapshot; 40008f84: c4 26 20 3c st %g2, [ %i0 + 0x3c ] _ISR_Enable( level ); 40008f88: 7f ff e7 8e call 40002dc0 40008f8c: 01 00 00 00 nop _Watchdog_Insert( &ts->Interval_watchdogs.Chain, &timer->Ticker ); 40008f90: 90 06 20 30 add %i0, 0x30, %o0 40008f94: 40 00 0d f1 call 4000c758 <_Watchdog_Insert> 40008f98: 92 07 60 10 add %i5, 0x10, %o1 if ( !ts->active ) { 40008f9c: c2 0e 20 7c ldub [ %i0 + 0x7c ], %g1 40008fa0: 80 a0 60 00 cmp %g1, 0 40008fa4: 12 80 00 29 bne 40009048 <_Timer_server_Schedule_operation_method+0x130> 40008fa8: 01 00 00 00 nop _Timer_server_Reset_interval_system_watchdog( ts ); 40008fac: 7f ff ff 40 call 40008cac <_Timer_server_Reset_interval_system_watchdog> 40008fb0: 90 10 00 18 mov %i0, %o0 40008fb4: 30 80 00 25 b,a 40009048 <_Timer_server_Schedule_operation_method+0x130> } } else if ( timer->the_class == TIMER_TIME_OF_DAY_ON_TASK ) { 40008fb8: 12 80 00 24 bne 40009048 <_Timer_server_Schedule_operation_method+0x130> 40008fbc: 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 ); 40008fc0: 7f ff e7 7d call 40002db4 40008fc4: 01 00 00 00 nop 40008fc8: b6 10 00 08 mov %o0, %i3 snapshot = (Watchdog_Interval) _TOD_Seconds_since_epoch(); 40008fcc: 40 00 02 d2 call 40009b14 <_TOD_Seconds_since_epoch> 40008fd0: 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; 40008fd4: c4 06 20 68 ld [ %i0 + 0x68 ], %g2 last_snapshot = ts->TOD_watchdogs.last_snapshot; 40008fd8: c6 06 20 74 ld [ %i0 + 0x74 ], %g3 RTEMS_INLINE_ROUTINE bool _Chain_Is_empty( const Chain_Control *the_chain ) { return _Chain_Immutable_first( the_chain ) == _Chain_Immutable_tail( the_chain ); 40008fdc: 88 06 20 6c add %i0, 0x6c, %g4 if ( !_Chain_Is_empty( &ts->TOD_watchdogs.Chain ) ) { 40008fe0: 80 a0 80 04 cmp %g2, %g4 40008fe4: 02 80 00 0d be 40009018 <_Timer_server_Schedule_operation_method+0x100> 40008fe8: 80 a2 00 03 cmp %o0, %g3 first_watchdog = _Watchdog_First( &ts->TOD_watchdogs.Chain ); delta_interval = first_watchdog->delta_interval; if ( snapshot > last_snapshot ) { 40008fec: 08 80 00 08 bleu 4000900c <_Timer_server_Schedule_operation_method+0xf4> 40008ff0: c8 00 a0 10 ld [ %g2 + 0x10 ], %g4 /* * We advanced in time. */ delta = snapshot - last_snapshot; 40008ff4: b8 22 00 03 sub %o0, %g3, %i4 if (delta_interval > delta) { 40008ff8: 80 a1 00 1c cmp %g4, %i4 40008ffc: 08 80 00 06 bleu 40009014 <_Timer_server_Schedule_operation_method+0xfc><== NEVER TAKEN 40009000: 86 10 20 00 clr %g3 delta_interval -= delta; 40009004: 10 80 00 04 b 40009014 <_Timer_server_Schedule_operation_method+0xfc> 40009008: 86 21 00 1c sub %g4, %i4, %g3 } } else { /* * Someone put us in the past. */ delta = last_snapshot - snapshot; 4000900c: 86 01 00 03 add %g4, %g3, %g3 delta_interval += delta; 40009010: 86 20 c0 08 sub %g3, %o0, %g3 } first_watchdog->delta_interval = delta_interval; 40009014: c6 20 a0 10 st %g3, [ %g2 + 0x10 ] } ts->TOD_watchdogs.last_snapshot = snapshot; 40009018: d0 26 20 74 st %o0, [ %i0 + 0x74 ] _ISR_Enable( level ); 4000901c: 7f ff e7 69 call 40002dc0 40009020: 90 10 00 1b mov %i3, %o0 _Watchdog_Insert( &ts->TOD_watchdogs.Chain, &timer->Ticker ); 40009024: 90 06 20 68 add %i0, 0x68, %o0 40009028: 40 00 0d cc call 4000c758 <_Watchdog_Insert> 4000902c: 92 07 60 10 add %i5, 0x10, %o1 if ( !ts->active ) { 40009030: c2 0e 20 7c ldub [ %i0 + 0x7c ], %g1 40009034: 80 a0 60 00 cmp %g1, 0 40009038: 12 80 00 04 bne 40009048 <_Timer_server_Schedule_operation_method+0x130> 4000903c: 01 00 00 00 nop _Timer_server_Reset_tod_system_watchdog( ts ); 40009040: 7f ff ff 2f call 40008cfc <_Timer_server_Reset_tod_system_watchdog> 40009044: 90 10 00 18 mov %i0, %o0 } } _Thread_Enable_dispatch(); 40009048: 40 00 09 27 call 4000b4e4 <_Thread_Enable_dispatch> 4000904c: 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 ); 40009050: f0 06 20 78 ld [ %i0 + 0x78 ], %i0 40009054: 40 00 01 87 call 40009670 <_Chain_Append> 40009058: 81 e8 00 00 restore =============================================================================== 4000c834 <_Timestamp64_Divide>: const Timestamp64_Control *_lhs, const Timestamp64_Control *_rhs, uint32_t *_ival_percentage, uint32_t *_fval_percentage ) { 4000c834: 9d e3 bf a0 save %sp, -96, %sp Timestamp64_Control answer; if ( *_rhs == 0 ) { 4000c838: d4 1e 40 00 ldd [ %i1 ], %o2 4000c83c: 80 92 80 0b orcc %o2, %o3, %g0 4000c840: 32 80 00 06 bne,a 4000c858 <_Timestamp64_Divide+0x24> <== ALWAYS TAKEN 4000c844: d8 1e 00 00 ldd [ %i0 ], %o4 *_ival_percentage = 0; 4000c848: c0 26 80 00 clr [ %i2 ] <== NOT EXECUTED *_fval_percentage = 0; 4000c84c: c0 26 c0 00 clr [ %i3 ] <== NOT EXECUTED return; 4000c850: 81 c7 e0 08 ret <== NOT EXECUTED 4000c854: 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; 4000c858: 83 2b 20 02 sll %o4, 2, %g1 4000c85c: 87 2b 60 02 sll %o5, 2, %g3 4000c860: 89 33 60 1e srl %o5, 0x1e, %g4 4000c864: bb 28 e0 05 sll %g3, 5, %i5 4000c868: 84 11 00 01 or %g4, %g1, %g2 4000c86c: 83 30 e0 1b srl %g3, 0x1b, %g1 4000c870: b9 28 a0 05 sll %g2, 5, %i4 4000c874: 86 a7 40 03 subcc %i5, %g3, %g3 4000c878: b8 10 40 1c or %g1, %i4, %i4 4000c87c: 84 67 00 02 subx %i4, %g2, %g2 4000c880: b2 80 c0 0d addcc %g3, %o5, %i1 4000c884: b0 40 80 0c addx %g2, %o4, %i0 4000c888: 83 36 60 1e srl %i1, 0x1e, %g1 4000c88c: 87 2e 60 02 sll %i1, 2, %g3 4000c890: 85 2e 20 02 sll %i0, 2, %g2 4000c894: 84 10 40 02 or %g1, %g2, %g2 4000c898: ba 86 40 03 addcc %i1, %g3, %i5 4000c89c: b8 46 00 02 addx %i0, %g2, %i4 4000c8a0: 83 37 60 1e srl %i5, 0x1e, %g1 4000c8a4: 87 2f 60 02 sll %i5, 2, %g3 4000c8a8: 85 2f 20 02 sll %i4, 2, %g2 4000c8ac: 84 10 40 02 or %g1, %g2, %g2 4000c8b0: 92 87 40 03 addcc %i5, %g3, %o1 4000c8b4: 90 47 00 02 addx %i4, %g2, %o0 4000c8b8: 87 32 60 1b srl %o1, 0x1b, %g3 4000c8bc: 85 2a 20 05 sll %o0, 5, %g2 4000c8c0: 83 2a 60 05 sll %o1, 5, %g1 4000c8c4: 90 10 c0 02 or %g3, %g2, %o0 4000c8c8: 40 00 23 1f call 40015544 <__divdi3> 4000c8cc: 92 10 00 01 mov %g1, %o1 *_ival_percentage = answer / 1000; 4000c8d0: 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; 4000c8d4: b8 10 00 08 mov %o0, %i4 4000c8d8: ba 10 00 09 mov %o1, %i5 *_ival_percentage = answer / 1000; 4000c8dc: 40 00 23 1a call 40015544 <__divdi3> 4000c8e0: 96 10 23 e8 mov 0x3e8, %o3 *_fval_percentage = answer % 1000; 4000c8e4: 90 10 00 1c mov %i4, %o0 * TODO: Rounding on the last digit of the fval. */ answer = (*_lhs * 100000) / *_rhs; *_ival_percentage = answer / 1000; 4000c8e8: d2 26 80 00 st %o1, [ %i2 ] *_fval_percentage = answer % 1000; 4000c8ec: 94 10 20 00 clr %o2 4000c8f0: 92 10 00 1d mov %i5, %o1 4000c8f4: 40 00 24 06 call 4001590c <__moddi3> 4000c8f8: 96 10 23 e8 mov 0x3e8, %o3 4000c8fc: d2 26 c0 00 st %o1, [ %i3 ] 4000c900: 81 c7 e0 08 ret 4000c904: 81 e8 00 00 restore =============================================================================== 4000af04 <_User_extensions_Handler_initialization>: } } void _User_extensions_Handler_initialization(void) { 4000af04: 9d e3 bf 98 save %sp, -104, %sp uint32_t number_of_initial_extensions = 4000af08: 03 10 00 55 sethi %hi(0x40015400), %g1 4000af0c: c2 00 61 c4 ld [ %g1 + 0x1c4 ], %g1 ! 400155c4 rtems_configuration_get_number_of_initial_extensions(); if ( number_of_initial_extensions > 0 ) { 4000af10: 80 a0 60 00 cmp %g1, 0 4000af14: 02 80 00 0a be 4000af3c <_User_extensions_Handler_initialization+0x38><== NEVER TAKEN 4000af18: 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 ) 4000af1c: 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 = 4000af20: 40 00 01 2d call 4000b3d4 <_Workspace_Allocate_or_fatal_error> 4000af24: 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 ); 4000af28: 13 10 00 2b sethi %hi(0x4000ac00), %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 }; 4000af2c: d0 27 bf fc st %o0, [ %fp + -4 ] _User_extensions_Iterate( &ctx, _User_extensions_Switch_visitor ); 4000af30: 92 12 62 c0 or %o1, 0x2c0, %o1 4000af34: 7f ff ff c2 call 4000ae3c <_User_extensions_Iterate> 4000af38: 90 07 bf fc add %fp, -4, %o0 4000af3c: 81 c7 e0 08 ret 4000af40: 81 e8 00 00 restore =============================================================================== 4000acf8 <_User_extensions_Thread_create_visitor>: void _User_extensions_Thread_create_visitor( Thread_Control *executing, void *arg, const User_extensions_Table *callouts ) { 4000acf8: 9d e3 bf a0 save %sp, -96, %sp User_extensions_thread_create_extension callout = callouts->thread_create; 4000acfc: c2 06 80 00 ld [ %i2 ], %g1 if ( callout != NULL ) { 4000ad00: 80 a0 60 00 cmp %g1, 0 4000ad04: 02 80 00 0b be 4000ad30 <_User_extensions_Thread_create_visitor+0x38> 4000ad08: 01 00 00 00 nop User_extensions_Thread_create_context *ctx = arg; ctx->ok = ctx->ok && (*callout)( executing, ctx->created ); 4000ad0c: c4 0e 60 04 ldub [ %i1 + 4 ], %g2 4000ad10: 80 a0 a0 00 cmp %g2, 0 4000ad14: 02 80 00 05 be 4000ad28 <_User_extensions_Thread_create_visitor+0x30><== NEVER TAKEN 4000ad18: 90 10 20 00 clr %o0 4000ad1c: d2 06 40 00 ld [ %i1 ], %o1 4000ad20: 9f c0 40 00 call %g1 4000ad24: 90 10 00 18 mov %i0, %o0 4000ad28: 90 0a 20 01 and %o0, 1, %o0 4000ad2c: d0 2e 60 04 stb %o0, [ %i1 + 4 ] 4000ad30: 81 c7 e0 08 ret 4000ad34: 81 e8 00 00 restore =============================================================================== 4000cbb8 <_Watchdog_Adjust>: void _Watchdog_Adjust( Chain_Control *header, Watchdog_Adjust_directions direction, Watchdog_Interval units ) { 4000cbb8: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; _ISR_Disable( level ); 4000cbbc: 7f ff d9 be call 400032b4 4000cbc0: 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; 4000cbc4: 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 ); 4000cbc8: 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 ) ) { 4000cbcc: 80 a0 40 1c cmp %g1, %i4 4000cbd0: 02 80 00 20 be 4000cc50 <_Watchdog_Adjust+0x98> 4000cbd4: 80 a6 60 00 cmp %i1, 0 switch ( direction ) { 4000cbd8: 02 80 00 07 be 4000cbf4 <_Watchdog_Adjust+0x3c> 4000cbdc: 80 a6 60 01 cmp %i1, 1 4000cbe0: 12 80 00 1c bne 4000cc50 <_Watchdog_Adjust+0x98> <== NEVER TAKEN 4000cbe4: 01 00 00 00 nop case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; 4000cbe8: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 4000cbec: 10 80 00 18 b 4000cc4c <_Watchdog_Adjust+0x94> 4000cbf0: b4 00 80 1a add %g2, %i2, %i2 if ( units < _Watchdog_First( header )->delta_interval ) { _Watchdog_First( header )->delta_interval -= units; break; } else { units -= _Watchdog_First( header )->delta_interval; _Watchdog_First( header )->delta_interval = 1; 4000cbf4: 10 80 00 0d b 4000cc28 <_Watchdog_Adjust+0x70> 4000cbf8: b6 10 20 01 mov 1, %i3 4000cbfc: f6 20 60 10 st %i3, [ %g1 + 0x10 ] _ISR_Enable( level ); 4000cc00: 7f ff d9 b0 call 400032c0 4000cc04: 01 00 00 00 nop _Watchdog_Tickle( header ); 4000cc08: 40 00 00 91 call 4000ce4c <_Watchdog_Tickle> 4000cc0c: 90 10 00 18 mov %i0, %o0 _ISR_Disable( level ); 4000cc10: 7f ff d9 a9 call 400032b4 4000cc14: 01 00 00 00 nop if ( _Chain_Is_empty( header ) ) 4000cc18: c2 06 00 00 ld [ %i0 ], %g1 4000cc1c: 80 a0 40 1c cmp %g1, %i4 4000cc20: 02 80 00 0c be 4000cc50 <_Watchdog_Adjust+0x98> 4000cc24: 01 00 00 00 nop switch ( direction ) { case WATCHDOG_BACKWARD: _Watchdog_First( header )->delta_interval += units; break; case WATCHDOG_FORWARD: while ( units ) { 4000cc28: 80 a6 a0 00 cmp %i2, 0 4000cc2c: 02 80 00 09 be 4000cc50 <_Watchdog_Adjust+0x98> <== NEVER TAKEN 4000cc30: 01 00 00 00 nop */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 4000cc34: c2 06 00 00 ld [ %i0 ], %g1 if ( units < _Watchdog_First( header )->delta_interval ) { 4000cc38: c4 00 60 10 ld [ %g1 + 0x10 ], %g2 4000cc3c: 80 a6 80 02 cmp %i2, %g2 4000cc40: 3a bf ff ef bcc,a 4000cbfc <_Watchdog_Adjust+0x44> 4000cc44: b4 26 80 02 sub %i2, %g2, %i2 _Watchdog_First( header )->delta_interval -= units; 4000cc48: b4 20 80 1a sub %g2, %i2, %i2 4000cc4c: f4 20 60 10 st %i2, [ %g1 + 0x10 ] } break; } } _ISR_Enable( level ); 4000cc50: 7f ff d9 9c call 400032c0 4000cc54: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 4000b098 <_Watchdog_Remove>: #include Watchdog_States _Watchdog_Remove( Watchdog_Control *the_watchdog ) { 4000b098: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; Watchdog_States previous_state; Watchdog_Control *next_watchdog; _ISR_Disable( level ); 4000b09c: 7f ff dc e6 call 40002434 4000b0a0: ba 10 00 18 mov %i0, %i5 previous_state = the_watchdog->state; 4000b0a4: f0 06 20 08 ld [ %i0 + 8 ], %i0 switch ( previous_state ) { 4000b0a8: 80 a6 20 01 cmp %i0, 1 4000b0ac: 22 80 00 1c be,a 4000b11c <_Watchdog_Remove+0x84> 4000b0b0: c0 27 60 08 clr [ %i5 + 8 ] 4000b0b4: 0a 80 00 1a bcs 4000b11c <_Watchdog_Remove+0x84> 4000b0b8: 80 a6 20 03 cmp %i0, 3 4000b0bc: 28 80 00 04 bleu,a 4000b0cc <_Watchdog_Remove+0x34> <== ALWAYS TAKEN 4000b0c0: c2 07 40 00 ld [ %i5 ], %g1 _Watchdog_Sync_level = _ISR_Nest_level; _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 4000b0c4: 10 80 00 17 b 4000b120 <_Watchdog_Remove+0x88> <== NOT EXECUTED 4000b0c8: 03 10 00 61 sethi %hi(0x40018400), %g1 <== NOT EXECUTED break; case WATCHDOG_ACTIVE: case WATCHDOG_REMOVE_IT: the_watchdog->state = WATCHDOG_INACTIVE; 4000b0cc: c0 27 60 08 clr [ %i5 + 8 ] next_watchdog = _Watchdog_Next( the_watchdog ); if ( _Watchdog_Next(next_watchdog) ) 4000b0d0: c4 00 40 00 ld [ %g1 ], %g2 4000b0d4: 80 a0 a0 00 cmp %g2, 0 4000b0d8: 02 80 00 07 be 4000b0f4 <_Watchdog_Remove+0x5c> 4000b0dc: 05 10 00 61 sethi %hi(0x40018400), %g2 next_watchdog->delta_interval += the_watchdog->delta_interval; 4000b0e0: c6 00 60 10 ld [ %g1 + 0x10 ], %g3 4000b0e4: c4 07 60 10 ld [ %i5 + 0x10 ], %g2 4000b0e8: 84 00 c0 02 add %g3, %g2, %g2 4000b0ec: c4 20 60 10 st %g2, [ %g1 + 0x10 ] if ( _Watchdog_Sync_count ) 4000b0f0: 05 10 00 61 sethi %hi(0x40018400), %g2 4000b0f4: c4 00 a0 bc ld [ %g2 + 0xbc ], %g2 ! 400184bc <_Watchdog_Sync_count> 4000b0f8: 80 a0 a0 00 cmp %g2, 0 4000b0fc: 22 80 00 06 be,a 4000b114 <_Watchdog_Remove+0x7c> 4000b100: c4 07 60 04 ld [ %i5 + 4 ], %g2 _Watchdog_Sync_level = _ISR_Nest_level; 4000b104: c6 01 a0 0c ld [ %g6 + 0xc ], %g3 4000b108: 05 10 00 61 sethi %hi(0x40018400), %g2 4000b10c: c6 20 a0 9c st %g3, [ %g2 + 0x9c ] ! 4001849c <_Watchdog_Sync_level> { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 4000b110: c4 07 60 04 ld [ %i5 + 4 ], %g2 next->previous = previous; 4000b114: c4 20 60 04 st %g2, [ %g1 + 4 ] previous->next = next; 4000b118: c2 20 80 00 st %g1, [ %g2 ] _Chain_Extract_unprotected( &the_watchdog->Node ); break; } the_watchdog->stop_time = _Watchdog_Ticks_since_boot; 4000b11c: 03 10 00 61 sethi %hi(0x40018400), %g1 4000b120: c2 00 60 c0 ld [ %g1 + 0xc0 ], %g1 ! 400184c0 <_Watchdog_Ticks_since_boot> 4000b124: c2 27 60 18 st %g1, [ %i5 + 0x18 ] _ISR_Enable( level ); 4000b128: 7f ff dc c6 call 40002440 4000b12c: 01 00 00 00 nop return( previous_state ); } 4000b130: 81 c7 e0 08 ret 4000b134: 81 e8 00 00 restore =============================================================================== 4000b138 <_Watchdog_Tickle>: #include void _Watchdog_Tickle( Chain_Control *header ) { 4000b138: 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 ); 4000b13c: 7f ff dc be call 40002434 4000b140: b8 10 00 18 mov %i0, %i4 4000b144: 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; 4000b148: 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 ); 4000b14c: b6 07 20 04 add %i4, 4, %i3 if ( _Chain_Is_empty( header ) ) 4000b150: 80 a7 40 1b cmp %i5, %i3 4000b154: 02 80 00 1f be 4000b1d0 <_Watchdog_Tickle+0x98> 4000b158: 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) { 4000b15c: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 4000b160: 80 a0 60 00 cmp %g1, 0 4000b164: 02 80 00 06 be 4000b17c <_Watchdog_Tickle+0x44> <== NEVER TAKEN 4000b168: 82 00 7f ff add %g1, -1, %g1 the_watchdog->delta_interval--; 4000b16c: c2 27 60 10 st %g1, [ %i5 + 0x10 ] if ( the_watchdog->delta_interval != 0 ) 4000b170: 80 a0 60 00 cmp %g1, 0 4000b174: 12 80 00 17 bne 4000b1d0 <_Watchdog_Tickle+0x98> 4000b178: 01 00 00 00 nop goto leave; } do { watchdog_state = _Watchdog_Remove( the_watchdog ); 4000b17c: 7f ff ff c7 call 4000b098 <_Watchdog_Remove> 4000b180: 90 10 00 1d mov %i5, %o0 4000b184: b4 10 00 08 mov %o0, %i2 _ISR_Enable( level ); 4000b188: 7f ff dc ae call 40002440 4000b18c: 90 10 00 18 mov %i0, %o0 switch( watchdog_state ) { 4000b190: 80 a6 a0 02 cmp %i2, 2 4000b194: 12 80 00 06 bne 4000b1ac <_Watchdog_Tickle+0x74> 4000b198: 01 00 00 00 nop case WATCHDOG_ACTIVE: (*the_watchdog->routine)( 4000b19c: c2 07 60 1c ld [ %i5 + 0x1c ], %g1 4000b1a0: d0 07 60 20 ld [ %i5 + 0x20 ], %o0 4000b1a4: 9f c0 40 00 call %g1 4000b1a8: d2 07 60 24 ld [ %i5 + 0x24 ], %o1 case WATCHDOG_REMOVE_IT: break; } _ISR_Disable( level ); 4000b1ac: 7f ff dc a2 call 40002434 4000b1b0: 01 00 00 00 nop 4000b1b4: b0 10 00 08 mov %o0, %i0 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 4000b1b8: fa 07 00 00 ld [ %i4 ], %i5 the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && (the_watchdog->delta_interval == 0) ); 4000b1bc: 80 a7 40 1b cmp %i5, %i3 4000b1c0: 02 80 00 04 be 4000b1d0 <_Watchdog_Tickle+0x98> 4000b1c4: 01 00 00 00 nop } _ISR_Disable( level ); the_watchdog = _Watchdog_First( header ); } while ( !_Chain_Is_empty( header ) && 4000b1c8: 10 bf ff ea b 4000b170 <_Watchdog_Tickle+0x38> 4000b1cc: c2 07 60 10 ld [ %i5 + 0x10 ], %g1 (the_watchdog->delta_interval == 0) ); leave: _ISR_Enable(level); 4000b1d0: 7f ff dc 9c call 40002440 4000b1d4: 81 e8 00 00 restore =============================================================================== 4000b1d8 <_Workspace_Handler_initialization>: void _Workspace_Handler_initialization( Heap_Area *areas, size_t area_count, Heap_Initialization_or_extend_handler extend ) { 4000b1d8: 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(); 4000b1dc: 05 10 00 55 sethi %hi(0x40015400), %g2 4000b1e0: 82 10 a1 88 or %g2, 0x188, %g1 ! 40015588 4000b1e4: c6 08 60 3a ldub [ %g1 + 0x3a ], %g3 4000b1e8: fa 00 a1 88 ld [ %g2 + 0x188 ], %i5 4000b1ec: 80 a0 e0 00 cmp %g3, 0 4000b1f0: 12 80 00 03 bne 4000b1fc <_Workspace_Handler_initialization+0x24> 4000b1f4: 84 10 20 00 clr %g2 4000b1f8: c4 00 60 04 ld [ %g1 + 4 ], %g2 4000b1fc: ba 00 80 1d add %g2, %i5, %i5 bool do_zero = rtems_configuration_get_do_zero_of_workspace(); 4000b200: e2 08 60 38 ldub [ %g1 + 0x38 ], %l1 bool unified = rtems_configuration_get_unified_work_area(); 4000b204: e4 08 60 39 ldub [ %g1 + 0x39 ], %l2 { /* * Do not use _TLS_Size here since this will lead GCC to assume that this * symbol is not 0 and the tests for 0 will be optimized away. */ return (uintptr_t) _TLS_BSS_end - (uintptr_t) _TLS_Data_begin; 4000b208: 05 10 00 5a sethi %hi(0x40016800), %g2 4000b20c: 03 10 00 5a sethi %hi(0x40016800), %g1 4000b210: 84 10 a2 a0 or %g2, 0x2a0, %g2 4000b214: 82 10 62 a0 or %g1, 0x2a0, %g1 * workspace is large enough to fulfill all requests known at configuration * time (so excluding the unlimited option). It is not possible to estimate * the TLS size in the configuration at compile-time. The TLS size is * determined at application link-time. */ if ( tls_size > 0 ) { 4000b218: 90 a0 80 01 subcc %g2, %g1, %o0 4000b21c: 02 80 00 1a be 4000b284 <_Workspace_Handler_initialization+0xac> 4000b220: 03 00 00 00 sethi %hi(0), %g1 static inline uintptr_t _TLS_Heap_align_up( uintptr_t val ) { uintptr_t msk = CPU_HEAP_ALIGNMENT - 1; return (val + msk) & ~msk; 4000b224: 82 10 60 01 or %g1, 1, %g1 ! 1 <_TLS_Alignment> 4000b228: 82 00 60 07 add %g1, 7, %g1 4000b22c: 82 08 7f f8 and %g1, -8, %g1 static inline uintptr_t _TLS_Get_thread_control_block_area_size( uintptr_t alignment ) { return alignment <= sizeof(TLS_Thread_control_block) ? 4000b230: 80 a0 60 08 cmp %g1, 8 4000b234: 2a 80 00 02 bcs,a 4000b23c <_Workspace_Handler_initialization+0x64><== NEVER TAKEN 4000b238: 82 10 20 08 mov 8, %g1 <== NOT EXECUTED { uint32_t thread_count = 0; thread_count += _Thread_Get_maximum_internal_threads(); thread_count += rtems_resource_maximum_per_allocation( 4000b23c: 05 10 00 5a sethi %hi(0x40016800), %g2 Configuration_RTEMS_API.maximum_tasks ); #if defined(RTEMS_POSIX_API) thread_count += rtems_resource_maximum_per_allocation( 4000b240: 07 10 00 5c sethi %hi(0x40017000), %g3 { uint32_t thread_count = 0; thread_count += _Thread_Get_maximum_internal_threads(); thread_count += rtems_resource_maximum_per_allocation( 4000b244: d2 00 a2 ac ld [ %g2 + 0x2ac ], %o1 Configuration_RTEMS_API.maximum_tasks ); #if defined(RTEMS_POSIX_API) thread_count += rtems_resource_maximum_per_allocation( 4000b248: c6 00 e0 84 ld [ %g3 + 0x84 ], %g3 { uint32_t thread_count = 0; thread_count += _Thread_Get_maximum_internal_threads(); thread_count += rtems_resource_maximum_per_allocation( 4000b24c: 05 00 00 3f sethi %hi(0xfc00), %g2 4000b250: 84 10 a3 ff or %g2, 0x3ff, %g2 ! ffff <_TLS_Alignment+0xfffe> 4000b254: 92 0a 40 02 and %o1, %g2, %o1 Configuration_RTEMS_API.maximum_tasks ); #if defined(RTEMS_POSIX_API) thread_count += rtems_resource_maximum_per_allocation( 4000b258: 84 08 c0 02 and %g3, %g2, %g2 static inline uintptr_t _TLS_Heap_align_up( uintptr_t val ) { uintptr_t msk = CPU_HEAP_ALIGNMENT - 1; return (val + msk) & ~msk; 4000b25c: 90 02 20 07 add %o0, 7, %o0 { uint32_t thread_count = 0; thread_count += _Thread_Get_maximum_internal_threads(); thread_count += rtems_resource_maximum_per_allocation( 4000b260: 92 02 40 02 add %o1, %g2, %o1 4000b264: 90 0a 3f f8 and %o0, -8, %o0 * size. */ remaining += _Heap_Min_block_size( page_size ); remaining += _Get_maximum_thread_count() * _Heap_Size_with_overhead( page_size, tls_alloc, tls_align ); 4000b268: 92 02 60 01 inc %o1 uintptr_t alignment ) { uintptr_t aligned_size = _TLS_Heap_align_up( size ); return _TLS_Get_thread_control_block_area_size( alignment ) 4000b26c: 90 02 00 01 add %o0, %g1, %o0 if ( page_size < alignment ) { page_size = alignment; } return HEAP_BLOCK_HEADER_SIZE + page_size - 1 + size; 4000b270: 90 02 20 0f add %o0, 0xf, %o0 4000b274: 40 00 20 5f call 400133f0 <.umul> 4000b278: 90 02 00 01 add %o0, %g1, %o0 /* * Memory allocated with an alignment constraint is allocated from the end * of a free block. The last allocation may need one free block of minimum * size. */ remaining += _Heap_Min_block_size( page_size ); 4000b27c: 90 02 20 10 add %o0, 0x10, %o0 remaining += _Get_maximum_thread_count() 4000b280: ba 07 40 08 add %i5, %o0, %i5 remaining -= space_available; } else { remaining = 0; } init_or_extend = extend; 4000b284: 21 10 00 21 sethi %hi(0x40008400), %l0 } else { size = 0; } } space_available = (*init_or_extend)( 4000b288: 27 10 00 61 sethi %hi(0x40018400), %l3 remaining -= space_available; } else { remaining = 0; } init_or_extend = extend; 4000b28c: b6 10 20 00 clr %i3 4000b290: a0 14 23 ac or %l0, 0x3ac, %l0 } for (i = 0; i < area_count; ++i) { Heap_Area *area = &areas [i]; if ( do_zero ) { 4000b294: a2 0c 60 ff and %l1, 0xff, %l1 if ( area->size > overhead ) { uintptr_t space_available; uintptr_t size; if ( unified ) { 4000b298: a4 0c a0 ff and %l2, 0xff, %l2 } else { size = 0; } } space_available = (*init_or_extend)( 4000b29c: a6 14 e0 3c or %l3, 0x3c, %l3 remaining += _Get_maximum_thread_count() * _Heap_Size_with_overhead( page_size, tls_alloc, tls_align ); } for (i = 0; i < area_count; ++i) { 4000b2a0: 80 a6 c0 19 cmp %i3, %i1 4000b2a4: 02 80 00 2d be 4000b358 <_Workspace_Handler_initialization+0x180> 4000b2a8: 80 a4 60 00 cmp %l1, 0 Heap_Area *area = &areas [i]; if ( do_zero ) { 4000b2ac: 22 80 00 07 be,a 4000b2c8 <_Workspace_Handler_initialization+0xf0> 4000b2b0: f8 06 20 04 ld [ %i0 + 4 ], %i4 memset( area->begin, 0, area->size ); 4000b2b4: d0 06 00 00 ld [ %i0 ], %o0 4000b2b8: d4 06 20 04 ld [ %i0 + 4 ], %o2 4000b2bc: 40 00 13 fe call 400102b4 4000b2c0: 92 10 20 00 clr %o1 } if ( area->size > overhead ) { 4000b2c4: f8 06 20 04 ld [ %i0 + 4 ], %i4 4000b2c8: 80 a7 20 16 cmp %i4, 0x16 4000b2cc: 28 80 00 21 bleu,a 4000b350 <_Workspace_Handler_initialization+0x178> 4000b2d0: b6 06 e0 01 inc %i3 uintptr_t space_available; uintptr_t size; if ( unified ) { 4000b2d4: 80 a4 a0 00 cmp %l2, 0 4000b2d8: 32 80 00 0c bne,a 4000b308 <_Workspace_Handler_initialization+0x130> 4000b2dc: d2 06 00 00 ld [ %i0 ], %o1 size = area->size; } else { if ( remaining > 0 ) { 4000b2e0: 80 a7 60 00 cmp %i5, 0 4000b2e4: 22 80 00 08 be,a 4000b304 <_Workspace_Handler_initialization+0x12c><== NEVER TAKEN 4000b2e8: b8 10 20 00 clr %i4 <== NOT EXECUTED size = remaining < area->size - overhead ? 4000b2ec: 82 07 3f ea add %i4, -22, %g1 remaining + overhead : area->size; 4000b2f0: 80 a7 40 01 cmp %i5, %g1 4000b2f4: 2a 80 00 04 bcs,a 4000b304 <_Workspace_Handler_initialization+0x12c><== ALWAYS TAKEN 4000b2f8: b8 07 60 16 add %i5, 0x16, %i4 4000b2fc: 10 80 00 03 b 4000b308 <_Workspace_Handler_initialization+0x130><== NOT EXECUTED 4000b300: d2 06 00 00 ld [ %i0 ], %o1 <== NOT EXECUTED } else { size = 0; } } space_available = (*init_or_extend)( 4000b304: d2 06 00 00 ld [ %i0 ], %o1 4000b308: 94 10 00 1c mov %i4, %o2 4000b30c: 90 10 00 13 mov %l3, %o0 4000b310: 9f c4 00 00 call %l0 4000b314: 96 10 20 08 mov 8, %o3 area->begin, size, page_size ); area->begin = (char *) area->begin + size; 4000b318: c2 06 00 00 ld [ %i0 ], %g1 area->size -= size; if ( space_available < remaining ) { 4000b31c: 80 a2 00 1d cmp %o0, %i5 area->begin, size, page_size ); area->begin = (char *) area->begin + size; 4000b320: 82 00 40 1c add %g1, %i4, %g1 4000b324: c2 26 00 00 st %g1, [ %i0 ] area->size -= size; 4000b328: c2 06 20 04 ld [ %i0 + 4 ], %g1 4000b32c: b8 20 40 1c sub %g1, %i4, %i4 if ( space_available < remaining ) { 4000b330: 1a 80 00 05 bcc 4000b344 <_Workspace_Handler_initialization+0x16c><== ALWAYS TAKEN 4000b334: f8 26 20 04 st %i4, [ %i0 + 4 ] remaining -= space_available; 4000b338: ba 27 40 08 sub %i5, %o0, %i5 <== NOT EXECUTED 4000b33c: 10 80 00 04 b 4000b34c <_Workspace_Handler_initialization+0x174><== NOT EXECUTED 4000b340: a0 10 00 1a mov %i2, %l0 <== NOT EXECUTED } else { remaining = 0; } init_or_extend = extend; 4000b344: a0 10 00 1a mov %i2, %l0 area->size -= size; if ( space_available < remaining ) { remaining -= space_available; } else { remaining = 0; 4000b348: ba 10 20 00 clr %i5 remaining += _Get_maximum_thread_count() * _Heap_Size_with_overhead( page_size, tls_alloc, tls_align ); } for (i = 0; i < area_count; ++i) { 4000b34c: b6 06 e0 01 inc %i3 4000b350: 10 bf ff d4 b 4000b2a0 <_Workspace_Handler_initialization+0xc8> 4000b354: b0 06 20 08 add %i0, 8, %i0 init_or_extend = extend; } } if ( remaining > 0 ) { 4000b358: 80 a7 60 00 cmp %i5, 0 4000b35c: 02 80 00 05 be 4000b370 <_Workspace_Handler_initialization+0x198> 4000b360: 90 10 20 00 clr %o0 _Terminate( 4000b364: 92 10 20 01 mov 1, %o1 4000b368: 7f ff f5 a8 call 40008a08 <_Terminate> 4000b36c: 94 10 20 02 mov 2, %o2 4000b370: 81 c7 e0 08 ret 4000b374: 81 e8 00 00 restore =============================================================================== 400076dc : #include #include #include int aio_cancel(int fildes, struct aiocb *aiocbp) { 400076dc: 9d e3 bf a0 save %sp, -96, %sp rtems_chain_control *idle_req_chain = &aio_request_queue.idle_req; rtems_chain_control *work_req_chain = &aio_request_queue.work_req; rtems_aio_request_chain *r_chain; int result; pthread_mutex_lock (&aio_request_queue.mutex); 400076e0: 3b 10 00 6a sethi %hi(0x4001a800), %i5 400076e4: 40 00 04 a7 call 40008980 400076e8: 90 17 60 88 or %i5, 0x88, %o0 ! 4001a888 if (fcntl (fildes, F_GETFD) < 0) { 400076ec: 90 10 00 18 mov %i0, %o0 400076f0: 92 10 20 01 mov 1, %o1 400076f4: 40 00 1b b9 call 4000e5d8 400076f8: b4 10 00 1d mov %i5, %i2 400076fc: 80 a2 20 00 cmp %o0, 0 40007700: 16 80 00 08 bge 40007720 40007704: 80 a6 60 00 cmp %i1, 0 pthread_mutex_unlock(&aio_request_queue.mutex); 40007708: 40 00 04 bd call 400089fc 4000770c: 90 17 60 88 or %i5, 0x88, %o0 rtems_set_errno_and_return_minus_one (EBADF); 40007710: 40 00 2a 67 call 400120ac <__errno> 40007714: 01 00 00 00 nop 40007718: 10 80 00 53 b 40007864 4000771c: 82 10 20 09 mov 9, %g1 ! 9 <_TLS_Alignment+0x8> } /* if aiocbp is NULL remove all request for given file descriptor */ if (aiocbp == NULL) { 40007720: 32 80 00 34 bne,a 400077f0 40007724: f8 06 40 00 ld [ %i1 ], %i4 AIO_printf ("Cancel all requests\n"); r_chain = rtems_aio_search_fd (work_req_chain, fildes, 0); 40007728: 11 10 00 6a sethi %hi(0x4001a800), %o0 4000772c: 92 10 00 18 mov %i0, %o1 40007730: 90 12 20 dc or %o0, 0xdc, %o0 40007734: 40 00 01 6d call 40007ce8 40007738: 94 10 20 00 clr %o2 if (r_chain == NULL) { 4000773c: b8 92 20 00 orcc %o0, 0, %i4 40007740: 12 80 00 1f bne 400077bc 40007744: 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; 40007748: ba 17 60 88 or %i5, 0x88, %i5 AIO_printf ("Request chain not on [WQ]\n"); if (!rtems_chain_is_empty (idle_req_chain)) { 4000774c: c4 07 60 60 ld [ %i5 + 0x60 ], %g2 40007750: 82 07 60 64 add %i5, 0x64, %g1 40007754: 80 a0 80 01 cmp %g2, %g1 40007758: 02 80 00 08 be 40007778 <== NEVER TAKEN 4000775c: 90 07 60 60 add %i5, 0x60, %o0 r_chain = rtems_aio_search_fd (idle_req_chain, fildes, 0); 40007760: 92 10 00 18 mov %i0, %o1 40007764: 40 00 01 61 call 40007ce8 40007768: 94 10 20 00 clr %o2 if (r_chain == NULL) { 4000776c: b8 92 20 00 orcc %o0, 0, %i4 40007770: 12 80 00 07 bne 4000778c 40007774: 01 00 00 00 nop pthread_mutex_unlock(&aio_request_queue.mutex); 40007778: 90 16 a0 88 or %i2, 0x88, %o0 4000777c: 40 00 04 a0 call 400089fc 40007780: b0 10 20 02 mov 2, %i0 return AIO_ALLDONE; 40007784: 81 c7 e0 08 ret 40007788: 81 e8 00 00 restore #else RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 4000778c: 40 00 0b 06 call 4000a3a4 <_Chain_Extract> 40007790: 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); 40007794: 40 00 01 7d call 40007d88 40007798: 90 10 00 1c mov %i4, %o0 pthread_mutex_destroy (&r_chain->mutex); 4000779c: 40 00 03 c6 call 400086b4 400077a0: 90 10 00 1b mov %i3, %o0 pthread_cond_destroy (&r_chain->mutex); 400077a4: 40 00 02 ae call 4000825c 400077a8: 90 10 00 1b mov %i3, %o0 free (r_chain); 400077ac: 7f ff f1 bb call 40003e98 400077b0: 90 10 00 1c mov %i4, %o0 pthread_mutex_unlock (&aio_request_queue.mutex); 400077b4: 10 80 00 0b b 400077e0 400077b8: 90 10 00 1d mov %i5, %o0 return AIO_ALLDONE; } AIO_printf ("Request chain on [WQ]\n"); pthread_mutex_lock (&r_chain->mutex); 400077bc: 40 00 04 71 call 40008980 400077c0: 90 10 00 1b mov %i3, %o0 400077c4: 40 00 0a f8 call 4000a3a4 <_Chain_Extract> 400077c8: 90 10 00 1c mov %i4, %o0 rtems_chain_extract (&r_chain->next_fd); rtems_aio_remove_fd (r_chain); 400077cc: 40 00 01 6f call 40007d88 400077d0: 90 10 00 1c mov %i4, %o0 pthread_mutex_unlock (&r_chain->mutex); 400077d4: 40 00 04 8a call 400089fc 400077d8: 90 10 00 1b mov %i3, %o0 pthread_mutex_unlock (&aio_request_queue.mutex); 400077dc: 90 17 60 88 or %i5, 0x88, %o0 400077e0: 40 00 04 87 call 400089fc 400077e4: b0 10 20 00 clr %i0 return AIO_CANCELED; 400077e8: 81 c7 e0 08 ret 400077ec: 81 e8 00 00 restore } else { AIO_printf ("Cancel request\n"); if (aiocbp->aio_fildes != fildes) { 400077f0: 80 a7 00 18 cmp %i4, %i0 400077f4: 12 80 00 17 bne 40007850 400077f8: 90 17 60 88 or %i5, 0x88, %o0 pthread_mutex_unlock (&aio_request_queue.mutex); rtems_set_errno_and_return_minus_one (EINVAL); } r_chain = rtems_aio_search_fd (work_req_chain, fildes, 0); 400077fc: 11 10 00 6a sethi %hi(0x4001a800), %o0 40007800: 92 10 00 1c mov %i4, %o1 40007804: 90 12 20 dc or %o0, 0xdc, %o0 40007808: 40 00 01 38 call 40007ce8 4000780c: 94 10 20 00 clr %o2 if (r_chain == NULL) { 40007810: b6 92 20 00 orcc %o0, 0, %i3 40007814: 32 80 00 1c bne,a 40007884 40007818: b8 06 e0 1c add %i3, 0x1c, %i4 4000781c: ba 17 60 88 or %i5, 0x88, %i5 if (!rtems_chain_is_empty (idle_req_chain)) { 40007820: c4 07 60 60 ld [ %i5 + 0x60 ], %g2 40007824: 82 07 60 64 add %i5, 0x64, %g1 40007828: 80 a0 80 01 cmp %g2, %g1 4000782c: 02 bf ff d3 be 40007778 <== NEVER TAKEN 40007830: 90 07 60 60 add %i5, 0x60, %o0 r_chain = rtems_aio_search_fd (idle_req_chain, fildes, 0); 40007834: 92 10 00 1c mov %i4, %o1 40007838: 40 00 01 2c call 40007ce8 4000783c: 94 10 20 00 clr %o2 if (r_chain == NULL) { 40007840: 80 a2 20 00 cmp %o0, 0 40007844: 12 80 00 0b bne 40007870 40007848: 90 02 20 08 add %o0, 8, %o0 pthread_mutex_unlock (&aio_request_queue.mutex); 4000784c: 90 10 00 1d mov %i5, %o0 40007850: 40 00 04 6b call 400089fc 40007854: 01 00 00 00 nop rtems_set_errno_and_return_minus_one (EINVAL); 40007858: 40 00 2a 15 call 400120ac <__errno> 4000785c: 01 00 00 00 nop 40007860: 82 10 20 16 mov 0x16, %g1 ! 16 <_TLS_Alignment+0x15> 40007864: c2 22 00 00 st %g1, [ %o0 ] 40007868: 81 c7 e0 08 ret 4000786c: 91 e8 3f ff restore %g0, -1, %o0 } AIO_printf ("Request on [IQ]\n"); result = rtems_aio_remove_req (&r_chain->perfd, aiocbp); 40007870: 40 00 01 5b call 40007ddc 40007874: 92 10 00 19 mov %i1, %o1 40007878: b0 10 00 08 mov %o0, %i0 pthread_mutex_unlock (&aio_request_queue.mutex); 4000787c: 10 80 00 0b b 400078a8 40007880: 90 10 00 1d mov %i5, %o0 return AIO_ALLDONE; } } AIO_printf ("Request on [WQ]\n"); pthread_mutex_lock (&r_chain->mutex); 40007884: 40 00 04 3f call 40008980 40007888: 90 10 00 1c mov %i4, %o0 result = rtems_aio_remove_req (&r_chain->perfd, aiocbp); 4000788c: 92 10 00 19 mov %i1, %o1 40007890: 40 00 01 53 call 40007ddc 40007894: 90 06 e0 08 add %i3, 8, %o0 40007898: b0 10 00 08 mov %o0, %i0 pthread_mutex_unlock (&r_chain->mutex); 4000789c: 40 00 04 58 call 400089fc 400078a0: 90 10 00 1c mov %i4, %o0 pthread_mutex_unlock (&aio_request_queue.mutex); 400078a4: 90 17 60 88 or %i5, 0x88, %o0 400078a8: 40 00 04 55 call 400089fc 400078ac: 01 00 00 00 nop return result; } return AIO_ALLDONE; } 400078b0: 81 c7 e0 08 ret 400078b4: 81 e8 00 00 restore =============================================================================== 400078c0 : int aio_fsync( int op, struct aiocb *aiocbp ) { 400078c0: 9d e3 bf a0 save %sp, -96, %sp rtems_aio_request *req; int mode; if (op != O_SYNC) 400078c4: 03 00 00 08 sethi %hi(0x2000), %g1 400078c8: 80 a6 00 01 cmp %i0, %g1 400078cc: 12 80 00 10 bne 4000790c 400078d0: ba 10 20 16 mov 0x16, %i5 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); mode = fcntl (aiocbp->aio_fildes, F_GETFL); 400078d4: d0 06 40 00 ld [ %i1 ], %o0 400078d8: 40 00 1b 40 call 4000e5d8 400078dc: 92 10 20 03 mov 3, %o1 if (!(((mode & O_ACCMODE) == O_WRONLY) || ((mode & O_ACCMODE) == O_RDWR))) 400078e0: 90 0a 20 03 and %o0, 3, %o0 400078e4: 90 02 3f ff add %o0, -1, %o0 400078e8: 80 a2 20 01 cmp %o0, 1 400078ec: 18 80 00 08 bgu 4000790c 400078f0: ba 10 20 09 mov 9, %i5 rtems_aio_set_errno_return_minus_one (EBADF, aiocbp); req = malloc (sizeof (rtems_aio_request)); 400078f4: 7f ff f2 87 call 40004310 400078f8: 90 10 20 18 mov 0x18, %o0 if (req == NULL) 400078fc: b0 92 20 00 orcc %o0, 0, %i0 40007900: 32 80 00 0b bne,a 4000792c <== ALWAYS TAKEN 40007904: f2 26 20 14 st %i1, [ %i0 + 0x14 ] rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 40007908: ba 10 20 0b mov 0xb, %i5 <== NOT EXECUTED 4000790c: 82 10 3f ff mov -1, %g1 40007910: fa 26 60 34 st %i5, [ %i1 + 0x34 ] 40007914: c2 26 60 38 st %g1, [ %i1 + 0x38 ] 40007918: 40 00 29 e5 call 400120ac <__errno> 4000791c: b0 10 3f ff mov -1, %i0 40007920: fa 22 00 00 st %i5, [ %o0 ] req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_SYNC; return rtems_aio_enqueue (req); } 40007924: 81 c7 e0 08 ret 40007928: 81 e8 00 00 restore req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_SYNC; 4000792c: 82 10 20 03 mov 3, %g1 40007930: c2 26 60 30 st %g1, [ %i1 + 0x30 ] return rtems_aio_enqueue (req); 40007934: 40 00 01 48 call 40007e54 40007938: 81 e8 00 00 restore =============================================================================== 4000807c : * 0 - otherwise */ int aio_read (struct aiocb *aiocbp) { 4000807c: 9d e3 bf a0 save %sp, -96, %sp rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 40008080: d0 06 00 00 ld [ %i0 ], %o0 40008084: 92 10 20 03 mov 3, %o1 40008088: 40 00 19 54 call 4000e5d8 4000808c: ba 10 00 18 mov %i0, %i5 if (!(((mode & O_ACCMODE) == O_RDONLY) || ((mode & O_ACCMODE) == O_RDWR))) 40008090: 80 8a 20 01 btst 1, %o0 40008094: 12 80 00 11 bne 400080d8 40008098: 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) 4000809c: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 400080a0: 80 a0 60 00 cmp %g1, 0 400080a4: 22 80 00 04 be,a 400080b4 400080a8: c2 06 20 08 ld [ %i0 + 8 ], %g1 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 400080ac: 10 80 00 0b b 400080d8 400080b0: b8 10 20 16 mov 0x16, %i4 if (aiocbp->aio_offset < 0) 400080b4: 80 a0 60 00 cmp %g1, 0 400080b8: 06 80 00 08 bl 400080d8 400080bc: b8 10 20 16 mov 0x16, %i4 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); req = malloc (sizeof (rtems_aio_request)); 400080c0: 7f ff f0 94 call 40004310 400080c4: 90 10 20 18 mov 0x18, %o0 if (req == NULL) 400080c8: b0 92 20 00 orcc %o0, 0, %i0 400080cc: 32 80 00 0b bne,a 400080f8 <== ALWAYS TAKEN 400080d0: fa 26 20 14 st %i5, [ %i0 + 0x14 ] rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 400080d4: b8 10 20 0b mov 0xb, %i4 <== NOT EXECUTED 400080d8: 82 10 3f ff mov -1, %g1 400080dc: f8 27 60 34 st %i4, [ %i5 + 0x34 ] 400080e0: c2 27 60 38 st %g1, [ %i5 + 0x38 ] 400080e4: 40 00 27 f2 call 400120ac <__errno> 400080e8: b0 10 3f ff mov -1, %i0 400080ec: f8 22 00 00 st %i4, [ %o0 ] req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_READ; return rtems_aio_enqueue (req); } 400080f0: 81 c7 e0 08 ret 400080f4: 81 e8 00 00 restore req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_READ; 400080f8: 82 10 20 01 mov 1, %g1 400080fc: c2 27 60 30 st %g1, [ %i5 + 0x30 ] return rtems_aio_enqueue (req); 40008100: 7f ff ff 55 call 40007e54 40008104: 81 e8 00 00 restore =============================================================================== 40008110 : * 0 - otherwise */ int aio_write (struct aiocb *aiocbp) { 40008110: 9d e3 bf a0 save %sp, -96, %sp rtems_aio_request *req; int mode; mode = fcntl (aiocbp->aio_fildes, F_GETFL); 40008114: d0 06 00 00 ld [ %i0 ], %o0 40008118: 40 00 19 30 call 4000e5d8 4000811c: 92 10 20 03 mov 3, %o1 * 0 - otherwise */ int aio_write (struct aiocb *aiocbp) { 40008120: 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))) 40008124: 90 0a 20 03 and %o0, 3, %o0 40008128: 90 02 3f ff add %o0, -1, %o0 4000812c: 80 a2 20 01 cmp %o0, 1 40008130: 18 80 00 11 bgu 40008174 40008134: 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) 40008138: c2 06 20 18 ld [ %i0 + 0x18 ], %g1 4000813c: 80 a0 60 00 cmp %g1, 0 40008140: 22 80 00 04 be,a 40008150 40008144: c2 06 20 08 ld [ %i0 + 8 ], %g1 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); 40008148: 10 80 00 0b b 40008174 4000814c: b8 10 20 16 mov 0x16, %i4 if (aiocbp->aio_offset < 0) 40008150: 80 a0 60 00 cmp %g1, 0 40008154: 06 80 00 08 bl 40008174 40008158: b8 10 20 16 mov 0x16, %i4 rtems_aio_set_errno_return_minus_one (EINVAL, aiocbp); req = malloc (sizeof (rtems_aio_request)); 4000815c: 7f ff f0 6d call 40004310 40008160: 90 10 20 18 mov 0x18, %o0 if (req == NULL) 40008164: b0 92 20 00 orcc %o0, 0, %i0 40008168: 32 80 00 0b bne,a 40008194 <== ALWAYS TAKEN 4000816c: fa 26 20 14 st %i5, [ %i0 + 0x14 ] rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); 40008170: b8 10 20 0b mov 0xb, %i4 <== NOT EXECUTED 40008174: 82 10 3f ff mov -1, %g1 40008178: f8 27 60 34 st %i4, [ %i5 + 0x34 ] 4000817c: c2 27 60 38 st %g1, [ %i5 + 0x38 ] 40008180: 40 00 27 cb call 400120ac <__errno> 40008184: b0 10 3f ff mov -1, %i0 40008188: f8 22 00 00 st %i4, [ %o0 ] req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_WRITE; return rtems_aio_enqueue (req); } 4000818c: 81 c7 e0 08 ret 40008190: 81 e8 00 00 restore req = malloc (sizeof (rtems_aio_request)); if (req == NULL) rtems_aio_set_errno_return_minus_one (EAGAIN, aiocbp); req->aiocbp = aiocbp; req->aiocbp->aio_lio_opcode = LIO_WRITE; 40008194: 82 10 20 02 mov 2, %g1 40008198: c2 27 60 30 st %g1, [ %i5 + 0x30 ] return rtems_aio_enqueue (req); 4000819c: 7f ff ff 2e call 40007e54 400081a0: 81 e8 00 00 restore =============================================================================== 40006e6c : int clock_gettime( clockid_t clock_id, struct timespec *tp ) { 40006e6c: 9d e3 bf 98 save %sp, -104, %sp if ( !tp ) 40006e70: 80 a6 60 00 cmp %i1, 0 40006e74: 12 80 00 06 bne 40006e8c 40006e78: 80 a6 20 01 cmp %i0, 1 rtems_set_errno_and_return_minus_one( EINVAL ); 40006e7c: 40 00 24 35 call 4000ff50 <__errno> 40006e80: 01 00 00 00 nop 40006e84: 10 80 00 25 b 40006f18 40006e88: 82 10 20 16 mov 0x16, %g1 ! 16 <_TLS_Alignment+0x15> if ( clock_id == CLOCK_REALTIME ) { 40006e8c: 12 80 00 16 bne 40006ee4 40006e90: 80 a6 20 04 cmp %i0, 4 ) { Timestamp_Control tod_as_timestamp; Timestamp_Control *tod_as_timestamp_ptr; tod_as_timestamp_ptr = 40006e94: 90 07 bf f8 add %fp, -8, %o0 40006e98: 13 10 00 6a sethi %hi(0x4001a800), %o1 40006e9c: 40 00 06 65 call 40008830 <_TOD_Get_with_nanoseconds> 40006ea0: 92 12 61 20 or %o1, 0x120, %o1 ! 4001a920 <_TOD> static inline void _TOD_Get( struct timespec *tod_as_timespec ) { Timestamp_Control tod_as_timestamp; Timestamp_Control *tod_as_timestamp_ptr; 40006ea4: 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); 40006ea8: 94 10 20 00 clr %o2 40006eac: 90 10 00 1c mov %i4, %o0 40006eb0: 92 10 00 1d mov %i5, %o1 40006eb4: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 40006eb8: 40 00 3b 45 call 40015bcc <__divdi3> 40006ebc: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 40006ec0: 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); 40006ec4: d2 26 40 00 st %o1, [ %i1 ] _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 40006ec8: 94 10 20 00 clr %o2 40006ecc: 92 10 00 1d mov %i5, %o1 40006ed0: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 40006ed4: 40 00 3c 30 call 40015f94 <__moddi3> 40006ed8: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 40006edc: 10 80 00 06 b 40006ef4 40006ee0: d2 26 60 04 st %o1, [ %i1 + 4 ] _TOD_Get(tp); return 0; } #ifdef CLOCK_MONOTONIC if ( clock_id == CLOCK_MONOTONIC ) { 40006ee4: 12 80 00 06 bne 40006efc <== ALWAYS TAKEN 40006ee8: 80 a6 20 02 cmp %i0, 2 _TOD_Get_uptime_as_timespec( tp ); 40006eec: 40 00 06 62 call 40008874 <_TOD_Get_uptime_as_timespec> 40006ef0: 90 10 00 19 mov %i1, %o0 return 0; 40006ef4: 81 c7 e0 08 ret 40006ef8: 91 e8 20 00 restore %g0, 0, %o0 } #endif #ifdef _POSIX_CPUTIME if ( clock_id == CLOCK_PROCESS_CPUTIME_ID ) { 40006efc: 02 bf ff fc be 40006eec 40006f00: 80 a6 20 03 cmp %i0, 3 return 0; } #endif #ifdef _POSIX_THREAD_CPUTIME if ( clock_id == CLOCK_THREAD_CPUTIME_ID ) 40006f04: 12 bf ff de bne 40006e7c 40006f08: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( ENOSYS ); 40006f0c: 40 00 24 11 call 4000ff50 <__errno> 40006f10: 01 00 00 00 nop 40006f14: 82 10 20 58 mov 0x58, %g1 ! 58 <_TLS_Alignment+0x57> 40006f18: c2 22 00 00 st %g1, [ %o0 ] #endif rtems_set_errno_and_return_minus_one( EINVAL ); return 0; } 40006f1c: 81 c7 e0 08 ret 40006f20: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 400072e4 : int clock_settime( clockid_t clock_id, const struct timespec *tp ) { 400072e4: 9d e3 bf 98 save %sp, -104, %sp if ( !tp ) 400072e8: 82 96 60 00 orcc %i1, 0, %g1 400072ec: 12 80 00 06 bne 40007304 <== ALWAYS TAKEN 400072f0: 80 a6 20 01 cmp %i0, 1 rtems_set_errno_and_return_minus_one( EINVAL ); 400072f4: 40 00 26 31 call 40010bb8 <__errno> 400072f8: 01 00 00 00 nop 400072fc: 10 80 00 4a b 40007424 40007300: 82 10 20 16 mov 0x16, %g1 ! 16 <_TLS_Alignment+0x15> if ( clock_id == CLOCK_REALTIME ) { 40007304: 32 80 00 42 bne,a 4000740c 40007308: b0 06 3f fe add %i0, -2, %i0 if ( tp->tv_sec < TOD_SECONDS_1970_THROUGH_1988 ) 4000730c: c6 00 40 00 ld [ %g1 ], %g3 40007310: 05 08 76 b9 sethi %hi(0x21dae400), %g2 40007314: 84 10 a0 ff or %g2, 0xff, %g2 ! 21dae4ff 40007318: 80 a0 c0 02 cmp %g3, %g2 4000731c: 08 bf ff f6 bleu 400072f4 40007320: 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 disable_level = _Thread_Dispatch_disable_level; 40007324: c6 01 a0 10 ld [ %g6 + 0x10 ], %g3 _ISR_Disable( level ); _Profiling_Thread_dispatch_disable( _Per_CPU_Get(), disable_level ); #endif ++disable_level; 40007328: 86 00 e0 01 inc %g3 _Thread_Dispatch_disable_level = disable_level; 4000732c: c6 21 a0 10 st %g3, [ %g6 + 0x10 ] const struct timespec *tod_as_timespec ) { Timestamp_Control tod_as_timestamp; _Timestamp_Set( 40007330: c8 00 40 00 ld [ %g1 ], %g4 40007334: c2 00 60 04 ld [ %g1 + 4 ], %g1 40007338: 86 10 00 04 mov %g4, %g3 4000733c: 85 39 20 1f sra %g4, 0x1f, %g2 Timestamp64_Control *_time, Timestamp64_Control _seconds, Timestamp64_Control _nanoseconds ) { *_time = _seconds * 1000000000L + _nanoseconds; 40007340: b7 31 20 1d srl %g4, 0x1d, %i3 40007344: 89 28 a0 03 sll %g2, 3, %g4 40007348: bb 28 e0 03 sll %g3, 3, %i5 4000734c: b8 16 c0 04 or %i3, %g4, %i4 40007350: 89 37 60 1b srl %i5, 0x1b, %g4 40007354: b5 2f 20 05 sll %i4, 5, %i2 40007358: b7 2f 60 05 sll %i5, 5, %i3 4000735c: b4 11 00 1a or %g4, %i2, %i2 40007360: ba a6 c0 1d subcc %i3, %i5, %i5 40007364: 89 37 60 1a srl %i5, 0x1a, %g4 40007368: b8 66 80 1c subx %i2, %i4, %i4 4000736c: b7 2f 60 06 sll %i5, 6, %i3 40007370: b5 2f 20 06 sll %i4, 6, %i2 40007374: b6 a6 c0 1d subcc %i3, %i5, %i3 40007378: b4 11 00 1a or %g4, %i2, %i2 4000737c: b4 66 80 1c subx %i2, %i4, %i2 40007380: b2 86 c0 03 addcc %i3, %g3, %i1 40007384: b0 46 80 02 addx %i2, %g2, %i0 40007388: 89 36 60 1e srl %i1, 0x1e, %g4 4000738c: 85 2e 20 02 sll %i0, 2, %g2 40007390: 84 11 00 02 or %g4, %g2, %g2 40007394: 87 2e 60 02 sll %i1, 2, %g3 40007398: ba 86 40 03 addcc %i1, %g3, %i5 4000739c: b8 46 00 02 addx %i0, %g2, %i4 400073a0: 89 37 60 1e srl %i5, 0x1e, %g4 400073a4: 85 2f 20 02 sll %i4, 2, %g2 400073a8: 84 11 00 02 or %g4, %g2, %g2 400073ac: 87 2f 60 02 sll %i5, 2, %g3 400073b0: b6 87 40 03 addcc %i5, %g3, %i3 400073b4: b4 47 00 02 addx %i4, %g2, %i2 400073b8: 85 36 e0 1e srl %i3, 0x1e, %g2 400073bc: bb 2e e0 02 sll %i3, 2, %i5 400073c0: b9 2e a0 02 sll %i2, 2, %i4 400073c4: 86 86 c0 1d addcc %i3, %i5, %g3 400073c8: b8 10 80 1c or %g2, %i4, %i4 400073cc: 84 46 80 1c addx %i2, %i4, %g2 400073d0: 89 28 e0 09 sll %g3, 9, %g4 400073d4: b9 30 e0 17 srl %g3, 0x17, %i4 400073d8: b6 81 00 01 addcc %g4, %g1, %i3 &tod_as_timestamp, tod_as_timespec->tv_sec, tod_as_timespec->tv_nsec ); _TOD_Set_with_timestamp( &tod_as_timestamp ); 400073dc: 90 07 bf f8 add %fp, -8, %o0 400073e0: bb 28 a0 09 sll %g2, 9, %i5 400073e4: 84 17 00 1d or %i4, %i5, %g2 rtems_set_errno_and_return_minus_one( ENOSYS ); #endif else rtems_set_errno_and_return_minus_one( EINVAL ); return 0; 400073e8: b0 10 20 00 clr %i0 const struct timespec *tod_as_timespec ) { Timestamp_Control tod_as_timestamp; _Timestamp_Set( 400073ec: b9 38 60 1f sra %g1, 0x1f, %i4 400073f0: 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 ); 400073f4: 40 00 07 e8 call 40009394 <_TOD_Set_with_timestamp> 400073f8: 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(); 400073fc: 40 00 0e 26 call 4000ac94 <_Thread_Enable_dispatch> 40007400: 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; 40007404: 81 c7 e0 08 ret 40007408: 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 ) 4000740c: 80 a6 20 01 cmp %i0, 1 40007410: 18 bf ff b9 bgu 400072f4 40007414: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( ENOSYS ); 40007418: 40 00 25 e8 call 40010bb8 <__errno> 4000741c: 01 00 00 00 nop 40007420: 82 10 20 58 mov 0x58, %g1 ! 58 <_TLS_Alignment+0x57> 40007424: c2 22 00 00 st %g1, [ %o0 ] #endif else rtems_set_errno_and_return_minus_one( EINVAL ); return 0; } 40007428: 81 c7 e0 08 ret 4000742c: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 40029570 : int killinfo( pid_t pid, int sig, const union sigval *value ) { 40029570: 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() ) 40029574: 7f ff ff 2c call 40029224 40029578: 01 00 00 00 nop 4002957c: 80 a6 00 08 cmp %i0, %o0 40029580: 02 80 00 06 be 40029598 40029584: 80 a6 60 00 cmp %i1, 0 rtems_set_errno_and_return_minus_one( ESRCH ); 40029588: 7f ff b9 41 call 40017a8c <__errno> 4002958c: 01 00 00 00 nop 40029590: 10 80 00 07 b 400295ac 40029594: 82 10 20 03 mov 3, %g1 ! 3 <_TLS_Alignment+0x2> /* * Validate the signal passed. */ if ( !sig ) 40029598: 12 80 00 08 bne 400295b8 4002959c: ba 06 7f ff add %i1, -1, %i5 rtems_set_errno_and_return_minus_one( EINVAL ); 400295a0: 7f ff b9 3b call 40017a8c <__errno> 400295a4: 01 00 00 00 nop 400295a8: 82 10 20 16 mov 0x16, %g1 ! 16 <_TLS_Alignment+0x15> 400295ac: c2 22 00 00 st %g1, [ %o0 ] 400295b0: 81 c7 e0 08 ret 400295b4: 91 e8 3f ff restore %g0, -1, %o0 if ( !is_valid_signo(sig) ) 400295b8: 80 a7 60 1f cmp %i5, 0x1f 400295bc: 18 bf ff f9 bgu 400295a0 400295c0: 23 10 00 c3 sethi %hi(0x40030c00), %l1 rtems_set_errno_and_return_minus_one( EINVAL ); /* * If the signal is being ignored, then we are out of here. */ if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) 400295c4: b1 2e 60 02 sll %i1, 2, %i0 400295c8: a2 14 60 cc or %l1, 0xcc, %l1 400295cc: a1 2e 60 04 sll %i1, 4, %l0 400295d0: 82 24 00 18 sub %l0, %i0, %g1 400295d4: 82 04 40 01 add %l1, %g1, %g1 400295d8: c2 00 60 08 ld [ %g1 + 8 ], %g1 400295dc: 80 a0 60 01 cmp %g1, 1 400295e0: 02 80 00 92 be 40029828 400295e4: 80 a6 60 08 cmp %i1, 8 /* * 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 ) ) 400295e8: 02 80 00 06 be 40029600 400295ec: 80 a6 60 04 cmp %i1, 4 400295f0: 02 80 00 04 be 40029600 400295f4: 80 a6 60 0b cmp %i1, 0xb 400295f8: 12 80 00 08 bne 40029618 400295fc: 82 10 20 01 mov 1, %g1 return pthread_kill( pthread_self(), sig ); 40029600: 40 00 01 1f call 40029a7c 40029604: 01 00 00 00 nop 40029608: 40 00 00 f0 call 400299c8 4002960c: 92 10 00 19 mov %i1, %o1 40029610: 81 c7 e0 08 ret 40029614: 91 e8 00 08 restore %g0, %o0, %o0 /* * Build up a siginfo structure */ siginfo = &siginfo_struct; siginfo->si_signo = sig; 40029618: f2 27 bf f4 st %i1, [ %fp + -12 ] siginfo->si_code = SI_USER; 4002961c: c2 27 bf f8 st %g1, [ %fp + -8 ] if ( !value ) { 40029620: 80 a6 a0 00 cmp %i2, 0 40029624: 12 80 00 04 bne 40029634 40029628: bb 28 40 1d sll %g1, %i5, %i5 4002962c: 10 80 00 04 b 4002963c 40029630: c0 27 bf fc clr [ %fp + -4 ] siginfo->si_value.sival_int = 0; } else { siginfo->si_value = *value; 40029634: c2 06 80 00 ld [ %i2 ], %g1 40029638: 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 disable_level = _Thread_Dispatch_disable_level; 4002963c: c4 01 a0 10 ld [ %g6 + 0x10 ], %g2 _ISR_Disable( level ); _Profiling_Thread_dispatch_disable( _Per_CPU_Get(), disable_level ); #endif ++disable_level; 40029640: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = disable_level; 40029644: c4 21 a0 10 st %g2, [ %g6 + 0x10 ] /* * 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; 40029648: d0 01 a0 18 ld [ %g6 + 0x18 ], %o0 api = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( _POSIX_signals_Is_interested( api, mask ) ) { 4002964c: c4 02 21 30 ld [ %o0 + 0x130 ], %g2 40029650: c4 00 a0 dc ld [ %g2 + 0xdc ], %g2 40029654: 80 af 40 02 andncc %i5, %g2, %g0 40029658: 12 80 00 50 bne 40029798 4002965c: 03 10 00 c3 sethi %hi(0x40030c00), %g1 */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 40029660: d0 00 62 58 ld [ %g1 + 0x258 ], %o0 ! 40030e58 <_POSIX_signals_Wait_queue> /* 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 ); 40029664: 05 10 00 c3 sethi %hi(0x40030c00), %g2 40029668: 84 10 a2 5c or %g2, 0x25c, %g2 ! 40030e5c <_POSIX_signals_Wait_queue+0x4> 4002966c: 80 a2 00 02 cmp %o0, %g2 40029670: 02 80 00 0c be 400296a0 40029674: 03 10 00 b8 sethi %hi(0x4002e000), %g1 #endif /* * Is this thread is actually blocked waiting for the signal? */ if (the_thread->Wait.option & mask) 40029678: c8 02 20 30 ld [ %o0 + 0x30 ], %g4 4002967c: 80 8f 40 04 btst %i5, %g4 40029680: 12 80 00 46 bne 40029798 40029684: c6 02 21 30 ld [ %o0 + 0x130 ], %g3 /* * Is this thread is blocked waiting for another signal but has * not blocked this one? */ if (~api->signals_blocked & mask) 40029688: c6 00 e0 dc ld [ %g3 + 0xdc ], %g3 4002968c: 80 af 40 03 andncc %i5, %g3, %g0 40029690: 12 80 00 43 bne 4002979c 40029694: 92 10 00 19 mov %i1, %o1 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 ) { 40029698: 10 bf ff f5 b 4002966c 4002969c: d0 02 00 00 ld [ %o0 ], %o0 * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; interested_priority = PRIORITY_MAXIMUM + 1; 400296a0: c6 08 60 f8 ldub [ %g1 + 0xf8 ], %g3 * * NOTES: * * + rtems internal threads do not receive signals. */ interested = NULL; 400296a4: 90 10 20 00 clr %o0 interested_priority = PRIORITY_MAXIMUM + 1; 400296a8: 86 00 e0 01 inc %g3 for (the_api = OBJECTS_CLASSIC_API; the_api <= OBJECTS_APIS_LAST; the_api++) { 400296ac: b8 10 20 02 mov 2, %i4 /* * This can occur when no one is interested and an API is not configured. */ if ( !_Objects_Information_table[ the_api ] ) 400296b0: 19 10 00 c0 sethi %hi(0x40030000), %o4 */ RTEMS_INLINE_ROUTINE bool _States_Is_interruptible_by_signal ( States_Control the_states ) { return (the_states & STATES_INTERRUPTIBLE_BY_SIGNAL); 400296b4: 35 04 00 00 sethi %hi(0x10000000), %i2 400296b8: 85 2f 20 02 sll %i4, 2, %g2 400296bc: 88 13 23 60 or %o4, 0x360, %g4 400296c0: c4 01 00 02 ld [ %g4 + %g2 ], %g2 400296c4: 80 a0 a0 00 cmp %g2, 0 400296c8: 02 80 00 2d be 4002977c <== NEVER TAKEN 400296cc: b6 10 20 01 mov 1, %i3 continue; the_info = _Objects_Information_table[ the_api ][ 1 ]; 400296d0: c4 00 a0 04 ld [ %g2 + 4 ], %g2 */ if ( !the_info ) continue; #endif maximum = the_info->maximum; 400296d4: d6 10 a0 10 lduh [ %g2 + 0x10 ], %o3 object_table = the_info->local_table; 400296d8: d4 00 a0 1c ld [ %g2 + 0x1c ], %o2 for ( index = 1 ; index <= maximum ; index++ ) { 400296dc: 80 a6 c0 0b cmp %i3, %o3 400296e0: 18 80 00 27 bgu 4002977c 400296e4: 85 2e e0 02 sll %i3, 2, %g2 the_thread = (Thread_Control *) object_table[ index ]; 400296e8: c4 02 80 02 ld [ %o2 + %g2 ], %g2 if ( !the_thread ) 400296ec: 80 a0 a0 00 cmp %g2, 0 400296f0: 22 bf ff fb be,a 400296dc 400296f4: 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 ) 400296f8: c8 00 a0 14 ld [ %g2 + 0x14 ], %g4 400296fc: 80 a1 00 03 cmp %g4, %g3 40029700: 38 bf ff f7 bgu,a 400296dc 40029704: b6 06 e0 01 inc %i3 #if defined(RTEMS_DEBUG) if ( !api ) continue; #endif if ( !_POSIX_signals_Is_interested( api, mask ) ) 40029708: de 00 a1 30 ld [ %g2 + 0x130 ], %o7 4002970c: de 03 e0 dc ld [ %o7 + 0xdc ], %o7 40029710: 80 af 40 0f andncc %i5, %o7, %g0 40029714: 22 bf ff f2 be,a 400296dc 40029718: 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 ) { 4002971c: 80 a1 00 03 cmp %g4, %g3 40029720: 2a 80 00 14 bcs,a 40029770 40029724: 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 ) ) { 40029728: 80 a2 20 00 cmp %o0, 0 4002972c: 22 bf ff ec be,a 400296dc <== NEVER TAKEN 40029730: b6 06 e0 01 inc %i3 <== NOT EXECUTED 40029734: da 02 20 10 ld [ %o0 + 0x10 ], %o5 40029738: 80 a3 60 00 cmp %o5, 0 4002973c: 22 bf ff e8 be,a 400296dc <== NEVER TAKEN 40029740: b6 06 e0 01 inc %i3 <== NOT EXECUTED /* preferred ready over blocked */ DEBUG_STEP("5"); if ( _States_Is_ready( the_thread->current_state ) ) { 40029744: de 00 a0 10 ld [ %g2 + 0x10 ], %o7 40029748: 80 a3 e0 00 cmp %o7, 0 4002974c: 22 80 00 09 be,a 40029770 40029750: 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) ) { 40029754: 80 8b 40 1a btst %o5, %i2 40029758: 32 bf ff e1 bne,a 400296dc 4002975c: b6 06 e0 01 inc %i3 DEBUG_STEP("7"); if ( _States_Is_interruptible_by_signal(the_thread->current_state) ) { 40029760: 80 8b c0 1a btst %o7, %i2 40029764: 22 bf ff de be,a 400296dc 40029768: b6 06 e0 01 inc %i3 4002976c: 86 10 00 04 mov %g4, %g3 40029770: 90 10 00 02 mov %g2, %o0 #endif maximum = the_info->maximum; object_table = the_info->local_table; for ( index = 1 ; index <= maximum ; index++ ) { 40029774: 10 bf ff da b 400296dc 40029778: b6 06 e0 01 inc %i3 * + 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++) { 4002977c: b8 07 20 01 inc %i4 40029780: 80 a7 20 04 cmp %i4, 4 40029784: 12 bf ff ce bne 400296bc 40029788: 85 2f 20 02 sll %i4, 2, %g2 } } } } if ( interested ) { 4002978c: 80 a2 20 00 cmp %o0, 0 40029790: 02 80 00 0b be 400297bc 40029794: 01 00 00 00 nop /* * 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 ) ) { 40029798: 92 10 00 19 mov %i1, %o1 4002979c: 40 00 00 30 call 4002985c <_POSIX_signals_Unblock_thread> 400297a0: 94 07 bf f4 add %fp, -12, %o2 400297a4: 80 a2 20 00 cmp %o0, 0 400297a8: 02 80 00 05 be 400297bc 400297ac: 01 00 00 00 nop _Thread_Enable_dispatch(); 400297b0: 7f ff 92 83 call 4000e1bc <_Thread_Enable_dispatch> 400297b4: b0 10 20 00 clr %i0 ! 0 <_TLS_BSS_size> 400297b8: 30 80 00 1d b,a 4002982c /* * 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 ); 400297bc: 40 00 00 1e call 40029834 <_POSIX_signals_Set_process_signals> 400297c0: 90 10 00 1d mov %i5, %o0 if ( _POSIX_signals_Vectors[ sig ].sa_flags == SA_SIGINFO ) { 400297c4: b8 24 00 18 sub %l0, %i0, %i4 400297c8: c2 04 40 1c ld [ %l1 + %i4 ], %g1 400297cc: 80 a0 60 02 cmp %g1, 2 400297d0: 12 bf ff f8 bne 400297b0 400297d4: 11 10 00 c3 sethi %hi(0x40030c00), %o0 psiginfo = (POSIX_signals_Siginfo_node *) 400297d8: 7f ff 8a df call 4000c354 <_Chain_Get> 400297dc: 90 12 22 4c or %o0, 0x24c, %o0 ! 40030e4c <_POSIX_signals_Inactive_siginfo> _Chain_Get( &_POSIX_signals_Inactive_siginfo ); if ( !psiginfo ) { 400297e0: ba 92 20 00 orcc %o0, 0, %i5 400297e4: 12 80 00 08 bne 40029804 400297e8: 92 07 bf f4 add %fp, -12, %o1 _Thread_Enable_dispatch(); 400297ec: 7f ff 92 74 call 4000e1bc <_Thread_Enable_dispatch> 400297f0: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( EAGAIN ); 400297f4: 7f ff b8 a6 call 40017a8c <__errno> 400297f8: 01 00 00 00 nop 400297fc: 10 bf ff 6c b 400295ac 40029800: 82 10 20 0b mov 0xb, %g1 ! b <_TLS_Alignment+0xa> } psiginfo->Info = *siginfo; 40029804: 90 07 60 08 add %i5, 8, %o0 40029808: 7f ff bf 77 call 400195e4 4002980c: 94 10 20 0c mov 0xc, %o2 _Chain_Append( &_POSIX_signals_Siginfo[ sig ], &psiginfo->Node ); 40029810: 11 10 00 c3 sethi %hi(0x40030c00), %o0 40029814: 92 10 00 1d mov %i5, %o1 40029818: 90 12 22 9c or %o0, 0x29c, %o0 4002981c: 7f ff 8a c2 call 4000c324 <_Chain_Append> 40029820: 90 02 00 1c add %o0, %i4, %o0 40029824: 30 bf ff e3 b,a 400297b0 /* * If the signal is being ignored, then we are out of here. */ if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) return 0; 40029828: b0 10 20 00 clr %i0 } DEBUG_STEP("\n"); _Thread_Enable_dispatch(); return 0; } 4002982c: 81 c7 e0 08 ret 40029830: 81 e8 00 00 restore =============================================================================== 4000c908 : int pthread_attr_setschedpolicy( pthread_attr_t *attr, int policy ) { 4000c908: 82 10 00 08 mov %o0, %g1 if ( !attr || !attr->is_initialized ) 4000c90c: 80 a0 60 00 cmp %g1, 0 4000c910: 02 80 00 0f be 4000c94c 4000c914: 90 10 20 16 mov 0x16, %o0 4000c918: c4 00 40 00 ld [ %g1 ], %g2 4000c91c: 80 a0 a0 00 cmp %g2, 0 4000c920: 02 80 00 0b be 4000c94c 4000c924: 80 a2 60 04 cmp %o1, 4 case SCHED_SPORADIC: attr->schedpolicy = policy; return 0; default: return ENOTSUP; 4000c928: 18 80 00 09 bgu 4000c94c 4000c92c: 90 10 20 86 mov 0x86, %o0 4000c930: 84 10 20 01 mov 1, %g2 4000c934: 85 28 80 09 sll %g2, %o1, %g2 4000c938: 80 88 a0 17 btst 0x17, %g2 4000c93c: 02 80 00 04 be 4000c94c <== NEVER TAKEN 4000c940: 01 00 00 00 nop switch ( policy ) { case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: case SCHED_SPORADIC: attr->schedpolicy = policy; 4000c944: d2 20 60 14 st %o1, [ %g1 + 0x14 ] return 0; 4000c948: 90 10 20 00 clr %o0 default: return ENOTSUP; } } 4000c94c: 81 c3 e0 08 retl =============================================================================== 40007ae4 : int pthread_barrier_init( pthread_barrier_t *barrier, const pthread_barrierattr_t *attr, unsigned int count ) { 40007ae4: 9d e3 bf 90 save %sp, -112, %sp const pthread_barrierattr_t *the_attr; /* * Error check parameters */ if ( !barrier ) 40007ae8: 80 a6 20 00 cmp %i0, 0 40007aec: 02 80 00 2e be 40007ba4 40007af0: 80 a6 a0 00 cmp %i2, 0 return EINVAL; if ( count == 0 ) 40007af4: 02 80 00 2d be 40007ba8 40007af8: b8 10 20 16 mov 0x16, %i4 return EINVAL; /* * If the user passed in NULL, use the default attributes */ if ( attr ) { 40007afc: 80 a6 60 00 cmp %i1, 0 40007b00: 32 80 00 06 bne,a 40007b18 40007b04: c2 06 40 00 ld [ %i1 ], %g1 the_attr = attr; } else { (void) pthread_barrierattr_init( &my_attr ); 40007b08: 90 07 bf f8 add %fp, -8, %o0 40007b0c: 7f ff ff 81 call 40007910 40007b10: 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 ) 40007b14: c2 06 40 00 ld [ %i1 ], %g1 40007b18: 80 a0 60 00 cmp %g1, 0 40007b1c: 02 80 00 23 be 40007ba8 40007b20: b8 10 20 16 mov 0x16, %i4 return EINVAL; switch ( the_attr->process_shared ) { 40007b24: f8 06 60 04 ld [ %i1 + 4 ], %i4 40007b28: 80 a7 20 00 cmp %i4, 0 40007b2c: 32 80 00 1f bne,a 40007ba8 <== NEVER TAKEN 40007b30: b8 10 20 16 mov 0x16, %i4 <== NOT EXECUTED /* * Convert from POSIX attributes to Core Barrier attributes */ the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE; the_attributes.maximum_count = count; 40007b34: f4 27 bf f4 st %i2, [ %fp + -12 ] } /* * Convert from POSIX attributes to Core Barrier attributes */ the_attributes.discipline = CORE_BARRIER_AUTOMATIC_RELEASE; 40007b38: c0 27 bf f0 clr [ %fp + -16 ] * 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 *) 40007b3c: 37 10 00 67 sethi %hi(0x40019c00), %i3 40007b40: 35 10 00 66 sethi %hi(0x40019800), %i2 40007b44: 40 00 08 92 call 40009d8c <_Objects_Allocate> 40007b48: 90 16 e0 98 or %i3, 0x98, %o0 the_attributes.maximum_count = count; the_barrier = _POSIX_Barrier_Allocate(); if ( !the_barrier ) { 40007b4c: ba 92 20 00 orcc %o0, 0, %i5 40007b50: 12 80 00 07 bne 40007b6c 40007b54: 90 07 60 10 add %i5, 0x10, %o0 40007b58: d0 06 a1 d8 ld [ %i2 + 0x1d8 ], %o0 40007b5c: 40 00 05 98 call 400091bc <_API_Mutex_Unlock> 40007b60: b8 10 20 0b mov 0xb, %i4 ); *barrier = the_barrier->Object.id; _Objects_Allocator_unlock(); return 0; } 40007b64: 81 c7 e0 08 ret 40007b68: 91 e8 00 1c restore %g0, %i4, %o0 if ( !the_barrier ) { _Objects_Allocator_unlock(); return EAGAIN; } _CORE_barrier_Initialize( &the_barrier->Barrier, &the_attributes ); 40007b6c: 40 00 05 d0 call 400092ac <_CORE_barrier_Initialize> 40007b70: 92 07 bf f0 add %fp, -16, %o1 ) { /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; _Objects_Set_local_object( 40007b74: c4 17 60 0a lduh [ %i5 + 0xa ], %g2 Objects_Control *the_object, uint32_t name ) { /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 40007b78: c0 27 60 0c clr [ %i5 + 0xc ] * @param[in] information points to an Object Information Table * @param[in] the_object is a pointer to an object * @param[in] name is the name of the object to make accessible */ RTEMS_INLINE_ROUTINE void _Objects_Open_u32( Objects_Information *information, 40007b7c: b6 16 e0 98 or %i3, 0x98, %i3 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 40007b80: c6 06 e0 1c ld [ %i3 + 0x1c ], %g3 ) { /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; _Objects_Set_local_object( 40007b84: c2 07 60 08 ld [ %i5 + 8 ], %g1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 40007b88: 85 28 a0 02 sll %g2, 2, %g2 40007b8c: fa 20 c0 02 st %i5, [ %g3 + %g2 ] 40007b90: d0 06 a1 d8 ld [ %i2 + 0x1d8 ], %o0 40007b94: 40 00 05 8a call 400091bc <_API_Mutex_Unlock> 40007b98: c2 26 00 00 st %g1, [ %i0 ] ); *barrier = the_barrier->Object.id; _Objects_Allocator_unlock(); return 0; } 40007b9c: 81 c7 e0 08 ret 40007ba0: 91 e8 00 1c restore %g0, %i4, %o0 switch ( the_attr->process_shared ) { case PTHREAD_PROCESS_PRIVATE: /* only supported values */ break; case PTHREAD_PROCESS_SHARED: default: return EINVAL; 40007ba4: b8 10 20 16 mov 0x16, %i4 ); *barrier = the_barrier->Object.id; _Objects_Allocator_unlock(); return 0; } 40007ba8: b0 10 00 1c mov %i4, %i0 40007bac: 81 c7 e0 08 ret 40007bb0: 81 e8 00 00 restore =============================================================================== 40010838 : */ int pthread_cond_init( pthread_cond_t *cond, const pthread_condattr_t *attr ) { 40010838: 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; 4001083c: 80 a6 60 00 cmp %i1, 0 40010840: 32 80 00 05 bne,a 40010854 40010844: c4 06 60 04 ld [ %i1 + 4 ], %g2 else the_attr = &_POSIX_Condition_variables_Default_attributes; 40010848: 33 10 00 6a sethi %hi(0x4001a800), %i1 4001084c: b2 16 62 d0 or %i1, 0x2d0, %i1 ! 4001aad0 <_POSIX_Condition_variables_Default_attributes> /* * Be careful about attributes when global!!! */ if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) 40010850: c4 06 60 04 ld [ %i1 + 4 ], %g2 40010854: 80 a0 a0 01 cmp %g2, 1 40010858: 02 80 00 22 be 400108e0 <== NEVER TAKEN 4001085c: 82 10 20 16 mov 0x16, %g1 return EINVAL; if ( !the_attr->is_initialized ) 40010860: c4 06 40 00 ld [ %i1 ], %g2 40010864: 80 a0 a0 00 cmp %g2, 0 40010868: 02 80 00 1e be 400108e0 4001086c: 39 10 00 73 sethi %hi(0x4001cc00), %i4 40010870: 37 10 00 72 sethi %hi(0x4001c800), %i3 * the inactive chain of free condition variable control blocks. */ RTEMS_INLINE_ROUTINE POSIX_Condition_variables_Control * _POSIX_Condition_variables_Allocate( void ) { return (POSIX_Condition_variables_Control *) 40010874: 7f ff e6 3a call 4000a15c <_Objects_Allocate> 40010878: 90 17 20 08 or %i4, 8, %o0 return EINVAL; the_cond = _POSIX_Condition_variables_Allocate(); if ( !the_cond ) { 4001087c: ba 92 20 00 orcc %o0, 0, %i5 40010880: 32 80 00 06 bne,a 40010898 40010884: c2 06 60 04 ld [ %i1 + 4 ], %g1 40010888: 7f ff e3 8f call 400096c4 <_API_Mutex_Unlock> 4001088c: d0 06 e0 b8 ld [ %i3 + 0xb8 ], %o0 _Objects_Allocator_unlock(); return ENOMEM; 40010890: 10 80 00 14 b 400108e0 40010894: 82 10 20 0c mov 0xc, %g1 the_cond->process_shared = the_attr->process_shared; the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX; _Thread_queue_Initialize( 40010898: 90 07 60 18 add %i5, 0x18, %o0 if ( !the_cond ) { _Objects_Allocator_unlock(); return ENOMEM; } the_cond->process_shared = the_attr->process_shared; 4001089c: c2 27 60 10 st %g1, [ %i5 + 0x10 ] the_cond->Mutex = POSIX_CONDITION_VARIABLES_NO_MUTEX; _Thread_queue_Initialize( 400108a0: 92 10 20 00 clr %o1 400108a4: 15 04 00 02 sethi %hi(0x10000800), %o2 400108a8: 96 10 20 74 mov 0x74, %o3 400108ac: 7f ff ec cb call 4000bbd8 <_Thread_queue_Initialize> 400108b0: c0 27 60 14 clr [ %i5 + 0x14 ] ) { /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; _Objects_Set_local_object( 400108b4: c4 17 60 0a lduh [ %i5 + 0xa ], %g2 Objects_Control *the_object, uint32_t name ) { /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 400108b8: c0 27 60 0c clr [ %i5 + 0xc ] * @param[in] information points to an Object Information Table * @param[in] the_object is a pointer to an object * @param[in] name is the name of the object to make accessible */ RTEMS_INLINE_ROUTINE void _Objects_Open_u32( Objects_Information *information, 400108bc: b8 17 20 08 or %i4, 8, %i4 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 400108c0: c6 07 20 1c ld [ %i4 + 0x1c ], %g3 ) { /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; _Objects_Set_local_object( 400108c4: c2 07 60 08 ld [ %i5 + 8 ], %g1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 400108c8: 85 28 a0 02 sll %g2, 2, %g2 400108cc: fa 20 c0 02 st %i5, [ %g3 + %g2 ] 400108d0: d0 06 e0 b8 ld [ %i3 + 0xb8 ], %o0 400108d4: 7f ff e3 7c call 400096c4 <_API_Mutex_Unlock> 400108d8: c2 26 00 00 st %g1, [ %i0 ] *cond = the_cond->Object.id; _Objects_Allocator_unlock(); return 0; 400108dc: 82 10 20 00 clr %g1 } 400108e0: 81 c7 e0 08 ret 400108e4: 91 e8 00 01 restore %g0, %g1, %o0 =============================================================================== 40008224 : */ int pthread_condattr_destroy( pthread_condattr_t *attr ) { 40008224: 82 10 00 08 mov %o0, %g1 if ( !attr || attr->is_initialized == false ) 40008228: 80 a0 60 00 cmp %g1, 0 4000822c: 02 80 00 08 be 4000824c 40008230: 90 10 20 16 mov 0x16, %o0 40008234: c4 00 40 00 ld [ %g1 ], %g2 40008238: 80 a0 a0 00 cmp %g2, 0 4000823c: 02 80 00 04 be 4000824c <== NEVER TAKEN 40008240: 01 00 00 00 nop return EINVAL; attr->is_initialized = false; 40008244: c0 20 40 00 clr [ %g1 ] return 0; 40008248: 90 10 20 00 clr %o0 } 4000824c: 81 c3 e0 08 retl =============================================================================== 40007510 : pthread_t *thread, const pthread_attr_t *attr, void *(*start_routine)( void * ), void *arg ) { 40007510: 9d e3 bf 58 save %sp, -168, %sp int schedpolicy = SCHED_RR; struct sched_param schedparam; Objects_Name name; int rc; if ( !start_routine ) 40007514: 80 a6 a0 00 cmp %i2, 0 40007518: 02 80 00 94 be 40007768 4000751c: ba 10 20 0e mov 0xe, %i5 return EFAULT; the_attr = (attr) ? attr : &_POSIX_Threads_Default_attributes; 40007520: 80 a6 60 00 cmp %i1, 0 40007524: 32 80 00 05 bne,a 40007538 40007528: c2 06 40 00 ld [ %i1 ], %g1 4000752c: 33 10 00 7c sethi %hi(0x4001f000), %i1 40007530: b2 16 62 c4 or %i1, 0x2c4, %i1 ! 4001f2c4 <_POSIX_Threads_Default_attributes> if ( !the_attr->is_initialized ) 40007534: c2 06 40 00 ld [ %i1 ], %g1 40007538: 80 a0 60 00 cmp %g1, 0 4000753c: 22 80 00 8b be,a 40007768 40007540: 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) ) 40007544: c2 06 60 04 ld [ %i1 + 4 ], %g1 40007548: 80 a0 60 00 cmp %g1, 0 4000754c: 02 80 00 07 be 40007568 40007550: 03 10 00 7c sethi %hi(0x4001f000), %g1 40007554: c4 06 60 08 ld [ %i1 + 8 ], %g2 40007558: c2 00 61 18 ld [ %g1 + 0x118 ], %g1 4000755c: 80 a0 80 01 cmp %g2, %g1 40007560: 2a 80 00 82 bcs,a 40007768 40007564: ba 10 20 16 mov 0x16, %i5 * 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 ) { 40007568: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 4000756c: 80 a0 60 01 cmp %g1, 1 40007570: 02 80 00 09 be 40007594 40007574: c4 01 a0 18 ld [ %g6 + 0x18 ], %g2 40007578: 80 a0 60 02 cmp %g1, 2 4000757c: 12 80 00 7b bne 40007768 40007580: ba 10 20 16 mov 0x16, %i5 schedpolicy = api->schedpolicy; schedparam = api->schedparam; break; case PTHREAD_EXPLICIT_SCHED: schedpolicy = the_attr->schedpolicy; 40007584: e2 06 60 14 ld [ %i1 + 0x14 ], %l1 schedparam = the_attr->schedparam; 40007588: 90 07 bf e4 add %fp, -28, %o0 4000758c: 10 80 00 06 b 400075a4 40007590: 92 06 60 18 add %i1, 0x18, %o1 * PTHREAD_EXPLICIT_SCHED, then scheduling parameters come from the * attributes structure. */ switch ( the_attr->inheritsched ) { case PTHREAD_INHERIT_SCHED: api = executing->API_Extensions[ THREAD_API_POSIX ]; 40007594: d2 00 a1 30 ld [ %g2 + 0x130 ], %o1 schedpolicy = api->schedpolicy; schedparam = api->schedparam; 40007598: 90 07 bf e4 add %fp, -28, %o0 * attributes structure. */ switch ( the_attr->inheritsched ) { case PTHREAD_INHERIT_SCHED: api = executing->API_Extensions[ THREAD_API_POSIX ]; schedpolicy = api->schedpolicy; 4000759c: e2 02 60 90 ld [ %o1 + 0x90 ], %l1 schedparam = api->schedparam; 400075a0: 92 02 60 94 add %o1, 0x94, %o1 break; case PTHREAD_EXPLICIT_SCHED: schedpolicy = the_attr->schedpolicy; schedparam = the_attr->schedparam; 400075a4: 40 00 24 02 call 400105ac 400075a8: 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 ) 400075ac: fa 06 60 0c ld [ %i1 + 0xc ], %i5 400075b0: 80 a7 60 00 cmp %i5, 0 400075b4: 32 80 00 6d bne,a 40007768 400075b8: ba 10 20 86 mov 0x86, %i5 return ENOTSUP; /* * Interpret the scheduling parameters. */ if ( !_POSIX_Priority_Is_valid( schedparam.sched_priority ) ) 400075bc: 40 00 18 dc call 4000d92c <_POSIX_Priority_Is_valid> 400075c0: d0 07 bf e4 ld [ %fp + -28 ], %o0 400075c4: 80 a2 20 00 cmp %o0, 0 400075c8: 22 80 00 68 be,a 40007768 <== NEVER TAKEN 400075cc: ba 10 20 16 mov 0x16, %i5 <== NOT EXECUTED */ RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( int priority ) { return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1); 400075d0: 03 10 00 7c sethi %hi(0x4001f000), %g1 return EINVAL; core_priority = _POSIX_Priority_To_core( schedparam.sched_priority ); 400075d4: e8 07 bf e4 ld [ %fp + -28 ], %l4 400075d8: ea 08 61 14 ldub [ %g1 + 0x114 ], %l5 /* * Set the core scheduling policy information. */ rc = _POSIX_Thread_Translate_sched_param( 400075dc: 90 10 00 11 mov %l1, %o0 400075e0: 92 07 bf e4 add %fp, -28, %o1 400075e4: 94 07 bf dc add %fp, -36, %o2 400075e8: 40 00 18 dc call 4000d958 <_POSIX_Thread_Translate_sched_param> 400075ec: 96 07 bf e0 add %fp, -32, %o3 schedpolicy, &schedparam, &budget_algorithm, &budget_callout ); if ( rc ) 400075f0: 80 a2 20 00 cmp %o0, 0 400075f4: 32 80 00 5d bne,a 40007768 400075f8: ba 10 00 08 mov %o0, %i5 */ SCORE_EXTERN API_Mutex_Control *_RTEMS_Allocator_Mutex; static inline void _RTEMS_Lock_allocator( void ) { _API_Mutex_Lock( _RTEMS_Allocator_Mutex ); 400075fc: 39 10 00 82 sethi %hi(0x40020800), %i4 40007600: d0 07 22 f8 ld [ %i4 + 0x2f8 ], %o0 ! 40020af8 <_RTEMS_Allocator_Mutex> 40007604: 40 00 05 74 call 40008bd4 <_API_Mutex_Lock> 40007608: 27 10 00 83 sethi %hi(0x40020c00), %l3 RTEMS_INLINE_ROUTINE Thread_Control *_POSIX_Threads_Allocate(void) { _Objects_Allocator_lock(); _Thread_Kill_zombies(); 4000760c: 40 00 0f b0 call 4000b4cc <_Thread_Kill_zombies> 40007610: a4 10 00 1c mov %i4, %l2 return (Thread_Control *) 40007614: 40 00 08 40 call 40009714 <_Objects_Allocate_unprotected> 40007618: 90 14 e0 50 or %l3, 0x50, %o0 * Allocate the thread control block. * * NOTE: Global threads are not currently supported. */ the_thread = _POSIX_Threads_Allocate(); if ( !the_thread ) { 4000761c: a0 92 20 00 orcc %o0, 0, %l0 40007620: 12 80 00 04 bne 40007630 40007624: 90 10 00 13 mov %l3, %o0 } static inline void _RTEMS_Unlock_allocator( void ) { _API_Mutex_Unlock( _RTEMS_Allocator_Mutex ); 40007628: 10 80 00 24 b 400076b8 4000762c: d0 07 22 f8 ld [ %i4 + 0x2f8 ], %o0 * * @return This method returns the minimum stack size; */ RTEMS_INLINE_ROUTINE uint32_t _Stack_Minimum (void) { return rtems_minimum_stack_size; 40007630: 03 10 00 7c sethi %hi(0x4001f000), %g1 static inline size_t _POSIX_Threads_Ensure_minimum_stack ( size_t size ) { if ( size >= PTHREAD_MINIMUM_STACK_SIZE ) 40007634: d8 00 61 18 ld [ %g1 + 0x118 ], %o4 ! 4001f118 40007638: c2 06 60 08 ld [ %i1 + 8 ], %g1 /* * Initialize the core thread for this task. */ name.name_p = NULL; /* posix threads don't have a name by default */ status = _Thread_Initialize( 4000763c: c0 27 bf d4 clr [ %fp + -44 ] 40007640: 99 2b 20 01 sll %o4, 1, %o4 40007644: 80 a3 00 01 cmp %o4, %g1 40007648: 1a 80 00 03 bcc 40007654 4000764c: d6 06 60 04 ld [ %i1 + 4 ], %o3 40007650: 98 10 00 01 mov %g1, %o4 40007654: 82 10 20 01 mov 1, %g1 40007658: c2 23 a0 60 st %g1, [ %sp + 0x60 ] 4000765c: c2 07 bf dc ld [ %fp + -36 ], %g1 40007660: aa 0d 60 ff and %l5, 0xff, %l5 40007664: c2 23 a0 64 st %g1, [ %sp + 0x64 ] 40007668: c2 07 bf e0 ld [ %fp + -32 ], %g1 4000766c: a8 25 40 14 sub %l5, %l4, %l4 40007670: c2 23 a0 68 st %g1, [ %sp + 0x68 ] 40007674: 82 07 bf d4 add %fp, -44, %g1 40007678: e8 23 a0 5c st %l4, [ %sp + 0x5c ] 4000767c: c0 23 a0 6c clr [ %sp + 0x6c ] 40007680: c2 23 a0 70 st %g1, [ %sp + 0x70 ] 40007684: 90 12 20 50 or %o0, 0x50, %o0 40007688: 92 10 00 10 mov %l0, %o1 4000768c: 15 10 00 77 sethi %hi(0x4001dc00), %o2 40007690: 9a 10 20 00 clr %o5 40007694: 40 00 0d 03 call 4000aaa0 <_Thread_Initialize> 40007698: 94 12 a1 5c or %o2, 0x15c, %o2 budget_algorithm, budget_callout, 0, /* isr level */ name /* posix threads don't have a name */ ); if ( !status ) { 4000769c: 80 a2 20 00 cmp %o0, 0 400076a0: 12 80 00 0a bne 400076c8 400076a4: 11 10 00 83 sethi %hi(0x40020c00), %o0 RTEMS_INLINE_ROUTINE void _POSIX_Threads_Free ( Thread_Control *the_pthread ) { _Objects_Free( &_POSIX_Threads_Information, &the_pthread->Object ); 400076a8: 92 10 00 10 mov %l0, %o1 400076ac: 40 00 09 15 call 40009b00 <_Objects_Free> 400076b0: 90 12 20 50 or %o0, 0x50, %o0 400076b4: d0 04 a2 f8 ld [ %l2 + 0x2f8 ], %o0 400076b8: 40 00 05 7e call 40008cb0 <_API_Mutex_Unlock> 400076bc: ba 10 20 0b mov 0xb, %i5 */ *thread = the_thread->Object.id; _Objects_Allocator_unlock(); return 0; } 400076c0: 81 c7 e0 08 ret 400076c4: 91 e8 00 1d restore %g0, %i5, %o0 #endif /* * finish initializing the per API structure */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 400076c8: f8 04 21 30 ld [ %l0 + 0x130 ], %i4 RTEMS_INLINE_ROUTINE void _POSIX_Threads_Copy_attributes( pthread_attr_t *dst_attr, const pthread_attr_t *src_attr ) { *dst_attr = *src_attr; 400076cc: 92 10 00 19 mov %i1, %o1 400076d0: 90 10 00 1c mov %i4, %o0 400076d4: 40 00 23 b6 call 400105ac 400076d8: 94 10 20 4c mov 0x4c, %o2 _POSIX_Threads_Copy_attributes( &api->Attributes, the_attr ); api->detachstate = the_attr->detachstate; 400076dc: c2 06 60 3c ld [ %i1 + 0x3c ], %g1 api->schedpolicy = schedpolicy; api->schedparam = schedparam; 400076e0: 90 07 20 94 add %i4, 0x94, %o0 * finish initializing the per API structure */ api = the_thread->API_Extensions[ THREAD_API_POSIX ]; _POSIX_Threads_Copy_attributes( &api->Attributes, the_attr ); api->detachstate = the_attr->detachstate; 400076e4: c2 27 20 4c st %g1, [ %i4 + 0x4c ] api->schedpolicy = schedpolicy; 400076e8: e2 27 20 90 st %l1, [ %i4 + 0x90 ] api->schedparam = schedparam; 400076ec: 92 07 bf e4 add %fp, -28, %o1 400076f0: 40 00 23 af call 400105ac 400076f4: 94 10 20 1c mov 0x1c, %o2 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t disable_level = _Thread_Dispatch_disable_level; 400076f8: c4 01 a0 10 ld [ %g6 + 0x10 ], %g2 _ISR_Disable( level ); _Profiling_Thread_dispatch_disable( _Per_CPU_Get(), disable_level ); #endif ++disable_level; 400076fc: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = disable_level; 40007700: c4 21 a0 10 st %g2, [ %g6 + 0x10 ] _Thread_Disable_dispatch(); /* * POSIX threads are allocated and started in one operation. */ status = _Thread_Start( 40007704: 92 10 20 01 mov 1, %o1 40007708: 90 10 00 10 mov %l0, %o0 4000770c: 94 10 00 1a mov %i2, %o2 40007710: 96 10 00 1b mov %i3, %o3 40007714: 98 10 20 00 clr %o4 40007718: 40 00 10 3d call 4000b80c <_Thread_Start> 4000771c: 9a 10 20 00 clr %o5 _Objects_Allocator_unlock(); return EINVAL; } #endif if ( schedpolicy == SCHED_SPORADIC ) { 40007720: 80 a4 60 04 cmp %l1, 4 40007724: 12 80 00 09 bne 40007748 40007728: 01 00 00 00 nop _Watchdog_Insert_ticks( 4000772c: 40 00 10 7b call 4000b918 <_Timespec_To_ticks> 40007730: 90 07 20 9c add %i4, 0x9c, %o0 ) { the_watchdog->initial = units; _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 40007734: 92 07 20 b4 add %i4, 0xb4, %o1 Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 40007738: d0 27 20 c0 st %o0, [ %i4 + 0xc0 ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 4000773c: 11 10 00 82 sethi %hi(0x40020800), %o0 40007740: 40 00 11 3e call 4000bc38 <_Watchdog_Insert> 40007744: 90 12 23 10 or %o0, 0x310, %o0 ! 40020b10 <_Watchdog_Ticks_chain> &api->Sporadic_timer, _Timespec_To_ticks( &api->schedparam.sched_ss_repl_period ) ); } _Thread_Enable_dispatch(); 40007748: 40 00 0c a7 call 4000a9e4 <_Thread_Enable_dispatch> 4000774c: 01 00 00 00 nop /* * Return the id and indicate we successfully created the thread */ *thread = the_thread->Object.id; 40007750: c2 04 20 08 ld [ %l0 + 8 ], %g1 40007754: d0 04 a2 f8 ld [ %l2 + 0x2f8 ], %o0 40007758: 40 00 05 56 call 40008cb0 <_API_Mutex_Unlock> 4000775c: c2 26 00 00 st %g1, [ %i0 ] _Objects_Allocator_unlock(); return 0; } 40007760: 81 c7 e0 08 ret 40007764: 91 e8 00 1d restore %g0, %i5, %o0 40007768: b0 10 00 1d mov %i5, %i0 4000776c: 81 c7 e0 08 ret 40007770: 81 e8 00 00 restore =============================================================================== 400299c8 : int pthread_kill( pthread_t thread, int sig ) { 400299c8: 9d e3 bf 98 save %sp, -104, %sp POSIX_API_Control *api; Thread_Control *the_thread; Objects_Locations location; if ( !sig ) 400299cc: 80 a6 60 00 cmp %i1, 0 400299d0: 12 80 00 06 bne 400299e8 400299d4: ba 06 7f ff add %i1, -1, %i5 rtems_set_errno_and_return_minus_one( EINVAL ); 400299d8: 7f ff b8 2d call 40017a8c <__errno> 400299dc: 01 00 00 00 nop 400299e0: 10 80 00 24 b 40029a70 400299e4: 82 10 20 16 mov 0x16, %g1 ! 16 <_TLS_Alignment+0x15> if ( !is_valid_signo(sig) ) 400299e8: 80 a7 60 1f cmp %i5, 0x1f 400299ec: 18 bf ff fb bgu 400299d8 400299f0: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( EINVAL ); the_thread = _Thread_Get( thread, &location ); 400299f4: 90 10 00 18 mov %i0, %o0 400299f8: 7f ff 91 fc call 4000e1e8 <_Thread_Get> 400299fc: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 40029a00: c4 07 bf fc ld [ %fp + -4 ], %g2 40029a04: 80 a0 a0 00 cmp %g2, 0 40029a08: 12 80 00 17 bne 40029a64 <== NEVER TAKEN 40029a0c: 87 2e 60 02 sll %i1, 2, %g3 api = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( sig ) { if ( _POSIX_signals_Vectors[ sig ].sa_handler == SIG_IGN ) { 40029a10: 89 2e 60 04 sll %i1, 4, %g4 40029a14: 05 10 00 c3 sethi %hi(0x40030c00), %g2 40029a18: 86 21 00 03 sub %g4, %g3, %g3 40029a1c: 84 10 a0 cc or %g2, 0xcc, %g2 40029a20: 84 00 80 03 add %g2, %g3, %g2 40029a24: c4 00 a0 08 ld [ %g2 + 8 ], %g2 40029a28: 80 a0 a0 01 cmp %g2, 1 40029a2c: 02 80 00 0a be 40029a54 40029a30: c2 02 21 30 ld [ %o0 + 0x130 ], %g1 40029a34: 84 10 20 01 mov 1, %g2 40029a38: bb 28 80 1d sll %g2, %i5, %i5 return 0; } /* XXX critical section */ api->signals_pending |= signo_to_mask( sig ); 40029a3c: c4 00 60 e0 ld [ %g1 + 0xe0 ], %g2 (void) _POSIX_signals_Unblock_thread( the_thread, sig, NULL ); 40029a40: 92 10 00 19 mov %i1, %o1 return 0; } /* XXX critical section */ api->signals_pending |= signo_to_mask( sig ); 40029a44: ba 10 80 1d or %g2, %i5, %i5 (void) _POSIX_signals_Unblock_thread( the_thread, sig, NULL ); 40029a48: 94 10 20 00 clr %o2 40029a4c: 7f ff ff 84 call 4002985c <_POSIX_signals_Unblock_thread> 40029a50: fa 20 60 e0 st %i5, [ %g1 + 0xe0 ] 40029a54: 7f ff 91 da call 4000e1bc <_Thread_Enable_dispatch> 40029a58: b0 10 20 00 clr %i0 } _Objects_Put( &the_thread->Object ); return 0; 40029a5c: 81 c7 e0 08 ret 40029a60: 81 e8 00 00 restore #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( ESRCH ); 40029a64: 7f ff b8 0a call 40017a8c <__errno> <== NOT EXECUTED 40029a68: 01 00 00 00 nop <== NOT EXECUTED 40029a6c: 82 10 20 03 mov 3, %g1 ! 3 <_TLS_Alignment+0x2> <== NOT EXECUTED 40029a70: c2 22 00 00 st %g1, [ %o0 ] } 40029a74: 81 c7 e0 08 ret 40029a78: 91 e8 3f ff restore %g0, -1, %o0 =============================================================================== 40010e74 : int pthread_mutex_init( pthread_mutex_t *mutex, const pthread_mutexattr_t *attr ) { 40010e74: 9d e3 bf a0 save %sp, -96, %sp POSIX_Mutex_Control *the_mutex; CORE_mutex_Attributes *the_mutex_attr; const pthread_mutexattr_t *the_attr; CORE_mutex_Disciplines the_discipline; if ( attr ) the_attr = attr; 40010e78: 80 a6 60 00 cmp %i1, 0 40010e7c: 12 80 00 04 bne 40010e8c 40010e80: 80 a6 20 00 cmp %i0, 0 else the_attr = &_POSIX_Mutex_Default_attributes; 40010e84: 33 10 00 72 sethi %hi(0x4001c800), %i1 40010e88: b2 16 63 b4 or %i1, 0x3b4, %i1 ! 4001cbb4 <_POSIX_Mutex_Default_attributes> /* Check for NULL mutex */ if ( !mutex ) 40010e8c: 02 80 00 52 be 40010fd4 40010e90: b8 10 20 16 mov 0x16, %i4 } } } #endif if ( !the_attr->is_initialized ) 40010e94: c2 06 40 00 ld [ %i1 ], %g1 40010e98: 80 a0 60 00 cmp %g1, 0 40010e9c: 22 80 00 4f be,a 40010fd8 40010ea0: b0 10 00 1c mov %i4, %i0 return EINVAL; /* * We only support process private mutexes. */ if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) 40010ea4: f8 06 60 04 ld [ %i1 + 4 ], %i4 40010ea8: 80 a7 20 01 cmp %i4, 1 40010eac: 02 80 00 47 be 40010fc8 40010eb0: 80 a7 20 00 cmp %i4, 0 return ENOSYS; if ( the_attr->process_shared != PTHREAD_PROCESS_PRIVATE ) 40010eb4: 32 80 00 48 bne,a 40010fd4 40010eb8: b8 10 20 16 mov 0x16, %i4 return EINVAL; /* * Determine the discipline of the mutex */ switch ( the_attr->protocol ) { 40010ebc: c2 06 60 0c ld [ %i1 + 0xc ], %g1 40010ec0: 80 a0 60 01 cmp %g1, 1 40010ec4: 02 80 00 09 be 40010ee8 40010ec8: 80 a0 60 02 cmp %g1, 2 40010ecc: 02 80 00 05 be 40010ee0 40010ed0: 80 a0 60 00 cmp %g1, 0 40010ed4: 12 80 00 3f bne 40010fd0 40010ed8: b6 10 20 00 clr %i3 40010edc: 30 80 00 04 b,a 40010eec case PTHREAD_PRIO_INHERIT: the_discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT; break; case PTHREAD_PRIO_PROTECT: the_discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_CEILING; break; 40010ee0: 10 80 00 03 b 40010eec 40010ee4: b6 10 20 03 mov 3, %i3 switch ( the_attr->protocol ) { case PTHREAD_PRIO_NONE: the_discipline = CORE_MUTEX_DISCIPLINES_FIFO; break; case PTHREAD_PRIO_INHERIT: the_discipline = CORE_MUTEX_DISCIPLINES_PRIORITY_INHERIT; 40010ee8: b6 10 20 02 mov 2, %i3 } /* * Validate the priority ceiling field -- should always be valid. */ if ( !_POSIX_Priority_Is_valid( the_attr->prio_ceiling ) ) 40010eec: 40 00 01 20 call 4001136c <_POSIX_Priority_Is_valid> 40010ef0: d0 06 60 08 ld [ %i1 + 8 ], %o0 40010ef4: 80 a2 20 00 cmp %o0, 0 40010ef8: 22 80 00 37 be,a 40010fd4 40010efc: b8 10 20 16 mov 0x16, %i4 #if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES) /* * Validate the mutex type and set appropriate SuperCore mutex * attributes. */ switch ( the_attr->type ) { 40010f00: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 40010f04: 80 a0 60 03 cmp %g1, 3 40010f08: 38 80 00 33 bgu,a 40010fd4 40010f0c: b8 10 20 16 mov 0x16, %i4 * This function allocates a mutexes control block from * the inactive chain of free mutexes control blocks. */ RTEMS_INLINE_ROUTINE POSIX_Mutex_Control *_POSIX_Mutex_Allocate( void ) { return (POSIX_Mutex_Control *) _Objects_Allocate( &_POSIX_Mutex_Information ); 40010f10: 35 10 00 72 sethi %hi(0x4001c800), %i2 40010f14: 90 16 a3 3c or %i2, 0x33c, %o0 ! 4001cb3c <_POSIX_Mutex_Information> 40010f18: 7f ff e4 91 call 4000a15c <_Objects_Allocate> 40010f1c: a0 10 00 1a mov %i2, %l0 } #endif the_mutex = _POSIX_Mutex_Allocate(); if ( !the_mutex ) { 40010f20: ba 92 20 00 orcc %o0, 0, %i5 40010f24: 12 80 00 07 bne 40010f40 40010f28: 35 10 00 72 sethi %hi(0x4001c800), %i2 40010f2c: d0 06 a0 b8 ld [ %i2 + 0xb8 ], %o0 ! 4001c8b8 <_RTEMS_Allocator_Mutex> 40010f30: 7f ff e1 e5 call 400096c4 <_API_Mutex_Unlock> 40010f34: b8 10 20 0b mov 0xb, %i4 *mutex = the_mutex->Object.id; _Objects_Allocator_unlock(); return 0; } 40010f38: 81 c7 e0 08 ret 40010f3c: 91 e8 00 1c restore %g0, %i4, %o0 if ( !the_mutex ) { _Objects_Allocator_unlock(); return EAGAIN; } the_mutex->process_shared = the_attr->process_shared; 40010f40: c2 06 60 04 ld [ %i1 + 4 ], %g1 40010f44: c2 27 60 10 st %g1, [ %i5 + 0x10 ] the_mutex_attr = &the_mutex->Mutex.Attributes; if ( the_attr->type == PTHREAD_MUTEX_RECURSIVE ) 40010f48: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 40010f4c: 80 a0 60 01 cmp %g1, 1 40010f50: 12 80 00 04 bne 40010f60 <== ALWAYS TAKEN 40010f54: 94 07 60 54 add %i5, 0x54, %o2 40010f58: 10 80 00 04 b 40010f68 <== NOT EXECUTED 40010f5c: c0 27 60 54 clr [ %i5 + 0x54 ] <== NOT EXECUTED the_mutex_attr->lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES; else the_mutex_attr->lock_nesting_behavior = CORE_MUTEX_NESTING_IS_ERROR; 40010f60: 82 10 20 01 mov 1, %g1 40010f64: c2 27 60 54 st %g1, [ %i5 + 0x54 ] the_mutex_attr->only_owner_release = true; 40010f68: 82 10 20 01 mov 1, %g1 40010f6c: c2 2f 60 58 stb %g1, [ %i5 + 0x58 ] */ RTEMS_INLINE_ROUTINE Priority_Control _POSIX_Priority_To_core( int priority ) { return (Priority_Control) (POSIX_SCHEDULER_MAXIMUM_PRIORITY - priority + 1); 40010f70: 03 10 00 6b sethi %hi(0x4001ac00), %g1 40010f74: c4 08 63 a4 ldub [ %g1 + 0x3a4 ], %g2 ! 4001afa4 40010f78: c2 06 60 08 ld [ %i1 + 8 ], %g1 the_mutex_attr->discipline = the_discipline; /* * Must be initialized to unlocked. */ _CORE_mutex_Initialize( &the_mutex->Mutex, NULL, the_mutex_attr, false ); 40010f7c: 90 07 60 14 add %i5, 0x14, %o0 40010f80: 82 20 80 01 sub %g2, %g1, %g1 else the_mutex_attr->lock_nesting_behavior = CORE_MUTEX_NESTING_IS_ERROR; the_mutex_attr->only_owner_release = true; the_mutex_attr->priority_ceiling = _POSIX_Priority_To_core( the_attr->prio_ceiling ); the_mutex_attr->discipline = the_discipline; 40010f84: f6 27 60 5c st %i3, [ %i5 + 0x5c ] if ( the_attr->type == PTHREAD_MUTEX_RECURSIVE ) the_mutex_attr->lock_nesting_behavior = CORE_MUTEX_NESTING_ACQUIRES; else the_mutex_attr->lock_nesting_behavior = CORE_MUTEX_NESTING_IS_ERROR; the_mutex_attr->only_owner_release = true; the_mutex_attr->priority_ceiling = 40010f88: c2 27 60 60 st %g1, [ %i5 + 0x60 ] the_mutex_attr->discipline = the_discipline; /* * Must be initialized to unlocked. */ _CORE_mutex_Initialize( &the_mutex->Mutex, NULL, the_mutex_attr, false ); 40010f8c: 92 10 20 00 clr %o1 40010f90: 7f ff e2 0c call 400097c0 <_CORE_mutex_Initialize> 40010f94: 96 10 20 00 clr %o3 ) { /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; _Objects_Set_local_object( 40010f98: c4 17 60 0a lduh [ %i5 + 0xa ], %g2 Objects_Control *the_object, uint32_t name ) { /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 40010f9c: c0 27 60 0c clr [ %i5 + 0xc ] * @param[in] information points to an Object Information Table * @param[in] the_object is a pointer to an object * @param[in] name is the name of the object to make accessible */ RTEMS_INLINE_ROUTINE void _Objects_Open_u32( Objects_Information *information, 40010fa0: a0 14 23 3c or %l0, 0x33c, %l0 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 40010fa4: c6 04 20 1c ld [ %l0 + 0x1c ], %g3 ) { /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; _Objects_Set_local_object( 40010fa8: c2 07 60 08 ld [ %i5 + 8 ], %g1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 40010fac: 85 28 a0 02 sll %g2, 2, %g2 40010fb0: fa 20 c0 02 st %i5, [ %g3 + %g2 ] 40010fb4: d0 06 a0 b8 ld [ %i2 + 0xb8 ], %o0 40010fb8: 7f ff e1 c3 call 400096c4 <_API_Mutex_Unlock> 40010fbc: c2 26 00 00 st %g1, [ %i0 ] *mutex = the_mutex->Object.id; _Objects_Allocator_unlock(); return 0; } 40010fc0: 81 c7 e0 08 ret 40010fc4: 91 e8 00 1c restore %g0, %i4, %o0 /* * We only support process private mutexes. */ if ( the_attr->process_shared == PTHREAD_PROCESS_SHARED ) return ENOSYS; 40010fc8: 10 80 00 03 b 40010fd4 40010fcc: b8 10 20 58 mov 0x58, %i4 case PTHREAD_MUTEX_ERRORCHECK: case PTHREAD_MUTEX_DEFAULT: break; default: return EINVAL; 40010fd0: b8 10 20 16 mov 0x16, %i4 *mutex = the_mutex->Object.id; _Objects_Allocator_unlock(); return 0; } 40010fd4: b0 10 00 1c mov %i4, %i0 40010fd8: 81 c7 e0 08 ret 40010fdc: 81 e8 00 00 restore =============================================================================== 40009ddc : */ int pthread_mutex_timedlock( pthread_mutex_t *mutex, const struct timespec *abstime ) { 40009ddc: 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 ); 40009de0: 92 07 bf fc add %fp, -4, %o1 40009de4: 40 00 00 35 call 40009eb8 <_POSIX_Absolute_timeout_to_ticks> 40009de8: 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 ); 40009dec: 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 ) 40009df0: 82 1a 20 03 xor %o0, 3, %g1 40009df4: 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 ); 40009df8: ba 10 00 08 mov %o0, %i5 if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) 40009dfc: b8 60 3f ff subx %g0, -1, %i4 do_wait = false; lock_status = _POSIX_Mutex_Lock_support( mutex, do_wait, ticks ); 40009e00: 90 10 00 18 mov %i0, %o0 40009e04: 7f ff ff b7 call 40009ce0 <_POSIX_Mutex_Lock_support> 40009e08: 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) ) { 40009e0c: 80 a7 20 00 cmp %i4, 0 40009e10: 32 80 00 0d bne,a 40009e44 40009e14: b0 10 00 08 mov %o0, %i0 40009e18: 80 a2 20 10 cmp %o0, 0x10 40009e1c: 32 80 00 0a bne,a 40009e44 40009e20: b0 10 00 08 mov %o0, %i0 if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID ) 40009e24: 80 a7 60 00 cmp %i5, 0 40009e28: 02 80 00 07 be 40009e44 <== NEVER TAKEN 40009e2c: b0 10 20 16 mov 0x16, %i0 return EINVAL; if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST || 40009e30: ba 07 7f ff add %i5, -1, %i5 40009e34: 80 a7 60 01 cmp %i5, 1 40009e38: 18 80 00 03 bgu 40009e44 <== NEVER TAKEN 40009e3c: b0 10 20 10 mov 0x10, %i0 40009e40: b0 10 20 74 mov 0x74, %i0 status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; } return lock_status; } 40009e44: 81 c7 e0 08 ret 40009e48: 81 e8 00 00 restore =============================================================================== 40006e60 : #if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES) int pthread_mutexattr_gettype( const pthread_mutexattr_t *attr, int *type ) { 40006e60: 82 10 00 08 mov %o0, %g1 if ( !attr ) 40006e64: 80 a0 60 00 cmp %g1, 0 40006e68: 02 80 00 0b be 40006e94 40006e6c: 90 10 20 16 mov 0x16, %o0 return EINVAL; if ( !attr->is_initialized ) 40006e70: c4 00 40 00 ld [ %g1 ], %g2 40006e74: 80 a0 a0 00 cmp %g2, 0 40006e78: 02 80 00 07 be 40006e94 40006e7c: 80 a2 60 00 cmp %o1, 0 return EINVAL; if ( !type ) 40006e80: 02 80 00 05 be 40006e94 <== NEVER TAKEN 40006e84: 01 00 00 00 nop return EINVAL; *type = attr->type; 40006e88: c2 00 60 10 ld [ %g1 + 0x10 ], %g1 return 0; 40006e8c: 90 10 20 00 clr %o0 return EINVAL; if ( !type ) return EINVAL; *type = attr->type; 40006e90: c2 22 40 00 st %g1, [ %o1 ] return 0; } 40006e94: 81 c3 e0 08 retl =============================================================================== 4000997c : int pthread_mutexattr_setpshared( pthread_mutexattr_t *attr, int pshared ) { 4000997c: 82 10 00 08 mov %o0, %g1 if ( !attr || !attr->is_initialized ) 40009980: 80 a0 60 00 cmp %g1, 0 40009984: 02 80 00 0a be 400099ac 40009988: 90 10 20 16 mov 0x16, %o0 4000998c: c4 00 40 00 ld [ %g1 ], %g2 40009990: 80 a0 a0 00 cmp %g2, 0 40009994: 02 80 00 06 be 400099ac 40009998: 80 a2 60 01 cmp %o1, 1 return EINVAL; switch ( pshared ) { 4000999c: 18 80 00 04 bgu 400099ac <== NEVER TAKEN 400099a0: 01 00 00 00 nop case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; 400099a4: d2 20 60 04 st %o1, [ %g1 + 4 ] return 0; 400099a8: 90 10 20 00 clr %o0 default: return EINVAL; } } 400099ac: 81 c3 e0 08 retl =============================================================================== 40006ecc : #if defined(_UNIX98_THREAD_MUTEX_ATTRIBUTES) int pthread_mutexattr_settype( pthread_mutexattr_t *attr, int type ) { 40006ecc: 82 10 00 08 mov %o0, %g1 if ( !attr || !attr->is_initialized ) 40006ed0: 80 a0 60 00 cmp %g1, 0 40006ed4: 02 80 00 0a be 40006efc 40006ed8: 90 10 20 16 mov 0x16, %o0 40006edc: c4 00 40 00 ld [ %g1 ], %g2 40006ee0: 80 a0 a0 00 cmp %g2, 0 40006ee4: 02 80 00 06 be 40006efc <== NEVER TAKEN 40006ee8: 80 a2 60 03 cmp %o1, 3 return EINVAL; switch ( type ) { 40006eec: 18 80 00 04 bgu 40006efc 40006ef0: 01 00 00 00 nop case PTHREAD_MUTEX_NORMAL: case PTHREAD_MUTEX_RECURSIVE: case PTHREAD_MUTEX_ERRORCHECK: case PTHREAD_MUTEX_DEFAULT: attr->type = type; 40006ef4: d2 20 60 10 st %o1, [ %g1 + 0x10 ] return 0; 40006ef8: 90 10 20 00 clr %o0 default: return EINVAL; } } 40006efc: 81 c3 e0 08 retl =============================================================================== 400115f0 : int pthread_once( pthread_once_t *once_control, void (*init_routine)(void) ) { if ( !once_control || !init_routine ) 400115f0: 80 a2 20 00 cmp %o0, 0 400115f4: 02 80 00 0c be 40011624 400115f8: 80 a2 60 00 cmp %o1, 0 400115fc: 02 80 00 0a be 40011624 40011600: 01 00 00 00 nop return EINVAL; if ( once_control->is_initialized != 1 ) 40011604: c2 02 00 00 ld [ %o0 ], %g1 40011608: 80 a0 60 01 cmp %g1, 1 4001160c: 12 80 00 06 bne 40011624 <== NEVER TAKEN 40011610: 01 00 00 00 nop return EINVAL; return _Once( &once_control->init_executed, init_routine ); 40011614: 90 02 20 04 add %o0, 4, %o0 40011618: 82 13 c0 00 mov %o7, %g1 4001161c: 40 00 03 0b call 40012248 <_Once> 40011620: 9e 10 40 00 mov %g1, %o7 } 40011624: 81 c3 e0 08 retl 40011628: 90 10 20 16 mov 0x16, %o0 =============================================================================== 40008448 : int pthread_rwlock_init( pthread_rwlock_t *rwlock, const pthread_rwlockattr_t *attr ) { 40008448: 9d e3 bf 90 save %sp, -112, %sp const pthread_rwlockattr_t *the_attr; /* * Error check parameters */ if ( !rwlock ) 4000844c: 80 a6 20 00 cmp %i0, 0 40008450: 02 80 00 2a be 400084f8 40008454: 80 a6 60 00 cmp %i1, 0 return EINVAL; /* * If the user passed in NULL, use the default attributes */ if ( attr ) { 40008458: 32 80 00 06 bne,a 40008470 4000845c: c2 06 40 00 ld [ %i1 ], %g1 the_attr = attr; } else { (void) pthread_rwlockattr_init( &default_attr ); 40008460: 90 07 bf f8 add %fp, -8, %o0 40008464: 40 00 01 b5 call 40008b38 40008468: 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 ) 4000846c: c2 06 40 00 ld [ %i1 ], %g1 40008470: 80 a0 60 00 cmp %g1, 0 40008474: 02 80 00 22 be 400084fc <== NEVER TAKEN 40008478: b8 10 20 16 mov 0x16, %i4 return EINVAL; switch ( the_attr->process_shared ) { 4000847c: f8 06 60 04 ld [ %i1 + 4 ], %i4 40008480: 80 a7 20 00 cmp %i4, 0 40008484: 32 80 00 1e bne,a 400084fc <== NEVER TAKEN 40008488: b8 10 20 16 mov 0x16, %i4 <== NOT EXECUTED */ RTEMS_INLINE_ROUTINE void _CORE_RWLock_Initialize_attributes( CORE_RWLock_Attributes *the_attributes ) { the_attributes->XXX = 0; 4000848c: c0 27 bf f4 clr [ %fp + -12 ] * 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 *) 40008490: 37 10 00 78 sethi %hi(0x4001e000), %i3 40008494: 35 10 00 78 sethi %hi(0x4001e000), %i2 40008498: 40 00 0b 4e call 4000b1d0 <_Objects_Allocate> 4000849c: 90 16 e2 30 or %i3, 0x230, %o0 */ _CORE_RWLock_Initialize_attributes( &the_attributes ); the_rwlock = _POSIX_RWLock_Allocate(); if ( !the_rwlock ) { 400084a0: ba 92 20 00 orcc %o0, 0, %i5 400084a4: 12 80 00 07 bne 400084c0 400084a8: 90 07 60 10 add %i5, 0x10, %o0 400084ac: d0 06 a0 d8 ld [ %i2 + 0xd8 ], %o0 400084b0: 40 00 07 f4 call 4000a480 <_API_Mutex_Unlock> 400084b4: b8 10 20 0b mov 0xb, %i4 *rwlock = the_rwlock->Object.id; _Objects_Allocator_unlock(); return 0; } 400084b8: 81 c7 e0 08 ret 400084bc: 91 e8 00 1c restore %g0, %i4, %o0 if ( !the_rwlock ) { _Objects_Allocator_unlock(); return EAGAIN; } _CORE_RWLock_Initialize( &the_rwlock->RWLock, &the_attributes ); 400084c0: 40 00 09 25 call 4000a954 <_CORE_RWLock_Initialize> 400084c4: 92 07 bf f4 add %fp, -12, %o1 ) { /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; _Objects_Set_local_object( 400084c8: c4 17 60 0a lduh [ %i5 + 0xa ], %g2 Objects_Control *the_object, uint32_t name ) { /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 400084cc: c0 27 60 0c clr [ %i5 + 0xc ] * @param[in] information points to an Object Information Table * @param[in] the_object is a pointer to an object * @param[in] name is the name of the object to make accessible */ RTEMS_INLINE_ROUTINE void _Objects_Open_u32( Objects_Information *information, 400084d0: b6 16 e2 30 or %i3, 0x230, %i3 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 400084d4: c6 06 e0 1c ld [ %i3 + 0x1c ], %g3 ) { /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; _Objects_Set_local_object( 400084d8: c2 07 60 08 ld [ %i5 + 8 ], %g1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 400084dc: 85 28 a0 02 sll %g2, 2, %g2 400084e0: fa 20 c0 02 st %i5, [ %g3 + %g2 ] 400084e4: d0 06 a0 d8 ld [ %i2 + 0xd8 ], %o0 400084e8: 40 00 07 e6 call 4000a480 <_API_Mutex_Unlock> 400084ec: c2 26 00 00 st %g1, [ %i0 ] *rwlock = the_rwlock->Object.id; _Objects_Allocator_unlock(); return 0; } 400084f0: 81 c7 e0 08 ret 400084f4: 91 e8 00 1c restore %g0, %i4, %o0 switch ( the_attr->process_shared ) { case PTHREAD_PROCESS_PRIVATE: /* only supported values */ break; case PTHREAD_PROCESS_SHARED: default: return EINVAL; 400084f8: b8 10 20 16 mov 0x16, %i4 *rwlock = the_rwlock->Object.id; _Objects_Allocator_unlock(); return 0; } 400084fc: b0 10 00 1c mov %i4, %i0 40008500: 81 c7 e0 08 ret 40008504: 81 e8 00 00 restore =============================================================================== 40008b14 : int pthread_rwlock_timedrdlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { 40008b14: 9d e3 bf 98 save %sp, -104, %sp Watchdog_Interval ticks; bool do_wait = true; POSIX_Absolute_timeout_conversion_results_t status; Thread_Control *executing; if ( !rwlock ) 40008b18: 80 a6 20 00 cmp %i0, 0 40008b1c: 02 80 00 2b be 40008bc8 40008b20: 92 07 bf fc add %fp, -4, %o1 * * 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 ); 40008b24: 40 00 19 fe call 4000f31c <_POSIX_Absolute_timeout_to_ticks> 40008b28: 90 10 00 19 mov %i1, %o0 40008b2c: d2 06 00 00 ld [ %i0 ], %o1 40008b30: ba 10 00 08 mov %o0, %i5 40008b34: 94 07 bf f8 add %fp, -8, %o2 40008b38: 11 10 00 71 sethi %hi(0x4001c400), %o0 40008b3c: 40 00 0b 26 call 4000b7d4 <_Objects_Get> 40008b40: 90 12 20 f4 or %o0, 0xf4, %o0 ! 4001c4f4 <_POSIX_RWLock_Information> if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { 40008b44: c2 07 bf f8 ld [ %fp + -8 ], %g1 40008b48: 80 a0 60 00 cmp %g1, 0 40008b4c: 32 80 00 20 bne,a 40008bcc 40008b50: b0 10 20 16 mov 0x16, %i0 case OBJECTS_LOCAL: executing = _Thread_Executing; 40008b54: f8 01 a0 18 ld [ %g6 + 0x18 ], %i4 _CORE_RWLock_Obtain_for_reading( 40008b58: d4 06 00 00 ld [ %i0 ], %o2 40008b5c: d8 07 bf fc ld [ %fp + -4 ], %o4 * 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 ) 40008b60: 82 1f 60 03 xor %i5, 3, %g1 switch ( location ) { case OBJECTS_LOCAL: executing = _Thread_Executing; _CORE_RWLock_Obtain_for_reading( 40008b64: 90 02 20 10 add %o0, 0x10, %o0 40008b68: 80 a0 00 01 cmp %g0, %g1 40008b6c: 92 10 00 1c mov %i4, %o1 40008b70: b6 60 3f ff subx %g0, -1, %i3 40008b74: 9a 10 20 00 clr %o5 40008b78: 40 00 07 62 call 4000a900 <_CORE_RWLock_Obtain_for_reading> 40008b7c: 96 10 00 1b mov %i3, %o3 40008b80: 40 00 0e 66 call 4000c518 <_Thread_Enable_dispatch> 40008b84: 01 00 00 00 nop ticks, NULL ); _Objects_Put( &the_rwlock->Object ); if ( !do_wait ) { 40008b88: 80 a6 e0 00 cmp %i3, 0 40008b8c: 12 80 00 0b bne 40008bb8 40008b90: d0 07 20 34 ld [ %i4 + 0x34 ], %o0 if ( executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE ) { 40008b94: 80 a2 20 02 cmp %o0, 2 40008b98: 12 80 00 08 bne 40008bb8 40008b9c: 80 a7 60 00 cmp %i5, 0 if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID ) 40008ba0: 22 80 00 0b be,a 40008bcc <== NEVER TAKEN 40008ba4: b0 10 20 16 mov 0x16, %i0 <== NOT EXECUTED return EINVAL; if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST || 40008ba8: ba 07 7f ff add %i5, -1, %i5 40008bac: 80 a7 60 01 cmp %i5, 1 40008bb0: 08 80 00 07 bleu 40008bcc <== ALWAYS TAKEN 40008bb4: b0 10 20 74 mov 0x74, %i0 status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; } } return _POSIX_RWLock_Translate_core_RWLock_return_code( 40008bb8: 40 00 00 37 call 40008c94 <_POSIX_RWLock_Translate_core_RWLock_return_code> 40008bbc: 01 00 00 00 nop 40008bc0: 81 c7 e0 08 ret 40008bc4: 91 e8 00 08 restore %g0, %o0, %o0 #endif case OBJECTS_ERROR: break; } return EINVAL; 40008bc8: b0 10 20 16 mov 0x16, %i0 } 40008bcc: 81 c7 e0 08 ret 40008bd0: 81 e8 00 00 restore =============================================================================== 40008bd4 : int pthread_rwlock_timedwrlock( pthread_rwlock_t *rwlock, const struct timespec *abstime ) { 40008bd4: 9d e3 bf 98 save %sp, -104, %sp Watchdog_Interval ticks; bool do_wait = true; POSIX_Absolute_timeout_conversion_results_t status; Thread_Control *executing; if ( !rwlock ) 40008bd8: 80 a6 20 00 cmp %i0, 0 40008bdc: 02 80 00 2b be 40008c88 40008be0: 92 07 bf fc add %fp, -4, %o1 * * 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 ); 40008be4: 40 00 19 ce call 4000f31c <_POSIX_Absolute_timeout_to_ticks> 40008be8: 90 10 00 19 mov %i1, %o0 40008bec: d2 06 00 00 ld [ %i0 ], %o1 40008bf0: ba 10 00 08 mov %o0, %i5 40008bf4: 94 07 bf f8 add %fp, -8, %o2 40008bf8: 11 10 00 71 sethi %hi(0x4001c400), %o0 40008bfc: 40 00 0a f6 call 4000b7d4 <_Objects_Get> 40008c00: 90 12 20 f4 or %o0, 0xf4, %o0 ! 4001c4f4 <_POSIX_RWLock_Information> if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; the_rwlock = _POSIX_RWLock_Get( rwlock, &location ); switch ( location ) { 40008c04: c2 07 bf f8 ld [ %fp + -8 ], %g1 40008c08: 80 a0 60 00 cmp %g1, 0 40008c0c: 32 80 00 20 bne,a 40008c8c 40008c10: b0 10 20 16 mov 0x16, %i0 case OBJECTS_LOCAL: executing = _Thread_Executing; 40008c14: f8 01 a0 18 ld [ %g6 + 0x18 ], %i4 _CORE_RWLock_Obtain_for_writing( 40008c18: d4 06 00 00 ld [ %i0 ], %o2 40008c1c: d8 07 bf fc ld [ %fp + -4 ], %o4 * 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 ) 40008c20: 82 1f 60 03 xor %i5, 3, %g1 switch ( location ) { case OBJECTS_LOCAL: executing = _Thread_Executing; _CORE_RWLock_Obtain_for_writing( 40008c24: 90 02 20 10 add %o0, 0x10, %o0 40008c28: 80 a0 00 01 cmp %g0, %g1 40008c2c: 92 10 00 1c mov %i4, %o1 40008c30: b6 60 3f ff subx %g0, -1, %i3 40008c34: 9a 10 20 00 clr %o5 40008c38: 40 00 07 60 call 4000a9b8 <_CORE_RWLock_Obtain_for_writing> 40008c3c: 96 10 00 1b mov %i3, %o3 40008c40: 40 00 0e 36 call 4000c518 <_Thread_Enable_dispatch> 40008c44: 01 00 00 00 nop ticks, NULL ); _Objects_Put( &the_rwlock->Object ); if ( !do_wait && 40008c48: 80 a6 e0 00 cmp %i3, 0 40008c4c: 12 80 00 0b bne 40008c78 40008c50: d0 07 20 34 ld [ %i4 + 0x34 ], %o0 40008c54: 80 a2 20 02 cmp %o0, 2 40008c58: 12 80 00 08 bne 40008c78 40008c5c: 80 a7 60 00 cmp %i5, 0 (executing->Wait.return_code == CORE_RWLOCK_UNAVAILABLE) ) { if ( status == POSIX_ABSOLUTE_TIMEOUT_INVALID ) 40008c60: 22 80 00 0b be,a 40008c8c <== NEVER TAKEN 40008c64: b0 10 20 16 mov 0x16, %i0 <== NOT EXECUTED return EINVAL; if ( status == POSIX_ABSOLUTE_TIMEOUT_IS_IN_PAST || 40008c68: ba 07 7f ff add %i5, -1, %i5 40008c6c: 80 a7 60 01 cmp %i5, 1 40008c70: 08 80 00 07 bleu 40008c8c <== ALWAYS TAKEN 40008c74: b0 10 20 74 mov 0x74, %i0 status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) return ETIMEDOUT; } return _POSIX_RWLock_Translate_core_RWLock_return_code( 40008c78: 40 00 00 07 call 40008c94 <_POSIX_RWLock_Translate_core_RWLock_return_code> 40008c7c: 01 00 00 00 nop 40008c80: 81 c7 e0 08 ret 40008c84: 91 e8 00 08 restore %g0, %o0, %o0 #endif case OBJECTS_ERROR: break; } return EINVAL; 40008c88: b0 10 20 16 mov 0x16, %i0 } 40008c8c: 81 c7 e0 08 ret 40008c90: 81 e8 00 00 restore =============================================================================== 4000943c : int pthread_rwlockattr_setpshared( pthread_rwlockattr_t *attr, int pshared ) { 4000943c: 82 10 00 08 mov %o0, %g1 if ( !attr ) 40009440: 80 a0 60 00 cmp %g1, 0 40009444: 02 80 00 0a be 4000946c 40009448: 90 10 20 16 mov 0x16, %o0 return EINVAL; if ( !attr->is_initialized ) 4000944c: c4 00 40 00 ld [ %g1 ], %g2 40009450: 80 a0 a0 00 cmp %g2, 0 40009454: 02 80 00 06 be 4000946c 40009458: 80 a2 60 01 cmp %o1, 1 return EINVAL; switch ( pshared ) { 4000945c: 18 80 00 04 bgu 4000946c <== NEVER TAKEN 40009460: 01 00 00 00 nop case PTHREAD_PROCESS_SHARED: case PTHREAD_PROCESS_PRIVATE: attr->process_shared = pshared; 40009464: d2 20 60 04 st %o1, [ %g1 + 4 ] return 0; 40009468: 90 10 20 00 clr %o0 default: return EINVAL; } } 4000946c: 81 c3 e0 08 retl =============================================================================== 4000a674 : int pthread_setschedparam( pthread_t thread, int policy, struct sched_param *param ) { 4000a674: 9d e3 bf 90 save %sp, -112, %sp int rc; /* * Check all the parameters */ if ( !param ) 4000a678: 80 a6 a0 00 cmp %i2, 0 4000a67c: 02 80 00 43 be 4000a788 4000a680: 90 10 20 16 mov 0x16, %o0 return EINVAL; rc = _POSIX_Thread_Translate_sched_param( 4000a684: 90 10 00 19 mov %i1, %o0 4000a688: 92 10 00 1a mov %i2, %o1 4000a68c: 94 07 bf f4 add %fp, -12, %o2 4000a690: 40 00 17 ed call 40010644 <_POSIX_Thread_Translate_sched_param> 4000a694: 96 07 bf f8 add %fp, -8, %o3 policy, param, &budget_algorithm, &budget_callout ); if ( rc ) 4000a698: 80 a2 20 00 cmp %o0, 0 4000a69c: 12 80 00 3b bne 4000a788 4000a6a0: 01 00 00 00 nop return rc; /* * Actually change the scheduling policy and parameters */ the_thread = _Thread_Get( thread, &location ); 4000a6a4: 90 10 00 18 mov %i0, %o0 4000a6a8: 40 00 0b da call 4000d610 <_Thread_Get> 4000a6ac: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 4000a6b0: c2 07 bf fc ld [ %fp + -4 ], %g1 return rc; /* * Actually change the scheduling policy and parameters */ the_thread = _Thread_Get( thread, &location ); 4000a6b4: b8 10 00 08 mov %o0, %i4 switch ( location ) { 4000a6b8: 80 a0 60 00 cmp %g1, 0 4000a6bc: 12 80 00 33 bne 4000a788 4000a6c0: 90 10 20 03 mov 3, %o0 case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_POSIX ]; 4000a6c4: fa 07 21 30 ld [ %i4 + 0x130 ], %i5 if ( api->schedpolicy == SCHED_SPORADIC ) 4000a6c8: c2 07 60 90 ld [ %i5 + 0x90 ], %g1 4000a6cc: 80 a0 60 04 cmp %g1, 4 4000a6d0: 12 80 00 05 bne 4000a6e4 4000a6d4: 92 10 00 1a mov %i2, %o1 (void) _Watchdog_Remove( &api->Sporadic_timer ); 4000a6d8: 40 00 10 f3 call 4000eaa4 <_Watchdog_Remove> 4000a6dc: 90 07 60 b4 add %i5, 0xb4, %o0 api->schedpolicy = policy; api->schedparam = *param; 4000a6e0: 92 10 00 1a mov %i2, %o1 4000a6e4: 94 10 20 1c mov 0x1c, %o2 api = the_thread->API_Extensions[ THREAD_API_POSIX ]; if ( api->schedpolicy == SCHED_SPORADIC ) (void) _Watchdog_Remove( &api->Sporadic_timer ); api->schedpolicy = policy; 4000a6e8: f2 27 60 90 st %i1, [ %i5 + 0x90 ] api->schedparam = *param; 4000a6ec: 40 00 22 fa call 400132d4 4000a6f0: 90 07 60 94 add %i5, 0x94, %o0 api->Attributes.schedpolicy = policy; api->Attributes.schedparam = *param; 4000a6f4: 90 07 60 18 add %i5, 0x18, %o0 if ( api->schedpolicy == SCHED_SPORADIC ) (void) _Watchdog_Remove( &api->Sporadic_timer ); api->schedpolicy = policy; api->schedparam = *param; api->Attributes.schedpolicy = policy; 4000a6f8: f2 27 60 14 st %i1, [ %i5 + 0x14 ] api->Attributes.schedparam = *param; 4000a6fc: 92 10 00 1a mov %i2, %o1 4000a700: 40 00 22 f5 call 400132d4 4000a704: 94 10 20 1c mov 0x1c, %o2 the_thread->budget_algorithm = budget_algorithm; 4000a708: c2 07 bf f4 ld [ %fp + -12 ], %g1 the_thread->budget_callout = budget_callout; switch ( api->schedpolicy ) { 4000a70c: 80 a6 60 00 cmp %i1, 0 api->schedpolicy = policy; api->schedparam = *param; api->Attributes.schedpolicy = policy; api->Attributes.schedparam = *param; the_thread->budget_algorithm = budget_algorithm; 4000a710: c2 27 20 78 st %g1, [ %i4 + 0x78 ] the_thread->budget_callout = budget_callout; 4000a714: c2 07 bf f8 ld [ %fp + -8 ], %g1 switch ( api->schedpolicy ) { 4000a718: 06 80 00 19 bl 4000a77c <== NEVER TAKEN 4000a71c: c2 27 20 7c st %g1, [ %i4 + 0x7c ] 4000a720: 80 a6 60 02 cmp %i1, 2 4000a724: 04 80 00 0b ble 4000a750 4000a728: 80 a6 60 04 cmp %i1, 4 4000a72c: 12 80 00 14 bne 4000a77c <== NEVER TAKEN 4000a730: 90 07 60 b4 add %i5, 0xb4, %o0 true ); break; case SCHED_SPORADIC: api->ss_high_priority = api->schedparam.sched_priority; 4000a734: c2 07 60 94 ld [ %i5 + 0x94 ], %g1 _Watchdog_Remove( &api->Sporadic_timer ); 4000a738: 40 00 10 db call 4000eaa4 <_Watchdog_Remove> 4000a73c: c2 27 60 b0 st %g1, [ %i5 + 0xb0 ] _POSIX_Threads_Sporadic_budget_TSR( 0, the_thread ); 4000a740: 90 10 20 00 clr %o0 4000a744: 7f ff ff 29 call 4000a3e8 <_POSIX_Threads_Sporadic_budget_TSR> 4000a748: 92 10 00 1c mov %i4, %o1 break; 4000a74c: 30 80 00 0c b,a 4000a77c switch ( api->schedpolicy ) { case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: the_thread->cpu_time_budget = rtems_configuration_get_ticks_per_timeslice(); 4000a750: 03 10 00 6b sethi %hi(0x4001ac00), %g1 switch ( api->schedpolicy ) { case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: the_thread->cpu_time_budget = 4000a754: c2 00 63 dc ld [ %g1 + 0x3dc ], %g1 ! 4001afdc rtems_configuration_get_ticks_per_timeslice(); the_thread->real_priority = _POSIX_Priority_To_core( api->schedparam.sched_priority ); _Thread_Change_priority( 4000a758: 90 10 00 1c mov %i4, %o0 switch ( api->schedpolicy ) { case SCHED_OTHER: case SCHED_FIFO: case SCHED_RR: the_thread->cpu_time_budget = 4000a75c: c2 27 20 74 st %g1, [ %i4 + 0x74 ] 4000a760: 03 10 00 71 sethi %hi(0x4001c400), %g1 4000a764: d2 08 60 94 ldub [ %g1 + 0x94 ], %o1 ! 4001c494 4000a768: c2 07 60 94 ld [ %i5 + 0x94 ], %g1 rtems_configuration_get_ticks_per_timeslice(); the_thread->real_priority = _POSIX_Priority_To_core( api->schedparam.sched_priority ); _Thread_Change_priority( 4000a76c: 94 10 20 01 mov 1, %o2 4000a770: 92 22 40 01 sub %o1, %g1, %o1 4000a774: 40 00 0a af call 4000d230 <_Thread_Change_priority> 4000a778: d2 27 20 18 st %o1, [ %i4 + 0x18 ] 4000a77c: 40 00 0b 9a call 4000d5e4 <_Thread_Enable_dispatch> 4000a780: 01 00 00 00 nop _POSIX_Threads_Sporadic_budget_TSR( 0, the_thread ); break; } _Objects_Put( &the_thread->Object ); return 0; 4000a784: 90 10 20 00 clr %o0 ! 0 <_TLS_BSS_size> case OBJECTS_ERROR: break; } return ESRCH; } 4000a788: 81 c7 e0 08 ret 4000a78c: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 40006134 : int pthread_setspecific( pthread_key_t key, const void *value ) { 40006134: 9d e3 bf 78 save %sp, -136, %sp 40006138: 11 10 00 53 sethi %hi(0x40014c00), %o0 4000613c: 92 10 00 18 mov %i0, %o1 40006140: 90 12 22 0c or %o0, 0x20c, %o0 40006144: 40 00 06 74 call 40007b14 <_Objects_Get> 40006148: 94 07 bf d8 add %fp, -40, %o2 POSIX_Keys_Key_value_pair *value_pair_ptr; RBTree_Node *p; POSIX_Keys_Key_value_pair search_node; the_key = _POSIX_Keys_Get( key, &location ); switch ( location ) { 4000614c: c2 07 bf d8 ld [ %fp + -40 ], %g1 40006150: 80 a0 60 00 cmp %g1, 0 40006154: 12 80 00 29 bne 400061f8 40006158: 39 10 00 53 sethi %hi(0x40014c00), %i4 case OBJECTS_LOCAL: search_node.key = key; search_node.thread_id = _Thread_Executing->Object.id; 4000615c: c2 01 a0 18 ld [ %g6 + 0x18 ], %g1 the_key = _POSIX_Keys_Get( key, &location ); switch ( location ) { case OBJECTS_LOCAL: search_node.key = key; 40006160: f0 27 bf f4 st %i0, [ %fp + -12 ] search_node.thread_id = _Thread_Executing->Object.id; 40006164: c2 00 60 08 ld [ %g1 + 8 ], %g1 40006168: c2 27 bf f8 st %g1, [ %fp + -8 ] p = _RBTree_Find( &_POSIX_Keys_Key_value_lookup_tree, 4000616c: 90 17 22 c8 or %i4, 0x2c8, %o0 40006170: 40 00 07 09 call 40007d94 <_RBTree_Find> 40006174: 92 07 bf e4 add %fp, -28, %o1 &search_node.Key_value_lookup_node ); if ( p ) { 40006178: 80 a2 20 00 cmp %o0, 0 4000617c: 22 80 00 04 be,a 4000618c 40006180: 11 10 00 53 sethi %hi(0x40014c00), %o0 40006184: 10 80 00 19 b 400061e8 40006188: f2 22 20 18 st %i1, [ %o0 + 0x18 ] ! 40014c18 <_POSIX_RWLock_Information+0x4> } RTEMS_INLINE_ROUTINE POSIX_Keys_Key_value_pair * _POSIX_Keys_Key_value_pair_allocate( void ) { return (POSIX_Keys_Key_value_pair *) _Freechain_Get( &_POSIX_Keys_Keypool ); 4000618c: 40 00 03 e8 call 4000712c <_Freechain_Get> 40006190: 90 12 22 84 or %o0, 0x284, %o0 value_pair_ptr->value = value; } else { value_pair_ptr = _POSIX_Keys_Key_value_pair_allocate(); if ( !value_pair_ptr ) { 40006194: ba 92 20 00 orcc %o0, 0, %i5 40006198: 32 80 00 06 bne,a 400061b0 <== ALWAYS TAKEN 4000619c: c2 01 a0 18 ld [ %g6 + 0x18 ], %g1 400061a0: 40 00 0a 13 call 400089ec <_Thread_Enable_dispatch> <== NOT EXECUTED 400061a4: b0 10 20 0c mov 0xc, %i0 <== NOT EXECUTED _Objects_Put( &the_key->Object ); return ENOMEM; 400061a8: 81 c7 e0 08 ret <== NOT EXECUTED 400061ac: 81 e8 00 00 restore <== NOT EXECUTED } value_pair_ptr->key = key; 400061b0: f0 27 60 18 st %i0, [ %i5 + 0x18 ] value_pair_ptr->thread_id = _Thread_Executing->Object.id; 400061b4: c2 00 60 08 ld [ %g1 + 8 ], %g1 value_pair_ptr->value = value; /* The insert can only go wrong if the same node is already in a unique * tree. This has been already checked with the _RBTree_Find() */ (void) _RBTree_Insert( &_POSIX_Keys_Key_value_lookup_tree, 400061b8: 90 17 22 c8 or %i4, 0x2c8, %o0 return ENOMEM; } value_pair_ptr->key = key; value_pair_ptr->thread_id = _Thread_Executing->Object.id; 400061bc: c2 27 60 1c st %g1, [ %i5 + 0x1c ] value_pair_ptr->value = value; 400061c0: f2 27 60 20 st %i1, [ %i5 + 0x20 ] /* The insert can only go wrong if the same node is already in a unique * tree. This has been already checked with the _RBTree_Find() */ (void) _RBTree_Insert( &_POSIX_Keys_Key_value_lookup_tree, 400061c4: 40 00 07 2c call 40007e74 <_RBTree_Insert> 400061c8: 92 07 60 08 add %i5, 8, %o1 &(value_pair_ptr->Key_value_lookup_node) ); /** append rb_node to the thread API extension's chain */ _Chain_Append_unprotected( &_Thread_Executing->Key_Chain, 400061cc: c2 01 a0 18 ld [ %g6 + 0x18 ], %g1 Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; 400061d0: c4 00 61 40 ld [ %g1 + 0x140 ], %g2 RTEMS_INLINE_ROUTINE void _Chain_Append_unprotected( Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); 400061d4: 86 00 61 3c add %g1, 0x13c, %g3 Chain_Node *old_last = tail->previous; the_node->next = tail; 400061d8: c6 27 40 00 st %g3, [ %i5 ] tail->previous = the_node; 400061dc: fa 20 61 40 st %i5, [ %g1 + 0x140 ] old_last->next = the_node; 400061e0: fa 20 80 00 st %i5, [ %g2 ] the_node->previous = old_last; 400061e4: c4 27 60 04 st %g2, [ %i5 + 4 ] 400061e8: 40 00 0a 01 call 400089ec <_Thread_Enable_dispatch> 400061ec: b0 10 20 00 clr %i0 ); } _Objects_Put( &the_key->Object ); return 0; 400061f0: 81 c7 e0 08 ret 400061f4: 81 e8 00 00 restore case OBJECTS_ERROR: break; } return EINVAL; } 400061f8: 81 c7 e0 08 ret 400061fc: 91 e8 20 16 restore %g0, 0x16, %o0 =============================================================================== 400078fc : /* * 18.2.2 Setting Cancelability State, P1003.1c/Draft 10, p. 183 */ void pthread_testcancel( void ) { 400078fc: 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() ) 40007900: c4 01 a0 0c ld [ %g6 + 0xc ], %g2 40007904: 80 a0 a0 00 cmp %g2, 0 40007908: 12 80 00 15 bne 4000795c <== NEVER TAKEN 4000790c: 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 disable_level = _Thread_Dispatch_disable_level; 40007910: c4 01 a0 10 ld [ %g6 + 0x10 ], %g2 _ISR_Disable( level ); _Profiling_Thread_dispatch_disable( _Per_CPU_Get(), disable_level ); #endif ++disable_level; 40007914: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = disable_level; 40007918: c4 21 a0 10 st %g2, [ %g6 + 0x10 ] return; _Thread_Disable_dispatch(); executing = _Thread_Executing; 4000791c: f0 01 a0 18 ld [ %g6 + 0x18 ], %i0 thread_support = executing->API_Extensions[ THREAD_API_POSIX ]; 40007920: c2 06 21 30 ld [ %i0 + 0x130 ], %g1 if ( thread_support->cancelability_state == PTHREAD_CANCEL_ENABLE && 40007924: c4 00 60 f0 ld [ %g1 + 0xf0 ], %g2 40007928: 80 a0 a0 00 cmp %g2, 0 4000792c: 12 80 00 05 bne 40007940 <== NEVER TAKEN 40007930: ba 10 20 00 clr %i5 40007934: c2 00 60 f8 ld [ %g1 + 0xf8 ], %g1 40007938: 80 a0 00 01 cmp %g0, %g1 4000793c: ba 40 20 00 addx %g0, 0, %i5 thread_support->cancelation_requested ) cancel = true; _Thread_Enable_dispatch(); 40007940: 40 00 0b 5e call 4000a6b8 <_Thread_Enable_dispatch> 40007944: 01 00 00 00 nop if ( cancel ) 40007948: 80 8f 60 ff btst 0xff, %i5 4000794c: 02 80 00 04 be 4000795c 40007950: 01 00 00 00 nop _POSIX_Thread_Exit( executing, PTHREAD_CANCELED ); 40007954: 40 00 17 9f call 4000d7d0 <_POSIX_Thread_Exit> 40007958: 93 e8 3f ff restore %g0, -1, %o1 4000795c: 81 c7 e0 08 ret 40007960: 81 e8 00 00 restore =============================================================================== 40007e54 : * errno - otherwise */ int rtems_aio_enqueue (rtems_aio_request *req) { 40007e54: 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); 40007e58: 3b 10 00 6a sethi %hi(0x4001a800), %i5 40007e5c: 90 17 60 88 or %i5, 0x88, %o0 ! 4001a888 40007e60: 40 00 02 c8 call 40008980 40007e64: a0 10 00 1d mov %i5, %l0 if (result != 0) { 40007e68: b8 92 20 00 orcc %o0, 0, %i4 40007e6c: 02 80 00 06 be 40007e84 <== ALWAYS TAKEN 40007e70: 90 10 00 18 mov %i0, %o0 free (req); 40007e74: 7f ff f0 09 call 40003e98 <== NOT EXECUTED 40007e78: b0 10 00 1c mov %i4, %i0 <== NOT EXECUTED return result; 40007e7c: 81 c7 e0 08 ret <== NOT EXECUTED 40007e80: 81 e8 00 00 restore <== NOT EXECUTED } /* _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); 40007e84: 40 00 04 d7 call 400091e0 40007e88: ba 17 60 88 or %i5, 0x88, %i5 40007e8c: 92 07 bf e0 add %fp, -32, %o1 40007e90: 40 00 03 e8 call 40008e30 40007e94: 94 07 bf e4 add %fp, -28, %o2 req->caller_thread = pthread_self (); 40007e98: 40 00 04 d2 call 400091e0 40007e9c: b8 10 00 1d mov %i5, %i4 req->priority = param.sched_priority - req->aiocbp->aio_reqprio; 40007ea0: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 40007ea4: c6 07 bf e4 ld [ %fp + -28 ], %g3 40007ea8: 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 (); 40007eac: d0 26 20 10 st %o0, [ %i0 + 0x10 ] req->priority = param.sched_priority - req->aiocbp->aio_reqprio; 40007eb0: 84 20 c0 02 sub %g3, %g2, %g2 40007eb4: c4 26 20 0c st %g2, [ %i0 + 0xc ] req->policy = policy; 40007eb8: c4 07 bf e0 ld [ %fp + -32 ], %g2 40007ebc: c4 26 20 08 st %g2, [ %i0 + 8 ] req->aiocbp->error_code = EINPROGRESS; 40007ec0: 84 10 20 77 mov 0x77, %g2 40007ec4: c4 20 60 34 st %g2, [ %g1 + 0x34 ] req->aiocbp->return_value = 0; if ((aio_request_queue.idle_threads == 0) && 40007ec8: c4 07 60 74 ld [ %i5 + 0x74 ], %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; 40007ecc: c0 20 60 38 clr [ %g1 + 0x38 ] if ((aio_request_queue.idle_threads == 0) && 40007ed0: 80 a0 a0 00 cmp %g2, 0 40007ed4: 12 80 00 33 bne 40007fa0 <== NEVER TAKEN 40007ed8: d2 00 40 00 ld [ %g1 ], %o1 40007edc: c2 07 60 70 ld [ %i5 + 0x70 ], %g1 40007ee0: 80 a0 60 04 cmp %g1, 4 40007ee4: 14 80 00 30 bg 40007fa4 40007ee8: 11 10 00 6a sethi %hi(0x4001a800), %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); 40007eec: 90 07 60 54 add %i5, 0x54, %o0 40007ef0: 7f ff ff 7e call 40007ce8 40007ef4: 94 10 20 01 mov 1, %o2 if (r_chain->new_fd == 1) { 40007ef8: 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); 40007efc: b8 10 00 08 mov %o0, %i4 if (r_chain->new_fd == 1) { 40007f00: 80 a0 60 01 cmp %g1, 1 40007f04: b2 02 20 08 add %o0, 8, %i1 40007f08: b6 02 20 1c add %o0, 0x1c, %i3 40007f0c: 12 80 00 1c bne 40007f7c 40007f10: b4 02 20 20 add %o0, 0x20, %i2 RTEMS_INLINE_ROUTINE void _Chain_Prepend( Chain_Control *the_chain, Chain_Node *the_node ) { _Chain_Insert(_Chain_Head(the_chain), the_node); 40007f14: 92 10 00 18 mov %i0, %o1 40007f18: 40 00 09 3c call 4000a408 <_Chain_Insert> 40007f1c: 90 10 00 19 mov %i1, %o0 rtems_chain_prepend (&r_chain->perfd, &req->next_prio); r_chain->new_fd = 0; pthread_mutex_init (&r_chain->mutex, NULL); 40007f20: 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; 40007f24: c0 27 20 18 clr [ %i4 + 0x18 ] pthread_mutex_init (&r_chain->mutex, NULL); 40007f28: 40 00 02 3b call 40008814 40007f2c: 90 10 00 1b mov %i3, %o0 pthread_cond_init (&r_chain->cond, NULL); 40007f30: 92 10 20 00 clr %o1 40007f34: 40 00 01 07 call 40008350 40007f38: 90 10 00 1a mov %i2, %o0 AIO_printf ("New thread \n"); result = pthread_create (&thid, &aio_request_queue.attr, 40007f3c: 90 07 bf dc add %fp, -36, %o0 40007f40: 92 07 60 08 add %i5, 8, %o1 40007f44: 15 10 00 1e sethi %hi(0x40007800), %o2 40007f48: 96 10 00 1c mov %i4, %o3 40007f4c: 40 00 03 20 call 40008bcc 40007f50: 94 12 a1 98 or %o2, 0x198, %o2 rtems_aio_handle, (void *) r_chain); if (result != 0) { 40007f54: b0 92 20 00 orcc %o0, 0, %i0 40007f58: 22 80 00 06 be,a 40007f70 <== ALWAYS TAKEN 40007f5c: c2 07 60 70 ld [ %i5 + 0x70 ], %g1 pthread_mutex_unlock (&aio_request_queue.mutex); 40007f60: 40 00 02 a7 call 400089fc <== NOT EXECUTED 40007f64: 90 10 00 1d mov %i5, %o0 <== NOT EXECUTED return result; 40007f68: 81 c7 e0 08 ret <== NOT EXECUTED 40007f6c: 81 e8 00 00 restore <== NOT EXECUTED } ++aio_request_queue.active_threads; 40007f70: 82 00 60 01 inc %g1 40007f74: 10 80 00 3d b 40008068 40007f78: c2 27 60 70 st %g1, [ %i5 + 0x70 ] } else { /* put request in the fd chain it belongs to */ pthread_mutex_lock (&r_chain->mutex); 40007f7c: 40 00 02 81 call 40008980 40007f80: 90 10 00 1b mov %i3, %o0 rtems_aio_insert_prio (&r_chain->perfd, req); 40007f84: 90 10 00 19 mov %i1, %o0 40007f88: 7f ff fe 6d call 4000793c 40007f8c: 92 10 00 18 mov %i0, %o1 pthread_cond_signal (&r_chain->cond); 40007f90: 40 00 01 1c call 40008400 40007f94: 90 10 00 1a mov %i2, %o0 pthread_mutex_unlock (&r_chain->mutex); 40007f98: 10 80 00 12 b 40007fe0 40007f9c: 90 10 00 1b mov %i3, %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, 40007fa0: 11 10 00 6a sethi %hi(0x4001a800), %o0 <== NOT EXECUTED 40007fa4: 94 10 20 00 clr %o2 40007fa8: 7f ff ff 50 call 40007ce8 40007fac: 90 12 20 dc or %o0, 0xdc, %o0 req->aiocbp->aio_fildes, 0); if (r_chain != NULL) 40007fb0: ba 92 20 00 orcc %o0, 0, %i5 40007fb4: 22 80 00 0f be,a 40007ff0 40007fb8: c2 06 20 14 ld [ %i0 + 0x14 ], %g1 { pthread_mutex_lock (&r_chain->mutex); 40007fbc: b8 07 60 1c add %i5, 0x1c, %i4 40007fc0: 40 00 02 70 call 40008980 40007fc4: 90 10 00 1c mov %i4, %o0 rtems_aio_insert_prio (&r_chain->perfd, req); 40007fc8: 90 07 60 08 add %i5, 8, %o0 40007fcc: 7f ff fe 5c call 4000793c 40007fd0: 92 10 00 18 mov %i0, %o1 pthread_cond_signal (&r_chain->cond); 40007fd4: 40 00 01 0b call 40008400 40007fd8: 90 07 60 20 add %i5, 0x20, %o0 pthread_mutex_unlock (&r_chain->mutex); 40007fdc: 90 10 00 1c mov %i4, %o0 40007fe0: 40 00 02 87 call 400089fc 40007fe4: 01 00 00 00 nop 40007fe8: 10 80 00 21 b 4000806c 40007fec: 90 14 20 88 or %l0, 0x88, %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); 40007ff0: 11 10 00 6a sethi %hi(0x4001a800), %o0 40007ff4: d2 00 40 00 ld [ %g1 ], %o1 40007ff8: 90 12 20 e8 or %o0, 0xe8, %o0 40007ffc: 7f ff ff 3b call 40007ce8 40008000: 94 10 20 01 mov 1, %o2 if (r_chain->new_fd == 1) { 40008004: 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); 40008008: ba 10 00 08 mov %o0, %i5 4000800c: 92 10 00 18 mov %i0, %o1 if (r_chain->new_fd == 1) { 40008010: 80 a0 60 01 cmp %g1, 1 40008014: 12 80 00 0d bne 40008048 40008018: 90 02 20 08 add %o0, 8, %o0 4000801c: 40 00 08 fb call 4000a408 <_Chain_Insert> 40008020: 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); 40008024: 90 07 60 1c add %i5, 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; 40008028: c0 27 60 18 clr [ %i5 + 0x18 ] pthread_mutex_init (&r_chain->mutex, NULL); 4000802c: 40 00 01 fa call 40008814 40008030: 92 10 20 00 clr %o1 pthread_cond_init (&r_chain->cond, NULL); 40008034: 90 07 60 20 add %i5, 0x20, %o0 40008038: 40 00 00 c6 call 40008350 4000803c: 92 10 20 00 clr %o1 40008040: 10 80 00 05 b 40008054 40008044: c2 07 20 74 ld [ %i4 + 0x74 ], %g1 } else /* just insert the request in the existing fd chain */ rtems_aio_insert_prio (&r_chain->perfd, req); 40008048: 7f ff fe 3d call 4000793c 4000804c: 01 00 00 00 nop if (aio_request_queue.idle_threads > 0) 40008050: c2 07 20 74 ld [ %i4 + 0x74 ], %g1 40008054: 80 a0 60 00 cmp %g1, 0 40008058: 04 80 00 05 ble 4000806c <== ALWAYS TAKEN 4000805c: 90 14 20 88 or %l0, 0x88, %o0 pthread_cond_signal (&aio_request_queue.new_req); 40008060: 40 00 00 e8 call 40008400 <== NOT EXECUTED 40008064: 90 07 20 04 add %i4, 4, %o0 <== NOT EXECUTED } } pthread_mutex_unlock (&aio_request_queue.mutex); 40008068: 90 14 20 88 or %l0, 0x88, %o0 4000806c: 40 00 02 64 call 400089fc 40008070: b0 10 20 00 clr %i0 return 0; } 40008074: 81 c7 e0 08 ret 40008078: 81 e8 00 00 restore =============================================================================== 40007998 : * NULL - if error */ static void * rtems_aio_handle (void *arg) { 40007998: 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); 4000799c: 3b 10 00 6a sethi %hi(0x4001a800), %i5 400079a0: ba 17 60 88 or %i5, 0x88, %i5 ! 4001a888 } } /* 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); 400079a4: b4 10 00 1d mov %i5, %i2 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)) { 400079a8: b2 07 60 64 add %i5, 0x64, %i1 rtems_chain_node *node; node = rtems_chain_first (work_req_chain); temp = (rtems_aio_request_chain *) node; while (temp->fildes < r_chain->fildes && 400079ac: a0 07 60 58 add %i5, 0x58, %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); 400079b0: b6 06 20 1c add %i0, 0x1c, %i3 400079b4: 40 00 03 f3 call 40008980 400079b8: 90 10 00 1b mov %i3, %o0 if (result != 0) 400079bc: 80 a2 20 00 cmp %o0, 0 400079c0: 12 80 00 93 bne 40007c0c <== NEVER TAKEN 400079c4: 82 06 20 0c add %i0, 0xc, %g1 */ RTEMS_INLINE_ROUTINE const Chain_Node *_Chain_Immutable_first( const Chain_Control *the_chain ) { return _Chain_Immutable_head( the_chain )->next; 400079c8: 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)) { 400079cc: 80 a7 00 01 cmp %i4, %g1 400079d0: 02 80 00 3b be 40007abc 400079d4: 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); 400079d8: 40 00 06 02 call 400091e0 400079dc: 01 00 00 00 nop 400079e0: 92 07 bf d8 add %fp, -40, %o1 400079e4: 40 00 05 13 call 40008e30 400079e8: 94 07 bf e4 add %fp, -28, %o2 param.sched_priority = req->priority; 400079ec: c2 07 20 0c ld [ %i4 + 0xc ], %g1 pthread_setschedparam (pthread_self(), req->policy, ¶m); 400079f0: 40 00 05 fc call 400091e0 400079f4: c2 27 bf e4 st %g1, [ %fp + -28 ] 400079f8: d2 07 20 08 ld [ %i4 + 8 ], %o1 400079fc: 40 00 05 fc call 400091ec 40007a00: 94 07 bf e4 add %fp, -28, %o2 #else RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 40007a04: 40 00 0a 68 call 4000a3a4 <_Chain_Extract> 40007a08: 90 10 00 1c mov %i4, %o0 rtems_chain_extract (node); pthread_mutex_unlock (&r_chain->mutex); 40007a0c: 40 00 03 fc call 400089fc 40007a10: 90 10 00 1b mov %i3, %o0 switch (req->aiocbp->aio_lio_opcode) { 40007a14: c2 07 20 14 ld [ %i4 + 0x14 ], %g1 40007a18: c4 00 60 30 ld [ %g1 + 0x30 ], %g2 40007a1c: 80 a0 a0 02 cmp %g2, 2 40007a20: 22 80 00 10 be,a 40007a60 40007a24: c4 18 60 08 ldd [ %g1 + 8 ], %g2 40007a28: 80 a0 a0 03 cmp %g2, 3 40007a2c: 02 80 00 15 be 40007a80 <== NEVER TAKEN 40007a30: 80 a0 a0 01 cmp %g2, 1 40007a34: 32 80 00 19 bne,a 40007a98 <== NEVER TAKEN 40007a38: f8 07 20 14 ld [ %i4 + 0x14 ], %i4 <== NOT EXECUTED case LIO_READ: AIO_printf ("read\n"); result = pread (req->aiocbp->aio_fildes, 40007a3c: c4 18 60 08 ldd [ %g1 + 8 ], %g2 40007a40: d0 00 40 00 ld [ %g1 ], %o0 40007a44: d2 00 60 10 ld [ %g1 + 0x10 ], %o1 40007a48: d4 00 60 14 ld [ %g1 + 0x14 ], %o2 40007a4c: 96 10 00 02 mov %g2, %o3 40007a50: 40 00 2a 7c call 40012440 40007a54: 98 10 00 03 mov %g3, %o4 (void *) req->aiocbp->aio_buf, req->aiocbp->aio_nbytes, req->aiocbp->aio_offset); break; 40007a58: 10 80 00 0d b 40007a8c 40007a5c: 80 a2 3f ff cmp %o0, -1 case LIO_WRITE: AIO_printf ("write\n"); result = pwrite (req->aiocbp->aio_fildes, 40007a60: d0 00 40 00 ld [ %g1 ], %o0 40007a64: d2 00 60 10 ld [ %g1 + 0x10 ], %o1 40007a68: d4 00 60 14 ld [ %g1 + 0x14 ], %o2 40007a6c: 96 10 00 02 mov %g2, %o3 40007a70: 40 00 2a b0 call 40012530 40007a74: 98 10 00 03 mov %g3, %o4 (void *) req->aiocbp->aio_buf, req->aiocbp->aio_nbytes, req->aiocbp->aio_offset); break; 40007a78: 10 80 00 05 b 40007a8c 40007a7c: 80 a2 3f ff cmp %o0, -1 case LIO_SYNC: AIO_printf ("sync\n"); result = fsync (req->aiocbp->aio_fildes); 40007a80: 40 00 1b a6 call 4000e918 <== NOT EXECUTED 40007a84: d0 00 40 00 ld [ %g1 ], %o0 <== NOT EXECUTED break; default: result = -1; } if (result == -1) { 40007a88: 80 a2 3f ff cmp %o0, -1 <== NOT EXECUTED 40007a8c: 32 80 00 09 bne,a 40007ab0 <== ALWAYS TAKEN 40007a90: c2 07 20 14 ld [ %i4 + 0x14 ], %g1 req->aiocbp->return_value = -1; 40007a94: f8 07 20 14 ld [ %i4 + 0x14 ], %i4 <== NOT EXECUTED 40007a98: 82 10 3f ff mov -1, %g1 <== NOT EXECUTED req->aiocbp->error_code = errno; 40007a9c: 40 00 29 84 call 400120ac <__errno> <== NOT EXECUTED 40007aa0: c2 27 20 38 st %g1, [ %i4 + 0x38 ] <== NOT EXECUTED 40007aa4: c2 02 00 00 ld [ %o0 ], %g1 <== NOT EXECUTED 40007aa8: 10 bf ff c2 b 400079b0 <== NOT EXECUTED 40007aac: c2 27 20 34 st %g1, [ %i4 + 0x34 ] <== NOT EXECUTED } else { req->aiocbp->return_value = result; 40007ab0: d0 20 60 38 st %o0, [ %g1 + 0x38 ] req->aiocbp->error_code = 0; 40007ab4: 10 bf ff bf b 400079b0 40007ab8: 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); 40007abc: 40 00 03 d0 call 400089fc 40007ac0: 90 10 00 1b mov %i3, %o0 pthread_mutex_lock (&aio_request_queue.mutex); 40007ac4: 40 00 03 af call 40008980 40007ac8: 90 10 00 1d mov %i5, %o0 if (rtems_chain_is_empty (chain)) 40007acc: c2 06 20 08 ld [ %i0 + 8 ], %g1 40007ad0: 80 a0 40 1c cmp %g1, %i4 40007ad4: 12 80 00 4a bne 40007bfc <== NEVER TAKEN 40007ad8: 92 07 bf dc add %fp, -36, %o1 { clock_gettime (CLOCK_REALTIME, &timeout); 40007adc: 40 00 01 b2 call 400081a4 40007ae0: 90 10 20 01 mov 1, %o0 timeout.tv_sec += 3; 40007ae4: c2 07 bf dc ld [ %fp + -36 ], %g1 timeout.tv_nsec = 0; 40007ae8: 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; 40007aec: 82 00 60 03 add %g1, 3, %g1 timeout.tv_nsec = 0; result = pthread_cond_timedwait (&r_chain->cond, 40007af0: 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; 40007af4: c2 27 bf dc st %g1, [ %fp + -36 ] timeout.tv_nsec = 0; result = pthread_cond_timedwait (&r_chain->cond, 40007af8: 90 10 00 1c mov %i4, %o0 40007afc: 92 10 00 1d mov %i5, %o1 40007b00: 40 00 02 5d call 40008474 40007b04: 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) { 40007b08: 80 a2 20 74 cmp %o0, 0x74 40007b0c: 12 80 00 3c bne 40007bfc <== NEVER TAKEN 40007b10: 01 00 00 00 nop 40007b14: 40 00 0a 24 call 4000a3a4 <_Chain_Extract> 40007b18: 90 10 00 18 mov %i0, %o0 rtems_chain_extract (&r_chain->next_fd); pthread_mutex_destroy (&r_chain->mutex); 40007b1c: 40 00 02 e6 call 400086b4 40007b20: 90 10 00 1b mov %i3, %o0 pthread_cond_destroy (&r_chain->cond); 40007b24: 40 00 01 ce call 4000825c 40007b28: 90 10 00 1c mov %i4, %o0 free (r_chain); 40007b2c: 7f ff f0 db call 40003e98 40007b30: 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)) { 40007b34: c2 07 60 60 ld [ %i5 + 0x60 ], %g1 40007b38: 80 a0 40 19 cmp %g1, %i1 40007b3c: 12 80 00 1b bne 40007ba8 40007b40: c2 07 60 74 ld [ %i5 + 0x74 ], %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); 40007b44: 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; 40007b48: 82 00 60 01 inc %g1 40007b4c: c2 27 60 74 st %g1, [ %i5 + 0x74 ] --aio_request_queue.active_threads; 40007b50: c2 07 60 70 ld [ %i5 + 0x70 ], %g1 clock_gettime (CLOCK_REALTIME, &timeout); 40007b54: 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; 40007b58: 82 00 7f ff add %g1, -1, %g1 clock_gettime (CLOCK_REALTIME, &timeout); 40007b5c: 40 00 01 92 call 400081a4 40007b60: c2 27 60 70 st %g1, [ %i5 + 0x70 ] timeout.tv_sec += 3; 40007b64: c2 07 bf dc ld [ %fp + -36 ], %g1 timeout.tv_nsec = 0; 40007b68: 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; 40007b6c: 82 00 60 03 add %g1, 3, %g1 timeout.tv_nsec = 0; result = pthread_cond_timedwait (&aio_request_queue.new_req, 40007b70: 90 07 60 04 add %i5, 4, %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; 40007b74: c2 27 bf dc st %g1, [ %fp + -36 ] timeout.tv_nsec = 0; result = pthread_cond_timedwait (&aio_request_queue.new_req, 40007b78: 92 10 00 1d mov %i5, %o1 40007b7c: 40 00 02 3e call 40008474 40007b80: 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) { 40007b84: 80 a2 20 74 cmp %o0, 0x74 40007b88: 12 80 00 08 bne 40007ba8 <== NEVER TAKEN 40007b8c: c2 07 60 74 ld [ %i5 + 0x74 ], %g1 AIO_printf ("Etimeout\n"); --aio_request_queue.idle_threads; pthread_mutex_unlock (&aio_request_queue.mutex); 40007b90: 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; 40007b94: 82 00 7f ff add %g1, -1, %g1 pthread_mutex_unlock (&aio_request_queue.mutex); 40007b98: 40 00 03 99 call 400089fc 40007b9c: c2 27 60 74 st %g1, [ %i5 + 0x74 ] } } AIO_printf ("Thread finished\n"); return NULL; } 40007ba0: 81 c7 e0 08 ret 40007ba4: 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; 40007ba8: f0 07 60 60 ld [ %i5 + 0x60 ], %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; 40007bac: 82 00 7f ff add %g1, -1, %g1 40007bb0: c2 27 60 74 st %g1, [ %i5 + 0x74 ] ++aio_request_queue.active_threads; 40007bb4: c2 07 60 70 ld [ %i5 + 0x70 ], %g1 40007bb8: 90 10 00 18 mov %i0, %o0 40007bbc: 82 00 60 01 inc %g1 40007bc0: 40 00 09 f9 call 4000a3a4 <_Chain_Extract> 40007bc4: c2 27 60 70 st %g1, [ %i5 + 0x70 ] 40007bc8: c2 07 60 54 ld [ %i5 + 0x54 ], %g1 rtems_chain_node *node; node = rtems_chain_first (work_req_chain); temp = (rtems_aio_request_chain *) node; while (temp->fildes < r_chain->fildes && 40007bcc: c4 06 20 14 ld [ %i0 + 0x14 ], %g2 40007bd0: c6 00 60 14 ld [ %g1 + 0x14 ], %g3 40007bd4: 80 a0 c0 02 cmp %g3, %g2 40007bd8: 16 80 00 06 bge 40007bf0 40007bdc: 80 a0 40 10 cmp %g1, %l0 40007be0: 22 80 00 05 be,a 40007bf4 <== NEVER TAKEN 40007be4: d0 00 60 04 ld [ %g1 + 4 ], %o0 <== NOT EXECUTED * @param[in] the_node is the node to be operated upon. * * @return This method returns the next node on the chain. */ RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_next( rtems_chain_node *the_node 40007be8: 10 bf ff fa b 40007bd0 40007bec: 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 ); 40007bf0: d0 00 60 04 ld [ %g1 + 4 ], %o0 40007bf4: 40 00 0a 05 call 4000a408 <_Chain_Insert> 40007bf8: 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); 40007bfc: 40 00 03 80 call 400089fc 40007c00: 90 10 00 1a mov %i2, %o0 40007c04: 10 bf ff 6c b 400079b4 40007c08: b6 06 20 1c add %i0, 0x1c, %i3 } } AIO_printf ("Thread finished\n"); return NULL; } 40007c0c: b0 10 20 00 clr %i0 <== NOT EXECUTED 40007c10: 81 c7 e0 08 ret <== NOT EXECUTED 40007c14: 81 e8 00 00 restore <== NOT EXECUTED =============================================================================== 40007c18 : * 0 - if initialization succeeded */ int rtems_aio_init (void) { 40007c18: 9d e3 bf a0 save %sp, -96, %sp int result = 0; result = pthread_attr_init (&aio_request_queue.attr); 40007c1c: 3b 10 00 6a sethi %hi(0x4001a800), %i5 40007c20: 40 00 03 d1 call 40008b64 40007c24: 90 17 60 90 or %i5, 0x90, %o0 ! 4001a890 if (result != 0) 40007c28: b0 92 20 00 orcc %o0, 0, %i0 40007c2c: 12 80 00 2d bne 40007ce0 <== NEVER TAKEN 40007c30: 90 17 60 90 or %i5, 0x90, %o0 return result; result = 40007c34: 40 00 03 d8 call 40008b94 40007c38: 92 10 20 00 clr %o1 pthread_attr_setdetachstate (&aio_request_queue.attr, PTHREAD_CREATE_DETACHED); if (result != 0) 40007c3c: 80 a2 20 00 cmp %o0, 0 40007c40: 02 80 00 05 be 40007c54 <== ALWAYS TAKEN 40007c44: 39 10 00 6a sethi %hi(0x4001a800), %i4 pthread_attr_destroy (&aio_request_queue.attr); 40007c48: 40 00 03 bb call 40008b34 <== NOT EXECUTED 40007c4c: 90 17 60 90 or %i5, 0x90, %o0 <== NOT EXECUTED result = pthread_mutex_init (&aio_request_queue.mutex, NULL); 40007c50: 39 10 00 6a sethi %hi(0x4001a800), %i4 <== NOT EXECUTED 40007c54: 92 10 20 00 clr %o1 40007c58: 40 00 02 ef call 40008814 40007c5c: 90 17 20 88 or %i4, 0x88, %o0 if (result != 0) 40007c60: 80 a2 20 00 cmp %o0, 0 40007c64: 22 80 00 05 be,a 40007c78 <== ALWAYS TAKEN 40007c68: 11 10 00 6a sethi %hi(0x4001a800), %o0 pthread_attr_destroy (&aio_request_queue.attr); 40007c6c: 40 00 03 b2 call 40008b34 <== NOT EXECUTED 40007c70: 90 17 60 90 or %i5, 0x90, %o0 <== NOT EXECUTED result = pthread_cond_init (&aio_request_queue.new_req, NULL); 40007c74: 11 10 00 6a sethi %hi(0x4001a800), %o0 <== NOT EXECUTED 40007c78: 92 10 20 00 clr %o1 40007c7c: 40 00 01 b5 call 40008350 40007c80: 90 12 20 8c or %o0, 0x8c, %o0 if (result != 0) { 40007c84: b0 92 20 00 orcc %o0, 0, %i0 40007c88: 02 80 00 07 be 40007ca4 <== ALWAYS TAKEN 40007c8c: 82 17 20 88 or %i4, 0x88, %g1 pthread_mutex_destroy (&aio_request_queue.mutex); 40007c90: 40 00 02 89 call 400086b4 <== NOT EXECUTED 40007c94: 90 17 20 88 or %i4, 0x88, %o0 <== NOT EXECUTED pthread_attr_destroy (&aio_request_queue.attr); 40007c98: 40 00 03 a7 call 40008b34 <== NOT EXECUTED 40007c9c: 90 17 60 90 or %i5, 0x90, %o0 <== NOT EXECUTED ) { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; 40007ca0: 82 17 20 88 or %i4, 0x88, %g1 <== NOT EXECUTED 40007ca4: 84 00 60 58 add %g1, 0x58, %g2 40007ca8: c4 20 60 54 st %g2, [ %g1 + 0x54 ] head->previous = NULL; tail->previous = head; 40007cac: 84 00 60 54 add %g1, 0x54, %g2 40007cb0: 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; 40007cb4: 84 00 60 64 add %g1, 0x64, %g2 40007cb8: c4 20 60 60 st %g2, [ %g1 + 0x60 ] head->previous = NULL; tail->previous = head; 40007cbc: 84 00 60 60 add %g1, 0x60, %g2 { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; 40007cc0: c0 20 60 58 clr [ %g1 + 0x58 ] tail->previous = head; 40007cc4: c4 20 60 68 st %g2, [ %g1 + 0x68 ] { Chain_Node *head = _Chain_Head( the_chain ); Chain_Node *tail = _Chain_Tail( the_chain ); head->next = tail; head->previous = NULL; 40007cc8: c0 20 60 64 clr [ %g1 + 0x64 ] 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; 40007ccc: 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; 40007cd0: c0 20 60 70 clr [ %g1 + 0x70 ] aio_request_queue.idle_threads = 0; aio_request_queue.initialized = AIO_QUEUE_INITIALIZED; 40007cd4: 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; 40007cd8: c0 20 60 74 clr [ %g1 + 0x74 ] aio_request_queue.initialized = AIO_QUEUE_INITIALIZED; 40007cdc: c4 20 60 6c st %g2, [ %g1 + 0x6c ] return result; } 40007ce0: 81 c7 e0 08 ret 40007ce4: 81 e8 00 00 restore =============================================================================== 4000793c : */ RTEMS_INLINE_ROUTINE Chain_Node *_Chain_First( Chain_Control *the_chain ) { return _Chain_Head( the_chain )->next; 4000793c: 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 ); 40007940: 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)) { 40007944: 80 a0 40 03 cmp %g1, %g3 40007948: 02 80 00 0b be 40007974 <== NEVER TAKEN 4000794c: 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; 40007950: c8 00 60 14 ld [ %g1 + 0x14 ], %g4 while (req->aiocbp->aio_reqprio > prio && 40007954: 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; 40007958: c8 01 20 18 ld [ %g4 + 0x18 ], %g4 while (req->aiocbp->aio_reqprio > prio && 4000795c: da 03 60 18 ld [ %o5 + 0x18 ], %o5 40007960: 80 a3 40 04 cmp %o5, %g4 40007964: 14 80 00 07 bg 40007980 <== NEVER TAKEN 40007968: 80 a0 40 03 cmp %g1, %g3 RTEMS_INLINE_ROUTINE void rtems_chain_insert( rtems_chain_node *after_node, rtems_chain_node *the_node ) { _Chain_Insert( after_node, the_node ); 4000796c: d0 00 60 04 ld [ %g1 + 4 ], %o0 40007970: 92 10 00 02 mov %g2, %o1 40007974: 82 13 c0 00 mov %o7, %g1 40007978: 40 00 0a a4 call 4000a408 <_Chain_Insert> 4000797c: 9e 10 40 00 mov %g1, %o7 40007980: 22 bf ff fc be,a 40007970 <== NOT EXECUTED 40007984: d0 00 60 04 ld [ %g1 + 4 ], %o0 <== NOT EXECUTED * @param[in] the_node is the node to be operated upon. * * @return This method returns the next node on the chain. */ RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_next( rtems_chain_node *the_node 40007988: c2 00 40 00 ld [ %g1 ], %g1 <== NOT EXECUTED !rtems_chain_is_tail (chain, node)) { node = rtems_chain_next (node); prio = ((rtems_aio_request *) node)->aiocbp->aio_reqprio; 4000798c: c8 00 60 14 ld [ %g1 + 0x14 ], %g4 <== NOT EXECUTED 40007990: 10 bf ff f4 b 40007960 <== NOT EXECUTED 40007994: c8 01 20 18 ld [ %g4 + 0x18 ], %g4 <== NOT EXECUTED =============================================================================== 40007ddc : * 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) { 40007ddc: 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; 40007de0: 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 ); 40007de4: 82 06 20 04 add %i0, 4, %g1 if (rtems_chain_is_empty (chain)) 40007de8: 80 a7 40 01 cmp %i5, %g1 40007dec: 02 80 00 18 be 40007e4c 40007df0: b0 10 20 02 mov 2, %i0 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) { 40007df4: c4 07 60 14 ld [ %i5 + 0x14 ], %g2 40007df8: 80 a0 80 19 cmp %g2, %i1 40007dfc: 02 80 00 08 be 40007e1c <== ALWAYS TAKEN 40007e00: 80 a7 40 01 cmp %i5, %g1 40007e04: fa 07 40 00 ld [ %i5 ], %i5 <== NOT EXECUTED 40007e08: 80 a7 40 01 cmp %i5, %g1 <== NOT EXECUTED 40007e0c: 32 bf ff fb bne,a 40007df8 <== NOT EXECUTED 40007e10: 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; 40007e14: 81 c7 e0 08 ret <== NOT EXECUTED 40007e18: 91 e8 20 01 restore %g0, 1, %o0 <== NOT EXECUTED while (!rtems_chain_is_tail (chain, node) && current->aiocbp != aiocbp) { node = rtems_chain_next (node); current = (rtems_aio_request *) node; } if (rtems_chain_is_tail (chain, node)) 40007e1c: 02 80 00 0c be 40007e4c <== NEVER TAKEN 40007e20: b0 10 20 01 mov 1, %i0 #else RTEMS_INLINE_ROUTINE void rtems_chain_extract( rtems_chain_node *the_node ) { _Chain_Extract( the_node ); 40007e24: 40 00 09 60 call 4000a3a4 <_Chain_Extract> 40007e28: 90 10 00 1d mov %i5, %o0 return AIO_NOTCANCELED; else { rtems_chain_extract (node); current->aiocbp->error_code = ECANCELED; 40007e2c: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 40007e30: 84 10 20 8c mov 0x8c, %g2 40007e34: c4 20 60 34 st %g2, [ %g1 + 0x34 ] current->aiocbp->return_value = -1; 40007e38: 84 10 3f ff mov -1, %g2 free (current); 40007e3c: 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; 40007e40: c4 20 60 38 st %g2, [ %g1 + 0x38 ] free (current); 40007e44: 7f ff f0 15 call 40003e98 40007e48: b0 10 20 00 clr %i0 } return AIO_CANCELED; 40007e4c: 81 c7 e0 08 ret 40007e50: 81 e8 00 00 restore =============================================================================== 400085e4 : rtems_chain_control *chain, rtems_event_set events, rtems_interval timeout, rtems_chain_node **node_ptr ) { 400085e4: 9d e3 bf 98 save %sp, -104, %sp #else RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_get( rtems_chain_control *the_chain ) { return _Chain_Get( the_chain ); 400085e8: 40 00 01 80 call 40008be8 <_Chain_Get> 400085ec: 90 10 00 18 mov %i0, %o0 rtems_status_code sc = RTEMS_SUCCESSFUL; rtems_chain_node *node = NULL; while ( sc == RTEMS_SUCCESSFUL && (node = rtems_chain_get( chain )) == NULL 400085f0: ba 92 20 00 orcc %o0, 0, %i5 400085f4: 12 80 00 0b bne 40008620 400085f8: 90 10 00 19 mov %i1, %o0 ) { rtems_event_set out; sc = rtems_event_receive( 400085fc: 92 10 20 00 clr %o1 40008600: 94 10 00 1a mov %i2, %o2 40008604: 7f ff fd 06 call 40007a1c 40008608: 96 07 bf fc add %fp, -4, %o3 ) { rtems_status_code sc = RTEMS_SUCCESSFUL; rtems_chain_node *node = NULL; while ( 4000860c: 80 a2 20 00 cmp %o0, 0 40008610: 02 bf ff f6 be 400085e8 <== NEVER TAKEN 40008614: 01 00 00 00 nop 40008618: 10 80 00 04 b 40008628 4000861c: fa 26 c0 00 st %i5, [ %i3 ] 40008620: 90 10 20 00 clr %o0 timeout, &out ); } *node_ptr = node; 40008624: fa 26 c0 00 st %i5, [ %i3 ] return sc; } 40008628: 81 c7 e0 08 ret 4000862c: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 40006f90 : #include #include #include rtems_status_code rtems_clock_tick( void ) { 40006f90: 9d e3 bf a0 save %sp, -96, %sp #if defined( RTEMS_SMP ) _Thread_Disable_dispatch(); #endif _TOD_Tickle_ticks(); 40006f94: 40 00 05 6b call 40008540 <_TOD_Tickle_ticks> 40006f98: 01 00 00 00 nop */ RTEMS_INLINE_ROUTINE void _Watchdog_Tickle_ticks( void ) { _Watchdog_Tickle( &_Watchdog_Ticks_chain ); 40006f9c: 11 10 00 61 sethi %hi(0x40018400), %o0 40006fa0: 40 00 10 66 call 4000b138 <_Watchdog_Tickle> 40006fa4: 90 12 20 b0 or %o0, 0xb0, %o0 ! 400184b0 <_Watchdog_Ticks_chain> uint32_t cpu_index; for ( cpu_index = 0 ; cpu_index < cpu_count ; ++cpu_index ) { const Per_CPU_Control *cpu = _Per_CPU_Get_by_index( cpu_index ); const Scheduler_Control *scheduler = _Scheduler_Get_by_CPU( cpu ); Thread_Control *executing = cpu->executing; 40006fa8: 03 10 00 63 sethi %hi(0x40018c00), %g1 40006fac: d2 00 61 18 ld [ %g1 + 0x118 ], %o1 ! 40018d18 <_Per_CPU_Information+0x18> if ( scheduler != NULL && executing != NULL ) { 40006fb0: 80 a2 60 00 cmp %o1, 0 40006fb4: 02 80 00 06 be 40006fcc <== NEVER TAKEN 40006fb8: 11 10 00 55 sethi %hi(0x40015400), %o0 ( *scheduler->Operations.tick )( scheduler, executing ); 40006fbc: 90 12 22 6c or %o0, 0x26c, %o0 ! 4001566c <_Scheduler_Table> 40006fc0: c2 02 20 30 ld [ %o0 + 0x30 ], %g1 40006fc4: 9f c0 40 00 call %g1 40006fc8: 01 00 00 00 nop _Scheduler_Tick(); #if defined( RTEMS_SMP ) _Thread_Enable_dispatch(); #else if ( _Thread_Is_context_switch_necessary() && 40006fcc: c4 09 a0 14 ldub [ %g6 + 0x14 ], %g2 40006fd0: 80 a0 a0 00 cmp %g2, 0 40006fd4: 02 80 00 08 be 40006ff4 40006fd8: 01 00 00 00 nop ISR_Level level; _ISR_Disable_without_giant( level ); #endif enabled = _Thread_Dispatch_disable_level == 0; 40006fdc: c2 01 a0 10 ld [ %g6 + 0x10 ], %g1 40006fe0: 80 a0 60 00 cmp %g1, 0 40006fe4: 12 80 00 04 bne 40006ff4 40006fe8: 01 00 00 00 nop _Thread_Dispatch_is_enabled() ) _Thread_Dispatch(); 40006fec: 40 00 0b 2e call 40009ca4 <_Thread_Dispatch> 40006ff0: 01 00 00 00 nop #endif return RTEMS_SUCCESSFUL; } 40006ff4: 81 c7 e0 08 ret 40006ff8: 91 e8 20 00 restore %g0, 0, %o0 =============================================================================== 4000cd3c : #include #include void rtems_iterate_over_all_threads(rtems_per_thread_routine routine) { 4000cd3c: 9d e3 bf a0 save %sp, -96, %sp uint32_t i; uint32_t api_index; Thread_Control *the_thread; Objects_Information *information; if ( !routine ) 4000cd40: ba 10 20 01 mov 1, %i5 4000cd44: 80 a6 20 00 cmp %i0, 0 4000cd48: 02 80 00 1a be 4000cdb0 <== NEVER TAKEN 4000cd4c: 35 10 00 c0 sethi %hi(0x40030000), %i2 4000cd50: 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 ]; 4000cd54: 84 16 a3 60 or %i2, 0x360, %g2 4000cd58: c2 00 80 01 ld [ %g2 + %g1 ], %g1 4000cd5c: f6 00 60 04 ld [ %g1 + 4 ], %i3 if ( !information ) 4000cd60: 80 a6 e0 00 cmp %i3, 0 4000cd64: 22 80 00 10 be,a 4000cda4 4000cd68: ba 07 60 01 inc %i5 4000cd6c: 10 80 00 09 b 4000cd90 4000cd70: b8 10 20 01 mov 1, %i4 continue; for ( i=1 ; i <= information->maximum ; i++ ) { the_thread = (Thread_Control *)information->local_table[ i ]; 4000cd74: 83 2f 20 02 sll %i4, 2, %g1 4000cd78: d0 00 80 01 ld [ %g2 + %g1 ], %o0 if ( !the_thread ) 4000cd7c: 80 a2 20 00 cmp %o0, 0 4000cd80: 02 80 00 04 be 4000cd90 <== NEVER TAKEN 4000cd84: b8 07 20 01 inc %i4 continue; (*routine)(the_thread); 4000cd88: 9f c6 00 00 call %i0 4000cd8c: 01 00 00 00 nop information = _Objects_Information_table[ api_index ][ 1 ]; if ( !information ) continue; for ( i=1 ; i <= information->maximum ; i++ ) { 4000cd90: c2 16 e0 10 lduh [ %i3 + 0x10 ], %g1 4000cd94: 80 a7 00 01 cmp %i4, %g1 4000cd98: 28 bf ff f7 bleu,a 4000cd74 4000cd9c: 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++ ) { 4000cda0: ba 07 60 01 inc %i5 4000cda4: 80 a7 60 04 cmp %i5, 4 4000cda8: 12 bf ff eb bne 4000cd54 4000cdac: 83 2f 60 02 sll %i5, 2, %g1 4000cdb0: 81 c7 e0 08 ret 4000cdb4: 81 e8 00 00 restore =============================================================================== 40009398 : uint32_t length, uint32_t buffer_size, rtems_attribute attribute_set, rtems_id *id ) { 40009398: 9d e3 bf a0 save %sp, -96, %sp Partition_Control *the_partition; if ( !rtems_is_name_valid( name ) ) 4000939c: 80 a6 20 00 cmp %i0, 0 400093a0: 02 80 00 36 be 40009478 400093a4: 82 10 20 03 mov 3, %g1 return RTEMS_INVALID_NAME; if ( !starting_address ) 400093a8: 80 a6 60 00 cmp %i1, 0 400093ac: 02 80 00 33 be 40009478 400093b0: 82 10 20 09 mov 9, %g1 return RTEMS_INVALID_ADDRESS; if ( !id ) 400093b4: 80 a7 60 00 cmp %i5, 0 400093b8: 02 80 00 30 be 40009478 <== NEVER TAKEN 400093bc: 80 a6 a0 00 cmp %i2, 0 return RTEMS_INVALID_ADDRESS; if ( length == 0 || buffer_size == 0 || length < buffer_size || 400093c0: 02 80 00 2e be 40009478 400093c4: 82 10 20 08 mov 8, %g1 400093c8: 80 a6 e0 00 cmp %i3, 0 400093cc: 02 80 00 2b be 40009478 400093d0: 80 a6 80 1b cmp %i2, %i3 400093d4: 0a 80 00 29 bcs 40009478 400093d8: 80 8e e0 07 btst 7, %i3 400093dc: 12 80 00 27 bne 40009478 400093e0: 80 8e 60 07 btst 7, %i1 !_Partition_Is_buffer_size_aligned( buffer_size ) ) return RTEMS_INVALID_SIZE; if ( !_Addresses_Is_aligned( starting_address ) ) 400093e4: 12 80 00 25 bne 40009478 400093e8: 82 10 20 09 mov 9, %g1 * 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 ); 400093ec: 23 10 00 77 sethi %hi(0x4001dc00), %l1 400093f0: 25 10 00 78 sethi %hi(0x4001e000), %l2 400093f4: 40 00 07 77 call 4000b1d0 <_Objects_Allocate> 400093f8: 90 14 62 c4 or %l1, 0x2c4, %o0 return RTEMS_MP_NOT_CONFIGURED; #endif the_partition = _Partition_Allocate(); if ( !the_partition ) { 400093fc: a0 92 20 00 orcc %o0, 0, %l0 40009400: 32 80 00 06 bne,a 40009418 40009404: f8 24 20 1c st %i4, [ %l0 + 0x1c ] 40009408: 40 00 04 1e call 4000a480 <_API_Mutex_Unlock> 4000940c: d0 04 a0 d8 ld [ %l2 + 0xd8 ], %o0 _Objects_Allocator_unlock(); return RTEMS_TOO_MANY; 40009410: 10 80 00 1a b 40009478 40009414: 82 10 20 05 mov 5, %g1 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 ); 40009418: 92 10 00 1b mov %i3, %o1 _Objects_Allocator_unlock(); return RTEMS_TOO_MANY; } #endif the_partition->starting_address = starting_address; 4000941c: f2 24 20 10 st %i1, [ %l0 + 0x10 ] the_partition->length = length; 40009420: f4 24 20 14 st %i2, [ %l0 + 0x14 ] the_partition->buffer_size = buffer_size; 40009424: f6 24 20 18 st %i3, [ %l0 + 0x18 ] the_partition->attribute_set = attribute_set; the_partition->number_of_used_blocks = 0; 40009428: c0 24 20 20 clr [ %l0 + 0x20 ] _Chain_Initialize( &the_partition->Memory, starting_address, length / buffer_size, buffer_size ); 4000942c: 40 00 32 67 call 40015dc8 <.udiv> 40009430: 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, 40009434: 92 10 00 19 mov %i1, %o1 length / buffer_size, buffer_size ); 40009438: 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, 4000943c: 96 10 00 1b mov %i3, %o3 40009440: b8 04 20 24 add %l0, 0x24, %i4 40009444: 40 00 04 3d call 4000a538 <_Chain_Initialize> 40009448: 90 10 00 1c mov %i4, %o0 Objects_Name name ) { the_object->name = name; _Objects_Set_local_object( 4000944c: c4 14 20 0a lduh [ %l0 + 0xa ], %g2 * @param[in] information points to an Object Information Table * @param[in] the_object is a pointer to an object * @param[in] name is the name of the object to make accessible */ RTEMS_INLINE_ROUTINE void _Objects_Open( Objects_Information *information, 40009450: a2 14 62 c4 or %l1, 0x2c4, %l1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 40009454: c6 04 60 1c ld [ %l1 + 0x1c ], %g3 Objects_Information *information, Objects_Control *the_object, Objects_Name name ) { the_object->name = name; 40009458: f0 24 20 0c st %i0, [ %l0 + 0xc ] _Objects_Set_local_object( 4000945c: c2 04 20 08 ld [ %l0 + 8 ], %g1 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 40009460: 85 28 a0 02 sll %g2, 2, %g2 40009464: e0 20 c0 02 st %l0, [ %g3 + %g2 ] 40009468: d0 04 a0 d8 ld [ %l2 + 0xd8 ], %o0 4000946c: 40 00 04 05 call 4000a480 <_API_Mutex_Unlock> 40009470: c2 27 40 00 st %g1, [ %i5 ] 0 /* Not used */ ); #endif _Objects_Allocator_unlock(); return RTEMS_SUCCESSFUL; 40009474: 82 10 20 00 clr %g1 } 40009478: 81 c7 e0 08 ret 4000947c: 91 e8 00 01 restore %g0, %g1, %o0 =============================================================================== 4000806c : rtems_status_code rtems_partition_return_buffer( rtems_id id, void *buffer ) { 4000806c: 9d e3 bf 98 save %sp, -104, %sp RTEMS_INLINE_ROUTINE Partition_Control *_Partition_Get ( Objects_Id id, Objects_Locations *location ) { return (Partition_Control *) 40008070: 11 10 00 69 sethi %hi(0x4001a400), %o0 40008074: 92 10 00 18 mov %i0, %o1 40008078: 90 12 22 10 or %o0, 0x210, %o0 4000807c: 40 00 07 4c call 40009dac <_Objects_Get> 40008080: 94 07 bf fc add %fp, -4, %o2 Partition_Control *the_partition; Objects_Locations location; the_partition = _Partition_Get( id, &location ); switch ( location ) { 40008084: c2 07 bf fc ld [ %fp + -4 ], %g1 40008088: 80 a0 60 00 cmp %g1, 0 4000808c: 12 80 00 21 bne 40008110 40008090: ba 10 00 08 mov %o0, %i5 ) { void *starting; void *ending; starting = the_partition->starting_address; 40008094: d0 02 20 10 ld [ %o0 + 0x10 ], %o0 RTEMS_INLINE_ROUTINE void *_Addresses_Add_offset ( const void *base, uintptr_t offset ) { return (void *)((uintptr_t)base + offset); 40008098: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 4000809c: 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 ) && 400080a0: 80 a6 40 01 cmp %i1, %g1 400080a4: 18 80 00 0b bgu 400080d0 400080a8: 82 10 20 00 clr %g1 400080ac: 80 a6 40 08 cmp %i1, %o0 400080b0: 0a 80 00 09 bcs 400080d4 <== NEVER TAKEN 400080b4: 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); 400080b8: d2 07 60 18 ld [ %i5 + 0x18 ], %o1 400080bc: 40 00 30 fd call 400144b0 <.urem> 400080c0: 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 ) && 400080c4: 80 a0 00 08 cmp %g0, %o0 400080c8: 10 80 00 02 b 400080d0 400080cc: 82 60 3f ff subx %g0, -1, %g1 case OBJECTS_LOCAL: if ( _Partition_Is_buffer_valid( buffer, the_partition ) ) { 400080d0: 80 a0 60 00 cmp %g1, 0 400080d4: 02 80 00 0b be 40008100 400080d8: 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 ); 400080dc: 40 00 03 4b call 40008e08 <_Chain_Append> 400080e0: 92 10 00 19 mov %i1, %o1 _Partition_Free_buffer( the_partition, buffer ); the_partition->number_of_used_blocks -= 1; 400080e4: c2 07 60 20 ld [ %i5 + 0x20 ], %g1 _Objects_Put( &the_partition->Object ); return RTEMS_SUCCESSFUL; 400080e8: 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; 400080ec: 82 00 7f ff add %g1, -1, %g1 400080f0: 40 00 0a a5 call 4000ab84 <_Thread_Enable_dispatch> 400080f4: c2 27 60 20 st %g1, [ %i5 + 0x20 ] _Objects_Put( &the_partition->Object ); return RTEMS_SUCCESSFUL; 400080f8: 81 c7 e0 08 ret 400080fc: 81 e8 00 00 restore 40008100: 40 00 0a a1 call 4000ab84 <_Thread_Enable_dispatch> 40008104: b0 10 20 09 mov 9, %i0 } _Objects_Put( &the_partition->Object ); return RTEMS_INVALID_ADDRESS; 40008108: 81 c7 e0 08 ret 4000810c: 81 e8 00 00 restore case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 40008110: 81 c7 e0 08 ret 40008114: 91 e8 20 04 restore %g0, 4, %o0 =============================================================================== 40007300 : int rtems_pthread_attribute_compare( const pthread_attr_t *attr1, const pthread_attr_t *attr2 ) { 40007300: 9d e3 bf a0 save %sp, -96, %sp if ( attr1->is_initialized != attr2->is_initialized ) 40007304: c4 06 00 00 ld [ %i0 ], %g2 40007308: c2 06 40 00 ld [ %i1 ], %g1 4000730c: 80 a0 80 01 cmp %g2, %g1 40007310: 12 80 00 50 bne 40007450 <== NEVER TAKEN 40007314: 90 10 20 01 mov 1, %o0 return 1; if ( attr1->stackaddr != attr2->stackaddr ) 40007318: c4 06 20 04 ld [ %i0 + 4 ], %g2 4000731c: c2 06 60 04 ld [ %i1 + 4 ], %g1 40007320: 80 a0 80 01 cmp %g2, %g1 40007324: 12 80 00 4b bne 40007450 <== NEVER TAKEN 40007328: 01 00 00 00 nop return 1; if ( attr1->stacksize != attr2->stacksize ) 4000732c: c4 06 20 08 ld [ %i0 + 8 ], %g2 40007330: c2 06 60 08 ld [ %i1 + 8 ], %g1 40007334: 80 a0 80 01 cmp %g2, %g1 40007338: 12 80 00 46 bne 40007450 <== NEVER TAKEN 4000733c: 01 00 00 00 nop return 1; if ( attr1->contentionscope != attr2->contentionscope ) 40007340: c4 06 20 0c ld [ %i0 + 0xc ], %g2 40007344: c2 06 60 0c ld [ %i1 + 0xc ], %g1 40007348: 80 a0 80 01 cmp %g2, %g1 4000734c: 12 80 00 41 bne 40007450 <== NEVER TAKEN 40007350: 01 00 00 00 nop return 1; if ( attr1->inheritsched != attr2->inheritsched ) 40007354: c4 06 20 10 ld [ %i0 + 0x10 ], %g2 40007358: c2 06 60 10 ld [ %i1 + 0x10 ], %g1 4000735c: 80 a0 80 01 cmp %g2, %g1 40007360: 12 80 00 3c bne 40007450 <== NEVER TAKEN 40007364: 01 00 00 00 nop return 1; if ( attr1->schedpolicy != attr2->schedpolicy ) 40007368: c4 06 20 14 ld [ %i0 + 0x14 ], %g2 4000736c: c2 06 60 14 ld [ %i1 + 0x14 ], %g1 40007370: 80 a0 80 01 cmp %g2, %g1 40007374: 12 80 00 37 bne 40007450 <== NEVER TAKEN 40007378: 92 06 60 18 add %i1, 0x18, %o1 return 1; if (memcmp( 4000737c: 90 06 20 18 add %i0, 0x18, %o0 40007380: 40 00 26 49 call 40010ca4 40007384: 94 10 20 1c mov 0x1c, %o2 40007388: 80 a2 20 00 cmp %o0, 0 4000738c: 32 80 00 31 bne,a 40007450 <== NEVER TAKEN 40007390: 90 10 20 01 mov 1, %o0 <== NOT EXECUTED sizeof(struct sched_param) )) return 1; #if HAVE_DECL_PTHREAD_ATTR_SETGUARDSIZE if ( attr1->guardsize != attr2->guardsize ) 40007394: c4 06 20 34 ld [ %i0 + 0x34 ], %g2 40007398: c2 06 60 34 ld [ %i1 + 0x34 ], %g1 4000739c: 80 a0 80 01 cmp %g2, %g1 400073a0: 32 80 00 2c bne,a 40007450 <== NEVER TAKEN 400073a4: 90 10 20 01 mov 1, %o0 <== NOT EXECUTED return 1; #endif #if defined(_POSIX_THREAD_CPUTIME) if ( attr1->cputime_clock_allowed != attr2->cputime_clock_allowed ) 400073a8: c4 06 20 38 ld [ %i0 + 0x38 ], %g2 400073ac: c2 06 60 38 ld [ %i1 + 0x38 ], %g1 400073b0: 80 a0 80 01 cmp %g2, %g1 400073b4: 32 80 00 27 bne,a 40007450 <== NEVER TAKEN 400073b8: 90 10 20 01 mov 1, %o0 <== NOT EXECUTED return 1; #endif if ( attr1->detachstate != attr2->detachstate ) 400073bc: c4 06 20 3c ld [ %i0 + 0x3c ], %g2 400073c0: c2 06 60 3c ld [ %i1 + 0x3c ], %g1 400073c4: 80 a0 80 01 cmp %g2, %g1 400073c8: 32 80 00 22 bne,a 40007450 <== NEVER TAKEN 400073cc: 90 10 20 01 mov 1, %o0 <== NOT EXECUTED return 1; #if defined(__RTEMS_HAVE_SYS_CPUSET_H__) if ( attr1->affinitysetsize != attr2->affinitysetsize ) 400073d0: c4 06 20 40 ld [ %i0 + 0x40 ], %g2 400073d4: c2 06 60 40 ld [ %i1 + 0x40 ], %g1 400073d8: 80 a0 80 01 cmp %g2, %g1 400073dc: 32 80 00 1d bne,a 40007450 <== NEVER TAKEN 400073e0: 90 10 20 01 mov 1, %o0 <== NOT EXECUTED } static __inline int CPU_EQUAL_S(size_t setsize, const cpu_set_t *set1, const cpu_set_t *set2) { const cpu_set_word_t *w1 = &set1->__bits[0]; 400073e4: c8 06 20 44 ld [ %i0 + 0x44 ], %g4 const cpu_set_word_t *w2 = &set2->__bits[0]; 400073e8: fa 06 60 44 ld [ %i1 + 0x44 ], %i5 size_t n = setsize / sizeof(*w1); 400073ec: 85 30 a0 02 srl %g2, 2, %g2 size_t i; for (i = 0; i < n; ++i) 400073f0: 82 10 20 00 clr %g1 400073f4: 80 a0 40 02 cmp %g1, %g2 400073f8: 02 80 00 09 be 4000741c <== ALWAYS TAKEN 400073fc: 87 28 60 02 sll %g1, 2, %g3 if (w1[i] != w2[i]) 40007400: f8 01 00 03 ld [ %g4 + %g3 ], %i4 <== NOT EXECUTED 40007404: c6 07 40 03 ld [ %i5 + %g3 ], %g3 <== NOT EXECUTED 40007408: 80 a7 00 03 cmp %i4, %g3 <== NOT EXECUTED 4000740c: 02 bf ff fa be 400073f4 <== NOT EXECUTED 40007410: 82 00 60 01 inc %g1 <== NOT EXECUTED const pthread_attr_t *attr1, const pthread_attr_t *attr2 ) { if ( attr1->is_initialized != attr2->is_initialized ) return 1; 40007414: 10 80 00 0f b 40007450 <== NOT EXECUTED 40007418: 90 10 20 01 mov 1, %o0 <== NOT EXECUTED } static __inline int CPU_EQUAL_S(size_t setsize, const cpu_set_t *set1, const cpu_set_t *set2) { const cpu_set_word_t *w1 = &set1->__bits[0]; 4000741c: b0 06 20 48 add %i0, 0x48, %i0 const cpu_set_word_t *w2 = &set2->__bits[0]; 40007420: b2 06 60 48 add %i1, 0x48, %i1 size_t n = setsize / sizeof(*w1); size_t i; for (i = 0; i < n; ++i) 40007424: 82 10 20 00 clr %g1 40007428: 80 a0 40 02 cmp %g1, %g2 4000742c: 02 80 00 09 be 40007450 <== ALWAYS TAKEN 40007430: 87 28 60 02 sll %g1, 2, %g3 if (w1[i] != w2[i]) 40007434: c8 06 00 03 ld [ %i0 + %g3 ], %g4 <== NOT EXECUTED 40007438: c6 06 40 03 ld [ %i1 + %g3 ], %g3 <== NOT EXECUTED 4000743c: 80 a1 00 03 cmp %g4, %g3 <== NOT EXECUTED 40007440: 12 bf ff f5 bne 40007414 <== NOT EXECUTED 40007444: 82 00 60 01 inc %g1 <== NOT EXECUTED const cpu_set_word_t *w1 = &set1->__bits[0]; const cpu_set_word_t *w2 = &set2->__bits[0]; size_t n = setsize / sizeof(*w1); size_t i; for (i = 0; i < n; ++i) 40007448: 10 bf ff f9 b 4000742c <== NOT EXECUTED 4000744c: 80 a0 40 02 cmp %g1, %g2 <== NOT EXECUTED )) return 1; #endif return 0; } 40007450: 81 c7 e0 08 ret 40007454: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 40008370 : rtems_status_code rtems_rate_monotonic_period( rtems_id id, rtems_interval length ) { 40008370: 9d e3 bf 98 save %sp, -104, %sp RTEMS_INLINE_ROUTINE Rate_monotonic_Control *_Rate_monotonic_Get ( Objects_Id id, Objects_Locations *location ) { return (Rate_monotonic_Control *) 40008374: 11 10 00 68 sethi %hi(0x4001a000), %o0 40008378: 92 10 00 18 mov %i0, %o1 4000837c: 90 12 22 a0 or %o0, 0x2a0, %o0 40008380: 40 00 09 38 call 4000a860 <_Objects_Get> 40008384: 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 ) { 40008388: c2 07 bf fc ld [ %fp + -4 ], %g1 4000838c: 80 a0 60 00 cmp %g1, 0 40008390: 12 80 00 6c bne 40008540 40008394: ba 10 00 08 mov %o0, %i5 case OBJECTS_LOCAL: if ( !_Thread_Is_executing( the_period->owner ) ) { 40008398: c4 02 20 40 ld [ %o0 + 0x40 ], %g2 4000839c: c2 01 a0 18 ld [ %g6 + 0x18 ], %g1 400083a0: 80 a0 80 01 cmp %g2, %g1 400083a4: 02 80 00 06 be 400083bc 400083a8: 80 a6 60 00 cmp %i1, 0 RTEMS_INLINE_ROUTINE void _Objects_Put( Objects_Control *the_object ) { (void) the_object; _Thread_Enable_dispatch(); 400083ac: 40 00 0c a3 call 4000b638 <_Thread_Enable_dispatch> 400083b0: b0 10 20 17 mov 0x17, %i0 _Objects_Put( &the_period->Object ); return RTEMS_NOT_OWNER_OF_RESOURCE; 400083b4: 81 c7 e0 08 ret 400083b8: 81 e8 00 00 restore } if ( length == RTEMS_PERIOD_STATUS ) { 400083bc: 12 80 00 0f bne 400083f8 400083c0: 01 00 00 00 nop switch ( the_period->state ) { 400083c4: c2 02 20 38 ld [ %o0 + 0x38 ], %g1 400083c8: 80 a0 60 00 cmp %g1, 0 400083cc: 02 80 00 07 be 400083e8 400083d0: b0 10 20 0b mov 0xb, %i0 400083d4: 82 00 7f fd add %g1, -3, %g1 400083d8: 80 a0 60 01 cmp %g1, 1 400083dc: 18 80 00 03 bgu 400083e8 400083e0: b0 10 20 00 clr %i0 case RATE_MONOTONIC_INACTIVE: return_value = RTEMS_NOT_DEFINED; break; case RATE_MONOTONIC_EXPIRED: case RATE_MONOTONIC_EXPIRED_WHILE_BLOCKING: return_value = RTEMS_TIMEOUT; 400083e4: b0 10 20 06 mov 6, %i0 400083e8: 40 00 0c 94 call 4000b638 <_Thread_Enable_dispatch> 400083ec: 01 00 00 00 nop default: /* unreached -- only to remove warnings */ return_value = RTEMS_SUCCESSFUL; break; } _Objects_Put( &the_period->Object ); return( return_value ); 400083f0: 81 c7 e0 08 ret 400083f4: 81 e8 00 00 restore } _ISR_Disable( level ); 400083f8: 7f ff eb 3f call 400030f4 400083fc: 01 00 00 00 nop 40008400: b8 10 00 08 mov %o0, %i4 if ( the_period->state == RATE_MONOTONIC_INACTIVE ) { 40008404: c2 07 60 38 ld [ %i5 + 0x38 ], %g1 40008408: 80 a0 60 00 cmp %g1, 0 4000840c: 12 80 00 15 bne 40008460 40008410: 80 a0 60 02 cmp %g1, 2 _ISR_Enable( level ); 40008414: 7f ff eb 3b call 40003100 40008418: 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 ); 4000841c: 90 10 00 1d mov %i5, %o0 40008420: 7f ff ff b9 call 40008304 <_Rate_monotonic_Initiate_statistics> 40008424: f2 27 60 3c st %i1, [ %i5 + 0x3c ] the_period->state = RATE_MONOTONIC_ACTIVE; 40008428: 82 10 20 02 mov 2, %g1 4000842c: c2 27 60 38 st %g1, [ %i5 + 0x38 ] Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; the_watchdog->routine = routine; 40008430: 03 10 00 21 sethi %hi(0x40008400), %g1 40008434: 82 10 63 fc or %g1, 0x3fc, %g1 ! 400087fc <_Rate_monotonic_Timeout> Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 40008438: c0 27 60 18 clr [ %i5 + 0x18 ] the_watchdog->routine = routine; 4000843c: c2 27 60 2c st %g1, [ %i5 + 0x2c ] the_watchdog->id = id; 40008440: f0 27 60 30 st %i0, [ %i5 + 0x30 ] the_watchdog->user_data = user_data; 40008444: c0 27 60 34 clr [ %i5 + 0x34 ] Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 40008448: f2 27 60 1c st %i1, [ %i5 + 0x1c ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 4000844c: 11 10 00 69 sethi %hi(0x4001a400), %o0 40008450: 92 07 60 10 add %i5, 0x10, %o1 40008454: 40 00 11 0a call 4000c87c <_Watchdog_Insert> 40008458: 90 12 20 10 or %o0, 0x10, %o0 4000845c: 30 80 00 1c b,a 400084cc _Watchdog_Insert_ticks( &the_period->Timer, length ); _Objects_Put( &the_period->Object ); return RTEMS_SUCCESSFUL; } if ( the_period->state == RATE_MONOTONIC_ACTIVE ) { 40008460: 12 80 00 1f bne 400084dc 40008464: 80 a0 60 04 cmp %g1, 4 /* * Update statistics from the concluding period. */ _Rate_monotonic_Update_statistics( the_period ); 40008468: 7f ff ff 5e call 400081e0 <_Rate_monotonic_Update_statistics> 4000846c: 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; 40008470: 82 10 20 01 mov 1, %g1 the_period->next_length = length; 40008474: 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; 40008478: c2 27 60 38 st %g1, [ %i5 + 0x38 ] the_period->next_length = length; _ISR_Enable( level ); 4000847c: 7f ff eb 21 call 40003100 40008480: 90 10 00 1c mov %i4, %o0 _Thread_Executing->Wait.id = the_period->Object.id; 40008484: c2 07 60 08 ld [ %i5 + 8 ], %g1 40008488: d0 01 a0 18 ld [ %g6 + 0x18 ], %o0 _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 4000848c: 13 00 00 10 sethi %hi(0x4000), %o1 40008490: 40 00 0f c1 call 4000c394 <_Thread_Set_state> 40008494: c2 22 20 20 st %g1, [ %o0 + 0x20 ] /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); 40008498: 7f ff eb 17 call 400030f4 4000849c: 01 00 00 00 nop local_state = the_period->state; the_period->state = RATE_MONOTONIC_ACTIVE; 400084a0: 82 10 20 02 mov 2, %g1 ! 2 <_TLS_Alignment+0x1> /* * Did the watchdog timer expire while we were actually blocking * on it? */ _ISR_Disable( level ); local_state = the_period->state; 400084a4: f8 07 60 38 ld [ %i5 + 0x38 ], %i4 the_period->state = RATE_MONOTONIC_ACTIVE; 400084a8: c2 27 60 38 st %g1, [ %i5 + 0x38 ] _ISR_Enable( level ); 400084ac: 7f ff eb 15 call 40003100 400084b0: 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 ) 400084b4: 80 a7 20 03 cmp %i4, 3 400084b8: 12 80 00 05 bne 400084cc 400084bc: 01 00 00 00 nop _Thread_Clear_state( _Thread_Executing, STATES_WAITING_FOR_PERIOD ); 400084c0: d0 01 a0 18 ld [ %g6 + 0x18 ], %o0 400084c4: 40 00 0b b2 call 4000b38c <_Thread_Clear_state> 400084c8: 13 00 00 10 sethi %hi(0x4000), %o1 400084cc: 40 00 0c 5b call 4000b638 <_Thread_Enable_dispatch> 400084d0: b0 10 20 00 clr %i0 _Objects_Put( &the_period->Object ); return RTEMS_SUCCESSFUL; 400084d4: 81 c7 e0 08 ret 400084d8: 81 e8 00 00 restore } if ( the_period->state == RATE_MONOTONIC_EXPIRED ) { 400084dc: 12 bf ff b6 bne 400083b4 <== NEVER TAKEN 400084e0: b0 10 20 04 mov 4, %i0 /* * Update statistics from the concluding period */ _Rate_monotonic_Update_statistics( the_period ); 400084e4: 7f ff ff 3f call 400081e0 <_Rate_monotonic_Update_statistics> 400084e8: 90 10 00 1d mov %i5, %o0 _ISR_Enable( level ); 400084ec: 7f ff eb 05 call 40003100 400084f0: 90 10 00 1c mov %i4, %o0 the_period->state = RATE_MONOTONIC_ACTIVE; 400084f4: 82 10 20 02 mov 2, %g1 400084f8: 92 07 60 10 add %i5, 0x10, %o1 400084fc: c2 27 60 38 st %g1, [ %i5 + 0x38 ] the_period->next_length = length; 40008500: f2 27 60 3c st %i1, [ %i5 + 0x3c ] Watchdog_Control *the_watchdog, Watchdog_Interval units ) { the_watchdog->initial = units; 40008504: f2 27 60 1c st %i1, [ %i5 + 0x1c ] _Watchdog_Insert( &_Watchdog_Ticks_chain, the_watchdog ); 40008508: 11 10 00 69 sethi %hi(0x4001a400), %o0 4000850c: 40 00 10 dc call 4000c87c <_Watchdog_Insert> 40008510: 90 12 20 10 or %o0, 0x10, %o0 ! 4001a410 <_Watchdog_Ticks_chain> 40008514: d2 07 60 40 ld [ %i5 + 0x40 ], %o1 40008518: d4 07 60 3c ld [ %i5 + 0x3c ], %o2 4000851c: 11 10 00 5c sethi %hi(0x40017000), %o0 40008520: 90 12 21 34 or %o0, 0x134, %o0 ! 40017134 <_Scheduler_Table> 40008524: c2 02 20 2c ld [ %o0 + 0x2c ], %g1 40008528: 9f c0 40 00 call %g1 4000852c: b0 10 20 06 mov 6, %i0 40008530: 40 00 0c 42 call 4000b638 <_Thread_Enable_dispatch> 40008534: 01 00 00 00 nop _Scheduler_Get( the_period->owner ), the_period->owner, the_period->next_length ); _Objects_Put( &the_period->Object ); return RTEMS_TIMEOUT; 40008538: 81 c7 e0 08 ret 4000853c: 81 e8 00 00 restore #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 40008540: b0 10 20 04 mov 4, %i0 } 40008544: 81 c7 e0 08 ret 40008548: 81 e8 00 00 restore =============================================================================== 4000854c : void rtems_rate_monotonic_report_statistics_with_plugin( void *context, rtems_printk_plugin_t print ) { 4000854c: 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 ) 40008550: 80 a6 60 00 cmp %i1, 0 40008554: 02 80 00 76 be 4000872c <== NEVER TAKEN 40008558: 90 10 00 18 mov %i0, %o0 return; (*print)( context, "Period information by period\n" ); 4000855c: 13 10 00 5e sethi %hi(0x40017800), %o1 40008560: 9f c6 40 00 call %i1 40008564: 92 12 62 18 or %o1, 0x218, %o1 ! 40017a18 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ (*print)( context, "--- CPU times are in seconds ---\n" ); 40008568: 90 10 00 18 mov %i0, %o0 4000856c: 13 10 00 5e sethi %hi(0x40017800), %o1 40008570: 9f c6 40 00 call %i1 40008574: 92 12 62 38 or %o1, 0x238, %o1 ! 40017a38 (*print)( context, "--- Wall times are in seconds ---\n" ); 40008578: 90 10 00 18 mov %i0, %o0 4000857c: 13 10 00 5e sethi %hi(0x40017800), %o1 40008580: 9f c6 40 00 call %i1 40008584: 92 12 62 60 or %o1, 0x260, %o1 ! 40017a60 Be sure to test the various cases. (*print)( context,"\ 1234567890123456789012345678901234567890123456789012345678901234567890123456789\ \n"); */ (*print)( context, " ID OWNER COUNT MISSED " 40008588: 90 10 00 18 mov %i0, %o0 4000858c: 13 10 00 5e sethi %hi(0x40017800), %o1 40008590: 9f c6 40 00 call %i1 40008594: 92 12 62 88 or %o1, 0x288, %o1 ! 40017a88 #ifndef __RTEMS_USE_TICKS_FOR_STATISTICS__ " " #endif " WALL TIME\n" ); (*print)( context, " " 40008598: 90 10 00 18 mov %i0, %o0 4000859c: 13 10 00 5e sethi %hi(0x40017800), %o1 400085a0: 9f c6 40 00 call %i1 400085a4: 92 12 62 d8 or %o1, 0x2d8, %o1 ! 40017ad8 /* * 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 ; 400085a8: 03 10 00 68 sethi %hi(0x4001a000), %g1 400085ac: 82 10 62 a0 or %g1, 0x2a0, %g1 ! 4001a2a0 <_Rate_monotonic_Information> 400085b0: fa 00 60 08 ld [ %g1 + 8 ], %i5 rtems_object_get_name( the_status.owner, sizeof(name), name ); /* * Print part of report line that is not dependent on granularity */ (*print)( context, 400085b4: 37 10 00 5e sethi %hi(0x40017800), %i3 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, 400085b8: 35 10 00 5e sethi %hi(0x40017800), %i2 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, 400085bc: 21 10 00 5e sethi %hi(0x40017800), %l0 /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { (*print)( context, "\n" ); 400085c0: 23 10 00 5b sethi %hi(0x40016c00), %l1 400085c4: b8 10 00 01 mov %g1, %i4 rtems_object_get_name( the_status.owner, sizeof(name), name ); /* * Print part of report line that is not dependent on granularity */ (*print)( context, 400085c8: b6 16 e3 28 or %i3, 0x328, %i3 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, 400085cc: b4 16 a3 40 or %i2, 0x340, %i2 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, 400085d0: a0 14 23 60 or %l0, 0x360, %l0 /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { (*print)( context, "\n" ); 400085d4: a2 14 63 d8 or %l1, 0x3d8, %l1 /* * 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 ; 400085d8: c2 07 20 0c ld [ %i4 + 0xc ], %g1 400085dc: 80 a7 40 01 cmp %i5, %g1 400085e0: 18 80 00 53 bgu 4000872c 400085e4: 90 10 00 1d mov %i5, %o0 id <= _Rate_monotonic_Information.maximum_id ; id++ ) { status = rtems_rate_monotonic_get_statistics( id, &the_stats ); 400085e8: 40 00 18 d5 call 4000e93c 400085ec: 92 07 bf c8 add %fp, -56, %o1 if ( status != RTEMS_SUCCESSFUL ) 400085f0: 80 a2 20 00 cmp %o0, 0 400085f4: 32 bf ff f9 bne,a 400085d8 400085f8: 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 ); 400085fc: 92 07 bf b0 add %fp, -80, %o1 40008600: 40 00 19 40 call 4000eb00 40008604: 90 10 00 1d mov %i5, %o0 #endif rtems_object_get_name( the_status.owner, sizeof(name), name ); 40008608: d0 07 bf b0 ld [ %fp + -80 ], %o0 4000860c: 92 10 20 05 mov 5, %o1 40008610: 40 00 00 a8 call 400088b0 40008614: 94 07 bf a0 add %fp, -96, %o2 /* * Print part of report line that is not dependent on granularity */ (*print)( context, 40008618: d8 1f bf c8 ldd [ %fp + -56 ], %o4 4000861c: 92 10 00 1b mov %i3, %o1 40008620: 90 10 00 18 mov %i0, %o0 40008624: 94 10 00 1d mov %i5, %o2 40008628: 9f c6 40 00 call %i1 4000862c: 96 07 bf a0 add %fp, -96, %o3 ); /* * If the count is zero, don't print statistics */ if (the_stats.count == 0) { 40008630: d2 07 bf c8 ld [ %fp + -56 ], %o1 40008634: 80 a2 60 00 cmp %o1, 0 40008638: 12 80 00 07 bne 40008654 4000863c: 94 07 bf a8 add %fp, -88, %o2 (*print)( context, "\n" ); 40008640: 90 10 00 18 mov %i0, %o0 40008644: 9f c6 40 00 call %i1 40008648: 92 10 00 11 mov %l1, %o1 continue; 4000864c: 10 bf ff e3 b 400085d8 40008650: 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 ); 40008654: 40 00 0f b1 call 4000c518 <_Timespec_Divide_by_integer> 40008658: 90 07 bf e0 add %fp, -32, %o0 (*print)( context, 4000865c: d0 07 bf d4 ld [ %fp + -44 ], %o0 40008660: 40 00 32 36 call 40014f38 <.div> 40008664: 92 10 23 e8 mov 0x3e8, %o1 40008668: a8 10 00 08 mov %o0, %l4 4000866c: d0 07 bf dc ld [ %fp + -36 ], %o0 40008670: 40 00 32 32 call 40014f38 <.div> 40008674: 92 10 23 e8 mov 0x3e8, %o1 40008678: c2 07 bf a8 ld [ %fp + -88 ], %g1 4000867c: a4 10 00 08 mov %o0, %l2 40008680: d0 07 bf ac ld [ %fp + -84 ], %o0 40008684: ea 07 bf d0 ld [ %fp + -48 ], %l5 40008688: e6 07 bf d8 ld [ %fp + -40 ], %l3 4000868c: c2 23 a0 5c st %g1, [ %sp + 0x5c ] 40008690: 40 00 32 2a call 40014f38 <.div> 40008694: 92 10 23 e8 mov 0x3e8, %o1 40008698: 96 10 00 14 mov %l4, %o3 4000869c: 98 10 00 13 mov %l3, %o4 400086a0: 9a 10 00 12 mov %l2, %o5 400086a4: 94 10 00 15 mov %l5, %o2 400086a8: d0 23 a0 60 st %o0, [ %sp + 0x60 ] 400086ac: 92 10 00 1a mov %i2, %o1 400086b0: 9f c6 40 00 call %i1 400086b4: 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); 400086b8: d2 07 bf c8 ld [ %fp + -56 ], %o1 400086bc: 94 07 bf a8 add %fp, -88, %o2 400086c0: 40 00 0f 96 call 4000c518 <_Timespec_Divide_by_integer> 400086c4: 90 07 bf f8 add %fp, -8, %o0 (*print)( context, 400086c8: d0 07 bf ec ld [ %fp + -20 ], %o0 400086cc: 40 00 32 1b call 40014f38 <.div> 400086d0: 92 10 23 e8 mov 0x3e8, %o1 400086d4: a8 10 00 08 mov %o0, %l4 400086d8: d0 07 bf f4 ld [ %fp + -12 ], %o0 400086dc: 40 00 32 17 call 40014f38 <.div> 400086e0: 92 10 23 e8 mov 0x3e8, %o1 400086e4: c2 07 bf a8 ld [ %fp + -88 ], %g1 400086e8: a4 10 00 08 mov %o0, %l2 400086ec: d0 07 bf ac ld [ %fp + -84 ], %o0 400086f0: ea 07 bf e8 ld [ %fp + -24 ], %l5 400086f4: e6 07 bf f0 ld [ %fp + -16 ], %l3 400086f8: 92 10 23 e8 mov 0x3e8, %o1 400086fc: 40 00 32 0f call 40014f38 <.div> 40008700: c2 23 a0 5c st %g1, [ %sp + 0x5c ] 40008704: 92 10 00 10 mov %l0, %o1 40008708: d0 23 a0 60 st %o0, [ %sp + 0x60 ] 4000870c: 94 10 00 15 mov %l5, %o2 40008710: 90 10 00 18 mov %i0, %o0 40008714: 96 10 00 14 mov %l4, %o3 40008718: 98 10 00 13 mov %l3, %o4 4000871c: 9f c6 40 00 call %i1 40008720: 9a 10 00 12 mov %l2, %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++ ) { 40008724: 10 bf ff ad b 400085d8 40008728: ba 07 60 01 inc %i5 4000872c: 81 c7 e0 08 ret 40008730: 81 e8 00 00 restore =============================================================================== 40008874 : return big_enough; } void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size) { 40008874: 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; 40008878: 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; 4000887c: 90 10 00 19 mov %i1, %o0 40008880: 92 10 00 1d mov %i5, %o1 40008884: 40 00 2f 9b call 400146f0 <.urem> 40008888: b6 10 00 19 mov %i1, %i3 if (excess > 0) { 4000888c: 80 a2 20 00 cmp %o0, 0 40008890: 02 80 00 05 be 400088a4 40008894: 80 a6 c0 19 cmp %i3, %i1 value += alignment - excess; 40008898: b6 06 40 1d add %i1, %i5, %i3 4000889c: b6 26 c0 08 sub %i3, %o0, %i3 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) { 400088a0: 80 a6 c0 19 cmp %i3, %i1 400088a4: 0a 80 00 04 bcs 400088b4 <== NEVER TAKEN 400088a8: 80 a6 60 00 cmp %i1, 0 400088ac: 32 80 00 04 bne,a 400088bc 400088b0: c2 06 00 00 ld [ %i0 ], %g1 return big_enough; } void *rtems_rbheap_allocate(rtems_rbheap_control *control, size_t size) { void *ptr = NULL; 400088b4: 81 c7 e0 08 ret 400088b8: 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); 400088bc: 84 06 20 04 add %i0, 4, %g2 rtems_rbheap_chunk *big_enough = NULL; 400088c0: ba 10 20 00 clr %i5 while (current != tail && big_enough == NULL) { 400088c4: 80 a7 60 00 cmp %i5, 0 400088c8: 12 80 00 0a bne 400088f0 400088cc: 80 a0 40 02 cmp %g1, %g2 400088d0: 02 80 00 09 be 400088f4 400088d4: 80 a7 60 00 cmp %i5, 0 rtems_rbheap_chunk *free_chunk = (rtems_rbheap_chunk *) current; if (free_chunk->size >= size) { 400088d8: c6 00 60 1c ld [ %g1 + 0x1c ], %g3 400088dc: 80 a0 c0 1b cmp %g3, %i3 400088e0: ba 40 3f ff addx %g0, -1, %i5 400088e4: ba 08 40 1d and %g1, %i5, %i5 * @param[in] the_node is the node to be operated upon. * * @return This method returns the next node on the chain. */ RTEMS_INLINE_ROUTINE rtems_chain_node *rtems_chain_next( rtems_chain_node *the_node 400088e8: 10 bf ff f7 b 400088c4 400088ec: c2 00 40 00 ld [ %g1 ], %g1 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) { 400088f0: 80 a7 60 00 cmp %i5, 0 400088f4: 02 bf ff f0 be 400088b4 400088f8: 01 00 00 00 nop uintptr_t free_size = free_chunk->size; 400088fc: f4 07 60 1c ld [ %i5 + 0x1c ], %i2 if (free_size > aligned_size) { 40008900: 80 a6 80 1b cmp %i2, %i3 40008904: 28 80 00 13 bleu,a 40008950 40008908: c4 07 40 00 ld [ %i5 ], %g2 rtems_rbheap_chunk *new_chunk = get_chunk(control); 4000890c: 7f ff ff 5c call 4000867c 40008910: 90 10 00 18 mov %i0, %o0 if (new_chunk != NULL) { 40008914: b8 92 20 00 orcc %o0, 0, %i4 40008918: 02 bf ff e7 be 400088b4 4000891c: 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; 40008920: 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; 40008924: f4 27 60 1c st %i2, [ %i5 + 0x1c ] new_chunk->begin = free_chunk->begin + new_free_size; new_chunk->size = aligned_size; 40008928: 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; 4000892c: b4 06 80 01 add %i2, %g1, %i2 */ RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain( Chain_Node *node ) { node->next = NULL; 40008930: c0 27 00 00 clr [ %i4 ] 40008934: f4 27 20 18 st %i2, [ %i4 + 0x18 ] static void insert_into_tree( rtems_rbtree_control *tree, rtems_rbheap_chunk *chunk ) { _RBTree_Insert(tree, &chunk->tree_node); 40008938: 90 06 20 18 add %i0, 0x18, %o0 4000893c: 40 00 06 ed call 4000a4f0 <_RBTree_Insert> 40008940: 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; 40008944: f0 07 20 18 ld [ %i4 + 0x18 ], %i0 40008948: 81 c7 e0 08 ret 4000894c: 81 e8 00 00 restore { Chain_Node *next; Chain_Node *previous; next = the_node->next; previous = the_node->previous; 40008950: 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; 40008954: f0 07 60 18 ld [ %i5 + 0x18 ], %i0 next->previous = previous; 40008958: c2 20 a0 04 st %g1, [ %g2 + 4 ] previous->next = next; 4000895c: c4 20 40 00 st %g2, [ %g1 ] */ RTEMS_INLINE_ROUTINE void _Chain_Set_off_chain( Chain_Node *node ) { node->next = NULL; 40008960: c0 27 40 00 clr [ %i5 ] } } } return ptr; } 40008964: 81 c7 e0 08 ret 40008968: 81 e8 00 00 restore =============================================================================== 40007f0c : rtems_id *id ) { rtems_status_code sc; if ( id != NULL ) { 40007f0c: 80 a2 60 00 cmp %o1, 0 40007f10: 02 80 00 13 be 40007f5c 40007f14: 82 10 20 09 mov 9, %g1 sc = RTEMS_INVALID_NAME; for ( i = 0 ; i < n && sc == RTEMS_INVALID_NAME ; ++i ) { const Scheduler_Control *scheduler = &_Scheduler_Table[ i ]; if ( scheduler->name == name ) { 40007f18: 03 10 00 59 sethi %hi(0x40016400), %g1 if ( _Scheduler_Get_processor_count( scheduler ) > 0 ) { *id = _Scheduler_Build_id( i ); 40007f1c: 09 03 c0 40 sethi %hi(0xf010000), %g4 sc = RTEMS_INVALID_NAME; for ( i = 0 ; i < n && sc == RTEMS_INVALID_NAME ; ++i ) { const Scheduler_Control *scheduler = &_Scheduler_Table[ i ]; if ( scheduler->name == name ) { 40007f20: c6 00 61 b4 ld [ %g1 + 0x1b4 ], %g3 40007f24: 84 10 20 00 clr %g2 40007f28: 82 10 20 03 mov 3, %g1 if ( _Scheduler_Get_processor_count( scheduler ) > 0 ) { *id = _Scheduler_Build_id( i ); 40007f2c: 88 11 20 01 or %g4, 1, %g4 size_t n = _Scheduler_Count; size_t i; sc = RTEMS_INVALID_NAME; for ( i = 0 ; i < n && sc == RTEMS_INVALID_NAME ; ++i ) { 40007f30: 80 a0 a0 00 cmp %g2, 0 40007f34: 12 80 00 0a bne 40007f5c 40007f38: 80 a0 60 03 cmp %g1, 3 40007f3c: 12 80 00 08 bne 40007f5c <== NEVER TAKEN 40007f40: 80 a0 c0 08 cmp %g3, %o0 const Scheduler_Control *scheduler = &_Scheduler_Table[ i ]; if ( scheduler->name == name ) { 40007f44: 12 80 00 04 bne 40007f54 40007f48: 82 10 20 03 mov 3, %g1 if ( _Scheduler_Get_processor_count( scheduler ) > 0 ) { *id = _Scheduler_Build_id( i ); 40007f4c: c8 22 40 00 st %g4, [ %o1 ] sc = RTEMS_SUCCESSFUL; 40007f50: 82 10 20 00 clr %g1 size_t n = _Scheduler_Count; size_t i; sc = RTEMS_INVALID_NAME; for ( i = 0 ; i < n && sc == RTEMS_INVALID_NAME ; ++i ) { 40007f54: 10 bf ff f7 b 40007f30 40007f58: 84 10 20 01 mov 1, %g2 } else { sc = RTEMS_INVALID_ADDRESS; } return sc; } 40007f5c: 81 c3 e0 08 retl 40007f60: 90 10 00 01 mov %g1, %o0 =============================================================================== 4000888c : rtems_status_code rtems_signal_send( rtems_id id, rtems_signal_set signal_set ) { 4000888c: 9d e3 bf 98 save %sp, -104, %sp Thread_Control *the_thread; Objects_Locations location; RTEMS_API_Control *api; ASR_Information *asr; if ( !signal_set ) 40008890: 80 a6 60 00 cmp %i1, 0 40008894: 02 80 00 41 be 40008998 40008898: 82 10 20 0a mov 0xa, %g1 return RTEMS_INVALID_NUMBER; the_thread = _Thread_Get( id, &location ); 4000889c: 90 10 00 18 mov %i0, %o0 400088a0: 40 00 0a 4d call 4000b1d4 <_Thread_Get> 400088a4: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 400088a8: c2 07 bf fc ld [ %fp + -4 ], %g1 400088ac: 80 a0 60 00 cmp %g1, 0 400088b0: 12 80 00 39 bne 40008994 400088b4: b8 10 00 08 mov %o0, %i4 case OBJECTS_LOCAL: api = the_thread->API_Extensions[ THREAD_API_RTEMS ]; 400088b8: fa 02 21 2c ld [ %o0 + 0x12c ], %i5 asr = &api->Signal; if ( ! _ASR_Is_null_handler( asr->handler ) ) { 400088bc: c2 07 60 0c ld [ %i5 + 0xc ], %g1 400088c0: 80 a0 60 00 cmp %g1, 0 400088c4: 02 80 00 30 be 40008984 400088c8: 01 00 00 00 nop if ( asr->is_enabled ) { 400088cc: c2 0f 60 08 ldub [ %i5 + 8 ], %g1 400088d0: 80 a0 60 00 cmp %g1, 0 400088d4: 02 80 00 21 be 40008958 400088d8: 01 00 00 00 nop { #if defined( RTEMS_SMP ) _SMP_lock_ISR_disable_and_acquire( &lock->lock, &context->lock_context ); #else (void) lock; _ISR_Disable( context->isr_level ); 400088dc: 7f ff ea be call 400033d4 400088e0: 01 00 00 00 nop ) { ISR_lock_Context lock_context; _ISR_lock_ISR_disable_and_acquire( &asr->Lock, &lock_context ); *signal_set |= signals; 400088e4: c2 07 60 14 ld [ %i5 + 0x14 ], %g1 400088e8: b2 10 40 19 or %g1, %i1, %i1 400088ec: f2 27 60 14 st %i1, [ %i5 + 0x14 ] { #if defined( RTEMS_SMP ) _SMP_lock_Release_and_ISR_enable( &lock->lock, &context->lock_context ); #else (void) lock; _ISR_Enable( context->isr_level ); 400088f0: 7f ff ea bc call 400033e0 400088f4: 01 00 00 00 nop ISR_Level *level ) { Per_CPU_Control *cpu; _ISR_Disable_without_giant( *level ); 400088f8: 7f ff ea b7 call 400033d4 400088fc: 01 00 00 00 nop RTEMS_INLINE_ROUTINE void _Chain_Append_if_is_off_chain_unprotected( Chain_Control *the_chain, Chain_Node *the_node ) { if ( _Chain_Is_node_off_chain( the_node ) ) { 40008900: c2 07 60 20 ld [ %i5 + 0x20 ], %g1 40008904: 80 a0 60 00 cmp %g1, 0 40008908: 12 80 00 08 bne 40008928 4000890c: 86 07 20 c8 add %i4, 0xc8, %g3 Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; 40008910: c2 07 20 cc ld [ %i4 + 0xcc ], %g1 the_node->next = tail; 40008914: c6 27 60 20 st %g3, [ %i5 + 0x20 ] { Per_CPU_Control *cpu; ISR_Level level; cpu = _Thread_Action_ISR_disable_and_acquire( thread, &level ); _Chain_Append_if_is_off_chain_unprotected( 40008918: 84 07 60 20 add %i5, 0x20, %g2 tail->previous = the_node; 4000891c: c4 27 20 cc st %g2, [ %i4 + 0xcc ] old_last->next = the_node; 40008920: c4 20 40 00 st %g2, [ %g1 ] the_node->previous = old_last; 40008924: c2 27 60 24 st %g1, [ %i5 + 0x24 ] RTEMS_INLINE_ROUTINE void _Thread_Action_release_and_ISR_enable( Per_CPU_Control *cpu, ISR_Level level ) { _Per_CPU_Release_and_ISR_enable( cpu, level ); 40008928: 7f ff ea ae call 400033e0 4000892c: 01 00 00 00 nop #endif } RTEMS_INLINE_ROUTINE void _Thread_Signal_notification( Thread_Control *thread ) { if ( _ISR_Is_in_progress() && _Thread_Is_executing( thread ) ) { 40008930: c4 01 a0 0c ld [ %g6 + 0xc ], %g2 40008934: 80 a0 a0 00 cmp %g2, 0 40008938: 02 80 00 0f be 40008974 4000893c: 01 00 00 00 nop 40008940: c4 01 a0 18 ld [ %g6 + 0x18 ], %g2 40008944: 80 a7 00 02 cmp %i4, %g2 40008948: 12 80 00 0b bne 40008974 <== NEVER TAKEN 4000894c: 84 10 20 01 mov 1, %g2 _Thread_Dispatch_necessary = true; 40008950: c4 29 a0 14 stb %g2, [ %g6 + 0x14 ] 40008954: 30 80 00 08 b,a 40008974 { #if defined( RTEMS_SMP ) _SMP_lock_ISR_disable_and_acquire( &lock->lock, &context->lock_context ); #else (void) lock; _ISR_Disable( context->isr_level ); 40008958: 7f ff ea 9f call 400033d4 4000895c: 01 00 00 00 nop 40008960: c2 07 60 18 ld [ %i5 + 0x18 ], %g1 40008964: b2 10 40 19 or %g1, %i1, %i1 40008968: f2 27 60 18 st %i1, [ %i5 + 0x18 ] { #if defined( RTEMS_SMP ) _SMP_lock_Release_and_ISR_enable( &lock->lock, &context->lock_context ); #else (void) lock; _ISR_Enable( context->isr_level ); 4000896c: 7f ff ea 9d call 400033e0 40008970: 01 00 00 00 nop 40008974: 40 00 0a 0d call 4000b1a8 <_Thread_Enable_dispatch> 40008978: 01 00 00 00 nop _Thread_Signal_notification( the_thread ); } else { _ASR_Post_signals( asr, signal_set, &asr->signals_pending ); } _Objects_Put( &the_thread->Object ); return RTEMS_SUCCESSFUL; 4000897c: 10 80 00 07 b 40008998 40008980: 82 10 20 00 clr %g1 ! 0 <_TLS_BSS_size> 40008984: 40 00 0a 09 call 4000b1a8 <_Thread_Enable_dispatch> 40008988: 01 00 00 00 nop } _Objects_Put( &the_thread->Object ); return RTEMS_NOT_DEFINED; 4000898c: 10 80 00 03 b 40008998 40008990: 82 10 20 0b mov 0xb, %g1 ! b <_TLS_Alignment+0xa> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 40008994: 82 10 20 04 mov 4, %g1 } 40008998: 81 c7 e0 08 ret 4000899c: 91 e8 00 01 restore %g0, %g1, %o0 =============================================================================== 4000d0c4 : [RTEMS_IO_ERROR] = EIO, [RTEMS_PROXY_BLOCKING] = EIO }; int rtems_status_code_to_errno(rtems_status_code sc) { 4000d0c4: 9d e3 bf a0 save %sp, -96, %sp if (sc == RTEMS_SUCCESSFUL) { 4000d0c8: 80 a6 20 00 cmp %i0, 0 4000d0cc: 02 80 00 0d be 4000d100 4000d0d0: 82 10 20 00 clr %g1 return 0; } else { int eno = EINVAL; if ((unsigned) sc <= RTEMS_STATUS_CODES_LAST) { 4000d0d4: 80 a6 20 1c cmp %i0, 0x1c 4000d0d8: 18 80 00 06 bgu 4000d0f0 <== NEVER TAKEN 4000d0dc: ba 10 20 16 mov 0x16, %i5 eno = status_code_to_errno [sc]; 4000d0e0: b1 2e 20 02 sll %i0, 2, %i0 4000d0e4: 03 10 00 59 sethi %hi(0x40016400), %g1 4000d0e8: 82 10 60 bc or %g1, 0xbc, %g1 ! 400164bc 4000d0ec: fa 00 40 18 ld [ %g1 + %i0 ], %i5 } errno = eno; 4000d0f0: 40 00 0a 4c call 4000fa20 <__errno> 4000d0f4: 01 00 00 00 nop return -1; 4000d0f8: 82 10 3f ff mov -1, %g1 ! ffffffff if ((unsigned) sc <= RTEMS_STATUS_CODES_LAST) { eno = status_code_to_errno [sc]; } errno = eno; 4000d0fc: fa 22 00 00 st %i5, [ %o0 ] return -1; } } 4000d100: 81 c7 e0 08 ret 4000d104: 91 e8 00 01 restore %g0, %g1, %o0 =============================================================================== 4000efdc : rtems_status_code rtems_task_mode( rtems_mode mode_set, rtems_mode mask, rtems_mode *previous_mode_set ) { 4000efdc: 9d e3 bf a0 save %sp, -96, %sp RTEMS_API_Control *api; ASR_Information *asr; bool needs_asr_dispatching; rtems_mode old_mode; if ( !previous_mode_set ) 4000efe0: 80 a6 a0 00 cmp %i2, 0 4000efe4: 02 80 00 65 be 4000f178 4000efe8: 82 10 20 09 mov 9, %g1 4000efec: fa 01 a0 18 ld [ %g6 + 0x18 ], %i5 executing = _Thread_Get_executing(); api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 4000eff0: c2 0f 60 70 ldub [ %i5 + 0x70 ], %g1 if ( !previous_mode_set ) return RTEMS_INVALID_ADDRESS; executing = _Thread_Get_executing(); api = executing->API_Extensions[ THREAD_API_RTEMS ]; 4000eff4: f8 07 61 2c ld [ %i5 + 0x12c ], %i4 asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 4000eff8: 80 a0 00 01 cmp %g0, %g1 if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) 4000effc: c2 07 60 78 ld [ %i5 + 0x78 ], %g1 executing = _Thread_Get_executing(); api = executing->API_Extensions[ THREAD_API_RTEMS ]; asr = &api->Signal; old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT; 4000f000: b6 60 3f ff subx %g0, -1, %i3 if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE ) 4000f004: 80 a0 60 00 cmp %g1, 0 4000f008: 02 80 00 03 be 4000f014 4000f00c: b7 2e e0 08 sll %i3, 8, %i3 old_mode |= RTEMS_NO_TIMESLICE; else old_mode |= RTEMS_TIMESLICE; 4000f010: b6 16 e2 00 or %i3, 0x200, %i3 old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR; 4000f014: c2 0f 20 08 ldub [ %i4 + 8 ], %g1 4000f018: 80 a0 00 01 cmp %g0, %g1 old_mode |= _ISR_Get_level(); 4000f01c: 7f ff f0 fe call 4000b414 <_CPU_ISR_Get_level> 4000f020: 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; 4000f024: a1 2c 20 0a sll %l0, 0xa, %l0 4000f028: 90 14 00 08 or %l0, %o0, %o0 old_mode |= _ISR_Get_level(); 4000f02c: b6 12 00 1b or %o0, %i3, %i3 *previous_mode_set = old_mode; /* * These are generic thread scheduling characteristics. */ if ( mask & RTEMS_PREEMPT_MASK ) { 4000f030: 80 8e 61 00 btst 0x100, %i1 4000f034: 02 80 00 06 be 4000f04c 4000f038: 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; 4000f03c: 83 36 20 08 srl %i0, 8, %g1 4000f040: 82 18 60 01 xor %g1, 1, %g1 4000f044: 82 08 60 01 and %g1, 1, %g1 !_Modes_Is_preempt( mode_set ) ) { return RTEMS_NOT_IMPLEMENTED; } #endif executing->is_preemptible = _Modes_Is_preempt( mode_set ); 4000f048: c2 2f 60 70 stb %g1, [ %i5 + 0x70 ] } if ( mask & RTEMS_TIMESLICE_MASK ) { 4000f04c: 80 8e 62 00 btst 0x200, %i1 4000f050: 02 80 00 0b be 4000f07c 4000f054: 80 8e 60 0f btst 0xf, %i1 if ( _Modes_Is_timeslice(mode_set) ) { 4000f058: 80 8e 22 00 btst 0x200, %i0 4000f05c: 22 80 00 07 be,a 4000f078 4000f060: c0 27 60 78 clr [ %i5 + 0x78 ] executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; 4000f064: 82 10 20 01 mov 1, %g1 4000f068: c2 27 60 78 st %g1, [ %i5 + 0x78 ] executing->cpu_time_budget = rtems_configuration_get_ticks_per_timeslice(); 4000f06c: 03 10 00 55 sethi %hi(0x40015400), %g1 } if ( mask & RTEMS_TIMESLICE_MASK ) { if ( _Modes_Is_timeslice(mode_set) ) { executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE; executing->cpu_time_budget = 4000f070: c2 00 61 a4 ld [ %g1 + 0x1a4 ], %g1 ! 400155a4 4000f074: c2 27 60 74 st %g1, [ %i5 + 0x74 ] } /* * Set the new interrupt level */ if ( mask & RTEMS_INTERRUPT_MASK ) 4000f078: 80 8e 60 0f btst 0xf, %i1 4000f07c: 02 80 00 06 be 4000f094 4000f080: 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 ); 4000f084: 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 ) ); 4000f088: 7f ff cc ee call 40002440 4000f08c: 91 2a 20 08 sll %o0, 8, %o0 /* * This is specific to the RTEMS API */ needs_asr_dispatching = false; if ( mask & RTEMS_ASR_MASK ) { 4000f090: 80 8e 64 00 btst 0x400, %i1 4000f094: 32 80 00 04 bne,a 4000f0a4 4000f098: c2 0f 20 08 ldub [ %i4 + 8 ], %g1 _Modes_Set_interrupt_level( mode_set ); /* * This is specific to the RTEMS API */ needs_asr_dispatching = false; 4000f09c: 10 80 00 23 b 4000f128 4000f0a0: 86 10 20 00 clr %g3 if ( mask & RTEMS_ASR_MASK ) { bool is_asr_enabled = !_Modes_Is_asr_disabled( mode_set ); 4000f0a4: b1 36 20 0a srl %i0, 0xa, %i0 4000f0a8: b0 1e 20 01 xor %i0, 1, %i0 4000f0ac: b0 0e 20 01 and %i0, 1, %i0 if ( is_asr_enabled != asr->is_enabled ) { 4000f0b0: 80 a6 00 01 cmp %i0, %g1 4000f0b4: 02 80 00 1d be 4000f128 4000f0b8: 86 10 20 00 clr %g3 { #if defined( RTEMS_SMP ) _SMP_lock_ISR_disable_and_acquire( &lock->lock, &context->lock_context ); #else (void) lock; _ISR_Disable( context->isr_level ); 4000f0bc: 7f ff cc de call 40002434 4000f0c0: f0 2f 20 08 stb %i0, [ %i4 + 8 ] { rtems_signal_set _signals; ISR_lock_Context lock_context; _ISR_lock_ISR_disable_and_acquire( &asr->Lock, &lock_context ); _signals = asr->signals_pending; 4000f0c4: c2 07 20 18 ld [ %i4 + 0x18 ], %g1 asr->signals_pending = asr->signals_posted; 4000f0c8: c4 07 20 14 ld [ %i4 + 0x14 ], %g2 asr->signals_posted = _signals; 4000f0cc: c2 27 20 14 st %g1, [ %i4 + 0x14 ] rtems_signal_set _signals; ISR_lock_Context lock_context; _ISR_lock_ISR_disable_and_acquire( &asr->Lock, &lock_context ); _signals = asr->signals_pending; asr->signals_pending = asr->signals_posted; 4000f0d0: c4 27 20 18 st %g2, [ %i4 + 0x18 ] { #if defined( RTEMS_SMP ) _SMP_lock_Release_and_ISR_enable( &lock->lock, &context->lock_context ); #else (void) lock; _ISR_Enable( context->isr_level ); 4000f0d4: 7f ff cc db call 40002440 4000f0d8: 01 00 00 00 nop asr->is_enabled = is_asr_enabled; _ASR_Swap_signals( asr ); if ( _ASR_Are_signals_pending( asr ) ) { 4000f0dc: c2 07 20 14 ld [ %i4 + 0x14 ], %g1 4000f0e0: 80 a0 60 00 cmp %g1, 0 4000f0e4: 02 80 00 11 be 4000f128 4000f0e8: 86 10 20 00 clr %g3 ISR_Level *level ) { Per_CPU_Control *cpu; _ISR_Disable_without_giant( *level ); 4000f0ec: 7f ff cc d2 call 40002434 4000f0f0: 01 00 00 00 nop RTEMS_INLINE_ROUTINE void _Chain_Append_if_is_off_chain_unprotected( Chain_Control *the_chain, Chain_Node *the_node ) { if ( _Chain_Is_node_off_chain( the_node ) ) { 4000f0f4: c2 07 20 20 ld [ %i4 + 0x20 ], %g1 4000f0f8: 80 a0 60 00 cmp %g1, 0 4000f0fc: 12 80 00 08 bne 4000f11c <== NEVER TAKEN 4000f100: 86 07 60 c8 add %i5, 0xc8, %g3 Chain_Control *the_chain, Chain_Node *the_node ) { Chain_Node *tail = _Chain_Tail( the_chain ); Chain_Node *old_last = tail->previous; 4000f104: c2 07 60 cc ld [ %i5 + 0xcc ], %g1 the_node->next = tail; 4000f108: c6 27 20 20 st %g3, [ %i4 + 0x20 ] { Per_CPU_Control *cpu; ISR_Level level; cpu = _Thread_Action_ISR_disable_and_acquire( thread, &level ); _Chain_Append_if_is_off_chain_unprotected( 4000f10c: 84 07 20 20 add %i4, 0x20, %g2 tail->previous = the_node; 4000f110: c4 27 60 cc st %g2, [ %i5 + 0xcc ] old_last->next = the_node; 4000f114: c4 20 40 00 st %g2, [ %g1 ] the_node->previous = old_last; 4000f118: c2 27 20 24 st %g1, [ %i4 + 0x24 ] RTEMS_INLINE_ROUTINE void _Thread_Action_release_and_ISR_enable( Per_CPU_Control *cpu, ISR_Level level ) { _Per_CPU_Release_and_ISR_enable( cpu, level ); 4000f11c: 7f ff cc c9 call 40002440 4000f120: 01 00 00 00 nop needs_asr_dispatching = true; 4000f124: 86 10 20 01 mov 1, %g3 ! 1 <_TLS_Alignment> ISR_Level level; _ISR_Disable_without_giant( level ); #endif enabled = _Thread_Dispatch_disable_level == 0; 4000f128: c8 01 a0 10 ld [ %g6 + 0x10 ], %g4 static void _RTEMS_Tasks_Dispatch_if_necessary( Thread_Control *executing, bool needs_asr_dispatching ) { if ( _Thread_Dispatch_is_enabled() ) { 4000f12c: 80 a1 20 00 cmp %g4, 0 4000f130: 12 80 00 12 bne 4000f178 <== NEVER TAKEN 4000f134: 82 10 20 00 clr %g1 ISR_Level level; _ISR_Disable_without_giant( level ); #endif if ( !_Thread_Is_heir( executing ) && executing->is_preemptible ) { 4000f138: c2 01 a0 1c ld [ %g6 + 0x1c ], %g1 4000f13c: 80 a7 40 01 cmp %i5, %g1 4000f140: 02 80 00 09 be 4000f164 4000f144: 80 88 e0 ff btst 0xff, %g3 4000f148: c2 0f 60 70 ldub [ %i5 + 0x70 ], %g1 4000f14c: 80 a0 60 00 cmp %g1, 0 4000f150: 02 80 00 05 be 4000f164 <== NEVER TAKEN 4000f154: 80 88 e0 ff btst 0xff, %g3 dispatch_necessary = true; _Thread_Dispatch_necessary = dispatch_necessary; 4000f158: 82 10 20 01 mov 1, %g1 4000f15c: c2 29 a0 14 stb %g1, [ %g6 + 0x14 ] 4000f160: 30 80 00 03 b,a 4000f16c #if defined( RTEMS_SMP ) _ISR_Enable_without_giant( level ); #endif if ( dispatch_necessary ) { 4000f164: 02 80 00 05 be 4000f178 4000f168: 82 10 20 00 clr %g1 _Thread_Dispatch(); 4000f16c: 7f ff ea ce call 40009ca4 <_Thread_Dispatch> 4000f170: 01 00 00 00 nop } } _RTEMS_Tasks_Dispatch_if_necessary( executing, needs_asr_dispatching ); return RTEMS_SUCCESSFUL; 4000f174: 82 10 20 00 clr %g1 ! 0 <_TLS_BSS_size> } 4000f178: 81 c7 e0 08 ret 4000f17c: 91 e8 00 01 restore %g0, %g1, %o0 =============================================================================== 4000c290 : rtems_status_code rtems_task_set_priority( rtems_id id, rtems_task_priority new_priority, rtems_task_priority *old_priority ) { 4000c290: 9d e3 bf 98 save %sp, -104, %sp Thread_Control *the_thread; Objects_Locations location; if ( new_priority != RTEMS_CURRENT_PRIORITY && 4000c294: 80 a6 60 00 cmp %i1, 0 4000c298: 02 80 00 08 be 4000c2b8 4000c29c: 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 ) ); 4000c2a0: 03 10 00 6c sethi %hi(0x4001b000), %g1 4000c2a4: c4 08 62 54 ldub [ %g1 + 0x254 ], %g2 ! 4001b254 4000c2a8: 80 a6 40 02 cmp %i1, %g2 4000c2ac: 18 80 00 1e bgu 4000c324 4000c2b0: 82 10 20 13 mov 0x13, %g1 !_RTEMS_tasks_Priority_is_valid( new_priority ) ) return RTEMS_INVALID_PRIORITY; if ( !old_priority ) 4000c2b4: 80 a6 a0 00 cmp %i2, 0 4000c2b8: 02 80 00 1b be 4000c324 4000c2bc: 82 10 20 09 mov 9, %g1 return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get( id, &location ); 4000c2c0: 90 10 00 18 mov %i0, %o0 4000c2c4: 40 00 09 6f call 4000e880 <_Thread_Get> 4000c2c8: 92 07 bf fc add %fp, -4, %o1 switch ( location ) { 4000c2cc: c2 07 bf fc ld [ %fp + -4 ], %g1 4000c2d0: 80 a0 60 00 cmp %g1, 0 4000c2d4: 12 80 00 14 bne 4000c324 4000c2d8: 82 10 20 04 mov 4, %g1 case OBJECTS_LOCAL: *old_priority = _RTEMS_tasks_Priority_from_Core( 4000c2dc: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 the_thread->current_priority ); if ( new_priority != RTEMS_CURRENT_PRIORITY ) { 4000c2e0: 80 a6 60 00 cmp %i1, 0 4000c2e4: 02 80 00 0d be 4000c318 4000c2e8: c2 26 80 00 st %g1, [ %i2 ] the_thread->real_priority = _RTEMS_tasks_Priority_to_Core( new_priority ); if ( !_Thread_Owns_resources( the_thread ) || 4000c2ec: c2 02 20 1c ld [ %o0 + 0x1c ], %g1 4000c2f0: 80 a0 60 00 cmp %g1, 0 4000c2f4: 02 80 00 06 be 4000c30c 4000c2f8: f2 22 20 18 st %i1, [ %o0 + 0x18 ] 4000c2fc: c2 02 20 14 ld [ %o0 + 0x14 ], %g1 4000c300: 80 a0 40 19 cmp %g1, %i1 4000c304: 08 80 00 05 bleu 4000c318 <== ALWAYS TAKEN 4000c308: 01 00 00 00 nop the_thread->current_priority > new_priority ) _Thread_Change_priority( the_thread, new_priority, false ); 4000c30c: 92 10 00 19 mov %i1, %o1 4000c310: 40 00 08 64 call 4000e4a0 <_Thread_Change_priority> 4000c314: 94 10 20 00 clr %o2 4000c318: 40 00 09 4f call 4000e854 <_Thread_Enable_dispatch> 4000c31c: 01 00 00 00 nop 4000c320: 82 10 20 00 clr %g1 ! 0 <_TLS_BSS_size> case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4000c324: 81 c7 e0 08 ret 4000c328: 91 e8 00 01 restore %g0, %g1, %o0 =============================================================================== 40009d90 : rtems_status_code rtems_task_variable_add( rtems_id tid, void **ptr, void (*dtor)(void *) ) { 40009d90: 9d e3 bf 98 save %sp, -104, %sp if ( rtems_configuration_is_smp_enabled() ) { return RTEMS_NOT_IMPLEMENTED; } #endif if ( !ptr ) 40009d94: 80 a6 60 00 cmp %i1, 0 40009d98: 02 80 00 27 be 40009e34 <== NEVER TAKEN 40009d9c: 82 10 20 09 mov 9, %g1 return RTEMS_INVALID_ADDRESS; the_thread = _Thread_Get (tid, &location); 40009da0: 90 10 00 18 mov %i0, %o0 40009da4: 40 00 09 cd call 4000c4d8 <_Thread_Get> 40009da8: 92 07 bf fc add %fp, -4, %o1 switch (location) { 40009dac: c2 07 bf fc ld [ %fp + -4 ], %g1 40009db0: 80 a0 60 00 cmp %g1, 0 40009db4: 12 80 00 1f bne 40009e30 <== NEVER TAKEN 40009db8: ba 10 00 08 mov %o0, %i5 case OBJECTS_LOCAL: /* * Figure out if the variable is already in this task's list. */ tvp = the_thread->task_variables; 40009dbc: c2 02 21 34 ld [ %o0 + 0x134 ], %g1 while (tvp) { 40009dc0: 80 a0 60 00 cmp %g1, 0 40009dc4: 02 80 00 08 be 40009de4 40009dc8: 01 00 00 00 nop if (tvp->ptr == ptr) { 40009dcc: c4 00 60 04 ld [ %g1 + 4 ], %g2 40009dd0: 80 a0 80 19 cmp %g2, %i1 40009dd4: 32 bf ff fb bne,a 40009dc0 <== NEVER TAKEN 40009dd8: c2 00 40 00 ld [ %g1 ], %g1 <== NOT EXECUTED tvp->dtor = dtor; 40009ddc: 10 80 00 11 b 40009e20 40009de0: f4 20 60 10 st %i2, [ %g1 + 0x10 ] } /* * Now allocate memory for this task variable. */ new = (rtems_task_variable_t *) 40009de4: 40 00 0f 3f call 4000dae0 <_Workspace_Allocate> 40009de8: 90 10 20 14 mov 0x14, %o0 _Workspace_Allocate(sizeof(rtems_task_variable_t)); if (new == NULL) { 40009dec: 80 a2 20 00 cmp %o0, 0 40009df0: 32 80 00 06 bne,a 40009e08 <== ALWAYS TAKEN 40009df4: c4 06 40 00 ld [ %i1 ], %g2 40009df8: 40 00 09 ad call 4000c4ac <_Thread_Enable_dispatch> <== NOT EXECUTED 40009dfc: 01 00 00 00 nop <== NOT EXECUTED _Objects_Put( &the_thread->Object ); return RTEMS_NO_MEMORY; 40009e00: 10 80 00 0d b 40009e34 <== NOT EXECUTED 40009e04: 82 10 20 1a mov 0x1a, %g1 ! 1a <_TLS_Alignment+0x19> <== NOT EXECUTED } new->gval = *ptr; new->ptr = ptr; 40009e08: f2 22 20 04 st %i1, [ %o0 + 4 ] _Workspace_Allocate(sizeof(rtems_task_variable_t)); if (new == NULL) { _Objects_Put( &the_thread->Object ); return RTEMS_NO_MEMORY; } new->gval = *ptr; 40009e0c: c4 22 20 08 st %g2, [ %o0 + 8 ] new->ptr = ptr; new->dtor = dtor; new->next = (struct rtems_task_variable_tt *)the_thread->task_variables; 40009e10: c4 07 61 34 ld [ %i5 + 0x134 ], %g2 _Objects_Put( &the_thread->Object ); return RTEMS_NO_MEMORY; } new->gval = *ptr; new->ptr = ptr; new->dtor = dtor; 40009e14: f4 22 20 10 st %i2, [ %o0 + 0x10 ] new->next = (struct rtems_task_variable_tt *)the_thread->task_variables; 40009e18: c4 22 00 00 st %g2, [ %o0 ] the_thread->task_variables = new; 40009e1c: d0 27 61 34 st %o0, [ %i5 + 0x134 ] 40009e20: 40 00 09 a3 call 4000c4ac <_Thread_Enable_dispatch> 40009e24: 01 00 00 00 nop _Objects_Put( &the_thread->Object ); return RTEMS_SUCCESSFUL; 40009e28: 10 80 00 03 b 40009e34 40009e2c: 82 10 20 00 clr %g1 ! 0 <_TLS_BSS_size> #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 40009e30: 82 10 20 04 mov 4, %g1 <== NOT EXECUTED } 40009e34: 81 c7 e0 08 ret 40009e38: 91 e8 00 01 restore %g0, %g1, %o0 =============================================================================== 4000b7c0 : */ rtems_status_code rtems_timer_cancel( rtems_id id ) { 4000b7c0: 9d e3 bf 98 save %sp, -104, %sp RTEMS_INLINE_ROUTINE Timer_Control *_Timer_Get ( Objects_Id id, Objects_Locations *location ) { return (Timer_Control *) 4000b7c4: 11 10 00 79 sethi %hi(0x4001e400), %o0 4000b7c8: 92 10 00 18 mov %i0, %o1 4000b7cc: 90 12 20 40 or %o0, 0x40, %o0 4000b7d0: 40 00 06 19 call 4000d034 <_Objects_Get> 4000b7d4: 94 07 bf fc add %fp, -4, %o2 Timer_Control *the_timer; Objects_Locations location; the_timer = _Timer_Get( id, &location ); switch ( location ) { 4000b7d8: c2 07 bf fc ld [ %fp + -4 ], %g1 4000b7dc: 80 a0 60 00 cmp %g1, 0 4000b7e0: 12 80 00 0c bne 4000b810 4000b7e4: 01 00 00 00 nop case OBJECTS_LOCAL: if ( !_Timer_Is_dormant_class( the_timer->the_class ) ) 4000b7e8: c2 02 20 38 ld [ %o0 + 0x38 ], %g1 4000b7ec: 80 a0 60 04 cmp %g1, 4 4000b7f0: 02 80 00 04 be 4000b800 <== NEVER TAKEN 4000b7f4: 01 00 00 00 nop (void) _Watchdog_Remove( &the_timer->Ticker ); 4000b7f8: 40 00 0e 28 call 4000f098 <_Watchdog_Remove> 4000b7fc: 90 02 20 10 add %o0, 0x10, %o0 4000b800: 40 00 09 5e call 4000dd78 <_Thread_Enable_dispatch> 4000b804: b0 10 20 00 clr %i0 _Objects_Put( &the_timer->Object ); return RTEMS_SUCCESSFUL; 4000b808: 81 c7 e0 08 ret 4000b80c: 81 e8 00 00 restore case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; } 4000b810: 81 c7 e0 08 ret 4000b814: 91 e8 20 04 restore %g0, 4, %o0 =============================================================================== 4000b830 : rtems_id id, rtems_time_of_day *wall_time, rtems_timer_service_routine_entry routine, void *user_data ) { 4000b830: 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; 4000b834: 03 10 00 74 sethi %hi(0x4001d000), %g1 4000b838: f8 00 61 9c ld [ %g1 + 0x19c ], %i4 ! 4001d19c <_Timer_server> if ( !timer_server ) 4000b83c: 80 a7 20 00 cmp %i4, 0 4000b840: 02 80 00 33 be 4000b90c 4000b844: 82 10 20 0e mov 0xe, %g1 return RTEMS_INCORRECT_STATE; if ( !_TOD_Is_set() ) 4000b848: 03 10 00 74 sethi %hi(0x4001d000), %g1 4000b84c: c4 08 62 38 ldub [ %g1 + 0x238 ], %g2 ! 4001d238 <_TOD+0x18> 4000b850: 80 a0 a0 00 cmp %g2, 0 4000b854: 02 80 00 2e be 4000b90c <== NEVER TAKEN 4000b858: 82 10 20 0b mov 0xb, %g1 return RTEMS_NOT_DEFINED; if ( !routine ) 4000b85c: 80 a6 a0 00 cmp %i2, 0 4000b860: 02 80 00 2b be 4000b90c 4000b864: 82 10 20 09 mov 9, %g1 return RTEMS_INVALID_ADDRESS; if ( !_TOD_Validate( wall_time ) ) 4000b868: 7f ff fb c8 call 4000a788 <_TOD_Validate> 4000b86c: 90 10 00 19 mov %i1, %o0 4000b870: 80 a2 20 00 cmp %o0, 0 4000b874: 02 80 00 26 be 4000b90c 4000b878: 82 10 20 14 mov 0x14, %g1 return RTEMS_INVALID_CLOCK; seconds = _TOD_To_seconds( wall_time ); 4000b87c: 7f ff fb 89 call 4000a6a0 <_TOD_To_seconds> 4000b880: 90 10 00 19 mov %i1, %o0 if ( seconds <= _TOD_Seconds_since_epoch() ) 4000b884: 40 00 03 c3 call 4000c790 <_TOD_Seconds_since_epoch> 4000b888: b2 10 00 08 mov %o0, %i1 4000b88c: 80 a6 40 08 cmp %i1, %o0 4000b890: 08 80 00 1f bleu 4000b90c 4000b894: 82 10 20 14 mov 0x14, %g1 4000b898: 11 10 00 74 sethi %hi(0x4001d000), %o0 4000b89c: 92 10 00 18 mov %i0, %o1 4000b8a0: 90 12 21 60 or %o0, 0x160, %o0 4000b8a4: 40 00 06 b9 call 4000d388 <_Objects_Get> 4000b8a8: 94 07 bf fc add %fp, -4, %o2 return RTEMS_INVALID_CLOCK; the_timer = _Timer_Get( id, &location ); switch ( location ) { 4000b8ac: c2 07 bf fc ld [ %fp + -4 ], %g1 4000b8b0: 80 a0 60 00 cmp %g1, 0 4000b8b4: 12 80 00 15 bne 4000b908 4000b8b8: ba 10 00 08 mov %o0, %i5 case OBJECTS_LOCAL: (void) _Watchdog_Remove( &the_timer->Ticker ); 4000b8bc: 40 00 0f 1b call 4000f528 <_Watchdog_Remove> 4000b8c0: 90 02 20 10 add %o0, 0x10, %o0 the_timer->the_class = TIMER_TIME_OF_DAY_ON_TASK; 4000b8c4: 82 10 20 03 mov 3, %g1 Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 4000b8c8: c0 27 60 18 clr [ %i5 + 0x18 ] 4000b8cc: c2 27 60 38 st %g1, [ %i5 + 0x38 ] the_watchdog->routine = routine; 4000b8d0: f4 27 60 2c st %i2, [ %i5 + 0x2c ] the_watchdog->id = id; 4000b8d4: f0 27 60 30 st %i0, [ %i5 + 0x30 ] _Watchdog_Initialize( &the_timer->Ticker, routine, id, user_data ); the_timer->Ticker.initial = seconds - _TOD_Seconds_since_epoch(); 4000b8d8: 40 00 03 ae call 4000c790 <_TOD_Seconds_since_epoch> 4000b8dc: f6 27 60 34 st %i3, [ %i5 + 0x34 ] (*timer_server->schedule_operation)( timer_server, the_timer ); 4000b8e0: 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(); 4000b8e4: 90 26 40 08 sub %i1, %o0, %o0 (*timer_server->schedule_operation)( timer_server, the_timer ); 4000b8e8: 92 10 00 1d mov %i5, %o1 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(); 4000b8ec: d0 27 60 1c st %o0, [ %i5 + 0x1c ] (*timer_server->schedule_operation)( timer_server, the_timer ); 4000b8f0: 9f c0 40 00 call %g1 4000b8f4: 90 10 00 1c mov %i4, %o0 4000b8f8: 40 00 0a 1a call 4000e160 <_Thread_Enable_dispatch> 4000b8fc: 01 00 00 00 nop _Objects_Put( &the_timer->Object ); return RTEMS_SUCCESSFUL; 4000b900: 10 80 00 03 b 4000b90c 4000b904: 82 10 20 00 clr %g1 ! 0 <_TLS_BSS_size> #endif case OBJECTS_ERROR: break; } return RTEMS_INVALID_ID; 4000b908: 82 10 20 04 mov 4, %g1 } 4000b90c: 81 c7 e0 08 ret 4000b910: 91 e8 00 01 restore %g0, %g1, %o0 =============================================================================== 40007b7c : #include int sched_get_priority_max( int policy ) { 40007b7c: 9d e3 bf a0 save %sp, -96, %sp 40007b80: 80 a6 20 04 cmp %i0, 4 40007b84: 18 80 00 06 bgu 40007b9c 40007b88: 82 10 20 01 mov 1, %g1 40007b8c: b1 28 40 18 sll %g1, %i0, %i0 40007b90: 80 8e 20 17 btst 0x17, %i0 default: rtems_set_errno_and_return_minus_one( EINVAL ); } return POSIX_SCHEDULER_MAXIMUM_PRIORITY; 40007b94: 12 80 00 08 bne 40007bb4 <== ALWAYS TAKEN 40007b98: 03 10 00 7c sethi %hi(0x4001f000), %g1 case SCHED_RR: case SCHED_SPORADIC: break; default: rtems_set_errno_and_return_minus_one( EINVAL ); 40007b9c: 40 00 22 56 call 400104f4 <__errno> 40007ba0: b0 10 3f ff mov -1, %i0 40007ba4: 82 10 20 16 mov 0x16, %g1 40007ba8: c2 22 00 00 st %g1, [ %o0 ] 40007bac: 81 c7 e0 08 ret 40007bb0: 81 e8 00 00 restore } return POSIX_SCHEDULER_MAXIMUM_PRIORITY; 40007bb4: f0 08 61 14 ldub [ %g1 + 0x114 ], %i0 } 40007bb8: 81 c7 e0 08 ret 40007bbc: 91 ee 3f ff restore %i0, -1, %o0 =============================================================================== 40007bc0 : * 13.3.6 Get Scheduling Parameter Limits, P1003.1b-1993, p. 258 */ int sched_get_priority_min( int policy ) { 40007bc0: 9d e3 bf a0 save %sp, -96, %sp 40007bc4: 80 a6 20 04 cmp %i0, 4 40007bc8: 18 80 00 06 bgu 40007be0 40007bcc: 82 10 20 01 mov 1, %g1 40007bd0: 83 28 40 18 sll %g1, %i0, %g1 40007bd4: 80 88 60 17 btst 0x17, %g1 default: rtems_set_errno_and_return_minus_one( EINVAL ); } return POSIX_SCHEDULER_MINIMUM_PRIORITY; 40007bd8: 12 80 00 06 bne 40007bf0 <== ALWAYS TAKEN 40007bdc: b0 10 20 01 mov 1, %i0 case SCHED_RR: case SCHED_SPORADIC: break; default: rtems_set_errno_and_return_minus_one( EINVAL ); 40007be0: 40 00 22 45 call 400104f4 <__errno> 40007be4: b0 10 3f ff mov -1, %i0 40007be8: 82 10 20 16 mov 0x16, %g1 40007bec: c2 22 00 00 st %g1, [ %o0 ] } return POSIX_SCHEDULER_MINIMUM_PRIORITY; } 40007bf0: 81 c7 e0 08 ret 40007bf4: 81 e8 00 00 restore =============================================================================== 40007bf8 : int sched_rr_get_interval( pid_t pid, struct timespec *interval ) { 40007bf8: 9d e3 bf a0 save %sp, -96, %sp /* * Only supported for the "calling process" (i.e. this node). */ if ( pid && pid != getpid() ) 40007bfc: 80 a6 20 00 cmp %i0, 0 40007c00: 02 80 00 0b be 40007c2c <== NEVER TAKEN 40007c04: 80 a6 60 00 cmp %i1, 0 40007c08: 7f ff f0 73 call 40003dd4 40007c0c: 01 00 00 00 nop 40007c10: 80 a6 00 08 cmp %i0, %o0 40007c14: 02 80 00 06 be 40007c2c 40007c18: 80 a6 60 00 cmp %i1, 0 rtems_set_errno_and_return_minus_one( ESRCH ); 40007c1c: 40 00 22 36 call 400104f4 <__errno> 40007c20: 01 00 00 00 nop 40007c24: 10 80 00 07 b 40007c40 40007c28: 82 10 20 03 mov 3, %g1 ! 3 <_TLS_Alignment+0x2> if ( !interval ) 40007c2c: 12 80 00 08 bne 40007c4c 40007c30: 03 10 00 77 sethi %hi(0x4001dc00), %g1 rtems_set_errno_and_return_minus_one( EINVAL ); 40007c34: 40 00 22 30 call 400104f4 <__errno> 40007c38: 01 00 00 00 nop 40007c3c: 82 10 20 16 mov 0x16, %g1 ! 16 <_TLS_Alignment+0x15> 40007c40: c2 22 00 00 st %g1, [ %o0 ] 40007c44: 81 c7 e0 08 ret 40007c48: 91 e8 3f ff restore %g0, -1, %o0 _Timespec_From_ticks( 40007c4c: d0 00 60 94 ld [ %g1 + 0x94 ], %o0 40007c50: 92 10 00 19 mov %i1, %o1 40007c54: 40 00 0f 1c call 4000b8c4 <_Timespec_From_ticks> 40007c58: b0 10 20 00 clr %i0 rtems_configuration_get_ticks_per_timeslice(), interval ); return 0; } 40007c5c: 81 c7 e0 08 ret 40007c60: 81 e8 00 00 restore =============================================================================== 40008b74 : int oflag, ... /* mode_t mode, */ /* unsigned int value */ ) { 40008b74: 9d e3 bf 88 save %sp, -120, %sp POSIX_Semaphore_Control *the_semaphore; Objects_Locations location; size_t name_len; if ( oflag & O_CREAT ) { va_start(arg, oflag); 40008b78: f4 27 a0 4c st %i2, [ %fp + 0x4c ] 40008b7c: f8 27 a0 54 st %i4, [ %fp + 0x54 ] 40008b80: f6 27 a0 50 st %i3, [ %fp + 0x50 ] 40008b84: fa 27 a0 58 st %i5, [ %fp + 0x58 ] Objects_Id the_semaphore_id; POSIX_Semaphore_Control *the_semaphore; Objects_Locations location; size_t name_len; if ( oflag & O_CREAT ) { 40008b88: b4 8e 62 00 andcc %i1, 0x200, %i2 40008b8c: 02 80 00 05 be 40008ba0 40008b90: b8 10 20 00 clr %i4 va_start(arg, oflag); 40008b94: 82 07 a0 4c add %fp, 0x4c, %g1 mode = va_arg( arg, mode_t ); value = va_arg( arg, unsigned int ); 40008b98: b8 10 00 1b mov %i3, %i4 POSIX_Semaphore_Control *the_semaphore; Objects_Locations location; size_t name_len; if ( oflag & O_CREAT ) { va_start(arg, oflag); 40008b9c: c2 27 bf ec st %g1, [ %fp + -20 ] */ SCORE_EXTERN API_Mutex_Control *_RTEMS_Allocator_Mutex; static inline void _RTEMS_Lock_allocator( void ) { _API_Mutex_Lock( _RTEMS_Allocator_Mutex ); 40008ba0: 03 10 00 78 sethi %hi(0x4001e000), %g1 40008ba4: d0 00 60 d8 ld [ %g1 + 0xd8 ], %o0 ! 4001e0d8 <_RTEMS_Allocator_Mutex> 40008ba8: 40 00 05 ff call 4000a3a4 <_API_Mutex_Lock> 40008bac: 37 10 00 78 sethi %hi(0x4001e000), %i3 const char *name, Objects_Id *id, size_t *len ) { return _POSIX_Name_to_id( &_POSIX_Semaphore_Information, name, id, len ); 40008bb0: 90 16 e2 e4 or %i3, 0x2e4, %o0 ! 4001e2e4 <_POSIX_Semaphore_Information> 40008bb4: 92 10 00 18 mov %i0, %o1 40008bb8: 94 07 bf f0 add %fp, -16, %o2 40008bbc: 7f ff fe 74 call 4000858c <_POSIX_Name_to_id> 40008bc0: 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 ) { 40008bc4: ba 92 20 00 orcc %o0, 0, %i5 40008bc8: 22 80 00 0e be,a 40008c00 40008bcc: 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) ) ) { 40008bd0: 80 a7 60 02 cmp %i5, 2 40008bd4: 12 80 00 04 bne 40008be4 40008bd8: 80 a6 a0 00 cmp %i2, 0 40008bdc: 12 80 00 20 bne 40008c5c 40008be0: d2 07 bf fc ld [ %fp + -4 ], %o1 * previous thread life protection state and thus may not return if the * executing thread was restarted or deleted in the mean-time. */ RTEMS_INLINE_ROUTINE void _Objects_Allocator_unlock( void ) { _RTEMS_Unlock_allocator(); 40008be4: 7f ff ff df call 40008b60 <_RTEMS_Unlock_allocator> 40008be8: b0 10 3f ff mov -1, %i0 _Objects_Allocator_unlock(); rtems_set_errno_and_return_minus_one_cast( status, sem_t * ); 40008bec: 40 00 25 8b call 40012218 <__errno> 40008bf0: 01 00 00 00 nop 40008bf4: fa 22 00 00 st %i5, [ %o0 ] 40008bf8: 81 c7 e0 08 ret 40008bfc: 81 e8 00 00 restore /* * Check for existence with creation. */ if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { 40008c00: 80 a6 6a 00 cmp %i1, 0xa00 40008c04: 12 80 00 0a bne 40008c2c 40008c08: d2 07 bf f0 ld [ %fp + -16 ], %o1 40008c0c: 7f ff ff d5 call 40008b60 <_RTEMS_Unlock_allocator> 40008c10: b0 10 3f ff mov -1, %i0 _Objects_Allocator_unlock(); rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * ); 40008c14: 40 00 25 81 call 40012218 <__errno> 40008c18: 01 00 00 00 nop 40008c1c: 82 10 20 11 mov 0x11, %g1 ! 11 <_TLS_Alignment+0x10> 40008c20: c2 22 00 00 st %g1, [ %o0 ] 40008c24: 81 c7 e0 08 ret 40008c28: 81 e8 00 00 restore RTEMS_INLINE_ROUTINE POSIX_Semaphore_Control *_POSIX_Semaphore_Get ( sem_t *id, Objects_Locations *location ) { return (POSIX_Semaphore_Control *) 40008c2c: 94 07 bf f8 add %fp, -8, %o2 40008c30: 40 00 0a 96 call 4000b688 <_Objects_Get> 40008c34: 90 16 e2 e4 or %i3, 0x2e4, %o0 } the_semaphore = _POSIX_Semaphore_Get( (sem_t *) &the_semaphore_id, &location ); the_semaphore->open_count += 1; 40008c38: c2 02 20 18 ld [ %o0 + 0x18 ], %g1 if ( (oflag & (O_CREAT | O_EXCL)) == (O_CREAT | O_EXCL) ) { _Objects_Allocator_unlock(); rtems_set_errno_and_return_minus_one_cast( EEXIST, sem_t * ); } the_semaphore = _POSIX_Semaphore_Get( (sem_t *) &the_semaphore_id, &location ); 40008c3c: d0 27 bf f4 st %o0, [ %fp + -12 ] the_semaphore->open_count += 1; 40008c40: 82 00 60 01 inc %g1 _Thread_Enable_dispatch(); 40008c44: 40 00 0e 1a call 4000c4ac <_Thread_Enable_dispatch> 40008c48: c2 22 20 18 st %g1, [ %o0 + 0x18 ] 40008c4c: 7f ff ff c5 call 40008b60 <_RTEMS_Unlock_allocator> 40008c50: 01 00 00 00 nop 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; 40008c54: 10 80 00 0d b 40008c88 40008c58: 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( 40008c5c: 94 10 20 00 clr %o2 40008c60: 96 10 00 1c mov %i4, %o3 40008c64: 98 07 bf f4 add %fp, -12, %o4 40008c68: 40 00 1a a5 call 4000f6fc <_POSIX_Semaphore_Create_support> 40008c6c: 90 10 00 18 mov %i0, %o0 40008c70: 7f ff ff bc call 40008b60 <_RTEMS_Unlock_allocator> 40008c74: ba 10 00 08 mov %o0, %i5 * errno was set by Create_support, so don't set it again. */ _Objects_Allocator_unlock(); if ( status == -1 ) 40008c78: 80 a7 7f ff cmp %i5, -1 40008c7c: 22 80 00 04 be,a 40008c8c <== NEVER TAKEN 40008c80: 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; 40008c84: f0 07 bf f4 ld [ %fp + -12 ], %i0 40008c88: b0 06 20 08 add %i0, 8, %i0 #endif } 40008c8c: 81 c7 e0 08 ret 40008c90: 81 e8 00 00 restore =============================================================================== 4000aee0 : int sem_timedwait( sem_t *__restrict sem, const struct timespec *__restrict abstime ) { 4000aee0: 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 ); 4000aee4: 92 07 bf fc add %fp, -4, %o1 4000aee8: 40 00 16 87 call 40010904 <_POSIX_Absolute_timeout_to_ticks> 4000aeec: 90 10 00 19 mov %i1, %o0 if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) do_wait = false; lock_status = _POSIX_Semaphore_Wait_support( sem, do_wait, ticks ); 4000aef0: 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 ) 4000aef4: 90 1a 20 03 xor %o0, 3, %o0 4000aef8: 80 a0 00 08 cmp %g0, %o0 do_wait = false; lock_status = _POSIX_Semaphore_Wait_support( sem, do_wait, ticks ); 4000aefc: 90 10 00 18 mov %i0, %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 ); if ( status != POSIX_ABSOLUTE_TIMEOUT_IS_IN_FUTURE ) 4000af00: ba 60 3f ff subx %g0, -1, %i5 do_wait = false; lock_status = _POSIX_Semaphore_Wait_support( sem, do_wait, ticks ); 4000af04: 40 00 19 2e call 400113bc <_POSIX_Semaphore_Wait_support> 4000af08: 92 10 00 1d mov %i5, %o1 * This service only gives us the option to block. We used a polling * attempt to obtain if the abstime was not in the future. If we did * not obtain the semaphore, then not look at the status immediately, * make sure the right reason is returned. */ if ( !do_wait && (lock_status == EBUSY) ) { 4000af0c: 80 a7 60 00 cmp %i5, 0 4000af10: 12 80 00 06 bne 4000af28 <== ALWAYS TAKEN 4000af14: 80 a2 20 10 cmp %o0, 0x10 4000af18: 12 80 00 04 bne 4000af28 <== NOT EXECUTED 4000af1c: 01 00 00 00 nop <== NOT EXECUTED 4000af20: 81 c7 e0 08 ret <== NOT EXECUTED 4000af24: 91 e8 20 10 restore %g0, 0x10, %o0 <== NOT EXECUTED lock_status == POSIX_ABSOLUTE_TIMEOUT_IS_NOW ) rtems_set_errno_and_return_minus_one( ETIMEDOUT ); } return lock_status; } 4000af28: 81 c7 e0 08 ret 4000af2c: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 40007c64 : int sigaction( int sig, const struct sigaction *__restrict act, struct sigaction *__restrict oact ) { 40007c64: 9d e3 bf a0 save %sp, -96, %sp ISR_Level level; if ( !sig ) 40007c68: 82 06 3f ff add %i0, -1, %g1 40007c6c: 80 a0 60 1f cmp %g1, 0x1f 40007c70: 08 80 00 08 bleu 40007c90 40007c74: 80 a6 20 09 cmp %i0, 9 rtems_set_errno_and_return_minus_one( EINVAL ); 40007c78: 40 00 23 d0 call 40010bb8 <__errno> 40007c7c: b0 10 3f ff mov -1, %i0 40007c80: 82 10 20 16 mov 0x16, %g1 40007c84: c2 22 00 00 st %g1, [ %o0 ] 40007c88: 81 c7 e0 08 ret 40007c8c: 81 e8 00 00 restore * * NOTE: Solaris documentation claims to "silently enforce" this which * contradicts the POSIX specification. */ if ( sig == SIGKILL ) 40007c90: 02 bf ff fa be 40007c78 40007c94: 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 disable_level = _Thread_Dispatch_disable_level; 40007c98: c4 01 a0 10 ld [ %g6 + 0x10 ], %g2 _ISR_Disable( level ); _Profiling_Thread_dispatch_disable( _Per_CPU_Get(), disable_level ); #endif ++disable_level; 40007c9c: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = disable_level; 40007ca0: c4 21 a0 10 st %g2, [ %g6 + 0x10 ] rtems_set_errno_and_return_minus_one( EINVAL ); _Thread_Disable_dispatch(); if ( oact ) 40007ca4: 80 a6 a0 00 cmp %i2, 0 40007ca8: 02 80 00 0a be 40007cd0 40007cac: 83 2e 20 02 sll %i0, 2, %g1 *oact = _POSIX_signals_Vectors[ sig ]; 40007cb0: 85 2e 20 04 sll %i0, 4, %g2 40007cb4: 82 20 80 01 sub %g2, %g1, %g1 40007cb8: 13 10 00 70 sethi %hi(0x4001c000), %o1 40007cbc: 90 10 00 1a mov %i2, %o0 40007cc0: 92 12 62 a8 or %o1, 0x2a8, %o1 40007cc4: 94 10 20 0c mov 0xc, %o2 40007cc8: 40 00 25 a6 call 40011360 40007ccc: 92 02 40 01 add %o1, %g1, %o1 /* * Evaluate the new action structure and set the global signal vector * appropriately. */ if ( act ) { 40007cd0: 80 a6 60 00 cmp %i1, 0 40007cd4: 02 80 00 1b be 40007d40 <== NEVER TAKEN 40007cd8: 01 00 00 00 nop /* * Unless the user is installing the default signal actions, then * we can just copy the provided sigaction structure into the vectors. */ _ISR_Disable( level ); 40007cdc: 7f ff ea c6 call 400027f4 40007ce0: 01 00 00 00 nop 40007ce4: b4 10 00 08 mov %o0, %i2 if ( act->sa_handler == SIG_DFL ) { 40007ce8: c2 06 60 08 ld [ %i1 + 8 ], %g1 40007cec: 3b 10 00 70 sethi %hi(0x4001c000), %i5 40007cf0: 80 a0 60 00 cmp %g1, 0 40007cf4: ba 17 62 a8 or %i5, 0x2a8, %i5 40007cf8: b9 2e 20 02 sll %i0, 2, %i4 40007cfc: 12 80 00 08 bne 40007d1c 40007d00: b7 2e 20 04 sll %i0, 4, %i3 _POSIX_signals_Vectors[ sig ] = _POSIX_signals_Default_vectors[ sig ]; 40007d04: b8 26 c0 1c sub %i3, %i4, %i4 40007d08: 13 10 00 65 sethi %hi(0x40019400), %o1 40007d0c: 90 07 40 1c add %i5, %i4, %o0 40007d10: 92 12 63 44 or %o1, 0x344, %o1 40007d14: 10 80 00 07 b 40007d30 40007d18: 92 02 40 1c add %o1, %i4, %o1 } else { _POSIX_signals_Clear_process_signals( sig ); 40007d1c: 40 00 17 73 call 4000dae8 <_POSIX_signals_Clear_process_signals> 40007d20: 90 10 00 18 mov %i0, %o0 _POSIX_signals_Vectors[ sig ] = *act; 40007d24: 90 26 c0 1c sub %i3, %i4, %o0 40007d28: 92 10 00 19 mov %i1, %o1 40007d2c: 90 07 40 08 add %i5, %o0, %o0 40007d30: 40 00 25 8c call 40011360 40007d34: 94 10 20 0c mov 0xc, %o2 } _ISR_Enable( level ); 40007d38: 7f ff ea b2 call 40002800 40007d3c: 90 10 00 1a mov %i2, %o0 } _Thread_Enable_dispatch(); 40007d40: 40 00 0b d5 call 4000ac94 <_Thread_Enable_dispatch> 40007d44: b0 10 20 00 clr %i0 return 0; } 40007d48: 81 c7 e0 08 ret 40007d4c: 81 e8 00 00 restore =============================================================================== 400081ec : int sigtimedwait( const sigset_t *__restrict set, siginfo_t *__restrict info, const struct timespec *__restrict timeout ) { 400081ec: 9d e3 bf 90 save %sp, -112, %sp ISR_lock_Context lock_context; /* * Error check parameters before disabling interrupts. */ if ( !set ) 400081f0: 80 a6 20 00 cmp %i0, 0 400081f4: 02 80 00 0e be 4000822c 400081f8: 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 ) { 400081fc: 22 80 00 10 be,a 4000823c 40008200: b4 10 20 00 clr %i2 if ( !_Timespec_Is_valid( timeout ) ) 40008204: 40 00 0f c6 call 4000c11c <_Timespec_Is_valid> 40008208: 90 10 00 1a mov %i2, %o0 4000820c: 80 a2 20 00 cmp %o0, 0 40008210: 02 80 00 07 be 4000822c 40008214: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( EINVAL ); interval = _Timespec_To_ticks( timeout ); 40008218: 40 00 0f d3 call 4000c164 <_Timespec_To_ticks> 4000821c: 90 10 00 1a mov %i2, %o0 if ( !interval ) 40008220: b4 92 20 00 orcc %o0, 0, %i2 40008224: 12 80 00 07 bne 40008240 <== ALWAYS TAKEN 40008228: 80 a6 60 00 cmp %i1, 0 rtems_set_errno_and_return_minus_one( EINVAL ); 4000822c: 40 00 24 44 call 4001133c <__errno> 40008230: 01 00 00 00 nop 40008234: 10 80 00 64 b 400083c4 40008238: 82 10 20 16 mov 0x16, %g1 ! 16 <_TLS_Alignment+0x15> /* * Initialize local variables. */ the_info = ( info ) ? info : &signal_information; 4000823c: 80 a6 60 00 cmp %i1, 0 40008240: 22 80 00 02 be,a 40008248 40008244: b2 07 bf f4 add %fp, -12, %i1 ISR_Level level; _ISR_Disable_without_giant( level ); #endif executing = _Thread_Executing; 40008248: fa 01 a0 18 ld [ %g6 + 0x18 ], %i5 { #if defined( RTEMS_SMP ) _SMP_lock_ISR_disable_and_acquire( &lock->lock, &context->lock_context ); #else (void) lock; _ISR_Disable( context->isr_level ); 4000824c: 7f ff ea 62 call 40002bd4 40008250: f8 07 61 30 ld [ %i5 + 0x130 ], %i4 40008254: b6 10 00 08 mov %o0, %i3 */ /* API signals pending? */ _POSIX_signals_Acquire( &lock_context ); if ( *set & api->signals_pending ) { 40008258: c2 06 00 00 ld [ %i0 ], %g1 4000825c: d0 07 20 e0 ld [ %i4 + 0xe0 ], %o0 40008260: 80 88 40 08 btst %g1, %o0 40008264: 02 80 00 13 be 400082b0 40008268: 05 10 00 73 sethi %hi(0x4001cc00), %g2 /* XXX real info later */ the_info->si_signo = _POSIX_signals_Get_lowest( api->signals_pending ); 4000826c: 7f ff ff c8 call 4000818c <_POSIX_signals_Get_lowest> 40008270: 01 00 00 00 nop _POSIX_signals_Clear_signals( 40008274: 94 10 00 19 mov %i1, %o2 /* API signals pending? */ _POSIX_signals_Acquire( &lock_context ); if ( *set & api->signals_pending ) { /* XXX real info later */ the_info->si_signo = _POSIX_signals_Get_lowest( api->signals_pending ); 40008278: 92 10 00 08 mov %o0, %o1 4000827c: d0 26 40 00 st %o0, [ %i1 ] _POSIX_signals_Clear_signals( 40008280: 96 10 20 00 clr %o3 40008284: 90 10 00 1c mov %i4, %o0 40008288: 98 10 20 00 clr %o4 4000828c: 40 00 18 36 call 4000e364 <_POSIX_signals_Clear_signals> 40008290: 9a 10 20 00 clr %o5 { #if defined( RTEMS_SMP ) _SMP_lock_Release_and_ISR_enable( &lock->lock, &context->lock_context ); #else (void) lock; _ISR_Enable( context->isr_level ); 40008294: 7f ff ea 53 call 40002be0 40008298: 90 10 00 1b mov %i3, %o0 false, false ); _POSIX_signals_Release( &lock_context ); the_info->si_code = SI_USER; 4000829c: 82 10 20 01 mov 1, %g1 the_info->si_value.sival_int = 0; 400082a0: c0 26 60 08 clr [ %i1 + 8 ] false, false ); _POSIX_signals_Release( &lock_context ); the_info->si_code = SI_USER; 400082a4: c2 26 60 04 st %g1, [ %i1 + 4 ] the_info->si_value.sival_int = 0; return the_info->si_signo; 400082a8: 10 80 00 49 b 400083cc 400082ac: d0 06 40 00 ld [ %i1 ], %o0 } /* Process pending signals? */ if ( *set & _POSIX_signals_Pending ) { 400082b0: d0 00 a0 d4 ld [ %g2 + 0xd4 ], %o0 400082b4: 80 88 40 08 btst %g1, %o0 400082b8: 02 80 00 14 be 40008308 400082bc: 01 00 00 00 nop signo = _POSIX_signals_Get_lowest( _POSIX_signals_Pending ); 400082c0: 7f ff ff b3 call 4000818c <_POSIX_signals_Get_lowest> 400082c4: 01 00 00 00 nop _POSIX_signals_Clear_signals( api, signo, the_info, true, false, false ); 400082c8: 94 10 00 19 mov %i1, %o2 } /* Process pending signals? */ if ( *set & _POSIX_signals_Pending ) { signo = _POSIX_signals_Get_lowest( _POSIX_signals_Pending ); 400082cc: ba 10 00 08 mov %o0, %i5 _POSIX_signals_Clear_signals( api, signo, the_info, true, false, false ); 400082d0: 96 10 20 01 mov 1, %o3 400082d4: 90 10 00 1c mov %i4, %o0 400082d8: 92 10 00 1d mov %i5, %o1 400082dc: 98 10 20 00 clr %o4 400082e0: 40 00 18 21 call 4000e364 <_POSIX_signals_Clear_signals> 400082e4: 9a 10 20 00 clr %o5 400082e8: 7f ff ea 3e call 40002be0 400082ec: 90 10 00 1b mov %i3, %o0 _POSIX_signals_Release( &lock_context ); the_info->si_signo = signo; the_info->si_code = SI_USER; 400082f0: 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, false ); _POSIX_signals_Release( &lock_context ); the_info->si_signo = signo; 400082f4: fa 26 40 00 st %i5, [ %i1 ] the_info->si_code = SI_USER; 400082f8: c2 26 60 04 st %g1, [ %i1 + 4 ] the_info->si_value.sival_int = 0; 400082fc: c0 26 60 08 clr [ %i1 + 8 ] return signo; 40008300: 10 80 00 33 b 400083cc 40008304: 90 10 00 1d mov %i5, %o0 * * This rountine increments the thread dispatch level */ RTEMS_INLINE_ROUTINE uint32_t _Thread_Dispatch_increment_disable_level(void) { uint32_t disable_level = _Thread_Dispatch_disable_level; 40008308: c4 01 a0 10 ld [ %g6 + 0x10 ], %g2 } the_info->si_signo = -1; 4000830c: 82 10 3f ff mov -1, %g1 40008310: c2 26 40 00 st %g1, [ %i1 ] _ISR_Disable( level ); _Profiling_Thread_dispatch_disable( _Per_CPU_Get(), disable_level ); #endif ++disable_level; 40008314: 84 00 a0 01 inc %g2 _Thread_Dispatch_disable_level = disable_level; 40008318: c4 21 a0 10 st %g2, [ %g6 + 0x10 ] _Thread_Disable_dispatch(); executing->Wait.queue = &_POSIX_signals_Wait_queue; executing->Wait.return_code = EINTR; 4000831c: 84 10 20 04 mov 4, %g2 40008320: c4 27 60 34 st %g2, [ %i5 + 0x34 ] executing->Wait.option = *set; 40008324: c4 06 00 00 ld [ %i0 ], %g2 executing->Wait.return_argument = the_info; 40008328: f2 27 60 28 st %i1, [ %i5 + 0x28 ] the_info->si_signo = -1; _Thread_Disable_dispatch(); executing->Wait.queue = &_POSIX_signals_Wait_queue; executing->Wait.return_code = EINTR; executing->Wait.option = *set; 4000832c: c4 27 60 30 st %g2, [ %i5 + 0x30 ] } the_info->si_signo = -1; _Thread_Disable_dispatch(); executing->Wait.queue = &_POSIX_signals_Wait_queue; 40008330: 03 10 00 73 sethi %hi(0x4001cc00), %g1 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; 40008334: 84 10 20 01 mov 1, %g2 40008338: 82 10 60 94 or %g1, 0x94, %g1 4000833c: c2 27 60 44 st %g1, [ %i5 + 0x44 ] 40008340: c4 20 60 30 st %g2, [ %g1 + 0x30 ] 40008344: 7f ff ea 27 call 40002be0 40008348: 90 10 00 1b mov %i3, %o0 executing->Wait.return_code = EINTR; executing->Wait.option = *set; executing->Wait.return_argument = the_info; _Thread_queue_Enter_critical_section( &_POSIX_signals_Wait_queue ); _POSIX_signals_Release( &lock_context ); _Thread_queue_Enqueue( &_POSIX_signals_Wait_queue, executing, interval ); 4000834c: 92 10 00 1d mov %i5, %o1 40008350: 94 10 00 1a mov %i2, %o2 40008354: 11 10 00 73 sethi %hi(0x4001cc00), %o0 40008358: 17 10 00 2e sethi %hi(0x4000b800), %o3 4000835c: 90 12 20 94 or %o0, 0x94, %o0 40008360: 40 00 0c f2 call 4000b728 <_Thread_queue_Enqueue_with_handler> 40008364: 96 12 e2 b8 or %o3, 0x2b8, %o3 _Thread_Enable_dispatch(); 40008368: 40 00 0b b5 call 4000b23c <_Thread_Enable_dispatch> 4000836c: 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( 40008370: d2 06 40 00 ld [ %i1 ], %o1 40008374: 90 10 00 1c mov %i4, %o0 40008378: 94 10 00 19 mov %i1, %o2 4000837c: 96 10 20 00 clr %o3 40008380: 98 10 20 00 clr %o4 40008384: 40 00 17 f8 call 4000e364 <_POSIX_signals_Clear_signals> 40008388: 9a 10 20 01 mov 1, %o5 /* 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 ( (executing->Wait.return_code != EINTR) 4000838c: c2 07 60 34 ld [ %i5 + 0x34 ], %g1 40008390: 80 a0 60 04 cmp %g1, 4 40008394: 12 80 00 09 bne 400083b8 40008398: 84 10 20 01 mov 1, %g2 || !(*set & signo_to_mask( the_info->si_signo )) ) { 4000839c: d0 06 40 00 ld [ %i1 ], %o0 400083a0: 82 02 3f ff add %o0, -1, %g1 400083a4: 85 28 80 01 sll %g2, %g1, %g2 400083a8: c2 06 00 00 ld [ %i0 ], %g1 400083ac: 80 88 80 01 btst %g2, %g1 400083b0: 12 80 00 07 bne 400083cc 400083b4: 01 00 00 00 nop errno = executing->Wait.return_code; 400083b8: 40 00 23 e1 call 4001133c <__errno> 400083bc: 01 00 00 00 nop 400083c0: c2 07 60 34 ld [ %i5 + 0x34 ], %g1 400083c4: c2 22 00 00 st %g1, [ %o0 ] return -1; 400083c8: 90 10 3f ff mov -1, %o0 } return the_info->si_signo; } 400083cc: 81 c7 e0 08 ret 400083d0: 91 e8 00 08 restore %g0, %o0, %o0 =============================================================================== 4000a1c8 : int sigwait( const sigset_t *__restrict set, int *__restrict sig ) { 4000a1c8: 9d e3 bf a0 save %sp, -96, %sp int status; status = sigtimedwait( set, NULL, NULL ); 4000a1cc: 92 10 20 00 clr %o1 4000a1d0: 90 10 00 18 mov %i0, %o0 4000a1d4: 7f ff ff 7f call 40009fd0 4000a1d8: 94 10 20 00 clr %o2 if ( status != -1 ) { 4000a1dc: 80 a2 3f ff cmp %o0, -1 4000a1e0: 02 80 00 06 be 4000a1f8 4000a1e4: 80 a6 60 00 cmp %i1, 0 if ( sig ) 4000a1e8: 32 80 00 09 bne,a 4000a20c <== ALWAYS TAKEN 4000a1ec: d0 26 40 00 st %o0, [ %i1 ] *sig = status; return 0; 4000a1f0: 81 c7 e0 08 ret <== NOT EXECUTED 4000a1f4: 91 e8 20 00 restore %g0, 0, %o0 <== NOT EXECUTED } return errno; 4000a1f8: 40 00 23 8e call 40013030 <__errno> 4000a1fc: 01 00 00 00 nop 4000a200: f0 02 00 00 ld [ %o0 ], %i0 4000a204: 81 c7 e0 08 ret 4000a208: 81 e8 00 00 restore status = sigtimedwait( set, NULL, NULL ); if ( status != -1 ) { if ( sig ) *sig = status; return 0; 4000a20c: b0 10 20 00 clr %i0 } return errno; } 4000a210: 81 c7 e0 08 ret 4000a214: 81 e8 00 00 restore =============================================================================== 40006f10 : */ long sysconf( int name ) { 40006f10: 9d e3 bf a0 save %sp, -96, %sp if ( name == _SC_CLK_TCK ) 40006f14: 80 a6 20 02 cmp %i0, 2 40006f18: 12 80 00 09 bne 40006f3c 40006f1c: 03 10 00 5e sethi %hi(0x40017800), %g1 return (TOD_MICROSECONDS_PER_SECOND / 40006f20: 03 10 00 58 sethi %hi(0x40016000), %g1 40006f24: d2 00 60 1c ld [ %g1 + 0x1c ], %o1 ! 4001601c 40006f28: 11 00 03 d0 sethi %hi(0xf4000), %o0 40006f2c: 40 00 33 cc call 40013e5c <.udiv> 40006f30: 90 12 22 40 or %o0, 0x240, %o0 ! f4240 <_TLS_Alignment+0xf423f> 40006f34: 81 c7 e0 08 ret 40006f38: 91 e8 00 08 restore %g0, %o0, %o0 rtems_configuration_get_microseconds_per_tick()); if ( name == _SC_OPEN_MAX ) 40006f3c: 80 a6 20 04 cmp %i0, 4 40006f40: 02 80 00 13 be 40006f8c 40006f44: d0 00 60 c0 ld [ %g1 + 0xc0 ], %o0 return rtems_libio_number_iops; if ( name == _SC_GETPW_R_SIZE_MAX ) 40006f48: 80 a6 20 33 cmp %i0, 0x33 40006f4c: 02 80 00 10 be 40006f8c 40006f50: 90 10 24 00 mov 0x400, %o0 return 1024; if ( name == _SC_PAGESIZE ) 40006f54: 80 a6 20 08 cmp %i0, 8 40006f58: 02 80 00 0d be 40006f8c 40006f5c: 11 00 00 04 sethi %hi(0x1000), %o0 return PAGE_SIZE; if ( name == _SC_SYMLOOP_MAX ) 40006f60: 80 a6 20 4f cmp %i0, 0x4f 40006f64: 02 80 00 0a be 40006f8c <== NEVER TAKEN 40006f68: 90 10 20 20 mov 0x20, %o0 return RTEMS_FILESYSTEM_SYMLOOP_MAX; #if defined(__sparc__) if ( name == 515 ) /* Solaris _SC_STACK_PROT */ 40006f6c: 80 a6 22 03 cmp %i0, 0x203 40006f70: 02 80 00 07 be 40006f8c <== NEVER TAKEN 40006f74: 90 10 20 00 clr %o0 return 0; #endif rtems_set_errno_and_return_minus_one( EINVAL ); 40006f78: 40 00 23 7e call 4000fd70 <__errno> 40006f7c: 01 00 00 00 nop 40006f80: 82 10 20 16 mov 0x16, %g1 ! 16 <_TLS_Alignment+0x15> 40006f84: c2 22 00 00 st %g1, [ %o0 ] 40006f88: 90 10 3f ff mov -1, %o0 } 40006f8c: b0 10 00 08 mov %o0, %i0 40006f90: 81 c7 e0 08 ret 40006f94: 81 e8 00 00 restore =============================================================================== 40008c94 : int timer_create( clockid_t clock_id, struct sigevent *__restrict evp, timer_t *__restrict timerid ) { 40008c94: 9d e3 bf a0 save %sp, -96, %sp POSIX_Timer_Control *ptimer; if ( clock_id != CLOCK_REALTIME ) 40008c98: 80 a6 20 01 cmp %i0, 1 40008c9c: 02 80 00 06 be 40008cb4 40008ca0: 80 a6 a0 00 cmp %i2, 0 rtems_set_errno_and_return_minus_one( EINVAL ); 40008ca4: 40 00 25 5d call 40012218 <__errno> 40008ca8: 01 00 00 00 nop 40008cac: 10 80 00 1a b 40008d14 40008cb0: 82 10 20 16 mov 0x16, %g1 ! 16 <_TLS_Alignment+0x15> if ( !timerid ) 40008cb4: 02 bf ff fc be 40008ca4 40008cb8: 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) { 40008cbc: 02 80 00 0c be 40008cec 40008cc0: 3b 10 00 78 sethi %hi(0x4001e000), %i5 /* The structure has data */ if ( ( evp->sigev_notify != SIGEV_NONE ) && 40008cc4: c2 06 40 00 ld [ %i1 ], %g1 40008cc8: 82 00 7f ff add %g1, -1, %g1 40008ccc: 80 a0 60 01 cmp %g1, 1 40008cd0: 18 bf ff f5 bgu 40008ca4 <== NEVER TAKEN 40008cd4: 01 00 00 00 nop ( 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 ) 40008cd8: c2 06 60 04 ld [ %i1 + 4 ], %g1 40008cdc: 82 00 7f ff add %g1, -1, %g1 40008ce0: 80 a0 60 1f cmp %g1, 0x1f 40008ce4: 18 bf ff f0 bgu 40008ca4 <== NEVER TAKEN 40008ce8: 01 00 00 00 nop * This function allocates a timer control block from * 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 ); 40008cec: 40 00 09 39 call 4000b1d0 <_Objects_Allocate> 40008cf0: 90 17 63 20 or %i5, 0x320, %o0 /* * Allocate a timer */ ptimer = _POSIX_Timer_Allocate(); if ( !ptimer ) { 40008cf4: 80 a2 20 00 cmp %o0, 0 40008cf8: 12 80 00 0a bne 40008d20 40008cfc: 03 10 00 78 sethi %hi(0x4001e000), %g1 } static inline void _RTEMS_Unlock_allocator( void ) { _API_Mutex_Unlock( _RTEMS_Allocator_Mutex ); 40008d00: 40 00 05 e0 call 4000a480 <_API_Mutex_Unlock> 40008d04: d0 00 60 d8 ld [ %g1 + 0xd8 ], %o0 ! 4001e0d8 <_RTEMS_Allocator_Mutex> _Objects_Allocator_unlock(); rtems_set_errno_and_return_minus_one( EAGAIN ); 40008d08: 40 00 25 44 call 40012218 <__errno> 40008d0c: 01 00 00 00 nop 40008d10: 82 10 20 0b mov 0xb, %g1 ! b <_TLS_Alignment+0xa> 40008d14: c2 22 00 00 st %g1, [ %o0 ] 40008d18: 81 c7 e0 08 ret 40008d1c: 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; 40008d20: 84 10 20 02 mov 2, %g2 40008d24: c4 2a 20 3c stb %g2, [ %o0 + 0x3c ] ptimer->thread_id = _Thread_Get_executing()->Object.id; 40008d28: c4 01 a0 18 ld [ %g6 + 0x18 ], %g2 if ( evp != NULL ) { 40008d2c: 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_Get_executing()->Object.id; 40008d30: c4 00 a0 08 ld [ %g2 + 8 ], %g2 if ( evp != NULL ) { 40008d34: 02 80 00 08 be 40008d54 40008d38: c4 22 20 38 st %g2, [ %o0 + 0x38 ] ptimer->inf.sigev_notify = evp->sigev_notify; 40008d3c: c4 06 40 00 ld [ %i1 ], %g2 40008d40: c4 22 20 40 st %g2, [ %o0 + 0x40 ] ptimer->inf.sigev_signo = evp->sigev_signo; 40008d44: c4 06 60 04 ld [ %i1 + 4 ], %g2 40008d48: c4 22 20 44 st %g2, [ %o0 + 0x44 ] ptimer->inf.sigev_value = evp->sigev_value; 40008d4c: c4 06 60 08 ld [ %i1 + 8 ], %g2 40008d50: c4 22 20 48 st %g2, [ %o0 + 0x48 ] Objects_Control *the_object, uint32_t name ) { /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; 40008d54: c0 22 20 0c clr [ %o0 + 0xc ] _Objects_Set_local_object( 40008d58: c6 12 20 0a lduh [ %o0 + 0xa ], %g3 * @param[in] information points to an Object Information Table * @param[in] the_object is a pointer to an object * @param[in] name is the name of the object to make accessible */ RTEMS_INLINE_ROUTINE void _Objects_Open_u32( Objects_Information *information, 40008d5c: ba 17 63 20 or %i5, 0x320, %i5 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 40008d60: c8 07 60 1c ld [ %i5 + 0x1c ], %g4 } ptimer->overrun = 0; 40008d64: c0 22 20 68 clr [ %o0 + 0x68 ] ptimer->timer_data.it_value.tv_sec = 0; 40008d68: c0 22 20 5c clr [ %o0 + 0x5c ] ptimer->timer_data.it_value.tv_nsec = 0; 40008d6c: c0 22 20 60 clr [ %o0 + 0x60 ] ptimer->timer_data.it_interval.tv_sec = 0; 40008d70: c0 22 20 54 clr [ %o0 + 0x54 ] ptimer->timer_data.it_interval.tv_nsec = 0; 40008d74: c0 22 20 58 clr [ %o0 + 0x58 ] Watchdog_Service_routine_entry routine, Objects_Id id, void *user_data ) { the_watchdog->state = WATCHDOG_INACTIVE; 40008d78: c0 22 20 18 clr [ %o0 + 0x18 ] the_watchdog->routine = routine; 40008d7c: c0 22 20 2c clr [ %o0 + 0x2c ] the_watchdog->id = id; 40008d80: c0 22 20 30 clr [ %o0 + 0x30 ] the_watchdog->user_data = user_data; 40008d84: c0 22 20 34 clr [ %o0 + 0x34 ] ) { /* ASSERT: information->is_string == false */ the_object->name.name_u32 = name; _Objects_Set_local_object( 40008d88: c4 02 20 08 ld [ %o0 + 8 ], %g2 #if defined(RTEMS_DEBUG) if ( index > information->maximum ) return; #endif information->local_table[ index ] = the_object; 40008d8c: 87 28 e0 02 sll %g3, 2, %g3 40008d90: d0 21 00 03 st %o0, [ %g4 + %g3 ] 40008d94: d0 00 60 d8 ld [ %g1 + 0xd8 ], %o0 _Watchdog_Initialize( &ptimer->Timer, NULL, 0, NULL ); _Objects_Open_u32(&_POSIX_Timer_Information, &ptimer->Object, 0); *timerid = ptimer->Object.id; 40008d98: c4 26 80 00 st %g2, [ %i2 ] 40008d9c: 40 00 05 b9 call 4000a480 <_API_Mutex_Unlock> 40008da0: b0 10 20 00 clr %i0 _Objects_Allocator_unlock(); return 0; } 40008da4: 81 c7 e0 08 ret 40008da8: 81 e8 00 00 restore =============================================================================== 40007118 : timer_t timerid, int flags, const struct itimerspec *__restrict value, struct itimerspec *__restrict ovalue ) { 40007118: 9d e3 bf 80 save %sp, -128, %sp Objects_Locations location; bool activated; uint32_t initial_period; struct itimerspec normalize; if ( !value ) 4000711c: 80 a6 a0 00 cmp %i2, 0 40007120: 02 80 00 84 be 40007330 <== NEVER TAKEN 40007124: a0 10 00 18 mov %i0, %l0 /* * 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) ) ) { 40007128: 40 00 10 3f call 4000b224 <_Timespec_Is_valid> 4000712c: 90 06 a0 08 add %i2, 8, %o0 40007130: 80 a2 20 00 cmp %o0, 0 40007134: 02 80 00 7f be 40007330 40007138: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( EINVAL ); } if ( !_Timespec_Is_valid( &(value->it_interval) ) ) { 4000713c: 40 00 10 3a call 4000b224 <_Timespec_Is_valid> 40007140: 90 10 00 1a mov %i2, %o0 40007144: 80 a2 20 00 cmp %o0, 0 40007148: 02 80 00 7a be 40007330 <== NEVER TAKEN 4000714c: 01 00 00 00 nop rtems_set_errno_and_return_minus_one( EINVAL ); } if ( flags != TIMER_ABSTIME && flags != POSIX_TIMER_RELATIVE ) { 40007150: b0 8e 7f fb andcc %i1, -5, %i0 40007154: 12 80 00 77 bne 40007330 40007158: 90 07 bf f0 add %fp, -16, %o0 rtems_set_errno_and_return_minus_one( EINVAL ); } normalize = *value; 4000715c: 92 10 00 1a mov %i2, %o1 40007160: 40 00 26 39 call 40010a44 40007164: 94 10 20 10 mov 0x10, %o2 /* Convert absolute to relative time */ if (flags == TIMER_ABSTIME) { 40007168: 80 a6 60 04 cmp %i1, 4 4000716c: 12 80 00 1f bne 400071e8 40007170: 11 10 00 67 sethi %hi(0x40019c00), %o0 ) { Timestamp_Control tod_as_timestamp; Timestamp_Control *tod_as_timestamp_ptr; tod_as_timestamp_ptr = 40007174: 90 07 bf e0 add %fp, -32, %o0 40007178: 13 10 00 67 sethi %hi(0x40019c00), %o1 4000717c: 40 00 06 41 call 40008a80 <_TOD_Get_with_nanoseconds> 40007180: 92 12 61 40 or %o1, 0x140, %o1 ! 40019d40 <_TOD> static inline void _TOD_Get( struct timespec *tod_as_timespec ) { Timestamp_Control tod_as_timestamp; Timestamp_Control *tod_as_timestamp_ptr; 40007184: 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); 40007188: 94 10 20 00 clr %o2 4000718c: 90 10 00 1c mov %i4, %o0 40007190: 92 10 00 1d mov %i5, %o1 40007194: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 40007198: 40 00 36 98 call 40014bf8 <__divdi3> 4000719c: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 400071a0: 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); 400071a4: d2 27 bf e8 st %o1, [ %fp + -24 ] _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 400071a8: 90 10 00 1c mov %i4, %o0 400071ac: 92 10 00 1d mov %i5, %o1 400071b0: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 400071b4: 40 00 37 83 call 40014fc0 <__moddi3> 400071b8: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 struct timespec now; _TOD_Get( &now ); /* Check for seconds in the past */ if ( _Timespec_Greater_than( &now, &normalize.it_value ) ) 400071bc: 90 07 bf f8 add %fp, -8, %o0 400071c0: d2 27 bf ec st %o1, [ %fp + -20 ] 400071c4: 40 00 10 2a call 4000b26c <_Timespec_Less_than> 400071c8: 92 07 bf e8 add %fp, -24, %o1 400071cc: 80 a2 20 00 cmp %o0, 0 400071d0: 12 80 00 58 bne 40007330 400071d4: 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 ); 400071d8: 90 07 bf e8 add %fp, -24, %o0 400071dc: 40 00 10 34 call 4000b2ac <_Timespec_Subtract> 400071e0: 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 *) 400071e4: 11 10 00 67 sethi %hi(0x40019c00), %o0 400071e8: 92 10 00 10 mov %l0, %o1 400071ec: 90 12 23 e4 or %o0, 0x3e4, %o0 400071f0: 40 00 09 04 call 40009600 <_Objects_Get> 400071f4: 94 07 bf e0 add %fp, -32, %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 ) { 400071f8: c2 07 bf e0 ld [ %fp + -32 ], %g1 400071fc: 80 a0 60 00 cmp %g1, 0 40007200: 12 80 00 4c bne 40007330 40007204: 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 ) { 40007208: c2 07 bf f8 ld [ %fp + -8 ], %g1 4000720c: 80 a0 60 00 cmp %g1, 0 40007210: 12 80 00 16 bne 40007268 40007214: ba 02 20 10 add %o0, 0x10, %i5 40007218: c2 07 bf fc ld [ %fp + -4 ], %g1 4000721c: 80 a0 60 00 cmp %g1, 0 40007220: 12 80 00 12 bne 40007268 40007224: 01 00 00 00 nop /* Stop the timer */ (void) _Watchdog_Remove( &ptimer->Timer ); 40007228: 40 00 11 36 call 4000b700 <_Watchdog_Remove> 4000722c: 90 10 00 1d mov %i5, %o0 /* The old data of the timer are returned */ if ( ovalue ) 40007230: 80 a6 e0 00 cmp %i3, 0 40007234: 02 80 00 06 be 4000724c 40007238: ba 06 60 54 add %i1, 0x54, %i5 *ovalue = ptimer->timer_data; 4000723c: 90 10 00 1b mov %i3, %o0 40007240: 92 10 00 1d mov %i5, %o1 40007244: 40 00 26 00 call 40010a44 40007248: 94 10 20 10 mov 0x10, %o2 /* The new data are set */ ptimer->timer_data = normalize; 4000724c: 90 10 00 1d mov %i5, %o0 40007250: 92 07 bf f0 add %fp, -16, %o1 40007254: 40 00 25 fc call 40010a44 40007258: 94 10 20 10 mov 0x10, %o2 /* Indicates that the timer is created and stopped */ ptimer->state = POSIX_TIMER_STATE_CREATE_STOP; 4000725c: 82 10 20 04 mov 4, %g1 40007260: 10 80 00 30 b 40007320 40007264: c2 2e 60 3c stb %g1, [ %i1 + 0x3c ] _Objects_Put( &ptimer->Object ); return 0; } /* Convert from seconds and nanoseconds to ticks */ ptimer->ticks = _Timespec_To_ticks( &value->it_interval ); 40007268: 40 00 10 22 call 4000b2f0 <_Timespec_To_ticks> 4000726c: 90 10 00 1a mov %i2, %o0 40007270: d0 26 60 64 st %o0, [ %i1 + 0x64 ] initial_period = _Timespec_To_ticks( &normalize.it_value ); 40007274: 40 00 10 1f call 4000b2f0 <_Timespec_To_ticks> 40007278: 90 07 bf f8 add %fp, -8, %o0 activated = _POSIX_Timer_Insert_helper( 4000727c: 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 ); 40007280: 92 10 00 08 mov %o0, %o1 activated = _POSIX_Timer_Insert_helper( 40007284: 17 10 00 1c sethi %hi(0x40007000), %o3 40007288: 90 10 00 1d mov %i5, %o0 4000728c: 96 12 e3 48 or %o3, 0x348, %o3 40007290: 40 00 18 db call 4000d5fc <_POSIX_Timer_Insert_helper> 40007294: 98 10 00 19 mov %i1, %o4 initial_period, ptimer->Object.id, _POSIX_Timer_TSR, ptimer ); if ( !activated ) { 40007298: 80 a2 20 00 cmp %o0, 0 4000729c: 02 80 00 21 be 40007320 400072a0: 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 ) 400072a4: 02 80 00 06 be 400072bc 400072a8: ba 06 60 54 add %i1, 0x54, %i5 *ovalue = ptimer->timer_data; 400072ac: 90 10 00 1b mov %i3, %o0 400072b0: 92 10 00 1d mov %i5, %o1 400072b4: 40 00 25 e4 call 40010a44 400072b8: 94 10 20 10 mov 0x10, %o2 ptimer->timer_data = normalize; 400072bc: 94 10 20 10 mov 0x10, %o2 400072c0: 90 10 00 1d mov %i5, %o0 400072c4: 40 00 25 e0 call 40010a44 400072c8: 92 07 bf f0 add %fp, -16, %o1 /* Indicate that the time is running */ ptimer->state = POSIX_TIMER_STATE_CREATE_RUN; 400072cc: 82 10 20 03 mov 3, %g1 tod_as_timestamp_ptr = 400072d0: 90 07 bf e8 add %fp, -24, %o0 400072d4: c2 2e 60 3c stb %g1, [ %i1 + 0x3c ] 400072d8: 13 10 00 67 sethi %hi(0x40019c00), %o1 400072dc: 40 00 05 e9 call 40008a80 <_TOD_Get_with_nanoseconds> 400072e0: 92 12 61 40 or %o1, 0x140, %o1 ! 40019d40 <_TOD> static inline void _TOD_Get( struct timespec *tod_as_timespec ) { Timestamp_Control tod_as_timestamp; Timestamp_Control *tod_as_timestamp_ptr; 400072e4: 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); 400072e8: 94 10 20 00 clr %o2 400072ec: 90 10 00 1c mov %i4, %o0 400072f0: 92 10 00 1d mov %i5, %o1 400072f4: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 400072f8: 40 00 36 40 call 40014bf8 <__divdi3> 400072fc: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 40007300: 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); 40007304: d2 26 60 6c st %o1, [ %i1 + 0x6c ] _timespec->tv_nsec = (long) (*_timestamp % 1000000000L); 40007308: 94 10 20 00 clr %o2 4000730c: 92 10 00 1d mov %i5, %o1 40007310: 17 0e e6 b2 sethi %hi(0x3b9ac800), %o3 40007314: 40 00 37 2b call 40014fc0 <__moddi3> 40007318: 96 12 e2 00 or %o3, 0x200, %o3 ! 3b9aca00 4000731c: d2 26 60 70 st %o1, [ %i1 + 0x70 ] RTEMS_INLINE_ROUTINE void _Objects_Put( Objects_Control *the_object ) { (void) the_object; _Thread_Enable_dispatch(); 40007320: 40 00 0c 09 call 4000a344 <_Thread_Enable_dispatch> 40007324: 01 00 00 00 nop _TOD_Get( &ptimer->time ); _Objects_Put( &ptimer->Object ); return 0; 40007328: 81 c7 e0 08 ret 4000732c: 81 e8 00 00 restore #endif case OBJECTS_ERROR: break; } rtems_set_errno_and_return_minus_one( EINVAL ); 40007330: 40 00 23 df call 400102ac <__errno> 40007334: b0 10 3f ff mov -1, %i0 40007338: 82 10 20 16 mov 0x16, %g1 4000733c: c2 22 00 00 st %g1, [ %o0 ] } 40007340: 81 c7 e0 08 ret 40007344: 81 e8 00 00 restore =============================================================================== 400073a8 : #include int wait( int *stat_loc ) { 400073a8: 9d e3 bf a0 save %sp, -96, %sp rtems_set_errno_and_return_minus_one( ENOSYS ); 400073ac: 40 00 23 83 call 400101b8 <__errno> 400073b0: b0 10 3f ff mov -1, %i0 400073b4: 82 10 20 58 mov 0x58, %g1 400073b8: c2 22 00 00 st %g1, [ %o0 ] } 400073bc: 81 c7 e0 08 ret 400073c0: 81 e8 00 00 restore